94 #include "TMatrixDEigen.h"
104 :CDist(), CDistC(), CNele(), CNeleT(), TeleTime(), AmplSig(),Pulse(), PulseT(), WDist(),
105 Wi(0), ArPerc(0), CO2Perc(0), CH4Perc(0), ArWPerc(0), CO2WPerc(0), CH4WPerc(0), pSTP(0), Radius(0),
106 AAr(0), ZAr(0), RhoAr(0), NclAr(0), EmedAr(0), EminAr(0), EmpAr(0), CsiAr(0), IAr(0), WiAr(0), Ncl(0),
107 Ecl(0), Lcl(0), Ntote(0), GasGain(0), Cutoff(0),
108 EmedCO2(0), EminCO2(0), EmpCO2(0), CsiCO2(0), ACO2(0), ZCO2(0), RhoCO2(0), ICO2(0), WiCO2(0), NclCO2(0),
109 EmedCH4(0), EmpCH4(0), CsiCH4(0), EminCH4(0), ACH4(0), ZCH4(0), RhoCH4(0), ICH4(0), WiCH4(0), NclCH4(0),
110 RhoMixCO2(0), RhoMixCH4(0), PZeta(0), piMass(0), PMass(0), PMom(0), Dx(0), eMass(0), prMass(0), Delta(0),
111 CNumb(0), PEn(0), beta(0), gamma(0), Emed(0), Emin(0), Csi(0), Emax(0), Emp(0), NNClus(0),
112 Xin(0), Yin(0), Zin(0), Xout(0), Yout(0), Zout(0), Rpath(0), NPolya(0), Xmax(0), bPolya(0),
113 Calpha(0), Cbeta(0), Cgamma(0),
114 NUrban(0), SigUrb(0), Eup(0), AvUrb(0), Wx1(0), Wy1(0), Wz1(0), Wx2(0), Wy2(0), Wz2(0),
115 Wp(0), Wq(0), Wr(0), PulseMax(0), PulseTime(0), Thresh1(0), Thresh2(0), Nchann(0), Out1(0), Out2(0), Out3(0)
123 memset(
Xs,0,
sizeof(
Xs));
161 {0., .802, .0707, .020, .013, .008, .006, .005, .006,
162 .008, .009, .007, .0050, .0040, .0033, .0029, .0025,
182 {0., .730, .162, .038, .020, .0110, .0147, .0060, .0084,
183 .0052, .0020, .0042, .0021, .0025, .0038, .0021, .0009,
184 .00013, .00064, .00048};
256 for(Int_t
i=1;
i<=20;
i++) {
263 for(Int_t
i=0;
i<=19;
i++) {
267 for(Int_t
i=0;
i<=20;
i++) {
296 Xin=InOut[0];
Yin=InOut[1];
Zin=InOut[2];
339 if(Xo <= Xst && Xst <= X1)
Delta = 4.6051702*Xst +Cs +as*pow(X1-Xst,ms);
340 else if(X1< Xst)
Delta = 4.6051702*Xst +Cs;
345 Emax = (1.022*begam*begam/(1.+2.*gamma*mratio+mratio*mratio))/1000.;
408 return gRandom->Landau(
Emp*
Dx,
Csi*Dx);
423 Double_t Sig1CO2, Sig2CO2, Sig3CO2, IMix, nAr, nCO2;
425 Double_t N1Mix, N2Mix, N3Mix, E1Mix, E2Mix, E3Mix, ZMix;
441 e2f = TMath::Power(e2,f2);
442 e1 = TMath::Power(
IAr/e2f,1./f1);
455 e2f = TMath::Power(e2,f2);
456 e1 = TMath::Power(
ICO2/e2f,1./f1);
475 E2Mix = 10.*ZMix*ZMix*eVGeV;
476 e2f = TMath::Power(E2Mix,f2);
477 E1Mix = TMath::Power(IMix/e2f,1./f1);
483 NUrban = Sig1Mix+Sig2Mix+Sig3Mix;
487 N1Mix = gRandom->Poisson(Sig1Mix);
488 N2Mix = gRandom->Poisson(Sig2Mix);
489 N3Mix = gRandom->Poisson(Sig3Mix);
494 for(Int_t j=1;j<=N3;j++){
495 E3Mix += ((
Emax+IMix)*IMix)/(IMix +
Emax*(1.-gRandom->Uniform()));
503 Sig22 = Sig21*
Eup - Medd*Medd;
504 Sig23 = Sig1Mix*E1Mix*E1Mix + Sig2Mix*E2Mix*E2Mix
505 + Sig3Mix*Medd*Medd + Sig3Mix*Sig22;
507 AvUrb = Sig1Mix*E1Mix + Sig2Mix*E2Mix + Sig3Mix*Medd;
515 return N1Mix*E1Mix + N2Mix*E2Mix + E3Mix;
529 Double_t TotEnEle = 0., ClusEner=0., Ecurr;
538 for(Int_t j=1;j<=
NNClus;j++){
555 for(Int_t k=1; k<=
NNClus; k++) {
556 for (Int_t kk=0; kk<(Int_t)
CNeleT.at(k-1); kk++) {
557 if(owfl > (Int_t)
Cutoff)
break;
563 return TotEnEle*1.e-09;
582 for(Int_t k=1; k<=1000; k++) {
589 CDist.push_back(path);
606 nelect= TMath::BinarySearch(21,
CumClus,gRandom->Uniform());
608 return Inelect = (Int_t) (nelect) +1;
612 return Inelect = (Int_t)(20./(1.03-gRandom->Uniform()));
629 if(1.<=gamma2 && gamma2 <= 2.2){
630 Rise = -2.159*lg +1.7;
632 else if(2.2<=gamma2 && gamma2 <= 6.){
635 else if(6.<=gamma2 && gamma2 <= 200.){
636 Rise = 0.302*lg + 0.765;
638 else if(200.<=gamma2 && gamma2 <= 1000.){
639 Rise = 0.1431*lg + 1.131;
641 else if(1000.<=gamma2){
666 PMax = eps * pow(k,k)*
exp(-k);
687 0.5*dx*(pow(x1,k)*
exp(-x1) + pow(x2,k)*
exp(-x2))/TMath::Gamma(k+1);
690 0.5*dx* pow(x2,k)*
exp(-x2)/TMath::Gamma(k+1);
770 Double_t difL = gRandom->Gaus(0.,SigL);
771 Double_t difT = gRandom->Gaus(0.,SigT);
775 XX += difL*cosx + difT*
Wp;
776 YY += difL*cosy + difT*
Wq;
777 ZZ += difL*cosz + difT*
Wr;
780 TVector3 TDist(XX,YY,ZZ);
816 Int_t ido =
WDist.size();
820 if(ido > (Int_t)
Cutoff) ido = (Int_t) Cutoff;
822 for(Int_t k=0; k<ido; k++) {
830 etime= -1.624e-05 + 0.1258*dst + 0.8079*pow(dst,2) -2.918*pow(dst,3)
831 + 10.33*pow(dst,4) -10.84*pow(dst,5);
835 etime= -6.763e-05 + 0.1471*dst +0.3625*pow(dst,2) +0.3876*pow(dst,3)
836 +1.04*pow(dst,4) -1.693*pow(dst,5);
841 etime= -0.0001014 + 0.1463*dst -0.1694*pow(dst,2) +2.4248*pow(dst,3)
866 if(x>0) elesig =pow(2.*x/10.,2)*
exp(-2.*x/10.);
896 for(Int_t j=0; j< neltot; j++){
901 for(Int_t j=0; j<
nsteps; j++){
904 for(Int_t
jj=0;
jj< neltot;
jj++){
909 Pulse.push_back(sumele);
917 for(Int_t k=0; k<(Int_t)
Pulse.size(); k++)
920 for(Int_t k=0; k<(Int_t)
Pulse.size(); k++){
921 Pulse.at(k) += 0.03*Pmax*gRandom->Uniform()
922 + 0.01*Pmax*(
sin(6.28*
PulseT.at(k)/120.));
951 for(Int_t k=0; k<(Int_t)
Pulse.size(); k++){
992 Double_t Modu =
sqrt( (Point[3]*Point[0])*(Point[3]*Point[0]) +
993 (Point[4]*Point[1])*(Point[4]*Point[1]) +
994 (Point[5]*Point[2])*(Point[5]*Point[2]) );
995 Double_t dcx = (Point[3]-Point[0])/Modu;
996 Double_t dcy = (Point[4]-Point[1])/Modu;
997 Double_t dcz = (Point[5]-Point[2])/Modu;
1005 (dcz*Wp-dcx*
Wr)*(dcz*Wp-dcx*Wr) +
1006 (dcx*Wq-dcy*Wp)*(dcx*Wq-dcy*Wp) );
1029 drift = -0.0140 -1.37281e-01
1031 +7.65443e-05*pow(time,2)
1032 -9.53479e-06*pow(time,3)
1033 +1.19432e-07*pow(time,4)
1034 -6.19861e-10*pow(time,5)
1035 +1.35458e-12*pow(time,6)
1036 -1.10933e-15*pow(time,7);
1044 drift = 0.0300 -1.07377e-01
1046 +1.20909e-03*pow(time,2)
1047 -4.56678e-05*pow(time,3)
1048 +6.70207e-07*pow(time,4)
1049 -4.99204e-09*pow(time,5)
1050 +2.19079e-11*pow(time,6)
1051 -8.01791e-14*pow(time,7)
1052 +2.16778e-16*pow(time,8);
1056 drift = 0.0300 -8.91701e-01
1058 +1.00902e-03*pow(time,2)
1059 -4.00359e-05*pow(time,3)
1060 +6.23768e-07*pow(time,4)
1061 -5.20556e-09*pow(time,5)
1062 +2.41502e-11*pow(time,6)
1063 -5.85450e-14*pow(time,7)
1064 +5.77250e-17*pow(time,8);
1075 drift = -0.0300 +1.28551e-02
1077 -3.67834e-03*pow(time,2)
1078 +3.32034e-04*pow(time,3)
1079 -6.36592e-06*pow(time,4)
1080 -7.82907e-08*pow(time,5)
1081 +3.58931e-09*pow(time,6)
1082 -2.93491e-11*pow(time,7) ;
1098 else if(50. < time && time < 130.) {
1103 drift = -0.0190 +4.40993e-01
1105 +3.06237e-03*pow(time,2)
1106 -6.07870e-05*pow(time,3)
1107 +5.97431e-07*pow(time,4)
1108 -3.09238e-09*pow(time,5)
1109 +7.70537e-12*pow(time,6)
1110 -6.49086e-15*pow(time,7) ;
1130 drift = -0.0100 +4.28757e-01
1132 +3.02333e-03*pow(time,2)
1133 -6.13920e-05*pow(time,3)
1134 +5.93656e-07*pow(time,4)
1135 -3.05271e-09*pow(time,5)
1136 +8.05446e-12*pow(time,6)
1137 -8.59626e-15*pow(time,7) ;
1155 if(drift < 0.) drift=0.;
1168 TInit(xPMass, xPMom, InOut);
1184 for(Int_t j=1; j<=
NNClus; j++){
1186 for(Int_t jc=1; jc<=(Int_t)
CNeleT[j-1]; jc++)
1205 Int_t NtotEle = (Int_t) (1.e+09 *
STUrban()/
Wi);
1207 for(Int_t j=1; j<= NtotEle; j++){
1233 resmic = 1.24506e+02 -1.80117e+02*TrueDcm
1234 +3.76905e+03*pow(TrueDcm,2) -4.63251e+04*pow(TrueDcm,3)
1235 +1.80068e+05*pow(TrueDcm,4) -2.21094e+05*pow(TrueDcm,5);
1242 resmic = 1.53656e+02
1243 -5.07749e+03*TrueDcm
1244 +1.73707e+05*pow(TrueDcm,2)
1245 -2.72285e+06*pow(TrueDcm,3)
1246 +2.28719e+07*pow(TrueDcm,4)
1247 -1.12921e+08*pow(TrueDcm,5)
1248 +3.39427e+08*pow(TrueDcm,6)
1249 -6.12741e+08 *pow(TrueDcm,7)
1250 +6.12041e+08 *pow(TrueDcm,8)
1251 -2.60444e+08*pow(TrueDcm,9) ;
1262 resmic = +1.06966e+02
1263 -4.03073e+03 *TrueDcm
1264 +1.60851e+05 *pow(TrueDcm,2)
1265 -2.87722e+06 *pow(TrueDcm,3)
1266 +2.67581e+07 *pow(TrueDcm,4)
1267 -1.43397e+08 *pow(TrueDcm,5)
1268 +4.61046e+08 *pow(TrueDcm,6)
1269 -8.79170e+08 *pow(TrueDcm,7)
1270 +9.17095e+08 *pow(TrueDcm,8)
1271 -4.03253e+08 *pow(TrueDcm,9) ;
1278 resmic = 20. +1.48048e+02
1279 -3.35951e+02*TrueDcm
1280 -1.87575e+03*pow(TrueDcm,2)
1281 +1.92910e+04*pow(TrueDcm,3)
1282 -6.90036e+04*pow(TrueDcm,4)
1283 +1.07960e+05*pow(TrueDcm,5)
1284 -5.90064e+04*pow(TrueDcm,6) ;
1291 Double_t rsim = gRandom->Gaus(TrueDcm, resmic*0.0001);
1292 if (rsim<0.) rsim = TrueDcm - TrueDcm*gRandom->Uniform(0.,1.);
1293 else if (rsim>0.5) rsim = TrueDcm + (0.5-TrueDcm)*gRandom->Uniform(0.,1.);
1309 DiffMic = 0.896 + 1387.*Distcm - 1.888e+04*pow(Distcm,2)
1310 + 1.799e+05*pow(Distcm,3) - 9.848e+05*pow(Distcm,4)
1311 + 3.009e+06*pow(Distcm,5) - 4.777e+06*pow(Distcm,6)
1312 + 3.074e+06*pow(Distcm,7);
1316 DiffMic = 1.537 + 1246.*Distcm - 1.357e+04*pow(Distcm,2)
1317 + 1.049e+05*pow(Distcm,3) - 4.755e+05*pow(Distcm,4)
1318 + 1.211e+06*pow(Distcm,5) - 1.6e+06*pow(Distcm,6)
1319 + 8.533e+05*pow(Distcm,7);
1325 DiffMic = 2.135 +818.*Distcm - 1.044e+04*pow(Distcm,2)
1326 + 8.31e+04*pow(Distcm,3) - 3.492e+05*pow(Distcm,4)
1327 + 7.959e+05*pow(Distcm,5) - 9.378e+05*pow(Distcm,6)
1328 + 4.492e+05*pow(Distcm,7);
1347 DiffMic = + 1.482 + 1529.*Distcm - 6755.*pow(Distcm,2)
1348 + 2.924e+04*pow(Distcm,3) - 0.9246e+05*pow(Distcm,4)
1349 + 1.548e+05*pow(Distcm,5) - 1.002e+05*pow(Distcm,6);
1353 DiffMic = + 1.482 + 1529.*Distcm - 6755.*pow(Distcm,2)
1354 + 2.924e+04*pow(Distcm,3) - 0.9246e+05*pow(Distcm,4)
1355 + 1.548e+05*pow(Distcm,5) - 1.002e+05*pow(Distcm,6);
1361 DiffMic = +2.094 + 1138.*Distcm - 7557.*pow(Distcm,2)
1362 + 2.968e+04*pow(Distcm,3) - 6.577e+04*pow(Distcm,4)
1363 + 7.581e+04*pow(Distcm,5) - 3.497e+04*pow(Distcm,6);
1384 drift = 0.001629 + 6.194*time
1385 - 56.55*pow(time,2) + 355.8*pow(time,3)
1386 - 903.2*pow(time,4);
1390 drift = 0.003365 + 5.734*time
1391 - 41.88*pow(time,2) + 191.2*pow(time,3)
1392 - 333.4*pow(time,4) ;
1400 drift = 0.003365 + 7.056*time
1401 - 62.28*pow(time,2) + 306.1*pow(time,3)
1402 - 558.7*pow(time,4);
std::vector< Double_t > TeleTime
Double_t DiffTran(Double_t distcm)
friend F32vec4 exp(const F32vec4 &a)
friend F32vec4 sqrt(const F32vec4 &a)
std::vector< Double_t > AmplSig
std::vector< Double_t > CDist
static T Sqrt(const T &x)
friend F32vec4 sin(const F32vec4 &a)
std::vector< Double_t > Pulse
std::vector< TVector3 > WDist
friend F32vec4 log(const F32vec4 &a)
void TInit(Double_t Mass, Double_t Momentum, Double_t InOut[])
std::vector< Double_t > PulseT
Double_t TimnsToDiscm(Double_t time)
Double_t RRise(Double_t gamma)
void TConst(Double_t Radius, Double_t pSTP, Double_t ArP, Double_t CO2P)
Double_t TrueDist(Double_t Point[])
double eps(TVector3 v1, TVector3 v2)
Double_t Signal(Double_t t, Double_t t0)
Double_t DistEle(Double_t tns)
TVector3 WDistCalc(Double_t d)
Double_t PartToTime(Double_t Mass, Double_t Momentum, Double_t InOut[])
void PutWireXYZ(Double_t w1, Double_t w2, Double_t w3, Double_t w4, Double_t w5, Double_t w6)
std::vector< Double_t > CNele
Int_t StrawSignal(Int_t nsteps)
Double_t FastRec(Double_t TrueDcm, Int_t Flag)
Double_t DiffLong(Double_t distcm)
void Polya(Double_t bpar)
std::vector< Double_t > CDistC
ClassImp(PndFtsSingleStraw)
std::vector< Double_t > CNeleT