CbmRoot
CbmMvdReadout.cxx
Go to the documentation of this file.
1 // -------------------------------------------------------------------------
2 // ----- CbmMvdClusterfinder source file -----
3 // -------------------------------------------------------------------------
4 
5 // Includes from MVD
6 #include "CbmMvdReadout.h"
7 #include "CbmMvdDetector.h"
9 
10 // Includes from FAIR
11 #include "FairModule.h"
12 #include "FairRootManager.h"
13 
14 // Includes from ROOT
15 #include "TClonesArray.h"
16 
17 #include "CbmDigiManager.h"
18 
19 
20 // Includes from C++
21 #include <iomanip>
22 #include <iostream>
23 
24 
25 using std::cout;
26 using std::endl;
27 
28 // ----- Default constructor ------------------------------------------
29 CbmMvdReadout::CbmMvdReadout() : CbmMvdReadout("MVDClusterfinder") {}
30 // -------------------------------------------------------------------------
31 
32 // ----- Standard constructor ------------------------------------------
34  : FairTask(name)
35  , fMode(-1)
36  , fPluginNr(0)
37  , fShowDebugHistos(kFALSE)
38  , fDetector(nullptr)
39  , fDigiMan(nullptr) {}
40 // -------------------------------------------------------------------------
41 
42 // ----- Destructor ----------------------------------------------------
44 // -----------------------------------------------------------------------------
45 
46 // ----- Exec --------------------------------------------------------------
47 void CbmMvdReadout::Exec(Option_t* /*opt*/) {
48 
50  if (fVerbose) cout << "//----------------------------------------//";
51  if (fVerbose) cout << endl << "Send Input" << endl;
53  if (fVerbose) cout << "Execute ReadoutPlugin Nr. " << fPluginNr << endl;
55  if (fVerbose) cout << "End Chain" << endl;
56  }
57 }
58 // -----------------------------------------------------------------------------
59 
60 // ----- Init --------------------------------------------------------------
61 InitStatus CbmMvdReadout::Init() {
62  cout << "-I- " << GetName() << ": Initialisation..." << endl;
63  cout << endl;
64  cout << "---------------------------------------------" << endl;
65  cout << "-I- Initialising " << GetName() << " ...." << endl;
66 
67  // ********** RootManager
68  FairRootManager* ioman = FairRootManager::Instance();
69  if (!ioman) {
70  cout << "-E- " << GetName() << "::Init: No FairRootManager!" << endl;
71  return kFATAL;
72  }
73 
74  // ********** Get input arrays
76  fDigiMan->Init();
77 
79  LOG(error) << "No MvdDigi branch found. There was no MVD in the "
80  "simulation. Switch this task off";
81  return kERROR;
82  }
83 
85 
86  if (fDetector->GetSensorArraySize() > 1) {
87  if (fVerbose)
88  cout << endl << "-I- succesfully loaded Geometry from file -I-" << endl;
89  } else {
90  LOG(fatal)
91  << "Geometry couldn't be loaded from file. No MVD digitizer available.";
92  }
93 
95 
96  fDetector->AddPlugin(readerTask);
97  fPluginNr = (UInt_t)(fDetector->GetPluginArraySize());
98  fDetector->Init();
99 
100 
101  // Screen output
102  cout << GetName() << " initialised with parameters: " << endl;
103  //PrintParameters();
104  cout << "---------------------------------------------" << endl;
105 
106 
107  return kSUCCESS;
108 }
109 
110 // ----- Virtual public method Reinit ----------------------------------
111 InitStatus CbmMvdReadout::ReInit() { return kSUCCESS; }
112 // -------------------------------------------------------------------------
113 
114 
115 // ----- Virtual method Finish -----------------------------------------
117  fDetector->Finish();
118  PrintParameters();
119 }
120 // -------------------------------------------------------------------------
121 
122 
123 // ----- Private method Reset ------------------------------------------
125  // fCluster->Delete();
126 }
127 // -------------------------------------------------------------------------
128 
129 // ----- Private method PrintParameters --------------------------------
131 
132  //cout.setf(ios_base::fixed, ios_base::floatfield);
133  cout << "============================================================"
134  << endl;
135  cout << "============== Parameters Readout ===== ===================="
136  << endl;
137  cout << "============================================================"
138  << endl;
139  cout << "=============== End Task ==================================="
140  << endl;
141 }
142 // -------------------------------------------------------------------------
143 
144 
CbmMvdDetector::Instance
static CbmMvdDetector * Instance()
Definition: CbmMvdDetector.cxx:47
CbmMvdReadout::Reset
void Reset()
Definition: CbmMvdReadout.cxx:124
CbmMvdSensorReadoutTask.h
CbmMvdDetector.h
CbmMvdDetector::Exec
void Exec(UInt_t nLevel)
Definition: CbmMvdDetector.cxx:527
CbmMvdDetector::GetPluginArraySize
UInt_t GetPluginArraySize()
Definition: CbmMvdDetector.h:71
CbmDigiManager::Init
InitStatus Init()
Initialisation.
Definition: CbmDigiManager.cxx:71
CbmMvdReadout
Definition: CbmMvdReadout.h:16
CbmMvdDetector::Init
void Init()
Definition: CbmMvdDetector.cxx:278
CbmMvdDetector::Finish
void Finish()
Definition: CbmMvdDetector.cxx:705
ClassImp
ClassImp(CbmMvdReadout)
ECbmModuleId::kMvd
@ kMvd
Micro-Vertex Detector.
CbmMvdReadout::PrintParameters
void PrintParameters() const
Definition: CbmMvdReadout.cxx:130
CbmDigiManager::GetNofDigis
static Int_t GetNofDigis(ECbmModuleId systemId)
Definition: CbmDigiManager.cxx:62
CbmMvdSensorReadoutTask
Definition: CbmMvdSensorReadoutTask.h:25
CbmDigiManager::IsPresent
static Bool_t IsPresent(ECbmModuleId systemId)
Presence of a digi branch.
Definition: CbmDigiManager.cxx:112
CbmMvdReadout::Finish
virtual void Finish()
Definition: CbmMvdReadout.cxx:116
CbmDigiManager::Instance
static CbmDigiManager * Instance()
Static instance.
Definition: CbmDigiManager.h:93
CbmMvdReadout::~CbmMvdReadout
~CbmMvdReadout()
Definition: CbmMvdReadout.cxx:43
CbmMvdDetector::SendInputDigis
void SendInputDigis(CbmDigiManager *digiMan)
Definition: CbmMvdDetector.cxx:373
CbmMvdReadout::fDigiMan
CbmDigiManager * fDigiMan
Definition: CbmMvdReadout.h:43
CbmMvdReadout.h
CbmMvdReadout::ReInit
virtual InitStatus ReInit()
Definition: CbmMvdReadout.cxx:111
fDigiMan
CbmDigiManager * fDigiMan
Definition: CbmTofAnaTestbeam.cxx:88
CbmMvdReadout::fPluginNr
Int_t fPluginNr
Definition: CbmMvdReadout.h:40
CbmMvdDetector::GetSensorArraySize
Int_t GetSensorArraySize()
Definition: CbmMvdDetector.h:70
CbmDigiManager.h
CbmMvdReadout::fDetector
CbmMvdDetector * fDetector
Definition: CbmMvdReadout.h:42
CbmMvdReadout::Exec
void Exec(Option_t *opt)
Definition: CbmMvdReadout.cxx:47
CbmMvdReadout::CbmMvdReadout
CbmMvdReadout()
Definition: CbmMvdReadout.cxx:29
CbmMvdDetector::AddPlugin
void AddPlugin(CbmMvdSensorPlugin *plugin)
Definition: CbmMvdDetector.cxx:186
CbmMvdReadout::Init
virtual InitStatus Init()
Definition: CbmMvdReadout.cxx:61