Go to the documentation of this file.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 "G4Region.hh"
00008 #include "G4Track.hh"
00009 #include "G4LogicalVolume.hh"
00010
00011 #include <string>
00012 #include <vector>
00013
00014 class StackingAction : public G4UserStackingAction {
00015
00016 public:
00017 StackingAction(const edm::ParameterSet & ps);
00018 virtual ~StackingAction();
00019 virtual G4ClassificationOfNewTrack ClassifyNewTrack(const G4Track * aTrack);
00020 virtual void NewStage();
00021 virtual void PrepareNewEvent();
00022 private:
00023 void initPointer();
00024 bool isThisVolume(const G4VTouchable*, std::vector<G4LogicalVolume*>&) const;
00025 int isItPrimaryDecayProductOrConversion(const G4Track*, const G4Track &) const;
00026 int isItFromPrimary(const G4Track &, int) const;
00027 bool isItLongLived(const G4Track*) const;
00028 private:
00029 bool savePDandCinTracker, savePDandCinCalo;
00030 bool savePDandCinMuon, saveFirstSecondary;
00031 bool killHeavy, trackNeutrino, killDeltaRay;
00032 double kmaxIon, kmaxNeutron, kmaxProton;
00033 double maxTrackTime;
00034 std::vector<double> maxTrackTimes;
00035 std::vector<std::string> maxTimeNames;
00036 std::vector<G4Region*> maxTimeRegions;
00037 std::vector<G4LogicalVolume*> tracker, calo, muon;
00038 };
00039
00040 #endif