- updates for AN67
authorjbook <jbook@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 4 Oct 2012 14:45:39 +0000 (14:45 +0000)
committerjbook <jbook@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 4 Oct 2012 14:45:39 +0000 (14:45 +0000)
PWGDQ/dielectron/macrosJPSI/AddTask_jbook_JPsi.C
PWGDQ/dielectron/macrosJPSI/AddTask_jbook_JPsiQA.C
PWGDQ/dielectron/macrosJPSI/AddTask_jbook_v2.C
PWGDQ/dielectron/macrosJPSI/ConfigJpsiQA_jb_PbPb.C
PWGDQ/dielectron/macrosJPSI/ConfigJpsi_jb_PbPb.C

index 30ea67159fbc7053987df165be92fa1222ea79bd..02583f0f16f9f2c2c410edd3e54c228a0d1261a0 100644 (file)
@@ -1,4 +1,4 @@
-AliAnalysisTask *AddTask_jbook_JPsi(TString prod="", Bool_t gridconf=kFALSE){
+AliAnalysisTask *AddTask_jbook_JPsi(TString prod="", Bool_t gridconf=kFALSE) {
   //get the current analysis manager
   AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
   if (!mgr) {
@@ -12,7 +12,6 @@ AliAnalysisTask *AddTask_jbook_JPsi(TString prod="", Bool_t gridconf=kFALSE){
   if( list.IsNull()) list=prod;
   if( list.Contains("LHC10h")   || list.Contains("LHC11h")   ) hasMC=kFALSE;
   if( list.Contains("LHC11a10") || list.Contains("LHC12a17") ) hasMC=kTRUE;
-  //(AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler()!=0x0);
 
   //Do we have an AOD handler?
   Bool_t isAOD=(mgr->GetInputEventHandler()->IsA()==AliAODInputHandler::Class() ? kTRUE : kFALSE);
@@ -20,9 +19,9 @@ AliAnalysisTask *AddTask_jbook_JPsi(TString prod="", Bool_t gridconf=kFALSE){
   // set AOD debug levels
   if(isAOD) {
     mgr->AddClassDebug("AliAODTrack", AliLog::kFatal);
-    mgr->AddClassDebug("AliAODpidUtil", AliLog::kInfo);
+    mgr->AddClassDebug("AliAODpidUtil", AliLog::kInfo); 
   }
-
+  
   //set config file name
   TString configFile("");
   printf("%s \n",gSystem->pwd());
@@ -49,10 +48,10 @@ AliAnalysisTask *AddTask_jbook_JPsi(TString prod="", Bool_t gridconf=kFALSE){
     gROOT->LoadMacro(configFile.Data());
 
   //add dielectron analysis with different cuts to the task
-  for (Int_t i=0; i<5; ++i){ //nDie defined in config file
+  for (Int_t i=0; i<6; ++i) { //nDie defined in config file
     AliDielectron *jpsi=ConfigJpsi_jb_PbPb(i,list);
     if (jpsi ) task->AddDielectron(jpsi);
-    //    if (jpsi ) printf("add: %s\n",jpsi->GetName());
+    if (jpsi ) printf("add: %s\n",jpsi->GetName());
   }
 
   //Add event filter
index 7f267fafe6590051274c18efde0e934b4ac06b88..b72b590b8ff1f47b9518254199f64e4362064bf9 100644 (file)
@@ -51,7 +51,7 @@ AliAnalysisTask *AddTask_jbook_JPsiQA(TString prod="", Bool_t gridconf=kFALSE){
   for (Int_t i=0; i<nDie; ++i){ //nDie defined in config file
     AliDielectron *jpsi=ConfigJpsiQA_jb_PbPb(i,list);
     if (jpsi ) task->AddDielectron(jpsi);
-    //    if (jpsi ) printf("add: %s\n",jpsi->GetName());
+    if (jpsi ) printf("add: %s\n",jpsi->GetName());
   }
   
   //Add event filter
index 6208d6891efa281f6ac6903ad6d1b3f5996037ab..b483f85c5da23969a89bc577c6c637c0da9574b9 100644 (file)
@@ -49,7 +49,7 @@ AliAnalysisTask *AddTask_jbook_v2(TString prod="", Bool_t gridconf=kFALSE){
     gROOT->LoadMacro(configFile.Data());
 
   //add dielectron analysis with different cuts to the task
-  for (Int_t i=16; i<nDie; ++i){ //nDie defined in config file
+  for (Int_t i=12; i<nDie; ++i){ //nDie defined in config file
     AliDielectron *jpsi=ConfigJpsi_jb_PbPb(i,list);
     if (jpsi ) task->AddDielectron(jpsi);
     if (jpsi ) printf("add: %s\n",jpsi->GetName());
index 83220d02df2a18f034b5da5476cdc1cbb390f77d..52ec693cafac9371e6204e46707e7198a3cacc67 100644 (file)
@@ -7,8 +7,8 @@ void SetupElectronCuts(AliDielectron *die, Int_t cutDefinition);
 TVectorD *GetRunNumbers();
 TVectorD *BinsToVector(Int_t nbins, Double_t min, Double_t max);
 
-TString names=("CutStats;noPID;TPC;TOF;TRD;TOFTRD;TRDeff;e_mcPid;jpsi_mcPid;conv_mcPid");
-enum {kCutStats=0, knoPID, kTPC, kTOF, kTRD, kTOFTRD, kTRDeff, kEleMC, kEleJPsiMC, kEleConvMC};
+TString names=("CutStats;noPID;TPC;TOF;TRD;TOFTRD;TOFTRD2D;TRDeff;e_mcPid;jpsi_mcPid;conv_mcPid");
+enum {kCutStats=0, knoPID, kTPC, kTOF, kTRD, kTOFTRD, kTOFTRD2D, kTRDeff, kEleMC, kEleJPsiMC, kEleConvMC};
 TObjArray *arrNames=names.Tokenize(";");
 
 const Int_t nDie=arrNames->GetEntries();
@@ -40,6 +40,7 @@ AliDielectron* ConfigJpsiQA_jb_PbPb(Int_t cutDefinition, TString prod="")
     case kTOF:       return 0x0;
     case kTRD:       return 0x0;
     case kTOFTRD:    return 0x0;
+    case kTOFTRD2D:  return 0x0;
     case kTRDeff:    return 0x0;
     case kEleMC:     return 0x0;
     case kEleJPsiMC: return 0x0;
@@ -47,12 +48,13 @@ AliDielectron* ConfigJpsiQA_jb_PbPb(Int_t cutDefinition, TString prod="")
     }
   } else { // COLLISION DATA
     switch(cutDefinition) {
-      //     case kCutStats:  return 0x0;
-      //     case knoPID:     return 0x0;
-      //     case kTPC:       return 0x0;
-      //     case kTOF:       return 0x0;
-      //     case kTRD:       return 0x0;
-    case kTOFTRD:    return 0x0;
+      //            case kCutStats:  return 0x0;
+      //            case knoPID:     return 0x0;
+      //            case kTPC:       return 0x0;
+      //            case kTOF:       return 0x0;
+      //            case kTRD:       return 0x0;
+      //            case kTOFTRD:    return 0x0;
+      //            case kTOFTRD2D:  return 0x0;
     case kTRDeff:    return 0x0;
     case kEleMC:     return 0x0;
     case kEleJPsiMC: return 0x0;
@@ -82,9 +84,9 @@ AliDielectron* ConfigJpsiQA_jb_PbPb(Int_t cutDefinition, TString prod="")
   
   // histogram setup
   InitHistograms(die,cutDefinition);
-  printf(" Add %d types and %03d histos to the manager \n",die->GetHistogramList()->GetEntries(),
-        0/*die->GetHistoManager()->GetList()->GetEntries()*/);
-
+  //  printf(" Add %d types and %03d histos to the manager \n",die->GetHistogramList()->GetEntries(),
+  //    die->GetHistoManager()->GetList()->GetEntries());
+  
   // CF container setup
   if(cutDefinition == kTRDeff ) {
     InitCF(die,cutDefinition);
@@ -163,7 +165,12 @@ void SetupTrackCuts(AliDielectron *die, Int_t cutDefinition)
   // Quality cuts
   AliDielectronCutGroup* cuts = new AliDielectronCutGroup("cuts","cuts",AliDielectronCutGroup::kCompAND);
   die->GetTrackFilter().AddCuts(cuts);
-  
+
+  // AOD track filter (needs to be first cut)
+  AliDielectronTrackCuts *trkFilter = new AliDielectronTrackCuts("TrkFilter","TrkFilter");
+  trkFilter->SetAODFilterBit(AliDielectronTrackCuts::kTPCqualSPDanyPIDele);
+  //  if(!isESD) cuts->AddCut(trkFilter);
+
   //Pt cut, should make execution a bit faster
   AliDielectronVarCuts *pt = new AliDielectronVarCuts("Pt>.8","Pt>.8");
   if(cutDefinition<kEleMC) 
@@ -180,7 +187,8 @@ void SetupTrackCuts(AliDielectron *die, Int_t cutDefinition)
   varCuts->AddCut(AliDielectronVarManager::kTPCchi2Cl,    0.0,   4.0);
   varCuts->AddCut(AliDielectronVarManager::kNclsTPC,     70.0, 160.0);
   varCuts->AddCut(AliDielectronVarManager::kKinkIndex0,   0.0);
-  if(!isESD) varCuts->AddCut(AliDielectronVarManager::kV0Index0,   0.0);
+  //varCuts->AddCut(AliDielectronVarManager::kTOFbeta,      0.2,   0.9, kTRUE);
+  //if(!isESD) varCuts->AddCut(AliDielectronVarManager::kV0Index0,   0.0);
   if(cutDefinition!=kCutStats) cuts->AddCut(varCuts);
   
   AliDielectronTrackCuts *trkCuts = new AliDielectronTrackCuts("TrkCuts","TrkCuts");
@@ -195,7 +203,7 @@ void SetupTrackCuts(AliDielectron *die, Int_t cutDefinition)
   
   ////////////////////////////////// DATA
   if(!hasMC && cutDefinition==kTPC) {
-    pid->AddCut(AliDielectronPID::kTPC,AliPID::kPion,-100.,3.5,0.,0.,kTRUE);
+    pid->AddCut(AliDielectronPID::kTPC,AliPID::kPion,-100.,4.0,0.,0.,kTRUE);
     pid->AddCut(AliDielectronPID::kTPC,AliPID::kProton,-100.,3.5,0.,0.,kTRUE);
   }
   
@@ -227,22 +235,28 @@ void SetupTrackCuts(AliDielectron *die, Int_t cutDefinition)
       
     }
   }
-       ////////////////////////////////// DATA + MC
+  ////////////////////////////////// DATA + MC
   // pid cuts TPC + TOF & TRD
   pid->AddCut(AliDielectronPID::kTPC,AliPID::kElectron,-4.,4.);
-  if(cutDefinition==kTOF || cutDefinition==kTOFTRD) 
+
+  if(cutDefinition==kTOF || cutDefinition==kTOFTRD || cutDefinition==kTOFTRD2D)
     pid->AddCut(AliDielectronPID::kTOF,AliPID::kElectron,-3,3.,0.,0.,kFALSE,AliDielectronPID::kIfAvailable);
-  if(cutDefinition==kTRD || cutDefinition==kTOFTRD) 
-    pid->AddCut(AliDielectronPID::kTRDeleEff,AliPID::kElectron,.9,1.,3.5.,6.,kFALSE,
+
+  if(cutDefinition==kTRD || cutDefinition==kTOFTRD)
+    pid->AddCut(AliDielectronPID::kTRDeleEff,AliPID::kElectron,.8,1.,3.5.,6.,kFALSE,
+                AliDielectronPID::kIfAvailable,AliDielectronVarManager::kTRDpidQuality);
+
+  if(cutDefinition==kTOFTRD2D)
+    pid->AddCut(AliDielectronPID::kTRDeleEff2D,AliPID::kElectron,.8,1.,3.5.,6.,kFALSE,
                 AliDielectronPID::kIfAvailable,AliDielectronVarManager::kTRDpidQuality);
 
   if(cutDefinition!=knoPID && cutDefinition!=kCutStats && cutDefinition!=kTRDeff && !hasMC ) cuts->AddCut(pid);
   /* ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PID CUTS ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
 
   // exclude conversion electrons selected by the tender
-  //AliDielectronTrackCuts *noconv=new AliDielectronTrackCuts("noConv","noConv");
-  //noconv->SetV0DaughterCut(AliPID::kElectron,kTRUE);
-  //cuts->AddCut(noconv);
+  AliDielectronTrackCuts *noconv=new AliDielectronTrackCuts("noConv","noConv");
+  noconv->SetV0DaughterCut(AliPID::kElectron,kTRUE);
+  cuts->AddCut(noconv);
   
 }
 
@@ -264,25 +278,24 @@ void InitHistograms(AliDielectron *die, Int_t cutDefinition)
   switch (cutDefinition) {
   case kCutStats:  bHistCuts=kTRUE; break;
   case knoPID:     bHistEvts=kTRUE; bHistPID=kTRUE; bHistRunQA=kTRUE; break;
-  case kTPC:       
-  case kTOF:       
-  case kTRD:       
-  case kTOFTRD: 
-    bHistPID=kTRUE; break;
+  case kTPC:
+  case kTOF:
+  case kTRD:
+  case kTOFTRD:
+  case kTOFTRD2D:  bHistPID=kTRUE; break;
   case kTRDeff:    bHistEff=kTRUE; break;
   case kEleMC:
-  case kEleJPsiMC: 
-  case kEleConvMC: 
+  case kEleJPsiMC:
+  case kEleConvMC:
     bHistPair=kTRUE; break;
   }
-  
-  
+
   //Track classes
   //to fill also track info from 2nd event loop until 2
   for (Int_t i=0; i<2; ++i){
     histos->AddClass(Form("Track_%s",AliDielectron::TrackClassName(i)));
   }
-  
+
   //add histograms to event class
   if (bHistEvts) {
     histos->AddClass("Event");
@@ -293,7 +306,7 @@ void InitHistograms(AliDielectron *die, Int_t cutDefinition)
       histos->UserHistogram("MCEvent","NumberOfJPsis",";N_{J/#psi};#events",20,0.,20.,AliDielectronVarManager::kNumberOfJPsis);
     }
   }
-  
+
   if (bHistRunQA) {
     if(!hasMC) {
     // Flow QA
@@ -306,7 +319,7 @@ void InitHistograms(AliDielectron *die, Int_t cutDefinition)
     histos->UserHistogram("Event","vOCrpH2_RunNumber",";run;#Psi_{2}^{V0C} (rad.)",
                           GetRunNumbers(), BinsToVector(100,-2.,2.) ,
                           AliDielectronVarManager::kRunNumber, AliDielectronVarManager::kv0CrpH2);
-    
+
     histos->UserHistogram("Event","TPCrpH2uc_Cent_RunNumber",";centrality (%);#Psi^{TPC} (rad.);run",
                           BinsToVector(10,0.,100.), BinsToVector(100,-2.,2.), GetRunNumbers(),
                           AliDielectronVarManager::kCentrality,
@@ -323,7 +336,7 @@ void InitHistograms(AliDielectron *die, Int_t cutDefinition)
                           AliDielectronVarManager::kv0CrpH2,
                           AliDielectronVarManager::kRunNumber );
     }
-    
+
     // PID QA
     histos->UserHistogram("Track","TPCnSigmaPio_Nacc_RunNumber",";N_{acc};run;n#sigma_{pio}^{TPC}",
                           BinsToVector(60,0.,3000.), GetRunNumbers(), BinsToVector(40,-5.,5.),
@@ -334,7 +347,7 @@ void InitHistograms(AliDielectron *die, Int_t cutDefinition)
                           BinsToVector(60,0.,3000.), BinsToVector(40,-5.,5.),
                           AliDielectronVarManager::kNacc,
                           AliDielectronVarManager::kTPCnSigmaPio);
-    
+
     histos->UserProfile("Track","TPCnSigmaPio-Nacc-RunNumber",";N_{acc};run;n#sigma_{pio}^{TPC}",
                         AliDielectronVarManager::kTPCnSigmaPio,
                         BinsToVector(60,0.,3000.),      GetRunNumbers(),
@@ -345,40 +358,50 @@ void InitHistograms(AliDielectron *die, Int_t cutDefinition)
     histos->UserProfile("Track","TPCnSigmaPio-Nacc",";N_{acc};n#sigma_{pio}^{TPC}",
                         AliDielectronVarManager::kTPCnSigmaPio,
                         BinsToVector(60,0.,3000.), AliDielectronVarManager::kNacc , "s;-5;5");
-    
+
+    histos->UserHistogram("Track","dEdx_RunNumber",";run;TPC signal (arb units)",
+                         GetRunNumbers(), BinsToVector(200,0.,200.),
+                         AliDielectronVarManager::kRunNumber,
+                         AliDielectronVarManager::kTPCsignal);
+    histos->UserHistogram("Track","TPCnSigmaEle_RunNumber",";run;TPC signal (arb units)",
+                         GetRunNumbers(), BinsToVector(100,-5.,5.),
+                         AliDielectronVarManager::kRunNumber,
+                         AliDielectronVarManager::kTPCnSigmaEle);
+    histos->UserHistogram("Track","dEdx_Eta",";#eta;TPC signal (arb units)",
+                         100,-1.,1.,200,0.,200.,AliDielectronVarManager::kEta,AliDielectronVarManager::kTPCsignal,kTRUE);
+    histos->UserHistogram("Track","dEdx_Phi",";#phi;TPC signal (arb units)",
+                         180,0.,6.285,200,0.,200.,AliDielectronVarManager::kPhi,AliDielectronVarManager::kTPCsignal,kTRUE);
   } // end PID+Flow QA
-  
-  if (bHistPID) {      
-    
-    //    if(cutDefinition==kTPC) {     // centrality dependence
+
+  if (bHistPID) {
       histos->UserHistogram("Track","dEdx_P_Cent",";p (GeV/c);TPC signal (arb units);centrality (%)",
                             400,0.2,20., 200,0.,200., 10,0.,100.,
                             AliDielectronVarManager::kPIn,
                             AliDielectronVarManager::kTPCsignal,
                             AliDielectronVarManager::kCentrality, 
                             kTRUE);
-      
+
       histos->UserHistogram("Track","TPCnSigmaEle_P_Cent",";p (GeV/c);n#sigma_{ele}^{TPC};centrality (%)",
                             100,0.2,20., 100,-10.,10., 10,0.,100.,
                             AliDielectronVarManager::kPIn,
                             AliDielectronVarManager::kTPCnSigmaEle,
                             AliDielectronVarManager::kCentrality, 
                             kTRUE);
-      
+
       histos->UserHistogram("Track","TPCnSigmaPio_P_Cent",";p (GeV/c);n#sigma_{pio}^{TPC};centrality (%)",
                             100,0.2,20., 100,-10.,10., 10,0.,100.,
                             AliDielectronVarManager::kPIn,
                             AliDielectronVarManager::kTPCnSigmaPio,
                             AliDielectronVarManager::kCentrality, 
                             kTRUE);
-      
+
       histos->UserHistogram("Track","TPCnSigmaPro_P_Cent",";p (GeV/c);n#sigma_{pro}^{TPC};centrality (%)",
                             100,0.2,20., 100,-10.,10., 10,0.,100.,
                             AliDielectronVarManager::kPIn,
                             AliDielectronVarManager::kTPCnSigmaPro,
                             AliDielectronVarManager::kCentrality, 
                             kTRUE);
-      
+
       histos->UserHistogram("Track","TOFbeta_P_Cent",";p (GeV/c);#beta;centrality (%);#tracks",
                             250,0.0,5., 300,0.,1.2, 10,0.,100.,
                             AliDielectronVarManager::kPIn,
@@ -390,42 +413,25 @@ void InitHistograms(AliDielectron *die, Int_t cutDefinition)
                             AliDielectronVarManager::kPIn,
                             AliDielectronVarManager::kTOFnSigmaEle,
                             AliDielectronVarManager::kCentrality);
-      //} 
-
-    // main pid spectra
-    histos->UserHistogram("Track","dEdx_P",";p (GeV/c);TPC signal (arb units);#tracks",
-                          400,0.2,20.,200,0.,200.,AliDielectronVarManager::kPIn,AliDielectronVarManager::kTPCsignal,kTRUE);
-    histos->UserHistogram("Track","TPCnSigmaEle_P",";p (GeV/c);n#sigma_{ele}^{TPC}",
-                          100,0.2,20.,100,-10.,10.,AliDielectronVarManager::kPIn,AliDielectronVarManager::kTPCnSigmaEle,kTRUE);
-    histos->UserHistogram("Track","TPCnSigmaPio_P",";p (GeV/c);n#sigma_{pio}^{TPC}",
-                         100,0.2,20.,100,-10.,10.,AliDielectronVarManager::kPIn,AliDielectronVarManager::kTPCnSigmaPio,kTRUE);
-    histos->UserHistogram("Track","TPCnSigmaPro_P",";p (GeV/c);n#sigma_{pro}^{TPC}",
+
+      // main pid spectra
+      histos->UserHistogram("Track","dEdx_P",";p (GeV/c);TPC signal (arb units);#tracks",
+                           400,0.2,20.,200,0.,200.,AliDielectronVarManager::kPIn,AliDielectronVarManager::kTPCsignal,kTRUE);
+      histos->UserHistogram("Track","TPCnSigmaEle_P",";p (GeV/c);n#sigma_{ele}^{TPC}",
+                           100,0.2,20.,100,-10.,10.,AliDielectronVarManager::kPIn,AliDielectronVarManager::kTPCnSigmaEle,kTRUE);
+      histos->UserHistogram("Track","TPCnSigmaPio_P",";p (GeV/c);n#sigma_{pio}^{TPC}",
+                           100,0.2,20.,100,-10.,10.,AliDielectronVarManager::kPIn,AliDielectronVarManager::kTPCnSigmaPio,kTRUE);
+      histos->UserHistogram("Track","TPCnSigmaPro_P",";p (GeV/c);n#sigma_{pro}^{TPC}",
                           100,0.2,20.,100,-10.,10.,AliDielectronVarManager::kPIn,AliDielectronVarManager::kTPCnSigmaPro,kTRUE);
-    histos->UserHistogram("Track","dEdx_NclsTPC",";N_{cls}^{TPC};TPC signal (arb units);#tracks",
-                          160,0.,160.,200,0.,200.,AliDielectronVarManager::kNclsTPC,AliDielectronVarManager::kTPCsignal);
-
-    histos->UserHistogram("Track","TOFbeta_P",";p (GeV/c);#beta;#tracks",
-                          250,0.0,5.0,300,0.,1.2,AliDielectronVarManager::kPIn,AliDielectronVarManager::kTOFbeta);
-    histos->UserHistogram("Track","TOFnSigmaEle_P",";p (GeV/c);n#sigma_{ele}^{TOF}",
-                          100,0.2,20.,50,-10.,10.,AliDielectronVarManager::kP,AliDielectronVarManager::kTOFnSigmaEle,kTRUE);
-
-    if(cutDefinition==knoPID || cutDefinition==kTPC) {
-      histos->UserHistogram("Track","dEdx_RunNumber",";run;TPC signal (arb units)",
-                           GetRunNumbers(), BinsToVector(200,0.,200.),
-                           AliDielectronVarManager::kRunNumber,
-                           AliDielectronVarManager::kTPCsignal);
-      histos->UserHistogram("Track","TPCnSigmaEle_RunNumber",";run;TPC signal (arb units)",
-                           GetRunNumbers(), BinsToVector(100,-5.,5.),
-                           AliDielectronVarManager::kRunNumber,
-                           AliDielectronVarManager::kTPCnSigmaEle);
-      histos->UserHistogram("Track","dEdx_Eta",";#eta;TPC signal (arb units)",
-                           100,-1.,1.,200,0.,200.,AliDielectronVarManager::kEta,AliDielectronVarManager::kTPCsignal,kTRUE);
-      histos->UserHistogram("Track","dEdx_Phi",";#phi;TPC signal (arb units)",
-                           180,0.,6.285,200,0.,200.,AliDielectronVarManager::kPhi,AliDielectronVarManager::kTPCsignal,kTRUE);
-    }
+      histos->UserHistogram("Track","dEdx_NclsTPC",";N_{cls}^{TPC};TPC signal (arb units);#tracks",
+                           160,0.,160.,200,0.,200.,AliDielectronVarManager::kNclsTPC,AliDielectronVarManager::kTPCsignal);
 
+      histos->UserHistogram("Track","TOFbeta_P",";p (GeV/c);#beta;#tracks",
+                           250,0.0,5.0,300,0.,1.2,AliDielectronVarManager::kPIn,AliDielectronVarManager::kTOFbeta);
+      histos->UserHistogram("Track","TOFnSigmaEle_P",";p (GeV/c);n#sigma_{ele}^{TOF}",
+                           100,0.2,20.,50,-10.,10.,AliDielectronVarManager::kP,AliDielectronVarManager::kTOFnSigmaEle,kTRUE);
   } // end PID hists
-  
+
   if (bHistPair) {
     //Pair classes
     for (Int_t i=1; i<=1; ++i){ // only +- pairs
@@ -450,11 +456,11 @@ void InitHistograms(AliDielectron *die, Int_t cutDefinition)
                           100,0.,1., AliDielectronVarManager::kLegDistXY);
     histos->UserHistogram("Pair","PdgCode",";mother PDG code;#tracks",
                           10000,-5000.5,4999.5,AliDielectronVarManager::kPdgCode);
-    
+
     // ITS tracks
-    histos->UserHistogram("Track","NclsITS",";N_{cls}^{ITS};#tracks", 
+    histos->UserHistogram("Track","NclsITS",";N_{cls}^{ITS};#tracks",
                           "0,1,2,3,4,5,6,7",  AliDielectronVarManager::kNclsITS);
-    histos->UserHistogram("Track","ITSLayerFirstCls",";ITS layer first cls;#tracks", 
+    histos->UserHistogram("Track","ITSLayerFirstCls",";ITS layer first cls;#tracks",
                           "-1,0,1,2,3,4,5,6", AliDielectronVarManager::kITSLayerFirstCls);
   } // end pair hists
 
@@ -498,7 +504,7 @@ void InitHistograms(AliDielectron *die, Int_t cutDefinition)
 
   } // end TRD eff
   
-  if(1) {    
+  if(0) {    
     //histos->UserHistogram("Track","Pt",";p_{T} (GeV/c);#tracks",200,0,20.,AliDielectronVarManager::kPt);
     //histos->UserHistogram("Track","Eta",";#eta;#tracks",100,-2.,2.,AliDielectronVarManager::kEta);
     //histos->UserHistogram("Track","Phi",";#phi;#tracks",360,0.,6.285,AliDielectronVarManager::kPhi);  
@@ -507,7 +513,7 @@ void InitHistograms(AliDielectron *die, Int_t cutDefinition)
     histos->UserHistogram("Track","TRDchi2_TRDpidQuality",";#chi^{2}_{TRD};N_{trkl}^{TRD};#tracks",
                          11,-1.,10., 7,0.,7.,    AliDielectronVarManager::kTRDchi2, AliDielectronVarManager::kTRDpidQuality);
     }
-    histos->UserHistogram("Track","V0Index0",";V0;#tracks",2,-0.5,1.5,AliDielectronVarManager::kV0Index0);
+    //    histos->UserHistogram("Track","V0Index0",";V0;#tracks",2,-0.5,1.5,AliDielectronVarManager::kV0Index0);
     if(hasMC) {
       histos->UserHistogram("Track","PdgCodeMother",";mother PDG code;#tracks",10000,-5000.5,4999.5,AliDielectronVarManager::kPdgCodeMother);
       //    histos->UserHistogram("Track","PdgCode",";tracks PDG code;#tracks",10000,-5000.5,4999.5,AliDielectronVarManager::kPdgCode);
index 1084c90ae9ebfcd75f72c2127c5902548e599465..3c201b5d5f49db2b64cf279e62ca83ae6d95c136 100644 (file)
@@ -9,8 +9,8 @@ void AddMCSignals(AliDielectron *die);
 void SetEtaCorrection();
 TVectorD *GetRunNumbers();
 
-TString names=("TPC;TOF;TRD;rec;TOFTRD;TOFTRD2;ITScls;ITSamy;dca;chi2;Gam0;Gam01;Gam05;Gam10;Gam15;Gam20;EtaGap01;EtaGap02;EtaGap03;EtaGap04;EtaGap05;SubLS;SubRndm");
-enum { kTPC=0, kTOF, kTRD, krec, kTOFTRD, kTOFTRD2, kITScls, kITSamy, kDCA, kChi, kGam0, kGam01, kGam05, kGam10, kGam15, kGam20, kEtaGap01, kEtaGap02, kEtaGap03, kEtaGap04, kEtaGap05, kSubLS, kSubRndm };
+TString names=("TPC;TOF;TRD;TOFTRD;TOFTRD2D;rec;Gam0;Gam01;Gam05;Gam10;Gam15;Gam20;EtaGap01;EtaGap02;EtaGap03;EtaGap04;EtaGap05;SubLS;SubRndm");
+enum { kTPC=0, kTOF, kTRD, kTOFTRD, kTOFTRD2D, krec,kGam0, kGam01, kGam05, kGam10, kGam15, kGam20, kEtaGap01, kEtaGap02, kEtaGap03, kEtaGap04, kEtaGap05, kSubLS, kSubRndm };
 
 TObjArray *arrNames=names.Tokenize(";");
 const Int_t nDie=arrNames->GetEntries();
@@ -35,38 +35,51 @@ AliDielectron* ConfigJpsi_jb_PbPb(Int_t cutDefinition, TString prod="")
   isESD=(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()->IsA()==AliESDInputHandler::Class());
 
   // switch off some configurations
-  switch(cutDefinition) {
-  case kTPC:
-      //case kTOF:
-  case kTRD:
-  case kTOFTRD:
-      return 0x0;
-      break;
-  case krec:
-      if(!hasMC) return 0x0;
-      break;
-      //case kTOFTRD2:
-    case kITScls:
-    case kITSamy:
-    case kDCA:
-    case kChi:
-      return 0x0;
-      break;
-      //    case kGam0:
-      //    case kGam01:
-      //    case kGam05:
-      //    case kGam10:
-      //    case kGam15:
-      //    case kGam20:
-    case kEtaGap01:
-    case kEtaGap02:
-    case kEtaGap03:
-    case kEtaGap04:
-    case kEtaGap05:
-    case kSubLS:
-    case kSubRndm:
-      if( hasMC) return 0x0;
-      break;
+  if(hasMC) { // MONTE CARLO
+    switch(cutDefinition) {
+    case kTPC:       return 0x0;
+    case kTOF:       return 0x0;
+    case kTRD:       return 0x0;
+    case kTOFTRD:    return 0x0;
+    case kTOFTRD2D:  return 0x0;
+    case krec:       return 0x0;
+    case kGam0:      return 0x0;
+    case kGam01:     return 0x0;
+    case kGam05:     return 0x0;
+    case kGam10:     return 0x0;
+    case kGam15:     return 0x0;
+    case kGam20:     return 0x0;
+    case kEtaGap01:  return 0x0;
+    case kEtaGap02:  return 0x0;
+    case kEtaGap03:  return 0x0;
+    case kEtaGap04:  return 0x0;
+    case kEtaGap05:  return 0x0;
+    case kSubLS:     return 0x0;
+    case kSubRndm:   return 0x0;
+    case kCutStats:  return 0x0;
+    }
+  } else { // COLLISION DATA
+    switch(cutDefinition) {
+    case kTPC:       return 0x0;
+    //            case kTOF:       return 0x0;
+    case kTRD:       return 0x0;
+    //            case kTOFTRD:    return 0x0;
+    //            case kTOFTRD2D:  return 0x0;
+    case krec:       return 0x0;
+    case kGam0:      return 0x0;
+    case kGam01:     return 0x0;
+    case kGam05:     return 0x0;
+    case kGam10:     return 0x0;
+    case kGam15:     return 0x0;
+    case kGam20:     return 0x0;
+    case kEtaGap01:  return 0x0;
+    case kEtaGap02:  return 0x0;
+    case kEtaGap03:  return 0x0;
+    case kEtaGap04:  return 0x0;
+    case kEtaGap05:  return 0x0;
+    case kSubLS:     return 0x0;
+    case kSubRndm:   return 0x0;
+    }
   }
 
   // create the actual framework object
@@ -102,15 +115,9 @@ AliDielectron* ConfigJpsi_jb_PbPb(Int_t cutDefinition, TString prod="")
   SetupPairCuts(die,cutDefinition);
 
   // histogram setup
-  if(cutDefinition == kTOF     ||
-     cutDefinition == kTOFTRD  ||
-     cutDefinition == kGam0    ||
-     cutDefinition == kTOFTRD2 ||
-     cutDefinition >= kEtaGap01 ) {
-    InitHistograms(die,cutDefinition);
-    printf(" Add %d types and %03d histos to the manager \n",die->GetHistogramList()->GetEntries(),
-          0/*die->GetHistoManager()->GetList()->GetEntries()*/);
-  }
+  InitHistograms(die,cutDefinition);
+  printf(" Add %d types and %03d histos to the manager \n",die->GetHistogramList()->GetEntries(),
+        0/*die->GetHistoManager()->GetList()->GetEntries()*/);
 
   // CF container setup, switched off
   if(cutDefinition <  kEtaGap01 ||
@@ -122,9 +129,9 @@ AliDielectron* ConfigJpsi_jb_PbPb(Int_t cutDefinition, TString prod="")
   }
 
   // HF arrays setup
-//   if(cutDefinition <  kEtaGap01 ) {
-//     InitHF(die,cutDefinition);
-//   }
+  //  if(cutDefinition <  kEtaGap01 ) {
+    InitHF(die,cutDefinition);
+    //}
 
 
   // bgrd estimators
@@ -173,10 +180,8 @@ AliDielectron* ConfigJpsi_jb_PbPb(Int_t cutDefinition, TString prod="")
   }
 
   // prefilter settings
-  if(cutDefinition == kTOFTRD2)
-    die->SetPreFilterAllSigns();
-  else
-    die->SetPreFilterUnlikeOnly();
+  //    die->SetPreFilterAllSigns();
+  die->SetPreFilterUnlikeOnly();
 
   // setup eta correction
   //  if(isESD && list.Contains("LHC10h")) SetEtaCorrection();
@@ -212,7 +217,7 @@ void SetupTrackCuts(AliDielectron *die, Int_t cutDefinition)
   pt->AddCut(AliDielectronVarManager::kPt,1.1,1e30);    //0.8
   cuts->AddCut(pt);
 
-       // track cuts ESD and AOD
+  // track cuts ESD and AOD
   AliDielectronVarCuts *varCuts = new AliDielectronVarCuts("VarCuts","VarCuts");
   varCuts->AddCut(AliDielectronVarManager::kImpactParXY, -1.0,   1.0);
   varCuts->AddCut(AliDielectronVarManager::kImpactParZ,  -3.0,   3.0);
@@ -220,6 +225,8 @@ void SetupTrackCuts(AliDielectron *die, Int_t cutDefinition)
   varCuts->AddCut(AliDielectronVarManager::kTPCchi2Cl,    0.0,   4.0);
   varCuts->AddCut(AliDielectronVarManager::kNclsTPC,     70.0, 160.0);
   varCuts->AddCut(AliDielectronVarManager::kKinkIndex0,   0.0);
+  if(cutDefinition==kTOF || cutDefinition==kTOFTRD || cutDefinition==kTOFTRD2D)
+    varCuts->AddCut(AliDielectronVarManager::kTOFbeta,      0.2,   0.9, kTRUE);
   cuts->AddCut(varCuts);
 
   AliDielectronTrackCuts *trkCuts = new AliDielectronTrackCuts("TrkCuts","TrkCuts");
@@ -236,12 +243,16 @@ void SetupTrackCuts(AliDielectron *die, Int_t cutDefinition)
 
   ////////////////////////////////// DATA
   if(!hasMC) {
-    pid->AddCut(AliDielectronPID::kTPC,AliPID::kPion,-100.,3.0,0.,0.,kTRUE);
+    pid->AddCut(AliDielectronPID::kTPC,AliPID::kPion,-100.,4.0,0.,0.,kTRUE);
     pid->AddCut(AliDielectronPID::kTPC,AliPID::kProton,-100.,3.5,0.,0.,kTRUE);
 
-    if(cutDefinition==kTRD || cutDefinition>=kTOFTRD || cutDefinition>=kTOFTRD2)
+    if(cutDefinition==kTRD || cutDefinition==kTOFTRD)
       pid->AddCut(AliDielectronPID::kTRDeleEff,AliPID::kElectron,.8,1.,3.5.,6.,kFALSE,
                   AliDielectronPID::kIfAvailable,AliDielectronVarManager::kTRDpidQuality);
+
+    if(cutDefinition==kTOFTRD2D)
+      pid->AddCut(AliDielectronPID::kTRDeleEff2D,AliPID::kElectron,.8,1.,3.5.,6.,kFALSE,
+                  AliDielectronPID::kIfAvailable,AliDielectronVarManager::kTRDpidQuality);
   }
 
   ////////////////////////////////// MC
@@ -331,8 +342,9 @@ void SetupTrackCuts(AliDielectron *die, Int_t cutDefinition)
 
   ////////////////////////////////// DATA + MC
   // pid cuts TPC + TOF & TRD
-  pid->AddCut(AliDielectronPID::kTPC,AliPID::kElectron,-4.0,4.);
-  if(cutDefinition==kTOF || cutDefinition>=kTOFTRD || cutDefinition>=kTOFTRD2)
+  pid->AddCut(AliDielectronPID::kTPC,AliPID::kElectron,-4.,4.);
+  
+  if(cutDefinition==kTOF || cutDefinition==kTOFTRD || cutDefinition==kTOFTRD2D)
     pid->AddCut(AliDielectronPID::kTOF,AliPID::kElectron,-3,3.,0.,0.,kFALSE,AliDielectronPID::kIfAvailable);
 
   if(cutDefinition!=krec) cuts->AddCut(pid);
@@ -391,37 +403,94 @@ void InitHistograms(AliDielectron *die, Int_t cutDefinition)
   // Initialise the histograms
   //
 
+  // booleans for histo selection
+  Bool_t bHistEvts = kFALSE, bHistPair = kFALSE, bHistPairME = kFALSE, bHistFlow = kFALSE, bHistFlowQA=kFALSE;
+  switch (cutDefinition) {
+  case kTPC:
+  case kTOF:      bHistEvts=kTRUE; bHistFlow=kTRUE; bHistPair=kTRUE; bHistPairME=kTRUE; break;
+  case kTRD:
+  case kTOFTRD:
+  case kTOFTRD2D: bHistFlow=kTRUE; bHistPair=kTRUE; break;
+  case krec:
+  case kITScls:
+  case kITSamy:
+  case kDCA:
+  case kChi:      break;
+  case kEtaGap01:
+  case kEtaGap02:
+  case kEtaGap03:
+  case kEtaGap04:
+  case kEtaGap05:
+  case kSubRndm:  bHistFlow=kTRUE; bHistFlowQA=kTRUE; break;
+  case kSubLS:    bHistFlow=kTRUE; bHistFlowQA=kTRUE; bHistEvts=kTRUE; break;
+  case kGam0:
+  case kGam01:
+  case kGam05:
+  case kGam10:
+  case kGam15:
+  case kGam20:    break;
+  }
+
+
   //Setup histogram Manager
   AliDielectronHistos *histos=new AliDielectronHistos(die->GetName(),die->GetTitle());
 
   //add histograms to event class
   histos->AddClass("Event");
-  histos->UserHistogram("Event","RunNumber","Events per run;run;events",
-                        GetRunNumbers(),
-                       AliDielectronVarManager::kRunNumber);
-  histos->UserHistogram("Event","VtxZ","Vertex Z;z (cm)", 300,-15.,15.,
-                        AliDielectronVarManager::kZvPrim);
   histos->UserHistogram("Event","Centrality","Centrality;centrality (%);events",
                         "0.,5.,10.,20.,40.,50.,60.,80.",
                         AliDielectronVarManager::kCentrality);
-  histos->UserHistogram("Event","Multiplicity","Multiplicity V0;Multiplicity V0;events", 500,0.,25000.,
-                        AliDielectronVarManager::kMultV0);
-  histos->UserHistogram("Event","Cent_Mult","Centrality vs. Multiplicity;centrality (%);Multiplicity V0",
-                        10,0.,100., 500,0.,25000.,
-                        AliDielectronVarManager::kCentrality,AliDielectronVarManager::kMultV0);
-  histos->UserProfile("Event","Cent_Nacc",
-                      "accepted tracks;centrality (%)",
-                      AliDielectronVarManager::kNacc,
-                      "0.,5.,10.,20.,40.,50.,60.,80.,100.",
-                      AliDielectronVarManager::kCentrality);
-  histos->UserProfile("Event","Cent_NVtxContrib",
-                      "number of vertex contributors;centrality (%)",
-                      AliDielectronVarManager::kNVtxContrib,
+
+  ////// EVENT HISTOS /////
+  if(bHistEvts) {
+    histos->UserHistogram("Event","RunNumber","Events per run;run;events",
+                         GetRunNumbers(),
+                         AliDielectronVarManager::kRunNumber);
+    histos->UserHistogram("Event","VtxZ","Vertex Z;z (cm)", 300,-15.,15.,
+                         AliDielectronVarManager::kZvPrim);
+    histos->UserHistogram("Event","Multiplicity","Multiplicity V0;Multiplicity V0;events", 500,0.,25000.,
+                         AliDielectronVarManager::kMultV0);
+    histos->UserHistogram("Event","Cent_Mult","Centrality vs. Multiplicity;centrality (%);Multiplicity V0",
+                         10,0.,100., 500,0.,25000.,
+                         AliDielectronVarManager::kCentrality,AliDielectronVarManager::kMultV0);
+    histos->UserProfile("Event","Cent_Nacc", "accepted tracks;centrality (%)",
+                       AliDielectronVarManager::kNacc,
+                       "0.,5.,10.,20.,40.,50.,60.,80.,100.",
+                       AliDielectronVarManager::kCentrality);
+    histos->UserProfile("Event","Cent_NVtxContrib", "number of vertex contributors;centrality (%)",
+                       AliDielectronVarManager::kNVtxContrib,
                       "0.,5.,10.,20.,40.,50.,60.,80.,100.",
-                      AliDielectronVarManager::kCentrality);
+                       AliDielectronVarManager::kCentrality);
+  } //hist: event
+
 
   ////// FLOW //////
-  if(cutDefinition == kTOFTRD || cutDefinition==kTOF) {
+  if(bHistFlow) {
+
+    // RP angles versus centrality
+    histos->UserHistogram("Event","Cent_TPCrpH2","TPC RP;centrality (%);#Psi^{TPC} (rad.)",
+                          10,0.,100.,100,-2.,2.,
+                          AliDielectronVarManager::kCentrality,AliDielectronVarManager::kTPCrpH2);
+    histos->UserHistogram("Event","Cent_TPCsub1rpH2","TPC-1 RP;centrality (%);#Psi^{sub1} (rad.)",
+                          10,0.,100.,100,-2.,2.,
+                          AliDielectronVarManager::kCentrality,AliDielectronVarManager::kTPCsub1rpH2);
+    histos->UserHistogram("Event","Cent_TPCsub2rpH2","TPC-2 RP;centrality (%);#Psi^{sub2} (rad.)",
+                          10,0.,100.,100,-2.,2.,
+                          AliDielectronVarManager::kCentrality,AliDielectronVarManager::kTPCsub2rpH2);
+
+    histos->UserHistogram("Event","Cent_v0ACrpH2","VZERO-AC RP;centrality (%);#Psi_{2}^{V0AC} (rad.)",
+                          10,0.,100.,100,-2.0,2.0,
+                          AliDielectronVarManager::kCentrality,AliDielectronVarManager::kv0ACrpH2);
+    histos->UserHistogram("Event","Cent_v0ArpH2","VZERO-A RP;centrality (%);#Psi_{2}^{V0A} (rad.)",
+                          10,0.,100.,100,-2.0,2.0,
+                          AliDielectronVarManager::kCentrality,AliDielectronVarManager::kv0ArpH2);
+    histos->UserHistogram("Event","Cent_v0CrpH2","VZERO-C RP;centrality (%);#Psi_{2}^{V0C} (rad.)",
+                          10,0.,100.,100,-2.0,2.0,
+                          AliDielectronVarManager::kCentrality,AliDielectronVarManager::kv0CrpH2);
+  } // hist: flow
+
+  if(bHistFlowQA) {
+    // TPC event plane
     histos->UserHistogram("Event","TPCxH2","TPC Qx component;TPCxH2",
                           100,-1500.,1500.,
                           AliDielectronVarManager::kTPCxH2);
@@ -483,113 +552,40 @@ void InitHistograms(AliDielectron *die, Int_t cutDefinition)
      histos->UserHistogram("Event","TPCsub12DiffH2uc","TPC reaction plane difference;TPCsub12DiffH2uc",
      100,-1.,1.,
      AliDielectronVarManager::kTPCsub12DiffH2uc);
-     */
-    histos->UserHistogram("Event","V0ACrpH2","VZERO-AC RP; #Psi_{2}^{V0AC} (rad.)",
-                          100,-2.0,2.0,
-                          AliDielectronVarManager::kV0ACrpH2);
-    histos->UserHistogram("Event","V0ArpH2","VZERO-A RP; #Psi_{2}^{V0A} (rad.)",
-                          100,-2.0,2.0,
-                          AliDielectronVarManager::kV0ArpH2);
-    histos->UserHistogram("Event","V0CrpH2","VZERO-C RP; #Psi_{2}^{V0C} (rad.)",
-                          100,-2.0,2.0,
-                          AliDielectronVarManager::kV0CrpH2);
-
-    histos->UserHistogram("Event","V0ATPCDiffH2","VZERO-A TPC diff; cos(2(#Psi^{V0A}-#Psi^{TPC}))",
-                          300,-1.0,1.0,
-                          AliDielectronVarManager::kV0ATPCDiffH2);
-    histos->UserHistogram("Event","V0CTPCDiffH2","VZERO-C TPC diff; cos(2(#Psi^{V0C}-#Psi^{TPC}))",
-                          300,-1.0,1.0,
-                          AliDielectronVarManager::kV0CTPCDiffH2);
-    histos->UserHistogram("Event","V0AV0CDiffH2","VZERO-A VZERO-C diff; cos(2(#Psi^{V0A}-#Psi^{V0C}))",
-                          300,-1.0,1.0,
-                          AliDielectronVarManager::kV0AV0CDiffH2);
-
-    // centrality dependent event plane histograms
-    histos->UserHistogram("Event","Cent_TPCrpH2","TPC RP;centrality (%);#Psi^{TPC} (rad.)",
-                          10,0.,100.,100,-2.,2.,
-                          AliDielectronVarManager::kCentrality,AliDielectronVarManager::kTPCrpH2);
-    histos->UserHistogram("Event","Cent_TPCsub1rpH2","TPC-1 RP;centrality (%);#Psi^{sub1} (rad.)",
-                          10,0.,100.,100,-2.,2.,
-                          AliDielectronVarManager::kCentrality,AliDielectronVarManager::kTPCsub1rpH2);
-    histos->UserHistogram("Event","Cent_TPCsub2rpH2","TPC-2 RP;centrality (%);#Psi^{sub2} (rad.)",
-                          10,0.,100.,100,-2.,2.,
-                          AliDielectronVarManager::kCentrality,AliDielectronVarManager::kTPCsub2rpH2);
+    */
 
-    histos->UserHistogram("Event","Cent_V0ACrpH2","VZERO-AC RP;centrality (%);#Psi_{2}^{V0AC} (rad.)",
-                          10,0.,100.,100,-2.0,2.0,
-                          AliDielectronVarManager::kCentrality,AliDielectronVarManager::kV0ACrpH2);
-    histos->UserHistogram("Event","Cent_V0ArpH2","VZERO-A RP;centrality (%);#Psi_{2}^{V0A} (rad.)",
-                          10,0.,100.,100,-2.0,2.0,
-                          AliDielectronVarManager::kCentrality,AliDielectronVarManager::kV0ArpH2);
-    histos->UserHistogram("Event","Cent_V0CrpH2","VZERO-C RP;centrality (%);#Psi_{2}^{V0C} (rad.)",
-                          10,0.,100.,100,-2.0,2.0,
-                          AliDielectronVarManager::kCentrality,AliDielectronVarManager::kV0CrpH2);
-    // for resolution calculation
-    histos->UserHistogram("Event","Cent_V0ATPCDiffH2","VZERO-A TPC diff;centrality (%);cos(2(#Psi^{V0A}-#Psi^{TPC}))",
+    // EP resolution calculation
+    histos->UserHistogram("Event","Cent_v0ATPCDiffH2","VZERO-A TPC diff;centrality (%);cos(2(#Psi^{V0A}-#Psi^{TPC}))",
                           10,0.,100.,300,-1.0,1.0,
-                          AliDielectronVarManager::kCentrality,AliDielectronVarManager::kV0ATPCDiffH2);
-    histos->UserHistogram("Event","Cent_V0CTPCDiffH2","VZERO-C TPC diff;centrality (%);cos(2(#Psi^{V0C}-#Psi^{TPC}))",
+                          AliDielectronVarManager::kCentrality,AliDielectronVarManager::kv0ATPCDiffH2);
+    histos->UserHistogram("Event","Cent_v0CTPCDiffH2","VZERO-C TPC diff;centrality (%);cos(2(#Psi^{V0C}-#Psi^{TPC}))",
                           10,0.,100.,300,-1.0,1.0,
-                          AliDielectronVarManager::kCentrality,AliDielectronVarManager::kV0CTPCDiffH2);
-    histos->UserHistogram("Event","Cent_V0AV0CDiffH2","VZERO-A VZERO-C diff;centrality (%);cos(2(#Psi^{V0A}-#Psi^{V0C}))",
+                          AliDielectronVarManager::kCentrality,AliDielectronVarManager::kv0CTPCDiffH2);
+    histos->UserHistogram("Event","Cent_v0Av0CDiffH2","VZERO-A VZERO-C diff;centrality (%);cos(2(#Psi^{V0A}-#Psi^{V0C}))",
                           10,0.,100.,300,-1.0,1.0,
-                          AliDielectronVarManager::kCentrality,AliDielectronVarManager::kV0AV0CDiffH2);
+                          AliDielectronVarManager::kCentrality,AliDielectronVarManager::kv0Av0CDiffH2);
     histos->UserHistogram("Event","Cent_TPCsub12DiffH2","TPC-sub1 TPC-sub2 diff;centrality (%);cos(2(#Psi^{sub1}-#Psi^{sub2}))",
                           10,0.,100.,300,-1.0,1.0,
                           AliDielectronVarManager::kCentrality,AliDielectronVarManager::kTPCsub12DiffH2);
     // detector effects
     histos->UserHistogram("Event","Cent_TPCsub12DiffH2Sin","TPC-sub1 TPC-sub2 diff;centrality (%);sin(2(#Psi^{sub1}-#Psi^{sub2}))",
-                          10,0.,100.,300,-1.0,1.0,AliDielectronVarManager::kCentrality,AliDielectronVarManager::kTPCsub12DiffH2Sin);
-
-    // EPSelectionTask V0 information directly from the ESDs
-    histos->UserHistogram("Event","Cent_v0ACrpH2","VZERO-AC RP;centrality (%);#Psi_{2}^{v0AC} (rad.)",
-                          10,0.,100.,100,-2.0,2.0,
-                          AliDielectronVarManager::kCentrality,AliDielectronVarManager::kv0ACrpH2);
-    histos->UserHistogram("Event","Cent_v0ArpH2","VZERO-A RP;centrality (%);#Psi_{2}^{v0A} (rad.)",
-                          10,0.,100.,100,-2.0,2.0,
-                          AliDielectronVarManager::kCentrality,AliDielectronVarManager::kv0ArpH2);
-    histos->UserHistogram("Event","Cent_v0CrpH2","VZERO-C RP;centrality (%);#Psi_{2}^{v0C} (rad.)",
-                          10,0.,100.,100,-2.0,2.0,
-                          AliDielectronVarManager::kCentrality,AliDielectronVarManager::kv0CrpH2);
-    // for resolution calculation
-    histos->UserHistogram("Event","Cent_v0ATPCDiffH2","VZERO-A TPC diff;centrality (%);cos(2(#Psi^{v0A}-#Psi^{TPC}))",
-                          10,0.,100.,300,-1.0,1.0,
-                          AliDielectronVarManager::kCentrality,AliDielectronVarManager::kv0ATPCDiffH2);
-    histos->UserHistogram("Event","Cent_v0CTPCDiffH2","VZERO-C TPC diff;centrality (%);cos(2(#Psi^{v0C}-#Psi^{TPC}))",
                           10,0.,100.,300,-1.0,1.0,
-                          AliDielectronVarManager::kCentrality,AliDielectronVarManager::kv0CTPCDiffH2);
-    histos->UserHistogram("Event","Cent_v0Av0CDiffH2","VZERO-A VZERO-C diff;centrality (%);cos(2(#Psi^{v0A}-#Psi^{v0C}))",
-                          10,0.,100.,300,-1.0,1.0,
-                          AliDielectronVarManager::kCentrality,AliDielectronVarManager::kv0Av0CDiffH2);
+                         AliDielectronVarManager::kCentrality,AliDielectronVarManager::kTPCsub12DiffH2Sin);
+  } //hist: flowQA
 
-  }
+  if(bHistPair) {
+    //Initialise histogram classes
+    histos->SetReservedWords("Track;Pair");
 
-  ////// MONTE CARLO //////
-  /*
-    if(cutDefinition == kTOFTRD && hasMC) {
-    histos->AddClass("MCEvent");
-    histos->UserHistogram("MCEvent","Cent_NJPsis","Centrality vs. generated incl. J/#psi per event;centrality (%);N_{J/#psi}",
-    10,0.,100., 21,-0.5,20.5,
-    AliDielectronVarManager::kCentrality,AliDielectronVarManager::kNumberOfJPsis);
+    //Pair classes
+    // to fill also mixed event histograms loop until 7 or 10
+    for (Int_t i=0; i<(bHistPairME ? 8 : 3); ++i){
+      histos->AddClass(Form("Pair_%s",AliDielectron::PairClassName(i)));
     }
-  */
-
-  //Initialise histogram classes
-  histos->SetReservedWords("Track;Pair");
-
-  //Pair classes
-  // to fill also mixed event histograms loop until 10
-  for (Int_t i=0; i<3; ++i){
-    histos->AddClass(Form("Pair_%s",AliDielectron::PairClassName(i)));
-  }
-
-  if(cutDefinition < kEtaGap01) {
-
-    //legs from pair
+    //legs from pair (fill SE)
     for (Int_t i=0; i<3; ++i){
       histos->AddClass(Form("Track_Legs_%s",AliDielectron::PairClassName(i)));
     }
-
     //Track classes
     //to fill also track info from 2nd event loop until 2
     for (Int_t i=0; i<2; ++i){
@@ -599,8 +595,6 @@ void InitHistograms(AliDielectron *die, Int_t cutDefinition)
     //   histos->AddClass(Form("Pair_%s",AliDielectron::PairClassName(AliDielectron::kEv1PMRot)));
     //   histos->AddClass(Form("Track_Legs_%s",AliDielectron::PairClassName(AliDielectron::kEv1PMRot)));
 
-    ///// add histograms to Track classes /////
-
     // Vertex
     histos->UserHistogram("Track","ImpactParXY",";dXY (cm);#tracks", 500,-1.,1.,
                           AliDielectronVarManager::kImpactParXY);
@@ -657,69 +651,40 @@ void InitHistograms(AliDielectron *die, Int_t cutDefinition)
     histos->UserHistogram("Pair","LegDistXY",";dca_{xy} (cm)",
                           50,0.,5., AliDielectronVarManager::kLegDistXY);
 
-  }
+    //// FLOW results use tprofiles
+    if(bHistFlow) {
+      histos->UserProfile("Pair","M_Cent_Pt_v0ACrpH2FlowV2",
+                         "cos(2(#varphi-#Psi^{V0AC}));mass (GeV/c^{2});centrality (%);p_{T} (GeV/c)",
+                         AliDielectronVarManager::kv0ACrpH2FlowV2,
+                         125,0.,125*.04, 10, 0.,100., 200,0.,100.,
+                         AliDielectronVarManager::kM, AliDielectronVarManager::kCentrality, AliDielectronVarManager::kPt);
+      histos->UserProfile("Pair","M_Cent_Pt_v0ArpH2FlowV2",
+                         "cos(2(#varphi-#Psi^{V0A}));mass (GeV/c^{2});centrality (%);p_{T} (GeV/c)",
+                         AliDielectronVarManager::kv0ArpH2FlowV2,
+                         125,0.,125*.04, 10, 0.,100., 200,0.,100.,
+                         AliDielectronVarManager::kM, AliDielectronVarManager::kCentrality, AliDielectronVarManager::kPt);
+      histos->UserProfile("Pair","M_Cent_Pt_v0CrpH2FlowV2",
+                         "cos(2(#varphi-#Psi^{V0C}));mass (GeV/c^{2});centrality (%);p_{T} (GeV/c)",
+                         AliDielectronVarManager::kv0CrpH2FlowV2,
+                         125,0.,125*.04, 10, 0.,100., 200,0.,100.,
+                         AliDielectronVarManager::kM, AliDielectronVarManager::kCentrality, AliDielectronVarManager::kPt);
+    } //hist: flow
+  } //hist: pair
 
-  //// FLOW results use tprofiles
-  if(cutDefinition == kTOFTRD || cutDefinition == kTOF || cutDefinition >= kEtaGap01) {
-
-    histos->UserProfile("Pair","M_Cent_Pt_V0ACrpH2FlowV2",
-                        "cos(2(#varphi-#Psi^{V0AC}));mass (GeV/c^{2});centrality (%);p_{T} (GeV/c)",
-                        AliDielectronVarManager::kV0ACrpH2FlowV2,
-                        125,0.,125*.04, 10, 0.,100., 200,0.,100.,
-                        AliDielectronVarManager::kM, AliDielectronVarManager::kCentrality, AliDielectronVarManager::kPt);
-
-    histos->UserProfile("Pair","M_Cent_Pt_V0ArpH2FlowV2",
-                        "cos(2(#varphi-#Psi^{V0A}));mass (GeV/c^{2});centrality (%);p_{T} (GeV/c)",
-                        AliDielectronVarManager::kV0ArpH2FlowV2,
-                        125,0.,125*.04, 10, 0.,100., 200,0.,100.,
-                        AliDielectronVarManager::kM, AliDielectronVarManager::kCentrality, AliDielectronVarManager::kPt);
-
-    histos->UserProfile("Pair","M_Cent_Pt_V0CrpH2FlowV2",
-                        "cos(2(#varphi-#Psi^{V0C}));mass (GeV/c^{2});centrality (%);p_{T} (GeV/c)",
-                        AliDielectronVarManager::kV0CrpH2FlowV2,
-                        125,0.,125*.04, 10, 0.,100., 200,0.,100.,
-                        AliDielectronVarManager::kM, AliDielectronVarManager::kCentrality, AliDielectronVarManager::kPt);
-
-    histos->UserProfile("Pair","M_Cent_Pt_v0ACrpH2FlowV2",
-                        "cos(2(#varphi-#Psi^{V0AC}));mass (GeV/c^{2});centrality (%);p_{T} (GeV/c)",
-                        AliDielectronVarManager::kv0ACrpH2FlowV2,
-                        125,0.,125*.04, 10, 0.,100., 200,0.,100.,
-                        AliDielectronVarManager::kM, AliDielectronVarManager::kCentrality, AliDielectronVarManager::kPt);
-
-    histos->UserProfile("Pair","M_Cent_Pt_v0ArpH2FlowV2",
-                        "cos(2(#varphi-#Psi^{V0A}));mass (GeV/c^{2});centrality (%);p_{T} (GeV/c)",
-                        AliDielectronVarManager::kv0ArpH2FlowV2,
-                        125,0.,125*.04, 10, 0.,100., 200,0.,100.,
-                        AliDielectronVarManager::kM, AliDielectronVarManager::kCentrality, AliDielectronVarManager::kPt);
-
-    histos->UserProfile("Pair","M_Cent_Pt_v0CrpH2FlowV2",
-                        "cos(2(#varphi-#Psi^{V0C}));mass (GeV/c^{2});centrality (%);p_{T} (GeV/c)",
-                        AliDielectronVarManager::kv0CrpH2FlowV2,
-                        125,0.,125*.04, 10, 0.,100., 200,0.,100.,
-                        AliDielectronVarManager::kM, AliDielectronVarManager::kCentrality, AliDielectronVarManager::kPt);
-
-    // 1D control histos
-    /*
-    histos->UserProfile("Pair","M_V0ACrpH2FlowV2",
-                        "cos(2(#varphi-#Psi^{V0AC}));mass (GeV/c^{2})",
-                        AliDielectronVarManager::kV0ACrpH2FlowV2,
-                        125,0.,125*.04,
-                        AliDielectronVarManager::kM);
-
-    histos->UserProfile("Pair","M_V0ArpH2FlowV2",
-                        "cos(2(#varphi-#Psi^{V0AC}));mass (GeV/c^{2})",
-                        AliDielectronVarManager::kV0ArpH2FlowV2,
-                        125,0.,125*.04,
-                        AliDielectronVarManager::kM);
-
-    histos->UserProfile("Pair","M_V0CrpH2FlowV2",
-                        "cos(2(#varphi-#Psi^{V0AC}));mass (GeV/c^{2})",
-                        AliDielectronVarManager::kV0CrpH2FlowV2,
-                        125,0.,125*.04,
-                        AliDielectronVarManager::kM);
-    */
-  }
 
+  ////// MONTE CARLO //////
+  /*
+    if(cutDefinition == kTOFTRD && hasMC) {
+    histos->AddClass("MCEvent");
+    histos->UserHistogram("MCEvent","Cent_NJPsis","Centrality vs. generated incl. J/#psi per event;centrality (%);N_{J/#psi}",
+    10,0.,100., 21,-0.5,20.5,
+    AliDielectronVarManager::kCentrality,AliDielectronVarManager::kNumberOfJPsis);
+    }
+  */
+
+  histos->UserHistogram("Track","TRDprobEle",";P_{ele}^{TRD};#tracks", 
+                       100,0.,1.,            AliDielectronVarManager::kTRDprobEle);
+  
   die->SetHistogramManager(histos);
 }