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