5 TProfile *
p1 = (TProfile*) th2->ProfileX();
9 throw cms::Exception(
"MultiTrackValidator") <<
"Different number of bins!";
14 for (
unsigned int j=0;
j<vec.size();
j++){
24 for (
unsigned int j=0;
j<numerator.size();
j++){
25 if (denominator[
j]!=0){
27 value = ((double) numerator[
j])*1./((double) denominator[j]);
28 err =
sqrt( value*(1-value)/(
double) denominator[j] );
29 }
else if (type==
"fakerate"){
30 value = 1-((double) numerator[
j])*1./((double) denominator[j]);
31 err =
sqrt( value*(1-value)/(
double) denominator[j] );
32 }
else if (type==
"pileup"){
33 value = ((double) numerator[
j])*1./((double) denominator[j]);
34 err =
sqrt( value*(1+value)/(
double) denominator[j] );
50 assert(h->
getNbinsX()==numerator->GetNbinsX());
51 assert(h->
getNbinsX()==denominator->GetNbinsX());
54 if (denominator->GetBinContent(
bin)!=0) {
56 value = ((double) numerator->GetBinContent(
bin))/((
double) denominator->GetBinContent(
bin));
57 err =
sqrt( value*(1.-value)/((
double) denominator->GetBinContent(
bin)) );
58 }
else if (type==
"fakerate"){
59 value = 1.-((double) numerator->GetBinContent(
bin))/((
double) denominator->GetBinContent(
bin));
60 err =
sqrt( value*(1.-value)/(
double)denominator->GetBinContent(
bin) );
61 }
else if (type==
"pileup"){
62 value = ((double) numerator->GetBinContent(
bin))/((
double) denominator->GetBinContent(
bin));
63 err =
sqrt( value*(1.+value)/(
double) denominator->GetBinContent(
bin) );
72 TAxis *axis = h->GetXaxis();
73 int bins = axis->GetNbins();
75 float from = axis->GetXmin();
76 float to = axis->GetXmax();
77 float width = (to - from) / bins;
78 float *new_bins =
new float[bins + 1];
80 for (
int i = 0;
i <= bins;
i++) {
81 new_bins[
i] = TMath::Power(10, from +
i * width);
84 axis->Set(bins, new_bins);
void setBinContent(int binx, double content)
set content of bin (1-D)
void fillPlotFromVectors(MonitorElement *h, std::vector< int > &numerator, std::vector< int > &denominator, std::string type)
void doProfileX(TH2 *th2, MonitorElement *me)
void fillPlotFromVector(MonitorElement *h, std::vector< int > &vec)
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
void setBinError(int binx, double error)
set uncertainty on content of bin (1-D)
void fillPlotFromPlots(MonitorElement *h, TH1 *numerator, TH1 *denominator, std::string type)
TProfile * getTProfile(void) const
int getNbinsX(void) const
get # of bins in X-axis