ATLAS Offline Software
MuonWallSDTool.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 //************************************************************
6 //
7 // Class MuonWallSD.
8 // Sensitive detector for the muon wall
9 //
10 // Author: franck Martin <Franck.Martin@cern.ch>
11 // january 12, 2004
12 //
13 //************************************************************
14 
15 #include "MuonWallSDTool.h"
16 #include "MuonWallSD.h"
17 
18 MuonWallSDTool::MuonWallSDTool(const std::string& type, const std::string& name, const IInterface* parent)
20 }
21 
22 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
23 
25 
26 }
27 
28 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
29 
31  ATH_MSG_VERBOSE("MuonWallSDTool::SetupEvent()");
32  if (!getSD()) {
33  ATH_MSG_ERROR("SetupEvent: MuonWallSD never created!");
34  return StatusCode::FAILURE;
35  } else {
36  MuonWallSD *localSD = dynamic_cast<MuonWallSD*>(getSD());
37  if (!localSD) {
38  ATH_MSG_ERROR("SetupEvent: Failed to cast m_SD into MuonWallSD.");
39  return StatusCode::FAILURE;
40  }
41  localSD->StartOfAthenaEvent();
42  }
43  return StatusCode::SUCCESS;
44 }
45 
46 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
47 
49  ATH_MSG_VERBOSE("MuonWallSDTool::Gather()");
50  if (!getSD()) {
51  ATH_MSG_ERROR("Gather: MuonWallSD never created!");
52  return StatusCode::FAILURE;
53  } else {
54  MuonWallSD *localSD = dynamic_cast<MuonWallSD*>(getSD());
55  if (!localSD) {
56  ATH_MSG_ERROR("Gather: Failed to cast m_SD into MuonWallSD.");
57  return StatusCode::FAILURE;
58  }
59  localSD->EndOfAthenaEvent();
60  }
61  return StatusCode::SUCCESS;
62 }
63 
64 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
65 
66 G4VSensitiveDetector* MuonWallSDTool::makeSD() const {
67  ATH_MSG_DEBUG("Initializing SD");
68 
69  int verboseLevel=1;
70  if (msgLvl(MSG::VERBOSE)) { verboseLevel = 10; }
71  else if (msgLvl(MSG::DEBUG)) { verboseLevel = 5; }
72 
73  // Create a fresh SD
74  return new MuonWallSD(name(), m_outputCollectionNames[0], verboseLevel);
75 }
SensitiveDetectorBase
Common base class for tools that create and manage Geant4 sensitive detectors.
Definition: SensitiveDetectorBase.h:42
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
MuonWallSD::EndOfAthenaEvent
void EndOfAthenaEvent()
Definition: MuonWallSD.cxx:147
SensitiveDetectorBase::getSD
G4VSensitiveDetector * getSD()
Retrieve the current SD.
Definition: SensitiveDetectorBase.cxx:123
MuonWallSDTool::Gather
virtual StatusCode Gather() override final
End of an athena event.
Definition: MuonWallSDTool.cxx:48
MuonWallSDTool::SetupEvent
virtual StatusCode SetupEvent() override final
Beginning of an athena event.
Definition: MuonWallSDTool.cxx:30
MuonWallSD.h
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
MuonWallSDTool::makeSD
G4VSensitiveDetector * makeSD() const override final
Definition: MuonWallSDTool.cxx:66
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
test_pyathena.parent
parent
Definition: test_pyathena.py:15
MuonWallSD
Definition: MuonWallSD.h:33
SensitiveDetectorBase::m_outputCollectionNames
Gaudi::Property< std::vector< std::string > > m_outputCollectionNames
Names of all output collections written out by this SD.
Definition: SensitiveDetectorBase.h:84
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
DEBUG
#define DEBUG
Definition: page_access.h:11
MuonWallSD::StartOfAthenaEvent
void StartOfAthenaEvent()
Definition: MuonWallSD.cxx:70
MuonWallSDTool::MuonWallSDTool
MuonWallSDTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition: MuonWallSDTool.cxx:18
python.Constants.VERBOSE
int VERBOSE
Definition: Control/AthenaCommon/python/Constants.py:14
MuonWallSDTool::~MuonWallSDTool
~MuonWallSDTool()
Definition: MuonWallSDTool.cxx:24
MuonWallSDTool.h