CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
ValidateGeometry Class Reference
Inheritance diagram for ValidateGeometry:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

 ValidateGeometry (const edm::ParameterSet &)
 
 ~ValidateGeometry () override
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
 ~EDAnalyzer () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void beginJob () override
 
void clearData ()
 
void compareShape (const GeomDet *det, const float *shape)
 
void compareTransform (const GlobalPoint &point, const TGeoMatrix *matrix)
 
bool dataEmpty ()
 
void endJob () override
 
double getDistance (const GlobalPoint &point1, const GlobalPoint &point2)
 
void makeHistogram (const std::string &name, std::vector< double > &data)
 
void makeHistograms (const char *detector)
 
void validateCaloGeometry (DetId::Detector detector, int subdetector, const char *detname)
 
void validateCSChamberGeometry (const int endcap, const char *detname)
 
void validateCSCLayerGeometry (const int endcap, const char *detname)
 
void validateDTChamberGeometry ()
 
void validateDTLayerGeometry ()
 
void validatePixelTopology (const TrackerGeometry::DetContainer &dets, const char *detname)
 
void validateRPCGeometry (const int regionNumber, const char *regionName)
 
void validateStripTopology (const TrackerGeometry::DetContainer &dets, const char *detname)
 
void validateTrackerGeometry (const TrackerGeometry::DetContainer &dets, const char *detname)
 

Private Attributes

std::vector< double > bottomWidths_
 
edm::ESHandle< CaloGeometrycaloGeometry_
 
edm::ESHandle< CSCGeometrycscGeometry_
 
bool doCalo_
 
bool doMuon_
 
bool doTracker_
 
edm::ESHandle< DTGeometrydtGeometry_
 
FWGeometry fwGeometry_
 
std::vector< double > globalDistances_
 
std::string infileName_
 
std::vector< double > lengths_
 
TFile * outFile_
 
std::string outfileName_
 
edm::ESHandle< RPCGeometryrpcGeometry_
 
std::vector< double > thicknesses_
 
std::vector< double > topWidths_
 
edm::ESHandle< TrackerGeometrytrackerGeometry_
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsInputProcessBlocks ()
 
static bool wantsProcessBlocks ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag) noexcept
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Detailed Description

Definition at line 62 of file ValidateGeometry.cc.

Constructor & Destructor Documentation

◆ ValidateGeometry()

ValidateGeometry::ValidateGeometry ( const edm::ParameterSet iConfig)
explicit

Definition at line 135 of file ValidateGeometry.cc.

136  : infileName_(iConfig.getUntrackedParameter<std::string>("infileName")),
137  outfileName_(iConfig.getUntrackedParameter<std::string>("outfileName")) {
138  doTracker_ = iConfig.getUntrackedParameter<bool>("Tracker", true);
139  doMuon_ = iConfig.getUntrackedParameter<bool>("Muon", true);
140  doCalo_ = iConfig.getUntrackedParameter<bool>("Calo", true);
141 
143 
144  outFile_ = new TFile(outfileName_.c_str(), "RECREATE");
145 }

References doCalo_, doMuon_, doTracker_, fwGeometry_, edm::ParameterSet::getUntrackedParameter(), infileName_, FWGeometry::loadMap(), outFile_, and outfileName_.

◆ ~ValidateGeometry()

ValidateGeometry::~ValidateGeometry ( )
override

Definition at line 147 of file ValidateGeometry.cc.

147 {}

Member Function Documentation

◆ analyze()

void ValidateGeometry::analyze ( const edm::Event event,
const edm::EventSetup eventSetup 
)
overrideprivatevirtual

Implements edm::EDAnalyzer.

Definition at line 149 of file ValidateGeometry.cc.

149  {
150  if (doMuon_) {
151  eventSetup.get<MuonGeometryRecord>().get(rpcGeometry_);
152 
153  if (rpcGeometry_.isValid()) {
154  std::cout << "Validating RPC -z endcap geometry" << std::endl;
155  validateRPCGeometry(-1, "RPC -z endcap");
156 
157  std::cout << "Validating RPC +z endcap geometry" << std::endl;
158  validateRPCGeometry(+1, "RPC +z endcap");
159 
160  std::cout << "Validating RPC barrel geometry" << std::endl;
161  validateRPCGeometry(0, "RPC barrel");
162  } else
163  fwLog(fwlog::kWarning) << "Invalid RPC geometry" << std::endl;
164 
165  eventSetup.get<MuonGeometryRecord>().get(dtGeometry_);
166 
167  if (dtGeometry_.isValid()) {
168  std::cout << "Validating DT chamber geometry" << std::endl;
170 
171  std::cout << "Validating DT layer geometry" << std::endl;
173  } else
174  fwLog(fwlog::kWarning) << "Invalid DT geometry" << std::endl;
175 
176  eventSetup.get<MuonGeometryRecord>().get(cscGeometry_);
177 
178  if (cscGeometry_.isValid()) {
179  std::cout << "Validating CSC -z geometry" << std::endl;
180  validateCSChamberGeometry(-1, "CSC chamber -z endcap");
181 
182  std::cout << "Validating CSC +z geometry" << std::endl;
183  validateCSChamberGeometry(+1, "CSC chamber +z endcap");
184 
185  std::cout << "Validating CSC layer -z geometry" << std::endl;
186  validateCSCLayerGeometry(-1, "CSC layer -z endcap");
187 
188  std::cout << "Validating CSC layer +z geometry" << std::endl;
189  validateCSCLayerGeometry(+1, "CSC layer +z endcap");
190  } else
191  fwLog(fwlog::kWarning) << "Invalid CSC geometry" << std::endl;
192  }
193 
194  if (doTracker_) {
196 
197  if (trackerGeometry_.isValid()) {
198  std::cout << "Validating TIB geometry and topology" << std::endl;
201 
202  std::cout << "Validating TOB geometry and topology" << std::endl;
205 
206  std::cout << "Validating TEC geometry and topology" << std::endl;
209 
210  std::cout << "Validating TID geometry and topology" << std::endl;
213 
214  std::cout << "Validating PXB geometry and topology" << std::endl;
217 
218  std::cout << "Validating PXF geometry and topology" << std::endl;
221  } else
222  fwLog(fwlog::kWarning) << "Invalid Tracker geometry" << std::endl;
223  }
224 
225  if (doCalo_) {
226  eventSetup.get<CaloGeometryRecord>().get(caloGeometry_);
227 
228  if (caloGeometry_.isValid()) {
229  std::cout << "Validating EB geometry" << std::endl;
231 
232  std::cout << "Validating EE geometry" << std::endl;
234 
235  std::cout << "Validating ES geometry" << std::endl;
237 
238  std::cout << "Validating HB geometry" << std::endl;
240 
241  std::cout << "Validating HE geometry" << std::endl;
243 
244  std::cout << "Validating HO geometry" << std::endl;
246 
247  std::cout << "Validating HF geometry" << std::endl;
249 
250  std::cout << "Validating Castor geometry" << std::endl;
252 
253  std::cout << "Validating ZDC geometry" << std::endl;
255  } else
256  fwLog(fwlog::kWarning) << "Invalid Calo geometry" << std::endl;
257  }
258 }

References DetId::Calo, caloGeometry_, gather_cfg::cout, cscGeometry_, TrackerGeometry::detsPXB(), TrackerGeometry::detsPXF(), TrackerGeometry::detsTEC(), TrackerGeometry::detsTIB(), TrackerGeometry::detsTID(), TrackerGeometry::detsTOB(), doCalo_, doMuon_, doTracker_, dtGeometry_, DetId::Ecal, EcalBarrel, EcalEndcap, EcalPreshower, fwLog, edm::EventSetup::get(), get, DetId::Hcal, HcalBarrel, HcalEndcap, HcalForward, HcalOuter, edm::ESHandleBase::isValid(), fwlog::kWarning, rpcGeometry_, HcalZDCDetId::SubdetectorId, HcalCastorDetId::SubdetectorId, trackerGeometry_, validateCaloGeometry(), validateCSChamberGeometry(), validateCSCLayerGeometry(), validateDTChamberGeometry(), validateDTLayerGeometry(), validatePixelTopology(), validateRPCGeometry(), validateStripTopology(), and validateTrackerGeometry().

◆ beginJob()

void ValidateGeometry::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 1032 of file ValidateGeometry.cc.

1032 { outFile_->cd(); }

References outFile_.

◆ clearData()

void ValidateGeometry::clearData ( )
inlineprivate

◆ compareShape()

void ValidateGeometry::compareShape ( const GeomDet det,
const float *  shape 
)
private

Definition at line 905 of file ValidateGeometry.cc.

905  {
906  double shape_topWidth;
907  double shape_bottomWidth;
908  double shape_length;
909  double shape_thickness;
910 
911  if (shape[0] == 1) {
912  shape_topWidth = shape[2];
913  shape_bottomWidth = shape[1];
914  shape_length = shape[4];
915  shape_thickness = shape[3];
916  }
917 
918  else if (shape[0] == 2) {
919  shape_topWidth = shape[1];
920  shape_bottomWidth = shape[1];
921  shape_length = shape[2];
922  shape_thickness = shape[3];
923  }
924 
925  else {
926  std::cout << "Failed to get box or trapezoid from shape" << std::endl;
927  return;
928  }
929 
930  double topWidth, bottomWidth;
931  double length, thickness;
932 
933  const Bounds* bounds = &(det->surface().bounds());
934 
935  if (const TrapezoidalPlaneBounds* tpbs = dynamic_cast<const TrapezoidalPlaneBounds*>(bounds)) {
936  std::array<const float, 4> const& ps = tpbs->parameters();
937 
938  assert(ps.size() == 4);
939 
940  bottomWidth = ps[0];
941  topWidth = ps[1];
942  thickness = ps[2];
943  length = ps[3];
944  }
945 
946  else if ((dynamic_cast<const RectangularPlaneBounds*>(bounds))) {
947  length = det->surface().bounds().length() * 0.5;
948  topWidth = det->surface().bounds().width() * 0.5;
949  bottomWidth = topWidth;
950  thickness = det->surface().bounds().thickness() * 0.5;
951  }
952 
953  else {
954  std::cout << "Failed to get bounds" << std::endl;
955  return;
956  }
957 
958  //assert((tgeotrap && trapezoid) || (tgeobbox && rectangle));
959 
960  /*
961  std::cout<<"topWidth: "<< shape_topWidth <<" "<< topWidth <<std::endl;
962  std::cout<<"bottomWidth: "<< shape_bottomWidth <<" "<< bottomWidth <<std::endl;
963  std::cout<<"length: "<< shape_length <<" "<< length <<std::endl;
964  std::cout<<"thickness: "<< shape_thickness <<" "<< thickness <<std::endl;
965  */
966 
967  topWidths_.push_back(fabs(shape_topWidth - topWidth));
968  bottomWidths_.push_back(fabs(shape_bottomWidth - bottomWidth));
969  lengths_.push_back(fabs(shape_length - length));
970  thicknesses_.push_back(fabs(shape_thickness - thickness));
971 
972  return;
973 }

References cms::cuda::assert(), bottomWidths_, Surface::bounds(), gather_cfg::cout, Bounds::length(), lengths_, GeomDet::surface(), Bounds::thickness(), Calorimetry_cff::thickness, thicknesses_, topWidths_, and Bounds::width().

Referenced by validateCSChamberGeometry(), validateCSCLayerGeometry(), validateDTChamberGeometry(), validateDTLayerGeometry(), validateRPCGeometry(), and validateTrackerGeometry().

◆ compareTransform()

void ValidateGeometry::compareTransform ( const GlobalPoint point,
const TGeoMatrix *  matrix 
)
private

Definition at line 894 of file ValidateGeometry.cc.

894  {
895  double local[3] = {0.0, 0.0, 0.0};
896 
897  double global[3];
898 
899  matrix->LocalToMaster(local, global);
900 
901  double distance = getDistance(GlobalPoint(global[0], global[1], global[2]), gp);
902  globalDistances_.push_back(distance);
903 }

References HLT_FULL_cff::distance, getDistance(), globalDistances_, runTauDisplay::gp, DTRecHitClients_cfi::local, and makeMuonMisalignmentScenario::matrix.

Referenced by validateCSChamberGeometry(), validateCSCLayerGeometry(), validateDTChamberGeometry(), validateDTLayerGeometry(), validateRPCGeometry(), and validateTrackerGeometry().

◆ dataEmpty()

bool ValidateGeometry::dataEmpty ( )
inlineprivate

Definition at line 125 of file ValidateGeometry.cc.

125  {
126  return (globalDistances_.empty() && topWidths_.empty() && bottomWidths_.empty() && lengths_.empty() &&
127  thicknesses_.empty());
128  }

References bottomWidths_, globalDistances_, lengths_, thicknesses_, and topWidths_.

◆ endJob()

void ValidateGeometry::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 1034 of file ValidateGeometry.cc.

1034  {
1035  std::cout << "Done. " << std::endl;
1036  std::cout << "Results written to " << outfileName_ << std::endl;
1037  outFile_->Close();
1038 }

References gather_cfg::cout, outFile_, and outfileName_.

◆ getDistance()

double ValidateGeometry::getDistance ( const GlobalPoint point1,
const GlobalPoint point2 
)
private

Definition at line 975 of file ValidateGeometry.cc.

975  {
976  /*
977  std::cout<<"X: "<< p1.x() <<" "<< p2.x() <<std::endl;
978  std::cout<<"Y: "<< p1.y() <<" "<< p2.y() <<std::endl;
979  std::cout<<"Z: "<< p1.z() <<" "<< p2.z() <<std::endl;
980  */
981 
982  return sqrt((p1.x() - p2.x()) * (p1.x() - p2.x()) + (p1.y() - p2.y()) * (p1.y() - p2.y()) +
983  (p1.z() - p2.z()) * (p1.z() - p2.z()));
984 }

References p1, p2, and mathSSE::sqrt().

Referenced by compareTransform(), and validateCaloGeometry().

◆ makeHistogram()

void ValidateGeometry::makeHistogram ( const std::string &  name,
std::vector< double > &  data 
)
private

Definition at line 1009 of file ValidateGeometry.cc.

1009  {
1010  if (data.empty())
1011  return;
1012 
1013  std::vector<double>::iterator it;
1014 
1015  it = std::min_element(data.begin(), data.end());
1016  double minE = *it;
1017 
1018  it = std::max_element(data.begin(), data.end());
1019  double maxE = *it;
1020 
1021  std::vector<double>::iterator itEnd = data.end();
1022 
1023  TH1D hist(name.c_str(), name.c_str(), 100, minE * (1 + 0.10), maxE * (1 + 0.10));
1024 
1025  for (it = data.begin(); it != itEnd; ++it)
1026  hist.Fill(*it);
1027 
1028  hist.GetXaxis()->SetTitle("[cm]");
1029  hist.Write();
1030 }

References data, compare::hist, HLT_FULL_cff::maxE, and Skims_PA_cff::name.

Referenced by makeHistograms(), validateCSCLayerGeometry(), validateDTLayerGeometry(), validatePixelTopology(), validateRPCGeometry(), and validateStripTopology().

◆ makeHistograms()

void ValidateGeometry::makeHistograms ( const char *  detector)
private

Definition at line 986 of file ValidateGeometry.cc.

986  {
987  outFile_->cd();
988 
990 
991  std::string gdn = d + ": distance between points in global coordinates";
993 
994  std::string twn = d + ": absolute difference between top widths (along X)";
996 
997  std::string bwn = d + ": absolute difference between bottom widths (along X)";
999 
1000  std::string ln = d + ": absolute difference between lengths (along Y)";
1001  makeHistogram(ln, lengths_);
1002 
1003  std::string tn = d + ": absolute difference between thicknesses (along Z)";
1005 
1006  return;
1007 }

References bottomWidths_, ztail::d, hgcalTestNeighbor_cfi::detector, globalDistances_, lengths_, makeHistogram(), outFile_, AlCaHLTBitMon_QueryRunRegistry::string, thicknesses_, and topWidths_.

Referenced by validateCaloGeometry(), validateCSChamberGeometry(), validateCSCLayerGeometry(), validateDTChamberGeometry(), validateDTLayerGeometry(), validateRPCGeometry(), and validateTrackerGeometry().

◆ validateCaloGeometry()

void ValidateGeometry::validateCaloGeometry ( DetId::Detector  detector,
int  subdetector,
const char *  detname 
)
private

Definition at line 704 of file ValidateGeometry.cc.

704  {
705  clearData();
706 
708 
709  const std::vector<DetId>& ids = geometry->getValidDetIds(detector, subdetector);
710 
711  for (auto it = ids.begin(), iEnd = ids.end(); it != iEnd; ++it) {
712  unsigned int rawId = (*it).rawId();
713 
714  const float* points = fwGeometry_.getCorners(rawId);
715 
716  if (points == nullptr) {
717  std::cout << "Failed to get points of " << detname << " element with detid: " << rawId << std::endl;
718  continue;
719  }
720 
721  auto cellGeometry = geometry->getGeometry(*it);
722  const CaloCellGeometry::CornersVec& corners = cellGeometry->getCorners();
723 
724  assert(corners.size() == 8);
725 
726  for (unsigned int i = 0, offset = 0; i < 8; ++i) {
727  offset = 2 * i;
728 
729  double distance = getDistance(GlobalPoint(points[i + offset], points[i + 1 + offset], points[i + 2 + offset]),
730  GlobalPoint(corners[i].x(), corners[i].y(), corners[i].z()));
731 
732  globalDistances_.push_back(distance);
733  }
734  }
735 
736  makeHistograms(detname);
737 }

References cms::cuda::assert(), caloGeometry_, clearData(), gather_cfg::cout, hgcalTestNeighbor_cfi::detector, HLT_FULL_cff::distance, fwGeometry_, FWGeometry::getCorners(), getDistance(), CaloGeometry::getSubdetectorGeometry(), globalDistances_, mps_fire::i, makeHistograms(), hltrates_dqm_sourceclient-live_cfg::offset, HLT_FULL_cff::points, EZArrayFL< T >::size(), subdetector, x, y, and z.

Referenced by analyze().

◆ validateCSChamberGeometry()

void ValidateGeometry::validateCSChamberGeometry ( const int  endcap,
const char *  detname 
)
private

Definition at line 438 of file ValidateGeometry.cc.

438  {
439  clearData();
440 
441  auto const& chambers = cscGeometry_->chambers();
442 
443  for (auto it = chambers.begin(), itEnd = chambers.end(); it != itEnd; ++it) {
444  const CSCChamber* chamber = *it;
445 
446  if (chamber && chamber->id().endcap() == endcap) {
447  DetId detId = chamber->geographicalId();
448  GlobalPoint gp = chamber->surface().toGlobal(LocalPoint(0.0, 0.0, 0.0));
449 
450  const TGeoMatrix* matrix = fwGeometry_.getMatrix(detId.rawId());
451 
452  if (!matrix) {
453  std::cout << "Failed to get matrix of CSC chamber with detid: " << detId.rawId() << std::endl;
454  continue;
455  }
456 
458 
459  const float* shape = fwGeometry_.getShapePars(detId.rawId());
460 
461  if (!shape) {
462  std::cout << "Failed to get shape of CSC chamber with detid: " << detId.rawId() << std::endl;
463  continue;
464  }
465 
466  compareShape(chamber, shape);
467  }
468  }
469 
470  makeHistograms(detname);
471 }

References relativeConstraints::chamber, CSCGeometry::chambers(), chambers, clearData(), compareShape(), compareTransform(), gather_cfg::cout, cscGeometry_, makeMuonMisalignmentScenario::endcap, fwGeometry_, FWGeometry::getMatrix(), FWGeometry::getShapePars(), runTauDisplay::gp, makeHistograms(), makeMuonMisalignmentScenario::matrix, and DetId::rawId().

Referenced by analyze().

◆ validateCSCLayerGeometry()

void ValidateGeometry::validateCSCLayerGeometry ( const int  endcap,
const char *  detname 
)
private

Definition at line 473 of file ValidateGeometry.cc.

473  {
474  clearData();
475  std::vector<double> strip_positions;
476  std::vector<double> wire_positions;
477 
478  std::vector<double> me11_wiresLocal;
479  std::vector<double> me12_wiresLocal;
480  std::vector<double> me13_wiresLocal;
481  std::vector<double> me14_wiresLocal;
482  std::vector<double> me21_wiresLocal;
483  std::vector<double> me22_wiresLocal;
484  std::vector<double> me31_wiresLocal;
485  std::vector<double> me32_wiresLocal;
486  std::vector<double> me41_wiresLocal;
487  std::vector<double> me42_wiresLocal;
488 
489  auto const& layers = cscGeometry_->layers();
490 
491  for (auto it = layers.begin(), itEnd = layers.end(); it != itEnd; ++it) {
492  const CSCLayer* layer = *it;
493 
494  if (layer && layer->id().endcap() == endcap) {
495  DetId detId = layer->geographicalId();
496  GlobalPoint gp = layer->surface().toGlobal(LocalPoint(0.0, 0.0, 0.0));
497 
498  const TGeoMatrix* matrix = fwGeometry_.getMatrix(detId.rawId());
499 
500  if (!matrix) {
501  std::cout << "Failed to get matrix of CSC layer with detid: " << detId.rawId() << std::endl;
502  continue;
503  }
504 
506 
507  const float* shape = fwGeometry_.getShapePars(detId.rawId());
508 
509  if (!shape) {
510  std::cout << "Failed to get shape of CSC layer with detid: " << detId.rawId() << std::endl;
511  continue;
512  }
513 
514  compareShape(layer, shape);
515 
516  double length;
517 
518  if (shape[0] == 1) {
519  length = shape[4];
520  }
521 
522  else {
523  std::cout << "Failed to get trapezoid from shape for CSC layer with detid: " << detId.rawId() << std::endl;
524  continue;
525  }
526 
527  const float* parameters = fwGeometry_.getParameters(detId.rawId());
528 
529  if (parameters == nullptr) {
530  std::cout << "Parameters empty for CSC layer with detid: " << detId.rawId() << std::endl;
531  continue;
532  }
533 
534  int yAxisOrientation = layer->geometry()->topology()->yAxisOrientation();
535  assert(yAxisOrientation == parameters[0]);
536 
537  float centreToIntersection = layer->geometry()->topology()->centreToIntersection();
538  assert(centreToIntersection == parameters[1]);
539 
540  float yCentre = layer->geometry()->topology()->yCentreOfStripPlane();
541  assert(yCentre == parameters[2]);
542 
543  float phiOfOneEdge = layer->geometry()->topology()->phiOfOneEdge();
544  assert(phiOfOneEdge == parameters[3]);
545 
546  float stripOffset = layer->geometry()->topology()->stripOffset();
547  assert(stripOffset == parameters[4]);
548 
549  float angularWidth = layer->geometry()->topology()->angularWidth();
550  assert(angularWidth == parameters[5]);
551 
552  for (int nStrip = 1; nStrip <= layer->geometry()->numberOfStrips(); ++nStrip) {
553  float xOfStrip1 = layer->geometry()->xOfStrip(nStrip);
554 
555  double stripAngle = phiOfOneEdge + yAxisOrientation * (nStrip - (0.5 - stripOffset)) * angularWidth;
556  double xOfStrip2 = yAxisOrientation * (centreToIntersection - yCentre) * tan(stripAngle);
557 
558  strip_positions.push_back(xOfStrip1 - xOfStrip2);
559  }
560 
561  int station = layer->id().station();
562  int ring = layer->id().ring();
563 
564  double wireSpacingInGroup = layer->geometry()->wireTopology()->wireSpacing();
565  assert(wireSpacingInGroup == parameters[6]);
566 
567  double wireSpacing = 0.0;
568  // we calculate an average wire group
569  // spacing from radialExtentOfTheWirePlane / numOfWireGroups
570 
571  double extentOfWirePlane = 0.0;
572 
573  if (ring == 2) {
574  if (station == 1)
575  extentOfWirePlane = 174.81; //wireSpacing = 174.81/64;
576  else
577  extentOfWirePlane = 323.38; //wireSpacing = 323.38/64;
578  } else if (station == 1 && (ring == 1 || ring == 4))
579  extentOfWirePlane = 150.5; //wireSpacing = 150.5/48;
580  else if (station == 1 && ring == 3)
581  extentOfWirePlane = 164.47; //wireSpacing = 164.47/32;
582  else if (station == 2 && ring == 1)
583  extentOfWirePlane = 189.97; //wireSpacing = 189.97/112;
584  else if (station == 3 && ring == 1)
585  extentOfWirePlane = 170.01; //wireSpacing = 170.01/96;
586  else if (station == 4 && ring == 1)
587  extentOfWirePlane = 149.73; //wireSpacing = 149.73/96;
588 
589  float wireAngle = layer->geometry()->wireTopology()->wireAngle();
590  assert(wireAngle == parameters[7]);
591 
592  //float cosWireAngle = cos(wireAngle);
593 
594  /* NOTE
595  Some parameters don't seem available in a public interface
596  so have to perhaps hard-code. This may not be too bad as there
597  seems to be a lot of degeneracy.
598  */
599 
600  double alignmentPinToFirstWire;
601  double yAlignmentFrame = 3.49;
602 
603  if (station == 1) {
604  if (ring == 1 || ring == 4) {
605  alignmentPinToFirstWire = 1.065;
606  yAlignmentFrame = 0.0;
607  }
608 
609  else // ME12, ME 13
610  alignmentPinToFirstWire = 2.85;
611  }
612 
613  else if (station == 4 && ring == 1)
614  alignmentPinToFirstWire = 3.04;
615 
616  else if (station == 3 && ring == 1)
617  alignmentPinToFirstWire = 2.84;
618 
619  else // ME21, ME22, ME32, ME42
620  alignmentPinToFirstWire = 2.87;
621 
622  double yOfFirstWire = (yAlignmentFrame - length) + alignmentPinToFirstWire;
623 
624  int nWireGroups = layer->geometry()->numberOfWireGroups();
625  double E = extentOfWirePlane / nWireGroups;
626 
627  for (int nWireGroup = 1; nWireGroup <= nWireGroups; ++nWireGroup) {
628  LocalPoint centerOfWireGroup = layer->geometry()->localCenterOfWireGroup(nWireGroup);
629  double yOfWire1 = centerOfWireGroup.y();
630 
631  //double yOfWire2 = (-0.5 - (nWireGroups*0.5 - 1) + (nWireGroup-1))*E;
632  //yOfWire2 += 0.5*E;
633  double yOfWire2 = yOfFirstWire + ((nWireGroup - 1) * E);
634  yOfWire2 += wireSpacing * 0.5;
635 
636  double ydiff_local = yOfWire1 - yOfWire2;
637  wire_positions.push_back(ydiff_local);
638 
639  //GlobalPoint globalPoint = layer->surface().toGlobal(LocalPoint(0.0,yOfWire1,0.0));
640 
641  /*
642  float fwLocalPoint[3] =
643  {
644  0.0, yOfWire2, 0.0
645  };
646 
647  float fwGlobalPoint[3];
648  fwGeometry_.localToGlobal(detId.rawId(), fwLocalPoint, fwGlobalPoint);
649  double ydiff_global = globalPoint.y() - fwGlobalPoint[1];
650  */
651 
652  if (station == 1) {
653  if (ring == 1) {
654  me11_wiresLocal.push_back(ydiff_local);
655  } else if (ring == 2) {
656  me12_wiresLocal.push_back(ydiff_local);
657  } else if (ring == 3) {
658  me13_wiresLocal.push_back(ydiff_local);
659  } else if (ring == 4) {
660  me14_wiresLocal.push_back(ydiff_local);
661  }
662  } else if (station == 2) {
663  if (ring == 1) {
664  me21_wiresLocal.push_back(ydiff_local);
665  } else if (ring == 2) {
666  me22_wiresLocal.push_back(ydiff_local);
667  }
668  } else if (station == 3) {
669  if (ring == 1) {
670  me31_wiresLocal.push_back(ydiff_local);
671  } else if (ring == 2) {
672  me32_wiresLocal.push_back(ydiff_local);
673  }
674  } else if (station == 4) {
675  if (ring == 1) {
676  me41_wiresLocal.push_back(ydiff_local);
677  } else if (ring == 2) {
678  me42_wiresLocal.push_back(ydiff_local);
679  }
680  }
681  }
682  }
683  }
684 
685  std::string hn(detname);
686  makeHistogram(hn + ": xOfStrip", strip_positions);
687 
688  makeHistogram(hn + ": local yOfWire", wire_positions);
689 
690  makeHistogram("ME11: local yOfWire", me11_wiresLocal);
691  makeHistogram("ME12: local yOfWire", me12_wiresLocal);
692  makeHistogram("ME13: local yOfWire", me13_wiresLocal);
693  makeHistogram("ME14: local yOfWire", me14_wiresLocal);
694  makeHistogram("ME21: local yOfWire", me21_wiresLocal);
695  makeHistogram("ME22: local yOfWire", me22_wiresLocal);
696  makeHistogram("ME31: local yOfWire", me31_wiresLocal);
697  makeHistogram("ME32: local yOfWire", me32_wiresLocal);
698  makeHistogram("ME41: local yOfWire", me41_wiresLocal);
699  makeHistogram("ME42: local yOfWire", me42_wiresLocal);
700 
701  makeHistograms(detname);
702 }

References CSCRadialStripTopology::angularWidth(), cms::cuda::assert(), CSCRadialStripTopology::centreToIntersection(), clearData(), compareShape(), compareTransform(), gather_cfg::cout, cscGeometry_, CSCDetId::endcap(), makeMuonMisalignmentScenario::endcap, fwGeometry_, GeomDet::geographicalId(), CSCLayer::geometry(), FWGeometry::getMatrix(), FWGeometry::getParameters(), FWGeometry::getShapePars(), runTauDisplay::gp, CSCLayer::id(), hgcalTopologyTester_cfi::layers, CSCGeometry::layers(), CSCLayerGeometry::localCenterOfWireGroup(), makeHistogram(), makeHistograms(), makeMuonMisalignmentScenario::matrix, CSCLayerGeometry::numberOfStrips(), CSCLayerGeometry::numberOfWireGroups(), CSCRadialStripTopology::phiOfOneEdge(), DetId::rawId(), CSCDetId::ring(), relativeConstraints::ring, relativeConstraints::station, CSCDetId::station(), AlCaHLTBitMon_QueryRunRegistry::string, OffsetRadialStripTopology::stripOffset(), GeomDet::surface(), funct::tan(), Surface::toGlobal(), CSCLayerGeometry::topology(), CSCWireTopology::wireAngle(), CSCWireTopology::wireSpacing(), CSCLayerGeometry::wireTopology(), CSCLayerGeometry::xOfStrip(), PV3DBase< T, PVType, FrameType >::y(), CSCRadialStripTopology::yAxisOrientation(), and CSCRadialStripTopology::yCentreOfStripPlane().

Referenced by analyze().

◆ validateDTChamberGeometry()

void ValidateGeometry::validateDTChamberGeometry ( )
private

Definition at line 332 of file ValidateGeometry.cc.

332  {
333  clearData();
334 
335  auto const& chambers = dtGeometry_->chambers();
336 
337  for (auto it = chambers.begin(), itEnd = chambers.end(); it != itEnd; ++it) {
338  const DTChamber* chamber = *it;
339 
340  if (chamber) {
341  DTChamberId chId = chamber->id();
342  GlobalPoint gp = chamber->surface().toGlobal(LocalPoint(0.0, 0.0, 0.0));
343 
344  const TGeoMatrix* matrix = fwGeometry_.getMatrix(chId.rawId());
345 
346  if (!matrix) {
347  std::cout << "Failed to get matrix of DT chamber with detid: " << chId.rawId() << std::endl;
348  continue;
349  }
350 
352 
353  const float* shape = fwGeometry_.getShapePars(chId.rawId());
354 
355  if (!shape) {
356  std::cout << "Failed to get shape of DT chamber with detid: " << chId.rawId() << std::endl;
357  continue;
358  }
359 
360  compareShape(chamber, shape);
361  }
362  }
363 
364  makeHistograms("DT chamber");
365 }

References relativeConstraints::chamber, DTGeometry::chambers(), chambers, clearData(), compareShape(), compareTransform(), gather_cfg::cout, dtGeometry_, fwGeometry_, FWGeometry::getMatrix(), FWGeometry::getShapePars(), runTauDisplay::gp, makeHistograms(), makeMuonMisalignmentScenario::matrix, and DetId::rawId().

Referenced by analyze().

◆ validateDTLayerGeometry()

void ValidateGeometry::validateDTLayerGeometry ( )
private

Definition at line 367 of file ValidateGeometry.cc.

367  {
368  clearData();
369 
370  std::vector<double> wire_positions;
371 
372  auto const& layers = dtGeometry_->layers();
373 
374  for (auto it = layers.begin(), itEnd = layers.end(); it != itEnd; ++it) {
375  const DTLayer* layer = *it;
376 
377  if (layer) {
378  DTLayerId layerId = layer->id();
379  GlobalPoint gp = layer->surface().toGlobal(LocalPoint(0.0, 0.0, 0.0));
380 
381  const TGeoMatrix* matrix = fwGeometry_.getMatrix(layerId.rawId());
382 
383  if (!matrix) {
384  std::cout << "Failed to get matrix of DT layer with detid: " << layerId.rawId() << std::endl;
385  continue;
386  }
387 
389 
390  const float* shape = fwGeometry_.getShapePars(layerId.rawId());
391 
392  if (!shape) {
393  std::cout << "Failed to get shape of DT layer with detid: " << layerId.rawId() << std::endl;
394  continue;
395  }
396 
397  compareShape(layer, shape);
398 
399  const float* parameters = fwGeometry_.getParameters(layerId.rawId());
400 
401  if (parameters == nullptr) {
402  std::cout << "Parameters empty for DT layer with detid: " << layerId.rawId() << std::endl;
403  continue;
404  }
405 
406  float width = layer->surface().bounds().width();
407  assert(width == parameters[6]);
408 
409  float thickness = layer->surface().bounds().thickness();
410  assert(thickness == parameters[7]);
411 
412  float length = layer->surface().bounds().length();
413  assert(length == parameters[8]);
414 
415  int firstChannel = layer->specificTopology().firstChannel();
416  assert(firstChannel == parameters[3]);
417 
418  int lastChannel = layer->specificTopology().lastChannel();
419  int nChannels = parameters[5];
420  assert(nChannels == (lastChannel - firstChannel) + 1);
421 
422  for (int wireN = firstChannel; wireN - lastChannel <= 0; ++wireN) {
423  double localX1 = layer->specificTopology().wirePosition(wireN);
424  double localX2 = (wireN - (firstChannel - 1) - 0.5) * parameters[0] - nChannels / 2.0 * parameters[0];
425 
426  wire_positions.push_back(localX1 - localX2);
427 
428  //std::cout<<"wireN, localXpos: "<< wireN <<" "<< localX1 <<" "<< localX2 <<std::endl;
429  }
430  }
431  }
432 
433  makeHistogram("DT layer wire localX", wire_positions);
434 
435  makeHistograms("DT layer");
436 }

References cms::cuda::assert(), Surface::bounds(), clearData(), compareShape(), compareTransform(), gather_cfg::cout, dtGeometry_, DTTopology::firstChannel(), fwGeometry_, FWGeometry::getMatrix(), FWGeometry::getParameters(), FWGeometry::getShapePars(), runTauDisplay::gp, DTLayer::id(), DTTopology::lastChannel(), hgcalTopologyTester_cfi::layers, DTGeometry::layers(), Bounds::length(), makeHistogram(), makeHistograms(), makeMuonMisalignmentScenario::matrix, ecaldqm::nChannels, DetId::rawId(), DTLayer::specificTopology(), GeomDet::surface(), Bounds::thickness(), Calorimetry_cff::thickness, Surface::toGlobal(), ApeEstimator_cff::width, Bounds::width(), and DTTopology::wirePosition().

Referenced by analyze().

◆ validatePixelTopology()

void ValidateGeometry::validatePixelTopology ( const TrackerGeometry::DetContainer dets,
const char *  detname 
)
private

Definition at line 769 of file ValidateGeometry.cc.

769  {
770  std::vector<double> pixelLocalXs;
771  std::vector<double> pixelLocalYs;
772 
773  for (TrackerGeometry::DetContainer::const_iterator it = dets.begin(), itEnd = dets.end(); it != itEnd; ++it) {
774  unsigned int rawId = (*it)->geographicalId().rawId();
775 
776  const float* parameters = fwGeometry_.getParameters(rawId);
777 
778  if (parameters == nullptr) {
779  std::cout << "Parameters empty for " << detname << " element with detid: " << rawId << std::endl;
780  continue;
781  }
782 
783  if (const PixelGeomDetUnit* det =
784  dynamic_cast<const PixelGeomDetUnit*>(trackerGeometry_->idToDetUnit((*it)->geographicalId()))) {
785  if (const PixelTopology* rpt = &det->specificTopology()) {
786  int nrows = rpt->nrows();
787  int ncolumns = rpt->ncolumns();
788 
789  for (int row = 1; row <= nrows; ++row) {
790  for (int column = 1; column <= ncolumns; ++column) {
791  LocalPoint localPoint = rpt->localPosition(MeasurementPoint(row, column));
792 
793  pixelLocalXs.push_back(localPoint.x() - fireworks::pixelLocalX(row, parameters));
794  pixelLocalYs.push_back(localPoint.y() - fireworks::pixelLocalY(column, parameters));
795  }
796  }
797  }
798 
799  else
800  std::cout << "No topology for " << detname << " " << rawId << std::endl;
801  }
802 
803  else
804  std::cout << "No geomDetUnit for " << detname << " " << rawId << std::endl;
805  }
806 
807  std::string hn(detname);
808  makeHistogram(hn + " pixelLocalX", pixelLocalXs);
809  makeHistogram(hn + " pixelLocalY", pixelLocalYs);
810 }

References gather_cfg::cout, fwGeometry_, FWGeometry::getParameters(), TrackerGeometry::idToDetUnit(), makeHistogram(), fireworks::pixelLocalX(), fireworks::pixelLocalY(), AlCaHLTBitMon_QueryRunRegistry::string, trackerGeometry_, PV3DBase< T, PVType, FrameType >::x(), and PV3DBase< T, PVType, FrameType >::y().

Referenced by analyze().

◆ validateRPCGeometry()

void ValidateGeometry::validateRPCGeometry ( const int  regionNumber,
const char *  regionName 
)
private

Definition at line 260 of file ValidateGeometry.cc.

260  {
261  clearData();
262 
263  std::vector<double> centers;
264 
265  auto const& rolls = rpcGeometry_->rolls();
266 
267  for (auto it = rolls.begin(), itEnd = rolls.end(); it != itEnd; ++it) {
268  const RPCRoll* roll = *it;
269 
270  if (roll) {
271  RPCDetId rpcDetId = roll->id();
272 
273  if (rpcDetId.region() == regionNumber) {
274  const GeomDetUnit* det = rpcGeometry_->idToDetUnit(rpcDetId);
275  GlobalPoint gp = det->surface().toGlobal(LocalPoint(0.0, 0.0, 0.0));
276 
277  const TGeoMatrix* matrix = fwGeometry_.getMatrix(rpcDetId.rawId());
278 
279  if (!matrix) {
280  std::cout << "Failed to get matrix of RPC with detid: " << rpcDetId.rawId() << std::endl;
281  continue;
282  }
283 
285 
286  const float* shape = fwGeometry_.getShapePars(rpcDetId.rawId());
287 
288  if (!shape) {
289  std::cout << "Failed to get shape of RPC with detid: " << rpcDetId.rawId() << std::endl;
290  continue;
291  }
292 
293  compareShape(det, shape);
294 
295  const float* parameters = fwGeometry_.getParameters(rpcDetId.rawId());
296 
297  if (parameters == nullptr) {
298  std::cout << "Parameters empty for RPC with detid: " << rpcDetId.rawId() << std::endl;
299  continue;
300  }
301 
302  // Yes, I know that below I'm comparing the equivalence
303  // of floating point numbers
304 
305  int nStrips = roll->nstrips();
306  assert(nStrips == parameters[0]);
307 
308  float stripLength = roll->specificTopology().stripLength();
309  assert(stripLength == parameters[1]);
310 
311  float pitch = roll->specificTopology().pitch();
312  assert(pitch == parameters[2]);
313 
314  float offset = -0.5 * nStrips * pitch;
315 
316  for (int strip = 1; strip <= roll->nstrips(); ++strip) {
317  LocalPoint centreOfStrip1 = roll->centreOfStrip(strip);
318  LocalPoint centreOfStrip2 = LocalPoint((strip - 0.5) * pitch + offset, 0.0);
319 
320  centers.push_back(centreOfStrip1.x() - centreOfStrip2.x());
321  }
322  }
323  }
324  }
325 
326  std::string hn(regionName);
327  makeHistogram(hn + ": centreOfStrip", centers);
328 
329  makeHistograms(regionName);
330 }

References cms::cuda::assert(), RPCRoll::centreOfStrip(), clearData(), compareShape(), compareTransform(), gather_cfg::cout, fwGeometry_, FWGeometry::getMatrix(), FWGeometry::getParameters(), FWGeometry::getShapePars(), runTauDisplay::gp, RPCRoll::id(), RPCGeometry::idToDetUnit(), makeHistogram(), makeHistograms(), makeMuonMisalignmentScenario::matrix, RPCRoll::nstrips(), me0TriggerPseudoDigis_cff::nStrips, hltrates_dqm_sourceclient-live_cfg::offset, StripTopology::pitch(), DetId::rawId(), RPCDetId::region(), RPCGeometry::rolls(), rpcGeometry_, RPCRoll::specificTopology(), AlCaHLTBitMon_QueryRunRegistry::string, digitizers_cfi::strip, StripTopology::stripLength(), GeomDet::surface(), Surface::toGlobal(), and PV3DBase< T, PVType, FrameType >::x().

Referenced by analyze().

◆ validateStripTopology()

void ValidateGeometry::validateStripTopology ( const TrackerGeometry::DetContainer dets,
const char *  detname 
)
private

Definition at line 812 of file ValidateGeometry.cc.

812  {
813  std::vector<double> radialStripLocalXs;
814  std::vector<double> rectangularStripLocalXs;
815 
816  for (TrackerGeometry::DetContainer::const_iterator it = dets.begin(), itEnd = dets.end(); it != itEnd; ++it) {
817  unsigned int rawId = (*it)->geographicalId().rawId();
818 
819  const float* parameters = fwGeometry_.getParameters(rawId);
820 
821  if (parameters == nullptr) {
822  std::cout << "Parameters empty for " << detname << " element with detid: " << rawId << std::endl;
823  continue;
824  }
825 
826  if (const StripGeomDetUnit* det =
827  dynamic_cast<const StripGeomDetUnit*>(trackerGeometry_->idToDet((*it)->geographicalId()))) {
828  // NOTE: why the difference in dets vs. units between these and pixels? The dynamic cast above
829  // fails for many of the detids...
830 
831  const StripTopology* st = dynamic_cast<const StripTopology*>(&det->specificTopology());
832 
833  if (st) {
834  //assert(parameters[0] == 0);
835  int nstrips = st->nstrips();
836  assert(parameters[1] == nstrips);
837  assert(parameters[2] == st->stripLength());
838 
839  if (const RadialStripTopology* rst =
840  dynamic_cast<const RadialStripTopology*>(&(det->specificType().specificTopology()))) {
841  assert(parameters[0] == 1);
842  assert(parameters[3] == rst->yAxisOrientation());
843  assert(parameters[4] == rst->originToIntersection());
844  assert(parameters[5] == rst->phiOfOneEdge());
845  assert(parameters[6] == rst->angularWidth());
846 
847  for (uint16_t strip = 1; strip <= nstrips; ++strip) {
848  float stripAngle1 = rst->stripAngle(strip);
849  float stripAngle2 = parameters[3] * (parameters[5] + strip * parameters[6]);
850 
851  assert((stripAngle1 - stripAngle2) == 0);
852 
853  LocalPoint stripPosition = st->localPosition(strip);
854 
855  float stripX = parameters[4] * tan(stripAngle2);
856  radialStripLocalXs.push_back(stripPosition.x() - stripX);
857  }
858  }
859 
860  else if (dynamic_cast<const RectangularStripTopology*>(&(det->specificType().specificTopology()))) {
861  assert(parameters[0] == 2);
862  assert(parameters[3] == st->pitch());
863 
864  for (uint16_t strip = 1; strip <= nstrips; ++strip) {
865  LocalPoint stripPosition = st->localPosition(strip);
866  float stripX = -parameters[1] * 0.5 * parameters[3];
867  stripX += strip * parameters[3];
868  rectangularStripLocalXs.push_back(stripPosition.x() - stripX);
869  }
870  }
871 
872  else if (dynamic_cast<const TrapezoidalStripTopology*>(&(det->specificType().specificTopology()))) {
873  assert(parameters[0] == 3);
874  assert(parameters[3] == st->pitch());
875  }
876 
877  else
878  std::cout << "Failed to get pitch for " << detname << " " << rawId << std::endl;
879  }
880 
881  else
882  std::cout << "Failed cast to StripTopology for " << detname << " " << rawId << std::endl;
883  }
884 
885  //else
886  // std::cout<<"Failed cast to StripGeomDetUnit for "<< detname <<" "<< rawId <<std::endl;
887  }
888 
889  std::string hn(detname);
890  makeHistogram(hn + " radial strip localX", radialStripLocalXs);
891  makeHistogram(hn + " rectangular strip localX", rectangularStripLocalXs);
892 }

References cms::cuda::assert(), gather_cfg::cout, fwGeometry_, FWGeometry::getParameters(), TrackerGeometry::idToDet(), StripTopology::localPosition(), makeHistogram(), StripTopology::nstrips(), StripTopology::pitch(), AlCaHLTBitMon_QueryRunRegistry::string, digitizers_cfi::strip, StripTopology::stripLength(), funct::tan(), trackerGeometry_, and PV3DBase< T, PVType, FrameType >::x().

Referenced by analyze().

◆ validateTrackerGeometry()

void ValidateGeometry::validateTrackerGeometry ( const TrackerGeometry::DetContainer dets,
const char *  detname 
)
private

Definition at line 739 of file ValidateGeometry.cc.

739  {
740  clearData();
741 
742  for (TrackerGeometry::DetContainer::const_iterator it = dets.begin(), itEnd = dets.end(); it != itEnd; ++it) {
743  GlobalPoint gp =
744  (trackerGeometry_->idToDet((*it)->geographicalId()))->surface().toGlobal(LocalPoint(0.0, 0.0, 0.0));
745  unsigned int rawId = (*it)->geographicalId().rawId();
746 
747  const TGeoMatrix* matrix = fwGeometry_.getMatrix(rawId);
748 
749  if (!matrix) {
750  std::cout << "Failed to get matrix of " << detname << " element with detid: " << rawId << std::endl;
751  continue;
752  }
753 
755 
756  const float* shape = fwGeometry_.getShapePars(rawId);
757 
758  if (!shape) {
759  std::cout << "Failed to get shape of " << detname << " element with detid: " << rawId << std::endl;
760  continue;
761  }
762 
763  compareShape(*it, shape);
764  }
765 
766  makeHistograms(detname);
767 }

References clearData(), compareShape(), compareTransform(), gather_cfg::cout, fwGeometry_, FWGeometry::getMatrix(), FWGeometry::getShapePars(), runTauDisplay::gp, TrackerGeometry::idToDet(), makeHistograms(), makeMuonMisalignmentScenario::matrix, and trackerGeometry_.

Referenced by analyze().

Member Data Documentation

◆ bottomWidths_

std::vector<double> ValidateGeometry::bottomWidths_
private

Definition at line 113 of file ValidateGeometry.cc.

Referenced by clearData(), compareShape(), dataEmpty(), and makeHistograms().

◆ caloGeometry_

edm::ESHandle<CaloGeometry> ValidateGeometry::caloGeometry_
private

Definition at line 104 of file ValidateGeometry.cc.

Referenced by analyze(), and validateCaloGeometry().

◆ cscGeometry_

edm::ESHandle<CSCGeometry> ValidateGeometry::cscGeometry_
private

◆ doCalo_

bool ValidateGeometry::doCalo_
private

Definition at line 132 of file ValidateGeometry.cc.

Referenced by analyze(), and ValidateGeometry().

◆ doMuon_

bool ValidateGeometry::doMuon_
private

Definition at line 131 of file ValidateGeometry.cc.

Referenced by analyze(), and ValidateGeometry().

◆ doTracker_

bool ValidateGeometry::doTracker_
private

Definition at line 130 of file ValidateGeometry.cc.

Referenced by analyze(), and ValidateGeometry().

◆ dtGeometry_

edm::ESHandle<DTGeometry> ValidateGeometry::dtGeometry_
private

◆ fwGeometry_

FWGeometry ValidateGeometry::fwGeometry_
private

◆ globalDistances_

std::vector<double> ValidateGeometry::globalDistances_
private

◆ infileName_

std::string ValidateGeometry::infileName_
private

Definition at line 98 of file ValidateGeometry.cc.

Referenced by ValidateGeometry().

◆ lengths_

std::vector<double> ValidateGeometry::lengths_
private

Definition at line 114 of file ValidateGeometry.cc.

Referenced by clearData(), compareShape(), dataEmpty(), and makeHistograms().

◆ outFile_

TFile* ValidateGeometry::outFile_
private

Definition at line 109 of file ValidateGeometry.cc.

Referenced by beginJob(), endJob(), makeHistograms(), and ValidateGeometry().

◆ outfileName_

std::string ValidateGeometry::outfileName_
private

Definition at line 99 of file ValidateGeometry.cc.

Referenced by endJob(), and ValidateGeometry().

◆ rpcGeometry_

edm::ESHandle<RPCGeometry> ValidateGeometry::rpcGeometry_
private

Definition at line 101 of file ValidateGeometry.cc.

Referenced by analyze(), and validateRPCGeometry().

◆ thicknesses_

std::vector<double> ValidateGeometry::thicknesses_
private

Definition at line 115 of file ValidateGeometry.cc.

Referenced by clearData(), compareShape(), dataEmpty(), and makeHistograms().

◆ topWidths_

std::vector<double> ValidateGeometry::topWidths_
private

Definition at line 112 of file ValidateGeometry.cc.

Referenced by clearData(), compareShape(), dataEmpty(), and makeHistograms().

◆ trackerGeometry_

edm::ESHandle<TrackerGeometry> ValidateGeometry::trackerGeometry_
private
TrackerGeometry::idToDet
const TrackerGeomDet * idToDet(DetId) const override
Definition: TrackerGeometry.cc:193
RadialStripTopology
Definition: RadialStripTopology.h:28
ValidateGeometry::validateRPCGeometry
void validateRPCGeometry(const int regionNumber, const char *regionName)
Definition: ValidateGeometry.cc:260
RPCRoll
Definition: RPCRoll.h:12
ValidateGeometry::validatePixelTopology
void validatePixelTopology(const TrackerGeometry::DetContainer &dets, const char *detname)
Definition: ValidateGeometry.cc:769
ValidateGeometry::validateDTLayerGeometry
void validateDTLayerGeometry()
Definition: ValidateGeometry.cc:367
ValidateGeometry::validateCSCLayerGeometry
void validateCSCLayerGeometry(const int endcap, const char *detname)
Definition: ValidateGeometry.cc:473
DDAxes::y
ApeEstimator_cff.width
width
Definition: ApeEstimator_cff.py:24
HLT_FULL_cff.maxE
maxE
Definition: HLT_FULL_cff.py:13734
BeamSpotPI::parameters
parameters
Definition: BeamSpotPayloadInspectorHelper.h:29
fwLog
#define fwLog(_level_)
Definition: fwLog.h:45
mps_fire.i
i
Definition: mps_fire.py:428
ValidateGeometry::cscGeometry_
edm::ESHandle< CSCGeometry > cscGeometry_
Definition: ValidateGeometry.cc:103
Bounds::width
virtual float width() const =0
RPCDetId::region
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.
Definition: RPCDetId.h:53
GeomDet
Definition: GeomDet.h:27
FWGeometry::getCorners
const float * getCorners(unsigned int id) const
Definition: FWGeometry.cc:467
makeMuonMisalignmentScenario.matrix
list matrix
Definition: makeMuonMisalignmentScenario.py:141
CSCWireTopology::wireAngle
float wireAngle() const override
Definition: CSCWireTopology.h:70
fireworks::pixelLocalX
float pixelLocalX(const double mpx, const float *)
Definition: TrackUtils.cc:159
FWGeometry::loadMap
void loadMap(const char *fileName)
Definition: FWGeometry.cc:103
HLT_FULL_cff.points
points
Definition: HLT_FULL_cff.py:21521
PV3DBase::x
T x() const
Definition: PV3DBase.h:59
ValidateGeometry::getDistance
double getDistance(const GlobalPoint &point1, const GlobalPoint &point2)
Definition: ValidateGeometry.cc:975
CaloGeometryRecord
Definition: CaloGeometryRecord.h:30
relativeConstraints.station
station
Definition: relativeConstraints.py:67
StripTopology::localPosition
virtual LocalPoint localPosition(float strip) const =0
CSCDetId::ring
int ring() const
Definition: CSCDetId.h:68
digitizers_cfi.strip
strip
Definition: digitizers_cfi.py:19
RPCDetId
Definition: RPCDetId.h:16
geometry
Definition: geometry.py:1
gather_cfg.cout
cout
Definition: gather_cfg.py:144
DTChamber
Definition: DTChamber.h:24
DetId::Hcal
Definition: DetId.h:28
ecaldqm::nChannels
Definition: EcalDQMCommonUtils.h:114
CSCRadialStripTopology::angularWidth
float angularWidth() const override
Definition: CSCRadialStripTopology.h:159
CaloGeometry::getSubdetectorGeometry
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:34
FWGeometry::getShapePars
const float * getShapePars(unsigned int id) const
Definition: FWGeometry.cc:489
Bounds
Definition: Bounds.h:18
cms::cuda::assert
assert(be >=bs)
CSCLayer
Definition: CSCLayer.h:24
HcalCastorDetId::SubdetectorId
static const int SubdetectorId
Definition: HcalCastorDetId.h:28
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
DDAxes::x
align::LocalPoint
Point3DBase< Scalar, LocalTag > LocalPoint
Definition: Definitions.h:30
HcalBarrel
Definition: HcalAssistant.h:33
makeMuonMisalignmentScenario.endcap
endcap
Definition: makeMuonMisalignmentScenario.py:320
EZArrayFL< GlobalPoint >
DetId::Calo
Definition: DetId.h:29
EcalBarrel
Definition: EcalSubdetector.h:10
CSCRadialStripTopology::centreToIntersection
float centreToIntersection() const override
Definition: CSCRadialStripTopology.h:181
ValidateGeometry::doTracker_
bool doTracker_
Definition: ValidateGeometry.cc:130
Bounds::length
virtual float length() const =0
ValidateGeometry::infileName_
std::string infileName_
Definition: ValidateGeometry.cc:98
RPCGeometry::idToDetUnit
const GeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
Definition: RPCGeometry.cc:30
CSCRadialStripTopology::yCentreOfStripPlane
float yCentreOfStripPlane() const override
Definition: CSCRadialStripTopology.h:223
TrackerGeometry::idToDetUnit
const TrackerGeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
Definition: TrackerGeometry.cc:183
StripTopology::pitch
virtual float pitch() const =0
TrackerGeometry::detsPXB
const DetContainer & detsPXB() const
Definition: TrackerGeometry.cc:171
RPCRoll::id
RPCDetId id() const
Definition: RPCRoll.cc:16
DetId
Definition: DetId.h:17
GeomDet::surface
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
FWGeometry::getParameters
const float * getParameters(unsigned int id) const
Definition: FWGeometry.cc:478
DTTopology::wirePosition
float wirePosition(int wireNumber) const
Returns the x position in the layer of a given wire number.
Definition: DTTopology.cc:59
ValidateGeometry::validateStripTopology
void validateStripTopology(const TrackerGeometry::DetContainer &dets, const char *detname)
Definition: ValidateGeometry.cc:812
FWGeometry::getMatrix
const TGeoMatrix * getMatrix(unsigned int id) const
Definition: FWGeometry.cc:225
TrackerGeometry::detsTOB
const DetContainer & detsTOB() const
Definition: TrackerGeometry.cc:179
ValidateGeometry::thicknesses_
std::vector< double > thicknesses_
Definition: ValidateGeometry.cc:115
ValidateGeometry::lengths_
std::vector< double > lengths_
Definition: ValidateGeometry.cc:114
edm::EventSetup::get
T get() const
Definition: EventSetup.h:80
CSCLayerGeometry::localCenterOfWireGroup
LocalPoint localCenterOfWireGroup(int wireGroup) const
Definition: CSCLayerGeometry.cc:163
compare.hist
hist
Definition: compare.py:376
DTTopology::firstChannel
int firstChannel() const
Returns the wire number of the first wire.
Definition: DTTopology.h:79
Calorimetry_cff.thickness
thickness
Definition: Calorimetry_cff.py:114
DTGeometry::layers
const std::vector< const DTLayer * > & layers() const
Return a vector of all SuperLayer.
Definition: DTGeometry.cc:88
DTGeometry::chambers
const std::vector< const DTChamber * > & chambers() const
Return a vector of all Chamber.
Definition: DTGeometry.cc:84
CSCLayerGeometry::xOfStrip
float xOfStrip(int strip, float y=0.) const
Definition: CSCLayerGeometry.h:175
ValidateGeometry::outfileName_
std::string outfileName_
Definition: ValidateGeometry.cc:99
PixelGeomDetUnit
Definition: PixelGeomDetUnit.h:15
TrackerDigiGeometryRecord
Definition: TrackerDigiGeometryRecord.h:15
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
Surface::bounds
const Bounds & bounds() const
Definition: Surface.h:87
CSCLayer::id
CSCDetId id() const
Definition: CSCLayer.h:39
ValidateGeometry::globalDistances_
std::vector< double > globalDistances_
Definition: ValidateGeometry.cc:111
Surface::toGlobal
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:79
CSCLayerGeometry::topology
const CSCStripTopology * topology() const
Definition: CSCLayerGeometry.h:272
DDAxes::z
ValidateGeometry::compareTransform
void compareTransform(const GlobalPoint &point, const TGeoMatrix *matrix)
Definition: ValidateGeometry.cc:894
ValidateGeometry::validateCSChamberGeometry
void validateCSChamberGeometry(const int endcap, const char *detname)
Definition: ValidateGeometry.cc:438
p2
double p2[4]
Definition: TauolaWrapper.h:90
TrackerGeometry::detsPXF
const DetContainer & detsPXF() const
Definition: TrackerGeometry.cc:173
CSCChamber
Definition: CSCChamber.h:22
HcalOuter
Definition: HcalAssistant.h:35
CSCLayer::geometry
const CSCLayerGeometry * geometry() const
Definition: CSCLayer.h:44
GlobalPoint
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
HcalZDCDetId::SubdetectorId
static const int SubdetectorId
Definition: HcalZDCDetId.h:25
Point3DBase< float, GlobalTag >
fireworks::pixelLocalY
float pixelLocalY(const double mpy, const float *)
Definition: TrackUtils.cc:209
PixelTopology
Definition: PixelTopology.h:10
DTLayerId
Definition: DTLayerId.h:12
RPCRoll::specificTopology
const StripTopology & specificTopology() const
Definition: RPCRoll.cc:49
TrackerGeometry::detsTID
const DetContainer & detsTID() const
Definition: TrackerGeometry.cc:177
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
ValidateGeometry::trackerGeometry_
edm::ESHandle< TrackerGeometry > trackerGeometry_
Definition: ValidateGeometry.cc:105
EcalEndcap
Definition: EcalSubdetector.h:10
RPCRoll::centreOfStrip
LocalPoint centreOfStrip(int strip) const
Definition: RPCRoll.cc:26
runTauDisplay.gp
gp
Definition: runTauDisplay.py:431
MeasurementPoint
Measurement2DPoint MeasurementPoint
Measurement points are two-dimensional by default.
Definition: MeasurementPoint.h:12
GeomDet::geographicalId
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:64
Bounds::thickness
virtual float thickness() const =0
StripTopology::stripLength
virtual float stripLength() const =0
ValidateGeometry::caloGeometry_
edm::ESHandle< CaloGeometry > caloGeometry_
Definition: ValidateGeometry.cc:104
DTLayer::id
DTLayerId id() const
Return the DetId of this SL.
Definition: DTLayer.cc:39
PV3DBase::y
T y() const
Definition: PV3DBase.h:60
funct::tan
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
RPCRoll::nstrips
int nstrips() const
Definition: RPCRoll.cc:24
CSCRadialStripTopology::yAxisOrientation
float yAxisOrientation() const override
Definition: CSCRadialStripTopology.h:218
chambers
static char chambers[264][20]
Definition: ReadPGInfo.cc:243
ValidateGeometry::doCalo_
bool doCalo_
Definition: ValidateGeometry.cc:132
p1
double p1[4]
Definition: TauolaWrapper.h:89
TrackerGeometry::detsTIB
const DetContainer & detsTIB() const
Definition: TrackerGeometry.cc:175
fwlog::kWarning
Definition: fwLog.h:35
ValidateGeometry::topWidths_
std::vector< double > topWidths_
Definition: ValidateGeometry.cc:112
ValidateGeometry::validateTrackerGeometry
void validateTrackerGeometry(const TrackerGeometry::DetContainer &dets, const char *detname)
Definition: ValidateGeometry.cc:739
DetId::Ecal
Definition: DetId.h:27
TrapezoidalPlaneBounds
Definition: TrapezoidalPlaneBounds.h:15
get
#define get
edm::ESHandleBase::isValid
bool isValid() const
Definition: ESHandle.h:44
DTLayer
Definition: DTLayer.h:25
StripTopology::nstrips
virtual int nstrips() const =0
ValidateGeometry::fwGeometry_
FWGeometry fwGeometry_
Definition: ValidateGeometry.cc:107
me0TriggerPseudoDigis_cff.nStrips
nStrips
1.2 is to make the matching window safely the two nearest strips 0.35 is the size of an ME0 chamber i...
Definition: me0TriggerPseudoDigis_cff.py:26
ValidateGeometry::outFile_
TFile * outFile_
Definition: ValidateGeometry.cc:109
DTTopology::lastChannel
int lastChannel() const
Returns the wire number of the last wire.
Definition: DTTopology.h:81
HcalForward
Definition: HcalAssistant.h:36
ValidateGeometry::rpcGeometry_
edm::ESHandle< RPCGeometry > rpcGeometry_
Definition: ValidateGeometry.cc:101
EcalPreshower
Definition: EcalSubdetector.h:10
ValidateGeometry::doMuon_
bool doMuon_
Definition: ValidateGeometry.cc:131
ValidateGeometry::clearData
void clearData()
Definition: ValidateGeometry.cc:117
ValidateGeometry::bottomWidths_
std::vector< double > bottomWidths_
Definition: ValidateGeometry.cc:113
OffsetRadialStripTopology::stripOffset
virtual float stripOffset(void) const
Definition: OffsetRadialStripTopology.h:35
ValidateGeometry::makeHistograms
void makeHistograms(const char *detector)
Definition: ValidateGeometry.cc:986
DetId::rawId
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
CSCLayerGeometry::wireTopology
const CSCWireTopology * wireTopology() const
Definition: CSCLayerGeometry.h:282
HcalEndcap
Definition: HcalAssistant.h:34
ValidateGeometry::makeHistogram
void makeHistogram(const std::string &name, std::vector< double > &data)
Definition: ValidateGeometry.cc:1009
TrackerGeometry::detsTEC
const DetContainer & detsTEC() const
Definition: TrackerGeometry.cc:181
CSCDetId::endcap
int endcap() const
Definition: CSCDetId.h:85
EZArrayFL::size
size_type size() const
Definition: EZArrayFL.h:67
ValidateGeometry::validateDTChamberGeometry
void validateDTChamberGeometry()
Definition: ValidateGeometry.cc:332
relativeConstraints.ring
ring
Definition: relativeConstraints.py:68
relativeConstraints.chamber
chamber
Definition: relativeConstraints.py:53
CSCGeometry::layers
const LayerContainer & layers() const
Return a vector of all layers.
Definition: CSCGeometry.cc:98
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
CaloSubdetectorGeometry
Definition: CaloSubdetectorGeometry.h:22
CSCRadialStripTopology::phiOfOneEdge
float phiOfOneEdge() const override
Definition: CSCRadialStripTopology.h:202
CSCGeometry::chambers
const ChamberContainer & chambers() const
Return a vector of all chambers.
Definition: CSCGeometry.cc:96
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
DTLayer::specificTopology
const DTTopology & specificTopology() const
Definition: DTLayer.cc:37
hgcalTestNeighbor_cfi.detector
detector
Definition: hgcalTestNeighbor_cfi.py:6
ztail.d
d
Definition: ztail.py:151
DTRecHitClients_cfi.local
local
Definition: DTRecHitClients_cfi.py:10
DTChamberId
Definition: DTChamberId.h:14
RPCGeometry::rolls
const std::vector< const RPCRoll * > & rolls() const
Return a vector of all RPC rolls.
Definition: RPCGeometry.cc:44
CSCDetId::station
int station() const
Definition: CSCDetId.h:79
ValidateGeometry::compareShape
void compareShape(const GeomDet *det, const float *shape)
Definition: ValidateGeometry.cc:905
CSCLayerGeometry::numberOfStrips
int numberOfStrips() const
Definition: CSCLayerGeometry.h:66
hltrates_dqm_sourceclient-live_cfg.offset
offset
Definition: hltrates_dqm_sourceclient-live_cfg.py:82
HLT_FULL_cff.distance
distance
Definition: HLT_FULL_cff.py:7799
ValidateGeometry::validateCaloGeometry
void validateCaloGeometry(DetId::Detector detector, int subdetector, const char *detname)
Definition: ValidateGeometry.cc:704
CSCLayerGeometry::numberOfWireGroups
int numberOfWireGroups() const
Definition: CSCLayerGeometry.h:76
StripTopology
Definition: StripTopology.h:11
MuonGeometryRecord
Definition: MuonGeometryRecord.h:34
CSCWireTopology::wireSpacing
double wireSpacing() const
Definition: CSCWireTopology.h:59
hgcalTopologyTester_cfi.layers
layers
Definition: hgcalTopologyTester_cfi.py:8
ValidateGeometry::dtGeometry_
edm::ESHandle< DTGeometry > dtGeometry_
Definition: ValidateGeometry.cc:102
StripGeomDetUnit
Definition: StripGeomDetUnit.h:15
subdetector
TString subdetector
Definition: trackSplitPlot.h:54