1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
|
#ifndef HeavyFlavorAnalysis_SpecificDecay_BPHDecayConstrainedBuilder_h
#define HeavyFlavorAnalysis_SpecificDecay_BPHDecayConstrainedBuilder_h
/** \class BPHDecayConstrainedBuilder
*
* Description:
* Class to build a particle decaying to a resonance, decaying itself
* to an opposite charged particles pair, applying a mass constraint
*
* \author Paolo Ronchese INFN Padova
*
*/
//----------------------
// Base Class Headers --
//----------------------
#include "HeavyFlavorAnalysis/SpecificDecay/interface/BPHDecayGenericBuilder.h"
#include "HeavyFlavorAnalysis/SpecificDecay/interface/BPHDecayConstrainedBuilderBase.h"
//------------------------------------
// Collaborating Class Declarations --
//------------------------------------
#include "HeavyFlavorAnalysis/RecoDecay/interface/BPHRecoCandidate.h"
#include "HeavyFlavorAnalysis/RecoDecay/interface/BPHPlusMinusCandidate.h"
#include "FWCore/Framework/interface/EventSetup.h"
class BPHEventSetupWrapper;
//---------------
// C++ Headers --
//---------------
#include <string>
#include <vector>
// ---------------------
// -- Class Interface --
// ---------------------
template <class ProdType, class ResType>
class BPHDecayConstrainedBuilder : public virtual BPHDecayConstrainedBuilderBase,
public virtual BPHDecayGenericBuilder<ProdType> {
public:
using typename BPHDecayGenericBuilder<ProdType>::prod_ptr;
typedef typename ResType::const_pointer res_ptr;
/** Constructor
*/
BPHDecayConstrainedBuilder(const BPHEventSetupWrapper& es,
const std::string& resName,
double resMass,
double resWidth,
const std::vector<res_ptr>& resCollection)
: BPHDecayGenericBuilderBase(es),
BPHDecayConstrainedBuilderBase(resName, resMass, resWidth),
BPHDecayGenericBuilder<ProdType>(new BPHMassFitSelect(resName, resMass, resWidth, -2.0e+06, -1.0e+06)),
rCollection(&resCollection) {}
// deleted copy constructor and assignment operator
BPHDecayConstrainedBuilder(const BPHDecayConstrainedBuilder& x) = delete;
BPHDecayConstrainedBuilder& operator=(const BPHDecayConstrainedBuilder& x) = delete;
/** Destructor
*/
~BPHDecayConstrainedBuilder() override = default;
protected:
BPHDecayConstrainedBuilder(const std::vector<res_ptr>& resCollection) : rCollection(&resCollection) {}
const std::vector<res_ptr>* rCollection;
void addResCollection(BPHRecoBuilder& brb) override {
const std::vector<res_ptr>& rc = *this->rCollection;
if (resoSel->getMassMax() > 0.0) {
rCollectSel.clear();
rCollectSel.reserve(rc.size());
for (const res_ptr& r : rc) {
if (resoSel->accept(*r))
rCollectSel.push_back(r);
}
brb.add(rName, rCollectSel);
} else
brb.add(rName, *this->rCollection);
}
private:
std::vector<res_ptr> rCollectSel;
};
#endif
|