ATLAS Offline Software
Loading...
Searching...
No Matches
HGTDSensorSDTool.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3*/
4
5// HGTD Sensitive Detector.
6// The Hits are processed here. For every hit, the position and information
7// on the sensor in which the interaction happened are obtained.
8
9// Class header
10#include "HGTDSensorSDTool.h"
11
12// For the SD itself
13#include "HGTDSensorSD.h"
14#include "HGTDSensorGmxSD.h"
15
16#include <GeoModelRead/ReadGeoModel.h>
19
20// STL includes
21#include <exception>
22
23HGTDSensorSDTool::HGTDSensorSDTool(const std::string& type, const std::string& name, const IInterface* parent)
24 : SensitiveDetectorBase( type , name , parent )
25{
26}
27
29{
32 return StatusCode::SUCCESS;
33}
34
35StatusCode HGTDSensorSDTool::Gather(HitCollectionMap& hitCollections)
36{
38 return StatusCode::SUCCESS;
39}
40
41G4VSensitiveDetector* HGTDSensorSDTool::makeSD() const
42{
43 // Make sure the job has been set up properly
44 ATH_MSG_DEBUG( "Initializing SD" );
45 GeoModelIO::ReadGeoModel* sqlreader = nullptr;
46 StatusCode sc = m_geoDbTagSvc.retrieve();
47 if (sc.isFailure()) {
48 msg(MSG::ERROR) << "Could not locate GeoDbTagSvc" << endmsg;
49 }
50 else {
51 sqlreader = m_geoDbTagSvc->getSqliteReader();
52 }
53 // Create a fresh SD
54 if (!m_gmxSensor){
55 return new HGTDSensorSD(name(), m_outputCollectionNames[0]);
56 } else {
57 return new HGTDSensorGmxSD(name(), m_outputCollectionNames[0], sqlreader);
58 }
59
60}
#define endmsg
#define ATH_MSG_DEBUG(x)
#define CHECK(...)
Evaluate an expression and check for errors.
static Double_t sc
AtlasHitsVector< SiHit > SiHitCollection
virtual G4VSensitiveDetector * makeSD() const override final
Gaudi::Property< bool > m_gmxSensor
ServiceHandle< IGeoDbTagSvc > m_geoDbTagSvc
HGTDSensorSDTool(const std::string &type, const std::string &name, const IInterface *parent)
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.
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.
MsgStream & msg
Definition testRead.cxx:32