-update
authorjbook <jbook@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 11 Jun 2012 15:09:13 +0000 (15:09 +0000)
committerjbook <jbook@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 11 Jun 2012 15:09:13 +0000 (15:09 +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 e769f64..665a620 100644 (file)
@@ -1,4 +1,4 @@
-AliAnalysisTask *AddTask_jbook_JPsi(Bool_t isMC=kFALSE){
+AliAnalysisTask *AddTask_jbook_JPsi(TString prod=""){
   //get the current analysis manager
   AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
   if (!mgr) {
@@ -7,8 +7,13 @@ AliAnalysisTask *AddTask_jbook_JPsi(Bool_t isMC=kFALSE){
   }
   
   //Do we have an MC handler?
-  Bool_t hasMC=isMC;
-    //(AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler()!=0x0);
+  Bool_t hasMC = kFALSE;
+  TString list = gSystem->Getenv("LIST");
+  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);
   
@@ -37,7 +42,7 @@ AliAnalysisTask *AddTask_jbook_JPsi(Bool_t isMC=kFALSE){
 
   //add dielectron analysis with different cuts to the task
   for (Int_t i=0; i<5; ++i){ //nDie defined in config file
-    AliDielectron *jpsi=ConfigJpsi_jb_PbPb(i,hasMC);
+    AliDielectron *jpsi=ConfigJpsi_jb_PbPb(i,list);
     if (jpsi ) task->AddDielectron(jpsi);
     if (jpsi ) printf("add: %s\n",jpsi->GetName());
   }
index 896c93e..05b861e 100644 (file)
@@ -1,4 +1,4 @@
-AliAnalysisTask *AddTask_jbook_JPsiQA(Bool_t isMC=kFALSE){
+AliAnalysisTask *AddTask_jbook_JPsiQA(TString prod=""){
   //get the current analysis manager
   AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
   if (!mgr) {
@@ -7,8 +7,13 @@ AliAnalysisTask *AddTask_jbook_JPsiQA(Bool_t isMC=kFALSE){
   }
 
   //Do we have an MC handler?
-  Bool_t hasMC=isMC;
+  Bool_t hasMC = kFALSE;
+  TString list = gSystem->Getenv("LIST");
+  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);
 
@@ -37,7 +42,7 @@ AliAnalysisTask *AddTask_jbook_JPsiQA(Bool_t isMC=kFALSE){
 
   //add dielectron analysis with different cuts to the task
   for (Int_t i=0; i<nDie; ++i){ //nDie defined in config file
-    AliDielectron *jpsi=ConfigJpsiQA_jb_PbPb(i,hasMC);
+    AliDielectron *jpsi=ConfigJpsiQA_jb_PbPb(i,list);
     if (jpsi ) task->AddDielectron(jpsi);
     if (jpsi ) printf("add: %s\n",jpsi->GetName());
   }
@@ -65,13 +70,13 @@ AliAnalysisTask *AddTask_jbook_JPsiQA(Bool_t isMC=kFALSE){
                          AliAnalysisManager::kOutputContainer,
                          "jbookQA.root");
 
-  /*
-    AliAnalysisDataContainer *cOutputHist2 =
+  
+  AliAnalysisDataContainer *cOutputHist2 =
     mgr->CreateContainer("jbookQA_CF",
                          TList::Class(),
                          AliAnalysisManager::kOutputContainer,
-                         "jbookQA.root");
-  */
+                         "dummy");
+    
   AliAnalysisDataContainer *cOutputHist3 =
     mgr->CreateContainer("jbookQA_EventStat",
                          TH1D::Class(),
@@ -81,7 +86,7 @@ AliAnalysisTask *AddTask_jbook_JPsiQA(Bool_t isMC=kFALSE){
   mgr->ConnectInput(task,  0, mgr->GetCommonInputContainer());
   mgr->ConnectOutput(task, 0, coutput1 );
   mgr->ConnectOutput(task, 1, cOutputHist1);
-  //  mgr->ConnectOutput(task, 2, cOutputHist2);
+  mgr->ConnectOutput(task, 2, cOutputHist2);
   mgr->ConnectOutput(task, 3, cOutputHist3);
   
   return task;
index 48f8df1..2209a29 100644 (file)
@@ -1,4 +1,4 @@
-AliAnalysisTask *AddTask_jbook_v2(Bool_t isMC=kFALSE){
+AliAnalysisTask *AddTask_jbook_v2(TString prod=""){
   //get the current analysis manager
   AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
   if (!mgr) {
@@ -7,8 +7,13 @@ AliAnalysisTask *AddTask_jbook_v2(Bool_t isMC=kFALSE){
   }
 
   //Do we have an MC handler?
-  Bool_t hasMC=isMC;
-    //(AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler()!=0x0);
+  Bool_t hasMC = kFALSE;
+  TString list = gSystem->Getenv("LIST");
+  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);
 
@@ -37,7 +42,7 @@ AliAnalysisTask *AddTask_jbook_v2(Bool_t isMC=kFALSE){
 
   //add dielectron analysis with different cuts to the task
   for (Int_t i=16; i<nDie; ++i){ //nDie defined in config file
-    AliDielectron *jpsi=ConfigJpsi_jb_PbPb(i,hasMC);
+    AliDielectron *jpsi=ConfigJpsi_jb_PbPb(i,list);
     if (jpsi ) task->AddDielectron(jpsi);
     if (jpsi ) printf("add: %s\n",jpsi->GetName());
   }
index 88186e5..6bda77c 100644 (file)
@@ -13,17 +13,24 @@ TObjArray *arrNames=names.Tokenize(";");
 
 const Int_t nDie=arrNames->GetEntries();
 
-Bool_t hasMC=kFALSE;
+Bool_t  hasMC = kFALSE;
+TString list  = gSystem->Getenv("LIST");
 
-AliDielectron* ConfigJpsiQA_jb_PbPb(Int_t cutDefinition, Bool_t isMC=kFALSE)
+AliDielectron* ConfigJpsiQA_jb_PbPb(Int_t cutDefinition, TString prod="")
 {
   //
   // Setup the instance of AliDielectron
   //
   
+  // find mc or not?
+  if( list.IsNull()) list=prod;
+  if( list.Contains("LHC10h")   || list.Contains("LHC11h")   ) hasMC=kFALSE;
+  if( list.Contains("LHC11a10") || list.Contains("LHC12a17") ) hasMC=kTRUE;
+  
+
   // MC event handler?
-  hasMC=isMC;
-  //hasMC=(AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler()!=0x0);    
+  //  hasMC=isMC;
+  //(AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler()!=0x0);    
 
   //ESD handler?
   Bool_t isESD=(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()->IsA()==AliESDInputHandler::Class());
@@ -295,11 +302,11 @@ void InitHistograms(AliDielectron *die, Int_t cutDefinition)
                           AliDielectronVarManager::kRunNumber );                      
 
     // PID QA
-    histos->UserHistogram("Track","TPCnSigmaPio_Nacc_RunNumber",";N_{acc};n#sigma_{pio}^{TPC};run",
-                          BinsToVector(60,0.,3000.), BinsToVector(40,-5.,5.), GetRunNumbers(),
+    histos->UserHistogram("Track","TPCnSigmaPio_Nacc_RunNumber",";N_{acc};run;n#sigma_{pio}^{TPC}",
+                          BinsToVector(60,0.,3000.), GetRunNumbers(), BinsToVector(40,-5.,5.),
                           AliDielectronVarManager::kNacc,
-                          AliDielectronVarManager::kTPCnSigmaPio,
-                          AliDielectronVarManager::kRunNumber);
+                          AliDielectronVarManager::kRunNumber,
+                          AliDielectronVarManager::kTPCnSigmaPio);
     histos->UserHistogram("Track","TPCnSigmaPio_Nacc",";N_{acc};n#sigma_{pio}^{TPC}",
                           BinsToVector(60,0.,3000.), BinsToVector(40,-5.,5.),
                           AliDielectronVarManager::kNacc,
@@ -527,9 +534,9 @@ TVectorD *GetRunNumbers() {
   };
   
   // selection via environement variable (works only for gsi trains)
-  TString list=gSystem->Getenv("LIST");
+
   
-  if(list.Contains("10h") || list.Contains("11a10b")) {
+  if(list.Contains("LHC10h") || list.Contains("LHC11a10")) {
     Int_t size = (int) (sizeof(runLHC10h)/sizeof(Double_t));
     TVectorD *vec = new TVectorD(size+1);
     
@@ -537,11 +544,11 @@ TVectorD *GetRunNumbers() {
     for (int i = 0; i < size; i++) {
       (*vec)[i] = runLHC10h[size-1-i];
     }
-//    vec->Print("");
+    //    vec->Print("");
     return vec;
   }
-  
-  if( list.IsNull() || list.Contains("11h") || list.Contains("12a17") ) {
+
+  if( list.Contains("LHC11h") || list.Contains("LHC12a17") ) {
     
     Int_t size = (int) (sizeof(runLHC11h)/sizeof(Double_t));
     TVectorD *vec = new TVectorD(size+1);
@@ -550,7 +557,7 @@ TVectorD *GetRunNumbers() {
     for (int i = 0; i < size; i++) {
       (*vec)[i] = runLHC11h[size-1-i];
     }
-//    vec->Print("");
+    //   vec->Print("");
     return vec;
   }
   
index 1b67500..2414f7f 100644 (file)
@@ -14,17 +14,24 @@ enum { kTPC=0, kTOF, kTRD, krec, kTOFTRD, kTOFTRD2, kITScls, kITSamy, kDCA, kChi
 TObjArray *arrNames=names.Tokenize(";");
 const Int_t nDie=arrNames->GetEntries();
 
-Bool_t hasMC=kFALSE;
+Bool_t  hasMC = kFALSE;
+TString list  = gSystem->Getenv("LIST");
 
-AliDielectron* ConfigJpsi_jb_PbPb(Int_t cutDefinition, Bool_t isMC=kFALSE)
+AliDielectron* ConfigJpsi_jb_PbPb(Int_t cutDefinition, TString prod="")
 {
   //
   // Setup the instance of AliDielectron
   //
   
+  // find mc or not?
+  if( list.IsNull()) list=prod;
+  if( list.Contains("LHC10h")   || list.Contains("LHC11h")   ) hasMC=kFALSE;
+  if( list.Contains("LHC11a10") || list.Contains("LHC12a17") ) hasMC=kTRUE;
+  
+
   // MC event handler?
-  hasMC=isMC;
-    //(AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler()!=0x0);    
+  //  hasMC=isMC;
+  //(AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler()!=0x0);    
 
   //ESD handler?
   Bool_t isESD=(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()->IsA()==AliESDInputHandler::Class());
@@ -285,10 +292,8 @@ void SetupTrackCuts(AliDielectron *die, Int_t cutDefinition)
       
       TF1 *ffPio=new TF1(Form("fBethe%d_c%d",AliPID::kPion,icent), Form("(%f*%f+(AliExternalTrackParam::BetheBlochAleph(x/%f,[0],[1],[2],[3],[4])-AliExternalTrackParam::BetheBlochAleph(x/%f,[0],[1],[2],[3],[4])))/%f", nSigmaPi,resolution, AliPID::ParticleMass(AliPID::kPion), AliPID::ParticleMass(AliPID::kElectron), resolution), 0.05,200.);
       
-      TString list=gSystem->Getenv("LIST");
-      
       //LHC11a10b
-      if (list.Contains("LHC11a10b") || list.IsNull()) {
+      if (list.Contains("LHC11a10b")) {
         printf("LHC11a10b parameters\n");
         ffPro->SetParameters(BBpro[0],BBpro[1],BBpro[2],BBpro[3],BBpro[4]);
         ffPio->SetParameters(BBpio[0],BBpio[1],BBpio[2],BBpio[3],BBpio[4]);
@@ -305,7 +310,7 @@ void SetupTrackCuts(AliDielectron *die, Int_t cutDefinition)
     // shifts for the nSigma electrons
     TGraph* nSigmaCorrection = new TGraph();
     // LHC11a10b
-    if (list.Contains("LHC11a10b") || list.IsNull()) {
+    if (list.Contains("LHC11a10b")) {
       nSigmaCorrection->SetPoint(0, 137161., -0.50-(0.28));
       nSigmaCorrection->SetPoint(1, 139510., -0.50-(0.28));
       pid->SetCorrGraph(nSigmaCorrection);
@@ -745,7 +750,8 @@ void InitCF(AliDielectron* die, Int_t cutDefinition)
       cf->AddVariable(AliDielectronVarManager::kTPCnSigmaEle,"-3,-2.5,-2,2,2.5,3",kTRUE);
       //cf->AddVariable(AliDielectronVarManager::kTPCnSigmaPio,"3.5,4.0,4.5,5.0,100",kTRUE);
       //    cf->AddVariable(AliDielectronVarManager::kTPCnSigmaPro,"3.5,4.0,4.5,5.0,100",kTRUE);
-      
+      cf->AddVariable(AliDielectronVarManager::kTRDpidQuality,"3.5, 4.5, 5.5, 6.5",kTRUE);
+       
       // standard vars
       if(cutDefinition<=kChi) {
         if(hasMC) cf->AddVariable(AliDielectronVarManager::kEta,"-0.9,0.9",kTRUE);
@@ -761,7 +767,7 @@ void InitCF(AliDielectron* die, Int_t cutDefinition)
       case kTOFTRD: 
         // if(hasMC) cf->AddVariable(AliDielectronVarManager::kThetaCS,15,-1.,1.);
         //cf->AddVariable(AliDielectronVarManager::kITSLayerFirstCls,7,-1.5,5.5,kTRUE); break;
-        break;
+       break;
       case kITScls: cf->AddVariable(AliDielectronVarManager::kNclsITS,"1,2,3,4,5,6",kTRUE);       break;
       case kITSamy: cf->AddVariable(AliDielectronVarManager::kITSLayerFirstCls,7,-1.5,5.5,kTRUE); break;
       case kDCA:
@@ -772,7 +778,6 @@ void InitCF(AliDielectron* die, Int_t cutDefinition)
       case kChi:    cf->AddVariable(AliDielectronVarManager::kChi2NDF,"0,1,2,3,4,5",kTRUE); break;
         //    cf->AddVariable(AliDielectronVarManager::kTOFnSigmaEle,"-3,-2,2,3",kTRUE);
         //    cf->AddVariable(AliDielectronVarManager::kTOFPIDBit,"-.5,.5,1.5",kTRUE);
-        //    cf->AddVariable(AliDielectronVarManager::kTRDpidQuality,"3.5, 4.5, 5.5, 6.5",kTRUE);
     }
     
   }
@@ -849,8 +854,6 @@ void SetEtaCorrection()
 {
   if (AliDielectronPID::GetEtaCorrFunction()) return;
   
-  TString list=gSystem->Getenv("LIST");
-
   TString etaMap="$TRAIN_ROOT/jpsi_JPSI/EtaCorrMaps.root";
   TString trainRoot=gSystem->Getenv("TRAIN_ROOT");
   if (trainRoot.IsNull()) etaMap="$ALICE_ROOT/PWGDQ/dielectron/files/EtaCorrMaps.root";
@@ -884,9 +887,9 @@ TVectorD *GetRunNumbers() {
   };
   
   // selection via environement variable (works only for gsi trains)
-  TString list=gSystem->Getenv("LIST");
+
   
-  if(list.Contains("10h") || list.Contains("11a10b")) {
+  if(list.Contains("LHC10h") || list.Contains("LHC11a10")) {
     Int_t size = (int) (sizeof(runLHC10h)/sizeof(Double_t));
     TVectorD *vec = new TVectorD(size+1);
     
@@ -898,7 +901,7 @@ TVectorD *GetRunNumbers() {
     return vec;
   }
 
-  if( list.IsNull() || list.Contains("11h") || list.Contains("12a17") ) {
+  if( list.Contains("LHC11h") || list.Contains("LHC12a17") ) {
     
     Int_t size = (int) (sizeof(runLHC11h)/sizeof(Double_t));
     TVectorD *vec = new TVectorD(size+1);