60 Gaudi::Hive::setCurrentContext(eventInfo->GetEventContext());
66 auto hitVector = std::make_unique<std::vector<Trk::HitInfo>>();
68 int pdgId = truth->
pdgid();
70 if (forceNeutral)
charge = 0.;
84 ATH_MSG_DEBUG(
"[ fastCaloSim transport ] x from position eta="<<pos.eta()<<
" phi="<<pos.phi()<<
" d="<<pos.mag()<<
" pT="<<mom.perp() );
89 double freepath = -1.;
90 double tDec = freepath > 0. ? freepath : -1.;
98 ATH_MSG_DEBUG(
"[ fastCaloSim transport ] before calo entrance ");
109 ATH_MSG_DEBUG(
"[ fastCaloSim transport ] after calo entrance ");
111 std::unique_ptr<const Trk::TrackParameters> caloEntry =
nullptr;
114 std::vector<Trk::HitInfo>* dummyHitVector =
nullptr;
138 ATH_MSG_DEBUG(
"[ fastCaloSim transport ] after calo caloEntry ");
141 std::unique_ptr<const Trk::TrackParameters> eParameters =
nullptr;
147 "[ fastCaloSim transport ] starting Calo transport from position eta="
148 << caloEntry->position().eta() <<
" phi=" << caloEntry->position().phi()
149 <<
" d=" << caloEntry->position().mag());
151 std::vector<Trk::HitInfo>* rawHitVector =
hitVector.get();
176 int IDCaloBoundary = 3000;
178 if(msgLvl(MSG::DEBUG)){
179 std::vector<Trk::HitInfo>::iterator it =
hitVector->begin();
180 while (it < hitVector->end()){
181 int sample=(*it).detID;
183 ATH_MSG_DEBUG(
" HIT: layer="<<sample<<
" sample="<<sample-IDCaloBoundary<<
" eta="<<hitPos.eta()<<
" phi="<<hitPos.phi()<<
" d="<<hitPos.mag());
188 std::vector<Trk::HitInfo>::iterator it2 =
hitVector->begin();
189 while(it2 < hitVector->end()){
190 int sample=(*it2).detID;
192 ATH_MSG_DEBUG(
" HIT: layer="<<sample<<
" sample="<<sample-IDCaloBoundary<<
" eta="<<hitPos.eta()<<
" phi="<<hitPos.phi()<<
" r="<<hitPos.perp()<<
" z="<<hitPos[
Amg::z]);
197 if (!forceNeutral &&
hitVector->empty()){
198 ATH_MSG_DEBUG(
"forcing neutral charge in FastCaloSimCaloTransportation::caloHits");
203 else if(
hitVector->empty())
ATH_MSG_ERROR(
"Empty hitVector even after forcing neutral charge. This may cause a segfault soon.");
215 std::vector<G4FieldTrack> caloSteps;
216 for (
auto& step :
vec){
217 G4FieldTrack track = G4FieldTrack(
' ');
220 track.SetChargeAndMoments(step.trackParms->charge());
221 caloSteps.push_back(track);