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 <map>
9 #include <vector>
10 
11 #include "CLHEP/Units/SystemOfUnits.h"
13 #include "CaloIdentifier/CaloCell_ID.h" // For CaloCell_ID::CaloSample
14 #include "CxxUtils/CachedPointer.h"
15 #include "G4VSensitiveDetector.hh"
19 #include "LArSimEvent/LArHit.h"
21 
22 // Forward declarations
23 class G4Step;
24 class G4TouchableHistory;
25 
26 class LArEM_ID;
27 class LArFCAL_ID;
28 class LArHEC_ID;
29 class TileID;
30 
31 class LArHitContainer;
32 
33 class StoreGateSvc;
34 
35 namespace FCS_Param {
36 
37 struct Config {
39  int verboseLevel = 0;
40  bool shift_lar_subhit = true;
41  bool shorten_lar_step = false;
42  double substpsize = 0.2 * CLHEP::mm; // size of splitting into substeps
43  // before calling the calculators.
44 
45  // Merging properties
46  std::vector<double> m_maxRadiusLateral{
47  24, 5.};
48  std::vector<double> m_maxRadiusLongitudinal{
50  24, 5.};
51 
53  double m_maxTime = 25.;
54  double m_maxTimeLAr = 25.;
55  double m_maxTimeHEC = 25.;
56  double m_maxTimeFCAL = 25.;
57  double m_maxTimeTile = 25.;
58 
61 };
62 
63 } // namespace FCS_Param
64 
71 class FCS_StepInfoSD : public G4VSensitiveDetector {
72  public:
74  FCS_StepInfoSD(G4String a_name, const FCS_Param::Config& config);
75 
77  virtual G4bool ProcessHits(G4Step* a_step, G4TouchableHistory*) override;
78 
80  void EndOfAthenaEvent(
82 
84  void setupHelpers(const LArEM_ID* EM, const LArFCAL_ID* FCAL,
85  const LArHEC_ID* HEC, const TileID* tile) {
86  m_larEmID = EM;
87  m_larFcalID = FCAL;
88  m_larHecID = HEC;
89  m_tileID = tile;
90  }
91 
92  protected:
96  void getCaloDDManager();
97  void update_map(const CLHEP::Hep3Vector& l_vec,
98  const Identifier& l_identifier, double l_energy,
99  double l_time, bool l_valid, int l_detector);
102  const LArEM_ID* m_larEmID{nullptr};
103  const LArFCAL_ID* m_larFcalID{nullptr};
104  const LArHEC_ID* m_larHecID{nullptr};
105  const TileID* m_tileID{nullptr};
107  std::map<Identifier, std::vector<ISF_FCS_Parametrization::FCS_StepInfo*>*>
109 
110  private:
112  double getMaxTime(const CaloCell_ID::CaloSample& layer) const;
113 };
114 
115 #endif // ISF_FASTCALOSIM_FCS_STEPINFOSD_H
FCS_StepInfoCollection.h
LArSamples::HEC
@ HEC
Definition: CaloId.h:26
python.SystemOfUnits.mm
float mm
Definition: SystemOfUnits.py:98
FCS_Param::Config::m_maxRadiusLateral
std::vector< double > m_maxRadiusLateral
property, see LArG4GenShowerLib::LArG4GenShowerLib
Definition: FCS_StepInfoSD.h:46
FCS_StepInfoSD::getCaloDDManager
void getCaloDDManager()
Keep a map instead of trying to keep the full vector.
Definition: FCS_StepInfoSD.cxx:49
ITileCalculator
Definition: ITileCalculator.h:67
FCS_StepInfoSD::getMaxTime
double getMaxTime(const CaloCell_ID::CaloSample &layer) const
Definition: FCS_StepInfoSD.cxx:34
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)
Definition: FCS_StepInfoSD.cxx:62
FCS_Param::Config::shift_lar_subhit
bool shift_lar_subhit
Definition: FCS_StepInfoSD.h:40
FCS_Param::Config::m_LArCalculator
ILArCalculatorSvc * m_LArCalculator
Definition: FCS_StepInfoSD.h:59
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:106
LArHitContainer
Hit collection.
Definition: LArHitContainer.h:26
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:84
FCS_Param::Config::substpsize
double substpsize
Definition: FCS_StepInfoSD.h:42
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:21
FCS_Param::Config::m_maxRadiusLongitudinal
std::vector< double > m_maxRadiusLongitudinal
property, see LArG4GenShowerLib::LArG4GenShowerLib
Definition: FCS_StepInfoSD.h:49
StoreGateSvc
The Athena Transient Store API.
Definition: StoreGateSvc.h:120
Ringer::EM
@ EM
Definition: CaloRingsDefs.h:19
FCS_Param::Config::m_maxTimeTile
double m_maxTimeTile
Definition: FCS_StepInfoSD.h:57
CaloSampling::CaloSample
CaloSample
Definition: Calorimeter/CaloGeoHelpers/CaloGeoHelpers/CaloSampling.h:22
TileID
Helper class for TileCal offline identifiers.
Definition: TileID.h:68
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
FCS_StepInfoSD::m_larHecID
const LArHEC_ID * m_larHecID
Definition: FCS_StepInfoSD.h:104
FCS_Param::Config::m_maxTime
double m_maxTime
Definition: FCS_StepInfoSD.h:53
FCS_StepInfoSD::m_tileID
const TileID * m_tileID
Definition: FCS_StepInfoSD.h:105
ILArCalculatorSvc
Definition: ILArCalculatorSvc.h:25
FCS_Param
Definition: FCS_StepInfoSD.h:35
LArG4Identifier.h
FCS_Param::Config::m_maxTimeFCAL
double m_maxTimeFCAL
Definition: FCS_StepInfoSD.h:56
FCS_StepInfoSD::m_larEmID
const LArEM_ID * m_larEmID
Pointers to the identifier helpers.
Definition: FCS_StepInfoSD.h:102
FCS_StepInfoSD::EndOfAthenaEvent
void EndOfAthenaEvent(ISF_FCS_Parametrization::FCS_StepInfoCollection *hitContnainer)
End of athena event processing.
Definition: FCS_StepInfoSD.cxx:146
FCS_Param::Config::m_maxTimeHEC
double m_maxTimeHEC
Definition: FCS_StepInfoSD.h:55
LArHit.h
LArSamples::FCAL
@ FCAL
Definition: CaloId.h:26
ILArCalculatorSvc.h
FCS_Param::Config::m_maxTimeLAr
double m_maxTimeLAr
Definition: FCS_StepInfoSD.h:54
CxxUtils::CachedPointer< const CaloDetDescrManager >
ITileCalculator.h
FCS_StepInfoSD
Common sensitive detector class for LAr systems.
Definition: FCS_StepInfoSD.h:71
ISF_FCS_Parametrization::FCS_StepInfoCollection
Class for collection of StepInfo class (G4 hits) copied and modified version to ISF.
Definition: FCS_StepInfoCollection.h:30
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:100
FCS_Param::Config
Definition: FCS_StepInfoSD.h:37
FCS_Param::Config::shorten_lar_step
bool shorten_lar_step
Definition: FCS_StepInfoSD.h:41
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:39
FCS_StepInfoSD::ProcessHits
virtual G4bool ProcessHits(G4Step *a_step, G4TouchableHistory *) override
Main processing method.
Definition: FCS_StepInfoSD.cxx:26
FCS_StepInfoSD::m_hit_map
std::map< Identifier, std::vector< ISF_FCS_Parametrization::FCS_StepInfo * > * > m_hit_map
Definition: FCS_StepInfoSD.h:108
FCS_Param::Config::m_TileCalculator
ITileCalculator * m_TileCalculator
Definition: FCS_StepInfoSD.h:60
FCS_StepInfoSD::m_larFcalID
const LArFCAL_ID * m_larFcalID
Definition: FCS_StepInfoSD.h:103
Identifier
Definition: IdentifierFieldParser.cxx:14