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 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 { return std::make_shared<TTdrEvent>(); }
55#endif
56
57protected:
58 std::ifstream fInputFile;
59 /// \cond CLASSIMP
60 ClassDefOverride(TTdrFile, 0) // Used to open and write Midas Files
61 /// \endcond
62};
63/*! @} */
64#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:116
void Close() override
Close input file.
Definition TTdrFile.cxx:107
std::string Status(bool long_file_description=true) override
Definition TTdrFile.cxx:51
bool Open(const char *filename) override
Open input file.
Definition TTdrFile.cxx:61
std::shared_ptr< TRawEvent > NewEvent() override
Definition TTdrFile.h:54
std::ifstream fInputFile
Definition TTdrFile.h:58
TTdrFile()
default constructor
Definition TTdrFile.cxx:29
int GetRunNumber() override
Definition TTdrFile.cxx:168
int GetSubRunNumber() override
Definition TTdrFile.cxx:200
void Skip(size_t nofEvents) override
Skip nofEvents from the file.
Definition TTdrFile.cxx:154
~TTdrFile() override
destructor
Definition TTdrFile.cxx:45