ATLAS Offline Software
Loading...
Searching...
No Matches
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
6
7#include "G4Event.hh"
8#include "G4Step.hh"
9#include "G4RunManagerKernel.hh"
10#include "G4EventManager.hh"
11
12
13namespace G4UA
14{
15
16 //---------------------------------------------------------------------------
18 : AthMessaging(Gaudi::svcLocator()->service<IMessageSvc>("MessageSvc"),
19 "HIPLArVolumeAccept")
20 , m_report()
21 , m_HIPacc(false)
22 {}
23
24 //---------------------------------------------------------------------------
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 //---------------------------------------------------------------------------
56 m_HIPacc = false;
57 }
58
59 //---------------------------------------------------------------------------
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
#define ATH_MSG_INFO(x)
AthMessaging(IMessageSvc *msgSvc, const std::string &name)
Constructor.
virtual void BeginOfEventAction(const G4Event *) override
virtual void UserSteppingAction(const G4Step *) override
virtual void EndOfEventAction(const G4Event *) override
=============================================================================