CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
PrintGeomSolids Class Reference
Inheritance diagram for PrintGeomSolids:
edm::one::EDAnalyzer<> edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

void analyze (edm::Event const &iEvent, edm::EventSetup const &) override
 
 PrintGeomSolids (const edm::ParameterSet &)
 
 ~PrintGeomSolids () override
 
- Public Member Functions inherited from edm::one::EDAnalyzer<>
 EDAnalyzer ()=default
 
 EDAnalyzer (const EDAnalyzer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
const EDAnalyzeroperator= (const EDAnalyzer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDAnalyzerBase () 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 const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
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::array< std::vector< ModuleDescription const *> *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const *> const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Attributes

edm::ESGetToken< cms::DDCompactView, IdealGeometryRecordcpvTokenDD4hep_
 
edm::ESGetToken< DDCompactView, IdealGeometryRecordcpvTokenDDD_
 
bool fromDD4hep_
 

Additional Inherited Members

- Public Types inherited from edm::one::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
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)
 
void resetItemsToGetFrom (BranchType iType)
 

Detailed Description

Definition at line 28 of file PrintGeomSolids.cc.

Constructor & Destructor Documentation

◆ PrintGeomSolids()

PrintGeomSolids::PrintGeomSolids ( const edm::ParameterSet ps)
explicit

Definition at line 42 of file PrintGeomSolids.cc.

References cpvTokenDD4hep_, cpvTokenDDD_, fromDD4hep_, and edm::ParameterSet::getParameter().

42  {
43  fromDD4hep_ = ps.getParameter<bool>("fromDD4hep");
44  if (fromDD4hep_)
45  cpvTokenDD4hep_ = esConsumes<cms::DDCompactView, IdealGeometryRecord>(edm::ESInputTag());
46  else
47  cpvTokenDDD_ = esConsumes<DDCompactView, IdealGeometryRecord>(edm::ESInputTag());
48 
49  edm::LogVerbatim("PrintGeom") << "PrintGeomSolids created with dd4hep: " << fromDD4hep_;
50 }
Log< level::Info, true > LogVerbatim
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::ESGetToken< DDCompactView, IdealGeometryRecord > cpvTokenDDD_
edm::ESGetToken< cms::DDCompactView, IdealGeometryRecord > cpvTokenDD4hep_

◆ ~PrintGeomSolids()

PrintGeomSolids::~PrintGeomSolids ( )
inlineoverride

Definition at line 31 of file PrintGeomSolids.cc.

31 {}

Member Function Documentation

◆ analyze()

void PrintGeomSolids::analyze ( edm::Event const &  iEvent,
edm::EventSetup const &  iSetup 
)
overridevirtual

Implements edm::one::EDAnalyzerBase.

Definition at line 58 of file PrintGeomSolids.cc.

References cpvTokenDD4hep_, cpvTokenDDD_, cms::DDDetector::description(), cms::DDCompactView::detector(), spr::find(), fromDD4hep_, relativeConstraints::geom, edm::EventSetup::getData(), DDCompactView::graph(), Skims_PA_cff::name, DDSolidShapesName::name(), DDBase< N, C >::name(), names, GetRecoTauVFromDQM_MC_cff::next, castor_dqm_sourceclient_file_cfg::path, DDSolid::shape(), DDLogicalPart::solid(), and AlCaHLTBitMon_QueryRunRegistry::string.

58  {
59  int solids(0);
60  if (fromDD4hep_) {
61  const cms::DDCompactView* cpv = &iSetup.getData(cpvTokenDD4hep_);
62  const cms::DDDetector* det = cpv->detector();
63  TGeoManager const& geom = det->description()->manager();
64  TGeoIterator next(geom.GetTopVolume());
65  TGeoNode* node;
66  TString path;
67  std::vector<std::string> names;
68  while ((node = next())) {
69  next.GetPath(path);
70  std::string name = static_cast<std::string>(node->GetVolume()->GetName());
71  if (std::find(names.begin(), names.end(), name) == names.end()) {
72  edm::LogVerbatim("PrintGeom") << name << " "
73  << static_cast<std::string>(node->GetVolume()->GetShape()->GetTitle());
74  names.emplace_back(name);
75  ++solids;
76  }
77  }
78 
79  } else {
80  const DDCompactView* cpv = &iSetup.getData(cpvTokenDDD_);
81  const auto& gra = cpv->graph();
82  for (DDCompactView::Graph::const_adj_iterator git = gra.begin(); git != gra.end(); ++git) {
83  const DDLogicalPart& ddLP = gra.nodeData(git);
84  const DDSolid& solid = ddLP.solid();
85  edm::LogVerbatim("PrintGeom") << solid.name() << " " << DDSolidShapesName::name(solid.shape());
86  ++solids;
87  }
88  }
89  edm::LogVerbatim("PrintGeom") << "\n\nPrintGeomSolids finds " << solids << " solids";
90 }
Log< level::Info, true > LogVerbatim
edm::ESGetToken< DDCompactView, IdealGeometryRecord > cpvTokenDDD_
dd4hep::Detector const * description() const
Definition: DDDetector.h:35
const cms::DDDetector * detector() const
Definition: DDCompactView.h:34
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
Compact representation of the geometrical detector hierarchy.
Definition: DDCompactView.h:81
const std::string names[nVars_]
A DDSolid represents the shape of a part.
Definition: DDSolid.h:39
static const char *const name(DDSolidShape s)
Definition: DDSolidShapes.h:33
edm::ESGetToken< cms::DDCompactView, IdealGeometryRecord > cpvTokenDD4hep_
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
Definition: DDLogicalPart.h:93
DDSolidShape shape(void) const
The type of the solid.
Definition: DDSolid.cc:123
const N & name() const
Definition: DDBase.h:59
const DDSolid & solid(void) const
Returns a reference object of the solid being the shape of this LogicalPart.
adj_list::const_iterator const_adj_iterator
Definition: Graph.h:105
const Graph & graph() const
Provides read-only access to the data structure of the compact-view.

◆ fillDescriptions()

void PrintGeomSolids::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 52 of file PrintGeomSolids.cc.

References edm::ConfigurationDescriptions::add(), and submitPVResolutionJobs::desc.

52  {
54  desc.add<bool>("fromDD4hep", false);
55  descriptions.add("printGeomSolids", desc);
56 }
void add(std::string const &label, ParameterSetDescription const &psetDescription)

Member Data Documentation

◆ cpvTokenDD4hep_

edm::ESGetToken<cms::DDCompactView, IdealGeometryRecord> PrintGeomSolids::cpvTokenDD4hep_
private

Definition at line 38 of file PrintGeomSolids.cc.

Referenced by analyze(), and PrintGeomSolids().

◆ cpvTokenDDD_

edm::ESGetToken<DDCompactView, IdealGeometryRecord> PrintGeomSolids::cpvTokenDDD_
private

Definition at line 37 of file PrintGeomSolids.cc.

Referenced by analyze(), and PrintGeomSolids().

◆ fromDD4hep_

bool PrintGeomSolids::fromDD4hep_
private

Definition at line 39 of file PrintGeomSolids.cc.

Referenced by analyze(), and PrintGeomSolids().