ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Simulation
ISF
ISF_FastCaloSim
ISF_FastCaloSimSD
src
TileFCS_StepInfoSD.cxx
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 TileFCS_StepInfoSD
8
// Sensitive detector for TileCal G4 simulations with TileGeoModel
9
//
10
// Author: Vakho Tsulaia <Vakhtang.Tsulaia@cern.ch>
11
//
12
// Major updates: July, 2013 (Sergey)
13
//
14
//************************************************************
15
16
// class header
17
#include "
TileFCS_StepInfoSD.h
"
18
19
#include <utility>
21
#include "G4Step.hh"
22
#include "G4ThreeVector.hh"
23
#include "G4TouchableHistory.hh"
24
26
#include "
CaloDetDescr/CaloDetDescrManager.h
"
27
#include "
TileG4Interfaces/ITileCalculator.h
"
28
29
TileFCS_StepInfoSD::TileFCS_StepInfoSD
(G4String name,
30
const
FCS_Param::Config
& config)
31
:
FCS_StepInfoSD
(
std
::move(name), config),
32
m_calculator
(config.m_TileCalculator) {}
33
34
G4bool
TileFCS_StepInfoSD::ProcessHits
(G4Step* a_step,
35
G4TouchableHistory*
/*ROhist*/
) {
36
G4bool result(
false
);
37
// If there's no energy, there's no hit. (Aside: Isn't this energy
38
// the same as the energy from the calculator? Not necessarily.
39
// The calculator may include detector effects such as
40
// charge-collection which are not modeled by Geant4.)
41
if
(a_step->GetTotalEnergyDeposit() <= 0.) {
42
return
result;
43
}
44
45
if
(
m_calculator
) {
46
// calculation of MicroHit with a_step
47
TileHitData
hitData;
48
TileMicroHit
micHit =
m_calculator
->GetTileMicroHit(a_step, hitData);
49
Identifier
invalid_id;
50
51
// Check if MicroHit is not in scintillator
52
if
((micHit.
pmt_up
== invalid_id) && (micHit.
pmt_down
== invalid_id)) {
53
G4cout << this->GetName() <<
" WARNING ProcessHits: Invalid hit in Tile??"
54
<< G4endl;
55
return
result;
56
}
else
{
57
// Some cells is the gap scintillator are only read out by one
58
// PMT, so only print warnings if this is not the case.
59
if
((micHit.
pmt_up
== invalid_id) &&
60
!(
cellReadOutByOnePMT
(micHit.
pmt_down
))) {
61
G4cout << this->GetName()
62
<<
" WARNING ProcessHits: Something wrong in identifier: tile "
63
"pmt_up: "
64
<< micHit.
pmt_up
<< std::endl;
65
G4cout << this->GetName()
66
<<
" WARNING ProcessHits: tile pmt_down : "
<< micHit.
pmt_down
67
<<
" "
<<
m_tileID
->to_string(micHit.
pmt_down
, -1) << std::endl;
68
G4cout << this->GetName()
69
<<
" WARNING ProcessHits: E up: "
<< micHit.
e_up
70
<<
" E down: "
<< micHit.
e_down
<<
" T up: "
<< micHit.
time_up
71
<<
" T down: "
<< micHit.
time_down
<< std::endl;
72
}
73
if
((micHit.
pmt_down
== invalid_id) &&
74
!(
cellReadOutByOnePMT
(micHit.
pmt_up
))) {
75
G4cout << this->GetName()
76
<<
" WARNING ProcessHits: Something wrong in identifier: tile "
77
"pmt_down: "
78
<< micHit.
pmt_down
<< std::endl;
79
G4cout << this->GetName()
80
<<
" WARNING ProcessHits: tile pmt_up: "
<< micHit.
pmt_up
<<
" "
81
<<
m_tileID
->to_string(micHit.
pmt_up
, -1) << std::endl;
82
G4cout << this->GetName()
83
<<
" WARNING ProcessHits: E up: "
<< micHit.
e_up
84
<<
" E down: "
<< micHit.
e_down
<<
" T up: "
<< micHit.
time_up
85
<<
" T down: "
<< micHit.
time_down
<< std::endl;
86
}
87
// Store TileHits Information
88
const
G4ThreeVector pos =
89
0.5 * (a_step->GetPreStepPoint()->GetPosition() +
90
a_step->GetPostStepPoint()->GetPosition());
91
const
int
numberOfProcessedHits(1);
92
if
(!
m_calo_dd_man
.get()) {
93
getCaloDDManager
();
94
}
95
this->
update_map
(pos, micHit.
pmt_up
, micHit.
e_up
, micHit.
time_up
,
true
,
96
numberOfProcessedHits);
97
this->
update_map
(pos, micHit.
pmt_down
, micHit.
e_down
, micHit.
time_down
,
98
true
, numberOfProcessedHits);
99
}
100
}
101
return
true
;
102
}
CaloDetDescrManager.h
Definition of CaloDetDescrManager.
ITileCalculator.h
TileFCS_StepInfoSD.h
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_StepInfoSD::m_calo_dd_man
CxxUtils::CachedPointer< const CaloDetDescrManager > m_calo_dd_man
Definition
FCS_StepInfoSD.h:106
FCS_StepInfoSD::FCS_StepInfoSD
FCS_StepInfoSD(G4String a_name, const FCS_Param::Config &config)
Constructor.
Definition
FCS_StepInfoSD.cxx:21
FCS_StepInfoSD::getCaloDDManager
void getCaloDDManager()
Keep a map instead of trying to keep the full vector.
Definition
FCS_StepInfoSD.cxx:49
FCS_StepInfoSD::m_tileID
const TileID * m_tileID
Definition
FCS_StepInfoSD.h:105
TileFCS_StepInfoSD::m_calculator
ITileCalculator * m_calculator
Definition
TileFCS_StepInfoSD.h:45
TileFCS_StepInfoSD::cellReadOutByOnePMT
bool cellReadOutByOnePMT(const Identifier &id) const
Some Tile Cells are only read out by one PMT rather than two.
Definition
TileFCS_StepInfoSD.h:65
TileFCS_StepInfoSD::ProcessHits
G4bool ProcessHits(G4Step *, G4TouchableHistory *) override final
Main processing method.
Definition
TileFCS_StepInfoSD.cxx:34
TileFCS_StepInfoSD::TileFCS_StepInfoSD
TileFCS_StepInfoSD(G4String name, const FCS_Param::Config &config)
Geant4 headers.
Definition
TileFCS_StepInfoSD.cxx:29
Identifier
Definition
IdentifierFieldParser.cxx:14
std
STL namespace.
FCS_Param::Config
Definition
FCS_StepInfoSD.h:37
TileHitData
Variables to identify Hit objects.
Definition
ITileCalculator.h:45
TileMicroHit
Definition
ITileCalculator.h:34
TileMicroHit::time_up
double time_up
Definition
ITileCalculator.h:39
TileMicroHit::pmt_down
Identifier pmt_down
Definition
ITileCalculator.h:36
TileMicroHit::e_down
G4double e_down
Definition
ITileCalculator.h:38
TileMicroHit::time_down
double time_down
Definition
ITileCalculator.h:40
TileMicroHit::pmt_up
Identifier pmt_up
Definition
ITileCalculator.h:35
TileMicroHit::e_up
G4double e_up
Definition
ITileCalculator.h:37
Generated on
for ATLAS Offline Software by
1.17.0