64 produces< edm::DetSetVector<PixelDigi> >();
66 produces< edm::DetSetVector<SiPixelRawDataError> >();
67 produces<DetIdCollection>();
68 produces<DetIdCollection>(
"UserErrorModules");
83 hCPU =
new TH1D (
"hCPU",
"hCPU",100,0.,0.050);
84 hDigi =
new TH1D(
"hDigi",
"hDigi",50,0.,15000.);
106 edm::LogInfo(
"SiPixelRawToDigi") <<
" HERE ** SiPixelRawToDigi destructor!";
111 TFile rootFile(
"analysis.root",
"RECREATE",
"my histograms");
121 desc.
add<
bool>(
"IncludeErrors",
true);
122 desc.
add<
bool>(
"UseQualityInfo",
false);
124 std::vector<int> temp1;
127 desc.
add<std::vector<int> >(
"ErrorList",temp1)->setComment(
"## ErrorList: list of error codes used by tracking to invalidate modules");
130 std::vector<int> temp1;
133 desc.
add<std::vector<int> >(
"UserErrorList",temp1)->setComment(
"## UserErrorList: list of error codes used by Pixel experts for investigation");
138 psd0.
addOptional<std::vector<edm::InputTag>>(
"inputs");
145 desc.
add<
bool>(
"UsePilotBlade",
false)->setComment(
"## Use pilot blades");
146 desc.
add<
bool>(
"UsePhase1",
false)->setComment(
"## Use phase1");
148 descriptions.
add(
"siPixelRawToDigi",desc);
158 const uint32_t dummydetid = 0xffffffff;
166 fedIds = cablingMap->fedIds();
167 cabling_ = cablingMap->cablingTree();
177 edm::LogError(
"SiPixelQualityNotPresent")<<
" Configured to use SiPixelQuality, but SiPixelQuality not present"<<endl;
188 std::auto_ptr< DetIdCollection > tkerror_detidcollection(
new DetIdCollection());
189 std::auto_ptr< DetIdCollection > usererror_detidcollection(
new DetIdCollection());
199 bool errorsInEvent =
false;
209 for (
auto aFed =
fedIds.begin(); aFed !=
fedIds.end(); ++aFed) {
216 if(
debug)
LogDebug(
"SiPixelRawToDigi")<<
" PRODUCE DIGI FOR FED: " << fedId << endl;
221 const FEDRawData& fedRawData = buffers->FEDData( fedId );
224 formatter.interpretRawData( errorsInEvent, fedId, fedRawData, *collection, errors);
228 typedef PixelDataFormatter::Errors::iterator IE;
229 for (IE is = errors.begin(); is != errors.end(); is++) {
230 uint32_t errordetid = is->first;
231 if (errordetid==dummydetid) {
232 nodeterrors.insert( nodeterrors.end(), errors[errordetid].begin(), errors[errordetid].end() );
235 errorDetSet.
data.insert(errorDetSet.
data.end(), is->second.begin(), is->second.end());
241 DetId errorDetId(errordetid);
243 for(; itPixelError!=errorDetSet.
end(); ++itPixelError){
248 tkerror_detidcollection->push_back(errordetid);
255 usererror_detidcollection->push_back(errordetid);
267 errorDetSet.
data = nodeterrors;
269 if (errorsInEvent)
LogDebug(
"SiPixelRawToDigi") <<
"Error words were stored in this event";
273 LogDebug(
"SiPixelRawToDigi") <<
"TIMING IS: (real)" <<
theTimer->realTime() ;
274 ndigis += formatter.nDigis();
275 nwords += formatter.nWords();
276 LogDebug(
"SiPixelRawToDigi") <<
" (Words/Digis) this ev: "
277 <<formatter.nWords()<<
"/"<<formatter.nDigis() <<
"--- all :"<<
nwords<<
"/"<<
ndigis;
279 hDigi->Fill(formatter.nDigis());
283 ev.
put( collection );
285 ev.
put( errorcollection );
286 ev.
put( tkerror_detidcollection );
287 ev.
put( usererror_detidcollection,
"UserErrorModules" );
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
std::unique_ptr< edm::CPUTimer > theTimer
ParameterDescriptionBase * addOptional(U const &iLabel, T const &value)
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
unsigned int nForwardFEDs() const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
static MessageDrop * instance()
bool exists(std::string const ¶meterName) const
checks if a parameter exists
std::vector< int > usererrorlist
const std::set< unsigned int > * modulesToUnpack() const
full set of module ids to unpack
virtual void produce(edm::Event &, const edm::EventSetup &) override
get data, convert to digis attach againe to Event
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
PixelUnpackingRegions * regions_
std::vector< unsigned int > fedIds
SiPixelRawToDigi(const edm::ParameterSet &)
ctor
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
std::unique_ptr< SiPixelFedCablingTree > cabling_
unsigned int nBarrelModules() const
edm::EDGetTokenT< FEDRawDataCollection > tFEDRawDataCollection
std::vector< std::string > getParameterNames() const
ParameterDescriptionBase * add(U const &iLabel, T const &value)
virtual ~SiPixelRawToDigi()
dtor
edm::ESWatcher< SiPixelFedCablingMapRcd > recordWatcher
void run(const edm::Event &e, const edm::EventSetup &es)
has to be run during each event
unsigned int nModules() const
T const * product() const
void add(std::string const &label, ParameterSetDescription const &psetDescription)
std::vector< int > tkerrorlist
bool check(const edm::EventSetup &iSetup)
edm::ParameterSet config_
unsigned int nForwardModules() const
unsigned int nFEDs() const
various informational accessors:
unsigned int nBarrelFEDs() const
bool mayUnpackFED(unsigned int fed_n) const
check whether a FED has to be unpacked
edm::EDCollection< DetId > DetIdCollection
collection_type::const_iterator const_iterator
edm::ESWatcher< SiPixelQualityRcd > qualityWatcher
const SiPixelQuality * badPixelInfo_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)