]>
Commit | Line | Data |
---|---|---|
c4c7c022 | 1 | // $Id$ |
2 | ||
a4e91fed | 3 | AliAnalysisTaskSE *AddTaskEMCALTender( |
a737aafa | 4 | Bool_t distBC = kTRUE, //distance to bad channel |
5 | Bool_t recalibClus = kTRUE, //recalibrate cluster energy | |
6 | Bool_t recalcClusPos = kTRUE, //recalculate cluster position | |
7 | Bool_t nonLinearCorr = kTRUE, //apply non-linearity | |
5aff1923 | 8 | Bool_t remExoticCell = kTRUE, //remove exotic cells |
9 | Bool_t remExoticClus = kTRUE, //remove exotic clusters | |
a737aafa | 10 | Bool_t fidRegion = kFALSE, //apply fiducial cuts |
11 | Bool_t calibEnergy = kTRUE, //calibrate energy | |
12 | Bool_t calibTime = kTRUE, //calibrate timing | |
13 | Bool_t remBC = kTRUE, //remove bad channels | |
fc30c012 | 14 | UInt_t nonLinFunct = AliEMCALRecoUtils::kBeamTestCorrected, |
a737aafa | 15 | Bool_t reclusterize = kTRUE, //reclusterize |
5a5f51e2 | 16 | Float_t seedthresh = 0.100, //seed threshold |
17 | Float_t cellthresh = 0.050, //cell threshold | |
a737aafa | 18 | UInt_t clusterizer = AliEMCALRecParam::kClusterizerv2, |
5a5f51e2 | 19 | Bool_t trackMatch = kTRUE, //track matching |
a737aafa | 20 | Bool_t updateCellOnly = kFALSE, //only change if you run your own clusterizer task |
21 | Float_t timeMin = 100e-9, //minimum time of physical signal in a cell/digit (s) | |
22 | Float_t timeMax = 900e-9, //maximum time of physical signal in a cell/digit (s) | |
5a5f51e2 | 23 | Float_t timeCut = 900e-9, //maximum time difference between the digits inside EMC cluster (s) |
d71d25d6 | 24 | const char *pass = 0, //string defining pass (use none if figured out from path) |
25 | Bool_t remapMcAod = kFALSE //switch on the remaping for the MC labels in AOD productions | |
a737aafa | 26 | ) |
a56c1f4e | 27 | { |
fd650c0d | 28 | // Get the pointer to the existing analysis manager via the static access method. |
29 | //============================================================================== | |
30 | AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); | |
31 | if (!mgr) { | |
32bf39af | 32 | ::Error("AddTaskEMCALTender", "No analysis manager to connect to."); |
fd650c0d | 33 | return NULL; |
a56c1f4e | 34 | } |
35 | ||
36 | AliVEventHandler *evhand = mgr->GetInputEventHandler(); | |
37 | ||
fd650c0d | 38 | // Create the task and configure it. |
39 | //=========================================================================== | |
fd650c0d | 40 | |
a56c1f4e | 41 | AliAnalysisTaskSE *ana = 0; |
ef8220aa | 42 | AliAnalysisDataContainer *coutput1 = 0; |
fd650c0d | 43 | |
59f16b27 | 44 | |
2f06de14 | 45 | gROOT->LoadMacro("$ALICE_ROOT/PWG/EMCAL/macros/ConfigEmcalTenderSupply.C"); |
a56c1f4e | 46 | |
5aff1923 | 47 | AliEMCALTenderSupply *EMCALSupply = ConfigEmcalTenderSupply(distBC, recalibClus, recalcClusPos, nonLinearCorr, remExoticCell, remExoticClus, |
95c1b11b | 48 | fidRegion, calibEnergy, calibTime, remBC, nonLinFunct, reclusterize, seedthresh, |
fc30c012 | 49 | cellthresh, clusterizer, trackMatch, updateCellOnly, timeMin, timeMax, timeCut); |
a737aafa | 50 | |
5582e90e | 51 | if (pass) |
52 | EMCALSupply->SetPass(pass); | |
a56c1f4e | 53 | |
a4e91fed | 54 | if (evhand->InheritsFrom("AliESDInputHandler")) { |
a737aafa | 55 | AliTender* alitender = mgr->GetTopTasks()->FindObject("AliTender"); |
d71d25d6 | 56 | |
a737aafa | 57 | if (!alitender) |
58 | alitender = new AliTender("AliTender"); | |
d71d25d6 | 59 | |
a56c1f4e | 60 | alitender->AddSupply(EMCALSupply); |
e6e03c89 | 61 | alitender->SetDefaultCDBStorage("raw://"); |
d71d25d6 | 62 | |
a56c1f4e | 63 | ana = alitender; |
d71d25d6 | 64 | |
ef8220aa | 65 | coutput1 = mgr->CreateContainer("emcal_tender_event", |
66 | AliESDEvent::Class(), | |
67 | AliAnalysisManager::kExchangeContainer, | |
68 | "default_tender"); | |
5a5f51e2 | 69 | } else if (evhand->InheritsFrom("AliAODInputHandler")) { |
a737aafa | 70 | AliEmcalTenderTask* emcaltender = mgr->GetTopTasks()->FindObject("AliEmcalTenderTask"); |
d71d25d6 | 71 | |
a737aafa | 72 | if (!emcaltender) |
d71d25d6 | 73 | emcaltender = new AliEmcalTenderTask("AliEmcalTenderTask"); |
74 | ||
75 | if (remapMcAod) | |
76 | EMCALSupply->SwitchOnRemapMCLabelForAODs(); | |
77 | ||
a56c1f4e | 78 | emcaltender->SetEMCALTenderSupply(EMCALSupply); |
d71d25d6 | 79 | |
a56c1f4e | 80 | ana = emcaltender; |
d71d25d6 | 81 | |
82 | coutput1 = mgr->CreateContainer("emcal_tender_event", | |
ef8220aa | 83 | AliAODEvent::Class(), |
84 | AliAnalysisManager::kExchangeContainer, | |
85 | "default_tender"); | |
5a5f51e2 | 86 | } else { |
a56c1f4e | 87 | ::Error("AddTaskEMCALTender", "Input event handler not recognized, AOD/ESD expected. Returning..."); |
88 | return NULL; | |
89 | } | |
90 | ||
91 | mgr->AddTask(ana); | |
a55e4f1d | 92 | |
fd650c0d | 93 | // Create ONLY the output containers for the data produced by the task. |
94 | // Get and connect other common input/output containers via the manager as below | |
95 | //============================================================================== | |
d0ed1257 | 96 | |
ef8220aa | 97 | mgr->ConnectInput(ana, 0, mgr->GetCommonInputContainer()); |
98 | mgr->ConnectOutput(ana, 1, coutput1 ); | |
a737aafa | 99 | |
100 | ::Info("AddTaskEMCALTender", "Tender configured"); | |
fd650c0d | 101 | |
102 | return ana; | |
103 | } |