|
|
#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)
64 produces<MeasurementTrackerEvent>();
References edm::ParameterSet::getParameter(), HLT_2018_cff::InputTag, isPhase2, LogDebug, pixelCablingMapLabel_, selfUpdateSkipClusters_, optionsL1T::skip, AlCaHLTBitMon_QueryRunRegistry::string, OrderedSet::t, theBadPixelFEDChannelsLabels, theInactivePixelDetectorLabels, theInactiveStripDetectorLabels, thePh2OTClusterLabel, thePixelClusterLabel, thePixelClusterMask, theStripClusterLabel, and theStripClusterMask.
◆ ~MeasurementTrackerEventProducer()
MeasurementTrackerEventProducer::~MeasurementTrackerEventProducer |
( |
| ) |
|
|
inlineoverride |
◆ fillDescriptions()
Definition at line 67 of file MeasurementTrackerEventProducer.cc.
76 desc.
add<std::vector<edm::InputTag>>(
"inactivePixelDetectorLabels",
78 ->setComment(
"One or more DetIdCollections of modules to mask on the fly for a given event");
79 desc.
add<std::vector<edm::InputTag>>(
"badPixelFEDChannelCollectionLabels", std::vector<edm::InputTag>())
80 ->setComment(
"One or more PixelFEDChannelCollections of modules+ROCs to mask on the fly for a given event");
83 desc.
add<std::vector<edm::InputTag>>(
"inactiveStripDetectorLabels",
85 ->setComment(
"One or more DetIdCollections of modules to mask on the fly for a given event");
87 desc.
add<
bool>(
"switchOffPixelsIfEmpty",
true)->setComment(
"let's keep it like this, for cosmics");
89 descriptions.
add(
"measurementTrackerEventDefault", desc);
References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), HLT_2018_cff::InputTag, and AlCaHLTBitMon_QueryRunRegistry::string.
◆ getInactiveStrips()
void MeasurementTrackerEventProducer::getInactiveStrips |
( |
const edm::Event & |
event, |
|
|
std::vector< uint32_t > & |
rawInactiveDetIds |
|
) |
| const |
|
protected |
◆ produce()
◆ updatePhase2OT()
Definition at line 351 of file MeasurementTrackerEventProducer.cc.
362 int i = 0, endDet = thePh2OTDets.
size();
364 ed = phase2OTCollection->
end();
368 unsigned int id = set.id();
369 while (
id != thePh2OTDets.
id(
i)) {
372 throw "we have a problem!!!!";
383 <<
"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, highPtTripletStepClusters_cfi::phase2OTClusters, Phase2OTMeasurementDetSet::setActiveThisEvent(), Phase2OTMeasurementDetSet::size(), thePh2OTClusterLabel, and Phase2OTMeasurementDetSet::update().
Referenced by produce().
◆ updatePixels()
Definition at line 124 of file MeasurementTrackerEventProducer.cc.
132 std::vector<uint32_t> rawInactiveDetIds;
136 if (
event.getByToken(tk, detIds)) {
137 rawInactiveDetIds.insert(rawInactiveDetIds.end(), detIds->
begin(), detIds->
end());
139 static std::atomic<bool> iFailedAlready{
false};
140 bool expected =
false;
141 if (iFailedAlready.compare_exchange_strong(expected,
true, std::memory_order_acq_rel)) {
143 <<
"I fail to get the list of inactive pixel modules, because of 4.2/4.4 event content change.";
147 if (!rawInactiveDetIds.empty())
148 std::sort(rawInactiveDetIds.begin(), rawInactiveDetIds.end());
150 int i = 0, endDet = thePxDets.
size();
151 unsigned int idp = 0;
152 for (
auto id : rawInactiveDetIds) {
156 i = thePxDets.
find(
id,
i);
168 if (!
event.getByToken(tk, pixelFEDChannelCollectionHandle))
171 for (
const auto& disabledChannels : *pixelFEDChannelCollectionHandle) {
173 for (
const auto& ch : disabledChannels) {
179 for (
path.roc = 1;
path.roc <= (ch.roc_last - ch.roc_first) + 1;
path.roc++) {
183 assert(
roc->rawId() == disabledChannels.detId());
184 if (
roc->idInDetUnit() == ch.roc_first)
186 if (
roc->idInDetUnit() == ch.roc_last)
189 if (roc_first ==
nullptr || roc_last ==
nullptr) {
191 <<
"Do not find either roc_first or roc_last in the cabling map.";
195 dynamic_cast<const PixelGeomDetUnit*>(trackerGeom.
idToDet(roc_first->
rawId()));
205 positions.push_back(std::make_pair(ll, ur));
207 if (!positions.empty()) {
208 i = thePxDets.
find(disabledChannels.detId(),
i);
209 assert(
i != thePxDets.
size() && thePxDets.
id(
i) == disabledChannels.detId());
230 pixelClustersToSkip.resize(pixelCollection->
dataSize());
231 std::fill(pixelClustersToSkip.begin(), pixelClustersToSkip.end(),
false);
237 LogDebug(
"MeasurementTracker") <<
"getting pxl refs to skip";
239 edm::LogError(
"MeasurementTracker") <<
"not getting the pixel clusters to skip";
242 <<
"The pixel masking does not point to the proper collection of clusters: "
245 pixelClusterMask->copyMaskTo(pixelClustersToSkip);
249 int i = 0, endDet = thePxDets.
size();
251 ed = pixelCollection->
end();
255 unsigned int id = set.id();
256 while (
id != thePxDets.
id(
i)) {
259 throw "we have a problem!!!!";
271 <<
"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 276 of file MeasurementTrackerEventProducer.cc.
281 std::vector<uint32_t> rawInactiveDetIds;
291 const int endDet = theStDets.
size();
295 unsigned int idp = 0;
296 for (
auto id : rawInactiveDetIds) {
300 i = theStDets.
find(
id,
i);
314 LogDebug(
"MeasurementTracker") <<
"getting strp refs to skip";
317 edm::LogError(
"MeasurementTracker") <<
"not getting the strip clusters to skip";
318 if (stripClusterMask->refProd().
id() != clusterHandle.
id()) {
320 <<
"The strip masking does not point to the proper collection of clusters: "
321 << stripClusterMask->refProd().
id() <<
"!=" << clusterHandle.
id();
323 stripClusterMask->copyMaskTo(stripClustersToSkip);
326 theStDets.
handle() = clusterHandle;
329 for (
auto j = 0
U;
j < (*clusterCollection).size(); ++
j) {
330 unsigned int id = (*clusterCollection).id(
j);
331 while (
id != theStDets.
id(
i)) {
334 throw "we have a problem in strips!!!!";
345 <<
"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
◆ thePixelClusterLabel
◆ thePixelClusterMask
◆ theStripClusterLabel
◆ theStripClusterMask
const TrackerGeomDet * idToDet(DetId) const override
const_iterator begin() const
ParameterDescriptionBase * add(U const &iLabel, T const &value)
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
const_iterator begin(bool update=false) const
void update(int i, const Phase2DetSet &detSet)
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
bool isUninitialized() const
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
int find(unsigned int jd, int i=0) const
void addBadFEDChannelPositions(int i, BadFEDChannelPositions &positions)
std::vector< edm::EDGetTokenT< PixelFEDChannelCollection > > theBadPixelFEDChannelsLabels
T getParameter(std::string const &) const
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
unsigned int id(int i) 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_