CMS 3D CMS Logo

BPHPlusMinusVertex.h
Go to the documentation of this file.
1 #ifndef HeavyFlavorAnalysis_RecoDecay_BPHPlusMinusVertex_h
2 #define HeavyFlavorAnalysis_RecoDecay_BPHPlusMinusVertex_h
3 
13 //----------------------
14 // Base Class Headers --
15 //----------------------
17 
18 //------------------------------------
19 // Collaborating Class Declarations --
20 //------------------------------------
24 
25 //---------------
26 // C++ Headers --
27 //---------------
28 #include <iostream>
29 
30 // ---------------------
31 // -- Class Interface --
32 // ---------------------
33 
34 class BPHPlusMinusVertex: public virtual BPHDecayVertex {
35 
36  public:
37 
44  virtual ~BPHPlusMinusVertex();
45 
48  virtual const ClosestApproachInRPhi& cAppInRPhi() const;
50 
51  protected:
52 
54 
55  // utility functions to check/enforce the number of decay particles
56  // at 2
57  template<class T> static
58  bool chkName( const T& cont,
59  const std::string& name,
60  const std::string& msg );
61  template<class T> static
62  bool chkSize( const T& cont,
63  const std::string& msg );
64  bool chkSize( const std::string& msg ) const;
65 
66  // utility function used to cash reconstruction results
67  virtual void setNotUpdated() const;
68 
69  private:
70 
71  // reconstruction results cache
72  mutable bool oldA;
74 
75  // compute closest approach distance and cache it
76  virtual void computeApp() const;
77 
78 };
79 
80 
81 template<class T>
82 bool BPHPlusMinusVertex::chkName( const T& cont,
83  const std::string& name,
84  const std::string& msg ) {
85  if ( cont.find( name ) != cont.end() ) return true;
86  edm::LogPrint( "ParticleNotFound" ) << msg << ", " << name << " not found";
87  return false;
88 }
89 
90 
91 template<class T>
92 bool BPHPlusMinusVertex::chkSize( const T& cont,
93  const std::string& msg ) {
94  int n = cont.size();
95  if ( n == 2 ) return true;
96  edm::LogPrint( "WrongDataSize" ) << msg << ", size = " << n;
97  return false;
98 }
99 
100 
101 #endif
102 
static bool chkSize(const T &cont, const std::string &msg)
virtual const ClosestApproachInRPhi & cAppInRPhi() const
compute distance of closest approach
virtual void setNotUpdated() const
BPHPlusMinusVertex(const edm::EventSetup *es)
virtual void computeApp() const
static bool chkName(const T &cont, const std::string &name, const std::string &msg)
ClosestApproachInRPhi * inRPhi
long double T