44 hCPU(0), hDigi(0), theTimer(0)
62 produces< edm::DetSetVector<PixelDigi> >();
64 produces< edm::DetSetVector<SiPixelRawDataError> >();
65 produces<DetIdCollection>();
66 produces<DetIdCollection>(
"UserErrorModules");
81 hCPU =
new TH1D (
"hCPU",
"hCPU",100,0.,0.050);
82 hDigi =
new TH1D(
"hDigi",
"hDigi",50,0.,15000.);
89 edm::LogInfo(
"SiPixelRawToDigi") <<
" HERE ** SiPixelRawToDigi destructor!";
95 TFile rootFile(
"analysis.root",
"RECREATE",
"my histograms");
111 const uint32_t dummydetid = 0xffffffff;
122 fedIds = cablingMap->fedIds();
123 cabling_ = cablingMap->cablingTree();
128 fedIds = cablingMap->fedIds();
140 edm::LogError(
"SiPixelQualityNotPresent")<<
" Configured to use SiPixelQuality, but SiPixelQuality not present"<<endl;
151 std::auto_ptr< DetIdCollection > tkerror_detidcollection(
new DetIdCollection());
152 std::auto_ptr< DetIdCollection > usererror_detidcollection(
new DetIdCollection());
160 bool errorsInEvent =
false;
170 typedef std::vector<unsigned int>::const_iterator IF;
171 for (IF aFed =
fedIds.begin(); aFed !=
fedIds.end(); ++aFed) {
176 if(
debug)
LogDebug(
"SiPixelRawToDigi")<<
" PRODUCE DIGI FOR FED: " << fedId << endl;
181 const FEDRawData& fedRawData = buffers->FEDData( fedId );
184 formatter.
interpretRawData( errorsInEvent, fedId, fedRawData, digis, errors);
187 typedef PixelDataFormatter::Digis::iterator
ID;
188 for (ID it = digis.begin(); it != digis.end(); it++) {
189 uint32_t
detid = it->first;
191 detSet.
data.insert(detSet.
data.end(), it->second.begin(), it->second.end());
196 typedef PixelDataFormatter::Errors::iterator IE;
197 for (IE is = errors.begin(); is != errors.end(); is++) {
198 uint32_t errordetid = is->first;
199 if (errordetid==dummydetid) {
200 nodeterrors.insert( nodeterrors.end(), errors[errordetid].begin(), errors[errordetid].end() );
203 errorDetSet.
data.insert(errorDetSet.
data.end(), is->second.begin(), is->second.end());
209 DetId errorDetId(errordetid);
211 for(; itPixelError!=errorDetSet.
end(); ++itPixelError){
216 tkerror_detidcollection->push_back(errordetid);
223 usererror_detidcollection->push_back(errordetid);
235 errorDetSet.
data = nodeterrors;
237 if (errorsInEvent)
LogDebug(
"SiPixelRawToDigi") <<
"Error words were stored in this event";
244 LogDebug(
"SiPixelRawToDigi") <<
" (Words/Digis) this ev: "
251 ev.
put( collection );
253 ev.
put( errorcollection );
254 ev.
put( tkerror_detidcollection );
255 ev.
put( usererror_detidcollection,
"UserErrorModules" );
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
unsigned int nForwardFEDs() 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 std::string version() const =0
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.
unsigned int nBarrelModules() const
std::vector< std::string > getParameterNames() const
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
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
const LastMeasurement & lastMeasurement()
T const * product() const
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
R2DTimerObserver * theTimer
collection_type::const_iterator const_iterator
edm::ESWatcher< SiPixelQualityRcd > qualityWatcher
const SiPixelQuality * badPixelInfo_
const SiPixelFedCabling * cabling_
virtual void produce(edm::Event &, const edm::EventSetup &)
get data, convert to digis attach againe to Event