74 virtual void beginStream(
StreamID)
override;
76 virtual void endStream()
override;
78 void makeECalTPGs(uint32_t lPhi,
UCTCTP7RawData& ctp7Data, std::auto_ptr<EcalTrigPrimDigiCollection>& ecalTPGs);
80 void makeHCalTPGs(uint32_t lPhi,
UCTCTP7RawData& ctp7Data, std::auto_ptr<HcalTrigPrimDigiCollection>& hcalTPGs);
82 void makeHFTPGs(uint32_t lPhi,
UCTCTP7RawData& ctp7Data, std::auto_ptr<HcalTrigPrimDigiCollection>& hfTPGs);
113 fedRawDataLabel(iConfig.getParameter<
InputTag>(
"fedRawDataLabel")),
114 fedIDs(iConfig.getParameter<std::vector<int> >(
"FEDIDs")),
116 verbose(iConfig.getParameter<bool>(
"verbose"))
119 produces<EcalTrigPrimDigiCollection>();
120 produces<HcalTrigPrimDigiCollection>();
121 produces<HcalTrigPrimDigiCollection>(
"hfTPGDigis");
152 if (fedRawDataCollection.isValid()) {
154 for(uint32_t
i = 0;
i <
fedIDs.size();
i++) {
158 const FEDRawData& fedRawData = fedRawDataCollection->FEDData(fed);
167 for(uint32_t
i = 0;
i < daqData.
nAMCs();
i++) {
174 uint32_t lPhi = amcData.layer1Phi();
189 LogError(
"L1T") <<
"Cannot unpack: no collection found";
194 iEvent.
put(ecalTPGs);
195 iEvent.
put(hcalTPGs);
196 iEvent.
put(hfTPGs,
"hfTPGDigis");
199 if(
verbose &&
event == 5)
LogDebug(
"L1TCaloLayer1") <<
"L1TCaloLayer1RawToDigi: Goodbye! Tired of printing junk" << endl;
205 for(uint32_t iPhi = 0; iPhi < 4; iPhi++) {
206 int cPhi = - 1 + lPhi * 4 + iPhi;
207 if(cPhi == 0) cPhi = 72;
208 else if(cPhi == -1) cPhi = 71;
210 LogError(
"L1TCaloLayer1RawToDigi") <<
"L1TCaloLayer1RawToDigi: Major error in makeECalTPGs" << std::endl;
213 for(
int cEta = -28; cEta <= 28; cEta++) {
215 bool negativeEta =
false;
216 if(cEta < 0) negativeEta =
true;
217 uint32_t iEta =
abs(cEta);
225 uint32_t towerDatum = ctp7Data.
getET(cType, negativeEta, iEta, iPhi);
226 if(ctp7Data.
getFB(cType, negativeEta, iEta, iPhi)) towerDatum |= 0x0100;
227 if(ctp7Data.
isTowerMasked(cType, negativeEta, iEta, iPhi)) towerDatum |= 0x2000;
228 if(ctp7Data.
isLinkMasked(cType, negativeEta, iEta, iPhi)) towerDatum |= 0x4000;
231 ctp7Data.
isLinkDown(cType, negativeEta, iEta, iPhi)) towerDatum |= 0x8000;
233 int zSide = cEta / ((int) iEta);
239 ecalTPGs->push_back(tpg);
248 for(uint32_t iPhi = 0; iPhi < 4; iPhi++) {
249 int cPhi = - 1 + lPhi * 4 + iPhi;
250 if(cPhi == 0) cPhi = 72;
251 else if(cPhi == -1) cPhi = 71;
253 LogError(
"L1TCaloLayer1RawToDigi") <<
"L1TCaloLayer1RawToDigi: Major error in makeHCalTPGs" << std::endl;
256 for(
int cEta = -28; cEta <= 28; cEta++) {
258 bool negativeEta =
false;
259 if(cEta < 0) negativeEta =
true;
260 uint32_t iEta =
abs(cEta);
268 uint32_t towerDatum = ctp7Data.
getET(cType, negativeEta, iEta, iPhi);
269 if(ctp7Data.
getFB(cType, negativeEta, iEta, iPhi)) towerDatum |= 0x0100;
270 if(ctp7Data.
isLinkMisaligned(cType, negativeEta, iEta, iPhi)) towerDatum |= 0x0200;
271 if(ctp7Data.
isLinkInError(cType, negativeEta, iEta, iPhi)) towerDatum |= 0x0400;
272 if(ctp7Data.
isLinkDown(cType, negativeEta, iEta, iPhi)) towerDatum |= 0x0800;
273 if(ctp7Data.
isTowerMasked(cType, negativeEta, iEta, iPhi)) towerDatum |= 0x2000;
274 if(ctp7Data.
isLinkMasked(cType, negativeEta, iEta, iPhi)) towerDatum |= 0x4000;
277 ctp7Data.
isLinkDown(cType, negativeEta, iEta, iPhi)) towerDatum |= 0x8000;
283 hcalTPGs->push_back(tpg);
292 for(uint32_t side = 0; side <= 1; side++) {
293 bool negativeEta =
false;
294 if(side == 0) negativeEta =
true;
295 for(uint32_t iEta = 30; iEta <= 40; iEta++) {
296 for(uint32_t iPhi = 0; iPhi < 2; iPhi++) {
297 if(iPhi == 1 && iEta == 40) iEta = 41;
298 int cPhi = 1 + lPhi * 2 + iPhi;
299 if(iEta == 40 || iEta == 41) cPhi = lPhi + 1;
301 if(negativeEta) cEta = -iEta;
309 uint32_t towerDatum = ctp7Data.
getET(cType, negativeEta, iEta, iPhi);
310 if(ctp7Data.
getFB(cType, negativeEta, iEta, iPhi)) towerDatum |= 0x0100;
311 if(ctp7Data.
isLinkMisaligned(cType, negativeEta, iEta, iPhi)) towerDatum |= 0x0200;
312 if(ctp7Data.
isLinkInError(cType, negativeEta, iEta, iPhi)) towerDatum |= 0x0400;
313 if(ctp7Data.
isLinkDown(cType, negativeEta, iEta, iPhi)) towerDatum |= 0x0800;
314 if(ctp7Data.
isTowerMasked(cType, negativeEta, iEta, iPhi)) towerDatum |= 0x2000;
315 if(ctp7Data.
isLinkMasked(cType, negativeEta, iEta, iPhi)) towerDatum |= 0x4000;
318 ctp7Data.
isLinkDown(cType, negativeEta, iEta, iPhi)) towerDatum |= 0x8000;
324 hfTPGs->push_back(tpg);
std::vector< int > fedIDs
void setSample(int i, const HcalTriggerPrimitiveSample &sam)
#define DEFINE_FWK_MODULE(type)
bool isLinkMasked(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)
bool isLinkDown(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)
~L1TCaloLayer1RawToDigi()
size_t size() const
Lenght of the data buffer in bytes.
void addDefault(ParameterSetDescription const &psetDescription)
void setSample(int i, const EcalTriggerPrimitiveSample &sam)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
bool isLinkInError(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)
bool isTowerMasked(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)
Abs< T >::type abs(const T &t)
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
void makeECalTPGs(uint32_t lPhi, UCTCTP7RawData &ctp7Data, std::auto_ptr< EcalTrigPrimDigiCollection > &ecalTPGs)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
L1TCaloLayer1RawToDigi(const ParameterSet &)
const uint32_t * amcPayload(uint32_t amc)
unsigned long long uint64_t
uint32_t getET(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)
static void fillDescriptions(ConfigurationDescriptions &descriptions)
bool getFB(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)
virtual void endStream() override
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
virtual void produce(Event &, const EventSetup &) override
void makeHFTPGs(uint32_t lPhi, UCTCTP7RawData &ctp7Data, std::auto_ptr< HcalTrigPrimDigiCollection > &hfTPGs)
virtual void beginStream(StreamID) override
void makeHCalTPGs(uint32_t lPhi, UCTCTP7RawData &ctp7Data, std::auto_ptr< HcalTrigPrimDigiCollection > &hcalTPGs)
bool isLinkMisaligned(CaloType cType, bool negativeEta, uint32_t cEta, uint32_t iPhi)