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
18#include "MuonWallSD.h"
20
21MuonWallSDTool::MuonWallSDTool(const std::string& type, const std::string& name, const IInterface* parent)
22 : SensitiveDetectorBase(type, name, parent) {
23}
24
25//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
26
30
31//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
32
33StatusCode MuonWallSDTool::SetupEvent(HitCollectionMap& hitCollections) {
34 ATH_MSG_VERBOSE("MuonWallSDTool::SetupEvent()");
36 return StatusCode::SUCCESS;
37}
38
39//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
40
41StatusCode MuonWallSDTool::Gather(HitCollectionMap& hitCollections) {
42 ATH_MSG_VERBOSE("MuonWallSDTool::Gather()");
43 return hitCollections.TransformAndRecord<TileHitVector>(m_outputCollectionNames[0], [](TileHitVector& hits) {
44 static_cast<MuonWallSD::HitVectorBuilder&>(hits).Finalize();
45 });
46}
47
48//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
49
50G4VSensitiveDetector* MuonWallSDTool::makeSD() const {
51 ATH_MSG_DEBUG("Initializing SD");
52
53 int verboseLevel=1;
54 if (msgLvl(MSG::VERBOSE)) { verboseLevel = 10; }
55 else if (msgLvl(MSG::DEBUG)) { verboseLevel = 5; }
56
57 // Create a fresh SD
58 return new MuonWallSD(name(), m_outputCollectionNames[0], verboseLevel);
59}
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_DEBUG(x)
AtlasHitsVector< TileHit > TileHitVector
Small wrapper around hit collection map to facilitate accessing the hit collection.
std::pair< StorageIterator, bool > Emplace(std::string const &hitCollectionName, CollectionArgs &&... args)
Insert a container in the map with in-place construction.
StatusCode TransformAndRecord(std::string const &sgKey, std::string const &hitCollectionName, EventContext const &ctx, std::function< void(T &)> transform)
Record the hit collection hitCollectionName to the StoreGate sgKey, applying a transformation functio...
MuonWallSDTool(const std::string &type, const std::string &name, const IInterface *parent)
G4VSensitiveDetector * makeSD() const override final
TileHitVectorCellBuilder< NCells > HitVectorBuilder
Definition MuonWallSD.h:38
virtual StatusCode Gather() override
End of an athena event.
virtual StatusCode SetupEvent() override
Beginning of an athena event.
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.