CMS 3D CMS Logo

Public Member Functions | Private Attributes

PixelClusterSelectorTopBottom Class Reference

#include <PixelClusterSelectorTopBottom.h>

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

List of all members.

Public Member Functions

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

Private Attributes

edm::InputTag label_
double y_

Detailed Description

Definition at line 30 of file PixelClusterSelectorTopBottom.h.


Constructor & Destructor Documentation

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

Definition at line 33 of file PixelClusterSelectorTopBottom.h.

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

Member Function Documentation

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

Implements edm::EDProducer.

Definition at line 4 of file PixelClusterSelectorTopBottom.cc.

References end, relativeConstraints::geom, edm::EventSetup::get(), TrackerGeometry::idToDet(), LaserDQM_cfg::input, label_, Topology::localPosition(), convertSQLitetoXML_cfg::output, PixelGeomDetUnit::specificTopology(), GeomDet::surface(), Surface::toGlobal(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), y_, and PV3DBase< T, PVType, FrameType >::z().

                                                                                        {

  edm::Handle< SiPixelClusterCollectionNew > input;
  event.getByLabel(label_, input);

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

  for (SiPixelClusterCollectionNew::const_iterator clustSet = input->begin(); clustSet!=input->end(); ++clustSet) {
    edmNew::DetSet<SiPixelCluster>::const_iterator clustIt = clustSet->begin();
    edmNew::DetSet<SiPixelCluster>::const_iterator end     = clustSet->end();
    
    DetId detIdObject( clustSet->detId() );
    edmNew::DetSetVector<SiPixelCluster>::FastFiller spc(*output, detIdObject);
    const PixelGeomDetUnit* theGeomDet = dynamic_cast<const PixelGeomDetUnit*> (theTracker.idToDet(detIdObject) );
    const PixelTopology * topol = (&(theGeomDet->specificTopology()));
    
    for(; clustIt!=end;++clustIt) {
      LocalPoint  lpclust = topol->localPosition(MeasurementPoint((*clustIt).x(),(*clustIt).y()));
      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 40 of file PixelClusterSelectorTopBottom.h.

Referenced by produce().

Definition at line 41 of file PixelClusterSelectorTopBottom.h.

Referenced by produce().