9 #ifdef SI_PIXEL_TEMPLATE_STANDALONE
25 #define LOGDEBUG std::cout
26 #define LOGERROR std::cout
27 #define LOGINFO std::cout
37 #define LOGDEBUG LogDebug("")
38 #define LOGERROR edm::LogError("Error")
39 #define LOGINFO edm::LogInfo("Info")
66 double cotbetaBinWidth,
67 double cotbetaLowEdge,
69 double cotalphaBinWidth,
70 double cotalphaLowEdge,
74 : weOwnHistograms_(
true),
76 cotbetaBinWidth_(cotbetaBinWidth),
77 cotbetaLowEdge_(cotbetaLowEdge),
78 cotbetaBins_(cotbetaBins),
79 cotalphaBinWidth_(cotalphaBinWidth),
80 cotalphaLowEdge_(cotalphaLowEdge),
81 cotalphaBins_(cotalphaBins),
84 binningHisto_(nullptr),
85 resMultiPixelXHist_(),
86 resSinglePixelXHist_(),
87 resMultiPixelYHist_(),
88 resSinglePixelYHist_(),
93 resSinglePixelXGen_(),
95 resSinglePixelYGen_(),
97 file_ = std::make_unique<TFile>(
filename.c_str(),
"RECREATE");
113 cotbetaLowEdge + cotbetaBins * cotbetaBinWidth,
116 cotalphaLowEdge + cotalphaBins * cotalphaBinWidth);
134 "cotbeta %.1f-%.1f cotalpha %.2f-%.2f qbin %d npixel>1 X",
145 "cotbeta %.1f-%.1f cotalpha %.2f-%.2f qbin %d npixel>1 Y",
165 "cotbeta %.1f-%.1f cotalpha %.2f-%.2f npixel=1 X",
175 "cotbeta %.1f-%.1f cotalpha %.2f-%.2f npixel=1 Y",
185 "cotbeta %.1f-%.1f cotalpha %.2f-%.2f qbin",
210 : weOwnHistograms_(
false),
215 cotalphaBinWidth_(0),
220 binningHisto_(nullptr),
221 resMultiPixelXHist_(),
222 resSinglePixelXHist_(),
223 resMultiPixelYHist_(),
224 resSinglePixelYHist_(),
228 resMultiPixelXGen_(),
229 resSinglePixelXGen_(),
230 resMultiPixelYGen_(),
231 resSinglePixelYGen_(),
235 TH1F* tmphist =
nullptr;
241 LOGERROR <<
"PixelResolutionHistograms:: Error, file " <<
filename <<
" not found.";
249 LOGERROR <<
"PixelResolutionHistograms:: Error, binning histogrram ResHistoBinning not found.";
281 "cotbeta %.1f-%.1f cotalpha %.2f-%.2f qbin %d npixel>1 X",
288 tmphist = (TH1F*)
file_->Get(Form(
"%s%s", rootdir.c_str(),
histo));
296 if (tmphist->GetEntries() < 5) {
298 <<
" entries. Trouble ahead." << std::endl;
305 "cotbeta %.1f-%.1f cotalpha %.2f-%.2f qbin %d npixel>1 Y",
312 tmphist = (TH1F*)
file_->Get(Form(
"%s%s", rootdir.c_str(),
histo));
320 if (tmphist->GetEntries() < 5) {
322 <<
" entries. Trouble ahead." << std::endl;
342 "cotbeta %.1f-%.1f cotalpha %.2f-%.2f npixel=1 X",
348 tmphist = (TH1F*)
file_->Get(Form(
"%s%s", rootdir.c_str(),
histo));
350 if (!ignore_single) {
359 if (tmphist->GetEntries() < 5) {
361 <<
" entries. Trouble ahead." << std::endl;
371 "cotbeta %.1f-%.1f cotalpha %.2f-%.2f npixel=1 Y",
377 tmphist = (TH1F*)
file_->Get(Form(
"%s%s", rootdir.c_str(),
histo));
379 if (!ignore_single) {
387 if (tmphist->GetEntries() < 5) {
389 <<
" entries. Trouble ahead." << std::endl;
399 "cotbeta %.1f-%.1f cotalpha %.2f-%.2f qbin",
405 tmphist = (TH1F*)
file_->Get(Form(
"%s%s", rootdir.c_str(),
histo));
415 if (tmphist->GetEntries() < 5) {
417 <<
" entries. Trouble ahead." << std::endl;
442 LOGINFO <<
"PixelResHistoStore: Writing the histograms to the output file. "
474 double dx,
double dy,
double cotalpha,
double cotbeta,
int qbin,
int nxpix,
int nypix) {
475 int icotalpha, icotbeta, iqbin;
478 iqbin = qbin > 2 ? 3 : qbin;
479 if (icotalpha >= 0 && icotalpha < cotalphaBins_ && icotbeta >= 0 && icotbeta <
cotbetaBins_) {
480 qbinHist_[icotbeta][icotalpha]->Fill((
double)iqbin);
504 int icotalpha, icotbeta, iqbin;
507 iqbin = qbin > 2 ? 3 : qbin;
543 int icotalpha, icotbeta, iqbin;
546 iqbin = qbin > 2 ? 3 : qbin;