QA: Do not access directly the CaloClusters from the Event but those filtered by...
authorgconesab <gconesab@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 17 Aug 2010 17:12:49 +0000 (17:12 +0000)
committergconesab <gconesab@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 17 Aug 2010 17:12:49 +0000 (17:12 +0000)
AddTaskPartCorr.C: If requested, fill deltaAOD, as it was, always off.

PWG4/PartCorrDep/AliAnaCalorimeterQA.cxx
PWG4/PartCorrDep/AliAnaCalorimeterQA.h
PWG4/macros/AddTaskPartCorr.C
PWG4/macros/QA/AddTaskCalorimeterQA.C

index a32f066..58929ad 100755 (executable)
@@ -1025,7 +1025,7 @@ TList *  AliAnaCalorimeterQA::GetCreateOutputObjects()
                fhGenGamAccEta = new TH1F("hGenGamAccEta","Y of generated #gamma in calorimeter acceptance",netabins,etamin,etamax);
                fhGenGamAccPhi = new TH1F("hGenGamAccPhi","#phi of generated #gamma  in calorimeter acceptance",nphibins,phimin,phimax);
                
-               fhGenPi0AccE  = new TH1F("hGenPi0AccE" ,"E of generated #pi^{0} in calorimeter acceptance",nptbins,ptmin,ptmax);
+               fhGenPi0AccE   = new TH1F("hGenPi0AccE" ,"E of generated #pi^{0} in calorimeter acceptance",nptbins,ptmin,ptmax);
                fhGenPi0AccPt  = new TH1F("hGenPi0AccPt" ,"p_{T} of generated #pi^{0} in calorimeter acceptance",nptbins,ptmin,ptmax);
                fhGenPi0AccEta = new TH1F("hGenPi0AccEta","Y of generated #pi^{0} in calorimeter acceptance",netabins,etamin,etamax);
                fhGenPi0AccPhi = new TH1F("hGenPi0AccPhi","#phi of generated #pi^{0} in calorimeter acceptance",nphibins,phimin,phimax);
@@ -1199,9 +1199,9 @@ void AliAnaCalorimeterQA::Print(const Option_t * opt) const
 void  AliAnaCalorimeterQA::MakeAnalysisFillHistograms() 
 {
   //Fill Calorimeter QA histograms
-       TLorentzVector mom ;
+       TLorentzVector mom  ;
        TLorentzVector mom2 ;
-       TRefArray * caloClusters = new TRefArray();
+       TObjArray * caloClusters = NULL;
        Int_t nLabel = 0;
        Int_t *labels=0x0;
        Int_t nCaloClusters = 0;
@@ -1251,11 +1251,15 @@ void  AliAnaCalorimeterQA::MakeAnalysisFillHistograms()
        
        
   //Get List with CaloClusters  
-       
-  if     (fCalorimeter == "EMCAL") GetReader()->GetInputEvent()->GetEMCALClusters(caloClusters);//GetAODEMCAL();
-  else if(fCalorimeter == "PHOS") GetReader()->GetInputEvent()->GetPHOSClusters (caloClusters);//GetAODPHOS();
-  else 
-    AliFatal(Form("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - Wrong calorimeter name <%s>, END\n", fCalorimeter.Data()));
+  if      (fCalorimeter == "PHOS")  caloClusters = GetAODPHOS();
+  else if (fCalorimeter == "EMCAL") caloClusters = GetAODEMCAL();
+ else 
+      AliFatal(Form("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - Wrong calorimeter name <%s>, END\n", fCalorimeter.Data()));
+  
+//  if     (fCalorimeter == "EMCAL") GetReader()->GetInputEvent()->GetEMCALClusters(caloClusters);//GetAODEMCAL();
+//  else if(fCalorimeter == "PHOS")  GetReader()->GetInputEvent()->GetPHOSClusters (caloClusters);//GetAODPHOS();
+//  else 
+//    AliFatal(Form("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - Wrong calorimeter name <%s>, END\n", fCalorimeter.Data()));
        
        if(!caloClusters) 
                AliFatal(Form("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - No CaloClusters available\n"));
@@ -1263,8 +1267,9 @@ void  AliAnaCalorimeterQA::MakeAnalysisFillHistograms()
   //----------------------------------------------------------
   //Correlate Calorimeters
   //----------------------------------------------------------
-       if(fCorrelateCalos)     CorrelateCalorimeters(caloClusters);
-  
+       //if(fCorrelateCalos)   CorrelateCalorimeters(caloClusters);
+  if(fCorrelateCalos)  CorrelateCalorimeters();
+
        
   //----------------------------------------------------------
   // CALOCLUSTERS
@@ -1296,18 +1301,9 @@ void  AliAnaCalorimeterQA::MakeAnalysisFillHistograms()
                if(GetReader()->GetDataType()==AliCaloTrackReader::kESD){
                        AliVCluster* clus =  (AliVCluster*)caloClusters->At(iclus);
                        AliVCaloCells * cell = 0x0; 
-                       if(fCalorimeter == "PHOS") cell =  GetReader()->GetInputEvent()->GetPHOSCells();
-                       else                               cell =  GetReader()->GetInputEvent()->GetEMCALCells();
-                       
-      //Check if the cluster contains any bad channel or it is close to the calorimeter borders
-                       if( GetCaloUtils()->ClusterContainsBadChannel(fCalorimeter,clus->GetCellsAbsId(), clus->GetNCells())) continue; 
-                       if(!GetCaloUtils()->CheckCellFiducialRegion(clus, cell, GetReader()->GetInputEvent(), 0)) continue;
-      //Recalibrate the cluster energy 
-                       if( GetCaloUtils()->IsRecalibrationOn())        {
-                               Float_t energy = GetCaloUtils()->RecalibrateClusterEnergy(clus, cell);
-                               clus->SetE(energy);
-                       }
-                       
+                       if(fCalorimeter == "PHOS") cell =  GetPHOSCells();
+                       else                                     cell =  GetEMCALCells();
+                                               
       //Get cluster kinematics
                        clus->GetPosition(pos);
                        clus->GetMomentum(mom,v);
@@ -1419,9 +1415,9 @@ void  AliAnaCalorimeterQA::MakeAnalysisFillHistograms()
             fhDeltaCellClusterRNCells->Fill(r-rcell, nCaloCellsPerCluster) ; 
             fhDeltaCellClusterRE     ->Fill(r-rcell, mom.E())  ; 
             
-            //                         printf("x cluster %f, x cell %f, cluster-cell %f\n",pos[0], cellpos[0],pos[0]-cellpos[0]);
-            //                         printf("y cluster %f, y cell %f, cluster-cell %f\n",pos[1], cellpos[1],pos[1]-cellpos[1]);
-            //                         printf("z cluster %f, z cell %f, cluster-cell %f\n",pos[2], cellpos[2],pos[2]-cellpos[2]);
+            //                   printf("x cluster %f, x cell %f, cluster-cell %f\n",pos[0], cellpos[0],pos[0]-cellpos[0]);
+            //                 printf("y cluster %f, y cell %f, cluster-cell %f\n",pos[1], cellpos[1],pos[1]-cellpos[1]);
+            //                 printf("z cluster %f, z cell %f, cluster-cell %f\n",pos[2], cellpos[2],pos[2]-cellpos[2]);
             //                                 printf("r cluster %f, r cell %f, cluster-cell %f\n",r,      rcell,     r-rcell);
           }//PHOS and its matrices are available
         }//Fill all position histograms
@@ -1469,11 +1465,8 @@ void  AliAnaCalorimeterQA::MakeAnalysisFillHistograms()
         for(Int_t jclus = iclus + 1 ; jclus < nCaloClusters ; jclus++) {
                                        AliVCluster* clus2 =  (AliVCluster*)caloClusters->At(jclus);
                                        AliVCaloCells  * cell2 = 0x0; 
-                                       if(fCalorimeter == "PHOS") cell2 =  GetReader()->GetInputEvent()->GetPHOSCells();
-                                       else                               cell2 =  GetReader()->GetInputEvent()->GetEMCALCells();
-          //Check if the cluster contains any bad channel or it is close to calorimeter borders
-                                       if( GetCaloUtils()->ClusterContainsBadChannel(fCalorimeter,clus2->GetCellsAbsId(), clus2->GetNCells())) continue;
-                                       if(!GetCaloUtils()->CheckCellFiducialRegion(clus2, cell2, GetReader()->GetInputEvent(), 0)) continue;
+                                       if(fCalorimeter == "PHOS") cell2 =  GetPHOSCells();
+                                       else                                     cell2 =  GetEMCALCells();
           
           //Get cluster kinematics
                                        clus2->GetMomentum(mom2,v);
@@ -1518,7 +1511,7 @@ void  AliAnaCalorimeterQA::MakeAnalysisFillHistograms()
                fhNClustersMod[imod]->Fill(nClustersInModule[imod]);
        }
        delete [] nClustersInModule;
-       delete caloClusters;
+       //delete caloClusters;
   
   //----------------------------------------------------------
   // CALOCELLS
@@ -1537,9 +1530,9 @@ void  AliAnaCalorimeterQA::MakeAnalysisFillHistograms()
   AliVCaloCells * cell = 0x0; 
   Int_t ncells = 0;
   if(fCalorimeter == "PHOS") 
-    cell =  GetReader()->GetInputEvent()->GetPHOSCells();
+    cell = GetPHOSCells();
   else                       
-    cell = GetReader()->GetInputEvent()->GetEMCALCells();
+    cell = GetEMCALCells();
   
   if(!cell) {
     printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - STOP: No %s ESD CELLS available for analysis\n",fCalorimeter.Data());
@@ -1573,7 +1566,7 @@ void  AliAnaCalorimeterQA::MakeAnalysisFillHistograms()
       //Get Recalibration factor if set
       if (GetCaloUtils()->IsRecalibrationOn()) {
         if(fCalorimeter == "PHOS") recalF = GetCaloUtils()->GetPHOSChannelRecalibrationFactor(nModule,icol,irow);
-        else                          recalF = GetCaloUtils()->GetEMCALChannelRecalibrationFactor(nModule,icol,irow);
+        else                              recalF = GetCaloUtils()->GetEMCALChannelRecalibrationFactor(nModule,icol,irow);
         if(fCalorimeter == "PHOS")printf("Recalibration factor (sm,row,col)=(%d,%d,%d) -  %f\n",nModule,icol,irow,recalF);
       }
       
@@ -1695,8 +1688,9 @@ void  AliAnaCalorimeterQA::MakeAnalysisFillHistograms()
 }
 
 
-//__________________________________
-void AliAnaCalorimeterQA::ClusterHistograms(const TLorentzVector mom, const Double_t tof, Float_t *pos, Float_t *showerShape,
+//_____________________________________________________________________________________________
+void AliAnaCalorimeterQA::ClusterHistograms(const TLorentzVector mom, const Double_t tof, 
+                                            Float_t *pos, Float_t *showerShape,
                                             const Int_t nCaloCellsPerCluster,const Int_t nModule,
                                             const Int_t nTracksMatched,  const AliVTrack * track,  
                                             const Int_t * labels, const Int_t nLabels){
@@ -2179,23 +2173,68 @@ void AliAnaCalorimeterQA::ClusterHistograms(const TLorentzVector mom, const Doub
 }// Clusters
 
 //__________________________________
-void AliAnaCalorimeterQA::CorrelateCalorimeters(TRefArray* refArray){
+//void AliAnaCalorimeterQA::CorrelateCalorimeters(TRefArray* refArray){
+//  // Correlate information from PHOS and EMCAL
+//     TRefArray * caloClustersEMCAL = 0;
+//     TRefArray * caloClustersPHOS  = 0;
+//     
+//  // Get once the array of clusters per calorimeter, avoid an extra loop.
+//  if(fCalorimeter == "EMCAL"){ 
+//    caloClustersPHOS = new TRefArray();
+//    GetReader()->GetInputEvent()->GetPHOSClusters(caloClustersPHOS);
+//    caloClustersEMCAL = new TRefArray(*refArray);
+//  }
+//  else if(fCalorimeter == "PHOS") { 
+//    caloClustersEMCAL = new TRefArray();
+//    GetReader()->GetInputEvent()->GetEMCALClusters (caloClustersEMCAL);
+//    caloClustersPHOS = new TRefArray(*refArray);
+//  }
+//  
+//  //Fill histograms with clusters
+//  
+//  fhCaloCorrNClusters->Fill(caloClustersEMCAL->GetEntriesFast(),caloClustersPHOS->GetEntriesFast());
+//  Float_t sumClusterEnergyEMCAL = 0;
+//  Float_t sumClusterEnergyPHOS  = 0;
+//  Int_t iclus = 0;
+//  for(iclus = 0 ; iclus <  caloClustersEMCAL->GetEntriesFast() ; iclus++) 
+//    sumClusterEnergyEMCAL += ((AliVCluster*)caloClustersEMCAL->At(iclus))->E();
+//  for(iclus = 0 ; iclus <  caloClustersPHOS->GetEntriesFast(); iclus++) 
+//    sumClusterEnergyPHOS += ((AliVCluster*)caloClustersPHOS->At(iclus))->E();
+//  fhCaloCorrEClusters->Fill(sumClusterEnergyEMCAL,sumClusterEnergyPHOS);
+//  
+//  //Fill histograms with cells
+//  
+//  AliVCaloCells * cellsEMCAL = GetReader()->GetInputEvent()->GetEMCALCells();
+//  AliVCaloCells * cellsPHOS  = GetReader()->GetInputEvent()->GetPHOSCells();
+//  fhCaloCorrNCells   ->Fill(cellsEMCAL->GetNumberOfCells(),cellsPHOS->GetNumberOfCells());
+//  
+//  Int_t icell = 0;
+//  Float_t sumCellEnergyEMCAL = 0;
+//  Float_t sumCellEnergyPHOS  = 0;
+//  for(icell = 0 ; icell < cellsEMCAL->GetNumberOfCells()  ; icell++) 
+//    sumCellEnergyEMCAL += cellsEMCAL->GetAmplitude(icell);
+//  for(icell = 0 ; icell <  cellsPHOS->GetNumberOfCells(); icell++) 
+//    sumCellEnergyPHOS += cellsPHOS->GetAmplitude(icell);
+//  fhCaloCorrECells->Fill(sumCellEnergyEMCAL,sumCellEnergyPHOS);
+//  if(GetDebug() > 0 ){
+//    printf("AliAnaCalorimeterQA::CorrelateCalorimeters() - ESD: \n");
+//    printf("\t EMCAL: N cells %d, N clusters  %d, summed E cells %f, summed E clusters %f \n",
+//           cellsEMCAL->GetNumberOfCells(),caloClustersEMCAL->GetEntriesFast(),sumCellEnergyEMCAL,sumClusterEnergyEMCAL);
+//    printf("\t PHOS : N cells %d, N clusters  %d, summed E cells %f, summed E clusters %f \n",
+//           cellsPHOS->GetNumberOfCells(),caloClustersPHOS->GetEntriesFast(),sumCellEnergyPHOS,sumClusterEnergyPHOS);
+//  }
+//     
+//     delete caloClustersEMCAL;
+//     delete caloClustersPHOS;
+//     
+//}
+
+//__________________________________
+void AliAnaCalorimeterQA::CorrelateCalorimeters(){
   // Correlate information from PHOS and EMCAL
-       TRefArray * caloClustersEMCAL = 0;
-       TRefArray * caloClustersPHOS  = 0;
-       
-  // Get once the array of clusters per calorimeter, avoid an extra loop.
-  if(fCalorimeter == "EMCAL"){ 
-    caloClustersPHOS = new TRefArray();
-    GetReader()->GetInputEvent()->GetPHOSClusters(caloClustersPHOS);
-    caloClustersEMCAL = new TRefArray(*refArray);
-  }
-  else if(fCalorimeter == "PHOS") { 
-    caloClustersEMCAL = new TRefArray();
-    GetReader()->GetInputEvent()->GetEMCALClusters (caloClustersEMCAL);
-    caloClustersPHOS = new TRefArray(*refArray);
-  }
-  
+       TObjArray * caloClustersEMCAL = GetAODEMCAL();
+       TObjArray * caloClustersPHOS  = GetAODPHOS();
   //Fill histograms with clusters
   
   fhCaloCorrNClusters->Fill(caloClustersEMCAL->GetEntriesFast(),caloClustersPHOS->GetEntriesFast());
@@ -2210,8 +2249,8 @@ void AliAnaCalorimeterQA::CorrelateCalorimeters(TRefArray* refArray){
   
   //Fill histograms with cells
   
-  AliVCaloCells * cellsEMCAL = GetReader()->GetInputEvent()->GetEMCALCells();
-  AliVCaloCells * cellsPHOS  = GetReader()->GetInputEvent()->GetPHOSCells();
+  AliVCaloCells * cellsEMCAL = GetEMCALCells();
+  AliVCaloCells * cellsPHOS  = GetPHOSCells();
   fhCaloCorrNCells   ->Fill(cellsEMCAL->GetNumberOfCells(),cellsPHOS->GetNumberOfCells());
   
   Int_t icell = 0;
@@ -2229,12 +2268,9 @@ void AliAnaCalorimeterQA::CorrelateCalorimeters(TRefArray* refArray){
     printf("\t PHOS : N cells %d, N clusters  %d, summed E cells %f, summed E clusters %f \n",
            cellsPHOS->GetNumberOfCells(),caloClustersPHOS->GetEntriesFast(),sumCellEnergyPHOS,sumClusterEnergyPHOS);
   }
-       
-       delete caloClustersEMCAL;
-       delete caloClustersPHOS;
-       
 }
 
+
 //______________________________________________________________________________
 void AliAnaCalorimeterQA::MCHistograms(const TLorentzVector mom, const Int_t pdg){
   //Fill pure monte carlo related histograms
index f65bd40..be63723 100755 (executable)
@@ -66,8 +66,9 @@ public:
   
   void SwitchOnCalorimetersCorrelation()  {fCorrelateCalos = kTRUE  ;}
   void SwitchOffCalorimetersCorrelation() {fCorrelateCalos = kFALSE ;}
-  void CorrelateCalorimeters(TRefArray* caloClusters);
-       
+  //void CorrelateCalorimeters(TRefArray* caloClusters);
+       void CorrelateCalorimeters();
+  
   void Terminate(TList * outputList);
   void ReadHistograms(TList * outputList); //Fill histograms with histograms in ouput list, needed in Terminate.
        
index b1ac69f..4144c64 100644 (file)
@@ -75,7 +75,7 @@ AliAnalysisTaskParticleCorrelation *AddTaskPartCorr(TString data, TString calori
   reader->SetEMCALPtMin(0.1); 
   reader->SetPHOSPtMin(0.);
   reader->SetCTSPtMin(0.);
-  if(outputAOD)  reader->SwitchOffWriteDeltaAOD()  ;
+  if(outputAOD)  reader->SwitchOnWriteDeltaAOD()  ;
   if(oldAOD) reader->SwitchOnOldAODs();
   if(kPrintSettings) reader->Print("");
   
@@ -336,7 +336,7 @@ AliAnalysisTaskParticleCorrelation *AddTaskPartCorr(TString data, TString calori
   ic2->SetConeSize(0.4);
   ic2->SetPtThreshold(0.2);
   ic2->SetICMethod(AliIsolationCut::kPtThresIC);
-  if(kPrintSettings) ic->Print("");
+  if(kPrintSettings) ic2->Print("");
   //Do or not do isolation with previously produced AODs.
   //No effect if use of SwitchOnSeveralIsolation()
   anaisolpi0->SwitchOffReIsolation();
@@ -346,7 +346,7 @@ AliAnalysisTaskParticleCorrelation *AddTaskPartCorr(TString data, TString calori
   anaisolpi0->SetHistoPtRangeAndNBins(0, 50, 200) ;
   //      ana->SetHistoPhiRangeAndNBins(0, TMath::TwoPi(), 100) ;
   //      ana->SetHistoEtaRangeAndNBins(-0.7, 0.7, 100) ;
-  if(kPrintSettings) anaisol->Print("");
+  if(kPrintSettings) anaisolpi0->Print("");
        
   //===========================
   //Correlation analysis
@@ -488,12 +488,12 @@ AliAnalysisTaskParticleCorrelation *AddTaskPartCorr(TString data, TString calori
   if(calorimeter=="EMCAL")maker->AddAnalysis(anaelectron,n++);   
   // Isolation analysis
   maker->AddAnalysis(anaisol,n++);
-  maker->AddAnalysis(anacorrisohadron,n++);
   maker->AddAnalysis(anaisolpi0,n++);
   // Correlation analysis
   maker->AddAnalysis(anacorrjet,n++);
   maker->AddAnalysis(anacorrhadron,n++);
   maker->AddAnalysis(anacorrhadronpi0,n++);
+  maker->AddAnalysis(anacorrisohadron,n++);
   maker->AddAnalysis(anacorrhadronisopi0,n);
   maker->SetAnaDebug(-1)  ;
   maker->SwitchOnHistogramsMaker()  ;
index 69476c7..96e3b06 100644 (file)
@@ -2,7 +2,7 @@
 // Wagon contacts: EMCAL Gustavo.Conesa.Balbastre@cern.ch
 //                 PHOS  Yuri.Kharlov@cern.ch
 //
-AliAnalysisTaskParticleCorrelation *AddTaskCalorimeterQA(TString data, Bool_t kPrintSettings = kFALSE,Bool_t kSimulation = kFALSE,TString outputFile = "")
+AliAnalysisTaskParticleCorrelation *AddTaskCalorimeterQA(TString data, Bool_t kPrintSettings = kFALSE,Bool_t kSimulation = kFALSE,TString outputFile = "", Bool_t oldAOD=kFALSE)
 {
   // Creates a PartCorr task for calorimeters performance studies, configures it and adds it to the analysis manager.
   
@@ -20,26 +20,31 @@ AliAnalysisTaskParticleCorrelation *AddTaskCalorimeterQA(TString data, Bool_t kP
     ::Error("AddTaskPartCorr", "This task requires an input event handler");
     return NULL;
   }
-   TString inputDataType = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD"
+  TString inputDataType = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD"
   
   Bool_t kUseKinematics = (mgr->GetMCtruthEventHandler())?kTRUE:kFALSE;
        
   cout<<"********* ACCESS KINE? "<<kUseKinematics<<endl;
        
-   // Configure analysis
-   //===========================================================================
+  // Configure analysis
+  //===========================================================================
   
   //Reader
   //For this particular analysis few things done by the reader.
   //Nothing else needs to be set.
   AliCaloTrackReader * reader = 0x0;
-  if(data=="AOD")      reader = new AliCaloTrackAODReader();
+  if     (data=="AOD") reader = new AliCaloTrackAODReader();
   else if(data=="ESD") reader = new AliCaloTrackESDReader();
   //reader->SetDebug(10);//10 for lots of messages
-  reader->SwitchOffEMCAL();
-  reader->SwitchOffPHOS();
+  reader->SwitchOnEMCALCells(); 
+  reader->SwitchOnPHOSCells(); 
+  reader->SwitchOnEMCAL();
+  reader->SwitchOnPHOS();
   reader->SwitchOffCTS();
-       
+  reader->SetEMCALPtMin(0.); 
+  reader->SetPHOSPtMin (0.);
+  reader->SetCTSPtMin  (0.);
+  
   if(kUseKinematics){
                if(inputDataType == "ESD"){
                        reader->SwitchOnStack();          
@@ -49,10 +54,12 @@ AliAnalysisTaskParticleCorrelation *AddTaskCalorimeterQA(TString data, Bool_t kP
                        reader->SwitchOffStack();          
                        reader->SwitchOnAODMCParticles(); 
                }
-   }
-   //if(!kSimulation) reader->SetFiredTriggerClassName("CINT1B-ABCE-NOPF-ALL");
-   reader->SetDeltaAODFileName(""); //Do not create deltaAOD file, this analysis do not create branches.
-   if(kPrintSettings) reader->Print("");
+  }
+  //if(!kSimulation) reader->SetFiredTriggerClassName("CINT1B-ABCE-NOPF-ALL");
+  reader->SetDeltaAODFileName(""); //Do not create deltaAOD file, this analysis do not create branches.
+  reader->SwitchOffWriteDeltaAOD()  ;
+  if(oldAOD)         reader->SwitchOnOldAODs();
+  if(kPrintSettings) reader->Print("");
        
   // *** Calorimeters Utils    ***
   AliCalorimeterUtils *cu = new AliCalorimeterUtils;
@@ -127,39 +134,39 @@ AliAnalysisTaskParticleCorrelation *AddTaskCalorimeterQA(TString data, Bool_t kP
   emcalQA->SetHistoYRangeAndNBins(370,450,20);
   emcalQA->SetHistoZRangeAndNBins(-400,400,100);
   emcalQA->SetHistoRRangeAndNBins(400,450,10);
-
+  
   //emcalQA->GetMCAnalysisUtils()->SetDebug(10);
        
   if(kPrintSettings) emcalQA->Print("");       
-
-   AliAnaCalorimeterQA *phosQA = new AliAnaCalorimeterQA();
-   //phosQA->SetDebug(2); //10 for lots of messages
-   phosQA->SetCalorimeter("PHOS");
-   if(kUseKinematics) phosQA->SwitchOnDataMC() ;//Access MC stack and fill more histograms, AOD MC not implemented yet.
-   else  phosQA->SwitchOffDataMC() ;  
-   phosQA->AddToHistogramsName("PHOS_");//Begining of histograms name
-   //phosQA->SetFiducialCut(fidCut);
-   phosQA->SwitchOffFiducialCut();
-   //phosQA->GetMCAnalysisUtils()->SetDebug(10);
-   phosQA->SwitchOffPlotsMaking();
-   //Set Histrograms bins and ranges
-   phosQA->SetHistoPtRangeAndNBins(0, 5, 50) ;
-   phosQA->SetHistoPhiRangeAndNBins(259*TMath::DegToRad(), 321*TMath::DegToRad(), 130) ;
-   phosQA->SetHistoEtaRangeAndNBins(-0.125, 0.125, 57) ;
-   phosQA->SetNumberOfModules(3); //PHOS first year
-   phosQA->SetHistoMassRangeAndNBins(0., 0.5, 100) ;
-   phosQA->SetHistoAsymmetryRangeAndNBins(0., 1. , 5) ;
-   phosQA->SetHistoPOverERangeAndNBins(0,10.,100);
-   phosQA->SetHistodEdxRangeAndNBins(0.,200.,100);
-   phosQA->SetHistodRRangeAndNBins(0.,TMath::Pi(),150);
-   phosQA->SetHistoTimeRangeAndNBins(0.,200,100);
-   phosQA->SetHistoRatioRangeAndNBins(0.,2.,100);
-   phosQA->SetHistoVertexDistRangeAndNBins(0.,500.,100);
-   phosQA->SetHistoNClusterCellRangeAndNBins(0,20,20);
-   phosQA->SetHistoXRangeAndNBins(-100,400,50);
-   phosQA->SetHistoYRangeAndNBins(-490,-290,50);
-   phosQA->SetHistoZRangeAndNBins(-80,80,50);
-   phosQA->SetHistoRRangeAndNBins(440,480,40);
+  
+  AliAnaCalorimeterQA *phosQA = new AliAnaCalorimeterQA();
+  //phosQA->SetDebug(2); //10 for lots of messages
+  phosQA->SetCalorimeter("PHOS");
+  if(kUseKinematics) phosQA->SwitchOnDataMC() ;//Access MC stack and fill more histograms, AOD MC not implemented yet.
+  else  phosQA->SwitchOffDataMC() ;  
+  phosQA->AddToHistogramsName("PHOS_");//Begining of histograms name
+  //phosQA->SetFiducialCut(fidCut);
+  phosQA->SwitchOffFiducialCut();
+  //phosQA->GetMCAnalysisUtils()->SetDebug(10);
+  phosQA->SwitchOffPlotsMaking();
+  //Set Histrograms bins and ranges
+  phosQA->SetHistoPtRangeAndNBins(0, 5, 50) ;
+  phosQA->SetHistoPhiRangeAndNBins(259*TMath::DegToRad(), 321*TMath::DegToRad(), 130) ;
+  phosQA->SetHistoEtaRangeAndNBins(-0.125, 0.125, 57) ;
+  phosQA->SetNumberOfModules(3); //PHOS first year
+  phosQA->SetHistoMassRangeAndNBins(0., 0.5, 100) ;
+  phosQA->SetHistoAsymmetryRangeAndNBins(0., 1. , 5) ;
+  phosQA->SetHistoPOverERangeAndNBins(0,10.,100);
+  phosQA->SetHistodEdxRangeAndNBins(0.,200.,100);
+  phosQA->SetHistodRRangeAndNBins(0.,TMath::Pi(),150);
+  phosQA->SetHistoTimeRangeAndNBins(0.,200,100);
+  phosQA->SetHistoRatioRangeAndNBins(0.,2.,100);
+  phosQA->SetHistoVertexDistRangeAndNBins(0.,500.,100);
+  phosQA->SetHistoNClusterCellRangeAndNBins(0,20,20);
+  phosQA->SetHistoXRangeAndNBins(-100,400,50);
+  phosQA->SetHistoYRangeAndNBins(-490,-290,50);
+  phosQA->SetHistoZRangeAndNBins(-80,80,50);
+  phosQA->SetHistoRRangeAndNBins(440,480,40);
        
   //if(kPrintSettings)phosQA->Print("");       
        
@@ -173,14 +180,14 @@ AliAnalysisTaskParticleCorrelation *AddTaskCalorimeterQA(TString data, Bool_t kP
   maker->SwitchOnHistogramsMaker()  ;
   maker->SwitchOffAODsMaker()  ;
   if(kPrintSettings) maker->Print("");
-
+  
+  
   printf("======================== \n");
   printf(" End Configuration of Calorimeter QA \n");
   printf("======================== \n");
   
-   // Create task
-   //===========================================================================
+  // Create task
+  //===========================================================================
   AliAnalysisTaskParticleCorrelation * task = new AliAnalysisTaskParticleCorrelation ("CalorimeterPerformance");
   task->SetConfigFileName(""); //Don't configure the analysis via configuration file.
   //task->SetDebugLevel(-1);
@@ -189,20 +196,20 @@ AliAnalysisTaskParticleCorrelation *AddTaskCalorimeterQA(TString data, Bool_t kP
   mgr->AddTask(task);
   
   //Create containers
-//  AliAnalysisDataContainer *cout_pc = mgr->CreateContainer("Calo.Performance",TList::Class(),
-//                                                        AliAnalysisManager::kOutputContainer, "Calo.Performance.root");
+  //  AliAnalysisDataContainer *cout_pc = mgr->CreateContainer("Calo.Performance",TList::Class(),
+  //                                                      AliAnalysisManager::kOutputContainer, "Calo.Performance.root");
        
-
+  
   if(outputFile.Length()==0)outputFile = AliAnalysisManager::GetCommonFileName(); 
-
-
+  
+  
   AliAnalysisDataContainer *cout_pc   = mgr->CreateContainer("CaloQA", TList::Class(), 
-                                                            AliAnalysisManager::kOutputContainer, 
-                                                            Form("%s:CaloQA",outputFile.Data()));
+                                                             AliAnalysisManager::kOutputContainer, 
+                                                             Form("%s:CaloQA",outputFile.Data()));
   
   AliAnalysisDataContainer *cout_cuts = mgr->CreateContainer("CaloQACuts", TList::Class(), 
-                                                            AliAnalysisManager::kParamContainer, 
-                                                            Form("%s:CaloQACuts",outputFile.Data()));
+                                                             AliAnalysisManager::kParamContainer, 
+                                                             Form("%s:CaloQACuts",outputFile.Data()));
        //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
@@ -210,7 +217,7 @@ AliAnalysisTaskParticleCorrelation *AddTaskCalorimeterQA(TString data, Bool_t kP
   mgr->ConnectInput  (task, 0, mgr->GetCommonInputContainer());
   mgr->ConnectOutput (task, 1, cout_pc);
   mgr->ConnectOutput (task, 2, cout_cuts);
-
+  
   return task;
 }