CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
TopBottomClusterInfoProducer Class Reference
Inheritance diagram for TopBottomClusterInfoProducer:
edm::global::EDProducer<> edm::global::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

void produce (edm::StreamID, edm::Event &iEvent, const edm::EventSetup &iSetup) const override
 
 TopBottomClusterInfoProducer (const edm::ParameterSet &iConfig)
 
 ~TopBottomClusterInfoProducer () override
 
- Public Member Functions inherited from edm::global::EDProducer<>
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
EDProduceroperator= (const EDProducer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
bool wantsStreamLuminosityBlocks () const final
 
bool wantsStreamRuns () const final
 
- Public Member Functions inherited from edm::global::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducerBase () 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
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (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::array< std::vector< ModuleDescription const * > *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, 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
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Attributes

edm::EDGetTokenT< edmNew::DetSetVector< SiPixelCluster > > pixelClustersNew_
 
edm::EDGetTokenT< edmNew::DetSetVector< SiPixelCluster > > pixelClustersOld_
 
edm::EDGetTokenT< edmNew::DetSetVector< SiStripCluster > > stripClustersNew_
 
edm::EDGetTokenT< edmNew::DetSetVector< SiStripCluster > > stripClustersOld_
 

Additional Inherited Members

- Public Types inherited from edm::global::EDProducerBase
typedef EDProducerBase 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::global::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- 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 = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
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<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag) noexcept
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
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 32 of file TopBottomClusterInfoProducer.cc.

Constructor & Destructor Documentation

◆ TopBottomClusterInfoProducer()

TopBottomClusterInfoProducer::TopBottomClusterInfoProducer ( const edm::ParameterSet iConfig)

Definition at line 49 of file TopBottomClusterInfoProducer.cc.

49  {
51  consumes<edmNew::DetSetVector<SiPixelCluster> >(iConfig.getParameter<edm::InputTag>("stripClustersOld"));
53  consumes<edmNew::DetSetVector<SiStripCluster> >(iConfig.getParameter<edm::InputTag>("pixelClustersOld"));
55  consumes<edmNew::DetSetVector<SiPixelCluster> >(iConfig.getParameter<edm::InputTag>("stripClustersNew"));
57  consumes<edmNew::DetSetVector<SiStripCluster> >(iConfig.getParameter<edm::InputTag>("pixelClustersNew"));
58  produces<ClusterRemovalInfo>();
59 }

References edm::ParameterSet::getParameter().

◆ ~TopBottomClusterInfoProducer()

TopBottomClusterInfoProducer::~TopBottomClusterInfoProducer ( )
override

Definition at line 61 of file TopBottomClusterInfoProducer.cc.

61 {}

Member Function Documentation

◆ produce()

void TopBottomClusterInfoProducer::produce ( edm::StreamID  ,
edm::Event iEvent,
const edm::EventSetup iSetup 
) const
overridevirtual

Implements edm::global::EDProducerBase.

Definition at line 63 of file TopBottomClusterInfoProducer.cc.

63  {
68 
73 
74  auto cri = std::make_unique<ClusterRemovalInfo>(pixelClustersOld, stripClustersOld);
75  ClusterRemovalInfo::Indices& pixelInd = cri->pixelIndices();
76  ClusterRemovalInfo::Indices& stripInd = cri->stripIndices();
77  stripInd.reserve(stripClustersNew->size());
78  pixelInd.reserve(pixelClustersNew->size());
79 
80  //const SiStripCluster * firstOffsetStripNew = & stripClustersNew->data().front();
82  itdetNew != stripClustersNew->end();
83  ++itdetNew) {
84  edmNew::DetSet<SiStripCluster> oldDSstripNew = *itdetNew;
85  if (oldDSstripNew.empty())
86  continue; // skip empty detsets
87  for (edmNew::DetSet<SiStripCluster>::const_iterator clNew = oldDSstripNew.begin(); clNew != oldDSstripNew.end();
88  ++clNew) {
89  uint16_t firstStripNew = clNew->firstStrip();
90  uint32_t idStripNew = itdetNew->id();
91  //uint32_t keyNew = ((&*clNew) - firstOffsetStripNew);
92  //cout << "new strip index=" << keyNew << endl;
93  uint32_t keyOld = 99999;
94 
95  const SiStripCluster* firstOffsetStripOld = &stripClustersOld->data().front();
97  if (itdetOld != stripClustersOld->end()) {
98  edmNew::DetSet<SiStripCluster> oldDSstripOld = *itdetOld;
99  if (oldDSstripOld.empty())
100  continue; // skip empty detsets
101  for (edmNew::DetSet<SiStripCluster>::const_iterator clOld = oldDSstripOld.begin(); clOld != oldDSstripOld.end();
102  ++clOld) {
103  uint16_t firstStripOld = clOld->firstStrip();
104  uint32_t idStripOld = itdetOld->id();
105  if (idStripNew == idStripOld && firstStripNew == firstStripOld) {
106  keyOld = ((&*clOld) - firstOffsetStripOld);
107  //cout << "old strip index=" << keyOld << endl;
108  break;
109  }
110  }
111  }
112  //assert(keyOld!=99999);
113  //cout << "push back strip index=" << keyOld << endl;
114  stripInd.push_back(keyOld);
115  }
116  }
117 
118  //const SiPixelCluster * firstOffsetPixelNew = & pixelClustersNew->data().front();
120  itdetNew != pixelClustersNew->end();
121  ++itdetNew) {
122  edmNew::DetSet<SiPixelCluster> oldDSpixelNew = *itdetNew;
123  if (oldDSpixelNew.empty())
124  continue; // skip empty detsets
125  for (edmNew::DetSet<SiPixelCluster>::const_iterator clNew = oldDSpixelNew.begin(); clNew != oldDSpixelNew.end();
126  ++clNew) {
127  int minPixelRowNew = clNew->minPixelRow();
128  //uint32_t keyNew = ((&*clNew) - firstOffsetPixelNew);
129  //cout << "new pixel index=" << keyNew << endl;
130  uint32_t keyOld = 99999;
131 
132  const SiPixelCluster* firstOffsetPixelOld = &pixelClustersOld->data().front();
134  if (itdetOld != pixelClustersOld->end()) {
135  edmNew::DetSet<SiPixelCluster> oldDSpixelOld = *itdetOld;
136  if (oldDSpixelOld.empty())
137  continue; // skip empty detsets
138  for (edmNew::DetSet<SiPixelCluster>::const_iterator clOld = oldDSpixelOld.begin(); clOld != oldDSpixelOld.end();
139  ++clOld) {
140  int minPixelRowOld = clOld->minPixelRow();
141  if (minPixelRowNew == minPixelRowOld) {
142  keyOld = ((&*clOld) - firstOffsetPixelOld);
143  //cout << "old pixel index=" << keyOld << endl;
144  break;
145  }
146  }
147  }
148  assert(keyOld != 99999);
149  //cout << "push back pixel index=" << keyOld << endl;
150  pixelInd.push_back(keyOld);
151  }
152  }
153 
154  //cout << "pixelInd size" << pixelInd.size() << endl;
155  //cout << "stripInd size" << stripInd.size() << endl;
156 
157  cri->setNewPixelClusters(
159  cri->setNewStripClusters(
161 
162  iEvent.put(std::move(cri));
163 }

References cms::cuda::assert(), edmNew::DetSet< T >::begin(), edmNew::DetSet< T >::detId(), edmNew::DetSet< T >::empty(), edmNew::DetSet< T >::end(), edmNew::DetSet< T >::id(), edmNew::DetSetVector< T >::id(), iEvent, eostools::move(), TopBottomClusterInfoProducer_cfi::pixelClustersNew, TopBottomClusterInfoProducer_cfi::pixelClustersOld, TopBottomClusterInfoProducer_cfi::stripClustersNew, and TopBottomClusterInfoProducer_cfi::stripClustersOld.

Member Data Documentation

◆ pixelClustersNew_

edm::EDGetTokenT<edmNew::DetSetVector<SiPixelCluster> > TopBottomClusterInfoProducer::pixelClustersNew_
private

Definition at line 40 of file TopBottomClusterInfoProducer.cc.

◆ pixelClustersOld_

edm::EDGetTokenT<edmNew::DetSetVector<SiPixelCluster> > TopBottomClusterInfoProducer::pixelClustersOld_
private

Definition at line 39 of file TopBottomClusterInfoProducer.cc.

◆ stripClustersNew_

edm::EDGetTokenT<edmNew::DetSetVector<SiStripCluster> > TopBottomClusterInfoProducer::stripClustersNew_
private

Definition at line 42 of file TopBottomClusterInfoProducer.cc.

◆ stripClustersOld_

edm::EDGetTokenT<edmNew::DetSetVector<SiStripCluster> > TopBottomClusterInfoProducer::stripClustersOld_
private

Definition at line 41 of file TopBottomClusterInfoProducer.cc.

TopBottomClusterInfoProducer_cfi.pixelClustersOld
pixelClustersOld
Definition: TopBottomClusterInfoProducer_cfi.py:5
TopBottomClusterInfoProducer_cfi.pixelClustersNew
pixelClustersNew
Definition: TopBottomClusterInfoProducer_cfi.py:7
edmNew::DetSetVector::id
id_type id(size_t cell) const
Definition: DetSetVectorNew.h:579
reco::ClusterRemovalInfo::Indices
std::vector< uint32_t > Indices
Definition: ClusterRemovalInfo.h:22
edmNew::DetSetVector::const_iterator
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
Definition: DetSetVectorNew.h:197
TopBottomClusterInfoProducer::pixelClustersNew_
edm::EDGetTokenT< edmNew::DetSetVector< SiPixelCluster > > pixelClustersNew_
Definition: TopBottomClusterInfoProducer.cc:40
cms::cuda::assert
assert(be >=bs)
SiPixelCluster
Pixel cluster – collection of neighboring pixels above threshold.
Definition: SiPixelCluster.h:28
edm::Handle
Definition: AssociativeIterator.h:50
TopBottomClusterInfoProducer_cfi.stripClustersNew
stripClustersNew
Definition: TopBottomClusterInfoProducer_cfi.py:6
edmNew::DetSet::end
iterator end()
Definition: DetSetNew.h:56
TopBottomClusterInfoProducer::stripClustersNew_
edm::EDGetTokenT< edmNew::DetSetVector< SiStripCluster > > stripClustersNew_
Definition: TopBottomClusterInfoProducer.cc:42
edmNew::DetSet
Definition: DetSetNew.h:22
TopBottomClusterInfoProducer::stripClustersOld_
edm::EDGetTokenT< edmNew::DetSetVector< SiStripCluster > > stripClustersOld_
Definition: TopBottomClusterInfoProducer.cc:41
edmNew::DetSet::id
id_type id() const
Definition: DetSetNew.h:64
iEvent
int iEvent
Definition: GenABIO.cc:224
edmNew::DetSet::begin
iterator begin()
Definition: DetSetNew.h:54
edmNew::DetSetVector
Definition: DetSetNew.h:13
eostools.move
def move(src, dest)
Definition: eostools.py:511
edm::OrphanHandle
Definition: EDProductfwd.h:39
edmNew::DetSet::detId
id_type detId() const
Definition: DetSetNew.h:66
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
TopBottomClusterInfoProducer_cfi.stripClustersOld
stripClustersOld
Definition: TopBottomClusterInfoProducer_cfi.py:4
SiStripCluster
Definition: SiStripCluster.h:8
edmNew::DetSet::empty
bool empty() const
Definition: DetSetNew.h:70
edm::InputTag
Definition: InputTag.h:15
TopBottomClusterInfoProducer::pixelClustersOld_
edm::EDGetTokenT< edmNew::DetSetVector< SiPixelCluster > > pixelClustersOld_
Definition: TopBottomClusterInfoProducer.cc:39
edmNew::DetSet::const_iterator
const data_type * const_iterator
Definition: DetSetNew.h:31