ATLAS Offline Software
Loading...
Searching...
No Matches
McVtxFilter Class Reference

McVtxFilter allows to select HepMC::GenParticle based on the decay pattern. More...

#include <McVtxFilter.h>

Inheritance diagram for McVtxFilter:
Collaboration diagram for McVtxFilter:

Public Member Functions

 McVtxFilter ()
 Default constructor:
 McVtxFilter (const McVtxFilter &rhs)
 Copy constructor:
 McVtxFilter (const std::string &decayPattern, const bool matchSign=false, const bool matchBranches=false)
 Constructor with parameters:
 McVtxFilter (const bool matchSign, const bool matchBranches)
 Constructor with parameters:
virtual ~McVtxFilter ()
 Destructor:
McVtxFilteroperator= (const McVtxFilter &rhs)
 Assignment operator:
virtual bool isAccepted (HepMC::ConstGenVertexPtr vtx) const
 Main filter method.
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 isFullVtx () const
 returns true if the vertex filter requires a parent AND a child list ie: returns false if the filter looks only for a lonely particle (eg: a photon or an electron, see TruthParticleAlgs for a concrete example)
bool matchSign () const
 return true if the filter discriminates the sign of the particles
bool matchBranches () const
 return true if the filter strictly matchs the number of output particles eg: a vertex t->Wbgg won't be selected if matchBranches == true and decay pattern = "#id 6[24,5]"
const std::string & decayPattern () const
 return the decay pattern used by this filter
const DataVector< const ParticleCandidateList > & parentList () const
 return the list of particle candidates for the input particles (parent)
const DataVector< const ParticleCandidateList > & childList () const
 return the list of particle candidates for the output particles (child)
virtual void setFilter (const IFilterCuts *filter)
 Set filter cut options.
void setMatchSign (const bool matchSign)
 Set if one wants to discriminate the sign of the particles.
void setMatchBranches (const bool matchVtxBranches)
 Set if one wants to strictly match the number of output particles.
void setDecayPattern (const std::string &decayPattern)
 Set the decay pattern to look for : it correctly setups the parent and children according to the LaTeX-like string which is given as argument.
bool msgLvl (const MSG::Level lvl) const
 Test the output level.
MsgStream & msg () const
 The standard message stream.
MsgStream & msg (const MSG::Level lvl) const
 The standard message stream.
void setLevel (MSG::Level lvl)
 Change the current logging level.

Protected Member Functions

bool checkParentBranch (HepMC::ConstGenVertexPtr vtx) const
 Check if the parent branch fulfills the requirements.
bool checkChildBranch (HepMC::ConstGenVertexPtr vtx) const
 Check if the child branch fulfills the requirements.
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 that particular case)

Protected Attributes

bool m_matchSign
 Discrimination between particles and conjugates.
bool m_matchBranches
 Tell if one wants a strict vertex branches matching.
std::string m_decayPattern
 The decay pattern one looks for.
DataVector< const ParticleCandidateListm_parentList
 The list of the matching particles Ids : each item in DataVector stands for an entering branch to the vertex.
DataVector< const ParticleCandidateListm_childList
 The list of the matching particles Ids : each item in DataVector stands for an out-going branch to the vertex.

Private Member Functions

void initMessaging () const
 Initialize our message level and MessageSvc.

Private Attributes

std::string m_nm
 Message source name.
boost::thread_specific_ptr< MsgStream > m_msg_tls
 MsgStream instance (a std::cout like with print-out levels)
std::atomic< IMessageSvc * > m_imsg { nullptr }
 MessageSvc pointer.
std::atomic< MSG::Level > m_lvl { MSG::NIL }
 Current logging level.
std::atomic_flag m_initialized ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT
 Messaging initialized (initMessaging)

Detailed Description

McVtxFilter allows to select HepMC::GenParticle based on the decay pattern.

Hopefully one will be able to also select the particles by pt (in a coming patch). It uses internally the DecayPattern class to build the filtering decision The basic modus operandi is to loop on HepMC::GenVertex (of a given HepMC::GenEvent) to select the ones which are of interest (and fulfill the decay pattern).

Definition at line 44 of file McVtxFilter.h.

Constructor & Destructor Documentation

◆ McVtxFilter() [1/4]

McVtxFilter::McVtxFilter ( )

Default constructor:

Public methods:

Constructors

Definition at line 32 of file McVtxFilter.cxx.

32 :
34 AthMessaging ( "McVtxFilter" ),
35 m_matchSign( false ),
36 m_matchBranches( false ),
37 m_decayPattern( "" ),
40{}
AthMessaging()
Default constructor:
IFilterCuts()
Default constructor:
Definition IFilterCuts.h:69
bool m_matchBranches
Tell if one wants a strict vertex branches matching.
std::string m_decayPattern
The decay pattern one looks for.
DataVector< const ParticleCandidateList > m_childList
The list of the matching particles Ids : each item in DataVector stands for an out-going branch to th...
bool m_matchSign
Discrimination between particles and conjugates.
DataVector< const ParticleCandidateList > m_parentList
The list of the matching particles Ids : each item in DataVector stands for an entering branch to the...

◆ McVtxFilter() [2/4]

McVtxFilter::McVtxFilter ( const McVtxFilter & rhs)

Copy constructor:

Definition at line 67 of file McVtxFilter.cxx.

67 :
68 IFilterCuts ( rhs ),
69 AthMessaging ( "McVtxFilter" ),
75{
76 // deep copy of the parent branch
77 m_parentList.reserve( rhs.m_parentList.size() );
79 rhs.m_parentList.begin();
80 itr != rhs.m_parentList.end();
81 ++itr ) {
82 m_parentList.push_back( new ParticleCandidateList(**itr) );
83 }
84
85 // deep copy of the child branch
86 m_childList.reserve( rhs.m_childList.size() );
88 rhs.m_childList.begin();
89 itr != rhs.m_childList.end();
90 ++itr ) {
91 m_childList.push_back( new ParticleCandidateList(**itr) );
92 }
93}
DataModel_detail::const_iterator< DataVector > const_iterator
Standard const_iterator.
Definition DataVector.h:838
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.
size_type size() const noexcept
Returns the number of elements in the collection.

◆ McVtxFilter() [3/4]

McVtxFilter::McVtxFilter ( const std::string & decayPattern,
const bool matchSign = false,
const bool matchBranches = false )

Constructor with parameters:

Definition at line 42 of file McVtxFilter.cxx.

44 :
46 AthMessaging ( "McVtxFilter" ),
52{
54}
bool matchSign() const
return true if the filter discriminates the sign of the particles
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 std::string & decayPattern() const
return the decay pattern used by this filter
bool matchBranches() const
return true if the filter strictly matchs the number of output particles eg: a vertex t->Wbgg won't b...

◆ McVtxFilter() [4/4]

McVtxFilter::McVtxFilter ( const bool matchSign,
const bool matchBranches )

Constructor with parameters:

Definition at line 56 of file McVtxFilter.cxx.

57 :
59 AthMessaging ( "McVtxFilter" ),
62 m_decayPattern( "" ),
65{}

◆ ~McVtxFilter()

McVtxFilter::~McVtxFilter ( )
inlinevirtual

Destructor:

Definition at line 199 of file McVtxFilter.h.

199{}

Member Function Documentation

◆ checkChildBranch()

bool McVtxFilter::checkChildBranch ( HepMC::ConstGenVertexPtr vtx) const
protected

Check if the child branch fulfills the requirements.

Check we aren't in the "any particle" case

Check there is enough outgoing particles in the current vertex

Definition at line 369 of file McVtxFilter.cxx.

370{
371 ATH_MSG_VERBOSE("In checkChildBranch...");
372
373 if ( msgLvl(MSG::VERBOSE) ) {
374 HepMC::Print::line(std::cout,vtx);
375 }
376
378 if ( m_childList.empty() ) {
379 return true;
380 }
381
383 if ( static_cast<unsigned int>(vtx->particles_out_size()) < m_childList.size() ) return false;
384 ATH_MSG_VERBOSE("Number of list of children : " << m_childList.size());
385
386 std::vector<int> childIds;
387 for ( auto Part: *vtx) {
388 childIds.push_back( Part->pdg_id() );
389 }
390
391 AnalysisUtils::Permutation<std::vector<int> > permute( &childIds, m_childList.size() );
392 std::vector<int> children;
393
394 bool accepted = false;
395 while ( permute.get(children) && !accepted ) {
396 accepted = true;
397 const unsigned int iMax = std::min( m_childList.size(), childIds.size() );
398 for ( unsigned int i = 0; i != iMax; ++i ) {
399 const bool hasInList = m_childList[i]->hasInList( children[i], m_matchSign );
400 if ( !hasInList ) {
401 // this permutation is not suiting, going to the next one (if any)
402 accepted = false;
403 break;
404 }
405 }
406 }
407
408 ATH_MSG_VERBOSE(">>> CheckChildBranch is DONE : "
409 << ( accepted ? "accept" : "reject" )
410 << " vtx= " << vtx);
411 return accepted;
412}
#define ATH_MSG_VERBOSE(x)
bool msgLvl(const MSG::Level lvl) const
Test the output level.
void line(std::ostream &os, const GenEvent &e)
Definition GenEvent.h:678

◆ checkParentBranch()

bool McVtxFilter::checkParentBranch ( HepMC::ConstGenVertexPtr vtx) const
protected

Check if the parent branch fulfills the requirements.

Protected methods:

Check we aren't in the "any particle" case

Check if number of parents is OK

Definition at line 302 of file McVtxFilter.cxx.

303{
304 ATH_MSG_VERBOSE("In checkParentBranch...");
305
307 if ( m_parentList.empty() ) {
308 return true;
309 }
310
311 if ( msgLvl(MSG::VERBOSE) ) {
312 HepMC::Print::line(std::cout,vtx);
313 }
314
316 if ( static_cast<unsigned int>(vtx->particles_in_size()) < m_parentList.size() ){
317 return false;
318 }
319
320 if ( msgLvl(MSG::VERBOSE) ) {
321 msg() << MSG::VERBOSE
322 << "Number of list of parents : "
323 << m_parentList.size()
324 << endmsg;
325 m_parentList.front()->dropList();
326 }
327
328 std::vector<int> parentIds;
329#ifdef HEPMC3
330 for ( const auto& Part: vtx->particles_in() ) {
331 parentIds.push_back( Part->pdg_id() );
332 }
333#else
334 for ( HepMC::GenVertex::particles_in_const_iterator itrPart = vtx->particles_in_const_begin();
335 itrPart != vtx->particles_in_const_end();
336 ++itrPart ) {
337 parentIds.push_back( (*itrPart)->pdg_id() );
338 }
339#endif
340
341 AnalysisUtils::Permutation<std::vector<int> > permute( &parentIds, m_parentList.size() );
342 std::vector<int> parents;
343
344 bool accepted = false;
345 while ( permute.get(parents) && !accepted ) {
346 accepted = true;
347 const unsigned int iMax = std::min( m_parentList.size(), parentIds.size() );
348 for ( unsigned int i = 0; i != iMax; ++i ) {
349 const bool hasInList = m_parentList[i]->hasInList( parents[i],m_matchSign );
350 if ( !hasInList ) {
351 // this permutation is not suiting, going to the next one (if any)
352 accepted = false;
353 break;
354 }
355 }
356
357 // everything went fine for this permutation !
358 if ( accepted ) {
359 break;
360 }
361 }
362
363 ATH_MSG_VERBOSE(">>> CheckParentBranch is DONE : "
364 << ( accepted ? "accept" : "reject" )
365 << " vtx= " << vtx);
366 return accepted;
367}
#define endmsg
MsgStream & msg() const
The standard message stream.
parents
print ("==> buf:",buf)

◆ checkTwoBodyDecay()

bool McVtxFilter::checkTwoBodyDecay ( HepMC::ConstGenVertexPtr vtx) const
protected

Check the branches for the special case of a 1->2 body decay (there is some room for optimisation in that particular case)

First check the parent branch matching decision if it doesn't fulfil our requirements, it is not worth continuing the process

Now, handle the child branch

Cache the 2 particle candidate lists

Cache the id of the outgoing particles of the vertex being analysed

Loop over candidates for the 1st child

Loop over candidate for the 2nd child

If the strict match sign has been required, we check if the PDG ids are matching

if we are in a loose sign request, we check only that the absolute values of the pdg IDs are matching

If we are here, then the vertex candidate didn't fulfil the requirements we have setup

Definition at line 414 of file McVtxFilter.cxx.

415{
416 ATH_MSG_VERBOSE("In checkTwoBodyDecay...");
417
421 const bool parentTree = checkParentBranch( vtx );
422 if ( parentTree == false ) {
423 return false;
424 }
425
427 ATH_MSG_VERBOSE(">>> Check child branch");
428
430 const ParticleCandidateList * children1 = m_childList[0];
431 const ParticleCandidateList * children2 = m_childList[1];
432
434//AV It would be a very good idea to have a chack of the number of output particles here.
435#ifdef HEPMC3
436 const int pdgId1= vtx->particles_out().at(0)->pdg_id();
437 const int pdgId2= vtx->particles_out().at(1)->pdg_id();
438#else
439 HepMC::GenVertex::particles_out_const_iterator itrPart = vtx->particles_out_const_begin();
440 const int pdgId1 = (*itrPart)->pdg_id();
441 ++itrPart;
442 const int pdgId2 = (*itrPart)->pdg_id();
443#endif
444
446 for( ParticleCandidateList::const_iterator itr1 = children1->begin();
447 itr1 != children1->end();
448 ++itr1 ) {
450 for( ParticleCandidateList::const_iterator itr2 = children2->begin();
451 itr2 != children2->end();
452 ++itr2 ) {
453 ATH_MSG_VERBOSE("Checking the pair : " << (*itr1) << "/" << (*itr2));
454
457 if ( m_matchSign &&
458 ( ( (*itr1) == pdgId1 && (*itr2) == pdgId2 ) ||
459 ( (*itr1) == pdgId2 && (*itr2) == pdgId1 ) ) ) {
460 ATH_MSG_VERBOSE("Strict sign matching found !");
461 return true;
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) ) ) {
468 ATH_MSG_VERBOSE("Loose sign matching found !");
469 return true;
470 }
471 ATH_MSG_VERBOSE("Checking next pair");
472 }//> loop over 2nd child's candidates
473 }//> loop over 1st child's candidates
474
477 ATH_MSG_VERBOSE(">>> CheckTwoBodyDecay is DONE.");
478 return false;
479}
bool checkParentBranch(HepMC::ConstGenVertexPtr vtx) const
Check if the parent branch fulfills the requirements.
const_iterator begin() const
std::list< int >::const_iterator const_iterator
const_iterator end() const

◆ childList()

const DataVector< const ParticleCandidateList > & McVtxFilter::childList ( ) const
inline

return the list of particle candidates for the output particles (child)

Definition at line 236 of file McVtxFilter.h.

237{
238 return m_childList;
239}

◆ decayPattern()

const std::string & McVtxFilter::decayPattern ( ) const
inline

return the decay pattern used by this filter

Definition at line 224 of file McVtxFilter.h.

225{
226 return m_decayPattern;
227}

◆ dump()

void McVtxFilter::dump ( std::ostream & out = std::cout) const

Dump to std::ostream (default = std::cout) the decay pattern the filter one is looking for.

Definition at line 201 of file McVtxFilter.cxx.

202{
203 out << ">>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<" << std::endl;
204 out << ">>> Parents : " << std::endl;
206 itr != m_parentList.end();
207 ++itr ) {
208 out << "\nList for : " << *itr
209 << " (" << (*itr)->size() << ")" << std::endl;
210 (*itr)->dropList();
211 }
212
213 out << ">>> Children : " << std::endl;
215 itr != m_childList.end();
216 ++itr ) {
217 out << "\nList for : " << *itr
218 << " (" << (*itr)->size() << ")" << std::endl;
219 (*itr)->dropList();
220 }
221 out << ">>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<" << std::endl;
222
223 return;
224}

◆ initMessaging()

void AthMessaging::initMessaging ( ) const
privateinherited

Initialize our message level and MessageSvc.

This method should only be called once.

Definition at line 39 of file AthMessaging.cxx.

40{
42 // If user did not set an explicit level, set a default
43 if (m_lvl == MSG::NIL) {
44 m_lvl = m_imsg ?
45 static_cast<MSG::Level>( m_imsg.load()->outputLevel(m_nm) ) :
46 MSG::INFO;
47 }
48}
std::string m_nm
Message source name.
std::atomic< IMessageSvc * > m_imsg
MessageSvc pointer.
std::atomic< MSG::Level > m_lvl
Current logging level.
IMessageSvc * getMessageSvc(bool quiet=false)

◆ isAccepted()

bool McVtxFilter::isAccepted ( HepMC::ConstGenVertexPtr vtx) const
virtual

Main filter method.

Const methods:

This method takes the decision whether or not the filter has to accept the vertex. It checks if the vertex has the required number of ingoing particles the required number of outgoing particles. Then for each branch (parent child) it checks if the particle can match an asked for particle.

First handle special case where the filter has only 1 child and no parent : one is looking for a stable particle with no end_vertex

Skip vertices which don't match the number of branches we are looking for : check if number of parents and of children is OK

Then handle the case we are looking for a 1->2 body decay

Handle other generic cases

Definition at line 128 of file McVtxFilter.cxx.

129{
130 ATH_MSG_VERBOSE("In McVtxFilter::isAccepted(...)");
131//AV TODO: add here a check to prevent null pointer dereference
132 unsigned int number_particles_out = vtx->particles_out_size();
133 unsigned int number_particles_in = vtx->particles_in_size();
138 if ( m_childList.size() == static_cast<unsigned int>( 1 ) &&
139 m_parentList.size() == static_cast<unsigned int>( 0 ) &&
140 number_particles_out == static_cast<unsigned int>( 1 ) ) {
141#ifdef HEPMC3
142 const HepMC::ConstGenParticlePtr& part = vtx->particles_out().front();
143#else
144 HepMC::ConstGenParticlePtr part = *(vtx->particles_out_const_begin());
145#endif
146 const ParticleCandidateList * item = *( m_childList.begin() );
147 if ( item->hasInList( part->pdg_id(), m_matchSign ) ) {
148 return true;
149 } else {
150 return false;
151 }
152 }
153
157 if ( !m_matchBranches ) {
158
159 //
160 // Test only if there is enough *output* branches to match for
161 //
162 if ( number_particles_in < m_parentList.size() ||
163 number_particles_out < m_childList.size() ) {
164 return false;
165 }
166
167 } else {
168 //
169 // Strict match of output branches
170 //
171 if ( number_particles_in != m_parentList.size() ||
172 number_particles_out != m_childList.size() ) {
173 return false;
174 }
175 }
176
180 if ( m_matchBranches &&
181 m_parentList.size() == static_cast<unsigned int>(1) &&
182 m_childList.size() == static_cast<unsigned int>(2) &&
183 number_particles_out >= 2 ) {
184 return checkTwoBodyDecay( std::move(vtx) );
185 } //> two-body decay
186
187
191 ATH_MSG_VERBOSE("trying checkParentBranch(...)");
192 if ( checkParentBranch( vtx ) == false ) return false;
193
194 ATH_MSG_VERBOSE("trying checkChildBranch(...)");
195 if ( checkChildBranch ( std::move(vtx) ) == false ) return false;
196
197 ATH_MSG_VERBOSE("McVtxFilter::isAccepted(...) => DONE");
198 return true;
199}
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 ...
bool checkChildBranch(HepMC::ConstGenVertexPtr vtx) const
Check if the child branch fulfills the requirements.
const GenParticle * ConstGenParticlePtr
Definition GenParticle.h:38

◆ isFullVtx()

bool McVtxFilter::isFullVtx ( ) const
inline

returns true if the vertex filter requires a parent AND a child list ie: returns false if the filter looks only for a lonely particle (eg: a photon or an electron, see TruthParticleAlgs for a concrete example)

Definition at line 205 of file McVtxFilter.h.

206{
207 if ( m_parentList.empty() || m_childList.empty() ) {
208 return false;
209 } else {
210 return true;
211 }
212}

◆ matchBranches()

bool McVtxFilter::matchBranches ( ) const
inline

return true if the filter strictly matchs the number of output particles eg: a vertex t->Wbgg won't be selected if matchBranches == true and decay pattern = "#id 6[24,5]"

Definition at line 219 of file McVtxFilter.h.

220{
221 return m_matchBranches;
222}

◆ matchSign()

bool McVtxFilter::matchSign ( ) const
inline

return true if the filter discriminates the sign of the particles

Definition at line 214 of file McVtxFilter.h.

215{
216 return m_matchSign;
217}

◆ msg() [1/2]

MsgStream & AthMessaging::msg ( ) const
inlineinherited

The standard message stream.

Returns a reference to the default message stream May not be invoked before sysInitialize() has been invoked.

Definition at line 163 of file AthMessaging.h.

164{
165 MsgStream* ms = m_msg_tls.get();
166 if (!ms) {
167 if (!m_initialized.test_and_set()) initMessaging();
168 ms = new MsgStream(m_imsg,m_nm);
169 m_msg_tls.reset( ms );
170 }
171
172 ms->setLevel (m_lvl);
173 return *ms;
174}
boost::thread_specific_ptr< MsgStream > m_msg_tls
MsgStream instance (a std::cout like with print-out levels)
void initMessaging() const
Initialize our message level and MessageSvc.

◆ msg() [2/2]

MsgStream & AthMessaging::msg ( const MSG::Level lvl) const
inlineinherited

The standard message stream.

Returns a reference to the default message stream May not be invoked before sysInitialize() has been invoked.

Definition at line 178 of file AthMessaging.h.

179{ return msg() << lvl; }

◆ msgLvl()

bool AthMessaging::msgLvl ( const MSG::Level lvl) const
inlineinherited

Test the output level.

Parameters
lvlThe message level to test against
Returns
boolean Indicating if messages at given level will be printed
Return values
trueMessages at level "lvl" will be printed

Definition at line 151 of file AthMessaging.h.

152{
153 if (m_lvl <= lvl) {
154 msg() << lvl;
155 return true;
156 } else {
157 return false;
158 }
159}

◆ operator=()

McVtxFilter & McVtxFilter::operator= ( const McVtxFilter & rhs)

Assignment operator:

Definition at line 95 of file McVtxFilter.cxx.

96{
97 if ( this != &rhs ) {
102
103 // deep copy of the parent branch
104 m_parentList.reserve( rhs.m_parentList.size() );
106 rhs.m_parentList.begin();
107 itr != rhs.m_parentList.end();
108 ++itr ) {
109 m_parentList.push_back( new ParticleCandidateList(**itr) );
110 }
111
112 // deep copy of the child branch
113 m_childList.reserve( rhs.m_childList.size() );
115 rhs.m_childList.begin();
116 itr != rhs.m_childList.end();
117 ++itr ) {
118 m_childList.push_back( new ParticleCandidateList(**itr) );
119 }
120 }
121 return *this;
122}
IFilterCuts & operator=(const IFilterCuts &rhs)
Assignment operator:
Definition IFilterCuts.h:78

◆ parentList()

const DataVector< const ParticleCandidateList > & McVtxFilter::parentList ( ) const
inline

return the list of particle candidates for the input particles (parent)

Definition at line 230 of file McVtxFilter.h.

231{
232 return m_parentList;
233}

◆ setDecayPattern()

void McVtxFilter::setDecayPattern ( const std::string & decayPattern)

Set the decay pattern to look for : it correctly setups the parent and children according to the LaTeX-like string which is given as argument.

Set the filter from a decay pattern.

Definition at line 247 of file McVtxFilter.cxx.

248{
249 // clear parent and child candidates
250 m_parentList.clear();
251 m_childList.clear();
252
254
255 DecayParser parser( m_decayPattern );
256
257 std::vector<std::vector<std::string> > parents = parser.getParents();
258 for(std::vector<std::vector<std::string> >::const_iterator itr = parents.begin();
259 itr != parents.end();
260 ++itr ) {
261 ParticleCandidateList * list = new ParticleCandidateList();
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;
265 ++candidate ) {
266 int pdgID = parser.pdgId( *candidate );
267 list->push_back( pdgID );
268 }
269 if ( ! list->empty() ) {
270 m_parentList.push_back( list );
271 } else {
272 delete list;
273 }
274 }
275 std::vector<std::vector<std::string> > children = parser.getChildren();
276 for(std::vector<std::vector<std::string> >::const_iterator itr = children.begin();
277 itr != children.end();
278 ++itr ) {
279 ParticleCandidateList * list = new ParticleCandidateList();
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;
283 ++candidate ) {
284 int pdgID = parser.pdgId( *candidate );
285 list->push_back( pdgID );
286 }
287 if ( ! list->empty() ) {
288 m_childList.push_back( list );
289 } else {
290 delete list;
291 }
292 }
293
294 return;
295}
list(name, path='/')
Definition histSizes.py:38

◆ setFilter()

void McVtxFilter::setFilter ( const IFilterCuts * filter)
virtual

Set filter cut options.

Non-const methods:

Set filter cut options

Implements IFilterCuts.

Definition at line 232 of file McVtxFilter.cxx.

233{
234 if ( filter ) {
235 const McVtxFilter * vtxFilter =
236 dynamic_cast<const McVtxFilter*>(filter);
237
238 if ( vtxFilter ) {
239 operator=(*vtxFilter);
240 } else {
241 ATH_MSG_ERROR("Can't dynamic_cast " << typeid(filter).name() << " to a McVtxFilter");
242 }
243 } //> filter is a valid pointer
244}
#define ATH_MSG_ERROR(x)
McVtxFilter()
Default constructor:
McVtxFilter & operator=(const McVtxFilter &rhs)
Assignment operator:

◆ setLevel()

void AthMessaging::setLevel ( MSG::Level lvl)
inherited

Change the current logging level.

Use this rather than msg().setLevel() for proper operation with MT.

Definition at line 28 of file AthMessaging.cxx.

29{
30 m_lvl = lvl;
31}

◆ setMatchBranches()

void McVtxFilter::setMatchBranches ( const bool matchVtxBranches)
inline

Set if one wants to strictly match the number of output particles.

Definition at line 250 of file McVtxFilter.h.

251{
253}

◆ setMatchSign()

void McVtxFilter::setMatchSign ( const bool matchSign)
inline

Set if one wants to discriminate the sign of the particles.

Definition at line 245 of file McVtxFilter.h.

246{
248}

Member Data Documentation

◆ ATLAS_THREAD_SAFE

std::atomic_flag m_initialized AthMessaging::ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT
mutableprivateinherited

Messaging initialized (initMessaging)

Definition at line 141 of file AthMessaging.h.

◆ m_childList

DataVector<const ParticleCandidateList> McVtxFilter::m_childList
protected

The list of the matching particles Ids : each item in DataVector stands for an out-going branch to the vertex.

Definition at line 186 of file McVtxFilter.h.

◆ m_decayPattern

std::string McVtxFilter::m_decayPattern
protected

The decay pattern one looks for.

Ex: 23 -> -11 + 11 to model a Z0 -> e+ e- decay

Definition at line 178 of file McVtxFilter.h.

◆ m_imsg

std::atomic<IMessageSvc*> AthMessaging::m_imsg { nullptr }
mutableprivateinherited

MessageSvc pointer.

Definition at line 135 of file AthMessaging.h.

135{ nullptr };

◆ m_lvl

std::atomic<MSG::Level> AthMessaging::m_lvl { MSG::NIL }
mutableprivateinherited

Current logging level.

Definition at line 138 of file AthMessaging.h.

138{ MSG::NIL };

◆ m_matchBranches

bool McVtxFilter::m_matchBranches
protected

Tell if one wants a strict vertex branches matching.

This is to cope with radiations in the output branches If true then a decay t->Wbggg will not be kept if one asked for a top into W+b decay... Default : false

Definition at line 174 of file McVtxFilter.h.

◆ m_matchSign

bool McVtxFilter::m_matchSign
protected

Discrimination between particles and conjugates.

Definition at line 167 of file McVtxFilter.h.

◆ m_msg_tls

boost::thread_specific_ptr<MsgStream> AthMessaging::m_msg_tls
mutableprivateinherited

MsgStream instance (a std::cout like with print-out levels)

Definition at line 132 of file AthMessaging.h.

◆ m_nm

std::string AthMessaging::m_nm
privateinherited

Message source name.

Definition at line 129 of file AthMessaging.h.

◆ m_parentList

DataVector<const ParticleCandidateList> McVtxFilter::m_parentList
protected

The list of the matching particles Ids : each item in DataVector stands for an entering branch to the vertex.

Definition at line 182 of file McVtxFilter.h.


The documentation for this class was generated from the following files: