30 #define BEG_DCC_FED_ID 0 31 #define END_DCC_FED_ID 0 32 #define BEG_DCC_FED_ID_GLOBAL 0 33 #define END_DCC_FED_ID_GLOBAL 0 35 #define ECAL_SUPERVISOR_FED_ID 40 36 #define TBCAMAC_FED_ID 41 37 #define TABLE_FED_ID 42 38 #define MATACQ_FED_ID 43 41 : fedRawDataCollectionTag_(pset.getParameter<
edm::
InputTag>(
"fedRawDataCollectionTag")) {
59 if (ics.empty() || towerIDs.empty() || stripIDs.empty() || channelIDs.empty()) {
61 <<
"Some of the mapping info is missing! Check config files! " 62 <<
" Size of IC vector is " << ics.size() <<
" Size of Tower ID vector is " << towerIDs.size()
63 <<
" Size of Strip ID vector is " << stripIDs.size() <<
" Size of Channel ID vector is " << channelIDs.size();
65 if (statusIDs.empty() || ccuIDs.empty() || positionIDs.empty()) {
67 <<
"Some of the mapping info is missing! Check config files! " 68 <<
" Size of status ID vector is " << statusIDs.size() <<
" Size of ccu ID vector is " << ccuIDs.size()
69 <<
" positionIDs size is " << positionIDs.size();
73 if (ics.size() != towerIDs.size() || ics.size() != stripIDs.size() || ics.size() != channelIDs.size() ||
74 towerIDs.size() != stripIDs.size() || towerIDs.size() != channelIDs.size() ||
75 stripIDs.size() != channelIDs.size())
77 <<
"Mapping information is corrupted. " 78 <<
"Tower/DQM position/strip/channel vectors are of different size! Check cfi files! \n" 79 <<
" Size of IC vector is " << ics.size() <<
" Size of Tower ID vector is " << towerIDs.size()
80 <<
" Size of Strip ID vector is " << stripIDs.size() <<
" Size of Channel ID vector is " << channelIDs.size();
82 if (statusIDs.size() != ccuIDs.size() || statusIDs.size() != positionIDs.size() ||
83 ccuIDs.size() != positionIDs.size())
85 <<
"Mapping information is corrupted. " 86 <<
"Status/CCU ID/DQM position vectors are of different size! Check cfi files! \n" 87 <<
" Size of status ID vector is " << statusIDs.size() <<
" Size of ccu ID vector is " << ccuIDs.size()
88 <<
" positionIDs size is " << positionIDs.size();
90 int cryIcMap[68][5][5];
91 int tbStatusToLocation[71];
92 int tbTowerIDToLocation[201];
93 for (
unsigned it = 1; it <= 68; ++it)
94 for (
unsigned is = 1; is <= 5; ++is)
95 for (
unsigned ic = 1; ic <= 5; ++ic)
96 cryIcMap[it - 1][is - 1][ic - 1] = 1700;
98 for (
unsigned it = 1; it <= 71; ++it)
99 tbStatusToLocation[it - 1] = it - 1;
101 for (
unsigned it = 1; it <= 201; ++it)
102 tbTowerIDToLocation[it - 1] = it - 1;
105 for (
unsigned int i = 0;
i < ics.size(); ++
i) {
108 int channel = channelIDs[
i];
110 cryIcMap[tower - 1][strip - 1][channel - 1] = ic;
112 for (
unsigned int i = 0;
i < statusIDs.size(); ++
i) {
113 int is = statusIDs[
i];
115 int itEB = positionIDs[
i];
117 tbStatusToLocation[is] = itEB;
118 tbTowerIDToLocation[it] = itEB;
128 produces<EBDigiCollection>(
"ebDigis");
129 produces<EEDigiCollection>(
"eeDigis");
130 produces<EcalMatacqDigiCollection>();
131 produces<EcalPnDiodeDigiCollection>();
132 produces<EcalRawDataCollection>();
133 produces<EcalTrigPrimDigiCollection>(
"EBTT");
136 produces<EcalTBHodoscopeRawInfo>();
137 produces<EcalTBTDCRawInfo>();
138 produces<EcalTBEventHeader>();
141 produces<EBDetIdCollection>(
"EcalIntegrityDCCSizeErrors");
142 produces<EcalElectronicsIdCollection>(
"EcalIntegrityTTIdErrors");
143 produces<EcalElectronicsIdCollection>(
"EcalIntegrityBlockSizeErrors");
144 produces<EBDetIdCollection>(
"EcalIntegrityChIdErrors");
145 produces<EBDetIdCollection>(
"EcalIntegrityGainErrors");
146 produces<EBDetIdCollection>(
"EcalIntegrityGainSwitchErrors");
149 produces<EcalElectronicsIdCollection>(
"EcalIntegrityMemTtIdErrors");
150 produces<EcalElectronicsIdCollection>(
"EcalIntegrityMemBlockSize");
151 produces<EcalElectronicsIdCollection>(
"EcalIntegrityMemChIdErrors");
152 produces<EcalElectronicsIdCollection>(
"EcalIntegrityMemGainErrors");
166 auto productEb = std::make_unique<EBDigiCollection>();
169 auto productEe = std::make_unique<EEDigiCollection>();
172 auto productMatacq = std::make_unique<EcalMatacqDigiCollection>();
175 auto productPN = std::make_unique<EcalPnDiodeDigiCollection>();
178 auto productDCCHeader = std::make_unique<EcalRawDataCollection>();
181 auto productTriggerPrimitives = std::make_unique<EcalTrigPrimDigiCollection>();
184 auto productDCCSize = std::make_unique<EBDetIdCollection>();
187 auto productTTId = std::make_unique<EcalElectronicsIdCollection>();
190 auto productBlockSize = std::make_unique<EcalElectronicsIdCollection>();
193 auto productChId = std::make_unique<EBDetIdCollection>();
196 auto productGain = std::make_unique<EBDetIdCollection>();
199 auto productGainSwitch = std::make_unique<EBDetIdCollection>();
202 auto productMemTtId = std::make_unique<EcalElectronicsIdCollection>();
205 auto productMemBlockSize = std::make_unique<EcalElectronicsIdCollection>();
208 auto productMemGain = std::make_unique<EcalElectronicsIdCollection>();
211 auto productMemChIdErrors = std::make_unique<EcalElectronicsIdCollection>();
214 auto productHodo = std::make_unique<EcalTBHodoscopeRawInfo>();
215 auto productTdc = std::make_unique<EcalTBTDCRawInfo>();
216 auto productHeader = std::make_unique<EcalTBEventHeader>();
236 if (data.
size() > 16) {
241 (*productHeader).setSmInBeam(
id);
255 *productMemBlockSize,
257 *productMemChIdErrors,
258 *productTriggerPrimitives);
259 int runType = (*productDCCHeader)[0].getRunType();
261 (*productHeader).setTriggerMask(0
x1);
262 else if (runType == 4 || runType == 5 || runType == 6)
263 (*productHeader).setTriggerMask(0x2000);
264 else if (runType == 9 || runType == 10 || runType == 11)
265 (*productHeader).setTriggerMask(0x800);
266 LogDebug(
"EcalDCCTB07UnpackingModule")
267 <<
"Event type is " << (*productHeader).eventType() <<
" dbEventType " << (*productHeader).dbEventType();
290 e.
put(
std::move(productDCCSize),
"EcalIntegrityDCCSizeErrors");
292 e.
put(
std::move(productTTId),
"EcalIntegrityTTIdErrors");
294 e.
put(
std::move(productBlockSize),
"EcalIntegrityBlockSizeErrors");
296 e.
put(
std::move(productChId),
"EcalIntegrityChIdErrors");
298 e.
put(
std::move(productGain),
"EcalIntegrityGainErrors");
300 e.
put(
std::move(productGainSwitch),
"EcalIntegrityGainSwitchErrors");
303 e.
put(
std::move(productMemTtId),
"EcalIntegrityMemTtIdErrors");
305 e.
put(
std::move(productMemBlockSize),
"EcalIntegrityMemBlockSize");
307 e.
put(
std::move(productMemChIdErrors),
"EcalIntegrityMemChIdErrors");
309 e.
put(
std::move(productMemGain),
"EcalIntegrityMemGainErrors");
316 std::cout <<
"[EcalDCCTB07UnpackingModule] " << e.
what() << std::endl;
318 std::cout <<
"[EcalDCCTB07UnpackingModule] " << e.
what() << std::endl;
320 std::cout <<
"[EcalDCCTB07UnpackingModule] " << e.
what() << std::endl;
322 std::cout <<
"[EcalDCCTB07UnpackingModule] Unknown exception ..." << std::endl;
T getUntrackedParameter(std::string const &, T const &) const
TableDataFormatter * tableFormatter_
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
const char * what() const
#define END_DCC_FED_ID_GLOBAL
EcalTB07DaqFormatter * formatter_
char const * what() const override
size_t size() const
Lenght of the data buffer in bytes.
edm::InputTag fedRawDataCollectionTag_
void produce(edm::Event &e, const edm::EventSetup &c) override
Produce digis out of raw data.
const FEDRawData & FEDData(int fedid) const
retrieve data for fed
CamacTBDataFormatter * camacTBformatter_
MatacqTBDataFormatter * matacqFormatter_
EcalSupervisorTBDataFormatter * ecalSupervisorFormatter_
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
#define ECAL_SUPERVISOR_FED_ID
char data[epos_bytes_allocation]
const char * what() const
~EcalDCCTB07UnpackingModule() override
Destructor.
#define BEG_DCC_FED_ID_GLOBAL
EcalDCCTB07UnpackingModule(const edm::ParameterSet &pset)
Constructor.
void endJob(void) override