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