CMS 3D CMS Logo

BPHPlusMinusCandidate.cc
Go to the documentation of this file.
1 /*
2  * See header file for a description of this class.
3  *
4  * \author Paolo Ronchese INFN Padova
5  *
6  */
7 
8 //-----------------------
9 // This Class' Header --
10 //-----------------------
12 
13 //-------------------------------
14 // Collaborating Class Headers --
15 //-------------------------------
23 
24 //---------------
25 // C++ Headers --
26 //---------------
27 
28 using namespace std;
29 
30 //-------------------
31 // Initializations --
32 //-------------------
33 
34 //----------------
35 // Constructors --
36 //----------------
39 
41  : BPHDecayMomentum(compList.daugMap, compList.compMap),
42  BPHDecayVertex(this, es),
43  BPHKinematicFit(this),
45  BPHRecoCandidate(es, compList) {}
46 
47 //--------------
48 // Destructor --
49 //--------------
51 
52 //--------------
53 // Operations --
54 //--------------
55 void BPHPlusMinusCandidate::add(const string& name, const reco::Candidate* daug, double mass, double sigma) {
56  add(name, daug, "cfhpmig", mass, sigma);
57  return;
58 }
59 
61  const string& name, const reco::Candidate* daug, const string& searchList, double mass, double sigma) {
62  const vector<const reco::Candidate*>& dL = daughters();
63  bool accept = false;
64  switch (dL.size()) {
65  case 0:
66  accept = true;
67  break;
68  case 1:
69  if ((daug->charge() * dL.front()->charge()) > 0) {
70  edm::LogPrint("TooManyParticles") << "BPHPlusMinusCandidate::add: "
71  << "already containing same sign particle, add rejected";
72  return;
73  }
74  accept = true;
75  break;
76  default:
77  edm::LogPrint("TooManyParticles") << "BPHPlusMinusCandidate::add: "
78  << "complete, add rejected";
79  return;
80  }
81  if (accept)
82  addK(name, daug, searchList, mass, sigma);
83  return;
84 }
85 
86 vector<BPHPlusMinusConstCandPtr> BPHPlusMinusCandidate::build(
87  const BPHRecoBuilder& builder, const string& nPos, const string& nNeg, double mass, double msig) {
88  vector<BPHPlusMinusConstCandPtr> cList;
89  class ChargeSelect : public BPHRecoSelect {
90  public:
91  ChargeSelect(int c) : charge(c) {}
92  ~ChargeSelect() override {}
93  bool accept(const reco::Candidate& cand) const override { return ((charge * cand.charge()) > 0); }
94 
95  private:
96  int charge;
97  };
98  ChargeSelect tkPos(+1);
99  ChargeSelect tkNeg(-1);
100  builder.filter(nPos, tkPos);
101  builder.filter(nNeg, tkNeg);
102  fill<BPHPlusMinusCandidate>(cList, builder, mass, msig);
103  return cList;
104 }
105 
110  fill(ptr, level);
111  return ptr;
112 }
113 
115  static const pat::CompositeCandidate compCand;
116  static const string msg = "BPHPlusMinusCandidate incomplete, no composite available";
117  if (!chkSize(msg))
118  return compCand;
120 }
121 
123  static const string msg = "BPHPlusMinusCandidate incomplete, no cowboy/sailor classification";
124  return (chkSize(msg) && phiDiff());
125 }
126 
128  static const string msg = "BPHPlusMinusCandidate incomplete, no cowboy/sailor classification";
129  return (chkSize(msg) && !phiDiff());
130 }
131 
133  const vector<const reco::Candidate*>& dL = daughters();
134  int idPos = (dL.front()->charge() > 0 ? 0 : 1);
135  return reco::deltaPhi(dL[idPos]->phi(), dL[1 - idPos]->phi()) > 0;
136 }
personalPlayback.level
level
Definition: personalPlayback.py:22
BPHRecoBuilder::filter
void filter(const std::string &name, const BPHRecoSelect &sel) const
BPHPlusMinusCandidate::~BPHPlusMinusCandidate
~BPHPlusMinusCandidate() override
Definition: BPHPlusMinusCandidate.cc:50
CompositeCandidate.h
BPHRecoSelect
Definition: BPHRecoSelect.h:35
MessageLogger.h
BPHRecoCandidate::fill
void fill(BPHRecoCandidate *ptr, int level) const override
Definition: BPHRecoCandidate.cc:61
reco::deltaPhi
constexpr double deltaPhi(double phi1, double phi2)
Definition: deltaPhi.h:26
BPHDecayMomentum::composite
virtual const pat::CompositeCandidate & composite() const
get a composite by the simple sum of simple particles
Definition: BPHDecayMomentum.cc:63
pat::CompositeCandidate
Analysis-level particle class.
Definition: CompositeCandidate.h:31
BPHDecayVertex::getEventSetup
const edm::EventSetup * getEventSetup() const
retrieve EventSetup
Definition: BPHDecayVertex.cc:152
BPHPlusMinusCandidate
Definition: BPHPlusMinusCandidate.h:32
BPHRecoSelect.h
BPHPlusMinusCandidate::composite
const pat::CompositeCandidate & composite() const override
get a composite by the simple sum of simple particles
Definition: BPHPlusMinusCandidate.cc:114
mps_check.msg
tuple msg
Definition: mps_check.py:285
accept
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
Definition: TopDQMHelpers.h:30
BPHPlusMinusVertex
Definition: BPHPlusMinusVertex.h:33
BPHPlusMinusCandidate::BPHPlusMinusCandidate
BPHPlusMinusCandidate(const edm::EventSetup *es)
Definition: BPHPlusMinusCandidate.cc:37
reco::Candidate::charge
virtual int charge() const =0
electric charge
BPHRecoBuilder
Definition: BPHRecoBuilder.h:50
BPHDecayMomentum
Definition: BPHDecayMomentum.h:35
BPHDecayVertex
Definition: BPHDecayVertex.h:43
ALCARECOTkAlJpsiMuMu_cff.charge
charge
Definition: ALCARECOTkAlJpsiMuMu_cff.py:47
BPHRecoBuilder::ComponentSet
Definition: BPHRecoBuilder.h:127
BPHMomentumSelect.h
cand
Definition: decayParser.h:34
newFWLiteAna.searchList
searchList
Definition: newFWLiteAna.py:119
edm::LogPrint
Definition: MessageLogger.h:342
BPHAddFourMomenta.h
edm::EventSetup
Definition: EventSetup.h:57
BPHPlusMinusCandidate::isSailor
bool isSailor() const
Definition: BPHPlusMinusCandidate.cc:127
BPHRecoBuilder.h
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
BPHKinematicFit::mass
virtual ParticleMass mass() const
Definition: BPHKinematicFit.cc:297
reco::Candidate
Definition: Candidate.h:27
BPHPlusMinusCandidate::phiDiff
bool phiDiff() const
Definition: BPHPlusMinusCandidate.cc:132
DDAxes::phi
BPHPlusMinusCandidate::build
static std::vector< BPHPlusMinusConstCandPtr > build(const BPHRecoBuilder &builder, const std::string &nPos, const std::string &nNeg, double mass=-1, double msig=-1)
Definition: BPHPlusMinusCandidate.cc:86
std
Definition: JetResolutionObject.h:76
BPHPlusMinusCandidate.h
BPHKinematicFit::addK
virtual void addK(const std::string &name, const reco::Candidate *daug, double mass=-1.0, double sigma=-1.0)
BPHPlusMinusCandidate::isCowboy
bool isCowboy() const
get cowboy/sailor classification
Definition: BPHPlusMinusCandidate.cc:122
EgHLTOffHistBins_cfi.mass
mass
Definition: EgHLTOffHistBins_cfi.py:34
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
BPHPlusMinusCandidate::add
void add(const std::string &name, const reco::Candidate *daug, double mass=-1.0, double sigma=-1.0) override
BPHKinematicFit
Definition: BPHKinematicFit.h:38
BPHDecayMomentum::daughters
virtual const std::vector< const reco::Candidate * > & daughters() const
Definition: BPHDecayMomentum.cc:73
BPHRecoCandidate
Definition: BPHRecoCandidate.h:46
BPHPlusMinusVertex::chkSize
static bool chkSize(const T &cont, const std::string &msg)
Definition: BPHPlusMinusVertex.h:83
BPHPlusMinusCandidate::clone
BPHRecoCandidate * clone(int level=-1) const override
Definition: BPHPlusMinusCandidate.cc:108
BPHDecayMomentum::cList
std::vector< BPHRecoConstCandPtr > cList
Definition: BPHDecayMomentum.h:143
BPHDecayMomentum::compCand
pat::CompositeCandidate compCand
Definition: BPHDecayMomentum.h:156
deltaPhi.h