20 m_geoIDSvc(
"GeoIDSvc",
n),
22 m_particleFilterHandle(),
24 m_numParticleFilters(0),
30 declareProperty(
"GeoIDSvc",
32 "AthenaService used to indentify sub-detector by (x,y,z) coordintes.");
35 declareProperty(
"ParticleFilters",
37 "ISF Particle filters, defining whether a particle will be stored or not.");
40 declareProperty(
"CaloEntryLayer",
42 "Name of CaloEntryLayer collection on Storegate");
43 declareProperty(
"MuonEntryLayer",
45 "Name of MuonEntryLayer collection on Storegate");
46 declareProperty(
"MuonExitLayer",
48 "Name of MuonExitLayer collection on Storegate");
51 declareProperty(
"CaloEntryVolumeString",
53 "VolumeName in TrackRecords in CaloEntryLayer");
54 declareProperty(
"MuonEntryVolumeString",
56 "VolumeName in TrackRecords in MuonEntryLayer");
57 declareProperty(
"MuonExitVolumeString",
59 "VolumeName in TrackRecords in MuonExitLayer");
69 if ( m_geoIDSvc.retrieve().isFailure() ){
71 return StatusCode::FAILURE;
74 m_geoIDSvcQuick = &(*m_geoIDSvc);
78 if ( m_particleFilterHandle.retrieve().isFailure() ){
80 return StatusCode::FAILURE;
83 m_numParticleFilters = m_particleFilterHandle.size();
85 for (
size_t curFilter = 0; curFilter<m_numParticleFilters; curFilter++) {
87 m_particleFilter[curFilter] = &(*m_particleFilterHandle[curFilter]);
91 return StatusCode::SUCCESS;
101 m_collection[entryLayer] = setupSGCollection( m_SGName[entryLayer] );
111 for (
size_t curFilter=0; pass && (curFilter<m_numParticleFilters); curFilter++) {
113 pass = m_particleFilter[curFilter]->passFilter( particle);
133 if ( onIDSurface && onCaloSurface ) {
143 if (onCaloSurface && onMSSurface) {
147 else if (onMSSurface) {
160 if ( !passesFilters(particle) ) {
169 layerHit = identifyEntryLayer( particle);
175 ATH_MSG_VERBOSE(
"Particle >>" << particle <<
"<< hit boundary surface, "
176 "adding it to '" << m_SGName[layerHit] <<
"' TrackRecord collection");
180 CLHEP::Hep3Vector hepPos(
pos.x(),
pos.y(),
pos.z() );
181 CLHEP::Hep3Vector hepMom(
mom.x(),
mom.y(),
mom.z() );
183 double mass = particle.mass();
188 auto truthBinding = particle.getTruthBinding();
189 auto generationZeroGenParticle = truthBinding ? truthBinding->getGenerationZeroGenParticle() :
nullptr;
191 const int id = generationZeroGenParticle ?
HepMC::uniqueID(generationZeroGenParticle) : particle.id();
192 const int status = generationZeroGenParticle ? generationZeroGenParticle->status() : particle.status();
194 m_collection[layerHit]->Emplace(particle.pdgCode(),
199 particle.timeStamp(),
202 m_volumeName[layerHit] );
211 m_collection[
layer]=collection;
212 return StatusCode::SUCCESS;
224 if ( evtStore()->contains<TrackRecordCollection>(collectionName) ){
225 if ( (evtStore()->
retrieve( collection, collectionName)).isFailure() )
226 ATH_MSG_ERROR(
"[ --- ] Unable to retrieve TrackRecordCollection " << collectionName);
230 if ( (evtStore()->record( collection, collectionName,
true)).isFailure() ) {
231 ATH_MSG_ERROR(
"[ --- ] Unable to record SiHitCollection " << collectionName);