]>
Commit | Line | Data |
---|---|---|
344100c4 | 1 | #ifndef ALICONVEVENTCUTS_H |
2 | #define ALICONVEVENTCUTS_H | |
3 | ||
4 | // Class handling all kinds of selection cuts for Gamma Conversion analysis | |
5 | // Authors: Svein Lindal, Daniel Lohner * | |
6 | ||
7 | #include "AliAODTrack.h" | |
8 | #include "AliESDtrack.h" | |
9 | #include "AliVEvent.h" | |
10 | #include "AliMCEvent.h" | |
11 | #include "AliVTrack.h" | |
12 | #include "AliStack.h" | |
13 | #include "AliAnalysisCuts.h" | |
14 | #include "TH1F.h" | |
15 | #include "TF1.h" | |
16 | #include "AliAnalysisUtils.h" | |
17 | #include "AliAnalysisManager.h" | |
18 | #include "TRandom3.h" | |
19 | ||
20 | class AliESDEvent; | |
21 | class AliAODEvent; | |
22 | class TH1F; | |
23 | class TH2F; | |
24 | class TF1; | |
25 | class AliAnalysisCuts; | |
26 | class iostream; | |
27 | class TList; | |
28 | class AliAnalysisManager; | |
29 | class AliAODMCParticle; | |
30 | ||
31 | using namespace std; | |
32 | ||
33 | class AliConvEventCuts : public AliAnalysisCuts { | |
34 | ||
35 | public: | |
36 | enum cutIds { | |
37 | kisHeavyIon, | |
38 | kCentralityMin, | |
39 | kCentralityMax, | |
40 | kSelectSpecialTriggerAlias, | |
41 | kSelectSubTriggerClass, | |
42 | kremovePileUp, | |
43 | kExtraSignals, | |
44 | kNCuts | |
45 | }; | |
46 | ||
47 | Bool_t SetCutIds(TString cutString); | |
48 | Int_t fCuts[kNCuts]; | |
49 | Bool_t SetCut(cutIds cutID, Int_t cut); | |
50 | Bool_t UpdateCutString(); | |
51 | static const char * fgkCutNames[kNCuts]; | |
52 | ||
53 | Bool_t InitializeCutsFromCutString(const TString analysisCutSelection); | |
54 | void SelectCollisionCandidates(UInt_t offlineTriggerMask = AliVEvent::kAny) { | |
55 | fOfflineTriggerMask = offlineTriggerMask; | |
56 | fTriggerSelectedManually = kTRUE; | |
57 | } | |
58 | void SelectSpecialTrigger(UInt_t offlineTriggerMask = AliVEvent::kAny, TString TriggerClassName = "AliVEvent::kAny" ) { | |
59 | fOfflineTriggerMask = offlineTriggerMask; | |
60 | fSpecialTriggerName = TriggerClassName; | |
61 | cout << fSpecialTriggerName.Data() << endl; | |
62 | ||
63 | } | |
64 | ||
65 | void SetAcceptedHeader(TList *HeaderList){fHeaderList = HeaderList;} | |
66 | TString *GetFoundHeader(){return fGeneratorNames;} | |
67 | ||
68 | Int_t GetEventQuality(){return fEventQuality;} | |
69 | Bool_t GetIsFromPileup(){return fRemovePileUp;} | |
70 | ||
71 | AliConvEventCuts(const char *name="EventCuts", const char * title="Event Cuts"); | |
72 | AliConvEventCuts(const AliConvEventCuts&); | |
73 | AliConvEventCuts& operator=(const AliConvEventCuts&); | |
74 | ||
75 | virtual ~AliConvEventCuts(); //virtual destructor | |
76 | ||
77 | // static AliConvEventCuts * GetStandardCuts2010PbPb(); | |
78 | // static AliConvEventCuts * GetStandardCuts2010pp(); | |
79 | ||
80 | virtual Bool_t IsSelected(TObject* /*obj*/){return kTRUE;} | |
81 | virtual Bool_t IsSelected(TList* /*list*/) {return kTRUE;} | |
82 | ||
83 | TString GetCutNumber(); | |
84 | ||
85 | void GetCentralityRange(Double_t range[2]){range[0]=10*fCentralityMin;range[1]=10*fCentralityMax;}; | |
86 | ||
87 | // Cut Selection | |
88 | Bool_t EventIsSelected(AliVEvent *fInputEvent, AliVEvent *fMCEvent); | |
89 | Int_t IsEventAcceptedByCut(AliConvEventCuts *ReaderCuts, AliVEvent *InputEvent, AliMCEvent *MCEvent, Int_t isHeavyIon); | |
90 | ||
91 | void PrintCuts(); | |
92 | void PrintCutsWithValues(); | |
93 | ||
94 | void InitCutHistograms(TString name="",Bool_t preCut = kTRUE); | |
95 | void SetFillCutHistograms(TString name="",Bool_t preCut = kTRUE){if(!fHistograms){InitCutHistograms(name,preCut);};} | |
96 | TList *GetCutHistograms(){return fHistograms;} | |
97 | ||
98 | ///Cut functions | |
99 | Int_t IsParticleFromBGEvent(Int_t index, AliStack *MCStack, AliVEvent *InputEvent = 0x0); | |
100 | void GetNotRejectedParticles(Int_t rejection, TList *HeaderList, AliVEvent *MCEvent); | |
101 | void SetUseReweightingWithHistogramFromFile( Bool_t pi0reweight=kTRUE, Bool_t etareweight=kFALSE, Bool_t k0sreweight=kFALSE, TString path="$ALICE_ROOT/PWGGA/GammaConv/MCSpectraInput.root", | |
102 | TString histoNamePi0 = "", TString histoNameEta = "", TString histoNameK0s = "", | |
103 | TString fitNamePi0 = "", TString fitNameEta = "", TString fitNameK0s ="" ) { | |
104 | AliInfo(Form("enabled reweighting for: pi0 : %i, eta: %i, K0s: %i",pi0reweight, etareweight, k0sreweight)); | |
105 | fDoReweightHistoMCPi0 = pi0reweight; | |
106 | fDoReweightHistoMCEta = etareweight; | |
107 | fDoReweightHistoMCK0s = k0sreweight; | |
108 | fPathTrFReweighting=path; | |
109 | fNameHistoReweightingPi0 =histoNamePi0; | |
110 | fNameHistoReweightingEta =histoNameEta; | |
111 | fNameHistoReweightingK0s =histoNameK0s; | |
112 | fNameFitDataPi0 =fitNamePi0; | |
113 | fNameFitDataEta =fitNameEta; | |
114 | fNameFitDataK0s =fitNameK0s; | |
115 | } | |
116 | void LoadReweightingHistosMCFromFile (); | |
117 | void SetAddedSignalPDGCode(Int_t addedSignalPDGcode) {fAddedSignalPDGCode = addedSignalPDGcode;} | |
118 | ||
119 | // Event Cuts | |
120 | Bool_t IsCentralitySelected(AliVEvent *fInputEvent, AliVEvent *fMCEvent = NULL); | |
121 | Double_t GetCentrality(AliVEvent *event); | |
122 | Int_t GetNumberOfContributorsVtx(AliVEvent *event); | |
123 | Bool_t VertexZCut(AliVEvent *fInputEvent); | |
124 | Bool_t IsTriggerSelected(AliVEvent *fInputEvent); | |
125 | Bool_t HasV0AND(){return fHasV0AND;} | |
126 | Bool_t IsSDDFired(){return fIsSDDFired;} | |
127 | Int_t IsSpecialTrigger(){return fSpecialTrigger;} | |
128 | TString GetSpecialTriggerName(){return fSpecialTriggerName;} | |
129 | ||
130 | // Request Flags | |
131 | Int_t IsHeavyIon(){return fIsHeavyIon;} | |
132 | Float_t GetWeightForMeson(TString period, Int_t index, AliStack *MCStack, AliVEvent *InputEvent = 0x0); | |
133 | void SetPreSelectionCutFlag(Bool_t preSelFlag){fPreSelCut = preSelFlag;} | |
134 | ||
135 | ||
136 | Int_t GetMultiplicityMethod(){return fMultiplicityMethod;} | |
137 | Int_t GetSignalRejection(){return fRejectExtraSignals;} | |
138 | Int_t GetNAcceptedHeaders(){return fnHeaders; } | |
139 | TString * GetAcceptedHeaderNames(){return fGeneratorNames;} | |
140 | Int_t * GetAcceptedHeaderStart(){return fNotRejectedStart;} | |
141 | Int_t * GetAcceptedHeaderEnd(){return fNotRejectedEnd;} | |
142 | TList* GetAcceptedHeader(){return fHeaderList;} | |
143 | ||
144 | // Eta shift Setting | |
145 | void SetEtaShift(Double_t etaShift) { | |
146 | fEtaShift = etaShift; | |
147 | } | |
148 | void SetEtaShift(TString pPbOrPbp) { | |
149 | Double_t etaShift = 0.0; | |
150 | if(!pPbOrPbp.CompareTo("pPb")) etaShift = -0.465; | |
151 | else if(!pPbOrPbp.CompareTo("Pbp")) etaShift = 0.465; | |
152 | ||
153 | fEtaShift = etaShift; | |
154 | } | |
155 | Double_t GetEtaShift() {return fEtaShift;} | |
156 | Bool_t GetDoEtaShift(){return fDoEtaShift;} | |
157 | void DoEtaShift(Bool_t doEtaShift){fDoEtaShift = doEtaShift;} | |
158 | void GetCorrectEtaShiftFromPeriod(TString periodName); | |
159 | ||
160 | Bool_t SetIsHeavyIon(Int_t isHeavyIon); | |
161 | Bool_t SetCentralityMax(Int_t centralityBin); | |
162 | Bool_t SetCentralityMin(Int_t centralityBin); | |
163 | Bool_t SetRemovePileUp(Int_t removePileUp); | |
164 | Bool_t SetMultiplicityMethod(Int_t multiplicityMethod); | |
165 | Bool_t SetSelectSpecialTrigger(Int_t selectSpecialTrigger); | |
166 | Bool_t SetSelectSubTriggerClass (Int_t selectSpecialSubTriggerClass); | |
167 | Bool_t SetRejectExtraSignalsCut(Int_t extraSignal); | |
168 | ||
169 | protected: | |
170 | TList *fHistograms; | |
171 | TList *fHeaderList; | |
172 | ||
173 | Int_t fEventQuality; // EventQuality | |
174 | //cuts | |
175 | Int_t fIsHeavyIon; // flag for heavy ion | |
176 | Int_t fDetectorCentrality; // centrality detecotor V0M or CL1 | |
177 | Int_t fModCentralityClass; // allows to select smaller centrality classes | |
178 | Double_t fMaxVertexZ; // max z offset of vertex | |
179 | Int_t fCentralityMin; // centrality selection lower bin value | |
180 | Int_t fCentralityMax; // centrality selection upper bin value | |
181 | Int_t fMultiplicityMethod; // selected multiplicity method | |
182 | Int_t fSpecialTrigger; // flag | |
183 | Int_t fSpecialSubTrigger; // flag | |
184 | Bool_t fRemovePileUp; // flag | |
185 | Int_t fRejectExtraSignals; // | |
186 | UInt_t fOfflineTriggerMask; // Task processes collision candidates only | |
187 | Bool_t fHasV0AND; // V0AND Offline Trigger | |
188 | Bool_t fIsSDDFired; // SDD FIRED to select with SDD events | |
189 | TRandom3 fRandom; // | |
190 | Int_t fnHeaders; // Number of Headers | |
191 | Int_t *fNotRejectedStart; //[fnHeaders] | |
192 | Int_t *fNotRejectedEnd; //[fnHeaders] | |
193 | TString *fGeneratorNames; //[fnHeaders] | |
194 | TObjString *fCutString; // cut number used for analysis | |
195 | AliAnalysisUtils *fUtils; | |
196 | Double_t fEtaShift; | |
197 | Bool_t fDoEtaShift; // Flag for Etashift | |
198 | Bool_t fDoReweightHistoMCPi0; // Flag for reweighting Pi0 input with histogram | |
199 | Bool_t fDoReweightHistoMCEta; // Flag for reweighting Eta input with histogram | |
200 | Bool_t fDoReweightHistoMCK0s; // Flag for reweighting K0s input with histogram | |
201 | TString fPathTrFReweighting; // Path for file used in reweighting | |
202 | TString fNameHistoReweightingPi0; // Histogram name for reweighting Pi0 | |
203 | TString fNameHistoReweightingEta; // Histogram name for reweighting Eta | |
204 | TString fNameHistoReweightingK0s; // Histogram name for reweighting K0s | |
205 | TString fNameFitDataPi0; // Fit name for fit to spectrum of pi0s in Data | |
206 | TString fNameFitDataEta; // Fit name for fit to spectrum of etas in Data | |
207 | TString fNameFitDataK0s; // Fit name for fit to spectrum of k0s in Data | |
208 | // Histograms | |
209 | TH1F *fHistoEventCuts; // bookkeeping for event selection cuts | |
210 | TH1F *hCentrality; // centrality distribution for selected events | |
211 | TH2F *hCentralityVsNumberOfPrimaryTracks; // centrality distribution for selected events | |
212 | TH1F *hVertexZ; // vertex z distribution for selected events | |
213 | TH1F *hTriggerClass; // fired offline trigger class | |
214 | TH1F *hTriggerClassSelected; // selected fired offline trigger class | |
215 | TH1D *hReweightMCHistPi0; // histogram input for reweighting Pi0 | |
216 | TH1D *hReweightMCHistEta; // histogram input for reweighting Eta | |
217 | TH1D *hReweightMCHistK0s; // histogram input for reweighting K0s | |
218 | TF1 *fFitDataPi0; // fit to pi0 spectrum in Data | |
219 | TF1 *fFitDataEta; // fit to eta spectrum in Data | |
220 | TF1 *fFitDataK0s; // fit to K0s spectrum in Data | |
221 | Int_t fAddedSignalPDGCode; | |
222 | Bool_t fPreSelCut; // Flag for preselection cut used in V0Reader | |
223 | Bool_t fTriggerSelectedManually; // Flag for manual trigger selection | |
224 | TString fSpecialTriggerName; // Name of the Special Triggers | |
225 | TString fSpecialSubTriggerName; // Name of the Special Triggers | |
226 | Int_t fNSpecialSubTriggerOptions; | |
227 | ||
228 | private: | |
229 | ||
230 | ClassDef(AliConvEventCuts,1) | |
231 | }; | |
232 | ||
233 | ||
234 | #endif |