]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGLF/FORWARD/analysis2/trains/MakeMultTrain.C
Added scripts for Casper/Valentina style P(N_{ch}) analysis
[u/mrichter/AliRoot.git] / PWGLF / FORWARD / analysis2 / trains / MakeMultTrain.C
1 /**
2  * @file   MakeMultTrain.C
3  * @author Valentina Zaccolo
4  * @date   Wed Nov  21 12:47:26 2012
5  * 
6  * @brief  
7  * 
8  * @ingroup pwglf_forward_trains_specific
9  * 
10  */
11
12 #include "TrainSetup.C"
13
14 //====================================================================
15 /**
16  * Analysis train to make @f$ Multiplicity Distributions@f$
17  * 
18  *
19  * @ingroup pwglf_forward_mult
20  * @ingroup pwglf_forward_trains_specific
21  */
22 class MakeMultTrain : public TrainSetup
23 {
24 public:
25   /** 
26    * Constructor.  
27    * 
28    * @param name     Name of train (free form)
29    * @param aoddir   Any file matching *AliAODs.root* is added 
30    * @param nEvents  If 0 or less -> all events are analysed
31    * @param trig     "NSD" for Non-Single-Diffractive, "INEL" for inelastic
32    * @param lowCent  Set 0 for pp
33    * @param nBins    For pp set 500, for central PbPb set 30000
34    */
35  MakeMultTrain(const char* name)
36   : TrainSetup(name)
37   {
38     fOptions.Add("trig",    "TYPE",       "Trigger type",     "V0AND");
39     fOptions.Add("vzMin",   "CENTIMETER", "Min Ip Z",         -4);
40     fOptions.Add("vzMax",   "CENTIMETER", "Max Ip Z",         +4);
41     fOptions.Add("lowCent", "%",          "Min Centrality",   0); 
42     fOptions.Add("highCent","%",          "Max Centrality",   0);
43     fOptions.Add("nBins",   "N",          "Max Multiplicity", 500);
44   }
45 protected:
46   /** 
47    * Create the tasks 
48    * 
49    * @param par  Whether to use par files 
50    */
51   void CreateTasks(AliAnalysisManager*)
52   {
53     // --- Output file name ------------------------------------------
54     AliAnalysisManager::SetCommonFileName("forward_multiplicity.root");
55
56     // --- Load libraries/pars ---------------------------------------
57     fHelper->LoadLibrary("PWGLFforward2");
58     
59     // --- Set load path ---------------------------------------------
60     gROOT->SetMacroPath(Form("%s:$(ALICE_ROOT)/PWGLF/FORWARD/analysis2",
61                              gROOT->GetMacroPath()));
62
63     // --- Get parameters --------------------------------------------
64     TString  trig     = fOptions.Get("trig");
65     Double_t vzMin    = fOptions.AsDouble("vzmin", -4);
66     Double_t vzMax    = fOptions.AsDouble("vzmax", +4);
67     Int_t    lowCent  = fOptions.AsInt("lowCent",  0);
68     Int_t    highCent = fOptions.AsInt("highCent", 0);
69     Int_t    nBins    = fOptions.AsInt("nBins",    500);
70
71     // --- Form arguments --------------------------------------------
72     TString args;
73     args.Form("\"%s\",%f,%f,%d,%d,%d",
74               trig.Data(), vzMin, vzMax, lowCent, highCent, nBins);
75     // --- Add the task ----------------------------------------------
76     gROOT->Macro(Form("AddTaskMultDists.C(%s);", args.Data()));
77   }
78   //__________________________________________________________________
79   /** 
80    * Do not the centrality selection
81    */
82   void CreateCentralitySelection(Bool_t, AliAnalysisManager*) {}
83   //__________________________________________________________________
84   /** 
85    * Crete output handler - we don't want one here. 
86    * 
87    * @return 0
88    */
89   AliVEventHandler* CreateOutputHandler(UShort_t) { return 0; }
90   //__________________________________________________________________
91   const char* ClassName() const { return "MakeMultTrain"; }
92 };
93 //
94 // EOF
95 //