]>
Commit | Line | Data |
---|---|---|
22fceaec | 1 | // This is the macro to include the FMD analysis in the train. It |
2 | // depends on two libraries: libFMDanalysis.so in AliRoot and | |
3 | // libPhysics.so in ROOT. It has been tested to work with the example | |
4 | // scripts in the ANALYSIS webpages. | |
5 | // | |
6 | // Author: Hans Hjersing Dalsgaard <hans.dalsgaard@cern.ch> | |
7 | ||
8 | ||
9 | AliAnalysisTask* AddTaskCorrection(Float_t blow =0, | |
10 | Float_t bhigh =100, | |
11 | Float_t cmsGeV=900.F, | |
12 | const char* col="p-p", | |
13 | Float_t bkG=5.F) | |
14 | { | |
15 | AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); | |
16 | if (!mgr) { | |
17 | Error("AddTaskESDFilter", "No analysis manager to connect to."); | |
18 | return NULL; | |
19 | } | |
20 | ||
21 | ||
22 | // --- Generate parameter manager ---------------------------------- | |
23 | /* AliFMDAnaParameters* pars = AliFMDAnaParameters::Instance(); | |
24 | pars->SetEnergy(cmsGeV); | |
25 | pars->SetCollisionSystem(col); | |
26 | pars->SetMagField(bkG); | |
27 | pars->SetProcessPrimary(kFALSE); | |
28 | pars->SetProcessHits(kFALSE); | |
29 | pars->SetRealData(kTRUE); | |
30 | */ | |
31 | // --- Check if we have an MC handler ------------------------------ | |
32 | //AliMCEventHandler* eventHandler = | |
33 | // dynamic_cast<AliMCEventHandler*> (AliAnalysisManager::GetAnalysisManager() | |
34 | // ->GetMCtruthEventHandler()); | |
35 | //if(eventHandler) { | |
36 | // pars->SetRealData(kFALSE); | |
37 | // pars->SetProcessPrimary(kTRUE); | |
38 | // pars->SetProcessHits(kFALSE); | |
39 | // } | |
40 | //pars->Init(); | |
41 | //pars->PrintStatus(); | |
42 | const Char_t* outFile = AliAnalysisManager::GetCommonFileName(); | |
43 | // --- Make the task ----------------------------------------------- | |
44 | AliFMDAnalysisTaskGenerateCorrection *taskfmd = new AliFMDAnalysisTaskGenerateCorrection("TaskFMD"); | |
45 | taskfmd->SetBLow(blow); | |
46 | taskfmd->SetBHigh(bhigh); | |
47 | mgr->AddTask(taskfmd); | |
48 | ||
49 | // --- Connect input/output ---------------------------------------- | |
50 | AliAnalysisDataContainer *cout_fmd1 = mgr->CreateContainer("Hits", | |
51 | TList::Class(), | |
52 | AliAnalysisManager::kOutputContainer, outFile); | |
53 | AliAnalysisDataContainer *cout_fmd2 = mgr->CreateContainer("Primaries", | |
54 | TList::Class(), | |
55 | AliAnalysisManager::kOutputContainer, outFile); | |
56 | ||
57 | AliAnalysisDataContainer *cout_fmd3 = mgr->CreateContainer("vertex", | |
58 | TH1F::Class(), | |
59 | AliAnalysisManager::kOutputContainer, outFile); | |
60 | AliAnalysisDataContainer *cout_fmd4 = mgr->CreateContainer("Correction", | |
61 | TList::Class(), | |
62 | AliAnalysisManager::kOutputContainer, outFile); | |
63 | ||
64 | ||
65 | // Dummy AOD output container for jet analysis (no client yet) | |
66 | //AliAnalysisDataContainer *c_aodfmd = mgr->CreateContainer("cAODfmd", | |
67 | // TTree::Class(), | |
68 | // AliAnalysisManager::kExchangeContainer); | |
69 | // Connect to data containers | |
70 | // mgr->ConnectInput (taskfmd, 0, cin_esd ); | |
71 | // mgr->ConnectOutput (fmdana, 0, c_aodfmd ); | |
72 | mgr->ConnectOutput (taskfmd, 1, cout_fmd1 ); | |
73 | mgr->ConnectOutput (taskfmd, 2, cout_fmd2 ); | |
74 | mgr->ConnectOutput (taskfmd, 3, cout_fmd3 ); | |
75 | mgr->ConnectOutput (taskfmd, 4, cout_fmd4 ); | |
76 | ||
77 | ||
78 | TString outputfile = Form("%s:%s", | |
79 | AliAnalysisManager::GetCommonFileName(), | |
80 | "Background"); | |
81 | ||
82 | // AliAnalysisDataContainer *cout_fmd = | |
83 | // mgr->CreateContainer("BackgroundCorrected", TList::Class(), | |
84 | // AliAnalysisManager::kOutputContainer,outputfile); | |
85 | mgr->ConnectInput(taskfmd, 0, mgr->GetCommonInputContainer()); | |
86 | //mgr->ConnectOutput(taskfmd, 1, cout_fmd); | |
87 | ||
88 | return taskfmd; | |
89 | } | |
90 | // | |
91 | // EOF | |
92 | // | |
93 |