o small mods
[u/mrichter/AliRoot.git] / TPC / Upgrade / 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;
a1a695e5 13
14class AliToyMCTrack;
15class AliToyMCEvent;
de0014b7 16
de0014b7 17class AliToyMCEventGenerator : public TObject {
18 public:
cd8ed0ac 19 enum EGasType {
d5715c32 20 kNeCO2_9010=0,
21 kNeCO2N2_90105
22 };
cd8ed0ac 23
24 enum EEpsilon {
25 kEps5=0,
26 kEps10,
d5715c32 27 kEps20,
28 kEps25,
29 kEps30,
30 kEps35,
31 kEps40
cd8ed0ac 32 };
33
34 enum ECollRate {
35 k50kHz = 0
36 };
223d9e38 37
38 enum ECorrection {
39 kLookup=0,
40 kSpaceChargeFile
41 };
cd8ed0ac 42
de0014b7 43 AliToyMCEventGenerator();
44 AliToyMCEventGenerator(const AliToyMCEventGenerator &gen);
45 virtual ~AliToyMCEventGenerator();
46
47 virtual AliToyMCEvent* Generate(Double_t time) = 0;
48
bfad2b05 49 Bool_t DistortTrack(AliToyMCTrack &trackIn, Double_t t0=0);
1e62e876 50 void MakeITSClusters(AliToyMCTrack &trackIn/*, Double_t t0*/);
51 void MakeTRDClusters(AliToyMCTrack &trackIn/*, Double_t t0*/);
52 void MakeTPCClusters(AliToyMCTrack &trackIn, Double_t t0);
32438f4e 53 void CreateSpacePoints(AliToyMCTrack &trackIn,
54 AliTrackPointArray &arrUdist,
55 AliTrackPointArray &arrDist);
e83fd282 56 void SetPoint(Float_t xyz[3], Float_t sigmaY, Float_t sigmaZ, AliTrackPoint &point);
32438f4e 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
a1a695e5 60 void SetOutputFileName(const char* file) { fOutputFileName=file; }
61 const char* GetOutputFileName() const { return fOutputFileName.Data(); }
32438f4e 62
223d9e38 63 void SetSpaceCharge(EEpsilon epsilon, EGasType gasType=kNeCO2_9010, ECollRate collRate=k50kHz, ECorrection corrType=kLookup);
64 void SetSpaceChargeFile(const char* file) { fCorrectionFile=file; }
cd8ed0ac 65
32438f4e 66 Int_t GetSector(Float_t xyz[3]);
d92b8630 67
68 void InitSpaceCharge();
69
d1cf83f5 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; }
0403120d 75
76 void SetIsLaser(Bool_t use) { fIsLaser=use; }
77 Bool_t GetIsLaser() const { return fIsLaser; }
2dd02504 78
f77d3124 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 !fSCListFile.IsNull(); }
862220e2 84
85 static Float_t GetSCScalingFactor(AliTPCCorrection *corr, AliTPCCorrection *averageCorr, Float_t &chi2);
e2cfbac8 86 static void SetCorrectionFromFile(TString file, AliTPCCorrection* &corr);
32438f4e 87
de0014b7 88 protected:
2dd02504 89 AliTPCParam *fTPCParam; //! TPC params
90 AliToyMCEvent *fEvent; //! Toy event
a1a695e5 91
92 Bool_t ConnectOutputFile();
93 Bool_t CloseOutputFile();
94 void FillTree();
2dd02504 95 void IterateSC(Int_t ipos=-1);
edac2b83 96 void SetSCScalingFactor();
97
223d9e38 98 UInt_t fCurrentTrack; // unique track id within the current event generation
99
de0014b7 100
101 private:
a1a695e5 102 AliToyMCEventGenerator& operator= (const AliToyMCEventGenerator& );
103
2dd02504 104 AliTPCCorrection *fTPCCorrection; //! distortion correction
862220e2 105 AliTPCCorrection *fTPCCorrectionAv; //! average distortion correction
106
2dd02504 107 TObjArray *fSCList; //! list with
108 TString fSCListFile; // file with a list of space charge files
109 TString fCorrectionFile; // name of a sinfle SC file
110 TString fOutputFileName; // name of the output file
111 TFile *fOutFile; //! output file
112 TTree *fOutTree; //! output tree
a1a695e5 113
2dd02504 114 Bool_t fUseStepCorrection; // use integralDz method?
115 Bool_t fUseMaterialBudget; // use material budget in tracking?
116 Bool_t fIsLaser; // is a laser event?
117 Bool_t fPrereadSCList; // preread all SC files from the SC list
d92b8630 118
2dd02504 119 void InitSpaceChargeList();
de0014b7 120
121 ClassDef(AliToyMCEventGenerator, 1)
2dd02504 122
de0014b7 123};
124
125#endif
126