ATLAS Offline Software
Loading...
Searching...
No Matches
PixelSensorSDTool.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// Pixel Sensitive Detector.
6// The Hits are processed here. For every hit I get the position and
7// an information on the sensor in which the interaction happened
8
9// Class header
10#include "PixelSensorSDTool.h"
11
12// For the SD itself
13#include "PixelSensorSD.h"
14#include "PixelSensorGmxSD.h"
15
18#include <GeoModelRead/ReadGeoModel.h>
19
20// STL includes
21#include <exception>
22
23//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
24
25PixelSensorSDTool::PixelSensorSDTool(const std::string& type, const std::string& name, const IInterface* parent)
26 : SensitiveDetectorBase( type , name , parent )
27{
28}
29
31{
33 return StatusCode::SUCCESS;
34}
35
37{
39 return StatusCode::SUCCESS;
40}
41
42//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
43
44G4VSensitiveDetector* PixelSensorSDTool::makeSD() const
45{
46 // Make sure the job has been set up properly
47 ATH_MSG_DEBUG( "Initializing SD" );
48 GeoModelIO::ReadGeoModel* sqlreader = nullptr;
49 StatusCode sc = m_geoDbTagSvc.retrieve();
50 if (sc.isFailure()) {
51 msg(MSG::ERROR) << "Could not locate GeoDbTagSvc" << endmsg;
52 }
53 else {
54 sqlreader = m_geoDbTagSvc->getSqliteReader();
55 }
56
57
58 // Create a fresh SD
59 if (!m_gmxSensor){
60 return new PixelSensorSD(name(), m_outputCollectionNames[0]);
61 } else {
62 return new PixelSensorGmxSD(name(), m_outputCollectionNames[0],sqlreader);
63 }
64}
65
#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.
void 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.
Gaudi::Property< bool > m_gmxSensor
ServiceHandle< IGeoDbTagSvc > m_geoDbTagSvc
PixelSensorSDTool(const std::string &type, const std::string &name, const IInterface *parent)
G4VSensitiveDetector * makeSD() const override final
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