56 #include <TEveGeoNode.h>
57 #include <TGeoVolume.h>
75 const char* regionName);
150 : infileName_(iConfig.getUntrackedParameter<std::string>(
"infileName")),
151 outfileName_(iConfig.getUntrackedParameter<std::string>(
"outfileName"))
170 std::cout<<
"Validating RPC -z endcap geometry"<<std::endl;
173 std::cout<<
"Validating RPC +z endcap geometry"<<std::endl;
176 std::cout<<
"Validating RPC barrel geometry"<<std::endl;
187 std::cout<<
"Validating DT chamber geometry"<<std::endl;
190 std::cout<<
"Validating DT layer geometry"<<std::endl;
201 std::cout<<
"Validating CSC -z geometry"<<std::endl;
204 std::cout<<
"Validating CSC +z geometry"<<std::endl;
207 std::cout<<
"Validating CSC layer -z geometry"<<std::endl;
210 std::cout<<
"Validating CSC layer +z geometry"<<std::endl;
221 std::cout<<
"Validating TIB geometry and topology"<<std::endl;
225 std::cout<<
"Validating TOB geometry and topology"<<std::endl;
229 std::cout<<
"Validating TEC geometry and topology"<<std::endl;
233 std::cout<<
"Validating TID geometry and topology"<<std::endl;
237 std::cout<<
"Validating PXB geometry and topology"<<std::endl;
241 std::cout<<
"Validating PXF geometry and topology"<<std::endl;
253 std::cout<<
"Validating EB geometry"<<std::endl;
256 std::cout<<
"Validating EE geometry"<<std::endl;
259 std::cout<<
"Validating ES geometry"<<std::endl;
262 std::cout<<
"Validating HB geometry"<<std::endl;
265 std::cout<<
"Validating HE geometry"<<std::endl;
268 std::cout<<
"Validating HO geometry"<<std::endl;
271 std::cout<<
"Validating HF geometry"<<std::endl;
274 std::cout<<
"Validating Castor geometry"<<std::endl;
277 std::cout<<
"Validating ZDC geometry"<<std::endl;
291 std::vector<double> centers;
295 for ( std::vector<RPCRoll*>::const_iterator it = rolls.begin(),
305 if ( rpcDetId.
region() == regionNumber )
314 std::cout<<
"Failed to get matrix of RPC with detid: "
315 << rpcDetId.
rawId() <<std::endl;
325 std::cout<<
"Failed to get shape of RPC with detid: "
326 << rpcDetId.
rawId() <<std::endl;
334 if ( parameters == 0 )
336 std::cout<<
"Parameters empty for RPC with detid: "
337 << rpcDetId.
rawId() <<std::endl;
345 assert(nStrips == parameters[0]);
348 assert(stripLength == parameters[1]);
351 assert(pitch == parameters[2]);
353 float offset = -0.5*nStrips*pitch;
360 centers.push_back(centreOfStrip1.
x()-centreOfStrip2.
x());
366 std::string hn(regionName);
381 for ( std::vector<DTChamber*>::const_iterator it = chambers.begin(),
382 itEnd = chambers.end();
396 std::cout<<
"Failed to get matrix of DT chamber with detid: "
397 << chId.
rawId() <<std::endl;
407 std::cout<<
"Failed to get shape of DT chamber with detid: "
408 << chId.
rawId() <<std::endl;
425 std::vector<double> wire_positions;
427 std::vector<DTLayer*> layers =
dtGeometry_->layers();
429 for ( std::vector<DTLayer*>::const_iterator it = layers.begin(),
430 itEnd = layers.end();
444 std::cout<<
"Failed to get matrix of DT layer with detid: "
445 << layerId.
rawId() <<std::endl;
455 std::cout<<
"Failed to get shape of DT layer with detid: "
456 << layerId.
rawId() <<std::endl;
465 if ( parameters == 0 )
467 std::cout<<
"Parameters empty for DT layer with detid: "
468 << layerId.
rawId() <<std::endl;
473 assert(width == parameters[6]);
476 assert(thickness == parameters[7]);
479 assert(length == parameters[8]);
482 assert(firstChannel == parameters[3]);
485 int nChannels = parameters[5];
486 assert(nChannels == (lastChannel-firstChannel)+1);
488 for (
int wireN = firstChannel; wireN - lastChannel <= 0; ++wireN )
491 double localX2 = (wireN -(firstChannel-1)-0.5)*parameters[0] - nChannels/2.0*parameters[0];
493 wire_positions.push_back(localX1-localX2);
514 for ( std::vector<CSCChamber*>::const_iterator it = chambers.begin(),
515 itEnd = chambers.end();
529 std::cout<<
"Failed to get matrix of CSC chamber with detid: "
530 << detId.
rawId() <<std::endl;
540 std::cout<<
"Failed to get shape of CSC chamber with detid: "
541 << detId.
rawId() <<std::endl;
556 std::vector<double> strip_positions;
557 std::vector<double> wire_positions;
559 std::vector<double> me11_wiresLocal;
560 std::vector<double> me12_wiresLocal;
561 std::vector<double> me13_wiresLocal;
562 std::vector<double> me14_wiresLocal;
563 std::vector<double> me21_wiresLocal;
564 std::vector<double> me22_wiresLocal;
565 std::vector<double> me31_wiresLocal;
566 std::vector<double> me32_wiresLocal;
567 std::vector<double> me41_wiresLocal;
568 std::vector<double> me42_wiresLocal;
572 for ( std::vector<CSCLayer*>::const_iterator it = layers.begin(),
573 itEnd = layers.end();
587 std::cout<<
"Failed to get matrix of CSC layer with detid: "
588 << detId.
rawId() <<std::endl;
598 std::cout<<
"Failed to get shape of CSC layer with detid: "
599 << detId.
rawId() <<std::endl;
614 std::cout<<
"Failed to get trapezoid from shape for CSC layer with detid: "
615 << detId.
rawId() <<std::endl;
621 if ( parameters == 0 )
623 std::cout<<
"Parameters empty for CSC layer with detid: "
624 << detId.
rawId() <<std::endl;
629 assert(yAxisOrientation == parameters[0]);
632 assert(centreToIntersection == parameters[1]);
635 assert(yCentre == parameters[2]);
638 assert(phiOfOneEdge == parameters[3]);
641 assert(stripOffset == parameters[4]);
644 assert(angularWidth == parameters[5]);
651 double stripAngle = phiOfOneEdge + yAxisOrientation*(nStrip-(0.5-stripOffset))*angularWidth;
652 double xOfStrip2 = yAxisOrientation*(centreToIntersection-yCentre)*
tan(stripAngle);
654 strip_positions.push_back(xOfStrip1-xOfStrip2);
661 assert(wireSpacingInGroup == parameters[6]);
663 double wireSpacing = 0.0;
667 double extentOfWirePlane = 0.0;
672 extentOfWirePlane = 174.81;
674 extentOfWirePlane = 323.38;
676 else if ( station == 1 && (ring == 1 || ring == 4))
677 extentOfWirePlane = 150.5;
678 else if ( station == 1 && ring == 3 )
679 extentOfWirePlane = 164.47;
680 else if ( station == 2 && ring == 1 )
681 extentOfWirePlane = 189.97;
682 else if ( station == 3 && ring == 1 )
683 extentOfWirePlane = 170.01;
684 else if ( station == 4 && ring == 1 )
685 extentOfWirePlane = 149.73;
688 assert(wireAngle == parameters[7]);
698 double alignmentPinToFirstWire;
699 double yAlignmentFrame = 3.49;
703 if ( ring == 1 || ring == 4 )
705 alignmentPinToFirstWire = 1.065;
706 yAlignmentFrame = 0.0;
710 alignmentPinToFirstWire = 2.85;
713 else if ( station == 4 && ring == 1 )
714 alignmentPinToFirstWire = 3.04;
716 else if ( station == 3 && ring == 1 )
717 alignmentPinToFirstWire = 2.84;
720 alignmentPinToFirstWire = 2.87;
722 double yOfFirstWire = (yAlignmentFrame-length) + alignmentPinToFirstWire;
725 double E = extentOfWirePlane/nWireGroups;
727 for (
int nWireGroup = 1; nWireGroup <= nWireGroups; ++nWireGroup )
730 double yOfWire1 = centerOfWireGroup.
y();
734 double yOfWire2 = yOfFirstWire + ((nWireGroup-1)*E);
735 yOfWire2 += wireSpacing*0.5;
737 double ydiff_local = yOfWire1 - yOfWire2;
738 wire_positions.push_back(ydiff_local);
757 me11_wiresLocal.push_back(ydiff_local);
759 else if ( ring == 2 )
761 me12_wiresLocal.push_back(ydiff_local);
763 else if ( ring == 3 )
765 me13_wiresLocal.push_back(ydiff_local);
767 else if ( ring == 4 )
769 me14_wiresLocal.push_back(ydiff_local);
772 else if ( station == 2 )
776 me21_wiresLocal.push_back(ydiff_local);
778 else if ( ring == 2 )
780 me22_wiresLocal.push_back(ydiff_local);
783 else if ( station == 3 )
787 me31_wiresLocal.push_back(ydiff_local);
789 else if ( ring == 2 )
791 me32_wiresLocal.push_back(ydiff_local);
794 else if ( station == 4 )
798 me41_wiresLocal.push_back(ydiff_local);
800 else if ( ring == 2 )
802 me42_wiresLocal.push_back(ydiff_local);
809 std::string hn(detname);
836 caloGeometry_->getSubdetectorGeometry(detector, subdetector);
838 const std::vector<DetId>& ids = geometry->
getValidDetIds(detector, subdetector);
840 for (std::vector<DetId>::const_iterator it = ids.begin(),
844 unsigned int rawId = (*it).rawId();
850 std::cout <<
"Failed to get points of "<< detname
851 <<
" element with detid: "<< rawId <<std::endl;
858 assert(corners.
size() == 8);
860 for (
unsigned int i = 0,
offset = 0;
i < 8; ++
i )
881 for ( TrackerGeometry::DetContainer::const_iterator it = dets.begin(),
886 unsigned int rawId = (*it)->geographicalId().rawId();
892 std::cout <<
"Failed to get matrix of "<< detname
893 <<
" element with detid: "<< rawId <<std::endl;
903 std::cout<<
"Failed to get shape of "<< detname
904 <<
" element with detid: "<< rawId <<std::endl;
921 for ( TrackerGeometry::DetUnitContainer::const_iterator it = dets.begin(),
926 unsigned int rawId = (*it)->geographicalId().rawId();
932 std::cout<<
"Failed to get matrix of "<< detname
933 <<
" element with detid: "<< rawId <<std::endl;
944 std::cout<<
"Failed to get shape of "<< detname
945 <<
" element with detid: "<< rawId <<std::endl;
959 std::vector<double> pixelLocalXs;
960 std::vector<double> pixelLocalYs;
962 for ( TrackerGeometry::DetContainer::const_iterator it = dets.begin(),
966 unsigned int rawId = (*it)->geographicalId().rawId();
970 if ( parameters == 0 )
972 std::cout<<
"Parameters empty for "<< detname <<
" element with detid: "
973 << rawId <<std::endl;
978 dynamic_cast<const PixelGeomDetUnit*>(
trackerGeometry_->idToDetUnit((*it)->geographicalId())) )
982 int nrows = rpt->nrows();
983 int ncolumns = rpt->ncolumns();
985 assert(parameters[0] == nrows);
986 assert(parameters[1] == ncolumns);
988 for (
int row = 1; row <= nrows; ++row )
990 for (
int column = 1; column <= ncolumns; ++column )
1001 std::cout<<
"No topology for "<< detname <<
" "<< rawId <<std::endl;
1005 std::cout<<
"No geomDetUnit for "<< detname <<
" "<< rawId <<std::endl;
1008 std::string hn(detname);
1015 const char* detname)
1017 std::vector<double> radialStripLocalXs;
1018 std::vector<double> rectangularStripLocalXs;
1020 for ( TrackerGeometry::DetContainer::const_iterator it = dets.begin(),
1024 unsigned int rawId = (*it)->geographicalId().rawId();
1028 if ( parameters == 0 )
1030 std::cout<<
"Parameters empty for "<< detname <<
" element with detid: "
1031 << rawId <<std::endl;
1036 dynamic_cast<const StripGeomDetUnit*>(
trackerGeometry_->idToDet((*it)->geographicalId())) )
1047 assert(parameters[1] == nstrips);
1050 if(
const RadialStripTopology* rst = dynamic_cast<const RadialStripTopology*>(&(det->specificType().specificTopology())) )
1052 assert(parameters[0] == 1);
1053 assert(parameters[3] == rst->yAxisOrientation());
1054 assert(parameters[4] == rst->originToIntersection());
1055 assert(parameters[5] == rst->phiOfOneEdge());
1056 assert(parameters[6] == rst->angularWidth());
1060 float stripAngle1 = rst->stripAngle(
strip);
1061 float stripAngle2 = parameters[5] + parameters[3]*
strip*parameters[6];
1063 assert((stripAngle1-stripAngle2) == 0);
1067 float stripX = parameters[3]*parameters[4]*
tan(stripAngle2);
1068 radialStripLocalXs.push_back(stripPosition.
x()-stripX);
1072 else if( dynamic_cast<const RectangularStripTopology*>(&(det->specificType().specificTopology())) )
1074 assert(parameters[0] == 2);
1075 assert(parameters[3] == st->
pitch());
1080 float stripX = -parameters[1]*0.5*parameters[3];
1081 stripX +=
strip*parameters[3];
1082 rectangularStripLocalXs.push_back(stripPosition.
x()-stripX);
1086 else if( dynamic_cast<const TrapezoidalStripTopology*>(&(det->specificType().specificTopology())) )
1088 assert(parameters[0] == 3);
1089 assert(parameters[3] == st->
pitch());
1093 std::cout<<
"Failed to get pitch for "<< detname <<
" "<< rawId <<std::endl;
1097 std::cout<<
"Failed cast to StripTopology for "<< detname <<
" "<< rawId <<std::endl;
1104 std::string hn(detname);
1105 makeHistogram(hn+
" radial strip localX", radialStripLocalXs);
1106 makeHistogram(hn+
" rectangular strip localX", rectangularStripLocalXs);
1112 const TGeoMatrix*
matrix)
1121 matrix->LocalToMaster(local, global);
1130 double shape_topWidth;
1131 double shape_bottomWidth;
1132 double shape_length;
1133 double shape_thickness;
1135 if ( shape[0] == 1 )
1137 shape_topWidth = shape[2];
1138 shape_bottomWidth = shape[1];
1139 shape_length = shape[4];
1140 shape_thickness = shape[3];
1143 else if ( shape[0] == 2 )
1145 shape_topWidth = shape[1];
1146 shape_bottomWidth = shape[1];
1147 shape_length = shape[2];
1148 shape_thickness = shape[3];
1153 std::cout<<
"Failed to get box or trapezoid from shape"<<std::endl;
1157 double topWidth, bottomWidth;
1158 double length, thickness;
1164 std::vector<float> ps = tpbs->parameters();
1166 assert(ps.size() == 4);
1168 bottomWidth = ps[0];
1174 else if ( (dynamic_cast<const RectangularPlaneBounds*>(bounds)) )
1178 bottomWidth = topWidth;
1184 std::cout<<
"Failed to get bounds"<<std::endl;
1197 topWidths_.push_back(fabs(shape_topWidth - topWidth));
1198 bottomWidths_.push_back(fabs(shape_bottomWidth - bottomWidth));
1199 lengths_.push_back(fabs(shape_length - length));
1200 thicknesses_.push_back(fabs(shape_thickness - thickness));
1217 return sqrt((p1.
x()-p2.
x())*(p1.
x()-p2.
x())+
1218 (p1.
y()-p2.
y())*(p1.
y()-p2.
y())+
1219 (p1.
z()-p2.
z())*(p1.
z()-p2.
z()));
1228 std::string d(detector);
1230 std::string gdn = d+
": distance between points in global coordinates";
1233 std::string twn = d +
": absolute difference between top widths (along X)";
1236 std::string bwn = d +
": absolute difference between bottom widths (along X)";
1239 std::string ln = d +
": absolute difference between lengths (along Y)";
1242 std::string tn = d +
": absolute difference between thicknesses (along Z)";
1255 std::vector<double>::iterator it;
1257 it = std::min_element(data.begin(), data.end());
1260 it = std::max_element(data.begin(), data.end());
1263 std::vector<double>::iterator itEnd = data.end();
1265 TH1D
hist(name.c_str(), name.c_str(), 100, minE*(1+0.10), maxE*(1+0.10));
1267 for ( it = data.begin(); it != itEnd; ++it )
1270 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_
const CSCWireTopology * wireTopology() const
virtual float length() const =0
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.
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)
float centreToIntersection() const
static char chambers[TOTALCHAMBERS][20]
int numberOfStrips() const
std::vector< GeomDet * > DetContainer
double wireSpacing() const
const TGeoMatrix * getMatrix(unsigned int id) const
const StripTopology & specificTopology() const
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)
std::vector< GeomDetUnit * > DetUnitContainer
void validateCaloGeometry(DetId::Detector detector, int subdetector, const char *detname)
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)
void validatePixelTopology(const TrackerGeometry::DetContainer &dets, const char *detname)
unsigned int offset(bool)
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_
LocalPoint localCenterOfWireGroup(int wireGroup) const
const Bounds & bounds() const
const CSCStripTopology * topology() const
float yCentreOfStripPlane() 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]
const BoundPlane & surface() const
The nominal surface of the GeomDet.
int yAxisOrientation() const
std::vector< double > thicknesses_
virtual float pitch() const =0
virtual void analyze(const edm::Event &, const edm::EventSetup &)
virtual LocalPoint localPosition(float strip) const =0
float angularWidth() const
float phiOfOneEdge() const
void validateCSChamberGeometry(const int endcap, const char *detname)
void validateStripTopology(const TrackerGeometry::DetContainer &dets, const char *detname)
std::vector< double > lengths_
virtual float width() const =0
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
virtual const CornersVec & getCorners() const =0
Returns the corner points of this cell's volume.
std::vector< double > globalDistances_
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.