1 |
#include "TrkUpgradeAnalysis/VHbb/interface/VHbbCandidateCuts.h"
|
2 |
|
3 |
// Required to work out deltaPhi
|
4 |
#include "DataFormats/GeometryVector/interface/VectorUtil.h"
|
5 |
|
6 |
|
7 |
trkupgradeanalysis::CandidateTypeEquals::CandidateTypeEquals( VHbbCandidate::CandidateType candidateType )
|
8 |
{
|
9 |
requiredCandidateTypes_.push_back(candidateType);
|
10 |
}
|
11 |
|
12 |
trkupgradeanalysis::CandidateTypeEquals::CandidateTypeEquals( const std::vector<VHbbCandidate::CandidateType>& candidateTypes )
|
13 |
: requiredCandidateTypes_(candidateTypes)
|
14 |
{
|
15 |
// No operation besides the initialiser list.
|
16 |
}
|
17 |
|
18 |
trkupgradeanalysis::CandidateTypeEquals::~CandidateTypeEquals()
|
19 |
{
|
20 |
// No operation
|
21 |
}
|
22 |
|
23 |
std::string trkupgradeanalysis::CandidateTypeEquals::name() const
|
24 |
{
|
25 |
std::stringstream nameStream;
|
26 |
nameStream << variableName() << "==";
|
27 |
|
28 |
if( requiredCandidateTypes_.size()>1 ) nameStream << "(";
|
29 |
|
30 |
for( std::vector<VHbbCandidate::CandidateType>::const_iterator iRequiredCandidateType=requiredCandidateTypes_.begin(); iRequiredCandidateType!=requiredCandidateTypes_.end(); ++iRequiredCandidateType )
|
31 |
{
|
32 |
if( *iRequiredCandidateType==VHbbCandidate::Zmumu ) nameStream << "Zmumu";
|
33 |
else if( *iRequiredCandidateType==VHbbCandidate::Zee ) nameStream << "Zee";
|
34 |
else if( *iRequiredCandidateType==VHbbCandidate::Wmun ) nameStream << "Wmun";
|
35 |
else if( *iRequiredCandidateType==VHbbCandidate::Wen ) nameStream << "Wen";
|
36 |
else if( *iRequiredCandidateType==VHbbCandidate::Znn ) nameStream << "Znn";
|
37 |
else if( *iRequiredCandidateType==VHbbCandidate::UNKNOWN ) nameStream << "UNKNOWN";
|
38 |
|
39 |
// Add an "OR" separator if there's more than one
|
40 |
if( requiredCandidateTypes_.size()>1 && iRequiredCandidateType!=requiredCandidateTypes_.begin() ) nameStream << "||";
|
41 |
}
|
42 |
|
43 |
if( requiredCandidateTypes_.size()>1 ) nameStream << ")";
|
44 |
|
45 |
return nameStream.str();
|
46 |
}
|
47 |
|
48 |
const trkupgradeanalysis::IHistogramVariable& trkupgradeanalysis::CandidateTypeEquals::cutVariable() const
|
49 |
{
|
50 |
// This class implements the HistogramVariable interface to save on the
|
51 |
// number of classes, so just return a reference to this instance.
|
52 |
return *this;
|
53 |
}
|
54 |
|
55 |
bool trkupgradeanalysis::CandidateTypeEquals::applyCut( const VHbbCandidate& vhbbCandidate ) const
|
56 |
{
|
57 |
lastValue_=vhbbCandidate.candidateType;
|
58 |
|
59 |
for( std::vector<VHbbCandidate::CandidateType>::const_iterator iRequiredCandidateType=requiredCandidateTypes_.begin(); iRequiredCandidateType!=requiredCandidateTypes_.end(); ++iRequiredCandidateType )
|
60 |
{
|
61 |
if( *iRequiredCandidateType==lastValue_ ) return true;
|
62 |
}
|
63 |
|
64 |
// If control reaches this far than non of the entries in the vector matched
|
65 |
return false;
|
66 |
}
|
67 |
|
68 |
std::string trkupgradeanalysis::CandidateTypeEquals::variableName() const
|
69 |
{
|
70 |
return "CandidateType";
|
71 |
}
|
72 |
|
73 |
double trkupgradeanalysis::CandidateTypeEquals::histogrammableValue() const
|
74 |
{
|
75 |
return lastValue_;
|
76 |
}
|
77 |
|
78 |
size_t trkupgradeanalysis::CandidateTypeEquals::suggestedNumberOfBins() const
|
79 |
{
|
80 |
return 6;
|
81 |
}
|
82 |
|
83 |
double trkupgradeanalysis::CandidateTypeEquals::suggestedLowerEdge() const
|
84 |
{
|
85 |
return -0.5;
|
86 |
}
|
87 |
|
88 |
double trkupgradeanalysis::CandidateTypeEquals::suggestedUpperEdge() const
|
89 |
{
|
90 |
return 5.5;
|
91 |
}
|
92 |
|
93 |
|
94 |
|
95 |
|
96 |
|
97 |
trkupgradeanalysis::NumberOfJets::NumberOfJets( const trkupgradeanalysis::cuts::ICutType& cut )
|
98 |
: pCut_( cut.copy() )
|
99 |
{
|
100 |
// No operation apart from the initialiser list
|
101 |
}
|
102 |
|
103 |
trkupgradeanalysis::NumberOfJets::~NumberOfJets()
|
104 |
{
|
105 |
// No operation
|
106 |
}
|
107 |
|
108 |
std::string trkupgradeanalysis::NumberOfJets::name() const
|
109 |
{
|
110 |
return variableName()+pCut_->name();}
|
111 |
|
112 |
const trkupgradeanalysis::IHistogramVariable& trkupgradeanalysis::NumberOfJets::cutVariable() const
|
113 |
{
|
114 |
// This class implements the HistogramVariable interface to save on the
|
115 |
// number of classes, so just return a reference to this instance.
|
116 |
return *this;
|
117 |
}
|
118 |
|
119 |
bool trkupgradeanalysis::NumberOfJets::applyCut( const VHbbCandidate& vhbbCandidate ) const
|
120 |
{
|
121 |
lastValue_=vhbbCandidate.H.jets.size();
|
122 |
return pCut_->apply(lastValue_);
|
123 |
}
|
124 |
|
125 |
std::string trkupgradeanalysis::NumberOfJets::variableName() const { return "numberOfJets"; }
|
126 |
double trkupgradeanalysis::NumberOfJets::histogrammableValue() const { return lastValue_; }
|
127 |
size_t trkupgradeanalysis::NumberOfJets::suggestedNumberOfBins() const { return 6; }
|
128 |
double trkupgradeanalysis::NumberOfJets::suggestedLowerEdge() const { return -0.5; }
|
129 |
double trkupgradeanalysis::NumberOfJets::suggestedUpperEdge() const { return 5.5; }
|
130 |
|
131 |
|
132 |
|
133 |
|
134 |
|
135 |
trkupgradeanalysis::PtOfJetN::PtOfJetN( unsigned int jetNumber, const trkupgradeanalysis::cuts::ICutType& cut )
|
136 |
: jetNumber_(jetNumber), pCut_( cut.copy() )
|
137 |
{
|
138 |
// No operation apart from the initialiser list
|
139 |
}
|
140 |
|
141 |
trkupgradeanalysis::PtOfJetN::~PtOfJetN()
|
142 |
{
|
143 |
// No operation
|
144 |
}
|
145 |
|
146 |
std::string trkupgradeanalysis::PtOfJetN::name() const
|
147 |
{
|
148 |
return variableName()+pCut_->name();
|
149 |
}
|
150 |
|
151 |
const trkupgradeanalysis::IHistogramVariable& trkupgradeanalysis::PtOfJetN::cutVariable() const
|
152 |
{
|
153 |
// This class implements the HistogramVariable interface to save on the
|
154 |
// number of classes, so just return a reference to this instance.
|
155 |
return *this;
|
156 |
}
|
157 |
|
158 |
bool trkupgradeanalysis::PtOfJetN::applyCut( const VHbbCandidate& vhbbCandidate ) const
|
159 |
{
|
160 |
if( vhbbCandidate.H.jets.size()<jetNumber_+1 ) lastValue_=-1; // Plus one because they're numbered from zero
|
161 |
else lastValue_=const_cast<VHbbCandidate&>(vhbbCandidate).H.jets.at(jetNumber_).Pt(); // const cast needed because this method isn't declared const for some reason
|
162 |
|
163 |
return pCut_->apply(lastValue_);
|
164 |
}
|
165 |
|
166 |
std::string trkupgradeanalysis::PtOfJetN::variableName() const
|
167 |
{
|
168 |
std::stringstream nameStream;
|
169 |
nameStream << "PtOfJet" << jetNumber_;
|
170 |
return nameStream.str();
|
171 |
}
|
172 |
|
173 |
double trkupgradeanalysis::PtOfJetN::histogrammableValue() const { return lastValue_; }
|
174 |
size_t trkupgradeanalysis::PtOfJetN::suggestedNumberOfBins() const { return 60; }
|
175 |
double trkupgradeanalysis::PtOfJetN::suggestedLowerEdge() const { return 0; }
|
176 |
double trkupgradeanalysis::PtOfJetN::suggestedUpperEdge() const { return 150; }
|
177 |
|
178 |
|
179 |
|
180 |
|
181 |
|
182 |
|
183 |
trkupgradeanalysis::PtOfHiggs::PtOfHiggs( const trkupgradeanalysis::cuts::ICutType& cut )
|
184 |
: pCut_( cut.copy() )
|
185 |
{
|
186 |
// No operation apart from the initialiser list
|
187 |
}
|
188 |
|
189 |
trkupgradeanalysis::PtOfHiggs::~PtOfHiggs()
|
190 |
{
|
191 |
// No operation
|
192 |
}
|
193 |
|
194 |
std::string trkupgradeanalysis::PtOfHiggs::name() const
|
195 |
{
|
196 |
return variableName()+pCut_->name();
|
197 |
}
|
198 |
|
199 |
const trkupgradeanalysis::IHistogramVariable& trkupgradeanalysis::PtOfHiggs::cutVariable() const
|
200 |
{
|
201 |
// This class implements the HistogramVariable interface to save on the
|
202 |
// number of classes, so just return a reference to this instance.
|
203 |
return *this;
|
204 |
}
|
205 |
|
206 |
bool trkupgradeanalysis::PtOfHiggs::applyCut( const VHbbCandidate& vhbbCandidate ) const
|
207 |
{
|
208 |
lastValue_=vhbbCandidate.H.p4.Pt();
|
209 |
return pCut_->apply( lastValue_ );
|
210 |
}
|
211 |
|
212 |
std::string trkupgradeanalysis::PtOfHiggs::variableName() const { return "PtOfHiggs"; }
|
213 |
double trkupgradeanalysis::PtOfHiggs::histogrammableValue() const { return lastValue_; }
|
214 |
size_t trkupgradeanalysis::PtOfHiggs::suggestedNumberOfBins() const { return 60; }
|
215 |
double trkupgradeanalysis::PtOfHiggs::suggestedLowerEdge() const { return 0; }
|
216 |
double trkupgradeanalysis::PtOfHiggs::suggestedUpperEdge() const { return 250; }
|
217 |
|
218 |
|
219 |
|
220 |
|
221 |
|
222 |
trkupgradeanalysis::PtOfVectorBoson::PtOfVectorBoson( const trkupgradeanalysis::cuts::ICutType& cut )
|
223 |
: pCut_( cut.copy() )
|
224 |
{
|
225 |
// No operation apart from the initialiser list
|
226 |
}
|
227 |
|
228 |
trkupgradeanalysis::PtOfVectorBoson::~PtOfVectorBoson()
|
229 |
{
|
230 |
// No operation
|
231 |
}
|
232 |
|
233 |
std::string trkupgradeanalysis::PtOfVectorBoson::name() const
|
234 |
{
|
235 |
return variableName()+pCut_->name();
|
236 |
}
|
237 |
|
238 |
const trkupgradeanalysis::IHistogramVariable& trkupgradeanalysis::PtOfVectorBoson::cutVariable() const
|
239 |
{
|
240 |
// This class implements the HistogramVariable interface to save on the
|
241 |
// number of classes, so just return a reference to this instance.
|
242 |
return *this;
|
243 |
}
|
244 |
|
245 |
bool trkupgradeanalysis::PtOfVectorBoson::applyCut( const VHbbCandidate& vhbbCandidate ) const
|
246 |
{
|
247 |
lastValue_=vhbbCandidate.V.p4.Pt();
|
248 |
return pCut_->apply( lastValue_ );
|
249 |
}
|
250 |
|
251 |
std::string trkupgradeanalysis::PtOfVectorBoson::variableName() const
|
252 |
{
|
253 |
return "PtOfVectorBoson";
|
254 |
}
|
255 |
|
256 |
double trkupgradeanalysis::PtOfVectorBoson::histogrammableValue() const
|
257 |
{
|
258 |
return lastValue_;
|
259 |
}
|
260 |
|
261 |
size_t trkupgradeanalysis::PtOfVectorBoson::suggestedNumberOfBins() const
|
262 |
{
|
263 |
return 60;
|
264 |
}
|
265 |
|
266 |
double trkupgradeanalysis::PtOfVectorBoson::suggestedLowerEdge() const
|
267 |
{
|
268 |
return 0;
|
269 |
}
|
270 |
|
271 |
double trkupgradeanalysis::PtOfVectorBoson::suggestedUpperEdge() const
|
272 |
{
|
273 |
return 250;
|
274 |
}
|
275 |
|
276 |
|
277 |
|
278 |
|
279 |
|
280 |
|
281 |
trkupgradeanalysis::NumberOfAdditionalJets::NumberOfAdditionalJets( const trkupgradeanalysis::cuts::ICutType& cut, bool applyCleaning )
|
282 |
: pCut_( cut.copy() ), applyCleaning_(applyCleaning)
|
283 |
{
|
284 |
// No operation apart from the initialiser list
|
285 |
}
|
286 |
|
287 |
trkupgradeanalysis::NumberOfAdditionalJets::~NumberOfAdditionalJets()
|
288 |
{
|
289 |
// No operation
|
290 |
}
|
291 |
|
292 |
std::string trkupgradeanalysis::NumberOfAdditionalJets::name() const
|
293 |
{
|
294 |
return variableName()+pCut_->name();
|
295 |
}
|
296 |
|
297 |
const trkupgradeanalysis::IHistogramVariable& trkupgradeanalysis::NumberOfAdditionalJets::cutVariable() const
|
298 |
{
|
299 |
// This class implements the HistogramVariable interface to save on the
|
300 |
// number of classes, so just return a reference to this instance.
|
301 |
return *this;
|
302 |
}
|
303 |
|
304 |
bool trkupgradeanalysis::NumberOfAdditionalJets::applyCut( const VHbbCandidate& vhbbCandidate ) const
|
305 |
{
|
306 |
if( !applyCleaning_ ) lastValue_=vhbbCandidate.additionalJets.size();
|
307 |
else
|
308 |
{
|
309 |
lastValue_=0;
|
310 |
for( std::vector<VHbbEvent::SimpleJet>::const_iterator iJet=vhbbCandidate.additionalJets.begin(); iJet!=vhbbCandidate.additionalJets.end(); ++iJet )
|
311 |
{
|
312 |
if( jetId( *iJet )==true && fabs(iJet->p4.Eta()) < 2.5 && iJet->p4.Pt() > 20 ) ++lastValue_;
|
313 |
}
|
314 |
}
|
315 |
|
316 |
return pCut_->apply( lastValue_ );
|
317 |
}
|
318 |
|
319 |
bool trkupgradeanalysis::NumberOfAdditionalJets::jetId( const VHbbEvent::SimpleJet& jet ) const
|
320 |
{
|
321 |
if( jet.neutralHadronEFraction > 0.99 ) return false;
|
322 |
if( jet.neutralEmEFraction > 0.99 ) return false;
|
323 |
if( jet.nConstituents <= 1 ) return false;
|
324 |
if( fabs(jet.p4.Eta()) < 2.5 )
|
325 |
{
|
326 |
if( jet.chargedEmEFraction > 0.99 ) return false;
|
327 |
if( jet.chargedHadronEFraction == 0 ) return false;
|
328 |
if( jet.ntracks== 0 ) return false;
|
329 |
}
|
330 |
|
331 |
return true;
|
332 |
}
|
333 |
|
334 |
std::string trkupgradeanalysis::NumberOfAdditionalJets::variableName() const
|
335 |
{
|
336 |
return "NumberOfAdditionalJets";
|
337 |
}
|
338 |
|
339 |
double trkupgradeanalysis::NumberOfAdditionalJets::histogrammableValue() const
|
340 |
{
|
341 |
return lastValue_;
|
342 |
}
|
343 |
|
344 |
size_t trkupgradeanalysis::NumberOfAdditionalJets::suggestedNumberOfBins() const
|
345 |
{
|
346 |
return 91;
|
347 |
}
|
348 |
|
349 |
double trkupgradeanalysis::NumberOfAdditionalJets::suggestedLowerEdge() const
|
350 |
{
|
351 |
return -0.5;
|
352 |
}
|
353 |
|
354 |
double trkupgradeanalysis::NumberOfAdditionalJets::suggestedUpperEdge() const
|
355 |
{
|
356 |
return 90.5;
|
357 |
}
|
358 |
|
359 |
|
360 |
|
361 |
|
362 |
|
363 |
|
364 |
trkupgradeanalysis::NumberOfAdditionalLeptons::NumberOfAdditionalLeptons( const trkupgradeanalysis::cuts::ICutType& cut )
|
365 |
: pCut_( cut.copy() )
|
366 |
{
|
367 |
// No operation apart from the initialiser list
|
368 |
}
|
369 |
|
370 |
trkupgradeanalysis::NumberOfAdditionalLeptons::~NumberOfAdditionalLeptons()
|
371 |
{
|
372 |
// No operation
|
373 |
}
|
374 |
|
375 |
std::string trkupgradeanalysis::NumberOfAdditionalLeptons::name() const
|
376 |
{
|
377 |
return variableName()+pCut_->name();
|
378 |
}
|
379 |
|
380 |
const trkupgradeanalysis::IHistogramVariable& trkupgradeanalysis::NumberOfAdditionalLeptons::cutVariable() const
|
381 |
{
|
382 |
// This class implements the HistogramVariable interface to save on the
|
383 |
// number of classes, so just return a reference to this instance.
|
384 |
return *this;
|
385 |
}
|
386 |
|
387 |
bool trkupgradeanalysis::NumberOfAdditionalLeptons::applyCut( const VHbbCandidate& vhbbCandidate ) const
|
388 |
{
|
389 |
int expectedLeptons=0;
|
390 |
if( vhbbCandidate.candidateType == VHbbCandidate::Wmun || vhbbCandidate.candidateType == VHbbCandidate::Wen ) expectedLeptons=1;
|
391 |
if( vhbbCandidate.candidateType == VHbbCandidate::Zmumu || vhbbCandidate.candidateType == VHbbCandidate::Zee ) expectedLeptons=2;
|
392 |
|
393 |
lastValue_=vhbbCandidate.V.muons.size()+vhbbCandidate.V.electrons.size()-expectedLeptons;
|
394 |
return pCut_->apply( lastValue_ );
|
395 |
}
|
396 |
|
397 |
std::string trkupgradeanalysis::NumberOfAdditionalLeptons::variableName() const
|
398 |
{
|
399 |
return "NumberOfAdditionalLeptons";
|
400 |
}
|
401 |
|
402 |
double trkupgradeanalysis::NumberOfAdditionalLeptons::histogrammableValue() const
|
403 |
{
|
404 |
return lastValue_;
|
405 |
}
|
406 |
|
407 |
size_t trkupgradeanalysis::NumberOfAdditionalLeptons::suggestedNumberOfBins() const
|
408 |
{
|
409 |
return 31;
|
410 |
}
|
411 |
|
412 |
double trkupgradeanalysis::NumberOfAdditionalLeptons::suggestedLowerEdge() const
|
413 |
{
|
414 |
return -0.5;
|
415 |
}
|
416 |
|
417 |
double trkupgradeanalysis::NumberOfAdditionalLeptons::suggestedUpperEdge() const
|
418 |
{
|
419 |
return 30.5;
|
420 |
}
|
421 |
|
422 |
|
423 |
|
424 |
|
425 |
|
426 |
|
427 |
|
428 |
|
429 |
trkupgradeanalysis::METSigma::METSigma( const trkupgradeanalysis::cuts::ICutType& cut )
|
430 |
: pCut_( cut.copy() )
|
431 |
{
|
432 |
// No operation apart from the initialiser list
|
433 |
}
|
434 |
|
435 |
trkupgradeanalysis::METSigma::~METSigma()
|
436 |
{
|
437 |
// No operation
|
438 |
}
|
439 |
|
440 |
std::string trkupgradeanalysis::METSigma::name() const
|
441 |
{
|
442 |
return variableName()+pCut_->name();
|
443 |
}
|
444 |
|
445 |
const trkupgradeanalysis::IHistogramVariable& trkupgradeanalysis::METSigma::cutVariable() const
|
446 |
{
|
447 |
// This class implements the HistogramVariable interface to save on the
|
448 |
// number of classes, so just return a reference to this instance.
|
449 |
return *this;
|
450 |
}
|
451 |
|
452 |
bool trkupgradeanalysis::METSigma::applyCut( const VHbbCandidate& vhbbCandidate ) const
|
453 |
{
|
454 |
if( vhbbCandidate.V.mets.empty() ) lastValue_=-1;
|
455 |
else lastValue_=vhbbCandidate.V.mets[0].metSig;
|
456 |
|
457 |
return pCut_->apply( lastValue_ );
|
458 |
}
|
459 |
|
460 |
std::string trkupgradeanalysis::METSigma::variableName() const
|
461 |
{
|
462 |
return "METSigma";
|
463 |
}
|
464 |
|
465 |
double trkupgradeanalysis::METSigma::histogrammableValue() const
|
466 |
{
|
467 |
return lastValue_;
|
468 |
}
|
469 |
|
470 |
size_t trkupgradeanalysis::METSigma::suggestedNumberOfBins() const
|
471 |
{
|
472 |
return 60;
|
473 |
}
|
474 |
|
475 |
double trkupgradeanalysis::METSigma::suggestedLowerEdge() const
|
476 |
{
|
477 |
return 0;
|
478 |
}
|
479 |
|
480 |
double trkupgradeanalysis::METSigma::suggestedUpperEdge() const
|
481 |
{
|
482 |
return 100;
|
483 |
}
|
484 |
|
485 |
|
486 |
|
487 |
|
488 |
|
489 |
|
490 |
|
491 |
trkupgradeanalysis::PtOfElectronN::PtOfElectronN( unsigned int electronNumber, const trkupgradeanalysis::cuts::ICutType& cut )
|
492 |
: electronNumber_(electronNumber), pCut_( cut.copy() )
|
493 |
{
|
494 |
// No operation apart from the initialiser list
|
495 |
}
|
496 |
|
497 |
trkupgradeanalysis::PtOfElectronN::~PtOfElectronN()
|
498 |
{
|
499 |
// No operation
|
500 |
}
|
501 |
|
502 |
std::string trkupgradeanalysis::PtOfElectronN::name() const
|
503 |
{
|
504 |
return variableName()+pCut_->name();
|
505 |
}
|
506 |
|
507 |
const trkupgradeanalysis::IHistogramVariable& trkupgradeanalysis::PtOfElectronN::cutVariable() const
|
508 |
{
|
509 |
// This class implements the HistogramVariable interface to save on the
|
510 |
// number of classes, so just return a reference to this instance.
|
511 |
return *this;
|
512 |
}
|
513 |
|
514 |
bool trkupgradeanalysis::PtOfElectronN::applyCut( const VHbbCandidate& vhbbCandidate ) const
|
515 |
{
|
516 |
if( vhbbCandidate.V.electrons.size()<electronNumber_+1 ) lastValue_=-1; // Plus one because they're numbered from zero
|
517 |
else lastValue_=vhbbCandidate.V.electrons.at(electronNumber_).p4.Pt();
|
518 |
|
519 |
return pCut_->apply( lastValue_ );
|
520 |
}
|
521 |
|
522 |
std::string trkupgradeanalysis::PtOfElectronN::variableName() const
|
523 |
{
|
524 |
std::stringstream nameStream;
|
525 |
nameStream << "PtOfElectron" << electronNumber_;
|
526 |
return nameStream.str();
|
527 |
}
|
528 |
|
529 |
double trkupgradeanalysis::PtOfElectronN::histogrammableValue() const
|
530 |
{
|
531 |
return lastValue_;
|
532 |
}
|
533 |
|
534 |
size_t trkupgradeanalysis::PtOfElectronN::suggestedNumberOfBins() const
|
535 |
{
|
536 |
return 60;
|
537 |
}
|
538 |
|
539 |
double trkupgradeanalysis::PtOfElectronN::suggestedLowerEdge() const
|
540 |
{
|
541 |
return 0;
|
542 |
}
|
543 |
|
544 |
double trkupgradeanalysis::PtOfElectronN::suggestedUpperEdge() const
|
545 |
{
|
546 |
return 150;
|
547 |
}
|
548 |
|
549 |
|
550 |
|
551 |
|
552 |
|
553 |
|
554 |
|
555 |
trkupgradeanalysis::MassOfVectorBoson::MassOfVectorBoson( const trkupgradeanalysis::cuts::ICutType& cut )
|
556 |
: pCut_( cut.copy() )
|
557 |
{
|
558 |
// No operation apart from the initialiser list
|
559 |
}
|
560 |
|
561 |
trkupgradeanalysis::MassOfVectorBoson::~MassOfVectorBoson()
|
562 |
{
|
563 |
// No operation
|
564 |
}
|
565 |
|
566 |
std::string trkupgradeanalysis::MassOfVectorBoson::name() const
|
567 |
{
|
568 |
return variableName()+pCut_->name();
|
569 |
}
|
570 |
|
571 |
const trkupgradeanalysis::IHistogramVariable& trkupgradeanalysis::MassOfVectorBoson::cutVariable() const
|
572 |
{
|
573 |
// This class implements the HistogramVariable interface to save on the
|
574 |
// number of classes, so just return a reference to this instance.
|
575 |
return *this;
|
576 |
}
|
577 |
|
578 |
bool trkupgradeanalysis::MassOfVectorBoson::applyCut( const VHbbCandidate& vhbbCandidate ) const
|
579 |
{
|
580 |
lastValue_=vhbbCandidate.V.p4.M();
|
581 |
return pCut_->apply( lastValue_ );
|
582 |
}
|
583 |
|
584 |
std::string trkupgradeanalysis::MassOfVectorBoson::variableName() const
|
585 |
{
|
586 |
return "MassOfVectorBoson";
|
587 |
}
|
588 |
|
589 |
double trkupgradeanalysis::MassOfVectorBoson::histogrammableValue() const
|
590 |
{
|
591 |
return lastValue_;
|
592 |
}
|
593 |
|
594 |
size_t trkupgradeanalysis::MassOfVectorBoson::suggestedNumberOfBins() const
|
595 |
{
|
596 |
return 60;
|
597 |
}
|
598 |
|
599 |
double trkupgradeanalysis::MassOfVectorBoson::suggestedLowerEdge() const
|
600 |
{
|
601 |
return 0;
|
602 |
}
|
603 |
|
604 |
double trkupgradeanalysis::MassOfVectorBoson::suggestedUpperEdge() const
|
605 |
{
|
606 |
return 250;
|
607 |
}
|
608 |
|
609 |
|
610 |
|
611 |
|
612 |
|
613 |
|
614 |
|
615 |
trkupgradeanalysis::MassOfHiggsBoson::MassOfHiggsBoson( const trkupgradeanalysis::cuts::ICutType& cut )
|
616 |
: pCut_( cut.copy() )
|
617 |
{
|
618 |
// No operation apart from the initialiser list
|
619 |
}
|
620 |
|
621 |
trkupgradeanalysis::MassOfHiggsBoson::~MassOfHiggsBoson()
|
622 |
{
|
623 |
// No operation
|
624 |
}
|
625 |
|
626 |
std::string trkupgradeanalysis::MassOfHiggsBoson::name() const
|
627 |
{
|
628 |
return variableName()+pCut_->name();
|
629 |
}
|
630 |
|
631 |
const trkupgradeanalysis::IHistogramVariable& trkupgradeanalysis::MassOfHiggsBoson::cutVariable() const
|
632 |
{
|
633 |
// This class implements the HistogramVariable interface to save on the
|
634 |
// number of classes, so just return a reference to this instance.
|
635 |
return *this;
|
636 |
}
|
637 |
|
638 |
bool trkupgradeanalysis::MassOfHiggsBoson::applyCut( const VHbbCandidate& vhbbCandidate ) const
|
639 |
{
|
640 |
lastValue_=vhbbCandidate.H.p4.M();
|
641 |
return pCut_->apply( lastValue_ );
|
642 |
}
|
643 |
|
644 |
std::string trkupgradeanalysis::MassOfHiggsBoson::variableName() const
|
645 |
{
|
646 |
return "MassOfHiggsBoson";
|
647 |
}
|
648 |
|
649 |
double trkupgradeanalysis::MassOfHiggsBoson::histogrammableValue() const
|
650 |
{
|
651 |
return lastValue_;
|
652 |
}
|
653 |
|
654 |
size_t trkupgradeanalysis::MassOfHiggsBoson::suggestedNumberOfBins() const
|
655 |
{
|
656 |
return 60;
|
657 |
}
|
658 |
|
659 |
double trkupgradeanalysis::MassOfHiggsBoson::suggestedLowerEdge() const
|
660 |
{
|
661 |
return 0;
|
662 |
}
|
663 |
|
664 |
double trkupgradeanalysis::MassOfHiggsBoson::suggestedUpperEdge() const
|
665 |
{
|
666 |
return 250;
|
667 |
}
|
668 |
|
669 |
|
670 |
|
671 |
|
672 |
|
673 |
|
674 |
|
675 |
trkupgradeanalysis::CSVOfAnyJetGreaterThan::CSVOfAnyJetGreaterThan( double csvValue, unsigned int maximumJetNumber )
|
676 |
: maximumJetNumber_(maximumJetNumber), requiredCSV_(csvValue)
|
677 |
{
|
678 |
// No operation apart from the initialiser list
|
679 |
}
|
680 |
|
681 |
trkupgradeanalysis::CSVOfAnyJetGreaterThan::~CSVOfAnyJetGreaterThan()
|
682 |
{
|
683 |
// No operation
|
684 |
}
|
685 |
|
686 |
std::string trkupgradeanalysis::CSVOfAnyJetGreaterThan::name() const
|
687 |
{
|
688 |
std::stringstream nameStream;
|
689 |
nameStream << variableName() << "GreaterThan" << requiredCSV_;
|
690 |
return nameStream.str();
|
691 |
}
|
692 |
|
693 |
const trkupgradeanalysis::IHistogramVariable& trkupgradeanalysis::CSVOfAnyJetGreaterThan::cutVariable() const
|
694 |
{
|
695 |
// This class implements the HistogramVariable interface to save on the
|
696 |
// number of classes, so just return a reference to this instance.
|
697 |
return *this;
|
698 |
}
|
699 |
|
700 |
bool trkupgradeanalysis::CSVOfAnyJetGreaterThan::applyCut( const VHbbCandidate& vhbbCandidate ) const
|
701 |
{
|
702 |
unsigned int numberOfJetsToCheck;
|
703 |
if( maximumJetNumber_==0 ) numberOfJetsToCheck=vhbbCandidate.H.jets.size();
|
704 |
else numberOfJetsToCheck=maximumJetNumber_;
|
705 |
|
706 |
lastValue_=-1; // Start off with a nonsensical default so I know if things go wrong
|
707 |
for( unsigned int a=0; a<numberOfJetsToCheck && a<vhbbCandidate.H.jets.size(); ++a )
|
708 |
{
|
709 |
if( vhbbCandidate.H.jets.at(a).csv > lastValue_ ) lastValue_=vhbbCandidate.H.jets.at(a).csv;
|
710 |
}
|
711 |
|
712 |
return lastValue_ > requiredCSV_;
|
713 |
}
|
714 |
|
715 |
std::string trkupgradeanalysis::CSVOfAnyJetGreaterThan::variableName() const
|
716 |
{
|
717 |
std::stringstream nameStream;
|
718 |
nameStream << "CSVOf";
|
719 |
|
720 |
if( maximumJetNumber_==0 ) nameStream << "AnyJet";
|
721 |
else nameStream << "AnyOfFirst" << maximumJetNumber_ << "Jets";
|
722 |
|
723 |
return nameStream.str();
|
724 |
}
|
725 |
|
726 |
double trkupgradeanalysis::CSVOfAnyJetGreaterThan::histogrammableValue() const
|
727 |
{
|
728 |
return lastValue_;
|
729 |
}
|
730 |
|
731 |
size_t trkupgradeanalysis::CSVOfAnyJetGreaterThan::suggestedNumberOfBins() const
|
732 |
{
|
733 |
return 60;
|
734 |
}
|
735 |
|
736 |
double trkupgradeanalysis::CSVOfAnyJetGreaterThan::suggestedLowerEdge() const
|
737 |
{
|
738 |
return -1;
|
739 |
}
|
740 |
|
741 |
double trkupgradeanalysis::CSVOfAnyJetGreaterThan::suggestedUpperEdge() const
|
742 |
{
|
743 |
return 1.5;
|
744 |
}
|
745 |
|
746 |
|
747 |
|
748 |
|
749 |
|
750 |
|
751 |
|
752 |
trkupgradeanalysis::CSVOfAllJetsGreaterThan::CSVOfAllJetsGreaterThan( double csvValue, unsigned int maximumJetNumber )
|
753 |
: maximumJetNumber_(maximumJetNumber), requiredCSV_(csvValue)
|
754 |
{
|
755 |
// No operation apart from the initialiser list
|
756 |
}
|
757 |
|
758 |
trkupgradeanalysis::CSVOfAllJetsGreaterThan::~CSVOfAllJetsGreaterThan()
|
759 |
{
|
760 |
// No operation
|
761 |
}
|
762 |
|
763 |
std::string trkupgradeanalysis::CSVOfAllJetsGreaterThan::name() const
|
764 |
{
|
765 |
std::stringstream nameStream;
|
766 |
nameStream << variableName() << "GreaterThan" << requiredCSV_;
|
767 |
return nameStream.str();
|
768 |
}
|
769 |
|
770 |
const trkupgradeanalysis::IHistogramVariable& trkupgradeanalysis::CSVOfAllJetsGreaterThan::cutVariable() const
|
771 |
{
|
772 |
// This class implements the HistogramVariable interface to save on the
|
773 |
// number of classes, so just return a reference to this instance.
|
774 |
return *this;
|
775 |
}
|
776 |
|
777 |
bool trkupgradeanalysis::CSVOfAllJetsGreaterThan::applyCut( const VHbbCandidate& vhbbCandidate ) const
|
778 |
{
|
779 |
unsigned int numberOfJetsToCheck;
|
780 |
if( maximumJetNumber_==0 ) numberOfJetsToCheck=vhbbCandidate.H.jets.size();
|
781 |
else numberOfJetsToCheck=maximumJetNumber_;
|
782 |
|
783 |
lastValue_=-1; // Start off with a nonsensical default so I know if things go wrong
|
784 |
for( unsigned int a=0; a<numberOfJetsToCheck && a<vhbbCandidate.H.jets.size(); ++a )
|
785 |
{
|
786 |
if( (vhbbCandidate.H.jets.at(a).csv<lastValue_) || lastValue_==-1 ) lastValue_=vhbbCandidate.H.jets.at(a).csv;
|
787 |
}
|
788 |
|
789 |
return lastValue_ > requiredCSV_;
|
790 |
}
|
791 |
|
792 |
std::string trkupgradeanalysis::CSVOfAllJetsGreaterThan::variableName() const
|
793 |
{
|
794 |
std::stringstream nameStream;
|
795 |
nameStream << "CSVOf";
|
796 |
|
797 |
if( maximumJetNumber_==0 ) nameStream << "AllJets";
|
798 |
else nameStream << "AllOfFirst" << maximumJetNumber_ << "Jets";
|
799 |
|
800 |
return nameStream.str();
|
801 |
}
|
802 |
|
803 |
double trkupgradeanalysis::CSVOfAllJetsGreaterThan::histogrammableValue() const
|
804 |
{
|
805 |
return lastValue_;
|
806 |
}
|
807 |
|
808 |
size_t trkupgradeanalysis::CSVOfAllJetsGreaterThan::suggestedNumberOfBins() const
|
809 |
{
|
810 |
return 60;
|
811 |
}
|
812 |
|
813 |
double trkupgradeanalysis::CSVOfAllJetsGreaterThan::suggestedLowerEdge() const
|
814 |
{
|
815 |
return -1;
|
816 |
}
|
817 |
|
818 |
double trkupgradeanalysis::CSVOfAllJetsGreaterThan::suggestedUpperEdge() const
|
819 |
{
|
820 |
return 1.5;
|
821 |
}
|
822 |
|
823 |
|
824 |
|
825 |
|
826 |
|
827 |
|
828 |
trkupgradeanalysis::NumberOfMETObjects::NumberOfMETObjects( const trkupgradeanalysis::cuts::ICutType& cut )
|
829 |
: pCut_( cut.copy() )
|
830 |
{
|
831 |
// No operation apart from the initialiser list
|
832 |
}
|
833 |
|
834 |
trkupgradeanalysis::NumberOfMETObjects::~NumberOfMETObjects()
|
835 |
{
|
836 |
// No operation
|
837 |
}
|
838 |
|
839 |
std::string trkupgradeanalysis::NumberOfMETObjects::name() const
|
840 |
{
|
841 |
return variableName()+pCut_->name();
|
842 |
}
|
843 |
|
844 |
const trkupgradeanalysis::IHistogramVariable& trkupgradeanalysis::NumberOfMETObjects::cutVariable() const
|
845 |
{
|
846 |
// This class implements the HistogramVariable interface to save on the
|
847 |
// number of classes, so just return a reference to this instance.
|
848 |
return *this;
|
849 |
}
|
850 |
|
851 |
bool trkupgradeanalysis::NumberOfMETObjects::applyCut( const VHbbCandidate& vhbbCandidate ) const
|
852 |
{
|
853 |
lastValue_=vhbbCandidate.V.mets.size();
|
854 |
return pCut_->apply( lastValue_ );
|
855 |
}
|
856 |
|
857 |
std::string trkupgradeanalysis::NumberOfMETObjects::variableName() const { return "numberOfMETObjects"; }
|
858 |
double trkupgradeanalysis::NumberOfMETObjects::histogrammableValue() const { return lastValue_; }
|
859 |
size_t trkupgradeanalysis::NumberOfMETObjects::suggestedNumberOfBins() const { return 6; }
|
860 |
double trkupgradeanalysis::NumberOfMETObjects::suggestedLowerEdge() const { return -0.5; }
|
861 |
double trkupgradeanalysis::NumberOfMETObjects::suggestedUpperEdge() const { return 5.5; }
|
862 |
|
863 |
|
864 |
|
865 |
|
866 |
|
867 |
|
868 |
|
869 |
|
870 |
|
871 |
trkupgradeanalysis::PtOfMETN::PtOfMETN( unsigned int metNumber, const trkupgradeanalysis::cuts::ICutType& cut )
|
872 |
: metNumber_(metNumber), pCut_( cut.copy() )
|
873 |
{
|
874 |
// No operation apart from the initialiser list
|
875 |
}
|
876 |
|
877 |
trkupgradeanalysis::PtOfMETN::~PtOfMETN()
|
878 |
{
|
879 |
// No operation
|
880 |
}
|
881 |
|
882 |
std::string trkupgradeanalysis::PtOfMETN::name() const
|
883 |
{
|
884 |
return variableName()+pCut_->name();
|
885 |
}
|
886 |
|
887 |
const trkupgradeanalysis::IHistogramVariable& trkupgradeanalysis::PtOfMETN::cutVariable() const
|
888 |
{
|
889 |
// This class implements the HistogramVariable interface to save on the
|
890 |
// number of classes, so just return a reference to this instance.
|
891 |
return *this;
|
892 |
}
|
893 |
|
894 |
bool trkupgradeanalysis::PtOfMETN::applyCut( const VHbbCandidate& vhbbCandidate ) const
|
895 |
{
|
896 |
if( vhbbCandidate.V.mets.size()<metNumber_+1 ) // Plus one because they're numbered from zero
|
897 |
{
|
898 |
lastValue_=-1;
|
899 |
return false;
|
900 |
}
|
901 |
|
902 |
lastValue_=vhbbCandidate.V.mets.at(metNumber_).p4.Pt();
|
903 |
return pCut_->apply( lastValue_ );
|
904 |
}
|
905 |
|
906 |
std::string trkupgradeanalysis::PtOfMETN::variableName() const
|
907 |
{
|
908 |
std::stringstream nameStream;
|
909 |
nameStream << "PtOfMET" << metNumber_;
|
910 |
return nameStream.str();
|
911 |
}
|
912 |
|
913 |
double trkupgradeanalysis::PtOfMETN::histogrammableValue() const { return lastValue_; }
|
914 |
size_t trkupgradeanalysis::PtOfMETN::suggestedNumberOfBins() const { return 60; }
|
915 |
double trkupgradeanalysis::PtOfMETN::suggestedLowerEdge() const { return 0; }
|
916 |
double trkupgradeanalysis::PtOfMETN::suggestedUpperEdge() const { return 150; }
|
917 |
|
918 |
|
919 |
|
920 |
|
921 |
|
922 |
|
923 |
|
924 |
trkupgradeanalysis::DeltaPhiVH::DeltaPhiVH( const trkupgradeanalysis::cuts::ICutType& cut )
|
925 |
: pCut_( cut.copy() )
|
926 |
{
|
927 |
// No operation apart from the initialiser list
|
928 |
}
|
929 |
|
930 |
trkupgradeanalysis::DeltaPhiVH::~DeltaPhiVH()
|
931 |
{
|
932 |
// No operation
|
933 |
}
|
934 |
|
935 |
std::string trkupgradeanalysis::DeltaPhiVH::name() const
|
936 |
{
|
937 |
return variableName()+pCut_->name();
|
938 |
}
|
939 |
|
940 |
const trkupgradeanalysis::IHistogramVariable& trkupgradeanalysis::DeltaPhiVH::cutVariable() const
|
941 |
{
|
942 |
// This class implements the HistogramVariable interface to save on the
|
943 |
// number of classes, so just return a reference to this instance.
|
944 |
return *this;
|
945 |
}
|
946 |
|
947 |
bool trkupgradeanalysis::DeltaPhiVH::applyCut( const VHbbCandidate& vhbbCandidate ) const
|
948 |
{
|
949 |
lastValue_=TMath::Abs( Geom::deltaPhi( vhbbCandidate.H.p4.Phi(), vhbbCandidate.V.p4.Phi() ) );
|
950 |
return pCut_->apply( lastValue_ );
|
951 |
}
|
952 |
|
953 |
std::string trkupgradeanalysis::DeltaPhiVH::variableName() const { return "DeltaPhiVH";}
|
954 |
double trkupgradeanalysis::DeltaPhiVH::histogrammableValue() const { return lastValue_; }
|
955 |
size_t trkupgradeanalysis::DeltaPhiVH::suggestedNumberOfBins() const { return 60; }
|
956 |
double trkupgradeanalysis::DeltaPhiVH::suggestedLowerEdge() const { return 0; }
|
957 |
double trkupgradeanalysis::DeltaPhiVH::suggestedUpperEdge() const { return M_PI; }
|