CMS 3D CMS Logo

Public Member Functions | Private Member Functions

ListGroups Class Reference

Inheritance diagram for ListGroups:
edm::EDAnalyzer

List of all members.

Public Member Functions

 ListGroups (const edm::ParameterSet &)
virtual ~ListGroups ()

Private Member Functions

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

Detailed Description

Definition at line 65 of file ListGroups.cc.


Constructor & Destructor Documentation

ListGroups::ListGroups ( const edm::ParameterSet )

Definition at line 77 of file ListGroups.cc.

                                              {
}
ListGroups::~ListGroups ( ) [virtual]

Definition at line 80 of file ListGroups.cc.

                        {
}

Member Function Documentation

void ListGroups::analyze ( const edm::Event evt,
const edm::EventSetup setup 
) [private, virtual]

Implements edm::EDAnalyzer.

Definition at line 84 of file ListGroups.cc.

References DDFilteredView::addFilter(), gather_cfg::cout, dddGetString(), align_tpl::filter, DDFilteredView::geoHistory(), edm::EventSetup::get(), h, DDFilteredView::next(), DDSpecificsFilter::not_equals, position, DDSpecificsFilter::setCriteria(), and DDFilteredView::translation().

                                                                   {
  edm::ESTransientHandle<DDCompactView> hDdd;
  setup.get<IdealGeometryRecord>().get( hDdd );
  DDFilteredView fv(*hDdd);

  DDSpecificsFilter filter;
  filter.setCriteria(DDValue("TrackingMaterialGroup", ""), DDSpecificsFilter::not_equals);
  fv.addFilter(filter);

  while (fv.next()) {
    // print the group name and full hierarchy of all items
    std::cout << dddGetString("TrackingMaterialGroup", fv) << '\t';

    // start from 2 to skip the leading /OCMS[0]/CMSE[1] part
    const DDGeoHistory & history = fv.geoHistory();
    std::cout << '/';
    for (unsigned int h = 2; h < history.size(); ++h)
      std::cout << '/' << history[h].logicalPart().name().name() << '[' << history[h].copyno() << ']';

    // DD3Vector and DDTranslation are the same type as math::XYZVector
    math::XYZVector position = fv.translation() / 10.;  // mm -> cm
    std::cout << "\t" << position << std::endl;
  };
  std::cout << std::endl;
}
void ListGroups::beginJob ( void  ) [inline, private, virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 73 of file ListGroups.cc.

{}
void ListGroups::endJob ( void  ) [private, virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 111 of file ListGroups.cc.

                   {
}