-
Notifications
You must be signed in to change notification settings - Fork 785
/
AddTaskTender.C
123 lines (105 loc) · 4.36 KB
/
AddTaskTender.C
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
AliTender *AddTaskTender(Bool_t useV0=kFALSE,
Bool_t useTPC=kTRUE,
Bool_t useTOF=kTRUE,
Bool_t useTRD=kTRUE,
Bool_t usePID=kTRUE,
Bool_t useVTX=kTRUE,
Bool_t useT0=kTRUE,
Bool_t useEmc=kFALSE,
Bool_t usePtFix=kFALSE)
{
if (!(useV0 | useTPC | useTOF | useTRD | usePID | useVTX | useT0 | useEmc | usePtFix)) {
::Error("AddTaskTender", "No supply added to tender, so tender not created");
return 0;
}
//get the current analysis manager
Bool_t checkEvtSelection = useV0;
AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
if (!mgr) {
::Error("AddTaskTender", "No analysis manager found.");
return 0;
}
// currently don't accept AOD input
if (!mgr->GetInputEventHandler()->InheritsFrom(AliESDInputHandler::Class())) {
::Error("AddTask_tender_Tender","The analysis tender only works with ESD input!");
return 0;
}
//========= Add tender to the ANALYSIS manager and set default storage =====
AliTender *tender=new AliTender("AnalysisTender");
tender->SetCheckEventSelection(checkEvtSelection);
tender->SetDefaultCDBStorage("raw://");
mgr->AddTask(tender);
//check that that tender is the first task after the pid response
TString firstName(mgr->GetTasks()->First()->GetName());
Bool_t isSecond=(mgr->GetTasks()->At(1) == (TObject*)tender);
if (! (firstName=="PIDResponseTask" && isSecond )){
Fatal("AddTaskTender","When using the tender the first task needs to be the PIDResponse and the tender the second task!!!");
return NULL;
}
//========= Attach VZERO supply ======
if (useV0) {
AliVZEROTenderSupply *vzeroSupply=new AliVZEROTenderSupply("VZEROtender");
vzeroSupply->SetDebug(kFALSE);
tender->AddSupply(vzeroSupply);
}
//========= Attach TPC supply ======
if (useTPC) {
AliTPCTenderSupply *tpcSupply=new AliTPCTenderSupply("TPCtender");
tpcSupply->SetDebugLevel(2);
//tpcSupply->SetMip(50.);
tender->AddSupply(tpcSupply);
}
//========= Attach track 1/pt correction supply ======
if (usePtFix) {
AliTrackFixTenderSupply *trfixSupply=new AliTrackFixTenderSupply("PTInvFix");
//trfixSupply->SetDebugLevel(2);
tender->AddSupply(trfixSupply);
}
//========= Attach T0 supply ======
if (useT0) {
AliT0TenderSupply *t0Tender = new AliT0TenderSupply("T0tender");
t0Tender ->SetPass4LHC11aCorrection(kTRUE);
tender->AddSupply(t0Tender);
}
//========= Attach TOF supply ======
if (useTOF) {
AliTOFTenderSupply *tofTender = new AliTOFTenderSupply("TOFtender");
tender->AddSupply(tofTender);
}
//========= Attach TRD supply ======
if (useTRD) {
AliTRDTenderSupply *trdSupply=new AliTRDTenderSupply("TRDtender");
trdSupply->SetLoadDeadChambersFromCDB(); // Mask Bad chambers
trdSupply->SetPIDmethod(AliTRDTenderSupply::k1DLQpid);
trdSupply->SwitchOffGainCorrection(); // Correction only on pass 1
trdSupply->SetNormalizationFactor(0.12697,114737,130850); // 1 otherwise
trdSupply->SetRedoTRDMatching(kTRUE);
tender->AddSupply(trdSupply);
}
//========= Attach Primary Vertex supply ======
if (useVTX) {
tender->AddSupply(new AliVtxTenderSupply("PriVtxtender"));
}
//========= Attach EMCAL supply ======
if (useEmc) {
AliEMCALTenderSupply *emcSupply = new AliEMCALTenderSupply("EmcTender");
emcSupply->SetDefaults();
tender->AddSupply(emcSupply);
}
//========= Attach PID supply ======
if (usePID) {
AliPIDTenderSupply *pidSupply=new AliPIDTenderSupply("PIDtender");
tender->AddSupply(pidSupply);
}
//================================================
// data containers
//================================================
// define output containers, please use 'username'_'somename'
AliAnalysisDataContainer *coutput1 =
mgr->CreateContainer("tender_event", AliESDEvent::Class(),
AliAnalysisManager::kExchangeContainer,"default_tender");
// connect containers
mgr->ConnectInput (tender, 0, mgr->GetCommonInputContainer() );
mgr->ConnectOutput (tender, 1, coutput1);
return tender;
}