55 #include <TEveGeoNode.h>
56 #include <TGeoVolume.h>
71 virtual void endJob()
override;
74 const char* regionName);
150 : infileName_(iConfig.getUntrackedParameter<std::
string>(
"infileName")),
151 outfileName_(iConfig.getUntrackedParameter<std::
string>(
"outfileName"))
176 std::cout<<
"Validating RPC -z endcap geometry"<<std::endl;
179 std::cout<<
"Validating RPC +z endcap geometry"<<std::endl;
182 std::cout<<
"Validating RPC barrel geometry"<<std::endl;
193 std::cout<<
"Validating DT chamber geometry"<<std::endl;
196 std::cout<<
"Validating DT layer geometry"<<std::endl;
207 std::cout<<
"Validating CSC -z geometry"<<std::endl;
210 std::cout<<
"Validating CSC +z geometry"<<std::endl;
213 std::cout<<
"Validating CSC layer -z geometry"<<std::endl;
216 std::cout<<
"Validating CSC layer +z geometry"<<std::endl;
229 std::cout<<
"Validating TIB geometry and topology"<<std::endl;
233 std::cout<<
"Validating TOB geometry and topology"<<std::endl;
237 std::cout<<
"Validating TEC geometry and topology"<<std::endl;
241 std::cout<<
"Validating TID geometry and topology"<<std::endl;
245 std::cout<<
"Validating PXB geometry and topology"<<std::endl;
249 std::cout<<
"Validating PXF geometry and topology"<<std::endl;
264 std::cout<<
"Validating EB geometry"<<std::endl;
267 std::cout<<
"Validating EE geometry"<<std::endl;
270 std::cout<<
"Validating ES geometry"<<std::endl;
273 std::cout<<
"Validating HB geometry"<<std::endl;
276 std::cout<<
"Validating HE geometry"<<std::endl;
279 std::cout<<
"Validating HO geometry"<<std::endl;
282 std::cout<<
"Validating HF geometry"<<std::endl;
285 std::cout<<
"Validating Castor geometry"<<std::endl;
288 std::cout<<
"Validating ZDC geometry"<<std::endl;
302 std::vector<double> centers;
306 for (
auto it = rolls.begin(),
316 if ( rpcDetId.
region() == regionNumber )
325 std::cout<<
"Failed to get matrix of RPC with detid: "
326 << rpcDetId.
rawId() <<std::endl;
336 std::cout<<
"Failed to get shape of RPC with detid: "
337 << rpcDetId.
rawId() <<std::endl;
345 if ( parameters == 0 )
347 std::cout<<
"Parameters empty for RPC with detid: "
348 << rpcDetId.
rawId() <<std::endl;
356 assert(nStrips == parameters[0]);
359 assert(stripLength == parameters[1]);
362 assert(pitch == parameters[2]);
364 float offset = -0.5*nStrips*pitch;
366 for (
int strip = 1; strip <= roll->
nstrips(); ++strip )
371 centers.push_back(centreOfStrip1.
x()-centreOfStrip2.
x());
407 std::cout<<
"Failed to get matrix of DT chamber with detid: "
408 << chId.
rawId() <<std::endl;
418 std::cout<<
"Failed to get shape of DT chamber with detid: "
419 << chId.
rawId() <<std::endl;
436 std::vector<double> wire_positions;
440 for (
auto it =
layers.begin(),
455 std::cout<<
"Failed to get matrix of DT layer with detid: "
456 << layerId.
rawId() <<std::endl;
466 std::cout<<
"Failed to get shape of DT layer with detid: "
467 << layerId.
rawId() <<std::endl;
476 if ( parameters == 0 )
478 std::cout<<
"Parameters empty for DT layer with detid: "
479 << layerId.
rawId() <<std::endl;
484 assert(width == parameters[6]);
487 assert(thickness == parameters[7]);
490 assert(length == parameters[8]);
493 assert(firstChannel == parameters[3]);
497 assert(nChannels == (lastChannel-firstChannel)+1);
499 for (
int wireN = firstChannel; wireN - lastChannel <= 0; ++wireN )
502 double localX2 = (wireN -(firstChannel-1)-0.5)*parameters[0] - nChannels/2.0*parameters[0];
504 wire_positions.push_back(localX1-localX2);
540 std::cout<<
"Failed to get matrix of CSC chamber with detid: "
541 << detId.
rawId() <<std::endl;
551 std::cout<<
"Failed to get shape of CSC chamber with detid: "
552 << detId.
rawId() <<std::endl;
567 std::vector<double> strip_positions;
568 std::vector<double> wire_positions;
570 std::vector<double> me11_wiresLocal;
571 std::vector<double> me12_wiresLocal;
572 std::vector<double> me13_wiresLocal;
573 std::vector<double> me14_wiresLocal;
574 std::vector<double> me21_wiresLocal;
575 std::vector<double> me22_wiresLocal;
576 std::vector<double> me31_wiresLocal;
577 std::vector<double> me32_wiresLocal;
578 std::vector<double> me41_wiresLocal;
579 std::vector<double> me42_wiresLocal;
583 for (
auto it =
layers.begin(),
598 std::cout<<
"Failed to get matrix of CSC layer with detid: "
599 << detId.
rawId() <<std::endl;
609 std::cout<<
"Failed to get shape of CSC layer with detid: "
610 << detId.
rawId() <<std::endl;
625 std::cout<<
"Failed to get trapezoid from shape for CSC layer with detid: "
626 << detId.
rawId() <<std::endl;
632 if ( parameters == 0 )
634 std::cout<<
"Parameters empty for CSC layer with detid: "
635 << detId.
rawId() <<std::endl;
640 assert(yAxisOrientation == parameters[0]);
643 assert(centreToIntersection == parameters[1]);
646 assert(yCentre == parameters[2]);
649 assert(phiOfOneEdge == parameters[3]);
652 assert(stripOffset == parameters[4]);
655 assert(angularWidth == parameters[5]);
662 double stripAngle = phiOfOneEdge + yAxisOrientation*(nStrip-(0.5-stripOffset))*angularWidth;
663 double xOfStrip2 = yAxisOrientation*(centreToIntersection-yCentre)*
tan(stripAngle);
665 strip_positions.push_back(xOfStrip1-xOfStrip2);
672 assert(wireSpacingInGroup == parameters[6]);
674 double wireSpacing = 0.0;
678 double extentOfWirePlane = 0.0;
683 extentOfWirePlane = 174.81;
685 extentOfWirePlane = 323.38;
687 else if ( station == 1 && (ring == 1 || ring == 4))
688 extentOfWirePlane = 150.5;
689 else if ( station == 1 && ring == 3 )
690 extentOfWirePlane = 164.47;
691 else if ( station == 2 && ring == 1 )
692 extentOfWirePlane = 189.97;
693 else if ( station == 3 && ring == 1 )
694 extentOfWirePlane = 170.01;
695 else if ( station == 4 && ring == 1 )
696 extentOfWirePlane = 149.73;
699 assert(wireAngle == parameters[7]);
709 double alignmentPinToFirstWire;
710 double yAlignmentFrame = 3.49;
714 if ( ring == 1 || ring == 4 )
716 alignmentPinToFirstWire = 1.065;
717 yAlignmentFrame = 0.0;
721 alignmentPinToFirstWire = 2.85;
724 else if ( station == 4 && ring == 1 )
725 alignmentPinToFirstWire = 3.04;
727 else if ( station == 3 && ring == 1 )
728 alignmentPinToFirstWire = 2.84;
731 alignmentPinToFirstWire = 2.87;
733 double yOfFirstWire = (yAlignmentFrame-length) + alignmentPinToFirstWire;
736 double E = extentOfWirePlane/nWireGroups;
738 for (
int nWireGroup = 1; nWireGroup <= nWireGroups; ++nWireGroup )
741 double yOfWire1 = centerOfWireGroup.
y();
745 double yOfWire2 = yOfFirstWire + ((nWireGroup-1)*E);
746 yOfWire2 += wireSpacing*0.5;
748 double ydiff_local = yOfWire1 - yOfWire2;
749 wire_positions.push_back(ydiff_local);
768 me11_wiresLocal.push_back(ydiff_local);
770 else if ( ring == 2 )
772 me12_wiresLocal.push_back(ydiff_local);
774 else if ( ring == 3 )
776 me13_wiresLocal.push_back(ydiff_local);
778 else if ( ring == 4 )
780 me14_wiresLocal.push_back(ydiff_local);
783 else if ( station == 2 )
787 me21_wiresLocal.push_back(ydiff_local);
789 else if ( ring == 2 )
791 me22_wiresLocal.push_back(ydiff_local);
794 else if ( station == 3 )
798 me31_wiresLocal.push_back(ydiff_local);
800 else if ( ring == 2 )
802 me32_wiresLocal.push_back(ydiff_local);
805 else if ( station == 4 )
809 me41_wiresLocal.push_back(ydiff_local);
811 else if ( ring == 2 )
813 me42_wiresLocal.push_back(ydiff_local);
847 caloGeometry_->getSubdetectorGeometry(detector, subdetector);
849 const std::vector<DetId>& ids = geometry->
getValidDetIds(detector, subdetector);
851 for (
auto it = ids.begin(),
855 unsigned int rawId = (*it).rawId();
861 std::cout <<
"Failed to get points of "<< detname
862 <<
" element with detid: "<< rawId <<std::endl;
871 for (
unsigned int i = 0,
offset = 0;
i < 8; ++
i )
892 for ( TrackerGeometry::DetContainer::const_iterator it = dets.begin(),
897 unsigned int rawId = (*it)->geographicalId().rawId();
903 std::cout <<
"Failed to get matrix of "<< detname
904 <<
" element with detid: "<< rawId <<std::endl;
914 std::cout<<
"Failed to get shape of "<< detname
915 <<
" element with detid: "<< rawId <<std::endl;
930 std::vector<double> pixelLocalXs;
931 std::vector<double> pixelLocalYs;
933 for ( TrackerGeometry::DetContainer::const_iterator it = dets.begin(),
937 unsigned int rawId = (*it)->geographicalId().rawId();
941 if ( parameters == 0 )
943 std::cout<<
"Parameters empty for "<< detname <<
" element with detid: "
944 << rawId <<std::endl;
949 dynamic_cast<const PixelGeomDetUnit*>(
trackerGeometry_->idToDetUnit((*it)->geographicalId())) )
953 int nrows = rpt->nrows();
954 int ncolumns = rpt->ncolumns();
956 assert(parameters[0] == nrows);
957 assert(parameters[1] == ncolumns);
959 for (
int row = 1; row <= nrows; ++row )
961 for (
int column = 1; column <= ncolumns; ++column )
972 std::cout<<
"No topology for "<< detname <<
" "<< rawId <<std::endl;
976 std::cout<<
"No geomDetUnit for "<< detname <<
" "<< rawId <<std::endl;
988 std::vector<double> radialStripLocalXs;
989 std::vector<double> rectangularStripLocalXs;
991 for ( TrackerGeometry::DetContainer::const_iterator it = dets.begin(),
995 unsigned int rawId = (*it)->geographicalId().rawId();
999 if ( parameters == 0 )
1001 std::cout<<
"Parameters empty for "<< detname <<
" element with detid: "
1002 << rawId <<std::endl;
1007 dynamic_cast<const StripGeomDetUnit*>(
trackerGeometry_->idToDet((*it)->geographicalId())) )
1018 assert(parameters[1] == nstrips);
1021 if(
const RadialStripTopology* rst = dynamic_cast<const RadialStripTopology*>(&(det->specificType().specificTopology())) )
1023 assert(parameters[0] == 1);
1024 assert(parameters[3] == rst->yAxisOrientation());
1025 assert(parameters[4] == rst->originToIntersection());
1026 assert(parameters[5] == rst->phiOfOneEdge());
1027 assert(parameters[6] == rst->angularWidth());
1029 for ( uint16_t strip = 1; strip <= nstrips; ++strip )
1031 float stripAngle1 = rst->stripAngle(strip);
1032 float stripAngle2 = parameters[3] * (parameters[5] + strip*parameters[6]);
1034 assert((stripAngle1-stripAngle2) == 0);
1038 float stripX = parameters[4]*
tan(stripAngle2);
1039 radialStripLocalXs.push_back(stripPosition.
x()-stripX);
1043 else if( dynamic_cast<const RectangularStripTopology*>(&(det->specificType().specificTopology())) )
1045 assert(parameters[0] == 2);
1048 for ( uint16_t strip = 1; strip <= nstrips; ++strip )
1051 float stripX = -parameters[1]*0.5*parameters[3];
1052 stripX += strip*parameters[3];
1053 rectangularStripLocalXs.push_back(stripPosition.
x()-stripX);
1057 else if( dynamic_cast<const TrapezoidalStripTopology*>(&(det->specificType().specificTopology())) )
1059 assert(parameters[0] == 3);
1064 std::cout<<
"Failed to get pitch for "<< detname <<
" "<< rawId <<std::endl;
1068 std::cout<<
"Failed cast to StripTopology for "<< detname <<
" "<< rawId <<std::endl;
1076 makeHistogram(hn+
" radial strip localX", radialStripLocalXs);
1077 makeHistogram(hn+
" rectangular strip localX", rectangularStripLocalXs);
1083 const TGeoMatrix*
matrix)
1092 matrix->LocalToMaster(local, global);
1101 double shape_topWidth;
1102 double shape_bottomWidth;
1103 double shape_length;
1104 double shape_thickness;
1106 if ( shape[0] == 1 )
1108 shape_topWidth = shape[2];
1109 shape_bottomWidth = shape[1];
1110 shape_length = shape[4];
1111 shape_thickness = shape[3];
1114 else if ( shape[0] == 2 )
1116 shape_topWidth = shape[1];
1117 shape_bottomWidth = shape[1];
1118 shape_length = shape[2];
1119 shape_thickness = shape[3];
1124 std::cout<<
"Failed to get box or trapezoid from shape"<<std::endl;
1128 double topWidth, bottomWidth;
1129 double length, thickness;
1135 std::array<const float, 4>
const & ps = tpbs->parameters();
1139 bottomWidth = ps[0];
1145 else if ( (dynamic_cast<const RectangularPlaneBounds*>(bounds)) )
1149 bottomWidth = topWidth;
1155 std::cout<<
"Failed to get bounds"<<std::endl;
1168 topWidths_.push_back(fabs(shape_topWidth - topWidth));
1169 bottomWidths_.push_back(fabs(shape_bottomWidth - bottomWidth));
1170 lengths_.push_back(fabs(shape_length - length));
1171 thicknesses_.push_back(fabs(shape_thickness - thickness));
1188 return sqrt((p1.
x()-p2.
x())*(p1.
x()-p2.
x())+
1189 (p1.
y()-p2.
y())*(p1.
y()-p2.
y())+
1190 (p1.
z()-p2.
z())*(p1.
z()-p2.
z()));
1201 std::string gdn = d+
": distance between points in global coordinates";
1204 std::string twn = d +
": absolute difference between top widths (along X)";
1207 std::string bwn = d +
": absolute difference between bottom widths (along X)";
1210 std::string ln = d +
": absolute difference between lengths (along Y)";
1213 std::string tn = d +
": absolute difference between thicknesses (along Z)";
1226 std::vector<double>::iterator it;
1228 it = std::min_element(data.begin(), data.end());
1231 it = std::max_element(data.begin(), data.end());
1234 std::vector<double>::iterator itEnd = data.end();
1236 TH1D
hist(name.c_str(), name.c_str(), 100, minE*(1+0.10), maxE*(1+0.10));
1238 for ( it = data.begin(); it != itEnd; ++it )
1241 hist.GetXaxis()->SetTitle(
"[cm]");
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
virtual int nstrips() const =0
T getUntrackedParameter(std::string const &, T const &) const
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 &)
CornersVec const & getCorners() const
Returns the corner points of this cell's volume.
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_
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.