test
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 Attributes
TopBottomClusterInfoProducer Class Reference
Inheritance diagram for TopBottomClusterInfoProducer:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

void produce (edm::Event &iEvent, const edm::EventSetup &iSetup) override
 
 TopBottomClusterInfoProducer (const edm::ParameterSet &iConfig)
 
 ~TopBottomClusterInfoProducer ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

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::EDProducer
typedef EDProducer ModuleType
 
- 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::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- 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().

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::Event iEvent,
const edm::EventSetup iSetup 
)
overridevirtual

Implements edm::EDProducer.

Definition at line 65 of file TopBottomClusterInfoProducer.cc.

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

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_ptr<ClusterRemovalInfo> cri(new 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(cri);
154 }
edm::EDGetTokenT< edmNew::DetSetVector< SiPixelCluster > > pixelClustersNew_
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
ProductID id() const
Definition: HandleBase.cc:15
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:434
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_
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:116
bool empty() const
Definition: DetSetNew.h:89
std::vector< uint32_t > Indices
id_type detId() const
Definition: DetSetNew.h:83
T const * product() const
Definition: Handle.h:81
Pixel cluster – collection of neighboring pixels above threshold.
iterator end()
Definition: DetSetNew.h:70
id_type id() const
Definition: DetSetNew.h:80
edm::EDGetTokenT< edmNew::DetSetVector< SiPixelCluster > > pixelClustersOld_
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.

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.