ATLAS Offline Software
FCS_StepInfoSD.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef ISF_FASTCALOSIM_FCS_STEPINFOSD_H
6 #define ISF_FASTCALOSIM_FCS_STEPINFOSD_H
7 
8 #include "G4VSensitiveDetector.hh"
9 
10 #include "CaloIdentifier/CaloCell_ID.h" // For CaloCell_ID::CaloSample
12 
13 #include "LArSimEvent/LArHit.h"
14 #include "CLHEP/Units/SystemOfUnits.h"
15 
19 
21 #include "CxxUtils/CachedPointer.h"
22 
23 #include <map>
24 #include <vector>
25 
26 // Forward declarations
27 class G4Step;
28 class G4TouchableHistory;
29 
30 class LArEM_ID;
31 class LArFCAL_ID;
32 class LArHEC_ID;
33 class TileID;
34 
35 class LArHitContainer;
36 
37 class StoreGateSvc;
38 
39 namespace FCS_Param {
40 
41  struct Config
42  {
44  int verboseLevel=0;
45  bool shift_lar_subhit=true;
46  bool shorten_lar_step=false;
47  double substpsize = 0.2*CLHEP::mm; //size of splitting into substeps before calling the calculators.
48 
49  // Merging properties
50  double m_maxRadius=25.;
51  double m_maxRadiusFine=1.;
52  double m_maxRadiusLAr=25.;
53  double m_maxRadiusHEC=100.;
54  double m_maxRadiusFCAL=100.;
55  double m_maxRadiusTile=100.;
56 
57  double m_maxTime=25.;
58  double m_maxTimeLAr=25.;
59  double m_maxTimeHEC=25.;
60  double m_maxTimeFCAL=25.;
61  double m_maxTimeTile=25.;
62 
63  // Optimised merging scheme
64  double m_maxEtaPS=1.;
65  double m_maxPhiPS=5.;
66  double m_maxrPS=0.;
67 
68  double m_maxEtaEM1=1.;
69  double m_maxPhiEM1=5.;
70  double m_maxrEM1=15.;
71 
72  double m_maxEtaEM2=1.;
73  double m_maxPhiEM2=5.;
74  double m_maxrEM2=60.;
75 
76  double m_maxEtaEM3=1.;
77  double m_maxPhiEM3=5.;
78  double m_maxrEM3=8.;
79 
82  };
83 
84 }
85 
92 class FCS_StepInfoSD : public G4VSensitiveDetector
93 {
94 public:
95 
97  FCS_StepInfoSD(G4String a_name, const FCS_Param::Config& config);
98 
100  virtual G4bool ProcessHits(G4Step* a_step, G4TouchableHistory*) override;
101 
104 
106  void setupHelpers( const LArEM_ID* EM ,
107  const LArFCAL_ID* FCAL ,
108  const LArHEC_ID* HEC ,
109  const TileID* tile) {
110  m_larEmID = EM;
111  m_larFcalID = FCAL;
112  m_larHecID = HEC;
113  m_tileID = tile;
114  }
115 
116 protected:
120  void getCaloDDManager();
121  void update_map(const CLHEP::Hep3Vector & l_vec, const Identifier & l_identifier, double l_energy, double l_time, bool l_valid, int l_detector, double timeWindow, double distanceWindow);
124  const LArEM_ID* m_larEmID{nullptr};
125  const LArFCAL_ID* m_larFcalID{nullptr};
126  const LArHEC_ID* m_larHecID{nullptr};
127  const TileID* m_tileID{nullptr};
129  std::map< Identifier , std::vector< ISF_FCS_Parametrization::FCS_StepInfo* >* > m_hit_map;
130 
131 private:
133  double getMaxTime(const CaloCell_ID::CaloSample& layer) const;
135  double getMaxRadius(const CaloCell_ID::CaloSample& layer) const;
137  double getMaxDeltaR(const CaloCell_ID::CaloSample& layer) const;
139  double getMaxDeltaEta(const CaloCell_ID::CaloSample& layer) const;
141  double getMaxDeltaPhi(const CaloCell_ID::CaloSample& layer) const;
142 
143 };
144 
145 #endif // ISF_FASTCALOSIM_FCS_STEPINFOSD_H
FCS_StepInfoSD::m_hit_map
std::map< Identifier, std::vector< ISF_FCS_Parametrization::FCS_StepInfo * > * > m_hit_map
Definition: FCS_StepInfoSD.h:129
FCS_StepInfoSD::update_map
void update_map(const CLHEP::Hep3Vector &l_vec, const Identifier &l_identifier, double l_energy, double l_time, bool l_valid, int l_detector, double timeWindow, double distanceWindow)
Definition: FCS_StepInfoSD.cxx:158
FCS_StepInfoCollection.h
LArSamples::HEC
@ HEC
Definition: CaloId.h:26
FCS_Param::Config::m_maxEtaEM3
double m_maxEtaEM3
Definition: FCS_StepInfoSD.h:76
FCS_StepInfoSD::getCaloDDManager
void getCaloDDManager()
Keep a map instead of trying to keep the full vector.
Definition: FCS_StepInfoSD.cxx:145
FCS_Param::Config::m_maxRadius
double m_maxRadius
property, see LArG4GenShowerLib::LArG4GenShowerLib
Definition: FCS_StepInfoSD.h:50
ITileCalculator
Definition: ITileCalculator.h:67
FCS_StepInfoSD::getMaxTime
double getMaxTime(const CaloCell_ID::CaloSample &layer) const
Definition: FCS_StepInfoSD.cxx:39
FCS_Param::Config::shift_lar_subhit
bool shift_lar_subhit
Definition: FCS_StepInfoSD.h:45
FCS_Param::Config::m_LArCalculator
ILArCalculatorSvc * m_LArCalculator
Definition: FCS_StepInfoSD.h:80
LArHEC_ID
Helper class for LArHEC offline identifiers.
Definition: LArHEC_ID.h:85
FCS_StepInfoSD::m_calo_dd_man
CxxUtils::CachedPointer< const CaloDetDescrManager > m_calo_dd_man
Definition: FCS_StepInfoSD.h:128
LArHitContainer
Hit collection.
Definition: LArHitContainer.h:26
FCS_StepInfoSD::getMaxDeltaR
double getMaxDeltaR(const CaloCell_ID::CaloSample &layer) const
Definition: FCS_StepInfoSD.cxx:69
FCS_Param::Config::m_maxRadiusFine
double m_maxRadiusFine
property, see LArG4GenShowerLib::LArG4GenShowerLib
Definition: FCS_StepInfoSD.h:51
FCS_Param::Config::m_maxEtaPS
double m_maxEtaPS
Definition: FCS_StepInfoSD.h:64
FCS_Param::Config::m_maxrEM3
double m_maxrEM3
Definition: FCS_StepInfoSD.h:78
FCS_Param::Config::m_maxrEM1
double m_maxrEM1
Definition: FCS_StepInfoSD.h:70
FCS_Param::Config::m_maxrEM2
double m_maxrEM2
Definition: FCS_StepInfoSD.h:74
FCS_StepInfoSD::setupHelpers
void setupHelpers(const LArEM_ID *EM, const LArFCAL_ID *FCAL, const LArHEC_ID *HEC, const TileID *tile)
Sets the ID helper pointers.
Definition: FCS_StepInfoSD.h:106
FCS_Param::Config::substpsize
double substpsize
Definition: FCS_StepInfoSD.h:47
CaloDetDescrManager.h
Definition of CaloDetDescrManager.
config
Definition: PhysicsAnalysis/AnalysisCommon/AssociationUtils/python/config.py:1
CachedPointer.h
Cached pointer with atomic update.
CaloCell_ID.h
ReadCellNoiseFromCool.tile
tile
Definition: ReadCellNoiseFromCool.py:92
FCS_StepInfoSD::FCS_StepInfoSD
FCS_StepInfoSD(G4String a_name, const FCS_Param::Config &config)
Constructor.
Definition: FCS_StepInfoSD.cxx:23
FCS_Param::Config::m_maxPhiPS
double m_maxPhiPS
Definition: FCS_StepInfoSD.h:65
FCS_Param::Config::m_maxPhiEM3
double m_maxPhiEM3
Definition: FCS_StepInfoSD.h:77
FCS_Param::Config::m_maxrPS
double m_maxrPS
Definition: FCS_StepInfoSD.h:66
StoreGateSvc
The Athena Transient Store API.
Definition: StoreGateSvc.h:128
Ringer::EM
@ EM
Definition: CaloRingsDefs.h:19
FCS_Param::Config::m_maxTimeTile
double m_maxTimeTile
Definition: FCS_StepInfoSD.h:61
CaloSampling::CaloSample
CaloSample
Definition: Calorimeter/CaloGeoHelpers/CaloGeoHelpers/CaloSampling.h:22
TileID
Helper class for TileCal offline identifiers.
Definition: TileID.h:68
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
FCS_StepInfoSD::m_larHecID
const LArHEC_ID * m_larHecID
Definition: FCS_StepInfoSD.h:126
FCS_Param::Config::m_maxTime
double m_maxTime
Definition: FCS_StepInfoSD.h:57
FCS_StepInfoSD::m_tileID
const TileID * m_tileID
Definition: FCS_StepInfoSD.h:127
ILArCalculatorSvc
Definition: ILArCalculatorSvc.h:25
FCS_Param
Definition: FCS_StepInfoSD.h:39
LArG4Identifier.h
FCS_StepInfoSD::getMaxRadius
double getMaxRadius(const CaloCell_ID::CaloSample &layer) const
Definition: FCS_StepInfoSD.cxx:54
FCS_Param::Config::m_maxTimeFCAL
double m_maxTimeFCAL
Definition: FCS_StepInfoSD.h:60
FCS_Param::Config::m_maxPhiEM1
double m_maxPhiEM1
Definition: FCS_StepInfoSD.h:69
FCS_StepInfoSD::getMaxDeltaPhi
double getMaxDeltaPhi(const CaloCell_ID::CaloSample &layer) const
Definition: FCS_StepInfoSD.cxx:119
FCS_StepInfoSD::m_larEmID
const LArEM_ID * m_larEmID
Pointers to the identifier helpers.
Definition: FCS_StepInfoSD.h:124
FCS_Param::Config::m_maxRadiusLAr
double m_maxRadiusLAr
property, see LArG4GenShowerLib::LArG4GenShowerLib
Definition: FCS_StepInfoSD.h:52
FCS_StepInfoSD::EndOfAthenaEvent
void EndOfAthenaEvent(ISF_FCS_Parametrization::FCS_StepInfoCollection *hitContnainer)
End of athena event processing.
Definition: FCS_StepInfoSD.cxx:209
FCS_Param::Config::m_maxTimeHEC
double m_maxTimeHEC
Definition: FCS_StepInfoSD.h:59
python.SystemOfUnits.mm
int mm
Definition: SystemOfUnits.py:83
LArHit.h
LArSamples::FCAL
@ FCAL
Definition: CaloId.h:26
FCS_Param::Config::m_maxRadiusTile
double m_maxRadiusTile
property, see LArG4GenShowerLib::LArG4GenShowerLib
Definition: FCS_StepInfoSD.h:55
ILArCalculatorSvc.h
FCS_Param::Config::m_maxTimeLAr
double m_maxTimeLAr
Definition: FCS_StepInfoSD.h:58
CxxUtils::CachedPointer< const CaloDetDescrManager >
ITileCalculator.h
FCS_StepInfoSD
Common sensitive detector class for LAr systems.
Definition: FCS_StepInfoSD.h:93
ISF_FCS_Parametrization::FCS_StepInfoCollection
Class for collection of StepInfo class (G4 hits) copied and modified version to ISF.
Definition: FCS_StepInfoCollection.h:30
FCS_Param::Config::m_maxEtaEM2
double m_maxEtaEM2
Definition: FCS_StepInfoSD.h:72
LArEM_ID
Helper class for LArEM offline identifiers.
Definition: LArEM_ID.h:118
FCS_StepInfoSD::m_config
FCS_Param::Config m_config
Definition: FCS_StepInfoSD.h:122
FCS_Param::Config
Definition: FCS_StepInfoSD.h:42
FCS_Param::Config::shorten_lar_step
bool shorten_lar_step
Definition: FCS_StepInfoSD.h:46
LArFCAL_ID
Helper class for LArFCAL offline identifiers.
Definition: LArFCAL_ID.h:60
FCS_Param::Config::verboseLevel
int verboseLevel
Helper to keep the same verbosity everywhere.
Definition: FCS_StepInfoSD.h:44
FCS_Param::Config::m_maxRadiusFCAL
double m_maxRadiusFCAL
property, see LArG4GenShowerLib::LArG4GenShowerLib
Definition: FCS_StepInfoSD.h:54
FCS_Param::Config::m_maxPhiEM2
double m_maxPhiEM2
Definition: FCS_StepInfoSD.h:73
FCS_StepInfoSD::ProcessHits
virtual G4bool ProcessHits(G4Step *a_step, G4TouchableHistory *) override
Main processing method.
Definition: FCS_StepInfoSD.cxx:30
FCS_Param::Config::m_maxRadiusHEC
double m_maxRadiusHEC
property, see LArG4GenShowerLib::LArG4GenShowerLib
Definition: FCS_StepInfoSD.h:53
FCS_Param::Config::m_TileCalculator
ITileCalculator * m_TileCalculator
Definition: FCS_StepInfoSD.h:81
FCS_StepInfoSD::getMaxDeltaEta
double getMaxDeltaEta(const CaloCell_ID::CaloSample &layer) const
Definition: FCS_StepInfoSD.cxx:94
FCS_Param::Config::m_maxEtaEM1
double m_maxEtaEM1
Definition: FCS_StepInfoSD.h:68
FCS_StepInfoSD::m_larFcalID
const LArFCAL_ID * m_larFcalID
Definition: FCS_StepInfoSD.h:125