22#include <TClonesArray.h>
53 , fSensorArray(nullptr)
57 , foutputHits(nullptr)
58 , foutputDigis(nullptr)
59 , foutputCluster(nullptr)
61 foutputDigiMatchs(nullptr)
62 , foutputHitMatchs(nullptr)
63 , fcurrentEvent(nullptr)
68 , fSensorArrayFilled(kFALSE)
75 Fatal(GetName(),
" - Do not use standard constructor");
83 , fSensorArray(new TClonesArray(
"CbmMvdSensor", 10))
87 , foutputHits(nullptr)
88 , foutputDigis(nullptr)
89 , foutputCluster(nullptr)
91 foutputDigiMatchs(nullptr)
92 , foutputHitMatchs(nullptr)
93 , fcurrentEvent(nullptr)
98 , fSensorArrayFilled(kFALSE)
102 , fParameter(nullptr)
106 Fatal(GetName(),
" - Error, singleton does already exist.");
124 Int_t sensorNr, Int_t volumeId, Double_t sensorStartTime, Int_t stationNr)
135 Fatal(GetName(),
" - Error, must add all sensors before adding plugins.");
144 new ((*fSensorArray)[nSensors])
145 CbmMvdSensor(myname, sensorData, fullName, nodeName, sensorNr, volumeId, sensorStartTime);
160 Float_t misalignment[3], randArray[3];
162 gRandom->RndmArray(3, randArray);
163 misalignment[0] = ((2 * randArray[0]) - 1) *
fepsilon[0];
164 misalignment[1] = ((2 * randArray[0]) - 1) *
fepsilon[1];
165 misalignment[2] = ((2 * randArray[0]) - 1) *
fepsilon[2];
167 LOG(debug1) <<
"new sensor " << myname <<
" to detector added at station: " << stationNr;
179 <<
"CbmMvdDetector::DetectPlugin: You tried to access sensor plugins while the detector is not initialized yet.";
185 Int_t nPlugin = pluginArray->GetEntries();
186 for (Int_t i = 0; i < nPlugin; i++) {
210 foutput =
new TClonesArray(
"CbmMvdPoint", 1000);
219 if (nSensors <= 0) LOG(fatal) <<
"CbmMvdDetector could not load Sensors from Geometry!";
222 for (Int_t j = 0; j < nSensors; j++) {
225 LOG(debug1) <<
"Init Sensor " << sensor->GetName();
240 for (Int_t j = 0; j < nSensors; j++) {
272 for (Int_t i = 0; i < nSensors; i++) {
300 for (Int_t i = 0; i < nSensors; i++) {
302 sensor->
Exec(nLevel);
327 for (Int_t i = 0; i < nSensors; i++) {
338 TClonesArray* tmpArray;
341 for (Int_t i = 0; i < nSensors; i++) {
344 Int_t length = tmpArray->GetEntriesFast();
347 outputArray->AbsorbObjects(tmpArray);
357 TClonesArray* tmpArray;
360 for (Int_t i = 0; i < nSensors; i++) {
363 Int_t length = tmpArray->GetEntriesFast();
366 matchArray->AbsorbObjects(tmpArray);
398 TH1* mySummedHistogram = (TH1*) ((sensor->
GetHistogram(nPlugin, nHistogram))->Clone());
400 for (Int_t i = 1; i <
fSensorArray->GetEntriesFast(); i++) {
402 mySummedHistogram->Add((TH1*) sensor->
GetHistogram(nPlugin, nHistogram));
405 return mySummedHistogram;
420 for (Int_t i = 0; i < nSensors; i++) {
ClassImp(CbmConverterManager)
Helper class to extract information from the GeoManager. Addapted from TrdGeoHandler byFlorian Uhlig ...
int32_t DetectorId(int32_t iStation) const
virtual ~CbmMvdDetector()
TH1 * GetHistogram(UInt_t nPlugin, UInt_t nHistogramNumber)
TClonesArray * foutputDigis
void AddSensor(TString clearName, TString fullName, TString nodeName, CbmMvdSensorDataSheet *sensorData, Int_t sensorNr, Int_t volumeId, Double_t sensorStartTime, Int_t stationNr)
void ExecFrom(UInt_t nLevel)
UInt_t GetMaxHistoNumber(UInt_t nPlugin)
static CbmMvdDetector * Instance()
Int_t DetectPlugin(Int_t pluginID)
CbmMvdSensor * GetSensor(Int_t nSensor)
static CbmMvdDetector * fInstance
void SendInputToSensorPlugin(Int_t detectorid, Int_t nPlugin, TObject *input)
std::map< int, CbmMvdSensor * > fSensorMap
static CbmMvdSensorTyp fSensorTyp
TClonesArray * foutputCluster
TClonesArray * fcurrentEvent
void GetOutputArray(Int_t nPlugin, TClonesArray *outputArray)
TClonesArray * foutputDigiMatchs
void GetMatchArray(Int_t nPlugin, TClonesArray *matchArray)
Bool_t fSensorArrayFilled
TClonesArray * fSensorArray
TClonesArray * foutputHits
void Init(Bool_t isSimulation=kFALSE)
void SetSensorTyp(CbmMvdSensorTyp typ)
virtual Int_t GetPluginIDNumber()
TClonesArray * GetMatchArray(Int_t nPlugin) const
UInt_t GetNumberOfHistograms(UInt_t nPlugin)
void SetMisalignment(Float_t misalignment[3])
TH1 * GetHistogram(UInt_t nPlugin, UInt_t nHisto)
void SetDataSheet(CbmMvdSensorDataSheet *sheet)
void SetStation(Int_t StationNumber)
void SendInputToPlugin(Int_t nPlugin, TObject *input)
TObjArray * GetPluginArray()
UInt_t GetPluginArraySize()
void Exec(UInt_t nPlugin)
void ExecFrom(UInt_t nPlugin)
TClonesArray * GetOutputArray(Int_t nPlugin) const