CMS 3D CMS Logo

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::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 ShallowRechitClustersProducer (const edm::ParameterSet &)
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducer () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
std::vector< bool > const & recordProvenanceList () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
TypeLabelList const & typeLabelList () const
 used by the fwk to register the list of products of this module More...
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

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

Private Attributes

const edm::EDGetTokenT< edmNew::DetSetVector< SiStripCluster > > clusters_token_
 
std::string Prefix
 
std::vector< edm::EDGetTokenT< SiStripRecHit2DCollection > > rec_hits_tokens_
 
std::string Suffix
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex > >
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- Protected Member Functions inherited from edm::ProducerBase
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 declare what type of product will make and with which optional label More...
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<BranchType B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<Transition B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Detailed Description

Definition at line 11 of file ShallowRechitClustersProducer.h.

Constructor & Destructor Documentation

◆ ShallowRechitClustersProducer()

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

Definition at line 13 of file ShallowRechitClustersProducer.cc.

14  : Suffix(iConfig.getParameter<std::string>("Suffix")),
15  Prefix(iConfig.getParameter<std::string>("Prefix")),
17  std::vector<edm::InputTag> rec_hits_tags = iConfig.getParameter<std::vector<edm::InputTag>>("InputTags");
18  for (auto itag : rec_hits_tags) {
19  rec_hits_tokens_.push_back(consumes<SiStripRecHit2DCollection>(itag));
20  }
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 }

References edm::ParameterSet::getParameter(), Prefix, rec_hits_tokens_, and Suffix.

Member Function Documentation

◆ produce()

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

Implements edm::EDProducer.

Definition at line 33 of file ShallowRechitClustersProducer.cc.

33  {
35 
36  int size = clustermap.size();
37  auto strip = std::make_unique<std::vector<float>>(size, -10000);
38  auto merr = std::make_unique<std::vector<float>>(size, -10000);
39  auto localx = std::make_unique<std::vector<float>>(size, -10000);
40  auto localy = std::make_unique<std::vector<float>>(size, -10000);
41  auto localxerr = std::make_unique<std::vector<float>>(size, -1);
42  auto localyerr = std::make_unique<std::vector<float>>(size, -1);
43  auto globalx = std::make_unique<std::vector<float>>(size, -10000);
44  auto globaly = std::make_unique<std::vector<float>>(size, -10000);
45  auto globalz = std::make_unique<std::vector<float>>(size, -10000);
46 
47  edm::ESHandle<TrackerGeometry> theTrackerGeometry;
48  iSetup.get<TrackerDigiGeometryRecord>().get(theTrackerGeometry);
49 
50  for (auto recHit_token : rec_hits_tokens_) {
52  iEvent.getByToken(recHit_token, recHits);
53  for (auto const& ds : *recHits) {
54  for (auto const& hit : ds) {
55  shallow::CLUSTERMAP::iterator cluster =
56  clustermap.find(std::make_pair(hit.geographicalId().rawId(), hit.cluster()->firstStrip()));
57  if (cluster != clustermap.end()) {
58  const StripGeomDetUnit* theStripDet =
59  dynamic_cast<const StripGeomDetUnit*>(theTrackerGeometry->idToDet(hit.geographicalId()));
60  unsigned int i = cluster->second;
61  strip->at(i) = theStripDet->specificTopology().strip(hit.localPosition());
62  merr->at(i) = sqrt(
63  theStripDet->specificTopology().measurementError(hit.localPosition(), hit.localPositionError()).uu());
64  localx->at(i) = hit.localPosition().x();
65  localy->at(i) = hit.localPosition().y();
66  localxerr->at(i) = sqrt(hit.localPositionError().xx());
67  localyerr->at(i) = sqrt(hit.localPositionError().yy());
68  globalx->at(i) = theStripDet->toGlobal(hit.localPosition()).x();
69  globaly->at(i) = theStripDet->toGlobal(hit.localPosition()).y();
70  globalz->at(i) = theStripDet->toGlobal(hit.localPosition()).z();
71  } else {
72  throw cms::Exception("cluster not found");
73  }
74  }
75  }
76  }
77 
78  iEvent.put(std::move(strip), Prefix + "strip" + Suffix);
79  iEvent.put(std::move(merr), Prefix + "merr" + Suffix);
80  iEvent.put(std::move(localx), Prefix + "localx" + Suffix);
81  iEvent.put(std::move(localy), Prefix + "localy" + Suffix);
82  iEvent.put(std::move(localxerr), Prefix + "localxerr" + Suffix);
83  iEvent.put(std::move(localyerr), Prefix + "localyerr" + Suffix);
84  iEvent.put(std::move(globalx), Prefix + "globalx" + Suffix);
85  iEvent.put(std::move(globaly), Prefix + "globaly" + Suffix);
86  iEvent.put(std::move(globalz), Prefix + "globalz" + Suffix);
87 }

References clusters_token_, Exception, edm::EventSetup::get(), get, mps_fire::i, iEvent, shallow::make_cluster_map(), Topology::measurementError(), eostools::move(), Prefix, rec_hits_tokens_, FastTrackerRecHitMaskProducer_cfi::recHits, findQualityFiles::size, StripGeomDetUnit::specificTopology(), mathSSE::sqrt(), digitizers_cfi::strip, StripTopology::strip(), Suffix, GeomDet::toGlobal(), x, hit::x, y, hit::y, and z.

Member Data Documentation

◆ clusters_token_

const edm::EDGetTokenT<edmNew::DetSetVector<SiStripCluster> > ShallowRechitClustersProducer::clusters_token_
private

Definition at line 18 of file ShallowRechitClustersProducer.h.

Referenced by produce().

◆ Prefix

std::string ShallowRechitClustersProducer::Prefix
private

Definition at line 17 of file ShallowRechitClustersProducer.h.

Referenced by produce(), and ShallowRechitClustersProducer().

◆ rec_hits_tokens_

std::vector<edm::EDGetTokenT<SiStripRecHit2DCollection> > ShallowRechitClustersProducer::rec_hits_tokens_
private

Definition at line 19 of file ShallowRechitClustersProducer.h.

Referenced by produce(), and ShallowRechitClustersProducer().

◆ Suffix

std::string ShallowRechitClustersProducer::Suffix
private

Definition at line 16 of file ShallowRechitClustersProducer.h.

Referenced by produce(), and ShallowRechitClustersProducer().

DDAxes::y
mps_fire.i
i
Definition: mps_fire.py:355
hit::y
double y
Definition: SiStripHitEffFromCalibTree.cc:90
digitizers_cfi.strip
strip
Definition: digitizers_cfi.py:19
DDAxes::x
edm::Handle
Definition: AssociativeIterator.h:50
hit::x
double x
Definition: SiStripHitEffFromCalibTree.cc:89
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
TrackerDigiGeometryRecord
Definition: TrackerDigiGeometryRecord.h:15
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
DDAxes::z
edm::ESHandle< TrackerGeometry >
Topology::measurementError
virtual MeasurementError measurementError(const LocalPoint &, const LocalError &) const =0
StripTopology::strip
virtual float strip(const LocalPoint &) const =0
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
FastTrackerRecHitMaskProducer_cfi.recHits
recHits
Definition: FastTrackerRecHitMaskProducer_cfi.py:8
ShallowRechitClustersProducer::rec_hits_tokens_
std::vector< edm::EDGetTokenT< SiStripRecHit2DCollection > > rec_hits_tokens_
Definition: ShallowRechitClustersProducer.h:19
GeomDet::toGlobal
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
Definition: GeomDet.h:49
iEvent
int iEvent
Definition: GenABIO.cc:224
ShallowRechitClustersProducer::Prefix
std::string Prefix
Definition: ShallowRechitClustersProducer.h:17
ShallowRechitClustersProducer::Suffix
std::string Suffix
Definition: ShallowRechitClustersProducer.h:16
get
#define get
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
edmNew::DetSetVector
Definition: DetSetNew.h:13
shallow::make_cluster_map
CLUSTERMAP make_cluster_map(const edm::Event &, const edm::EDGetTokenT< edmNew::DetSetVector< SiStripCluster > > &)
Definition: ShallowTools.cc:12
eostools.move
def move(src, dest)
Definition: eostools.py:511
Exception
Definition: hltDiff.cc:246
StripGeomDetUnit::specificTopology
virtual const StripTopology & specificTopology() const
Returns a reference to the strip proxy topology.
Definition: StripGeomDetUnit.cc:17
edm::EDConsumerBase::consumes
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Definition: EDConsumerBase.h:126
edm::InputTag
Definition: InputTag.h:15
shallow::CLUSTERMAP
std::map< std::pair< uint32_t, uint16_t >, unsigned int > CLUSTERMAP
Definition: ShallowTools.h:21
hit
Definition: SiStripHitEffFromCalibTree.cc:88
ShallowRechitClustersProducer::clusters_token_
const edm::EDGetTokenT< edmNew::DetSetVector< SiStripCluster > > clusters_token_
Definition: ShallowRechitClustersProducer.h:18
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443
StripGeomDetUnit
Definition: StripGeomDetUnit.h:15