61 Gaudi::Hive::setCurrentContext(eventInfo->GetEventContext());
67 auto hitVector = std::make_unique<std::vector<Trk::HitInfo>>();
69 int pdgId = truth->
pdgid();
71 if (forceNeutral)
charge = 0.;
85 ATH_MSG_DEBUG(
"[ fastCaloSim transport ] x from position eta="<<pos.eta()<<
" phi="<<pos.phi()<<
" d="<<pos.mag()<<
" pT="<<mom.perp() );
90 double freepath = -1.;
91 double tDec = freepath > 0. ? freepath : -1.;
99 ATH_MSG_DEBUG(
"[ fastCaloSim transport ] before calo entrance ");
110 ATH_MSG_DEBUG(
"[ fastCaloSim transport ] after calo entrance ");
112 std::unique_ptr<const Trk::TrackParameters> caloEntry =
nullptr;
115 std::vector<Trk::HitInfo>* dummyHitVector =
nullptr;
139 ATH_MSG_DEBUG(
"[ fastCaloSim transport ] after calo caloEntry ");
142 std::unique_ptr<const Trk::TrackParameters> eParameters =
nullptr;
148 "[ fastCaloSim transport ] starting Calo transport from position eta="
149 << caloEntry->position().eta() <<
" phi=" << caloEntry->position().phi()
150 <<
" d=" << caloEntry->position().mag());
152 std::vector<Trk::HitInfo>* rawHitVector =
hitVector.get();
177 int IDCaloBoundary = 3000;
179 if(msgLvl(MSG::DEBUG)){
180 std::vector<Trk::HitInfo>::iterator it =
hitVector->begin();
181 while (it < hitVector->end()){
182 int sample=(*it).detID;
184 ATH_MSG_DEBUG(
" HIT: layer="<<sample<<
" sample="<<sample-IDCaloBoundary<<
" eta="<<hitPos.eta()<<
" phi="<<hitPos.phi()<<
" d="<<hitPos.mag());
189 std::vector<Trk::HitInfo>::iterator it2 =
hitVector->begin();
190 while(it2 < hitVector->end()){
191 int sample=(*it2).detID;
193 ATH_MSG_DEBUG(
" HIT: layer="<<sample<<
" sample="<<sample-IDCaloBoundary<<
" eta="<<hitPos.eta()<<
" phi="<<hitPos.phi()<<
" r="<<hitPos.perp()<<
" z="<<hitPos[
Amg::z]);
198 if (!forceNeutral &&
hitVector->empty()){
199 ATH_MSG_DEBUG(
"forcing neutral charge in FastCaloSimCaloTransportation::caloHits");
204 else if(
hitVector->empty())
ATH_MSG_ERROR(
"Empty hitVector even after forcing neutral charge. This may cause a segfault soon.");
216 std::vector<G4FieldTrack> caloSteps;
217 for (
auto& step :
vec){
218 G4FieldTrack track = G4FieldTrack(
' ');
221 track.SetChargeAndMoments(step.trackParms->charge());
222 caloSteps.push_back(track);