127 {
131 int nbinsx =
hist->GetNbinsX();
133
136
137 for (
rnd[0] = 0;
rnd[0] < 0.9999;
rnd[0] += 0.25) {
140 }
141
142 TH1 *hist_val = nullptr;
143 if (histfine)
144 hist_val = (TH1 *)histfine->Clone(TString(
hist->GetName()) +
"hist_val");
145 else
146 hist_val = (TH1 *)
hist->Clone(TString(
hist->GetName()) +
"hist_val");
147 double weightfine = hist_val->Integral() / nrnd;
148 hist_val->SetTitle("toy simulation");
149 hist_val->Reset();
150 hist_val->SetLineColor(2);
151 hist_val->Sumw2();
152
153 TH1 *hist_diff = (TH1 *)
hist->Clone(TString(
hist->GetName()) +
"_difference");
154 hist_diff->SetTitle("cut efficiency difference");
155 hist_diff->Reset();
156 hist_diff->Sumw2();
157
159 for (
int i = 0;
i < nrnd; ++
i) {
160 rnd[0] = gRandom->Rndm();
162 hist_val->Fill(value[0], weightfine);
163 hist_diff->Fill(value[0], weight);
164 }
165 hist_diff->Add(hist, -1);
167
169 new TH1F(TString(
hist->GetName()) +
"_pull",
"pull", 200, -10, 10);
170 for (int ix = 1; ix <= nbinsx; ++ix) {
171 float val = hist_diff->GetBinContent(ix);
172 float err = hist_diff->GetBinError(ix);
173 if (err > 0)
174 hist_pull->Fill(val / err);
175 }
176
177
178
179#if defined(__FastCaloSimStandAlone__)
180 TCanvas *
c =
new TCanvas(
hist->GetName(),
hist->GetName());
182
184 if (histfine) {
185 histfine->SetLineColor(kGray);
186 histfine->DrawClone("hist");
187 hist->DrawClone(
"same");
188 } else {
190 }
191 hist_val->DrawClone("sameshist");
192
194 if (histfine) {
195 histfine->SetLineColor(kGray);
196 histfine->DrawClone("hist");
197 hist->DrawClone(
"same");
198 } else {
200 }
201 hist_val->DrawClone("sameshist");
202 gPad->SetLogy();
203
205 hist_diff->Draw();
206
208 hist_pull->Draw();
209
211#endif
212}
#define ATH_MSG_NOCLASS(logger_name, x)
virtual void rnd_to_fct(float value[], const float rnd[]) const
Function gets array of random numbers rnd[] in the range [0,1) as arguments and returns function valu...
virtual std::size_t MemorySize() const
Gives the total memory size, including the size of additional memory allocated inside the class.
static Root::TMsgLogger logger("iLumiCalc")
TH1F(name, title, nxbins, bins_par2, bins_par3=None, path='', **kwargs)