ATLAS Offline Software
Loading...
Searching...
No Matches
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
21// G4 needed classes
22class G4Step;
23class G4HCofThisEvent;
24
25//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
26
27class PixelSensorSD : public G4VSensitiveDetector
28{
29 FRIEND_TEST( PixelSensorSDtest, ProcessHits );
30 FRIEND_TEST( PixelSensorSDtest, AddHit );
31 public:
32 // Constructor
33 PixelSensorSD(const std::string& name, const std::string& hitCollectionName);
34
35 // Process the hits from G4
36 G4bool ProcessHits(G4Step*, G4TouchableHistory*) override final;
37
38 // Initialize from G4
39 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;
51};
52
53#endif //PIXEL_G4_SD_PIXELSENSORSD_H
AtlasHitsVector< SiHit > SiHitCollection
This class is attached to G4Event objects as UserInformation.
void Initialize(G4HCofThisEvent *) override final
FRIEND_TEST(PixelSensorSDtest, ProcessHits)
PixelSensorSD(const std::string &name, const std::string &hitCollectionName)
FRIEND_TEST(PixelSensorSDtest, AddHit)
AtlasG4EventUserInfo * m_g4UserEventInfo
G4bool ProcessHits(G4Step *, G4TouchableHistory *) override final
void AddHit(Args &&... args)
Templated method to stuff a single hit into the sensitive detector class.
SiHitCollection * m_HitColl
std::string m_HitCollName