CMS 3D CMS Logo

BPHBdToKxMuMuBuilder.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 using namespace std;
28 
29 //-------------------
30 // Initializations --
31 //-------------------
32 
33 //----------------
34 // Constructors --
35 //----------------
37  const std::vector<BPHPlusMinusConstCandPtr>& oniaCollection,
38  const std::vector<BPHPlusMinusConstCandPtr>& kx0Collection)
39  : oniaName("Onia"), kx0Name("Kx0"), evSetup(&es), jCollection(&oniaCollection), kCollection(&kx0Collection) {
40  oniaSel = new BPHMassSelect(1.00, 12.00);
41  mkx0Sel = new BPHMassSelect(0.80, 1.00);
42  massSel = new BPHMassSelect(3.50, 8.00);
43  chi2Sel = new BPHChi2Select(0.02);
44  mFitSel = new BPHMassFitSelect(4.00, 7.00);
45  massConstr = true;
46  minPDiff = 1.0e-4;
47  updated = false;
48 }
49 
50 //--------------
51 // Destructor --
52 //--------------
54  delete oniaSel;
55  delete mkx0Sel;
56  delete massSel;
57  delete chi2Sel;
58  delete mFitSel;
59 }
60 
61 //--------------
62 // Operations --
63 //--------------
64 vector<BPHRecoConstCandPtr> BPHBdToKxMuMuBuilder::build() {
65  if (updated)
66  return bdList;
67 
68  bdList.clear();
69 
70  BPHRecoBuilder bBd(*evSetup);
72  bBd.add(oniaName, *jCollection);
73  bBd.add(kx0Name, *kCollection);
74  bBd.filter(oniaName, *oniaSel);
75  bBd.filter(kx0Name, *mkx0Sel);
76 
77  bBd.filter(*massSel);
78  if (chi2Sel != nullptr)
79  bBd.filter(*chi2Sel);
80  if (massConstr)
81  bBd.filter(*mFitSel);
82 
84  //
85  // Apply kinematic constraint on the onia mass.
86  // The operation is already performed when apply the mass selection,
87  // so it's not repeated. The following code is left as example
88  // for similar operations
89  //
90  // int iBd;
91  // int nBd = ( massConstr ? bdList.size() : 0 );
92  // for ( iBd = 0; iBd < nBd; ++iBd ) {
93  // BPHRecoCandidate* cptr = bdList[iBd].get();
94  // BPHRecoConstCandPtr onia = cptr->getComp( oniaName );
95  // double oMass = onia->constrMass();
96  // if ( oMass < 0 ) continue;
97  // double sigma = onia->constrSigma();
98  // cptr->kinematicTree( oniaName, oMass, sigma );
99  // }
100  updated = true;
101 
102  return bdList;
103 }
104 
107  updated = false;
108  oniaSel->setMassMin(m);
109  return;
110 }
111 
113  updated = false;
114  oniaSel->setMassMax(m);
115  return;
116 }
117 
119  updated = false;
120  mkx0Sel->setMassMin(m);
121  return;
122 }
123 
125  updated = false;
126  mkx0Sel->setMassMax(m);
127  return;
128 }
129 
131  updated = false;
132  massSel->setMassMin(m);
133  return;
134 }
135 
137  updated = false;
138  massSel->setMassMax(m);
139  return;
140 }
141 
143  updated = false;
144  delete chi2Sel;
145  chi2Sel = (p < 0.0 ? nullptr : new BPHChi2Select(p));
146  return;
147 }
148 
150  updated = false;
151  mFitSel->setMassMin(m);
152  return;
153 }
154 
156  updated = false;
157  mFitSel->setMassMax(m);
158  return;
159 }
160 
162  updated = false;
163  massConstr = flag;
164  return;
165 }
166 
169 
171 
173 
175 
177 
179 
180 double BPHBdToKxMuMuBuilder::getProbMin() const { return (chi2Sel == nullptr ? -1.0 : chi2Sel->getProbMin()); }
181 
183 
185 
BPHBdToKxMuMuBuilder::getKxMassMax
double getKxMassMax() const
Definition: BPHBdToKxMuMuBuilder.cc:174
BPHBdToKxMuMuBuilder::setKxMassMin
void setKxMassMin(double m)
Definition: BPHBdToKxMuMuBuilder.cc:118
BPHMassCuts::setMassMax
void setMassMax(double m)
Definition: BPHMassCuts.h:52
BPHRecoBuilder::filter
void filter(const std::string &name, const BPHRecoSelect &sel) const
BPHChi2Select.h
BPHBdToKxMuMuBuilder::setKxMassMax
void setKxMassMax(double m)
Definition: BPHBdToKxMuMuBuilder.cc:124
BPHBdToKxMuMuBuilder::getConstr
bool getConstr() const
Definition: BPHBdToKxMuMuBuilder.cc:186
BPHMassFitSelect.h
BPHBdToKxMuMuBuilder.h
BPHChi2Select::getProbMin
double getProbMin() const
get current prob min
Definition: BPHChi2Select.h:66
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
BPHBdToKxMuMuBuilder::kCollection
const std::vector< BPHPlusMinusConstCandPtr > * kCollection
Definition: BPHBdToKxMuMuBuilder.h:90
BPHMassCuts::getMassMin
double getMassMin() const
get current mass cuts
Definition: BPHMassCuts.h:58
kCollection
static const std::string kCollection
Definition: FWTableView.cc:190
BPHBdToKxMuMuBuilder::updated
bool updated
Definition: BPHBdToKxMuMuBuilder.h:101
BPHBdToKxMuMuBuilder::massConstr
bool massConstr
Definition: BPHBdToKxMuMuBuilder.h:99
BPHParticleMasses.h
BPHBdToKxMuMuBuilder::evSetup
const edm::EventSetup * evSetup
Definition: BPHBdToKxMuMuBuilder.h:88
BPHBdToKxMuMuBuilder::setMassMax
void setMassMax(double m)
Definition: BPHBdToKxMuMuBuilder.cc:136
BPHBdToKxMuMuBuilder::mFitSel
BPHMassFitSelect * mFitSel
Definition: BPHBdToKxMuMuBuilder.h:97
BPHRecoBuilder
Definition: BPHRecoBuilder.h:50
visualization-live-secondInstance_cfg.m
m
Definition: visualization-live-secondInstance_cfg.py:72
BPHBdToKxMuMuBuilder::getMassMin
double getMassMin() const
Definition: BPHBdToKxMuMuBuilder.cc:176
BPHMassSelect
Definition: BPHMassSelect.h:31
BPHBdToKxMuMuBuilder::~BPHBdToKxMuMuBuilder
virtual ~BPHBdToKxMuMuBuilder()
Definition: BPHBdToKxMuMuBuilder.cc:53
BPHBdToKxMuMuBuilder::setMassFitMax
void setMassFitMax(double m)
Definition: BPHBdToKxMuMuBuilder.cc:155
BPHBdToKxMuMuBuilder::setMassMin
void setMassMin(double m)
Definition: BPHBdToKxMuMuBuilder.cc:130
BPHRecoBuilder::setMinPDiffererence
void setMinPDiffererence(double pMin)
Definition: BPHRecoBuilder.cc:172
BPHBdToKxMuMuBuilder::setMassFitMin
void setMassFitMin(double m)
Definition: BPHBdToKxMuMuBuilder.cc:149
BPHBdToKxMuMuBuilder::minPDiff
float minPDiff
Definition: BPHBdToKxMuMuBuilder.h:100
BPHMassCuts::setMassMin
void setMassMin(double m)
set mass cuts
Definition: BPHMassCuts.h:48
BPHBdToKxMuMuBuilder::getProbMin
double getProbMin() const
Definition: BPHBdToKxMuMuBuilder.cc:180
BPHBdToKxMuMuBuilder::kx0Name
std::string kx0Name
Definition: BPHBdToKxMuMuBuilder.h:86
BPHBdToKxMuMuBuilder::setProbMin
void setProbMin(double p)
Definition: BPHBdToKxMuMuBuilder.cc:142
BPHMassSelect.h
BPHMassCuts::getMassMax
double getMassMax() const
Definition: BPHMassCuts.h:59
BPHBdToKxMuMuBuilder::getMassFitMin
double getMassFitMin() const
Definition: BPHBdToKxMuMuBuilder.cc:182
edm::EventSetup
Definition: EventSetup.h:58
BPHChi2Select
Definition: BPHChi2Select.h:31
BPHBdToKxMuMuBuilder::jCollection
const std::vector< BPHPlusMinusConstCandPtr > * jCollection
Definition: BPHBdToKxMuMuBuilder.h:89
BPHRecoBuilder.h
BPHBdToKxMuMuBuilder::chi2Sel
BPHChi2Select * chi2Sel
Definition: BPHBdToKxMuMuBuilder.h:96
BPHBdToKxMuMuBuilder::setOniaMassMax
void setOniaMassMax(double m)
Definition: BPHBdToKxMuMuBuilder.cc:112
std
Definition: JetResolutionObject.h:76
BPHPlusMinusCandidate.h
BPHBdToKxMuMuBuilder::bdList
std::vector< BPHRecoConstCandPtr > bdList
Definition: BPHBdToKxMuMuBuilder.h:103
BPHBdToKxMuMuBuilder::getOniaMassMin
double getOniaMassMin() const
get current cuts
Definition: BPHBdToKxMuMuBuilder.cc:168
BPHBdToKxMuMuBuilder::getOniaMassMax
double getOniaMassMax() const
Definition: BPHBdToKxMuMuBuilder.cc:170
BPHRecoCandidate::build
static std::vector< BPHRecoConstCandPtr > build(const BPHRecoBuilder &builder, double mass=-1, double msig=-1)
Definition: BPHRecoCandidate.cc:43
BPHBdToKxMuMuBuilder::mkx0Sel
BPHMassSelect * mkx0Sel
Definition: BPHBdToKxMuMuBuilder.h:93
BPHBdToKxMuMuBuilder::BPHBdToKxMuMuBuilder
BPHBdToKxMuMuBuilder(const edm::EventSetup &es, const std::vector< BPHPlusMinusConstCandPtr > &oniaCollection, const std::vector< BPHPlusMinusConstCandPtr > &kx0Collection)
Definition: BPHBdToKxMuMuBuilder.cc:36
BPHBdToKxMuMuBuilder::oniaSel
BPHMassSelect * oniaSel
Definition: BPHBdToKxMuMuBuilder.h:92
BPHRecoCandidate.h
BPHBdToKxMuMuBuilder::setConstr
void setConstr(bool flag)
Definition: BPHBdToKxMuMuBuilder.cc:161
BPHRecoBuilder::add
void add(const std::string &name, const BPHGenericCollection *collection, double mass=-1.0, double msig=-1.0)
BPHBdToKxMuMuBuilder::massSel
BPHMassSelect * massSel
Definition: BPHBdToKxMuMuBuilder.h:95
BPHBdToKxMuMuBuilder::build
std::vector< BPHRecoConstCandPtr > build()
build Bs candidates
Definition: BPHBdToKxMuMuBuilder.cc:64
BPHBdToKxMuMuBuilder::oniaName
std::string oniaName
Definition: BPHBdToKxMuMuBuilder.h:85
BPHBdToKxMuMuBuilder::setOniaMassMin
void setOniaMassMin(double m)
set cuts
Definition: BPHBdToKxMuMuBuilder.cc:106
BPHBdToKxMuMuBuilder::getKxMassMin
double getKxMassMin() const
Definition: BPHBdToKxMuMuBuilder.cc:172
BPHBdToKxMuMuBuilder::getMassFitMax
double getMassFitMax() const
Definition: BPHBdToKxMuMuBuilder.cc:184
BPHBdToKxMuMuBuilder::getMassMax
double getMassMax() const
Definition: BPHBdToKxMuMuBuilder.cc:178
RemoveAddSevLevel.flag
flag
Definition: RemoveAddSevLevel.py:116
BPHMassFitSelect
Definition: BPHMassFitSelect.h:34