26 class Interactions_pair {
31 : first(
p1), second(std::move(
p2)) {};
33 bool operator> (
const Interactions_pair& other)
const
34 {
return first <
other.first;}
36 bool operator< (
const Interactions_pair& other)
const
37 {
return first >
other.first;}
61 return StatusCode::SUCCESS;
69 std::vector<Amg::Vector3D> seeds =
findMultiSeeds (perigeeList, constraint);
81 std::vector<Amg::Vector3D> seeds =
findMultiSeeds (vectorTrk, constraint);
91 std::vector<Amg::Vector3D> seeds;
102 std::vector<Amg::Vector3D> seeds;
116 if ( !mcEventCollection.
isValid() ) {
119 return StatusCode::FAILURE;
122 interactions.clear();
123 std::vector<Interactions_pair> interactionsColl;
125 for ( ; itr != mcEventCollection->end(); ++itr ) {
127 if(!
pass( myEvent, mcEventCollection.
cptr()))
continue;
132 for (
const auto& part: *myEvent) {
133 if(!
pass(part, mcEventCollection.
cptr()))
continue;
134 sum_pt2 += part->momentum().perp2();
140 auto Vert = myEvent->vertices().begin();
141 msg(MSG::DEBUG) <<
"Retrieved position x: " << (*Vert)->position().x() <<
142 " y: " << (*Vert)->position().y() <<
143 " z: " << (*Vert)->position().z() <<
endmsg;
145 (*Vert)->position().y(),
146 (*Vert)->position().z());
149 interactionsColl.emplace_back(sum_pt2, vtxPosition );
153 std::sort(interactionsColl.begin(), interactionsColl.end());
154 std::vector<Interactions_pair>::iterator itIp = interactionsColl.begin();
156 for (; itIp < interactionsColl.end(); ++itIp) {
157 interactions.push_back(itIp->second);
158 ATH_MSG_DEBUG(
"(" << itIp->second.x() <<
", " << itIp->second.y() <<
", "
159 << itIp->second.z() <<
"), SumPt2 = " << itIp->first);
162 ATH_MSG_DEBUG(
"New interactions info stored successfully: " << interactions.size() <<
" interactions found.");
163 return StatusCode::SUCCESS;
173 bool isEmpty = ( evt->particles_size() == 0 );
174 bool isDummy = ( ( evt->event_number() == -1 ) &&
176 if( isDummy ) isEmpty =
false;
178 if( isEmpty )
return false;
179 if( isDummy )
return false;
182 if( ! coll )
return true;
193 for( ; iter != end; ++iter ) {
194 if( ( ( ( *iter )->event_number() == -1 ) &&
198 if( evt == *iter )
break;
202 if( gotzero == 2 )
return false;
203 if( gotzero == 3 )
return false;
204 if( gotzero == 4 )
return false;
213 if( !
pass( part->parent_event(), coll ) )
return false;
222 int pdg = part->pdg_id();
225 if( std::abs(pdg) < 7 || std::abs(pdg) == 21 )
return false;
229 return std::abs(
charge ) >= 1E-5;
#define ATH_CHECK
Evaluate an expression and check for errors.
double charge(const T &p)
bool operator>(const DataVector< T > &a, const DataVector< T > &b)
Based on operator<.
bool operator<(const DataVector< T > &a, const DataVector< T > &b)
Vector ordering relation.
ATLAS-specific HepMC functions.
DataModel_detail::const_iterator< DataVector > const_iterator
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
This defines the McEventCollection, which is really just an ObjectVector of McEvent objectsFile: Gene...
virtual bool isValid() override final
Can the handle be successfully dereferenced?
const_pointer_type cptr()
Dereference the pointer.
bool m_removeHardScattering
Flag to consider hard-scattering interaction.
MCTrueSeedFinder(const std::string &t, const std::string &n, const IInterface *p)
StatusCode retrieveInteractionsInfo(std::vector< Amg::Vector3D > &interactions) const
bool pass(const HepMC::GenEvent *evt, const McEventCollection *coll=0) const
Function selecting GenEvent objects.
virtual ~MCTrueSeedFinder()
virtual std::vector< Amg::Vector3D > findMultiSeeds(const std::vector< const Trk::Track * > &vectorTrk, const xAOD::Vertex *constraint=0) const override final
Finds full vector of linearization points from a vector of tracks and returns it as an Amg::Vector3D ...
bool m_removeInTimePileUp
Flag to consider in-time pile-up interactions.
SG::ReadHandleKey< McEventCollection > m_mcEventCollectionKey
virtual StatusCode initialize() override
virtual Amg::Vector3D findSeed(const std::vector< const Trk::Track * > &vectorTrk, const xAOD::Vertex *constraint=0) const override final
Finds a linearization point out of a vector of tracks and returns it as an Amg::Vector3D object.
Eigen::Matrix< double, 3, 1 > Vector3D
int signal_process_id(const GenEvent &evt)
HepMC3::ConstGenParticlePtr ConstGenParticlePtr
bool is_simulation_particle(const T &p)
Method to establish if a particle (or barcode) was created during the simulation (TODO update to be s...
HepMC3::GenEvent GenEvent
bool isSimInteracting(const T &p)
Identify if the particle could interact with the detector during the simulation, e....
double charge(const T &p)
bool isGenStable(const T &p)
Determine if the particle is stable at the generator (not det-sim) level,.
Ensure that the ATLAS eigen extensions are properly loaded.
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.
Vertex_v1 Vertex
Define the latest version of the vertex class.