test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
BPHMassFitSelect.h
Go to the documentation of this file.
1 #ifndef HeavyFlavorAnalysis_SpecificDecay_BPHMassFitSelect_h
2 #define HeavyFlavorAnalysis_SpecificDecay_BPHMassFitSelect_h
3 
12 //----------------------
13 // Base Class Headers --
14 //----------------------
17 
18 //------------------------------------
19 // Collaborating Class Declarations --
20 //------------------------------------
24 
25 //---------------
26 // C++ Headers --
27 //---------------
28 #include <string>
29 
30 // ---------------------
31 // -- Class Interface --
32 // ---------------------
33 
34 class BPHMassFitSelect: public BPHFitSelect, public BPHMassCuts {
35 
36  public:
37 
40  BPHMassFitSelect( double minMass, double maxMass ):
41  BPHMassCuts( minMass, maxMass ) { setFitConstraint(); }
42 
43  BPHMassFitSelect( const std::string& name, double mass, double sigma,
44  double minMass, double maxMass ):
45  BPHMassCuts( minMass, maxMass ) { setFitConstraint( name, mass, sigma ); }
46 
48  double minMass, double maxMass ):
49  BPHMassCuts( minMass, maxMass ) { setFitConstraint( name, mass ); }
50 
52  double minMass, double maxMass ):
53  BPHMassCuts( minMass, maxMass ) { setFitConstraint( name, c ); }
54 
56  double minMass, double maxMass ):
57  BPHMassCuts( minMass, maxMass ) { setFitConstraint( name, c ); }
58 
61  virtual ~BPHMassFitSelect() {
62  }
63 
66  virtual bool accept( const BPHKinematicFit& cand ) const {
68  switch ( type ) {
69  default:
70  case none: break;
71  case mcss: cand.kinematicTree( cName, cMass, cSigma ); break;
72  case mcst: cand.kinematicTree( cName, cMass ) ; break;
73  case kf: cand.kinematicTree( cName, kc ); break;
74  case mtkf: cand.kinematicTree( cName, mtkc ); break;
75  }
76  double mass = cand.p4().mass();
77  return ( ( mass > mMin ) && ( mass < mMax ) );
78  }
79 
82  type = none;
83  cName = "" ;
84  cMass = -1.0;
85  cSigma = -1.0;
86  kc = 0 ;
87  mtkc = 0 ;
88  }
89  void setFitConstraint( const std::string& name, double mass ) {
90  type = mcst;
91  cName = name ;
92  cMass = mass ;
93  cSigma = -1.0 ;
94  kc = 0 ;
95  mtkc = 0 ;
96  }
97  void setFitConstraint( const std::string& name, double mass, double sigma ) {
98  type = mcss;
99  cName = name ;
100  cMass = mass ;
101  cSigma = sigma;
102  kc = 0 ;
103  mtkc = 0 ;
104  }
106  type = kf;
107  cName = name ;
108  cMass = -1.0 ;
109  cSigma = -1.0 ;
110  kc = c ;
111  mtkc = 0 ;
112  }
115  type = mtkf;
116  cName = name ;
117  cMass = -1.0 ;
118  cSigma = -1.0 ;
119  kc = 0 ;
120  mtkc = c ;
121  }
122 
124  const std::string& getConstrainedName() const { return cName; }
125  double getMass () const { return cMass; }
126  double getSigma() const { return cSigma; }
127  KinematicConstraint* getKC () const { return kc; }
129 
130  private:
131 
132  // private copy and assigment constructors
135 
136  enum fit_type { none, mcss, mcst, kf, mtkf };
137 
140  double cMass;
141  double cSigma;
144 
145 };
146 
147 
148 #endif
149 
type
Definition: HCALResponse.h:21
virtual const math::XYZTLorentzVector & p4() const
compute total momentum after the fit
virtual ~BPHMassFitSelect()
void setFitConstraint(const std::string &name, double mass, double sigma)
void setFitConstraint()
set fit constraint
double getMass() const
BPHMassFitSelect & operator=(const BPHMassFitSelect &x)
BPHMassFitSelect(const std::string &name, double mass, double sigma, double minMass, double maxMass)
void setFitConstraint(const std::string &name, double mass)
const std::string & getConstrainedName() const
get fit constraint
double mMax
Definition: BPHMassCuts.h:64
virtual const RefCountedKinematicTree & kinematicTree() const
perform the kinematic fit and get the result
BPHMassFitSelect(double minMass, double maxMass)
double getSigma() const
void setFitConstraint(const std::string &name, KinematicConstraint *c)
MultiTrackKinematicConstraint * getMultiTrackKC() const
void setFitConstraint(const std::string &name, MultiTrackKinematicConstraint *c)
KinematicConstraint * getKC() const
BPHMassFitSelect(const std::string &name, MultiTrackKinematicConstraint *c, double minMass, double maxMass)
double mMin
Definition: BPHMassCuts.h:63
KinematicConstraint * kc
MultiTrackKinematicConstraint * mtkc
BPHMassFitSelect(const std::string &name, KinematicConstraint *c, double minMass, double maxMass)
virtual bool accept(const BPHKinematicFit &cand) const
select particle
BPHMassFitSelect(const std::string &name, double mass, double minMass, double maxMass)