ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Simulation
G4Utilities
G4UserActions
src
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
13
#include "
TruthUtils/HepMCHelpers.h
"
14
#include "CLHEP/Units/PhysicalConstants.h"
15
16
#include "GaudiKernel/Bootstrap.h"
17
#include "GaudiKernel/ISvcLocator.h"
18
#include "GaudiKernel/IMessageSvc.h"
19
20
namespace
G4UA
21
{
22
23
//---------------------------------------------------------------------------
24
HIPKiller::HIPKiller
()
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
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition
AthMsgStreamMacros.h:32
HIPKiller.h
HepMCHelpers.h
ATLAS-specific HepMC functions.
AthMessaging::AthMessaging
AthMessaging(IMessageSvc *msgSvc, const std::string &name)
Constructor.
Definition
AthMessaging.cxx:13
G4UA::HIPKiller::HIPKiller
HIPKiller()
Definition
HIPKiller.cxx:24
G4UA::HIPKiller::UserSteppingAction
virtual void UserSteppingAction(const G4Step *) override
Definition
HIPKiller.cxx:30
G4UA
for nSW
Definition
CalibrationDefaultProcessing.h:19
Gaudi
=============================================================================
Definition
CaloGPUClusterAndCellDataMonitorOptions.h:273
MC::isMonopole
bool isMonopole(const T &p)
PDG rule 11i Magnetic monopoles and dyons are assumed to have one unit of Dirac monopole charge and a...
Definition
HepMCHelpers.h:652
Generated on
for ATLAS Offline Software by
1.17.0