19 const std::vector<std::string>
names{
"x",
"y",
"xi",
"th_y"};
20 for (std::size_t
i = 0;
i <
names.size(); ++
i) {
28 ti_tr_min_ = association_cuts.getParameter<
double>(
"ti_tr_min");
29 ti_tr_max_ = association_cuts.getParameter<
double>(
"ti_tr_max");
36 for (
const auto &
s : s_means_)
37 f_means_.push_back(std::make_shared<TF1>(
"f",
s.c_str()));
39 f_thresholds_.clear();
40 for (
const auto &
s : s_thresholds_)
41 f_thresholds_.push_back(std::make_shared<TF1>(
"f",
s.c_str()));
47 return (!s_thresholds_[quantity].
empty()) && (!s_means_[quantity].empty());
53 Quantities quantity,
double x_near,
double y_near,
double xangle,
double q_NF_diff)
const {
55 if (!isApplied(quantity))
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);
63 return fabs(q_NF_diff - mean) <
threshold;
72 expression->SetParameter(
"x_near", x_near);
73 expression->SetParameter(
"y_near", y_near);
74 expression->SetParameter(
"xangle", xangle);
75 return expression->EvalPar(
nullptr);
82 for (
const int §or : {45, 56})
93 desc.
add<
std::string>(
"x_cut_mean",
"")->setComment(
"mean of track-association cut in x, mm");
94 desc.
add<
std::string>(
"x_cut_threshold",
"")->setComment(
"threshold of track-association cut in x, mm");
96 desc.
add<
std::string>(
"y_cut_mean",
"")->setComment(
"mean of track-association cut in y, mm");
97 desc.
add<
std::string>(
"y_cut_threshold",
"")->setComment(
"threshold of track-association cut in y, mm");
99 desc.
add<
std::string>(
"xi_cut_mean",
"")->setComment(
"mean of track-association cut in xi");
100 desc.
add<
std::string>(
"xi_cut_threshold",
"")->setComment(
"threshold of track-association cut in xi");
102 desc.
add<
std::string>(
"th_y_cut_mean",
"")->setComment(
"mean of track-association cut in th_y, rad");
103 desc.
add<
std::string>(
"th_y_cut_threshold",
"")->setComment(
"threshold of track-association cut in th_y, rad");
105 desc.
add<
double>(
"ti_tr_min", -1.)->
setComment(
"minimum value for timing-tracking association cut");
106 desc.
add<
double>(
"ti_tr_max", +1.)->
setComment(
"maximum value for timing-tracking association cut");
130 throw cms::Exception(
"PPS") <<
"Invalid structure of PPSAssociationCuts.";
133 p.second.buildFunctions();
139 os <<
"CutsPerArm {" << std::endl;
143 os <<
"\"" <<
value <<
"\", ";
145 os <<
"}" << std::endl << std::endl;
147 os <<
"\tthresholds {";
149 os <<
"\"" <<
value <<
"\", ";
151 os <<
"}" << std::endl << std::endl;
153 os <<
"\tti_tr_min " << cutsPerArm.
getTiTrMin() << std::endl;
154 os <<
"\tti_tr_max " << cutsPerArm.
getTiTrMax() << std::endl;
155 os <<
"}" << std::endl;
163 os <<
"PPSAssociationCuts {" << std::endl;
164 os <<
"45" << std::endl;
166 os <<
"56" << std::endl;
168 os <<
"}" << std::endl;
void setComment(std::string const &value)
const std::vector< std::string > & getThresholds() const
const std::vector< std::string > & getMeans() const
std::string to_string(const V &value)
std::ostream & operator<<(std::ostream &out, const ALILine &li)
const std::string names[nVars_]
std::map< unsigned int, CutsPerArm > association_cuts_
bool isSatisfied(Quantities quantity, double x_near, double y_near, double xangle, double q_NF_diff) const
bool isApplied(Quantities quantity) const
double getTiTrMax() const
std::vector< std::string > s_thresholds_
ParameterDescriptionBase * add(U const &iLabel, T const &value)
ParameterSet const & getParameterSet(std::string const &) const
static double evaluateExpression(std::shared_ptr< TF1 > expression, double x_near, double y_near, double xangle)
const CutsPerArm & getAssociationCuts(const int sector) const
double getTiTrMin() const
static edm::ParameterSetDescription getDefaultParameters()
std::vector< std::string > s_means_