42{
43 MuFilter* MuFilterDet =
dynamic_cast<MuFilter*
> (gROOT->GetListOfGlobals()->FindObject(
"MuFilter"));
44
47
49
50 Float_t attLength=0;
51 Float_t siPMcalibration=0;
52 Float_t siPMcalibrationS=0;
53 Float_t propspeed =0;
54 if (floor(detID/10000)==3) {
55 if (
nSides==2){attLength = MuFilterDet->
GetConfParF(
"MuFilter/DsAttenuationLength");}
56 else {attLength = MuFilterDet->
GetConfParF(
"MuFilter/DsTAttenuationLength");}
57 siPMcalibration = MuFilterDet->
GetConfParF(
"MuFilter/DsSiPMcalibration");
58 propspeed = MuFilterDet->
GetConfParF(
"MuFilter/DsPropSpeed");
59 }
60 else {
61 if (floor(detID/10000)==1 &&
nSides==1){
62
63 attLength = 2*MuFilterDet->
GetConfParF(
"MuFilter/VandUpAttenuationLength");
64 }
65 else {attLength = MuFilterDet->
GetConfParF(
"MuFilter/VandUpAttenuationLength");}
66 siPMcalibration = MuFilterDet->
GetConfParF(
"MuFilter/VandUpSiPMcalibration");
67 siPMcalibrationS = MuFilterDet->
GetConfParF(
"MuFilter/VandUpSiPMcalibrationS");
68 propspeed = MuFilterDet->
GetConfParF(
"MuFilter/VandUpPropSpeed");
69 }
70
71 for (
unsigned int j=0;
j<16; ++
j){
74 }
75 LOG(DEBUG) <<
"detid "<<detID<<
" size "<<
nSiPMs<<
" side "<<
nSides;
76
78 Float_t signalLeft = 0;
79 Float_t signalRight = 0;
80 Float_t earliestToAL = 1E20;
81 Float_t earliestToAR = 1E20;
82 for(
auto p = std::begin(V);
p!= std::end(V); ++
p) {
83
84 Double_t
signal = (*p)->GetEnergyLoss();
85
86
87 TVector3 vLeft,vRight;
88 TVector3 impact((*p)->GetX(),(*p)->GetY() ,(*p)->GetZ() );
90 Double_t distance_Left = (vLeft-impact).Mag();
91 Double_t distance_Right = (vRight-impact).Mag();
92
93 signalLeft+=
signal/
nSides*TMath::Exp(-distance_Left/attLength);
94 signalRight+=
signal/
nSides*TMath::Exp(-distance_Right/attLength);
95
96
97 Double_t ptime = (*p)->GetTime();
98 Double_t t_Left = ptime + distance_Left/propspeed;
99 Double_t t_Right = ptime + distance_Right/propspeed;
100 if ( t_Left <earliestToAL){earliestToAL = t_Left ;}
101 if ( t_Right <earliestToAR){earliestToAR = t_Right ;}
102 }
103
104
105 for (
unsigned int j=0;
j<
nSiPMs; ++
j){
106 if ( floor(detID/10000)==2 && (j==2 or j==5)){
108 times[
j] = gRandom->Gaus(earliestToAL, timeResol);
109 }else{
111 times[
j] = gRandom->Gaus(earliestToAL, timeResol);
112 }
115 times[
j+
nSiPMs] = gRandom->Gaus(earliestToAR, timeResol);
116 }
117 }
120 LOG(DEBUG) << "signal created";
121}
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