CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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,
MuonGeometryRecord
m_token
 

Detailed Description

Definition at line 18 of file DTGeometryTest.cc.

Constructor & Destructor Documentation

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

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(), DTTopology::channels(), DTTopology::firstChannel(), edm::EventSetup::getTransientHandle(), edm::ESHandleBase::isValid(), DTTopology::lastChannel(), log, m_label, m_token, cms_rounding::roundVecIfNear0(), and AlCaHLTBitMon_QueryRunRegistry::string.

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
static std::vector< std::string > checklist log
float cellWidth() const
Returns the cell width.
Definition: DTTopology.h:69
int firstChannel() const
Returns the wire number of the first wire.
Definition: DTTopology.h:79
int lastChannel() const
Returns the wire number of the last wire.
Definition: DTTopology.h:81
float cellHeight() const
Returns the cell height.
Definition: DTTopology.h:71
const string m_label
int channels() const
Returns the number of wires in the layer.
Definition: DTTopology.h:76
const edm::ESGetToken< DTGeometry, MuonGeometryRecord > m_token
bool isValid() const
Definition: ESHandle.h:44
float cellLenght() const
Definition: DTTopology.h:74
void DTGeometryTest::beginJob ( void  )
inlineoverride

Definition at line 22 of file DTGeometryTest.cc.

22 {}
void DTGeometryTest::endJob ( void  )
inlineoverride

Definition at line 24 of file DTGeometryTest.cc.

24 {}

Member Data Documentation

const string DTGeometryTest::m_label
private

Definition at line 27 of file DTGeometryTest.cc.

Referenced by analyze(), and DTGeometryTest().

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

Definition at line 28 of file DTGeometryTest.cc.

Referenced by analyze().