CMS 3D CMS Logo

BPHDecayToResFlyingBuilder.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 //-------------------------------
19 
20 //---------------
21 // C++ Headers --
22 //---------------
23 using namespace std;
24 
25 //-------------------
26 // Initializations --
27 //-------------------
28 
29 //----------------
30 // Constructors --
31 //----------------
33  const std::string& resName,
34  double resMass,
35  double resWidth,
36  const std::vector<BPHPlusMinusConstCandPtr>& resCollection,
37  const std::string& flyName,
38  double flyMass,
39  double flyMSigma,
40  const std::vector<BPHPlusMinusConstCandPtr>& flyCollection)
41  : BPHDecayConstrainedBuilder(es, resName, resMass, resWidth, resCollection),
42  fName(flyName),
43  fMass(flyMass),
44  fMSigma(flyMSigma),
45  fCollection(&flyCollection),
46  flySel(new BPHMassFitSelect(-2.0e+06, -1.0e+06)),
47  kfChi2Sel(new BPHKinFitChi2Select(-1.0)) {}
48 
49 //--------------
50 // Destructor --
51 //--------------
53  delete flySel;
54  delete kfChi2Sel;
55 }
56 
57 //--------------
58 // Operations --
59 //--------------
60 vector<BPHRecoConstCandPtr> BPHDecayToResFlyingBuilder::build() {
61  if (updated)
62  return recList;
63 
64  recList.clear();
65 
66  BPHRecoBuilder brb(*evSetup);
68  brb.add(rName, *rCollection);
69  brb.add(fName, *fCollection);
70 
71  if (resoSel->getMassMax() >= 0.0)
72  brb.filter(rName, *resoSel);
73  if (flySel->getMassMax() >= 0.0)
74  brb.filter(fName, *flySel);
75 
76  if (massSel->getMassMax() >= 0.0)
77  brb.filter(*massSel);
78 
79  vector<BPHRecoConstCandPtr> tmpList = BPHRecoCandidate::build(brb);
80  //
81  // Apply kinematic constraint on the resonance mass.
82  //
83  int iRec;
84  int nRec = tmpList.size();
85  recList.reserve(nRec);
86  for (iRec = 0; iRec < nRec; ++iRec) {
87  BPHRecoConstCandPtr ctmp = tmpList[iRec];
88  BPHRecoCandidate* cptr = ctmp->clone();
90  // fit for flying reconstruction
91  // indipendent from other particles
92  cptr->setIndependentFit(fName, true, fMass, fMSigma);
93  cptr->resetKinematicFit();
94  if ((mFitSel->getMassMax() >= 0) && (!mFitSel->accept(*cptr)))
95  continue;
96  const RefCountedKinematicVertex tdv = cptr->topDecayVertex();
97  if ((kfChi2Sel->getProbMin() >= 0) && !kfChi2Sel->accept(*cptr))
98  continue;
99  dMap[cand->getComp(rName).get()] = ctmp->getComp(rName).get();
100  dMap[cand->getComp(fName).get()] = ctmp->getComp(fName).get();
101  recList.push_back(cand);
102  }
103  updated = true;
104  return recList;
105 }
106 
109  updated = false;
110  flySel->setMassMin(m);
111  return;
112 }
113 
115  updated = false;
116  flySel->setMassMax(m);
117  return;
118 }
119 
120 void BPHDecayToResFlyingBuilder::setFlyingMassRange(double mMin, double mMax) {
121  updated = false;
122  flySel->setMassMin(mMin);
123  flySel->setMassMax(mMax);
124  return;
125 }
126 
128  updated = false;
130 }
BPHKinFitChi2Select::setProbMin
void setProbMin(double p)
set prob min
Definition: BPHKinFitChi2Select.h:65
BPHMassCuts::setMassMax
void setMassMax(double m)
Definition: BPHMassCuts.h:52
BPHDecayToResFlyingBuilder::flySel
BPHMassFitSelect * flySel
Definition: BPHDecayToResFlyingBuilder.h:87
BPHKinFitChi2Select
Definition: BPHKinFitChi2Select.h:31
BPHRecoBuilder::filter
void filter(const std::string &name, const BPHRecoSelect &sel) const
BPHDecayToResFlyingBuilder::setFlyingMassMax
void setFlyingMassMax(double m)
Definition: BPHDecayToResFlyingBuilder.cc:114
BPHDecayToResFlyingBuilder::fCollection
const std::vector< BPHPlusMinusConstCandPtr > * fCollection
Definition: BPHDecayToResFlyingBuilder.h:85
BPHDecayConstrainedBuilder
Definition: BPHDecayConstrainedBuilder.h:37
ReferenceCountingPointer< KinematicVertex >
BPHDecayGenericBuilder::massSel
BPHMassSelect * massSel
Definition: BPHDecayGenericBuilder.h:75
BPHDecayConstrainedBuilder::resoSel
BPHMassSelect * resoSel
Definition: BPHDecayConstrainedBuilder.h:75
BPHDecayConstrainedBuilder::rCollection
const std::vector< BPHPlusMinusConstCandPtr > * rCollection
Definition: BPHDecayConstrainedBuilder.h:73
MainPageGenerator.fName
fName
Definition: MainPageGenerator.py:301
BPHDecayToResFlyingBuilder::setFlyingMassMin
void setFlyingMassMin(double m)
set cuts
Definition: BPHDecayToResFlyingBuilder.cc:108
BPHDecayGenericBuilder::updated
bool updated
Definition: BPHDecayGenericBuilder.h:80
BPHDecayToResFlyingBuilder::fMass
double fMass
Definition: BPHDecayToResFlyingBuilder.h:82
BPHRecoBuilder
Definition: BPHRecoBuilder.h:50
visualization-live-secondInstance_cfg.m
m
Definition: visualization-live-secondInstance_cfg.py:79
BPHRecoBuilder::setMinPDiffererence
void setMinPDiffererence(double pMin)
Definition: BPHRecoBuilder.cc:172
BPHDecayToResFlyingBuilder::BPHDecayToResFlyingBuilder
BPHDecayToResFlyingBuilder(const edm::EventSetup &es, const std::string &resName, double resMass, double resWidth, const std::vector< BPHPlusMinusConstCandPtr > &resCollection, const std::string &flyName, double flyMass, double flyMSigma, const std::vector< BPHPlusMinusConstCandPtr > &flyCollection)
Definition: BPHDecayToResFlyingBuilder.cc:32
BPHMassCuts::setMassMin
void setMassMin(double m)
set mass cuts
Definition: BPHMassCuts.h:48
BPHDecayGenericBuilder::evSetup
const edm::EventSetup * evSetup
Definition: BPHDecayGenericBuilder.h:73
BPHKinFitChi2Select::accept
bool accept(const BPHKinematicFit &cand) const override
select vertex
Definition: BPHKinFitChi2Select.h:48
BPHDecayToResFlyingBuilder::setKinFitProbMin
void setKinFitProbMin(double p)
Definition: BPHDecayToResFlyingBuilder.cc:127
BPHDecayToResFlyingBuilder::fName
std::string fName
Definition: BPHDecayToResFlyingBuilder.h:81
BPHKinFitChi2Select::getProbMin
double getProbMin() const
get current prob min
Definition: BPHKinFitChi2Select.h:71
AlCaHLTBitMon_ParallelJobs.p
def p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
BPHKinematicFit::topDecayVertex
virtual const RefCountedKinematicVertex topDecayVertex() const
Definition: BPHKinematicFit.cc:290
BPHDecayToResFlyingBuilder::kfChi2Sel
BPHKinFitChi2Select * kfChi2Sel
Definition: BPHDecayToResFlyingBuilder.h:88
BPHDecayToResFlyingBuilder.h
BPHDecayGenericBuilder::minPDiff
double minPDiff
Definition: BPHDecayGenericBuilder.h:79
BPHDecayToResFlyingBuilder::build
std::vector< BPHRecoConstCandPtr > build()
build candidates
Definition: BPHDecayToResFlyingBuilder.cc:60
BPHDecayGenericBuilder::mFitSel
BPHMassFitSelect * mFitSel
Definition: BPHDecayGenericBuilder.h:77
cand
Definition: decayParser.h:32
BPHMassCuts::getMassMax
double getMassMax() const
Definition: BPHMassCuts.h:59
BPHDecayToResFlyingBuilder::dMap
std::map< const BPHRecoCandidate *, const BPHRecoCandidate * > dMap
Definition: BPHDecayToResFlyingBuilder.h:90
edm::EventSetup
Definition: EventSetup.h:58
BPHRecoBuilder.h
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
std
Definition: JetResolutionObject.h:76
BPHPlusMinusCandidate.h
BPHDecayConstrainedBuilder::rName
std::string rName
Definition: BPHDecayConstrainedBuilder.h:69
BPHRecoCandidate::build
static std::vector< BPHRecoConstCandPtr > build(const BPHRecoBuilder &builder, double mass=-1, double msig=-1)
Definition: BPHRecoCandidate.cc:43
BPHRecoCandidate.h
BPHDecayToResFlyingBuilder::~BPHDecayToResFlyingBuilder
~BPHDecayToResFlyingBuilder() override
Definition: BPHDecayToResFlyingBuilder.cc:52
BPHDecayToResFlyingBuilder::recList
std::vector< BPHRecoConstCandPtr > recList
Definition: BPHDecayToResFlyingBuilder.h:91
BPHKinematicFit::resetKinematicFit
virtual void resetKinematicFit() const
reset the kinematic fit
Definition: BPHKinematicFit.cc:250
BPHRecoCandidate::clone
virtual BPHRecoCandidate * clone(int level=-1) const
Definition: BPHRecoCandidate.cc:53
BPHRecoBuilder::add
void add(const std::string &name, const BPHGenericCollection *collection, double mass=-1.0, double msig=-1.0)
BPHDecayToResFlyingBuilder::setFlyingMassRange
void setFlyingMassRange(double mMin, double mMax)
Definition: BPHDecayToResFlyingBuilder.cc:120
BPHRecoCandidate
Definition: BPHRecoCandidate.h:46
BPHDecayToResFlyingBuilder::fMSigma
double fMSigma
Definition: BPHDecayToResFlyingBuilder.h:83
BPHMassFitSelect::accept
bool accept(const BPHKinematicFit &cand) const override
select particle
Definition: BPHMassFitSelect.h:71
BPHKinematicFit::setIndependentFit
void setIndependentFit(const std::string &name, bool flag=true, double mass=-1.0, double sigma=-1.0)
set a decaying daughter as an unique particle fitted independently
Definition: BPHKinematicFit.cc:104
BPHRecoConstCandPtr
BPHGenericPtr< const BPHRecoCandidate >::type BPHRecoConstCandPtr
Definition: BPHRecoCandidatePtr.h:9
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
BPHMassFitSelect
Definition: BPHMassFitSelect.h:34