33 #define BEG_DCC_FED_ID 0
34 #define END_DCC_FED_ID 0
35 #define BEG_DCC_FED_ID_GLOBAL 0
36 #define END_DCC_FED_ID_GLOBAL 0
38 #define ECAL_SUPERVISOR_FED_ID 40
39 #define TBCAMAC_FED_ID 41
40 #define TABLE_FED_ID 42
41 #define MATACQ_FED_ID 43
62 if ( ics.size() == 0 || towerIDs.size() == 0 || stripIDs.size() == 0 || channelIDs.size() == 0 ){
63 edm::LogError(
"EcalDCCTB07UnpackingModule") <<
"Some of the mapping info is missing! Check config files! " <<
64 " Size of IC vector is " << ics.size() <<
65 " Size of Tower ID vector is " << towerIDs.size() <<
66 " Size of Strip ID vector is " << stripIDs.size() <<
67 " Size of Channel ID vector is " << channelIDs.size();
69 if ( statusIDs.size() == 0 || ccuIDs.size() == 0 || positionIDs.size() == 0 ) {
70 edm::LogError(
"EcalDCCTB07UnpackingModule") <<
"Some of the mapping info is missing! Check config files! " <<
71 " Size of status ID vector is " << statusIDs.size() <<
72 " Size of ccu ID vector is " << ccuIDs.size() <<
73 " positionIDs size is " << positionIDs.size();
77 if ( ics.size() != towerIDs.size() || ics.size() != stripIDs.size() || ics.size() != channelIDs.size() ||
78 towerIDs.size() != stripIDs.size() || towerIDs.size() != channelIDs.size() ||
79 stripIDs.size() != channelIDs.size() )
80 edm::LogError(
"EcalDCCTB07UnpackingModule") <<
"Mapping information is corrupted. " <<
81 "Tower/DQM position/strip/channel vectors are of different size! Check cfi files! \n" <<
82 " Size of IC vector is " << ics.size() <<
83 " Size of Tower ID vector is " << towerIDs.size() <<
84 " Size of Strip ID vector is " << stripIDs.size() <<
85 " Size of Channel ID vector is " << channelIDs.size();
87 if ( statusIDs.size() != ccuIDs.size() || statusIDs.size() != positionIDs.size() ||
88 ccuIDs.size() != positionIDs.size() )
89 edm::LogError(
"EcalDCCTB07UnpackingModule") <<
"Mapping information is corrupted. " <<
90 "Status/CCU ID/DQM position vectors are of different size! Check cfi files! \n" <<
91 " Size of status ID vector is " << statusIDs.size() <<
92 " Size of ccu ID vector is " << ccuIDs.size() <<
93 " positionIDs size is " << positionIDs.size();
95 int cryIcMap[68][5][5];
96 int tbStatusToLocation[71];
97 int tbTowerIDToLocation[201];
98 for (
unsigned it=1; it <= 68; ++it )
99 for (
unsigned is=1; is <=5; ++is )
100 for (
unsigned ic=1; ic <=5; ++ic)
101 cryIcMap[it-1][is-1][ic-1] = 1700;
103 for (
unsigned it=1; it <=71; ++it)
104 tbStatusToLocation[it-1] = it - 1;
106 for (
unsigned it=1; it <= 201; ++it)
107 tbTowerIDToLocation[it-1] = it - 1;
110 for(
unsigned int i=0;
i < ics.size(); ++
i) {
111 int tower = towerIDs[
i];
113 int channel = channelIDs[
i];
115 cryIcMap[tower-1][strip-1][channel-1] = ic;
117 for(
unsigned int i = 0;
i < statusIDs.size(); ++
i) {
118 int is = statusIDs[
i];
120 int itEB = positionIDs[
i];
122 tbStatusToLocation[is] = itEB;
123 tbTowerIDToLocation[it] = itEB;
134 produces<EBDigiCollection>(
"ebDigis");
135 produces<EEDigiCollection>(
"eeDigis");
136 produces<EcalMatacqDigiCollection>();
137 produces<EcalPnDiodeDigiCollection>();
138 produces<EcalRawDataCollection>();
139 produces<EcalTrigPrimDigiCollection>(
"EBTT");
142 produces<EcalTBHodoscopeRawInfo>();
143 produces<EcalTBTDCRawInfo>();
144 produces<EcalTBEventHeader>();
147 produces<EBDetIdCollection>(
"EcalIntegrityDCCSizeErrors");
148 produces<EcalElectronicsIdCollection>(
"EcalIntegrityTTIdErrors");
149 produces<EcalElectronicsIdCollection>(
"EcalIntegrityBlockSizeErrors");
150 produces<EBDetIdCollection>(
"EcalIntegrityChIdErrors");
151 produces<EBDetIdCollection>(
"EcalIntegrityGainErrors");
152 produces<EBDetIdCollection>(
"EcalIntegrityGainSwitchErrors");
155 produces<EcalElectronicsIdCollection>(
"EcalIntegrityMemTtIdErrors");
156 produces<EcalElectronicsIdCollection>(
"EcalIntegrityMemBlockSize");
157 produces<EcalElectronicsIdCollection>(
"EcalIntegrityMemChIdErrors");
158 produces<EcalElectronicsIdCollection>(
"EcalIntegrityMemGainErrors");
263 (*productHeader).setSmInBeam(
id);
268 *productTTId, *productBlockSize,
269 *productChId, *productGain, *productGainSwitch,
270 *productMemTtId, *productMemBlockSize,
271 *productMemGain, *productMemChIdErrors,
272 *productTriggerPrimitives);
273 int runType = (*productDCCHeader)[0].getRunType();
275 (*productHeader).setTriggerMask(0x1);
276 else if ( runType == 4 || runType == 5 || runType == 6 )
277 (*productHeader).setTriggerMask(0x2000);
278 else if ( runType == 9 || runType == 10 || runType == 11 )
279 (*productHeader).setTriggerMask(0x800);
280 LogDebug(
"EcalDCCTB07UnpackingModule") <<
"Event type is " << (*productHeader).eventType() <<
" dbEventType " << (*productHeader).dbEventType();
298 e.
put(productMatacq);
299 e.
put(productDCCHeader);
300 e.
put(productTriggerPrimitives,
"EBTT");
316 e.
put(productHeader);
319 std::cout <<
"[EcalDCCTB07UnpackingModule] " << e.
what() << std::endl;
321 std::cout <<
"[EcalDCCTB07UnpackingModule] " << e.
what() << std::endl;
323 std::cout <<
"[EcalDCCTB07UnpackingModule] " << e.
what() << std::endl;
325 std::cout <<
"[EcalDCCTB07UnpackingModule] Unknown exception ..." << std::endl;
virtual char const * what() const
T getUntrackedParameter(std::string const &, T const &) const
TableDataFormatter * tableFormatter_
const char * what() const
edm::SortedCollection< EcalMatacqDigi > EcalMatacqDigiCollection
#define END_DCC_FED_ID_GLOBAL
EcalTB07DaqFormatter * formatter_
bool getByType(Handle< PROD > &result) const
size_t size() const
Lenght of the data buffer in bytes.
void produce(edm::Event &e, const edm::EventSetup &c)
Produce digis out of raw data.
CamacTBDataFormatter * camacTBformatter_
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
virtual ~EcalDCCTB07UnpackingModule()
Destructor.
MatacqTBDataFormatter * matacqFormatter_
EcalSupervisorTBDataFormatter * ecalSupervisorFormatter_
#define ECAL_SUPERVISOR_FED_ID
char data[epos_bytes_allocation]
const char * what() const
#define BEG_DCC_FED_ID_GLOBAL
EcalDCCTB07UnpackingModule(const edm::ParameterSet &pset)
Constructor.