ATLAS Offline Software
Loading...
Searching...
No Matches
PixelSensorGmxSD.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3*/
4
5/****************************************************************
6 Pixel Sensitive Detector class for GeoModelXML
7 ****************************************************************/
8
9#ifndef PIXEL_G4_SD_PIXELSENSORGMXSD_H
10#define PIXEL_G4_SD_PIXELSENSORGMXSD_H
11
12// Base class
13#include "G4VSensitiveDetector.hh"
14
15// use of the hits
17#include <gtest/gtest_prod.h>
18
20// G4 needed classes
21class G4Step;
22class G4HCofThisEvent;
23
24namespace GeoModelIO{
25 class ReadGeoModel;
26}
27
28class PixelSensorGmxSD : public G4VSensitiveDetector
29{
30 FRIEND_TEST( PixelSensorGmxSDtest, ProcessHits );
31 FRIEND_TEST( PixelSensorGmxSDtest, AddHit );
32 public:
33 // Constructor
34 PixelSensorGmxSD(const std::string& name, const std::string& hitCollectionName, GeoModelIO::ReadGeoModel * sqlreader=nullptr);
35
36 // Process the hits from G4
37 virtual G4bool ProcessHits(G4Step*, G4TouchableHistory*) override final;
38
39 // Initialize from G4
40 virtual void Initialize(G4HCofThisEvent *) override final;
41
45 template <class... Args> void AddHit(Args&&... args){ m_HitColl->Emplace( args... ); }
46
47 private:
48 // The hits collection
49 std::string m_HitCollName;
52 GeoModelIO::ReadGeoModel * m_sqlreader{nullptr};
53
54};
55
56#endif //PIXEL_G4_SD_PIXELSENSORGMXSD_H
AtlasHitsVector< SiHit > SiHitCollection
This class is attached to G4Event objects as UserInformation.
virtual G4bool ProcessHits(G4Step *, G4TouchableHistory *) override final
FRIEND_TEST(PixelSensorGmxSDtest, AddHit)
void AddHit(Args &&... args)
Templated method to stuff a single hit into the sensitive detector class.
PixelSensorGmxSD(const std::string &name, const std::string &hitCollectionName, GeoModelIO::ReadGeoModel *sqlreader=nullptr)
std::string m_HitCollName
FRIEND_TEST(PixelSensorGmxSDtest, ProcessHits)
virtual void Initialize(G4HCofThisEvent *) override final
AtlasG4EventUserInfo * m_g4UserEventInfo
SiHitCollection * m_HitColl
GeoModelIO::ReadGeoModel * m_sqlreader