44 using namespace sipixelconstants;
66 std::unique_ptr<SiPixelFedCablingTree>
cabling_;
95 badPixelInfo_(nullptr),
97 tkerrorlist_(config_.getParameter<std::
vector<int>>(
"ErrorList")),
98 usererrorlist_(config_.getParameter<std::
vector<int>>(
"UserErrorList")),
100 cablingMapToken_{esConsumes<SiPixelFedCablingMap, SiPixelFedCablingMapRcd>(
102 siPixelDigiCollectionToken_{produces<edm::DetSetVector<PixelDigi>>()},
103 includeErrors_(config_.getParameter<
bool>(
"IncludeErrors")),
104 useQuality_(config_.getParameter<
bool>(
"UseQualityInfo")),
105 usePilotBlade_(config_.getParameter<
bool>(
"UsePilotBlade")),
106 usePhase1_(config_.getParameter<
bool>(
"UsePhase1"))
110 siPixelQualityToken_ = esConsumes<SiPixelQuality, SiPixelQualityRcd>(
115 if (includeErrors_) {
116 errorPutToken_ = produces<edm::DetSetVector<SiPixelRawDataError>>();
117 tkErrorPutToken_ = produces<DetIdCollection>();
118 userErrorPutToken_ = produces<DetIdCollection>(
"UserErrorModules");
119 disabledChannelPutToken_ = produces<edmNew::DetSetVector<PixelFEDChannel>>();
129 edm::LogInfo(
"SiPixelRawToDigi") <<
" Use pilot blade data (FED 40)";
138 edm::LogInfo(
"SiPixelRawToDigi") <<
" HERE ** SiPixelRawToDigi destructor!";
145 desc.
add<
bool>(
"IncludeErrors",
true);
146 desc.
add<
bool>(
"UseQualityInfo",
false);
148 desc.
add<std::vector<int>>(
"ErrorList", std::vector<int>{29})
149 ->setComment(
"## ErrorList: list of error codes used by tracking to invalidate modules");
152 desc.
add<std::vector<int>>(
"UserErrorList", std::vector<int>{40})
153 ->setComment(
"## UserErrorList: list of error codes used by Pixel experts for investigation");
158 psd0.
addOptional<std::vector<edm::InputTag>>(
"inputs");
163 ->setComment(
"## Empty Regions PSet means complete unpacking");
165 desc.
add<
bool>(
"UsePilotBlade",
false)->setComment(
"## Use pilot blades");
166 desc.
add<
bool>(
"UsePhase1",
false)->setComment(
"## Use phase1");
167 desc.
add<
std::string>(
"CablingMapLabel",
"")->setComment(
"CablingMap label");
168 desc.
add<
std::string>(
"SiPixelQualityLabel",
"")->setComment(
"SiPixelQuality label");
169 descriptions.
add(
"siPixelRawToDigi", desc);
176 const uint32_t dummydetid = 0xffffffff;
182 fedIds_ = cablingMap->fedIds();
183 cabling_ = cablingMap->cablingTree();
192 edm::LogError(
"SiPixelQualityNotPresent") <<
"Configured to use SiPixelQuality, but SiPixelQuality not present";
214 bool errorsInEvent =
false;
225 for (
auto aFed =
fedIds_.begin(); aFed !=
fedIds_.end(); ++aFed) {
234 LogDebug(
"SiPixelRawToDigi") <<
"PRODUCE DIGI FOR FED:" <<
fedId;
239 const FEDRawData& fedRawData = buffers->FEDData(fedId);
242 formatter.interpretRawData(errorsInEvent, fedId, fedRawData,
collection, errors);
246 formatter.unpackFEDErrors(errors,
250 tkerror_detidcollection,
251 usererror_detidcollection,
252 disabled_channelcollection,
259 errorDetSet.
data = nodeterrors;
262 LogDebug(
"SiPixelRawToDigi") <<
"Error words were stored in this event";
ParameterDescriptionBase * addOptional(U const &iLabel, T const &value)
edm::EDPutTokenT< edmNew::DetSetVector< PixelFEDChannel > > disabledChannelPutToken_
edm::ESWatcher< SiPixelQualityRcd > qualityWatcher_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
std::vector< unsigned int > fedIds_
#define DEFINE_FWK_MODULE(type)
const std::set< unsigned int > * modulesToUnpack() const
full set of module ids to unpack
edm::EDPutTokenT< DetIdCollection > userErrorPutToken_
void produce(edm::Event &, const edm::EventSetup &) override
get data, convert to digis attach againe to Event
Log< level::Error, false > LogError
PixelUnpackingRegions * regions_
reference find_or_insert(det_id_type id)
SiPixelRawToDigi(const edm::ParameterSet &)
ctor
edm::EDPutTokenT< edm::DetSetVector< SiPixelRawDataError > > errorPutToken_
const bool usePilotBlade_
const std::vector< int > tkerrorlist_
std::unique_ptr< SiPixelFedCablingTree > cabling_
const edm::ESGetToken< SiPixelFedCablingMap, SiPixelFedCablingMapRcd > cablingMapToken_
edm::ESWatcher< SiPixelFedCablingMapRcd > recordWatcher_
unsigned int nBarrelModules() const
std::vector< std::string > getParameterNames() const
ParameterDescriptionBase * add(U const &iLabel, T const &value)
~SiPixelRawToDigi() override
dtor
const std::vector< int > usererrorlist_
Log< level::Info, false > LogInfo
void run(const edm::Event &e, const edm::EventSetup &es)
has to be run during each event
unsigned int nModules() const
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
OrphanHandle< PROD > emplace(EDPutTokenT< PROD > token, Args &&...args)
puts a new product
T const * product() const
T getParameter(std::string const &) const
void add(std::string const &label, ParameterSetDescription const &psetDescription)
bool check(const edm::EventSetup &iSetup)
edm::ParameterSet config_
unsigned int nForwardModules() const
const edm::EDGetTokenT< FEDRawDataCollection > fedRawDataCollectionToken_
unsigned int nFEDs() const
various informational accessors:
bool mayUnpackFED(unsigned int fed_n) const
check whether a FED has to be unpacked
edm::ESGetToken< SiPixelQuality, SiPixelQualityRcd > siPixelQualityToken_
edm::EDPutTokenT< DetIdCollection > tkErrorPutToken_
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
const SiPixelQuality * badPixelInfo_
const edm::EDPutTokenT< edm::DetSetVector< PixelDigi > > siPixelDigiCollectionToken_
const bool includeErrors_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)