ATLAS Offline Software
SctSensorSD.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 /****************************************************************
6  SCT Sensitive Detector class
7 ****************************************************************/
8 
9 #ifndef SCT_G4_SD_SCTSENSORSD_H
10 #define SCT_G4_SD_SCTSENSORSD_H
11 
12 // Base class
13 #include "G4VSensitiveDetector.hh"
14 
15 // For the hits
17 #include "StoreGate/WriteHandle.h"
18 #include <gtest/gtest_prod.h>
19 
20 // G4 needed classes
21 class G4Step;
22 class G4TouchableHistory;
23 
24 class SctSensorSD : public G4VSensitiveDetector
25 {
26  FRIEND_TEST( SctSensorSDtest, Initialize );
27  FRIEND_TEST( SctSensorSDtest, ProcessHits );
28  FRIEND_TEST( SctSensorSDtest, indexMethod );
29  FRIEND_TEST( SctSensorSDtest, AddHit );
30 public:
31  // Constructor
32  SctSensorSD(const std::string& name, const std::string& hitCollectionName);
33 
34  // Destructor
35  ~SctSensorSD() { /* If all goes well we do not own myHitColl here */ }
36 
37  // Deal with each G4 hit
38  G4bool ProcessHits(G4Step*, G4TouchableHistory*) override;
39 
40  // For setting up the hit collection
41  void Initialize(G4HCofThisEvent*) override final;
42 
46  template <class... Args> void AddHit(Args&&... args){ m_HitColl->Emplace( args... ); }
47 
48 private:
49  void indexMethod(const G4TouchableHistory *myTouch, double coord1z, int &brlEcap, int &layerDisk, int &etaMod, int &phiMod, int &side);
50 protected:
51  // The hits collection
53 };
54 
55 #endif //SCT_G4_SD_SCTSENSORSD_H
SctSensorSD::ProcessHits
G4bool ProcessHits(G4Step *, G4TouchableHistory *) override
Definition: SctSensorSD.cxx:46
SctSensorSD::SctSensorSD
SctSensorSD(const std::string &name, const std::string &hitCollectionName)
Definition: SctSensorSD.cxx:31
SctSensorSD::m_HitColl
SG::WriteHandle< SiHitCollection > m_HitColl
Definition: SctSensorSD.h:52
SctSensorSD::FRIEND_TEST
FRIEND_TEST(SctSensorSDtest, ProcessHits)
Args
Definition: test_lwtnn_fastgraph.cxx:12
SctSensorSD::FRIEND_TEST
FRIEND_TEST(SctSensorSDtest, indexMethod)
TRT::Hit::side
@ side
Definition: HitInfo.h:83
WriteHandle.h
Handle class for recording to StoreGate.
SctSensorSD::~SctSensorSD
~SctSensorSD()
Definition: SctSensorSD.h:35
SctSensorSD::FRIEND_TEST
FRIEND_TEST(SctSensorSDtest, Initialize)
SctSensorSD
Definition: SctSensorSD.h:25
SctSensorSD::Initialize
void Initialize(G4HCofThisEvent *) override final
Definition: SctSensorSD.cxx:39
SctSensorSD::indexMethod
void indexMethod(const G4TouchableHistory *myTouch, double coord1z, int &brlEcap, int &layerDisk, int &etaMod, int &phiMod, int &side)
Definition: SctSensorSD.cxx:113
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
SG::WriteHandle
Definition: StoreGate/StoreGate/WriteHandle.h:76
SctSensorSD::AddHit
void AddHit(Args &&... args)
Templated method to stuff a single hit into the sensitive detector class.
Definition: SctSensorSD.h:46
fillSCTHists.etaMod
etaMod
Definition: fillSCTHists.py:23
python.CaloScaleNoiseConfig.args
args
Definition: CaloScaleNoiseConfig.py:80
SctSensorSD::FRIEND_TEST
FRIEND_TEST(SctSensorSDtest, AddHit)
SiHitCollection.h