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
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
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 &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
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::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices 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

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
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
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<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag) noexcept
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Detailed Description

Definition at line 68 of file ListIds.cc.

Constructor & Destructor Documentation

◆ ListIds()

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

Definition at line 85 of file ListIds.cc.

86  : printMaterial_(pset.getUntrackedParameter<bool>("printMaterial")),
87  materials_(pset.getUntrackedParameter<std::vector<std::string> >("materials")) {}

◆ ~ListIds()

ListIds::~ListIds ( )
override

Definition at line 89 of file ListIds.cc.

89 {}

Member Function Documentation

◆ analyze()

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

Implements edm::one::EDAnalyzerBase.

Definition at line 91 of file ListIds.cc.

91  {
92  std::cout << "______________________________ DDD ______________________________" << std::endl;
94  setup.get<IdealGeometryRecord>().get(hDdd);
95 
96  std::string attribute = "TkDDDStructure";
97  CmsTrackerStringToEnum theCmsTrackerStringToEnum;
99  DDFilteredView fv(*hDdd, filter);
100  if (theCmsTrackerStringToEnum.type(dddGetString(attribute, fv)) != GeometricDet::Tracker) {
101  fv.firstChild();
102  if (theCmsTrackerStringToEnum.type(dddGetString(attribute, fv)) != GeometricDet::Tracker)
103  throw cms::Exception("Configuration") << "The first child of the DDFilteredView is not what is expected \n"
104  << dddGetString(attribute, fv);
105  }
106 
107  std::cout << std::fixed << std::setprecision(3);
108  bool printAnyMaterial = (std::find(materials_.begin(), materials_.end(), "ANY") != materials_.end());
109  do {
110  // print the full hierarchy of all elements whose material
111  // has been specified by the user. An empty list of
112  // materials will print no elements. The special
113  // keyword ANY (in any location of the vector)
114  // will select all elements.
115  if (printAnyMaterial ||
116  (std::find(materials_.begin(), materials_.end(), fv.logicalPart().material().name().fullname()) !=
117  materials_.end())) {
118  // start from 2 to skip the leading /OCMS[0]/CMSE[1] part
119  const DDGeoHistory &history = fv.geoHistory();
120  std::cout << '/';
121  for (unsigned int h = 2; h < history.size(); ++h) {
122  std::cout << '/' << history[h].logicalPart().name().ns() << ":" << history[h].logicalPart().name().name() << '['
123  << history[h].copyno() << ']';
124  }
125  if (printMaterial_)
126  std::cout << " Material: |" << fv.logicalPart().material().name() << "|";
127  // DD3Vector and DDTranslation are the same type as math::XYZVector
128  math::XYZVector position = fv.translation() / 10.; // mm -> cm
129  std::cout << "\t" << position << std::endl;
130  }
131  } while (fv.next());
132  std::cout << std::endl;
133 
134  std::cout << "______________________________ std::vector<GeomDet*> from TrackerGeometry::dets() "
135  "______________________________"
136  << std::endl;
138  setup.get<TrackerDigiGeometryRecord>().get(hGeo);
139 
140  std::cout << std::fixed << std::setprecision(3);
141  auto const &dets = hGeo->dets();
142  for (unsigned int i = 0; i < dets.size(); ++i) {
143  const GeomDet &det = *dets[i];
144 
145  // Surface::PositionType is a typedef for Point3DBase<float,GlobalTag> a.k.a. GlobalPoint
146  const Surface::PositionType &p = det.position();
147  math::XYZVector position(p.x(), p.y(), p.z());
148 
149  std::cout << det.subDetector() << '\t' << det.geographicalId().det() << '\t' << det.geographicalId().subdetId()
150  << '\t' << det.geographicalId().rawId() << "\t" << position;
151  const std::vector<const GeomDet *> &parts = det.components();
152  if (!parts.empty()) {
153  std::cout << "\t[" << parts[0]->geographicalId().rawId();
154  for (unsigned int j = 1; j < parts.size(); ++j)
155  std::cout << '\t' << parts[j]->geographicalId().rawId();
156  std::cout << ']';
157  }
158  std::cout << std::endl;
159  }
160 }

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

◆ beginJob()

void ListIds::beginJob ( void  )
inlineoverrideprivatevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 75 of file ListIds.cc.

75 {}

◆ endJob()

void ListIds::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 162 of file ListIds.cc.

162 {}

Member Data Documentation

◆ materials_

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

Definition at line 82 of file ListIds.cc.

Referenced by analyze().

◆ printMaterial_

bool ListIds::printMaterial_
private

Definition at line 81 of file ListIds.cc.

Referenced by analyze().

GeomDet::position
const Surface::PositionType & position() const
The position (origin of the R.F.)
Definition: GeomDet.h:43
ListIds::printMaterial_
bool printMaterial_
Definition: ListIds.cc:81
dddGetString
static std::string dddGetString(const std::string &s, const DDFilteredView &view)
Definition: ListIds.cc:56
alignBH_cfg.fixed
fixed
Definition: alignBH_cfg.py:54
mps_fire.i
i
Definition: mps_fire.py:428
DDGeoHistory
std::vector< DDExpandedNode > DDGeoHistory
Geometrical 'path' of the current node up to the root-node.
Definition: DDExpandedNode.h:82
CmsTrackerStringToEnum::type
GeometricDet::GeometricEnumType type(std::string const &) const
Definition: CmsTrackerStringToEnum.cc:122
GeomDet
Definition: GeomDet.h:27
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
h
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
Definition: L1TUtmAlgorithmRcd.h:4
DetId::det
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46
gather_cfg.cout
cout
Definition: gather_cfg.py:144
CmsTrackerStringToEnum
Definition: CmsTrackerStringToEnum.h:10
GeomDet::components
virtual std::vector< const GeomDet * > components() const
Returns direct components, if any.
Definition: GeomDet.h:73
spr::find
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
singleTopDQM_cfi.setup
setup
Definition: singleTopDQM_cfi.py:37
GeometricDet::Tracker
Definition: GeometricDet.h:50
contentValuesFiles.parts
parts
Definition: contentValuesFiles.py:58
TrackerDigiGeometryRecord
Definition: TrackerDigiGeometryRecord.h:15
edm::ESHandle< TrackerGeometry >
h
Point3DBase< float, GlobalTag >
ALCARECOTkAlBeamHalo_cff.filter
filter
Definition: ALCARECOTkAlBeamHalo_cff.py:27
DetId::subdetId
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum)
Definition: DetId.h:48
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
GeomDet::geographicalId
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:64
math::XYZVector
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:31
position
static int position[264][3]
Definition: ReadPGInfo.cc:289
DDSpecificsHasNamedValueFilter
Definition: DDFilter.h:60
TrackerGeometry::dets
const DetContainer & dets() const override
Returm a vector of all GeomDet (including all GeomDetUnits)
Definition: TrackerGeometry.h:62
get
#define get
edm::ESTransientHandle
Definition: ESTransientHandle.h:41
DetId::rawId
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
DDFilteredView
Definition: DDFilteredView.h:20
cms::Exception
Definition: Exception.h:70
ListIds::materials_
std::vector< std::string > materials_
Definition: ListIds.cc:82
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
IdealGeometryRecord
Definition: IdealGeometryRecord.h:25
GeomDet::subDetector
virtual SubDetector subDetector() const
Which subdetector.
Definition: GeomDet.cc:38
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27