Add example configuration macro for pi0 analysis, change way several cut parameters are set.
Remove btag analysis from train configuration macro
Add posibility to switch off the Terminate execution per analysis, off by default
Mem Leak fixes in case analysis with kinematics stack
Several fixes in isolation analysis
TObject(), fDataMC(0), fDebug(0), fCheckFidCut(0),
fCheckCaloPID(0), fRecalculateCaloPID(0), fMinPt(0), fMaxPt(0),
fMultiBin(0),fNZvertBin(0),fNrpBin(0),fZvtxCut(0.), fMaxMulti(0),fMinMulti(0),
- fUseSelectEvent(kFALSE),
+ fUseSelectEvent(kFALSE), fMakePlots(kFALSE),
fReader(0x0), fInputAODBranch(0x0), fInputAODName(""),
fOutputAODBranch(0x0), fNewAOD(kFALSE),
fOutputAODName(""), fOutputAODClassName(""),
printf("Recalculate PID = %d\n", fRecalculateCaloPID) ;
printf("Check Fiducial cut = %d\n", fCheckFidCut) ;
printf("Check MC labels = %d\n", fDataMC);
+ printf("Make plots? = %d \n", fMakePlots);
printf("Debug Level = %d\n", fDebug);
printf("Histograms: %3.1f < pT < %3.1f, Nbin = %d\n", fHistoPtMin, fHistoPtMax, fHistoPtBins);
printf("Histograms: %3.1f < phi < %3.1f, Nbin = %d\n", fHistoPhiMin, fHistoPhiMax, fHistoPhiBins);
virtual Bool_t IsTrackMatched(const AliVCluster * cluster) const { return fCaloPID->IsTrackMatched(cluster); }
+ void SwitchOnPlotsMaking() {fMakePlots = kTRUE ;}
+ void SwitchOffPlotsMaking() {fMakePlots = kFALSE ;}
+ Bool_t MakePlotsOn() const {return fMakePlots;}
+
private:
Bool_t fDataMC ; // Flag to access MC data when using ESD or AOD
Int_t fMaxMulti ; // Maximum multiplicity of particles in the analysis
Int_t fMinMulti ; // Maximum multiplicity of particles in the analysis
Bool_t fUseSelectEvent ; // Select events based on multiplicity and vertex cuts
-
+ Bool_t fMakePlots ; // Print plots
+
AliCaloTrackReader * fReader; // Acces to ESD/AOD/MC data
Float_t fHistoAsymMax ; // Maximum value of asymmetry histogram range
Float_t fHistoAsymMin ; // Minimum value of asymmetry histogram range
- ClassDef(AliAnaPartCorrBaseClass,10)
+ ClassDef(AliAnaPartCorrBaseClass,11)
} ;
for(Int_t iana = 0; iana < fAnalysisContainer->GetEntries(); iana++){
AliAnaPartCorrBaseClass * ana = ((AliAnaPartCorrBaseClass *) fAnalysisContainer->At(iana)) ;
- ana->Terminate(outputList);
+ if(ana->MakePlotsOn())ana->Terminate(outputList);
}//Loop on analysis defined
}
//Initialize parameters
InitParameters();
- fDataType = kMC;
- fReadStack = kTRUE;
- fReadAODMCParticles = kFALSE;
-
-}
-/*
-//____________________________________________________________________________
-AliCaloTrackMCReader::AliCaloTrackMCReader(const AliCaloTrackMCReader & g) :
- AliCaloTrackReader(g), fDecayPi0(g.fDecayPi0),
- fNeutralParticlesArray(g.fNeutralParticlesArray?new TArrayI(*g.fNeutralParticlesArray):0x0),
- fChargedParticlesArray(g.fChargedParticlesArray?new TArrayI(*g.fChargedParticlesArray):0x0),
- fStatusArray(g.fStatusArray?new TArrayI(*g.fStatusArray):0x0),
- fKeepAllStatus(g.fKeepAllStatus), fCheckOverlap(g.fCheckOverlap),
- fEMCALOverlapAngle( g.fEMCALOverlapAngle), fPHOSOverlapAngle(g.fPHOSOverlapAngle),
- fIndex2ndPhoton(g.fIndex2ndPhoton)
-{
- // cpy ctor
}
-*/
-//_________________________________________________________________________
-//AliCaloTrackMCReader & AliCaloTrackMCReader::operator = (const AliCaloTrackMCReader & source)
-//{
-// // assignment operator
-//
-// if(&source == this) return *this;
-//
-// fDecayPi0 = source.fDecayPi0;
-//
-// delete fChargedParticlesArray;
-// fChargedParticlesArray = source.fChargedParticlesArray?new TArrayI(*source.fChargedParticlesArray):0x0;
-//
-// delete fNeutralParticlesArray;
-// fNeutralParticlesArray = source.fNeutralParticlesArray?new TArrayI(*source.fNeutralParticlesArray):0x0;
-//
-// delete fStatusArray;
-// fStatusArray = source.fStatusArray?new TArrayI(*source.fStatusArray):0x0;
-//
-// fKeepAllStatus = source.fKeepAllStatus ;
-//
-// return *this;
-//
-//}
-//
//_________________________________
AliCaloTrackMCReader::~AliCaloTrackMCReader() {
//Dtor
}
-
//_______________________________________________________________
void AliCaloTrackMCReader::InitParameters()
{
fEMCALOverlapAngle = 2.5 * TMath::DegToRad();
fPHOSOverlapAngle = 0.5 * TMath::DegToRad();
fIndex2ndPhoton = -1;
+
+ fDataType = kMC;
+ fReadStack = kTRUE;
+ fReadAODMCParticles = kFALSE;
+
+ //For this reader we own the objects of the arrays
+ fAODCTS->SetOwner(kTRUE);
+ fAODEMCAL->SetOwner(kTRUE);
+ fAODPHOS->SetOwner(kTRUE);
+
}
+
//____________________________________________________________________________
void AliCaloTrackMCReader::CheckOverlap(const Float_t anglethres, const Int_t imom, Int_t & iPrimary, Int_t & index, TLorentzVector & mom, Int_t & pdg) {
//Check overlap of decay photons
}
//____________________________________________________________________________
-void AliCaloTrackMCReader::FillCalorimeters(Int_t & iParticle, TParticle* particle, TLorentzVector momentum) {
+void AliCaloTrackMCReader::FillCalorimeters(Int_t & iParticle, TParticle* particle, TLorentzVector &momentum) {
//Fill AODCaloClusters or TParticles lists of PHOS or EMCAL
//In PHOS
if(fFillPHOS && momentum.Pt() > fPHOSPtMin){
//Particles in CTS acceptance
if(fCheckFidCut && !fFiducialCut->IsInFiducialCut(momentum,"CTS")) continue;
-
+
+ if(TMath::Abs(pdg) == 11 && GetStack()->Particle(particle->GetFirstMother())->GetPdgCode()==22) continue ;
+
if(fDebug > 3 && momentum.Pt() > 0.2)
printf("AliCaloTrackMCReader::FillInputEvent() - CTS : Selected tracks E %3.2f, pt %3.2f, phi %3.2f, eta %3.2f\n",
momentum.E(),momentum.Pt(),momentum.Phi()*TMath::RadToDeg(),momentum.Eta());
void CheckOverlap(const Float_t anglethres, const Int_t imom, Int_t & iPrimary, Int_t & index, TLorentzVector & mom, Int_t & pdg);
void MakePi0Decay(TLorentzVector &p0, TLorentzVector &p1, TLorentzVector &p2) const ;//, Double_t &angle);
- void FillCalorimeters(Int_t & iParticle, TParticle* particle, TLorentzVector momentum) ;
+ void FillCalorimeters(Int_t & iParticle, TParticle* particle, TLorentzVector & momentum) ;
private:
Bool_t fDecayPi0 ; // If not decayed, decay pi0 by hand
}
if(fAODCTS){
- fAODCTS->Clear() ;
+ if(fDataType!=kMC)fAODCTS->Clear() ;
+ else fAODCTS->Delete() ;
delete fAODCTS ;
}
if(fAODEMCAL){
- fAODEMCAL->Clear() ;
+ if(fDataType!=kMC)fAODEMCAL->Clear() ;
+ else fAODEMCAL->Delete() ;
delete fAODEMCAL ;
}
if(fAODPHOS){
- fAODPHOS->Clear() ;
+ if(fDataType!=kMC)fAODPHOS->Clear() ;
+ else fAODPHOS->Delete() ;
delete fAODPHOS ;
}
//Modules fiducial region
Bool_t CheckCellFiducialRegion(AliVCluster* cluster, AliVCaloCells* cells, AliVEvent * event, Int_t iev=0) const ;
void SetNumberOfCellsFromPHOSBorder(Int_t n) {fNCellsFromPHOSBorder = n; }
- Int_t GetNumberOfCellsFromPHOSBorder() const {return fNCellsFromPHOSBorder; }
- void SetNumberOfCellsFromEMCALBorder(Int_t n) {fEMCALRecoUtils->SetNumberOfCellsFromEMCALBorder(n); }
- Int_t GetNumberOfCellsFromEMCALBorder() const {return fEMCALRecoUtils->GetNumberOfCellsFromEMCALBorder(); }
+ Int_t GetNumberOfCellsFromPHOSBorder() const {return fNCellsFromPHOSBorder; }
+ void SetNumberOfCellsFromEMCALBorder(Int_t n) {fEMCALRecoUtils->SetNumberOfCellsFromEMCALBorder(n) ;}
+ Int_t GetNumberOfCellsFromEMCALBorder() const {return fEMCALRecoUtils->GetNumberOfCellsFromEMCALBorder();}
+ void SwitchOnNoFiducialBorderInEMCALEta0() {fEMCALRecoUtils->SwitchOnNoFiducialBorderInEMCALEta0() ;}
+ void SwitchOffNoFiducialBorderInEMCALEta0() {fEMCALRecoUtils->SwitchOffNoFiducialBorderInEMCALEta0() ;}
+ Bool_t IsEMCALNoBorderAtEta0() const {return fEMCALRecoUtils->IsEMCALNoBorderAtEta0() ;}
// Recalibration
Bool_t IsRecalibrationOn() const { return fRecalibration ; }
//__________________________________________________________________
void AliIsolationCut::MakeIsolationCut(TObjArray * const plCTS, TObjArray * const plNe, AliCaloTrackReader * const reader,
- const Bool_t fillAOD, AliAODPWG4ParticleCorrelation *pCandidate,
- const TString aodArrayRefName,
+ const Bool_t bFillAOD, AliAODPWG4ParticleCorrelation *pCandidate,
+ const TString & aodArrayRefName,
Int_t & n, Int_t & nfrac, Float_t &coneptsum, Bool_t &isolated) const
{
//Search in cone around a candidate particle if it is isolated
nfrac = -1;
coneptsum = -1;
isolated = kFALSE;
- if(fillAOD && reftracks) reftracks->Clear();
+ if(bFillAOD && reftracks) reftracks->Clear();
return ;
}
//Check if there is any particle inside cone with pt larger than fPtThreshold
rad = TMath::Sqrt((eta-etaC)*(eta-etaC)+ (phi-phiC)*(phi-phiC));
if(rad < fConeSize){
- if(fillAOD) {
+ if(bFillAOD) {
ntrackrefs++;
if(ntrackrefs == 1){
reftracks = new TObjArray(0);
- reftracks->SetName(aodArrayRefName+"Tracks");
+ reftracks->SetName(Form("Tracks%s",aodArrayRefName.Data()));
reftracks->SetOwner(kFALSE);
}
reftracks->Add(track);
coneptsum+=pt;
if(pt > fPtThreshold ) n++;
if(pt > fPtFraction*ptC ) nfrac++;
- }
+ } // Inside cone
}// charged particle loop
}//Tracks
nfrac = -1;
coneptsum = -1;
isolated = kFALSE;
- if(fillAOD){
+ if(bFillAOD){
if(reftracks) reftracks->Clear();
if(refclusters)refclusters->Clear();
}
//Check if there is any particle inside cone with pt larger than fPtThreshold
rad = TMath::Sqrt((eta-etaC)*(eta-etaC)+ (phi-phiC)*(phi-phiC));
if(rad < fConeSize){
- if(fillAOD) {
+ if(bFillAOD) {
nclusterrefs++;
if(nclusterrefs==1){
refclusters = new TObjArray(0);
- refclusters->SetName(aodArrayRefName+"Clusters");
+ refclusters->SetName(Form("Clusters%s",aodArrayRefName.Data()));
refclusters->SetOwner(kFALSE);
}
refclusters->Add(calo);
coneptsum+=pt;
if(pt > fPtThreshold ) n++;
//if fPtFraction*ptC<fPtThreshold then consider the fPtThreshold directly
- if(pt > fPtFraction*ptC && pt>fPtThreshold) nfrac++;
+ if(fPtFraction*ptC<fPtThreshold) {
+ if(pt>fPtThreshold) nfrac++ ;
+ }
+ else {
+ if(pt>fPtFraction*ptC) nfrac++;
+ }
}//in cone
}// neutral particle loop
}//neutrals
//printf("Isolation Cut: in cone with: pT>pTthres %d, pT > pTfrac*pTcandidate %d \n",n,nfrac);
//Add reference arrays to AOD when filling AODs only
- if(fillAOD) {
+ if(bFillAOD) {
if(refclusters) pCandidate->AddObjArray(refclusters);
if(reftracks) pCandidate->AddObjArray(reftracks);
}
if(coneptsum < fPtFraction*ptC && coneptsum < fSumPtThreshold) isolated = kTRUE ;
}
- //if(refclusters) delete refclusters;
- //if(reftracks) delete reftracks;
-
}
//__________________________________________________________________
TString GetICParametersList() ;
void MakeIsolationCut(TObjArray * const plCTS, TObjArray * const plNe, AliCaloTrackReader * const reader,
- const Bool_t fillAOD, AliAODPWG4ParticleCorrelation * pCandidate, const TString aodObjArrayName,
+ const Bool_t bFillAOD, AliAODPWG4ParticleCorrelation * pCandidate, const TString &aodObjArrayName,
Int_t &n, Int_t & nfrac, Float_t &ptsum, Bool_t & isolated) const ;
void Print(const Option_t * opt)const;
if(fDebug > 0 && label < 8 ) printf("AliMCAnalysisUtils::CheckOriginInStack() - Mother is parton %d\n",iParent);
//GrandParent of the entity
- TParticle * parent = new TParticle ;
+ TParticle * parent = NULL;
Int_t pPdg = -1;
Int_t pStatus =-1;
if(iParent >= 0){
//____________________________________________________________________________
AliAnaCalorimeterQA::AliAnaCalorimeterQA() :
AliAnaPartCorrBaseClass(), fCalorimeter(""), fStyleMacro(""),
-fMakePlots(kFALSE), fFillAllPosHisto(kFALSE), fFillAllTH12(kFALSE),
+fFillAllPosHisto(kFALSE), fFillAllTH12(kFALSE),
fCorrelateCalos(kFALSE), fNModules(12), fNRCU(2),
fTimeCutMin(-1), fTimeCutMax(9999999),
fEMCALCellAmpMin(0),fPHOSCellAmpMin(0),
AliAnaPartCorrBaseClass::Print(" ");
printf("Select Calorimeter %s \n",fCalorimeter.Data());
- printf("Make plots? %d \n",fMakePlots);
printf("Plots style macro %s \n",fStyleMacro.Data());
printf("Time Cut: %3.1f < TOF < %3.1f\n", fTimeCutMin, fTimeCutMax);
printf("EMCAL Min Amplitude : %2.1f GeV/c\n", fEMCALCellAmpMin) ;
{
//Do plots if requested
- if(GetDebug() > 0) printf("AliAnaCalorimeterQA::Terminate() - Make plots for %s? %d\n",fCalorimeter.Data(), fMakePlots);
- if(!fMakePlots) return;
-
+ if(GetDebug() > 0) printf("AliAnaCalorimeterQA::Terminate() - Make plots for %s? %d\n",fCalorimeter.Data(), MakePlotsOn());
+
//Do some plots to end
if(fStyleMacro!="")gROOT->Macro(fStyleMacro);
//Recover histograms from output histograms list, needed for distributed analysis.
TString GetStyleMacro() const {return fStyleMacro ;}
void SetStyleMacro( TString macro ) {fStyleMacro = macro; }
- void SwitchOnPlotsMaking() {fMakePlots = kTRUE ;}
- void SwitchOffPlotsMaking() {fMakePlots = kFALSE ;}
-
+
void SwitchOnFillAllPositionHistogram() {fFillAllPosHisto = kTRUE ;}
void SwitchOffFillAllPositionHistogram() {fFillAllPosHisto = kFALSE ;}
TString fCalorimeter ; // Calorimeter selection
TString fStyleMacro ; // Location of macro for plots style
- Bool_t fMakePlots ; // Print plots
Bool_t fFillAllPosHisto; // Fill all the position related histograms
Bool_t fFillAllTH12 ; // Fill simple histograms which information is already in TH3 histograms
Bool_t fCorrelateCalos ; // Correlate PHOS/EMCAL clusters
TH2F *fhMCChHad1pOverER02; //! p/E for track-cluster matches, dR > 0.2, MC charged hadrons
TH2F *fhMCNeutral1pOverER02; //! p/E for track-cluster matches, dR > 0.2, MC neutral
- ClassDef(AliAnaCalorimeterQA,11)
+ ClassDef(AliAnaCalorimeterQA,12)
} ;
fDoOwnMix(kFALSE),fNCentrBin(0),//fNZvertBin(0),fNrpBin(0),
fNPID(0),fNmaxMixEv(0), fCalorimeter(""),
fNModules(12), fUseAngleCut(kFALSE), fEventsList(0x0), fMultiCutAna(kFALSE),
-fNPtCuts(0),fPtCuts(0x0),fNAsymCuts(0),fAsymCuts(0x0),
-fNCellNCuts(0),fCellNCuts(0x0),fNPIDBits(0),fPIDBits(0x0),fhReMod(0x0),fhReDiffMod(0x0),
+fNPtCuts(0),fNAsymCuts(0), fNCellNCuts(0),fNPIDBits(0),
+fhReMod(0x0),fhReDiffMod(0x0),
fhRe1(0x0), fhMi1(0x0), fhRe2(0x0), fhMi2(0x0), fhRe3(0x0), fhMi3(0x0),
fhReInvPt1(0x0), fhMiInvPt1(0x0), fhReInvPt2(0x0), fhMiInvPt2(0x0), fhReInvPt3(0x0), fhMiInvPt3(0x0),
fhRePtNCellAsymCuts(0x0), fhRePIDBits(0x0),
fMultiCutAna = kFALSE;
fNPtCuts = 3;
- fPtCuts = new Float_t[fNPtCuts];
- fPtCuts[0] = 0.; fPtCuts[1] = 0.2; fPtCuts[2] = 0.3;
+ fPtCuts[0] = 0.; fPtCuts[1] = 0.2; fPtCuts[2] = 0.3;fPtCuts[3] = 0.; fPtCuts[4] = 0.;
fNAsymCuts = 3;
- fAsymCuts = new Float_t[fNAsymCuts];
- fAsymCuts[0] = 0.7; fAsymCuts[1] = 0.8; fAsymCuts[2] = 1.;
+ fAsymCuts[0] = 0.7; fAsymCuts[1] = 0.8; fAsymCuts[2] = 1.; fAsymCuts[3] = 0.; fAsymCuts[4] = 0.;
fNCellNCuts = 3;
- fCellNCuts = new Int_t[fNCellNCuts];
- fCellNCuts[0] = 1; fCellNCuts[1] = 2; fCellNCuts[2] = 3;
+ fCellNCuts[0] = 1; fCellNCuts[1] = 2; fCellNCuts[2] = 3; fCellNCuts[3] = 0; fCellNCuts[4] = 0;
fNPIDBits = 3;
- fPIDBits = new Int_t[fNPIDBits];
fPIDBits[0] = 2; fPIDBits[1] = 4; fPIDBits[2] = 6; // check dispersion, neutral, dispersion&&neutral
-
+ fPIDBits[3] = 0; fPIDBits[4] = 0;
}
void SwitchOnMultipleCutAnalysis() {fMultiCutAna = kTRUE;}
void SwitchOffMultipleCutAnalysis() {fMultiCutAna = kFALSE;}
- void SetPtCuts (Int_t ncuts) {fNPtCuts = ncuts;}
- void SetAsymCuts (Int_t ncuts) {fNAsymCuts = ncuts;}
- void SetCellNCuts(Int_t ncuts) {fNCellNCuts = ncuts;}
- void SetPIDBits (Int_t ncuts) {fNPIDBits = ncuts;}
-
- void SetPtCuts (Float_t * cuts) {fPtCuts = cuts;}
- void SetAsymCuts (Float_t * cuts) {fAsymCuts = cuts;}
- void SetCellNCuts(Int_t * cuts) {fCellNCuts = cuts;}
- void SetPIDBits (Int_t * cuts) {fPIDBits = cuts;}
-
+ void SetNPtCuts (Int_t size) {if(size <= 5)fNPtCuts = size; }
+ void SetNAsymCuts (Int_t size) {if(size <= 5)fNAsymCuts = size; }
+ void SetNNCellCuts(Int_t size) {if(size <= 5)fNCellNCuts = size; }
+ void SetNPIDBits (Int_t size) {if(size <= 5)fNPIDBits = size; }
+
+ void SetPtCutsAt (Int_t pos,Float_t val) {if(pos < 5)fPtCuts[pos] = val;}
+ void SetAsymCutsAt (Int_t pos,Float_t val) {if(pos < 5)fAsymCuts[pos] = val;}
+ void SetNCellCutsAt(Int_t pos,Float_t val) {if(pos < 5)fCellNCuts[pos] = val;}
+ void SetPIDBitsAt (Int_t pos,Float_t val) {if(pos < 5)fPIDBits[pos] = val;}
+
+
private:
Bool_t IsBadRun(Int_t /*iRun*/) const {return kFALSE;} //Tests if this run bad according to private list
private:
Bool_t fDoOwnMix; // Do combinatorial background not the one provided by the frame
Int_t fNCentrBin ; // Number of bins in event container for centrality
- // Int_t fNZvertBin ; // Number of bins in event container for vertex position
-// Int_t fNrpBin ; // Number of bins in event container for reaction plain
+ // Int_t fNZvertBin ; // Number of bins in event container for vertex position
+ // Int_t fNrpBin ; // Number of bins in event container for reaction plain
Int_t fNPID ; // Number of possible PID combinations
Int_t fNmaxMixEv ; // Maximal number of events stored in buffer for mixing
-// Float_t fZvtxCut ; // Cut on vertex position
+ // Float_t fZvtxCut ; // Cut on vertex position
TString fCalorimeter ; // Select Calorimeter for IM
Int_t fNModules ; // Number of EMCAL/PHOS modules, set as many histogras as modules
Bool_t fUseAngleCut ; // Select pairs depending on their opening angle
TList ** fEventsList ; //! Containers for photons in stored events
Bool_t fMultiCutAna; // Do analysis with several or fixed cut
Int_t fNPtCuts; // number of pt cuts
- Float_t* fPtCuts; //[fNPtCuts] array with different pt cuts
+ Float_t fPtCuts[5]; // array with different pt cuts
Int_t fNAsymCuts; // number of assymmetry cuts
- Float_t* fAsymCuts; //[fNAsymCuts] array with different assymetry cuts
+ Float_t fAsymCuts[5]; // array with different assymetry cuts
Int_t fNCellNCuts; // number of cuts with number of cells in cluster
- Int_t* fCellNCuts; //[fNCellNCuts] array with different cell number cluster cuts
+ Int_t fCellNCuts[5]; // array with different cell number cluster cuts
Int_t fNPIDBits; // number of PID bits to check in multi cuts option
- Int_t* fPIDBits; //[fNPIDBits] array with different pid bits
+ Int_t fPIDBits[5]; // array with different pid bits
//Histograms
TH3D ** fhReMod ; //!REAL two-photon invariant mass distribution for different calorimeter modules.
if(kPrintSettings) anaomegaToPi0Gamma->Print("");
- //---------------------------------------------------------------------
- // Electron/btag
- //---------------------------------------------------------------------
- if(calorimeter=="EMCAL"){
-
- AliAnaBtag *anabtag = new AliAnaBtag();
- anabtag->SetDebug(-1); //10 for lots of messages
- if(kUseKinematics){
- anabtag->SwitchOnDataMC();
- anabtag->SetMinPt(1.);
- }
- anabtag->SetOutputAODName("ElectronsEMCAL");
- anabtag->SetOutputAODClassName("AliAODPWG4Particle");
- //anabtag->SetHistoPtRangeAndNBins(0, 100, 100) ;
- //anabtag->SetHistoPhiRangeAndNBins(0, TMath::TwoPi(), 100) ;
- //anabtag->SetHistoEtaRangeAndNBins(-0.7, 0.7, 100) ;
- if(kPrintSettings)anabtag->Print("");
- }
+// //---------------------------------------------------------------------
+// // Electron/btag
+// //---------------------------------------------------------------------
+// if(calorimeter=="EMCAL"){
+//
+// AliAnaBtag *anabtag = new AliAnaBtag();
+// anabtag->SetDebug(-1); //10 for lots of messages
+// if(kUseKinematics){
+// anabtag->SwitchOnDataMC();
+// anabtag->SetMinPt(1.);
+// }
+// anabtag->SetOutputAODName("ElectronsEMCAL");
+// anabtag->SetOutputAODClassName("AliAODPWG4Particle");
+// //anabtag->SetHistoPtRangeAndNBins(0, 100, 100) ;
+// //anabtag->SetHistoPhiRangeAndNBins(0, TMath::TwoPi(), 100) ;
+// //anabtag->SetHistoEtaRangeAndNBins(-0.7, 0.7, 100) ;
+// if(kPrintSettings)anabtag->Print("");
+// }
//==================================
// ### Isolation analysis ###
maker->AddAnalysis(anapi0,n++);
maker->AddAnalysis(anapi0ebe,n++);
maker->AddAnalysis(anaomegaToPi0Gamma,n++);
- if(calorimeter=="EMCAL")maker->AddAnalysis(anabtag,n++);
+ //if(calorimeter=="EMCAL")maker->AddAnalysis(anabtag,n++);
// Isolation analysis
maker->AddAnalysis(anaisol,n++);
maker->AddAnalysis(anaisolpi0,n++);
--- /dev/null
+AliAnalysisTaskParticleCorrelation *AddTaskPi0(TString data, TString calorimeter, Bool_t kPrintSettings = kFALSE,Bool_t kSimulation = kFALSE, Bool_t outputAOD=kFALSE, Bool_t oldAOD=kFALSE)
+{
+ // Creates a PartCorr task, configures it and adds it to the analysis manager.
+
+ // Get the pointer to the existing analysis manager via the static access method.
+ //==============================================================================
+ AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
+ if (!mgr) {
+ ::Error("AddTaskPi0", "No analysis manager to connect to.");
+ return NULL;
+ }
+
+ // Check the analysis type using the event handlers connected to the analysis manager.
+ //==============================================================================
+ if (!mgr->GetInputEventHandler()) {
+ ::Error("AddTaskPi0", "This task requires an input event handler");
+ return NULL;
+ }
+ TString inputDataType = "AOD";
+ if(!data.Contains("delta"))
+ inputDataType = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD"
+ //cout<<"DATA TYPE :: "<<inputDataType<<endl;
+ // inputDataType: data managed by the input handler
+ // data: can be same as one managed by input handler, or the output AOD created by the filter. By default use AOD
+
+ Bool_t kUseKinematics = kFALSE;
+ if(kSimulation) {
+ kUseKinematics = (mgr->GetMCtruthEventHandler())?kTRUE:kFALSE;
+ if (!kUseKinematics && data=="AOD" && inputDataType != "ESD") kUseKinematics = kTRUE; //AOD primary should be available ...
+ }
+
+ cout<<"********* ACCESS KINE? "<<kUseKinematics<<endl;
+
+ // Configure analysis
+ //===========================================================================
+
+ // *** Reader ***
+ AliCaloTrackReader * reader = ;
+ if(data.Contains("AOD")) reader = new AliCaloTrackAODReader();
+ else if(data=="ESD") reader = new AliCaloTrackESDReader();
+ else if(data=="MC" && inputDataType == "ESD") reader = new AliCaloTrackMCReader();
+ reader->SetDebug(-1);//10 for lots of messages
+ reader->SwitchOnCTS();
+ //reader->SetDeltaAODFileName("");
+ //if(!kSimulation) reader->SetFiredTriggerClassName("CINT1B-ABCE-NOPF-ALL");
+ if(calorimeter == "EMCAL") {
+ reader->SwitchOnEMCALCells();
+ reader->SwitchOnEMCAL();
+ }
+ if(calorimeter == "PHOS") {
+ reader->SwitchOnPHOSCells();
+ reader->SwitchOnPHOS();
+ }
+
+ // for case data="deltaAOD", no need to fill the EMCAL/PHOS cluster lists
+ if(data.Contains("delta")){
+ reader->SwitchOffEMCAL();
+ reader->SwitchOffPHOS();
+ reader->SwitchOffEMCALCells();
+ reader->SwitchOffPHOSCells();
+ }
+
+ if(kUseKinematics){
+ if(inputDataType == "ESD"){
+ reader->SwitchOnStack();
+ reader->SwitchOffAODMCParticles();
+ }
+ else if(inputDataType == "AOD"){
+ reader->SwitchOffStack();
+ reader->SwitchOnAODMCParticles();
+ }
+ }
+
+ //Min particle pT
+ reader->SetEMCALPtMin(0.1);
+ reader->SetPHOSPtMin(0.);
+ reader->SetCTSPtMin(0.);
+ if(outputAOD) reader->SwitchOnWriteDeltaAOD() ;
+ if(oldAOD) reader->SwitchOnOldAODs();
+ if(kPrintSettings) reader->Print("");
+
+ // *** Calorimeters Utils ***
+ AliCalorimeterUtils *cu = new AliCalorimeterUtils;
+ // Remove clusters close to borders, at least max energy cell is 1 cell away
+ cu->SetNumberOfCellsFromEMCALBorder(1);
+ cu->SetNumberOfCellsFromPHOSBorder(2);
+
+ // Remove EMCAL hottest channels for first LHC10 periods
+ cu->SwitchOnBadChannelsRemoval();
+ // SM0
+ cu->SetEMCALChannelStatus(0,3,13); cu->SetEMCALChannelStatus(0,44,1); cu->SetEMCALChannelStatus(0,3,13);
+ cu->SetEMCALChannelStatus(0,20,7); cu->SetEMCALChannelStatus(0,38,2);
+ // SM1
+ cu->SetEMCALChannelStatus(1,4,7); cu->SetEMCALChannelStatus(1,4,13); cu->SetEMCALChannelStatus(1,9,20);
+ cu->SetEMCALChannelStatus(1,14,15); cu->SetEMCALChannelStatus(1,23,16); cu->SetEMCALChannelStatus(1,32,23);
+ cu->SetEMCALChannelStatus(1,37,5); cu->SetEMCALChannelStatus(1,40,1); cu->SetEMCALChannelStatus(1,40,2);
+ cu->SetEMCALChannelStatus(1,40,5); cu->SetEMCALChannelStatus(1,41,0); cu->SetEMCALChannelStatus(1,41,1);
+ cu->SetEMCALChannelStatus(1,41,2); cu->SetEMCALChannelStatus(1,41,4);
+ // SM2
+ cu->SetEMCALChannelStatus(2,14,15); cu->SetEMCALChannelStatus(2,18,16); cu->SetEMCALChannelStatus(2,18,17);
+ cu->SetEMCALChannelStatus(2,18,18); cu->SetEMCALChannelStatus(2,18,20); cu->SetEMCALChannelStatus(2,18,21);
+ cu->SetEMCALChannelStatus(2,18,23); cu->SetEMCALChannelStatus(2,19,16); cu->SetEMCALChannelStatus(2,19,17);
+ cu->SetEMCALChannelStatus(2,19,19); cu->SetEMCALChannelStatus(2,19,20); cu->SetEMCALChannelStatus(2,19,21);
+ cu->SetEMCALChannelStatus(2,19,22);
+ //SM3
+ cu->SetEMCALChannelStatus(3,4,7);
+
+
+ //Recalibration
+ //cu->SwitchOnRecalibration();
+ //TFile * f = new TFile("RecalibrationFactors.root","read");
+ //cu->SetEMCALChannelRecalibrationFactors(0,(TH2F*)f->Get("EMCALRecalFactors_SM0"));
+ //cu->SetEMCALChannelRecalibrationFactors(1,(TH2F*)f->Get("EMCALRecalFactors_SM1"));
+ //cu->SetEMCALChannelRecalibrationFactors(2,(TH2F*)f->Get("EMCALRecalFactors_SM2"));
+ //cu->SetEMCALChannelRecalibrationFactors(3,(TH2F*)f->Get("EMCALRecalFactors_SM3"));
+ //f->Close();
+
+ cu->SetDebug(-1);
+ if(kPrintSettings) cu->Print("");
+
+
+ // ##### Analysis algorithm settings ####
+
+ // -------------------------------------------------
+ // --- Photon/Pi0/Omega/Electron Analysis ---
+ // -------------------------------------------------
+
+ AliAnaPhoton *anaphoton = new AliAnaPhoton();
+ anaphoton->SetDebug(-1); //10 for lots of messages
+ if(calorimeter == "PHOS"){
+ anaphoton->SetNCellCut(0);// At least 2 cells
+ anaphoton->SetMinPt(0.);
+ anaphoton->SetMinDistanceToBadChannel(2, 4, 5);
+ }
+ else {//EMCAL
+ //anaphoton->SetNCellCut(0);// At least 2 cells
+ anaphoton->SetMinPt(0.1); // no effect minium EMCAL cut.
+ if(!kUseKinematics) anaphoton->SetTimeCut(400,900);// Time window of [400-900] ns
+ anaphoton->SetMinDistanceToBadChannel(6, 12, 18);
+ }
+ anaphoton->SetCalorimeter(calorimeter);
+ if(kUseKinematics) anaphoton->SwitchOnDataMC() ;//Access MC stack and fill more histograms
+ else anaphoton->SwitchOffDataMC() ;
+ anaphoton->SwitchOffCaloPID();
+ anaphoton->SwitchOffFiducialCut();
+ if(kSimulation){
+ anaphoton->SwitchOnFiducialCut();
+ AliFiducialCut * fidCut1stYear = anaphoton->GetFiducialCut();
+ fidCut1stYear->DoCTSFiducialCut(kFALSE) ;
+ fidCut1stYear->DoEMCALFiducialCut(kTRUE) ;
+ fidCut1stYear->DoPHOSFiducialCut(kTRUE) ;
+ fidCut1stYear->SetSimpleEMCALFiducialCut(0.7,80.,120.);
+ fidCut1stYear->SetSimplePHOSFiducialCut(0.12,260.,320.);
+ }
+
+ if(!data.Contains("delta")) {
+ anaphoton->SetOutputAODName(Form("Photons%s",calorimeter.Data()));
+ anaphoton->SetOutputAODClassName("AliAODPWG4ParticleCorrelation");
+ }
+ else anaphoton->SetInputAODName(Form("Photons%s",calorimeter.Data()));
+ anaphoton->AddToHistogramsName("AnaPhotonCorr_");
+ //Set Histograms bins and ranges
+ anaphoton->SetHistoPtRangeAndNBins(0, 50, 200) ;
+ // ana->SetHistoPhiRangeAndNBins(0, TMath::TwoPi(), 100) ;
+ // ana->SetHistoEtaRangeAndNBins(-0.7, 0.7, 100) ;
+ if(kPrintSettings) anaphoton->Print("");
+
+ // -----------------------------------
+ // --- Pi0 Invariant Mass Analysis ---
+ // -----------------------------------
+
+ AliAnaPi0 *anapi0 = new AliAnaPi0();
+ anapi0->SetDebug(-1);//10 for lots of messages
+ anapi0->SetInputAODName(Form("Photons%s",calorimeter.Data()));
+ anapi0->SetCalorimeter(calorimeter);
+
+ anapi0->SwitchOnMultipleCutAnalysis();
+ anapi0->SetNPtCuts(2);
+ anapi0->SetNAsymCuts(2);
+ anapi0->SetNNCellCuts(2);
+ anapi0->SetNPIDBits(2);
+
+ anapi0->SetPtCutsAt(0,0.3); anapi0->SetPtCutsAt(1,0.5);
+ anapi0->SetAsymCutsAt(0,0.1);anapi0->SetAsymCutsAt(1,0.5);
+ anapi0->SetNCellCutsAt(0,1); anapi0->SetNCellCutsAt(1,2);
+ anapi0->SetPIDBitsAt(0,2); anapi0->SetPIDBitsAt(1,4);
+
+
+ if(kSimulation){
+ anapi0->SwitchOnFiducialCut();
+ AliFiducialCut * fidCut1stYear = anapi0->GetFiducialCut();
+ fidCut1stYear->DoCTSFiducialCut(kFALSE) ;
+ fidCut1stYear->DoEMCALFiducialCut(kTRUE) ;
+ fidCut1stYear->DoPHOSFiducialCut(kTRUE) ;
+ fidCut1stYear->SetSimpleEMCALFiducialCut(0.7,80.,120.);
+ fidCut1stYear->SetSimplePHOSFiducialCut(0.12,260.,320.);
+ }
+
+ anapi0->SetNPID(1); //Available from tag AliRoot::v4-18-15-AN
+ //settings for pp collision mixing
+ anapi0->SwitchOnOwnMix(); //Off when mixing done with general mixing frame
+ anapi0->SetNCentrBin(1);
+ anapi0->SetNZvertBin(1);
+ anapi0->SetNRPBin(1);
+ anapi0->SetNMaxEvMix(10);
+
+ if(kUseKinematics)anapi0->SwitchOnDataMC() ;//Access MC stack and fill more histograms
+ else anapi0->SwitchOffDataMC() ;
+ if(calorimeter=="PHOS") anapi0->SetNumberOfModules(3); //PHOS first year
+ else anapi0->SetNumberOfModules(4); //EMCAL first year
+ anapi0->SetHistoPtRangeAndNBins(0, 50, 200) ;
+ //anapi0->SetHistoPhiRangeAndNBins(0, TMath::TwoPi(), 100) ;
+ //anapi0->SetHistoEtaRangeAndNBins(-0.8, 0.8, 200) ;
+ anapi0->SetHistoMassRangeAndNBins(0., 0.6, 200) ;
+ anapi0->SetHistoAsymmetryRangeAndNBins(0., 1. , 10) ;
+ if(kPrintSettings) anapi0->Print("");
+
+
+
+ // #### Configure Maker ####
+ AliAnaPartCorrMaker * maker = new AliAnaPartCorrMaker();
+ maker->SetReader(reader);//pointer to reader
+ maker->SetCaloUtils(cu); //pointer to calorimeter utils
+ Int_t n = 0;//Analysis number, order is important
+ // Particle selection analysis
+ maker->AddAnalysis(anaphoton,n++);
+ maker->AddAnalysis(anapi0,n++);
+ maker->SetAnaDebug(-1) ;
+ maker->SwitchOnHistogramsMaker() ;
+ if(data.Contains("delta")) maker->SwitchOffAODsMaker() ;
+ else maker->SwitchOnAODsMaker() ;
+
+ if(kPrintSettings) maker->Print("");
+
+ printf("======================== \n");
+ printf(" End Configuration of Pi0 analysis with detector %s \n",calorimeter.Data());
+ printf("======================== \n");
+
+ // Create task
+ //===========================================================================
+ AliAnalysisTaskParticleCorrelation * task = new AliAnalysisTaskParticleCorrelation (Form("PartCorr%s",calorimeter.Data()));
+ task->SetConfigFileName(""); //Don't configure the analysis via configuration file.
+ //task->SetDebugLevel(-1);
+ task->SelectCollisionCandidates();
+ task->SetAnalysisMaker(maker);
+ //if(!kSimulation)task->SelectCollisionCandidates(); //AliPhysicsSelection has to be attached before.
+ mgr->AddTask(task);
+
+ //Create containers
+ char name[128];
+ sprintf(name,"PartCorr_%s",calorimeter.Data());
+ cout<<"Name of task "<<name<<endl;
+ //AliAnalysisDataContainer *cout_pc = mgr->CreateContainer(Form(name),TList::Class(),
+ // AliAnalysisManager::kOutputContainer, Form("PartCorr_%s.root",calorimeter.Data()));
+
+ TString outputfile = AliAnalysisManager::GetCommonFileName();
+ // AliAnalysisDataContainer *cout_pc = mgr->CreateContainer(Form("PartCorr_%s",calorimeter.Data()), TList::Class(), AliAnalysisManager::kOutputContainer, Form("%s:PartCorr_%s",outputfile.Data(),calorimeter.Data()));
+ AliAnalysisDataContainer *cout_pc = mgr->CreateContainer(calorimeter.Data(), TList::Class(),
+ AliAnalysisManager::kOutputContainer,
+ Form("%s:PartCorr",outputfile.Data()));
+
+ AliAnalysisDataContainer *cout_cuts = mgr->CreateContainer(Form("%sCuts",calorimeter.Data()), TList::Class(),
+ AliAnalysisManager::kParamContainer,
+ Form("%s:PartCorrCuts",outputfile.Data()));
+
+ // Create ONLY the output containers for the data produced by the task.
+ // Get and connect other common input/output containers via the manager as below
+ //==============================================================================
+ mgr->ConnectInput (task, 0, mgr->GetCommonInputContainer());
+ // AOD output slot will be used in a different way in future
+ if(!data.Contains("delta") && outputAOD) mgr->ConnectOutput (task, 0, mgr->GetCommonOutputContainer());
+ mgr->ConnectOutput (task, 1, cout_pc);
+ mgr->ConnectOutput (task, 2, cout_cuts);
+
+ return task;
+}
+
+