ATLAS Offline Software
Loading...
Searching...
No Matches
TileGeoG4CalibSD.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//************************************************************
6//
7// Class TileGeoG4CalibSD.
8// Calibration Sensitive Detector for TileCal simulation
9//
10// Author: Gia Khoriauli <gia@mail.cern.ch>
11// May, 2005
12//
13// Major updates: December, 2005;
14// July, 2013 (Sergey);
15//
16//************************************************************
17
18#ifndef TILEGEOG4CALIB_TILEGEOG4CALIBSD_H
19#define TILEGEOG4CALIB_TILEGEOG4CALIBSD_H
20
21#include "G4VSensitiveDetector.hh"
22
23// Output collections
25
26// Member variables
28
29// Service handles
32#include "GaudiKernel/ServiceHandle.h"
33
34// the lower line should be uncommented to produce special text or root file
35// with coordinates of all calibration hits
36// later the ROOT macro (test/testHits.C) can be used to produce plots
37//#define HITSINFO //added by Sergey
38
39#ifdef HITSINFO
40#include "GaudiKernel/ToolHandle.h"
43#define doHitsTXT false
44#define doHitsNTup true
45#define IDcalc 0 //1-6, 0-all
46#endif
47
50class G4Step;
51class G4HCofThisEvent;
52class Identifier;
53
54class StoreGateSvc;
55class CaloCell_ID;
56class CaloDM_ID;
57
58#ifdef HITSINFO
61#endif
62
63class ITileCalculator;
64class TileGeoG4LookupBuilder;
67
68class TileGeoG4Section;
69class TileGeoG4Cell;
73
74struct TileHitData;
75
76class G4TouchableHistory;
77class G4VPhysicalVolume;
78
80
81#include <string>
82#include <vector>
83typedef std::vector<double> E_4;
84
85class TileGeoG4CalibSD: public G4VSensitiveDetector {
86public:
87 TileGeoG4CalibSD(const G4String& name, const std::vector<std::string>& m_outputCollectionNames,
88 ITileCalculator* tileCalculator, const ServiceHandle<StoreGateSvc> &detStore);
90
95
96 //SD MAIN METHODS FOR A STEP PROCESSING
97 void Initialize(G4HCofThisEvent*) override final;
98 G4bool ProcessHits(G4Step*, G4TouchableHistory*) override final;
99 void EndOfEvent(G4HCofThisEvent*) override final;
100
101 //METHOD FOR CLASSIFYING STEP ENERGY AND THE METHODS,
102 //WHICH CALCULATE IDENTIFIER FOR CELL OR DEAD MATERIAL
103 //CALIBRATION HITS ON THE CURRENT STEP
110 void DefaultHitIDCalculatorTB(int sample=0, int region=0, int eta=0, int phi=0);
111
112 //GET RESULT FOR THE STEP HIT ID AND CLASSIFYED ENERGIES
115
116 //DEBUG CELL AND DM CELL ID FIELDS
119
120 //added by Sergey
121 void CellNumCorrectToHit(int, int);
122#ifdef HITSINFO
123 void HitsInfoPrint (bool, int);
124#endif
125
126 //RESET ALL CLASS MEMBER ID FIELDS, NEW & DEFAULT HIT FLAGS,
127 //SECTION & SIDE FLAGS, DEPOSITED ENERGIES IN SCINTILLATOR/PMTs
128 // ! THESE METHODS ARE NEEDED AT THE BEGGINING OF EACH STEP !
129 void ResetCellIDFields();
130 void ResetDMCellIDFields();
131 void ResetSectSideFlags();
132
133protected:
134 Identifier DM_ID_Maker(int det, int type, int sample, int region, int tower, int module);
135
136 //THIS METHOD IS USED BY IDENTIFIER CALCULATOR METHODS FOR FINDING TILE SECTION
137 //WHERE THE CURRENT STEP IS AND FOR DETERMINING SOME RELATED IDENTIFIER FIELD
138 //VALUES. ALSO, DETRMINES SOME FLAGS USED IN A FURTHER PROCESSING OF THE STEP
140 void SetEscapedEnergy(double escapedEnergy);
141 double GetVisibleEnergy();
142 double GetInvisibleEnergy();
143
144 // Retrieve the hit collection for the current Athena event
146
149
150private:
153
154 std::string m_tileHits;
158
159 // Handles for later use
162
166
167 //FLAGS FROM JOBOPTIONS
170
171#ifdef HITSINFO
172 ToolHandle<TileCalibHitNtuple> m_ntuple;
173 ToolHandle<TileCalibHitCntNtup> m_ntupleCnt;
174#endif
175
176 //ORDINARY AND CALIBRATION LOOKUP BUILDERS
178
179 //CALIBRATION ENERGY CLASSIFYER
182
183 //ENERGY AND POSITION AT CURRENT STEP
184 G4Step* m_aStep;
185
186 //FOR SIMPLE ENERGY DEBUGGING
187 double m_E_tot;
188 double m_E_em;
189 double m_E_nonem;
192
193 //STEP TOUCHABLE HISTORY AND VOLUME
194 const G4TouchableHistory* m_stepTouchable;
195 G4VPhysicalVolume* m_stepPhysVol;
196 G4String m_nameVol;
197
198 //CALIBRATION SECTION & CELLS
200 TileGeoG4Cell* m_cell;
203
204 //CLASSIFIED ENERGY VECTOR
206
207 //IDENTIFIER FOR CALIBRATION HIT
209
210 //CELL ACTIVE || CELL INACTIVE || DM
212
213 //REAL CELL ID VALUES
220
221 //DM CELL ID VALUES
228
229 //GLOBAL HIT POSITION -- added by Sergey
230 double m_xGlobal;
231 double m_yGlobal;
232 double m_zGlobal;
235#ifdef HITSINFO
236 int m_nEvent;
237 int m_det_side;
238#endif
239
240 //FLAG FOR DEFAULT HIT
242
245
248
251
255
259
262
263 class LessHit {
264 public:
265 bool operator()(CaloCalibrationHit* const & p, CaloCalibrationHit* const & q) const {
266 return p->Less(q);
267 }
268 };
269
270 typedef std::set<CaloCalibrationHit*, LessHit> m_calibrationHits_t;
271 typedef m_calibrationHits_t::iterator m_calibrationHits_ptr_t;
275
276};
277//CLASS TileGeoG4CalibSD
278
280//inline methods//
286
290
294
304
306 //check any kind of classified energies. if they all are zero
307 //then nothing to do and go to the next Step
311}
312
319
326
331
332#endif // TILEGEOG4CALIB_TILEGEOG4CALIBSD_H
333
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
Definition of the abstract IRDBAccessSvc interface.
std::vector< double > E_4
This class is attached to G4Event objects as UserInformation.
Class to store calorimeter calibration hit.
Helper class for offline cell identifiers.
Definition CaloCell_ID.h:34
Helper class for Calo Dead Material offline identifiers.
Definition CaloDM_ID.h:102
This class implements the calculations requires to categorize the energies deposited during the simul...
The Athena Transient Store API.
This class creates ntuple with calibration hits container info.
This class creates ntuple with calibration hits info.
bool operator()(CaloCalibrationHit *const &p, CaloCalibrationHit *const &q) const
TileGeoG4CalibSD(const G4String &name, const std::vector< std::string > &m_outputCollectionNames, ITileCalculator *tileCalculator, const ServiceHandle< StoreGateSvc > &detStore)
TileEscapedEnergyProcessing * m_tile_eep
void GirderCellIDCalculator()
m_calibrationHits_t::iterator m_calibrationHits_ptr_t
TileGeoG4GirderCell * m_gCell
CaloG4::SimulationEnergies::ClassifyResult_t m_result
void SetEscapedEnergy(double escapedEnergy)
ServiceHandle< IGeoModelSvc > m_geoModSvc
m_calibrationHits_t m_deadCalibrationHits
bool m_isExtended
set to true if hit is in extended barrel
void DefaultHitIDCalculator()
Identifier DM_ID_Maker(int det, int type, int sample, int region, int tower, int module)
m_calibrationHits_t m_activeCalibrationHits
bool m_addToCell
set to true if DM hit in front plate is added to a real cell (currently equal to _plateToCell)
std::set< CaloCalibrationHit *, LessHit > m_calibrationHits_t
const CaloDM_ID * m_caloDM_ID
Identifier GetCellIDOnStep()
TileGeoG4CalibSD & operator=(const TileGeoG4CalibSD &)
G4bool ProcessHits(G4Step *, G4TouchableHistory *) override final
CaloG4::SimulationEnergies * m_simEn
void CellNumCorrectToHit(int, int)
bool m_plateToCell
set to true if DM hit in end/front plate is added to a real cell (taken from DB or from JO)
std::string m_tileInactiveCellCalibHits
const CaloCell_ID * m_caloCell_ID
bool AreClassifiedEnergiesAllZero()
TileGeoG4CalibSection * m_cSection
std::string m_tileActiveCellCalibHits
void DebugDMCellIDFields(int)
std::string m_tileDeadMaterialCalibHits
bool m_isNegative
set to true if hit is in negative side
void DebugCellIDFields()
CaloG4::SimulationEnergies::ClassifyResult_t GetEnergiesOnStep()
TileGeoG4CalibSD(const TileGeoG4CalibSD &)
void PlateCellIDCalculator()
ServiceHandle< IRDBAccessSvc > m_rdbSvc
G4VPhysicalVolume * m_stepPhysVol
m_calibrationHits_t m_inactiveCalibrationHits
AtlasG4EventUserInfo * m_atlasG4EvtUserInfo
variable used for producing calibration hits signed with primary particle ID
void EnergiesSimpleCounter()
bool FindTileCalibSection()
void Initialize(G4HCofThisEvent *) override final
TileGeoG4PlateCell * m_pCell
bool m_addToGirder
set to true if DM hit in absorber at outer radius is added to girder (currently inverse of _plateToCe...
void ScintIDCalculator(TileHitData &hitData)
void CellIDCalculator()
TileHitVectorDMBuilder * GetHitCollection()
void DefaultHitIDCalculatorTB(int sample=0, int region=0, int eta=0, int phi=0)
ServiceHandle< StoreGateSvc > m_detStoreSvc
ITileCalculator * m_calc
TileGeoG4Cell * m_cell
const G4TouchableHistory * m_stepTouchable
void EndOfEvent(G4HCofThisEvent *) override final
See TileGeoG4SD/TileHitVectorBuilder documentation.
This defines the results returned by the energy classification; these detailed results are mostly use...
Variables to identify Hit objects.