71 if(
data.IsA()->InheritsFrom(
"TH1" )) {
72 h =
static_cast<const TH1*
>(&
data);
73 if (
h->GetDimension() > 1 ) {
74 throw dqm_core::BadConfig( ERS_HERE,
name,
"Not SCT Time Bins: Hist. Dimension > 1 " );
76 if (
h->GetNbinsX() != 8) {
77 throw dqm_core::BadConfig( ERS_HERE,
name,
"Not SCT Time Bins: Hist. NBins != 8 " );
80 throw dqm_core::BadConfig( ERS_HERE,
name,
"does not inherit from TH1");
89 double EarlyHits = 0.;
90 double InTimeHits = 0.;
92 double AllEntries = 0.;
96 TBin =
h->GetBinContent(0+1);
99 TBin =
h->GetBinContent(1+1);
103 TBin =
h->GetBinContent(2+1);
108 TBin =
h->GetBinContent(3+1);
110 InTimeHits += TBin/2;
114 TBin =
h->GetBinContent(4+1);
118 TBin =
h->GetBinContent(5+1);
121 TBin =
h->GetBinContent(6+1);
123 InTimeHits += TBin/2;
126 TBin =
h->GetBinContent(7+1);
132 if (Hits010 + Hits011 > 0.) {
133 double HitBin_ratio = Hits010 / (Hits010 + Hits011);
134 std::string HitBin_ratio_name = Form(
"%s_Ratio_010_over_01X",
name.c_str());
135 result->tags_[HitBin_ratio_name.c_str()] = HitBin_ratio;
138 if (AllEntries > 0.) {
139 double Edge0_ratio = Hits010 / AllEntries;
140 std::string Edge0_name = Form(
"%s_Ratio_010_over_XXX",
name.c_str());
141 result->tags_[Edge0_name.c_str()] = Edge0_ratio;
144 if (AllEntries > 0.) {
145 double Edge1_ratio = Hits011 / AllEntries;
146 std::string Edge1_name = Form(
"%s_Ratio_011_over_XXX",
name.c_str());
147 result->tags_[Edge1_name.c_str()] = Edge1_ratio;
150 if (AllEntries > 0.) {
151 double EdgeX_ratio = (Hits010 + Hits011) / AllEntries;
152 std::string EdgeX_name = Form(
"%s_Ratio_01X_over_XXX",
name.c_str());
153 result->tags_[EdgeX_name.c_str()] = EdgeX_ratio;
156 if (LateHits + InTimeHits + EarlyHits > 0.) {
157 double HitMean_time = (LateHits - EarlyHits) / (LateHits + InTimeHits + EarlyHits);
158 std::string HitMean_name = Form(
"%s_MeanHitTimeBC",
name.c_str());
159 result->tags_[HitMean_name.c_str()] = HitMean_time;
161 double HitWidth_time = (LateHits + EarlyHits) / (LateHits + InTimeHits + EarlyHits);
162 HitWidth_time = std::sqrt(HitWidth_time - HitMean_time*HitMean_time);
163 std::string HitWidth_name = Form(
"%s_VarianceHitTimeBC",
name.c_str());
164 result->tags_[HitWidth_name.c_str()] = HitWidth_time;