108 map<int,unique_ptr<HCalFED> > fedMap;
117 for (
unsigned int j=0; j < qie10dc.
size(); j++){
121 int crateId =
eid.crateId();
122 int slotId =
eid.slot();
123 int uhtrIndex = ((slotId&0xF)<<8) | (crateId&0xFF);
131 if( ! uhtrs.
exist( uhtrIndex ) ){
132 uhtrs.
newUHTR( uhtrIndex , presamples );
144 for (
unsigned int j=0; j < qie11dc.
size(); j++){
148 int crateId =
eid.crateId();
149 int slotId =
eid.slot();
150 int uhtrIndex = ((slotId&0xF)<<8) | (crateId&0xFF);
153 if( ! uhtrs.
exist(uhtrIndex) ){
154 uhtrs.
newUHTR( uhtrIndex , presamples );
169 int crateId =
eid.crateId();
170 int slotId =
eid.slot();
171 int uhtrIndex = (crateId&0xFF) | ((slotId&0xF)<<8) ;
174 if( ! uhtrs.
exist(uhtrIndex) ){
175 uhtrs.
newUHTR( uhtrIndex , presamples );
190 int crateId =
eid.crateId();
191 int slotId =
eid.slot();
192 int uhtrIndex = (crateId&0xFF) | ((slotId&0xF)<<8) ;
195 if( ! uhtrs.
exist(uhtrIndex) ){
196 uhtrs.
newUHTR( uhtrIndex , presamples );
211 int crateId =
eid.crateId();
212 int slotId =
eid.slot();
213 int uhtrIndex = (crateId&0xFF) | ((slotId&0xF)<<8);
214 int ilink =
eid.fiberIndex();
215 int itower =
eid.fiberChanId();
216 int channelid = (itower&0xF) | ((ilink&0xF)<<4);
219 if( ! uhtrs.
exist(uhtrIndex) ){
220 uhtrs.
newUHTR( uhtrIndex , presamples );
232 for( UHTRpacker::UHTRMap::iterator uhtr = uhtrs.
uhtrs.begin() ; uhtr != uhtrs.
uhtrs.end() ; ++uhtr){
236 uint64_t crateId = (uhtr->first)&0xFF;
237 uint64_t slotId = (uhtr->first&0xF00)>>8;
241 if( fedMap.find(fedId) == fedMap.end() ){
245 fedMap[fedId]->addUHTR(uhtr->second,crateId,slotId);
253 for(
map<
int,unique_ptr<HCalFED> >::iterator fed = fedMap.begin() ; fed != fedMap.end() ; ++fed ){
255 int fedId = fed->first;
257 auto & rawData = fed_buffers->FEDData(fedId);
258 fed->second->formatFEDdata(rawData);
262 FEDTrailer hcalFEDTrailer(rawData.data()+(rawData.size()-8));
263 hcalFEDTrailer.set(rawData.data()+(rawData.size()-8), rawData.size()/8,
evf::compute_crc(rawData.data(),rawData.size()), 0, 0);
DetId detid() const
Get the detector id.
EventNumber_t event() const
edm::EDGetTokenT< HBHEDigiCollection > tok_HBHEDigiCollection_
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
void finalizeHeadTail(uhtrData *uhtr, bool verbosity)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
int presamples() const
for backward compatibility
uhtrData * newUHTR(int uhtrIndex, int ps=0, int orn=0, int bcn=0, uint64_t evt=0)
std::vector< HFDataFrame >::const_iterator const_iterator
int bunchCrossing() const
edm::Handle< HcalTrigPrimDigiCollection > tpDigiCollection
void addChannel(int uhtrIndex, edm::SortedCollection< HFDataFrame >::const_iterator &qiedf, const HcalElectronicsMap *readoutMap, int verbosity=0)
edm::EDGetTokenT< HcalDataFrameContainer< QIE10DataFrame > > tok_QIE10DigiCollection_
std::string electronicsMapLabel_
unsigned short compute_crc(unsigned char *buffer, unsigned int bufSize)
edm::EDGetTokenT< HFDigiCollection > tok_HFDigiCollection_
edm::DataFrame::id_type id() const
DetId detid() const
Get the detector id.
edm::Handle< HFDigiCollection > hfDigiCollection
edm::Handle< QIE10DigiCollection > qie10DigiCollection
const_iterator end() const
unsigned long long uint64_t
int presamples() const
for backward compatibility
bool exist(int uhtrIndex)
edm::Handle< QIE11DigiCollection > qie11DigiCollection
edm::Handle< HBHEDigiCollection > hbheDigiCollection
const DetId lookupTrigger(HcalElectronicsId fId) const
brief lookup the trigger logical detid associated with the given electronics id
T const * product() const
Readout chain identification for Hcal.
edm::EDGetTokenT< HcalTrigPrimDigiCollection > tok_TPDigiCollection_
const DetId lookup(HcalElectronicsId fId) const
lookup the logical detid associated with the given electronics id
const_iterator begin() const
edm::EDGetTokenT< HcalDataFrameContainer< QIE11DataFrame > > tok_QIE11DigiCollection_