ATLAS Offline Software
Loading...
Searching...
No Matches
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
18MuonWallSDTool::MuonWallSDTool(const std::string& type, const std::string& name, const IInterface* parent)
19 : SensitiveDetectorBase(type, name, parent) {
20}
21
22//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
23
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
66G4VSensitiveDetector* 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}
#define ATH_MSG_ERROR(x)
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_DEBUG(x)
virtual StatusCode SetupEvent() override final
Beginning of an athena event.
MuonWallSDTool(const std::string &type, const std::string &name, const IInterface *parent)
virtual StatusCode Gather() override final
End of an athena event.
G4VSensitiveDetector * makeSD() const override final
void EndOfAthenaEvent()
void StartOfAthenaEvent()
Gaudi::Property< std::vector< std::string > > m_outputCollectionNames
Names of all output collections written out by this SD.
SensitiveDetectorBase(const std::string &type, const std::string &name, const IInterface *parent)
Standard constructor.
G4VSensitiveDetector * getSD()
Retrieve the current SD.