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 16 of file DTGeometryTest.cc.

Constructor & Destructor Documentation

DTGeometryTest::DTGeometryTest ( const ParameterSet iConfig)
explicit

Definition at line 29 of file DTGeometryTest.cc.

References m_label.

30  : m_label(iConfig.getUntrackedParameter<string>("fromDataLabel", "")),
31  m_token(esConsumes<DTGeometry, MuonGeometryRecord>(edm::ESInputTag{"", m_label}))
32 {}
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 &   
)
override

Definition at line 35 of file DTGeometryTest.cc.

References DTTopology::cellHeight(), DTTopology::cellLenght(), DTTopology::cellWidth(), DTGeometry::chambers(), DTTopology::channels(), DEFINE_FWK_MODULE, DTGeometry::dets(), DTGeometry::detTypes(), DTGeometry::detUnits(), DTTopology::firstChannel(), edm::EventSetup::getTransientHandle(), DTTopology::lastChannel(), DTGeometry::layers(), edm::LogVerbatim::log(), cmsBatch::log, m_label, m_token, AlCaHLTBitMon_QueryRunRegistry::string, and DTGeometry::superLayers().

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

Definition at line 20 of file DTGeometryTest.cc.

References analyze(), and iEvent.

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

Definition at line 22 of file DTGeometryTest.cc.

22 {}

Member Data Documentation

const string DTGeometryTest::m_label
private

Definition at line 25 of file DTGeometryTest.cc.

Referenced by analyze(), and DTGeometryTest().

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

Definition at line 26 of file DTGeometryTest.cc.

Referenced by analyze().