adding next sector check (to be improved)
[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;
8
9class AliTPCParam;
223d9e38 10class AliTPCCorrection;
32438f4e 11class AliTrackPointArray;
a1a695e5 12
13class AliToyMCTrack;
14class AliToyMCEvent;
de0014b7 15
de0014b7 16class AliToyMCEventGenerator : public TObject {
17 public:
cd8ed0ac 18 enum EGasType {
19 kNeCO2_9010=0
20 };
21
22 enum EEpsilon {
23 kEps5=0,
24 kEps10,
25 kEps20
26 };
27
28 enum ECollRate {
29 k50kHz = 0
30 };
223d9e38 31
32 enum ECorrection {
33 kLookup=0,
34 kSpaceChargeFile
35 };
cd8ed0ac 36
de0014b7 37 AliToyMCEventGenerator();
38 AliToyMCEventGenerator(const AliToyMCEventGenerator &gen);
39 virtual ~AliToyMCEventGenerator();
40
41 virtual AliToyMCEvent* Generate(Double_t time) = 0;
42
bfad2b05 43 Bool_t DistortTrack(AliToyMCTrack &trackIn, Double_t t0=0);
1e62e876 44 void MakeITSClusters(AliToyMCTrack &trackIn/*, Double_t t0*/);
45 void MakeTRDClusters(AliToyMCTrack &trackIn/*, Double_t t0*/);
46 void MakeTPCClusters(AliToyMCTrack &trackIn, Double_t t0);
32438f4e 47 void CreateSpacePoints(AliToyMCTrack &trackIn,
48 AliTrackPointArray &arrUdist,
49 AliTrackPointArray &arrDist);
50 void SetPoint(Float_t xyz[3], AliTrackPoint &point);
51 void ConvertTrackPointsToLocalClusters(AliTrackPointArray &arrPoints, AliToyMCTrack &tr, Double_t t0, Int_t type);
52 Bool_t SetupCluster(AliTPCclusterMI &tempCl, Float_t xyz[3], Int_t sec, Double_t t0);
53
a1a695e5 54 void SetOutputFileName(const char* file) { fOutputFileName=file; }
55 const char* GetOutputFileName() const { return fOutputFileName.Data(); }
32438f4e 56
223d9e38 57 void SetSpaceCharge(EEpsilon epsilon, EGasType gasType=kNeCO2_9010, ECollRate collRate=k50kHz, ECorrection corrType=kLookup);
58 void SetSpaceChargeFile(const char* file) { fCorrectionFile=file; }
cd8ed0ac 59
32438f4e 60 Int_t GetSector(Float_t xyz[3]);
d92b8630 61
62 void InitSpaceCharge();
63
d1cf83f5 64 void SetStepCorrection(Bool_t step=kTRUE) { fUseStepCorrection=step; }
65 Bool_t GetStepCorrection() const { return fUseStepCorrection; }
66
67 void SetUseMaterialBudget(Bool_t use) { fUseMaterialBudget=use; }
68 Bool_t GetUseMaterialBudget() const { return fUseMaterialBudget; }
32438f4e 69
de0014b7 70 protected:
71 AliTPCParam *fTPCParam;
a1a695e5 72 AliToyMCEvent *fEvent;
73
74 Bool_t ConnectOutputFile();
75 Bool_t CloseOutputFile();
76 void FillTree();
cd8ed0ac 77
223d9e38 78 UInt_t fCurrentTrack; // unique track id within the current event generation
79
de0014b7 80
81 private:
a1a695e5 82 AliToyMCEventGenerator& operator= (const AliToyMCEventGenerator& );
83
223d9e38 84 AliTPCCorrection *fTPCCorrection;
a1a695e5 85
223d9e38 86 TString fCorrectionFile;
a1a695e5 87 TString fOutputFileName;
88 TFile *fOutFile;
89 TTree *fOutTree;
d92b8630 90
91 Bool_t fUseStepCorrection;
d1cf83f5 92 Bool_t fUseMaterialBudget;
de0014b7 93
94 ClassDef(AliToyMCEventGenerator, 1)
95
96};
97
98#endif
99