2 #include "G4MaterialPropertyVector.hh" 3 #include "Randomize.hh" 11 #include "CLHEP/Units/PhysicalConstants.h" 12 using namespace CLHEP;
16 map<string, double> dgtz;
19 vector<identifier> identity = aHit->
GetId();
20 int idsector = identity[0].id;
21 int idring = identity[1].id;
22 int idhalf = identity[2].id;
23 int thisPid = aHit->
GetPID();
31 dgtz[
"sector"] = -idsector;
32 dgtz[
"ring"] = -idring;
33 dgtz[
"half"] = -idhalf;
34 dgtz[
"nphe"] = thisPid;
35 dgtz[
"time"] = tInfos.
time;
50 vector<int> tids = aHit->
GetTIds();
51 vector<int> pids = aHit->
GetPIDs();
53 vector<double> photon_energies;
55 vector<double> Energies = aHit->
GetEs();
60 for(
unsigned int s=0; s<tids.size(); s++)
66 pair< set<int> ::iterator,
bool> newtrack = TIDS.insert(tids[s]);
70 if( newtrack.second ) photon_energies.push_back( Energies[s] );
81 G4MaterialPropertiesTable* MPT = aHit->
GetDetector().
GetLogical()->GetMaterial()->GetMaterialPropertiesTable();
82 G4MaterialPropertyVector* efficiency = NULL;
84 bool gotefficiency =
false;
87 efficiency = (G4MaterialPropertyVector*) MPT->GetProperty(
"EFFICIENCY");
88 if( efficiency != NULL ) gotefficiency =
true;
91 for(
unsigned int iphoton = 0; iphoton<TIDS.size(); iphoton++ )
98 bool outofrange =
false;
99 if( G4UniformRand() <= efficiency->GetValue( photon_energies[iphoton], outofrange ) )
104 cout << log_msg <<
" Found efficiency definition for material " 106 <<
": (Ephoton, efficiency)=(" << photon_energies[iphoton] <<
", " 107 << ( (G4MaterialPropertyVector*) efficiency )->GetValue( photon_energies[iphoton], outofrange )
121 cout << log_msg <<
" (sector, ring, half)=(" << idsector <<
", " << idring <<
", " << idhalf <<
")" 122 <<
" x=" << tInfos.
x/cm <<
" y=" << tInfos.
y/cm <<
" z=" << tInfos.
z/cm << endl;
125 dgtz[
"sector"] = idsector;
126 dgtz[
"ring"] = idring;
127 dgtz[
"half"] = idhalf;
128 dgtz[
"nphe"] = ndetected;
129 dgtz[
"time"] = tInfos.
time;
138 id[
id.size()-1].id_sharing = 1;
146 map< string, vector <int> > MH;
vector< identifier > processID(vector< identifier >, G4Step *, detector)
map< string, vector< int > > multiDgt(MHit *, int)
G4LogicalVolume * GetLogical()
Returns Logical Volume pointer.
vector< identifier > GetId()
map< string, double > integrateDgt(MHit *, int)