CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Static Protected Member Functions | Protected Attributes | Private Member Functions | Friends
PPSAssociationCuts::CutsPerArm Class Reference

#include <PPSAssociationCuts.h>

Public Types

enum  Quantities { qX, qY, qXi, qThetaY }
 

Public Member Functions

void buildFunctions ()
 
 CutsPerArm ()
 
 CutsPerArm (const edm::ParameterSet &iConfig, int sector)
 
const std::vector< std::string > & getMeans () const
 
const std::vector< std::string > & getThresholds () const
 
double getTiTrMax () const
 
double getTiTrMin () const
 
bool isApplied (Quantities quantity) const
 
bool isSatisfied (Quantities quantity, double x_near, double y_near, double xangle, double q_NF_diff) const
 
 ~CutsPerArm ()
 

Static Protected Member Functions

static double evaluateExpression (std::shared_ptr< TF1 > expression, double x_near, double y_near, double xangle)
 

Protected Attributes

std::vector< std::shared_ptr< TF1 > > f_means_
 
std::vector< std::shared_ptr< TF1 > > f_thresholds_
 
std::vector< std::string > s_means_
 
std::vector< std::string > s_thresholds_
 
double ti_tr_max_
 
double ti_tr_min_
 

Private Member Functions

template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 

Friends

class boost::serialization::access
 
template<typename CondSerializationT , typename Enabled >
struct cond::serialization::access
 

Detailed Description

Definition at line 24 of file PPSAssociationCuts.h.

Member Enumeration Documentation

◆ Quantities

Constructor & Destructor Documentation

◆ CutsPerArm() [1/2]

PPSAssociationCuts::CutsPerArm::CutsPerArm ( )
inline

Definition at line 28 of file PPSAssociationCuts.h.

28 {}

◆ CutsPerArm() [2/2]

PPSAssociationCuts::CutsPerArm::CutsPerArm ( const edm::ParameterSet iConfig,
int  sector 
)

Definition at line 16 of file PPSAssociationCuts.cc.

References edm::ParameterSet::getParameterSet(), mps_fire::i, SiStripPI::mean, names, s_means_, s_thresholds_, nano_mu_digi_cff::sector, AlCaHLTBitMon_QueryRunRegistry::string, DiMuonV_cfg::threshold, ti_tr_max_, ti_tr_min_, and to_string().

16  {
17  const auto &association_cuts = iConfig.getParameterSet("association_cuts_" + std::to_string(sector));
18 
19  const std::vector<std::string> names{"x", "y", "xi", "th_y"};
20  for (std::size_t i = 0; i < names.size(); ++i) {
21  std::string mean = association_cuts.getParameter<std::string>(names[i] + "_cut_mean");
22  s_means_.push_back(mean);
23 
24  std::string threshold = association_cuts.getParameter<std::string>(names[i] + "_cut_threshold");
25  s_thresholds_.push_back(threshold);
26  }
27 
28  ti_tr_min_ = association_cuts.getParameter<double>("ti_tr_min");
29  ti_tr_max_ = association_cuts.getParameter<double>("ti_tr_max");
30 }
ParameterSet const & getParameterSet(std::string const &) const
const std::string names[nVars_]
static std::string to_string(const XMLCh *ch)
std::vector< std::string > s_thresholds_
std::vector< std::string > s_means_

◆ ~CutsPerArm()

PPSAssociationCuts::CutsPerArm::~CutsPerArm ( )
inline

Definition at line 32 of file PPSAssociationCuts.h.

32 {}

Member Function Documentation

◆ buildFunctions()

void PPSAssociationCuts::CutsPerArm::buildFunctions ( )

Definition at line 34 of file PPSAssociationCuts.cc.

References alignCSCRings::s.

34  {
35  f_means_.clear();
36  for (const auto &s : s_means_)
37  f_means_.push_back(std::make_shared<TF1>("f", s.c_str()));
38 
39  f_thresholds_.clear();
40  for (const auto &s : s_thresholds_)
41  f_thresholds_.push_back(std::make_shared<TF1>("f", s.c_str()));
42 }
std::vector< std::string > s_thresholds_
std::vector< std::shared_ptr< TF1 > > f_means_
std::vector< std::shared_ptr< TF1 > > f_thresholds_
std::vector< std::string > s_means_

◆ evaluateExpression()

double PPSAssociationCuts::CutsPerArm::evaluateExpression ( std::shared_ptr< TF1 >  expression,
double  x_near,
double  y_near,
double  xangle 
)
staticprotected

Definition at line 68 of file PPSAssociationCuts.cc.

References l1tGTMenu_hadr_metSeeds_cff::expression, and profile_base_cff::xangle.

71  {
72  expression->SetParameter("x_near", x_near);
73  expression->SetParameter("y_near", y_near);
74  expression->SetParameter("xangle", xangle);
75  return expression->EvalPar(nullptr);
76 }

◆ getMeans()

const std::vector<std::string>& PPSAssociationCuts::CutsPerArm::getMeans ( ) const
inline

Definition at line 34 of file PPSAssociationCuts.h.

References s_means_.

Referenced by operator<<().

34 { return s_means_; }
std::vector< std::string > s_means_

◆ getThresholds()

const std::vector<std::string>& PPSAssociationCuts::CutsPerArm::getThresholds ( ) const
inline

Definition at line 35 of file PPSAssociationCuts.h.

References s_thresholds_.

Referenced by operator<<().

35 { return s_thresholds_; }
std::vector< std::string > s_thresholds_

◆ getTiTrMax()

double PPSAssociationCuts::CutsPerArm::getTiTrMax ( ) const
inline

Definition at line 38 of file PPSAssociationCuts.h.

References ti_tr_max_.

Referenced by operator<<().

◆ getTiTrMin()

double PPSAssociationCuts::CutsPerArm::getTiTrMin ( ) const
inline

Definition at line 37 of file PPSAssociationCuts.h.

References ti_tr_min_.

Referenced by operator<<().

◆ isApplied()

bool PPSAssociationCuts::CutsPerArm::isApplied ( Quantities  quantity) const

Definition at line 46 of file PPSAssociationCuts.cc.

References relativeConstraints::empty, and MjjMonitor_cfi::quantity.

46  {
47  return (!s_thresholds_[quantity].empty()) && (!s_means_[quantity].empty());
48 }
std::vector< std::string > s_thresholds_
std::vector< std::string > s_means_

◆ isSatisfied()

bool PPSAssociationCuts::CutsPerArm::isSatisfied ( Quantities  quantity,
double  x_near,
double  y_near,
double  xangle,
double  q_NF_diff 
) const

Definition at line 52 of file PPSAssociationCuts.cc.

References SiStripPI::mean, MjjMonitor_cfi::quantity, DiMuonV_cfg::threshold, and profile_base_cff::xangle.

53  {
54  // if cut not applied, then condition considered as satisfied
55  if (!isApplied(quantity))
56  return true;
57 
58  // evaluate mean and threshold
59  const double mean = evaluateExpression(f_means_[quantity], x_near, y_near, xangle);
60  const double threshold = evaluateExpression(f_thresholds_[quantity], x_near, y_near, xangle);
61 
62  // make comparison
63  return fabs(q_NF_diff - mean) < threshold;
64 }
bool isApplied(Quantities quantity) const
std::vector< std::shared_ptr< TF1 > > f_means_
static double evaluateExpression(std::shared_ptr< TF1 > expression, double x_near, double y_near, double xangle)
std::vector< std::shared_ptr< TF1 > > f_thresholds_

◆ serialize()

template<class Archive >
void PPSAssociationCuts::CutsPerArm::serialize ( Archive &  ar,
const unsigned int  version 
)
private

Friends And Related Function Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Definition at line 64 of file PPSAssociationCuts.h.

◆ cond::serialization::access

template<typename CondSerializationT , typename Enabled >
friend struct cond::serialization::access
friend

Definition at line 64 of file PPSAssociationCuts.h.

Member Data Documentation

◆ f_means_

std::vector<std::shared_ptr<TF1> > PPSAssociationCuts::CutsPerArm::f_means_
protected

Definition at line 55 of file PPSAssociationCuts.h.

◆ f_thresholds_

std::vector<std::shared_ptr<TF1> > PPSAssociationCuts::CutsPerArm::f_thresholds_
protected

Definition at line 56 of file PPSAssociationCuts.h.

◆ s_means_

std::vector<std::string> PPSAssociationCuts::CutsPerArm::s_means_
protected

Definition at line 51 of file PPSAssociationCuts.h.

Referenced by CutsPerArm(), and getMeans().

◆ s_thresholds_

std::vector<std::string> PPSAssociationCuts::CutsPerArm::s_thresholds_
protected

Definition at line 52 of file PPSAssociationCuts.h.

Referenced by CutsPerArm(), and getThresholds().

◆ ti_tr_max_

double PPSAssociationCuts::CutsPerArm::ti_tr_max_
protected

Definition at line 60 of file PPSAssociationCuts.h.

Referenced by CutsPerArm(), and getTiTrMax().

◆ ti_tr_min_

double PPSAssociationCuts::CutsPerArm::ti_tr_min_
protected

Definition at line 59 of file PPSAssociationCuts.h.

Referenced by CutsPerArm(), and getTiTrMin().