4 #include "G4UnitsTable.hh" 5 #include "G4MaterialPropertyVector.hh" 6 #include "Randomize.hh" 17 string hd_msg = Opt.
args[
"LOG_MSG"].args +
" HTCC Hit Process " ;
18 double HIT_VERBOSITY = Opt.
args[
"HIT_VERBOSITY"].arg;
21 HCname =
"HTCC Hit Process";
24 if(aHit->
GetPID() != 0)
return out;
35 int nsteps = aHit->
GetPos().size();
39 vector<int> tids = aHit->
GetTIds();
40 vector<int> pids = aHit->
GetPIDs();
42 vector<double> photon_energies;
47 x = y = z = lx = ly = lz = 0;
48 vector<G4ThreeVector> pos = aHit->
GetPos();
49 vector<G4ThreeVector> Lpos = aHit->
GetLPos();
51 for(
int s=0; s<nsteps; s++)
54 pair< set<int> ::iterator,
bool> newtrack = TIDS.insert(tids[s]);
55 if( newtrack.second ) photon_energies.push_back( (aHit->
GetEs())[s] );
61 lx = lx + Lpos[s].x();
62 ly = ly + Lpos[s].y();
63 lz = lz + Lpos[s].z();
78 vector<G4double> times = aHit->
GetTime();
79 for(
int s=0; s<nsteps; s++) time = time + times[s]/nsteps;
82 double Ene = aHit->
GetE();
84 out.
raws.push_back(x);
85 out.
raws.push_back(y);
86 out.
raws.push_back(z);
87 out.
raws.push_back(lx);
88 out.
raws.push_back(ly);
89 out.
raws.push_back(lz);
90 out.
raws.push_back(time);
94 out.
raws.push_back(Ene);
108 int idsector=-1, idring=-1, idhalf=-1;
110 for(
unsigned int id=0;
id<out.
identity.size();
id++){
121 int isector=-1, iring=-1, ihalf=-1;
123 if( idsector >= 0 && idring >= 0 && idhalf >= 0 ){
124 isector = out.
identity[idsector].id;
134 G4MaterialPropertiesTable* MPT = aHit->
GetDetector().
GetLogical()->GetMaterial()->GetMaterialPropertiesTable();
135 G4MaterialPropertyVector* efficiency;
137 bool gotefficiency =
false;
139 efficiency = (G4MaterialPropertyVector*) MPT->GetProperty(
"EFFICIENCY");
140 if( efficiency != NULL ) gotefficiency =
true;
143 for(
unsigned int iphoton = 0; iphoton<TIDS.size(); iphoton++ ){
145 bool outofrange =
false;
146 if( G4UniformRand() <= efficiency->GetValue( photon_energies[iphoton], outofrange ) )
149 if( HIT_VERBOSITY > 4 ){
150 cout <<
"Found efficiency definition for material " << aHit->
GetDetector().
GetLogical()->GetMaterial()->GetName()
151 <<
": (Ephoton, efficiency)=(" << photon_energies[iphoton] <<
", " 152 << ( (G4MaterialPropertyVector*) efficiency )->GetValue( photon_energies[iphoton], outofrange )
161 cout << hd_msg <<
" (sector, ring, half)=(" << isector <<
", " << iring <<
", " << ihalf <<
")" 162 <<
" x=" << x/cm <<
" y=" << y/cm <<
" z=" << z/cm << endl;
164 out.
dgtz.push_back(isector);
165 out.
dgtz.push_back(iring);
166 out.
dgtz.push_back(ihalf);
168 out.
dgtz.push_back( ndetected );
176 id[
id.size()-1].id_sharing = 1;
G4LogicalVolume * GetLogical()
Returns Logical Volume pointer.
PH_output ProcessHit(MHit *, gemc_opts)
Method to process the hit.
vector< double > raws
Raw information.
vector< identifier > GetId()
string HCname
Hit Collection name.
vector< identifier > identity
Identifier.
vector< G4ThreeVector > GetLPos()
vector< G4ThreeVector > GetPos()
vector< double > GetTime()
map< string, opts > args
Options map.
string TrimSpaces(string in)
Removes leading and trailing spaces.
vector< identifier > ProcessID(vector< identifier >, G4Step *, detector, gemc_opts)
Method to calculate new identifier.
vector< int > dgtz
Digitized information.