62 map<const reco::Candidate*,const reco::Candidate*> iMap;
63 const vector<const reco::Candidate*>& daug =
daughters();
67 for ( i = 0; i <
n; ++
i ) {
71 for ( i = 0; i <
n; ++
i ) {
75 const vector<BPHRecoConstCandPtr>& dComp =
daughComp();
78 for ( j = 0; j <
m; ++j ) {
79 const map<const reco::Candidate*,double>&
dMap = dComp[j]->dMSig;
80 dMSig.insert( dMap.begin(), dMap.end() );
119 const vector<string>&
names )
const {
121 const vector<const reco::Candidate*>& daugs =
daughFull();
122 vector<RefCountedKinematicParticle> plist;
123 if (
allParticles.size() != daugs.size() )
return plist;
124 set<RefCountedKinematicParticle>
pset;
126 int n = names.size();
127 int m = daugs.size();
129 for ( i = 0; i <
n; ++
i ) {
130 const string&
pname = names[
i];
131 if ( pname ==
"*" ) {
135 if ( pset.find( kp ) != pset.end() )
continue;
136 plist.push_back( kp );
144 map<
const reco::Candidate*,
146 if ( iter != iend ) {
148 if ( pset.find( kp ) != pset.end() )
continue;
149 plist.push_back( kp );
154 <<
"BPHKinematicFit::kinParticles: " 155 << pname <<
" not found";
170 double mass,
double sigma )
const {
180 double mass )
const {
206 vector<RefCountedKinematicParticle> kComp;
207 vector<RefCountedKinematicParticle> kTail;
210 if ( comp ==
nullptr ) {
212 <<
"BPHKinematicFit::kinematicTree: " 213 <<
name <<
" daughter not found";
218 int nn = ns = names.size();
219 vector<string> nfull( nn + 1 );
221 while ( nn-- ) nfull[
nn] =
name +
"/" + names[
nn];
222 vector<RefCountedKinematicParticle> kPart =
kinParticles( nfull );
223 vector<RefCountedKinematicParticle>::const_iterator iter = kPart.begin();
224 vector<RefCountedKinematicParticle>::const_iterator imid = iter + ns;
225 vector<RefCountedKinematicParticle>::const_iterator iend = kPart.end();
226 kComp.insert( kComp.end(), iter, imid );
227 kTail.insert( kTail.end(), imid, iend );
235 if ( compTree->isEmpty() )
return kinTree;
237 compTree = kinFitter.
fit( kc, compTree );
238 if ( compTree->isEmpty() )
return kinTree;
239 compTree->movePointerToTheTop();
240 if ( !kTail.empty() ) {
242 if ( !compPart->currentState().isValid() )
return kinTree;
243 kTail.push_back( compPart );
252 <<
"BPHKinematicFit::kinematicTree: " 267 vector<string> nfull;
270 if ( comp ==
nullptr ) {
272 <<
"BPHKinematicFit::kinematicTree: " 273 <<
name <<
" daughter not found";
277 int nn = names.size();
278 nfull.resize( nn + 1 );
280 while ( nn-- ) nfull[
nn] =
name +
"/" + names[
nn];
283 nfull.push_back(
"*" );
291 <<
"BPHKinematicFit::kinematicTree: " 314 if ( kPart.get() ==
nullptr )
return false;
315 return kPart->currentState().isValid();
321 return kinTree->currentParticle();
327 return kinTree->currentDecayVertex();
333 if ( kPart.get() ==
nullptr )
return -1.0;
348 double mass,
double sigma ) {
356 const string& searchList,
357 double mass,
double sigma ) {
367 const map<const reco::Candidate*,double>&
dMap = comp->dMSig;
368 dMSig.insert( dMap.begin(), dMap.end() );
383 const vector<const reco::Candidate*>& daug =
daughFull();
392 float sigma =
dMSig.find( cand )->second;
393 if ( sigma < 0 ) sigma = 1.0e-7;
397 mass, chi, ndf, sigma ) );
411 double m = ks.
mass();
412 double e =
sqrt( ( x * x ) + ( y * y ) + ( z * z ) + ( m * m ) );
417 <<
"BPHKinematicFit::fitMomentum: " 418 <<
"simple momentum sum computed";
420 const vector<const reco::Candidate*>& daug =
daughters();
422 while ( n-- ) tm += daug[
n]->p4();
425 while ( m-- ) tm += comp[
m]->p4();
const reco::Candidate * cand
virtual const math::XYZTLorentzVector & p4() const
compute total momentum after the fit
RefCountedKinematicTree fit(const std::vector< RefCountedKinematicParticle > &part)
virtual void buildParticles() const
virtual void addK(const std::string &name, const reco::Candidate *daug, double mass=-1.0, double sigma=-1.0)
BPHGenericPtr< const BPHRecoCandidate >::type BPHRecoConstCandPtr
reco::TransientTrack * getTransientTrack(const reco::Candidate *cand) const
get TransientTrack for a daughter
virtual bool isEmpty() const
GlobalVector globalMomentum() const
virtual ParticleMass mass() const
virtual const std::vector< const reco::Candidate * > & daughters() const
const std::string names[nVars_]
virtual const RefCountedKinematicParticle currentParticle() const
std::vector< RefCountedKinematicTree > fit(KinematicConstraint *cs, const std::vector< RefCountedKinematicTree > &trees) const
std::map< const reco::Candidate *, double > dMSig
ParticleMass mass() const
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
double constrSigma() const
std::map< const reco::Candidate *, RefCountedKinematicParticle > kinMap
double constrMass() const
retrieve the constraint
virtual void fitMomentum() const
virtual const RefCountedKinematicTree & kinematicTree() const
perform the kinematic fit and get the result
virtual void addV(const std::string &name, const reco::Candidate *daug, const std::string &searchList, double mass)
virtual const RefCountedKinematicVertex currentDecayVertex() const
virtual const std::vector< RefCountedKinematicParticle > & kinParticles() const
get kinematic particles
void setNotUpdated() const override
const std::vector< Component > & componentList() const
RefCountedKinematicTree fit(const std::vector< RefCountedKinematicParticle > &particles) const
virtual const reco::Candidate * originalReco(const reco::Candidate *daug) const
get the original particle from the clone
void setNotUpdated() const override
virtual void resetKinematicFit() const
reset the kinematic fit
ReferenceCountingPointer< KinematicVertex > RefCountedKinematicVertex
ReferenceCountingPointer< KinematicTree > RefCountedKinematicTree
std::vector< RefCountedKinematicParticle > allParticles
virtual bool isValidFit() const
RefCountedKinematicTree kinTree
virtual double mass() const =0
mass
std::map< std::string, const reco::Candidate * > dMap
ReferenceCountingPointer< KinematicParticle > RefCountedKinematicParticle
virtual BPHRecoConstCandPtr getComp(const std::string &name) const
virtual const std::vector< BPHRecoConstCandPtr > & daughComp() const
virtual const std::vector< const reco::Candidate * > & daughFull() const
RefCountedKinematicParticle particle(const reco::TransientTrack &initialTrack, const ParticleMass &massGuess, float chiSquared, float degreesOfFr, float &m_sigma) const
void setConstraint(double mass, double sigma)
apply a mass constraint
math::XYZTLorentzVector totalMomentum
virtual const std::vector< std::string > & daugNames() const
virtual const reco::Candidate * getDaug(const std::string &name) const
~BPHKinematicFit() override
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger list("!*","!HLTx*"if it matches 2 triggers or more) will accept the event if all the matching triggers are FAIL.It will reject the event if any of the triggers are PASS or EXCEPTION(this matches the behavior of"!*"before the partial wildcard feature was incorporated).Triggers which are in the READY state are completely ignored.(READY should never be returned since the trigger paths have been run