125 {
129 int nbinsx =
hist->GetNbinsX();
131
134
135 for (
rnd[0] = 0;
rnd[0] < 0.9999;
rnd[0] += 0.25) {
138 }
139
140 TH1 *hist_val = nullptr;
141 if (histfine)
142 hist_val = (TH1 *)histfine->Clone(TString(
hist->GetName()) +
"hist_val");
143 else
144 hist_val = (TH1 *)
hist->Clone(TString(
hist->GetName()) +
"hist_val");
145 double weightfine = hist_val->Integral() / nrnd;
146 hist_val->SetTitle("toy simulation");
147 hist_val->Reset();
148 hist_val->SetLineColor(2);
149 hist_val->Sumw2();
150
151 TH1 *hist_diff = (TH1 *)
hist->Clone(TString(
hist->GetName()) +
"_difference");
152 hist_diff->SetTitle("cut efficiency difference");
153 hist_diff->Reset();
154 hist_diff->Sumw2();
155
157 for (
int i = 0;
i < nrnd; ++
i) {
158 rnd[0] = gRandom->Rndm();
160 hist_val->Fill(value[0], weightfine);
161 hist_diff->Fill(value[0], weight);
162 }
163 hist_diff->Add(hist, -1);
165
167 new TH1F(TString(
hist->GetName()) +
"_pull",
"pull", 200, -10, 10);
168 for (int ix = 1; ix <= nbinsx; ++ix) {
169 float val = hist_diff->GetBinContent(ix);
170 float err = hist_diff->GetBinError(ix);
171 if (err > 0)
172 hist_pull->Fill(val / err);
173 }
174
175
176
177#if defined(__FastCaloSimStandAlone__)
178 TCanvas *
c =
new TCanvas(
hist->GetName(),
hist->GetName());
180
182 if (histfine) {
183 histfine->SetLineColor(kGray);
184 histfine->DrawClone("hist");
185 hist->DrawClone(
"same");
186 } else {
188 }
189 hist_val->DrawClone("sameshist");
190
192 if (histfine) {
193 histfine->SetLineColor(kGray);
194 histfine->DrawClone("hist");
195 hist->DrawClone(
"same");
196 } else {
198 }
199 hist_val->DrawClone("sameshist");
200 gPad->SetLogy();
201
203 hist_diff->Draw();
204
206 hist_pull->Draw();
207
209#endif
210}
#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)