ATLAS Offline Software
McVtxFilter.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 // McVtxFilter.h
7 // Header file for class McVtxFilter
8 // Author: S.Binet<binet@cern.ch>
10 #ifndef MCPARTICLEUTILS_MCVTXFILTER_H
11 #define MCPARTICLEUTILS_MCVTXFILTER_H
12 
22 // STL includes
23 #include <sstream>
24 #include <ostream>
25 
26 // Framework includes
29 
30 // HepMC includes
31 #include "AtlasHepMC/GenEvent.h"
32 #include "AtlasHepMC/GenParticle.h"
33 #include "AtlasHepMC/GenVertex.h"
34 
35 // AnalysisUtils includes
38 
39 // McParticleUtils includes
41 
42 // Forward declaration
43 
44 class McVtxFilter : virtual public IFilterCuts, public AthMessaging
45 {
46 
48  // Public methods:
50  public:
51 
54  McVtxFilter();
55 
58  McVtxFilter( const McVtxFilter& rhs );
59 
62  McVtxFilter( const std::string& decayPattern,
63  const bool matchSign = false,
64  const bool matchBranches = false );
65 
68  McVtxFilter( const bool matchSign, const bool matchBranches );
69 
72  virtual ~McVtxFilter();
73 
76  McVtxFilter &operator=(const McVtxFilter &rhs);
77 
79  // Const methods:
81 
88  virtual bool isAccepted( HepMC::ConstGenVertexPtr vtx ) const;
89 
92  void dump( std::ostream& out = std::cout ) const;
93 
98  bool isFullVtx() const;
99 
102  bool matchSign() const;
103 
108  bool matchBranches() const;
109 
112  const std::string& decayPattern() const;
113 
117 
121 
123  // Non-const methods:
125 
128  virtual void setFilter( const IFilterCuts * filter );
129 
132  void setMatchSign( const bool matchSign );
133 
136  void setMatchBranches( const bool matchVtxBranches );
137 
142  void setDecayPattern( const std::string& decayPattern );
143 
145  // Protected methods:
147  protected:
148 
152 
155  bool checkChildBranch ( HepMC::ConstGenVertexPtr vtx ) const;
156 
160 
162  // Protected data:
164  protected:
165 
168 
175 
178  std::string m_decayPattern;
179 
183 
187 
188 };
189 
192 MsgStream& operator<<( MsgStream & msg, const McVtxFilter &obj );
193 std::ostream& operator<<( std::ostream& out, const McVtxFilter &obj );
194 
196 // Inline methods:
198 
200 
202 // Const methods:
204 
205 inline bool McVtxFilter::isFullVtx() const
206 {
207  if ( m_parentList.empty() || m_childList.empty() ) {
208  return false;
209  } else {
210  return true;
211  }
212 }
213 
214 inline bool McVtxFilter::matchSign() const
215 {
216  return m_matchSign;
217 }
218 
219 inline bool McVtxFilter::matchBranches() const
220 {
221  return m_matchBranches;
222 }
223 
224 inline const std::string& McVtxFilter::decayPattern() const
225 {
226  return m_decayPattern;
227 }
228 
229 inline
231 {
232  return m_parentList;
233 }
234 
235 inline
237 {
238  return m_childList;
239 }
240 
242 // Non-const methods:
244 
245 inline void McVtxFilter::setMatchSign( const bool matchSign )
246 {
248 }
249 
250 inline void McVtxFilter::setMatchBranches( const bool matchBranches )
251 {
253 }
254 
255 #endif //> MCPARTICLEUTILS_MCVTXFILTER_H
McVtxFilter::dump
void dump(std::ostream &out=std::cout) const
Dump to std::ostream (default = std::cout) the decay pattern the filter one is looking for.
Definition: McVtxFilter.cxx:201
McVtxFilter::m_matchBranches
bool m_matchBranches
Tell if one wants a strict vertex branches matching.
Definition: McVtxFilter.h:174
McVtxFilter::m_parentList
DataVector< const ParticleCandidateList > m_parentList
The list of the matching particles Ids : each item in DataVector stands for an entering branch to the...
Definition: McVtxFilter.h:182
GenEvent.h
GenVertex.h
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
McVtxFilter::setMatchSign
void setMatchSign(const bool matchSign)
Set if one wants to discriminate the sign of the particles.
Definition: McVtxFilter.h:245
DecayParser.h
McVtxFilter::checkParentBranch
bool checkParentBranch(HepMC::ConstGenVertexPtr vtx) const
Check if the parent branch fulfills the requirements.
Definition: McVtxFilter.cxx:302
McVtxFilter::setFilter
virtual void setFilter(const IFilterCuts *filter)
Set filter cut options.
Definition: McVtxFilter.cxx:232
McVtxFilter::McVtxFilter
McVtxFilter()
Default constructor:
Definition: McVtxFilter.cxx:32
GenParticle.h
McVtxFilter::checkTwoBodyDecay
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 ...
Definition: McVtxFilter.cxx:414
covarianceTool.filter
filter
Definition: covarianceTool.py:514
McVtxFilter
McVtxFilter allows to select HepMC::GenParticle based on the decay pattern.
Definition: McVtxFilter.h:45
McVtxFilter::childList
const DataVector< const ParticleCandidateList > & childList() const
return the list of particle candidates for the output particles (child)
Definition: McVtxFilter.h:236
McVtxFilter::isAccepted
virtual bool isAccepted(HepMC::ConstGenVertexPtr vtx) const
Main filter method.
Definition: McVtxFilter.cxx:128
McVtxFilter::decayPattern
const std::string & decayPattern() const
return the decay pattern used by this filter
Definition: McVtxFilter.h:224
McVtxFilter::m_decayPattern
std::string m_decayPattern
The decay pattern one looks for.
Definition: McVtxFilter.h:178
McVtxFilter::isFullVtx
bool isFullVtx() const
returns true if the vertex filter requires a parent AND a child list ie: returns false if the filter ...
Definition: McVtxFilter.h:205
McVtxFilter::setDecayPattern
void setDecayPattern(const std::string &decayPattern)
Set the decay pattern to look for : it correctly setups the parent and children according to the LaTe...
Definition: McVtxFilter.cxx:247
AthMessaging
Class to provide easy MsgStream access and capabilities.
Definition: AthMessaging.h:55
DataVector< const ParticleCandidateList >
McVtxFilter::checkChildBranch
bool checkChildBranch(HepMC::ConstGenVertexPtr vtx) const
Check if the child branch fulfills the requirements.
Definition: McVtxFilter.cxx:369
IFilterCuts.h
McVtxFilter::setMatchBranches
void setMatchBranches(const bool matchVtxBranches)
Set if one wants to strictly match the number of output particles.
Definition: McVtxFilter.h:250
McVtxFilter::matchBranches
bool matchBranches() const
return true if the filter strictly matchs the number of output particles eg: a vertex t->Wbgg won't b...
Definition: McVtxFilter.h:219
McVtxFilter::~McVtxFilter
virtual ~McVtxFilter()
Destructor:
Definition: McVtxFilter.h:199
DataVector.h
An STL vector of pointers that by default owns its pointed-to elements.
AthMessaging.h
IFilterCuts
IFilterCuts is a class which is used internally by the filters to copy their cut properties one to ...
Definition: IFilterCuts.h:21
ParticleCandidateList.h
McVtxFilter::parentList
const DataVector< const ParticleCandidateList > & parentList() const
return the list of particle candidates for the input particles (parent)
Definition: McVtxFilter.h:230
HepMC::ConstGenVertexPtr
const HepMC::GenVertex * ConstGenVertexPtr
Definition: GenVertex.h:60
operator<<
MsgStream & operator<<(MsgStream &msg, const McVtxFilter &obj)
I/O operators.
Definition: McVtxFilter.cxx:485
McVtxFilter::m_matchSign
bool m_matchSign
Discrimination between particles and conjugates.
Definition: McVtxFilter.h:167
python.PyAthena.obj
obj
Definition: PyAthena.py:135
McVtxFilter::m_childList
DataVector< const ParticleCandidateList > m_childList
The list of the matching particles Ids : each item in DataVector stands for an out-going branch to th...
Definition: McVtxFilter.h:186
McVtxFilter::operator=
McVtxFilter & operator=(const McVtxFilter &rhs)
Assignment operator:
Definition: McVtxFilter.cxx:95
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7
McVtxFilter::matchSign
bool matchSign() const
return true if the filter discriminates the sign of the particles
Definition: McVtxFilter.h:214
DataVector::empty
bool empty() const noexcept
Returns true if the collection is empty.