CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
SiPixelDigiErrorsFromSoA Class Reference
Inheritance diagram for SiPixelDigiErrorsFromSoA:
edm::stream::EDProducer<>

Public Member Functions

 SiPixelDigiErrorsFromSoA (const edm::ParameterSet &iConfig)
 
 ~SiPixelDigiErrorsFromSoA () override=default
 
- 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)
 

Private Member Functions

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

Private Attributes

std::unique_ptr< SiPixelFedCablingTreecabling_
 
const edm::ESGetToken< SiPixelFedCablingMap, SiPixelFedCablingMapRcdcablingToken_
 
edm::ESWatcher< SiPixelFedCablingMapRcdcablingWatcher_
 
const edm::EDGetTokenT< SiPixelErrorsSoAdigiErrorSoAGetToken_
 
const edm::EDPutTokenT< edmNew::DetSetVector< PixelFEDChannel > > disabledChannelPutToken_
 
const edm::EDPutTokenT< edm::DetSetVector< SiPixelRawDataError > > errorPutToken_
 
const std::vector< int > tkerrorlist_
 
const edm::EDPutTokenT< DetIdCollectiontkErrorPutToken_
 
const bool usePhase1_
 
const std::vector< int > usererrorlist_
 
const edm::EDPutTokenT< DetIdCollectionuserErrorPutToken_
 

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 24 of file SiPixelDigiErrorsFromSoA.cc.

Constructor & Destructor Documentation

◆ SiPixelDigiErrorsFromSoA()

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

Definition at line 50 of file SiPixelDigiErrorsFromSoA.cc.

51  : cablingToken_(esConsumes(edm::ESInputTag("", iConfig.getParameter<std::string>("CablingMapLabel")))),
52  digiErrorSoAGetToken_{consumes<SiPixelErrorsSoA>(iConfig.getParameter<edm::InputTag>("digiErrorSoASrc"))},
53  errorPutToken_{produces<edm::DetSetVector<SiPixelRawDataError>>()},
54  tkErrorPutToken_{produces<DetIdCollection>()},
55  userErrorPutToken_{produces<DetIdCollection>("UserErrorModules")},
56  disabledChannelPutToken_{produces<edmNew::DetSetVector<PixelFEDChannel>>()},
57  tkerrorlist_(iConfig.getParameter<std::vector<int>>("ErrorList")),
58  usererrorlist_(iConfig.getParameter<std::vector<int>>("UserErrorList")),
59  usePhase1_(iConfig.getParameter<bool>("UsePhase1")) {}

References edm::ParameterSet::getParameter().

◆ ~SiPixelDigiErrorsFromSoA()

SiPixelDigiErrorsFromSoA::~SiPixelDigiErrorsFromSoA ( )
overridedefault

Member Function Documentation

◆ fillDescriptions()

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

Definition at line 61 of file SiPixelDigiErrorsFromSoA.cc.

61  {
63  desc.add<edm::InputTag>("digiErrorSoASrc", edm::InputTag("siPixelDigiErrorsSoA"));
64  // the configuration parameters here are named following those in SiPixelRawToDigi
65  desc.add<std::string>("CablingMapLabel", "")->setComment("CablingMap label");
66  desc.add<bool>("UsePhase1", false)->setComment("## Use phase1");
67  desc.add<std::vector<int>>("ErrorList", std::vector<int>{29})
68  ->setComment("## ErrorList: list of error codes used by tracking to invalidate modules");
69  desc.add<std::vector<int>>("UserErrorList", std::vector<int>{40})
70  ->setComment("## UserErrorList: list of error codes used by Pixel experts for investigation");
71  descriptions.addWithDefaultLabel(desc);
72 }

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

◆ produce()

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

Definition at line 74 of file SiPixelDigiErrorsFromSoA.cc.

74  {
75  // pack errors into collection
76 
77  // initialize cabling map or update if necessary
78  if (cablingWatcher_.check(iSetup)) {
79  // cabling map, which maps online address (fed->link->ROC->local pixel) to offline (DetId->global pixel)
80  const SiPixelFedCablingMap* cablingMap = &iSetup.getData(cablingToken_);
81  cabling_ = cablingMap->cablingTree();
82  LogDebug("map version:") << cabling_->version();
83  }
84 
85  const auto& digiErrors = iEvent.get(digiErrorSoAGetToken_);
86 
88  DetIdCollection tkerror_detidcollection{};
89  DetIdCollection usererror_detidcollection{};
90  edmNew::DetSetVector<PixelFEDChannel> disabled_channelcollection{};
91 
92  PixelDataFormatter formatter(cabling_.get(), usePhase1_); // for phase 1 & 0
93  const PixelDataFormatter::Errors* formatterErrors = digiErrors.formatterErrors();
94  assert(formatterErrors != nullptr);
95  auto errors = *formatterErrors; // make a copy
97 
98  auto size = digiErrors.size();
99  for (auto i = 0U; i < size; i++) {
100  SiPixelErrorCompact err = digiErrors.error(i);
101  if (err.errorType != 0) {
103  errors[err.rawId].push_back(error);
104  }
105  }
106 
107  constexpr uint32_t dummydetid = 0xffffffff;
108  typedef PixelDataFormatter::Errors::iterator IE;
109  for (auto& error : errors) {
110  uint32_t errordetid = error.first;
111  if (errordetid == dummydetid) { // errors given dummy detId must be sorted by Fed
112  nodeterrors.insert(nodeterrors.end(), errors[errordetid].begin(), errors[errordetid].end());
113  } else {
114  edm::DetSet<SiPixelRawDataError>& errorDetSet = errorcollection.find_or_insert(errordetid);
115  errorDetSet.data.insert(errorDetSet.data.end(), error.second.begin(), error.second.end());
116  // Fill detid of the detectors where there is error AND the error number is listed
117  // in the configurable error list in the job option cfi.
118  // Code needs to be here, because there can be a set of errors for each
119  // entry in the for loop over PixelDataFormatter::Errors
120 
121  std::vector<PixelFEDChannel> disabledChannelsDetSet;
122 
123  for (auto const& aPixelError : errorDetSet) {
124  // For the time being, we extend the error handling functionality with ErrorType 25
125  // In the future, we should sort out how the usage of tkerrorlist can be generalized
126  if (aPixelError.getType() == 25) {
127  int fedId = aPixelError.getFedId();
129  if (fed) {
130  cms_uint32_t linkId = formatter.linkId(aPixelError.getWord32());
131  const sipixelobjects::PixelFEDLink* link = fed->link(linkId);
132  if (link) {
133  // The "offline" 0..15 numbering is fixed by definition, also, the FrameConversion depends on it
134  // in contrast, the ROC-in-channel numbering is determined by hardware --> better to use the "offline" scheme
135  PixelFEDChannel ch = {fed->id(), linkId, 25, 0};
136  for (unsigned int iRoc = 1; iRoc <= link->numberOfROCs(); iRoc++) {
137  const sipixelobjects::PixelROC* roc = link->roc(iRoc);
138  if (roc->idInDetUnit() < ch.roc_first)
139  ch.roc_first = roc->idInDetUnit();
140  if (roc->idInDetUnit() > ch.roc_last)
141  ch.roc_last = roc->idInDetUnit();
142  }
143  disabledChannelsDetSet.push_back(ch);
144  }
145  }
146  } else {
147  // fill list of detIds to be turned off by tracking
148  if (!tkerrorlist_.empty()) {
149  auto it_find = std::find(tkerrorlist_.begin(), tkerrorlist_.end(), aPixelError.getType());
150  if (it_find != tkerrorlist_.end()) {
151  tkerror_detidcollection.push_back(errordetid);
152  }
153  }
154  }
155 
156  // fill list of detIds with errors to be studied
157  if (!usererrorlist_.empty()) {
158  auto it_find = std::find(usererrorlist_.begin(), usererrorlist_.end(), aPixelError.getType());
159  if (it_find != usererrorlist_.end()) {
160  usererror_detidcollection.push_back(errordetid);
161  }
162  }
163 
164  } // loop on DetSet of errors
165 
166  if (!disabledChannelsDetSet.empty()) {
167  disabled_channelcollection.insert(errordetid, disabledChannelsDetSet.data(), disabledChannelsDetSet.size());
168  }
169 
170  } // if error assigned to a real DetId
171  } // loop on errors in event for this FED
172 
173  edm::DetSet<SiPixelRawDataError>& errorDetSet = errorcollection.find_or_insert(dummydetid);
174  errorDetSet.data = nodeterrors;
175 
176  iEvent.emplace(errorPutToken_, std::move(errorcollection));
177  iEvent.emplace(tkErrorPutToken_, std::move(tkerror_detidcollection));
178  iEvent.emplace(userErrorPutToken_, std::move(usererror_detidcollection));
179  iEvent.emplace(disabledChannelPutToken_, std::move(disabled_channelcollection));
180 }

References cms::cuda::assert(), cabling_, cablingToken_, SiPixelFedCablingMap::cablingTree(), cablingWatcher_, edm::ESWatcher< T >::check(), edm::DetSet< T >::data, digiErrorSoAGetToken_, disabledChannelPutToken_, submitPVResolutionJobs::err, relativeConstraints::error, errorPutToken_, l1tstage2_dqm_sourceclient-live_cfg::fedId, spr::find(), edm::EventSetup::getData(), mps_fire::i, sipixelobjects::PixelFEDCabling::id(), iEvent, sipixelobjects::PixelFEDCabling::link(), MainPageGenerator::link, LogDebug, FEDNumbering::MINSiPixeluTCAFEDID, eostools::move(), PixelMapPlotter::roc, PixelFEDChannel::roc_first, PixelFEDChannel::roc_last, findQualityFiles::size, tkerrorlist_, tkErrorPutToken_, mitigatedMETSequence_cff::U, usePhase1_, usererrorlist_, and userErrorPutToken_.

Member Data Documentation

◆ cabling_

std::unique_ptr<SiPixelFedCablingTree> SiPixelDigiErrorsFromSoA::cabling_
private

Definition at line 42 of file SiPixelDigiErrorsFromSoA.cc.

Referenced by produce().

◆ cablingToken_

const edm::ESGetToken<SiPixelFedCablingMap, SiPixelFedCablingMapRcd> SiPixelDigiErrorsFromSoA::cablingToken_
private

Definition at line 34 of file SiPixelDigiErrorsFromSoA.cc.

Referenced by produce().

◆ cablingWatcher_

edm::ESWatcher<SiPixelFedCablingMapRcd> SiPixelDigiErrorsFromSoA::cablingWatcher_
private

Definition at line 41 of file SiPixelDigiErrorsFromSoA.cc.

Referenced by produce().

◆ digiErrorSoAGetToken_

const edm::EDGetTokenT<SiPixelErrorsSoA> SiPixelDigiErrorsFromSoA::digiErrorSoAGetToken_
private

Definition at line 35 of file SiPixelDigiErrorsFromSoA.cc.

Referenced by produce().

◆ disabledChannelPutToken_

const edm::EDPutTokenT<edmNew::DetSetVector<PixelFEDChannel> > SiPixelDigiErrorsFromSoA::disabledChannelPutToken_
private

Definition at line 39 of file SiPixelDigiErrorsFromSoA.cc.

Referenced by produce().

◆ errorPutToken_

const edm::EDPutTokenT<edm::DetSetVector<SiPixelRawDataError> > SiPixelDigiErrorsFromSoA::errorPutToken_
private

Definition at line 36 of file SiPixelDigiErrorsFromSoA.cc.

Referenced by produce().

◆ tkerrorlist_

const std::vector<int> SiPixelDigiErrorsFromSoA::tkerrorlist_
private

Definition at line 44 of file SiPixelDigiErrorsFromSoA.cc.

Referenced by produce().

◆ tkErrorPutToken_

const edm::EDPutTokenT<DetIdCollection> SiPixelDigiErrorsFromSoA::tkErrorPutToken_
private

Definition at line 37 of file SiPixelDigiErrorsFromSoA.cc.

Referenced by produce().

◆ usePhase1_

const bool SiPixelDigiErrorsFromSoA::usePhase1_
private

Definition at line 47 of file SiPixelDigiErrorsFromSoA.cc.

Referenced by produce().

◆ usererrorlist_

const std::vector<int> SiPixelDigiErrorsFromSoA::usererrorlist_
private

Definition at line 45 of file SiPixelDigiErrorsFromSoA.cc.

Referenced by produce().

◆ userErrorPutToken_

const edm::EDPutTokenT<DetIdCollection> SiPixelDigiErrorsFromSoA::userErrorPutToken_
private

Definition at line 38 of file SiPixelDigiErrorsFromSoA.cc.

Referenced by produce().

sipixelobjects::PixelFEDCabling::id
unsigned int id() const
Definition: PixelFEDCabling.h:34
edm::ESWatcher::check
bool check(const edm::EventSetup &iSetup)
Definition: ESWatcher.h:52
edm::DetSetVector
Definition: DetSetVector.h:61
cms_uint32_t
unsigned int cms_uint32_t
Definition: typedefs.h:15
sipixelobjects::PixelFEDCabling::link
const PixelFEDLink * link(unsigned int id) const
return link identified by id. Link id's are ranged [1, numberOfLinks]
Definition: PixelFEDCabling.h:27
SiPixelDigiErrorsFromSoA::userErrorPutToken_
const edm::EDPutTokenT< DetIdCollection > userErrorPutToken_
Definition: SiPixelDigiErrorsFromSoA.cc:38
mps_fire.i
i
Definition: mps_fire.py:428
edm::ESInputTag
Definition: ESInputTag.h:87
PixelFEDChannel
Definition: PixelFEDChannel.h:6
MainPageGenerator.link
link
Definition: MainPageGenerator.py:271
SiPixelRawDataError
Pixel error – collection of errors and error information.
Definition: SiPixelRawDataError.h:19
SiPixelDigiErrorsFromSoA::cablingToken_
const edm::ESGetToken< SiPixelFedCablingMap, SiPixelFedCablingMapRcd > cablingToken_
Definition: SiPixelDigiErrorsFromSoA.cc:34
edm::DetSet
Definition: DetSet.h:23
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89285
sipixelobjects::PixelFEDCabling
Definition: PixelFEDCabling.h:16
SiPixelDigiErrorsFromSoA::tkErrorPutToken_
const edm::EDPutTokenT< DetIdCollection > tkErrorPutToken_
Definition: SiPixelDigiErrorsFromSoA.cc:37
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
SiPixelDigiErrorsFromSoA::cabling_
std::unique_ptr< SiPixelFedCablingTree > cabling_
Definition: SiPixelDigiErrorsFromSoA.cc:42
cms::cuda::assert
assert(be >=bs)
spr::find
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
relativeConstraints.error
error
Definition: relativeConstraints.py:53
PixelDataFormatter
Definition: PixelDataFormatter.h:57
SiPixelDigiErrorsFromSoA::usePhase1_
const bool usePhase1_
Definition: SiPixelDigiErrorsFromSoA.cc:47
SiPixelDigiErrorsFromSoA::tkerrorlist_
const std::vector< int > tkerrorlist_
Definition: SiPixelDigiErrorsFromSoA.cc:44
SiPixelErrorCompact
Definition: SiPixelErrorCompact.h:6
SiPixelDigiErrorsFromSoA::disabledChannelPutToken_
const edm::EDPutTokenT< edmNew::DetSetVector< PixelFEDChannel > > disabledChannelPutToken_
Definition: SiPixelDigiErrorsFromSoA.cc:39
errors
Definition: errors.py:1
SiPixelDigiErrorsFromSoA::cablingWatcher_
edm::ESWatcher< SiPixelFedCablingMapRcd > cablingWatcher_
Definition: SiPixelDigiErrorsFromSoA.cc:41
mitigatedMETSequence_cff.U
U
Definition: mitigatedMETSequence_cff.py:36
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
SiPixelFedCablingMap::cablingTree
std::unique_ptr< SiPixelFedCablingTree > cablingTree() const
Definition: SiPixelFedCablingMap.cc:103
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:233
PixelDataFormatter::DetErrors
std::vector< SiPixelRawDataError > DetErrors
Definition: PixelDataFormatter.h:65
iEvent
int iEvent
Definition: GenABIO.cc:224
l1tstage2_dqm_sourceclient-live_cfg.fedId
fedId
Definition: l1tstage2_dqm_sourceclient-live_cfg.py:88
submitPVResolutionJobs.err
err
Definition: submitPVResolutionJobs.py:85
edm::EDCollection< DetId >
SiPixelFedCablingMap
Definition: SiPixelFedCablingMap.h:19
edm::EventSetup::getData
bool getData(T &iHolder) const
Definition: EventSetup.h:127
FEDNumbering::MINSiPixeluTCAFEDID
Definition: FEDNumbering.h:105
sipixelobjects::PixelROC
Definition: PixelROC.h:23
edmNew::DetSetVector
Definition: DetSetNew.h:13
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
eostools.move
def move(src, dest)
Definition: eostools.py:511
PixelFEDChannel::roc_last
unsigned int roc_last
Definition: PixelFEDChannel.h:7
PixelMapPlotter.roc
roc
Definition: PixelMapPlotter.py:498
SiPixelDigiErrorsFromSoA::errorPutToken_
const edm::EDPutTokenT< edm::DetSetVector< SiPixelRawDataError > > errorPutToken_
Definition: SiPixelDigiErrorsFromSoA.cc:36
edm::DetSet::data
collection_type data
Definition: DetSet.h:80
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
SiPixelDigiErrorsFromSoA::digiErrorSoAGetToken_
const edm::EDGetTokenT< SiPixelErrorsSoA > digiErrorSoAGetToken_
Definition: SiPixelDigiErrorsFromSoA.cc:35
DeDxTools::esConsumes
ESGetTokenH3DDVariant esConsumes(std::string const &Reccord, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
SiPixelDigiErrorsFromSoA::usererrorlist_
const std::vector< int > usererrorlist_
Definition: SiPixelDigiErrorsFromSoA.cc:45
edm::InputTag
Definition: InputTag.h:15
PixelFEDChannel::roc_first
unsigned int roc_first
Definition: PixelFEDChannel.h:7
edm::ConfigurationDescriptions::addWithDefaultLabel
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:87
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443
PixelDataFormatter::Errors
std::map< cms_uint32_t, DetErrors > Errors
Definition: PixelDataFormatter.h:66