include CalorimeterQA in analysis train, some debug prints in QA added
authorgconesab <gconesab@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 29 Jun 2009 18:14:57 +0000 (18:14 +0000)
committergconesab <gconesab@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 29 Jun 2009 18:14:57 +0000 (18:14 +0000)
PWG4/PartCorrDep/AliAnaCalorimeterQA.cxx
PWG4/macros/AddTaskPartCorr.C

index 15f8bc7..54c73fd 100755 (executable)
@@ -227,7 +227,7 @@ TList *  AliAnaCalorimeterQA::GetCreateOutputObjects()
        // store them in fOutputContainer
     
        TList * outputContainer = new TList() ; 
-       outputContainer->SetName("ExampleHistos") ; 
+       outputContainer->SetName("QAHistos") ; 
        
        Int_t nptbins  = GetHistoNPtBins();
        Int_t nphibins = GetHistoNPhiBins();
@@ -860,7 +860,13 @@ void  AliAnaCalorimeterQA::MakeAnalysisFillHistograms()
        //Play with the MC stack if available
        AliStack * stack = 0x0;
        TParticle * primary = 0x0;
-       if(IsDataMC()) stack =  GetMCStack() ;
+       if(IsDataMC()) { 
+               stack =  GetMCStack() ;
+               if(!stack) {
+                       printf("Stack not available, have you switched on the MC data?\n");
+                       return;
+               }
+       }
        
        //Get List with clusters  
        TRefArray * partList = new TRefArray();
@@ -882,9 +888,9 @@ void  AliAnaCalorimeterQA::MakeAnalysisFillHistograms()
        //Get vertex for photon momentum calculation
        Double_t v[3] ; //vertex ;
        GetReader()->GetVertex(v);
-       
+
        for(Int_t iclus = 0; iclus < partList->GetEntriesFast(); iclus++){
-               
+               //printf(" cluster %d\n",iclus);
                AliAODCaloCluster * calo =  (AliAODCaloCluster*) (partList->At(iclus));
                //if(calo->GetNCells() <= 2) continue;
                //Get cluster kinematics
@@ -905,7 +911,7 @@ void  AliAnaCalorimeterQA::MakeAnalysisFillHistograms()
                
                //matched cluster with tracks
                Int_t ntracksmatched = calo->GetNTracksMatched();
-               
+
                //Fill histograms only possible when simulation
                if(IsDataMC()){
                //Play with the MC stack if available
@@ -920,8 +926,10 @@ void  AliAnaCalorimeterQA::MakeAnalysisFillHistograms()
                                printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() *** large label ***:  label %d, n tracks %d \n", label, stack->GetNtrack());
                                continue ;
                }
+                       
                //cout<<"LABEL > "<<label<<endl;
                primary = GetMCStack()->Particle(label);
+
                    Int_t pdg = primary->GetPdgCode();
                    Float_t vx = primary->Vx();
                    Float_t vy = primary->Vy();
@@ -1127,10 +1135,11 @@ void  AliAnaCalorimeterQA::MakeAnalysisFillHistograms()
                                if(trackIndex >= 0){
                                        AliESDtrack* track = (AliESDtrack*) esd->GetTrack(trackIndex);
                                        if (track && track->GetOuterParam() ) {
-                                               
+
                                                Double_t tphi = track->GetOuterParam()->Phi();
                                                Double_t teta = track->GetOuterParam()->Eta();
                                                Double_t tmom = track->GetOuterParam()->P();
+
                                                Double_t deta = teta - eta;
                                                Double_t dphi = tphi - phi;
                                                if(dphi > TMath::Pi()) dphi -= 2*TMath::Pi();
@@ -1144,9 +1153,11 @@ void  AliAnaCalorimeterQA::MakeAnalysisFillHistograms()
                                                
                                                fh1dR->Fill(dR);
                                                fh2MatchdEdx->Fill(track->P(),track->GetTPCsignal());
-                                           Int_t pdg = primary->GetPdgCode();
-                                               Double_t  charge = TDatabasePDG::Instance()->GetParticle(pdg)->Charge();
+                                       
                                                if(IsDataMC() && primary){ 
+                                                        Int_t pdg = primary->GetPdgCode();
+                                                        Double_t  charge = TDatabasePDG::Instance()->GetParticle(pdg)->Charge();
+                                                       
                                                        if(TMath::Abs(pdg) == 11){
                                                                fhMCEle1pOverE->Fill(pOverE);
                                                                fhMCEle1dR->Fill(dR);
@@ -1185,7 +1196,7 @@ void  AliAnaCalorimeterQA::MakeAnalysisFillHistograms()
                                                if ( (track->GetStatus() & status) == status) printf("ITS+TPC\n");
                                        }
                                        else {
-                                               Printf("ERROR: Could not receive track %d", trackIndex);
+                                               printf("ERROR: Could not receive track %d\n", trackIndex);
                                        }
                                }// non negative track index
                        }//do only if input are ESDs
@@ -1290,6 +1301,10 @@ void  AliAnaCalorimeterQA::MakeAnalysisFillHistograms()
                } //primary loop
        } //Is data MC
        
+       if(GetDebug() > 0)
+               printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - End \n");
+       
+       
 }
 
 //________________________________________________________________________
index f734169..d71f44f 100644 (file)
@@ -27,10 +27,11 @@ AliAnalysisTaskParticleCorrelation *AddTaskPartCorr(TString data, TString calori
   else if(data=="ESD") reader = new AliCaloTrackESDReader();
   else if(data=="MC") reader = new AliCaloTrackMCReader();
   reader->SetDebug(-1);//10 for lots of messages
-  
+  if(calorimeter == "EMCAL") reader->SwitchOnEMCALCells();
+  if(calorimeter == "PHOS")  reader->SwitchOnPHOSCells();
   //Min particle pT
-  reader->SetEMCALPtMin(0.5); 
-  reader->SetPHOSPtMin(0.5);
+  reader->SetEMCALPtMin(0.2); 
+  reader->SetPHOSPtMin(0.2);
   reader->SetCTSPtMin(0.2);
   reader->Print("");
   
@@ -45,7 +46,21 @@ AliAnalysisTaskParticleCorrelation *AddTaskPartCorr(TString data, TString calori
   pid->SetTOFCut(5.e-9);
   pid->SetDebug(-1);
   pid->Print("");
-  
+       
+  AliFidutialCut * fidCut = new AliFidutialCut();
+  fidCut->DoCTSFidutialCut(kFALSE) ;
+  fidCut->DoEMCALFidutialCut(kTRUE) ;
+  fidCut->DoPHOSFidutialCut(kTRUE) ;
+       
+  AliAnaCalorimeterQA *qa = new AliAnaCalorimeterQA();
+  qa->SetDebug(-1); //10 for lots of messages
+  qa->SetCalorimeter(calorimeter);
+  qa->SwitchOnDataMC() ;//Access MC stack and fill more histograms
+  qa->AddToHistogramsName("AnaCaloQA_"+calorimeter);
+  qa->SetFidutialCut(fidCut);
+  qa->SwitchOnFidutialCut();
+  qa->Print("");       
+       
   AliAnaPhoton *anaphoton1 = new AliAnaPhoton();
   anaphoton1->SetDebug(-1); //10 for lots of messages
   //anaphoton->SetMinPt(0.5);
@@ -56,19 +71,40 @@ AliAnalysisTaskParticleCorrelation *AddTaskPartCorr(TString data, TString calori
   anaphoton1->SwitchOffCaloPID();
   anaphoton1->SwitchOffCaloPIDRecalculation(); //recommended for EMCAL
   anaphoton1->SwitchOffFidutialCut();
-  anaphoton1->SetOutputAODName("PhotonsForPi0IM"+calorimeter);
+  anaphoton1->SetOutputAODName("PhotonsForIM"+calorimeter);
   anaphoton1->Print("");
 
   AliAnaPi0 *anapi0 = new AliAnaPi0();
   anapi0->SetDebug(-1);//10 for lots of messages
-  anapi0->SetInputAODName("PhotonsForPi0IM"+calorimeter);
+  anapi0->SetInputAODName("PhotonsForIM"+calorimeter);
   anapi0->SetCaloPID(pid);
   anapi0->SetCalorimeter(calorimeter);
   anapi0->SwitchOnFidutialCut();
   anapi0->SwitchOffDataMC() ;//Access MC stack and fill more histograms
   anapi0->Print("");
   
-  
+//  AliAnaNeutralMeson *ananeutral = new AliAnaNeutralMeson();
+//  ananeutral->SetDebug(-1);//10 for lots of messages
+//  ananeutral->SetInputAODName("PhotonsForIM"+calorimeter);
+//  ananeutral->SetCaloPID(pid);
+//  // ananeutral->SetNCentrBin(5); //number of bins in centrality 
+//  // ananeutral->SetNZvertBin(5); //number of bins for vertex position
+//  // ananeutral->SetNRPBin(6); //number of bins in reaction plain
+//  ananeutral->SetAnaPi0Eta(kTRUE); //whether analysis pi0 and eta
+//  ananeutral->SetAnaOmega(kTRUE);   //whether analysis omega
+//  ananeutral->SetNPID(3);
+//  ananeutral->SetInvMassCut(1.);
+//  ananeutral->SetNEventsMixed(6);
+//  ananeutral->SetNAsyBinsMinMax(200,0,1.);
+//  ananeutral->SetNPtBinsMinMax(200,0,20.);
+//  ananeutral->SetNMassBinsMinMas(200,0,1.);
+//  ananeutral->SetPi0MassPeakWidthCut(0.015);
+//  ananeutral->SetCalorimeter(calorimeter);
+//  ananeutral->SwitchOnFidutialCut();
+//  ananeutral->SwitchOffDataMC() ;//Access MC stack and fill more histograms
+//  ananeutral->AddToHistogramsName("AnaNeutralMeson_");
+//  ananeutral->Print("");
+       
   // -------------------------------------------------
   // --- Photon Isolation and Correlation Analysis ---
   // -------------------------------------------------
@@ -136,7 +172,7 @@ AliAnalysisTaskParticleCorrelation *AddTaskPartCorr(TString data, TString calori
   anacorrhadron->SetPtCutRange(1,100);
   anacorrhadron->SetDeltaPhiCutRange(1.5,4.5);
   anacorrhadron->SelectIsolated(kTRUE); // do correlation with isolated photons
-       if(calorimeter=="PHOS"){
+  if(calorimeter=="PHOS"){
     //Correlate with particles in EMCAL
     anacorrhadron->SwitchOnCaloPID();
     anacorrhadron->SwitchOnCaloPIDRecalculation(); //recommended for EMCAL
@@ -146,12 +182,14 @@ AliAnalysisTaskParticleCorrelation *AddTaskPartCorr(TString data, TString calori
   // #### Configure Maker ####
   AliAnaPartCorrMaker * maker = new AliAnaPartCorrMaker();
   maker->SetReader(reader);//pointer to reader
-  maker->AddAnalysis(anaphoton1,0);
-  maker->AddAnalysis(anapi0,1);
-  maker->AddAnalysis(anaphoton2,2);
-  maker->AddAnalysis(anaisol,3);
-  maker->AddAnalysis(anacorrjet,4);
-  maker->AddAnalysis(anacorrhadron,5);
+  maker->AddAnalysis(qa,0);
+  maker->AddAnalysis(anaphoton1,1);
+  maker->AddAnalysis(anapi0,2);
+  maker->AddAnalysis(anaphoton2,3);
+  maker->AddAnalysis(anaisol,4);
+  maker->AddAnalysis(anacorrjet,5);
+  maker->AddAnalysis(anacorrhadron,6);
+  //maker->AddAnalysis(ananeutral,7);
   maker->SetAnaDebug(-1)  ;
   maker->SwitchOnHistogramsMaker()  ;
   maker->SwitchOnAODsMaker()  ;