CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions
MeasurementTrackerEventProducer Class Referencefinal

#include <MeasurementTrackerEventProducer.h>

Inheritance diagram for MeasurementTrackerEventProducer:
edm::stream::EDProducer<>

Public Member Functions

 MeasurementTrackerEventProducer (const edm::ParameterSet &iConfig)
 
 ~MeasurementTrackerEventProducer () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Protected Member Functions

void getInactiveStrips (const edm::Event &event, std::vector< uint32_t > &rawInactiveDetIds) const
 
void updatePhase2OT (const edm::Event &, Phase2OTMeasurementDetSet &thePh2OTDets) const
 
void updatePixels (const edm::Event &, PxMeasurementDetSet &thePxDets, std::vector< bool > &pixelClustersToSkip, const TrackerGeometry &trackerGeom, const edm::EventSetup &iSetup) const
 
void updateStacks (const edm::Event &, Phase2OTMeasurementDetSet &theStDets) const
 
void updateStrips (const edm::Event &, StMeasurementDetSet &theStDets, std::vector< bool > &stripClustersToSkip) const
 

Protected Attributes

bool isPhase2_
 
std::string measurementTrackerLabel_
 
std::string pixelCablingMapLabel_
 
bool selfUpdateSkipClusters_
 
bool switchOffPixelsIfEmpty_
 
std::vector< edm::EDGetTokenT< PixelFEDChannelCollection > > theBadPixelFEDChannelsLabels
 
std::vector< edm::EDGetTokenT< DetIdCollection > > theInactivePixelDetectorLabels
 
std::vector< edm::EDGetTokenT< DetIdCollection > > theInactiveStripDetectorLabels
 
edm::EDGetTokenT< edmNew::DetSetVector< Phase2TrackerCluster1D > > thePh2OTClusterLabel
 
edm::EDGetTokenT< VectorHitCollectionthePh2OTVectorHitsLabel
 
edm::EDGetTokenT< VectorHitCollectionthePh2OTVectorHitsRejLabel
 
edm::EDGetTokenT< edmNew::DetSetVector< SiPixelCluster > > thePixelClusterLabel
 
edm::EDGetTokenT< edm::ContainerMask< edmNew::DetSetVector< SiPixelCluster > > > thePixelClusterMask
 
edm::EDGetTokenT< edmNew::DetSetVector< SiStripCluster > > theStripClusterLabel
 
edm::EDGetTokenT< edm::ContainerMask< edmNew::DetSetVector< SiStripCluster > > > theStripClusterMask
 
bool useVectorHits_
 

Private Member Functions

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

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 

Detailed Description

Definition at line 17 of file MeasurementTrackerEventProducer.h.

Constructor & Destructor Documentation

◆ MeasurementTrackerEventProducer()

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

Definition at line 17 of file MeasurementTrackerEventProducer.cc.

18  : measurementTrackerLabel_(iConfig.getParameter<std::string>("measurementTracker")),
19  switchOffPixelsIfEmpty_(iConfig.getParameter<bool>("switchOffPixelsIfEmpty")) {
20  std::vector<edm::InputTag> inactivePixelDetectorTags(
21  iConfig.getParameter<std::vector<edm::InputTag>>("inactivePixelDetectorLabels"));
22  for (auto& t : inactivePixelDetectorTags)
23  theInactivePixelDetectorLabels.push_back(consumes<DetIdCollection>(t));
24 
25  std::vector<edm::InputTag> badPixelFEDChannelCollectionTags =
26  iConfig.getParameter<std::vector<edm::InputTag>>("badPixelFEDChannelCollectionLabels");
27  if (!badPixelFEDChannelCollectionTags.empty()) {
28  for (auto& t : badPixelFEDChannelCollectionTags)
29  theBadPixelFEDChannelsLabels.push_back(consumes<PixelFEDChannelCollection>(t));
30  pixelCablingMapLabel_ = iConfig.getParameter<std::string>("pixelCablingMapLabel");
31  }
32 
33  std::vector<edm::InputTag> inactiveStripDetectorTags(
34  iConfig.getParameter<std::vector<edm::InputTag>>("inactiveStripDetectorLabels"));
35  for (auto& t : inactiveStripDetectorTags)
36  theInactiveStripDetectorLabels.push_back(consumes<DetIdCollection>(t));
37 
38  //the measurement tracking is set to skip clusters, the other option is set from outside
39  edm::InputTag skip = iConfig.getParameter<edm::InputTag>("skipClusters");
41  LogDebug("MeasurementTracker") << "skipping clusters: " << selfUpdateSkipClusters_;
42  isPhase2_ = false;
43  useVectorHits_ = false;
44 
45  if (!iConfig.getParameter<std::string>("stripClusterProducer").empty()) {
46  theStripClusterLabel = consumes<edmNew::DetSetVector<SiStripCluster>>(
47  edm::InputTag(iConfig.getParameter<std::string>("stripClusterProducer")));
49  theStripClusterMask = consumes<edm::ContainerMask<edmNew::DetSetVector<SiStripCluster>>>(
50  iConfig.getParameter<edm::InputTag>("skipClusters"));
51  }
52  if (!iConfig.getParameter<std::string>("pixelClusterProducer").empty()) {
53  thePixelClusterLabel = consumes<edmNew::DetSetVector<SiPixelCluster>>(
54  edm::InputTag(iConfig.getParameter<std::string>("pixelClusterProducer")));
56  thePixelClusterMask = consumes<edm::ContainerMask<edmNew::DetSetVector<SiPixelCluster>>>(
57  iConfig.getParameter<edm::InputTag>("skipClusters"));
58  }
59  if (!iConfig.getParameter<std::string>("Phase2TrackerCluster1DProducer").empty()) {
60  thePh2OTClusterLabel = consumes<edmNew::DetSetVector<Phase2TrackerCluster1D>>(
61  edm::InputTag(iConfig.getParameter<std::string>("Phase2TrackerCluster1DProducer")));
62  isPhase2_ = true;
63  }
64  if (!(iConfig.getParameter<edm::InputTag>("vectorHits") == edm::InputTag("") ||
65  iConfig.getParameter<edm::InputTag>("vectorHitsRej") == edm::InputTag(""))) {
66  thePh2OTVectorHitsLabel = consumes<VectorHitCollection>(iConfig.getParameter<edm::InputTag>("vectorHits"));
67  thePh2OTVectorHitsRejLabel = consumes<VectorHitCollection>(iConfig.getParameter<edm::InputTag>("vectorHitsRej"));
68  isPhase2_ = true;
69  useVectorHits_ = true;
70  }
71 
72  produces<MeasurementTrackerEvent>();
73 }

References edm::ParameterSet::getParameter(), HLT_FULL_cff::InputTag, isPhase2_, LogDebug, pixelCablingMapLabel_, selfUpdateSkipClusters_, optionsL1T::skip, AlCaHLTBitMon_QueryRunRegistry::string, submitPVValidationJobs::t, theBadPixelFEDChannelsLabels, theInactivePixelDetectorLabels, theInactiveStripDetectorLabels, thePh2OTClusterLabel, thePh2OTVectorHitsLabel, thePh2OTVectorHitsRejLabel, thePixelClusterLabel, thePixelClusterMask, theStripClusterLabel, theStripClusterMask, and useVectorHits_.

◆ ~MeasurementTrackerEventProducer()

MeasurementTrackerEventProducer::~MeasurementTrackerEventProducer ( )
inlineoverride

Definition at line 20 of file MeasurementTrackerEventProducer.h.

20 {}

Member Function Documentation

◆ fillDescriptions()

void MeasurementTrackerEventProducer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 75 of file MeasurementTrackerEventProducer.cc.

75  {
77 
78  desc.add<std::string>("measurementTracker", "");
79  desc.add<edm::InputTag>("skipClusters", edm::InputTag());
80  desc.add<std::string>("pixelClusterProducer", "siPixelClusters");
81  desc.add<std::string>("stripClusterProducer", "siStripClusters");
82  desc.add<std::string>("Phase2TrackerCluster1DProducer", "");
83  desc.add<edm::InputTag>("vectorHits", edm::InputTag(""));
84  desc.add<edm::InputTag>("vectorHitsRej", edm::InputTag(""));
85 
86  desc.add<std::vector<edm::InputTag>>("inactivePixelDetectorLabels",
87  std::vector<edm::InputTag>{{edm::InputTag("siPixelDigis")}})
88  ->setComment("One or more DetIdCollections of modules to mask on the fly for a given event");
89  desc.add<std::vector<edm::InputTag>>("badPixelFEDChannelCollectionLabels", std::vector<edm::InputTag>())
90  ->setComment("One or more PixelFEDChannelCollections of modules+ROCs to mask on the fly for a given event");
91  desc.add<std::string>("pixelCablingMapLabel", "");
92 
93  desc.add<std::vector<edm::InputTag>>("inactiveStripDetectorLabels",
94  std::vector<edm::InputTag>{{edm::InputTag("siStripDigis")}})
95  ->setComment("One or more DetIdCollections of modules to mask on the fly for a given event");
96 
97  desc.add<bool>("switchOffPixelsIfEmpty", true)->setComment("let's keep it like this, for cosmics");
98 
99  descriptions.add("measurementTrackerEventDefault", desc);
100 }

References edm::ConfigurationDescriptions::add(), submitPVResolutionJobs::desc, HLT_FULL_cff::InputTag, and AlCaHLTBitMon_QueryRunRegistry::string.

◆ getInactiveStrips()

void MeasurementTrackerEventProducer::getInactiveStrips ( const edm::Event event,
std::vector< uint32_t > &  rawInactiveDetIds 
) const
protected

Definition at line 409 of file MeasurementTrackerEventProducer.cc.

410  {
411  if (!theInactiveStripDetectorLabels.empty()) {
414  if (event.getByToken(tk, detIds)) {
415  rawInactiveDetIds.insert(rawInactiveDetIds.end(), detIds->begin(), detIds->end());
416  }
417  }
418  if (!rawInactiveDetIds.empty())
419  std::sort(rawInactiveDetIds.begin(), rawInactiveDetIds.end());
420  }
421 }

References edm::EDCollection< T >::begin(), edm::EDCollection< T >::end(), and theInactiveStripDetectorLabels.

Referenced by updateStrips().

◆ produce()

void MeasurementTrackerEventProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 102 of file MeasurementTrackerEventProducer.cc.

102  {
105 
106  // create new data structures from templates
107  auto stripData = std::make_unique<StMeasurementDetSet>(measurementTracker->stripDetConditions());
108  auto pixelData = std::make_unique<PxMeasurementDetSet>(measurementTracker->pixelDetConditions());
109  auto phase2OTData = std::make_unique<Phase2OTMeasurementDetSet>(measurementTracker->phase2DetConditions());
110 
111  std::vector<bool> stripClustersToSkip;
112  std::vector<bool> pixelClustersToSkip;
113  std::vector<bool> phase2ClustersToSkip;
114  // fill them
115  updateStrips(iEvent, *stripData, stripClustersToSkip);
117  *pixelData,
118  pixelClustersToSkip,
119  dynamic_cast<const TrackerGeometry&>(*(measurementTracker->geomTracker())),
120  iSetup);
121  updatePhase2OT(iEvent, *phase2OTData);
122  updateStacks(iEvent, *phase2OTData);
123 
124  // put into MTE
125  // put into event
126  //
127 
128  const VectorHitCollection* phase2OTVectorHits = useVectorHits_ ? &iEvent.get(thePh2OTVectorHitsLabel) : nullptr;
129  const VectorHitCollection* phase2OTVectorHitsRej = useVectorHits_ ? &iEvent.get(thePh2OTVectorHitsRejLabel) : nullptr;
130  iEvent.put(std::make_unique<MeasurementTrackerEvent>(*measurementTracker,
131  stripData.release(),
132  pixelData.release(),
133  phase2OTData.release(),
134  phase2OTVectorHits,
135  phase2OTVectorHitsRej,
136  stripClustersToSkip,
137  pixelClustersToSkip,
138  phase2ClustersToSkip));
139 }

References edm::EventSetup::get(), get, iEvent, HLTSiStripMonitoring_cff::measurementTracker, measurementTrackerLabel_, thePh2OTVectorHitsLabel, thePh2OTVectorHitsRejLabel, updatePhase2OT(), updatePixels(), updateStacks(), updateStrips(), and useVectorHits_.

◆ updatePhase2OT()

void MeasurementTrackerEventProducer::updatePhase2OT ( const edm::Event event,
Phase2OTMeasurementDetSet thePh2OTDets 
) const
protected

Definition at line 368 of file MeasurementTrackerEventProducer.cc.

369  {
370  thePh2OTDets.setEmpty();
371 
372  // Phase2OT Clusters
373  if (isPhase2_) {
374  if (thePh2OTClusterLabel.isUninitialized()) { //clusters have not been produced
375  thePh2OTDets.setActiveThisEvent(false);
376  } else {
378  if (event.getByToken(thePh2OTClusterLabel, phase2OTClusters)) {
379  const edmNew::DetSetVector<Phase2TrackerCluster1D>* phase2OTCollection = phase2OTClusters.product();
380 
381  int i = 0, endDet = thePh2OTDets.size();
383  ed = phase2OTCollection->end();
384  it != ed;
385  ++it) {
387  unsigned int id = set.id();
388  while (id != thePh2OTDets.id(i)) {
389  ++i;
390  if (endDet == i)
391  throw "we have a problem!!!!";
392  }
393  // push cluster range in det
394  if (thePh2OTDets.isActive(i)) {
395  thePh2OTDets.update(i, set);
396  }
397  }
398  } else {
400  labelsForToken(thePh2OTClusterLabel, labels);
401  edm::LogWarning("MeasurementTrackerEventProducer")
402  << "input Phase2TrackerCluster1D collection " << labels.module << " is not valid";
403  }
404  }
405  }
406  return;
407 }

References edmNew::DetSetVector< T >::begin(), edmNew::DetSetVector< T >::end(), Phase2OTMeasurementDetSet::handle(), mps_fire::i, edmNew::DetSet< T >::id(), Phase2OTMeasurementDetSet::id(), Phase2OTMeasurementDetSet::isActive(), isPhase2_, edm::EDGetTokenT< T >::isUninitialized(), SummaryClient_cfi::labels, HLTEgPhaseIITestSequence_cff::phase2OTClusters, Phase2OTMeasurementDetSet::setActiveThisEvent(), Phase2OTMeasurementDetSet::setEmpty(), Phase2OTMeasurementDetSet::size(), thePh2OTClusterLabel, and Phase2OTMeasurementDetSet::update().

Referenced by produce().

◆ updatePixels()

void MeasurementTrackerEventProducer::updatePixels ( const edm::Event event,
PxMeasurementDetSet thePxDets,
std::vector< bool > &  pixelClustersToSkip,
const TrackerGeometry trackerGeom,
const edm::EventSetup iSetup 
) const
protected

Definition at line 141 of file MeasurementTrackerEventProducer.cc.

145  {
146  // start by clearinng everything
147  thePxDets.setEmpty();
148 
149  std::vector<uint32_t> rawInactiveDetIds;
150  if (!theInactivePixelDetectorLabels.empty()) {
153  if (event.getByToken(tk, detIds)) {
154  rawInactiveDetIds.insert(rawInactiveDetIds.end(), detIds->begin(), detIds->end());
155  } else {
156  static std::atomic<bool> iFailedAlready{false};
157  bool expected = false;
158  if (iFailedAlready.compare_exchange_strong(expected, true, std::memory_order_acq_rel)) {
159  edm::LogError("MissingProduct")
160  << "I fail to get the list of inactive pixel modules, because of 4.2/4.4 event content change.";
161  }
162  }
163  }
164  if (!rawInactiveDetIds.empty())
165  std::sort(rawInactiveDetIds.begin(), rawInactiveDetIds.end());
166  // mark as inactive if in rawInactiveDetIds
167  int i = 0, endDet = thePxDets.size();
168  unsigned int idp = 0;
169  for (auto id : rawInactiveDetIds) {
170  if (id == idp)
171  continue; // skip multiple id
172  idp = id;
173  i = thePxDets.find(id, i);
174  assert(i != endDet && id == thePxDets.id(i));
175  thePxDets.setActiveThisEvent(i, false);
176  }
177  }
178 
179  if (!theBadPixelFEDChannelsLabels.empty()) {
181  iSetup.get<SiPixelFedCablingMapRcd>().get(pixelCablingMapLabel_, cablingMap);
182 
183  edm::Handle<PixelFEDChannelCollection> pixelFEDChannelCollectionHandle;
185  if (!event.getByToken(tk, pixelFEDChannelCollectionHandle))
186  continue;
187  int i = 0;
188  for (const auto& disabledChannels : *pixelFEDChannelCollectionHandle) {
190  for (const auto& ch : disabledChannels) {
191  const sipixelobjects::PixelROC *roc_first = nullptr, *roc_last = nullptr;
192  sipixelobjects::CablingPathToDetUnit path = {ch.fed, ch.link, 0};
193  // PixelFEDChannelCollection addresses the ROCs by their 'idInDetUnit' (from 0 to 15), ROCs also know their on 'idInDetUnit',
194  // however the cabling map uses a numbering [1,numberOfROCs], see sipixelobjects::PixelFEDLink::roc(unsigned int id), not necessarily sorted in the same direction.
195  // PixelFEDChannelCollection MUST be filled such that ch.roc_first (ch.roc_last) correspond to the lowest (highest) 'idInDetUnit' in the channel
196  for (path.roc = 1; path.roc <= (ch.roc_last - ch.roc_first) + 1; path.roc++) {
197  const sipixelobjects::PixelROC* roc = cablingMap->findItem(path);
198  if (roc == nullptr)
199  continue;
200  assert(roc->rawId() == disabledChannels.detId());
201  if (roc->idInDetUnit() == ch.roc_first)
202  roc_first = roc;
203  if (roc->idInDetUnit() == ch.roc_last)
204  roc_last = roc;
205  }
206  if (roc_first == nullptr || roc_last == nullptr) {
207  edm::LogError("PixelFEDChannelCollection")
208  << "Do not find either roc_first or roc_last in the cabling map.";
209  continue;
210  }
211  const PixelGeomDetUnit* theGeomDet =
212  dynamic_cast<const PixelGeomDetUnit*>(trackerGeom.idToDet(roc_first->rawId()));
213  PixelTopology const* topology = &(theGeomDet->specificTopology());
215  topology->rowsperroc() / 2, topology->colsperroc() / 2}; //corresponding to center of ROC row, col
217  LocalPoint lp1 = topology->localPosition(MeasurementPoint(global.row, global.col));
218  global = roc_last->toGlobal(sipixelobjects::LocalPixel(local));
219  LocalPoint lp2 = topology->localPosition(MeasurementPoint(global.row, global.col));
220  LocalPoint ll(std::min(lp1.x(), lp2.x()), std::min(lp1.y(), lp2.y()), std::min(lp1.z(), lp2.z()));
221  LocalPoint ur(std::max(lp1.x(), lp2.x()), std::max(lp1.y(), lp2.y()), std::max(lp1.z(), lp2.z()));
222  positions.push_back(std::make_pair(ll, ur));
223  } // loop on channels
224  if (!positions.empty()) {
225  i = thePxDets.find(disabledChannels.detId(), i);
226  assert(i != thePxDets.size() && thePxDets.id(i) == disabledChannels.detId());
227  thePxDets.addBadFEDChannelPositions(i, positions);
228  }
229  } // loop on DetId-s
230  } // loop on labels
231  } // if collection labels are populated
232 
233  // Pixel Clusters
234  if (thePixelClusterLabel.isUninitialized()) { //clusters have not been produced
236  thePxDets.setActiveThisEvent(false);
237  }
238  } else {
240  if (event.getByToken(thePixelClusterLabel, pixelClusters)) {
241  const edmNew::DetSetVector<SiPixelCluster>* pixelCollection = pixelClusters.product();
242 
243  if (switchOffPixelsIfEmpty_ && pixelCollection->empty()) {
244  thePxDets.setActiveThisEvent(false);
245  } else {
246  //std::cout <<"updatePixels "<<pixelCollection->dataSize()<<std::endl;
247  pixelClustersToSkip.resize(pixelCollection->dataSize());
248  std::fill(pixelClustersToSkip.begin(), pixelClustersToSkip.end(), false);
249 
252  //and get the collection of pixel ref to skip
253  event.getByToken(thePixelClusterMask, pixelClusterMask);
254  LogDebug("MeasurementTracker") << "getting pxl refs to skip";
255  if (pixelClusterMask.failedToGet())
256  edm::LogError("MeasurementTracker") << "not getting the pixel clusters to skip";
257  if (pixelClusterMask->refProd().id() != pixelClusters.id()) {
258  edm::LogError("ProductIdMismatch")
259  << "The pixel masking does not point to the proper collection of clusters: "
260  << pixelClusterMask->refProd().id() << "!=" << pixelClusters.id();
261  }
262  pixelClusterMask->copyMaskTo(pixelClustersToSkip);
263  }
264 
265  // FIXME: should check if lower_bound is better
266  int i = 0, endDet = thePxDets.size();
267  for (edmNew::DetSetVector<SiPixelCluster>::const_iterator it = pixelCollection->begin(),
268  ed = pixelCollection->end();
269  it != ed;
270  ++it) {
272  unsigned int id = set.id();
273  while (id != thePxDets.id(i)) {
274  ++i;
275  if (endDet == i)
276  throw "we have a problem!!!!";
277  }
278  // push cluster range in det
279  if (thePxDets.isActive(i)) {
280  thePxDets.update(i, set);
281  }
282  }
283  }
284  } else {
286  labelsForToken(thePixelClusterLabel, labels);
287  edm::LogWarning("MeasurementTrackerEventProducer")
288  << "input pixel clusters collection " << labels.module << " is not valid";
289  }
290  }
291 }

References PxMeasurementDetSet::addBadFEDChannelPositions(), cms::cuda::assert(), edm::EDCollection< T >::begin(), edmNew::DetSetVector< T >::begin(), sipixelobjects::GlobalPixel::col, edmNew::DetSetVector< T >::dataSize(), edmNew::DetSetVector< T >::empty(), edm::EDCollection< T >::end(), edmNew::DetSetVector< T >::end(), edm::HandleBase::failedToGet(), ntuplemaker::fill, PxMeasurementDetSet::find(), SiPixelFedCablingMap::findItem(), edm::EventSetup::get(), get, PxMeasurementDetSet::handle(), mps_fire::i, triggerObjects_cff::id, edmNew::DetSet< T >::id(), edm::HandleBase::id(), PxMeasurementDetSet::id(), TrackerGeometry::idToDet(), PxMeasurementDetSet::isActive(), edm::EDGetTokenT< T >::isUninitialized(), SummaryClient_cfi::labels, DTRecHitClients_cfi::local, LogDebug, SiStripPI::max, min(), castor_dqm_sourceclient_file_cfg::path, pixelCablingMapLabel_, LumiMonitor_cff::pixelClusters, sipixelobjects::PixelROC::rawId(), PixelMapPlotter::roc, sipixelobjects::GlobalPixel::row, selfUpdateSkipClusters_, PxMeasurementDetSet::setActiveThisEvent(), PxMeasurementDetSet::setEmpty(), PxMeasurementDetSet::size(), PixelGeomDetUnit::specificTopology(), switchOffPixelsIfEmpty_, theBadPixelFEDChannelsLabels, theInactivePixelDetectorLabels, thePixelClusterLabel, thePixelClusterMask, sipixelobjects::PixelROC::toGlobal(), ecaldqm::topology(), PxMeasurementDetSet::update(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by produce().

◆ updateStacks()

void MeasurementTrackerEventProducer::updateStacks ( const edm::Event ,
Phase2OTMeasurementDetSet theStDets 
) const
inlineprotected

Definition at line 36 of file MeasurementTrackerEventProducer.h.

36 {};

Referenced by produce().

◆ updateStrips()

void MeasurementTrackerEventProducer::updateStrips ( const edm::Event event,
StMeasurementDetSet theStDets,
std::vector< bool > &  stripClustersToSkip 
) const
protected

Definition at line 293 of file MeasurementTrackerEventProducer.cc.

295  {
296  typedef edmNew::DetSet<SiStripCluster> StripDetSet;
297 
298  std::vector<uint32_t> rawInactiveDetIds;
299  getInactiveStrips(event, rawInactiveDetIds);
300 
301  // Strip Clusters
302  //first clear all of them
303  theStDets.setEmpty();
304 
306  return; //clusters have not been produced
307 
308  const int endDet = theStDets.size();
309 
310  // mark as inactive if in rawInactiveDetIds
311  int i = 0;
312  unsigned int idp = 0;
313  for (auto id : rawInactiveDetIds) {
314  if (id == idp)
315  continue; // skip multiple id
316  idp = id;
317  i = theStDets.find(id, i);
318  assert(i != endDet && id == theStDets.id(i));
319  theStDets.setActiveThisEvent(i, false);
320  }
321 
322  //========= actually load cluster =============
323  {
325  if (event.getByToken(theStripClusterLabel, clusterHandle)) {
326  const edmNew::DetSetVector<SiStripCluster>* clusterCollection = clusterHandle.product();
327 
330  //and get the collection of pixel ref to skip
331  LogDebug("MeasurementTracker") << "getting strp refs to skip";
332  event.getByToken(theStripClusterMask, stripClusterMask);
333  if (stripClusterMask.failedToGet())
334  edm::LogError("MeasurementTracker") << "not getting the strip clusters to skip";
335  if (stripClusterMask->refProd().id() != clusterHandle.id()) {
336  edm::LogError("ProductIdMismatch")
337  << "The strip masking does not point to the proper collection of clusters: "
338  << stripClusterMask->refProd().id() << "!=" << clusterHandle.id();
339  }
340  stripClusterMask->copyMaskTo(stripClustersToSkip);
341  }
342 
343  theStDets.handle() = clusterHandle;
344  int i = 0;
345  // cluster and det and in order (both) and unique so let's use set intersection
346  for (auto j = 0U; j < (*clusterCollection).size(); ++j) {
347  unsigned int id = (*clusterCollection).id(j);
348  while (id != theStDets.id(i)) { // eventually change to lower_bound
349  ++i;
350  if (endDet == i)
351  throw "we have a problem in strips!!!!";
352  }
353 
354  // push cluster range in det
355  if (theStDets.isActive(i))
356  theStDets.update(i, j);
357  }
358  } else {
360  labelsForToken(theStripClusterLabel, labels);
361  edm::LogWarning("MeasurementTrackerEventProducer")
362  << "input strip cluster collection " << labels.module << " is not valid";
363  }
364  }
365 }

References cms::cuda::assert(), edm::HandleBase::failedToGet(), StMeasurementDetSet::find(), getInactiveStrips(), StMeasurementDetSet::handle(), mps_fire::i, triggerObjects_cff::id, edm::HandleBase::id(), StMeasurementDetSet::id(), StMeasurementDetSet::isActive(), edm::EDGetTokenT< T >::isUninitialized(), dqmiolumiharvest::j, SummaryClient_cfi::labels, LogDebug, edm::Handle< T >::product(), selfUpdateSkipClusters_, StMeasurementDetSet::setActiveThisEvent(), StMeasurementDetSet::setEmpty(), StMeasurementDetSet::size(), theStripClusterLabel, theStripClusterMask, mitigatedMETSequence_cff::U, and StMeasurementDetSet::update().

Referenced by produce().

Member Data Documentation

◆ isPhase2_

bool MeasurementTrackerEventProducer::isPhase2_
protected

◆ measurementTrackerLabel_

std::string MeasurementTrackerEventProducer::measurementTrackerLabel_
protected

Definition at line 40 of file MeasurementTrackerEventProducer.h.

Referenced by produce().

◆ pixelCablingMapLabel_

std::string MeasurementTrackerEventProducer::pixelCablingMapLabel_
protected

◆ selfUpdateSkipClusters_

bool MeasurementTrackerEventProducer::selfUpdateSkipClusters_
protected

◆ switchOffPixelsIfEmpty_

bool MeasurementTrackerEventProducer::switchOffPixelsIfEmpty_
protected

Definition at line 55 of file MeasurementTrackerEventProducer.h.

Referenced by updatePixels().

◆ theBadPixelFEDChannelsLabels

std::vector<edm::EDGetTokenT<PixelFEDChannelCollection> > MeasurementTrackerEventProducer::theBadPixelFEDChannelsLabels
protected

◆ theInactivePixelDetectorLabels

std::vector<edm::EDGetTokenT<DetIdCollection> > MeasurementTrackerEventProducer::theInactivePixelDetectorLabels
protected

◆ theInactiveStripDetectorLabels

std::vector<edm::EDGetTokenT<DetIdCollection> > MeasurementTrackerEventProducer::theInactiveStripDetectorLabels
protected

◆ thePh2OTClusterLabel

edm::EDGetTokenT<edmNew::DetSetVector<Phase2TrackerCluster1D> > MeasurementTrackerEventProducer::thePh2OTClusterLabel
protected

◆ thePh2OTVectorHitsLabel

edm::EDGetTokenT<VectorHitCollection> MeasurementTrackerEventProducer::thePh2OTVectorHitsLabel
protected

Definition at line 44 of file MeasurementTrackerEventProducer.h.

Referenced by MeasurementTrackerEventProducer(), and produce().

◆ thePh2OTVectorHitsRejLabel

edm::EDGetTokenT<VectorHitCollection> MeasurementTrackerEventProducer::thePh2OTVectorHitsRejLabel
protected

Definition at line 45 of file MeasurementTrackerEventProducer.h.

Referenced by MeasurementTrackerEventProducer(), and produce().

◆ thePixelClusterLabel

edm::EDGetTokenT<edmNew::DetSetVector<SiPixelCluster> > MeasurementTrackerEventProducer::thePixelClusterLabel
protected

◆ thePixelClusterMask

edm::EDGetTokenT<edm::ContainerMask<edmNew::DetSetVector<SiPixelCluster> > > MeasurementTrackerEventProducer::thePixelClusterMask
protected

◆ theStripClusterLabel

edm::EDGetTokenT<edmNew::DetSetVector<SiStripCluster> > MeasurementTrackerEventProducer::theStripClusterLabel
protected

◆ theStripClusterMask

edm::EDGetTokenT<edm::ContainerMask<edmNew::DetSetVector<SiStripCluster> > > MeasurementTrackerEventProducer::theStripClusterMask
protected

◆ useVectorHits_

bool MeasurementTrackerEventProducer::useVectorHits_
protected

Definition at line 57 of file MeasurementTrackerEventProducer.h.

Referenced by MeasurementTrackerEventProducer(), and produce().

TrackerGeometry::idToDet
const TrackerGeomDet * idToDet(DetId) const override
Definition: TrackerGeometry.cc:193
SummaryClient_cfi.labels
labels
Definition: SummaryClient_cfi.py:61
edm::EDCollection::begin
const_iterator begin() const
Definition: EDCollection.h:117
mps_fire.i
i
Definition: mps_fire.py:428
LumiMonitor_cff.pixelClusters
pixelClusters
Definition: LumiMonitor_cff.py:10
MeasurementTrackerEventProducer::theStripClusterMask
edm::EDGetTokenT< edm::ContainerMask< edmNew::DetSetVector< SiStripCluster > > > theStripClusterMask
Definition: MeasurementTrackerEventProducer.h:47
MeasurementTrackerEventProducer::thePh2OTClusterLabel
edm::EDGetTokenT< edmNew::DetSetVector< Phase2TrackerCluster1D > > thePh2OTClusterLabel
Definition: MeasurementTrackerEventProducer.h:43
edm::Handle::product
T const * product() const
Definition: Handle.h:70
MeasurementTrackerEventProducer::theInactivePixelDetectorLabels
std::vector< edm::EDGetTokenT< DetIdCollection > > theInactivePixelDetectorLabels
Definition: MeasurementTrackerEventProducer.h:49
PxMeasurementDetSet::update
void update(int i, const PixelDetSet &detSet)
Definition: TkMeasurementDetSet.h:339
HLTSiStripMonitoring_cff.measurementTracker
measurementTracker
Definition: HLTSiStripMonitoring_cff.py:178
StMeasurementDetSet::size
int size() const
Definition: TkMeasurementDetSet.h:173
MeasurementTrackerEventProducer::isPhase2_
bool isPhase2_
Definition: MeasurementTrackerEventProducer.h:56
PV3DBase::x
T x() const
Definition: PV3DBase.h:59
min
T min(T a, T b)
Definition: MathUtil.h:58
edm::EDGetTokenT
Definition: EDGetToken.h:33
PxMeasurementDetSet::size
int size() const
Definition: TkMeasurementDetSet.h:334
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:85964
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
StMeasurementDetSet::setEmpty
void setEmpty(int i)
Definition: TkMeasurementDetSet.h:181
edmNew::DetSetVector::const_iterator
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
Definition: DetSetVectorNew.h:197
Phase2OTMeasurementDetSet::setActiveThisEvent
void setActiveThisEvent(bool active)
Definition: TkMeasurementDetSet.h:465
cms::cuda::assert
assert(be >=bs)
PxMeasurementDetSet::find
int find(unsigned int jd, int i=0) const
Definition: TkMeasurementDetSet.h:337
edm::EDGetTokenT::isUninitialized
constexpr bool isUninitialized() const noexcept
Definition: EDGetToken.h:99
sipixelobjects::GlobalPixel::row
int row
Definition: GlobalPixel.h:7
edmNew::DetSetVector::begin
const_iterator begin(bool update=false) const
Definition: DetSetVectorNew.h:530
MeasurementTrackerEventProducer::thePh2OTVectorHitsLabel
edm::EDGetTokenT< VectorHitCollection > thePh2OTVectorHitsLabel
Definition: MeasurementTrackerEventProducer.h:44
Phase2OTMeasurementDetSet::update
void update(int i, const Phase2DetSet &detSet)
Definition: TkMeasurementDetSet.h:448
Phase2OTMeasurementDetSet::setEmpty
void setEmpty(int i)
Definition: TkMeasurementDetSet.h:456
edm::Handle
Definition: AssociativeIterator.h:50
sipixelobjects::GlobalPixel::col
int col
Definition: GlobalPixel.h:8
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
HLTEgPhaseIITestSequence_cff.phase2OTClusters
phase2OTClusters
Definition: HLTEgPhaseIITestSequence_cff.py:722
sipixelobjects::LocalPixel
identify pixel inside single ROC
Definition: LocalPixel.h:7
PV3DBase::z
T z() const
Definition: PV3DBase.h:61
optionsL1T.skip
skip
Definition: optionsL1T.py:30
PxMeasurementDetSet::id
unsigned int id(int i) const
Definition: TkMeasurementDetSet.h:336
edm::EventSetup::get
T get() const
Definition: EventSetup.h:80
sipixelobjects::GlobalPixel
global coordinates (row and column in DetUnit, as in PixelDigi)
Definition: GlobalPixel.h:6
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
MeasurementTrackerEventProducer::updateStrips
void updateStrips(const edm::Event &, StMeasurementDetSet &theStDets, std::vector< bool > &stripClustersToSkip) const
Definition: MeasurementTrackerEventProducer.cc:293
CkfComponentsRecord
Definition: CkfComponentsRecord.h:22
ecaldqm::topology
const CaloTopology * topology(nullptr)
MeasurementTrackerEventProducer::thePixelClusterMask
edm::EDGetTokenT< edm::ContainerMask< edmNew::DetSetVector< SiPixelCluster > > > thePixelClusterMask
Definition: MeasurementTrackerEventProducer.h:46
MeasurementTrackerEventProducer::theInactiveStripDetectorLabels
std::vector< edm::EDGetTokenT< DetIdCollection > > theInactiveStripDetectorLabels
Definition: MeasurementTrackerEventProducer.h:52
PixelGeomDetUnit
Definition: PixelGeomDetUnit.h:15
sipixelobjects::CablingPathToDetUnit
Definition: CablingPathToDetUnit.h:5
PxMeasurementDetSet::handle
const edm::Handle< edmNew::DetSetVector< SiPixelCluster > > & handle() const
Definition: TkMeasurementDetSet.h:385
PxMeasurementDetSet::setEmpty
void setEmpty(int i)
Definition: TkMeasurementDetSet.h:347
edm::ESHandle< MeasurementTracker >
edmNew::DetSet
Definition: DetSetNew.h:22
Phase2OTMeasurementDetSet::handle
const edm::Handle< edmNew::DetSetVector< Phase2TrackerCluster1D > > & handle() const
Definition: TkMeasurementDetSet.h:471
Point3DBase< float, LocalTag >
PixelTopology
Definition: PixelTopology.h:10
sipixelobjects::PixelROC::rawId
uint32_t rawId() const
return the DetUnit to which this ROC belongs to.
Definition: PixelROC.h:34
Phase2OTMeasurementDetSet::id
unsigned int id(int i) const
Definition: TkMeasurementDetSet.h:445
edmNew::DetSetVector::dataSize
size_type dataSize() const
Definition: DetSetVectorNew.h:552
mitigatedMETSequence_cff.U
U
Definition: mitigatedMETSequence_cff.py:36
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
MeasurementPoint
Measurement2DPoint MeasurementPoint
Measurement points are two-dimensional by default.
Definition: MeasurementPoint.h:12
ntuplemaker.fill
fill
Definition: ntuplemaker.py:304
MeasurementTrackerEventProducer::measurementTrackerLabel_
std::string measurementTrackerLabel_
Definition: MeasurementTrackerEventProducer.h:40
PxMeasurementDetSet::BadFEDChannelPositions
std::vector< std::pair< LocalPoint, LocalPoint > > BadFEDChannelPositions
Definition: TkMeasurementDetSet.h:327
edm::HandleBase::failedToGet
bool failedToGet() const
Definition: HandleBase.h:72
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:223
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
edmNew::DetSetVector::empty
bool empty() const
Definition: DetSetVectorNew.h:550
PixelGeomDetUnit::specificTopology
virtual const PixelTopology & specificTopology() const
Returns a reference to the pixel proxy topology.
Definition: PixelGeomDetUnit.cc:17
MeasurementTrackerEventProducer::updatePixels
void updatePixels(const edm::Event &, PxMeasurementDetSet &thePxDets, std::vector< bool > &pixelClustersToSkip, const TrackerGeometry &trackerGeom, const edm::EventSetup &iSetup) const
Definition: MeasurementTrackerEventProducer.cc:141
PV3DBase::y
T y() const
Definition: PV3DBase.h:60
iEvent
int iEvent
Definition: GenABIO.cc:224
MeasurementTrackerEventProducer::updateStacks
void updateStacks(const edm::Event &, Phase2OTMeasurementDetSet &theStDets) const
Definition: MeasurementTrackerEventProducer.h:36
MeasurementTrackerEventProducer::pixelCablingMapLabel_
std::string pixelCablingMapLabel_
Definition: MeasurementTrackerEventProducer.h:51
sipixelobjects::PixelROC::toGlobal
GlobalPixel toGlobal(const LocalPixel &loc) const
Definition: PixelROC.h:55
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
get
#define get
StMeasurementDetSet::find
int find(unsigned int jd, int i=0) const
Definition: TkMeasurementDetSet.h:176
PxMeasurementDetSet::addBadFEDChannelPositions
void addBadFEDChannelPositions(int i, BadFEDChannelPositions &positions)
Definition: TkMeasurementDetSet.h:369
MeasurementTrackerEventProducer::theBadPixelFEDChannelsLabels
std::vector< edm::EDGetTokenT< PixelFEDChannelCollection > > theBadPixelFEDChannelsLabels
Definition: MeasurementTrackerEventProducer.h:50
MeasurementTrackerEventProducer::thePixelClusterLabel
edm::EDGetTokenT< edmNew::DetSetVector< SiPixelCluster > > thePixelClusterLabel
Definition: MeasurementTrackerEventProducer.h:41
sipixelobjects::PixelROC
Definition: PixelROC.h:23
edmNew::DetSetVector
Definition: DetSetNew.h:13
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
StMeasurementDetSet::handle
edm::Handle< edmNew::DetSetVector< SiStripCluster > > & handle()
Definition: TkMeasurementDetSet.h:204
MeasurementTrackerEventProducer::theStripClusterLabel
edm::EDGetTokenT< edmNew::DetSetVector< SiStripCluster > > theStripClusterLabel
Definition: MeasurementTrackerEventProducer.h:42
Phase2OTMeasurementDetSet::isActive
bool isActive(int i) const
Definition: TkMeasurementDetSet.h:454
MeasurementTrackerEventProducer::updatePhase2OT
void updatePhase2OT(const edm::Event &, Phase2OTMeasurementDetSet &thePh2OTDets) const
Definition: MeasurementTrackerEventProducer.cc:368
sipixelobjects::LocalPixel::RocRowCol
row and collumn in ROC representation
Definition: LocalPixel.h:13
StMeasurementDetSet::setActiveThisEvent
void setActiveThisEvent(int i, bool active)
Turn on/off the module for reconstruction for one events. This per-event flag is cleared by any call ...
Definition: TkMeasurementDetSet.h:198
PxMeasurementDetSet::isActive
bool isActive(int i) const
Definition: TkMeasurementDetSet.h:345
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:31
edmNew::DetSetVector::end
const_iterator end(bool update=false) const
Definition: DetSetVectorNew.h:535
MeasurementTrackerEventProducer::thePh2OTVectorHitsRejLabel
edm::EDGetTokenT< VectorHitCollection > thePh2OTVectorHitsRejLabel
Definition: MeasurementTrackerEventProducer.h:45
PixelMapPlotter.roc
roc
Definition: PixelMapPlotter.py:498
StMeasurementDetSet::id
unsigned int id(int i) const
Definition: TkMeasurementDetSet.h:175
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
StMeasurementDetSet::isActive
bool isActive(int i) const
Definition: TkMeasurementDetSet.h:179
castor_dqm_sourceclient_file_cfg.path
path
Definition: castor_dqm_sourceclient_file_cfg.py:37
DTRecHitClients_cfi.local
local
Definition: DTRecHitClients_cfi.py:10
PxMeasurementDetSet::setActiveThisEvent
void setActiveThisEvent(bool active)
Definition: TkMeasurementDetSet.h:361
StMeasurementDetSet::update
void update(int i, const StripDetset &detSet)
Definition: TkMeasurementDetSet.h:159
SiPixelFedCablingMapRcd
Definition: SiPixelFedCablingMapRcd.h:5
MeasurementTrackerEventProducer::getInactiveStrips
void getInactiveStrips(const edm::Event &event, std::vector< uint32_t > &rawInactiveDetIds) const
Definition: MeasurementTrackerEventProducer.cc:409
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
event
Definition: event.py:1
submitPVValidationJobs.t
string t
Definition: submitPVValidationJobs.py:644
edm::Log
Definition: MessageLogger.h:70
MeasurementTrackerEventProducer::useVectorHits_
bool useVectorHits_
Definition: MeasurementTrackerEventProducer.h:57
edm::HandleBase::id
ProductID id() const
Definition: HandleBase.cc:29
SiPixelFedCablingMap::findItem
const sipixelobjects::PixelROC * findItem(const sipixelobjects::CablingPathToDetUnit &path) const final
Definition: SiPixelFedCablingMap.cc:124
edm::InputTag
Definition: InputTag.h:15
edm::EDCollection::end
const_iterator end() const
Definition: EDCollection.h:122
Phase2OTMeasurementDetSet::size
int size() const
Definition: TkMeasurementDetSet.h:443
MeasurementTrackerEventProducer::switchOffPixelsIfEmpty_
bool switchOffPixelsIfEmpty_
Definition: MeasurementTrackerEventProducer.h:55
edm::ProductLabels
Definition: ProductLabels.h:4
MeasurementTrackerEventProducer::selfUpdateSkipClusters_
bool selfUpdateSkipClusters_
Definition: MeasurementTrackerEventProducer.h:54