2 #include "G4Poisson.hh" 3 #include "Randomize.hh" 7 #include "CLHEP/Units/PhysicalConstants.h" 15 map<string, double> dgtz;
16 vector<identifier> identity = aHit->
GetId();
18 int sector = identity[0].id;
19 int pad = identity[1].id;
24 dgtz[
"sector"] = sector;
36 #include "G4VVisManager.hh" 37 #include "G4Circle.hh" 38 #include "G4VisAttributes.hh" 39 #include "G4ParticleTable.hh" 43 vector<identifier> id2 = id;
45 G4StepPoint *prestep = aStep->GetPreStepPoint();
46 G4ThreeVector xyz = aStep->GetPostStepPoint()->GetPosition();
47 G4ThreeVector Lxyz = prestep->GetTouchableHandle()->GetHistory()->GetTopTransform().TransformPoint(xyz);
48 const double xpos = Lxyz.x();
49 const double ypos = Lxyz.y();
50 const double Energy = aStep->GetTrack()->GetTotalEnergy()/eV;
53 static const int nbins=15;
54 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};
55 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};
56 static const int NIPXL = 8;
57 static const int NJPXL = 8;
58 static const double PhCsize_x(49);
59 static const double PhCsize_y(49);
60 static const double PXLDeadSpace_x(0.15);
61 static const double PXLDeadSpace_y(0.15);
62 static const double PXLsize_x((PhCsize_x-7*PXLDeadSpace_x)/8);
63 static const double PXLsize_y((PhCsize_y-7*PXLDeadSpace_y)/8);
66 const double new_xpos = xpos+PhCsize_x/2.;
67 const double new_ypos = ypos+PhCsize_y/2.;
70 const int iPMT = (int) floor(new_xpos/(PXLDeadSpace_x+PXLsize_x))+1;
71 const double lx = new_xpos -(iPMT-1)*(PXLDeadSpace_x+PXLsize_x);
74 const int jPMT = (int) floor(new_ypos/(PXLDeadSpace_y+PXLsize_y))+1;
75 const double ly = new_ypos -(jPMT-1)*(PXLDeadSpace_y+PXLsize_y);
78 int ijPMT = NIPXL*(NJPXL-jPMT) + iPMT;
81 if(lx>PXLsize_x || ly>PXLsize_y)
89 if(Energy > p[0] || Energy <= p[nbins-1])
91 for(
int ie=0; ie<nbins-1; ie++)
93 if(Energy > p[ie] && Energy <= p[ie+1])
95 QE = q[ie] + (Energy-p[ie])*(q[ie+1]-q[ie])/(p[ie+1]-p[ie]);
96 if(G4UniformRand()>QE)
106 G4VVisManager* pVVisManager = G4VVisManager::GetConcreteInstance();
114 G4Circle circle(xyz);
115 circle.SetFillStyle(G4Circle::filled);
116 circle.SetScreenSize(8);
119 G4Colour colour_touch (1.0, 0.0, 0.0);
120 circle.SetVisAttributes(G4VisAttributes(colour_touch));
122 pVVisManager->Draw(circle);
127 id2[2].id_sharing = 1;
135 map< string, vector <int> > MH;
vector< identifier > processID(vector< identifier >, G4Step *, detector)
vector< identifier > GetId()
map< string, double > integrateDgt(MHit *, int)
map< string, vector< int > > multiDgt(MHit *, int)