37 #endif // G4ANALYSIS_USE
41 #include "G4HCofThisEvent.hh"
42 #include "G4VHitsCollection.hh"
65 fECHCID = SDman->
GetCollectionID(colName=
"EMcalorimeter/EMcalorimeterColl");
66 fHCHCID = SDman->
GetCollectionID(colName=
"HadCalorimeter/HadCalorimeterColl");
73 fDc1Hits = fDc2Hits = 0;
74 fDc1XY = fDc2XY = fEvstof = 0;
84 fDc1Hits = hFactory->createHistogram1D(
"Drift Chamber 1 # Hits",50,0,50);
85 fDc2Hits = hFactory->createHistogram1D(
"Drift Chamber 2 # Hits",50,0,50);
88 fDc1XY = hFactory->createCloud2D(
"Drift Chamber 1 X vs Y");
89 fDc2XY = hFactory->createCloud2D(
"Drift Chamber 2 X vs Y");
90 fEvstof = hFactory->createCloud2D(
"EDep vs Time-of-flight");
95 fPlotter->createRegions(3,2);
96 fPlotter->region(0)->plot(*fDc1Hits);
97 fPlotter->region(1)->plot(*fDc2Hits);
98 fPlotter->region(2)->plot(*fDc1XY);
99 fPlotter->region(3)->plot(*fDc2XY);
100 fPlotter->region(4)->plot(*fEvstof);
110 fTuple = tFactory->create(
"MyTuple",
"MyTuple",
"int fDc1Hits, fDc2Hits, double ECEnergy, HCEnergy, time1, time2",
"");
112 #endif // G4ANALYSIS_USE
117 #ifdef G4ANALYSIS_USE
119 #endif // G4ANALYSIS_USE
146 #ifdef G4ANALYSIS_USE
149 if (fDHC1 && fDc1Hits)
152 fDc1Hits->fill(n_hit);
153 for(
int i1=0;i1<n_hit;i1++)
157 if (fDc1XY) fDc1XY->fill(localPos.
y(), localPos.
x());
160 if (fDHC2 && fDc2Hits)
163 fDc2Hits->fill(n_hit);
164 for(
int i1=0;i1<n_hit;i1++)
168 if (fDc2XY) fDc2XY->fill(localPos.
y(), localPos.
x());
176 if (fDHC1) fTuple->fill(0,fDHC1->
entries());
177 if (fDHC2) fTuple->fill(1,fDHC2->
entries());
182 for(
int i1=0;i1<80;i1++)
192 fTuple->fill(2,totalE);
196 double tof = (*fHHC2)[0]->GetTime() - (*fHHC1)[0]->GetTime();
197 if (fEvstof) fEvstof->fill(tof,totalE);
204 for(
int i1=0;i1<20;i1++)
214 fTuple->fill(3,totalE);
216 if (fHHC1 && fHHC1->
entries()==1) fTuple->fill(4,(*fHHC1)[0]->GetTime());
217 if (fHHC2 && fHHC2->
entries()==1) fTuple->fill(5,(*fHHC2)[0]->GetTime());
220 if (fPlotter) fPlotter->refresh();
221 #endif // G4ANALYSIS_USE
226 if (fVerboseLevel==0 || evt->
GetEventID() % fVerboseLevel != 0)
return;
230 <<
">>> Event " << evt->
GetEventID() <<
" >>> Simulation truth : "
237 G4cout <<
"Hodoscope 1 has " << n_hit <<
" hits." <<
G4endl;
238 for(
int i1=0;i1<n_hit;i1++)
247 G4cout <<
"Hodoscope 2 has " << n_hit <<
" hits." <<
G4endl;
248 for(
int i1=0;i1<n_hit;i1++)
257 G4cout <<
"Drift Chamber 1 has " << n_hit <<
" hits." <<
G4endl;
258 for(
int i2=0;i2<5;i2++)
260 for(
int i1=0;i1<n_hit;i1++)
270 G4cout <<
"Drift Chamber 2 has " << n_hit <<
" hits." <<
G4endl;
271 for(
int i2=0;i2<5;i2++)
273 for(
int i1=0;i1<n_hit;i1++)
284 for(
int i1=0;i1<80;i1++)
294 G4cout <<
"EM Calorimeter has " << iHit <<
" hits. Total Edep is "
301 for(
int i1=0;i1<20;i1++)
311 G4cout <<
"Hadron Calorimeter has " << iHit <<
" hits. Total Edep is "