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 356 of file McVtxFilter.cxx.

357{
358 ATH_MSG_VERBOSE("In checkChildBranch...");
359
360 if ( msgLvl(MSG::VERBOSE) ) {
361 HepMC::Print::line(std::cout,vtx);
362 }
363
365 if ( m_childList.empty() ) {
366 return true;
367 }
368
370 if ( static_cast<unsigned int>(vtx->particles_out_size()) < m_childList.size() ) return false;
371 ATH_MSG_VERBOSE("Number of list of children : " << m_childList.size());
372
373 std::vector<int> childIds;
374 for ( auto Part: *vtx) {
375 childIds.push_back( Part->pdg_id() );
376 }
377
378 AnalysisUtils::Permutation<std::vector<int> > permute( &childIds, m_childList.size() );
379 std::vector<int> children;
380
381 bool accepted = false;
382 while ( permute.get(children) && !accepted ) {
383 accepted = true;
384 const unsigned int iMax = std::min( m_childList.size(), childIds.size() );
385 for ( unsigned int i = 0; i != iMax; ++i ) {
386 const bool hasInList = m_childList[i]->hasInList( children[i], m_matchSign );
387 if ( !hasInList ) {
388 // this permutation is not suiting, going to the next one (if any)
389 accepted = false;
390 break;
391 }
392 }
393 }
394
395 ATH_MSG_VERBOSE(">>> CheckChildBranch is DONE : "
396 << ( accepted ? "accept" : "reject" )
397 << " vtx= " << vtx);
398 return accepted;
399}
#define ATH_MSG_VERBOSE(x)
bool msgLvl(const MSG::Level lvl) const
Test the output level.

◆ 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 298 of file McVtxFilter.cxx.

299{
300 ATH_MSG_VERBOSE("In checkParentBranch...");
301
303 if ( m_parentList.empty() ) {
304 return true;
305 }
306
307 if ( msgLvl(MSG::VERBOSE) ) {
308 HepMC::Print::line(std::cout,vtx);
309 }
310
312 if ( static_cast<unsigned int>(vtx->particles_in_size()) < m_parentList.size() ){
313 return false;
314 }
315
316 if ( msgLvl(MSG::VERBOSE) ) {
317 msg() << MSG::VERBOSE
318 << "Number of list of parents : "
319 << m_parentList.size()
320 << endmsg;
321 m_parentList.front()->dropList();
322 }
323
324 std::vector<int> parentIds;
325 for ( const auto& Part: vtx->particles_in() ) {
326 parentIds.push_back( Part->pdg_id() );
327 }
328 AnalysisUtils::Permutation<std::vector<int> > permute( &parentIds, m_parentList.size() );
329 std::vector<int> parents;
330
331 bool accepted = false;
332 while ( permute.get(parents) && !accepted ) {
333 accepted = true;
334 const unsigned int iMax = std::min( m_parentList.size(), parentIds.size() );
335 for ( unsigned int i = 0; i != iMax; ++i ) {
336 const bool hasInList = m_parentList[i]->hasInList( parents[i],m_matchSign );
337 if ( !hasInList ) {
338 // this permutation is not suiting, going to the next one (if any)
339 accepted = false;
340 break;
341 }
342 }
343
344 // everything went fine for this permutation !
345 if ( accepted ) {
346 break;
347 }
348 }
349
350 ATH_MSG_VERBOSE(">>> CheckParentBranch is DONE : "
351 << ( accepted ? "accept" : "reject" )
352 << " vtx= " << vtx);
353 return accepted;
354}
#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 401 of file McVtxFilter.cxx.

402{
403 ATH_MSG_VERBOSE("In checkTwoBodyDecay...");
404
408 const bool parentTree = checkParentBranch( vtx );
409 if ( parentTree == false ) {
410 return false;
411 }
412
414 ATH_MSG_VERBOSE(">>> Check child branch");
415
417 const ParticleCandidateList * children1 = m_childList[0];
418 const ParticleCandidateList * children2 = m_childList[1];
419
421//AV It would be a very good idea to have a chack of the number of output particles here.
422 const int pdgId1= vtx->particles_out().at(0)->pdg_id();
423 const int pdgId2= vtx->particles_out().at(1)->pdg_id();
424
426 for( ParticleCandidateList::const_iterator itr1 = children1->begin();
427 itr1 != children1->end();
428 ++itr1 ) {
430 for( ParticleCandidateList::const_iterator itr2 = children2->begin();
431 itr2 != children2->end();
432 ++itr2 ) {
433 ATH_MSG_VERBOSE("Checking the pair : " << (*itr1) << "/" << (*itr2));
434
437 if ( m_matchSign &&
438 ( ( (*itr1) == pdgId1 && (*itr2) == pdgId2 ) ||
439 ( (*itr1) == pdgId2 && (*itr2) == pdgId1 ) ) ) {
440 ATH_MSG_VERBOSE("Strict sign matching found !");
441 return true;
444 } else if ( ( std::abs(*itr1) == std::abs(pdgId1) &&
445 std::abs(*itr2) == std::abs(pdgId2) ) ||
446 ( std::abs(*itr1) == std::abs(pdgId2) &&
447 std::abs(*itr2) == std::abs(pdgId1) ) ) {
448 ATH_MSG_VERBOSE("Loose sign matching found !");
449 return true;
450 }
451 ATH_MSG_VERBOSE("Checking next pair");
452 }//> loop over 2nd child's candidates
453 }//> loop over 1st child's candidates
454
457 ATH_MSG_VERBOSE(">>> CheckTwoBodyDecay is DONE.");
458 return false;
459}
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 197 of file McVtxFilter.cxx.

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

◆ 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 const HepMC::ConstGenParticlePtr& part = vtx->particles_out().front();
142 const ParticleCandidateList * item = *( m_childList.begin() );
143 if ( item->hasInList( part->pdg_id(), m_matchSign ) ) {
144 return true;
145 } else {
146 return false;
147 }
148 }
149
153 if ( !m_matchBranches ) {
154
155 //
156 // Test only if there is enough *output* branches to match for
157 //
158 if ( number_particles_in < m_parentList.size() ||
159 number_particles_out < m_childList.size() ) {
160 return false;
161 }
162
163 } else {
164 //
165 // Strict match of output branches
166 //
167 if ( number_particles_in != m_parentList.size() ||
168 number_particles_out != m_childList.size() ) {
169 return false;
170 }
171 }
172
176 if ( m_matchBranches &&
177 m_parentList.size() == static_cast<unsigned int>(1) &&
178 m_childList.size() == static_cast<unsigned int>(2) &&
179 number_particles_out >= 2 ) {
180 return checkTwoBodyDecay( std::move(vtx) );
181 } //> two-body decay
182
183
187 ATH_MSG_VERBOSE("trying checkParentBranch(...)");
188 if ( checkParentBranch( vtx ) == false ) return false;
189
190 ATH_MSG_VERBOSE("trying checkChildBranch(...)");
191 if ( checkChildBranch ( std::move(vtx) ) == false ) return false;
192
193 ATH_MSG_VERBOSE("McVtxFilter::isAccepted(...) => DONE");
194 return true;
195}
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.
bool hasInList(const int &pdgID, const bool tightMatch=false) const
Tells if a given particle or pID is in the list if tightMatch = false : look only if std::abs() of pa...
HepMC3::ConstGenParticlePtr ConstGenParticlePtr
Definition GenParticle.h:20

◆ 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 167 of file AthMessaging.h.

168{
169 MsgStream* ms = m_msg_tls.get();
170 if (!ms) {
171 if (!m_initialized.test_and_set()) initMessaging();
172 ms = new MsgStream(m_imsg,m_nm);
173 m_msg_tls.reset( ms );
174 }
175
176 ms->setLevel (m_lvl);
177 return *ms;
178}
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 182 of file AthMessaging.h.

183{ 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 user did not set explicit message level we have to initialize
154 // the messaging and retrieve the default via the MessageSvc.
155 if (m_lvl==MSG::NIL && !m_initialized.test_and_set()) initMessaging();
156
157 if (m_lvl <= lvl) {
158 msg() << lvl;
159 return true;
160 } else {
161 return false;
162 }
163}

◆ 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 243 of file McVtxFilter.cxx.

244{
245 // clear parent and child candidates
246 m_parentList.clear();
247 m_childList.clear();
248
250
251 DecayParser parser( m_decayPattern );
252
253 std::vector<std::vector<std::string> > parents = parser.getParents();
254 for(std::vector<std::vector<std::string> >::const_iterator itr = parents.begin();
255 itr != parents.end();
256 ++itr ) {
257 ParticleCandidateList * list = new ParticleCandidateList();
258 const std::vector<std::string>::const_iterator candEnd = itr->end();
259 for( std::vector<std::string>::const_iterator candidate = itr->begin();
260 candidate != candEnd;
261 ++candidate ) {
262 int pdgID = parser.pdgId( *candidate );
263 list->push_back( pdgID );
264 }
265 if ( ! list->empty() ) {
266 m_parentList.push_back( list );
267 } else {
268 delete list;
269 }
270 }
271 std::vector<std::vector<std::string> > children = parser.getChildren();
272 for(std::vector<std::vector<std::string> >::const_iterator itr = children.begin();
273 itr != children.end();
274 ++itr ) {
275 ParticleCandidateList * list = new ParticleCandidateList();
276 const std::vector<std::string>::const_iterator candEnd = itr->end();
277 for( std::vector<std::string>::const_iterator candidate = itr->begin();
278 candidate != candEnd;
279 ++candidate ) {
280 int pdgID = parser.pdgId( *candidate );
281 list->push_back( pdgID );
282 }
283 if ( ! list->empty() ) {
284 m_childList.push_back( list );
285 } else {
286 delete list;
287 }
288 }
289
290 return;
291}
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 228 of file McVtxFilter.cxx.

229{
230 if ( filter ) {
231 const McVtxFilter * vtxFilter =
232 dynamic_cast<const McVtxFilter*>(filter);
233
234 if ( vtxFilter ) {
235 operator=(*vtxFilter);
236 } else {
237 ATH_MSG_ERROR("Can't dynamic_cast " << typeid(filter).name() << " to a McVtxFilter");
238 }
239 } //> filter is a valid pointer
240}
#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: