1 #ifndef AliToyMCEventGenerator_H
2 #define AliToyMCEventGenerator_H
11 class AliTPCCorrection;
12 class AliTrackPointArray;
14 class AliTPCclusterMI;
19 class AliToyMCEventGenerator : public TObject {
45 AliToyMCEventGenerator();
46 AliToyMCEventGenerator(const AliToyMCEventGenerator &gen);
47 virtual ~AliToyMCEventGenerator();
49 virtual AliToyMCEvent* Generate(Double_t time) = 0;
51 Bool_t DistortTrack(AliToyMCTrack &trackIn, Double_t t0=0);
52 void MakeITSClusters(AliToyMCTrack &trackIn/*, Double_t t0*/);
53 void MakeTRDClusters(AliToyMCTrack &trackIn/*, Double_t t0*/);
54 void MakeTPCClusters(AliToyMCTrack &trackIn, Double_t t0);
55 void CreateSpacePoints(AliToyMCTrack &trackIn,
56 AliTrackPointArray &arrUdist,
57 AliTrackPointArray &arrDist);
58 void SetPoint(Float_t xyz[3], Float_t sigmaY, Float_t sigmaZ, AliTrackPoint &point);
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);
62 void SetOutputFileName(const char* file) { fOutputFileName=file; }
63 const char* GetOutputFileName() const { return fOutputFileName.Data(); }
65 void SetSpaceCharge(EEpsilon epsilon, EGasType gasType=kNeCO2_9010, ECollRate collRate=k50kHz, ECorrection corrType=kLookup);
66 void SetSpaceChargeFile(const char* file) { fCorrectionFile=file; }
68 Int_t GetSector(Float_t xyz[3]);
70 void InitSpaceCharge();
72 void SetStepCorrection(Bool_t step=kTRUE) { fUseStepCorrection=step; }
73 Bool_t GetStepCorrection() const { return fUseStepCorrection; }
75 void SetUseMaterialBudget(Bool_t use) { fUseMaterialBudget=use; }
76 Bool_t GetUseMaterialBudget() const { return fUseMaterialBudget; }
78 void SetIsLaser(Bool_t use) { fIsLaser=use; }
79 Bool_t GetIsLaser() const { return fIsLaser; }
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(); }
87 void SetCalculateScaling(Bool_t val) { fCalculateScaling = val; }
88 Bool_t GetCalculateScaling() const { return fCalculateScaling; }
90 static Float_t GetSCScalingFactor(AliTPCCorrection *corr, AliTPCCorrection *averageCorr, Float_t &chi2);
91 static void SetCorrectionFromFile(TString file, AliTPCCorrection* &corr);
94 AliTPCParam *fTPCParam; //! TPC params
95 AliToyMCEvent *fEvent; //! Toy event
97 Bool_t ConnectOutputFile();
98 Bool_t CloseOutputFile();
100 void IterateSC(Int_t ipos=-1);
101 void SetSCScalingFactor();
103 UInt_t fCurrentTrack; // unique track id within the current event generation
107 AliToyMCEventGenerator& operator= (const AliToyMCEventGenerator& );
109 AliTPCCorrection *fTPCCorrection; //! distortion correction
110 AliTPCCorrection *fTPCCorrectionAv; //! average distortion correction
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
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
123 Bool_t fCalculateScaling; // calculate scaling factor
125 void InitSpaceChargeList();
127 ClassDef(AliToyMCEventGenerator, 2)