00001 #ifndef SimG4Core_StackingAction_H 00002 #define SimG4Core_StackingAction_H 00003 00004 #include "FWCore/ParameterSet/interface/ParameterSet.h" 00005 00006 #include "G4UserStackingAction.hh" 00007 #include "G4Track.hh" 00008 #include "G4VPhysicalVolume.hh" 00009 00010 class StackingAction : public G4UserStackingAction { 00011 00012 public: 00013 StackingAction(const edm::ParameterSet & ps); 00014 virtual ~StackingAction(); 00015 virtual G4ClassificationOfNewTrack ClassifyNewTrack(const G4Track * aTrack); 00016 virtual void NewStage(); 00017 virtual void PrepareNewEvent(); 00018 private: 00019 void initPointer(); 00020 bool isThisVolume(const G4VTouchable*, G4VPhysicalVolume* ) const; 00021 int isItPrimaryDecayProductOrConversion(const G4Track*, const G4Track &) const; 00022 int isItFromPrimary(const G4Track &, int) const; 00023 private: 00024 G4VPhysicalVolume *tracker, *calo, *muon; 00025 bool savePDandCinTracker, savePDandCinCalo, savePDandCinMuon; 00026 bool killHeavy, trackNeutrino, saveFirstSecondary; 00027 double kmaxIon, kmaxNeutron, kmaxProton; 00028 }; 00029 00030 #endif