#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, 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 G4int totalPhotons(G4int num) { return total_Photons[num]; } // return the value currently contained in the total_Photons when the method is invoked. G4int detectedPhotons(G4int num) { return detected_Photons[num]; } // return the value currenly contained in the detected_Photons when the method is invoked. G4double totalPhotonEnergy(G4int num) { return energy_Detected[num]; } G4double totalDepositEnergy(G4int num) { return energy_Deposited[num]; } G4double totalAttenuateEnergy(G4int num) { return energy_Attenuated[num]; } private: FCALDetectorConstruction* detector_Construction; FCALPrimaryGeneratorAction* generator_Action; 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; Int_t event_ID, n_ExCells, row_No[kMaxCells], column_No[kMaxCells]; // event ID, number of excited cells, row number, column number Float_t in_Energy, n_RescaledPhotons[kMaxCells], op_Energy[kMaxCells], dep_Energy[kMaxCells], att_Energy[kMaxCells]; // incident particle energy, number of optical photons, detected optical photon energy, deposited energy TTree* FCAL_Tree; }; #endif /*FCALEventAction_h*/