ATLAS Offline Software
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 
24 SctSensorSDTool::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 
37 {
39  return StatusCode::SUCCESS;
40 }
41 
42 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
43 
44 G4VSensitiveDetector* SctSensorSDTool::makeSD() const
45 {
46  ATH_MSG_DEBUG( "Initializing SD" );
47  GeoModelIO::ReadGeoModel* sqlreader = nullptr;
48  StatusCode sc = m_geoDbTagSvc.retrieve();
49  if (sc.isFailure()) {
50  msg(MSG::ERROR) << "Could not locate GeoDbTagSvc" << endmsg;
51  }
52  else {
53  sqlreader = m_geoDbTagSvc->getSqliteReader();
54  }
55 
56  if(m_isGmxSensor)
57  {
58  return new SctSensorGmxSD(name(), m_outputCollectionNames[0],sqlreader);
59  }
60  else
61  {
62  return new SctSensorSD(name(), m_outputCollectionNames[0]);
63  }
64 }
65 
SensitiveDetectorBase::SetupEvent
virtual StatusCode SetupEvent() override
Beginning of an athena event.
Definition: SensitiveDetectorBase.h:70
HitCollectionMap
Small wrapper around hit collection map to facilitate accessing the hit collection.
Definition: HitCollectionMap.h:21
HitCollectionMap.h
SctSensorSDTool.h
AtlasHitsVector< SiHit >
SensitiveDetectorBase
Common base class for tools that create and manage Geant4 sensitive detectors.
Definition: SensitiveDetectorBase.h:50
SctSensorSDTool::m_geoDbTagSvc
ServiceHandle< IGeoDbTagSvc > m_geoDbTagSvc
Definition: SctSensorSDTool.h:37
SctSensorSD.h
python.CaloAddPedShiftConfig.type
type
Definition: CaloAddPedShiftConfig.py:42
SctSensorSDTool::m_isGmxSensor
bool m_isGmxSensor
Definition: SctSensorSDTool.h:36
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
SctSensorGmxSD.h
HitCollectionMap::Emplace
std::pair< StorageIterator, bool > Emplace(std::string const &hitCollectionName, CollectionArgs &&... args)
Insert a container in the map with in-place construction.
Definition: HitCollectionMap.h:38
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
test_pyathena.parent
parent
Definition: test_pyathena.py:15
SctSensorGmxSD
Definition: SctSensorGmxSD.h:25
SctSensorSD
Definition: SctSensorSD.h:24
SctSensorSDTool::SctSensorSDTool
SctSensorSDTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition: SctSensorSDTool.cxx:24
SensitiveDetectorBase::m_outputCollectionNames
Gaudi::Property< std::vector< std::string > > m_outputCollectionNames
Names of all output collections written out by this SD.
Definition: SensitiveDetectorBase.h:98
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
HitCollectionMap::Record
void Record(std::string const &sgKey, std::string const &hitCollectionName, EventContext const &ctx)
Record the hit collection hitCollectionName to the StoreGate sgKey.
Definition: HitCollectionMap.h:82
SensitiveDetectorBase::Gather
virtual StatusCode Gather() override
End of an athena event.
Definition: SensitiveDetectorBase.h:78
SctSensorSDTool::makeSD
G4VSensitiveDetector * makeSD() const override final
Definition: SctSensorSDTool.cxx:44
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7
SiHitCollection.h