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