CMS 3D CMS Logo

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

Public Member Functions

 ListIds (const edm::ParameterSet &)
 
 ~ListIds () 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 noexcept final
 
bool wantsGlobalRuns () const noexcept final
 
bool wantsInputProcessBlocks () const noexcept final
 
bool wantsProcessBlocks () const noexcept 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 noexcept
 
bool wantsStreamRuns () const noexcept
 
 ~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
 
ESResolverIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESResolverIndex > 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
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void beginJob () override
 
void endJob () override
 

Private Attributes

edm::ESGetToken< DDCompactView, IdealGeometryRecorddddToken_
 
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecordgeoToken_
 
std::vector< std::string > materials_
 
bool printMaterial_
 

Additional Inherited Members

- Public Types inherited from edm::one::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- 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 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 67 of file ListIds.cc.

Constructor & Destructor Documentation

◆ ListIds()

ListIds::ListIds ( const edm::ParameterSet pset)

Definition at line 86 of file ListIds.cc.

87  : printMaterial_(pset.getUntrackedParameter<bool>("printMaterial")),
88  materials_(pset.getUntrackedParameter<std::vector<std::string> >("materials")),
90  geoToken_(esConsumes()) {}
bool printMaterial_
Definition: ListIds.cc:80
std::vector< std::string > materials_
Definition: ListIds.cc:81
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > geoToken_
Definition: ListIds.cc:83
edm::ESGetToken< DDCompactView, IdealGeometryRecord > dddToken_
Definition: ListIds.cc:82

◆ ~ListIds()

ListIds::~ListIds ( )
override

Definition at line 92 of file ListIds.cc.

92 {}

Member Function Documentation

◆ analyze()

void ListIds::analyze ( const edm::Event evt,
const edm::EventSetup setup 
)
overrideprivatevirtual

Implements edm::one::EDAnalyzerBase.

Definition at line 94 of file ListIds.cc.

References GeomDet::components(), gather_cfg::cout, dddGetString(), dddToken_, DetId::det(), ALCARECOTkAlBeamHalo_cff::filter, spr::find(), DDFilteredView::firstChild(), alignBH_cfg::fixed, DDName::fullname(), GeomDet::geographicalId(), DDFilteredView::geoHistory(), geoToken_, h, isotrackTrainRegressor::history, mps_fire::i, dqmiolumiharvest::j, DDFilteredView::logicalPart(), DDLogicalPart::material(), materials_, DDBase< N, C >::name(), DDFilteredView::next(), AlCaHLTBitMon_ParallelJobs::p, GeomDet::position(), position, printMaterial_, DetId::rawId(), singleTopDQM_cfi::setup, AlCaHLTBitMon_QueryRunRegistry::string, GeomDet::subDetector(), DetId::subdetId(), GeometricDet::Tracker, DDFilteredView::translation(), and CmsTrackerStringToEnum::type().

94  {
95  std::cout << "______________________________ DDD ______________________________" << std::endl;
96  auto hDdd = setup.getTransientHandle(dddToken_);
97 
98  std::string attribute = "TkDDDStructure";
99  CmsTrackerStringToEnum theCmsTrackerStringToEnum;
101  DDFilteredView fv(*hDdd, filter);
102  if (theCmsTrackerStringToEnum.type(dddGetString(attribute, fv)) != GeometricDet::Tracker) {
103  fv.firstChild();
104  if (theCmsTrackerStringToEnum.type(dddGetString(attribute, fv)) != GeometricDet::Tracker)
105  throw cms::Exception("Configuration") << "The first child of the DDFilteredView is not what is expected \n"
106  << dddGetString(attribute, fv);
107  }
108 
109  std::cout << std::fixed << std::setprecision(3);
110  bool printAnyMaterial = (std::find(materials_.begin(), materials_.end(), "ANY") != materials_.end());
111  do {
112  // print the full hierarchy of all elements whose material
113  // has been specified by the user. An empty list of
114  // materials will print no elements. The special
115  // keyword ANY (in any location of the vector)
116  // will select all elements.
117  if (printAnyMaterial ||
118  (std::find(materials_.begin(), materials_.end(), fv.logicalPart().material().name().fullname()) !=
119  materials_.end())) {
120  // start from 2 to skip the leading /OCMS[0]/CMSE[1] part
121  const DDGeoHistory &history = fv.geoHistory();
122  std::cout << '/';
123  for (unsigned int h = 2; h < history.size(); ++h) {
124  std::cout << '/' << history[h].logicalPart().name().ns() << ":" << history[h].logicalPart().name().name() << '['
125  << history[h].copyno() << ']';
126  }
127  if (printMaterial_)
128  std::cout << " Material: |" << fv.logicalPart().material().name() << "|";
129  // DD3Vector and DDTranslation are the same type as math::XYZVector
130  math::XYZVector position = fv.translation() / 10.; // mm -> cm
131  std::cout << "\t" << position << std::endl;
132  }
133  } while (fv.next());
134  std::cout << std::endl;
135 
136  std::cout << "______________________________ std::vector<GeomDet*> from TrackerGeometry::dets() "
137  "______________________________"
138  << std::endl;
139  auto const &geo = setup.getData(geoToken_);
140 
141  std::cout << std::fixed << std::setprecision(3);
142  auto const &dets = geo.dets();
143  for (unsigned int i = 0; i < dets.size(); ++i) {
144  const GeomDet &det = *dets[i];
145 
146  // Surface::PositionType is a typedef for Point3DBase<float,GlobalTag> a.k.a. GlobalPoint
147  const Surface::PositionType &p = det.position();
148  math::XYZVector position(p.x(), p.y(), p.z());
149 
150  std::cout << det.subDetector() << '\t' << det.geographicalId().det() << '\t' << det.geographicalId().subdetId()
151  << '\t' << det.geographicalId().rawId() << "\t" << position;
152  const std::vector<const GeomDet *> &parts = det.components();
153  if (!parts.empty()) {
154  std::cout << "\t[" << parts[0]->geographicalId().rawId();
155  for (unsigned int j = 1; j < parts.size(); ++j)
156  std::cout << '\t' << parts[j]->geographicalId().rawId();
157  std::cout << ']';
158  }
159  std::cout << std::endl;
160  }
161 }
virtual std::vector< const GeomDet * > components() const
Returns direct components, if any.
Definition: GeomDet.h:73
bool printMaterial_
Definition: ListIds.cc:80
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
static std::string dddGetString(const std::string &s, const DDFilteredView &view)
Definition: ListIds.cc:55
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:64
GeometricDet::GeometricEnumType type(std::string const &) const
std::vector< DDExpandedNode > DDGeoHistory
Geometrical &#39;path&#39; of the current node up to the root-node.
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:31
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
virtual SubDetector subDetector() const
Which subdetector.
Definition: GeomDet.cc:38
const Surface::PositionType & position() const
The position (origin of the R.F.)
Definition: GeomDet.h:43
std::vector< std::string > materials_
Definition: ListIds.cc:81
static int position[264][3]
Definition: ReadPGInfo.cc:289
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > geoToken_
Definition: ListIds.cc:83
edm::ESGetToken< DDCompactView, IdealGeometryRecord > dddToken_
Definition: ListIds.cc:82
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4

◆ beginJob()

void ListIds::beginJob ( void  )
inlineoverrideprivatevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 74 of file ListIds.cc.

74 {}

◆ endJob()

void ListIds::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 163 of file ListIds.cc.

163 {}

Member Data Documentation

◆ dddToken_

edm::ESGetToken<DDCompactView, IdealGeometryRecord> ListIds::dddToken_
private

Definition at line 82 of file ListIds.cc.

Referenced by analyze().

◆ geoToken_

Definition at line 83 of file ListIds.cc.

Referenced by analyze().

◆ materials_

std::vector<std::string> ListIds::materials_
private

Definition at line 81 of file ListIds.cc.

Referenced by analyze().

◆ printMaterial_

bool ListIds::printMaterial_
private

Definition at line 80 of file ListIds.cc.

Referenced by analyze().