]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
ana.C: Get run number in local mode automatically, adjust some analysis settings
authorgconesab <gconesab@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 25 Nov 2011 11:05:24 +0000 (11:05 +0000)
committergconesab <gconesab@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 25 Nov 2011 11:05:24 +0000 (11:05 +0000)
AddTaskPartCorr.C: Adjust some analysis settings
AddTaskEMCALClusterize: Use reconstruction default time cuts when parameters set to 0
ConfigureEMCALRecoUtils: Adjust exotic cluster cut, add possibility to switch on/of the time, energy recalibration and bad channel rejection.

PWG4/CaloCalib/macros/AddTaskEMCALClusterize.C
PWG4/CaloCalib/macros/ConfigureEMCALRecoUtils.C
PWG4/macros/AddTaskPartCorr.C
PWG4/macros/ana.C

index 90d7c0904c81cf1eeb11fed939e839302402487d..38b4807483e3b9751a59b6c32812fddbdaed4bbc 100644 (file)
@@ -70,9 +70,18 @@ AliAnalysisTaskEMCALClusterize* AddTaskEMCALClusterize(
   }
   else{
     printf("AliAnalysisTaskEMCALClusterize - Set time cuts for ESDs\n");
-    params->SetTimeCut(maxDeltaT*1.e-9);
-    params->SetTimeMin(-1*timeWindow*1.e-9);
-    params->SetTimeMax(timeWindow*1.e-9);
+    if(maxDeltaT > 1) params->SetTimeCut(maxDeltaT*1.e-9);
+    else            { params->SetTimeCut(250*1.e-9); printf("default maxDeltaT = 250 ns\n"); }// Same as in reco
+    
+    if(timeWindow > 1){
+      params->SetTimeMin(-1*timeWindow*1.e-9);
+      params->SetTimeMax(timeWindow*1.e-9);
+    }
+    else{ // same as in reco
+      params->SetTimeMin(425*1.e-9);
+      params->SetTimeMax(825*1.e-9);
+      printf("default time window 425 ns < T < 825 ns\n");
+    }
   }
 
   params->SetClusteringThreshold(minEseed/1.e3);                                          
index f6af70e689f4cb153a0600a983d3639909b5089e..58166a03c95eddd0db2103bbe0301c6d80de7028 100644 (file)
@@ -5,7 +5,10 @@ void ConfigureEMCALRecoUtils(
                              TGeoHMatrix* matrix[10],
                              TString path  = "",
                              Int_t   run   = 0, 
-                             TString pass  = "pass2"
+                             TString pass  = "pass2",
+                             Bool_t bRecalE= kTRUE,
+                             Bool_t bBad   = kTRUE,
+                             Bool_t bRecalT= kFALSE
                              )
 {  
 
@@ -14,14 +17,18 @@ void ConfigureEMCALRecoUtils(
   printf("**** Configure AliEMCALRecoUtils, LOAD AODB ***\n");
   printf("\t run %d, pass %s\n",run,pass.Data());
   
+  
   // Exotic cells removal
+  
   reco->SwitchOnRejectExoticCell() ;
   reco->SetExoticCellDiffTimeCut(10000); // Open  
   reco->SetExoticCellFractionCut(0.95);  // 1-Ecross/Ecell > 0.95 -> out
-  reco->SetExoticCellMinAmplitudeCut(2); // 2 GeV  
+  reco->SetExoticCellMinAmplitudeCut(0.75); // 750 MeV    
   
   gSystem->Load("libOADB");
   
+  // Geometry settings, matrices
+  
   // Instantiate EMCAL geometry for the first time
   
   AliEMCALGeometry*   geom = 0; 
@@ -69,21 +76,19 @@ void ConfigureEMCALRecoUtils(
   reco->SetPositionAlgorithm(AliEMCALRecoUtils::kPosTowerGlobal);   
   
   
-  //----------------------------------------------
+  // *** Energy recalibration settings ***
   
-  Bool_t bRecal  = kTRUE;
-  Bool_t bBad    = kTRUE;
   if(pass == "pass3"){
-    bRecal = kFALSE;
+    bRecalE = kFALSE;
     bBad   = kFALSE;
   }
   
   if(bMC){
-    bRecal = kFALSE;
+    bRecalE = kFALSE;
   }
   
   //Recalibration factors
-  if(bRecal){
+  if(bRecalE){
     
     fileName="$ALICE_ROOT/OADB/EMCAL/EMCALRecalib.root";
     if(path!="") fileName=path+"EMCALRecalib.root";
@@ -125,7 +130,7 @@ void ConfigureEMCALRecoUtils(
     
   } else printf("AliEMCALRecoUtils ---Do NOT recalibrate\n");
 
-  // Remove EMCAL hot channels 
+  // *** Remove EMCAL hot channels *** 
   
   if(bBad){
     
@@ -177,37 +182,43 @@ void ConfigureEMCALRecoUtils(
     }
    */
  
+  // *** Time recalibration settings ***
   
-  reco->SwitchOnTimeRecalibration();
-  
-  //Waiting for OADB, meanwhile
+  if(bRecalT){
+    
+    reco->SwitchOnTimeRecalibration();
+    
+    //Waiting for OADB, meanwhile
+    
+    TFile * ftime = 0;
+    TString path ="./"; 
+    //TString path = "alien:///alice/cern.ch/user/g/germain/RecalDB/Time";
+    //TGrid::Connect("alien://");
+    
+    if     (run > 140000 && run < 146500 )
+      ftime = TFile::Open(Form("%s/RefLHC11apass1-7TeV.root",path.Data()));
+    else if(run > 146500 && run <= 146860 )
+      ftime = TFile::Open(Form("%s/RefLHC11apass3-2.76TeV.root",path.Data()));
+    else if(run > 146860 && run < 156477 )
+      ftime = TFile::Open(Form("%s/RefLHC11cpass1-7TeV.root",path.Data()));
+    else if(run >= 156477)
+      ftime = TFile::Open(Form("%s/RefLHC11dpass1-7TeV.root",path.Data()));
+    else if(run <  140000 && run > 136850)
+      ftime = TFile::Open(Form("%s/RefLHC10hpass2PbPb2.76TeV.root",path.Data()));
+    else if(run < 136850)
+      ftime = TFile::Open(Form("%s/RefLHC10dpass2-7TeV.root",path.Data()));
+    else printf("Run %d, not considered for time calibration\n",run);
+    
+    if(ftime){
+      printf("AliEMCALRecoUtils - Time recalibration ON\n");
+      
+      for(Int_t i =0; i< 4; i++)  reco->SetEMCALChannelTimeRecalibrationFactors( i, (TH1F*) ftime->Get(Form("hAllTimeAvBC%d",i)));     
+    }
+    else printf("AliEMCALRecoUtils --- Time recalibration OFF\n");
+    
+  }    else printf("AliEMCALRecoUtils --- Time recalibration OFF 2\n");
 
-  TFile * ftime = 0;
-  //TString path ="./"; 
-  TString path = "alien:///alice/cern.ch/user/g/germain/RecalDB/Time";
-  //TGrid::Connect("alien://");
-  
-  if     (run > 140000 && run < 146500 )
-    ftime = TFile::Open(Form("%s/RefLHC11apass1-7TeV.root",path.Data()));
-  else if(run > 146500 && run <= 146860 )
-    ftime = TFile::Open(Form("%s/RefLHC11apass3-2.76TeV.root",path.Data()));
-  else if(run > 146860 && run < 156477 )
-    ftime = TFile::Open(Form("%s/RefLHC11cpass1-7TeV.root",path.Data()));
-  else if(run >= 156477)
-    ftime = TFile::Open(Form("%s/RefLHC11dpass1-7TeV.root",path.Data()));
-  else if(run <  140000 && run > 136850)
-    ftime = TFile::Open(Form("%s/RefLHC10hpass2PbPb2.76TeV.root",path.Data()));
-  else if(run < 136850)
-    ftime = TFile::Open(Form("%s/RefLHC10dpass2-7TeV.root",path.Data()));
-  else printf("Run %d, not considered for time calibration\n",run);
-  
-  if(ftime){
-    printf("AliEMCALRecoUtils - Time recalibration ON\n");
-    
-    for(Int_t i =0; i< 4; i++)  reco->SetEMCALChannelTimeRecalibrationFactors( i, (TH1F*) ftime->Get(Form("hAllTimeAvBC%d",i)));       
-  }
-  else printf("AliEMCALRecoUtils --- Time recalibration OFF\n");
-  
+    
 }
 
 
index e683e6b138e8952e0d20d1302a1952e9deaca366..419bdec9286607e5ba972a5caecf5332ffbf515f 100644 (file)
@@ -78,8 +78,8 @@ AliAnalysisTaskParticleCorrelation *AddTaskPartCorr(
   maker->AddAnalysis(ConfigureQAAnalysis()    , n++);  
 
   // Isolation settings
-  Int_t partInCone = AliIsolationCut::kOnlyCharged;
-  Int_t thresType  = AliIsolationCut::kPtThresIC;
+  Int_t partInCone = AliIsolationCut::kNeutralAndCharged;//kOnlyCharged;
+  Int_t thresType  = AliIsolationCut::kSumPtFracIC;      // kPtThresIC;
   
   if(kClusterArray!=""){
     
@@ -223,8 +223,9 @@ AliCaloTrackReader * ConfigureReader()
   
   reader->SetEMCALClusterListName(kClusterArray);
   if(kClusterArray == "") {
-    printf("**************** Normal analysis **************** \n");
+    printf("**************** Standard EMCAL clusters branch analysis **************** \n");
     reader->SwitchOnClusterRecalculation();
+    // Check in ConfigureCaloUtils that the recalibration and bad map are ON 
   }
   else {
     printf("**************** Input for analysis is Clusterizer %s **************** \n", kClusterArray.Data());
@@ -311,6 +312,11 @@ AliCalorimeterUtils* ConfigureCaloUtils()
   //EMCAL only settings
   AliEMCALRecoUtils * recou = cu->GetEMCALRecoUtils();
   
+  Bool_t bCalib = kTRUE;
+  Bool_t bBadMap= kTRUE;
+  cu->SwitchOnRecalibration();      // Check the reader if it is taken into account during filtering
+  cu->SwitchOnBadChannelsRemoval(); // Check the reader if it is taken into account during filtering
+  
   TGeoHMatrix* matrix[10];
   gROOT->LoadMacro("ConfigureEMCALRecoUtils.C");
   ConfigureEMCALRecoUtils(
@@ -319,8 +325,13 @@ AliCalorimeterUtils* ConfigureCaloUtils()
                           matrix,
                           "",//AODB path, default
                           kRunNumber, 
-                          kPass
+                          kPass,
+                          bCalib, 
+                          bBadMap
                           );   
+  printf("ConfigureCaloUtils() - Recalibration ON? %d %d\n",recou->IsRecalibrationOn(), cu->IsRecalibrationOn());
+  printf("ConfigureCaloUtils() - BadMap        ON? %d %d\n",recou->IsBadChannelsRemovalSwitchedOn(), cu->IsBadChannelsRemovalSwitchedOn());
+  
   
   if(kCollisions=="pp"  ) { // Do only for pp for the moment
     cu->SwitchOnCorrectClusterLinearity();
@@ -360,8 +371,7 @@ AliAnaPhoton* ConfigurePhotonAnalysis()
     anaphoton->SetNCellCut(1);// At least 2 cells
     anaphoton->SetMinPt(0.5); // avoid mip peak at E = 260 MeV
     anaphoton->SetMaxPt(1000); 
-    if(!kUseKinematics) anaphoton->SetTimeCut(-1000,1000);// Time window of [400-900] ns if time recalibration is off, 
-    // restrict to less than 100 ns when time calibration is on 
+    anaphoton->SetTimeCut(-1000,1000); // open cut, usual time window of [425-825] ns if time recalibration is off 
     anaphoton->SetMinDistanceToBadChannel(1, 2, 3); // For filtered AODs, new releases.
   }
   
@@ -635,6 +645,8 @@ AliAnaCalorimeterQA* ConfigureQAAnalysis()
   //anaQA->SetDebug(10); //10 for lots of messages
   anaQA->SetCalorimeter(kCalorimeter);
   
+  anaQA->SetTimeCut(-1000,1000); // Open time cut
+  
   anaQA->SwitchOffFiducialCut();
   anaQA->SwitchOnCorrelation(); // make sure you switch in the reader PHOS and EMCAL cells and clusters if option is ON
   anaQA->SwitchOffFillAllTH3Histogram();
index c63f8bd60671b38982cc9fe82c4dc15b7630e7fd..99c901953aebeae951a418427cc31200b38849b6 100644 (file)
@@ -164,12 +164,13 @@ void ana(Int_t mode=mGRID)
     AddTaskCounter("EMC7"); // Trig Th > 4-5 GeV 
     AddTaskCounter("PHOS"); //  
   }
-  
-  gROOT->LoadMacro("AddTaskPartCorr.C"); // $ALICE_ROOT/PWG4/macros
-  
+    
   Bool_t kPrint   = kFALSE;
   Bool_t deltaAOD = kFALSE;
     
+  gROOT->LoadMacro("AddTaskPartCorr.C");        // $ALICE_ROOT/PWG4/macros
+  gROOT->LoadMacro("AddTaskEMCALClusterize.C"); // $ALICE_ROOT/PWG4/CaloCalib/macros
+  
   // ------
   // Tracks
   // ------  
@@ -182,12 +183,11 @@ void ana(Int_t mode=mGRID)
   // EMCAL
   // -----  
   
-  gROOT->LoadMacro("AddTaskEMCALClusterize.C"); // $ALICE_ROOT/PWG4/CaloCalib/macros
   Bool_t  bTrackMatch = kTRUE;
   Int_t   minEcell    = 50;  // 50  MeV (10 MeV used in reconstruction)
   Int_t   minEseed    = 100; // 100 MeV
-  Int_t   dTime       = 40;  // 40  ns difference in time of cells in cluster
-  Int_t   wTime       = 10000;  // open time window of cells in cluster, open
+  Int_t   dTime       = 0;   // default, 250 ns
+  Int_t   wTime       = 0;   // default 425 < T < 825 ns
   TString clTrigger   = "";  // Do not select, do Min Bias and triggered
   
   //Analysis with clusterizer V1
@@ -411,36 +411,58 @@ void CheckInputData(const anaModes mode){
       sprintf(fileG, "%s/%s%d/galice.root", kInDir,kPattern,event) ; 
       sprintf(fileEm, "%s/%s%d/embededAOD.root", kInDir,kPattern,event) ; 
       
-      TFile * fAOD = 0 ; 
+      TFile * fESD = TFile::Open(fileE) ; 
+      TFile * fAOD = TFile::Open(fileA) ; 
+      
       //Check if file exists and add it, if not skip it
-      if ( TFile::Open(fileE))  {
+      if (fESD)  {
         kTreeName ="esdTree";
         kInputData = "ESD";
-        if(TFile::Open(fileG)) kMC=kTRUE;
-        else kMC = kFALSE;
+        TFile * fG = TFile::Open(fileG);
+        if(fG) { kMC = kTRUE; fG->Close();}
+        else     kMC = kFALSE;
+        
+        // Get run number
+        TTree* esdTree = (TTree*)fESD->Get("esdTree");
+        AliESDEvent* esd = new AliESDEvent();
+        esd->ReadFromTree(esdTree);
+        esdTree->GetEvent(0);
+        kRun = esd->GetRunNumber();
+        
         return;
       }
-      else if(fAOD=TFile::Open(fileA)){
+      else if(fAOD){
         kTreeName ="aodTree";
         kInputData = "AOD";
         if(((TTree*) fAOD->Get("aodTree"))->GetBranch("mcparticles")) kMC=kTRUE;
         else kMC = kFALSE;
+        
+        // Get run number
+        TTree* aodTree = (TTree*)fAOD->Get("aodTree");
+        AliAODEvent* aod = new AliAODEvent();
+        aod->ReadFromTree(esdTree);
+        aodTree->GetEvent(0);
+        kRun = aod->GetRunNumber();
         return;
       }
-      else if(fAOD=TFile::Open(fileEm)){
-        kTreeName ="aodTree";
+      else if(TFile::Open(fileEm)){
+        kTreeName  = "aodTree";
         kInputData = "AOD";
-        kMC=kTRUE;
+        kMC        = kTRUE;
+        
         return;
       }
       else if(TFile::Open(fileG)){
-        kTreeName ="TE";
+        kTreeName  = "TE";
         kInputData = "MC";
-        kMC=kTRUE;
+        kMC        = kTRUE;
         return;
       }
     }
     
+    if(fESD) fESD->Close();
+    if(fAOD) fAOD->Close();
+    
   }// local files analysis
   
   //------------------------------
@@ -579,7 +601,7 @@ void CreateChain(const anaModes mode, TChain * chain, TChain * chainxs)
       else if(kInputData.Contains("AOD")) datafile = "AliAOD.root" ;//////////
       else if(kInputData == "MC")  datafile = "galice.root" ;
       
-      //Loop on ESD files, add them to chain
+      //Loop on ESD/AOD/MC files, add them to chain
       Int_t event =0;
       Int_t skipped=0 ; 
       char file[120] ;
@@ -588,10 +610,10 @@ void CreateChain(const anaModes mode, TChain * chain, TChain * chainxs)
       for (event = 0 ; event < kFile ; event++) {
         sprintf(file, "%s/%s%d/%s", kInDir,kPattern,event,datafile.Data()) ; 
         sprintf(filexs, "%s/%s%d/%s", kInDir,kPattern,event,kXSFileName) ; 
-        TFile * fESD = 0 ; 
+        TFile * fData = 0 ; 
         //Check if file exists and add it, if not skip it
-        if ( fESD = TFile::Open(file)) {
-          if ( fESD->Get(kTreeName) ) { 
+        if ( fData = TFile::Open(file)) {
+          if ( fData->Get(kTreeName) ) { 
             printf("++++ Adding %s\n", file) ;
             chain->AddFile(file);
             chainxs->Add(filexs) ;