]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG1/AliGenInfoMaker.h
matching performance ITS-TPC-TRD class
[u/mrichter/AliRoot.git] / PWG1 / AliGenInfoMaker.h
1 #ifndef ALIGENINFOMAKER_H
2 #define ALIGENINFOMAKER_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                               */
5
6
7
8 //////////////////////////////////////////////////////////////////////////////
9 //                          Class AliGenInfoMaker                           //
10 //   collect together MC info for comparison purposes - effieciency studies and so on//                                                                 //
11 //   marian.ivanov@cern.ch                                                  //
12 //////////////////////////////////////////////////////////////////////////////
13
14
15
16
17 #include <TParticle.h>
18 #include "AliAnalysisTask.h"
19 #include "AliTrackReference.h"
20
21 class TFile;
22 class AliRunLoader;
23 class AliStack;
24 class AliTPCParam;
25 class AliMCEventHandler;
26 class AliMCInfo;
27
28 ////////////////////////////////////////////////////////////////////////
29 // 
30 // Start of implementation of the class AliGenInfoMaker
31 //
32 ////////////////////////////////////////////////////////////////////////
33
34 class AliGenInfoMaker : public TObject {
35
36 public:
37   AliGenInfoMaker();
38   virtual ~AliGenInfoMaker();
39   // 
40   //
41   AliGenInfoMaker(const char * fnGalice, const char* fnRes,
42                    Int_t nEvents=1, Int_t firstEvent=0);
43   //event by event function - used in the analysis task
44   Int_t ProcessEvent(AliMCEventHandler* mcinfo);
45
46   Int_t ProcessEvent();   // process event
47   Int_t TreeKLoop();      // process kinamatics
48   Int_t TreeTRLoop();     // process track refereces
49   Int_t TreeDLoop();      // process digits tree
50   Int_t BuildKinkInfo();  // build information about MC kinks
51   Int_t BuildV0Info();    // build information about MC kinks
52   //
53   //
54   Int_t Exec();  
55   void CreateTreeGenTracks();
56   void CloseOutputFile();
57   void SetFirstEventNr(Int_t i) {fFirstEventNr = i;}
58   void SetNEvents(Int_t i) {fNEvents = i;}
59   void SetDebug(Int_t level) {fDebug = level;}
60   Int_t SetIO(Int_t eventNr);
61   Int_t CloseIOEvent();
62   Int_t CloseIO();
63   Int_t SetIO();
64
65 protected:
66   AliGenInfoMaker(const AliGenInfoMaker& /*info*/);
67   AliGenInfoMaker& operator=(const AliGenInfoMaker& /*info*/) { return *this;}
68
69   AliMCInfo * MakeInfo(UInt_t i);
70   AliMCInfo * GetInfo(UInt_t i) const {return (i<fNParticles)? fGenInfo[i]:0;}
71   Float_t TR2LocalX(AliTrackReference *trackRef,
72                     AliTPCParam *paramTPC) const;
73   AliTPCParam * GetTPCParam();
74   //
75   TObjArray *fGenTracksArray;  //clones array with filtered particles
76   TObjArray *fGenKinkArray;    //clones array with filtered Kinks
77   TObjArray *fGenV0Array;      //clones array with filtered V0s
78   //
79   Int_t  fDebug;                   //! debug flag  
80   Int_t  fEventNr;                 //! current event number
81   Int_t  fLabel;                   //! track label
82   Int_t  fNEvents;                 //! number of events to process
83   Int_t  fFirstEventNr;            //! first event to process
84   UInt_t fNParticles;              //! number of particles in TreeK
85   TTree *fTreeGenTracks;          //! output tree with generated tracks
86   TTree *fTreeKinks;             //!  output tree with Kinks
87   TTree *fTreeV0;                //!  output tree with V0
88   char   fFnRes[1000];             //! output file name with stored tracks
89   TFile *fFileGenTracks;          //! output file with stored fTreeGenTracks
90   //
91   AliRunLoader * fLoader;         //! pointer to the run loader
92   TTree * fTreeD;                 //! current tree with digits
93   TTree * fTreeTR;                //! current tree with TR
94   AliStack *fStack;               //! current stack
95   // 
96   AliMCInfo **   fGenInfo;    //! array with pointers to gen info
97   Int_t   fNInfos;                  //! number of tracks with infos
98   //
99   AliTPCParam* fParamTPC;         //! AliTPCParam
100   Float_t  fVPrim[3];             //! primary vertex position                                  // the fVDist[3] contains size of the 3-vector
101   // cuts
102   //
103   Double_t fTPCPtCut; // do not store particles with generated pT less than this
104   Double_t fITSPtCut; // do not store particles with generated pT less than this
105   Double_t fTRDPtCut; // do not store particles with generated pT less than this
106   Double_t fTOFPtCut; // do not store particles with generated pT less than this
107  
108   ClassDef(AliGenInfoMaker,0)    // class which creates and fills tree with TPCGenTrack objects
109 };
110
111
112
113
114
115
116 #endif