CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Private Attributes
BPHFittedBasicSelect Class Reference
Inheritance diagram for BPHFittedBasicSelect:
BPHHistoSpecificDecay::CandidateSelect

Public Member Functions

bool accept (const pat::CompositeCandidate &cand, const reco::Vertex *pv=nullptr) const override
 
 BPHFittedBasicSelect (float massMin, float massMax, float ptMin=-1.0, float etaMax=-1.0, float rapidityMax=-1.0)
 
 ~BPHFittedBasicSelect () override
 
- Public Member Functions inherited from BPHHistoSpecificDecay::CandidateSelect
virtual ~CandidateSelect ()
 

Private Attributes

float eMax
 
float mMax
 
float mMin
 
float pMin
 
float yMax
 

Detailed Description

Definition at line 270 of file BPHHistoSpecificDecay.cc.

Constructor & Destructor Documentation

BPHFittedBasicSelect::BPHFittedBasicSelect ( float  massMin,
float  massMax,
float  ptMin = -1.0,
float  etaMax = -1.0,
float  rapidityMax = -1.0 
)
inline
BPHFittedBasicSelect::~BPHFittedBasicSelect ( )
inlineoverride

Definition at line 274 of file BPHHistoSpecificDecay.cc.

274 {}

Member Function Documentation

bool BPHFittedBasicSelect::accept ( const pat::CompositeCandidate cand,
const reco::Vertex pv = nullptr 
) const
inlineoverridevirtual

Implements BPHHistoSpecificDecay::CandidateSelect.

Definition at line 275 of file BPHHistoSpecificDecay.cc.

References alignCSCRings::e, PV3DBase< T, VectorTag, FrameTag >::eta(), pat::PATObject< ObjectType >::hasUserFloat(), log, ResonanceBuilder::mass, HLT_FULL_cff::pMin, alignCSCRings::r, mathSSE::sqrt(), PV3DBase< T, VectorTag, FrameTag >::transverse(), pat::PATObject< ObjectType >::userFloat(), PV3DBase< T, VectorTag, FrameTag >::x(), PV3DBase< T, VectorTag, FrameTag >::y(), HLT_FULL_cff::yMax, and PV3DBase< T, VectorTag, FrameTag >::z().

Referenced by esMonitoring.FDJsonServer::handle_accept().

275  {
276  if (!cand.hasUserFloat("fitMass"))
277  return false;
278  float mass = cand.userFloat("fitMass");
279  if (((mMin > 0) && (mMax < 0)) || ((mMin < 0) && (mMax > 0)) || ((mMin > 0) && (mMax > 0) && (mMin < mMax))) {
280  if (mass < mMin)
281  return false;
282  if ((mMax > 0) && (mass > mMax))
283  return false;
284  }
285  const Vector3DBase<float, GlobalTag>* fmom = BPHUserData::get<Vector3DBase<float, GlobalTag>>(cand, "fitMomentum");
286  if (fmom == nullptr)
287  return false;
288  if (pMin > 0) {
289  if (fmom->transverse() < pMin)
290  return false;
291  }
292  if (eMax > 0) {
293  if (fabs(fmom->eta()) > eMax)
294  return false;
295  }
296  if (yMax > 0) {
297  float x = fmom->x();
298  float y = fmom->y();
299  float z = fmom->z();
300  float e = sqrt((x * x) + (y * y) + (z * z) + (mass * mass));
301  float r = log((e + z) / (e - z)) / 2;
302  if (fabs(r) > yMax)
303  return false;
304  }
305  return true;
306  }
static std::vector< std::string > checklist log
bool hasUserFloat(const std::string &key) const
Return true if there is a user-defined float with a given name.
Definition: PATObject.h:373
float userFloat(const std::string &key) const
Definition: PATObject.h:871
T sqrt(T t)
Definition: SSEVec.h:19

Member Data Documentation

float BPHFittedBasicSelect::eMax
private

Definition at line 312 of file BPHHistoSpecificDecay.cc.

float BPHFittedBasicSelect::mMax
private

Definition at line 310 of file BPHHistoSpecificDecay.cc.

float BPHFittedBasicSelect::mMin
private

Definition at line 309 of file BPHHistoSpecificDecay.cc.

float BPHFittedBasicSelect::pMin
private

Definition at line 311 of file BPHHistoSpecificDecay.cc.

float BPHFittedBasicSelect::yMax
private

Definition at line 313 of file BPHHistoSpecificDecay.cc.