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 | Private Attributes
ShallowRechitClustersProducer Class Reference

#include <ShallowRechitClustersProducer.h>

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

Public Member Functions

 ShallowRechitClustersProducer (const edm::ParameterSet &)
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
boost::function< void(const
BranchDescription &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 

Private Member Functions

void produce (edm::Event &, const edm::EventSetup &)
 

Private Attributes

std::vector< edm::InputTaginputTags
 
std::string Prefix
 
std::string Suffix
 
edm::InputTag theClustersLabel
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
typedef WorkerT< EDProducerWorkerType
 
- 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::EDProducer
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::ProducerBase
template<class TProducer , class TMethod >
void callWhenNewProductsRegistered (TProducer *iProd, TMethod iMethod)
 

Detailed Description

Definition at line 8 of file ShallowRechitClustersProducer.h.

Constructor & Destructor Documentation

ShallowRechitClustersProducer::ShallowRechitClustersProducer ( const edm::ParameterSet iConfig)
explicit

Definition at line 16 of file ShallowRechitClustersProducer.cc.

References Prefix, and Suffix.

17  : Suffix ( iConfig.getParameter<std::string>("Suffix") ),
18  Prefix ( iConfig.getParameter<std::string>("Prefix") ),
19  theClustersLabel( iConfig.getParameter<edm::InputTag>("Clusters")),
20  inputTags ( iConfig.getParameter<std::vector<edm::InputTag> >("InputTags"))
21 {
22  produces <std::vector<float> > ( Prefix + "strip" + Suffix );
23  produces <std::vector<float> > ( Prefix + "merr" + Suffix );
24  produces <std::vector<float> > ( Prefix + "localx" + Suffix );
25  produces <std::vector<float> > ( Prefix + "localy" + Suffix );
26  produces <std::vector<float> > ( Prefix + "localxerr" + Suffix );
27  produces <std::vector<float> > ( Prefix + "localyerr" + Suffix );
28  produces <std::vector<float> > ( Prefix + "globalx" + Suffix );
29  produces <std::vector<float> > ( Prefix + "globaly" + Suffix );
30  produces <std::vector<float> > ( Prefix + "globalz" + Suffix );
31 }
T getParameter(std::string const &) const
std::vector< edm::InputTag > inputTags

Member Function Documentation

void ShallowRechitClustersProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
privatevirtual

Implements edm::EDProducer.

Definition at line 34 of file ShallowRechitClustersProducer.cc.

References SiStripRecHit2D::cluster(), edm::hlt::Exception, TrackingRecHit::geographicalId(), edm::EventSetup::get(), edm::Event::getByLabel(), i, LaserDQM_cfg::input, inputTags, BaseTrackerRecHit::localPosition(), BaseTrackerRecHit::localPositionError(), shallow::make_cluster_map(), Topology::measurementError(), Prefix, edm::Event::put(), DetId::rawId(), findQualityFiles::size, StripGeomDetUnit::specificTopology(), mathSSE::sqrt(), strip(), StripTopology::strip(), Suffix, theClustersLabel, GeomDet::toGlobal(), PV3DBase< T, PVType, FrameType >::x(), vdt::x, LocalError::xx(), detailsBasic3DVector::y, PV3DBase< T, PVType, FrameType >::y(), LocalError::yy(), and detailsBasic3DVector::z.

Referenced by JSONExport.JsonExport::export(), HTMLExport.HTMLExport::export(), and HTMLExport.HTMLExportStatic::export().

34  {
36 
37  int size = clustermap.size();
38  std::auto_ptr<std::vector<float> > strip ( new std::vector<float>(size, -10000 ));
39  std::auto_ptr<std::vector<float> > merr ( new std::vector<float>(size, -10000 ));
40  std::auto_ptr<std::vector<float> > localx ( new std::vector<float>(size, -10000 ));
41  std::auto_ptr<std::vector<float> > localy ( new std::vector<float>(size, -10000 ));
42  std::auto_ptr<std::vector<float> > localxerr ( new std::vector<float>(size, -1 ));
43  std::auto_ptr<std::vector<float> > localyerr ( new std::vector<float>(size, -1 ));
44  std::auto_ptr<std::vector<float> > globalx ( new std::vector<float>(size, -10000 ));
45  std::auto_ptr<std::vector<float> > globaly ( new std::vector<float>(size, -10000 ));
46  std::auto_ptr<std::vector<float> > globalz ( new std::vector<float>(size, -10000 ));
47 
48  edm::ESHandle<TrackerGeometry> theTrackerGeometry; iSetup.get<TrackerDigiGeometryRecord>().get( theTrackerGeometry );
49 
50  BOOST_FOREACH(const edm::InputTag& input, inputTags ) { edm::Handle<SiStripRecHit2DCollection> recHits; iEvent.getByLabel(input, recHits);
51  BOOST_FOREACH( const SiStripRecHit2DCollection::value_type& ds, *recHits) {
52  BOOST_FOREACH( const SiStripRecHit2D& hit, ds) {
53 
54  shallow::CLUSTERMAP::iterator cluster = clustermap.find( std::make_pair(hit.geographicalId().rawId(), hit.cluster()->firstStrip() ) );
55  if(cluster != clustermap.end() ) {
56  const StripGeomDetUnit* theStripDet = dynamic_cast<const StripGeomDetUnit*>( theTrackerGeometry->idToDet( hit.geographicalId() ) );
57  unsigned int i = cluster->second;
58  strip->at(i) = theStripDet->specificTopology().strip(hit.localPosition());
59  merr->at(i) = sqrt(theStripDet->specificTopology().measurementError(hit.localPosition(), hit.localPositionError()).uu());
60  localx->at(i) = hit.localPosition().x();
61  localy->at(i) = hit.localPosition().y();
62  localxerr->at(i) = sqrt(hit.localPositionError().xx());
63  localyerr->at(i) = sqrt(hit.localPositionError().yy());
64  globalx->at(i) = theStripDet->toGlobal(hit.localPosition()).x();
65  globaly->at(i) = theStripDet->toGlobal(hit.localPosition()).y();
66  globalz->at(i) = theStripDet->toGlobal(hit.localPosition()).z();
67  }
68  else {throw cms::Exception("cluster not found");}
69  }
70  }
71  }
72 
73  iEvent.put( strip, Prefix + "strip" + Suffix );
74  iEvent.put( merr, Prefix + "merr" + Suffix );
75  iEvent.put( localx , Prefix + "localx" + Suffix );
76  iEvent.put( localy , Prefix + "localy" + Suffix );
77  iEvent.put( localxerr , Prefix + "localxerr" + Suffix );
78  iEvent.put( localyerr , Prefix + "localyerr" + Suffix );
79  iEvent.put( globalx , Prefix + "globalx" + Suffix );
80  iEvent.put( globaly , Prefix + "globaly" + Suffix );
81  iEvent.put( globalz , Prefix + "globalz" + Suffix );
82 }
int i
Definition: DBlmapReader.cc:9
float xx() const
Definition: LocalError.h:24
void strip(std::string &input, const std::string &blanks=" \n\t")
Definition: stringTools.cc:16
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
Definition: GeomDet.h:47
T y() const
Definition: PV3DBase.h:62
virtual const StripTopology & specificTopology() const
Returns a reference to the strip proxy topology.
double double double z
virtual float strip(const LocalPoint &) const =0
uint32_t rawId() const
get the raw id
Definition: DetId.h:45
virtual LocalError localPositionError() const
virtual MeasurementError measurementError(const LocalPoint &, const LocalError &) const =0
float yy() const
Definition: LocalError.h:26
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:85
T sqrt(T t)
Definition: SSEVec.h:46
std::vector< edm::InputTag > inputTags
ClusterRef cluster() const
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
CLUSTERMAP make_cluster_map(const edm::Event &, edm::InputTag &)
Definition: ShallowTools.cc:15
virtual LocalPoint localPosition() const
const T & get() const
Definition: EventSetup.h:55
std::map< std::pair< uint32_t, uint16_t >, unsigned int > CLUSTERMAP
Definition: ShallowTools.h:16
DetId geographicalId() const
x
Definition: VDTMath.h:216
T x() const
Definition: PV3DBase.h:61
tuple size
Write out results.

Member Data Documentation

std::vector<edm::InputTag> ShallowRechitClustersProducer::inputTags
private
std::string ShallowRechitClustersProducer::Prefix
private

Definition at line 13 of file ShallowRechitClustersProducer.h.

Referenced by produce(), and ShallowRechitClustersProducer().

std::string ShallowRechitClustersProducer::Suffix
private

Definition at line 12 of file ShallowRechitClustersProducer.h.

Referenced by produce(), and ShallowRechitClustersProducer().

edm::InputTag ShallowRechitClustersProducer::theClustersLabel
private

Definition at line 14 of file ShallowRechitClustersProducer.h.

Referenced by produce().