]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG/EMCAL/macros/AddTaskEmcalPreparation.C
Merge branch 'master' into TRDdev
[u/mrichter/AliRoot.git] / PWG / EMCAL / macros / AddTaskEmcalPreparation.C
1 AliAnalysisTaskSE *AddTaskEmcalPreparation(const char *perstr  = "LHC11h",
2                                            const char *pass    = 0 /*should not be needed*/
3                                            ) {
4
5   AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
6   if (!mgr)
7   {
8     ::Error("AddTaskEmcalPreparation", "No analysis manager to connect to.");
9     return NULL;
10   }
11
12   TString period(perstr);
13   period.ToLower();
14
15   Bool_t isMC = kFALSE;
16   if(period.Sizeof()>7) isMC = kTRUE;
17   //  Bool_t isMC = (mgr->GetMCtruthEventHandler() != NULL); //only works for ESD
18   if(isMC) Printf("AddTaskEmcalPreparation: Running on MC");
19   else     Printf("AddTaskEmcalPreparation: Running on DATA");
20
21   //----------------------- Add tender -------------------------------------------------------
22   Bool_t distBC         = kFALSE; //switch for recalculation cluster position from bad channel 
23   Bool_t recalibClus    = kFALSE;
24   Bool_t recalcClusPos  = kFALSE;
25   Bool_t nonLinearCorr  = kFALSE;
26   Bool_t remExoticCell  = kFALSE;
27   Bool_t remExoticClus  = kFALSE;
28   Bool_t fidRegion      = kFALSE;
29   Bool_t calibEnergy    = kTRUE;
30   Bool_t calibTime      = kTRUE;
31   Bool_t remBC          = kTRUE;
32   UInt_t nonLinFunct    = 0;
33   Bool_t reclusterize   = kFALSE;
34   Float_t seedthresh    = 0.1;      // 100 MeV
35   Float_t cellthresh    = 0.05;     // 50 MeV 
36   UInt_t clusterizer    = 0;
37   Bool_t trackMatch     = kFALSE;
38   Bool_t updateCellOnly = kFALSE;
39   Float_t timeMin       = -50e-9;   // minimum time of physical signal in a cell/digit
40   Float_t timeMax       =  50e-9;   // maximum time of physical signal in a cell/digit
41   Float_t timeCut       = 1e6;
42   if(isMC) {
43     calibEnergy = kFALSE;
44     calibTime   = kFALSE;
45     timeMin = -1.;
46     timeMax = 1e6;
47   }
48   
49   gROOT->LoadMacro("$ALICE_ROOT/PWG/EMCAL/macros/AddTaskEMCALTender.C");//tendertasks
50   AliAnalysisTaskSE *tender = AddTaskEMCALTender(distBC, recalibClus, recalcClusPos, nonLinearCorr, remExoticCell, remExoticClus,
51                                                  fidRegion, calibEnergy, calibTime, remBC, nonLinFunct, reclusterize, seedthresh,
52                                                  cellthresh, clusterizer, trackMatch, updateCellOnly, timeMin, timeMax, timeCut,pass);
53
54   //----------------------- Add clusterizer -------------------------------------------------------
55   clusterizer    = AliEMCALRecParam::kClusterizerv2;
56   remExoticCell  = kTRUE;
57   gROOT->LoadMacro("$ALICE_ROOT/PWG/EMCAL/macros/AddTaskClusterizerFast.C");
58   AliAnalysisTaskEMCALClusterizeFast *clusterizerTask = AddTaskClusterizerFast("ClusterizerFast","","",clusterizer,cellthresh,seedthresh,
59                                                                                timeMin,timeMax,timeCut,remExoticCell,distBC,
60                                                                                AliAnalysisTaskEMCALClusterizeFast::kFEEData);
61
62   //----------------------- Add cluster maker -----------------------------------------------------
63   gROOT->LoadMacro("$ALICE_ROOT/PWG/EMCAL/macros/AddTaskEmcalClusterMaker.C"); //cluster maker: non-linearity, 
64   UInt_t nonLinFunct = AliEMCALRecoUtils::kBeamTestCorrected;
65   if(isMC) {
66     if(period == "lhc12a15a") 
67       nonLinFunct = AliEMCALRecoUtils::kPi0MCv2;
68     else
69       nonLinFunct = AliEMCALRecoUtils::kPi0MCv3;
70   }
71   remExoticClus  = kTRUE;
72   AliEmcalClusterMaker *clusMaker = AddTaskEmcalClusterMaker(nonLinFunct,remExoticClus,0,"EmcCaloClusters",0.,kTRUE);
73   
74   return clusterizerTask;
75 }