1 #ifndef ALIGNMENT_OFFLINEVALIDATION_PVVALIDATIONHELPER_H
2 #define ALIGNMENT_OFFLINEVALIDATION_PVVALIDATIONHELPER_H
11 #ifndef PLOTTING_MACRO
13 #define COUT edm::LogWarning("PVValidationHelpers")
16 #define COUT std::cout << "PVValidationHelpers: "
21 namespace PVValHelper {
29 template <
typename T,
size_t N>
31 const T minLog10 = std::log10(min);
32 const T maxLog10 = std::log10(max);
33 const T width = (maxLog10 - minLog10) /
N;
34 std::array<T, N + 1>
ret;
37 for (
size_t i = 1;
i <=
N; ++
i) {
38 ret[
i] = ret[
i - 1] *
mult;
87 std::map<std::pair<residualType, plotVariable>, std::pair<float, float>>
range;
88 std::map<plotVariable, std::vector<float>>
trendbins;
92 range[std::make_pair(type, plot)] = std::make_pair(low, high);
96 if (
range.find(std::make_pair(type, plot)) !=
range.end()) {
97 return range[std::make_pair(type, plot)];
99 COUT <<
"Trying to get range for non-existent combination " << std::endl;
100 return std::make_pair(0., 0.);
105 if (
range.find(std::make_pair(type, plot)) !=
range.end()) {
106 return range[std::make_pair(type, plot)].first;
108 COUT <<
"Trying to get low end of range for non-existent combination " << std::endl;
114 if (
range.find(std::make_pair(type, plot)) !=
range.end()) {
115 return range[std::make_pair(type, plot)].second;
117 COUT <<
"Trying get high end of range for non-existent combination " << std::endl;
123 typedef std::tuple<std::string, std::string, std::string>
plotLabels;
127 void add(std::map<std::string, TH1*>&
h, TH1*
hist);
131 void fill(std::map<std::string, TH1*>&
h,
const std::string&
s,
double x,
double y);
Measurement1D getMedian(TH1F *histo)
tuple ret
prodAgent to be discontinued
void fillByIndex(std::vector< TH1F * > &h, unsigned int index, double x, std::string tag="")
std::pair< Measurement1D, Measurement1D > fitResiduals(TH1 *hist)
std::vector< float > generateBins(int n, float start, float range)
std::map< std::pair< residualType, plotVariable >, std::pair< float, float > > range
constexpr double max_eta_phase2
Measurement1D getMAD(TH1F *histo)
plotLabels getVarString(plotVariable var)
const uint16_t range(const Frame &aFrame)
std::map< plotVariable, std::vector< float > > trendbins
constexpr double max_eta_phase1
float getHigh(residualType type, plotVariable plot)
float getLow(residualType type, plotVariable plot)
list var
if using global norm cols_to_minmax = ['t_delta', 't_hmaxNearP','t_emaxNearP', 't_hAnnular', 't_eAnnular','t_pt','t_nVtx','t_ieta','t_eHcal10', 't_eHcal30','t_rhoh','t_eHcal'] df[cols_to_minmax] = df[cols_to_minmax].apply(lambda x: (x - x.min()) / (x.max() - x.min()) if (x.max() - x.min() > 0) else 1.0/200.0)
void setMap(residualType type, plotVariable plot, float low, float high)
void add(std::map< std::string, TH1 * > &h, TH1 *hist)
plotLabels getTypeString(residualType type)
void fill(std::map< std::string, TH1 * > &h, const std::string &s, double x)
void shrinkHistVectorToFit(std::vector< TH1F * > &h, unsigned int desired_size)
std::array< T, N+1 > makeLogBins(const T &min, const T &max)
constexpr double max_eta_phase0
std::pair< float, float > getRange(residualType type, plotVariable plot)
std::tuple< std::string, std::string, std::string > plotLabels
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Power< A, B >::type pow(const A &a, const B &b)