9 string hd_msg = Opt.
args[
"LOG_MSG"].args +
" FMT Hit Process " ;
10 double VERB = Opt.
args[
"HIT_VERBOSITY"].arg;
15 HCname =
"FMT Hit Process";
20 int nsteps = aHit->
GetPos().size();
24 vector<G4double> Edep = aHit->
GetEdep();
25 for(
int s=0; s<nsteps; s++) Etot = Etot + Edep[s];
30 x = y = z = lx = ly = lz = 0;
31 vector<G4ThreeVector> pos = aHit->
GetPos();
32 vector<G4ThreeVector> Lpos = aHit->
GetLPos();
35 for(
int s=0; s<nsteps; s++)
37 x = x + pos[s].x()*Edep[s]/Etot;
38 y = y + pos[s].y()*Edep[s]/Etot;
39 z = z + pos[s].z()*Edep[s]/Etot;
40 lx = lx + Lpos[s].x()*Edep[s]/Etot;
41 ly = ly + Lpos[s].y()*Edep[s]/Etot;
42 lz = lz + Lpos[s].z()*Edep[s]/Etot;
57 vector<G4double> times = aHit->
GetTime();
58 for(
int s=0; s<nsteps; s++) time = time + times[s]/nsteps;
61 double Ene = aHit->
GetE();
63 out.
raws.push_back(Etot);
64 out.
raws.push_back(x);
65 out.
raws.push_back(y);
66 out.
raws.push_back(z);
67 out.
raws.push_back(lx);
68 out.
raws.push_back(ly);
69 out.
raws.push_back(lz);
70 out.
raws.push_back(time);
75 out.
raws.push_back(Ene);
92 cout << hd_msg <<
" layer: " << layer <<
" sector: " << sector
93 <<
" Strip: " << strip <<
" x=" << x <<
" y=" << y <<
" z=" << z << endl;
95 out.
dgtz.push_back(layer);
96 out.
dgtz.push_back(sector);
97 out.
dgtz.push_back(strip);
107 G4ThreeVector xyz = aStep->GetPostStepPoint()->GetPosition();
112 vector<identifier> yid = id;
116 int layer = 2*yid[0].id + yid[1].id - 2 ;
117 int sector = yid[2].id;
120 double depe = aStep->GetTotalEnergyDeposit();
122 vector<double> multi_hit = fmts.
FindStrip(layer-1, sector-1, x, y, z, depe);
124 int n_multi_hits = multi_hit.size()/2;
128 yid[3].id = (int) multi_hit[0];
130 yid[0].id_sharing = multi_hit[1];
131 yid[1].id_sharing = multi_hit[1];
132 yid[2].id_sharing = multi_hit[1];
133 yid[3].id_sharing = multi_hit[1];
137 for(
int h=1; h<n_multi_hits; h++)
139 for(
int j=0; j<3; j++)
142 this_id.
name = yid[j].name;
143 this_id.
rule = yid[j].rule;
144 this_id.
id = yid[j].id;
145 this_id.
time = yid[j].time;
147 this_id.
TrackId = yid[j].TrackId;
149 yid.push_back(this_id);
153 this_id.
name = yid[3].name;
154 this_id.
rule = yid[3].rule;
155 this_id.
id = (int) multi_hit[2];
156 this_id.
time = yid[3].time;
158 this_id.
TrackId = yid[3].TrackId;
160 yid.push_back(this_id);
vector< double > raws
Raw information.
vector< identifier > GetId()
string HCname
Hit Collection name.
int id
manually assing ID. 0 if "ncopy" (will be set at hit processing time)
string name
Name of the detector.
vector< identifier > identity
Identifier.
PH_output ProcessHit(MHit *, gemc_opts)
Method to process the hit.
vector< G4ThreeVector > GetLPos()
double TimeWindow
Time Window. If abs(steptime - time) is smaller than TimeWindow, it's the same hit.
int TrackId
If Time Window is 0, it's a "flux" detector: if it's the same track, it's the same hit...
vector< G4ThreeVector > GetPos()
vector< double > FindStrip(int layer, int sector, double x, double y, double z, double Edep)
vector< double > GetTime()
map< string, opts > args
Options map.
vector< identifier > ProcessID(vector< identifier >, G4Step *, detector, gemc_opts)
Method to calculate new identifier.
double id_sharing
A single step can generate multiple identifiers. This variable represent the percentage sharing of th...
double time
Time of the first step.
vector< double > GetEdep()
string rule
"manual" or "ncopy"
vector< int > dgtz
Digitized information.