3 //______________________________________________________________________________
4 ////////////////////////////////////////////////////////////////////////////////
6 // class AliReaderAOD //
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. //
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. //
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. //
26 // Piotr.Skowronski@cern.ch //
28 ////////////////////////////////////////////////////////////////////////////////
32 #include "AliReader.h"
37 class AliReaderAOD: public AliReader
40 AliReaderAOD(const Char_t* aodfilename = "AOD.root");
41 virtual ~AliReaderAOD();
43 void ReadSimulatedData(Bool_t flag){fReadSim = flag;}//switches reading MC data
44 void ReadReconsructedData(Bool_t flag){fReadRec = flag;}//switches reading MC data
45 Bool_t ReadsRec() const {return fReadRec;}
46 Bool_t ReadsSim() const {return fReadSim;}
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);
55 virtual Int_t ReadNext();
56 virtual Int_t OpenFile(Int_t evno);//opens files to be read for given event
58 virtual Int_t ReadRecAndSim();
59 virtual Int_t ReadRec();
60 virtual Int_t ReadSim();
62 static const TString fgkTreeName;//name of branch holding simulated data
63 static const TString fgkReconstructedDataBranchName;//name of branch holding reconstructed data
64 static const TString fgkSimulatedDataBranchName;//name of branch holding simulated data
68 TString fFileName;//File name
70 Bool_t fReadSim;//indicates if to read simulated data
71 Bool_t fReadRec;//indicates if to read simulated data
75 AliAOD* fSimBuffer;//!buffer array that tree is read to
76 AliAOD* fRecBuffer;//!
78 AliReaderAOD(const AliReaderAOD&); // Not implemented
79 AliReaderAOD& operator=(const AliReaderAOD&); // Not implemented
81 ClassDef(AliReaderAOD,1)