]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGLF/RESONANCES/macros/train/RsnConfigEvent.C
PWG2/SPECTRA -> PWGLF/SPECTRA migration
[u/mrichter/AliRoot.git] / PWGLF / RESONANCES / macros / train / RsnConfigEvent.C
1 //
2 // Configuration script for monitor task with 2010 runs
3 //
4 // It contains a class definition where the cuts for each object
5 // are defined separately, functions are initialized and so on.
6 // This is used in the main function (named after the file name),
7 // which is called by the 'AddTask' function.
8 //
9
10 Bool_t RsnConfigEvent
11 (
12    AliRsnAnalysisTask *task,
13    Bool_t              isMC,
14    Bool_t              useCentrality,
15    AliRsnCutSet       *eventCuts
16 )
17 {
18    if (!task) myError("NULL task");
19    
20    // ----------------------------------------------------------------------------------------------
21    // -- LOOP DEFINITION ---------------------------------------------------------------------------
22    // ----------------------------------------------------------------------------------------------
23    
24    // loop on events
25    AliRsnLoopEvent *loop = new AliRsnLoopEvent("evtLoop");
26    
27    // add cuts to loop
28    loop->SetEventCuts(eventCuts);
29    
30    // add loop to task
31    task->Add(loop);
32    
33    // ----------------------------------------------------------------------------------------------
34    // -- OUTPUTS DEFINITION ------------------------------------------------------------------------
35    // ----------------------------------------------------------------------------------------------
36    
37    Double_t mult[] = { 0.,  1.,  2.,  3.,  4.,  5.,   6.,   7.,   8.,   9.,  10., 11., 12., 13., 
38                       14., 15., 16., 17., 18., 19.,  20.,  21.,  22.,  23.,  24.,  25., 30., 35., 
39                       40., 50., 60., 70., 80., 90., 100., 120., 140., 160., 180., 200., 500.};
40    Int_t    nmult  = sizeof(mult) / sizeof(mult[0]);
41
42    // axes
43    AliRsnValueStd *axisMultESD  = new AliRsnValueStd("MESD", AliRsnValueStd::kEventMultESDCuts , nmult, mult);
44    AliRsnValueStd *axisMultSPD  = new AliRsnValueStd("MSPD", AliRsnValueStd::kEventMultSPD     , nmult, mult);
45    AliRsnValueStd *axisMultMC   = new AliRsnValueStd("MMC" , AliRsnValueStd::kEventMultMC      , nmult, mult);
46    AliRsnValueStd *axisMultTRK  = new AliRsnValueStd("MTRK", AliRsnValueStd::kEventMult        , nmult, mult);
47    AliRsnValueStd *axisCentV0   = new AliRsnValueStd("CNT" , AliRsnValueStd::kEventCentralityV0, 0.0  , 100.0, 1.0);
48    AliRsnValueStd *axisMultTest = new AliRsnValueStd("TEST", AliRsnValueStd::kEventMult        , 1, 1.0 , 1E10);
49    
50    // create output
51    AliRsnListOutput *out = new AliRsnListOutput("evtOut", AliRsnListOutput::kHistoDefault);
52    
53    // always add test axis, used to know how many events had at least one track
54    out->AddValue(axisMultTest);
55    
56    // add values to output:
57    // centrality only if this is requested, otherwise multiplicity
58    if (useCentrality) {
59       ::Info("RsnConfigEvent", "Adding centrality");
60       out->AddValue(axisCentV0);
61    } else {
62       ::Info("RsnConfigEvent", "Adding multiplicity");
63       //out->AddValue(axisMultESD);
64       //out->AddValue(axisMultSPD);
65       out->AddValue(axisMultTRK);
66       if (isMC) {
67          out->AddValue(axisMultMC);
68       }
69    }
70    
71    // add output to loop
72    loop->AddOutput(out);
73    
74    return kTRUE;
75 }