63 auto hitVector = std::make_unique<std::vector<Trk::HitInfo>>();
65 int pdgId = truth->
pdgid();
66 double charge = HepPDT::ParticleID(pdgId).charge();
67 if (forceNeutral)
charge = 0.;
81 ATH_MSG_DEBUG(
"[ fastCaloSim transport ] x from position eta="<<pos.eta()<<
" phi="<<pos.phi()<<
" d="<<pos.mag()<<
" pT="<<mom.perp() );
86 double freepath = -1.;
87 double tDec = freepath > 0. ? freepath : -1.;
95 ATH_MSG_DEBUG(
"[ fastCaloSim transport ] before calo entrance ");
106 ATH_MSG_DEBUG(
"[ fastCaloSim transport ] after calo entrance ");
108 std::unique_ptr<const Trk::TrackParameters> caloEntry =
nullptr;
111 std::vector<Trk::HitInfo>* dummyHitVector =
nullptr;
135 ATH_MSG_DEBUG(
"[ fastCaloSim transport ] after calo caloEntry ");
138 std::unique_ptr<const Trk::TrackParameters> eParameters =
nullptr;
144 "[ fastCaloSim transport ] starting Calo transport from position eta="
145 << caloEntry->position().eta() <<
" phi=" << caloEntry->position().phi()
146 <<
" d=" << caloEntry->position().mag());
148 std::vector<Trk::HitInfo>* rawHitVector =
hitVector.get();
173 int IDCaloBoundary = 3000;
175 if(msgLvl(MSG::DEBUG)){
176 std::vector<Trk::HitInfo>::iterator it =
hitVector->begin();
177 while (it < hitVector->end()){
178 int sample=(*it).detID;
180 ATH_MSG_DEBUG(
" HIT: layer="<<sample<<
" sample="<<sample-IDCaloBoundary<<
" eta="<<hitPos.eta()<<
" phi="<<hitPos.phi()<<
" d="<<hitPos.mag());
185 std::vector<Trk::HitInfo>::iterator it2 =
hitVector->begin();
186 while(it2 < hitVector->end()){
187 int sample=(*it2).detID;
189 ATH_MSG_DEBUG(
" HIT: layer="<<sample<<
" sample="<<sample-IDCaloBoundary<<
" eta="<<hitPos.eta()<<
" phi="<<hitPos.phi()<<
" r="<<hitPos.perp()<<
" z="<<hitPos[
Amg::z]);
194 if (!forceNeutral &&
hitVector->empty()){
195 ATH_MSG_DEBUG(
"forcing neutral charge in FastCaloSimCaloTransportation::caloHits");
200 else if(
hitVector->empty())
ATH_MSG_ERROR(
"Empty hitVector even after forcing neutral charge. This may cause a segfault soon.");
212 std::vector<G4FieldTrack> caloSteps;
213 for (
auto& step :
vec){
214 G4FieldTrack track = G4FieldTrack(
' ');
217 track.SetChargeAndMoments(step.trackParms->charge());
218 caloSteps.push_back(track);