|
|
#include <MeasurementTrackerEventProducer.h>
◆ MeasurementTrackerEventProducer()
MeasurementTrackerEventProducer::MeasurementTrackerEventProducer |
( |
const edm::ParameterSet & |
iConfig | ) |
|
|
explicit |
Definition at line 17 of file MeasurementTrackerEventProducer.cc.
20 std::vector<edm::InputTag> inactivePixelDetectorTags(
21 iConfig.
getParameter<std::vector<edm::InputTag>>(
"inactivePixelDetectorLabels"));
22 for (
auto&
t : inactivePixelDetectorTags)
25 std::vector<edm::InputTag> badPixelFEDChannelCollectionTags =
26 iConfig.
getParameter<std::vector<edm::InputTag>>(
"badPixelFEDChannelCollectionLabels");
27 if (!badPixelFEDChannelCollectionTags.empty()) {
28 for (
auto&
t : badPixelFEDChannelCollectionTags)
33 std::vector<edm::InputTag> inactiveStripDetectorTags(
34 iConfig.
getParameter<std::vector<edm::InputTag>>(
"inactiveStripDetectorLabels"));
35 for (
auto&
t : inactiveStripDetectorTags)
72 produces<MeasurementTrackerEvent>();
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 |
◆ fillDescriptions()
Definition at line 75 of file MeasurementTrackerEventProducer.cc.
86 desc.add<std::vector<edm::InputTag>>(
"inactivePixelDetectorLabels",
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");
93 desc.add<std::vector<edm::InputTag>>(
"inactiveStripDetectorLabels",
95 ->setComment(
"One or more DetIdCollections of modules to mask on the fly for a given event");
97 desc.add<
bool>(
"switchOffPixelsIfEmpty",
true)->setComment(
"let's keep it like this, for cosmics");
99 descriptions.
add(
"measurementTrackerEventDefault",
desc);
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 |
◆ produce()
Definition at line 102 of file MeasurementTrackerEventProducer.cc.
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());
111 std::vector<bool> stripClustersToSkip;
112 std::vector<bool> pixelClustersToSkip;
113 std::vector<bool> phase2ClustersToSkip;
133 phase2OTData.release(),
135 phase2OTVectorHitsRej,
138 phase2ClustersToSkip));
References edm::EventSetup::get(), get, iEvent, HLTSiStripMonitoring_cff::measurementTracker, measurementTrackerLabel_, thePh2OTVectorHitsLabel, thePh2OTVectorHitsRejLabel, updatePhase2OT(), updatePixels(), updateStacks(), updateStrips(), and useVectorHits_.
◆ updatePhase2OT()
Definition at line 368 of file MeasurementTrackerEventProducer.cc.
381 int i = 0, endDet = thePh2OTDets.
size();
383 ed = phase2OTCollection->
end();
387 unsigned int id = set.id();
388 while (
id != thePh2OTDets.
id(
i)) {
391 throw "we have a problem!!!!";
402 <<
"input Phase2TrackerCluster1D collection " <<
labels.module <<
" is not valid";
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()
Definition at line 141 of file MeasurementTrackerEventProducer.cc.
149 std::vector<uint32_t> rawInactiveDetIds;
153 if (
event.getByToken(tk, detIds)) {
154 rawInactiveDetIds.insert(rawInactiveDetIds.end(), detIds->
begin(), detIds->
end());
156 static std::atomic<bool> iFailedAlready{
false};
157 bool expected =
false;
158 if (iFailedAlready.compare_exchange_strong(expected,
true, std::memory_order_acq_rel)) {
160 <<
"I fail to get the list of inactive pixel modules, because of 4.2/4.4 event content change.";
164 if (!rawInactiveDetIds.empty())
165 std::sort(rawInactiveDetIds.begin(), rawInactiveDetIds.end());
167 int i = 0, endDet = thePxDets.
size();
168 unsigned int idp = 0;
169 for (
auto id : rawInactiveDetIds) {
173 i = thePxDets.
find(
id,
i);
185 if (!
event.getByToken(tk, pixelFEDChannelCollectionHandle))
188 for (
const auto& disabledChannels : *pixelFEDChannelCollectionHandle) {
190 for (
const auto& ch : disabledChannels) {
196 for (
path.roc = 1;
path.roc <= (ch.roc_last - ch.roc_first) + 1;
path.roc++) {
200 assert(
roc->rawId() == disabledChannels.detId());
201 if (
roc->idInDetUnit() == ch.roc_first)
203 if (
roc->idInDetUnit() == ch.roc_last)
206 if (roc_first ==
nullptr || roc_last ==
nullptr) {
208 <<
"Do not find either roc_first or roc_last in the cabling map.";
212 dynamic_cast<const PixelGeomDetUnit*>(trackerGeom.
idToDet(roc_first->
rawId()));
222 positions.push_back(std::make_pair(ll, ur));
224 if (!positions.empty()) {
225 i = thePxDets.
find(disabledChannels.detId(),
i);
226 assert(
i != thePxDets.
size() && thePxDets.
id(
i) == disabledChannels.detId());
247 pixelClustersToSkip.resize(pixelCollection->
dataSize());
248 std::fill(pixelClustersToSkip.begin(), pixelClustersToSkip.end(),
false);
254 LogDebug(
"MeasurementTracker") <<
"getting pxl refs to skip";
256 edm::LogError(
"MeasurementTracker") <<
"not getting the pixel clusters to skip";
259 <<
"The pixel masking does not point to the proper collection of clusters: "
262 pixelClusterMask->copyMaskTo(pixelClustersToSkip);
266 int i = 0, endDet = thePxDets.
size();
268 ed = pixelCollection->
end();
272 unsigned int id = set.id();
273 while (
id != thePxDets.
id(
i)) {
276 throw "we have a problem!!!!";
288 <<
"input pixel clusters collection " <<
labels.module <<
" is not valid";
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()
◆ updateStrips()
void MeasurementTrackerEventProducer::updateStrips |
( |
const edm::Event & |
event, |
|
|
StMeasurementDetSet & |
theStDets, |
|
|
std::vector< bool > & |
stripClustersToSkip |
|
) |
| const |
|
protected |
Definition at line 293 of file MeasurementTrackerEventProducer.cc.
298 std::vector<uint32_t> rawInactiveDetIds;
308 const int endDet = theStDets.
size();
312 unsigned int idp = 0;
313 for (
auto id : rawInactiveDetIds) {
317 i = theStDets.
find(
id,
i);
331 LogDebug(
"MeasurementTracker") <<
"getting strp refs to skip";
334 edm::LogError(
"MeasurementTracker") <<
"not getting the strip clusters to skip";
335 if (stripClusterMask->refProd().
id() != clusterHandle.
id()) {
337 <<
"The strip masking does not point to the proper collection of clusters: "
338 << stripClusterMask->refProd().
id() <<
"!=" << clusterHandle.
id();
340 stripClusterMask->copyMaskTo(stripClustersToSkip);
343 theStDets.
handle() = clusterHandle;
346 for (
auto j = 0
U;
j < (*clusterCollection).size(); ++
j) {
347 unsigned int id = (*clusterCollection).id(
j);
348 while (
id != theStDets.
id(
i)) {
351 throw "we have a problem in strips!!!!";
362 <<
"input strip cluster collection " <<
labels.module <<
" is not valid";
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().
◆ isPhase2_
bool MeasurementTrackerEventProducer::isPhase2_ |
|
protected |
◆ measurementTrackerLabel_
std::string MeasurementTrackerEventProducer::measurementTrackerLabel_ |
|
protected |
◆ pixelCablingMapLabel_
std::string MeasurementTrackerEventProducer::pixelCablingMapLabel_ |
|
protected |
◆ selfUpdateSkipClusters_
bool MeasurementTrackerEventProducer::selfUpdateSkipClusters_ |
|
protected |
◆ switchOffPixelsIfEmpty_
bool MeasurementTrackerEventProducer::switchOffPixelsIfEmpty_ |
|
protected |
◆ theBadPixelFEDChannelsLabels
◆ theInactivePixelDetectorLabels
◆ theInactiveStripDetectorLabels
◆ thePh2OTClusterLabel
◆ thePh2OTVectorHitsLabel
◆ thePh2OTVectorHitsRejLabel
◆ thePixelClusterLabel
◆ thePixelClusterMask
◆ theStripClusterLabel
◆ theStripClusterMask
◆ useVectorHits_
bool MeasurementTrackerEventProducer::useVectorHits_ |
|
protected |
const TrackerGeomDet * idToDet(DetId) const override
const_iterator begin() const
edm::EDGetTokenT< edm::ContainerMask< edmNew::DetSetVector< SiStripCluster > > > theStripClusterMask
edm::EDGetTokenT< edmNew::DetSetVector< Phase2TrackerCluster1D > > thePh2OTClusterLabel
T const * product() const
std::vector< edm::EDGetTokenT< DetIdCollection > > theInactivePixelDetectorLabels
void update(int i, const PixelDetSet &detSet)
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
void setActiveThisEvent(bool active)
int find(unsigned int jd, int i=0) const
constexpr bool isUninitialized() const noexcept
const_iterator begin(bool update=false) const
edm::EDGetTokenT< VectorHitCollection > thePh2OTVectorHitsLabel
void update(int i, const Phase2DetSet &detSet)
Log< level::Warning, false > LogWarning
identify pixel inside single ROC
unsigned int id(int i) const
global coordinates (row and column in DetUnit, as in PixelDigi)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void updateStrips(const edm::Event &, StMeasurementDetSet &theStDets, std::vector< bool > &stripClustersToSkip) const
const CaloTopology * topology(nullptr)
edm::EDGetTokenT< edm::ContainerMask< edmNew::DetSetVector< SiPixelCluster > > > thePixelClusterMask
std::vector< edm::EDGetTokenT< DetIdCollection > > theInactiveStripDetectorLabels
const edm::Handle< edmNew::DetSetVector< SiPixelCluster > > & handle() const
const edm::Handle< edmNew::DetSetVector< Phase2TrackerCluster1D > > & handle() const
uint32_t rawId() const
return the DetUnit to which this ROC belongs to.
unsigned int id(int i) const
size_type dataSize() const
Measurement2DPoint MeasurementPoint
Measurement points are two-dimensional by default.
std::string measurementTrackerLabel_
std::vector< std::pair< LocalPoint, LocalPoint > > BadFEDChannelPositions
virtual const PixelTopology & specificTopology() const
Returns a reference to the pixel proxy topology.
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
std::string pixelCablingMapLabel_
GlobalPixel toGlobal(const LocalPixel &loc) const
Log< level::Error, false > LogError
int find(unsigned int jd, int i=0) const
void addBadFEDChannelPositions(int i, BadFEDChannelPositions &positions)
std::vector< edm::EDGetTokenT< PixelFEDChannelCollection > > theBadPixelFEDChannelsLabels
edm::EDGetTokenT< edmNew::DetSetVector< SiPixelCluster > > thePixelClusterLabel
edm::Handle< edmNew::DetSetVector< SiStripCluster > > & handle()
edm::EDGetTokenT< edmNew::DetSetVector< SiStripCluster > > theStripClusterLabel
bool isActive(int i) const
void updatePhase2OT(const edm::Event &, Phase2OTMeasurementDetSet &thePh2OTDets) const
row and collumn in ROC representation
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 ...
bool isActive(int i) const
const_iterator end(bool update=false) const
edm::EDGetTokenT< VectorHitCollection > thePh2OTVectorHitsRejLabel
unsigned int id(int i) const
T getParameter(std::string const &) const
bool isActive(int i) const
void setActiveThisEvent(bool active)
void update(int i, const StripDetset &detSet)
void getInactiveStrips(const edm::Event &event, std::vector< uint32_t > &rawInactiveDetIds) const
const sipixelobjects::PixelROC * findItem(const sipixelobjects::CablingPathToDetUnit &path) const final
const_iterator end() const
bool switchOffPixelsIfEmpty_
bool selfUpdateSkipClusters_