63 Gaudi::Hive::setCurrentContext(eventInfo->GetEventContext());
69 auto hitVector = std::make_unique<std::vector<Trk::HitInfo>>();
71 int pdgId = truth->
pdgid();
72 double charge = HepPDT::ParticleID(pdgId).charge();
73 if (forceNeutral)
charge = 0.;
87 ATH_MSG_DEBUG(
"[ fastCaloSim transport ] x from position eta="<<pos.eta()<<
" phi="<<pos.phi()<<
" d="<<pos.mag()<<
" pT="<<mom.perp() );
92 double freepath = -1.;
93 double tDec = freepath > 0. ? freepath : -1.;
101 ATH_MSG_DEBUG(
"[ fastCaloSim transport ] before calo entrance ");
112 ATH_MSG_DEBUG(
"[ fastCaloSim transport ] after calo entrance ");
114 std::unique_ptr<const Trk::TrackParameters> caloEntry =
nullptr;
117 std::vector<Trk::HitInfo>* dummyHitVector =
nullptr;
141 ATH_MSG_DEBUG(
"[ fastCaloSim transport ] after calo caloEntry ");
144 std::unique_ptr<const Trk::TrackParameters> eParameters =
nullptr;
150 "[ fastCaloSim transport ] starting Calo transport from position eta="
151 << caloEntry->position().eta() <<
" phi=" << caloEntry->position().phi()
152 <<
" d=" << caloEntry->position().mag());
154 std::vector<Trk::HitInfo>* rawHitVector =
hitVector.get();
179 int IDCaloBoundary = 3000;
181 if(msgLvl(MSG::DEBUG)){
182 std::vector<Trk::HitInfo>::iterator it =
hitVector->begin();
183 while (it < hitVector->end()){
184 int sample=(*it).detID;
186 ATH_MSG_DEBUG(
" HIT: layer="<<sample<<
" sample="<<sample-IDCaloBoundary<<
" eta="<<hitPos.eta()<<
" phi="<<hitPos.phi()<<
" d="<<hitPos.mag());
191 std::vector<Trk::HitInfo>::iterator it2 =
hitVector->begin();
192 while(it2 < hitVector->end()){
193 int sample=(*it2).detID;
195 ATH_MSG_DEBUG(
" HIT: layer="<<sample<<
" sample="<<sample-IDCaloBoundary<<
" eta="<<hitPos.eta()<<
" phi="<<hitPos.phi()<<
" r="<<hitPos.perp()<<
" z="<<hitPos[
Amg::z]);
200 if (!forceNeutral &&
hitVector->empty()){
201 ATH_MSG_DEBUG(
"forcing neutral charge in FastCaloSimCaloTransportation::caloHits");
206 else if(
hitVector->empty())
ATH_MSG_ERROR(
"Empty hitVector even after forcing neutral charge. This may cause a segfault soon.");
218 std::vector<G4FieldTrack> caloSteps;
219 for (
auto& step :
vec){
220 G4FieldTrack track = G4FieldTrack(
' ');
223 track.SetChargeAndMoments(step.trackParms->charge());
224 caloSteps.push_back(track);