ATLAS Offline Software
Loading...
Searching...
No Matches
MinBiasScintillatorSD.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
5//************************************************************
6//
7// Class MinBiasScintillatorSD
8// Sensitive detector for the Minimum Bias Scintillator
9//
10// Author: A. Solodkov
11// April 01, 2006.
12//
13//************************************************************
14
15#ifndef MINBIASSCINTILLATOR_MINBIASSCINTILLATORSD_H
16#define MINBIASSCINTILLATOR_MINBIASSCINTILLATORSD_H
17
18// Base class
19#include "G4VSensitiveDetector.hh"
20
21#include "Identifier/Identifier.h"
24
25// STL headers
26#include <string>
27#include <vector>
28
29// G4 needed classes
30class G4Step;
31class G4TouchableHistory;
32
33class TileTBID;
34
35class MinBiasScintillatorSD: public G4VSensitiveDetector {
36 public:
37 MinBiasScintillatorSD(const G4String& name, const std::string& hitCollectionName,
38 const MinBiasScintSDOptions& opts);
40
41 static constexpr int NCells = 32;
43
44 virtual void Initialize(G4HCofThisEvent*) override final;
45
46 virtual G4bool ProcessHits(G4Step*, G4TouchableHistory*) override final;
47
48 private:
49 // Options for the SD configuration
51
53
54 static const int N_SIDE = 2;
55 static const int N_PHI = 8;
56 static const int N_ETA = 2;
57 static const int N_DIST = N_SIDE * N_ETA;
58
60
61 const std::string m_hitCollectionName;
63
64 inline int cell_index(int side, int phi, int eta) const {
65 return (side * N_PHI + phi) * N_ETA + eta;
66 }
67 inline int dist_index(int side, int eta) const {
68 return side * N_ETA + eta;
69 }
70
75
78 double m_deltaT;
79 std::vector<double> m_deltaTvec;
80
83 double m_timeCut;
84
89
91
92 G4double BirkLaw(const G4Step* aStep) const;
93
97
98 inline double deltaT(double time) const {
99 unsigned int i = 0;
100 double delta = m_deltaTvec[i++];
101 while (i < m_deltaTvec.size()) {
102 if (time > m_deltaTvec[i++] && time < m_deltaTvec[i++]) break;
103 delta = m_deltaTvec[i++];
104 }
105 return delta;
106 }
107};
108
109#endif //MINBIASSCINTILLATOR_MINBIASSCINTILLATORSD_H
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
Identifier m_channelID[NCells]
array to cache look-ups of Identifiers for each cell (size=nCell).
double m_deltaT
granularity in time for hits
~MinBiasScintillatorSD()=default
double deltaT(double time) const
function to provide correct deltaT bin width for given time
HitVectorBuilder * m_hitCollection
const MinBiasScintSDOptions m_options
G4double BirkLaw(const G4Step *aStep) const
MinBiasScintillatorSD(const G4String &name, const std::string &hitCollectionName, const MinBiasScintSDOptions &opts)
static constexpr int NCells
int cell_index(int side, int phi, int eta) const
int dist_index(int side, int eta) const
double m_lateHitTime
time for hits which are above m_timeCut threshold it is equal to m_tilesize_deltaT - m_deltaT
TileHitVectorCellBuilder< NCells > HitVectorBuilder
virtual void Initialize(G4HCofThisEvent *) override final
double m_timeCut
max allowed time for hits
HitVectorBuilder * GetHitCollection()
std::vector< double > m_deltaTvec
const std::string m_hitCollectionName
virtual G4bool ProcessHits(G4Step *, G4TouchableHistory *) override final
Event-owned TileHit accumulator for SDs that merge one TileSimHit per cell.
Helper class for TileCal offline identifiers of ancillary testbeam detectors and MBTS.