CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
DTGeometryTest Class Reference
Inheritance diagram for DTGeometryTest:

Public Member Functions

void analyze (Event const &iEvent, EventSetup const &) override
 
void beginJob () override
 
 DTGeometryTest (const ParameterSet &)
 
void endJob () override
 

Private Attributes

const string m_label
 
const edm::ESGetToken< DTGeometry, MuonGeometryRecordm_token
 

Detailed Description

Definition at line 18 of file DTGeometryTest.cc.

Constructor & Destructor Documentation

◆ DTGeometryTest()

DTGeometryTest::DTGeometryTest ( const ParameterSet iConfig)
explicit

Definition at line 31 of file DTGeometryTest.cc.

References m_label.

32  : m_label(iConfig.getUntrackedParameter<string>("fromDataLabel", "")),
33  m_token(esConsumes<DTGeometry, MuonGeometryRecord>(edm::ESInputTag{"", m_label})) {}
T getUntrackedParameter(std::string const &, T const &) const
const string m_label
const edm::ESGetToken< DTGeometry, MuonGeometryRecord > m_token

Member Function Documentation

◆ analyze()

void DTGeometryTest::analyze ( Event const &  iEvent,
EventSetup const &  iEventSetup 
)
override

Definition at line 35 of file DTGeometryTest.cc.

References DTTopology::cellHeight(), DTTopology::cellLenght(), DTTopology::cellWidth(), DTGeometry::chambers(), DTTopology::channels(), DTGeometry::dets(), DTGeometry::detTypes(), DTGeometry::detUnits(), DTTopology::firstChannel(), edm::EventSetup::getTransientHandle(), edm::ESHandleBase::isValid(), DTTopology::lastChannel(), DTGeometry::layers(), CrabHelper::log, m_label, m_token, cms_rounding::roundVecIfNear0(), AlCaHLTBitMon_QueryRunRegistry::string, and DTGeometry::superLayers().

35  {
36  LogVerbatim("DTGeometryTest") << "DTGeometryTest::analyze: " << m_label;
37  ESTransientHandle<DTGeometry> pDD = iEventSetup.getTransientHandle(m_token);
38 
39  LogVerbatim("DTGeometryTest") << " Geometry node for DTGeom is " << (pDD.isValid() ? "valid" : "not valid");
40  LogVerbatim("DTGeometryTest") << " I have " << pDD->detTypes().size() << " detTypes";
41  LogVerbatim("DTGeometryTest") << " I have " << pDD->detUnits().size() << " detUnits";
42  LogVerbatim("DTGeometryTest") << " I have " << pDD->dets().size() << " dets";
43  LogVerbatim("DTGeometryTest") << " I have " << pDD->layers().size() << " layers";
44  LogVerbatim("DTGeometryTest") << " I have " << pDD->superLayers().size() << " superlayers";
45  LogVerbatim("DTGeometryTest") << " I have " << pDD->chambers().size() << " chambers";
46 
47  // check chamber
48  LogVerbatim("DTGeometryTest") << "CHAMBERS " << string(120, '-');
49 
50  LogVerbatim("DTGeometryTest").log([&](auto& log) {
51  for (auto det : pDD->chambers()) {
52  const BoundPlane& surf = det->surface();
53  log << "Chamber " << det->id() << " Position " << surf.position() << " normVect "
54  << roundVecIfNear0(surf.normalVector()) << " bounds W/H/L: " << surf.bounds().width() << "/"
55  << surf.bounds().thickness() << "/" << surf.bounds().length() << "\n";
56  }
57  });
58  LogVerbatim("DTGeometryTest") << "END " << string(120, '-');
59 
60  // check superlayers
61  LogVerbatim("DTGeometryTest") << "SUPERLAYERS " << string(120, '-');
62  LogVerbatim("DTGeometryTest").log([&](auto& log) {
63  for (auto det : pDD->superLayers()) {
64  const BoundPlane& surf = det->surface();
65  log << "SuperLayer " << det->id() << " chamber " << det->chamber()->id() << " Position " << surf.position()
66  << " normVect " << roundVecIfNear0(surf.normalVector()) << " bounds W/H/L: " << surf.bounds().width() << "/"
67  << surf.bounds().thickness() << "/" << surf.bounds().length() << "\n";
68  }
69  });
70  LogVerbatim("DTGeometryTest") << "END " << string(120, '-');
71 
72  // check layers
73  LogVerbatim("DTGeometryTest") << "LAYERS " << string(120, '-');
74 
75  LogVerbatim("DTGeometryTest").log([&](auto& log) {
76  for (auto det : pDD->layers()) {
77  const DTTopology& topo = det->specificTopology();
78  const BoundPlane& surf = det->surface();
79  log << "Layer " << det->id() << " SL " << det->superLayer()->id() << " chamber " << det->chamber()->id()
80  << " Topology W/H/L: " << topo.cellWidth() << "/" << topo.cellHeight() << "/" << topo.cellLenght()
81  << " first/last/# wire " << topo.firstChannel() << "/" << topo.lastChannel() << "/" << topo.channels()
82  << " Position " << surf.position() << " normVect " << roundVecIfNear0(surf.normalVector())
83  << " bounds W/H/L: " << surf.bounds().width() << "/" << surf.bounds().thickness() << "/"
84  << surf.bounds().length() << "\n";
85  }
86  });
87  LogVerbatim("DTGeometryTest") << "END " << string(120, '-');
88 }
Log< level::Info, true > LogVerbatim
constexpr valType roundVecIfNear0(valType value, double tolerance=1.e-7)
Definition: Rounding.h:18
const DetContainer & dets() const override
Returm a vector of all GeomDet (including all GeomDetUnits)
Definition: DTGeometry.cc:63
float cellLenght() const
Definition: DTTopology.h:74
const DetContainer & detUnits() const override
Returm a vector of all GeomDet.
Definition: DTGeometry.cc:61
int firstChannel() const
Returns the wire number of the first wire.
Definition: DTTopology.h:79
float cellWidth() const
Returns the cell width.
Definition: DTTopology.h:69
const DetTypeContainer & detTypes() const override
Return a vector of all det types.
Definition: DTGeometry.cc:37
const string m_label
bool isValid() const
Definition: ESHandle.h:44
int lastChannel() const
Returns the wire number of the last wire.
Definition: DTTopology.h:81
const std::vector< const DTLayer * > & layers() const
Return a vector of all SuperLayer.
Definition: DTGeometry.cc:88
const std::vector< const DTChamber * > & chambers() const
Return a vector of all Chamber.
Definition: DTGeometry.cc:84
const edm::ESGetToken< DTGeometry, MuonGeometryRecord > m_token
int channels() const
Returns the number of wires in the layer.
Definition: DTTopology.h:76
const std::vector< const DTSuperLayer * > & superLayers() const
Return a vector of all SuperLayer.
Definition: DTGeometry.cc:86
float cellHeight() const
Returns the cell height.
Definition: DTTopology.h:71

◆ beginJob()

void DTGeometryTest::beginJob ( void  )
inlineoverride

Definition at line 22 of file DTGeometryTest.cc.

22 {}

◆ endJob()

void DTGeometryTest::endJob ( void  )
inlineoverride

Definition at line 24 of file DTGeometryTest.cc.

24 {}

Member Data Documentation

◆ m_label

const string DTGeometryTest::m_label
private

Definition at line 27 of file DTGeometryTest.cc.

Referenced by analyze(), and DTGeometryTest().

◆ m_token

const edm::ESGetToken<DTGeometry, MuonGeometryRecord> DTGeometryTest::m_token
private

Definition at line 28 of file DTGeometryTest.cc.

Referenced by analyze().