31 #define BEG_DCC_FED_ID 0
32 #define END_DCC_FED_ID 0
33 #define BEG_DCC_FED_ID_GLOBAL 0
34 #define END_DCC_FED_ID_GLOBAL 0
36 #define ECAL_SUPERVISOR_FED_ID 40
37 #define TBCAMAC_FED_ID 41
38 #define TABLE_FED_ID 42
39 #define MATACQ_FED_ID 43
42 fedRawDataCollectionTag_(pset.getParameter<edm::
InputTag>(
"fedRawDataCollectionTag")) {
61 if ( ics.size() == 0 || towerIDs.size() == 0 || stripIDs.size() == 0 || channelIDs.size() == 0 ){
62 edm::LogError(
"EcalDCCTB07UnpackingModule") <<
"Some of the mapping info is missing! Check config files! " <<
63 " Size of IC vector is " << ics.size() <<
64 " Size of Tower ID vector is " << towerIDs.size() <<
65 " Size of Strip ID vector is " << stripIDs.size() <<
66 " Size of Channel ID vector is " << channelIDs.size();
68 if ( statusIDs.size() == 0 || ccuIDs.size() == 0 || positionIDs.size() == 0 ) {
69 edm::LogError(
"EcalDCCTB07UnpackingModule") <<
"Some of the mapping info is missing! Check config files! " <<
70 " Size of status ID vector is " << statusIDs.size() <<
71 " Size of ccu ID vector is " << ccuIDs.size() <<
72 " positionIDs size is " << positionIDs.size();
76 if ( ics.size() != towerIDs.size() || ics.size() != stripIDs.size() || ics.size() != channelIDs.size() ||
77 towerIDs.size() != stripIDs.size() || towerIDs.size() != channelIDs.size() ||
78 stripIDs.size() != channelIDs.size() )
79 edm::LogError(
"EcalDCCTB07UnpackingModule") <<
"Mapping information is corrupted. " <<
80 "Tower/DQM position/strip/channel vectors are of different size! Check cfi files! \n" <<
81 " Size of IC vector is " << ics.size() <<
82 " Size of Tower ID vector is " << towerIDs.size() <<
83 " Size of Strip ID vector is " << stripIDs.size() <<
84 " Size of Channel ID vector is " << channelIDs.size();
86 if ( statusIDs.size() != ccuIDs.size() || statusIDs.size() != positionIDs.size() ||
87 ccuIDs.size() != positionIDs.size() )
88 edm::LogError(
"EcalDCCTB07UnpackingModule") <<
"Mapping information is corrupted. " <<
89 "Status/CCU ID/DQM position vectors are of different size! Check cfi files! \n" <<
90 " Size of status ID vector is " << statusIDs.size() <<
91 " Size of ccu ID vector is " << ccuIDs.size() <<
92 " positionIDs size is " << positionIDs.size();
94 int cryIcMap[68][5][5];
95 int tbStatusToLocation[71];
96 int tbTowerIDToLocation[201];
97 for (
unsigned it=1; it <= 68; ++it )
98 for (
unsigned is=1; is <=5; ++is )
99 for (
unsigned ic=1; ic <=5; ++ic)
100 cryIcMap[it-1][is-1][ic-1] = 1700;
102 for (
unsigned it=1; it <=71; ++it)
103 tbStatusToLocation[it-1] = it - 1;
105 for (
unsigned it=1; it <= 201; ++it)
106 tbTowerIDToLocation[it-1] = it - 1;
109 for(
unsigned int i=0;
i < ics.size(); ++
i) {
110 int tower = towerIDs[
i];
111 int strip = stripIDs[
i];
112 int channel = channelIDs[
i];
114 cryIcMap[tower-1][strip-1][channel-1] = ic;
116 for(
unsigned int i = 0;
i < statusIDs.size(); ++
i) {
117 int is = statusIDs[
i];
119 int itEB = positionIDs[
i];
121 tbStatusToLocation[is] = itEB;
122 tbTowerIDToLocation[it] = itEB;
133 produces<EBDigiCollection>(
"ebDigis");
134 produces<EEDigiCollection>(
"eeDigis");
135 produces<EcalMatacqDigiCollection>();
136 produces<EcalPnDiodeDigiCollection>();
137 produces<EcalRawDataCollection>();
138 produces<EcalTrigPrimDigiCollection>(
"EBTT");
141 produces<EcalTBHodoscopeRawInfo>();
142 produces<EcalTBTDCRawInfo>();
143 produces<EcalTBEventHeader>();
146 produces<EBDetIdCollection>(
"EcalIntegrityDCCSizeErrors");
147 produces<EcalElectronicsIdCollection>(
"EcalIntegrityTTIdErrors");
148 produces<EcalElectronicsIdCollection>(
"EcalIntegrityBlockSizeErrors");
149 produces<EBDetIdCollection>(
"EcalIntegrityChIdErrors");
150 produces<EBDetIdCollection>(
"EcalIntegrityGainErrors");
151 produces<EBDetIdCollection>(
"EcalIntegrityGainSwitchErrors");
154 produces<EcalElectronicsIdCollection>(
"EcalIntegrityMemTtIdErrors");
155 produces<EcalElectronicsIdCollection>(
"EcalIntegrityMemBlockSize");
156 produces<EcalElectronicsIdCollection>(
"EcalIntegrityMemChIdErrors");
157 produces<EcalElectronicsIdCollection>(
"EcalIntegrityMemGainErrors");
182 auto productEb = std::make_unique<EBDigiCollection>();
185 auto productEe = std::make_unique<EEDigiCollection>();
188 auto productMatacq = std::make_unique<EcalMatacqDigiCollection>();
191 auto productPN = std::make_unique<EcalPnDiodeDigiCollection>();
194 auto productDCCHeader = std::make_unique<EcalRawDataCollection>();
197 auto productTriggerPrimitives = std::make_unique<EcalTrigPrimDigiCollection>();
200 auto productDCCSize = std::make_unique<EBDetIdCollection>();
203 auto productTTId = std::make_unique<EcalElectronicsIdCollection>();
206 auto productBlockSize = std::make_unique<EcalElectronicsIdCollection>();
209 auto productChId = std::make_unique<EBDetIdCollection>();
212 auto productGain = std::make_unique<EBDetIdCollection>();
215 auto productGainSwitch = std::make_unique<EBDetIdCollection>();
218 auto productMemTtId = std::make_unique<EcalElectronicsIdCollection>();
221 auto productMemBlockSize = std::make_unique< EcalElectronicsIdCollection>();
224 auto productMemGain = std::make_unique< EcalElectronicsIdCollection>();
227 auto productMemChIdErrors = std::make_unique<EcalElectronicsIdCollection>();
230 auto productHodo = std::make_unique<EcalTBHodoscopeRawInfo>();
231 auto productTdc = std::make_unique<EcalTBTDCRawInfo>();
232 auto productHeader = std::make_unique<EcalTBEventHeader>();
262 (*productHeader).setSmInBeam(
id);
267 *productTTId, *productBlockSize,
268 *productChId, *productGain, *productGainSwitch,
269 *productMemTtId, *productMemBlockSize,
270 *productMemGain, *productMemChIdErrors,
271 *productTriggerPrimitives);
272 int runType = (*productDCCHeader)[0].getRunType();
274 (*productHeader).setTriggerMask(0x1);
275 else if ( runType == 4 || runType == 5 || runType == 6 )
276 (*productHeader).setTriggerMask(0x2000);
277 else if ( runType == 9 || runType == 10 || runType == 11 )
278 (*productHeader).setTriggerMask(0x800);
279 LogDebug(
"EcalDCCTB07UnpackingModule") <<
"Event type is " << (*productHeader).eventType() <<
" dbEventType " << (*productHeader).dbEventType();
318 std::cout <<
"[EcalDCCTB07UnpackingModule] " << e.
what() << std::endl;
320 std::cout <<
"[EcalDCCTB07UnpackingModule] " << e.
what() << std::endl;
322 std::cout <<
"[EcalDCCTB07UnpackingModule] " << e.
what() << std::endl;
324 std::cout <<
"[EcalDCCTB07UnpackingModule] Unknown exception ..." << std::endl;
virtual char const * what() const
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_
size_t size() const
Lenght of the data buffer in bytes.
edm::InputTag fedRawDataCollectionTag_
void produce(edm::Event &e, const edm::EventSetup &c)
Produce digis out of raw data.
CamacTBDataFormatter * camacTBformatter_
virtual ~EcalDCCTB07UnpackingModule()
Destructor.
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
volatile std::atomic< bool > shutdown_flag false
#define BEG_DCC_FED_ID_GLOBAL
EcalDCCTB07UnpackingModule(const edm::ParameterSet &pset)
Constructor.