AliPhysics  d497547 (d497547)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AddTaskFMDMCTracks.C
Go to the documentation of this file.
1 
25 AddTaskFMDMCTracks(Bool_t useTuple=false,
26  UShort_t maxStrips=2,
27  Int_t debug=0)
28 {
29  // --- Load libraries ----------------------------------------------
30  gROOT->LoadClass("AliFMDMCTrackELoss", "PWGLFforward2");
31 
32  // --- Get analysis manager ----------------------------------------
33  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
34  if (!mgr) {
35  Error("AddTaskFMDELoss", "No analysis manager to connect to.");
36  return NULL;
37  }
38 
39  // --- Make the task and add it to the manager ---------------------
41  new AliFMDMCTrackInspectorTask("ForwardTracks",
42  useTuple);
43  // --- Set parameters on the algorithms ----------------------------
44  // Set the number of SPD tracklets for which we consider the event a
45  // low flux event
46  task->GetEventInspector().SetLowFluxCut(1000);
47  // Set the maximum error on v_z [cm]
48  task->GetEventInspector().SetMaxVzErr(0.2);
49  // Set the eta axis to use - note, this overrides whatever is used
50  // by the rest of the algorithms - but only for the energy fitter
51  // algorithm.
52  task->GetTrackInspector().SetEtaAxis(100, -4, 6);
53  // Set maximum energy loss to consider
54  task->GetTrackInspector().SetMaxE(15);
55  // Set number of energy loss bins
56  task->GetTrackInspector().SetNEbins(500);
57  // Set whether to use increasing bin sizes
59  // Set whether to do fit the energy distributions
60  task->GetTrackInspector().SetDoFits(kTRUE);
61  // Set whether to make the correction object
62  // task->GetTrackInspector().SetDoMakeObject(kTRUE);
63  // Set the low cut used for energy
64  task->GetTrackInspector().SetLowCut(0.05);
65  // Set the number of bins to subtract from maximum of distributions
66  // to get the lower bound of the fit range
68  // Set the maximum number of landaus to try to fit (max 5)
70  // Set the minimum number of entries in the distribution before
71  // trying to fit to the data - 10K seems the absolute minimum
72  task->GetTrackInspector().SetMinEntries(3000 /*10000*/);
73  // Set maximum number of strips per 'cluster'
75  // If set, only collect statistics for MB. This is to prevent a
76  // bias when looping over data where the MB trigger is downscaled.
77  // task->SetOnlyMB(onlyMB);
78  // Debug
79  task->SetDebug(debug);
80 
81  // --- Set limits on fits the energy -------------------------------
82  // DO NOT CHANGE THESE UNLESS YOU KNOW WHAT YOU ARE DOING
83  // Maximum relative error on parameters
84  // AliFMDCorrELossFit::ELossFit::fgMaxRelError = .12;
85  // Least weight to use
86  // AliFMDCorrELossFit::ELossFit::fgLeastWeight = 1e-5;
87  // Maximum value of reduced chi^2
88  // AliFMDCorrELossFit::ELossFit::fgMaxChi2nu = 20;
89 
90  // --- Make the output container and connect it --------------------
91  task->Connect(0,0);
92  if (useTuple) {
93  AliAnalysisDataContainer* tuple =
94  mgr->CreateContainer("tuple", TTree::Class(),
95  AliAnalysisManager::kOutputContainer,
96  "forward_tuple.root"
97  /*AliAnalysisManager::GetCommonFileName()*/);
98  mgr->ConnectOutput(task, 3, tuple);
99  }
100 
101  Printf("Returning task %p", task);
102  return task;
103 }
104 //
105 // EOF
106 //
AliFMDEventInspector & GetEventInspector()
AliFMDMCTrackInspector & GetTrackInspector()
const int debug
Definition: scanAll.C:15
virtual Bool_t Connect(const char *sumFile=0, const char *resFile=0)
void SetDoFits(Bool_t doFit=kTRUE)
void SetMaxConsequtiveStrips(UShort_t n)
void SetLowCut(Double_t lowCut=0.3)
void SetFitRangeBinWidth(UShort_t n=4)
void SetMaxE(Double_t x)
void SetMaxVzErr(Double_t c=0.1)
void SetNParticles(UShort_t n)
int Int_t
Definition: External.C:63
void SetUseIncreasingBins(Bool_t x)
void SetMinEntries(UShort_t n)
void SetEtaAxis(Int_t nBins, Double_t etaMin, Double_t etaMax)
unsigned short UShort_t
Definition: External.C:28
AliFMDMCTrackELoss & GetTracker()
bool Bool_t
Definition: External.C:53
AliAnalysisTask * AddTaskFMDMCTracks(Bool_t useTuple=false, UShort_t maxStrips=2, Int_t debug=0)