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