Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:15:33

0001 #ifndef HeavyFlavorAnalysis_RecoDecay_BPHPlusMinusCandidate_h
0002 #define HeavyFlavorAnalysis_RecoDecay_BPHPlusMinusCandidate_h
0003 /** \class BPHPlusMinusCandidate
0004  *
0005  *  Description: 
0006  *     class for reconstructed decay candidates to opposite charge
0007  *     particle pairs
0008  *
0009  *  \author Paolo Ronchese INFN Padova
0010  *
0011  */
0012 
0013 //----------------------
0014 // Base Class Headers --
0015 //----------------------
0016 #include "HeavyFlavorAnalysis/RecoDecay/interface/BPHPlusMinusCandidatePtr.h"
0017 #include "HeavyFlavorAnalysis/RecoDecay/interface/BPHRecoCandidate.h"
0018 #include "HeavyFlavorAnalysis/RecoDecay/interface/BPHPlusMinusVertex.h"
0019 
0020 //------------------------------------
0021 // Collaborating Class Declarations --
0022 //------------------------------------
0023 class BPHEventSetupWrapper;
0024 
0025 //---------------
0026 // C++ Headers --
0027 //---------------
0028 #include <string>
0029 
0030 //              ---------------------
0031 //              -- Class Interface --
0032 //              ---------------------
0033 
0034 class BPHPlusMinusCandidate : public BPHRecoCandidate, public virtual BPHPlusMinusVertex {
0035   friend class BPHRecoCandidate;
0036 
0037 public:
0038   typedef BPHPlusMinusCandidatePtr pointer;
0039   typedef BPHPlusMinusConstCandPtr const_pointer;
0040 
0041   /** Constructor
0042    */
0043   BPHPlusMinusCandidate(const BPHEventSetupWrapper* es);
0044 
0045   // deleted copy constructor and assignment operator
0046   BPHPlusMinusCandidate(const BPHPlusMinusCandidate& x) = delete;
0047   BPHPlusMinusCandidate& operator=(const BPHPlusMinusCandidate& x) = delete;
0048 
0049   /** Destructor
0050    */
0051   ~BPHPlusMinusCandidate() override = default;
0052 
0053   /** Operations
0054    */
0055   /// add a simple particle giving it a name
0056   /// particles are cloned, eventually specifying a different mass
0057   /// particles can be added only up to two particles with opposite charge
0058   void add(const std::string& name, const reco::Candidate* daug, double mass = -1.0, double sigma = -1.0) override;
0059   void add(const std::string& name,
0060            const reco::Candidate* daug,
0061            const std::string& searchList,
0062            double mass = -1.0,
0063            double sigma = -1.0) override;
0064 
0065   /// look for candidates starting from particle collections as
0066   /// specified in the BPHRecoBuilder, with given names for
0067   /// positive and negative particle
0068   /// charge selection is applied inside
0069   struct BuilderParameters {
0070     const std::string* posName;
0071     const std::string* negName;
0072     double constrMass;
0073     double constrSigma;
0074   };
0075   static std::vector<BPHPlusMinusConstCandPtr> build(const BPHRecoBuilder& builder, const BuilderParameters& par) {
0076     return build(builder, *par.posName, *par.negName, par.constrMass, par.constrSigma);
0077   }
0078   static std::vector<BPHPlusMinusConstCandPtr> build(const BPHRecoBuilder& builder,
0079                                                      const std::string& nPos,
0080                                                      const std::string& nNeg,
0081                                                      double mass = -1,
0082                                                      double msig = -1);
0083 
0084   /// clone object, cloning daughters as well up to required depth
0085   /// level = -1 to clone all levels
0086   BPHRecoCandidate* clone(int level = -1) const override;
0087 
0088   /// get a composite by the simple sum of simple particles
0089   const pat::CompositeCandidate& composite() const override;
0090 
0091   /// get cowboy/sailor classification
0092   bool isCowboy() const;
0093   bool isSailor() const;
0094 
0095 protected:
0096   // utility function used to cash reconstruction results
0097   void setNotUpdated() const override {
0098     BPHKinematicFit::setNotUpdated();
0099     BPHPlusMinusVertex::setNotUpdated();
0100   }
0101 
0102 private:
0103   // constructor
0104   BPHPlusMinusCandidate(const BPHEventSetupWrapper* es, const BPHRecoBuilder::ComponentSet& compList);
0105 
0106   // return true or false for positive or negative phi_pos-phi_neg difference
0107   bool phiDiff() const;
0108 };
0109 
0110 #endif