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
ListIds Class Reference
Inheritance diagram for ListIds:
edm::EDAnalyzer

Public Member Functions

 ListIds (const edm::ParameterSet &)
 
virtual ~ListIds ()
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 

Private Member Functions

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

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
typedef WorkerT< EDAnalyzerWorkerType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from edm::EDAnalyzer
CurrentProcessingContext const * currentContext () const
 

Detailed Description

Definition at line 68 of file ListIds.cc.

Constructor & Destructor Documentation

ListIds::ListIds ( const edm::ParameterSet )

Definition at line 80 of file ListIds.cc.

80  {
81 }
ListIds::~ListIds ( )
virtual

Definition at line 83 of file ListIds.cc.

83  {
84 }

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 87 of file ListIds.cc.

References DDFilteredView::addFilter(), GeomDet::components(), gather_cfg::cout, dddGetString(), DetId::det(), alcazmumu_cfi::filter, DDFilteredView::firstChild(), GeomDet::geographicalId(), DDFilteredView::geoHistory(), edm::EventSetup::get(), h, i, j, DDFilteredView::logicalPart(), DDLogicalPart::material(), DDBase< N, C >::name(), DDFilteredView::next(), DDSpecificsFilter::not_equals, AlCaHLTBitMon_ParallelJobs::p, CfgNavigationSchool_cfi::parts, GeomDet::position(), position, DetId::rawId(), DDSpecificsFilter::setCriteria(), 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().

87  {
88  std::cout << "______________________________ DDD ______________________________" << std::endl;
90  setup.get<IdealGeometryRecord>().get( hDdd );
91 
92  std::string attribute = "TkDDDStructure";
93  CmsTrackerStringToEnum theCmsTrackerStringToEnum;
95  filter.setCriteria(DDValue(attribute, "any", 0), DDSpecificsFilter::not_equals);
96  DDFilteredView fv(*hDdd);
97  fv.addFilter(filter);
98  if (theCmsTrackerStringToEnum.type(dddGetString(attribute, fv)) != GeometricDet::Tracker) {
99  fv.firstChild();
100  if (theCmsTrackerStringToEnum.type(dddGetString(attribute, fv)) != GeometricDet::Tracker)
101  throw cms::Exception("Configuration") << "The first child of the DDFilteredView is not what is expected \n"
102  << dddGetString(attribute, fv);
103  }
104 
105  std::cout << std::fixed << std::setprecision(3);
106  do {
107  // print the full hierarchy of all Silicon items
108  if (fv.logicalPart().material().name() == "materials:Silicon") {
109 
110  // start from 2 to skip the leading /OCMS[0]/CMSE[1] part
111  const DDGeoHistory & history = fv.geoHistory();
112  std::cout << '/';
113  for (unsigned int h = 2; h < history.size(); ++h) {
114  std::cout << '/' << history[h].logicalPart().name().name() << '[' << history[h].copyno() << ']';
115  }
116 
117  // DD3Vector and DDTranslation are the same type as math::XYZVector
118  math::XYZVector position = fv.translation() / 10.; // mm -> cm
119  std::cout << "\t" << position << std::endl;
120  }
121  } while (fv.next());
122  std::cout << std::endl;
123 
124  std::cout << "______________________________ std::vector<GeomDet*> from TrackerGeometry::dets() ______________________________" << std::endl;
126  setup.get<TrackerDigiGeometryRecord>().get( hGeo );
127 
128  std::cout << std::fixed << std::setprecision(3);
129  const std::vector<GeomDet*> & dets = hGeo->dets();
130  for (unsigned int i = 0; i < dets.size(); ++i) {
131  const GeomDet & det = *dets[i];
132 
133  // Surface::PositionType is a typedef for Point3DBase<float,GlobalTag> a.k.a. GlobalPoint
134  const Surface::PositionType & p = det.position();
135  math::XYZVector position(p.x(), p.y(), p.z());
136 
137  std::cout << det.subDetector() << '\t'
138  << det.geographicalId().det() << '\t'
139  << det.geographicalId().subdetId() << '\t'
140  << det.geographicalId().rawId() << "\t"
141  << position;
142  const std::vector<const GeomDet*> & parts = det.components();
143  if (parts.size()) {
144  std::cout << "\t[" << parts[0]->geographicalId().rawId();
145  for (unsigned int j = 1; j < parts.size(); ++j)
146  std::cout << '\t' << parts[j]->geographicalId().rawId();
147  std::cout << ']';
148  }
149  std::cout << std::endl;
150  }
151 
152 }
int i
Definition: DBlmapReader.cc:9
T y() const
Definition: PV3DBase.h:62
virtual SubDetector subDetector() const =0
Which subdetector.
uint32_t rawId() const
get the raw id
Definition: DetId.h:45
const Surface::PositionType & position() const
The position (origin of the R.F.)
Definition: GeomDet.h:41
T z() const
Definition: PV3DBase.h:63
int j
Definition: DBlmapReader.cc:9
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:72
static std::string dddGetString(const std::string &s, const DDFilteredView &view)
Definition: ListIds.cc:55
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:39
virtual std::vector< const GeomDet * > components() const =0
Returns direct components, if any.
std::vector< DDExpandedNode > DDGeoHistory
Geometrical &#39;path&#39; of the current node up to the root-node.
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:31
const T & get() const
Definition: EventSetup.h:55
static int position[264][3]
Definition: ReadPGInfo.cc:509
void setCriteria(const DDValue &nameVal, comp_op, log_op l=AND, bool asString=true, bool merged=true)
Definition: DDFilter.cc:285
tuple cout
Definition: gather_cfg.py:121
Detector det() const
get the detector field from this detid
Definition: DetId.h:37
T x() const
Definition: PV3DBase.h:61
GeometricDet::GeometricEnumType type(std::string const &) const
The DDGenericFilter is a runtime-parametrized Filter looking on DDSpecifcs.
Definition: DDFilter.h:37
void ListIds::beginJob ( void  )
inlineprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 76 of file ListIds.cc.

76 {}
void ListIds::endJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 155 of file ListIds.cc.

155  {
156 }