4 #include "G4UnitsTable.hh" 5 #include "G4Poisson.hh" 6 #include "Randomize.hh" 19 HCname =
"RICH Hit Process";
24 int nsteps = aHit->
GetPos().size();
28 vector<G4double> Edep = aHit->
GetEdep();
29 for(
int s=0; s<nsteps; s++) Etot = Etot + Edep[s];
30 if(nsteps>1)cout <<
"ATT nsteps " << nsteps << endl;
35 x = y = z = lx = ly = lz = 0;
36 vector<G4ThreeVector> pos = aHit->
GetPos();
37 vector<G4ThreeVector> Lpos = aHit->
GetLPos();
41 for(
int s=0; s<nsteps; s++)
43 x = x + pos[s].x()*Edep[s]/Etot;
44 y = y + pos[s].y()*Edep[s]/Etot;
45 z = z + pos[s].z()*Edep[s]/Etot;
46 lx = lx + Lpos[s].x()*Edep[s]/Etot;
47 ly = ly + Lpos[s].y()*Edep[s]/Etot;
48 lz = lz + Lpos[s].z()*Edep[s]/Etot;
63 vector<G4double> times = aHit->
GetTime();
64 for(
int s=0; s<nsteps; s++) time = time + times[s]/nsteps;
67 double Ene = aHit->
GetE();
69 cout <<
" RICHhit: " << aHit->
GetPID()
70 <<
" " << Ene <<
" " << sector <<
" " << pad <<
" " << x <<
" " << y <<
" " << z
71 <<
" " << lx <<
" " << ly <<
" " << lz << endl;
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);
96 out.
dgtz.push_back(sector);
97 out.
dgtz.push_back(pad);
103 #include "G4VVisManager.hh" 104 #include "G4Circle.hh" 105 #include "G4VisAttributes.hh" 106 #include "G4ParticleTable.hh" 110 vector<identifier> id2 = id;
112 G4StepPoint *prestep = aStep->GetPreStepPoint();
113 G4ThreeVector xyz = aStep->GetPostStepPoint()->GetPosition();
114 G4ThreeVector Lxyz = prestep->GetTouchableHandle()->GetHistory()->GetTopTransform().TransformPoint(xyz);
115 const double xpos = Lxyz.x();
116 const double ypos = Lxyz.y();
117 const double Energy = aStep->GetTrack()->GetTotalEnergy()/eV;
120 static const int nbins=15;
121 static const double p[nbins]={1.86, 1.96, 2.03, 2.13, 2.28, 2.37, 2.48, 2.59, 2.71, 3.11, 3.37, 3.73, 4.13, 4.39, 4.64};
122 static const double q[nbins]={0.0002, 0.002, 0.007, 0.02, 0.04, 0.08, 0.13, 0.17, 0.20, 0.26, 0.27, 0.28, 0.22, 0.18, 0.10};
123 static const int NIPXL = 8;
124 static const int NJPXL = 8;
125 static const double PhCsize_x(49);
126 static const double PhCsize_y(49);
127 static const double PXLDeadSpace_x(0.15);
128 static const double PXLDeadSpace_y(0.15);
129 static const double PXLsize_x((PhCsize_x-7*PXLDeadSpace_x)/8);
130 static const double PXLsize_y((PhCsize_y-7*PXLDeadSpace_y)/8);
133 const double new_xpos = xpos+PhCsize_x/2.;
134 const double new_ypos = ypos+PhCsize_y/2.;
137 const int iPMT = (int) floor(new_xpos/(PXLDeadSpace_x+PXLsize_x))+1;
138 const double lx = new_xpos -(iPMT-1)*(PXLDeadSpace_x+PXLsize_x);
141 const int jPMT = (int) floor(new_ypos/(PXLDeadSpace_y+PXLsize_y))+1;
142 const double ly = new_ypos -(jPMT-1)*(PXLDeadSpace_y+PXLsize_y);
145 int ijPMT = NIPXL*(NJPXL-jPMT) + iPMT;
148 if(lx>PXLsize_x || ly>PXLsize_y)
156 if(Energy > p[0] || Energy <= p[nbins-1])
158 for(
int ie=0; ie<nbins-1; ie++)
160 if(Energy > p[ie] && Energy <= p[ie+1])
162 QE = q[ie] + (Energy-p[ie])*(q[ie+1]-q[ie])/(p[ie+1]-p[ie]);
163 if(G4UniformRand()>QE)
173 G4VVisManager* pVVisManager = G4VVisManager::GetConcreteInstance();
181 G4Circle circle(xyz);
182 circle.SetFillStyle(G4Circle::filled);
183 circle.SetScreenSize(8);
186 G4Colour colour_touch (1.0, 0.0, 0.0);
187 circle.SetVisAttributes(G4VisAttributes(colour_touch));
189 pVVisManager->Draw(circle);
194 id2[2].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 > ProcessID(vector< identifier >, G4Step *, detector, gemc_opts)
Method to calculate new identifier.
vector< identifier > identity
Identifier.
vector< G4ThreeVector > GetLPos()
vector< G4ThreeVector > GetPos()
vector< double > GetTime()
vector< double > GetEdep()
vector< int > dgtz
Digitized information.