]>
Commit | Line | Data |
---|---|---|
dd2b6810 | 1 | #ifndef ALIREADERAOD_H |
2 | #define ALIREADERAOD_H | |
cd319790 | 3 | //______________________________________________________________________________ |
4 | //////////////////////////////////////////////////////////////////////////////// | |
5 | // // | |
6 | // class AliReaderAOD // | |
7 | // // | |
8 | // Reader and Writer for AOD format. // | |
9 | // AODs are stored in a tree named by the variable fgkTreeName. // | |
10 | // There is stored 1 or 2 branches. Each of them stores AOD objects // | |
11 | // First branch is named by the variable fgkReconstructedDataBranchName // | |
12 | // ("reconstructed.") and keeps reconstructed data. // | |
13 | // Second branch is called by the variable fgkSimulatedDataBranchName // | |
14 | // ("simulated.") and stores Monte carlo truth. If both branches are present // | |
15 | // AODs are parallel, i.e. nth particle in one branch corresponds to the nth // | |
16 | // particle in the other one. // | |
17 | // // | |
18 | // Since we accept different formats of particles that are stored in AODs // | |
19 | // reader must take care of that fact: clean buffer if the next file contains // | |
20 | // different particle type. // | |
21 | // // | |
22 | // If no cuts are specified in a reader, it reuturns pointer to the // | |
23 | // buffers. In the other case data are copied to the onother AOD (filtering // | |
24 | // out particles that do not pass a cut), thus reading is slower. // | |
25 | // // | |
26 | // Piotr.Skowronski@cern.ch // | |
27 | // // | |
28 | //////////////////////////////////////////////////////////////////////////////// | |
29 | ||
30 | ||
dd2b6810 | 31 | |
32 | #include "AliReader.h" | |
33 | ||
efdb0cc9 | 34 | class TTree; |
35 | class TFile; | |
36 | ||
dd2b6810 | 37 | class AliReaderAOD: public AliReader |
38 | { | |
39 | public: | |
efdb0cc9 | 40 | AliReaderAOD(const Char_t* aodfilename = "AOD.root"); |
41 | virtual ~AliReaderAOD(); | |
dd2b6810 | 42 | |
43 | void ReadSimulatedData(Bool_t flag){fReadSim = flag;}//switches reading MC data | |
cd319790 | 44 | void ReadReconsructedData(Bool_t flag){fReadRec = flag;}//switches reading MC data |
45 | Bool_t ReadsRec() const {return fReadRec;} | |
dd2b6810 | 46 | Bool_t ReadsSim() const {return fReadSim;} |
47 | ||
efdb0cc9 | 48 | void Rewind(); |
49 | ||
dd2b6810 | 50 | |
beb1c41d | 51 | static Int_t WriteAOD(AliReader* reader, const char* outfilename = "AliAOD.root", //reads tracks from runs and writes them to file |
52 | const char* pclassname = "AliAODParticle", Bool_t multcheck = kFALSE); | |
dd2b6810 | 53 | |
54 | protected: | |
efdb0cc9 | 55 | virtual Int_t ReadNext(); |
cd319790 | 56 | virtual Int_t OpenFile(Int_t evno);//opens files to be read for given event |
57 | ||
58 | virtual Int_t ReadRecAndSim(); | |
59 | virtual Int_t ReadRec(); | |
60 | virtual Int_t ReadSim(); | |
61 | ||
efdb0cc9 | 62 | static const TString fgkTreeName;//name of branch holding simulated data |
cd319790 | 63 | static const TString fgkReconstructedDataBranchName;//name of branch holding reconstructed data |
efdb0cc9 | 64 | static const TString fgkSimulatedDataBranchName;//name of branch holding simulated data |
65 | ||
66 | ||
dd2b6810 | 67 | private: |
68 | TString fFileName;//File name | |
69 | ||
70 | Bool_t fReadSim;//indicates if to read simulated data | |
cd319790 | 71 | Bool_t fReadRec;//indicates if to read simulated data |
efdb0cc9 | 72 | |
73 | TTree* fTree;//!tree | |
74 | TFile* fFile;//!file | |
75 | AliAOD* fSimBuffer;//!buffer array that tree is read to | |
76 | AliAOD* fRecBuffer;//! | |
77 | ||
62411bd0 | 78 | AliReaderAOD(const AliReaderAOD&); // Not implemented |
79 | AliReaderAOD& operator=(const AliReaderAOD&); // Not implemented | |
efdb0cc9 | 80 | |
dd2b6810 | 81 | ClassDef(AliReaderAOD,1) |
82 | }; | |
83 | ||
84 | #endif |