CMS 3D CMS Logo

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=0) const override
 
 BPHFittedBasicSelect (float massMin, float massMax, float ptMin=-1.0, float etaMax=-1.0, float rapidityMax=-1.0)
 
- Public Member Functions inherited from BPHHistoSpecificDecay::CandidateSelect
virtual ~CandidateSelect ()
 

Private Attributes

float eMax
 
float mMax
 
float mMin
 
float pMin
 
float rMax
 

Detailed Description

Definition at line 196 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

Member Function Documentation

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

Implements BPHHistoSpecificDecay::CandidateSelect.

Definition at line 200 of file BPHHistoSpecificDecay.cc.

References MillePedeFileConverter_cfg::e, cosmicPhotonAnalyzer_cfi::eMax, PV3DBase< T, VectorTag, FrameTag >::eta(), pat::PATObject< ObjectType >::hasUserFloat(), dqm-mbProfile::log, EgHLTOffHistBins_cfi::mass, ALCARECOTkAlMinBias_cff::pMin, alignCSCRings::r, photonAnalyzer_cfi::rMax, mathSSE::sqrt(), PV3DBase< T, VectorTag, FrameTag >::transverse(), pat::PATObject< ObjectType >::userFloat(), PV3DBase< T, VectorTag, FrameTag >::x(), PV3DBase< T, VectorTag, FrameTag >::y(), and PV3DBase< T, VectorTag, FrameTag >::z().

Referenced by Vispa.Gui.BoxContentDialog.BoxContentDialog::apply(), Vispa.Plugins.ConfigEditor.ToolDialog.ToolDialog::apply(), and esMonitoring.FDJsonServer::handle_accept().

200  {
201  if (!cand.hasUserFloat("fitMass"))
202  return false;
203  float mass = cand.userFloat("fitMass");
204  if (((mMin > 0) && (mMax < 0)) || ((mMin < 0) && (mMax > 0)) || ((mMin > 0) && (mMax > 0) && (mMin < mMax))) {
205  if (mass < mMin)
206  return false;
207  if ((mMax > 0) && (mass > mMax))
208  return false;
209  }
210  const Vector3DBase<float, GlobalTag>* fmom = BPHUserData::get<Vector3DBase<float, GlobalTag> >(cand, "fitMomentum");
211  if (fmom == nullptr)
212  return false;
213  if (pMin > 0) {
214  if (fmom->transverse() < pMin)
215  return false;
216  }
217  if (eMax > 0) {
218  if (fabs(fmom->eta()) > eMax)
219  return false;
220  }
221  if (rMax > 0) {
222  float x = fmom->x();
223  float y = fmom->y();
224  float z = fmom->z();
225  float e = sqrt((x * x) + (y * y) + (z * z) + (mass * mass));
226  float r = log((e + z) / (e - z)) / 2;
227  if (fabs(r) > rMax)
228  return false;
229  }
230  return true;
231  }
bool hasUserFloat(const std::string &key) const
Return true if there is a user-defined float with a given name.
Definition: PATObject.h:378
float userFloat(const std::string &key) const
Definition: PATObject.h:876
T sqrt(T t)
Definition: SSEVec.h:19

Member Data Documentation

float BPHFittedBasicSelect::eMax
private

Definition at line 237 of file BPHHistoSpecificDecay.cc.

float BPHFittedBasicSelect::mMax
private

Definition at line 235 of file BPHHistoSpecificDecay.cc.

float BPHFittedBasicSelect::mMin
private

Definition at line 234 of file BPHHistoSpecificDecay.cc.

float BPHFittedBasicSelect::pMin
private

Definition at line 236 of file BPHHistoSpecificDecay.cc.

float BPHFittedBasicSelect::rMax
private

Definition at line 238 of file BPHHistoSpecificDecay.cc.