55 #include <TEveGeoNode.h>
56 #include <TGeoVolume.h>
71 virtual void endJob()
override;
74 const char* regionName);
146 : infileName_(iConfig.getUntrackedParameter<std::
string>(
"infileName")),
147 outfileName_(iConfig.getUntrackedParameter<std::
string>(
"outfileName"))
166 std::cout<<
"Validating RPC -z endcap geometry"<<std::endl;
169 std::cout<<
"Validating RPC +z endcap geometry"<<std::endl;
172 std::cout<<
"Validating RPC barrel geometry"<<std::endl;
183 std::cout<<
"Validating DT chamber geometry"<<std::endl;
186 std::cout<<
"Validating DT layer geometry"<<std::endl;
197 std::cout<<
"Validating CSC -z geometry"<<std::endl;
200 std::cout<<
"Validating CSC +z geometry"<<std::endl;
203 std::cout<<
"Validating CSC layer -z geometry"<<std::endl;
206 std::cout<<
"Validating CSC layer +z geometry"<<std::endl;
217 std::cout<<
"Validating TIB geometry and topology"<<std::endl;
221 std::cout<<
"Validating TOB geometry and topology"<<std::endl;
225 std::cout<<
"Validating TEC geometry and topology"<<std::endl;
229 std::cout<<
"Validating TID geometry and topology"<<std::endl;
233 std::cout<<
"Validating PXB geometry and topology"<<std::endl;
237 std::cout<<
"Validating PXF geometry and topology"<<std::endl;
249 std::cout<<
"Validating EB geometry"<<std::endl;
252 std::cout<<
"Validating EE geometry"<<std::endl;
255 std::cout<<
"Validating ES geometry"<<std::endl;
258 std::cout<<
"Validating HB geometry"<<std::endl;
261 std::cout<<
"Validating HE geometry"<<std::endl;
264 std::cout<<
"Validating HO geometry"<<std::endl;
267 std::cout<<
"Validating HF geometry"<<std::endl;
270 std::cout<<
"Validating Castor geometry"<<std::endl;
273 std::cout<<
"Validating ZDC geometry"<<std::endl;
287 std::vector<double> centers;
291 for (
auto it = rolls.begin(),
301 if ( rpcDetId.
region() == regionNumber )
310 std::cout<<
"Failed to get matrix of RPC with detid: "
311 << rpcDetId.
rawId() <<std::endl;
321 std::cout<<
"Failed to get shape of RPC with detid: "
322 << rpcDetId.
rawId() <<std::endl;
330 if ( parameters == 0 )
332 std::cout<<
"Parameters empty for RPC with detid: "
333 << rpcDetId.
rawId() <<std::endl;
341 assert(nStrips == parameters[0]);
344 assert(stripLength == parameters[1]);
347 assert(pitch == parameters[2]);
349 float offset = -0.5*nStrips*pitch;
351 for (
int strip = 1; strip <= roll->
nstrips(); ++strip )
356 centers.push_back(centreOfStrip1.
x()-centreOfStrip2.
x());
392 std::cout<<
"Failed to get matrix of DT chamber with detid: "
393 << chId.
rawId() <<std::endl;
403 std::cout<<
"Failed to get shape of DT chamber with detid: "
404 << chId.
rawId() <<std::endl;
421 std::vector<double> wire_positions;
425 for (
auto it =
layers.begin(),
440 std::cout<<
"Failed to get matrix of DT layer with detid: "
441 << layerId.
rawId() <<std::endl;
451 std::cout<<
"Failed to get shape of DT layer with detid: "
452 << layerId.
rawId() <<std::endl;
461 if ( parameters == 0 )
463 std::cout<<
"Parameters empty for DT layer with detid: "
464 << layerId.
rawId() <<std::endl;
469 assert(width == parameters[6]);
472 assert(thickness == parameters[7]);
475 assert(length == parameters[8]);
478 assert(firstChannel == parameters[3]);
482 assert(nChannels == (lastChannel-firstChannel)+1);
484 for (
int wireN = firstChannel; wireN - lastChannel <= 0; ++wireN )
487 double localX2 = (wireN -(firstChannel-1)-0.5)*parameters[0] - nChannels/2.0*parameters[0];
489 wire_positions.push_back(localX1-localX2);
525 std::cout<<
"Failed to get matrix of CSC chamber with detid: "
526 << detId.
rawId() <<std::endl;
536 std::cout<<
"Failed to get shape of CSC chamber with detid: "
537 << detId.
rawId() <<std::endl;
552 std::vector<double> strip_positions;
553 std::vector<double> wire_positions;
555 std::vector<double> me11_wiresLocal;
556 std::vector<double> me12_wiresLocal;
557 std::vector<double> me13_wiresLocal;
558 std::vector<double> me14_wiresLocal;
559 std::vector<double> me21_wiresLocal;
560 std::vector<double> me22_wiresLocal;
561 std::vector<double> me31_wiresLocal;
562 std::vector<double> me32_wiresLocal;
563 std::vector<double> me41_wiresLocal;
564 std::vector<double> me42_wiresLocal;
568 for (
auto it =
layers.begin(),
583 std::cout<<
"Failed to get matrix of CSC layer with detid: "
584 << detId.
rawId() <<std::endl;
594 std::cout<<
"Failed to get shape of CSC layer with detid: "
595 << detId.
rawId() <<std::endl;
610 std::cout<<
"Failed to get trapezoid from shape for CSC layer with detid: "
611 << detId.
rawId() <<std::endl;
617 if ( parameters == 0 )
619 std::cout<<
"Parameters empty for CSC layer with detid: "
620 << detId.
rawId() <<std::endl;
625 assert(yAxisOrientation == parameters[0]);
628 assert(centreToIntersection == parameters[1]);
631 assert(yCentre == parameters[2]);
634 assert(phiOfOneEdge == parameters[3]);
637 assert(stripOffset == parameters[4]);
640 assert(angularWidth == parameters[5]);
647 double stripAngle = phiOfOneEdge + yAxisOrientation*(nStrip-(0.5-stripOffset))*angularWidth;
648 double xOfStrip2 = yAxisOrientation*(centreToIntersection-yCentre)*
tan(stripAngle);
650 strip_positions.push_back(xOfStrip1-xOfStrip2);
657 assert(wireSpacingInGroup == parameters[6]);
659 double wireSpacing = 0.0;
663 double extentOfWirePlane = 0.0;
668 extentOfWirePlane = 174.81;
670 extentOfWirePlane = 323.38;
672 else if ( station == 1 && (ring == 1 || ring == 4))
673 extentOfWirePlane = 150.5;
674 else if ( station == 1 && ring == 3 )
675 extentOfWirePlane = 164.47;
676 else if ( station == 2 && ring == 1 )
677 extentOfWirePlane = 189.97;
678 else if ( station == 3 && ring == 1 )
679 extentOfWirePlane = 170.01;
680 else if ( station == 4 && ring == 1 )
681 extentOfWirePlane = 149.73;
684 assert(wireAngle == parameters[7]);
694 double alignmentPinToFirstWire;
695 double yAlignmentFrame = 3.49;
699 if ( ring == 1 || ring == 4 )
701 alignmentPinToFirstWire = 1.065;
702 yAlignmentFrame = 0.0;
706 alignmentPinToFirstWire = 2.85;
709 else if ( station == 4 && ring == 1 )
710 alignmentPinToFirstWire = 3.04;
712 else if ( station == 3 && ring == 1 )
713 alignmentPinToFirstWire = 2.84;
716 alignmentPinToFirstWire = 2.87;
718 double yOfFirstWire = (yAlignmentFrame-length) + alignmentPinToFirstWire;
721 double E = extentOfWirePlane/nWireGroups;
723 for (
int nWireGroup = 1; nWireGroup <= nWireGroups; ++nWireGroup )
726 double yOfWire1 = centerOfWireGroup.
y();
730 double yOfWire2 = yOfFirstWire + ((nWireGroup-1)*E);
731 yOfWire2 += wireSpacing*0.5;
733 double ydiff_local = yOfWire1 - yOfWire2;
734 wire_positions.push_back(ydiff_local);
753 me11_wiresLocal.push_back(ydiff_local);
755 else if ( ring == 2 )
757 me12_wiresLocal.push_back(ydiff_local);
759 else if ( ring == 3 )
761 me13_wiresLocal.push_back(ydiff_local);
763 else if ( ring == 4 )
765 me14_wiresLocal.push_back(ydiff_local);
768 else if ( station == 2 )
772 me21_wiresLocal.push_back(ydiff_local);
774 else if ( ring == 2 )
776 me22_wiresLocal.push_back(ydiff_local);
779 else if ( station == 3 )
783 me31_wiresLocal.push_back(ydiff_local);
785 else if ( ring == 2 )
787 me32_wiresLocal.push_back(ydiff_local);
790 else if ( station == 4 )
794 me41_wiresLocal.push_back(ydiff_local);
796 else if ( ring == 2 )
798 me42_wiresLocal.push_back(ydiff_local);
832 caloGeometry_->getSubdetectorGeometry(detector, subdetector);
834 const std::vector<DetId>& ids = geometry->
getValidDetIds(detector, subdetector);
836 for (
auto it = ids.begin(),
840 unsigned int rawId = (*it).rawId();
846 std::cout <<
"Failed to get points of "<< detname
847 <<
" element with detid: "<< rawId <<std::endl;
856 for (
unsigned int i = 0,
offset = 0;
i < 8; ++
i )
877 for ( TrackerGeometry::DetContainer::const_iterator it = dets.begin(),
882 unsigned int rawId = (*it)->geographicalId().rawId();
888 std::cout <<
"Failed to get matrix of "<< detname
889 <<
" element with detid: "<< rawId <<std::endl;
899 std::cout<<
"Failed to get shape of "<< detname
900 <<
" element with detid: "<< rawId <<std::endl;
915 std::vector<double> pixelLocalXs;
916 std::vector<double> pixelLocalYs;
918 for ( TrackerGeometry::DetContainer::const_iterator it = dets.begin(),
922 unsigned int rawId = (*it)->geographicalId().rawId();
926 if ( parameters == 0 )
928 std::cout<<
"Parameters empty for "<< detname <<
" element with detid: "
929 << rawId <<std::endl;
934 dynamic_cast<const PixelGeomDetUnit*>(
trackerGeometry_->idToDetUnit((*it)->geographicalId())) )
938 int nrows = rpt->nrows();
939 int ncolumns = rpt->ncolumns();
941 assert(parameters[0] == nrows);
942 assert(parameters[1] == ncolumns);
944 for (
int row = 1; row <= nrows; ++row )
946 for (
int column = 1; column <= ncolumns; ++column )
957 std::cout<<
"No topology for "<< detname <<
" "<< rawId <<std::endl;
961 std::cout<<
"No geomDetUnit for "<< detname <<
" "<< rawId <<std::endl;
973 std::vector<double> radialStripLocalXs;
974 std::vector<double> rectangularStripLocalXs;
976 for ( TrackerGeometry::DetContainer::const_iterator it = dets.begin(),
980 unsigned int rawId = (*it)->geographicalId().rawId();
984 if ( parameters == 0 )
986 std::cout<<
"Parameters empty for "<< detname <<
" element with detid: "
987 << rawId <<std::endl;
992 dynamic_cast<const StripGeomDetUnit*>(
trackerGeometry_->idToDet((*it)->geographicalId())) )
1003 assert(parameters[1] == nstrips);
1006 if(
const RadialStripTopology* rst = dynamic_cast<const RadialStripTopology*>(&(det->specificType().specificTopology())) )
1008 assert(parameters[0] == 1);
1009 assert(parameters[3] == rst->yAxisOrientation());
1010 assert(parameters[4] == rst->originToIntersection());
1011 assert(parameters[5] == rst->phiOfOneEdge());
1012 assert(parameters[6] == rst->angularWidth());
1014 for ( uint16_t strip = 1; strip <= nstrips; ++strip )
1016 float stripAngle1 = rst->stripAngle(strip);
1017 float stripAngle2 = parameters[3] * (parameters[5] + strip*parameters[6]);
1019 assert((stripAngle1-stripAngle2) == 0);
1023 float stripX = parameters[4]*
tan(stripAngle2);
1024 radialStripLocalXs.push_back(stripPosition.
x()-stripX);
1028 else if( dynamic_cast<const RectangularStripTopology*>(&(det->specificType().specificTopology())) )
1030 assert(parameters[0] == 2);
1033 for ( uint16_t strip = 1; strip <= nstrips; ++strip )
1036 float stripX = -parameters[1]*0.5*parameters[3];
1037 stripX += strip*parameters[3];
1038 rectangularStripLocalXs.push_back(stripPosition.
x()-stripX);
1042 else if( dynamic_cast<const TrapezoidalStripTopology*>(&(det->specificType().specificTopology())) )
1044 assert(parameters[0] == 3);
1049 std::cout<<
"Failed to get pitch for "<< detname <<
" "<< rawId <<std::endl;
1053 std::cout<<
"Failed cast to StripTopology for "<< detname <<
" "<< rawId <<std::endl;
1061 makeHistogram(hn+
" radial strip localX", radialStripLocalXs);
1062 makeHistogram(hn+
" rectangular strip localX", rectangularStripLocalXs);
1068 const TGeoMatrix*
matrix)
1077 matrix->LocalToMaster(local, global);
1086 double shape_topWidth;
1087 double shape_bottomWidth;
1088 double shape_length;
1089 double shape_thickness;
1091 if ( shape[0] == 1 )
1093 shape_topWidth = shape[2];
1094 shape_bottomWidth = shape[1];
1095 shape_length = shape[4];
1096 shape_thickness = shape[3];
1099 else if ( shape[0] == 2 )
1101 shape_topWidth = shape[1];
1102 shape_bottomWidth = shape[1];
1103 shape_length = shape[2];
1104 shape_thickness = shape[3];
1109 std::cout<<
"Failed to get box or trapezoid from shape"<<std::endl;
1113 double topWidth, bottomWidth;
1114 double length, thickness;
1120 std::array<const float, 4>
const & ps = tpbs->parameters();
1124 bottomWidth = ps[0];
1130 else if ( (dynamic_cast<const RectangularPlaneBounds*>(bounds)) )
1134 bottomWidth = topWidth;
1140 std::cout<<
"Failed to get bounds"<<std::endl;
1153 topWidths_.push_back(fabs(shape_topWidth - topWidth));
1154 bottomWidths_.push_back(fabs(shape_bottomWidth - bottomWidth));
1155 lengths_.push_back(fabs(shape_length - length));
1156 thicknesses_.push_back(fabs(shape_thickness - thickness));
1173 return sqrt((p1.
x()-p2.
x())*(p1.
x()-p2.
x())+
1174 (p1.
y()-p2.
y())*(p1.
y()-p2.
y())+
1175 (p1.
z()-p2.
z())*(p1.
z()-p2.
z()));
1186 std::string gdn = d+
": distance between points in global coordinates";
1189 std::string twn = d +
": absolute difference between top widths (along X)";
1192 std::string bwn = d +
": absolute difference between bottom widths (along X)";
1195 std::string ln = d +
": absolute difference between lengths (along Y)";
1198 std::string tn = d +
": absolute difference between thicknesses (along Z)";
1211 std::vector<double>::iterator it;
1213 it = std::min_element(data.begin(), data.end());
1216 it = std::max_element(data.begin(), data.end());
1219 std::vector<double>::iterator itEnd = data.end();
1221 TH1D
hist(name.c_str(), name.c_str(), 100, minE*(1+0.10), maxE*(1+0.10));
1223 for ( it = data.begin(); it != itEnd; ++it )
1226 hist.GetXaxis()->SetTitle(
"[cm]");
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
virtual int nstrips() const =0
float wirePosition(int wireNumber) const
Returns the x position in the layer of a given wire number.
edm::ESHandle< CaloGeometry > caloGeometry_
LocalPoint centreOfStrip(int strip) const
edm::ESHandle< TrackerGeometry > trackerGeometry_
std::vector< LayerSetAndLayers > layers(const SeedingLayerSetsHits &sets)
const CSCWireTopology * wireTopology() const
virtual float length() const =0
virtual void beginJob() override
std::vector< double > topWidths_
void validateTrackerGeometry(const TrackerGeometry::DetContainer &dets, const char *detname)
float pixelLocalY(const double mpy, const int m_ncols)
CSCDetId id() const
Get the (concrete) DetId.
float yCentreOfStripPlane() const
const float * getParameters(unsigned int id) const
#define DEFINE_FWK_MODULE(type)
DTLayerId id() const
Return the DetId of this SL.
edm::ESHandle< RPCGeometry > rpcGeometry_
std::vector< double > bottomWidths_
Global3DPoint GlobalPoint
void makeHistograms(const char *detector)
const Bounds & bounds() const
int numberOfStrips() const
double wireSpacing() const
const TGeoMatrix * getMatrix(unsigned int id) const
const StripTopology & specificTopology() const
const Plane & surface() const
The nominal surface of the GeomDet.
int numberOfWireGroups() const
void makeHistogram(const std::string &name, std::vector< double > &data)
virtual const std::vector< DetId > & getValidDetIds(DetId::Detector det=DetId::Detector(0), int subdet=0) const
Get a list of valid detector ids (for the given subdetector)
virtual const CaloCellGeometry * getGeometry(const DetId &id) const
Get the cell geometry of a given detector id. Should return false if not found.
int firstChannel() const
Returns the wire number of the first wire.
float xOfStrip(int strip, float y=0.) const
void validateDTChamberGeometry()
uint32_t rawId() const
get the raw id
virtual float thickness() const =0
const float * getShapePars(unsigned int id) const
int lastChannel() const
Returns the wire number of the last wire.
const DTTopology & specificTopology() const
virtual float stripLength() const =0
Measurement2DPoint MeasurementPoint
Measurement points are two-dimensional by default.
void compareShape(const GeomDet *det, const float *shape)
void loadMap(const char *fileName)
void validateCaloGeometry(DetId::Detector detector, int subdetector, const char *detname)
float yAxisOrientation() const
DTChamberId id() const
Return the DTChamberId of this chamber.
void validateDTLayerGeometry()
Tan< T >::type tan(const T &t)
edm::ESHandle< DTGeometry > dtGeometry_
DetId geographicalId() const
The label of this GeomDet.
void validateRPCGeometry(const int regionNumber, const char *regionName)
float centreToIntersection() const
void validatePixelTopology(const TrackerGeometry::DetContainer &dets, const char *detname)
float phiOfOneEdge() const
float angularWidth() const
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
void validateCSCLayerGeometry(const int endcap, const char *detname)
static const int SubdetectorId
edm::ESHandle< CSCGeometry > cscGeometry_
virtual void endJob() override
LocalPoint localCenterOfWireGroup(int wireGroup) const
const CSCStripTopology * topology() const
virtual float stripOffset(void) const
static const int SubdetectorId
const float * getCorners(unsigned int id) const
double getDistance(const GlobalPoint &point1, const GlobalPoint &point2)
ValidateGeometry(const edm::ParameterSet &)
ESHandle< TrackerGeometry > geometry
char data[epos_bytes_allocation]
std::vector< double > thicknesses_
virtual float pitch() const =0
virtual void analyze(const edm::Event &, const edm::EventSetup &) override
virtual LocalPoint localPosition(float strip) const =0
void validateCSChamberGeometry(const int endcap, const char *detname)
void validateStripTopology(const TrackerGeometry::DetContainer &dets, const char *detname)
static char chambers[264][20]
std::vector< double > lengths_
const CornersVec & getCorners() const
Returns the corner points of this cell's volume.
virtual float width() const =0
std::vector< GeomDet const * > DetContainer
const CSCLayerGeometry * geometry() const
float pixelLocalX(const double mpx, const int m_nrows)
void compareTransform(const GlobalPoint &point, const TGeoMatrix *matrix)
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
std::vector< double > globalDistances_
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.