Update Wagon with physics event selection option and change a couple of histogram...
authorgconesab <gconesab@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 8 Jan 2010 10:24:14 +0000 (10:24 +0000)
committergconesab <gconesab@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 8 Jan 2010 10:24:14 +0000 (10:24 +0000)
PWG4/PartCorrDep/AliAnaCalorimeterQA.cxx
PWG4/PartCorrDep/AliAnaCalorimeterQA.h
PWG4/macros/AddTaskPartCorr.C
PWG4/macros/QA/DrawCaloQA.C

index 4e983f0..5dd2b7c 100755 (executable)
@@ -72,8 +72,8 @@ ClassImp(AliAnaCalorimeterQA)
     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), fhIM(0), fhIMCellCut(0),fhAsym(0), 
-       fhNCellsPerCluster(0), fhNClusters(0), fhNCells(0), 
-       fhAmplitude(0), fhTime(0), fhTimeId(0), fhTimeAmp(0),
+       fhNCellsPerCluster(0),fhNCellsPerClusterMIP(0), fhNClusters(0), fhNCells(0), 
+       fhAmplitude(0), fhAmpId(0), fhTime(0), fhTimeId(0), fhTimeAmp(0),
     fhCaloCorrNClusters(0), fhCaloCorrEClusters(0), fhCaloCorrNCells(0), fhCaloCorrECells(0),
     fhEMod(0),fhNClustersMod(0), fhNCellsPerClusterMod(0), fhNCellsMod(0),  
     fhGridCellsMod(0),  fhGridCellsEMod(0), fhAmplitudeMod(0), fhIMMod(0),  fhIMCellCutMod(0),
@@ -121,8 +121,10 @@ AliAnaCalorimeterQA::AliAnaCalorimeterQA(const AliAnaCalorimeterQA & qa) :
   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), 
-  fhIM(qa.fhIM), fhIMCellCut(qa.fhIMCellCut), fhAsym(qa.fhAsym), fhNCellsPerCluster(qa.fhNCellsPerCluster), fhNClusters(qa.fhNClusters), 
-  fhNCells(qa.fhNCells), fhAmplitude(qa.fhAmplitude), fhTime(qa.fhTime), fhTimeId(qa.fhTimeId),fhTimeAmp(qa.fhTimeAmp),
+  fhIM(qa.fhIM), fhIMCellCut(qa.fhIMCellCut), fhAsym(qa.fhAsym), 
+  fhNCellsPerCluster(qa.fhNCellsPerCluster), fhNCellsPerClusterMIP(qa.fhNCellsPerClusterMIP),
+  fhNClusters(qa.fhNClusters), fhNCells(qa.fhNCells), fhAmplitude(qa.fhAmplitude), fhAmpId(fhAmpId),
+  fhTime(qa.fhTime), fhTimeId(qa.fhTimeId),fhTimeAmp(qa.fhTimeAmp),
   fhCaloCorrNClusters(qa.fhCaloCorrNClusters), fhCaloCorrEClusters(qa.fhCaloCorrEClusters),
   fhCaloCorrNCells(qa.fhCaloCorrNCells), fhCaloCorrECells(qa.fhCaloCorrECells),
   fhEMod(qa.fhEMod),fhNClustersMod(qa.fhNClustersMod), fhNCellsPerClusterMod(qa.fhNCellsPerClusterMod), fhNCellsMod(qa.fhNCellsMod),  
@@ -202,8 +204,9 @@ AliAnaCalorimeterQA & AliAnaCalorimeterQA::operator = (const AliAnaCalorimeterQA
   fhIM   = qa.fhIM;   fhIMCellCut   = qa.fhIMCellCut;
   fhAsym = qa.fhAsym;
        
-  fhNCellsPerCluster = qa.fhNCellsPerCluster;
-  fhNClusters        = qa.fhNClusters;
+  fhNCellsPerCluster    = qa.fhNCellsPerCluster;
+  fhNCellsPerClusterMIP = qa.fhNCellsPerClusterMIP;
+  fhNClusters           = qa.fhNClusters;
        
   fhDeltaE   = qa.fhDeltaE;    
   fhDeltaPt  = qa.fhDeltaPt;
@@ -223,6 +226,7 @@ AliAnaCalorimeterQA & AliAnaCalorimeterQA::operator = (const AliAnaCalorimeterQA
        
   fhNCells    = qa.fhNCells;
   fhAmplitude = qa.fhAmplitude;
+  fhAmpId     = qa.fhAmpId;
   fhTime      = qa.fhTime;
   fhTimeId    = qa.fhTimeId;
   fhTimeAmp   = qa.fhTimeAmp;
@@ -446,6 +450,11 @@ TList *  AliAnaCalorimeterQA::GetCreateOutputObjects()
        fhNCellsPerCluster->SetYTitle("n cells");
        outputContainer->Add(fhNCellsPerCluster);
        
+       fhNCellsPerClusterMIP  = new TH2F ("hNCellsPerClusterMIP","# cells per cluster vs cluster energy, smaller bin for MIP search", 400,0.,2., nbins,nmin,nmax); 
+       fhNCellsPerClusterMIP->SetXTitle("E (GeV)");
+       fhNCellsPerClusterMIP->SetYTitle("n cells");
+       outputContainer->Add(fhNCellsPerClusterMIP);
+       
        fhNClusters  = new TH1F ("hNClusters","# clusters", nbins,nmin,nmax); 
        fhNClusters->SetXTitle("number of clusters");
        outputContainer->Add(fhNClusters);
@@ -455,10 +464,14 @@ TList *  AliAnaCalorimeterQA::GetCreateOutputObjects()
        fhNCells->SetXTitle("n cells");
        outputContainer->Add(fhNCells);
     
-       fhAmplitude  = new TH1F ("hAmplitude","Cell Energy", nptbins*2,ptmin,ptmax); 
+       fhAmplitude  = new TH1F ("hAmplitude","Cell Energy", nptbins*5,ptmin,ptmax); 
        fhAmplitude->SetXTitle("Cell Energy (GeV)");
        outputContainer->Add(fhAmplitude);
        
+       fhAmpId  = new TH2F ("hAmpId","Cell Energy", nptbins*2,ptmin,ptmax,rowmax*colmax,0,rowmax*colmax); 
+       fhAmpId->SetXTitle("Cell Energy (GeV)");
+       outputContainer->Add(fhAmpId);
+       
        //Cell Time histograms, time only available in ESDs
        if(GetReader()->GetDataType()==AliCaloTrackReader::kESD) {
                fhTime  = new TH1F ("hTime","Cell Time",ntimebins,timemin,timemax); 
@@ -1443,6 +1456,7 @@ void  AliAnaCalorimeterQA::MakeAnalysisFillHistograms()
                                //printf("%s: time %g\n",fCalorimeter.Data(), time);
                                id      = cell->GetCellNumber(iCell);
                                fhAmplitude->Fill(amp);
+                               fhAmpId    ->Fill(amp,id);
                                fhTime     ->Fill(time);
                                fhTimeId   ->Fill(time,id);
                                fhTimeAmp  ->Fill(amp,time);
@@ -1478,6 +1492,7 @@ void  AliAnaCalorimeterQA::MakeAnalysisFillHistograms()
                        if(nModule < fNModules) {       
                                amp     = cell->GetAmplitude(iCell);
                                fhAmplitude->Fill(amp);
+                               fhAmpId    ->Fill(amp,id);
                                fhAmplitudeMod[nModule]->Fill(cell->GetAmplitude(iCell));
                                nCellsInModule[nModule]++;
                                fhGridCellsMod[nModule]->Fill(icol,irow);
@@ -1530,7 +1545,8 @@ void AliAnaCalorimeterQA::ClusterHistograms(const TLorentzVector mom, const Int_
        fhEtaPhi->Fill(eta,phi);
        fhEtaPhiE->Fill(eta,phi,e);
        //Cells per cluster
-       fhNCellsPerCluster->Fill(e, nCaloCellsPerCluster);
+       fhNCellsPerCluster   ->Fill(e, nCaloCellsPerCluster);
+       fhNCellsPerClusterMIP->Fill(e, nCaloCellsPerCluster);
        if(nModule < fNModules) fhNCellsPerClusterMod[nModule]->Fill(e, nCaloCellsPerCluster);
 
        //Fill histograms only possible when simulation
@@ -2147,10 +2163,13 @@ void AliAnaCalorimeterQA::ReadHistograms(TList* outputList)
        fhIMCellCut = (TH2F *) outputList->At(index++);
        fhAsym      = (TH2F *) outputList->At(index++);
        
-       fhNCellsPerCluster = (TH2F *) outputList->At(index++);
+       fhNCellsPerCluster    = (TH2F *) outputList->At(index++);
+       fhNCellsPerClusterMIP = (TH2F *) outputList->At(index++);
        fhNClusters  = (TH1F *) outputList->At(index++); 
        fhNCells     = (TH1F *) outputList->At(index++); 
        fhAmplitude  = (TH1F *) outputList->At(index++); 
+       fhAmpId      = (TH2F *) outputList->At(index++); 
+
        if(GetReader()->GetDataType()==AliCaloTrackReader::kESD) {
                fhTime       = (TH1F *) outputList->At(index++); 
                fhTimeId     = (TH2F *) outputList->At(index++); 
index 08877da..43cff95 100755 (executable)
@@ -8,7 +8,7 @@
 // Class to check results from simulations or reconstructed real data. 
 // Fill few histograms and do some checking plots
 //
-//-- Author: Gustavo Conesa (INFN-LNF)
+//-- Author: Gustavo Conesa (INFN-LNF)a
 
 // --- Root system ---
 class TH3F;
@@ -202,12 +202,14 @@ class AliAnaCalorimeterQA : public AliAnaPartCorrBaseClass {
   TH2F * fhIM; //! cluster pairs invariant mass
   TH2F * fhIMCellCut; //! cluster pairs invariant mass, n cells > 1 per cluster
   TH2F * fhAsym; //! cluster pairs invariant mass      
-  TH2F * fhNCellsPerCluster; //! N cells per cluster   
+  TH2F * fhNCellsPerCluster;    //! N cells per cluster        
+  TH2F * fhNCellsPerClusterMIP; //! N cells per cluster, finer fixed pT bin for MIP search.    
   TH1F * fhNClusters; //! Number of clusters
        
   //Calo Cells
   TH1F * fhNCells;    //! Number of towers/crystals with signal
   TH1F * fhAmplitude; //! Amplitude measured in towers/crystals
+  TH2F * fhAmpId;     //! Amplitude measured in towers/crystals vs id of tower.        
   TH1F * fhTime;      //! Time measured in towers/crystals
   TH2F * fhTimeId;    //! Time vs Absolute cell Id
   TH2F * fhTimeAmp;   //! Time vs Amplitude 
index 2fa577c..88cb238 100644 (file)
@@ -32,7 +32,7 @@ AliAnalysisTaskParticleCorrelation *AddTaskPartCorr(TString data, TString calori
    //reader->SetDebug(10);//10 for lots of messages
    reader->SwitchOnCTS();
    //reader->SetDeltaAODFileName("");
-   if(!kSimulation) reader->SetFiredTriggerClassName("CINT1B-ABCE-NOPF-ALL");
+   //if(!kSimulation) reader->SetFiredTriggerClassName("CINT1B-ABCE-NOPF-ALL");
   if(calorimeter == "EMCAL") {
     reader->SwitchOnEMCALCells();  
     reader->SwitchOnEMCAL();
@@ -70,10 +70,23 @@ AliAnalysisTaskParticleCorrelation *AddTaskPartCorr(TString data, TString calori
   pid->SetDebug(-1);
   if(kPrintSettings) pid->Print("");
        
-  AliFiducialCut * fidCut = new AliFiducialCut();
-  fidCut->DoCTSFiducialCut(kFALSE) ;
-  fidCut->DoEMCALFiducialCut(kTRUE) ;
-  fidCut->DoPHOSFiducialCut(kTRUE) ;
+  AliFiducialCut * fidCut1stYear = new AliFiducialCut();
+  fidCut1stYear->DoCTSFiducialCut(kFALSE) ;
+  if(kSimulation){
+               fidCut1stYear->DoEMCALFiducialCut(kTRUE) ;
+               fidCut1stYear->DoPHOSFiducialCut(kTRUE) ;
+               fidCut1stYear->SetSimpleEMCALFiducialCut(0.7,80.,120.);
+               fidCut1stYear->SetSimplePHOSFiducialCut(0.12,260.,320.);
+  } 
+  else{
+               fidCut1stYear->DoEMCALFiducialCut(kFALSE) ;
+               fidCut1stYear->DoPHOSFiducialCut(kFALSE) ;
+  }    
+       
+//  AliFiducialCut * fidCut = new AliFiducialCut();
+//  fidCut->DoCTSFiducialCut(kFALSE) ;
+//  fidCut->DoEMCALFiducialCut(kTRUE) ;
+//  fidCut->DoPHOSFiducialCut(kTRUE) ;
        
   AliAnaCalorimeterQA *qa = new AliAnaCalorimeterQA();
   //qa->SetDebug(10); //10 for lots of messages
@@ -81,8 +94,10 @@ AliAnalysisTaskParticleCorrelation *AddTaskPartCorr(TString data, TString calori
   if(kUseKinematics && inputDataType!="AOD") qa->SwitchOnDataMC() ;//Access MC stack and fill more histograms, AOD MC not implemented yet.
   else  qa->SwitchOffDataMC() ;
   qa->AddToHistogramsName("AnaCaloQA_");
-  qa->SetFiducialCut(fidCut);
-  qa->SwitchOnFiducialCut();
+  if(kSimulation){
+         qa->SetFiducialCut(fidCut1stYear);
+         qa->SwitchOnFiducialCut();
+  }
   if(qa=="PHOS") qa->SetNumberOfModules(3); //PHOS first year
   else  qa->SetNumberOfModules(4); //EMCAL first year
   //Set Histograms bins and ranges
@@ -90,14 +105,14 @@ AliAnalysisTaskParticleCorrelation *AddTaskPartCorr(TString data, TString calori
   qa->SetHistoPhiRangeAndNBins(0, TMath::TwoPi(), 100) ;
   if(calorimeter == "PHOS"){
          qa->SetHistoEtaRangeAndNBins(-0.13, 0.13, 100) ;
-         qa->SetHistoPhiRangeAndNBins(250*TMath::DegToRad(), 330*TMath::DegToRad() , 100) ;
+         qa->SetHistoPhiRangeAndNBins(250*TMath::DegToRad(), 330*TMath::DegToRad() , 200) ;
   }
   else if(calorimeter == "EMCAL"){
-         qa->SetHistoEtaRangeAndNBins(-0.8, 0.8, 100) ;
-         qa->SetHistoPhiRangeAndNBins(70*TMath::DegToRad(), 130*TMath::DegToRad(), 100) ;
+         qa->SetHistoEtaRangeAndNBins(-0.8, 0.8, 200) ;
+         qa->SetHistoPhiRangeAndNBins(70*TMath::DegToRad(), 130*TMath::DegToRad(), 200) ;
   }
-  qa->SetHistoMassRangeAndNBins(0., 0.5, 500) ;
-  qa->SetHistoAsymmetryRangeAndNBins(0., 1. , 5) ;
+  qa->SetHistoMassRangeAndNBins(0., 0.6, 300) ;
+  qa->SetHistoAsymmetryRangeAndNBins(0., 1. , 25) ;
   qa->SetHistoPOverERangeAndNBins(0,10.,100);
   qa->SetHistodEdxRangeAndNBins(0.,400.,200);
   qa->SetHistodRRangeAndNBins(0.,TMath::Pi(),300);
@@ -114,19 +129,7 @@ AliAnalysisTaskParticleCorrelation *AddTaskPartCorr(TString data, TString calori
   // --------------------
        
        
-  AliFiducialCut * fidCut1stYear = new AliFiducialCut();
-  fidCut1stYear->DoCTSFiducialCut(kFALSE) ;
-  if(kSimulation){
-    fidCut1stYear->DoEMCALFiducialCut(kTRUE) ;
-    fidCut1stYear->DoPHOSFiducialCut(kTRUE) ;
-    fidCut1stYear->SetSimpleEMCALFiducialCut(0.7,80.,120.);
-    fidCut1stYear->SetSimplePHOSFiducialCut(0.12,260.,320.);
-  } 
-  else{
-    fidCut1stYear->DoEMCALFiducialCut(kFALSE) ;
-    fidCut1stYear->DoPHOSFiducialCut(kFALSE) ;
-  }    
-  
+
   AliAnaPhoton *anaphoton1 = new AliAnaPhoton();
   anaphoton1->SetDebug(-1); //10 for lots of messages
   anaphoton1->SetMinPt(0.);
@@ -154,7 +157,10 @@ AliAnalysisTaskParticleCorrelation *AddTaskPartCorr(TString data, TString calori
   anapi0->SetInputAODName(Form("PhotonsForIM%s",calorimeter.Data()));
   anapi0->SetCaloPID(pid);
   anapi0->SetCalorimeter(calorimeter);
-  anapi0->SwitchOnFiducialCut();
+  if(kSimulation){
+               anapi0->SwitchOnFiducialCut();
+               anapi0->SetFiducialCut(fidCut1stYear);
+  }  
   anapi0->SetNPID(1); //Available from tag AliRoot::v4-18-15-AN
   //settings for pp collision
   anapi0->SetNCentrBin(1);
@@ -165,10 +171,10 @@ AliAnalysisTaskParticleCorrelation *AddTaskPartCorr(TString data, TString calori
   if(calorimeter=="PHOS") anapi0->SetNumberOfModules(3); //PHOS first year
   else  anapi0->SetNumberOfModules(4); //EMCAL first year
   anapi0->SetHistoPtRangeAndNBins(0, 50, 500) ;
-  //      ana->SetHistoPhiRangeAndNBins(0, TMath::TwoPi(), 100) ;
-  //      ana->SetHistoEtaRangeAndNBins(-0.7, 0.7, 100) ;
-  anapi0->SetHistoMassRangeAndNBins(0., 0.5, 500) ;
-  anapi0->SetHistoAsymmetryRangeAndNBins(0., 1. , 5) ;
+  //anapi0->SetHistoPhiRangeAndNBins(0, TMath::TwoPi(), 100) ;
+  //anapi0->SetHistoEtaRangeAndNBins(-0.8, 0.8, 200) ;
+  anapi0->SetHistoMassRangeAndNBins(0., 0.6, 300) ;
+  anapi0->SetHistoAsymmetryRangeAndNBins(0., 1. , 10) ;
   if(kPrintSettings) anapi0->Print("");
   
   
@@ -185,6 +191,10 @@ AliAnalysisTaskParticleCorrelation *AddTaskPartCorr(TString data, TString calori
   else  anaphoton2->SwitchOffDataMC() ;
   anaphoton2->SwitchOffCaloPID();
   anaphoton2->SwitchOffFiducialCut();
+  if(kSimulation){
+               anaphoton2->SwitchOnFiducialCut();
+               anaphoton2->SetFiducialCut(fidCut1stYear);
+  }
   anaphoton2->SetOutputAODName(Form("Photons%s",calorimeter.Data()));
   anaphoton2->SetOutputAODClassName("AliAODPWG4ParticleCorrelation");
   anaphoton2->AddToHistogramsName("AnaPhotonCorr_");
@@ -432,7 +442,8 @@ AliAnalysisTaskParticleCorrelation *AddTaskPartCorr(TString data, TString calori
   AliAnalysisTaskParticleCorrelation * task = new AliAnalysisTaskParticleCorrelation (Form("PartCorr%s",calorimeter.Data()));
   task->SetConfigFileName(""); //Don't configure the analysis via configuration file.
   //task->SetDebugLevel(-1);
-  task->SetAnalysisMaker(maker);                               
+  task->SetAnalysisMaker(maker);
+  if(!kSimulation)task->SelectCollisionCandidates(); //AliPhysicsSelection has to be attached before.
   mgr->AddTask(task);
   
   char name[128];
index c0a73fd..65aaf36 100644 (file)
@@ -32,11 +32,13 @@ TH2F * fhIM; //! cluster pairs invariant mass
 TH2F * fhIMCellCut; //! cluster pairs invariant mass, n cells > 1 per cluster
 TH2F * fhAsym; //! cluster pairs invariant mass        
 TH2F * fhNCellsPerCluster; //! N cells per cluster     
+TH2F * fhNCellsPerClusterMIP; //! N cells per cluster  
 TH1F * fhNClusters; //! Number of clusters
 
 //Calo Cells
 TH1F * fhNCells; //! Number of towers/crystals with signal
 TH1F * fhAmplitude; //! Amplitude measured in towers/crystals
+TH1F * fhAmpId; //! Amplitude measured vs towers/crystals id
 TH1F * fhTime;      //! Time measured in towers/crystals
 TH2F * fhTimeId;    //! Time vs Absolute cell Id
 TH2F * fhTimeAmp;   //! Time vs Amplitude 
@@ -216,10 +218,13 @@ void ReadHistograms(TString name, TString dataType, Bool_t isDataMC, Bool_t  fCo
        fhIMCellCut = (TH2F *) outputList->At(index++);
        fhAsym   = (TH2F *) outputList->At(index++);
        
-       fhNCellsPerCluster = (TH2F *) outputList->At(index++);
+       fhNCellsPerCluster    = (TH2F *) outputList->At(index++);
+       fhNCellsPerClusterMIP = (TH2F *) outputList->At(index++);
+
        fhNClusters  = (TH1F *) outputList->At(index++); 
        fhNCells     = (TH1F *) outputList->At(index++); 
        fhAmplitude  = (TH1F *) outputList->At(index++); 
+       fhAmpId      = (TH1F *) outputList->At(index++); 
        if(dataType=="ESD") {
                fhTime       = (TH1F *) outputList->At(index++); 
                fhTimeId     = (TH2F *) outputList->At(index++);