21 fedUnpackList_(conf.getParameter<std::vector<int> >(
"FEDs")),
24 orderedFedUnpackList_(conf.getParameter<std::vector<int> >(
"orderedFedList")),
27 orderedDCCIdList_(conf.getParameter<std::vector<int> >(
"orderedDCCIdList")),
30 numbXtalTSamples_(conf.getParameter<int>(
"numbXtalTSamples")),
33 numbTriggerTSamples_(conf.getParameter<int>(
"numbTriggerTSamples")),
36 headerUnpacking_(conf.getParameter<bool>(
"headerUnpacking")),
39 srpUnpacking_(conf.getParameter<bool>(
"srpUnpacking")),
42 tccUnpacking_(conf.getParameter<bool>(
"tccUnpacking")),
45 feUnpacking_(conf.getParameter<bool>(
"feUnpacking")),
48 memUnpacking_(conf.getParameter<bool>(
"memUnpacking")),
51 syncCheck_(conf.getParameter<bool>(
"syncCheck")),
54 feIdCheck_(conf.getParameter<bool>(
"feIdCheck")),
57 forceToKeepFRdata_(conf.getParameter<bool>(
"forceToKeepFRData")),
60 put_(conf.getParameter<bool>(
"eventPut")),
64 REGIONAL_(conf.getParameter<bool>(
"DoRegional")),
80 <<
"\n Valid Number of xtal time samples are : 6,10,14,18,...,62";
88 <<
"\n Valid number of trigger time samples are : 1, 4 or 8";
104 std::ostringstream loggerOutput_;
108 edm::LogInfo(
"EcalRawToDigi") <<
"EcalRawToDigi will unpack FEDs ( " << loggerOutput_.str() <<
")";
109 LogDebug(
"EcalRawToDigi") <<
"EcalRawToDigi will unpack FEDs ( " << loggerOutput_.str() <<
")";
113 <<
"\n ECAL RawToDigi configuration:"
128 produces<EBDigiCollection>(
"ebDigis");
129 produces<EEDigiCollection>(
"eeDigis");
130 produces<EBSrFlagCollection>();
131 produces<EESrFlagCollection>();
132 produces<EcalRawDataCollection>();
133 produces<EcalPnDiodeDigiCollection>();
134 produces<EcalTrigPrimDigiCollection>(
"EcalTriggerPrimitives");
135 produces<EcalPSInputDigiCollection>(
"EcalPseudoStripInputs");
138 produces<EBDetIdCollection>(
"EcalIntegrityGainErrors");
139 produces<EBDetIdCollection>(
"EcalIntegrityGainSwitchErrors");
140 produces<EBDetIdCollection>(
"EcalIntegrityChIdErrors");
143 produces<EEDetIdCollection>(
"EcalIntegrityGainErrors");
144 produces<EEDetIdCollection>(
"EcalIntegrityGainSwitchErrors");
145 produces<EEDetIdCollection>(
"EcalIntegrityChIdErrors");
148 produces<EcalElectronicsIdCollection>(
"EcalIntegrityTTIdErrors");
149 produces<EcalElectronicsIdCollection>(
"EcalIntegrityZSXtalIdErrors");
150 produces<EcalElectronicsIdCollection>(
"EcalIntegrityBlockSizeErrors");
153 produces<EcalElectronicsIdCollection>(
"EcalIntegrityMemTtIdErrors");
154 produces<EcalElectronicsIdCollection>(
"EcalIntegrityMemBlockSizeErrors");
155 produces<EcalElectronicsIdCollection>(
"EcalIntegrityMemChIdErrors");
156 produces<EcalElectronicsIdCollection>(
"EcalIntegrityMemGainErrors");
158 dataToken_=consumes<FEDRawDataCollection>(dataLabel);
160 fedsToken_=consumes<EcalListOfFEDS>(fedsLabel);
176 <<
"Arrays orderedFedList and orderedDCCIdList are emply. "
177 "Hard coded correspondence for DCCId:FedId will be used.";
208 <<
" id " <<
id.rawId()
209 <<
" -> (" <<
id.ix() <<
", " <<
id.iy() <<
", " <<
id.zside() <<
") "
211 <<
"status = " << code
232 <<
" id " <<
id.rawId()
233 <<
" -> (" <<
id.ieta() <<
", " <<
id.iphi() <<
", " <<
id.zside() <<
") "
235 <<
"status = " << code
245 desc.
add<
bool>(
"tccUnpacking",
true);
247 desc.
add<
bool>(
"srpUnpacking",
true);
248 desc.
add<
bool>(
"syncCheck",
true);
249 desc.
add<
bool>(
"feIdCheck",
true);
253 std::vector<int> temp1;
254 unsigned int nvec = 54;
256 for (
unsigned int i=0;
i<nvec;
i++) temp1.push_back(601+
i);
257 desc.
add<std::vector<int> >(
"orderedFedList",temp1);
259 desc.
add<
bool>(
"eventPut",
true);
260 desc.
add<
int>(
"numbTriggerTSamples",1);
261 desc.
add<
int>(
"numbXtalTSamples",10);
263 std::vector<int> temp1;
264 unsigned int nvec = 54;
266 for (
unsigned int i=0;
i<nvec;
i++) temp1.push_back(1+
i);
267 desc.
add<std::vector<int> >(
"orderedDCCIdList",temp1);
270 std::vector<int> temp1;
271 unsigned int nvec = 54;
273 for (
unsigned int i=0;
i<nvec;
i++) temp1.push_back(601+
i);
274 desc.
add<std::vector<int> >(
"FEDs",temp1);
276 desc.
add<
bool>(
"DoRegional",
false);
277 desc.
add<
bool>(
"feUnpacking",
true);
278 desc.
add<
bool>(
"forceToKeepFRData",
false);
279 desc.
add<
bool>(
"headerUnpacking",
true);
280 desc.
add<
bool>(
"memUnpacking",
true);
281 descriptions.
add(
"ecalRawToDigi",desc);
320 myMap_ -> deletePointers();
321 myMap_ -> resetPointers();
328 std::vector<int> FEDS_to_unpack;
332 FEDS_to_unpack = listoffeds -> GetList();
347 productDigisEB->reserve(1700);
363 std::auto_ptr< EBDetIdCollection> productInvalidGainsSwitch(
new EBDetIdCollection);
377 std::auto_ptr<EEDetIdCollection> productInvalidEEGainsSwitch(
new EEDetIdCollection);
445 std::vector<int>::const_iterator fed_it =
find(FEDS_to_unpack.begin(), FEDS_to_unpack.end(), *
i);
446 if (fed_it == FEDS_to_unpack.end())
continue;
452 const size_t length = fedData.
size();
454 LogDebug(
"EcalRawToDigi") <<
"raw data length: " << length ;
461 LogDebug(
"EcalRawToDigi") <<
"Getting FED = " << *
i <<
"(SM = "<<smId<<
")"<<
" data size is: " << length;
466 LogDebug(
"EcalRawToDigi") <<
" in EE :"<<productDigisEE->size()
467 <<
" in EB :"<<productDigisEB->size();
484 e.
put(productDccHeaders);
488 productDigisEB->sort();
489 e.
put(productDigisEB,
"ebDigis");
490 productDigisEE->sort();
491 e.
put(productDigisEE,
"eeDigis");
492 e.
put(productInvalidGains,
"EcalIntegrityGainErrors");
493 e.
put(productInvalidGainsSwitch,
"EcalIntegrityGainSwitchErrors");
494 e.
put(productInvalidChIds,
"EcalIntegrityChIdErrors");
496 e.
put(productInvalidEEGains,
"EcalIntegrityGainErrors");
497 e.
put(productInvalidEEGainsSwitch,
"EcalIntegrityGainSwitchErrors");
498 e.
put(productInvalidEEChIds,
"EcalIntegrityChIdErrors");
500 e.
put(productInvalidTTIds,
"EcalIntegrityTTIdErrors");
501 e.
put(productInvalidZSXtalIds,
"EcalIntegrityZSXtalIdErrors");
502 e.
put(productInvalidBlockLengths,
"EcalIntegrityBlockSizeErrors");
503 e.
put(productPnDiodeDigis);
506 e.
put(productInvalidMemTtIds,
"EcalIntegrityMemTtIdErrors");
507 e.
put(productInvalidMemBlockSizes,
"EcalIntegrityMemBlockSizeErrors");
508 e.
put(productInvalidMemChIds,
"EcalIntegrityMemChIdErrors");
509 e.
put(productInvalidMemGains,
"EcalIntegrityMemGainErrors");
512 e.
put(productEBSrFlags);
513 e.
put(productEESrFlags);
516 e.
put(productEcalTps,
"EcalTriggerPrimitives");
517 e.
put(productEcalPSs,
"EcalPseudoStripInputs");
void setChannelStatusDB(const EcalChannelStatusMap *chdb)
T getParameter(std::string const &) const
void setPnDiodeDigisCollection(std::auto_ptr< EcalPnDiodeDigiCollection > *x)
edm::ESWatcher< EcalMappingRcd > watcher_
T getUntrackedParameter(std::string const &, T const &) const
unsigned int numbXtalTSamples_
int xtalId() const
get the channel id
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
void unpack(const uint64_t *buffer, size_t bufferSize, unsigned int smId, unsigned int fedId)
void setInvalidZSXtalIdsCollection(std::auto_ptr< EcalElectronicsIdCollection > *x)
int stripId() const
get the tower id
edm::EDGetTokenT< FEDRawDataCollection > dataToken_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
void setInvalidMemBlockSizesCollection(std::auto_ptr< EcalElectronicsIdCollection > *x)
std::vector< int > orderedFedUnpackList_
Ecal readout channel identification [32:20] Unused (so far) [19:13] DCC id [12:6] tower [5:3] strip [...
void setDccHeadersCollection(std::auto_ptr< EcalRawDataCollection > *x)
void setEcalPSsCollection(std::auto_ptr< EcalPSInputDigiCollection > *x)
int towerId() const
get the tower id
void setInvalidEEGainsSwitchCollection(std::auto_ptr< EEDetIdCollection > *x)
static EEDetId unhashIndex(int hi)
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
void setEEDigisCollection(std::auto_ptr< EEDigiCollection > *x)
size_t size() const
Lenght of the data buffer in bytes.
std::vector< int > fedUnpackList_
const EcalElectronicsMapper * electronicsMapper() const
DCCDataUnpacker * theUnpacker_
void setInvalidMemTtIdsCollection(std::auto_ptr< EcalElectronicsIdCollection > *x)
EcalElectronicsId getElectronicsId(const DetId &id) const
Get the electronics id for this det id.
void setEBSrFlagsCollection(std::auto_ptr< EBSrFlagCollection > *x)
unsigned int getDCCId(unsigned int aSMId) const
static std::atomic< bool > silentMode_
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
bool setActiveDCC(unsigned int dccId)
void setEBDigisCollection(std::auto_ptr< EBDigiCollection > *x)
uint16_t getChannelValue(const DetId &id) const
unsigned int numbTriggerTSamples_
bool makeMapFromVectors(std::vector< int > &, std::vector< int > &)
void setInvalidMemGainsCollection(std::auto_ptr< EcalElectronicsIdCollection > *x)
std::vector< int > orderedDCCIdList_
void setInvalidGainsCollection(std::auto_ptr< EBDetIdCollection > *x)
virtual void produce(edm::Event &e, const edm::EventSetup &c) override
EcalRawToDigi(const edm::ParameterSet &ps)
void setInvalidEEChIdsCollection(std::auto_ptr< EEDetIdCollection > *x)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
edm::EDGetTokenT< EcalListOfFEDS > fedsToken_
int dccId() const
get the DCC (Ecal Local DCC value not global one) id
void printStatusRecords(const DCCDataUnpacker *unpacker, const EcalElectronicsMapping *mapping)
void setInvalidTTIdsCollection(std::auto_ptr< EcalElectronicsIdCollection > *x)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
void setInvalidGainsSwitchCollection(std::auto_ptr< EBDetIdCollection > *x)
unsigned long long uint64_t
void setEESrFlagsCollection(std::auto_ptr< EESrFlagCollection > *x)
T const * product() const
void add(std::string const &label, ParameterSetDescription const &psetDescription)
bool check(const edm::EventSetup &iSetup)
static EBDetId unhashIndex(int hi)
get a DetId from a compact index for arrays
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
void setEcalTpsCollection(std::auto_ptr< EcalTrigPrimDigiCollection > *x)
void setInvalidMemChIdsCollection(std::auto_ptr< EcalElectronicsIdCollection > *x)
void setInvalidBlockLengthsCollection(std::auto_ptr< EcalElectronicsIdCollection > *x)
void setInvalidEEGainsCollection(std::auto_ptr< EEDetIdCollection > *x)
EcalElectronicsMapper * myMap_
virtual void beginRun(const edm::Run &run, const edm::EventSetup &es) override
unsigned int getActiveSM()
void setInvalidChIdsCollection(std::auto_ptr< EBDetIdCollection > *x)