CMS 3D CMS Logo

Public Member Functions | Private Attributes

StripClusterSelectorTopBottom Class Reference

#include <StripClusterSelectorTopBottom.h>

Inheritance diagram for StripClusterSelectorTopBottom:
edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

List of all members.

Public Member Functions

void produce (edm::Event &event, const edm::EventSetup &setup)
 StripClusterSelectorTopBottom (const edm::ParameterSet &cfg)

Private Attributes

edm::InputTag label_
double y_

Detailed Description

Definition at line 31 of file StripClusterSelectorTopBottom.h.


Constructor & Destructor Documentation

StripClusterSelectorTopBottom::StripClusterSelectorTopBottom ( const edm::ParameterSet cfg) [inline, explicit]

Definition at line 34 of file StripClusterSelectorTopBottom.h.

                                                                      :
    label_( cfg.getParameter<edm::InputTag>( "label" ) ),
    y_( cfg.getParameter<double>( "y" ) ) { produces<edmNew::DetSetVector<SiStripCluster> >(); }

Member Function Documentation

void StripClusterSelectorTopBottom::produce ( edm::Event event,
const edm::EventSetup setup 
) [virtual]

Implements edm::EDProducer.

Definition at line 4 of file StripClusterSelectorTopBottom.cc.

References end, relativeConstraints::geom, edm::EventSetup::get(), TrackerGeometry::idToDet(), collect_tpl::input, label_, StripTopology::localPosition(), convertSQLitetoXML_cfg::output, PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), y_, and PV3DBase< T, PVType, FrameType >::z().

                                                                                        {

  edm::Handle< edmNew::DetSetVector<SiStripCluster> > input;
  event.getByLabel(label_, input);

  edm::ESHandle<TrackerGeometry> geom;
  setup.get<TrackerDigiGeometryRecord>().get( geom );
  const TrackerGeometry& theTracker( *geom );
  
  std::auto_ptr<edmNew::DetSetVector<SiStripCluster> > output( new edmNew::DetSetVector<SiStripCluster>() );

  for (edmNew::DetSetVector<SiStripCluster>::const_iterator clustSet = input->begin(); clustSet!=input->end(); ++clustSet) {
    edmNew::DetSet<SiStripCluster>::const_iterator clustIt = clustSet->begin();
    edmNew::DetSet<SiStripCluster>::const_iterator end     = clustSet->end();
    
    DetId detIdObject( clustSet->detId() );
    edmNew::DetSetVector<SiStripCluster>::FastFiller spc(*output, detIdObject.rawId());
    const StripGeomDetUnit* theGeomDet = dynamic_cast<const StripGeomDetUnit*> (theTracker.idToDet(detIdObject) );
    const StripTopology * topol = dynamic_cast<const StripTopology*>(&(theGeomDet->specificTopology()));
    
    for(; clustIt!=end;++clustIt) {
      LocalPoint lpclust = topol->localPosition(clustIt->barycenter());
      GlobalPoint GPclust = theGeomDet->surface().toGlobal(Local3DPoint(lpclust.x(),lpclust.y(),lpclust.z()));
      double clustY = GPclust.y();
      if ((clustY * y_) > 0) {
        spc.push_back(*clustIt);
      }
    }
  }
  event.put( output );  
}

Member Data Documentation

Definition at line 41 of file StripClusterSelectorTopBottom.h.

Referenced by produce().

Definition at line 42 of file StripClusterSelectorTopBottom.h.

Referenced by produce().