10 string hd_msg = Opt.
args[
"LOG_MSG"].args +
" STR Hit Process " ;
11 double HIT_VERBOSITY = Opt.
args[
"HIT_VERBOSITY"].arg;
16 HCname =
"STR 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);
104 cout << hd_msg <<
" layer: " << slayer <<
" type: " << stype <<
" segment: " << segment <<
" module: "<< module
105 <<
" Strip: " << strip <<
" x=" << x <<
" y=" << y <<
" z=" << z << endl;
107 out.
dgtz.push_back(slayer);
108 out.
dgtz.push_back(stype);
109 out.
dgtz.push_back(segment);
110 out.
dgtz.push_back(module);
111 out.
dgtz.push_back(strip);
116 #define ABS_(x) (x < 0 ? -x : x) 120 vector<identifier> yid = id;
122 enum STR_identifiers {layer=0,type=1,segment=2,module=3,strip=4};
132 double active_width = 38.34;
133 double active_height = 98.33;
134 double readout_pitch = 0.06;
136 G4ThreeVector xyz = aStep->GetPostStepPoint()->GetPosition();
137 G4ThreeVector Lxyz = aStep->GetPreStepPoint()->GetTouchableHandle()->GetHistory()->GetTopTransform().TransformPoint(xyz);
142 if( x < -active_width/2) yid[strip].id = -10;
143 else if ( x > active_width/2) yid[strip].id = -9;
144 else if( y < -active_height/2)yid[strip].id = -8;
145 else if( y > active_height/2) yid[strip].id = -7;
148 int nstrip = (int)((x + active_width/2 )/readout_pitch);
149 yid[strip].id = nstrip;
151 yid[
id.size()-1].id_sharing = 1;
vector< double > raws
Raw information.
vector< identifier > GetId()
string HCname
Hit Collection name.
vector< identifier > identity
Identifier.
vector< G4ThreeVector > GetLPos()
vector< G4ThreeVector > GetPos()
PH_output ProcessHit(MHit *, gemc_opts)
Method to process the hit.
vector< double > GetTime()
map< string, opts > args
Options map.
vector< identifier > ProcessID(vector< identifier >, G4Step *, detector, gemc_opts)
Method to calculate new identifier.
vector< double > GetEdep()
vector< int > dgtz
Digitized information.