]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG/EMCAL/macros/AddTaskEMCALTenderUsingDatasetDef.C
Merge branch 'feature-movesplit'
[u/mrichter/AliRoot.git] / PWG / EMCAL / macros / AddTaskEMCALTenderUsingDatasetDef.C
1 // $Id$
2
3 AliAnalysisTaskSE *AddTaskEMCALTenderUsingDatasetDef(
4   const char *perstr  = "LHC11h",
5   const char *pass    = 0 /*should not be needed*/
6
7 {
8   AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
9   if (!mgr)
10   {
11     Error("AddTaskEMCALTenderUsingDatasetDef","No analysis manager found.");
12     return 0;
13   }
14
15   AliVEventHandler *evhand = mgr->GetInputEventHandler();
16   if (!evhand) {
17     Error("AddTaskEMCALTenderUsingDatasetDef", "This task requires an input event handler");
18     return NULL;
19   }
20
21   gROOT->LoadMacro("$ALICE_ROOT/PWG/EMCAL/macros/AddTaskEMCALTender.C");
22
23   Bool_t distBC         = kTRUE;   //distance to bad channel
24   Bool_t recalibClus    = kTRUE;   //recalibrate cluster energy
25   Bool_t recalcClusPos  = kTRUE;   //recalculate cluster position
26   Bool_t nonLinearCorr  = kTRUE;   //apply non-linearity
27   Bool_t remExoticCell  = kTRUE;   //remove exotic cells
28   Bool_t remExoticClus  = kTRUE;   //remove exotic clusters
29   Bool_t fidRegion      = kFALSE;  //apply fiducial cuts
30   Bool_t calibEnergy    = kTRUE;   //calibrate energy
31   Bool_t calibTime      = kTRUE;   //calibrate timing
32   Bool_t remBC          = kTRUE;   //remove bad channels
33   UInt_t nonLinFunct    = AliEMCALRecoUtils::kBeamTestCorrected;
34   Bool_t reclusterize   = kFALSE;  //reclusterize
35   Float_t seedthresh    = 0.100;   //seed threshold
36   Float_t cellthresh    = 0.050;   //cell threshold
37   UInt_t clusterizer    = AliEMCALRecParam::kClusterizerv2;
38   Bool_t trackMatch     = kTRUE;   //track matching
39   Bool_t updateCellOnly = kFALSE;  //only change if you run your own clusterizer task
40   Float_t timeMin       = -50e6;   //minimum time of physical signal in a cell/digit (s)
41   Float_t timeMax       =  50e6;   //maximum time of physical signal in a cell/digit (s)
42   Float_t timeCut       =   1e6;   //maximum time difference between the digits inside EMC cluster (s)
43
44   Bool_t isMC = kFALSE;
45
46   TString period(perstr);
47   period.ToLower();
48   Printf("Configuring tender for run period: %s",period.Data());
49
50   if (period == "lhc11h") {
51     trackMatch = kFALSE;
52     timeMin = -50e-9;
53     timeMax =  50e-9;
54     timeCut =  1e6;
55   }
56   else if (period == "lhc12a15e" || period == "lhc12a15e_fix" || 
57            period == "lhc12a17a_fix" || period == "lhc12a17b_fix" || period == "lhc12a17c_fix" || period == "lhc12a17d_fix" || 
58            period == "lhc12a17e_fix" || period == "lhc12a17f_fix" || period == "lhc12a17g_fix" || period == "lhc12a17h_fix" || 
59            period == "lhc12a17i_fix") {
60     nonLinFunct = AliEMCALRecoUtils::kPi0MCv3;
61     isMC = kTRUE;
62   }
63   else if (period == "lhc12a15a") {
64     nonLinFunct = AliEMCALRecoUtils::kPi0MCv2;
65     isMC = kTRUE;
66   }
67   else if(period == "lhc12a" || period == "lhc12b" || period == "lhc12c" || period == "lhc12d" || period == "lhc12e" || period == "lhc12f" || period == "lhc12g" || period == "lhc12h" || period == "lhc12i") {
68     reclusterize = kTRUE;
69     seedthresh = 0.3;
70     cellthresh = 0.05;
71     timeMin = -50e-9;
72     timeMax =  50e-9;
73     timeCut =  1e6;
74   }
75   else if(period == "lhc13b" || period == "lhc13c" || period == "lhc13d" || period == "lhc13e" || period == "lhc13f" || period == "lhc13g" || 
76           period == "lhc13b4" || period == "lhc13b4_fix" || period == "lhc13b4_plus") {
77     reclusterize = kTRUE;
78     seedthresh = 0.3;
79     cellthresh = 0.05;
80     if(period == "lhc13b" || period == "lhc13c" || period == "lhc13d" || period == "lhc13e" || period == "lhc13f" || period == "lhc13g") {
81       timeMin = -50e-9;
82       timeMax =  50e-9;
83       timeCut =  1e6;
84     }
85     else if(period == "lhc13b4" || period == "lhc13b4_fix" || period == "lhc13b4_plus") {
86       nonLinFunct = AliEMCALRecoUtils::kPi0MCv3;
87       isMC = kTRUE;
88     }
89   }
90
91   if(isMC) { //no timing cuts when running on MC
92     calibEnergy = kFALSE;
93     calibTime   = kFALSE;
94     timeMin = -1;
95     timeMax =  1e6;
96     timeCut =  1e6;
97   }
98
99   if (!evhand->InheritsFrom("AliESDInputHandler"))
100     trackMatch = kFALSE;
101
102   AliAnalysisTaskSE *task = AddTaskEMCALTender(
103     distBC, recalibClus, recalcClusPos, nonLinearCorr,
104     remExoticCell, remExoticClus, fidRegion, calibEnergy, 
105     calibTime, remBC, nonLinFunct, reclusterize, seedthresh, 
106     cellthresh, clusterizer, trackMatch, updateCellOnly,
107     timeMin, timeMax, timeCut, pass);
108
109   return task;
110 }