CLARION2_GEANT4/CloverEventAction.hh
2022-10-17 18:02:56 -04:00

64 lines
1.7 KiB
C++

#ifndef CloverEventAction_h
#define CloverEventAction_h 1
#include "G4UserEventAction.hh"
#include "CloverCrystalHit.hh"
#include "BGOHIT.hh"
#include "globals.hh"
#include <vector>
/// Event action class
///
/// In EndOfEventAction(), it prints the accumulated quantities of the energy
/// deposit and track lengths of charged particles in Crystal
/// stored in the hits collections.
class CloverEventAction : public G4UserEventAction
{
public:
CloverEventAction();
virtual ~CloverEventAction();
virtual void BeginOfEventAction(const G4Event* event);
virtual void EndOfEventAction(const G4Event* event);
std::vector<G4double>& GetdEList() {return fdEList;};
std::vector<G4double>& GetStepLengthList() {return fdLList;};
std::vector<G4double>& GetBEList000() {return fBEList;};
std::vector<G4double>& GetBStepLengthList() {return fBLList;};
private:
// methods
CloverCrystalHitsCollection* GetHitsCollection(G4int hcID, const G4Event* event) const;
BGOHitsCollection* GetHitsBGOCollection(G4int hcID, const G4Event* event) const;
void PrintEventStatistics(G4double absoEdep, G4double absoTrackLength) const;
// data members
G4int fCrystalHCID; // Hit collection ID
G4int fBGOHCID; // Hit collection ID
//clover
G4int fNDet;
//bgo
G4int fNBGODet;
std::vector<G4double> fdEList; // dE of each crystal
std::vector<G4double> fdLList; // step length of each crystal
std::vector<G4double> fBEList; // dE of each crystal
std::vector<G4double> fBLList; // step length of each crystal
//std::vector<G4double> fLastPost; //last tracking position
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif