1 #ifndef ALIGNMENT_OFFLINEVALIDATION_PVVALIDATIONHELPER_H 2 #define ALIGNMENT_OFFLINEVALIDATION_PVVALIDATIONHELPER_H 18 template <
typename T,
size_t N>
20 const T minLog10 = std::log10(min);
21 const T maxLog10 = std::log10(max);
22 const T width = (maxLog10-minLog10)/
N;
23 std::array<T, N+1> ret;
26 for (
size_t i=1;
i<=
N; ++
i) {
27 ret[
i] = ret[
i-1]*mult;
76 std::map<std::pair<residualType,plotVariable>,std::pair<float,float>>
range;
77 std::map<plotVariable,std::vector<float> >
trendbins;
81 range[std::make_pair(type,plot)] = std::make_pair(low,high);
85 if (range.find(std::make_pair(type,plot)) != range.end()) {
86 return range[std::make_pair(type,plot)];
88 edm::LogWarning(
"PVValidationHelpers") <<
"Trying to get range for non-existent combination "<< std::endl;
89 return std::make_pair(0.,0.);
94 if (range.find(std::make_pair(type,plot)) != range.end()) {
95 return range[std::make_pair(type,plot)].first;
97 edm::LogWarning(
"PVValidationHelpers") <<
"Trying to get low end of range for non-existent combination "<< std::endl;
103 if (range.find(std::make_pair(type,plot)) != range.end()) {
104 return range[std::make_pair(type,plot)].second;
106 edm::LogWarning(
"PVValidationHelpers") <<
"Trying get high end of range for non-existent combination "<< std::endl;
112 typedef std::tuple<std::string,std::string,std::string>
plotLabels;
116 void add(std::map<std::string,TH1*>&
h, TH1*
hist);
120 void fill(std::map<std::string, TH1*>&
h,
const std::string&
s,
double x,
double y);
Measurement1D getMedian(TH1F *histo)
void fillByIndex(std::vector< TH1F * > &h, unsigned int index, double x, std::string tag="")
std::tuple< std::string, std::string, std::string > plotLabels
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
std::pair< Measurement1D, Measurement1D > fitResiduals(TH1 *hist)
std::vector< float > generateBins(int n, float start, float range)
Measurement1D getMAD(TH1F *histo)
plotLabels getVarString(plotVariable var)
float getHigh(residualType type, plotVariable plot)
float getLow(residualType type, plotVariable plot)
std::map< plotVariable, std::vector< float > > trendbins
std::array< T, N+1 > makeLogBins(const T min, const T max)
void setMap(residualType type, plotVariable plot, float low, float high)
std::map< std::pair< residualType, plotVariable >, std::pair< float, float > > range
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::pair< float, float > getRange(residualType type, plotVariable plot)
Power< A, B >::type pow(const A &a, const B &b)