]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Many fixes:
authorgconesab <gconesab@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 27 Oct 2010 16:17:51 +0000 (16:17 +0000)
committergconesab <gconesab@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 27 Oct 2010 16:17:51 +0000 (16:17 +0000)
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

16 files changed:
PWG4/PartCorrBase/AliAnaPartCorrBaseClass.cxx
PWG4/PartCorrBase/AliAnaPartCorrBaseClass.h
PWG4/PartCorrBase/AliAnaPartCorrMaker.cxx
PWG4/PartCorrBase/AliCaloTrackMCReader.cxx
PWG4/PartCorrBase/AliCaloTrackMCReader.h
PWG4/PartCorrBase/AliCaloTrackReader.cxx
PWG4/PartCorrBase/AliCalorimeterUtils.h
PWG4/PartCorrBase/AliIsolationCut.cxx
PWG4/PartCorrBase/AliIsolationCut.h
PWG4/PartCorrBase/AliMCAnalysisUtils.cxx
PWG4/PartCorrDep/AliAnaCalorimeterQA.cxx
PWG4/PartCorrDep/AliAnaCalorimeterQA.h
PWG4/PartCorrDep/AliAnaPi0.cxx
PWG4/PartCorrDep/AliAnaPi0.h
PWG4/macros/AddTaskPartCorr.C
PWG4/macros/AddTaskPi0.C [new file with mode: 0644]

index 9b685b044d85df243ad863d50ce4fbc6c81374f5..8ea2fe34afd81bb4e0916b8dbc0bc5eee3030a18 100755 (executable)
@@ -48,7 +48,7 @@ ClassImp(AliAnaPartCorrBaseClass)
     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(""),
@@ -519,6 +519,7 @@ void AliAnaPartCorrBaseClass::Print(const Option_t * opt) const
   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);
index 6b592786db5cd92ccb03a1d556e45d24294ec7b4..b0e5233117acf4260482cc44c601494d30c55b0f 100755 (executable)
@@ -246,6 +246,10 @@ public:
 
        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     
@@ -262,7 +266,8 @@ private:
   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
   
@@ -300,7 +305,7 @@ private:
   Float_t fHistoAsymMax  ;  // Maximum value of asymmetry histogram range
   Float_t fHistoAsymMin  ;  // Minimum value of asymmetry histogram range
   
-  ClassDef(AliAnaPartCorrBaseClass,10)
+  ClassDef(AliAnaPartCorrBaseClass,11)
 } ;
 
 
index 3bb7877a6450cc429e52cb73094c936b3078b5a9..8f78e8acbac8e84ef57d8cde0ffbfd5de1380358 100755 (executable)
@@ -343,7 +343,7 @@ void AliAnaPartCorrMaker::Terminate(TList * outputList)
   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
 }
index 913929c16cf70fa9fafee7da56c25707faa41759..d44df993bc1b1be6af9c7c8aef184f45b1f777a1 100755 (executable)
@@ -56,49 +56,7 @@ AliCaloTrackMCReader::AliCaloTrackMCReader() :
   
   //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
@@ -121,7 +79,6 @@ void AliCaloTrackMCReader::GetVertex(Double_t  v[3]) const {
 
 }
 
-
 //_______________________________________________________________
 void AliCaloTrackMCReader::InitParameters()
 {
@@ -145,7 +102,18 @@ 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
@@ -189,7 +157,7 @@ void  AliCaloTrackMCReader::CheckOverlap(const Float_t anglethres, const Int_t i
 }
 
 //____________________________________________________________________________
-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){
@@ -278,7 +246,9 @@ Bool_t AliCaloTrackMCReader::FillInputEvent(const Int_t iEntry, const char * cur
          //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());
index 67dafe6e7011677c80be267556fc80d6640daa8e..4fcce5fe8613c6a6e51098cba682df2206798675 100755 (executable)
@@ -87,7 +87,7 @@ public:
   
   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
index 27645fd53d583c77b73f1c4c2079b9126fd3b8c9..a331d006e13a43ebf99ba07334a47dfe03ee9d9f 100755 (executable)
@@ -87,17 +87,20 @@ AliCaloTrackReader::~AliCaloTrackReader() {
   }  
   
   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 ;
   }
   
index 3af0bc2c7c41d33f0f0d483483ac277e3874a1be..e5828cce5fd34866263edce4dcee48db9f022122 100755 (executable)
@@ -99,9 +99,12 @@ class AliCalorimeterUtils : public TObject {
   //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 ; }
index c69842f3cf035687ce2ec749dabf5ef77bcd96c3..7e4cd34a2b7ea0ee2cd505b6583b67f87df37dc9 100755 (executable)
@@ -126,8 +126,8 @@ void AliIsolationCut::InitParameters()
 
 //__________________________________________________________________
 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 
@@ -168,18 +168,18 @@ void  AliIsolationCut::MakeIsolationCut(TObjArray * const plCTS,  TObjArray * co
         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);
@@ -188,7 +188,7 @@ void  AliIsolationCut::MakeIsolationCut(TObjArray * const plCTS,  TObjArray * co
         coneptsum+=pt;
         if(pt > fPtThreshold ) n++;
         if(pt > fPtFraction*ptC ) nfrac++;  
-      }
+      } // Inside cone
     }// charged particle loop
   }//Tracks
   
@@ -239,7 +239,7 @@ void  AliIsolationCut::MakeIsolationCut(TObjArray * const plCTS,  TObjArray * co
         nfrac = -1;
         coneptsum = -1;
         isolated = kFALSE;
-        if(fillAOD){
+        if(bFillAOD){
           if(reftracks)  reftracks->Clear(); 
           if(refclusters)refclusters->Clear(); 
         }
@@ -249,11 +249,11 @@ void  AliIsolationCut::MakeIsolationCut(TObjArray * const plCTS,  TObjArray * co
       //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);
@@ -262,7 +262,12 @@ void  AliIsolationCut::MakeIsolationCut(TObjArray * const plCTS,  TObjArray * co
         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
@@ -270,7 +275,7 @@ void  AliIsolationCut::MakeIsolationCut(TObjArray * const plCTS,  TObjArray * co
   //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);
   }
@@ -290,9 +295,6 @@ void  AliIsolationCut::MakeIsolationCut(TObjArray * const plCTS,  TObjArray * co
     if(coneptsum < fPtFraction*ptC && coneptsum < fSumPtThreshold) isolated  =  kTRUE ;
   }
   
-  //if(refclusters) delete refclusters;
-  //if(reftracks)   delete reftracks;
-  
 }
 
 //__________________________________________________________________
index 4ab9eea0bea132e4a2afb48ea4b31615df37f153..65783f97f96724985127174d885654ca82c7633b 100755 (executable)
@@ -48,7 +48,7 @@ class AliIsolationCut : public TObject {
   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;
index f03481bd1b87758c3ed9970cb5b3e867bf452085..96daf87aa230c322d2a45d5f853b9a3696a02f8c 100755 (executable)
@@ -157,7 +157,7 @@ Int_t AliMCAnalysisUtils::CheckOriginInStack(const Int_t *labels, const Int_t nl
     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){
index 52f8f76e94ba82946b6f81a876e8f64932bd3ef9..d3b4cbddcf34b07583a11e542b7d07beb589c89c 100755 (executable)
@@ -57,7 +57,7 @@ ClassImp(AliAnaCalorimeterQA)
 //____________________________________________________________________________
 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), 
@@ -1187,7 +1187,6 @@ void AliAnaCalorimeterQA::Print(const Option_t * opt) const
   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) ;
@@ -2634,9 +2633,8 @@ void  AliAnaCalorimeterQA::Terminate(TList* outputList)
 {
   //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.   
index a814990392e190fba336abf2de5fa264734034e3..cbe8a7a877865b3d0d47675da52f1c3394db2fac 100755 (executable)
@@ -55,9 +55,7 @@ public:
   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 ;}
   
@@ -227,7 +225,6 @@ public:
   
   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
@@ -491,7 +488,7 @@ public:
   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)
 } ;
 
 
index 34ee46e3990762d1f56663af57a52fd5b015748d..bfcad99268fbec0460a21c35e00707d7e74e8961 100755 (executable)
@@ -56,8 +56,8 @@ AliAnaPi0::AliAnaPi0() : AliAnaPartCorrBaseClass(),
 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),
@@ -111,21 +111,17 @@ void AliAnaPi0::InitParameters()
   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;
 }
 
 
index a3c838725e1372c5b13919c3314e098f03071d17..5d1a3c42d39bd8e5c20e8f847ab03a3830459a5d 100755 (executable)
@@ -82,40 +82,41 @@ class AliAnaPi0 : public AliAnaPartCorrBaseClass {
   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.
index 725a5c0f4a44d877c4ee15629551280cd34bef43..ffb41b7277d9bd02b46b0b12e7de68898f04c1e4 100644 (file)
@@ -265,24 +265,24 @@ AliAnalysisTaskParticleCorrelation *AddTaskPartCorr(TString data, TString calori
   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 ###        
@@ -484,7 +484,7 @@ AliAnalysisTaskParticleCorrelation *AddTaskPartCorr(TString data, TString calori
   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++);
diff --git a/PWG4/macros/AddTaskPi0.C b/PWG4/macros/AddTaskPi0.C
new file mode 100644 (file)
index 0000000..6bfb63d
--- /dev/null
@@ -0,0 +1,278 @@
+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;
+}
+
+