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