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