55 #include <TEveGeoNode.h>
56 #include <TGeoVolume.h>
71 virtual void endJob()
override;
74 const char* regionName);
149 : infileName_(iConfig.getUntrackedParameter<std::
string>(
"infileName")),
150 outfileName_(iConfig.getUntrackedParameter<std::
string>(
"outfileName"))
169 std::cout<<
"Validating RPC -z endcap geometry"<<std::endl;
172 std::cout<<
"Validating RPC +z endcap geometry"<<std::endl;
175 std::cout<<
"Validating RPC barrel geometry"<<std::endl;
186 std::cout<<
"Validating DT chamber geometry"<<std::endl;
189 std::cout<<
"Validating DT layer geometry"<<std::endl;
200 std::cout<<
"Validating CSC -z geometry"<<std::endl;
203 std::cout<<
"Validating CSC +z geometry"<<std::endl;
206 std::cout<<
"Validating CSC layer -z geometry"<<std::endl;
209 std::cout<<
"Validating CSC layer +z geometry"<<std::endl;
220 std::cout<<
"Validating TIB geometry and topology"<<std::endl;
224 std::cout<<
"Validating TOB geometry and topology"<<std::endl;
228 std::cout<<
"Validating TEC geometry and topology"<<std::endl;
232 std::cout<<
"Validating TID geometry and topology"<<std::endl;
236 std::cout<<
"Validating PXB geometry and topology"<<std::endl;
240 std::cout<<
"Validating PXF geometry and topology"<<std::endl;
252 std::cout<<
"Validating EB geometry"<<std::endl;
255 std::cout<<
"Validating EE geometry"<<std::endl;
258 std::cout<<
"Validating ES geometry"<<std::endl;
261 std::cout<<
"Validating HB geometry"<<std::endl;
264 std::cout<<
"Validating HE geometry"<<std::endl;
267 std::cout<<
"Validating HO geometry"<<std::endl;
270 std::cout<<
"Validating HF geometry"<<std::endl;
273 std::cout<<
"Validating Castor geometry"<<std::endl;
276 std::cout<<
"Validating ZDC geometry"<<std::endl;
290 std::vector<double> centers;
294 for (
auto it = rolls.begin(),
304 if ( rpcDetId.
region() == regionNumber )
313 std::cout<<
"Failed to get matrix of RPC with detid: "
314 << rpcDetId.
rawId() <<std::endl;
324 std::cout<<
"Failed to get shape of RPC with detid: "
325 << rpcDetId.
rawId() <<std::endl;
333 if ( parameters == 0 )
335 std::cout<<
"Parameters empty for RPC with detid: "
336 << rpcDetId.
rawId() <<std::endl;
344 assert(nStrips == parameters[0]);
347 assert(stripLength == parameters[1]);
350 assert(pitch == parameters[2]);
352 float offset = -0.5*nStrips*pitch;
354 for (
int strip = 1; strip <= roll->
nstrips(); ++strip )
359 centers.push_back(centreOfStrip1.
x()-centreOfStrip2.
x());
395 std::cout<<
"Failed to get matrix of DT chamber with detid: "
396 << chId.
rawId() <<std::endl;
406 std::cout<<
"Failed to get shape of DT chamber with detid: "
407 << chId.
rawId() <<std::endl;
424 std::vector<double> wire_positions;
428 for (
auto it =
layers.begin(),
443 std::cout<<
"Failed to get matrix of DT layer with detid: "
444 << layerId.
rawId() <<std::endl;
454 std::cout<<
"Failed to get shape of DT layer with detid: "
455 << layerId.
rawId() <<std::endl;
464 if ( parameters == 0 )
466 std::cout<<
"Parameters empty for DT layer with detid: "
467 << layerId.
rawId() <<std::endl;
472 assert(width == parameters[6]);
475 assert(thickness == parameters[7]);
478 assert(length == parameters[8]);
481 assert(firstChannel == parameters[3]);
485 assert(nChannels == (lastChannel-firstChannel)+1);
487 for (
int wireN = firstChannel; wireN - lastChannel <= 0; ++wireN )
490 double localX2 = (wireN -(firstChannel-1)-0.5)*parameters[0] - nChannels/2.0*parameters[0];
492 wire_positions.push_back(localX1-localX2);
528 std::cout<<
"Failed to get matrix of CSC chamber with detid: "
529 << detId.
rawId() <<std::endl;
539 std::cout<<
"Failed to get shape of CSC chamber with detid: "
540 << detId.
rawId() <<std::endl;
555 std::vector<double> strip_positions;
556 std::vector<double> wire_positions;
558 std::vector<double> me11_wiresLocal;
559 std::vector<double> me12_wiresLocal;
560 std::vector<double> me13_wiresLocal;
561 std::vector<double> me14_wiresLocal;
562 std::vector<double> me21_wiresLocal;
563 std::vector<double> me22_wiresLocal;
564 std::vector<double> me31_wiresLocal;
565 std::vector<double> me32_wiresLocal;
566 std::vector<double> me41_wiresLocal;
567 std::vector<double> me42_wiresLocal;
571 for (
auto it =
layers.begin(),
586 std::cout<<
"Failed to get matrix of CSC layer with detid: "
587 << detId.
rawId() <<std::endl;
597 std::cout<<
"Failed to get shape of CSC layer with detid: "
598 << detId.
rawId() <<std::endl;
613 std::cout<<
"Failed to get trapezoid from shape for CSC layer with detid: "
614 << detId.
rawId() <<std::endl;
620 if ( parameters == 0 )
622 std::cout<<
"Parameters empty for CSC layer with detid: "
623 << detId.
rawId() <<std::endl;
628 assert(yAxisOrientation == parameters[0]);
631 assert(centreToIntersection == parameters[1]);
634 assert(yCentre == parameters[2]);
637 assert(phiOfOneEdge == parameters[3]);
640 assert(stripOffset == parameters[4]);
643 assert(angularWidth == parameters[5]);
650 double stripAngle = phiOfOneEdge + yAxisOrientation*(nStrip-(0.5-stripOffset))*angularWidth;
651 double xOfStrip2 = yAxisOrientation*(centreToIntersection-yCentre)*
tan(stripAngle);
653 strip_positions.push_back(xOfStrip1-xOfStrip2);
660 assert(wireSpacingInGroup == parameters[6]);
662 double wireSpacing = 0.0;
666 double extentOfWirePlane = 0.0;
671 extentOfWirePlane = 174.81;
673 extentOfWirePlane = 323.38;
675 else if ( station == 1 && (ring == 1 || ring == 4))
676 extentOfWirePlane = 150.5;
677 else if ( station == 1 && ring == 3 )
678 extentOfWirePlane = 164.47;
679 else if ( station == 2 && ring == 1 )
680 extentOfWirePlane = 189.97;
681 else if ( station == 3 && ring == 1 )
682 extentOfWirePlane = 170.01;
683 else if ( station == 4 && ring == 1 )
684 extentOfWirePlane = 149.73;
687 assert(wireAngle == parameters[7]);
697 double alignmentPinToFirstWire;
698 double yAlignmentFrame = 3.49;
702 if ( ring == 1 || ring == 4 )
704 alignmentPinToFirstWire = 1.065;
705 yAlignmentFrame = 0.0;
709 alignmentPinToFirstWire = 2.85;
712 else if ( station == 4 && ring == 1 )
713 alignmentPinToFirstWire = 3.04;
715 else if ( station == 3 && ring == 1 )
716 alignmentPinToFirstWire = 2.84;
719 alignmentPinToFirstWire = 2.87;
721 double yOfFirstWire = (yAlignmentFrame-length) + alignmentPinToFirstWire;
724 double E = extentOfWirePlane/nWireGroups;
726 for (
int nWireGroup = 1; nWireGroup <= nWireGroups; ++nWireGroup )
729 double yOfWire1 = centerOfWireGroup.
y();
733 double yOfWire2 = yOfFirstWire + ((nWireGroup-1)*E);
734 yOfWire2 += wireSpacing*0.5;
736 double ydiff_local = yOfWire1 - yOfWire2;
737 wire_positions.push_back(ydiff_local);
756 me11_wiresLocal.push_back(ydiff_local);
758 else if ( ring == 2 )
760 me12_wiresLocal.push_back(ydiff_local);
762 else if ( ring == 3 )
764 me13_wiresLocal.push_back(ydiff_local);
766 else if ( ring == 4 )
768 me14_wiresLocal.push_back(ydiff_local);
771 else if ( station == 2 )
775 me21_wiresLocal.push_back(ydiff_local);
777 else if ( ring == 2 )
779 me22_wiresLocal.push_back(ydiff_local);
782 else if ( station == 3 )
786 me31_wiresLocal.push_back(ydiff_local);
788 else if ( ring == 2 )
790 me32_wiresLocal.push_back(ydiff_local);
793 else if ( station == 4 )
797 me41_wiresLocal.push_back(ydiff_local);
799 else if ( ring == 2 )
801 me42_wiresLocal.push_back(ydiff_local);
835 caloGeometry_->getSubdetectorGeometry(detector, subdetector);
837 const std::vector<DetId>& ids = geometry->
getValidDetIds(detector, subdetector);
839 for (
auto it = ids.begin(),
843 unsigned int rawId = (*it).rawId();
849 std::cout <<
"Failed to get points of "<< detname
850 <<
" element with detid: "<< rawId <<std::endl;
857 assert(corners.
size() == 8);
859 for (
unsigned int i = 0,
offset = 0;
i < 8; ++
i )
880 for ( TrackerGeometry::DetContainer::const_iterator it = dets.begin(),
885 unsigned int rawId = (*it)->geographicalId().rawId();
891 std::cout <<
"Failed to get matrix of "<< detname
892 <<
" element with detid: "<< rawId <<std::endl;
902 std::cout<<
"Failed to get shape of "<< detname
903 <<
" element with detid: "<< rawId <<std::endl;
920 for ( TrackerGeometry::DetUnitContainer::const_iterator it = dets.begin(),
925 unsigned int rawId = (*it)->geographicalId().rawId();
931 std::cout<<
"Failed to get matrix of "<< detname
932 <<
" element with detid: "<< rawId <<std::endl;
943 std::cout<<
"Failed to get shape of "<< detname
944 <<
" element with detid: "<< rawId <<std::endl;
958 std::vector<double> pixelLocalXs;
959 std::vector<double> pixelLocalYs;
961 for ( TrackerGeometry::DetContainer::const_iterator it = dets.begin(),
965 unsigned int rawId = (*it)->geographicalId().rawId();
969 if ( parameters == 0 )
971 std::cout<<
"Parameters empty for "<< detname <<
" element with detid: "
972 << rawId <<std::endl;
977 dynamic_cast<const PixelGeomDetUnit*>(
trackerGeometry_->idToDetUnit((*it)->geographicalId())) )
981 int nrows = rpt->nrows();
982 int ncolumns = rpt->ncolumns();
984 assert(parameters[0] == nrows);
985 assert(parameters[1] == ncolumns);
987 for (
int row = 1; row <= nrows; ++row )
1000 std::cout<<
"No topology for "<< detname <<
" "<< rawId <<std::endl;
1004 std::cout<<
"No geomDetUnit for "<< detname <<
" "<< rawId <<std::endl;
1014 const char* detname)
1016 std::vector<double> radialStripLocalXs;
1017 std::vector<double> rectangularStripLocalXs;
1019 for ( TrackerGeometry::DetContainer::const_iterator it = dets.begin(),
1023 unsigned int rawId = (*it)->geographicalId().rawId();
1027 if ( parameters == 0 )
1029 std::cout<<
"Parameters empty for "<< detname <<
" element with detid: "
1030 << rawId <<std::endl;
1035 dynamic_cast<const StripGeomDetUnit*>(
trackerGeometry_->idToDet((*it)->geographicalId())) )
1046 assert(parameters[1] == nstrips);
1049 if(
const RadialStripTopology* rst = dynamic_cast<const RadialStripTopology*>(&(det->specificType().specificTopology())) )
1051 assert(parameters[0] == 1);
1052 assert(parameters[3] == rst->yAxisOrientation());
1053 assert(parameters[4] == rst->originToIntersection());
1054 assert(parameters[5] == rst->phiOfOneEdge());
1055 assert(parameters[6] == rst->angularWidth());
1057 for ( uint16_t strip = 1; strip <= nstrips; ++strip )
1059 float stripAngle1 = rst->stripAngle(strip);
1060 float stripAngle2 = parameters[3] * (parameters[5] + strip*parameters[6]);
1062 assert((stripAngle1-stripAngle2) == 0);
1066 float stripX = parameters[4]*
tan(stripAngle2);
1067 radialStripLocalXs.push_back(stripPosition.
x()-stripX);
1071 else if( dynamic_cast<const RectangularStripTopology*>(&(det->specificType().specificTopology())) )
1073 assert(parameters[0] == 2);
1074 assert(parameters[3] == st->
pitch());
1076 for ( uint16_t strip = 1; strip <= nstrips; ++strip )
1079 float stripX = -parameters[1]*0.5*parameters[3];
1080 stripX += strip*parameters[3];
1081 rectangularStripLocalXs.push_back(stripPosition.
x()-stripX);
1085 else if( dynamic_cast<const TrapezoidalStripTopology*>(&(det->specificType().specificTopology())) )
1087 assert(parameters[0] == 3);
1088 assert(parameters[3] == st->
pitch());
1092 std::cout<<
"Failed to get pitch for "<< detname <<
" "<< rawId <<std::endl;
1096 std::cout<<
"Failed cast to StripTopology for "<< detname <<
" "<< rawId <<std::endl;
1104 makeHistogram(hn+
" radial strip localX", radialStripLocalXs);
1105 makeHistogram(hn+
" rectangular strip localX", rectangularStripLocalXs);
1111 const TGeoMatrix*
matrix)
1120 matrix->LocalToMaster(local, global);
1129 double shape_topWidth;
1130 double shape_bottomWidth;
1131 double shape_length;
1132 double shape_thickness;
1134 if ( shape[0] == 1 )
1136 shape_topWidth = shape[2];
1137 shape_bottomWidth = shape[1];
1138 shape_length = shape[4];
1139 shape_thickness = shape[3];
1142 else if ( shape[0] == 2 )
1144 shape_topWidth = shape[1];
1145 shape_bottomWidth = shape[1];
1146 shape_length = shape[2];
1147 shape_thickness = shape[3];
1152 std::cout<<
"Failed to get box or trapezoid from shape"<<std::endl;
1156 double topWidth, bottomWidth;
1157 double length, thickness;
1163 std::array<const float, 4>
const & ps = tpbs->parameters();
1165 assert(ps.size() == 4);
1167 bottomWidth = ps[0];
1173 else if ( (dynamic_cast<const RectangularPlaneBounds*>(bounds)) )
1177 bottomWidth = topWidth;
1183 std::cout<<
"Failed to get bounds"<<std::endl;
1196 topWidths_.push_back(fabs(shape_topWidth - topWidth));
1197 bottomWidths_.push_back(fabs(shape_bottomWidth - bottomWidth));
1198 lengths_.push_back(fabs(shape_length - length));
1199 thicknesses_.push_back(fabs(shape_thickness - thickness));
1216 return sqrt((p1.
x()-p2.
x())*(p1.
x()-p2.
x())+
1217 (p1.
y()-p2.
y())*(p1.
y()-p2.
y())+
1218 (p1.
z()-p2.
z())*(p1.
z()-p2.
z()));
1229 std::string gdn = d+
": distance between points in global coordinates";
1232 std::string twn = d +
": absolute difference between top widths (along X)";
1235 std::string bwn = d +
": absolute difference between bottom widths (along X)";
1238 std::string ln = d +
": absolute difference between lengths (along Y)";
1241 std::string tn = d +
": absolute difference between thicknesses (along Z)";
1254 std::vector<double>::iterator it;
1256 it = std::min_element(data.begin(), data.end());
1259 it = std::max_element(data.begin(), data.end());
1262 std::vector<double>::iterator itEnd = data.end();
1264 TH1D
hist(name.c_str(), name.c_str(), 100, minE*(1+0.10), maxE*(1+0.10));
1266 for ( it = data.begin(); it != itEnd; ++it )
1269 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
unsigned int offset(bool)
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
std::vector< GeomDetUnit const * > DetUnitContainer
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.