ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Simulation
G4Utilities
G4UserActions
src
HIPLArVolumeAccept.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 "
HIPLArVolumeAccept.h
"
6
7
#include "G4Event.hh"
8
#include "G4Step.hh"
9
#include "G4RunManagerKernel.hh"
10
#include "G4EventManager.hh"
11
12
13
namespace
G4UA
14
{
15
16
//---------------------------------------------------------------------------
17
HIPLArVolumeAccept::HIPLArVolumeAccept
()
18
:
AthMessaging
(
Gaudi
::svcLocator()->service<IMessageSvc>(
"MessageSvc"
),
19
"HIPLArVolumeAccept"
)
20
,
m_report
()
21
,
m_HIPacc
(false)
22
{}
23
24
//---------------------------------------------------------------------------
25
void
HIPLArVolumeAccept::UserSteppingAction
(
const
G4Step* aStep)
26
{
27
int
PDGcode=aStep->GetTrack()->GetDefinition()->GetPDGEncoding();
28
29
// check if PDG code compatible with HIP (Monopole:411xxx0 or Qball:100xxxx0)
30
if
(abs(PDGcode)>4000000 && abs(PDGcode)<90000000)
// likely a HIP, no heavy ion
31
{
32
// in EM calorimeter barrel mother volume (beyond presampler)
33
if
(!
m_HIPacc
&& aStep->GetTrack()->GetVolume()->GetName()==
"Total LAR Volume"
)
// EMB
34
{
35
m_HIPacc
=1;
36
ATH_MSG_INFO
(
"HIPLArVolumeAccept: a particle with PDG code "
37
<<PDGcode
38
<<
" entered the volume "
39
<<aStep->GetTrack()->GetVolume()->GetName());
40
}
41
// in EM calorimeter endcap mother volume
42
if
(!
m_HIPacc
&& aStep->GetTrack()->GetVolume()->GetName()==
"LArEndcapPos"
)
// EMEC
43
{
44
m_HIPacc
=1;
45
ATH_MSG_INFO
(
"HIPLArVolumeAccept: a particle with PDG code "
46
<<PDGcode
47
<<
" entered the volume "
48
<<aStep->GetTrack()->GetVolume()->GetName());
49
}
50
}
51
52
}
53
54
//---------------------------------------------------------------------------
55
void
HIPLArVolumeAccept::BeginOfEventAction
(
const
G4Event*){
56
m_HIPacc
=
false
;
57
}
58
59
//---------------------------------------------------------------------------
60
void
HIPLArVolumeAccept::EndOfEventAction
(
const
G4Event*)
61
{
62
m_report
.HIPevts++;
63
if
(!
m_HIPacc
)
64
{
65
//anEvent->SetEventAborted();
66
G4RunManagerKernel *rmk = G4RunManagerKernel::GetRunManagerKernel();
67
rmk->GetEventManager()->AbortCurrentEvent();
68
rmk->GetEventManager()->GetNonconstCurrentEvent()->SetEventAborted();
69
m_report
.HIPevts_failed++;
70
ATH_MSG_INFO
(
"HIPLArVolumeAccept: no HIP reach the LAr detector volumes. Event aborted."
);
71
}
72
}
73
74
}
// namespace G4UA
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition
AthMsgStreamMacros.h:31
HIPLArVolumeAccept.h
AthMessaging::AthMessaging
AthMessaging(IMessageSvc *msgSvc, const std::string &name)
Constructor.
Definition
AthMessaging.cxx:13
G4UA::HIPLArVolumeAccept::BeginOfEventAction
virtual void BeginOfEventAction(const G4Event *) override
Definition
HIPLArVolumeAccept.cxx:55
G4UA::HIPLArVolumeAccept::UserSteppingAction
virtual void UserSteppingAction(const G4Step *) override
Definition
HIPLArVolumeAccept.cxx:25
G4UA::HIPLArVolumeAccept::m_HIPacc
bool m_HIPacc
Definition
HIPLArVolumeAccept.h:46
G4UA::HIPLArVolumeAccept::m_report
Report m_report
Definition
HIPLArVolumeAccept.h:45
G4UA::HIPLArVolumeAccept::HIPLArVolumeAccept
HIPLArVolumeAccept()
Definition
HIPLArVolumeAccept.cxx:17
G4UA::HIPLArVolumeAccept::EndOfEventAction
virtual void EndOfEventAction(const G4Event *) override
Definition
HIPLArVolumeAccept.cxx:60
G4UA
for nSW
Definition
CalibrationDefaultProcessing.h:19
Gaudi
=============================================================================
Definition
CaloGPUClusterAndCellDataMonitorOptions.h:273
Generated on
for ATLAS Offline Software by
1.17.0