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 <gtest/gtest_prod.h>
18 
19 // G4 needed classes
20 class G4Step;
21 class G4HCofThisEvent;
22 
23 namespace GeoModelIO{
24  class ReadGeoModel;
25 }
26 
27 class PixelSensorGmxSD : public G4VSensitiveDetector
28 {
29  FRIEND_TEST( PixelSensorGmxSDtest, ProcessHits );
30  FRIEND_TEST( PixelSensorGmxSDtest, AddHit );
31  public:
32  // Constructor
33  PixelSensorGmxSD(const std::string& name, const std::string& hitCollectionName, GeoModelIO::ReadGeoModel * sqlreader=nullptr);
34 
35  // Process the hits from G4
36  virtual G4bool ProcessHits(G4Step*, G4TouchableHistory*) override final;
37 
38  // Initialize from G4
39  virtual void Initialize(G4HCofThisEvent *) override final;
40 
44  template <class... Args> void AddHit(Args&&... args){ m_HitColl->Emplace( args... ); }
45 
46  private:
47  // The hits collection
48  std::string m_HitCollName;
50  GeoModelIO::ReadGeoModel * m_sqlreader{nullptr};
51 
52 };
53 
54 #endif //PIXEL_G4_SD_PIXELSENSORGMXSD_H
python.CaloAddPedShiftConfig.args
args
Definition: CaloAddPedShiftConfig.py:47
PixelSensorGmxSD
Definition: PixelSensorGmxSD.h:28
AtlasHitsVector< SiHit >
PixelSensorGmxSD::FRIEND_TEST
FRIEND_TEST(PixelSensorGmxSDtest, ProcessHits)
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:36
AtlasHitsVector::Emplace
void Emplace(Args &&... args)
Definition: AtlasHitsVector.h:80
PixelSensorGmxSD::AddHit
void AddHit(Args &&... args)
Templated method to stuff a single hit into the sensitive detector class.
Definition: PixelSensorGmxSD.h:44
PixelSensorGmxSD::FRIEND_TEST
FRIEND_TEST(PixelSensorGmxSDtest, AddHit)
PixelSensorGmxSD::Initialize
virtual void Initialize(G4HCofThisEvent *) override final
Definition: PixelSensorGmxSD.cxx:44
GeoModelIO
Definition: IGeoDbTagSvc.h:12
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
PixelSensorGmxSD::ProcessHits
virtual G4bool ProcessHits(G4Step *, G4TouchableHistory *) override final
Definition: PixelSensorGmxSD.cxx:56
PixelSensorGmxSD::m_HitColl
SiHitCollection * m_HitColl
Definition: PixelSensorGmxSD.h:49
PixelSensorGmxSD::m_HitCollName
std::string m_HitCollName
Definition: PixelSensorGmxSD.h:48
PixelSensorGmxSD::m_sqlreader
GeoModelIO::ReadGeoModel * m_sqlreader
Definition: PixelSensorGmxSD.h:50
SiHitCollection.h