GRSISort "v4.0.0.5"
An extension of the ROOT analysis Framework
Loading...
Searching...
No Matches
TTdrFile.h
Go to the documentation of this file.
1#ifndef TTDRFILE_H
2#define TTDRFILE_H
3
4/** \addtogroup Sorting
5 * @{
6 */
7
8/////////////////////////////////////////////////////////////////
9///
10/// \class TTdrFile
11///
12/// This Class is used to read and write TDR files in the
13/// root framework.
14///
15/////////////////////////////////////////////////////////////////
16
17#include <string>
18#include <fstream>
19
20#ifdef __APPLE__
21#include <_types/_uint32_t.h>
22#else
23#include <cstdint>
24#endif
25
26#include "TRawFile.h"
27
28#include "TTdrEvent.h"
29
30/// Reader for MIDAS .mid files
31
32class TTdrFile : public TRawFile {
33public:
34 TTdrFile() = default; ///< default constructor
35 TTdrFile(const char* filename, TRawFile::EOpenType open_type = TRawFile::EOpenType::kRead);
36 ~TTdrFile() override; ///< destructor
37
38 bool Open(const char* filename) override; ///< Open input file
39
40 void Close() override; ///< Close input file
41
42 using TObject::Read;
43 using TObject::Write;
44#ifndef __CINT__
45 int Read(std::shared_ptr<TRawEvent> lstEvent) override; ///< Read one event from the file
46#endif
47 void Skip(size_t nofEvents) override; ///< Skip nofEvents from the file
48 std::string Status(bool long_file_description = true) override;
49
50 int GetRunNumber() override;
51 int GetSubRunNumber() override;
52
53#ifndef __CINT__
54 std::shared_ptr<TRawEvent> NewEvent() override
55 {
56 return std::make_shared<TTdrEvent>();
57 }
58#endif
59
60protected:
61 std::ifstream fInputFile;
62 /// \cond CLASSIMP
63 ClassDefOverride(TTdrFile, 0) // Used to open and write Midas Files
64 /// \endcond
65};
66/*! @} */
67#endif // TTdrFile.h
Reader for raw files.
Definition TRawFile.h:31
Reader for MIDAS .mid files.
Definition TTdrFile.h:32
int Read(std::shared_ptr< TRawEvent > lstEvent) override
Read one event from the file.
Definition TTdrFile.cxx:105
void Close() override
Close input file.
Definition TTdrFile.cxx:96
std::string Status(bool long_file_description=true) override
Definition TTdrFile.cxx:40
bool Open(const char *filename) override
Open input file.
Definition TTdrFile.cxx:50
std::shared_ptr< TRawEvent > NewEvent() override
Definition TTdrFile.h:54
std::ifstream fInputFile
Definition TTdrFile.h:61
int GetRunNumber() override
Definition TTdrFile.cxx:157
int GetSubRunNumber() override
Definition TTdrFile.cxx:189
void Skip(size_t nofEvents) override
Skip nofEvents from the file.
Definition TTdrFile.cxx:143
~TTdrFile() override
destructor
Definition TTdrFile.cxx:34
TTdrFile()=default
default constructor