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 ()
 
- Public Member Functions inherited from edm::global::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::global::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducerBase ()
 
- 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 ()
 
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, std::unordered_multimap< std::string, edm::ProductResolverIndex > const &iIndicies, std::string const &moduleLabel)
 
virtual ~ProducerBase () noexcept(false)
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
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 & itemsToGetFromEvent () 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
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
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
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::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 32 of file TopBottomClusterInfoProducer.cc.

Constructor & Destructor Documentation

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

Definition at line 50 of file TopBottomClusterInfoProducer.cc.

References edm::ParameterSet::getParameter(), pixelClustersNew_, pixelClustersOld_, stripClustersNew_, and stripClustersOld_.

51 {
52  pixelClustersOld_ = consumes<edmNew::DetSetVector<SiPixelCluster> >(iConfig.getParameter<edm::InputTag>("stripClustersOld"));
53  stripClustersOld_ = consumes<edmNew::DetSetVector<SiStripCluster> >(iConfig.getParameter<edm::InputTag>("pixelClustersOld"));
54  pixelClustersNew_ = consumes<edmNew::DetSetVector<SiPixelCluster> >(iConfig.getParameter<edm::InputTag>("stripClustersNew"));
55  stripClustersNew_ = consumes<edmNew::DetSetVector<SiStripCluster> >(iConfig.getParameter<edm::InputTag>("pixelClustersNew"));
56  produces< ClusterRemovalInfo >();
57 }
T getParameter(std::string const &) const
edm::EDGetTokenT< edmNew::DetSetVector< SiPixelCluster > > pixelClustersNew_
edm::EDGetTokenT< edmNew::DetSetVector< SiStripCluster > > stripClustersOld_
edm::EDGetTokenT< edmNew::DetSetVector< SiStripCluster > > stripClustersNew_
edm::EDGetTokenT< edmNew::DetSetVector< SiPixelCluster > > pixelClustersOld_
TopBottomClusterInfoProducer::~TopBottomClusterInfoProducer ( )

Definition at line 60 of file TopBottomClusterInfoProducer.cc.

61 {
62 }

Member Function Documentation

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

Definition at line 65 of file TopBottomClusterInfoProducer.cc.

References edmNew::DetSet< T >::begin(), DEFINE_FWK_MODULE, 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(), TopBottomClusterInfoProducer_cfi::pixelClustersNew, pixelClustersNew_, TopBottomClusterInfoProducer_cfi::pixelClustersOld, pixelClustersOld_, edm::Handle< T >::product(), edm::Event::put(), TopBottomClusterInfoProducer_cfi::stripClustersNew, stripClustersNew_, TopBottomClusterInfoProducer_cfi::stripClustersOld, and stripClustersOld_.

66 {
67 
69  iEvent.getByToken(pixelClustersOld_, pixelClustersOld);
71  iEvent.getByToken(stripClustersOld_, stripClustersOld);
72 
74  iEvent.getByToken(pixelClustersNew_, pixelClustersNew);
76  iEvent.getByToken(stripClustersNew_, stripClustersNew);
77 
78  auto cri = std::make_unique<ClusterRemovalInfo>(pixelClustersOld, stripClustersOld);
79  ClusterRemovalInfo::Indices& pixelInd = cri->pixelIndices();
80  ClusterRemovalInfo::Indices& stripInd = cri->stripIndices();
81  stripInd.reserve(stripClustersNew->size());
82  pixelInd.reserve(pixelClustersNew->size());
83 
84  //const SiStripCluster * firstOffsetStripNew = & stripClustersNew->data().front();
85  for (edmNew::DetSetVector<SiStripCluster>::const_iterator itdetNew = stripClustersNew->begin(); itdetNew != stripClustersNew->end(); ++itdetNew) {
86  edmNew::DetSet<SiStripCluster> oldDSstripNew = *itdetNew;
87  if (oldDSstripNew.empty()) continue; // skip empty detsets
88  for (edmNew::DetSet<SiStripCluster>::const_iterator clNew = oldDSstripNew.begin(); clNew != oldDSstripNew.end(); ++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()) continue; // skip empty detsets
100  for (edmNew::DetSet<SiStripCluster>::const_iterator clOld = oldDSstripOld.begin(); clOld != oldDSstripOld.end(); ++clOld) {
101  uint16_t firstStripOld = clOld->firstStrip();
102  uint32_t idStripOld = itdetOld->id();
103  if (idStripNew==idStripOld && firstStripNew==firstStripOld) {
104  keyOld = ((&*clOld) - firstOffsetStripOld);
105  //cout << "old strip index=" << keyOld << endl;
106  break;
107  }
108  }
109  }
110  //assert(keyOld!=99999);
111  //cout << "push back strip index=" << keyOld << endl;
112  stripInd.push_back(keyOld);
113  }
114  }
115 
116 
117  //const SiPixelCluster * firstOffsetPixelNew = & pixelClustersNew->data().front();
118  for (edmNew::DetSetVector<SiPixelCluster>::const_iterator itdetNew = pixelClustersNew->begin(); itdetNew != pixelClustersNew->end(); ++itdetNew) {
119  edmNew::DetSet<SiPixelCluster> oldDSpixelNew = *itdetNew;
120  if (oldDSpixelNew.empty()) continue; // skip empty detsets
121  for (edmNew::DetSet<SiPixelCluster>::const_iterator clNew = oldDSpixelNew.begin(); clNew != oldDSpixelNew.end(); ++clNew) {
122  int minPixelRowNew = clNew->minPixelRow();
123  //uint32_t keyNew = ((&*clNew) - firstOffsetPixelNew);
124  //cout << "new pixel index=" << keyNew << endl;
125  uint32_t keyOld=99999;
126 
127  const SiPixelCluster * firstOffsetPixelOld = & pixelClustersOld->data().front();
128  edmNew::DetSetVector<SiPixelCluster>::const_iterator itdetOld = pixelClustersOld->find(oldDSpixelNew.detId());
129  if (itdetOld != pixelClustersOld->end()) {
130  edmNew::DetSet<SiPixelCluster> oldDSpixelOld = *itdetOld;
131  if (oldDSpixelOld.empty()) continue; // skip empty detsets
132  for (edmNew::DetSet<SiPixelCluster>::const_iterator clOld = oldDSpixelOld.begin(); clOld != oldDSpixelOld.end(); ++clOld) {
133  int minPixelRowOld = clOld->minPixelRow();
134  if (minPixelRowNew==minPixelRowOld) {
135  keyOld = ((&*clOld) - firstOffsetPixelOld);
136  //cout << "old pixel index=" << keyOld << endl;
137  break;
138  }
139  }
140  }
141  assert(keyOld!=99999);
142  //cout << "push back pixel index=" << keyOld << endl;
143  pixelInd.push_back(keyOld);
144  }
145  }
146 
147  //cout << "pixelInd size" << pixelInd.size() << endl;
148  //cout << "stripInd size" << stripInd.size() << endl;
149 
150  cri->setNewPixelClusters(edm::OrphanHandle<SiPixelClusterCollectionNew>(pixelClustersNew.product(),pixelClustersNew.id()));
151  cri->setNewStripClusters(edm::OrphanHandle<edmNew::DetSetVector<SiStripCluster> >(stripClustersNew.product(),stripClustersNew.id()));
152 
153  iEvent.put(std::move(cri));
154 }
edm::EDGetTokenT< edmNew::DetSetVector< SiPixelCluster > > pixelClustersNew_
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
const_iterator end(bool update=false) const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:122
ProductID id() const
Definition: HandleBase.cc:15
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:457
data_type const * const_iterator
Definition: DetSetNew.h:30
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:90
std::vector< uint32_t > Indices
T const * product() const
Definition: Handle.h:81
id_type detId() const
Definition: DetSetNew.h:84
const_iterator find(id_type i, bool update=false) const
Pixel cluster – collection of neighboring pixels above threshold.
iterator end()
Definition: DetSetNew.h:70
id_type id() const
Definition: DetSetNew.h:81
edm::EDGetTokenT< edmNew::DetSetVector< SiPixelCluster > > pixelClustersOld_
def move(src, dest)
Definition: eostools.py:510
iterator begin()
Definition: DetSetNew.h:67

Member Data Documentation

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

Definition at line 40 of file TopBottomClusterInfoProducer.cc.

Referenced by produce(), and TopBottomClusterInfoProducer().

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

Definition at line 39 of file TopBottomClusterInfoProducer.cc.

Referenced by produce(), and TopBottomClusterInfoProducer().

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

Definition at line 42 of file TopBottomClusterInfoProducer.cc.

Referenced by produce(), and TopBottomClusterInfoProducer().

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

Definition at line 41 of file TopBottomClusterInfoProducer.cc.

Referenced by produce(), and TopBottomClusterInfoProducer().