test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 &)
 
virtual ~ListIds ()
 
- Public Member Functions inherited from edm::one::EDAnalyzer<>
 EDAnalyzer ()=default
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDAnalyzerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
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 & 
itemsToGetFromEvent () 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
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
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
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
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 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)
 

Detailed Description

Definition at line 71 of file ListIds.cc.

Constructor & Destructor Documentation

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

Definition at line 89 of file ListIds.cc.

90  : printMaterial_(pset.getUntrackedParameter<bool>("printMaterial")),
91  materials_(pset.getUntrackedParameter<std::vector<std::string> >("materials")) {
92 }
T getUntrackedParameter(std::string const &, T const &) const
bool printMaterial_
Definition: ListIds.cc:85
std::vector< std::string > materials_
Definition: ListIds.cc:86
ListIds::~ListIds ( )
virtual

Definition at line 94 of file ListIds.cc.

94  {
95 }

Member Function Documentation

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

Implements edm::one::EDAnalyzerBase.

Definition at line 98 of file ListIds.cc.

References DDFilteredView::addFilter(), GeomDet::components(), gather_cfg::cout, dddGetString(), DetId::det(), alcazmumu_cfi::filter, spr::find(), DDFilteredView::firstChild(), DDName::fullname(), GeomDet::geographicalId(), DDFilteredView::geoHistory(), edm::EventSetup::get(), h, i, j, DDFilteredView::logicalPart(), DDLogicalPart::material(), materials_, DDBase< N, C >::name(), DDFilteredView::next(), not_equals, AlCaHLTBitMon_ParallelJobs::p, contentValuesFiles::parts, GeomDet::position(), position, printMaterial_, DetId::rawId(), DDSpecificsFilter::setCriteria(), AlCaHLTBitMon_QueryRunRegistry::string, GeomDet::subDetector(), DetId::subdetId(), GeometricDet::Tracker, DDFilteredView::translation(), CmsTrackerStringToEnum::type(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

98  {
99  std::cout << "______________________________ DDD ______________________________" << std::endl;
101  setup.get<IdealGeometryRecord>().get( hDdd );
102 
103  std::string attribute = "TkDDDStructure";
104  CmsTrackerStringToEnum theCmsTrackerStringToEnum;
106  filter.setCriteria(DDValue(attribute, "any", 0), DDCompOp::not_equals);
107  DDFilteredView fv(*hDdd);
108  fv.addFilter(filter);
109  if (theCmsTrackerStringToEnum.type(dddGetString(attribute, fv)) != GeometricDet::Tracker) {
110  fv.firstChild();
111  if (theCmsTrackerStringToEnum.type(dddGetString(attribute, fv)) != GeometricDet::Tracker)
112  throw cms::Exception("Configuration") << "The first child of the DDFilteredView is not what is expected \n"
113  << dddGetString(attribute, fv);
114  }
115 
116  std::cout << std::fixed << std::setprecision(3);
117  bool printAnyMaterial = (std::find(materials_.begin(), materials_.end(), "ANY") != materials_.end());
118  do {
119  // print the full hierarchy of all elements whose material
120  // has been specified by the user. An empty list of
121  // materials will print no elements. The special
122  // keyword ANY (in any location of the vector)
123  // will select all elements.
124  if (printAnyMaterial ||
125  (std::find(materials_.begin(),
126  materials_.end(),
127  fv.logicalPart().material().name().fullname()) != materials_.end())) {
128 
129  // start from 2 to skip the leading /OCMS[0]/CMSE[1] part
130  const DDGeoHistory & history = fv.geoHistory();
131  std::cout << '/';
132  for (unsigned int h = 2; h < history.size(); ++h) {
133  std::cout << '/' << history[h].logicalPart().name().ns()
134  << ":" << history[h].logicalPart().name().name() << '[' << history[h].copyno() << ']';
135  }
136  if (printMaterial_)
137  std::cout << " Material: |" << fv.logicalPart().material().name() << "|";
138  // DD3Vector and DDTranslation are the same type as math::XYZVector
139  math::XYZVector position = fv.translation() / 10.; // mm -> cm
140  std::cout << "\t" << position << std::endl;
141  }
142  } while (fv.next());
143  std::cout << std::endl;
144 
145  std::cout << "______________________________ std::vector<GeomDet*> from TrackerGeometry::dets() ______________________________" << std::endl;
147  setup.get<TrackerDigiGeometryRecord>().get( hGeo );
148 
149  std::cout << std::fixed << std::setprecision(3);
150  auto const & dets = hGeo->dets();
151  for (unsigned int i = 0; i < dets.size(); ++i) {
152  const GeomDet & det = *dets[i];
153 
154  // Surface::PositionType is a typedef for Point3DBase<float,GlobalTag> a.k.a. GlobalPoint
155  const Surface::PositionType & p = det.position();
156  math::XYZVector position(p.x(), p.y(), p.z());
157 
158  std::cout << det.subDetector() << '\t'
159  << det.geographicalId().det() << '\t'
160  << det.geographicalId().subdetId() << '\t'
161  << det.geographicalId().rawId() << "\t"
162  << position;
163  const std::vector<const GeomDet*> & parts = det.components();
164  if (parts.size()) {
165  std::cout << "\t[" << parts[0]->geographicalId().rawId();
166  for (unsigned int j = 1; j < parts.size(); ++j)
167  std::cout << '\t' << parts[j]->geographicalId().rawId();
168  std::cout << ']';
169  }
170  std::cout << std::endl;
171  }
172 
173 }
int i
Definition: DBlmapReader.cc:9
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
bool printMaterial_
Definition: ListIds.cc:85
T y() const
Definition: PV3DBase.h:63
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
const Surface::PositionType & position() const
The position (origin of the R.F.)
Definition: GeomDet.h:48
T z() const
Definition: PV3DBase.h:64
int j
Definition: DBlmapReader.cc:9
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:79
static std::string dddGetString(const std::string &s, const DDFilteredView &view)
Definition: ListIds.cc:58
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
std::vector< DDExpandedNode > DDGeoHistory
Geometrical &#39;path&#39; of the current node up to the root-node.
virtual std::vector< const GeomDet * > components() const
Returns direct components, if any.
Definition: GeomDet.h:88
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:30
const T & get() const
Definition: EventSetup.h:56
std::vector< std::string > materials_
Definition: ListIds.cc:86
static int position[264][3]
Definition: ReadPGInfo.cc:509
tuple cout
Definition: gather_cfg.py:145
Detector det() const
get the detector field from this detid
Definition: DetId.h:35
virtual SubDetector subDetector() const
Which subdetector.
Definition: GeomDet.cc:44
T x() const
Definition: PV3DBase.h:62
void setCriteria(const DDValue &nameVal, DDCompOp, DDLogOp l=DDLogOp::AND, bool asString=true, bool merged=true)
Definition: DDFilter.cc:253
GeometricDet::GeometricEnumType type(std::string const &) const
The DDGenericFilter is a runtime-parametrized Filter looking on DDSpecifcs.
Definition: DDFilter.h:33
void ListIds::beginJob ( void  )
inlineoverrideprivatevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 79 of file ListIds.cc.

79 {}
void ListIds::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 176 of file ListIds.cc.

176  {
177 }

Member Data Documentation

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

Definition at line 86 of file ListIds.cc.

Referenced by analyze().

bool ListIds::printMaterial_
private

Definition at line 85 of file ListIds.cc.

Referenced by analyze().