AliPhysics  4a7363b (4a7363b)
TrackletAODTrain.C
Go to the documentation of this file.
1 
11 #include "TrainSetup.C"
12 #ifndef __CINT__
13 #include <AliESDInputHandlerRP.h>
14 // #include <AliMixInputEventHandler.h>
15 // #include <AliMixEventPool.h>
16 // #include <AliMixEventCutObj.h>
17 #include <TMacro.h>
18 #else
19 class AliAnalysisTaskSE;
20 #endif
21 
46 {
52  TrackletAODTrain(const char* name)
53  : TrainSetup(name)
54  {
55  // Define all our options here
56  fOptions.Add("max-delta", "X","Cut on weighted distance",25.);
57  fOptions.Add("scale-dtheta", "Scale dTheta" , true);
58  fOptions.Add("dphi-window", "X","dPhi window", 0.06);
59  fOptions.Add("dtheta-window", "X","dTheta window", 0.025);
60  fOptions.Add("dphi-shift", "X","Bending shift", 0.0045);
61  fOptions.Add("phi-overlap-cut", "X","Phi overlap cut", 0.005);
62  fOptions.Add("z-eta-overlap-cut","X","Z-Eta overlap cut", 0.05);
63  fOptions.Add("copy", "LIST","',' separated list to copy","cent,v0");
64  fOptions.Add("filter-mode", "MODE","Filter strange clusters", 0);
65  fOptions.Add("filter-weight","FILE","File with filter weights", "");
66  fOptions.SetDescription("Create branch in AOD with tracklet info");
67 
68  }
79  AliVEventHandler* CreateInputHandler(UShort_t type, Bool_t needRec=false)
80  {
81  Bool_t needRP = true;
82  return TrainSetup::CreateInputHandler(type, needRP);
83  }
93  AliVEventHandler* CreateMCHandler(UShort_t type, bool mc)
94  {
95  AliMCEventHandler* ret =
96  static_cast<AliMCEventHandler*>(TrainSetup::CreateMCHandler(type,mc));
97  if (ret) ret->SetPreReadMode(AliMCEventHandler::kLmPreRead);
98  return ret;
99  }
106  {
107  Info("CreateTasks", "Loading code");
108  fRailway->LoadSource("FixPaths.C");
109  fRailway->LoadSource("AliAODSimpleHeader.C");
110  fRailway->LoadSource("AliSimpleHeaderTask.C");
111  fRailway->LoadSource("AliAODTracklet.C");
112  fRailway->LoadSource("AliTrackletWeights.C");
113  fRailway->LoadSource("AliTrackletAODUtils.C");
114  fRailway->LoadSource("AliTrackletAODTask.C");
115 
116  // --- Task to copy header information ---------------------------
117  TString cpy = fOptions.Get("copy");
118  Info("", "What to copy: %s", cpy.Data());
119  CoupleSECar("AddTaskCopyHeader.C", Form("\"%s\"", cpy.Data()),
120  AliVEvent::kAny);
121 
122  // --- Task to create simple header ------------------------------
123  if (!gROOT->ProcessLine("AliSimpleHeaderTask::Create()"))
124  return;
125 
126  // --- Create the task using interpreter -------------------------
127  Long_t ret =
128  gROOT->ProcessLine(Form("AliTrackletAODTask::Create(\"%s\")",
129  fOptions.AsString("filter-weight")));
130  AliAnalysisTaskSE* task = reinterpret_cast<AliAnalysisTaskSE*>(ret);
131  if (!task) return;
132 
133  // --- Set various options on task -------------------------------
134  FromOption(task, "MaxDelta", "max-delta", 25.);
135  FromOption(task, "ScaleDTheta", "scale-dtheta", true);
136  FromOption(task, "DPhiWindow", "dphi-window", 0.06);
137  FromOption(task, "DThetaWindow", "dtheta-window", 0.025);
138  FromOption(task, "DPhiShift", "dphi-shift", 0.0045);
139  FromOption(task, "PhiOverlapCut", "phi-overlap-cut" , 0.005);
140  FromOption(task, "ZEtaOverlapCut", "z-eta-overlap-cut", 0.05);
141  FromOption(task, "FilterMode", "filter-mode", 0);
142 
143  task->Print("");
144  }
150  const char* ClassName() const { return "TrackletAODTrain"; }
151 };
152 //
153 // EOF
154 //
virtual AliVEventHandler * CreateInputHandler(UShort_t type, Bool_t esdRecPoints=false)
Definition: TrainSetup.C:539
Railway * fRailway
Definition: TrainSetup.C:1674
TrackletAODTrain(const char *name)
AliVEventHandler * CreateInputHandler(UShort_t type, Bool_t needRec=false)
virtual AliVEventHandler * CreateMCHandler(UShort_t, bool mc)
Definition: TrainSetup.C:583
const char * AsString(const TString &name, const TString &def="") const
Definition: Option.C:687
const TString & Get(const TString &name) const
Definition: Option.C:596
const char * ClassName() const
void SetDescription(const TString &d)
Definition: Option.C:359
Base classs for train specifications.
Option * Add(const TString &name, const TString &arg, const TString &desc, const TString &val="")
Definition: Option.C:421
void FromOption(AliAnalysisTaskSE *task, const char *what, const char *opt, Double_t defval)
Definition: TrainSetup.C:1236
OptionList fOptions
Definition: TrainSetup.C:1673
unsigned short UShort_t
Definition: External.C:28
AliVEventHandler * CreateMCHandler(UShort_t type, bool mc)
void CreateTasks(AliAnalysisManager *mgr)
bool Bool_t
Definition: External.C:53
virtual AliAnalysisTaskSE * CoupleSECar(const TString &macro, const TString &args, UInt_t mask=0)
Definition: TrainSetup.C:883
virtual Bool_t LoadSource(const TString &name, bool copy=false)
Definition: Railway.C:231