ATLAS Offline Software
Loading...
Searching...
No Matches
SctSensorSDTool.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3*/
4
5// SCT Sensitive Detector Tool.
6//
7
8// class header
9#include "SctSensorSDTool.h"
10
11// package includes
12#include "SctSensorSD.h"
13#include "SctSensorGmxSD.h"
14
15#include <GeoModelRead/ReadGeoModel.h>
18
19// STL includes
20#include <exception>
21
22//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
23
24SctSensorSDTool::SctSensorSDTool(const std::string& type, const std::string& name, const IInterface* parent)
25 : SensitiveDetectorBase( type , name , parent ),m_isGmxSensor(false)
26{
27 declareProperty("GmxSensor",m_isGmxSensor);
28}
29
31{
33 return StatusCode::SUCCESS;
34}
35
36StatusCode SctSensorSDTool::Gather(HitCollectionMap& hitCollections)
37{
38 return hitCollections.Record<SiHitCollection>(m_outputCollectionNames[0]);
39}
40
41//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
42
43G4VSensitiveDetector* SctSensorSDTool::makeSD() const
44{
45 ATH_MSG_DEBUG( "Initializing SD" );
46 GeoModelIO::ReadGeoModel* sqlreader = nullptr;
47 StatusCode sc = m_geoDbTagSvc.retrieve();
48 if (sc.isFailure()) {
49 msg(MSG::ERROR) << "Could not locate GeoDbTagSvc" << endmsg;
50 }
51 else {
52 sqlreader = m_geoDbTagSvc->getSqliteReader();
53 }
54
56 {
57 return new SctSensorGmxSD(name(), m_outputCollectionNames[0],sqlreader);
58 }
59 else
60 {
61 return new SctSensorSD(name(), m_outputCollectionNames[0]);
62 }
63}
64
#define endmsg
#define ATH_MSG_DEBUG(x)
static Double_t sc
AtlasHitsVector< SiHit > SiHitCollection
Small wrapper around hit collection map to facilitate accessing the hit collection.
StatusCode Record(std::string const &sgKey, std::string const &hitCollectionName, EventContext const &ctx)
Record the hit collection hitCollectionName to the StoreGate sgKey.
std::pair< StorageIterator, bool > Emplace(std::string const &hitCollectionName, CollectionArgs &&... args)
Insert a container in the map with in-place construction.
ServiceHandle< IGeoDbTagSvc > m_geoDbTagSvc
SctSensorSDTool(const std::string &type, const std::string &name, const IInterface *parent)
virtual StatusCode Gather(HitCollectionMap &) override
End of an athena event.
virtual StatusCode SetupEvent(HitCollectionMap &) override
Beginning of an athena event.
G4VSensitiveDetector * makeSD() const override final
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.
MsgStream & msg
Definition testRead.cxx:32