bugfix: use time, when looking for next cluster, exception: kIdealTracking
[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;
10class AliTPCSpaceCharge3D;
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 };
31
de0014b7 32 AliToyMCEventGenerator();
33 AliToyMCEventGenerator(const AliToyMCEventGenerator &gen);
34 virtual ~AliToyMCEventGenerator();
35
36 virtual AliToyMCEvent* Generate(Double_t time) = 0;
37
bfad2b05 38 Bool_t DistortTrack(AliToyMCTrack &trackIn, Double_t t0=0);
32438f4e 39 void CreateSpacePoints(AliToyMCTrack &trackIn,
40 AliTrackPointArray &arrUdist,
41 AliTrackPointArray &arrDist);
42 void SetPoint(Float_t xyz[3], AliTrackPoint &point);
43 void ConvertTrackPointsToLocalClusters(AliTrackPointArray &arrPoints, AliToyMCTrack &tr, Double_t t0, Int_t type);
44 Bool_t SetupCluster(AliTPCclusterMI &tempCl, Float_t xyz[3], Int_t sec, Double_t t0);
45
a1a695e5 46 void SetOutputFileName(const char* file) { fOutputFileName=file; }
47 const char* GetOutputFileName() const { return fOutputFileName.Data(); }
32438f4e 48
cd8ed0ac 49 void SetSpaceCharge(EEpsilon epsilon, EGasType gasType=kNeCO2_9010, ECollRate collRate=k50kHz);
50 void SetSpaceChargeFile(const char* file) { fSpaceChargeFile=file; }
51
32438f4e 52 Int_t GetSector(Float_t xyz[3]);
d92b8630 53
54 void InitSpaceCharge();
55
d1cf83f5 56 void SetStepCorrection(Bool_t step=kTRUE) { fUseStepCorrection=step; }
57 Bool_t GetStepCorrection() const { return fUseStepCorrection; }
58
59 void SetUseMaterialBudget(Bool_t use) { fUseMaterialBudget=use; }
60 Bool_t GetUseMaterialBudget() const { return fUseMaterialBudget; }
32438f4e 61
de0014b7 62 protected:
63 AliTPCParam *fTPCParam;
a1a695e5 64 AliToyMCEvent *fEvent;
65
66 Bool_t ConnectOutputFile();
67 Bool_t CloseOutputFile();
68 void FillTree();
cd8ed0ac 69
de0014b7 70
71 private:
a1a695e5 72 AliToyMCEventGenerator& operator= (const AliToyMCEventGenerator& );
73
de0014b7 74 AliTPCSpaceCharge3D *fSpaceCharge;
a1a695e5 75
cd8ed0ac 76 TString fSpaceChargeFile;
a1a695e5 77 TString fOutputFileName;
78 TFile *fOutFile;
79 TTree *fOutTree;
d92b8630 80
81 Bool_t fUseStepCorrection;
d1cf83f5 82 Bool_t fUseMaterialBudget;
de0014b7 83
84 ClassDef(AliToyMCEventGenerator, 1)
85
86};
87
88#endif
89