1 #ifndef CONDCORE_ALIGNMENTPLUGINS_ALIGNMENTPAYLOADINSPECTORHELPER_H 2 #define CONDCORE_ALIGNMENTPLUGINS_ALIGNMENTPAYLOADINSPECTORHELPER_H 11 #include "TPaveStats.h" 277 bool isOuter =
false;
282 isOuter = !odd_ladder;
284 isOuter = odd_ladder;
287 isOuter = odd_ladder;
289 isOuter = !odd_ladder;
354 unsigned int subdetId =
static_cast<unsigned int>(detId.
subdetId());
573 return "x-translation";
575 return "y-translation";
577 return "z-translation";
579 return "#alpha angle rotation";
581 return "#beta angle rotation";
583 return "#gamma angle rotation";
585 return "should never be here!";
607 return "should never be here!";
629 return "should never be here!";
639 return std::make_pair(0, 0);
641 return std::make_pair(0, 1);
643 return std::make_pair(0, 2);
645 return std::make_pair(1, 0);
647 return std::make_pair(1, 1);
649 return std::make_pair(2, 2);
651 return std::make_pair(-1, -1);
659 hist->SetStats(kFALSE);
661 hist->GetXaxis()->SetTitleColor(color);
662 hist->SetLineColor(color);
663 hist->SetTitleSize(0.08);
664 hist->SetLineWidth(2);
665 hist->GetXaxis()->CenterTitle(
true);
666 hist->GetYaxis()->CenterTitle(
true);
667 hist->GetXaxis()->SetTitleFont(42);
668 hist->GetYaxis()->SetTitleFont(42);
669 hist->GetXaxis()->SetNdivisions(505);
670 hist->GetXaxis()->SetTitleSize(0.06);
671 hist->GetYaxis()->SetTitleSize(0.06);
672 hist->GetXaxis()->SetTitleOffset(1.0);
673 hist->GetYaxis()->SetTitleOffset(1.3);
674 hist->GetXaxis()->SetLabelFont(42);
675 hist->GetYaxis()->SetLabelFont(42);
676 hist->GetYaxis()->SetLabelSize(.05);
677 hist->GetXaxis()->SetLabelSize(.05);
685 TPaveText*
stat =
new TPaveText(0.60, 0.75, 0.95, 0.95,
"NDC");
687 stat->AddText(buffer);
689 sprintf(buffer,
"Entries : %i\n", (
int)hist->GetEntries());
690 stat->AddText(buffer);
692 if (
std::abs(hist->GetMean()) > 0.01) {
693 sprintf(buffer,
"Mean : %6.2f\n", hist->GetMean());
695 sprintf(buffer,
"Mean : %6.2f e-2\n", 100 * hist->GetMean());
697 stat->AddText(buffer);
699 if (
std::abs(hist->GetRMS()) > 0.01) {
700 sprintf(buffer,
"RMS : %6.2f\n", hist->GetRMS());
702 sprintf(buffer,
"RMS : %6.2f e-2\n", 100 * hist->GetRMS());
704 stat->AddText(buffer);
706 stat->SetLineColor(color);
707 stat->SetTextColor(color);
708 stat->SetFillColor(10);
709 stat->SetShadowColor(10);
717 float sum = std::accumulate(
719 return value + p.second;
722 float m = sum / values.size();
726 accum += (p.second -
m) * (p.second - m);
729 float stdev =
sqrt(accum / (values.size() - 1));
732 return std::make_pair(m - nsigma * stdev, m + nsigma * stdev);
734 return std::make_pair(m > 0. ? 0.95 * m : 1.05 * m, m > 0 ? 1.05 * m : 0.95 * m);
744 int iw = myPad->GetWw();
745 int ih = myPad->GetWh();
746 double x1p, y1p, x2p, y2p;
747 myPad->GetPadPar(x1p, y1p, x2p, y2p);
748 ix1 = (
int)(iw * x1p);
749 ix2 = (
int)(iw * x2p);
750 double wndc =
std::min(1., (
double)iw / (
double)ih);
751 double rw = wndc / (double)iw;
752 double x1ndc = (double)ix1 * rw;
753 double x2ndc = (double)ix2 * rw;
754 double rx1, ry1, rx2, ry2;
755 myPad->GetRange(rx1, ry1, rx2, ry2);
756 double rx = (x2ndc - x1ndc) / (rx2 - rx1);
758 _sx = rx * (boundary - rx1) + x1ndc;
759 double _dx = _sx + 0.05;
761 return std::make_pair(_sx, _dx);
static constexpr auto TEC
bool tecIsDoubleSide(const DetId &id) const
bool tobIsDoubleSide(const DetId &id) const
bool tibIsDoubleSide(const DetId &id) const
unsigned int tibLayer(const DetId &id) const
unsigned int tidRing(const DetId &id) const
void makeNicePlotStyle(TH1 *hist, int color)
std::vector< unsigned int > tidModuleInfo(const DetId &id) const
ret
prodAgent to be discontinued
unsigned int pxfDisk(const DetId &id) const
unsigned int tecRing(const DetId &id) const
ring id
unsigned int pxbLadder(const DetId &id) const
constexpr uint32_t rawId() const
get the raw id
std::string getStringFromPart(AlignmentPI::partitions i)
unsigned int tidWheel(const DetId &id) const
bool isBPixOuterLadder(const DetId &detid, const TrackerTopology &tTopo, bool isPhase0)
static const float cmToUm
void makeNiceStats(TH1F *hist, AlignmentPI::partitions part, int color)
unsigned int tibSide(const DetId &id) const
static const unsigned int phase0size
std::vector< unsigned int > tecPetalInfo(const DetId &id) const
Container::value_type value_type
unsigned int tidSide(const DetId &id) const
unsigned int tobSide(const DetId &id) const
void fillGeometryInfo(const DetId &detId, const TrackerTopology &tTopo, bool isPhase0)
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
Abs< T >::type abs(const T &t)
static constexpr auto TOB
std::pair< int, int > getIndices(AlignmentPI::index i)
unsigned int pxbLayer(const DetId &id) const
std::pair< float, float > getTheRange(std::map< uint32_t, float > values, const float nsigma)
static constexpr auto TIB
std::string getStringFromCoordinate(AlignmentPI::coordinate coord)
AlignmentPI::regions filterThePartition()
bool tidIsDoubleSide(const DetId &id) const
std::string getStringFromIndex(AlignmentPI::index i)
unsigned int tobModule(const DetId &id) const
std::pair< double, double > calculatePosition(TVirtualPad *myPad, int boundary)
unsigned int pxfSide(const DetId &id) const
std::string getStringFromRegionEnum(AlignmentPI::regions e)
bool isRPhi(const DetId &id) const
bool tibIsInternalString(const DetId &id) const
unsigned int tecWheel(const DetId &id) const
static constexpr auto TID
unsigned int tobLayer(const DetId &id) const
unsigned int tecSide(const DetId &id) const