CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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
 
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)
 
 ~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 const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
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
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
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
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
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...
 
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)
 
void resetItemsToGetFrom (BranchType iType)
 

Detailed Description

Definition at line 32 of file TopBottomClusterInfoProducer.cc.

Constructor & Destructor Documentation

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

Definition at line 49 of file TopBottomClusterInfoProducer.cc.

References edm::ParameterSet::getParameter().

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 }
edm::EDGetTokenT< edmNew::DetSetVector< SiPixelCluster > > pixelClustersNew_
edm::EDGetTokenT< edmNew::DetSetVector< SiStripCluster > > stripClustersOld_
edm::EDGetTokenT< edmNew::DetSetVector< SiStripCluster > > stripClustersNew_
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::EDGetTokenT< edmNew::DetSetVector< SiPixelCluster > > pixelClustersOld_
TopBottomClusterInfoProducer::~TopBottomClusterInfoProducer ( )
override

Definition at line 61 of file TopBottomClusterInfoProducer.cc.

61 {}

Member Function Documentation

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.

References cms::cuda::assert(), edmNew::DetSet< T >::begin(), edmNew::DetSet< T >::detId(), edmNew::DetSet< T >::empty(), edmNew::DetSet< T >::end(), edmNew::DetSetVector< T >::end(), edm::Event::getByToken(), edmNew::DetSet< T >::id(), edm::HandleBase::id(), edmNew::DetSetVector< T >::id(), eostools::move(), edm::Handle< T >::product(), and edm::Event::put().

63  {
65  iEvent.getByToken(pixelClustersOld_, pixelClustersOld);
67  iEvent.getByToken(stripClustersOld_, stripClustersOld);
68 
70  iEvent.getByToken(pixelClustersNew_, pixelClustersNew);
72  iEvent.getByToken(stripClustersNew_, stripClustersNew);
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();
81  for (edmNew::DetSetVector<SiStripCluster>::const_iterator itdetNew = stripClustersNew->begin();
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();
96  edmNew::DetSetVector<SiStripCluster>::const_iterator itdetOld = stripClustersOld->find(itdetNew->id());
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();
119  for (edmNew::DetSetVector<SiPixelCluster>::const_iterator itdetNew = pixelClustersNew->begin();
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();
133  edmNew::DetSetVector<SiPixelCluster>::const_iterator itdetOld = pixelClustersOld->find(oldDSpixelNew.detId());
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(
158  edm::OrphanHandle<SiPixelClusterCollectionNew>(pixelClustersNew.product(), pixelClustersNew.id()));
159  cri->setNewStripClusters(
160  edm::OrphanHandle<edmNew::DetSetVector<SiStripCluster> >(stripClustersNew.product(), stripClustersNew.id()));
161 
162  iEvent.put(std::move(cri));
163 }
edm::EDGetTokenT< edmNew::DetSetVector< SiPixelCluster > > pixelClustersNew_
const_iterator end(bool update=false) const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:133
ProductID id() const
Definition: HandleBase.cc:29
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
data_type const * const_iterator
Definition: DetSetNew.h:31
assert(be >=bs)
edm::EDGetTokenT< edmNew::DetSetVector< SiStripCluster > > stripClustersOld_
id_type id(size_t cell) const
edm::EDGetTokenT< edmNew::DetSetVector< SiStripCluster > > stripClustersNew_
bool empty() const
Definition: DetSetNew.h:70
def move
Definition: eostools.py:511
std::vector< uint32_t > Indices
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
T const * product() const
Definition: Handle.h:70
id_type detId() const
Definition: DetSetNew.h:66
const_iterator find(id_type i, bool update=false) const
Pixel cluster – collection of neighboring pixels above threshold.
iterator end()
Definition: DetSetNew.h:56
id_type id() const
Definition: DetSetNew.h:64
edm::EDGetTokenT< edmNew::DetSetVector< SiPixelCluster > > pixelClustersOld_
iterator begin()
Definition: DetSetNew.h:54

Member Data Documentation

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

Definition at line 40 of file TopBottomClusterInfoProducer.cc.

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

Definition at line 39 of file TopBottomClusterInfoProducer.cc.

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

Definition at line 42 of file TopBottomClusterInfoProducer.cc.

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

Definition at line 41 of file TopBottomClusterInfoProducer.cc.