2 #include "G4MaterialPropertyVector.hh" 3 #include "Randomize.hh" 13 map<string, double> dgtz;
16 vector<identifier> identity = aHit->
GetId();
17 int idsector = identity[0].id;
18 int idside = identity[1].id;
19 int idsegment = identity[2].id;
20 int thisPid = aHit->
GetPID();
28 dgtz[
"sector"] = -idsector;
29 dgtz[
"side"] = -idside;
30 dgtz[
"segment"] = -idsegment;
31 dgtz[
"nphe"] = thisPid;
32 dgtz[
"time"] = tInfos.
time;
41 vector<int> tids = aHit->
GetTIds();
42 vector<int> pids = aHit->
GetPIDs();
43 vector<double> Energies = aHit->
GetEs();
46 map<int, double> penergy;
48 for(
unsigned int s=0; s<tids.size(); s++)
52 if(penergy.find(tids[s]) == penergy.end())
53 penergy[tids[s]] = Energies[s];
60 G4MaterialPropertiesTable* MPT = aHit->
GetDetector().
GetLogical()->GetMaterial()->GetMaterialPropertiesTable();
61 G4MaterialPropertyVector* efficiency = NULL;
63 bool gotefficiency =
false;
66 efficiency = (G4MaterialPropertyVector*) MPT->GetProperty(
"EFFICIENCY");
67 if( efficiency != NULL ) gotefficiency =
true;
70 for(
unsigned int iphoton = 0; iphoton<penergy.size(); iphoton++ )
77 bool outofrange =
false;
78 if( G4UniformRand() <= efficiency->GetValue( penergy[tids[iphoton]], outofrange ) )
85 cout <<
log_msg <<
" Found efficiency definition for material " 87 <<
": (Ephoton, efficiency)=(" << penergy[tids[iphoton]] <<
", " 88 << ( (G4MaterialPropertyVector*) efficiency )->GetValue( penergy[tids[iphoton]], outofrange )
100 dgtz[
"sector"] = idsector;
101 dgtz[
"side"] = idside;
102 dgtz[
"segment"] = idsegment;
103 dgtz[
"nphe"] = narrived;
104 dgtz[
"npheD"] = ndetected;
105 dgtz[
"time"] = tInfos.
time;
116 id[
id.size()-1].id_sharing = 1;
124 map< string, vector <int> > MH;
G4LogicalVolume * GetLogical()
Returns Logical Volume pointer.
vector< identifier > GetId()
map< string, vector< int > > multiDgt(MHit *, int)
vector< identifier > processID(vector< identifier >, G4Step *, detector)
map< string, double > integrateDgt(MHit *, int)