]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TPC/Upgrade/AliToyMCEventGenerator.h
o add usage of SC lists
[u/mrichter/AliRoot.git] / TPC / Upgrade / AliToyMCEventGenerator.h
1 #ifndef AliToyMCEventGenerator_H
2 #define AliToyMCEventGenerator_H
3
4 #include <TString.h>
5
6 class TFile;
7 class TTree;
8 class TObjArray;
9
10 class AliTPCParam;
11 class AliTPCCorrection;
12 class AliTrackPointArray;
13
14 class AliToyMCTrack;
15 class AliToyMCEvent;
16
17 class AliToyMCEventGenerator : public TObject {
18  public:
19    enum EGasType {
20      kNeCO2_9010=0,
21      kNeCO2N2_90105
22    };
23
24   enum EEpsilon {
25     kEps5=0,
26     kEps10,
27     kEps20,
28     kEps25,
29     kEps30,
30     kEps35,
31     kEps40
32   };
33
34   enum ECollRate {
35     k50kHz = 0
36   };
37
38   enum ECorrection {
39     kLookup=0,
40     kSpaceChargeFile
41   };
42   
43   AliToyMCEventGenerator();
44   AliToyMCEventGenerator(const AliToyMCEventGenerator &gen);
45   virtual ~AliToyMCEventGenerator();
46
47   virtual AliToyMCEvent* Generate(Double_t time) = 0;
48
49   Bool_t DistortTrack(AliToyMCTrack &trackIn, Double_t t0=0);
50   void MakeITSClusters(AliToyMCTrack &trackIn/*, Double_t t0*/);
51   void MakeTRDClusters(AliToyMCTrack &trackIn/*, Double_t t0*/);
52   void MakeTPCClusters(AliToyMCTrack &trackIn, Double_t t0);
53   void CreateSpacePoints(AliToyMCTrack &trackIn,
54                         AliTrackPointArray &arrUdist,
55                         AliTrackPointArray &arrDist);
56   void SetPoint(Float_t xyz[3], Float_t sigmaY, Float_t sigmaZ, AliTrackPoint &point);
57   void ConvertTrackPointsToLocalClusters(AliTrackPointArray &arrPoints, AliToyMCTrack &tr, Double_t t0, Int_t type);
58   Bool_t SetupCluster(AliTPCclusterMI &tempCl, Float_t xyz[3], Int_t sec, Double_t t0);
59   
60   void SetOutputFileName(const char* file) { fOutputFileName=file; }
61   const char* GetOutputFileName()    const { return fOutputFileName.Data(); }
62
63   void SetSpaceCharge(EEpsilon epsilon, EGasType gasType=kNeCO2_9010, ECollRate collRate=k50kHz, ECorrection corrType=kLookup);
64   void SetSpaceChargeFile(const char* file) { fCorrectionFile=file; }
65   
66   Int_t GetSector(Float_t xyz[3]);
67
68   void InitSpaceCharge();
69
70   void SetStepCorrection(Bool_t step=kTRUE) { fUseStepCorrection=step;   }
71   Bool_t GetStepCorrection() const          { return fUseStepCorrection; }
72
73   void SetUseMaterialBudget(Bool_t use) { fUseMaterialBudget=use;    }
74   Bool_t GetUseMaterialBudget() const   { return fUseMaterialBudget; }
75
76   void SetIsLaser(Bool_t use) { fIsLaser=use;    }
77   Bool_t GetIsLaser() const   { return fIsLaser; }
78
79   void   SetSCListFile(const char* file) { fSCListFile=file;          }
80   const char* GetSCListFile() const      { return fSCListFile.Data(); }
81   void   SetPrereadSCList(Bool_t b)      { fPrereadSCList=b;          }
82   Bool_t GetPrereadSCList() const        { return fPrereadSCList;     }
83   Bool_t HasSCList() const               { return  fSCList!=0x0;      }
84   
85  protected:
86   AliTPCParam *fTPCParam;                //! TPC params
87   AliToyMCEvent *fEvent;                 //! Toy event
88   
89   Bool_t ConnectOutputFile();
90   Bool_t CloseOutputFile();
91   void FillTree();
92   void IterateSC(Int_t ipos=-1);
93
94   UInt_t fCurrentTrack;                  // unique track id within the current event generation
95
96   
97  private:
98   AliToyMCEventGenerator& operator= (const AliToyMCEventGenerator& );
99    
100   AliTPCCorrection *fTPCCorrection;      //! distortion correction
101
102   TObjArray   *fSCList;                  //! list with
103   TString fSCListFile;                   // file with a list of space charge files
104   TString fCorrectionFile;               // name of a sinfle SC file
105   TString fOutputFileName;               // name of the output file
106   TFile   *fOutFile;                     //! output file
107   TTree   *fOutTree;                     //! output tree
108
109   Bool_t fUseStepCorrection;             // use integralDz method?
110   Bool_t fUseMaterialBudget;             // use material budget in tracking?
111   Bool_t fIsLaser;                       // is a laser event?
112   Bool_t fPrereadSCList;                 // preread all SC files from the SC list
113
114   void InitSpaceChargeList();
115   
116   ClassDef(AliToyMCEventGenerator, 1)
117   
118 };
119
120 #endif
121