CMS 3D CMS Logo

BPHDecayToV0DiffMassBuilder.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 //-------------------------------
20 
21 //---------------
22 // C++ Headers --
23 //---------------
24 #include <cmath>
25 using namespace std;
26 
27 //-------------------
28 // Initializations --
29 //-------------------
30 
31 //----------------
32 // Constructors --
33 //----------------
35  const std::string& d1Name,
36  double d1Mass,
37  double d1Sigma,
38  const std::string& d2Name,
39  double d2Mass,
40  double d2Sigma,
41  const BPHRecoBuilder::BPHGenericCollection* posCollection,
42  const BPHRecoBuilder::BPHGenericCollection* negCollection,
43  double expectedMass)
44  : BPHDecayToV0Builder(es, d1Name, d2Name, posCollection, negCollection),
45  p1Mass(d1Mass),
46  p2Mass(d2Mass),
47  p1Sigma(d1Sigma),
48  p2Sigma(d2Sigma),
49  expMass(expectedMass) {}
50 
52  const std::string& d1Name,
53  double d1Mass,
54  double d1Sigma,
55  const std::string& d2Name,
56  double d2Mass,
57  double d2Sigma,
58  const std::vector<reco::VertexCompositeCandidate>* v0Collection,
59  double expectedMass,
60  const std::string& searchList)
61  : BPHDecayToV0Builder(es, d1Name, d2Name, v0Collection, searchList),
62  p1Mass(d1Mass),
63  p2Mass(d2Mass),
64  p1Sigma(d1Sigma),
65  p2Sigma(d2Sigma),
66  expMass(expectedMass) {}
67 
69  const edm::EventSetup& es,
70  const std::string& d1Name,
71  double d1Mass,
72  double d1Sigma,
73  const std::string& d2Name,
74  double d2Mass,
75  double d2Sigma,
76  const std::vector<reco::VertexCompositePtrCandidate>* vpCollection,
77  double expectedMass,
78  const std::string& searchList)
79  : BPHDecayToV0Builder(es, d1Name, d2Name, vpCollection, searchList),
80  p1Mass(d1Mass),
81  p2Mass(d2Mass),
82  p1Sigma(d1Sigma),
83  p2Sigma(d2Sigma),
84  expMass(expectedMass) {}
85 
86 //--------------
87 // Destructor --
88 //--------------
90 
91 //--------------
92 // Operations --
93 //--------------
97 
98  b.setTrk1PtMin(ptMin);
99  b.setTrk2PtMin(ptMin);
100  b.setTrk1EtaMax(etaMax);
101  b.setTrk2EtaMax(etaMax);
102  b.setMassRange(getMassMin(), getMassMax());
103  b.setProbMin(getProbMin());
104 
105  cList = b.build();
106 
107  return;
108 }
109 
111  const reco::Candidate* c2,
112  const void* v0,
113  v0Type type) {
116  BPHPlusMinusCandidate* cptrX = candX.get();
117  BPHPlusMinusCandidate* cptrY = candY.get();
118  cptrX->add(p1Name, c1, sList, p1Mass, p1Sigma);
119  cptrX->add(p2Name, c2, sList, p2Mass, p2Sigma);
120  cptrY->add(p1Name, c2, sList, p1Mass, p1Sigma);
121  cptrY->add(p2Name, c1, sList, p2Mass, p2Sigma);
122  double mv0 = 0.0;
123  switch (type) {
125  mv0 = static_cast<const reco::VertexCompositeCandidate*>(v0)->mass();
126  break;
128  mv0 = static_cast<const reco::VertexCompositePtrCandidate*>(v0)->mass();
129  break;
130  default:
131  mv0 = expMass;
132  break;
133  }
134  double m1 = 0.0;
135  double m2 = 0.0;
136  if (p1Mass > p2Mass) {
137  m1 = c1->mass();
138  m2 = c2->mass();
139  } else {
140  m1 = c2->mass();
141  m2 = c1->mass();
142  }
143  // check daughter masses in V0 CompositeCandidate
144  double mcut = (p1Mass + p2Mass) / 2;
145  if ((m1 > mcut) && (m2 < mcut))
146  return candX;
147  if ((m1 < mcut) && (m2 > mcut))
148  return candY;
149  // choose combination having the best invariant mass
150  return (fabs(mv0 - cptrX->mass()) < fabs(mv0 - cptrY->mass()) ? candX : candY);
151 }
BPHDecayToV0Builder::VertexCompositePtrCandidate
Definition: BPHDecayToV0Builder.h:43
BPHDecayToV0DiffMassBuilder::BPHDecayToV0DiffMassBuilder
BPHDecayToV0DiffMassBuilder(const edm::EventSetup &es, const std::string &d1Name, double d1Mass, double d1Sigma, const std::string &d2Name, double d2Mass, double d2Sigma, const BPHRecoBuilder::BPHGenericCollection *posCollection, const BPHRecoBuilder::BPHGenericCollection *negCollection, double expectedMass)
Definition: BPHDecayToV0DiffMassBuilder.cc:34
V0Monitor_cff.v0
v0
Definition: V0Monitor_cff.py:7
BPHDecayToV0Builder::VertexCompositeCandidate
Definition: BPHDecayToV0Builder.h:43
BPHDecayToV0Builder::p2Name
std::string p2Name
Definition: BPHDecayToV0Builder.h:92
BPHDecayGenericBuilder::getMassMax
double getMassMax() const
Definition: BPHDecayGenericBuilder.h:63
reco::Candidate::mass
virtual double mass() const =0
mass
BPHDecayToV0Builder::v0Type
v0Type
Definition: BPHDecayToV0Builder.h:43
BPHPlusMinusCandidatePtr
BPHGenericPtr< BPHPlusMinusCandidate >::type BPHPlusMinusCandidatePtr
Definition: BPHPlusMinusCandidatePtr.h:7
BPHDecayToV0DiffMassBuilder::~BPHDecayToV0DiffMassBuilder
~BPHDecayToV0DiffMassBuilder() override
Definition: BPHDecayToV0DiffMassBuilder.cc:89
BPHDecayToV0DiffMassBuilder.h
BPHPlusMinusCandidate
Definition: BPHPlusMinusCandidate.h:32
BPHDecayToV0Builder
Definition: BPHDecayToV0Builder.h:41
BPHDecayToTkpTknSymChargeBuilder.h
BPHDecayToV0Builder::p1Name
std::string p1Name
Definition: BPHDecayToV0Builder.h:91
BPHDecayToV0Builder::ptMin
double ptMin
Definition: BPHDecayToV0Builder.h:100
b
double b
Definition: hdecay.h:118
BPHDecayToV0Builder::sList
std::string sList
Definition: BPHDecayToV0Builder.h:98
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
BPHDecayGenericBuilder::getProbMin
double getProbMin() const
Definition: BPHDecayGenericBuilder.h:64
BPHDecayToV0DiffMassBuilder::expMass
double expMass
Definition: BPHDecayToV0DiffMassBuilder.h:87
BPHDecayToV0DiffMassBuilder::p2Sigma
double p2Sigma
Definition: BPHDecayToV0DiffMassBuilder.h:86
BPHDecayToV0DiffMassBuilder::buildCandidate
BPHPlusMinusCandidatePtr buildCandidate(const reco::Candidate *c1, const reco::Candidate *c2, const void *v0, v0Type type) override
Definition: BPHDecayToV0DiffMassBuilder.cc:110
BPHDecayGenericBuilder::evSetup
const edm::EventSetup * evSetup
Definition: BPHDecayGenericBuilder.h:73
BPHDecayToV0Builder::p1Collection
const BPHRecoBuilder::BPHGenericCollection * p1Collection
Definition: BPHDecayToV0Builder.h:94
BPHDecayToV0DiffMassBuilder::p2Mass
double p2Mass
Definition: BPHDecayToV0DiffMassBuilder.h:84
type
type
Definition: SiPixelVCal_PayloadInspector.cc:37
alignmentValidation.c1
c1
do drawing
Definition: alignmentValidation.py:1025
newFWLiteAna.searchList
searchList
Definition: newFWLiteAna.py:119
BPHDecayToV0Builder::p2Collection
const BPHRecoBuilder::BPHGenericCollection * p2Collection
Definition: BPHDecayToV0Builder.h:95
BPHDecayToV0Builder::etaMax
double etaMax
Definition: BPHDecayToV0Builder.h:101
edm::EventSetup
Definition: EventSetup.h:58
BPHRecoBuilder.h
BPHKinematicFit::mass
virtual ParticleMass mass() const
Definition: BPHKinematicFit.cc:297
reco::Candidate
Definition: Candidate.h:27
BPHRecoBuilder::BPHGenericCollection
Definition: BPHRecoBuilder.h:70
std
Definition: JetResolutionObject.h:76
BPHPlusMinusCandidate.h
BPHDecayToV0DiffMassBuilder::p1Mass
double p1Mass
Definition: BPHDecayToV0DiffMassBuilder.h:83
BPHDecayToV0Builder::cList
std::vector< BPHPlusMinusConstCandPtr > cList
Definition: BPHDecayToV0Builder.h:89
BPHDecayToV0DiffMassBuilder::p1Sigma
double p1Sigma
Definition: BPHDecayToV0DiffMassBuilder.h:85
BPHPlusMinusCandidate::add
void add(const std::string &name, const reco::Candidate *daug, double mass=-1.0, double sigma=-1.0) override
Candidate.h
BPHDecayToV0DiffMassBuilder::buildFromBPHGenericCollection
void buildFromBPHGenericCollection() override
build candidates and link to V0
Definition: BPHDecayToV0DiffMassBuilder.cc:94
BPHGenericPtr::create
static type create(Args &&... args)
Definition: BPHGenericPtr.h:10
BPHDecayToTkpTknSymChargeBuilder
Definition: BPHDecayToTkpTknSymChargeBuilder.h:43
BPHDecayGenericBuilder::getMassMin
double getMassMin() const
get current cuts
Definition: BPHDecayGenericBuilder.h:62