59 {
60
62
63 auto hitVector = std::make_unique<std::vector<Trk::HitInfo>>();
64
66 double charge = HepPDT::ParticleID(pdgId).charge();
67 if (forceNeutral)
charge = 0.;
68
69
71
73
74
76
78
80
81 ATH_MSG_DEBUG(
"[ fastCaloSim transport ] x from position eta="<<
pos.eta()<<
" phi="<<
pos.phi()<<
" d="<<
pos.mag()<<
" pT="<<
mom.perp() );
82
83
85
86 double freepath = -1.;
87 double tDec = freepath > 0. ? freepath : -1.;
88 int decayProc = 0;
89
90 Trk::TimeLimit timeLim(tDec, 0., decayProc);
91 Trk::PathLimit pathLim(-1., 0);
93
94
95 ATH_MSG_DEBUG(
"[ fastCaloSim transport ] before calo entrance ");
96
97
102 else
104 }
105
106 ATH_MSG_DEBUG(
"[ fastCaloSim transport ] after calo entrance ");
107
108 std::unique_ptr<const Trk::TrackParameters> caloEntry = nullptr;
109
111 std::vector<Trk::HitInfo>* dummyHitVector = nullptr;
113 caloEntry =
115 pathLim,
116 timeLim,
118 pHypothesis,
119 dummyHitVector,
120 nextGeoID,
122 }else{
124 pathLim,
125 timeLim,
127 pHypothesis,
128 dummyHitVector,
129 nextGeoID,
131 }
132 } else
133 caloEntry = inputPar.uniqueClone();
134
135 ATH_MSG_DEBUG(
"[ fastCaloSim transport ] after calo caloEntry ");
136
137 if(caloEntry){
138 std::unique_ptr<const Trk::TrackParameters> eParameters = nullptr;
139
140
141 hitVector->push_back(Trk::HitInfo(caloEntry->uniqueClone(), timeLim.time, nextGeoID, 0.));
142
144 "[ fastCaloSim transport ] starting Calo transport from position eta="
145 << caloEntry->position().eta() << " phi=" << caloEntry->position().phi()
146 << " d=" << caloEntry->position().mag());
147
148 std::vector<Trk::HitInfo>* rawHitVector =
hitVector.get();
150 eParameters =
152 pathLim,
153 timeLim,
155 pHypothesis,
156 rawHitVector,
157 nextGeoID);
158 }else{
159 eParameters =
161 pathLim,
162 timeLim,
164 pHypothesis,
165 rawHitVector,
166 nextGeoID);
167 }
168
169 if(eParameters)
hitVector->push_back(Trk::HitInfo(std::move(eParameters), timeLim.time, nextGeoID, 0.));
170 }
171
172
173 int IDCaloBoundary = 3000;
174
175 if(msgLvl(MSG::DEBUG)){
176 std::vector<Trk::HitInfo>::iterator
it =
hitVector->begin();
177 while (it < hitVector->
end()){
180 ATH_MSG_DEBUG(
" HIT: layer="<<sample<<
" sample="<<sample-IDCaloBoundary<<
" eta="<<hitPos.eta()<<
" phi="<<hitPos.phi()<<
" d="<<hitPos.mag());
182 }
183 }
184
185 std::vector<Trk::HitInfo>::iterator it2 =
hitVector->begin();
186 while(it2 < hitVector->
end()){
189 ATH_MSG_DEBUG(
" HIT: layer="<<sample<<
" sample="<<sample-IDCaloBoundary<<
" eta="<<hitPos.eta()<<
" phi="<<hitPos.phi()<<
" r="<<hitPos.perp()<<
" z="<<hitPos[
Amg::z]);
190 ++it2;
191 }
192
193
194 if (!forceNeutral &&
hitVector->empty()){
195 ATH_MSG_DEBUG(
"forcing neutral charge in FastCaloSimCaloTransportation::caloHits");
197 }
198
199
200 else if(
hitVector->empty())
ATH_MSG_ERROR(
"Empty hitVector even after forcing neutral charge. This may cause a segfault soon.");
201
202
204
205 return caloSteps;
206
207}
#define ATH_MSG_WARNING(x)
double charge(const T &p)
std::vector< FPGATrackSimHit > hitVector
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
CurvilinearParametersT< TrackParametersDim, Charged, PlaneSurface > CurvilinearParameters
ParticleHypothesis
Enumeration for Particle hypothesis respecting the interaction with material.