#ifndef FCALEventAction_h #define FCALEventAction_h 1 #include "G4UserEventAction.hh" #include "TTree.h" #include "globals.hh" class G4Event; class FCALDetectorConstruction; class FCALPrimaryGeneratorAction; class TTree; class FCALEventAction : public G4UserEventAction { public: enum { kMaxCells = 2000 }; FCALEventAction(FCALDetectorConstruction* detector_Con, FCALPrimaryGeneratorAction* generator_Act, G4int Interact, TTree* tree); ~FCALEventAction(); void BeginOfEventAction(const G4Event*); // the definiton of a pure virtual method, BeginOfEventAction void EndOfEventAction(const G4Event*); // it is not, actually, required to add the keyword 'virtual' void countPhotons(G4double x_Pos, G4double y_Pos); // the method to count the number of the Photons void countHits(G4int copy_No); // the method to count the number of the Hits void addEnergy(G4double photon_Eng, G4int copy_No); // the method to add energy void addEnergyDeposit(G4double energy_Dep, G4int copy_No); // the method to add energy deposited void addEnergyAttenuate(G4double energy_att, G4int copy_No); void resetCounters(); // the method to reset // the methode to store the start location of the shower void recordShowerStart(Float_t Wx, Float_t Wy, Float_t Wz, Float_t Lx, Float_t Ly, Float_t Lz); // save initial photon energy void recordPhotonEnergy(Float_t E); G4int gettotalPhotons(G4int num) { return total_Photons[num]; } // return the value currently contained in the total_Photons when the method is invoked. G4int getdetectedPhotons(G4int num) { return detected_Photons[num]; } // return the value currenly contained in the detected_Photons when the method is invoked. G4double gettotalPhotonEnergy(G4int num) { return energy_Detected[num]; } G4double gettotalDepositEnergy(G4int num) { return energy_Deposited[num]; } G4double gettotalAttenuateEnergy(G4int num) { return energy_Attenuated[num]; } private: FCALDetectorConstruction* detector_Construction; FCALPrimaryGeneratorAction* generator_Action; G4int Interactive; G4int n_Cells; G4int n_ExcitedCells; // the number of the photocathodes detecting, at least, one optical photon. G4int* total_Photons; // declare the pointer variable to contain the total number of produced photons. G4int* detected_Photons; // declare the pointer instance to contain the total number of detected photons. G4double* energy_Detected; G4double* energy_Deposited; G4double* energy_Attenuated; Float_t ShowerStartWx; Float_t ShowerStartWy; Float_t ShowerStartWz; Float_t ShowerStartLx; Float_t ShowerStartLy; Float_t ShowerStartLz; // event ID, number of excited cells, row number, column number Int_t event_ID, n_ExCells, row_No[kMaxCells], column_No[kMaxCells]; // incident particle energy, number of optical photons, // detected optical photon energy, deposited energy Float_t in_Energy, n_RescaledPhotons[kMaxCells], op_Energy[kMaxCells]; Float_t dep_Energy[kMaxCells], att_Energy[kMaxCells]; TTree* FCAL_Tree; }; #endif /*FCALEventAction_h*/