![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
ATLAS Offline Software
|
Go to the documentation of this file.
13 #include "GaudiKernel/MsgStream.h"
14 #include "GaudiKernel/GaudiException.h"
36 m_matchBranches( false ),
44 const bool matchBranches ) :
47 m_matchSign( matchSign ),
48 m_matchBranches( matchBranches ),
49 m_decayPattern( decayPattern ),
57 const bool matchBranches ) :
60 m_matchSign( matchSign ),
61 m_matchBranches( matchBranches ),
70 m_matchSign ( rhs.m_matchSign ),
71 m_matchBranches( rhs.m_matchBranches ),
72 m_decayPattern ( rhs.m_decayPattern ),
132 unsigned int number_particles_out = vtx->particles_out_size();
133 unsigned int number_particles_in = vtx->particles_in_size();
140 number_particles_out ==
static_cast<unsigned int>( 1 ) ) {
183 number_particles_out >= 2 ) {
203 out <<
">>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<" << std::endl;
204 out <<
">>> Parents : " << std::endl;
208 out <<
"\nList for : " << *itr
209 <<
" (" << (*itr)->size() <<
")" << std::endl;
213 out <<
">>> Children : " << std::endl;
217 out <<
"\nList for : " << *itr
218 <<
" (" << (*itr)->size() <<
")" << std::endl;
221 out <<
">>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<" << std::endl;
257 std::vector<std::vector<std::string> >
parents =
parser.getParents();
258 for(std::vector<std::vector<std::string> >::const_iterator itr =
parents.begin();
262 const std::vector<std::string>::const_iterator candEnd = itr->end();
263 for( std::vector<std::string>::const_iterator candidate = itr->begin();
264 candidate != candEnd;
266 int pdgID =
parser.pdgId( *candidate );
267 list->push_back( pdgID );
269 if ( !
list->empty() ) {
275 std::vector<std::vector<std::string> >
children =
parser.getChildren();
276 for(std::vector<std::vector<std::string> >::const_iterator itr =
children.begin();
280 const std::vector<std::string>::const_iterator candEnd = itr->end();
281 for( std::vector<std::string>::const_iterator candidate = itr->begin();
282 candidate != candEnd;
284 int pdgID =
parser.pdgId( *candidate );
285 list->push_back( pdgID );
287 if ( !
list->empty() ) {
316 if (
static_cast<unsigned int>(vtx->particles_in_size()) <
m_parentList.
size() ){
322 <<
"Number of list of parents : "
328 std::vector<int> parentIds;
330 for (
const auto&
Part: vtx->particles_in() ) {
331 parentIds.push_back(
Part->pdg_id() );
334 for ( HepMC::GenVertex::particles_in_const_iterator itrPart = vtx->particles_in_const_begin();
335 itrPart != vtx->particles_in_const_end();
337 parentIds.push_back( (*itrPart)->pdg_id() );
344 bool accepted =
false;
348 for (
unsigned int i = 0;
i != iMax; ++
i ) {
364 << ( accepted ?
"accept" :
"reject" )
383 if (
static_cast<unsigned int>(vtx->particles_out_size()) <
m_childList.
size() )
return false;
386 std::vector<int> childIds;
387 for (
auto Part: *vtx) {
388 childIds.push_back(
Part->pdg_id() );
394 bool accepted =
false;
398 for (
unsigned int i = 0;
i != iMax; ++
i ) {
409 << ( accepted ?
"accept" :
"reject" )
422 if ( parentTree ==
false ) {
436 const int pdgId1= vtx->particles_out().
at(0)->pdg_id();
437 const int pdgId2= vtx->particles_out().at(1)->pdg_id();
439 HepMC::GenVertex::particles_out_const_iterator itrPart = vtx->particles_out_const_begin();
440 const int pdgId1 = (*itrPart)->pdg_id();
442 const int pdgId2 = (*itrPart)->pdg_id();
447 itr1 != children1->
end();
451 itr2 != children2->
end();
458 ( ( (*itr1) == pdgId1 && (*itr2) == pdgId2 ) ||
459 ( (*itr1) == pdgId2 && (*itr2) == pdgId1 ) ) ) {
464 }
else if ( ( std::abs(*itr1) == std::abs(pdgId1) &&
465 std::abs(*itr2) == std::abs(pdgId2) ) ||
466 ( std::abs(*itr1) == std::abs(pdgId2) &&
467 std::abs(*itr2) == std::abs(pdgId1) ) ) {
487 std::stringstream
out;
void reserve(size_type n)
Attempt to preallocate enough memory for a specified number of elements.
const_iterator begin() const
void dump(std::ostream &out=std::cout) const
Dump to std::ostream (default = std::cout) the decay pattern the filter one is looking for.
bool m_matchBranches
Tell if one wants a strict vertex branches matching.
DataVector< const ParticleCandidateList > m_parentList
The list of the matching particles Ids : each item in DataVector stands for an entering branch to the...
singleton-like access to IMessageSvc via open function and helper
parents
print ("==> buf:",buf)
MsgStream & operator<<(MsgStream &msg, const McVtxFilter &obj)
I/O operators.
bool checkParentBranch(HepMC::ConstGenVertexPtr vtx) const
Check if the parent branch fulfills the requirements.
virtual void setFilter(const IFilterCuts *filter)
Set filter cut options.
#define ATH_MSG_VERBOSE(x)
void line(std::ostream &os, const GenEvent &e)
McVtxFilter()
Default constructor:
bool checkTwoBodyDecay(HepMC::ConstGenVertexPtr vtx) const
Check the branches for the special case of a 1->2 body decay (there is some room for optimisation in ...
McVtxFilter allows to select HepMC::GenParticle based on the decay pattern.
virtual bool isAccepted(HepMC::ConstGenVertexPtr vtx) const
Main filter method.
const std::string & decayPattern() const
return the decay pattern used by this filter
bool msgLvl(const MSG::Level lvl) const
Test the output level.
std::string m_decayPattern
The decay pattern one looks for.
void setDecayPattern(const std::string &decayPattern)
Set the decay pattern to look for : it correctly setups the parent and children according to the LaTe...
const T * front() const
Access the first element in the collection as an rvalue.
bool get(OUT &perm)
get a permutation.
Class to provide easy MsgStream access and capabilities.
bool checkChildBranch(HepMC::ConstGenVertexPtr vtx) const
Check if the child branch fulfills the requirements.
MsgStream & msg() const
The standard message stream.
void clear()
Erase all the elements in the collection.
const GenParticle * ConstGenParticlePtr
value_type push_back(value_type pElem)
Add an element to the end of the collection.
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
const_iterator end() const
IFilterCuts & operator=(const IFilterCuts &rhs)
Assignment operator:
std::list< int >::const_iterator const_iterator
IFilterCuts is a class which is used internally by the filters to copy their cut properties one to ...
const HepMC::GenVertex * ConstGenVertexPtr
const T * at(size_type n) const
Access an element, as an rvalue.
A simple wrapper for std::list<int> to model a list of particle identity candidates.
bool m_matchSign
Discrimination between particles and conjugates.
size_type size() const noexcept
Returns the number of elements in the collection.
DataVector< const ParticleCandidateList > m_childList
The list of the matching particles Ids : each item in DataVector stands for an out-going branch to th...
McVtxFilter & operator=(const McVtxFilter &rhs)
Assignment operator:
bool empty() const noexcept
Returns true if the collection is empty.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.