6 #include "CLHEP/Units/PhysicalConstants.h" 10 #include "Randomize.hh" 14 map<string, double> dgtz;
15 vector<identifier> identity = aHit->
GetId();
25 cout <<
" Warning: dimensions mismatch between sensor reconstruction dimensions and gemc card dimensions." << endl << endl;
27 int layer = 2*identity[0].id + identity[1].id - 2 ;
28 int sector = identity[2].id;
29 int card = identity[3].id;
30 int strip = identity[4].id;
40 double minHit = 0.0261*MeV;
41 double maxHit = 0.11747*MeV;
42 double deltaADC = maxHit - minHit;
43 int adc = floor( 7*(tInfos.
eTot - minHit)/deltaADC);
44 int adchd = floor(8196*(tInfos.
eTot - minHit)/deltaADC);
46 if(tInfos.
eTot>maxHit)
51 if(tInfos.
eTot<minHit)
59 cout << log_msg <<
" layer: " << layer <<
" sector: " << sector <<
" Card: " << card <<
" Strip: " << strip
60 <<
" x=" << tInfos.
x <<
" y=" << tInfos.
y <<
" z=" << tInfos.
z << endl;
64 dgtz[
"layer"] = layer;
65 dgtz[
"sector"] = sector;
66 dgtz[
"strip"] = strip;
68 dgtz[
"ADCHD"] = adchd;
69 dgtz[
"time"] = tInfos.
time;
70 dgtz[
"bco"] = (int) 255*G4UniformRand();
79 vector<identifier> yid = id;
81 G4ThreeVector xyz = aStep->GetPostStepPoint()->GetPosition();
83 G4ThreeVector Lxyz = aStep->GetPreStepPoint()->GetTouchableHandle()->GetHistory()
84 ->GetTopTransform().TransformPoint(xyz);
89 int layer = 2*yid[0].id + yid[1].id - 2 ;
90 int sector = yid[2].id;
91 int isensor = yid[3].id;
93 vector<double> multi_hit = bsts.
FindStrip(layer-1, sector-1, isensor, Lxyz);
95 int n_multi_hits = multi_hit.size()/2;
98 yid[4].id = (int) multi_hit[0];
100 yid[0].id_sharing = multi_hit[1];
101 yid[1].id_sharing = multi_hit[1];
102 yid[2].id_sharing = multi_hit[1];
103 yid[3].id_sharing = multi_hit[1];
104 yid[4].id_sharing = multi_hit[1];
107 for(
int h=1; h<n_multi_hits; h++)
109 for(
int j=0; j<4; j++)
112 this_id.
name = yid[j].name;
113 this_id.
rule = yid[j].rule;
114 this_id.
id = yid[j].id;
115 this_id.
time = yid[j].time;
117 this_id.
TrackId = yid[j].TrackId;
119 yid.push_back(this_id);
123 this_id.
name = yid[4].name;
124 this_id.
rule = yid[4].rule;
125 this_id.
id = (int) multi_hit[2];
126 this_id.
time = yid[4].time;
128 this_id.
TrackId = yid[4].TrackId;
130 yid.push_back(this_id);
141 map< string, vector <int> > MH;
vector< identifier > processID(vector< identifier >, G4Step *, detector)
vector< identifier > GetId()
int id
manually assing ID. 0 if "ncopy" (will be set at hit processing time)
map< string, vector< int > > multiDgt(MHit *, int)
string name
Name of the detector.
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...
map< string, double > integrateDgt(MHit *, int)
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
string rule
"manual" or "ncopy"