CMS 3D CMS Logo

SiPixelDigiErrorsFromSoA.cc
Go to the documentation of this file.
1 #include <memory>
2 
23 
25 public:
26  explicit SiPixelDigiErrorsFromSoA(const edm::ParameterSet& iConfig);
27  ~SiPixelDigiErrorsFromSoA() override = default;
28 
29  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
30 
31 private:
32  void produce(edm::Event& iEvent, const edm::EventSetup& iSetup) override;
33 
40 
42  std::unique_ptr<SiPixelFedCablingTree> cabling_;
43 
44  const std::vector<int> tkerrorlist_;
45  const std::vector<int> usererrorlist_;
46 
47  const bool usePhase1_;
48 };
49 
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")) {}
60 
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 }
73 
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  formatter.unpackFEDErrors(errors,
108  tkerrorlist_,
110  errorcollection,
111  tkerror_detidcollection,
112  usererror_detidcollection,
113  disabled_channelcollection,
114  nodeterrors);
115 
116  const uint32_t dummydetid = 0xffffffff;
117  edm::DetSet<SiPixelRawDataError>& errorDetSet = errorcollection.find_or_insert(dummydetid);
118  errorDetSet.data = nodeterrors;
119 
120  iEvent.emplace(errorPutToken_, std::move(errorcollection));
121  iEvent.emplace(tkErrorPutToken_, std::move(tkerror_detidcollection));
122  iEvent.emplace(userErrorPutToken_, std::move(usererror_detidcollection));
123  iEvent.emplace(disabledChannelPutToken_, std::move(disabled_channelcollection));
124 }
125 
ConfigurationDescriptions.h
edm::ESWatcher::check
bool check(const edm::EventSetup &iSetup)
Definition: ESWatcher.h:57
FEDNumbering.h
edm::DetSetVector
Definition: DetSetVector.h:61
SiPixelDigiErrorsFromSoA::userErrorPutToken_
const edm::EDPutTokenT< DetIdCollection > userErrorPutToken_
Definition: SiPixelDigiErrorsFromSoA.cc:38
Handle.h
SiPixelDigiErrorsFromSoA::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: SiPixelDigiErrorsFromSoA.cc:61
mps_fire.i
i
Definition: mps_fire.py:428
ESTransientHandle.h
SiPixelRawDataError
Pixel error – collection of errors and error information.
Definition: SiPixelRawDataError.h:19
edm::ESWatcher< SiPixelFedCablingMapRcd >
SiPixelDigiErrorsFromSoA::cablingToken_
const edm::ESGetToken< SiPixelFedCablingMap, SiPixelFedCablingMapRcd > cablingToken_
Definition: SiPixelDigiErrorsFromSoA.cc:34
ESInputTag
edm::DetSet
Definition: DetSet.h:23
PixelDataFormatter::Errors
std::map< cms_uint32_t, DetErrors > Errors
Definition: PixelDataFormatter.h:64
edm::EDGetTokenT< SiPixelErrorsSoA >
FEDNumbering::MINSiPixeluTCAFEDID
Definition: FEDNumbering.h:105
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::EDPutTokenT
Definition: EDPutToken.h:33
PixelDataFormatter::DetErrors
std::vector< SiPixelRawDataError > DetErrors
Definition: PixelDataFormatter.h:63
PixelFEDChannel.h
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89301
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)
EDProducer.h
SiPixelFedCablingMap.h
PixelDigi.h
SiPixelFedCablingTree.h
relativeConstraints.error
error
Definition: relativeConstraints.py:53
SiPixelDigiErrorsFromSoA::produce
void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) override
Definition: SiPixelDigiErrorsFromSoA.cc:74
PixelDataFormatter
Definition: PixelDataFormatter.h:61
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
MakerMacros.h
SiPixelDigiErrorsFromSoA::disabledChannelPutToken_
const edm::EDPutTokenT< edmNew::DetSetVector< PixelFEDChannel > > disabledChannelPutToken_
Definition: SiPixelDigiErrorsFromSoA.cc:39
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
errors
Definition: errors.py:1
SiPixelDigiErrorsFromSoA::cablingWatcher_
edm::ESWatcher< SiPixelFedCablingMapRcd > cablingWatcher_
Definition: SiPixelDigiErrorsFromSoA.cc:41
ParameterSetDescription.h
SiPixelDigiErrorsFromSoA::~SiPixelDigiErrorsFromSoA
~SiPixelDigiErrorsFromSoA() override=default
mitigatedMETSequence_cff.U
U
Definition: mitigatedMETSequence_cff.py:36
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
SiPixelFedCablingMap::cablingTree
std::unique_ptr< SiPixelFedCablingTree > cablingTree() const
Definition: SiPixelFedCablingMap.cc:103
SiPixelDigiErrorsFromSoA::SiPixelDigiErrorsFromSoA
SiPixelDigiErrorsFromSoA(const edm::ParameterSet &iConfig)
Definition: SiPixelDigiErrorsFromSoA.cc:50
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:233
edm::ParameterSet
Definition: ParameterSet.h:47
Event.h
SiPixelFedCablingMapRcd.h
postprocess-scan-build.formatter
formatter
Definition: postprocess-scan-build.py:49
iEvent
int iEvent
Definition: GenABIO.cc:224
edm::stream::EDProducer
Definition: EDProducer.h:36
edm::EventSetup
Definition: EventSetup.h:58
DetSetVector.h
submitPVResolutionJobs.err
err
Definition: submitPVResolutionJobs.py:85
SiPixelDigiErrorsFromSoA
Definition: SiPixelDigiErrorsFromSoA.cc:24
edm::EDCollection
Definition: EDCollection.h:16
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ESGetToken< SiPixelFedCablingMap, SiPixelFedCablingMapRcd >
SiPixelFedCablingMap
Definition: SiPixelFedCablingMap.h:19
edm::EventSetup::getData
bool getData(T &iHolder) const
Definition: EventSetup.h:127
edmNew::DetSetVector
Definition: DetSetNew.h:13
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
PixelDataFormatter.h
eostools.move
def move(src, dest)
Definition: eostools.py:511
std
Definition: JetResolutionObject.h:76
ESWatcher.h
SiPixelErrorsSoA.h
SiPixelDigiErrorsFromSoA::errorPutToken_
const edm::EDPutTokenT< edm::DetSetVector< SiPixelRawDataError > > errorPutToken_
Definition: SiPixelDigiErrorsFromSoA.cc:36
edm::DetSet::data
collection_type data
Definition: DetSet.h:80
EventSetup.h
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
ParameterSet.h
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
edm::Event
Definition: Event.h:73
SiPixelDigiErrorsFromSoA::usererrorlist_
const std::vector< int > usererrorlist_
Definition: SiPixelDigiErrorsFromSoA.cc:45
edm::InputTag
Definition: InputTag.h:15
DetIdCollection.h
edm::ConfigurationDescriptions::addWithDefaultLabel
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:87
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443