9 #include "ERBeamDetDigitizer.h" 12 #include "TGeoMatrix.h" 16 #include "FairRootManager.h" 17 #include "FairRuntimeDb.h" 18 #include "FairLogger.h" 20 #include "ERBeamDetSetup.h" 21 #include "ERDetectorList.h" 22 #include "ERSupport.h" 39 FairRootManager* ioman = FairRootManager::Instance();
40 if (!ioman) Fatal(
"Init",
"No FairRootManager");
44 Fatal(
"Init",
"Can`t find collection BeamDetToFPoint!");
46 Fatal(
"Init",
"Can`t find collection BeamDetMWPCPoint!");
48 fBeamDetToFDigi1 =
new TClonesArray(
"ERDigi", consts::approx_beamdet_tof_digi_number);
49 fBeamDetToFDigi2 =
new TClonesArray(
"ERDigi", consts::approx_beamdet_tof_digi_number);
50 fBeamDetMWPCDigiX1 =
new TClonesArray(
"ERDigi", consts::approx_beamdet_mwpc_digi_number);
51 fBeamDetMWPCDigiX2 =
new TClonesArray(
"ERDigi", consts::approx_beamdet_mwpc_digi_number);
52 fBeamDetMWPCDigiY1 =
new TClonesArray(
"ERDigi", consts::approx_beamdet_mwpc_digi_number);
53 fBeamDetMWPCDigiY2 =
new TClonesArray(
"ERDigi", consts::approx_beamdet_mwpc_digi_number);
54 ioman->Register(
"BeamDetToFDigi1",
"BeamDetToF Digi",
fBeamDetToFDigi1, kTRUE );
55 ioman->Register(
"BeamDetToFDigi2",
"BeamDetToF Digi",
fBeamDetToFDigi2, kTRUE);
56 ioman->Register(
"BeamDetMWPCDigiX1",
"BeamDetMWPC x1 Digi",
fBeamDetMWPCDigiX1, kTRUE);
57 ioman->Register(
"BeamDetMWPCDigiX2",
"BeamDetMWPC x2 Digi",
fBeamDetMWPCDigiX2, kTRUE);
58 ioman->Register(
"BeamDetMWPCDigiY1",
"BeamDetMWPC y1 Digi",
fBeamDetMWPCDigiY1, kTRUE);
59 ioman->Register(
"BeamDetMWPCDigiY2",
"BeamDetMWPC y2 Digi",
fBeamDetMWPCDigiY2, kTRUE);
65 map<Int_t, vector<Int_t>> pointsToF;
68 pointsToF[point->GetToFNb()].push_back(iPoint);
70 map<Int_t, vector<Int_t> >::iterator itPlate;
71 vector<Int_t>::iterator itToFPoint;
72 for(itPlate = pointsToF.begin(); itPlate != pointsToF.end(); ++itPlate){
74 Float_t time = numeric_limits<float>::max();
75 for (itToFPoint = itPlate->second.begin(); itToFPoint != itPlate->second.end(); ++itToFPoint){
77 edep += point->GetEnergyLoss();
79 if (point->GetTime() < time){
80 time = point->GetTime();
91 itToFPoint = itPlate->second.begin();
97 map<Int_t, map<Int_t, map<Int_t, vector<Int_t>>>> points;
100 points[point->GetMWPCNb()][point->GetPlaneNb()][point->GetWireNb()].push_back(iPoint);
102 for (
auto& mwpc_points : points) {
103 const auto mwpc_nb = mwpc_points.first;
104 for (
auto& plane_points : mwpc_points.second) {
105 const auto plane_nb = plane_points.first;
106 for(
auto& wire_points : plane_points.second) {
107 const auto wire_nb = wire_points.first;
109 float time = numeric_limits<float>::max();
110 for (
auto& point_nb : wire_points.second) {
112 edep += point->GetEnergyLoss();
113 if (point->GetTime() < time){
114 time = point->GetTime();
121 ERDigi *digi =
AddMWPCDigi(edep, time, mwpc_nb, plane_nb, static_cast<ERChannel>(wire_nb));
140 collection->Delete();
145 Int_t planeNb, ERChannel wireNb) {
150 ERDigi(edep, time, wireNb);
153 ERDigi(edep, time, wireNb);
159 ERDigi(edep, time, wireNb);
162 ERDigi(edep, time, wireNb);
Float_t fToFElossThreshold
energy losses thershold in ToF
Class for convertion simulation data to format like real detector data.
Float_t fElossSigmaOverElossToF
parameter of spreading energy losses
ERDigi * AddToFDigi(float edep, float time, int tofNb)
Adds a digi to the output Collections.
TClonesArray * fBeamDetToFPoints
input collection of ToF points
virtual void Exec(Option_t *opt)
Defines the transformation actions for all input data (Point) to output data (Digi) for each event...
virtual InitStatus Init()
virtual InitStatus Init()
Defines all input and output object colletions participates in digitization.
Float_t fMWPCElossThreshold
energy losses thershold in MWPC
Float_t fElossSigmaToF
standart deviation of energy losses in ToF
ERDigi * AddMWPCDigi(float edep, float time, int mwpcNb, int planeNb, ERChannel wireNb)
Adds a digi to the output Collections.
Bool_t fSigmaEOverEToFIsSet
true if SetToFElossSigmaOverEloss is set
virtual void Reset()
Resets all output data.
Float_t fElossSigmaMWPC
standart deviation of energy losses in MWPC
TClonesArray * fBeamDetMWPCPoints
input collection of MWPC points
TClonesArray * fBeamDetMWPCDigiY1
output collection of Digi in second gas strip array in first MWPC station
TClonesArray * fBeamDetToFDigi1
output collection of Digi in first plastic
TClonesArray * fBeamDetMWPCDigiY2
output collection of Digi in second gas strip array in second MWPC station
Float_t fTimeSigmaToF
standart deviation of time in ToF
Float_t fTimeSigmaMWPC
standart deviation of time in MWPC
ERBeamDetDigitizer()
Default constructor.
TClonesArray * fBeamDetMWPCDigiX1
output collection of Digi in first gas strip array in first MWPC station
TClonesArray * fBeamDetMWPCDigiX2
output collection of Digi in first gas strip array in second MWPC station
TClonesArray * fBeamDetToFDigi2