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/BPHDecayToV0SameMassBuilder.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/SpecificDecay/interface/BPHDecayToChargedXXbarBuilder.h"
0019 #include "DataFormats/Candidate/interface/Candidate.h"
0020 
0021 //---------------
0022 // C++ Headers --
0023 //---------------
0024 #include <cmath>
0025 using namespace std;
0026 
0027 //-------------------
0028 // Initializations --
0029 //-------------------
0030 
0031 //----------------
0032 // Constructors --
0033 //----------------
0034 BPHDecayToV0SameMassBuilder::BPHDecayToV0SameMassBuilder(const edm::EventSetup& es,
0035                                                          const std::string& d1Name,
0036                                                          const std::string& d2Name,
0037                                                          double dMass,
0038                                                          double dSigma,
0039                                                          const BPHRecoBuilder::BPHGenericCollection* d1Collection,
0040                                                          const BPHRecoBuilder::BPHGenericCollection* d2Collection)
0041     : BPHDecayToV0Builder(es, d1Name, d2Name, d1Collection, d2Collection), pMass(dMass), pSigma(dSigma) {}
0042 
0043 BPHDecayToV0SameMassBuilder::BPHDecayToV0SameMassBuilder(const edm::EventSetup& es,
0044                                                          const std::string& d1Name,
0045                                                          const std::string& d2Name,
0046                                                          double dMass,
0047                                                          double dSigma,
0048                                                          const std::vector<reco::VertexCompositeCandidate>* v0Collection,
0049                                                          const std::string& searchList)
0050     : BPHDecayToV0Builder(es, d1Name, d2Name, v0Collection, searchList), pMass(dMass), pSigma(dSigma) {}
0051 
0052 BPHDecayToV0SameMassBuilder::BPHDecayToV0SameMassBuilder(
0053     const edm::EventSetup& es,
0054     const std::string& d1Name,
0055     const std::string& d2Name,
0056     double dMass,
0057     double dSigma,
0058     const std::vector<reco::VertexCompositePtrCandidate>* vpCollection,
0059     const std::string& searchList)
0060     : BPHDecayToV0Builder(es, d1Name, d2Name, vpCollection, searchList), pMass(dMass), pSigma(dSigma) {}
0061 
0062 //--------------
0063 // Destructor --
0064 //--------------
0065 BPHDecayToV0SameMassBuilder::~BPHDecayToV0SameMassBuilder() {}
0066 
0067 //--------------
0068 // Operations --
0069 //--------------
0070 void BPHDecayToV0SameMassBuilder::buildFromBPHGenericCollection() {
0071   BPHDecayToChargedXXbarBuilder b(*evSetup, p1Name, p2Name, pMass, pSigma, p1Collection, p2Collection);
0072 
0073   b.setPtMin(ptMin);
0074   b.setEtaMax(etaMax);
0075   b.setMassRange(getMassMin(), getMassMax());
0076   b.setProbMin(getProbMin());
0077 
0078   cList = b.build();
0079 
0080   return;
0081 }
0082 
0083 BPHPlusMinusCandidatePtr BPHDecayToV0SameMassBuilder::buildCandidate(const reco::Candidate* c1,
0084                                                                      const reco::Candidate* c2,
0085                                                                      const void* v0,
0086                                                                      v0Type type) {
0087   BPHPlusMinusCandidatePtr cand = BPHPlusMinusCandidateWrap::create(evSetup);
0088   if (c1->charge() > 0) {
0089     cand->add(p1Name, c1, pMass, pSigma);
0090     cand->add(p2Name, c2, pMass, pSigma);
0091   } else {
0092     cand->add(p1Name, c2, pMass, pSigma);
0093     cand->add(p2Name, c1, pMass, pSigma);
0094   }
0095   return cand;
0096 }