Macros for analysis wagon:
authorgconesab <gconesab@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sat, 26 Jun 2010 04:22:32 +0000 (04:22 +0000)
committergconesab <gconesab@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sat, 26 Jun 2010 04:22:32 +0000 (04:22 +0000)
-remove unnecessary setting of output branches that are created but not used
-add EMCAL hot channels removal (and clusters containing them)
-remove clusters close to calorimeters borders
AliCalorimeterUtils: Fixes for calibration and bad channel recovery
AliAnaCalorimeterQA:
-Remove not useful histograms filled when track outer param not exists.
-Add possibility to recalibrate cluster/cell energy

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

index 8524c32..d3adaeb 100755 (executable)
@@ -534,6 +534,7 @@ void AliCalorimeterUtils::InitPHOSBadChannelStatusMap(){
   //In order to avoid rewriting the same histograms
   Bool_t oldStatus = TH1::AddDirectoryStatus();
   TH1::AddDirectory(kFALSE);
+       
   //for (int i = 0; i < 5; i++)fPHOSBadChannelMap->Add(new TH2I(Form("PHOSBadChannelMap_Mod%d_%s",i,fTaskName.Data()),Form("PHOSBadChannelMap_Mod%d",i), 56, 0, 56, 64, 0, 64));
   for (int i = 0; i < 5; i++)fPHOSBadChannelMap->Add(new TH2I(Form("PHOSBadChannelMap_Mod%d",i),Form("PHOSBadChannelMap_Mod%d",i), 56, 0, 56, 64, 0, 64));
 
index 815f98d..1616bef 100755 (executable)
@@ -67,26 +67,26 @@ public:
        
   // Bad channels
   Bool_t IsBadChannelsRemovalSwitchedOn()  const { return fRemoveBadChannels ; }
-  void SwitchOnBadChannelsRemoval()    {fRemoveBadChannels = kTRUE ; }
-  void SwitchOffBadChannelsRemoval()   {fRemoveBadChannels = kFALSE ; }
+  void SwitchOnBadChannelsRemoval ()  {fRemoveBadChannels = kTRUE  ; InitEMCALBadChannelStatusMap(); InitPHOSBadChannelStatusMap();}
+  void SwitchOffBadChannelsRemoval()  {fRemoveBadChannels = kFALSE ; }
        
   void InitEMCALBadChannelStatusMap() ;
   void InitPHOSBadChannelStatusMap () ;
 
   Int_t GetEMCALChannelStatus(Int_t iSM , Int_t iCol, Int_t iRow) const { 
-    if(fEMCALBadChannelMap->GetEntries()>0) return (Int_t) ((TH2I*)fEMCALBadChannelMap->At(iSM))->GetBinContent(iCol,iRow); 
-    else return -1;}
+    if(fEMCALBadChannelMap->GetEntriesFast()>0) return (Int_t) ((TH2I*)fEMCALBadChannelMap->At(iSM))->GetBinContent(iCol,iRow); 
+    else return 0;}//Channel is ok by default
 
   Int_t GetPHOSChannelStatus (Int_t imod, Int_t iCol, Int_t iRow) const { 
-    if(fPHOSBadChannelMap->GetEntries()>0)return (Int_t) ((TH2I*)fPHOSBadChannelMap->At(imod))->GetBinContent(iCol,iRow); 
-    else return -1;}
+    if(fPHOSBadChannelMap->GetEntriesFast()>0)return (Int_t) ((TH2I*)fPHOSBadChannelMap->At(imod))->GetBinContent(iCol,iRow); 
+    else return 0;}//Channel is ok by default
   
   void SetEMCALChannelStatus(Int_t iSM , Int_t iCol, Int_t iRow, Double_t c = 1) { 
-    if(!fEMCALBadChannelMap->GetEntries())InitEMCALBadChannelStatusMap() ;
+    if(!fEMCALBadChannelMap->GetEntriesFast())InitEMCALBadChannelStatusMap() ;
     ((TH2I*)fEMCALBadChannelMap->At(iSM))->SetBinContent(iCol,iRow,c);}
   
   void SetPHOSChannelStatus (Int_t imod, Int_t iCol, Int_t iRow, Double_t c = 1) {
-       if(!fPHOSBadChannelMap->GetEntries()) InitPHOSBadChannelStatusMap() ; 
+       if(!fPHOSBadChannelMap->GetEntriesFast()) InitPHOSBadChannelStatusMap() ; 
        ((TH2I*)fPHOSBadChannelMap->At(imod))->SetBinContent(iCol,iRow,c);}
     
   TH2I * GetEMCALChannelStatusMap(Int_t iSM) const {return (TH2I*)fEMCALBadChannelMap->At(iSM);}
@@ -125,11 +125,11 @@ public:
   void InitPHOSRecalibrationFactors () ;
        
   Float_t GetEMCALChannelRecalibrationFactor(Int_t iSM , Int_t iCol, Int_t iRow) const { 
-         if(fEMCALRecalibrationFactors->GetEntries()>0) return (Float_t) ((TH2F*)fEMCALRecalibrationFactors->At(iSM))->GetBinContent(iCol,iRow); 
+         if(fEMCALRecalibrationFactors->GetEntriesFast()>0) return (Float_t) ((TH2F*)fEMCALRecalibrationFactors->At(iSM))->GetBinContent(iCol,iRow); 
          else return 1;}
        
   Float_t GetPHOSChannelRecalibrationFactor (Int_t imod, Int_t iCol, Int_t iRow) const { 
-         if(fPHOSRecalibrationFactors->GetEntries()>0)return (Float_t) ((TH2F*)fPHOSRecalibrationFactors->At(imod))->GetBinContent(iCol,iRow); 
+         if(fPHOSRecalibrationFactors->GetEntriesFast()>0)return (Float_t) ((TH2F*)fPHOSRecalibrationFactors->At(imod))->GetBinContent(iCol,iRow); 
          else return 1;}
        
   void SetEMCALChannelRecalibrationFactor(Int_t iSM , Int_t iCol, Int_t iRow, Double_t c = 1) { 
index 866de1e..16eaad3 100755 (executable)
@@ -75,7 +75,7 @@ ClassImp(AliAnaCalorimeterQA)
        fHistoSSBins(40),          fHistoSSMax(10),            fHistoSSMin(0),
     fhE(0),fhPt(0),fhPhi(0),fhEta(0),   fhEtaPhiE(0),
     fhECharged(0),fhPtCharged(0),fhPhiCharged(0),fhEtaCharged(0), fhEtaPhiECharged(0), 
-    fhEChargedNoOut(0),fhPtChargedNoOut(0),fhPhiChargedNoOut(0),fhEtaChargedNoOut(0), fhEtaPhiChargedNoOut(0), 
+    //fhEChargedNoOut(0),fhPtChargedNoOut(0),fhPhiChargedNoOut(0),fhEtaChargedNoOut(0), fhEtaPhiChargedNoOut(0), 
     fhDeltaE(0), fhDeltaPt(0),fhDeltaPhi(0),fhDeltaEta(0), fhRatioE(0), fhRatioPt(0),fhRatioPhi(0),fhRatioEta(0),
     fh2E(0),fh2Pt(0),fh2Phi(0),fh2Eta(0),
        fhLambda(0), fhDispersion(0), 
@@ -143,8 +143,8 @@ AliAnaCalorimeterQA::AliAnaCalorimeterQA(const AliAnaCalorimeterQA & qa) :
   fhE(qa.fhE),fhPt(qa.fhPt), fhPhi(qa.fhPhi), fhEta(qa.fhEta), fhEtaPhiE(qa.fhEtaPhiE), 
   fhECharged(qa.fhECharged),fhPtCharged(qa.fhPtCharged),fhPhiCharged(qa.fhPhiCharged),
   fhEtaCharged(qa.fhEtaCharged), fhEtaPhiECharged(qa.fhEtaPhiECharged), 
-  fhEChargedNoOut(qa.fhEChargedNoOut),fhPtChargedNoOut(qa.fhPtChargedNoOut),fhPhiChargedNoOut(qa.fhPhiChargedNoOut),
-  fhEtaChargedNoOut(qa.fhEtaChargedNoOut), fhEtaPhiChargedNoOut(qa.fhEtaPhiChargedNoOut), 
+  //fhEChargedNoOut(qa.fhEChargedNoOut),fhPtChargedNoOut(qa.fhPtChargedNoOut),fhPhiChargedNoOut(qa.fhPhiChargedNoOut),
+  //fhEtaChargedNoOut(qa.fhEtaChargedNoOut), fhEtaPhiChargedNoOut(qa.fhEtaPhiChargedNoOut), 
   fhDeltaE(qa.fhDeltaE), fhDeltaPt(qa.fhDeltaPt), fhDeltaPhi(qa.fhDeltaPhi), fhDeltaEta(qa.fhDeltaEta),
   fhRatioE(qa.fhRatioE), fhRatioPt(qa.fhRatioPt), fhRatioPhi(qa.fhRatioPhi), fhRatioEta(qa.fhRatioEta),
   fh2E(qa.fh2E), fh2Pt(qa.fh2Pt), fh2Phi(qa.fh2Phi),fh2Eta(qa.fh2Eta), 
@@ -320,26 +320,26 @@ TList *  AliAnaCalorimeterQA::GetCreateOutputObjects()
        outputContainer->Add(fhEtaPhiECharged); 
 
 
-       fhEChargedNoOut  = new TH1F ("hEChargedNoOut","E reconstructed clusters, matched with track, no output track params", nptbins,ptmin,ptmax); 
-       fhEChargedNoOut->SetXTitle("E (GeV)");
-       outputContainer->Add(fhEChargedNoOut);
-       
-       fhPtChargedNoOut  = new TH1F ("hPtChargedNoOut","p_{T} reconstructed clusters, matched with track, no output track params", nptbins,ptmin,ptmax); 
-       fhPtChargedNoOut->SetXTitle("p_{T} (GeV/c)");
-       outputContainer->Add(fhPtChargedNoOut);
-       
-       fhPhiChargedNoOut  = new TH1F ("hPhiChargedNoOut","#phi reconstructed clusters, matched with track, no output track params",nphibins,phimin,phimax); 
-       fhPhiChargedNoOut->SetXTitle("#phi (rad)");
-       outputContainer->Add(fhPhiChargedNoOut);
-       
-       fhEtaChargedNoOut  = new TH1F ("hEtaChargedNoOut","#eta reconstructed clusters, matched with track, no output track params",netabins,etamin,etamax); 
-       fhEtaChargedNoOut->SetXTitle("#eta ");
-       outputContainer->Add(fhEtaChargedNoOut);
-       
-       fhEtaPhiChargedNoOut  = new TH2F ("hEtaPhiChargedNoOut","#eta vs #phi, reconstructed clusters, matched with track, no output track params",netabins,etamin,etamax,nphibins,phimin,phimax); 
-       fhEtaPhiChargedNoOut->SetXTitle("#eta ");
-       fhEtaPhiChargedNoOut->SetYTitle("#phi ");
-       outputContainer->Add(fhEtaPhiChargedNoOut);     
+//     fhEChargedNoOut  = new TH1F ("hEChargedNoOut","E reconstructed clusters, matched with track, no output track params", nptbins,ptmin,ptmax);                                                      \
+//     fhEChargedNoOut->SetXTitle("E (GeV)");                                                                                                                                                           \
+//     outputContainer->Add(fhEChargedNoOut);                                                                                                                                                           \
+//                                                                                                                                                                                                      \
+//     fhPtChargedNoOut  = new TH1F ("hPtChargedNoOut","p_{T} reconstructed clusters, matched with track, no output track params", nptbins,ptmin,ptmax);                                                \
+//     fhPtChargedNoOut->SetXTitle("p_{T} (GeV/c)");                                                                                                                                                    \
+//     outputContainer->Add(fhPtChargedNoOut);                                                                                                                                                          \
+//                                                                                                                                                                                                      \
+//     fhPhiChargedNoOut  = new TH1F ("hPhiChargedNoOut","#phi reconstructed clusters, matched with track, no output track params",nphibins,phimin,phimax);                                             \
+//     fhPhiChargedNoOut->SetXTitle("#phi (rad)");                                                                                                                                                      \
+//     outputContainer->Add(fhPhiChargedNoOut);                                                                                                                                                         \
+//                                                                                                                                                                                                      \
+//     fhEtaChargedNoOut  = new TH1F ("hEtaChargedNoOut","#eta reconstructed clusters, matched with track, no output track params",netabins,etamin,etamax);                                             \
+//     fhEtaChargedNoOut->SetXTitle("#eta ");                                                                                                                                                           \
+//     outputContainer->Add(fhEtaChargedNoOut);                                                                                                                                                         \
+//                                                                                                                                                                                                      \
+//     fhEtaPhiChargedNoOut  = new TH2F ("hEtaPhiChargedNoOut","#eta vs #phi, reconstructed clusters, matched with track, no output track params",netabins,etamin,etamax,nphibins,phimin,phimax);       \
+//     fhEtaPhiChargedNoOut->SetXTitle("#eta ");                                                                                                                                                        \
+//     fhEtaPhiChargedNoOut->SetYTitle("#phi ");                                                                                                                                                        \
+//     outputContainer->Add(fhEtaPhiChargedNoOut);     
 
        fh1pOverE = new TH2F("h1pOverE","TRACK matches p/E",nptbins,ptmin,ptmax, nPoverEbins,pOverEmin,pOverEmax);
        fh1pOverE->SetYTitle("p/E");
@@ -1396,7 +1396,12 @@ void  AliAnaCalorimeterQA::MakeAnalysisFillHistograms()
                        //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)) continue;
-
+                       //Recalibrate the cluster energy 
+                       if( GetCaloUtils()->IsRecalibrationOn())        {
+                               Float_t energy = GetCaloUtils()->RecalibrateClusterEnergy(clus, cell);
+                               clus->SetE(energy);
+                       }
+                       
                        //Get cluster kinematics
                        clus->GetPosition(pos);
                        clus->GetMomentum(mom,v);
@@ -1545,7 +1550,12 @@ void  AliAnaCalorimeterQA::MakeAnalysisFillHistograms()
                        //Check if the cluster contains any bad channel or it is close to calorimeter borders
                        if( GetCaloUtils()->ClusterContainsBadChannel(fCalorimeter,clus->GetCellsAbsId(), clus->GetNCells())) continue;
                        if(!GetCaloUtils()->CheckCellFiducialRegion(clus, cell)) continue;
-
+                       //Recalibrate the cluster energy 
+                       if( GetCaloUtils()->IsRecalibrationOn())        {
+                               Float_t energy = GetCaloUtils()->RecalibrateClusterEnergy(clus, cell);
+                               clus->SetE(energy);
+                       }
+                       
                        //Get cluster kinematics
                        clus->GetPosition(pos);
                        clus->GetMomentum(mom,v);
@@ -1747,18 +1757,20 @@ void  AliAnaCalorimeterQA::MakeAnalysisFillHistograms()
        
        Int_t *nCellsInModule = new Int_t[fNModules];
        for(Int_t imod = 0; imod < fNModules; imod++ ) nCellsInModule[imod] = 0;
-       Int_t icol = -1;
-       Int_t irow = -1;
-       Int_t iRCU = -1;
-       Float_t amp  = 0.;
-       Float_t time = 0.;
-       Int_t id     = -1;
+       Int_t icol     = -1;
+       Int_t irow     = -1;
+       Int_t iRCU     = -1;
+       Float_t amp    = 0.;
+       Float_t time   = 0.;
+       Int_t id       = -1;
+       Float_t recalF = 1.;
+       
        if(GetReader()->GetDataType()==AliCaloTrackReader::kESD){
                AliESDCaloCells * cell = 0x0; 
                Int_t ncells = 0;
                if(fCalorimeter == "PHOS") cell =  ((AliESDEvent*)GetReader()->GetInputEvent())->GetPHOSCells();
                else                           cell =  ((AliESDEvent*)GetReader()->GetInputEvent())->GetEMCALCells();
-               
+                               
                if(!cell) {
                        printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - STOP: No %s ESD CELLS available for analysis\n",fCalorimeter.Data());
                        abort();
@@ -1781,11 +1793,26 @@ void  AliAnaCalorimeterQA::MakeAnalysisFillHistograms()
                                                if(GetCaloUtils()->GetEMCALChannelStatus(nModule,icol,irow)) continue;
                                        }
                                        else {
-                                               if(GetCaloUtils()->GetPHOSChannelStatus(nModule,icol,irow)) continue;
+                                               if(GetCaloUtils()->GetPHOSChannelStatus(nModule,icol,irow)) {
+                                                       printf("PHOS bad channel\n");
+                                                       continue;
+                                               }
                                        }
                                }
-                               amp     = cell->GetAmplitude(iCell);
+                               
+                               //Get Recalibration factor if set
+                               if (GetCaloUtils()->IsRecalibrationOn()) {
+                                       if(fCalorimeter == "PHOS") recalF = GetCaloUtils()->GetPHOSChannelRecalibrationFactor(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);
+                               }
+                               
+                               amp     = cell->GetAmplitude(iCell)*recalF;
                                time    = cell->GetTime(iCell)*1e9;//transform time to ns
+
+                               //if(amp > 3 && fCalorimeter=="EMCAL") printf("Amp = %f, time = %f, (mod, col, row)= (%d,%d,%d)\n",
+                               //                                                                                 amp,time,nModule,icol,irow);
+                               
                                if(time < fTimeCutMin || time > fTimeCutMax) continue;
 
                                //printf("%s: time %g\n",fCalorimeter.Data(), time);
@@ -1919,7 +1946,15 @@ void  AliAnaCalorimeterQA::MakeAnalysisFillHistograms()
                                                if(GetCaloUtils()->GetPHOSChannelStatus(nModule,icol,irow)) continue;
                                        }       
                                }
-                               amp     = cell->GetAmplitude(iCell);
+                               
+                               //Get Recalibration factor if set
+                               if (GetCaloUtils()->IsRecalibrationOn()) {
+                                       if(fCalorimeter == "PHOS") recalF = GetCaloUtils()->GetPHOSChannelRecalibrationFactor(nModule,icol,irow);
+                                       else                           recalF = GetCaloUtils()->GetEMCALChannelRecalibrationFactor(nModule,icol,irow);
+                                       //printf("Recalibration factor (sm,row,col)=(%d,%d,%d) -  %f\n",nModule,icol,irow,recalF);
+                               }                               
+                               
+                               amp     = cell->GetAmplitude(iCell)*recalF;
                                fhAmplitude->Fill(amp);
                                fhAmpId    ->Fill(amp,id);
                                fhAmplitudeMod[nModule]->Fill(amp);
@@ -2445,15 +2480,17 @@ void AliAnaCalorimeterQA::ClusterHistograms(const TLorentzVector mom, const Doub
                                }
                        }
                        else{//no ESD external param or AODPid
-                                       ULong_t status=AliESDtrack::kTPCrefit;
-                               status|=AliESDtrack::kITSrefit;
+//                                     ULong_t status=AliESDtrack::kTPCrefit;
+//                             status|=AliESDtrack::kITSrefit;
                                //printf("track status %d\n", track->GetStatus() );
-                               fhEChargedNoOut      ->Fill(e);         
-                               fhPtChargedNoOut     ->Fill(pt);
-                               fhPhiChargedNoOut    ->Fill(phi);
-                               fhEtaChargedNoOut    ->Fill(eta);
-                               fhEtaPhiChargedNoOut ->Fill(eta,phi);   
-                               if(GetDebug() >= 0 && ((((AliESDtrack*)track)->GetStatus() & status) == status)) printf("ITS+TPC\n");
+//                             fhEChargedNoOut      ->Fill(e);         
+//                             fhPtChargedNoOut     ->Fill(pt);
+//                             fhPhiChargedNoOut    ->Fill(phi);
+//                             fhEtaChargedNoOut    ->Fill(eta);
+//                             fhEtaPhiChargedNoOut ->Fill(eta,phi);
+//                             if(GetDebug() >= 0 && ((((AliESDtrack*)track)->GetStatus() & status) == status)) printf("ITS+TPC\n");
+                               if(GetDebug() >= 0) printf("No ESD external param or AliAODPid \n");
+
                        }//No out params
        }//matched clusters with tracks
                
@@ -2647,11 +2684,11 @@ void AliAnaCalorimeterQA::ReadHistograms(TList* outputList)
        fhEtaCharged     = (TH1F *) outputList->At(index++);
        fhEtaPhiECharged = (TH3F *) outputList->At(index++);
        
-       fhEChargedNoOut      = (TH1F *) outputList->At(index++);        
-       fhPtChargedNoOut     = (TH1F *) outputList->At(index++); 
-       fhPhiChargedNoOut    = (TH1F *) outputList->At(index++); 
-       fhEtaChargedNoOut    = (TH1F *) outputList->At(index++);
-       fhEtaPhiChargedNoOut = (TH2F *) outputList->At(index++);
+//     fhEChargedNoOut      = (TH1F *) outputList->At(index++);        
+//     fhPtChargedNoOut     = (TH1F *) outputList->At(index++); 
+//     fhPhiChargedNoOut    = (TH1F *) outputList->At(index++); 
+//     fhEtaChargedNoOut    = (TH1F *) outputList->At(index++);
+//     fhEtaPhiChargedNoOut = (TH2F *) outputList->At(index++);
 
        fh1pOverE =    (TH2F *) outputList->At(index++);
        fh1dR =        (TH1F *) outputList->At(index++);
index 99d02a0..6a92da3 100755 (executable)
@@ -261,11 +261,11 @@ public:
   TH1F * fhPhiCharged; //! phi distribution, Reco, matched with track 
   TH1F * fhEtaCharged; //! eta distribution, Reco, matched with track 
   TH3F * fhEtaPhiECharged  ; //! eta vs phi vs E, Reco, matched with track 
-  TH1F * fhEChargedNoOut  ; //! E distribution, Reco, matched with track, no outer param
-  TH1F * fhPtChargedNoOut ; //! pT distribution, Reco, matched with track, no outer param
-  TH1F * fhPhiChargedNoOut; //! phi distribution, Reco, matched with track, no outer param
-  TH1F * fhEtaChargedNoOut; //! eta distribution, Reco, matched with track, no outer param
-  TH2F * fhEtaPhiChargedNoOut  ; //! eta vs phi, Reco, matched with track, no outer param
+//  TH1F * fhEChargedNoOut  ; //! E distribution, Reco, matched with track, no outer param
+//  TH1F * fhPtChargedNoOut ; //! pT distribution, Reco, matched with track, no outer param
+//  TH1F * fhPhiChargedNoOut; //! phi distribution, Reco, matched with track, no outer param
+//  TH1F * fhEtaChargedNoOut; //! eta distribution, Reco, matched with track, no outer param
+//  TH2F * fhEtaPhiChargedNoOut  ; //! eta vs phi, Reco, matched with track, no outer param
   TH1F * fhDeltaE  ; //! MC-Reco E distribution        
   TH1F * fhDeltaPt ; //! MC-Reco pT distribution
   TH1F * fhDeltaPhi; //! MC-Reco phi distribution
index 198791f..07898e0 100644 (file)
@@ -34,8 +34,8 @@ AliAnalysisTaskParticleCorrelation *AddTaskPartCorr(TString data, TString calori
    // Configure analysis
    //===========================================================================
    
-   //Reader
-   AliCaloTrackReader * reader = 0x0;
+   // *** 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();
@@ -77,6 +77,47 @@ AliAnalysisTaskParticleCorrelation *AddTaskPartCorr(TString data, TString calori
   reader->SetCTSPtMin(0.);
   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(1);
+  cu->SwitchOnNoFiducialBorderInEMCALEta0();
+
+  // 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 ####
   
        
@@ -108,7 +149,7 @@ AliAnalysisTaskParticleCorrelation *AddTaskPartCorr(TString data, TString calori
   else {//EMCAL
                //anaphoton->SetNCellCut(0);// At least 2 cells
                anaphoton->SetMinPt(0.1); // no effect minium EMCAL cut.
-               anaphoton->SetTimeCut(550,750);// Time window of [550-750] ns
+               anaphoton->SetTimeCut(525,725);// Time window of [550-750] ns
            anaphoton->SetMinDistanceToBadChannel(6, 12, 18);
   }
   anaphoton->SetCalorimeter(calorimeter);
@@ -214,12 +255,6 @@ AliAnalysisTaskParticleCorrelation *AddTaskPartCorr(TString data, TString calori
   // ### Correlation with hadrons
   AliAnaParticleHadronCorrelation *anacorrhadron = new AliAnaParticleHadronCorrelation();
   anacorrhadron->SetInputAODName(Form("Photons%s",calorimeter.Data()));
-  if(!data.Contains("delta")) {
-         anacorrhadron->SetOutputAODName(Form("CorrGammaHadrons%s",calorimeter.Data()));
-         anacorrhadron->SetOutputAODClassName("AliAODPWG4ParticleCorrelation");
-  }
-  else anacorrhadron->SetInputAODName(Form("CorrGammaHadrons%s",calorimeter.Data()));
-       
   anacorrhadron->AddToHistogramsName("AnaHadronCorrPhoton_");
   anacorrhadron->SetDebug(-1);
   anacorrhadron->SwitchOffCaloPID();
@@ -245,12 +280,6 @@ AliAnalysisTaskParticleCorrelation *AddTaskPartCorr(TString data, TString calori
   // ### Correlation with hadrons
   AliAnaParticleHadronCorrelation *anacorrisohadron = new AliAnaParticleHadronCorrelation();
   anacorrisohadron->SetInputAODName(Form("Photons%s",calorimeter.Data()));
-  if(!data.Contains("delta")) {
-         anacorrisohadron->SetOutputAODName(Form("CorrIsoGammaHadrons%s",calorimeter.Data()));
-         anacorrisohadron->SetOutputAODClassName("AliAODPWG4ParticleCorrelation");
-  }
-  else  anacorrisohadron->SetInputAODName(Form("CorrIsoGammaHadrons%s",calorimeter.Data()));
-       
   anacorrisohadron->AddToHistogramsName("AnaHadronCorrIsoPhoton_");
   anacorrisohadron->SetDebug(-1);
   anacorrisohadron->SwitchOffCaloPID();
@@ -339,12 +368,6 @@ AliAnalysisTaskParticleCorrelation *AddTaskPartCorr(TString data, TString calori
   // ### Pi0 Correlation with hadrons, not isolated
   AliAnaParticleHadronCorrelation *anacorrhadronpi0 = new AliAnaParticleHadronCorrelation();
   anacorrhadronpi0->SetInputAODName(Form("Pi0s%s",calorimeter.Data()));
-  if(!data.Contains("delta")){ 
-         anacorrhadronpi0->SetOutputAODName(Form("CorrPi0Hadrons%s",calorimeter.Data()));
-         anacorrhadronpi0->SetOutputAODClassName("AliAODPWG4ParticleCorrelation");
-  }
-  else anacorrhadronpi0->SetInputAODName(Form("CorrPi0Hadrons%s",calorimeter.Data()));
-       
   anacorrhadronpi0->AddToHistogramsName("AnaHadronCorrPi0_");
   anacorrhadronpi0->SetDebug(-1);
   anacorrhadronpi0->SwitchOffCaloPID();
@@ -370,12 +393,6 @@ AliAnalysisTaskParticleCorrelation *AddTaskPartCorr(TString data, TString calori
   // ### Pi0 Correlation with hadrons, isolated
   AliAnaParticleHadronCorrelation *anacorrhadronisopi0 = new AliAnaParticleHadronCorrelation();
   anacorrhadronisopi0->SetInputAODName(Form("Pi0s%s",calorimeter.Data()));
-  if(!data.Contains("delta")) {
-               anacorrhadronisopi0->SetOutputAODName(Form("CorrIsoPi0Hadrons%s",calorimeter.Data()));
-               anacorrhadronisopi0->SetOutputAODClassName("AliAODPWG4ParticleCorrelation");
-  }
-  else  anacorrhadronisopi0->SetInputAODName(Form("CorrIsoPi0Hadrons%s",calorimeter.Data()));
-       
   anacorrhadronisopi0->AddToHistogramsName("AnaHadronCorrIsoPi0_");
   anacorrhadronisopi0->SetDebug(-1);
   anacorrhadronisopi0->SwitchOffCaloPID();
@@ -421,8 +438,8 @@ AliAnalysisTaskParticleCorrelation *AddTaskPartCorr(TString data, TString calori
  
   // #### Configure Maker ####
   AliAnaPartCorrMaker * maker = new AliAnaPartCorrMaker();
-  maker->SetReader(reader);//pointer to reader∫
-  //if(!data.Contains("delta")) maker->AddAnalysis(qa,0);
+  maker->SetReader(reader);//pointer to reader
+  maker->SetCaloUtils(cu); //pointer to calorimeter utils
   maker->AddAnalysis(anaphoton,0);
   maker->AddAnalysis(anapi0,1);
   maker->AddAnalysis(anaisol,2);
index 039d25e..fd71722 100644 (file)
@@ -55,13 +55,50 @@ AliAnalysisTaskParticleCorrelation *AddTaskCalorimeterQA(TString data, Bool_t kP
    reader->SetDeltaAODFileName(""); //Do not create deltaAOD file, this analysis do not create branches.
    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(1);
+  cu->SwitchOnNoFiducialBorderInEMCALEta0();
+       
+  // 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"));
+       
+  cu->SetDebug(-1);
+  if(kPrintSettings) cu->Print("");    
+       
   // ##### Analysis algorithm settings ####
-   //Only needed now for MC data
-   //AliFiducialCut * fidCut = new AliFiducialCut();
-   //fidCut->DoCTSFiducialCut(kFALSE) ;
-   //fidCut->DoEMCALFiducialCut(kTRUE) ;
-   //fidCut->DoPHOSFiducialCut(kTRUE) ;
-               
+  //AliFiducialCut * fidCut = new AliFiducialCut();
+  //fidCut->DoCTSFiducialCut(kFALSE) ;
+  //fidCut->DoEMCALFiducialCut(kTRUE) ;
+  //fidCut->DoPHOSFiducialCut(kTRUE) ; 
+       
   AliAnaCalorimeterQA *emcalQA = new AliAnaCalorimeterQA();
   //emcalQA->SetDebug(2); //10 for lots of messages
   emcalQA->SetCalorimeter("EMCAL");
@@ -72,7 +109,7 @@ AliAnalysisTaskParticleCorrelation *AddTaskCalorimeterQA(TString data, Bool_t kP
   emcalQA->SwitchOffFiducialCut();
   emcalQA->SwitchOffPlotsMaking();
   emcalQA->SwitchOnCalorimetersCorrelation();
-  emcalQA->SetTimeCut(550,750);
+  emcalQA->SetTimeCut(420,825);//Open for the moment
   //Set Histrograms bins and ranges
   emcalQA->SetHistoPtRangeAndNBins(0, 10, 100) ;
   emcalQA->SetHistoPhiRangeAndNBins(75*TMath::DegToRad(), 125*TMath::DegToRad(), 100) ;
@@ -130,9 +167,10 @@ AliAnalysisTaskParticleCorrelation *AddTaskCalorimeterQA(TString data, Bool_t kP
   // #### Configure Maker ####
   AliAnaPartCorrMaker * maker = new AliAnaPartCorrMaker();
   maker->SetReader(reader);//pointer to reader
+  maker->SetCaloUtils(cu); //pointer to calorimeter utils
   maker->AddAnalysis(emcalQA,0);
   maker->AddAnalysis(phosQA,1);
-  maker->SetAnaDebug(-1)  ; // 0 to at least print the event number
+  maker->SetAnaDebug(0)  ; // 0 to at least print the event number
   maker->SwitchOnHistogramsMaker()  ;
   maker->SwitchOffAODsMaker()  ;
   if(kPrintSettings) maker->Print("");