ATLAS Offline Software
PixelSensorGmxSD.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 /****************************************************************
6  Pixel Sensitive Detector class for GeoModelXML
7  ****************************************************************/
8 
9 #ifndef PIXEL_G4_SD_PIXELSENSORGMXSD_H
10 #define PIXEL_G4_SD_PIXELSENSORGMXSD_H
11 
12 // Base class
13 #include "G4VSensitiveDetector.hh"
14 
15 // use of the hits
17 #include "StoreGate/WriteHandle.h"
18 #include <gtest/gtest_prod.h>
19 
20 // G4 needed classes
21 class G4Step;
22 class G4HCofThisEvent;
23 
24 namespace GeoModelIO{
25  class ReadGeoModel;
26 }
27 
28 class PixelSensorGmxSD : public G4VSensitiveDetector
29 {
30  FRIEND_TEST( PixelSensorGmxSDtest, Initialize );
31  FRIEND_TEST( PixelSensorGmxSDtest, ProcessHits );
32  FRIEND_TEST( PixelSensorGmxSDtest, AddHit );
33  public:
34  // Constructor
35  PixelSensorGmxSD(const std::string& name, const std::string& hitCollectionName, GeoModelIO::ReadGeoModel * sqlreader=nullptr);
36 
37  // Destructor
38  virtual ~PixelSensorGmxSD() { /* I don't own myHitColl if all has gone well */ }
39 
40  // Process the hits from G4
41  virtual G4bool ProcessHits(G4Step*, G4TouchableHistory*) override final;
42 
43  // Initialize from G4
44  virtual void Initialize(G4HCofThisEvent *) override final;
45 
49  template <class... Args> void AddHit(Args&&... args){ m_HitColl->Emplace( args... ); }
50 
51  private:
52  // The hits collection
54  GeoModelIO::ReadGeoModel * m_sqlreader;
55 
56 };
57 
58 #endif //PIXEL_G4_SD_PIXELSENSORGMXSD_H
PixelSensorGmxSD
Definition: PixelSensorGmxSD.h:29
PixelSensorGmxSD::FRIEND_TEST
FRIEND_TEST(PixelSensorGmxSDtest, ProcessHits)
PixelSensorGmxSD::~PixelSensorGmxSD
virtual ~PixelSensorGmxSD()
Definition: PixelSensorGmxSD.h:38
Args
Definition: test_lwtnn_fastgraph.cxx:12
PixelSensorGmxSD::PixelSensorGmxSD
PixelSensorGmxSD(const std::string &name, const std::string &hitCollectionName, GeoModelIO::ReadGeoModel *sqlreader=nullptr)
Definition: PixelSensorGmxSD.cxx:37
WriteHandle.h
Handle class for recording to StoreGate.
PixelSensorGmxSD::AddHit
void AddHit(Args &&... args)
Templated method to stuff a single hit into the sensitive detector class.
Definition: PixelSensorGmxSD.h:49
PixelSensorGmxSD::FRIEND_TEST
FRIEND_TEST(PixelSensorGmxSDtest, AddHit)
PixelSensorGmxSD::Initialize
virtual void Initialize(G4HCofThisEvent *) override final
Definition: PixelSensorGmxSD.cxx:45
GeoModelIO
Definition: IGeoDbTagSvc.h:12
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
SG::WriteHandle
Definition: StoreGate/StoreGate/WriteHandle.h:76
PixelSensorGmxSD::ProcessHits
virtual G4bool ProcessHits(G4Step *, G4TouchableHistory *) override final
Definition: PixelSensorGmxSD.cxx:51
PixelSensorGmxSD::FRIEND_TEST
FRIEND_TEST(PixelSensorGmxSDtest, Initialize)
PixelSensorGmxSD::m_HitColl
SG::WriteHandle< SiHitCollection > m_HitColl
Definition: PixelSensorGmxSD.h:53
PixelSensorGmxSD::m_sqlreader
GeoModelIO::ReadGeoModel * m_sqlreader
Definition: PixelSensorGmxSD.h:54
python.CaloScaleNoiseConfig.args
args
Definition: CaloScaleNoiseConfig.py:80
SiHitCollection.h