ATLAS Offline Software
Loading...
Searching...
No Matches
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 <gtest/gtest_prod.h>
18
20// G4 needed classes
21class G4Step;
22class G4TouchableHistory;
23
24class SctSensorSD : public G4VSensitiveDetector
25{
26 FRIEND_TEST( SctSensorSDtest, ProcessHits );
27 FRIEND_TEST( SctSensorSDtest, indexMethod );
28 FRIEND_TEST( SctSensorSDtest, AddHit );
29public:
30 // Constructor
31 SctSensorSD(const std::string& name, const std::string& hitCollectionName);
32
33 // Destructor
34 ~SctSensorSD() { /* If all goes well we do not own myHitColl here */ }
35
36 // Deal with each G4 hit
37 G4bool ProcessHits(G4Step*, G4TouchableHistory*) override;
38
39 // For setting up the hit collection
40 void Initialize(G4HCofThisEvent*) override final;
41
45 template <class... Args> void AddHit(Args&&... args){ m_HitColl->Emplace( args... ); }
46
47private:
48 void indexMethod(const G4TouchableHistory *myTouch, double coord1z, int &brlEcap, int &layerDisk, int &etaMod, int &phiMod, int &side);
49protected:
50 // The hits collection
51 std::string m_HitCollName;
54};
55
56#endif //SCT_G4_SD_SCTSENSORSD_H
AtlasHitsVector< SiHit > SiHitCollection
This class is attached to G4Event objects as UserInformation.
void indexMethod(const G4TouchableHistory *myTouch, double coord1z, int &brlEcap, int &layerDisk, int &etaMod, int &phiMod, int &side)
std::string m_HitCollName
Definition SctSensorSD.h:51
FRIEND_TEST(SctSensorSDtest, AddHit)
G4bool ProcessHits(G4Step *, G4TouchableHistory *) override
FRIEND_TEST(SctSensorSDtest, ProcessHits)
void Initialize(G4HCofThisEvent *) override final
SctSensorSD(const std::string &name, const std::string &hitCollectionName)
FRIEND_TEST(SctSensorSDtest, indexMethod)
SiHitCollection * m_HitColl
Definition SctSensorSD.h:52
void AddHit(Args &&... args)
Templated method to stuff a single hit into the sensitive detector class.
Definition SctSensorSD.h:45
AtlasG4EventUserInfo * m_g4UserEventInfo
Definition SctSensorSD.h:53