45 : config_(conf), badPixelInfo_(nullptr), regions_(nullptr), hCPU(nullptr), hDigi(nullptr) {
62 produces<edm::DetSetVector<PixelDigi>>();
64 produces<edm::DetSetVector<SiPixelRawDataError>>();
65 produces<DetIdCollection>();
66 produces<DetIdCollection>(
"UserErrorModules");
67 produces<edmNew::DetSetVector<PixelFEDChannel>>();
78 theTimer = std::make_unique<edm::CPUTimer>();
79 hCPU =
new TH1D(
"hCPU",
"hCPU", 100, 0., 0.050);
80 hDigi =
new TH1D(
"hDigi",
"hDigi", 50, 0., 15000.);
86 edm::LogInfo(
"SiPixelRawToDigi") <<
" Use pilot blade data (FED 40)";
100 edm::LogInfo(
"SiPixelRawToDigi") <<
" HERE ** SiPixelRawToDigi destructor!";
106 TFile
rootFile(
"analysis.root",
"RECREATE",
"my histograms");
114 desc.add<
bool>(
"IncludeErrors",
true);
115 desc.add<
bool>(
"UseQualityInfo",
false);
117 std::vector<int> temp1;
120 desc.add<std::vector<int>>(
"ErrorList", temp1)
121 ->setComment(
"## ErrorList: list of error codes used by tracking to invalidate modules");
124 std::vector<int> temp1;
127 desc.add<std::vector<int>>(
"UserErrorList", temp1)
128 ->setComment(
"## UserErrorList: list of error codes used by Pixel experts for investigation");
133 psd0.
addOptional<std::vector<edm::InputTag>>(
"inputs");
138 ->setComment(
"## Empty Regions PSet means complete unpacking");
140 desc.addUntracked<
bool>(
"Timing",
false);
141 desc.add<
bool>(
"UsePilotBlade",
false)->setComment(
"## Use pilot blades");
142 desc.add<
bool>(
"UsePhase1",
false)->setComment(
"## Use phase1");
143 desc.add<
std::string>(
"CablingMapLabel",
"")->setComment(
"CablingMap label");
144 desc.addOptional<
bool>(
"CheckPixelOrder");
145 descriptions.
add(
"siPixelRawToDigi",
desc);
152 const uint32_t dummydetid = 0xffffffff;
170 <<
" Configured to use SiPixelQuality, but SiPixelQuality not present" << endl;
178 auto collection = std::make_unique<edm::DetSetVector<PixelDigi>>();
180 auto errorcollection = std::make_unique<edm::DetSetVector<SiPixelRawDataError>>();
181 auto tkerror_detidcollection = std::make_unique<DetIdCollection>();
182 auto usererror_detidcollection = std::make_unique<DetIdCollection>();
183 auto disabled_channelcollection = std::make_unique<edmNew::DetSetVector<PixelFEDChannel>>();
194 bool errorsInEvent =
false;
205 for (
auto aFed =
fedIds.begin(); aFed !=
fedIds.end(); ++aFed) {
215 LogDebug(
"SiPixelRawToDigi") <<
" PRODUCE DIGI FOR FED: " <<
fedId << endl;
227 typedef PixelDataFormatter::Errors::iterator IE;
228 for (IE is =
errors.begin(); is !=
errors.end(); is++) {
229 uint32_t errordetid = is->first;
230 if (errordetid == dummydetid) {
231 nodeterrors.insert(nodeterrors.end(),
errors[errordetid].begin(),
errors[errordetid].end());
234 errorDetSet.
data.insert(errorDetSet.
data.end(), is->second.begin(), is->second.end());
240 std::vector<PixelFEDChannel> disabledChannelsDetSet;
242 for (
auto const& aPixelError : errorDetSet) {
245 if (
usePhase1 && aPixelError.getType() == 25) {
249 cms_uint32_t linkId = formatter.linkId(aPixelError.getWord32());
255 for (
unsigned int iRoc = 1; iRoc <=
link->numberOfROCs(); iRoc++) {
262 disabledChannelsDetSet.push_back(ch);
268 std::vector<int>::iterator it_find =
271 tkerror_detidcollection->push_back(errordetid);
278 std::vector<int>::iterator it_find =
281 usererror_detidcollection->push_back(errordetid);
287 if (!disabledChannelsDetSet.empty()) {
288 disabled_channelcollection->insert(
289 errordetid, disabledChannelsDetSet.data(), disabledChannelsDetSet.size());
298 errorDetSet.
data = nodeterrors;
301 LogDebug(
"SiPixelRawToDigi") <<
"Error words were stored in this event";
305 LogDebug(
"SiPixelRawToDigi") <<
"TIMING IS: (real)" <<
theTimer->realTime();
306 ndigis += formatter.nDigis();
307 nwords += formatter.nWords();
308 LogDebug(
"SiPixelRawToDigi") <<
" (Words/Digis) this ev: " << formatter.nWords() <<
"/" << formatter.nDigis()
311 hDigi->Fill(formatter.nDigis());
318 ev.put(
std::move(usererror_detidcollection),
"UserErrorModules");