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/BPHDecayToResResBuilder.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 BPHDecayToResResBuilder::BPHDecayToResResBuilder(const edm::EventSetup& es,
0033                                                  const std::string& res1Name,
0034                                                  double res1Mass,
0035                                                  double res1Width,
0036                                                  const std::vector<BPHPlusMinusConstCandPtr>& res1Collection,
0037                                                  const std::string& res2Name,
0038                                                  const std::vector<BPHPlusMinusConstCandPtr>& res2Collection)
0039     : BPHDecayConstrainedBuilder(es, res1Name, res1Mass, res1Width, res1Collection),
0040       sName(res2Name),
0041       sCollection(&res2Collection),
0042       res2Sel(new BPHMassSelect(-2.0e+06, -1.0e+06)) {}
0043 
0044 //--------------
0045 // Destructor --
0046 //--------------
0047 BPHDecayToResResBuilder::~BPHDecayToResResBuilder() { delete res2Sel; }
0048 
0049 //--------------
0050 // Operations --
0051 //--------------
0052 vector<BPHRecoConstCandPtr> BPHDecayToResResBuilder::build() {
0053   if (updated)
0054     return recList;
0055 
0056   recList.clear();
0057 
0058   BPHRecoBuilder brb(*evSetup);
0059   brb.setMinPDiffererence(minPDiff);
0060   brb.add(rName, *rCollection);
0061   brb.add(sName, *sCollection);
0062   brb.filter(rName, *resoSel);
0063   brb.filter(sName, *res2Sel);
0064 
0065   if (massSel->getMassMax() >= 0.0)
0066     brb.filter(*massSel);
0067   if (chi2Sel->getProbMin() >= 0.0)
0068     brb.filter(*chi2Sel);
0069   if (mFitSel->getMassMax() >= 0.0)
0070     brb.filter(*mFitSel);
0071 
0072   recList = BPHRecoCandidate::build(brb);
0073   updated = true;
0074   return recList;
0075 }
0076 
0077 /// set cuts
0078 void BPHDecayToResResBuilder::setRes2MassMin(double m) {
0079   updated = false;
0080   res2Sel->setMassMin(m);
0081   return;
0082 }
0083 
0084 void BPHDecayToResResBuilder::setRes2MassMax(double m) {
0085   updated = false;
0086   res2Sel->setMassMax(m);
0087   return;
0088 }
0089 
0090 void BPHDecayToResResBuilder::setRes2MassRange(double mMin, double mMax) {
0091   updated = false;
0092   res2Sel->setMassMin(mMin);
0093   res2Sel->setMassMax(mMax);
0094   return;
0095 }