1 #ifndef CONDCORE_ALIGNMENTPLUGINS_ALIGNMENTPAYLOADINSPECTORHELPER_H 2 #define CONDCORE_ALIGNMENTPLUGINS_ALIGNMENTPAYLOADINSPECTORHELPER_H 9 #include "TPaveStats.h" 216 if (layer==2) isOuter = !odd_ladder;
217 else isOuter = odd_ladder;
219 if (layer==4) isOuter = odd_ladder;
220 else isOuter = !odd_ladder;
297 unsigned int subdetId =
static_cast<unsigned int>(detId.
subdetId());
529 case t_x :
return "x-translation";
530 case t_y :
return "y-translation";
531 case t_z :
return "z-translation";
532 case rot_alpha :
return "#alpha angle rotation";
533 case rot_beta :
return "#beta angle rotation";
534 case rot_gamma :
return "#gamma angle rotation";
535 default :
return "should never be here!";
544 case XX :
return "XX";
545 case XY :
return "XY";
546 case XZ :
return "XZ";
547 case YZ :
return "YX";
548 case YY :
return "YY";
549 case ZZ :
return "ZZ";
550 default :
return "should never be here!";
559 case BPix :
return "BPix";
560 case FPix :
return "FPix";
561 case TIB :
return "TIB";
562 case TID :
return "TID";
563 case TOB :
return "TOB";
564 case TEC :
return "TEC";
565 default :
return "should never be here!";
574 case XX :
return std::make_pair(0,0);
575 case XY :
return std::make_pair(0,1);
576 case XZ :
return std::make_pair(0,2);
577 case YZ :
return std::make_pair(1,0);
578 case YY :
return std::make_pair(1,1);
579 case ZZ :
return std::make_pair(2,2);
580 default :
return std::make_pair(-1,-1);
589 hist->SetStats(kFALSE);
591 hist->GetXaxis()->SetTitleColor(color);
592 hist->SetLineColor(color);
593 hist->SetTitleSize(0.08);
594 hist->SetLineWidth(2);
595 hist->GetXaxis()->CenterTitle(
true);
596 hist->GetYaxis()->CenterTitle(
true);
597 hist->GetXaxis()->SetTitleFont(42);
598 hist->GetYaxis()->SetTitleFont(42);
599 hist->GetXaxis()->SetNdivisions(505);
600 hist->GetXaxis()->SetTitleSize(0.06);
601 hist->GetYaxis()->SetTitleSize(0.06);
602 hist->GetXaxis()->SetTitleOffset(1.0);
603 hist->GetYaxis()->SetTitleOffset(1.3);
604 hist->GetXaxis()->SetLabelFont(42);
605 hist->GetYaxis()->SetLabelFont(42);
606 hist->GetYaxis()->SetLabelSize(.05);
607 hist->GetXaxis()->SetLabelSize(.05);
616 TPaveText*
stat =
new TPaveText(0.60,0.75,0.95,0.95,
"NDC");
618 stat->AddText(buffer);
620 sprintf(buffer,
"Entries : %i\n",(
int)hist->GetEntries());
621 stat->AddText(buffer);
624 sprintf(buffer,
"Mean : %6.2f\n",hist->GetMean());
626 sprintf(buffer,
"Mean : %6.2f e-2\n",100*hist->GetMean());
628 stat->AddText(buffer);
631 sprintf(buffer,
"RMS : %6.2f\n",hist->GetRMS());
633 sprintf(buffer,
"RMS : %6.2f e-2\n",100*hist->GetRMS());
635 stat->AddText(buffer);
637 stat->SetLineColor(color);
638 stat->SetTextColor(color);
639 stat->SetFillColor(10);
640 stat->SetShadowColor(10);
648 float sum = std::accumulate(
std::begin(values),
652 {
return value + p.second; }
655 float m = sum / values.size();
661 {accum += (p.second -
m) * (p.second - m);}
664 float stdev =
sqrt(accum / (values.size()-1));
667 return std::make_pair(m-nsigma*stdev,m+nsigma*stdev);
669 return std::make_pair(m>0.? 0.95*m : 1.05*m, m>0? 1.05*m : 0.95*m);
680 int iw = myPad->GetWw();
681 int ih = myPad->GetWh();
682 double x1p,y1p,x2p,y2p;
683 myPad->GetPadPar(x1p,y1p,x2p,y2p);
686 double wndc =
std::min(1.,(
double)iw/(
double)ih);
687 double rw = wndc/(double)iw;
688 double x1ndc = (double)ix1*rw;
689 double x2ndc = (double)ix2*rw;
690 double rx1,ry1,rx2,ry2;
691 myPad->GetRange(rx1,ry1,rx2,ry2);
692 double rx = (x2ndc-x1ndc)/(rx2-rx1);
694 _sx = rx*(boundary-rx1)+x1ndc;
695 double _dx = _sx+0.05;
697 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
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
uint32_t rawId() const
get the raw id
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)
Abs< T >::type abs(const T &t)
int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
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