5 #include "CLHEP/Units/PhysicalConstants.h" 13 if(hitProcessMap->find(HCname) == hitProcessMap->end())
15 cout << endl <<
" !!! Error: >" << HCname <<
"< NOT FOUND IN ProcessHit Map. Exiting" << endl;
19 return (*hitProcessMap)[HCname]();
27 for(map<string, HitProcess_Factory>::iterator it = hitProcessMap.begin(); it != hitProcessMap.end(); it++)
28 listF.insert(it->first);
37 map<string, double> raws;
44 raws[
"pid"] = (double) aHit->
GetPID();
45 raws[
"mpid"] = (double) aHit->
GetmPID();
46 raws[
"tid"] = (double) aHit->
GetTId();
49 raws[
"trackE"] = aHit->
GetE();
50 raws[
"totEdep"] = tInfos.
eTot;
51 raws[
"avg_x"] = tInfos.
x;
52 raws[
"avg_y"] = tInfos.
y;
53 raws[
"avg_z"] = tInfos.
z;
54 raws[
"avg_lx"] = tInfos.
lx;
55 raws[
"avg_ly"] = tInfos.
ly;
56 raws[
"avg_lz"] = tInfos.
lz;
57 raws[
"px"] = aHit->
GetMom().getX();
58 raws[
"py"] = aHit->
GetMom().getY();
59 raws[
"pz"] = aHit->
GetMom().getZ();
60 raws[
"vx"] = aHit->
GetVert().getX();
61 raws[
"vy"] = aHit->
GetVert().getY();
62 raws[
"vz"] = aHit->
GetVert().getZ();
63 raws[
"mvx"] = aHit->
GetmVert().getX();
64 raws[
"mvy"] = aHit->
GetmVert().getY();
65 raws[
"mvz"] = aHit->
GetmVert().getZ();
66 raws[
"avg_t"] = tInfos.
time;
68 raws[
"nsteps"] = aHit->
GetPIDs().size();
77 map< string, vector <double> > allRaws;
79 vector<int> pids = aHit->
GetPIDs();
80 vector<double> pids_d(pids.begin(), pids.end());
82 vector<int> mpids = aHit->
GetmPIDs();
83 vector<double> mpids_d(mpids.begin(), mpids.end());
85 vector<int> tids = aHit->
GetTIds();
86 vector<double> tids_d(tids.begin(), tids.end());
89 vector<double> mtids_d(mtids.begin(), mtids.end());
92 vector<double> otids_d(otids.begin(), otids.end());
95 vector<double> hitnd(pids.size(), (double) hitn);
97 vector<G4ThreeVector> gpos = aHit->
GetPos();
98 vector<G4ThreeVector> lpos = aHit->
GetLPos();
99 vector<G4ThreeVector> mome = aHit->
GetMoms();
100 vector<G4ThreeVector> vert = aHit->
GetVerts();
101 vector<G4ThreeVector> mver = aHit->
GetmVerts();
104 vector<double> x, y, z;
105 vector<double> lx, ly, lz;
106 vector<double> px, py, pz;
107 vector<double> vx, vy, vz;
108 vector<double> mvx, mvy, mvz;
109 vector<double> stepi;
111 for(
unsigned s=0; s<gpos.size(); s++)
114 stepi.push_back(s+1);
116 x.push_back(gpos[s].getX());
117 y.push_back(gpos[s].getY());
118 z.push_back(gpos[s].getZ());
120 lx.push_back(lpos[s].getX());
121 ly.push_back(lpos[s].getY());
122 lz.push_back(lpos[s].getZ());
124 px.push_back(mome[s].getX());
125 py.push_back(mome[s].getY());
126 pz.push_back(mome[s].getZ());
128 vx.push_back(vert[s].getX());
129 vy.push_back(vert[s].getY());
130 vz.push_back(vert[s].getZ());
132 mvx.push_back(mver[s].getX());
133 mvy.push_back(mver[s].getY());
134 mvz.push_back(mver[s].getZ());
138 allRaws[
"stepn"] = stepi;
139 allRaws[
"hitn"] = hitnd;
140 allRaws[
"pid"] = pids_d;
141 allRaws[
"mpid"] = mpids_d;
142 allRaws[
"tid"] = tids_d;
143 allRaws[
"mtid"] = mtids_d;
144 allRaws[
"otid"] = otids_d;
145 allRaws[
"trackE"] = aHit->
GetEs();
146 allRaws[
"edep"] = aHit->
GetEdep();
147 allRaws[
"t"] = aHit->
GetTime();
160 allRaws[
"mvx"] = mvx;
161 allRaws[
"mvy"] = mvy;
162 allRaws[
"mvz"] = mvz;
174 double tres = gemcOpt.optMap[
"VTRESOLUTION"].arg;
176 map< double, double > VT;
188 vector<G4double> Edep = aHit->
GetEdep();
189 vector<G4double> times = aHit->
GetTime();
190 unsigned nsteps = Edep.size();
192 double tmin = 100000;
197 for(
unsigned int s=0; s<nsteps; s++)
199 if(tmin > times[s]) tmin = times[s];
200 if(tmax < times[s]) tmax = times[s];
205 tmin = floor(tmin + 0.5*SID.
delay);
210 unsigned int nt = (int) (tmax - tmin)/tres;
215 for(
unsigned ti=0; ti<nt; ti++)
218 double localT = tmin + ti*tres;
222 for(
unsigned int s=0; s<nsteps; s++)
224 totV += DGauss(localT, par, Edep[s], times[s]);
247 double triggerV = 3500;
252 double sres = gemcOpt.optMap[
"VTRESOLUTION"].arg;
264 for(
int i=0; i<tsampling/tres; i++)
270 map< int, int > :: iterator qsi = QS.begin();
271 map<double, double>::iterator vti = vts.begin();
277 while (qsi->first < vti->first)
284 for(
unsigned i=0; i<vts.size(); i++)
286 if(fabs(vti->first - qsi->first) < sres/2)
289 QS[qsind*4] = fabs(vti->second - sdid.
pedestal);
294 TR[qsind] = triggerV;
328 x = y = z = lx = ly = lz = 0;
333 vector<G4double> Edep = aHit->
GetEdep();
334 vector<G4ThreeVector> pos = aHit->
GetPos();
335 vector<G4ThreeVector> Lpos = aHit->
GetLPos();
336 vector<G4double> times = aHit->
GetTime();
338 nsteps = Edep.size();
339 for(
unsigned int s=0; s<nsteps; s++)
346 for(
unsigned int s=0; s<nsteps; s++)
348 x += pos[s].x()*Edep[s];
349 y += pos[s].y()*Edep[s];
350 z += pos[s].z()*Edep[s];
351 lx += Lpos[s].x()*Edep[s];
352 ly += Lpos[s].y()*Edep[s];
353 lz += Lpos[s].z()*Edep[s];
354 time += times[s]*Edep[s];
366 for(
unsigned int s=0; s<nsteps; s++)
virtual map< double, double > signalVT(MHit *)
void setSignal(map< double, double > VT)
void setQuantum(map< int, int > QS)
double delay
time from PMT face to signal
virtual map< int, int > quantumS(map< double, double >, MHit *)
set< string > getListOfHitProcessHit(map< string, HitProcess_Factory > hitProcessMap)
vector< string > get_info(string input, string chars)
get information from strings such as "5*GeV, 2*deg, 10*deg", parses out strings in second argument ...
vector< G4ThreeVector > GetMoms()
vector< int > GetmTrackIds()
void setQuantumTR(vector< int > t)
double get_number(string v, int warn_no_unit)
Returns number with dimension from string, i.e. 100*cm.
vector< G4ThreeVector > GetLPos()
map< string, vector< double > > allRaws(MHit *, int)
vector< G4ThreeVector > GetPos()
vector< G4ThreeVector > GetmVerts()
double mvToMeV
from MeV to mV constant
vector< double > GetTime()
double signalThreshold
Minimum energy of the hit to be recorded in the output stream.
vector< double > GetEdep()
vector< int > GetoTrackIds()
vector< G4ThreeVector > GetVerts()
HitProcess * getHitProcess(map< string, HitProcess_Factory > *hitProcessMap, string HCname)
double fallTime
fall time of the PMT signal
map< string, double > integrateRaw(MHit *, int, bool)
double riseTime
rise time of the PMT signal