Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:49:24

0001 /*
0002  *  See header file for a description of this class.
0003  *
0004  *  \author Paolo Ronchese INFN Padova
0005  *
0006  */
0007 
0008 //-----------------------
0009 // This Class' Header --
0010 //-----------------------
0011 #include "HeavyFlavorAnalysis/SpecificDecay/interface/BPHDecayConstrainedBuilder.h"
0012 
0013 //-------------------------------
0014 // Collaborating Class Headers --
0015 //-------------------------------
0016 #include "HeavyFlavorAnalysis/RecoDecay/interface/BPHRecoBuilder.h"
0017 #include "HeavyFlavorAnalysis/RecoDecay/interface/BPHPlusMinusCandidate.h"
0018 #include "HeavyFlavorAnalysis/RecoDecay/interface/BPHRecoCandidate.h"
0019 
0020 //---------------
0021 // C++ Headers --
0022 //---------------
0023 using namespace std;
0024 
0025 //-------------------
0026 // Initializations --
0027 //-------------------
0028 
0029 //----------------
0030 // Constructors --
0031 //----------------
0032 BPHDecayConstrainedBuilder::BPHDecayConstrainedBuilder(const edm::EventSetup& es,
0033                                                        const std::string& resName,
0034                                                        double resMass,
0035                                                        double resWidth,
0036                                                        const std::vector<BPHPlusMinusConstCandPtr>& resCollection)
0037     : BPHDecayGenericBuilder(es, new BPHMassFitSelect(resName, resMass, resWidth, -2.0e+06, -1.0e+06)),
0038       rName(resName),
0039       rMass(resMass),
0040       rWidth(resWidth),
0041       rCollection(&resCollection),
0042       resoSel(new BPHMassSelect(-2.0e+06, -1.0e+06)),
0043       massConstr(true) {}
0044 
0045 //--------------
0046 // Destructor --
0047 //--------------
0048 BPHDecayConstrainedBuilder::~BPHDecayConstrainedBuilder() { delete resoSel; }
0049 
0050 //--------------
0051 // Operations --
0052 //--------------
0053 /// set cuts
0054 void BPHDecayConstrainedBuilder::setResMassMin(double m) {
0055   updated = false;
0056   resoSel->setMassMin(m);
0057   return;
0058 }
0059 
0060 void BPHDecayConstrainedBuilder::setResMassMax(double m) {
0061   updated = false;
0062   resoSel->setMassMax(m);
0063   return;
0064 }
0065 
0066 void BPHDecayConstrainedBuilder::setResMassRange(double mMin, double mMax) {
0067   updated = false;
0068   resoSel->setMassMin(mMin);
0069   resoSel->setMassMax(mMax);
0070   return;
0071 }
0072 
0073 void BPHDecayConstrainedBuilder::setConstr(bool flag) {
0074   updated = false;
0075   if (flag == massConstr)
0076     return;
0077   double mMin = mFitSel->getMassMin();
0078   double mMax = mFitSel->getMassMax();
0079   delete mFitSel;
0080   massConstr = flag;
0081   if (massConstr)
0082     mFitSel = new BPHMassFitSelect(rName, rMass, rWidth, mMin, mMax);
0083   else
0084     mFitSel = new BPHMassFitSelect(mMin, mMax);
0085   return;
0086 }