4 #include "G4UnitsTable.hh" 5 #include "G4Poisson.hh" 6 #include "Randomize.hh" 24 HCname =
"ECwithG4strips Hit Process";
31 int nsteps = aHit->
GetPos().size();
35 vector<G4double> Edep = aHit->
GetEdep();
36 for(
int s=0; s<nsteps; s++) Etot = Etot + Edep[s];
41 x = y = z = lx = ly = lz = 0;
42 vector<G4ThreeVector> pos = aHit->
GetPos();
43 vector<G4ThreeVector> Lpos = aHit->
GetLPos();
46 for(
int s=0; s<nsteps; s++)
48 x = x + pos[s].x()*Edep[s]/Etot;
49 y = y + pos[s].y()*Edep[s]/Etot;
50 z = z + pos[s].z()*Edep[s]/Etot;
51 lx = lx + Lpos[s].x()*Edep[s]/Etot;
52 ly = ly + Lpos[s].y()*Edep[s]/Etot;
53 lz = lz + Lpos[s].z()*Edep[s]/Etot;
67 vector<G4double> times = aHit->
GetTime();
68 for(
int s=0; s<nsteps; s++) time = time + times[s]/nsteps;
71 double Ene = aHit->
GetE();
73 out.
raws.push_back(Etot);
74 out.
raws.push_back(x);
75 out.
raws.push_back(y);
76 out.
raws.push_back(z);
77 out.
raws.push_back(lx);
78 out.
raws.push_back(ly);
79 out.
raws.push_back(lz);
80 out.
raws.push_back(time);
85 out.
raws.push_back(Ene);
98 int ec_tdc_time_to_channel = (int)
gpars[
"EC/ec_tdc_time_to_channel"];
99 double ECfactor = (double)
gpars[
"EC/ECfactor"];
100 int EC_TDC_MAX = (int)
gpars[
"EC/EC_TDC_MAX"];
101 int ec_charge_to_channel = (int)
gpars[
"EC/ec_charge_to_channel"];
102 double ec_npe_to_charge = (double)
gpars[
"EC/ec_npe_to_charge"];
114 int EC_TDC = EC_TDC_MAX;
119 double EC_npe = G4Poisson(Etot*ECfactor);
122 double sigma = sqrt(EC_npe)*1.15;
123 double EC_charge = G4RandGauss::shoot(EC_npe,sigma)*ec_npe_to_charge*ec_charge_to_channel;
124 if (EC_charge <= 0) EC_charge=0.0;
125 EC_ADC = (int) EC_charge;
129 EC_TDC = (int) (time*ec_tdc_time_to_channel);
130 if (EC_TDC > EC_TDC_MAX) EC_TDC = EC_TDC_MAX;
132 out.
dgtz.push_back(sector);
133 out.
dgtz.push_back(stack);
134 out.
dgtz.push_back(view);
135 out.
dgtz.push_back(strip);
136 out.
dgtz.push_back(EC_ADC);
137 out.
dgtz.push_back(EC_TDC);
146 vector<identifier> yid = id;
150 G4StepPoint *prestep = aStep->GetPreStepPoint();
151 G4StepPoint *poststep = aStep->GetPostStepPoint();
152 G4VTouchable* TH = (G4VTouchable*) aStep->GetPreStepPoint()->GetTouchable();
154 string name = TH->GetVolume(0)->GetName();
155 G4ThreeVector xyz = poststep->GetPosition();
156 G4ThreeVector Lxyz = prestep->GetTouchableHandle()->GetHistory()
157 ->GetTopTransform().TransformPoint(xyz);
165 int strip_number = yid[3].id;
166 string detName = Detector.
name;
209 yid[3].id = strip_number;
210 yid[3].id_sharing = 1;
vector< identifier > ProcessID(vector< identifier >, G4Step *, detector, gemc_opts)
Method to calculate new identifier.
vector< double > raws
Raw information.
vector< identifier > GetId()
string HCname
Hit Collection name.
vector< identifier > identity
Identifier.
vector< G4ThreeVector > GetLPos()
vector< G4ThreeVector > GetPos()
string name
Name of the volume. Since this is the key of the STL map, it has to be unique.
map< string, double > gpars
PH_output ProcessHit(MHit *, gemc_opts)
Method to process the hit.
vector< double > GetTime()
vector< double > GetEdep()
vector< int > dgtz
Digitized information.