CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 ()
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &) override
 
virtual void beginJob () override
 
void clearData ()
 
void compareShape (const GeomDet *det, const float *shape)
 
void compareTransform (const GlobalPoint &point, const TGeoMatrix *matrix)
 
bool dataEmpty ()
 
virtual 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_
 
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 &)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
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 ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Definition at line 62 of file ValidateGeometry.cc.

Constructor & Destructor Documentation

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

Definition at line 145 of file ValidateGeometry.cc.

References fwGeometry_, infileName_, FWGeometry::loadMap(), outFile_, and outfileName_.

146  : infileName_(iConfig.getUntrackedParameter<std::string>("infileName")),
147  outfileName_(iConfig.getUntrackedParameter<std::string>("outfileName"))
148 {
150 
151  outFile_ = new TFile(outfileName_.c_str(), "RECREATE");
152 }
T getUntrackedParameter(std::string const &, T const &) const
void loadMap(const char *fileName)
Definition: FWGeometry.cc:52
std::string infileName_
std::string outfileName_
ValidateGeometry::~ValidateGeometry ( )

Definition at line 155 of file ValidateGeometry.cc.

156 {}

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 160 of file ValidateGeometry.cc.

References DetId::Calo, caloGeometry_, gather_cfg::cout, cscGeometry_, dtGeometry_, DetId::Ecal, EcalBarrel, EcalEndcap, EcalPreshower, fwLog, edm::EventSetup::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().

161 {
162  eventSetup.get<MuonGeometryRecord>().get(rpcGeometry_);
163 
164  if ( rpcGeometry_.isValid() )
165  {
166  std::cout<<"Validating RPC -z endcap geometry"<<std::endl;
167  validateRPCGeometry(-1, "RPC -z endcap");
168 
169  std::cout<<"Validating RPC +z endcap geometry"<<std::endl;
170  validateRPCGeometry(+1, "RPC +z endcap");
171 
172  std::cout<<"Validating RPC barrel geometry"<<std::endl;
173  validateRPCGeometry(0, "RPC barrel");
174  }
175  else
176  fwLog(fwlog::kWarning)<<"Invalid RPC geometry"<<std::endl;
177 
178 
179  eventSetup.get<MuonGeometryRecord>().get(dtGeometry_);
180 
181  if ( dtGeometry_.isValid() )
182  {
183  std::cout<<"Validating DT chamber geometry"<<std::endl;
185 
186  std::cout<<"Validating DT layer geometry"<<std::endl;
188  }
189  else
190  fwLog(fwlog::kWarning)<<"Invalid DT geometry"<<std::endl;
191 
192 
193  eventSetup.get<MuonGeometryRecord>().get(cscGeometry_);
194 
195  if ( cscGeometry_.isValid() )
196  {
197  std::cout<<"Validating CSC -z geometry"<<std::endl;
198  validateCSChamberGeometry(-1, "CSC chamber -z endcap");
199 
200  std::cout<<"Validating CSC +z geometry"<<std::endl;
201  validateCSChamberGeometry(+1, "CSC chamber +z endcap");
202 
203  std::cout<<"Validating CSC layer -z geometry"<<std::endl;
204  validateCSCLayerGeometry(-1, "CSC layer -z endcap");
205 
206  std::cout<<"Validating CSC layer +z geometry"<<std::endl;
207  validateCSCLayerGeometry(+1, "CSC layer +z endcap");
208  }
209  else
210  fwLog(fwlog::kWarning)<<"Invalid CSC geometry"<<std::endl;
211 
212 
214 
215  if ( trackerGeometry_.isValid() )
216  {
217  std::cout<<"Validating TIB geometry and topology"<<std::endl;
218  validateTrackerGeometry(trackerGeometry_->detsTIB(), "TIB");
219  validateStripTopology(trackerGeometry_->detsTIB(), "TIB");
220 
221  std::cout<<"Validating TOB geometry and topology"<<std::endl;
222  validateTrackerGeometry(trackerGeometry_->detsTOB(), "TOB");
223  validateStripTopology(trackerGeometry_->detsTOB(), "TOB");
224 
225  std::cout<<"Validating TEC geometry and topology"<<std::endl;
226  validateTrackerGeometry(trackerGeometry_->detsTEC(), "TEC");
227  validateStripTopology(trackerGeometry_->detsTEC(), "TEC");
228 
229  std::cout<<"Validating TID geometry and topology"<<std::endl;
230  validateTrackerGeometry(trackerGeometry_->detsTID(), "TID");
231  validateStripTopology(trackerGeometry_->detsTID(), "TID");
232 
233  std::cout<<"Validating PXB geometry and topology"<<std::endl;
234  validateTrackerGeometry(trackerGeometry_->detsPXB(), "PXB");
235  validatePixelTopology(trackerGeometry_->detsPXB(), "PXB");
236 
237  std::cout<<"Validating PXF geometry and topology"<<std::endl;
238  validateTrackerGeometry(trackerGeometry_->detsPXF(), "PXF");
239  validatePixelTopology(trackerGeometry_->detsPXF(), "PXF");
240  }
241  else
242  fwLog(fwlog::kWarning)<<"Invalid Tracker geometry"<<std::endl;
243 
244  eventSetup.get<CaloGeometryRecord>().get(caloGeometry_);
245 
246 
247  if ( caloGeometry_.isValid() )
248  {
249  std::cout<<"Validating EB geometry"<<std::endl;
251 
252  std::cout<<"Validating EE geometry"<<std::endl;
254 
255  std::cout<<"Validating ES geometry"<<std::endl;
257 
258  std::cout<<"Validating HB geometry"<<std::endl;
260 
261  std::cout<<"Validating HE geometry"<<std::endl;
263 
264  std::cout<<"Validating HO geometry"<<std::endl;
266 
267  std::cout<<"Validating HF geometry"<<std::endl;
269 
270  std::cout<<"Validating Castor geometry"<<std::endl;
272 
273  std::cout<<"Validating ZDC geometry"<<std::endl;
275  }
276  else
277  fwLog(fwlog::kWarning)<<"Invalid Calo geometry"<<std::endl;
278 
279 }
edm::ESHandle< CaloGeometry > caloGeometry_
edm::ESHandle< TrackerGeometry > trackerGeometry_
void validateTrackerGeometry(const TrackerGeometry::DetContainer &dets, const char *detname)
edm::ESHandle< RPCGeometry > rpcGeometry_
void validateDTChamberGeometry()
void validateCaloGeometry(DetId::Detector detector, int subdetector, const char *detname)
edm::ESHandle< DTGeometry > dtGeometry_
void validateRPCGeometry(const int regionNumber, const char *regionName)
void validatePixelTopology(const TrackerGeometry::DetContainer &dets, const char *detname)
void validateCSCLayerGeometry(const int endcap, const char *detname)
static const int SubdetectorId
edm::ESHandle< CSCGeometry > cscGeometry_
static const int SubdetectorId
Definition: HcalZDCDetId.h:20
#define fwLog(_level_)
Definition: fwLog.h:50
const T & get() const
Definition: EventSetup.h:56
tuple cout
Definition: gather_cfg.py:145
void validateCSChamberGeometry(const int endcap, const char *detname)
void validateStripTopology(const TrackerGeometry::DetContainer &dets, const char *detname)
bool isValid() const
Definition: ESHandle.h:47
void ValidateGeometry::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 1231 of file ValidateGeometry.cc.

References outFile_.

1232 {
1233  outFile_->cd();
1234 }
void ValidateGeometry::clearData ( )
inlineprivate

Definition at line 125 of file ValidateGeometry.cc.

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

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

126  {
127  globalDistances_.clear();
128  topWidths_.clear();
129  bottomWidths_.clear();
130  lengths_.clear();
131  thicknesses_.clear();
132  }
std::vector< double > topWidths_
std::vector< double > bottomWidths_
std::vector< double > thicknesses_
std::vector< double > lengths_
std::vector< double > globalDistances_
void ValidateGeometry::compareShape ( const GeomDet det,
const float *  shape 
)
private

Definition at line 1084 of file ValidateGeometry.cc.

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

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

1085 {
1086  double shape_topWidth;
1087  double shape_bottomWidth;
1088  double shape_length;
1089  double shape_thickness;
1090 
1091  if ( shape[0] == 1 )
1092  {
1093  shape_topWidth = shape[2];
1094  shape_bottomWidth = shape[1];
1095  shape_length = shape[4];
1096  shape_thickness = shape[3];
1097  }
1098 
1099  else if ( shape[0] == 2 )
1100  {
1101  shape_topWidth = shape[1];
1102  shape_bottomWidth = shape[1];
1103  shape_length = shape[2];
1104  shape_thickness = shape[3];
1105  }
1106 
1107  else
1108  {
1109  std::cout<<"Failed to get box or trapezoid from shape"<<std::endl;
1110  return;
1111  }
1112 
1113  double topWidth, bottomWidth;
1114  double length, thickness;
1115 
1116  const Bounds* bounds = &(det->surface().bounds());
1117 
1118  if ( const TrapezoidalPlaneBounds* tpbs = dynamic_cast<const TrapezoidalPlaneBounds*>(bounds) )
1119  {
1120  std::array<const float, 4> const & ps = tpbs->parameters();
1121 
1122  assert(ps.size() == 4);
1123 
1124  bottomWidth = ps[0];
1125  topWidth = ps[1];
1126  thickness = ps[2];
1127  length = ps[3];
1128  }
1129 
1130  else if ( (dynamic_cast<const RectangularPlaneBounds*>(bounds)) )
1131  {
1132  length = det->surface().bounds().length()*0.5;
1133  topWidth = det->surface().bounds().width()*0.5;
1134  bottomWidth = topWidth;
1135  thickness = det->surface().bounds().thickness()*0.5;
1136  }
1137 
1138  else
1139  {
1140  std::cout<<"Failed to get bounds"<<std::endl;
1141  return;
1142  }
1143 
1144  //assert((tgeotrap && trapezoid) || (tgeobbox && rectangle));
1145 
1146  /*
1147  std::cout<<"topWidth: "<< shape_topWidth <<" "<< topWidth <<std::endl;
1148  std::cout<<"bottomWidth: "<< shape_bottomWidth <<" "<< bottomWidth <<std::endl;
1149  std::cout<<"length: "<< shape_length <<" "<< length <<std::endl;
1150  std::cout<<"thickness: "<< shape_thickness <<" "<< thickness <<std::endl;
1151  */
1152 
1153  topWidths_.push_back(fabs(shape_topWidth - topWidth));
1154  bottomWidths_.push_back(fabs(shape_bottomWidth - bottomWidth));
1155  lengths_.push_back(fabs(shape_length - length));
1156  thicknesses_.push_back(fabs(shape_thickness - thickness));
1157 
1158  return;
1159 }
virtual float length() const =0
std::vector< double > topWidths_
assert(m_qm.get())
std::vector< double > bottomWidths_
const Bounds & bounds() const
Definition: Surface.h:120
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:40
virtual float thickness() const =0
std::vector< double > thicknesses_
tuple cout
Definition: gather_cfg.py:145
Definition: Bounds.h:22
std::vector< double > lengths_
virtual float width() const =0
void ValidateGeometry::compareTransform ( const GlobalPoint point,
const TGeoMatrix *  matrix 
)
private

Definition at line 1067 of file ValidateGeometry.cc.

References HLT_25ns10e33_v2_cff::distance, getDistance(), and globalDistances_.

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

1069 {
1070  double local[3] =
1071  {
1072  0.0, 0.0, 0.0
1073  };
1074 
1075  double global[3];
1076 
1077  matrix->LocalToMaster(local, global);
1078 
1079  double distance = getDistance(GlobalPoint(global[0], global[1], global[2]), gp);
1080  globalDistances_.push_back(distance);
1081 }
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
double getDistance(const GlobalPoint &point1, const GlobalPoint &point2)
std::vector< double > globalDistances_
bool ValidateGeometry::dataEmpty ( )
inlineprivate

Definition at line 134 of file ValidateGeometry.cc.

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

135  {
136  return (globalDistances_.empty() &&
137  topWidths_.empty() &&
138  bottomWidths_.empty() &&
139  lengths_.empty() &&
140  thicknesses_.empty());
141  }
std::vector< double > topWidths_
std::vector< double > bottomWidths_
std::vector< double > thicknesses_
std::vector< double > lengths_
std::vector< double > globalDistances_
void ValidateGeometry::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 1238 of file ValidateGeometry.cc.

References gather_cfg::cout, outFile_, and outfileName_.

1239 {
1240  std::cout<<"Done. "<<std::endl;
1241  std::cout<<"Results written to "<< outfileName_ <<std::endl;
1242  outFile_->Close();
1243 }
tuple cout
Definition: gather_cfg.py:145
std::string outfileName_
double ValidateGeometry::getDistance ( const GlobalPoint point1,
const GlobalPoint point2 
)
private

Definition at line 1165 of file ValidateGeometry.cc.

References mathSSE::sqrt(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by Vispa.Gui.VispaWidget.VispaWidget::_initTextField(), Vispa.Gui.VispaWidget.VispaWidget::_initTitleField(), Vispa.Gui.ConnectableWidget.ConnectableWidget::arrangePorts(), Vispa.Gui.WidgetContainer.WidgetContainer::autolayoutChildren(), Vispa.Views.LineDecayView.LineDecayContainer::autolayoutThreadFinished(), Vispa.Gui.VispaWidget.VispaWidget::autosize(), Vispa.Gui.ConnectableWidget.ConnectableWidget::centerSinglePortVertically(), Vispa.Views.LineDecayView.LineDecayContainer::childrenRect(), compareTransform(), Vispa.Gui.VispaWidget.VispaWidget::contentRect(), Vispa.Gui.WidgetContainer.WidgetContainer::contentStartX(), Vispa.Gui.WidgetContainer.WidgetContainer::contentStartY(), Vispa.Gui.VispaWidget.VispaWidget::defineArrowBackgroundShape(), Vispa.Gui.VispaWidget.VispaWidget::defineRectBackgroundShape(), Vispa.Gui.VispaWidget.VispaWidget::defineRoundRectBackgroundShape(), Vispa.Gui.VispaWidget.VispaWidget::drawHeaderBackground(), Vispa.Gui.MenuWidget.MenuWidget::drawMenuEntries(), Vispa.Gui.ConnectableWidget.ConnectableWidget::drawPortNames(), Vispa.Gui.VispaWidget.VispaWidget::drawTextField(), Vispa.Gui.VispaWidget.VispaWidget::drawTitle(), Vispa.Gui.ConnectableWidget.ConnectableWidget::dropArea(), Vispa.Gui.VispaWidget.VispaWidget::height(), Vispa.Gui.VispaWidget.VispaWidget::imageRectF(), Vispa.Gui.VispaWidget.VispaWidget::isTitlePoint(), Vispa.Gui.WidgetContainer.WidgetContainer::mouseDoubleClickEvent(), Vispa.Gui.WidgetContainer.WidgetContainer::mouseMoveEvent(), Vispa.Gui.VispaWidget.VispaWidget::paint(), Vispa.Gui.VispaWidget.VispaWidget::rearangeContent(), Vispa.Gui.WidgetContainer.WidgetContainer::sizeHint(), Vispa.Gui.ConnectableWidget.ConnectableWidget::sizeHint(), Vispa.Gui.VispaWidget.VispaWidget::sizeHint(), validateCaloGeometry(), and Vispa.Gui.VispaWidget.VispaWidget::width().

1166 {
1167  /*
1168  std::cout<<"X: "<< p1.x() <<" "<< p2.x() <<std::endl;
1169  std::cout<<"Y: "<< p1.y() <<" "<< p2.y() <<std::endl;
1170  std::cout<<"Z: "<< p1.z() <<" "<< p2.z() <<std::endl;
1171  */
1172 
1173  return sqrt((p1.x()-p2.x())*(p1.x()-p2.x())+
1174  (p1.y()-p2.y())*(p1.y()-p2.y())+
1175  (p1.z()-p2.z())*(p1.z()-p2.z()));
1176 }
T sqrt(T t)
Definition: SSEVec.h:18
double p2[4]
Definition: TauolaWrapper.h:90
double p1[4]
Definition: TauolaWrapper.h:89
void ValidateGeometry::makeHistogram ( const std::string &  name,
std::vector< double > &  data 
)
private

Definition at line 1206 of file ValidateGeometry.cc.

References estimatePileup::hist.

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

1207 {
1208  if ( data.empty() )
1209  return;
1210 
1211  std::vector<double>::iterator it;
1212 
1213  it = std::min_element(data.begin(), data.end());
1214  double minE = *it;
1215 
1216  it = std::max_element(data.begin(), data.end());
1217  double maxE = *it;
1218 
1219  std::vector<double>::iterator itEnd = data.end();
1220 
1221  TH1D hist(name.c_str(), name.c_str(), 100, minE*(1+0.10), maxE*(1+0.10));
1222 
1223  for ( it = data.begin(); it != itEnd; ++it )
1224  hist.Fill(*it);
1225 
1226  hist.GetXaxis()->SetTitle("[cm]");
1227  hist.Write();
1228 }
void ValidateGeometry::makeHistograms ( const char *  detector)
private

Definition at line 1180 of file ValidateGeometry.cc.

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

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

1181 {
1182  outFile_->cd();
1183 
1184  std::string d(detector);
1185 
1186  std::string gdn = d+": distance between points in global coordinates";
1188 
1189  std::string twn = d + ": absolute difference between top widths (along X)";
1190  makeHistogram(twn, topWidths_);
1191 
1192  std::string bwn = d + ": absolute difference between bottom widths (along X)";
1194 
1195  std::string ln = d + ": absolute difference between lengths (along Y)";
1196  makeHistogram(ln, lengths_);
1197 
1198  std::string tn = d + ": absolute difference between thicknesses (along Z)";
1200 
1201  return;
1202 }
std::vector< double > topWidths_
std::vector< double > bottomWidths_
void makeHistogram(const std::string &name, std::vector< double > &data)
tuple d
Definition: ztail.py:151
std::vector< double > thicknesses_
std::vector< double > lengths_
std::vector< double > globalDistances_
void ValidateGeometry::validateCaloGeometry ( DetId::Detector  detector,
int  subdetector,
const char *  detname 
)
private

Definition at line 825 of file ValidateGeometry.cc.

References assert(), caloGeometry_, clearData(), gather_cfg::cout, HLT_25ns10e33_v2_cff::distance, fwGeometry_, geometry, CaloCellGeometry::getCorners(), FWGeometry::getCorners(), getDistance(), CaloSubdetectorGeometry::getGeometry(), CaloSubdetectorGeometry::getValidDetIds(), globalDistances_, i, makeHistograms(), hltrates_dqm_sourceclient-live_cfg::offset, EZArrayFL< T >::size(), x, y, and z.

Referenced by analyze().

828 {
829  clearData();
830 
832  caloGeometry_->getSubdetectorGeometry(detector, subdetector);
833 
834  const std::vector<DetId>& ids = geometry->getValidDetIds(detector, subdetector);
835 
836  for (auto it = ids.begin(),
837  iEnd = ids.end();
838  it != iEnd; ++it)
839  {
840  unsigned int rawId = (*it).rawId();
841 
842  const float* points = fwGeometry_.getCorners(rawId);
843 
844  if ( points == 0 )
845  {
846  std::cout <<"Failed to get points of "<< detname
847  <<" element with detid: "<< rawId <<std::endl;
848  continue;
849  }
850 
851  const CaloCellGeometry* cellGeometry = geometry->getGeometry(*it);
852  const CaloCellGeometry::CornersVec& corners = cellGeometry->getCorners();
853 
854  assert(corners.size() == 8);
855 
856  for ( unsigned int i = 0, offset = 0; i < 8; ++i )
857  {
858  offset = 2*i;
859 
860  double distance = getDistance(GlobalPoint(points[i+offset], points[i+1+offset], points[i+2+offset]),
861  GlobalPoint(corners[i].x(), corners[i].y(), corners[i].z()));
862 
863  globalDistances_.push_back(distance);
864  }
865  }
866 
867  makeHistograms(detname);
868 }
int i
Definition: DBlmapReader.cc:9
edm::ESHandle< CaloGeometry > caloGeometry_
TString subdetector
assert(m_qm.get())
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
void makeHistograms(const char *detector)
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.
size_type size() const
Definition: EZArrayFL.h:81
const float * getCorners(unsigned int id) const
Definition: FWGeometry.cc:280
double getDistance(const GlobalPoint &point1, const GlobalPoint &point2)
ESHandle< TrackerGeometry > geometry
tuple cout
Definition: gather_cfg.py:145
const CornersVec & getCorners() const
Returns the corner points of this cell&#39;s volume.
std::vector< double > globalDistances_
void ValidateGeometry::validateCSChamberGeometry ( const int  endcap,
const char *  detname 
)
private

Definition at line 504 of file ValidateGeometry.cc.

References chambers, clearData(), compareShape(), compareTransform(), gather_cfg::cout, cscGeometry_, Reference_intrackfit_cff::endcap, CSCDetId::endcap(), fwGeometry_, GeomDet::geographicalId(), FWGeometry::getMatrix(), FWGeometry::getShapePars(), CSCChamber::id(), makeHistograms(), makeMuonMisalignmentScenario::matrix, DetId::rawId(), GeomDet::surface(), and Surface::toGlobal().

Referenced by analyze().

505 {
506  clearData();
507 
508  auto const& chambers = cscGeometry_->chambers();
509 
510  for ( auto it = chambers.begin(),
511  itEnd = chambers.end();
512  it != itEnd; ++it )
513  {
514  const CSCChamber* chamber = *it;
515 
516  if ( chamber && chamber->id().endcap() == endcap )
517  {
518  DetId detId = chamber->geographicalId();
519  GlobalPoint gp = chamber->surface().toGlobal(LocalPoint(0.0,0.0,0.0));
520 
521  const TGeoMatrix* matrix = fwGeometry_.getMatrix(detId.rawId());
522 
523  if ( ! matrix )
524  {
525  std::cout<<"Failed to get matrix of CSC chamber with detid: "
526  << detId.rawId() <<std::endl;
527  continue;
528  }
529 
530  compareTransform(gp, matrix);
531 
532  const float* shape = fwGeometry_.getShapePars(detId.rawId());
533 
534  if ( ! shape )
535  {
536  std::cout<<"Failed to get shape of CSC chamber with detid: "
537  << detId.rawId() <<std::endl;
538  continue;
539  }
540 
541  compareShape(chamber, shape);
542  }
543  }
544 
545  makeHistograms(detname);
546 }
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:106
CSCDetId id() const
Get the (concrete) DetId.
Definition: CSCChamber.h:37
void makeHistograms(const char *detector)
const TGeoMatrix * getMatrix(unsigned int id) const
Definition: FWGeometry.cc:169
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:40
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
int endcap() const
Definition: CSCDetId.h:93
const float * getShapePars(unsigned int id) const
Definition: FWGeometry.cc:312
void compareShape(const GeomDet *det, const float *shape)
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:77
edm::ESHandle< CSCGeometry > cscGeometry_
Definition: DetId.h:18
Local3DPoint LocalPoint
Definition: LocalPoint.h:11
tuple cout
Definition: gather_cfg.py:145
static char chambers[264][20]
Definition: ReadPGInfo.cc:243
void compareTransform(const GlobalPoint &point, const TGeoMatrix *matrix)
void ValidateGeometry::validateCSCLayerGeometry ( const int  endcap,
const char *  detname 
)
private

Definition at line 549 of file ValidateGeometry.cc.

References CSCRadialStripTopology::angularWidth(), assert(), CSCRadialStripTopology::centreToIntersection(), clearData(), compareShape(), compareTransform(), gather_cfg::cout, cscGeometry_, Reference_intrackfit_cff::endcap, CSCDetId::endcap(), fwGeometry_, GeomDet::geographicalId(), CSCLayer::geometry(), FWGeometry::getMatrix(), FWGeometry::getParameters(), FWGeometry::getShapePars(), CSCLayer::id(), LayerTriplets::layers(), CSCLayerGeometry::localCenterOfWireGroup(), makeHistogram(), makeHistograms(), makeMuonMisalignmentScenario::matrix, CSCLayerGeometry::numberOfStrips(), CSCLayerGeometry::numberOfWireGroups(), HLT_25ns10e33_v2_cff::parameters, CSCRadialStripTopology::phiOfOneEdge(), DetId::rawId(), relativeConstraints::ring, CSCDetId::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().

550 {
551  clearData();
552  std::vector<double> strip_positions;
553  std::vector<double> wire_positions;
554 
555  std::vector<double> me11_wiresLocal;
556  std::vector<double> me12_wiresLocal;
557  std::vector<double> me13_wiresLocal;
558  std::vector<double> me14_wiresLocal;
559  std::vector<double> me21_wiresLocal;
560  std::vector<double> me22_wiresLocal;
561  std::vector<double> me31_wiresLocal;
562  std::vector<double> me32_wiresLocal;
563  std::vector<double> me41_wiresLocal;
564  std::vector<double> me42_wiresLocal;
565 
566  auto const& layers = cscGeometry_->layers();
567 
568  for ( auto it = layers.begin(),
569  itEnd = layers.end();
570  it != itEnd; ++it )
571  {
572  const CSCLayer* layer = *it;
573 
574  if ( layer && layer->id().endcap() == endcap )
575  {
576  DetId detId = layer->geographicalId();
577  GlobalPoint gp = layer->surface().toGlobal(LocalPoint(0.0,0.0,0.0));
578 
579  const TGeoMatrix* matrix = fwGeometry_.getMatrix(detId.rawId());
580 
581  if ( ! matrix )
582  {
583  std::cout<<"Failed to get matrix of CSC layer with detid: "
584  << detId.rawId() <<std::endl;
585  continue;
586  }
587 
588  compareTransform(gp, matrix);
589 
590  const float* shape = fwGeometry_.getShapePars(detId.rawId());
591 
592  if ( ! shape )
593  {
594  std::cout<<"Failed to get shape of CSC layer with detid: "
595  << detId.rawId() <<std::endl;
596  continue;
597  }
598 
599  compareShape(layer, shape);
600 
601  double length;
602 
603  if ( shape[0] == 1 )
604  {
605  length = shape[4];
606  }
607 
608  else
609  {
610  std::cout<<"Failed to get trapezoid from shape for CSC layer with detid: "
611  << detId.rawId() <<std::endl;
612  continue;
613  }
614 
615  const float* parameters = fwGeometry_.getParameters(detId.rawId());
616 
617  if ( parameters == 0 )
618  {
619  std::cout<<"Parameters empty for CSC layer with detid: "
620  << detId.rawId() <<std::endl;
621  continue;
622  }
623 
624  int yAxisOrientation = layer->geometry()->topology()->yAxisOrientation();
625  assert(yAxisOrientation == parameters[0]);
626 
627  float centreToIntersection = layer->geometry()->topology()->centreToIntersection();
628  assert(centreToIntersection == parameters[1]);
629 
630  float yCentre = layer->geometry()->topology()->yCentreOfStripPlane();
631  assert(yCentre == parameters[2]);
632 
633  float phiOfOneEdge = layer->geometry()->topology()->phiOfOneEdge();
634  assert(phiOfOneEdge == parameters[3]);
635 
636  float stripOffset = layer->geometry()->topology()->stripOffset();
637  assert(stripOffset == parameters[4]);
638 
639  float angularWidth = layer->geometry()->topology()->angularWidth();
640  assert(angularWidth == parameters[5]);
641 
642  for ( int nStrip = 1; nStrip <= layer->geometry()->numberOfStrips();
643  ++nStrip )
644  {
645  float xOfStrip1 = layer->geometry()->xOfStrip(nStrip);
646 
647  double stripAngle = phiOfOneEdge + yAxisOrientation*(nStrip-(0.5-stripOffset))*angularWidth;
648  double xOfStrip2 = yAxisOrientation*(centreToIntersection-yCentre)*tan(stripAngle);
649 
650  strip_positions.push_back(xOfStrip1-xOfStrip2);
651  }
652 
653  int station = layer->id().station();
654  int ring = layer->id().ring();
655 
656  double wireSpacingInGroup = layer->geometry()->wireTopology()->wireSpacing();
657  assert(wireSpacingInGroup == parameters[6]);
658 
659  double wireSpacing = 0.0;
660  // we calculate an average wire group
661  // spacing from radialExtentOfTheWirePlane / numOfWireGroups
662 
663  double extentOfWirePlane = 0.0;
664 
665  if ( ring == 2 )
666  {
667  if ( station == 1 )
668  extentOfWirePlane = 174.81; //wireSpacing = 174.81/64;
669  else
670  extentOfWirePlane = 323.38; //wireSpacing = 323.38/64;
671  }
672  else if ( station == 1 && (ring == 1 || ring == 4))
673  extentOfWirePlane = 150.5; //wireSpacing = 150.5/48;
674  else if ( station == 1 && ring == 3 )
675  extentOfWirePlane = 164.47; //wireSpacing = 164.47/32;
676  else if ( station == 2 && ring == 1 )
677  extentOfWirePlane = 189.97; //wireSpacing = 189.97/112;
678  else if ( station == 3 && ring == 1 )
679  extentOfWirePlane = 170.01; //wireSpacing = 170.01/96;
680  else if ( station == 4 && ring == 1 )
681  extentOfWirePlane = 149.73; //wireSpacing = 149.73/96;
682 
683  float wireAngle = layer->geometry()->wireTopology()->wireAngle();
684  assert(wireAngle == parameters[7]);
685 
686  //float cosWireAngle = cos(wireAngle);
687 
688  /* NOTE
689  Some parameters don't seem available in a public interface
690  so have to perhaps hard-code. This may not be too bad as there
691  seems to be a lot of degeneracy.
692  */
693 
694  double alignmentPinToFirstWire;
695  double yAlignmentFrame = 3.49;
696 
697  if ( station == 1 )
698  {
699  if ( ring == 1 || ring == 4 )
700  {
701  alignmentPinToFirstWire = 1.065;
702  yAlignmentFrame = 0.0;
703  }
704 
705  else // ME12, ME 13
706  alignmentPinToFirstWire = 2.85;
707  }
708 
709  else if ( station == 4 && ring == 1 )
710  alignmentPinToFirstWire = 3.04;
711 
712  else if ( station == 3 && ring == 1 )
713  alignmentPinToFirstWire = 2.84;
714 
715  else // ME21, ME22, ME32, ME42
716  alignmentPinToFirstWire = 2.87;
717 
718  double yOfFirstWire = (yAlignmentFrame-length) + alignmentPinToFirstWire;
719 
720  int nWireGroups = layer->geometry()->numberOfWireGroups();
721  double E = extentOfWirePlane/nWireGroups;
722 
723  for ( int nWireGroup = 1; nWireGroup <= nWireGroups; ++nWireGroup )
724  {
725  LocalPoint centerOfWireGroup = layer->geometry()->localCenterOfWireGroup(nWireGroup);
726  double yOfWire1 = centerOfWireGroup.y();
727 
728  //double yOfWire2 = (-0.5 - (nWireGroups*0.5 - 1) + (nWireGroup-1))*E;
729  //yOfWire2 += 0.5*E;
730  double yOfWire2 = yOfFirstWire + ((nWireGroup-1)*E);
731  yOfWire2 += wireSpacing*0.5;
732 
733  double ydiff_local = yOfWire1 - yOfWire2;
734  wire_positions.push_back(ydiff_local);
735 
736  //GlobalPoint globalPoint = layer->surface().toGlobal(LocalPoint(0.0,yOfWire1,0.0));
737 
738  /*
739  float fwLocalPoint[3] =
740  {
741  0.0, yOfWire2, 0.0
742  };
743 
744  float fwGlobalPoint[3];
745  fwGeometry_.localToGlobal(detId.rawId(), fwLocalPoint, fwGlobalPoint);
746  double ydiff_global = globalPoint.y() - fwGlobalPoint[1];
747  */
748 
749  if ( station == 1 )
750  {
751  if ( ring == 1 )
752  {
753  me11_wiresLocal.push_back(ydiff_local);
754  }
755  else if ( ring == 2 )
756  {
757  me12_wiresLocal.push_back(ydiff_local);
758  }
759  else if ( ring == 3 )
760  {
761  me13_wiresLocal.push_back(ydiff_local);
762  }
763  else if ( ring == 4 )
764  {
765  me14_wiresLocal.push_back(ydiff_local);
766  }
767  }
768  else if ( station == 2 )
769  {
770  if ( ring == 1 )
771  {
772  me21_wiresLocal.push_back(ydiff_local);
773  }
774  else if ( ring == 2 )
775  {
776  me22_wiresLocal.push_back(ydiff_local);
777  }
778  }
779  else if ( station == 3 )
780  {
781  if ( ring == 1 )
782  {
783  me31_wiresLocal.push_back(ydiff_local);
784  }
785  else if ( ring == 2 )
786  {
787  me32_wiresLocal.push_back(ydiff_local);
788  }
789  }
790  else if ( station == 4 )
791  {
792  if ( ring == 1 )
793  {
794  me41_wiresLocal.push_back(ydiff_local);
795  }
796  else if ( ring == 2 )
797  {
798  me42_wiresLocal.push_back(ydiff_local);
799  }
800  }
801  }
802  }
803  }
804 
805  std::string hn(detname);
806  makeHistogram(hn+": xOfStrip", strip_positions);
807 
808  makeHistogram(hn+": local yOfWire", wire_positions);
809 
810  makeHistogram("ME11: local yOfWire", me11_wiresLocal);
811  makeHistogram("ME12: local yOfWire", me12_wiresLocal);
812  makeHistogram("ME13: local yOfWire", me13_wiresLocal);
813  makeHistogram("ME14: local yOfWire", me14_wiresLocal);
814  makeHistogram("ME21: local yOfWire", me21_wiresLocal);
815  makeHistogram("ME22: local yOfWire", me22_wiresLocal);
816  makeHistogram("ME31: local yOfWire", me31_wiresLocal);
817  makeHistogram("ME32: local yOfWire", me32_wiresLocal);
818  makeHistogram("ME41: local yOfWire", me41_wiresLocal);
819  makeHistogram("ME42: local yOfWire", me42_wiresLocal);
820 
821  makeHistograms(detname);
822 }
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:106
std::vector< LayerSetAndLayers > layers(const SeedingLayerSetsHits &sets)
Definition: LayerTriplets.cc:4
const CSCWireTopology * wireTopology() const
const float * getParameters(unsigned int id) const
Definition: FWGeometry.cc:296
CSCDetId id() const
Definition: CSCLayer.h:42
assert(m_qm.get())
void makeHistograms(const char *detector)
T y() const
Definition: PV3DBase.h:63
int numberOfStrips() const
double wireSpacing() const
const TGeoMatrix * getMatrix(unsigned int id) const
Definition: FWGeometry.cc:169
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:40
int numberOfWireGroups() const
void makeHistogram(const std::string &name, std::vector< double > &data)
float xOfStrip(int strip, float y=0.) const
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
int endcap() const
Definition: CSCDetId.h:93
const float * getShapePars(unsigned int id) const
Definition: FWGeometry.cc:312
float wireAngle() const
void compareShape(const GeomDet *det, const float *shape)
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:77
edm::ESHandle< CSCGeometry > cscGeometry_
LocalPoint localCenterOfWireGroup(int wireGroup) const
int ring() const
Definition: CSCDetId.h:75
Definition: DetId.h:18
const CSCStripTopology * topology() const
virtual float stripOffset(void) const
Local3DPoint LocalPoint
Definition: LocalPoint.h:11
int station() const
Definition: CSCDetId.h:86
tuple cout
Definition: gather_cfg.py:145
const CSCLayerGeometry * geometry() const
Definition: CSCLayer.h:47
void compareTransform(const GlobalPoint &point, const TGeoMatrix *matrix)
void ValidateGeometry::validateDTChamberGeometry ( )
private

Definition at line 371 of file ValidateGeometry.cc.

References chambers, clearData(), compareShape(), compareTransform(), gather_cfg::cout, dtGeometry_, fwGeometry_, FWGeometry::getMatrix(), FWGeometry::getShapePars(), DTChamber::id(), makeHistograms(), makeMuonMisalignmentScenario::matrix, DetId::rawId(), GeomDet::surface(), and Surface::toGlobal().

Referenced by analyze().

372 {
373  clearData();
374 
375  auto const& chambers = dtGeometry_->chambers();
376 
377  for ( auto it = chambers.begin(),
378  itEnd = chambers.end();
379  it != itEnd; ++it)
380  {
381  const DTChamber* chamber = *it;
382 
383  if ( chamber )
384  {
385  DTChamberId chId = chamber->id();
386  GlobalPoint gp = chamber->surface().toGlobal(LocalPoint(0.0, 0.0, 0.0));
387 
388  const TGeoMatrix* matrix = fwGeometry_.getMatrix(chId.rawId());
389 
390  if ( ! matrix )
391  {
392  std::cout<<"Failed to get matrix of DT chamber with detid: "
393  << chId.rawId() <<std::endl;
394  continue;
395  }
396 
397  compareTransform(gp, matrix);
398 
399  const float* shape = fwGeometry_.getShapePars(chId.rawId());
400 
401  if ( ! shape )
402  {
403  std::cout<<"Failed to get shape of DT chamber with detid: "
404  << chId.rawId() <<std::endl;
405  continue;
406  }
407 
408  compareShape(chamber, shape);
409  }
410  }
411 
412  makeHistograms("DT chamber");
413 }
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:106
void makeHistograms(const char *detector)
const TGeoMatrix * getMatrix(unsigned int id) const
Definition: FWGeometry.cc:169
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:40
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
const float * getShapePars(unsigned int id) const
Definition: FWGeometry.cc:312
void compareShape(const GeomDet *det, const float *shape)
DTChamberId id() const
Return the DTChamberId of this chamber.
Definition: DTChamber.cc:33
edm::ESHandle< DTGeometry > dtGeometry_
Local3DPoint LocalPoint
Definition: LocalPoint.h:11
tuple cout
Definition: gather_cfg.py:145
static char chambers[264][20]
Definition: ReadPGInfo.cc:243
void compareTransform(const GlobalPoint &point, const TGeoMatrix *matrix)
void ValidateGeometry::validateDTLayerGeometry ( )
private

Definition at line 417 of file ValidateGeometry.cc.

References assert(), Surface::bounds(), clearData(), compareShape(), compareTransform(), gather_cfg::cout, dtGeometry_, DTTopology::firstChannel(), fwGeometry_, FWGeometry::getMatrix(), FWGeometry::getParameters(), FWGeometry::getShapePars(), DTLayer::id(), DTTopology::lastChannel(), LayerTriplets::layers(), Bounds::length(), makeHistogram(), makeHistograms(), makeMuonMisalignmentScenario::matrix, ecaldqm::nChannels, HLT_25ns10e33_v2_cff::parameters, DetId::rawId(), DTLayer::specificTopology(), GeomDet::surface(), Bounds::thickness(), Surface::toGlobal(), Bounds::width(), create_public_lumi_plots::width, and DTTopology::wirePosition().

Referenced by analyze().

418 {
419  clearData();
420 
421  std::vector<double> wire_positions;
422 
423  auto const& layers = dtGeometry_->layers();
424 
425  for ( auto it = layers.begin(),
426  itEnd = layers.end();
427  it != itEnd; ++it)
428  {
429  const DTLayer* layer = *it;
430 
431  if ( layer )
432  {
433  DTLayerId layerId = layer->id();
434  GlobalPoint gp = layer->surface().toGlobal(LocalPoint(0.0, 0.0, 0.0));
435 
436  const TGeoMatrix* matrix = fwGeometry_.getMatrix(layerId.rawId());
437 
438  if ( ! matrix )
439  {
440  std::cout<<"Failed to get matrix of DT layer with detid: "
441  << layerId.rawId() <<std::endl;
442  continue;
443  }
444 
445  compareTransform(gp, matrix);
446 
447  const float* shape = fwGeometry_.getShapePars(layerId.rawId());
448 
449  if ( ! shape )
450  {
451  std::cout<<"Failed to get shape of DT layer with detid: "
452  << layerId.rawId() <<std::endl;
453  continue;
454  }
455 
456  compareShape(layer, shape);
457 
458 
459  const float* parameters = fwGeometry_.getParameters(layerId.rawId());
460 
461  if ( parameters == 0 )
462  {
463  std::cout<<"Parameters empty for DT layer with detid: "
464  << layerId.rawId() <<std::endl;
465  continue;
466  }
467 
468  float width = layer->surface().bounds().width();
469  assert(width == parameters[6]);
470 
471  float thickness = layer->surface().bounds().thickness();
472  assert(thickness == parameters[7]);
473 
474  float length = layer->surface().bounds().length();
475  assert(length == parameters[8]);
476 
477  int firstChannel = layer->specificTopology().firstChannel();
478  assert(firstChannel == parameters[3]);
479 
480  int lastChannel = layer->specificTopology().lastChannel();
481  int nChannels = parameters[5];
482  assert(nChannels == (lastChannel-firstChannel)+1);
483 
484  for ( int wireN = firstChannel; wireN - lastChannel <= 0; ++wireN )
485  {
486  double localX1 = layer->specificTopology().wirePosition(wireN);
487  double localX2 = (wireN -(firstChannel-1)-0.5)*parameters[0] - nChannels/2.0*parameters[0];
488 
489  wire_positions.push_back(localX1-localX2);
490 
491  //std::cout<<"wireN, localXpos: "<< wireN <<" "<< localX1 <<" "<< localX2 <<std::endl;
492 
493  }
494  }
495  }
496 
497  makeHistogram("DT layer wire localX", wire_positions);
498 
499  makeHistograms("DT layer");
500 }
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:106
float wirePosition(int wireNumber) const
Returns the x position in the layer of a given wire number.
Definition: DTTopology.cc:86
std::vector< LayerSetAndLayers > layers(const SeedingLayerSetsHits &sets)
Definition: LayerTriplets.cc:4
virtual float length() const =0
const float * getParameters(unsigned int id) const
Definition: FWGeometry.cc:296
DTLayerId id() const
Return the DetId of this SL.
Definition: DTLayer.cc:46
assert(m_qm.get())
void makeHistograms(const char *detector)
const Bounds & bounds() const
Definition: Surface.h:120
const TGeoMatrix * getMatrix(unsigned int id) const
Definition: FWGeometry.cc:169
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:40
void makeHistogram(const std::string &name, std::vector< double > &data)
int firstChannel() const
Returns the wire number of the first wire.
Definition: DTTopology.h:78
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
virtual float thickness() const =0
const float * getShapePars(unsigned int id) const
Definition: FWGeometry.cc:312
int lastChannel() const
Returns the wire number of the last wire.
Definition: DTTopology.h:80
const DTTopology & specificTopology() const
Definition: DTLayer.cc:42
void compareShape(const GeomDet *det, const float *shape)
edm::ESHandle< DTGeometry > dtGeometry_
Local3DPoint LocalPoint
Definition: LocalPoint.h:11
tuple cout
Definition: gather_cfg.py:145
virtual float width() const =0
void compareTransform(const GlobalPoint &point, const TGeoMatrix *matrix)
void ValidateGeometry::validatePixelTopology ( const TrackerGeometry::DetContainer dets,
const char *  detname 
)
private

Definition at line 912 of file ValidateGeometry.cc.

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

Referenced by analyze().

914 {
915  std::vector<double> pixelLocalXs;
916  std::vector<double> pixelLocalYs;
917 
918  for ( TrackerGeometry::DetContainer::const_iterator it = dets.begin(),
919  itEnd = dets.end();
920  it != itEnd; ++it )
921  {
922  unsigned int rawId = (*it)->geographicalId().rawId();
923 
924  const float* parameters = fwGeometry_.getParameters(rawId);
925 
926  if ( parameters == 0 )
927  {
928  std::cout<<"Parameters empty for "<< detname <<" element with detid: "
929  << rawId <<std::endl;
930  continue;
931  }
932 
933  if ( const PixelGeomDetUnit* det =
934  dynamic_cast<const PixelGeomDetUnit*>(trackerGeometry_->idToDetUnit((*it)->geographicalId())) )
935  {
936  if ( const PixelTopology* rpt = &det->specificTopology() )
937  {
938  int nrows = rpt->nrows();
939  int ncolumns = rpt->ncolumns();
940 
941  assert(parameters[0] == nrows);
942  assert(parameters[1] == ncolumns);
943 
944  for ( int row = 1; row <= nrows; ++row )
945  {
946  for ( int column = 1; column <= ncolumns; ++column )
947  {
948  LocalPoint localPoint = rpt->localPosition(MeasurementPoint(row, column));
949 
950  pixelLocalXs.push_back(localPoint.x() - fireworks::pixelLocalX(row, nrows));
951  pixelLocalYs.push_back(localPoint.y() - fireworks::pixelLocalY(column, ncolumns));
952  }
953  }
954  }
955 
956  else
957  std::cout<<"No topology for "<< detname <<" "<< rawId <<std::endl;
958  }
959 
960  else
961  std::cout<<"No geomDetUnit for "<< detname <<" "<< rawId <<std::endl;
962  }
963 
964  std::string hn(detname);
965  makeHistogram(hn+" pixelLocalX", pixelLocalXs);
966  makeHistogram(hn+" pixelLocalY", pixelLocalYs);
967 }
edm::ESHandle< TrackerGeometry > trackerGeometry_
float pixelLocalY(const double mpy, const int m_ncols)
Definition: TrackUtils.cc:203
const float * getParameters(unsigned int id) const
Definition: FWGeometry.cc:296
assert(m_qm.get())
T y() const
Definition: PV3DBase.h:63
void makeHistogram(const std::string &name, std::vector< double > &data)
Measurement2DPoint MeasurementPoint
Measurement points are two-dimensional by default.
tuple cout
Definition: gather_cfg.py:145
T x() const
Definition: PV3DBase.h:62
float pixelLocalX(const double mpx, const int m_nrows)
Definition: TrackUtils.cc:170
void ValidateGeometry::validateRPCGeometry ( const int  regionNumber,
const char *  regionName 
)
private

Definition at line 283 of file ValidateGeometry.cc.

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

Referenced by analyze().

284 {
285  clearData();
286 
287  std::vector<double> centers;
288 
289  auto const& rolls = rpcGeometry_->rolls();
290 
291  for ( auto it = rolls.begin(),
292  itEnd = rolls.end();
293  it != itEnd; ++it )
294  {
295  const RPCRoll* roll = *it;
296 
297  if ( roll )
298  {
299  RPCDetId rpcDetId = roll->id();
300 
301  if ( rpcDetId.region() == regionNumber )
302  {
303  const GeomDetUnit* det = rpcGeometry_->idToDetUnit(rpcDetId);
304  GlobalPoint gp = det->surface().toGlobal(LocalPoint(0.0, 0.0, 0.0));
305 
306  const TGeoMatrix* matrix = fwGeometry_.getMatrix(rpcDetId.rawId());
307 
308  if ( ! matrix )
309  {
310  std::cout<<"Failed to get matrix of RPC with detid: "
311  << rpcDetId.rawId() <<std::endl;
312  continue;
313  }
314 
315  compareTransform(gp, matrix);
316 
317  const float* shape = fwGeometry_.getShapePars(rpcDetId.rawId());
318 
319  if ( ! shape )
320  {
321  std::cout<<"Failed to get shape of RPC with detid: "
322  << rpcDetId.rawId() <<std::endl;
323  continue;
324  }
325 
326  compareShape(det, shape);
327 
328  const float* parameters = fwGeometry_.getParameters(rpcDetId.rawId());
329 
330  if ( parameters == 0 )
331  {
332  std::cout<<"Parameters empty for RPC with detid: "
333  << rpcDetId.rawId() <<std::endl;
334  continue;
335  }
336 
337  // Yes, I know that below I'm comparing the equivalence
338  // of floating point numbers
339 
340  int nStrips = roll->nstrips();
341  assert(nStrips == parameters[0]);
342 
343  float stripLength = roll->specificTopology().stripLength();
344  assert(stripLength == parameters[1]);
345 
346  float pitch = roll->specificTopology().pitch();
347  assert(pitch == parameters[2]);
348 
349  float offset = -0.5*nStrips*pitch;
350 
351  for ( int strip = 1; strip <= roll->nstrips(); ++strip )
352  {
353  LocalPoint centreOfStrip1 = roll->centreOfStrip(strip);
354  LocalPoint centreOfStrip2 = LocalPoint((strip-0.5)*pitch + offset, 0.0);
355 
356  centers.push_back(centreOfStrip1.x()-centreOfStrip2.x());
357  }
358  }
359  }
360  }
361 
362  std::string hn(regionName);
363  makeHistogram(hn+": centreOfStrip", centers);
364 
365 
366  makeHistograms(regionName);
367 }
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:106
LocalPoint centreOfStrip(int strip) const
Definition: RPCRoll.cc:52
const float * getParameters(unsigned int id) const
Definition: FWGeometry.cc:296
edm::ESHandle< RPCGeometry > rpcGeometry_
assert(m_qm.get())
int nstrips() const
Definition: RPCRoll.cc:46
void makeHistograms(const char *detector)
const TGeoMatrix * getMatrix(unsigned int id) const
Definition: FWGeometry.cc:169
const StripTopology & specificTopology() const
Definition: RPCRoll.cc:107
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:40
void makeHistogram(const std::string &name, std::vector< double > &data)
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
const float * getShapePars(unsigned int id) const
Definition: FWGeometry.cc:312
virtual float stripLength() const =0
RPCDetId id() const
Definition: RPCRoll.cc:24
void compareShape(const GeomDet *det, const float *shape)
virtual float pitch() const =0
Local3DPoint LocalPoint
Definition: LocalPoint.h:11
tuple cout
Definition: gather_cfg.py:145
T x() const
Definition: PV3DBase.h:62
void compareTransform(const GlobalPoint &point, const TGeoMatrix *matrix)
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.
Definition: RPCDetId.h:63
void ValidateGeometry::validateStripTopology ( const TrackerGeometry::DetContainer dets,
const char *  detname 
)
private

Definition at line 970 of file ValidateGeometry.cc.

References assert(), gather_cfg::cout, fwGeometry_, FWGeometry::getParameters(), StripTopology::localPosition(), makeHistogram(), StripTopology::nstrips(), HLT_25ns10e33_v2_cff::parameters, StripTopology::pitch(), AlCaHLTBitMon_QueryRunRegistry::string, StripTopology::stripLength(), funct::tan(), trackerGeometry_, and PV3DBase< T, PVType, FrameType >::x().

Referenced by analyze().

972 {
973  std::vector<double> radialStripLocalXs;
974  std::vector<double> rectangularStripLocalXs;
975 
976  for ( TrackerGeometry::DetContainer::const_iterator it = dets.begin(),
977  itEnd = dets.end();
978  it != itEnd; ++it )
979  {
980  unsigned int rawId = (*it)->geographicalId().rawId();
981 
982  const float* parameters = fwGeometry_.getParameters(rawId);
983 
984  if ( parameters == 0 )
985  {
986  std::cout<<"Parameters empty for "<< detname <<" element with detid: "
987  << rawId <<std::endl;
988  continue;
989  }
990 
991  if ( const StripGeomDetUnit* det =
992  dynamic_cast<const StripGeomDetUnit*>(trackerGeometry_->idToDet((*it)->geographicalId())) )
993  {
994  // NOTE: why the difference in dets vs. units between these and pixels? The dynamic cast above
995  // fails for many of the detids...
996 
997  const StripTopology* st = dynamic_cast<const StripTopology*>(&det->specificTopology());
998 
999  if ( st )
1000  {
1001  //assert(parameters[0] == 0);
1002  int nstrips = st->nstrips();
1003  assert(parameters[1] == nstrips);
1004  assert(parameters[2] == st->stripLength());
1005 
1006  if( const RadialStripTopology* rst = dynamic_cast<const RadialStripTopology*>(&(det->specificType().specificTopology())) )
1007  {
1008  assert(parameters[0] == 1);
1009  assert(parameters[3] == rst->yAxisOrientation());
1010  assert(parameters[4] == rst->originToIntersection());
1011  assert(parameters[5] == rst->phiOfOneEdge());
1012  assert(parameters[6] == rst->angularWidth());
1013 
1014  for ( uint16_t strip = 1; strip <= nstrips; ++strip )
1015  {
1016  float stripAngle1 = rst->stripAngle(strip);
1017  float stripAngle2 = parameters[3] * (parameters[5] + strip*parameters[6]);
1018 
1019  assert((stripAngle1-stripAngle2) == 0);
1020 
1021  LocalPoint stripPosition = st->localPosition(strip);
1022 
1023  float stripX = parameters[4]*tan(stripAngle2);
1024  radialStripLocalXs.push_back(stripPosition.x()-stripX);
1025  }
1026  }
1027 
1028  else if( dynamic_cast<const RectangularStripTopology*>(&(det->specificType().specificTopology())) )
1029  {
1030  assert(parameters[0] == 2);
1031  assert(parameters[3] == st->pitch());
1032 
1033  for ( uint16_t strip = 1; strip <= nstrips; ++strip )
1034  {
1035  LocalPoint stripPosition = st->localPosition(strip);
1036  float stripX = -parameters[1]*0.5*parameters[3];
1037  stripX += strip*parameters[3];
1038  rectangularStripLocalXs.push_back(stripPosition.x()-stripX);
1039  }
1040  }
1041 
1042  else if( dynamic_cast<const TrapezoidalStripTopology*>(&(det->specificType().specificTopology())) )
1043  {
1044  assert(parameters[0] == 3);
1045  assert(parameters[3] == st->pitch());
1046  }
1047 
1048  else
1049  std::cout<<"Failed to get pitch for "<< detname <<" "<< rawId <<std::endl;
1050  }
1051 
1052  else
1053  std::cout<<"Failed cast to StripTopology for "<< detname <<" "<< rawId <<std::endl;
1054  }
1055 
1056  //else
1057  // std::cout<<"Failed cast to StripGeomDetUnit for "<< detname <<" "<< rawId <<std::endl;
1058  }
1059 
1060  std::string hn(detname);
1061  makeHistogram(hn+" radial strip localX", radialStripLocalXs);
1062  makeHistogram(hn+" rectangular strip localX", rectangularStripLocalXs);
1063 }
virtual int nstrips() const =0
edm::ESHandle< TrackerGeometry > trackerGeometry_
const float * getParameters(unsigned int id) const
Definition: FWGeometry.cc:296
assert(m_qm.get())
void makeHistogram(const std::string &name, std::vector< double > &data)
virtual float stripLength() const =0
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
virtual float pitch() const =0
virtual LocalPoint localPosition(float strip) const =0
tuple cout
Definition: gather_cfg.py:145
T x() const
Definition: PV3DBase.h:62
void ValidateGeometry::validateTrackerGeometry ( const TrackerGeometry::DetContainer dets,
const char *  detname 
)
private

Definition at line 872 of file ValidateGeometry.cc.

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

Referenced by analyze().

874 {
875  clearData();
876 
877  for ( TrackerGeometry::DetContainer::const_iterator it = dets.begin(),
878  itEnd = dets.end();
879  it != itEnd; ++it )
880  {
881  GlobalPoint gp = (trackerGeometry_->idToDet((*it)->geographicalId()))->surface().toGlobal(LocalPoint(0.0,0.0,0.0));
882  unsigned int rawId = (*it)->geographicalId().rawId();
883 
884  const TGeoMatrix* matrix = fwGeometry_.getMatrix(rawId);
885 
886  if ( ! matrix )
887  {
888  std::cout <<"Failed to get matrix of "<< detname
889  <<" element with detid: "<< rawId <<std::endl;
890  continue;
891  }
892 
893  compareTransform(gp, matrix);
894 
895  const float* shape = fwGeometry_.getShapePars(rawId);
896 
897  if ( ! shape )
898  {
899  std::cout<<"Failed to get shape of "<< detname
900  <<" element with detid: "<< rawId <<std::endl;
901  continue;
902  }
903 
904  compareShape(*it, shape);
905  }
906 
907  makeHistograms(detname);
908 }
edm::ESHandle< TrackerGeometry > trackerGeometry_
void makeHistograms(const char *detector)
const TGeoMatrix * getMatrix(unsigned int id) const
Definition: FWGeometry.cc:169
const float * getShapePars(unsigned int id) const
Definition: FWGeometry.cc:312
void compareShape(const GeomDet *det, const float *shape)
Local3DPoint LocalPoint
Definition: LocalPoint.h:11
tuple cout
Definition: gather_cfg.py:145
void compareTransform(const GlobalPoint &point, const TGeoMatrix *matrix)

Member Data Documentation

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

Definition at line 121 of file ValidateGeometry.cc.

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

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

Definition at line 112 of file ValidateGeometry.cc.

Referenced by analyze(), and validateCaloGeometry().

edm::ESHandle<CSCGeometry> ValidateGeometry::cscGeometry_
private
edm::ESHandle<DTGeometry> ValidateGeometry::dtGeometry_
private
FWGeometry ValidateGeometry::fwGeometry_
private
std::vector<double> ValidateGeometry::globalDistances_
private
std::string ValidateGeometry::infileName_
private

Definition at line 106 of file ValidateGeometry.cc.

Referenced by ValidateGeometry().

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

Definition at line 122 of file ValidateGeometry.cc.

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

TFile* ValidateGeometry::outFile_
private

Definition at line 117 of file ValidateGeometry.cc.

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

std::string ValidateGeometry::outfileName_
private

Definition at line 107 of file ValidateGeometry.cc.

Referenced by endJob(), and ValidateGeometry().

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

Definition at line 109 of file ValidateGeometry.cc.

Referenced by analyze(), and validateRPCGeometry().

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

Definition at line 123 of file ValidateGeometry.cc.

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

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

Definition at line 120 of file ValidateGeometry.cc.

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

edm::ESHandle<TrackerGeometry> ValidateGeometry::trackerGeometry_
private