1 #ifndef CONDCORE_ALIGNMENTPLUGINS_ALIGNMENTPAYLOADINSPECTORHELPER_H
2 #define CONDCORE_ALIGNMENTPLUGINS_ALIGNMENTPAYLOADINSPECTORHELPER_H
11 #include "TPaveStats.h"
22 #define COUT std::cout << "MM "
24 #define COUT edm::LogVerbatim("")
308 bool isOuter =
false;
313 isOuter = !odd_ladder;
315 isOuter = odd_ladder;
318 isOuter = odd_ladder;
320 isOuter = !odd_ladder;
385 unsigned int subdetId = static_cast<unsigned int>(detId.
subdetId());
604 return "x-translation";
606 return "y-translation";
608 return "z-translation";
610 return "#alpha angle rotation";
612 return "#beta angle rotation";
614 return "#gamma angle rotation";
616 return "should never be here!";
638 return "should never be here!";
660 return "should never be here!";
670 return std::make_pair(0, 0);
672 return std::make_pair(0, 1);
674 return std::make_pair(0, 2);
676 return std::make_pair(1, 0);
678 return std::make_pair(1, 1);
680 return std::make_pair(2, 2);
682 return std::make_pair(-1, -1);
690 hist->SetStats(kFALSE);
692 hist->GetXaxis()->SetTitleColor(color);
693 hist->SetLineColor(color);
694 hist->SetTitleSize(0.08);
695 hist->SetLineWidth(2);
696 hist->GetXaxis()->CenterTitle(
true);
697 hist->GetYaxis()->CenterTitle(
true);
698 hist->GetXaxis()->SetTitleFont(42);
699 hist->GetYaxis()->SetTitleFont(42);
700 hist->GetXaxis()->SetNdivisions(505);
701 hist->GetXaxis()->SetTitleSize(0.06);
702 hist->GetYaxis()->SetTitleSize(0.06);
703 hist->GetXaxis()->SetTitleOffset(1.0);
704 hist->GetYaxis()->SetTitleOffset(1.3);
705 hist->GetXaxis()->SetLabelFont(42);
706 hist->GetYaxis()->SetLabelFont(42);
707 hist->GetYaxis()->SetLabelSize(.05);
708 hist->GetXaxis()->SetLabelSize(.05);
716 TPaveText*
stat =
new TPaveText(0.60, 0.75, 0.95, 0.95,
"NDC");
720 sprintf(
buffer,
"Entries : %i\n", (
int)
hist->GetEntries());
724 sprintf(
buffer,
"Mean : %6.2f\n",
hist->GetMean());
726 sprintf(
buffer,
"Mean : %6.2f e-2\n", 100 *
hist->GetMean());
731 sprintf(
buffer,
"RMS : %6.2f\n",
hist->GetRMS());
733 sprintf(
buffer,
"RMS : %6.2f e-2\n", 100 *
hist->GetRMS());
737 stat->SetLineColor(color);
738 stat->SetTextColor(color);
739 stat->SetFillColor(10);
740 stat->SetShadowColor(10);
745 inline std::pair<float, float>
getTheRange(std::map<uint32_t, float>
values,
const float nsigma)
748 float sum = std::accumulate(
757 accum += (
p.second -
m) * (
p.second -
m);
763 return std::make_pair(
m - nsigma *
stdev,
m + nsigma *
stdev);
765 return std::make_pair(
m > 0. ? 0.95 *
m : 1.05 *
m,
m > 0 ? 1.05 *
m : 0.95 *
m);
775 int iw = myPad->GetWw();
776 int ih = myPad->GetWh();
777 double x1p, y1p, x2p, y2p;
778 myPad->GetPadPar(x1p, y1p, x2p, y2p);
779 ix1 = (
int)(iw * x1p);
780 ix2 = (
int)(iw * x2p);
781 double wndc =
std::min(1., (
double)iw / (
double)ih);
782 double rw = wndc / (double)iw;
783 double x1ndc = (double)ix1 * rw;
784 double x2ndc = (double)ix2 * rw;
785 double rx1, ry1, rx2, ry2;
786 myPad->GetRange(rx1, ry1, rx2, ry2);
787 double rx = (x2ndc - x1ndc) / (rx2 - rx1);
789 _sx =
rx * (boundary - rx1) + x1ndc;
790 double _dx = _sx + 0.05;
792 return std::make_pair(_sx, _dx);
809 const std::map<AlignmentPI::coordinate, float>& GPR);
817 const std::array<double, 6>
getX()
829 const std::array<double, 6>
getY()
841 const std::array<double, 6>
getZ()
864 const std::map<AlignmentPI::coordinate, float>& GPR)
867 for (
const auto& ali :
input) {
870 <<
"Encountered invalid Tracker DetId:" << ali.rawId() <<
" " <<
DetId(ali.rawId()).det()
875 int subid =
DetId(ali.rawId()).subdetId();
942 edm::LogError(
"TrackerAlignment_PayloadInspector") <<
"Unrecognized partition " << subid << std::endl;
957 <<
" X: " << std::right << std::setw(12) <<
Xbarycenters[
p] <<
" Y: " << std::right << std::setw(12)