4 #include "G4UnitsTable.hh" 5 #include "G4Poisson.hh" 6 #include "Randomize.hh" 25 HCname =
"PCAL Hit Process";
38 int nsteps = aHit->
GetPos().size();
44 x = y = z = lx = ly = lz = 0;
45 vector<G4ThreeVector> pos = aHit->
GetPos();
46 vector<G4ThreeVector> Lpos = aHit->
GetLPos();
52 vector<G4double> Edep = aHit->
GetEdep();
54 for(
int s=0; s<nsteps; s++)
60 if(view==1) latt=pDx2+xlocal;
61 if(view==2) latt=pDx2+xlocal;
62 if(view==3) latt=pDx2+xlocal;
63 Etot = Etot + Edep[s];
65 Etota = Etota + Edep[s]*exp(-latt/attlen);
69 Etot = Etot + Edep[s];
70 Etota = Etota + Edep[s];
75 for(
int s=0; s<nsteps; s++)
77 x = x + pos[s].x()*Edep[s]/Etot;
78 y = y + pos[s].y()*Edep[s]/Etot;
79 z = z + pos[s].z()*Edep[s]/Etot;
80 lx = lx + Lpos[s].x()*Edep[s]/Etot;
81 ly = ly + Lpos[s].y()*Edep[s]/Etot;
82 lz = lz + Lpos[s].z()*Edep[s]/Etot;
96 vector<G4double> times = aHit->
GetTime();
97 for(
int s=0; s<nsteps; s++) time = time + times[s]/nsteps;
100 double Ene = aHit->
GetE();
102 out.
raws.push_back(Etot);
103 out.
raws.push_back(x);
104 out.
raws.push_back(y);
105 out.
raws.push_back(z);
106 out.
raws.push_back(lx);
107 out.
raws.push_back(ly);
108 out.
raws.push_back(lz);
109 out.
raws.push_back(time);
114 out.
raws.push_back(Ene);
133 double pc_tdc_time_to_channel = 20 ;
134 double PCfactor = 11.5;
135 int PC_TDC_MAX = 4095;
136 double pc_MeV_to_channel = 10.;
140 int PC_TDC = PC_TDC_MAX;
144 double PC_npe = G4Poisson(Etota*PCfactor);
148 double sigma = sqrt(PC_npe)/1.22;
149 double PC_MeV = G4RandGauss::shoot(PC_npe,sigma)*pc_MeV_to_channel/PCfactor;
150 if (PC_MeV <= 0) PC_MeV=0.0;
151 PC_ADC = (int) PC_MeV;
155 PC_TDC = (int) (time*pc_tdc_time_to_channel);
156 if (PC_TDC > PC_TDC_MAX) PC_TDC = PC_TDC_MAX;
158 out.
dgtz.push_back(sector);
159 out.
dgtz.push_back(module);
160 out.
dgtz.push_back(view);
161 out.
dgtz.push_back(strip);
162 out.
dgtz.push_back(PC_ADC);
163 out.
dgtz.push_back(PC_TDC);
178 id[
id.size()-1].id_sharing = 1;
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()
vector< identifier > ProcessID(vector< identifier >, G4Step *, detector, gemc_opts)
Method to calculate new identifier.
vector< double > dimensions
vector of dimensions. Size, units depends on solid type
vector< double > GetEdep()
vector< int > dgtz
Digitized information.