FairRoot/PandaRoot
Classes | Public Member Functions | Protected Attributes | Private Attributes | List of all members
PndMasterMultiPidTask Class Reference

The default pid tasks. More...

#include <PndMasterMultiPidTask.h>

Inheritance diagram for PndMasterMultiPidTask:
PndMasterTask PndBlackBoxTask PndPersistencyTask

Classes

struct  pidTaskList
 struct of the task list This struct avoids to retrieve tasks using the integer value (misleading), but uses an easier scheme. The enum is "k" + the class name, i.e. "kPndPidCorrelator" for the class PndPidCorrelator. The function PrintTaskList() can be used to check the list of the tasks and the corresponding number. More...
 

Public Member Functions

 PndMasterMultiPidTask (TString options="")
 Default constructor with options This string can be: "" -> default settings full setup "day1" -> Setup for day1 experiment: no GEM, FTS1234, NO DISC, NO RICH "gem" (added to "day1") -> Setup for day1 experiment with 3 GEM planes "fts1256" (added to "day1") -> Setup for day1 experiment with FTS1256 insted of FTS1234 "filtered" -> the option filtered was used in the reco stage to remove tracks with wrong Pz Example: "day1+gem+fts1256" means day1 setup + GEM planes + fst1256. More...
 
virtual ~PndMasterMultiPidTask ()
 Destructor. More...
 
virtual void SetPersistency (Bool_t pers=kTRUE)
 Set the persistency of all the tasks. More...
 
void PrintTaskList ()
 It prints the list of tasks. More...
 
void SetVerbose (Int_t iVerbose=1)
 Set the Verbosity to all the tasks. More...
 
void SetVerbose (Int_t nTask, Int_t iVerbose)
 Set the Verbosity to a single task. More...
 
FairTask * GetTask (Int_t nTask)
 Return the pointer to a single task. More...
 
virtual void SetParContainers ()
 
virtual InitStatus Init ()
 
virtual InitStatus ReInit ()
 
virtual void Exec (Option_t *opt)
 
Bool_t GetPersistency ()
 

Protected Attributes

std::vector< PndPersistencyTask * > fBranchTasks
 
std::vector< FairTask * > fStandardTasks
 
std::map< PndPersistencyTask
*, bool > 
fFixedPersistency
 

Private Attributes

std::array< pidTaskList, 5 > fPidTasks
 
TString fOptions
 Options parsed to the pid. More...
 
std::array< Bool_t, 5 > fHypoFlag
 

Detailed Description

The default pid tasks.

Master Pid Task Class

This class includes all the pid tasks which need to be used in the default pid macros.

Remarks
If you find some obsolete task which needs to be changed, contact the computing coordinator.
Author
Stefano Spataro spata.nosp@m.ro@t.nosp@m.o.inf.nosp@m.n.it, Torino University
Version
1.0
Date
Feb 1, 2016

Definition at line 21 of file PndMasterMultiPidTask.h.

Constructor & Destructor Documentation

PndMasterMultiPidTask::PndMasterMultiPidTask ( TString  options = "")

Default constructor with options This string can be: "" -> default settings full setup "day1" -> Setup for day1 experiment: no GEM, FTS1234, NO DISC, NO RICH "gem" (added to "day1") -> Setup for day1 experiment with 3 GEM planes "fts1256" (added to "day1") -> Setup for day1 experiment with FTS1256 insted of FTS1234 "filtered" -> the option filtered was used in the reco stage to remove tracks with wrong Pz Example: "day1+gem+fts1256" means day1 setup + GEM planes + fst1256.

Default Constructor.

Pid task list

Here all the pid tasks are added to the task, with the standard settings. A check is done after each task if the tasklist enum is broken or not. At the end the event counter is added (each 100 events), and the verbosity is set to 0 to all the tasks (it can be changed afterwards with SetVerbosity() functions.

Definition at line 32 of file PndMasterMultiPidTask.cxx.

References Add(), fHypoFlag, fOptions, fPidTasks, PndPidCorrelator::SetBackPropagate(), PndPidCorrelator::SetBarrelTrackBranch(), PndMcCloner2::SetCleanMc(), PndPidCorrelator::SetDebugMode(), PndPidCorrelator::SetFast(), PndPidCorrelator::SetForwardTrackBranch(), PndPidSciTAssociatorTask::SetOutputBranch(), PndPidFtofAssociatorTask::SetOutputBranch(), PndPidMvdAssociatorTask::SetOutputBranch(), PndPidBremCorrector::SetOutputBranch(), PndPidMdtHCAssociatorTask::SetOutputBranch(), PndPidDrcAssociatorTask::SetOutputBranch(), PndPidDiscAssociatorTask::SetOutputBranch(), PndPidRichAssociatorTask::SetOutputBranch(), PndPidIdealAssociatorTask::SetOutputBranch(), PndPidEmcBayesAssociatorTask::SetOutputBranch(), PndPidSttAssociatorTask::SetOutputBranch(), PndPidCorrelator::SetOutputBranch(), PndPidCorrelator::SetPidHyp(), PndMasterTask::SetVerbose(), and TString.

32  :
33  PndMasterTask("Master Pid Task"), fOptions(options)
34 {
35  std::array<Int_t,5> hypoPdg= {11,13,211,321,2212};
36  std::array<TString,5> hypoName= {"Electron","Muon","Pion","Kaon","Proton"};
37 
38  unsigned int nfits = 0;
39  if (fOptions.Contains("electron")) {
40  nfits++;
41  fHypoFlag[0] = true;
42  }
43  if (fOptions.Contains("muon")) {
44  nfits++;
45  fHypoFlag[1] = true;
46  }
47  if (fOptions.Contains("pion")) {
48  nfits++;
49  fHypoFlag[2] = true;
50  }
51  if (fOptions.Contains("kaon")) {
52  nfits++;
53  fHypoFlag[3] = true;
54  }
55  if (fOptions.Contains("proton")) {
56  nfits++;
57  fHypoFlag[4] = true;
58  }
59  if (nfits == 0) {
60  std::cout<<" -I- PndMasterMultiPidTask: No hypotheses given, running pid with all 5 hypothesis" << std::endl;
61  fHypoFlag[0] = true;
62  fHypoFlag[1] = true;
63  fHypoFlag[2] = true;
64  fHypoFlag[3] = true;
65  fHypoFlag[4] = true;
66  }
67 
68  for (int iHyp=0; iHyp<5; iHyp++)
69  {
70  fPidTasks[iHyp] = {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1};
71 
72  // ----- Correlation ---------------------------------
73  PndPidCorrelator* correlator = new PndPidCorrelator();
74  correlator->SetPidHyp(hypoPdg[iHyp]);
75  correlator->SetOutputBranch(hypoName[iHyp]); // suffixes for branches
76  //correlator->SetFlagCut(kFALSE);
77 
78  this->Add(correlator); // Adding to task list
79  fPidTasks[iHyp].kPndPidCorrelator = GetListOfTasks()->GetSize()-1;
80 
81  TString brlbranchname="SttMvdGemGenTrack"+hypoName[iHyp];
82  if (fOptions.Contains("nogem")||fOptions.Contains("gem0")) {
83  brlbranchname="SttMvdGenTrack"+hypoName[iHyp];
84  }
85  if (fOptions.Contains("filtered")) brlbranchname+="_filtered";
86  if (fOptions.Contains("fakeonline")) brlbranchname+="_fakeonline";
87  //if ( (!fOptions.Contains("day1")) || (fOptions.Contains("gem")) )
88  //{
89  //} else
90 
91  // TODO: Go over day1 and PID!
92  correlator->SetBarrelTrackBranch(brlbranchname);
93 
94  TString fwdbranchname="FtsIdealGenTrack"+hypoName[iHyp];
95  if (fOptions.Contains("fakeonline")) fwdbranchname+="_fakeonline";
96  correlator->SetForwardTrackBranch(fwdbranchname);
97 
98  if (fOptions.Contains("piddebug")) correlator->SetDebugMode(kTRUE);
99  if (fOptions.Contains("pidfast")) correlator->SetFast(kTRUE);
100  if (fOptions.Contains("pidnoswim")) correlator->SetBackPropagate(kFALSE);
101 
102  // ----- Bremsstrahlung Correction ----------------------
103  PndPidBremCorrector *PidBrem = new PndPidBremCorrector();
104  PidBrem->SetOutputBranch(hypoName[iHyp]);
105  this->Add(PidBrem); // 2
106  fPidTasks[iHyp].kPndPidBremCorrector = GetListOfTasks()->GetSize()-1;
107 
108  // // ----- MC Cloner ------------------------------------
109  // PndMcCloner *clone = new PndMcCloner();
110  // clone->SetOutputBranch(hypoName[iHyp]);
111  // this->Add(clone); // 3
112  // fPidTasks[iHyp].kPndMcCloner = GetListOfTasks()->GetSize()-1;
113  // // Option to clean the MCTrack TClonesArray from particles which were not interacting with sensitive detectors
114  // clone->SetCleanMc();
115 
116  // // ----- Classifiers ----------------------------------
117  // PndPidIdealAssociatorTask *PidIdeal = new PndPidIdealAssociatorTask();
118  // PidIdeal->SetOutputBranch(hypoName[iHyp]);
119  // this->Add(PidIdeal); // 4
120  // fPidTasks[iHyp].kPndPidIdealAssociatorTask = GetListOfTasks()->GetSize()-1;
121 
123  PidMvd->SetOutputBranch(hypoName[iHyp]);
124  this->Add(PidMvd); // 5
125  fPidTasks[iHyp].kPndPidMvdAssociatorTask = GetListOfTasks()->GetSize()-1;
126 
128  PidMdt->SetOutputBranch(hypoName[iHyp]);
129  this->Add(PidMdt); // 6
130  fPidTasks[iHyp].kPndPidMdtHCAssociatorTask = GetListOfTasks()->GetSize()-1;
131 
133  PidDrc->SetOutputBranch(hypoName[iHyp]);
134  this->Add(PidDrc); // 7
135  fPidTasks[iHyp].kPndPidDrcAssociatorTask = GetListOfTasks()->GetSize()-1;
136 
137  if ( !fOptions.Contains("day1") && !fOptions.Contains("phase1") )
138  {
140  PidDisc->SetOutputBranch(hypoName[iHyp]);
141  this->Add(PidDisc); // 8
142  fPidTasks[iHyp].kPndPidDiscAssociatorTask = GetListOfTasks()->GetSize()-1;
143  }
144 
146  PidStt->SetOutputBranch(hypoName[iHyp]);
147  this->Add(PidStt); // 9
148  fPidTasks[iHyp].kPndPidSttAssociatorTask = GetListOfTasks()->GetSize()-1;
149 
151  PidEmcBayes->SetOutputBranch(hypoName[iHyp]);
152  this->Add(PidEmcBayes); // 10
153  fPidTasks[iHyp].kPndPidEmcBayesAssociatorTask = GetListOfTasks()->GetSize()-1;
154 
156  PidSciT->SetOutputBranch(hypoName[iHyp]);
157  this->Add(PidSciT); // 11
158  fPidTasks[iHyp].kPndPidSciTAssociatorTask = GetListOfTasks()->GetSize()-1;
159 
161  PidFtof->SetOutputBranch(hypoName[iHyp]);
162  this->Add(PidFtof); // 12
163  fPidTasks[iHyp].kPndPidFtofAssociatorTask = GetListOfTasks()->GetSize()-1;
164 
165  if ( !fOptions.Contains("day1") && !fOptions.Contains("phase1") )
166  {
168  PidRich->SetOutputBranch(hypoName[iHyp]);
169  this->Add(PidRich); // 13
170  fPidTasks[iHyp].kPndPidRichAssociatorTask = GetListOfTasks()->GetSize()-1;
171  }
172  }
173 
174  // ----- MC Cloner ------------------------------------
175  //cloner that goes through all candidates. Run only once, and after all correlators
176  PndMcCloner2 *clone = new PndMcCloner2();
177  this->Add(clone); // 3
178  // Option to clean the MCTrack TClonesArray from particles which were not interacting with sensitive detectors
179  clone->SetCleanMc();
180 
181 
182  for (int iHyp=0; iHyp<5; iHyp++)
183  {
185  PidIdeal->SetOutputBranch(hypoName[iHyp]);
186  this->Add(PidIdeal); // 4
187  fPidTasks[iHyp].kPndPidIdealAssociatorTask = GetListOfTasks()->GetSize()-1;
188 
189  }
190 
191  SetVerbose(0);
192 }
void SetOutputBranch(TString branch)
void SetOutputBranch(TString branch)
mychain Add("run.root")
void SetOutputBranch(TString branch)
void SetVerbose(Int_t iVerbose=1)
Set the Verbosity to all the tasks.
void SetBarrelTrackBranch(TString branch)
void SetOutputBranch(TString branch)
void SetPidHyp(Int_t pid)
void SetOutputBranch(TString branch)
void SetOutputBranch(TString branch)
void SetDebugMode(Bool_t debug)
std::array< pidTaskList, 5 > fPidTasks
void SetOutputBranch(TString branch)
TString fOptions
Options parsed to the pid.
void SetCleanMc(Bool_t opt=kTRUE)
Definition: PndMcCloner2.h:33
void SetBackPropagate(Bool_t opt=kTRUE)
void SetOutputBranch(TString branch)
void SetOutputBranch(TString branch)
void SetForwardTrackBranch(TString branch)
PndMasterTask()
Default constructor.
void SetFast(Bool_t fast)
std::array< Bool_t, 5 > fHypoFlag
void SetOutputBranch(TString branch)
void SetOutputBranch(TString branch)
PndMasterMultiPidTask::~PndMasterMultiPidTask ( )
virtual

Destructor.

Definition at line 205 of file PndMasterMultiPidTask.cxx.

206 {
207 }

Member Function Documentation

void PndBlackBoxTask::Exec ( Option_t *  opt)
virtualinherited

Reimplemented in PndMvdQATask, and PndBufferTestTask.

Definition at line 50 of file PndBlackBoxTask.cxx.

51 {
52  return;
53 }
Bool_t PndPersistencyTask::GetPersistency ( )
inlineinherited

Definition at line 32 of file PndPersistencyTask.h.

References PndPersistencyTask::fPersistency.

Referenced by PndLmdPixelHitProducerFast::GetPersistance(), PndMdtDigitization::Init(), PndMdtHitProducerIdeal::Init(), PndMdtClusterTask::Init(), PndFtsHitProducerRealFast::Init(), PndDiscTaskReconstruction::Init(), PndRichHitProducer::Init(), PndSttHitProducerRealFast::Init(), PndSttHelixHitProducer::Init(), PndDiscTaskPID::Init(), PndIdealTrackFinder::Init(), PndSttMvdGemTracking::Init(), PndMdtTrkProducer::Init(), PndFtsHitProducerRealFull::Init(), PndLmdPixelClusterTask::Init(), PndSttHitProducerRealFull::Init(), PndLmdStripClusterTask::Init(), PndEmcApdHitProducer::Init(), PndMissingPzCleanerTask::Init(), PndEmcMakeRecoHit::Init(), PndEmcMakeClusterOnline::Init(), PndTrackSmearTask::Init(), PndEmcFWEndcapTimebasedWaveforms::Init(), PndSttHitProducerIdeal::Init(), PndEmcFWEndcapDigi::Init(), PndFtsHitProducerIdeal::Init(), PndEmcMakeCluster::Init(), PndMdtPointsToWaveform::Init(), PndDiscTaskDigitization::Init(), PndEmcMakeDigi::Init(), PndSdsTimeWalkCorrTask::Init(), PndLmdPixelHitProducerFast::Init(), PndDrcHitFinder::Init(), PndRichHitFinder::Init(), PndEmcMakeCorr::Init(), PndFtofHitProducerIdeal::Init(), PndEmcHitsToWaveform::Init(), PndSciTDigiTask::Init(), PndDrcHitProducerIdeal::Init(), PndSdsHitProducerIdeal::Init(), PndSciTHitProducerIdeal::Init(), PndEmcHitProducer::Init(), PndRecoMultiKalmanTask2::Init(), PndDrcHitProducerReal::Init(), PndDskFLGHitProducerIdeal::Init(), PndEmcTmpWaveformToDigi::Init(), PndDrcDigiTask::Init(), PndEmcWaveformToDigi::Init(), PndSttMatchTracks::Init(), PndEmcWaveformToCalibratedDigi::Init(), PndTrkTracking2::Init(), PndSttFindTracks::Init(), PndEmcMultiWaveformToCalibratedDigi::Init(), PndDrcTimeDigiTask::Init(), PndRecoKalmanTask2::Init(), PndEmcExpClusterSplitter::Init(), PndSdsNoiseProducer::Init(), PndFtsHoughTrackerTask::Init(), PndEmcPhiBumpSplitter::Init(), PndSdsHybridHitProducer::Init(), PndSdsIdealRecoTask::Init(), PndRecoMultiKalmanTask::Init(), PndSdsIdealClusterTask::Init(), PndRecoKalmanTask::Init(), PndSdsStripHitProducerDif::Init(), PndSdsStripHitProducer::Init(), PndGemDigitize::Init(), PndGemFindHits::Init(), PndSdsPixelClusterTask::Init(), PndSdsStripClusterTask::Init(), PndMvdGemTrackFinderOnHits::Init(), PndBarrelTrackFinder::Init(), PndEmcFullDigiTask::PndEmcFullDigiTask(), PndEmcMakeBump::PndEmcMakeBump(), PndUnassignedHitsTask::RegisterBranches(), PndMvdClusterTask::SetPersistance(), PndMvdDigiTask::SetPersistance(), PndEmcMakeBump::SetStorageOfData(), and PndEmcFullDigiTask::StoreDigi().

32 { return fPersistency; }
FairTask * PndMasterTask::GetTask ( Int_t  nTask)
inherited

Return the pointer to a single task.

This function allows to retrieve the pointer of a task inside the task list, when you want to use some particular setter or change someting in the task.

Parameters
nTaskIndex of the task you want to modify. Instead of the integer you can use the enum "k" + task name (i.e. kMvdDigiTask, kSttHitProducerRealFast, etc...)
Returns
A pointer to the corresponding task

Retrieve the pointer to a Task in the list

Definition at line 75 of file PndMasterTask.cxx.

76 {
77  TList* thistasks = this->GetListOfTasks();
78 
79  return ((FairTask*)thistasks->At(nTask));
80 }
InitStatus PndBlackBoxTask::Init ( )
virtualinherited

Reimplemented in PndMvdQATask, and PndBufferTestTask.

Definition at line 43 of file PndBlackBoxTask.cxx.

44 {
45  return kSUCCESS;
46 }
void PndMasterTask::PrintTaskList ( )
inherited

It prints the list of tasks.

Print the list of the task which are included in the list

This function print the task number, its title and its name. This can be important when it is needed to modify a particular task and the task number is needed. In any case, the use of enum should be preferred.

Remarks
The task names are not well defined in the classes, some of them are missing. We should define a better scheme.

Definition at line 24 of file PndMasterTask.cxx.

References counter, and next.

25 {
26  TList* thistasks = this->GetListOfTasks();
27 
28  Int_t counter = 0;
29  TIter next(thistasks->MakeIterator());
30  while (FairTask *task = (FairTask*)next())
31  {
32  if (counter < 10)
33  std::cout << "Task #" << counter << "\tTitle: " << task->GetTitle() << "\tName: " << task->GetName() << std::endl;
34  else
35  std::cout << "Task #" << counter << "\tTitle: " << task->GetTitle() << "\tName: " << task->GetName() << std::endl;
36  counter++;
37  }
38 
39  return;
40 }
int counter
Definition: ZeeAnalysis.C:59
static int next[96]
Definition: ranlxd.cxx:374
InitStatus PndBlackBoxTask::ReInit ( )
virtualinherited

Definition at line 25 of file PndBlackBoxTask.cxx.

26 {
27  return kSUCCESS;
28 }
void PndBlackBoxTask::SetParContainers ( )
virtualinherited

Reimplemented in PndMvdQATask.

Definition at line 21 of file PndBlackBoxTask.cxx.

22 {
23 }
void PndMasterMultiPidTask::SetPersistency ( Bool_t  pers = kTRUE)
virtual

Set the persistency of all the tasks.

Parameters
persPersistency level: 0 no TCA, 1 all TCA

Set the Persistency of all the tasks in the same way

Reimplemented from PndMasterTask.

Definition at line 196 of file PndMasterMultiPidTask.cxx.

Referenced by PndMasterRunAna::AddPidTasks().

197 {
198  if (!pers) LOG(INFO) << "It makes no sense to have pid persistency switched OFF!" << FairLogger::endl;
199  if (!pers) LOG(INFO) << "Or, if you prefer... this functionality has not been implemented yet" << FairLogger::endl;
200 
201  return;
202 }
void PndMasterTask::SetVerbose ( Int_t  iVerbose = 1)
inherited

Set the Verbosity to all the tasks.

Parameters
iVerboseVerbosity level: 0 no messages, the higher more messages

Set the Verbosity of all the tasks at the same number

Definition at line 43 of file PndMasterTask.cxx.

References next.

Referenced by PndMasterDigiOnlyTask::PndMasterDigiOnlyTask(), PndMasterDigiTask::PndMasterDigiTask(), PndMasterLocalRecoTask::PndMasterLocalRecoTask(), PndMasterMultiPidTask(), PndMasterPidTask::PndMasterPidTask(), PndMasterRecoIdealTask::PndMasterRecoIdealTask(), PndMasterRecoTask::PndMasterRecoTask(), PndMasterSimTask::PndMasterSimTask(), and PndMasterTask::SetVerbose().

44 {
45  TList* thistasks = this->GetListOfTasks();
46 
47  TIter next(thistasks->MakeIterator());
48  while (FairTask *task = (FairTask*)next())
49  {
50  task->SetVerbose(iVerbose);
51  }
52 
53  return;
54 }
Int_t iVerbose
static int next[96]
Definition: ranlxd.cxx:374
void PndMasterTask::SetVerbose ( Int_t  nTask,
Int_t  iVerbose 
)
inherited

Set the Verbosity to a single task.

This function has to be used when you want to change the verbosity to a single task

Parameters
nTaskIndex of the task you want to modify. Instead of the integer you can use the enum k + task name (i.e. kMvdDigiTask, hSttHitProducerRealFast
iVerboseVerbosity. 0 -> no messages; the higher -> more messages

Set the Verbosity of a single task

Definition at line 57 of file PndMasterTask.cxx.

References PndMasterTask::SetVerbose().

58 {
59  TList* thistasks = this->GetListOfTasks();
60  ((FairTask*)thistasks->At(nTask))->SetVerbose(iVerbose);
61 
62  return;
63 }
void SetVerbose(Int_t iVerbose=1)
Set the Verbosity to all the tasks.
Int_t iVerbose

Member Data Documentation

std::vector<PndPersistencyTask*> PndMasterTask::fBranchTasks
protectedinherited
std::map<PndPersistencyTask*, bool> PndMasterTask::fFixedPersistency
protectedinherited
std::array<Bool_t,5> PndMasterMultiPidTask::fHypoFlag
private

Definition at line 74 of file PndMasterMultiPidTask.h.

Referenced by PndMasterMultiPidTask().

TString PndMasterMultiPidTask::fOptions
private

Options parsed to the pid.

Definition at line 73 of file PndMasterMultiPidTask.h.

Referenced by PndMasterMultiPidTask().

std::array<pidTaskList,5> PndMasterMultiPidTask::fPidTasks
private

Definition at line 70 of file PndMasterMultiPidTask.h.

Referenced by PndMasterMultiPidTask().

std::vector<FairTask*> PndMasterTask::fStandardTasks
protectedinherited

Definition at line 81 of file PndMasterTask.h.

Referenced by PndMasterPidTask::PndMasterPidTask().


The documentation for this class was generated from the following files: