31 #include "EventAction.hh"
33 #include "RunAction.hh"
34 #include "PrimaryGeneratorAction.hh"
35 #include "EventActionMessenger.hh"
36 #include "HistoManager.hh"
45 :detector(det), runAct(run), primary(prim), histoManager(hist)
61 delete eventMessenger;
71 if (evtNb%printModulo == 0)
77 G4int size = totalEnergy.size();
78 if (size < nbOfPixels) {
79 visibleEnergy.resize(nbOfPixels);
80 totalEnergy.resize(nbOfPixels);
83 for (
G4int k=0; k<nbOfPixels; k++) {
84 visibleEnergy[k] = totalEnergy[k] = 0.0;
101 for (
G4int i1=0; i1<n1pxl; i1++) {
104 for (
G4int i2=0; i2<n2pxl; i2++) {
105 G4int k = i1*n1shift + i2;
106 if (visibleEnergy[k] > Eseuil) count++;
109 if (count > 1)
return;
117 for (
G4int i1=0; i1<n1pxl; i1++) {
121 for (
G4int i2=0; i2<n2pxl; i2++) {
122 G4int k = i1*n1shift + i2;
124 layerEvis += visibleEnergy[k];
125 layerEtot += totalEnergy[k];
126 calorEvis += visibleEnergy[k];
127 calorEtot += totalEnergy[k];
130 if (layerEvis > 0.) histoManager->
FillNtuple(1, i1, layerEvis);
131 if (layerEtot > 0.) histoManager->
FillNtuple(1, n1pxl+i1, layerEtot);
136 if (calorEvis > 0.) histoManager->
FillHisto(1,calorEvis);
137 if (calorEtot > 0.) histoManager->
FillHisto(2,calorEtot);
146 if (nbRadLen > 0.) histoManager->
FillHisto(5,nbRadLen);
172 G4String fileName = name +
".pixels.ascii";
175 std::ios::fmtflags mode = File.flags();
176 File.setf( std::ios::scientific, std::ios::floatfield );
177 G4int prec = File.precision(3);
189 File << ekin <<
" " << direction <<
" " << position <<
G4endl;
193 G4int firedPixels = 0;
195 for (
G4int k=0; k<nbOfPixels; k++) {
196 if (totalEnergy[k] > 0.0) firedPixels++;
198 File << firedPixels <<
G4endl;
202 for (
G4int k=0; k<nbOfPixels; k++) {
203 if (totalEnergy[k] > 0.0)
204 File << k <<
" " << visibleEnergy[k] <<
" " << totalEnergy[k] <<
" ";
209 File.setf(mode,std::ios::floatfield);
210 File.precision(prec);
void FillNtuple(G4int id, G4int column, G4double value)
void BeginOfEventAction(const G4Event *)
void fillNbRadLen(G4double)
void AddRowNtuple(G4int id)
void FillHisto(G4int id, G4double bin, G4double weight=1.0)
void fillPerEvent_1(G4int, G4double, G4double)
G4ThreeVector GetParticlePosition()
void fillPerEvent_2(G4int, G4double, G4double)
void EndOfEventAction(const G4Event *)
void SetWriteFile(G4bool)
G4ParticleMomentum GetParticleMomentumDirection() const
G4GLOB_DLL std::ostream G4cout
void WritePixels(const G4Event *)
G4int GetSizeVectorPixels()
G4ParticleGun * GetParticleGun()
void SetWriteFile(G4bool val)
void fillPerEvent_3(G4double, G4double, G4double)
G4double GetParticleEnergy() const