8 #include "G4Electron.hh"
9 #include "G4Positron.hh"
10 #include "G4PionPlus.hh"
11 #include "G4PionMinus.hh"
12 #include "G4MuonPlus.hh"
13 #include "G4MuonMinus.hh"
14 #include "G4Neutron.hh"
15 #include "G4Proton.hh"
20 #include "G4StepPoint.hh"
34 double timebins[101],ebins[101];
35 for (
int i=0;
i<101;++
i){
37 ebins[
i] =
std::pow(10.,-11.+16.*
double(
i)/100.);
40 for (
int j=0;j<9;++j){
41 for (
int k=0;
k<2;++
k){
42 sprintf(
nom,
"Flux_%i_%i_%i",
i,j,
k);
45 sprintf(
nom,
"FluxE_%i_%i",
i,j);
58 TFile *
f =
new TFile(
"flux.root",
"RECREATE");
62 for (
int j=0;j<9;++j){
63 for (
int k=0;
k<2;++
k){
64 sprintf(
nom,
"Flux_%i_%i_%i",
i,j,
k);
68 sprintf(
nom,
"FluxE_%i_%i",
i,j);
77 int pdgid = 8,
energy=(aStep->GetTrack()->GetKineticEnergy()>10.)?1:0;
78 if (aStep->GetTrack()->GetDefinition()==G4Gamma::Definition()){
80 energy = (aStep->GetTrack()->GetKineticEnergy()>0.03)?1:0;
81 }
else if (aStep->GetTrack()->GetDefinition()==G4Proton::Definition()){
83 energy = (aStep->GetTrack()->GetKineticEnergy()>10.)?1:0;
84 }
else if (aStep->GetTrack()->GetDefinition()==G4PionPlus::Definition() ||
85 aStep->GetTrack()->GetDefinition()==G4PionMinus::Definition()){
87 energy = (aStep->GetTrack()->GetKineticEnergy()>10.)?1:0;
88 }
else if(aStep->GetTrack()->GetDefinition()==G4MuonPlus::Definition() ||
89 aStep->GetTrack()->GetDefinition()==G4MuonMinus::Definition()){
91 energy = (aStep->GetTrack()->GetKineticEnergy()>10.)?1:0;
92 }
else if(aStep->GetTrack()->GetDefinition()==G4Electron::Definition() ||
93 aStep->GetTrack()->GetDefinition()==G4Positron::Definition()){
94 if (aStep->GetTrack()->GetKineticEnergy()>0.5){
98 energy=(aStep->GetTrack()->GetKineticEnergy()>0.01)?1:0;
100 }
else if(aStep->GetTrack()->GetDefinition()==G4Neutron::Definition()){
101 if (aStep->GetTrack()->GetKineticEnergy()>10.){
105 energy=(aStep->GetTrack()->GetKineticEnergy()>0.1?1:0);
107 }
else if (!aStep->GetTrack()->GetDefinition()->GetPDGCharge())
return;
110 findVolume( aStep->GetPreStepPoint()->GetPosition().rho()*0.1, std::fabs(aStep->GetPreStepPoint()->GetPosition().z()*0.1),
111 aStep->GetPostStepPoint()->GetPosition().rho()*0.1, std::fabs(aStep->GetPostStepPoint()->GetPosition().z()*0.1) );
112 if (
m_list.size()==0)
return;
114 for (
unsigned int i=0;
i<
m_list.size();++
i){
116 m_fluxE[
m_list[
i]][pdgid]->Fill( aStep->GetTrack()->GetKineticEnergy() );
125 {980.,1000.,0.,400.} , {980.,1000.,400.,800.} , {980.,1000.,800.,1200.} ,
126 {750.,770.,0.,200.} , {750.,770.,200.,450.} , {750.,770.,450.,850.} ,
127 {480.,540.,0.,200.} , {480.,540.,200.,400.} , {480.,540.,400.,600.} ,
128 {500.,1000.,1320.,1400.} , {280.,500.,1320.,1400.} , {180.,280.,1320.,1400.} ,
129 {600.,1200.,2120.,2180.} , {400.,600.,2120.,2180.} , {300.,400.,2120.,2180.} ,
130 {450.,600.,700.,760.} , {320.,450.,700.,760.} , {220.,320.,700.,760.} , {100.,200.,720.,760.} , {220.,320.,680.,700.} ,
131 {460.,460.1,0.,350.} , {460.,460.1,350.,655.} , {750.,750.1,0.,740.} , {750.,750.1,740.,1000.} ,
132 {1020.,1020.1,0.,740.} , {1020.,1020.1,740.,1281.} ,
133 {370.,532.,705.,705.1} , {194.,370.,705.,705.1} , {99.,190.,730.,690.} ,
134 {683.,1020.,1301.,1301.1} , {264.,683.,1301.,1301.1} , {176.,264.,1301.,1301.1} ,
135 {600.,1170.,2040.,2040.1} , {447.,700.,2207.,2207.1} , {298.,447.,2207.,2207.1} ,
137 {750.,770.,850.,950.} , {480.,540.,600.,720.} };
144 double myZ1 = z1+(r1!=r2?(z2-z1)/(r2-r1)*(
dim[
i][0]-r1):(z2-z1)*0.5);
145 double myZ2 = z1+(r1!=r2?(z2-z1)/(r2-r1)*(
dim[
i][1]-r1):(z2-z1)*0.5);
146 double myR1 = r1+(z1!=z2?(r2-r1)/(z2-z1)*(
dim[
i][2]-z1):(r2-r1)*0.5);
147 double myR2 = r1+(z1!=z2?(r2-r1)/(z2-z1)*(
dim[
i][3]-z1):(r2-r1)*0.5);
150 if ( r1<
dim[
i][0] && r2>
dim[
i][0] && myZ1>
dim[
i][2] && myZ1<
dim[
i][3] ) hit = 1;
152 else if ( r1>
dim[
i][1] && r2<
dim[
i][1] && myZ2>
dim[
i][2] && myZ2<
dim[
i][3] ) hit = 2;
154 else if ( z1<
dim[
i][2] && z2>
dim[
i][2] && myR1>
dim[
i][0] && myR1<
dim[
i][1] ) hit = 3;
156 else if ( z1>
dim[
i][3] && z2<
dim[
i][3] && myR2>
dim[
i][0] && myR2<
dim[
i][1] ) hit = 4;
161 if ( (r1==
dim[
i][0]&&z1==
dim[
i][2])||(r2==
dim[
i][0]&&r2==
dim[
i][2]) ) hit = 1;
165 double nume_a = (z2 - z1)*(
dim[
i][0] - r1) - (r2 - r1)*(
dim[
i][2] - z1);
169 if(!nume_a && !nume_b) hit=1;
171 double ua = nume_a /
denom;
172 double ub = nume_b /
denom;
173 if(ua >= 0. && ua <= 1. && ub >= 0. && ub <= 1.) hit=2;