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