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>
17
18// STL includes
19#include <exception>
20
21HGTDSensorSDTool::HGTDSensorSDTool(const std::string& type, const std::string& name, const IInterface* parent)
22 : SensitiveDetectorBase( type , name , parent )
23{
24}
25
26G4VSensitiveDetector* HGTDSensorSDTool::makeSD() const
27{
28 // Make sure the job has been set up properly
29 ATH_MSG_DEBUG( "Initializing SD" );
30 GeoModelIO::ReadGeoModel* sqlreader = nullptr;
31 StatusCode sc = m_geoDbTagSvc.retrieve();
32 if (sc.isFailure()) {
33 msg(MSG::ERROR) << "Could not locate GeoDbTagSvc" << endmsg;
34 }
35 else {
36 sqlreader = m_geoDbTagSvc->getSqliteReader();
37 }
38 // Create a fresh SD
39 if (!m_gmxSensor){
40 return new HGTDSensorSD(name(), m_outputCollectionNames[0]);
41 } else {
42 return new HGTDSensorGmxSD(name(), m_outputCollectionNames[0], sqlreader);
43 }
44
45}
#define endmsg
#define ATH_MSG_DEBUG(x)
static Double_t sc
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)
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