FairRoot/PandaRoot
PndMasterPidTask.cxx
Go to the documentation of this file.
1 // -------------------------------------------------------------------------
2 // ----- PndMasterPidTask source file -----
3 // ----- Created 01/02/16 by S. Spataro -----
4 // ----- Wrapper for pid tasks -----
5 // -------------------------------------------------------------------------
6 
7 
8 #include "PndMasterPidTask.h"
9 #include "PndMasterTask.h"
10 
11 #include "PndPidCorrelator.h"
12 #include "PndPidBremCorrector.h"
13 #include "PndMcCloner.h"
24 
30 // ----- Default constructor -------------------------------------------
32  PndMasterTask("Master Pid Task"), fOptions(options)
33 {
34  pid = {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1};
35 
36  // ----- Correlation ---------------------------------
37  PndPidCorrelator* corr = NULL;
38  this->Add(corr = new PndPidCorrelator()); // 1
39  pid.kPndPidCorrelator = GetListOfTasks()->GetSize()-1;
40  TString barrelbranchname="SttMvdGemGenTrack";
41  if (fOptions.Contains("nogem")||fOptions.Contains("gem0")) {
42  barrelbranchname="SttMvdGenTrack";
43  }
44  if (fOptions.Contains("filtered")) barrelbranchname+="_filtered";
45  if (fOptions.Contains("fakeonline")) barrelbranchname+="_fakeonline";
46  corr->SetBarrelTrackBranch(barrelbranchname);
47 
48  TString fwdbranchname="FtsIdealGenTrack";
49  if (fOptions.Contains("fakeonline")) fwdbranchname+="_fakeonline";
50  corr->SetForwardTrackBranch(fwdbranchname);
51 
52  if (fOptions.Contains("piddebug")) corr->SetDebugMode(kTRUE);
53  if (fOptions.Contains("pidfast")) corr->SetFast(kTRUE);
54  if (fOptions.Contains("pidnoswim")) corr->SetBackPropagate(kFALSE);
55 
56  // ----- Bremsstrahlung Correction ----------------------
57  this->Add(new PndPidBremCorrector()); // 2
58  pid.kPndPidBremCorrector = GetListOfTasks()->GetSize()-1;
59 
60  // ----- MC Cloner ------------------------------------
61  PndMcCloner *clone = NULL;
62  this->Add(clone = new PndMcCloner()); // 3
63  pid.kPndMcCloner = GetListOfTasks()->GetSize()-1;
64  // Option to clean the MCTrack TClonesArray from particles which were not interacting with sensitive detectors
65  clone->SetCleanMc();
66 
67  // ----- Classifiers ----------------------------------
68  this->Add(new PndPidIdealAssociatorTask()); // 4
69  pid.kPndPidIdealAssociatorTask = GetListOfTasks()->GetSize()-1;
70 
71  this->Add(new PndPidMvdAssociatorTask()); // 5
72  pid.kPndPidMvdAssociatorTask = GetListOfTasks()->GetSize()-1;
73 
74  this->Add(new PndPidMdtHCAssociatorTask()); // 6
75  pid.kPndPidMdtHCAssociatorTask = GetListOfTasks()->GetSize()-1;
76 
77  this->Add(new PndPidDrcAssociatorTask()); // 7
78  pid.kPndPidDrcAssociatorTask = GetListOfTasks()->GetSize()-1;
79 
80  if ( !fOptions.Contains("day1") && !fOptions.Contains("phase1") )
81  {
82  this->Add(new PndPidDiscAssociatorTask()); // 8
83  pid.kPndPidDiscAssociatorTask = GetListOfTasks()->GetSize()-1;
84  }
85 
86  this->Add(new PndPidSttAssociatorTask()); // 9
87  pid.kPndPidSttAssociatorTask = GetListOfTasks()->GetSize()-1;
88 
89  this->Add(new PndPidEmcBayesAssociatorTask()); // 10
90  pid.kPndPidEmcBayesAssociatorTask = GetListOfTasks()->GetSize()-1;
91 
92  this->Add(new PndPidSciTAssociatorTask()); // 11
93  pid.kPndPidSciTAssociatorTask = GetListOfTasks()->GetSize()-1;
94 
95  this->Add(new PndPidFtofAssociatorTask()); // 12
96  pid.kPndPidFtofAssociatorTask = GetListOfTasks()->GetSize()-1;
97 
98  if ( !fOptions.Contains("day1") && !fOptions.Contains("phase1") )
99  {
100  this->Add(new PndPidRichAssociatorTask()); // 13
101  pid.kPndPidRichAssociatorTask = GetListOfTasks()->GetSize()-1;
102  }
103 
104  SetVerbose(0);
105 
106 }
107 // -------------------------------------------------------------------------
108 
111 {
112  if (!pers) LOG(INFO) << "It makes no sense to have pid persistency switched OFF!" << FairLogger::endl;
113  if (!pers) LOG(INFO) << "Or, if you prefer... this functionality has not been implemented yet" << FairLogger::endl;
114 
115  return;
116 }
117 
118 // ----- Destructor ----------------------------------------------------
120 {
121 }
122 // -------------------------------------------------------------------------
123 
mychain Add("run.root")
PndMasterPidTask(TString options="")
Default constructor with options This string can be: &quot;&quot; -&gt; default settings full setup &quot;day1&quot; -&gt; Set...
PndPidCorrelator * corr
void SetVerbose(Int_t iVerbose=1)
Set the Verbosity to all the tasks.
void SetBarrelTrackBranch(TString branch)
void SetCleanMc(Bool_t opt=kTRUE)
Definition: PndMcCloner.h:33
virtual void SetPersistency(Bool_t pers=kTRUE)
Set the persistency of all the tasks.
Abstract class for all the master task list classes.
Definition: PndMasterTask.h:21
TString fOptions
Options parsed to the pid.
struct PndMasterPidTask::pidTaskList pid
void SetDebugMode(Bool_t debug)
virtual ~PndMasterPidTask()
Destructor.
The default pid tasks.
void SetBackPropagate(Bool_t opt=kTRUE)
ClassImp(PndAnaContFact)
void SetForwardTrackBranch(TString branch)
void SetFast(Bool_t fast)