58 {
60 Gaudi::Hive::setCurrentContext(eventInfo->GetEventContext());
61 }
62
63
65
66 auto hitVector = std::make_unique<std::vector<Trk::HitInfo>>();
67
70 if (forceNeutral)
charge = 0.;
71
72
74
76
77
79
81
83
84 ATH_MSG_DEBUG(
"[ fastCaloSim transport ] x from position eta="<<
pos.eta()<<
" phi="<<
pos.phi()<<
" d="<<
pos.mag()<<
" pT="<<
mom.perp() );
85
86
88
89 double freepath = -1.;
90 double tDec = freepath > 0. ? freepath : -1.;
91 int decayProc = 0;
92
93 Trk::TimeLimit timeLim(tDec, 0., decayProc);
94 Trk::PathLimit pathLim(-1., 0);
96
97
98 ATH_MSG_DEBUG(
"[ fastCaloSim transport ] before calo entrance ");
99
100
105 else
107 }
108
109 ATH_MSG_DEBUG(
"[ fastCaloSim transport ] after calo entrance ");
110
111 std::unique_ptr<const Trk::TrackParameters> caloEntry = nullptr;
112
114 std::vector<Trk::HitInfo>* dummyHitVector = nullptr;
116 caloEntry =
118 pathLim,
119 timeLim,
121 pHypothesis,
122 dummyHitVector,
123 nextGeoID,
125 }else{
127 pathLim,
128 timeLim,
130 pHypothesis,
131 dummyHitVector,
132 nextGeoID,
134 }
135 } else
136 caloEntry = inputPar.uniqueClone();
137
138 ATH_MSG_DEBUG(
"[ fastCaloSim transport ] after calo caloEntry ");
139
140 if(caloEntry){
141 std::unique_ptr<const Trk::TrackParameters> eParameters = nullptr;
142
143
144 hitVector->push_back(Trk::HitInfo(caloEntry->uniqueClone(), timeLim.time, nextGeoID, 0.));
145
147 "[ fastCaloSim transport ] starting Calo transport from position eta="
148 << caloEntry->position().eta() << " phi=" << caloEntry->position().phi()
149 << " d=" << caloEntry->position().mag());
150
151 std::vector<Trk::HitInfo>* rawHitVector =
hitVector.get();
153 eParameters =
155 pathLim,
156 timeLim,
158 pHypothesis,
159 rawHitVector,
160 nextGeoID);
161 }else{
162 eParameters =
164 pathLim,
165 timeLim,
167 pHypothesis,
168 rawHitVector,
169 nextGeoID);
170 }
171
172 if(eParameters)
hitVector->push_back(Trk::HitInfo(std::move(eParameters), timeLim.time, nextGeoID, 0.));
173 }
174
175
176 int IDCaloBoundary = 3000;
177
178 if(msgLvl(MSG::DEBUG)){
179 std::vector<Trk::HitInfo>::iterator
it =
hitVector->begin();
180 while (it < hitVector->
end()){
183 ATH_MSG_DEBUG(
" HIT: layer="<<sample<<
" sample="<<sample-IDCaloBoundary<<
" eta="<<hitPos.eta()<<
" phi="<<hitPos.phi()<<
" d="<<hitPos.mag());
185 }
186 }
187
188 std::vector<Trk::HitInfo>::iterator it2 =
hitVector->begin();
189 while(it2 < hitVector->
end()){
192 ATH_MSG_DEBUG(
" HIT: layer="<<sample<<
" sample="<<sample-IDCaloBoundary<<
" eta="<<hitPos.eta()<<
" phi="<<hitPos.phi()<<
" r="<<hitPos.perp()<<
" z="<<hitPos[
Amg::z]);
193 ++it2;
194 }
195
196
197 if (!forceNeutral &&
hitVector->empty()){
198 ATH_MSG_DEBUG(
"forcing neutral charge in FastCaloSimCaloTransportation::caloHits");
200 }
201
202
203 else if(
hitVector->empty())
ATH_MSG_ERROR(
"Empty hitVector even after forcing neutral charge. This may cause a segfault soon.");
204
205
207
208 return caloSteps;
209
210}
#define ATH_MSG_WARNING(x)
double charge(const T &p)
std::vector< FPGATrackSimHit > hitVector
static AtlasG4EventUserInfo * GetEventUserInfo()
virtual std::vector< G4FieldTrack > transport(const TFCSTruthState *truth, bool forceNeutral=false) const override final
Trk::PdgToParticleHypothesis m_pdgToParticleHypothesis
StringProperty m_caloEntranceName
CxxUtils::CachedPointer< const Trk::TrackingVolume > m_caloEntrance
std::vector< G4FieldTrack > convertToFieldTrack(const std::vector< Trk::HitInfo > &vec) const
const TLorentzVector & vertex() const
Eigen::Matrix< double, 3, 1 > Vector3D
double charge(const T &p)
CurvilinearParametersT< TrackParametersDim, Charged, PlaneSurface > CurvilinearParameters
ParticleHypothesis
Enumeration for Particle hypothesis respecting the interaction with material.