10 string hd_msg = Opt.
args[
"LOG_MSG"].args +
" BST Hit Process " ;
11 double HIT_VERBOSITY = Opt.
args[
"HIT_VERBOSITY"].arg;
16 HCname =
"BST Hit Process";
21 int nsteps = aHit->
GetPos().size();
25 vector<G4double> Edep = aHit->
GetEdep();
26 for(
int s=0; s<nsteps; s++) Etot = Etot + Edep[s];
31 x = y = z = lx = ly = lz = 0;
32 vector<G4ThreeVector> pos = aHit->
GetPos();
33 vector<G4ThreeVector> Lpos = aHit->
GetLPos();
36 for(
int s=0; s<nsteps; s++)
38 x = x + pos[s].x()*Edep[s]/Etot;
39 y = y + pos[s].y()*Edep[s]/Etot;
40 z = z + pos[s].z()*Edep[s]/Etot;
41 lx = lx + Lpos[s].x()*Edep[s]/Etot;
42 ly = ly + Lpos[s].y()*Edep[s]/Etot;
43 lz = lz + Lpos[s].z()*Edep[s]/Etot;
58 vector<G4double> times = aHit->
GetTime();
59 for(
int s=0; s<nsteps; s++) time = time + times[s]/nsteps;
62 double Ene = aHit->
GetE();
64 out.
raws.push_back(Etot);
65 out.
raws.push_back(x);
66 out.
raws.push_back(y);
67 out.
raws.push_back(z);
68 out.
raws.push_back(lx);
69 out.
raws.push_back(ly);
70 out.
raws.push_back(lz);
71 out.
raws.push_back(time);
76 out.
raws.push_back(Ene);
95 cout <<
" Warning: dimensions mismatch between sensor reconstruction dimensions and gemc card dimensions." << endl << endl;
103 cout << hd_msg <<
" layer: " << layer <<
" sector: " << sector <<
" Card: " << card
104 <<
" Strip: " << strip <<
" x=" << x <<
" y=" << y <<
" z=" << z << endl;
106 out.
dgtz.push_back(layer);
107 out.
dgtz.push_back(sector);
108 out.
dgtz.push_back(strip);
117 vector<identifier> yid = id;
120 G4ThreeVector xyz = aStep->GetPostStepPoint()->GetPosition();
122 G4ThreeVector Lxyz = aStep->GetPreStepPoint()->GetTouchableHandle()->GetHistory()
123 ->GetTopTransform().TransformPoint(xyz);
133 int layer = 2*yid[0].id + yid[1].id - 2 ;
134 int sector = yid[2].id;
135 int isensor = yid[3].id;
137 vector<double> multi_hit = bsts.
FindStrip(layer-1, sector-1, isensor, Lxyz);
139 int n_multi_hits = multi_hit.size()/2;
142 yid[4].id = (int) multi_hit[0];
144 yid[0].id_sharing = multi_hit[1];
145 yid[1].id_sharing = multi_hit[1];
146 yid[2].id_sharing = multi_hit[1];
147 yid[3].id_sharing = multi_hit[1];
148 yid[4].id_sharing = multi_hit[1];
151 for(
int h=1; h<n_multi_hits; h++)
153 for(
int j=0; j<4; j++)
156 this_id.
name = yid[j].name;
157 this_id.
rule = yid[j].rule;
158 this_id.
id = yid[j].id;
159 this_id.
time = yid[j].time;
161 this_id.
TrackId = yid[j].TrackId;
163 yid.push_back(this_id);
167 this_id.
name = yid[4].name;
168 this_id.
rule = yid[4].rule;
169 this_id.
id = (int) multi_hit[2];
170 this_id.
time = yid[4].time;
172 this_id.
TrackId = yid[4].TrackId;
174 yid.push_back(this_id);
vector< double > raws
Raw information.
vector< identifier > ProcessID(vector< identifier >, G4Step *, detector, gemc_opts)
Method to calculate new identifier.
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.
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()
PH_output ProcessHit(MHit *, gemc_opts)
Method to process the hit.
vector< double > GetTime()
map< string, opts > args
Options map.
vector< double > FindStrip(int layer, int sector, int isens, G4ThreeVector Lxyz)
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 > dimensions
vector of dimensions. Size, units depends on solid type
vector< double > GetEdep()
string rule
"manual" or "ncopy"
vector< int > dgtz
Digitized information.