]>
Commit | Line | Data |
---|---|---|
1c5acb87 | 1 | /************************************************************************** |
2 | * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
3 | * * | |
4 | * Author: The ALICE Off-line Project. * | |
5 | * Contributors are mentioned in the code where appropriate. * | |
6 | * * | |
7 | * Permission to use, copy, modify and distribute this software and its * | |
8 | * documentation strictly for non-commercial purposes is hereby granted * | |
9 | * without fee, provided that the above copyright notice appears in all * | |
10 | * copies and that both the copyright notice and this permission notice * | |
11 | * appear in the supporting documentation. The authors make no claims * | |
12 | * about the suitability of this software for any purpose. It is * | |
13 | * provided "as is" without express or implied warranty. * | |
14 | **************************************************************************/ | |
15 | /* $Id: $ */ | |
16 | ||
17 | //_________________________________________________________________________ | |
18 | // Base class for analysis algorithms | |
19 | //-- Author: Gustavo Conesa (LNF-INFN) | |
20 | //_________________________________________________________________________ | |
5025c139 | 21 | // --Yaxian Mao: Add the possibality for event selection analysis based on vertex and multiplicity bins (10/10/2010) |
1c5acb87 | 22 | |
23 | ||
24 | // --- ROOT system --- | |
25 | #include <TClonesArray.h> | |
477d6cee | 26 | //#include <Riostream.h> |
1c5acb87 | 27 | |
28 | //---- AliRoot system ---- | |
1c5acb87 | 29 | #include "AliAnaPartCorrBaseClass.h" |
30 | #include "AliCaloTrackReader.h" | |
765d44e7 | 31 | #include "AliCalorimeterUtils.h" |
1c5acb87 | 32 | #include "AliCaloPID.h" |
ff45398a | 33 | #include "AliFiducialCut.h" |
1c5acb87 | 34 | #include "AliIsolationCut.h" |
6639984f | 35 | #include "AliMCAnalysisUtils.h" |
1c5acb87 | 36 | #include "AliNeutralMesonSelection.h" |
f37fa8d2 | 37 | #include "AliVCaloCells.h" |
477d6cee | 38 | #include "AliAODEvent.h" |
42dc8e7d | 39 | #include "AliAODHandler.h" |
40 | #include "AliAnalysisManager.h" | |
c8fe2783 | 41 | #include "AliAODPWG4Particle.h" |
1c5acb87 | 42 | |
43 | ClassImp(AliAnaPartCorrBaseClass) | |
44 | ||
45 | ||
46 | //_______________________________________________ | |
47 | AliAnaPartCorrBaseClass::AliAnaPartCorrBaseClass() : | |
48 | TObject(), fDataMC(0), fDebug(0), fCheckFidCut(0), | |
7cd4e982 | 49 | fCheckCaloPID(0), fRecalculateCaloPID(0), fMinPt(0), fMaxPt(0), |
5025c139 | 50 | fMultiBin(0),fNZvertBin(0),fNrpBin(0),fZvtxCut(0.), fMaxMulti(0),fMinMulti(0), |
51 | fUseSelectEvent(kFALSE), | |
3c769bf6 | 52 | fReader(0x0), fInputAODBranch(0x0), fInputAODName(""), |
53 | fOutputAODBranch(0x0), fNewAOD(kFALSE), | |
54 | fOutputAODName(""), fOutputAODClassName(""), | |
591cc579 | 55 | fAODObjArrayName(""), fAddToHistogramsName(""), |
3c769bf6 | 56 | fCaloPID(0x0), fFidCut(0x0), fIC(0x0),fMCUtils(0x0), fNMS(0x0), |
78219bac | 57 | fCaloUtils(0x0), |
5a2dbc3c | 58 | fHistoPtBins(0), fHistoPtMax(0.), fHistoPtMin(0.), |
59 | fHistoPhiBins(0), fHistoPhiMax(0.), fHistoPhiMin(0.), | |
60 | fHistoEtaBins(0), fHistoEtaMax(0.), fHistoEtaMin(0.), | |
61 | fHistoMassBins(0), fHistoMassMax(0.), fHistoMassMin(0.), | |
f8006433 | 62 | fHistoAsymBins(0), fHistoAsymMax(0.), fHistoAsymMin(0.) |
1c5acb87 | 63 | { |
64 | //Default Ctor | |
4a745797 | 65 | |
1c5acb87 | 66 | //Initialize parameters |
67 | InitParameters(); | |
68 | } | |
78219bac | 69 | /* |
1c5acb87 | 70 | //___________________________________________________________ |
71 | AliAnaPartCorrBaseClass::AliAnaPartCorrBaseClass(const AliAnaPartCorrBaseClass & abc) : | |
72 | TObject(), fDataMC(abc.fDataMC), fDebug(abc.fDebug), | |
73 | fCheckFidCut(abc.fCheckFidCut), fCheckCaloPID(abc. fCheckCaloPID), | |
74 | fRecalculateCaloPID(abc.fRecalculateCaloPID), | |
765d44e7 | 75 | fMinPt(abc.fMinPt), fMaxPt(abc.fMaxPt), fReader(new AliCaloTrackReader(*abc.fReader)), |
1c5acb87 | 76 | fInputAODBranch(new TClonesArray(*abc.fInputAODBranch)), fInputAODName(abc.fInputAODName), |
77 | fOutputAODBranch(new TClonesArray(*abc.fOutputAODBranch)),fNewAOD(abc.fNewAOD), | |
78 | fOutputAODName(abc.fOutputAODName), fOutputAODClassName(abc.fOutputAODClassName), | |
591cc579 | 79 | fAODObjArrayName(abc.fAODObjArrayName), |
a3aebfff | 80 | fAddToHistogramsName(abc.fAddToHistogramsName), |
fb9841b8 | 81 | fCaloPID(new AliCaloPID(*abc.fCaloPID)), fFidCut(new AliFiducialCut(*abc.fFidCut)), fIC(new AliIsolationCut(*abc.fIC)), |
82 | fMCUtils(new AliMCAnalysisUtils(*abc.fMCUtils)), fNMS(new AliNeutralMesonSelection(*abc.fNMS)), | |
765d44e7 | 83 | fCaloUtils(new AliCalorimeterUtils(*abc.fCaloUtils)), |
5a2dbc3c | 84 | fHistoPtBins(abc.fHistoPtBins), fHistoPtMax(abc.fHistoPtMax), fHistoPtMin(abc.fHistoPtMin), |
85 | fHistoPhiBins(abc.fHistoPhiBins), fHistoPhiMax(abc.fHistoPhiMax), fHistoPhiMin(abc.fHistoPhiMin), | |
86 | fHistoEtaBins(abc.fHistoEtaBins), fHistoEtaMax(abc.fHistoEtaMax), fHistoEtaMin(abc.fHistoEtaMin), | |
87 | fHistoMassBins(abc.fHistoMassBins), fHistoMassMax(abc.fHistoMassMax), fHistoMassMin(abc.fHistoMassMin), | |
88 | fHistoAsymBins(abc.fHistoAsymBins), fHistoAsymMax(abc.fHistoAsymMax), fHistoAsymMin(abc.fHistoAsymMin) | |
1c5acb87 | 89 | { |
90 | // cpy ctor | |
fb9841b8 | 91 | |
1c5acb87 | 92 | } |
78219bac | 93 | */ |
94 | /* | |
1c5acb87 | 95 | //_________________________________________________________________________ |
96 | AliAnaPartCorrBaseClass & AliAnaPartCorrBaseClass::operator = (const AliAnaPartCorrBaseClass & abc) | |
97 | { | |
477d6cee | 98 | // assignment operator |
99 | ||
100 | if(this == &abc) return *this; | |
101 | ((TObject *)this)->operator=(abc); | |
102 | ||
103 | fDataMC = abc.fDataMC; | |
104 | fDebug = abc.fDebug ; | |
105 | fRecalculateCaloPID = abc.fRecalculateCaloPID ; | |
106 | fCheckCaloPID = abc.fCheckCaloPID ; | |
107 | fCheckFidCut = abc.fCheckFidCut ; | |
1c5acb87 | 108 | |
477d6cee | 109 | fMinPt = abc.fMinPt; |
110 | fMaxPt = abc.fMaxPt; | |
fb9841b8 | 111 | |
765d44e7 | 112 | delete fCaloPID; fCaloPID = new AliCaloPID (*abc.fCaloPID); |
113 | delete fFidCut; fFidCut = new AliFiducialCut (*abc.fFidCut); | |
114 | delete fMCUtils; fMCUtils = new AliMCAnalysisUtils(*abc.fMCUtils); | |
115 | delete fIC; fIC = new AliIsolationCut (*abc.fIC); | |
116 | delete fNMS; fNMS = new AliNeutralMesonSelection(*abc.fNMS); | |
117 | delete fCaloUtils; fCaloUtils = new AliCalorimeterUtils(*abc.fCaloUtils); | |
118 | delete fReader; fReader = new AliCaloTrackReader(*abc.fReader) ; | |
4a745797 | 119 | |
fb9841b8 | 120 | delete fInputAODBranch; fInputAODBranch = new TClonesArray(*abc.fInputAODBranch) ; |
a3aebfff | 121 | fInputAODName = abc.fInputAODName; |
fb9841b8 | 122 | delete fOutputAODBranch; fOutputAODBranch = new TClonesArray(*abc.fOutputAODBranch) ; |
a3aebfff | 123 | fNewAOD = abc.fNewAOD ; |
124 | fOutputAODName = abc.fOutputAODName; | |
125 | fOutputAODClassName = abc.fOutputAODClassName; | |
126 | fAddToHistogramsName = abc.fAddToHistogramsName; | |
591cc579 | 127 | fAODObjArrayName = abc.fAODObjArrayName; |
a3aebfff | 128 | |
5a2dbc3c | 129 | fHistoPtBins = abc.fHistoPtBins; fHistoPtMax = abc.fHistoPtMax; fHistoPtMin = abc.fHistoPtMin; |
130 | fHistoPhiBins = abc.fHistoPhiBins; fHistoPhiMax = abc.fHistoPhiMax; fHistoPhiMin = abc.fHistoPhiMin; | |
131 | fHistoEtaBins = abc.fHistoEtaBins; fHistoEtaMax = abc.fHistoEtaMax; fHistoEtaMin = abc.fHistoEtaMin; | |
477d6cee | 132 | |
133 | return *this; | |
134 | ||
1c5acb87 | 135 | } |
78219bac | 136 | */ |
1c5acb87 | 137 | //____________________________________________________________________________ |
138 | AliAnaPartCorrBaseClass::~AliAnaPartCorrBaseClass() | |
139 | { | |
140 | // Remove all pointers except analysis output pointers. | |
7787a778 | 141 | //printf("---Delete analysis %s\n", fAODObjArrayName.Data()); |
142 | // Not sure if it should be me who deletes the delta AOD branches. | |
143 | // if(fOutputAODBranch){ | |
144 | // fOutputAODBranch->Clear() ; | |
145 | // delete fOutputAODBranch ; | |
146 | // } | |
147 | // | |
148 | // if(fInputAODBranch){ | |
149 | // fInputAODBranch->Clear() ; | |
150 | // delete fInputAODBranch ; | |
151 | // } | |
477d6cee | 152 | |
7787a778 | 153 | //if(fCaloUtils) delete fCaloUtils ; //Already deleted in maker |
154 | //if(fReader) delete fReader ; //Already deleted in maker | |
155 | ||
765d44e7 | 156 | if(fCaloPID) delete fCaloPID ; |
157 | if(fFidCut) delete fFidCut ; | |
158 | if(fIC) delete fIC ; | |
159 | if(fMCUtils) delete fMCUtils ; | |
160 | if(fNMS) delete fNMS ; | |
5025c139 | 161 | |
162 | // printf("--- analysis deleted \n"); | |
1c5acb87 | 163 | } |
164 | ||
1c5acb87 | 165 | //____________________________________________________________________________ |
166 | void AliAnaPartCorrBaseClass::AddAODParticle(AliAODPWG4Particle pc) { | |
167 | //Put AOD calo cluster in the AODParticleCorrelation array | |
168 | ||
477d6cee | 169 | if(fOutputAODBranch){ |
170 | ||
171 | Int_t i = fOutputAODBranch->GetEntriesFast(); | |
172 | //new((*fOutputAODBranch)[i]) AliAODPWG4Particle(pc); | |
173 | if(strcmp(fOutputAODBranch->GetClass()->GetName(),"AliAODPWG4Particle")==0) | |
174 | new((*fOutputAODBranch)[i]) AliAODPWG4Particle(pc); | |
175 | else if(strcmp(fOutputAODBranch->GetClass()->GetName(),"AliAODPWG4ParticleCorrelation")==0) | |
176 | new((*fOutputAODBranch)[i]) AliAODPWG4ParticleCorrelation(pc); | |
177 | else { | |
178 | printf("AliAnaPartCorrBaseClass::AddAODParticle() - Cannot add an object of type < %s >, to the AOD TClonesArray \n", | |
179 | fOutputAODBranch->GetClass()->GetName()); | |
180 | abort(); | |
181 | } | |
182 | } | |
183 | else { | |
184 | printf(" AliAnaPartCorrBaseClass::AddAODParticle() - No AOD branch available!!!\n"); | |
185 | abort(); | |
186 | } | |
187 | ||
1c5acb87 | 188 | } |
189 | ||
f37fa8d2 | 190 | //___________________________________________________________________________ |
42dc8e7d | 191 | TClonesArray * AliAnaPartCorrBaseClass::GetAODBranch(TString aodName) const { |
192 | //Recover ouput and input AOD pointers for each event in the maker | |
193 | ||
194 | //Delta AODs | |
1e86c71e | 195 | if(fDebug > 3) printf("AliAnaPartCorrBaseClass::GetAODBranch() - Get Input Branch with name: <%s>; \n",aodName.Data()); |
196 | ||
f37fa8d2 | 197 | //Get the AOD handler, if output AOD is created use it, if not get the branches from the input which should be deltaAODs |
198 | AliAODHandler* aodHandler = 0x0; | |
199 | Bool_t outAOD = kFALSE; | |
200 | if((AliAnalysisManager::GetAnalysisManager())->GetOutputEventHandler()) outAOD = kTRUE; | |
201 | if(outAOD) aodHandler = (AliAODHandler*) ((AliAnalysisManager::GetAnalysisManager())->GetOutputEventHandler()); | |
202 | else aodHandler = (AliAODHandler*) ((AliAnalysisManager::GetAnalysisManager())->GetInputEventHandler()); | |
203 | ||
204 | if(!GetReader()->WriteDeltaAODToFile()) | |
205 | { | |
206 | return (TClonesArray *) (fReader->GetAODBranchList())->FindObject(aodName); | |
207 | } | |
208 | else if (aodHandler->GetExtensions()) | |
209 | { | |
210 | AliAODExtension *ext = (AliAODExtension*)aodHandler->GetExtensions()->FindObject(GetReader()->GetDeltaAODFileName()); | |
211 | if(ext){ | |
212 | AliAODEvent *aodEvent = ext->GetAOD(); | |
213 | TClonesArray * aodbranch = (TClonesArray*) aodEvent->FindListObject(aodName); | |
214 | if(aodbranch) return aodbranch; | |
215 | else { | |
216 | if(outAOD) return (TClonesArray *) fReader->GetOutputEvent()->FindListObject(aodName); | |
217 | else return (TClonesArray *) fReader->GetInputEvent() ->FindListObject(aodName); | |
218 | } | |
219 | } | |
220 | else{//If no Delta AODs, kept in standard branch, to revise. | |
221 | if(outAOD) return (TClonesArray *) fReader->GetOutputEvent()->FindListObject(aodName); | |
222 | else return (TClonesArray *) fReader->GetInputEvent() ->FindListObject(aodName); | |
223 | } | |
224 | } | |
225 | else{ //If no Delta AODs, kept in standard branch, to revise. | |
226 | if(outAOD) return (TClonesArray *) fReader->GetOutputEvent()->FindListObject(aodName); | |
227 | else return (TClonesArray *) fReader->GetInputEvent() ->FindListObject(aodName); | |
228 | } | |
229 | ||
42dc8e7d | 230 | } |
477d6cee | 231 | |
477d6cee | 232 | |
f37fa8d2 | 233 | |
42dc8e7d | 234 | //___________________________________________________ |
235 | void AliAnaPartCorrBaseClass::ConnectInputOutputAODBranches() { | |
236 | //Recover ouput and input AOD pointers for each event in the maker | |
237 | ||
238 | //Delta AODs | |
1e86c71e | 239 | if(fDebug > 3) printf("AliAnaPartCorrBaseClass::ConnectInputOutputAODBranches() - Connect Input with name: <%s>; Connect output with name <%s>\n",fInputAODName.Data(),fOutputAODName.Data()); |
f37fa8d2 | 240 | |
1e86c71e | 241 | //Get the AOD handler, if output AOD is created use it, if not get the branches from the input which should be deltaAODs |
242 | AliAODHandler* aodHandler = 0x0; | |
243 | Bool_t outAOD = kFALSE; | |
244 | if((AliAnalysisManager::GetAnalysisManager())->GetOutputEventHandler()) outAOD = kTRUE; | |
245 | if(outAOD) aodHandler = (AliAODHandler*) ((AliAnalysisManager::GetAnalysisManager())->GetOutputEventHandler()); | |
f37fa8d2 | 246 | else aodHandler = (AliAODHandler*) ((AliAnalysisManager::GetAnalysisManager())->GetInputEventHandler()); |
1e86c71e | 247 | |
f37fa8d2 | 248 | if(!GetReader()->WriteDeltaAODToFile()) |
249 | { | |
250 | fOutputAODBranch = (TClonesArray *) (fReader->GetAODBranchList())->FindObject(fOutputAODName); | |
251 | fInputAODBranch = (TClonesArray *) (fReader->GetAODBranchList())->FindObject(fInputAODName); | |
252 | } | |
253 | else if (aodHandler->GetExtensions()) { | |
254 | ||
42dc8e7d | 255 | AliAODExtension *ext = (AliAODExtension*)aodHandler->GetExtensions()->FindObject(GetReader()->GetDeltaAODFileName()); |
256 | if(ext){ | |
f37fa8d2 | 257 | AliAODEvent *aodEvent = ext->GetAOD(); |
258 | if(fNewAOD)fOutputAODBranch = (TClonesArray*) aodEvent->FindListObject(fOutputAODName); | |
259 | fInputAODBranch = (TClonesArray*) aodEvent->FindListObject(fInputAODName); | |
260 | if(!fOutputAODBranch && fNewAOD) fOutputAODBranch = (TClonesArray *) fReader->GetOutputEvent()->FindListObject(fOutputAODName); | |
261 | if(!fInputAODBranch) fInputAODBranch = (TClonesArray *) fReader->GetOutputEvent()->FindListObject(fInputAODName); | |
42dc8e7d | 262 | } |
263 | else{//If no Delta AODs, kept in standard branch, to revise. | |
0866d83a | 264 | if(fNewAOD && fReader->GetOutputEvent()) { |
1e86c71e | 265 | fOutputAODBranch = (TClonesArray *) fReader->GetOutputEvent()->FindListObject(fOutputAODName); |
266 | fInputAODBranch = (TClonesArray *) fReader->GetOutputEvent()->FindListObject(fInputAODName); | |
267 | } | |
7cd31fd6 | 268 | else { |
269 | fInputAODBranch = (TClonesArray *) fReader->GetInputEvent()->FindListObject(fInputAODName); | |
0866d83a | 270 | if(!fInputAODBranch && fReader->GetOutputEvent() ) |
271 | fInputAODBranch = (TClonesArray *) fReader->GetOutputEvent()->FindListObject(fInputAODName);//Try the output event. | |
7cd31fd6 | 272 | } |
1e86c71e | 273 | } |
274 | } | |
275 | else{ //If no Delta AODs, kept in standard branch | |
0866d83a | 276 | if(fNewAOD && fReader->GetOutputEvent()) { |
42dc8e7d | 277 | fOutputAODBranch = (TClonesArray *) fReader->GetOutputEvent()->FindListObject(fOutputAODName); |
1e86c71e | 278 | fInputAODBranch = (TClonesArray *) fReader->GetOutputEvent()->FindListObject(fInputAODName); |
42dc8e7d | 279 | } |
7cd31fd6 | 280 | else{ |
1e86c71e | 281 | fInputAODBranch = (TClonesArray *) fReader->GetInputEvent()->FindListObject(fInputAODName); |
0866d83a | 282 | if(!fInputAODBranch && fReader->GetOutputEvent()) |
283 | fInputAODBranch = (TClonesArray *) fReader->GetOutputEvent()->FindListObject(fInputAODName);//Try the output event. | |
7cd31fd6 | 284 | } |
42dc8e7d | 285 | } |
1e86c71e | 286 | |
287 | if(GetDebug() > 1){ | |
f37fa8d2 | 288 | if(fNewAOD && !fOutputAODBranch) |
289 | printf(" AliAnaPartCorrBaseClass::ConnectInputOutputAODBranches() - Output Branch <%s>, not found!\n",fOutputAODName.Data()); | |
290 | if(!fNewAOD && !fInputAODBranch) | |
291 | printf(" AliAnaPartCorrBaseClass::ConnectInputOutputAODBranches() - Input Branch <%s>, not found!\n",fInputAODName.Data()); | |
42dc8e7d | 292 | } |
1c5acb87 | 293 | } |
5ae09196 | 294 | // |
295 | ////__________________________________________________________________________ | |
296 | //Bool_t AliAnaPartCorrBaseClass::IsTrackMatched(AliVCluster* cluster) const { | |
297 | // //Check if there is any track attached to this cluster | |
298 | // | |
299 | // Int_t nMatches = cluster->GetNTracksMatched(); | |
300 | //// printf("N matches %d, first match %d\n",nMatches,cluster->GetTrackMatchedIndex()); | |
301 | //// if (cluster->GetTrackMatched(0)) printf("\t matched track id %d\n",((AliVTrack*)cluster->GetTrackMatched(0))->GetID()) ; | |
302 | //// else if(cluster->GetTrackMatchedIndex()>=0) printf("\t matched track id %d\n",((AliVTrack*) GetReader()->GetInputEvent()->GetTrack(cluster->GetTrackMatchedIndex()))->GetID()) ; | |
303 | // | |
304 | // if(fReader->GetDataType()==AliCaloTrackReader::kESD) | |
305 | // { | |
306 | // | |
307 | // if (nMatches > 0) { | |
308 | // if (nMatches == 1 ) { | |
309 | // Int_t iESDtrack = cluster->GetTrackMatchedIndex(); | |
310 | // //printf("Track Matched index %d\n",iESDtrack); | |
311 | // if(iESDtrack==-1) return kFALSE ;// Default value of array, there is no match | |
312 | // else return kTRUE; | |
313 | // }//Just one, check | |
314 | // else return kTRUE ;//More than one, there is a match. | |
315 | // }// > 0 | |
316 | // else return kFALSE; //It does not happen, but in case | |
317 | // | |
318 | // }//ESDs | |
319 | // else | |
320 | // { | |
321 | // //AODs | |
322 | // if(nMatches > 0) return kTRUE; //There is at least one match. | |
323 | // else return kFALSE; | |
324 | // | |
325 | // }//AODs or MC (copy into AOD) | |
326 | // | |
327 | // return kFALSE; | |
328 | // | |
329 | //} | |
330 | // | |
1c5acb87 | 331 | //__________________________________________________ |
591cc579 | 332 | TObjArray * AliAnaPartCorrBaseClass::GetAODCTS() const { |
477d6cee | 333 | //Get list of referenced tracks from reader |
1c5acb87 | 334 | |
335 | return fReader->GetAODCTS(); | |
336 | ||
337 | } | |
338 | ||
339 | //__________________________________________________ | |
591cc579 | 340 | TObjArray * AliAnaPartCorrBaseClass::GetAODPHOS() const { |
477d6cee | 341 | //Get list of PHOS reference caloclusters from reader |
1c5acb87 | 342 | |
343 | return fReader->GetAODPHOS(); | |
344 | ||
345 | } | |
346 | ||
1c5acb87 | 347 | //__________________________________________________ |
591cc579 | 348 | TObjArray * AliAnaPartCorrBaseClass::GetAODEMCAL() const { |
477d6cee | 349 | //Get list of emcal referenced caloclusters from reader |
1c5acb87 | 350 | |
351 | return fReader->GetAODEMCAL(); | |
352 | ||
353 | } | |
354 | ||
477d6cee | 355 | //__________________________________________________ |
356 | TClonesArray * AliAnaPartCorrBaseClass::GetAODCaloClusters() const { | |
357 | //Get list of all caloclusters in AOD output file | |
358 | ||
359 | return fReader->GetOutputEvent()->GetCaloClusters(); | |
360 | ||
361 | } | |
362 | ||
363 | //__________________________________________________ | |
364 | TClonesArray * AliAnaPartCorrBaseClass::GetAODTracks() const { | |
365 | //Get list of all tracks in AOD output file | |
366 | ||
367 | return fReader->GetOutputEvent()->GetTracks(); | |
368 | ||
369 | } | |
370 | ||
1c5acb87 | 371 | //__________________________________________________ |
372 | TString AliAnaPartCorrBaseClass::GetBaseParametersList() { | |
373 | //Put data member values in string to keep in output container | |
374 | ||
477d6cee | 375 | TString parList ; //this will be list of parameters used for this analysis. |
5ae09196 | 376 | const Int_t buffersize = 255; |
377 | char onePar[buffersize] ; | |
378 | snprintf(onePar,buffersize,"--- AliAnaPartCorrBaseClass ---\n") ; | |
477d6cee | 379 | parList+=onePar ; |
5ae09196 | 380 | snprintf(onePar,buffersize,"Minimal P_t: %2.2f ; Max\n", fMinPt) ; |
477d6cee | 381 | parList+=onePar ; |
5ae09196 | 382 | snprintf(onePar,buffersize,"Minimal P_t: %2.2f ; Max\n", fMaxPt) ; |
477d6cee | 383 | parList+=onePar ; |
5ae09196 | 384 | snprintf(onePar,buffersize,"fDataMC =%d (Check MC information, on/off) \n",fDataMC) ; |
477d6cee | 385 | parList+=onePar ; |
5ae09196 | 386 | snprintf(onePar,buffersize,"fCheckFidCut=%d (Check Fiducial cut selection on/off) \n",fCheckFidCut) ; |
477d6cee | 387 | parList+=onePar ; |
5ae09196 | 388 | snprintf(onePar,buffersize,"fCheckCaloPID =%d (Use Bayesian PID in calorimetes, on/off) \n",fCheckCaloPID) ; |
477d6cee | 389 | parList+=onePar ; |
5ae09196 | 390 | snprintf(onePar,buffersize,"fRecalculateCaloPID =%d (Calculate PID from shower/tof/tracking parameters, on/off) \n",fRecalculateCaloPID) ; |
477d6cee | 391 | parList+=onePar ; |
5ae09196 | 392 | snprintf(onePar,buffersize,"fInputAODName =%s Input AOD name \n",fInputAODName.Data()) ; |
a3aebfff | 393 | parList+=onePar ; |
394 | if(fNewAOD){ | |
5ae09196 | 395 | snprintf(onePar,buffersize,"fOutputAODName =%s Output AOD name \n",fOutputAODName.Data()) ; |
396 | parList+=onePar ; | |
397 | snprintf(onePar,buffersize,"fOutputAODClassName =%s Output AOD class name \n",fOutputAODClassName.Data()) ; | |
a3aebfff | 398 | parList+=onePar ; |
a3aebfff | 399 | } |
5ae09196 | 400 | snprintf(onePar,buffersize,"fAODObjArrayName =%s Reference arrays in AOD name \n",fAODObjArrayName.Data()) ; |
a3aebfff | 401 | parList+=onePar ; |
5ae09196 | 402 | snprintf(onePar,buffersize,"fAddToHistogramsName =%s String added to beginning of histograms name \n",fAddToHistogramsName.Data()) ; |
a3aebfff | 403 | parList+=onePar ; |
404 | ||
1c5acb87 | 405 | return parList; |
406 | ||
407 | } | |
408 | ||
409 | //__________________________________________________ | |
410 | TClonesArray * AliAnaPartCorrBaseClass::GetCreateOutputAODBranch() { | |
477d6cee | 411 | //Create AOD branch filled in the analysis |
412 | ||
413 | printf("Create AOD branch of %s objects and with name < %s >\n", | |
414 | fOutputAODClassName.Data(),fOutputAODName.Data()) ; | |
415 | ||
416 | TClonesArray * aodBranch = new TClonesArray(fOutputAODClassName, 0); | |
417 | aodBranch->SetName(fOutputAODName); | |
418 | return aodBranch ; | |
419 | ||
1c5acb87 | 420 | } |
421 | ||
6639984f | 422 | //__________________________________________________ |
423 | Int_t AliAnaPartCorrBaseClass::GetEventNumber() const { | |
424 | //Get current event number | |
425 | ||
426 | return fReader->GetEventNumber() ; | |
427 | } | |
428 | ||
1c5acb87 | 429 | //__________________________________________________ |
430 | AliStack * AliAnaPartCorrBaseClass::GetMCStack() const { | |
431 | //Get stack pointer from reader | |
432 | ||
433 | return fReader->GetStack(); | |
434 | ||
435 | } | |
436 | //__________________________________________________ | |
437 | AliHeader * AliAnaPartCorrBaseClass::GetMCHeader() const { | |
438 | //Get header pointer from reader | |
439 | ||
440 | return fReader->GetHeader(); | |
441 | ||
442 | } | |
443 | ||
444 | //__________________________________________________ | |
445 | AliGenEventHeader * AliAnaPartCorrBaseClass::GetMCGenEventHeader() const { | |
446 | //Get GenEventHeader pointer from reader | |
447 | ||
448 | return fReader->GetGenEventHeader(); | |
449 | ||
450 | } | |
451 | ||
452 | //__________________________________________________ | |
453 | void AliAnaPartCorrBaseClass::InitParameters() | |
454 | { | |
455 | //Initialize the parameters of the analysis. | |
456 | fDataMC = kFALSE; | |
457 | fDebug = -1; | |
458 | fCheckCaloPID = kTRUE ; | |
459 | fCheckFidCut = kFALSE ; | |
460 | fRecalculateCaloPID = kFALSE ; | |
1e86c71e | 461 | fMinPt = 0.1 ; //Min pt in particle analysis |
1c5acb87 | 462 | fMaxPt = 300. ; //Max pt in particle analysis |
5025c139 | 463 | fMultiBin = 1; |
464 | fNZvertBin = 1; | |
465 | fNrpBin = 1; | |
466 | fZvtxCut = 40; | |
467 | fMaxMulti = 1000; | |
468 | fMinMulti = 0; | |
469 | fUseSelectEvent = kFALSE ; | |
470 | ||
78219bac | 471 | //fReader = new AliCaloTrackReader(); //Initialized in maker |
472 | //fCaloUtils = new AliCalorimeterUtils();//Initialized in maker | |
f37fa8d2 | 473 | |
4a745797 | 474 | fNewAOD = kFALSE ; |
475 | fOutputAODName = "PartCorr"; | |
476 | fOutputAODClassName = "AliAODPWG4Particle"; | |
477 | fInputAODName = "PartCorr"; | |
a3aebfff | 478 | fAddToHistogramsName = ""; |
4a745797 | 479 | fAODObjArrayName = "Ref"; |
7cd4e982 | 480 | |
5a2dbc3c | 481 | //Histogram settings |
482 | fHistoPtBins = 240 ; | |
483 | fHistoPtMax = 120 ; | |
484 | fHistoPtMin = 0. ; | |
485 | ||
486 | fHistoPhiBins = 120 ; | |
487 | fHistoPhiMax = TMath::TwoPi(); | |
488 | fHistoPhiMin = 0. ; | |
489 | ||
490 | fHistoEtaBins = 100 ; | |
491 | fHistoEtaMax = 1 ; | |
492 | fHistoEtaMin = -1 ; | |
493 | ||
494 | fHistoMassBins = 200; | |
495 | fHistoMassMax = 1. ; | |
496 | fHistoMassMin = 0. ; | |
497 | ||
498 | fHistoAsymBins = 10 ; | |
499 | fHistoAsymMax = 1. ; | |
500 | fHistoAsymMin = 0. ; | |
c8fe2783 | 501 | |
1c5acb87 | 502 | } |
503 | ||
504 | //__________________________________________________________________ | |
505 | void AliAnaPartCorrBaseClass::Print(const Option_t * opt) const | |
506 | { | |
477d6cee | 507 | //Print some relevant parameters set for the analysis |
508 | ||
509 | if(! opt) | |
510 | return; | |
a3aebfff | 511 | |
477d6cee | 512 | printf("New AOD: = %d\n",fNewAOD); |
513 | printf("Input AOD name: = %s\n",fInputAODName.Data()); | |
514 | printf("Output AOD name: = %s\n",fOutputAODName.Data()); | |
515 | printf("Output AOD Class name: = %s\n",fOutputAODClassName.Data()); | |
516 | printf("Min Photon pT = %2.2f\n", fMinPt) ; | |
517 | printf("Max Photon pT = %3.2f\n", fMaxPt) ; | |
518 | printf("Check PID = %d\n", fCheckCaloPID) ; | |
519 | printf("Recalculate PID = %d\n", fRecalculateCaloPID) ; | |
ff45398a | 520 | printf("Check Fiducial cut = %d\n", fCheckFidCut) ; |
477d6cee | 521 | printf("Check MC labels = %d\n", fDataMC); |
522 | printf("Debug Level = %d\n", fDebug); | |
5a2dbc3c | 523 | printf("Histograms: %3.1f < pT < %3.1f, Nbin = %d\n", fHistoPtMin, fHistoPtMax, fHistoPtBins); |
524 | printf("Histograms: %3.1f < phi < %3.1f, Nbin = %d\n", fHistoPhiMin, fHistoPhiMax, fHistoPhiBins); | |
525 | printf("Histograms: %3.1f < eta < %3.1f, Nbin = %d\n", fHistoEtaMin, fHistoEtaMax, fHistoEtaBins); | |
526 | printf("Histograms: %3.1f < mass < %3.1f, Nbin = %d\n", fHistoMassMin, fHistoMassMax, fHistoMassBins); | |
527 | printf("Histograms: %3.1f < asymmetry < %3.1f, Nbin = %d\n", fHistoAsymMin, fHistoAsymMax, fHistoAsymBins); | |
591cc579 | 528 | printf("Name of reference array : %s\n", fAODObjArrayName.Data()); |
a3aebfff | 529 | printf("String added histograms name : %s\n",fAddToHistogramsName.Data()); |
530 | ||
477d6cee | 531 | printf(" \n") ; |
532 | ||
1c5acb87 | 533 | } |
c8fe2783 | 534 | |
c8fe2783 | 535 | |
536 |