43{
44 MuFilter* MuFilterDet =
dynamic_cast<MuFilter*
> (gROOT->GetListOfGlobals()->FindObject(
"MuFilter"));
45
48
50
51 Float_t attLength=0;
52 Float_t siPMcalibration=0;
53 Float_t siPMcalibrationS=0;
54 Float_t propspeed =0;
55 if (floor(detID/10000)==3) {
56 if (
nSides==2){attLength = MuFilterDet->
GetConfParF(
"MuFilter/DsAttenuationLength");}
57 else {attLength = MuFilterDet->
GetConfParF(
"MuFilter/DsTAttenuationLength");}
58 siPMcalibration = MuFilterDet->
GetConfParF(
"MuFilter/DsSiPMcalibration");
59 propspeed = MuFilterDet->
GetConfParF(
"MuFilter/DsPropSpeed");
60 }
61 else {
62 if (floor(detID/10000)==1 &&
nSides==1){
63
64 attLength = 2*MuFilterDet->
GetConfParF(
"MuFilter/VandUpAttenuationLength");
65 }
66 else {attLength = MuFilterDet->
GetConfParF(
"MuFilter/VandUpAttenuationLength");}
67 siPMcalibration = MuFilterDet->
GetConfParF(
"MuFilter/VandUpSiPMcalibration");
68 siPMcalibrationS = MuFilterDet->
GetConfParF(
"MuFilter/VandUpSiPMcalibrationS");
69 propspeed = MuFilterDet->
GetConfParF(
"MuFilter/VandUpPropSpeed");
70 }
71
72 for (
unsigned int j=0;
j<16; ++
j){
75 }
76 LOG(DEBUG) <<
"detid "<<detID<<
" size "<<
nSiPMs<<
" side "<<
nSides;
77
79 Float_t signalLeft = 0;
80 Float_t signalRight = 0;
81 Float_t earliestToAL = 1E20;
82 Float_t earliestToAR = 1E20;
83 for(
auto p = std::begin(V);
p!= std::end(V); ++
p) {
84
85 Double_t
signal = (*p)->GetEnergyLoss();
86
87
88 TVector3 vLeft,vRight;
89 TVector3 impact((*p)->GetX(),(*p)->GetY() ,(*p)->GetZ() );
91 Double_t distance_Left = (vLeft-impact).Mag();
92 Double_t distance_Right = (vRight-impact).Mag();
93
94 signalLeft+=
signal/
nSides*TMath::Exp(-distance_Left/attLength);
95 signalRight+=
signal/
nSides*TMath::Exp(-distance_Right/attLength);
96
97
98 Double_t ptime = (*p)->GetTime();
99 Double_t t_Left = ptime + distance_Left/propspeed;
100 Double_t t_Right = ptime + distance_Right/propspeed;
101 if ( t_Left <earliestToAL){earliestToAL = t_Left ;}
102 if ( t_Right <earliestToAR){earliestToAR = t_Right ;}
103 }
104
105
106 for (
unsigned int j=0;
j<
nSiPMs; ++
j){
107 if ( floor(detID/10000)==2 && (j==2 or j==5)){
109 times[
j] = gRandom->Gaus(earliestToAL, timeResol);
110 }else{
112 times[
j] = gRandom->Gaus(earliestToAL, timeResol);
113 }
116 times[
j+
nSiPMs] = gRandom->Gaus(earliestToAR, timeResol);
117 }
118 }
121 LOG(DEBUG) << "signal created";
122}
Int_t GetnSides(Int_t detID)
void GetPosition(Int_t id, TVector3 &vLeft, TVector3 &vRight)
Int_t GetnSiPMs(Int_t detID)
Float_t GetConfParF(TString name)
Int_t fDetectorID
Detector unique identifier.
Int_t nSides
number of SiPMs per side