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 Attributes
PixelClusterSelectorTopBottom Class Reference

#include <PixelClusterSelectorTopBottom.h>

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

Public Member Functions

 PixelClusterSelectorTopBottom (const edm::ParameterSet &cfg)
 
void produce (edm::Event &event, const edm::EventSetup &setup)
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Attributes

edm::InputTag label_
 
double y_
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- 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 28 of file PixelClusterSelectorTopBottom.h.

Constructor & Destructor Documentation

PixelClusterSelectorTopBottom::PixelClusterSelectorTopBottom ( const edm::ParameterSet cfg)
inlineexplicit

Definition at line 31 of file PixelClusterSelectorTopBottom.h.

31  :
32  label_( cfg.getParameter<edm::InputTag>( "label" ) ),
33  y_( cfg.getParameter<double>( "y" ) ) { produces<SiPixelClusterCollectionNew>(); }
T getParameter(std::string const &) const

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(), 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().

4  {
5 
7  event.getByLabel(label_, input);
8 
10  setup.get<TrackerDigiGeometryRecord>().get( geom );
11  const TrackerGeometry& theTracker( *geom );
12 
13  std::auto_ptr<SiPixelClusterCollectionNew> output( new SiPixelClusterCollectionNew() );
14 
15  for (SiPixelClusterCollectionNew::const_iterator clustSet = input->begin(); clustSet!=input->end(); ++clustSet) {
16  edmNew::DetSet<SiPixelCluster>::const_iterator clustIt = clustSet->begin();
18 
19  DetId detIdObject( clustSet->detId() );
21  const PixelGeomDetUnit* theGeomDet = dynamic_cast<const PixelGeomDetUnit*> (theTracker.idToDet(detIdObject) );
22  const PixelTopology * topol = (&(theGeomDet->specificTopology()));
23 
24  for(; clustIt!=end;++clustIt) {
25  LocalPoint lpclust = topol->localPosition(MeasurementPoint((*clustIt).x(),(*clustIt).y()));
26  GlobalPoint GPclust = theGeomDet->surface().toGlobal(Local3DPoint(lpclust.x(),lpclust.y(),lpclust.z()));
27  double clustY = GPclust.y();
28  if ((clustY * y_) > 0) {
29  spc.push_back(*clustIt);
30  }
31  }
32  }
33  event.put( output );
34 }
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:114
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
virtual LocalPoint localPosition(const MeasurementPoint &) const =0
T y() const
Definition: PV3DBase.h:63
data_type const * const_iterator
Definition: DetSetNew.h:30
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:35
static std::string const input
Definition: EdmProvDump.cc:44
Measurement2DPoint MeasurementPoint
Measurement points are two-dimensional by default.
T z() const
Definition: PV3DBase.h:64
#define end
Definition: vmac.h:37
Point3DBase< float, LocalTag > Local3DPoint
Definition: LocalPoint.h:9
Definition: DetId.h:18
const T & get() const
Definition: EventSetup.h:55
virtual const PixelTopology & specificTopology() const
Returns a reference to the pixel proxy topology.
edmNew::DetSetVector< SiPixelCluster > SiPixelClusterCollectionNew
T x() const
Definition: PV3DBase.h:62

Member Data Documentation

edm::InputTag PixelClusterSelectorTopBottom::label_
private
double PixelClusterSelectorTopBottom::y_
private

Definition at line 39 of file PixelClusterSelectorTopBottom.h.

Referenced by produce().