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
44 fedRawDataCollectionTag_(pset.getParameter<edm::InputTag>(
"fedRawDataCollectionTag")) {
63 if ( ics.size() == 0 || towerIDs.size() == 0 || stripIDs.size() == 0 || channelIDs.size() == 0 ){
64 edm::LogError(
"EcalDCCTB07UnpackingModule") <<
"Some of the mapping info is missing! Check config files! " <<
65 " Size of IC vector is " << ics.size() <<
66 " Size of Tower ID vector is " << towerIDs.size() <<
67 " Size of Strip ID vector is " << stripIDs.size() <<
68 " Size of Channel ID vector is " << channelIDs.size();
70 if ( statusIDs.size() == 0 || ccuIDs.size() == 0 || positionIDs.size() == 0 ) {
71 edm::LogError(
"EcalDCCTB07UnpackingModule") <<
"Some of the mapping info is missing! Check config files! " <<
72 " Size of status ID vector is " << statusIDs.size() <<
73 " Size of ccu ID vector is " << ccuIDs.size() <<
74 " positionIDs size is " << positionIDs.size();
78 if ( ics.size() != towerIDs.size() || ics.size() != stripIDs.size() || ics.size() != channelIDs.size() ||
79 towerIDs.size() != stripIDs.size() || towerIDs.size() != channelIDs.size() ||
80 stripIDs.size() != channelIDs.size() )
81 edm::LogError(
"EcalDCCTB07UnpackingModule") <<
"Mapping information is corrupted. " <<
82 "Tower/DQM position/strip/channel vectors are of different size! Check cfi files! \n" <<
83 " Size of IC vector is " << ics.size() <<
84 " Size of Tower ID vector is " << towerIDs.size() <<
85 " Size of Strip ID vector is " << stripIDs.size() <<
86 " Size of Channel ID vector is " << channelIDs.size();
88 if ( statusIDs.size() != ccuIDs.size() || statusIDs.size() != positionIDs.size() ||
89 ccuIDs.size() != positionIDs.size() )
90 edm::LogError(
"EcalDCCTB07UnpackingModule") <<
"Mapping information is corrupted. " <<
91 "Status/CCU ID/DQM position vectors are of different size! Check cfi files! \n" <<
92 " Size of status ID vector is " << statusIDs.size() <<
93 " Size of ccu ID vector is " << ccuIDs.size() <<
94 " positionIDs size is " << positionIDs.size();
96 int cryIcMap[68][5][5];
97 int tbStatusToLocation[71];
98 int tbTowerIDToLocation[201];
99 for (
unsigned it=1; it <= 68; ++it )
100 for (
unsigned is=1; is <=5; ++is )
101 for (
unsigned ic=1; ic <=5; ++ic)
102 cryIcMap[it-1][is-1][ic-1] = 1700;
104 for (
unsigned it=1; it <=71; ++it)
105 tbStatusToLocation[it-1] = it - 1;
107 for (
unsigned it=1; it <= 201; ++it)
108 tbTowerIDToLocation[it-1] = it - 1;
111 for(
unsigned int i=0;
i < ics.size(); ++
i) {
112 int tower = towerIDs[
i];
113 int strip = stripIDs[
i];
114 int channel = channelIDs[
i];
116 cryIcMap[tower-1][strip-1][channel-1] = ic;
118 for(
unsigned int i = 0;
i < statusIDs.size(); ++
i) {
119 int is = statusIDs[
i];
121 int itEB = positionIDs[
i];
123 tbStatusToLocation[is] = itEB;
124 tbTowerIDToLocation[it] = itEB;
135 produces<EBDigiCollection>(
"ebDigis");
136 produces<EEDigiCollection>(
"eeDigis");
137 produces<EcalMatacqDigiCollection>();
138 produces<EcalPnDiodeDigiCollection>();
139 produces<EcalRawDataCollection>();
140 produces<EcalTrigPrimDigiCollection>(
"EBTT");
143 produces<EcalTBHodoscopeRawInfo>();
144 produces<EcalTBTDCRawInfo>();
145 produces<EcalTBEventHeader>();
148 produces<EBDetIdCollection>(
"EcalIntegrityDCCSizeErrors");
149 produces<EcalElectronicsIdCollection>(
"EcalIntegrityTTIdErrors");
150 produces<EcalElectronicsIdCollection>(
"EcalIntegrityBlockSizeErrors");
151 produces<EBDetIdCollection>(
"EcalIntegrityChIdErrors");
152 produces<EBDetIdCollection>(
"EcalIntegrityGainErrors");
153 produces<EBDetIdCollection>(
"EcalIntegrityGainSwitchErrors");
156 produces<EcalElectronicsIdCollection>(
"EcalIntegrityMemTtIdErrors");
157 produces<EcalElectronicsIdCollection>(
"EcalIntegrityMemBlockSize");
158 produces<EcalElectronicsIdCollection>(
"EcalIntegrityMemChIdErrors");
159 produces<EcalElectronicsIdCollection>(
"EcalIntegrityMemGainErrors");
264 (*productHeader).setSmInBeam(
id);
269 *productTTId, *productBlockSize,
270 *productChId, *productGain, *productGainSwitch,
271 *productMemTtId, *productMemBlockSize,
272 *productMemGain, *productMemChIdErrors,
273 *productTriggerPrimitives);
274 int runType = (*productDCCHeader)[0].getRunType();
276 (*productHeader).setTriggerMask(0x1);
277 else if ( runType == 4 || runType == 5 || runType == 6 )
278 (*productHeader).setTriggerMask(0x2000);
279 else if ( runType == 9 || runType == 10 || runType == 11 )
280 (*productHeader).setTriggerMask(0x800);
281 LogDebug(
"EcalDCCTB07UnpackingModule") <<
"Event type is " << (*productHeader).eventType() <<
" dbEventType " << (*productHeader).dbEventType();
299 e.
put(productMatacq);
300 e.
put(productDCCHeader);
301 e.
put(productTriggerPrimitives,
"EBTT");
317 e.
put(productHeader);
320 std::cout <<
"[EcalDCCTB07UnpackingModule] " << e.
what() << std::endl;
322 std::cout <<
"[EcalDCCTB07UnpackingModule] " << e.
what() << std::endl;
324 std::cout <<
"[EcalDCCTB07UnpackingModule] " << e.
what() << std::endl;
326 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_
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_
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
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
#define BEG_DCC_FED_ID_GLOBAL
EcalDCCTB07UnpackingModule(const edm::ParameterSet &pset)
Constructor.