1 #ifndef CONDCORE_ALIGNMENTPLUGINS_ALIGNMENTPAYLOADINSPECTORHELPER_H 2 #define CONDCORE_ALIGNMENTPLUGINS_ALIGNMENTPAYLOADINSPECTORHELPER_H 11 #include "TPaveStats.h" 219 if (layer==2) isOuter = !odd_ladder;
220 else isOuter = odd_ladder;
222 if (layer==4) isOuter = odd_ladder;
223 else isOuter = !odd_ladder;
300 unsigned int subdetId =
static_cast<unsigned int>(detId.
subdetId());
532 case t_x :
return "x-translation";
533 case t_y :
return "y-translation";
534 case t_z :
return "z-translation";
535 case rot_alpha :
return "#alpha angle rotation";
536 case rot_beta :
return "#beta angle rotation";
537 case rot_gamma :
return "#gamma angle rotation";
538 default :
return "should never be here!";
547 case XX :
return "XX";
548 case XY :
return "XY";
549 case XZ :
return "XZ";
550 case YZ :
return "YX";
551 case YY :
return "YY";
552 case ZZ :
return "ZZ";
553 default :
return "should never be here!";
562 case BPix :
return "BPix";
563 case FPix :
return "FPix";
564 case TIB :
return "TIB";
565 case TID :
return "TID";
566 case TOB :
return "TOB";
567 case TEC :
return "TEC";
568 default :
return "should never be here!";
577 case XX :
return std::make_pair(0,0);
578 case XY :
return std::make_pair(0,1);
579 case XZ :
return std::make_pair(0,2);
580 case YZ :
return std::make_pair(1,0);
581 case YY :
return std::make_pair(1,1);
582 case ZZ :
return std::make_pair(2,2);
583 default :
return std::make_pair(-1,-1);
592 hist->SetStats(kFALSE);
594 hist->GetXaxis()->SetTitleColor(color);
595 hist->SetLineColor(color);
596 hist->SetTitleSize(0.08);
597 hist->SetLineWidth(2);
598 hist->GetXaxis()->CenterTitle(
true);
599 hist->GetYaxis()->CenterTitle(
true);
600 hist->GetXaxis()->SetTitleFont(42);
601 hist->GetYaxis()->SetTitleFont(42);
602 hist->GetXaxis()->SetNdivisions(505);
603 hist->GetXaxis()->SetTitleSize(0.06);
604 hist->GetYaxis()->SetTitleSize(0.06);
605 hist->GetXaxis()->SetTitleOffset(1.0);
606 hist->GetYaxis()->SetTitleOffset(1.3);
607 hist->GetXaxis()->SetLabelFont(42);
608 hist->GetYaxis()->SetLabelFont(42);
609 hist->GetYaxis()->SetLabelSize(.05);
610 hist->GetXaxis()->SetLabelSize(.05);
619 TPaveText*
stat =
new TPaveText(0.60,0.75,0.95,0.95,
"NDC");
621 stat->AddText(buffer);
623 sprintf(buffer,
"Entries : %i\n",(
int)hist->GetEntries());
624 stat->AddText(buffer);
627 sprintf(buffer,
"Mean : %6.2f\n",hist->GetMean());
629 sprintf(buffer,
"Mean : %6.2f e-2\n",100*hist->GetMean());
631 stat->AddText(buffer);
634 sprintf(buffer,
"RMS : %6.2f\n",hist->GetRMS());
636 sprintf(buffer,
"RMS : %6.2f e-2\n",100*hist->GetRMS());
638 stat->AddText(buffer);
640 stat->SetLineColor(color);
641 stat->SetTextColor(color);
642 stat->SetFillColor(10);
643 stat->SetShadowColor(10);
651 float sum = std::accumulate(
std::begin(values),
655 {
return value + p.second; }
658 float m = sum / values.size();
664 {accum += (p.second -
m) * (p.second - m);}
667 float stdev =
sqrt(accum / (values.size()-1));
670 return std::make_pair(m-nsigma*stdev,m+nsigma*stdev);
672 return std::make_pair(m>0.? 0.95*m : 1.05*m, m>0? 1.05*m : 0.95*m);
683 int iw = myPad->GetWw();
684 int ih = myPad->GetWh();
685 double x1p,y1p,x2p,y2p;
686 myPad->GetPadPar(x1p,y1p,x2p,y2p);
689 double wndc =
std::min(1.,(
double)iw/(
double)ih);
690 double rw = wndc/(double)iw;
691 double x1ndc = (double)ix1*rw;
692 double x2ndc = (double)ix2*rw;
693 double rx1,ry1,rx2,ry2;
694 myPad->GetRange(rx1,ry1,rx2,ry2);
695 double rx = (x2ndc-x1ndc)/(rx2-rx1);
697 _sx = rx*(boundary-rx1)+x1ndc;
698 double _dx = _sx+0.05;
700 return std::make_pair(_sx,_dx);
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
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)
std::pair< float, float > getTheRange(std::map< uint32_t, float > values, const float nsigma)
std::pair< int, int > getIndices(AlignmentPI::index i)
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
std::pair< double, double > calculatePosition(TVirtualPad *myPad, int boundary)
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)
unsigned int pxbLayer(const DetId &id) const
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
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
unsigned int tobLayer(const DetId &id) const
unsigned int tecSide(const DetId &id) const