46 : config_(conf), badPixelInfo_(nullptr), regions_(nullptr), hCPU(nullptr), hDigi(nullptr) {
60 produces<edm::DetSetVector<PixelDigi>>();
62 produces<edm::DetSetVector<SiPixelRawDataError>>();
63 produces<DetIdCollection>();
64 produces<DetIdCollection>(
"UserErrorModules");
65 produces<edmNew::DetSetVector<PixelFEDChannel>>();
77 hCPU =
new TH1D(
"hCPU",
"hCPU", 100, 0., 0.050);
78 hDigi =
new TH1D(
"hDigi",
"hDigi", 50, 0., 15000.);
84 edm::LogInfo(
"SiPixelRawToDigi") <<
" Use pilot blade data (FED 40)";
97 edm::LogInfo(
"SiPixelRawToDigi") <<
" HERE ** SiPixelRawToDigi destructor!";
103 TFile
rootFile(
"analysis.root",
"RECREATE",
"my histograms");
111 desc.
add<
bool>(
"IncludeErrors",
true);
112 desc.
add<
bool>(
"UseQualityInfo",
false);
114 std::vector<int> temp1;
117 desc.
add<std::vector<int>>(
"ErrorList", temp1)
118 ->setComment(
"## ErrorList: list of error codes used by tracking to invalidate modules");
121 std::vector<int> temp1;
124 desc.
add<std::vector<int>>(
"UserErrorList", temp1)
125 ->setComment(
"## UserErrorList: list of error codes used by Pixel experts for investigation");
130 psd0.
addOptional<std::vector<edm::InputTag>>(
"inputs");
135 ->setComment(
"## Empty Regions PSet means complete unpacking");
138 desc.
add<
bool>(
"UsePilotBlade",
false)->setComment(
"## Use pilot blades");
139 desc.
add<
bool>(
"UsePhase1",
false)->setComment(
"## Use phase1");
140 desc.
add<
std::string>(
"CablingMapLabel",
"")->setComment(
"CablingMap label");
142 descriptions.
add(
"siPixelRawToDigi", desc);
149 const uint32_t dummydetid = 0xffffffff;
169 <<
" Configured to use SiPixelQuality, but SiPixelQuality not present" << endl;
177 auto collection = std::make_unique<edm::DetSetVector<PixelDigi>>();
179 auto errorcollection = std::make_unique<edm::DetSetVector<SiPixelRawDataError>>();
180 auto tkerror_detidcollection = std::make_unique<DetIdCollection>();
181 auto usererror_detidcollection = std::make_unique<DetIdCollection>();
182 auto disabled_channelcollection = std::make_unique<edmNew::DetSetVector<PixelFEDChannel>>();
193 bool errorsInEvent =
false;
204 for (
auto aFed =
fedIds.begin(); aFed !=
fedIds.end(); ++aFed) {
214 LogDebug(
"SiPixelRawToDigi") <<
" PRODUCE DIGI FOR FED: " <<
fedId << endl;
226 typedef PixelDataFormatter::Errors::iterator IE;
227 for (IE is =
errors.begin(); is !=
errors.end(); is++) {
228 uint32_t errordetid = is->first;
229 if (errordetid == dummydetid) {
230 nodeterrors.insert(nodeterrors.end(),
errors[errordetid].begin(),
errors[errordetid].end());
233 errorDetSet.
data.insert(errorDetSet.
data.end(), is->second.begin(), is->second.end());
239 std::vector<PixelFEDChannel> disabledChannelsDetSet;
241 for (
auto const& aPixelError : errorDetSet) {
244 if (
usePhase1 && aPixelError.getType() == 25) {
248 cms_uint32_t linkId = formatter.linkId(aPixelError.getWord32());
254 for (
unsigned int iRoc = 1; iRoc <=
link->numberOfROCs(); iRoc++) {
261 disabledChannelsDetSet.push_back(ch);
267 std::vector<int>::iterator it_find =
270 tkerror_detidcollection->push_back(errordetid);
277 std::vector<int>::iterator it_find =
280 usererror_detidcollection->push_back(errordetid);
286 if (!disabledChannelsDetSet.empty()) {
287 disabled_channelcollection->insert(
288 errordetid, disabledChannelsDetSet.data(), disabledChannelsDetSet.size());
297 errorDetSet.
data = nodeterrors;
300 LogDebug(
"SiPixelRawToDigi") <<
"Error words were stored in this event";
304 LogDebug(
"SiPixelRawToDigi") <<
"TIMING IS: (real)" <<
theTimer->realTime();
305 ndigis += formatter.nDigis();
306 nwords += formatter.nWords();
307 LogDebug(
"SiPixelRawToDigi") <<
" (Words/Digis) this ev: " << formatter.nWords() <<
"/" << formatter.nDigis()
310 hDigi->Fill(formatter.nDigis());
317 ev.put(
std::move(usererror_detidcollection),
"UserErrorModules");