ATLAS Offline Software
Loading...
Searching...
No Matches
HIPKiller.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3*/
4
5#include "HIPKiller.h"
6#include <iostream>
7
8#include "G4Event.hh"
9#include "G4Step.hh"
10#include "G4RunManagerKernel.hh"
11#include "G4EventManager.hh"
12
14#include "CLHEP/Units/PhysicalConstants.h"
15
16#include "GaudiKernel/Bootstrap.h"
17#include "GaudiKernel/ISvcLocator.h"
18#include "GaudiKernel/IMessageSvc.h"
19
20namespace G4UA
21{
22
23 //---------------------------------------------------------------------------
25 : AthMessaging(Gaudi::svcLocator()->service<IMessageSvc>("MessageSvc"),
26 "HIPKiller")
27 {}
28
29 //---------------------------------------------------------------------------
30 void HIPKiller::UserSteppingAction(const G4Step* aStep)
31 {
32 int PDGcode = aStep->GetTrack()->GetDefinition()->GetPDGEncoding();
33
34 // check if PDG code compatible with HIP (Monopole:411xxx0 or Qball:100xxxx0)
35 if ( MC::isMonopole(PDGcode) || ((int)(abs(PDGcode)/10000000) == 1) )
36 {
37 //std::cout << "SB: HIPKiller Step:" << PDGcode << ", energy="
38 // << aStep->GetTrack()->GetKineticEnergy() << std::endl;
39
40 // Kill if energy is less than 1MeV
41 if (aStep->GetTrack()->GetKineticEnergy() < 1.0) {
42 aStep->GetTrack()->SetTrackStatus( fStopAndKill );
43 ATH_MSG_WARNING("HIP " << PDGcode << " is being killed: kinetic energy=" <<
44 aStep->GetTrack()->GetKineticEnergy()/CLHEP::MeV << "MeV");
45 }
46 }
47 }
48
49} // namespace G4UA
#define ATH_MSG_WARNING(x)
ATLAS-specific HepMC functions.
AthMessaging(IMessageSvc *msgSvc, const std::string &name)
Constructor.
virtual void UserSteppingAction(const G4Step *) override
Definition HIPKiller.cxx:30
=============================================================================
bool isMonopole(const T &p)
PDG rule 11i Magnetic monopoles and dyons are assumed to have one unit of Dirac monopole charge and a...