ATLAS Offline Software
Loading...
Searching...
No Matches
BCMSensorSD.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// BCM Sensitive Detector class
7// Bostjan Macek 17.may.2007
8//###############################################
9
10#ifndef BCMSENSORSD_H
11#define BCMSENSORSD_H
12
13// Base class
14#include "G4VSensitiveDetector.hh"
15
17// G4 needed classes
18class G4Step;
19
20// use of the hits
22#include <gtest/gtest_prod.h>
23
24class BCMSensorSD : public G4VSensitiveDetector
25{
26 FRIEND_TEST( BCMSensorSDtest, ProcessHits );
27 FRIEND_TEST( BCMSensorSDtest, AddHit );
28 public:
29 // Constructor
30 BCMSensorSD(const std::string& name, const std::string& hitCollectionName);
31
32 // Process the hits from G4
33 G4bool ProcessHits(G4Step*, G4TouchableHistory*) override final;
34
35 // Initialize from G4
36 void Initialize(G4HCofThisEvent *) override final;
37
41 template <class... Args> void AddHit(Args&&... args){ m_HitColl->Emplace( args... ); }
42 private:
43 std::string m_HitCollName;
46};
47
48#endif
AtlasHitsVector< SiHit > SiHitCollection
This class is attached to G4Event objects as UserInformation.
AtlasG4EventUserInfo * m_g4UserEventInfo
Definition BCMSensorSD.h:45
void AddHit(Args &&... args)
Templated method to stuff a single hit into the sensitive detector class.
Definition BCMSensorSD.h:41
FRIEND_TEST(BCMSensorSDtest, AddHit)
std::string m_HitCollName
Name of the hit collection.
Definition BCMSensorSD.h:43
G4bool ProcessHits(G4Step *, G4TouchableHistory *) override final
SiHitCollection * m_HitColl
Pointer to the hit collection.
Definition BCMSensorSD.h:44
BCMSensorSD(const std::string &name, const std::string &hitCollectionName)
FRIEND_TEST(BCMSensorSDtest, ProcessHits)
void Initialize(G4HCofThisEvent *) override final