CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Attributes | Static Private Attributes
HcalDigiToRawuHTR Class Reference
Inheritance diagram for HcalDigiToRawuHTR:
edm::global::EDProducer<> edm::global::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 HcalDigiToRawuHTR (const edm::ParameterSet &)
 
void produce (edm::StreamID, edm::Event &, const edm::EventSetup &) const override
 
 ~HcalDigiToRawuHTR () override
 
- Public Member Functions inherited from edm::global::EDProducer<>
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
EDProduceroperator= (const EDProducer &)=delete
 
bool wantsGlobalLuminosityBlocks () const noexcept final
 
bool wantsGlobalRuns () const noexcept final
 
bool wantsInputProcessBlocks () const noexcept final
 
bool wantsProcessBlocks () const noexcept final
 
bool wantsStreamLuminosityBlocks () const noexcept final
 
bool wantsStreamRuns () const noexcept final
 
- Public Member Functions inherited from edm::global::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
std::vector< bool > const & recordProvenanceList () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
TypeLabelList const & typeLabelList () const
 used by the fwk to register the list of products of this module More...
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESResolverIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESResolverIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::array< std::vector< ModuleDescription const *> *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const *> const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::global::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Attributes

const int _verbosity
 
const bool packHBTDC_
 
const bool premix_
 
const vector< int > tdc1_
 
const vector< int > tdc2_
 
const edm::ESGetToken< HcalElectronicsMap, HcalElectronicsMapRcdtok_electronicsMap_
 
const edm::EDGetTokenT< HBHEDigiCollectiontok_HBHEDigiCollection_
 
const edm::EDGetTokenT< HFDigiCollectiontok_HFDigiCollection_
 
const edm::EDGetTokenT< HcalDataFrameContainer< QIE10DataFrame > > tok_QIE10DigiCollection_
 
const edm::EDGetTokenT< HcalDataFrameContainer< QIE11DataFrame > > tok_QIE11DigiCollection_
 
const edm::EDGetTokenT< HcalTrigPrimDigiCollectiontok_TPDigiCollection_
 

Static Private Attributes

static constexpr int tdcmax_ = 49
 

Additional Inherited Members

- Public Types inherited from edm::global::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
template<typename T >
using BranchAliasSetterT = ProductRegistryHelper::BranchAliasSetterT< T >
 
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex > >
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Protected Member Functions inherited from edm::ProducerBase
template<Transition Tr = Transition::Event>
auto produces (std::string instanceName) noexcept
 declare what type of product will make and with which optional label More...
 
template<Transition B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<BranchType B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
template<Transition Tr = Transition::Event>
auto produces () noexcept
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
void resetItemsToGetFrom (BranchType iType)
 

Detailed Description

Definition at line 43 of file HcalDigiToRawuHTR.cc.

Constructor & Destructor Documentation

◆ HcalDigiToRawuHTR()

HcalDigiToRawuHTR::HcalDigiToRawuHTR ( const edm::ParameterSet iConfig)
explicit

Definition at line 69 of file HcalDigiToRawuHTR.cc.

References mps_fire::i, tdc1_, tdc2_, and tdcmax_.

70  : _verbosity(iConfig.getUntrackedParameter<int>("Verbosity", 0)),
71  tdc1_(iConfig.getParameter<vector<int>>("tdc1")),
72  tdc2_(iConfig.getParameter<vector<int>>("tdc2")),
73  packHBTDC_(iConfig.getParameter<bool>("packHBTDC")),
78  tok_HBHEDigiCollection_(consumes<HBHEDigiCollection>(iConfig.getParameter<edm::InputTag>("HBHEqie8"))),
79  tok_HFDigiCollection_(consumes<HFDigiCollection>(iConfig.getParameter<edm::InputTag>("HFqie8"))),
80  tok_TPDigiCollection_(consumes<HcalTrigPrimDigiCollection>(iConfig.getParameter<edm::InputTag>("TP"))),
81  tok_electronicsMap_(esConsumes<HcalElectronicsMap, HcalElectronicsMapRcd>(
82  edm::ESInputTag("", iConfig.getParameter<std::string>("ElectronicsMap")))),
83  premix_(iConfig.getParameter<bool>("premix")) {
84  produces<FEDRawDataCollection>("");
85  for (size_t i = 0; i < tdc1_.size(); i++) {
86  if (!(tdc1_.at(i) >= 0 && tdc1_.at(i) <= tdc2_.at(i) && tdc2_.at(i) <= tdcmax_))
87  edm::LogWarning("HcalDigiToRawuHTR")
88  << " incorrect TDC ranges " << i << "-th element: " << tdc1_.at(i) << ", " << tdc2_.at(i) << ", " << tdcmax_;
89  }
90 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
const edm::EDGetTokenT< HBHEDigiCollection > tok_HBHEDigiCollection_
static constexpr int tdcmax_
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getUntrackedParameter(std::string const &, T const &) const
const edm::ESGetToken< HcalElectronicsMap, HcalElectronicsMapRcd > tok_electronicsMap_
const vector< int > tdc1_
Log< level::Warning, false > LogWarning
const edm::EDGetTokenT< HcalDataFrameContainer< QIE11DataFrame > > tok_QIE11DigiCollection_
const edm::EDGetTokenT< HcalTrigPrimDigiCollection > tok_TPDigiCollection_
const edm::EDGetTokenT< HFDigiCollection > tok_HFDigiCollection_
const vector< int > tdc2_
const edm::EDGetTokenT< HcalDataFrameContainer< QIE10DataFrame > > tok_QIE10DigiCollection_

◆ ~HcalDigiToRawuHTR()

HcalDigiToRawuHTR::~HcalDigiToRawuHTR ( )
override

Definition at line 92 of file HcalDigiToRawuHTR.cc.

92 {}

Member Function Documentation

◆ fillDescriptions()

void HcalDigiToRawuHTR::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 284 of file HcalDigiToRawuHTR.cc.

References edm::ConfigurationDescriptions::add(), edm::ConfigurationDescriptions::addDefault(), submitPVResolutionJobs::desc, ProducerED_cfi::InputTag, and AlCaHLTBitMon_QueryRunRegistry::string.

284  {
285  //The following says we do not know what parameters are allowed so do no validation
286  // Please change this to state exactly what you do use, even if it is no parameters
288  desc.addUntracked<int>("Verbosity", 0);
289  desc.add<vector<int>>("tdc1", {12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
290  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
291  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12});
292  desc.add<vector<int>>("tdc2", {14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
293  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
294  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14});
295  desc.add<bool>("packHBTDC", true);
296  desc.add<std::string>("ElectronicsMap", "");
297  desc.add<edm::InputTag>("QIE10", edm::InputTag("simHcalDigis", "HFQIE10DigiCollection"));
298  desc.add<edm::InputTag>("QIE11", edm::InputTag("simHcalDigis", "HBHEQIE11DigiCollection"));
299  desc.add<edm::InputTag>("HBHEqie8", edm::InputTag("simHcalDigis"));
300  desc.add<edm::InputTag>("HFqie8", edm::InputTag("simHcalDigis"));
301  desc.add<edm::InputTag>("TP", edm::InputTag("simHcalTriggerPrimitiveDigis"));
302  desc.add<bool>("premix", false);
303  descriptions.add("hcalDigiToRawuHTR", desc);
304  descriptions.addDefault(desc);
305 }
void addDefault(ParameterSetDescription const &psetDescription)
void add(std::string const &label, ParameterSetDescription const &psetDescription)

◆ produce()

void HcalDigiToRawuHTR::produce ( edm::StreamID  id,
edm::Event iEvent,
const edm::EventSetup iSetup 
) const
overridevirtual

Implements edm::global::EDProducerBase.

Definition at line 94 of file HcalDigiToRawuHTR.cc.

References _verbosity, UHTRpacker::addChannel(), edm::SortedCollection< T, SORT >::begin(), evf::compute_crc(), convertHB(), ALCARECOPPSCalTrackBasedSel_cff::detid, QIE11DataFrame::detid(), QIE10DataFrame::detid(), runTauDisplay::eid, edm::SortedCollection< T, SORT >::end(), UHTRpacker::exist(), l1tstage2_dqm_sourceclient-live_cfg::fedId, EcalFEDMonitor_cfi::FEDRawDataCollection, UHTRpacker::finalizeHeadTail(), edm::EventSetup::getHandle(), HcalBarrel, iEvent, l1ctLayer1_patternWriters_cff::ilink, edm::HandleBase::isValid(), B2GTnPMonitor_cfi::item, dqmiolumiharvest::j, HcalElectronicsMap::lookup(), HcalElectronicsMap::lookupTrigger(), genParticles_cff::map, FEDNumbering::MINHCALuTCAFEDID, eostools::move(), UHTRpacker::newUHTR(), packHBTDC_, premix_, hcalTTPDigis_cfi::presamples, QIE11DataFrame::presamples(), QIE10DataFrame::presamples(), l1tstage2_dqm_sourceclient-live_cfg::rawData, FEDHeader::set(), FEDTrailer::set(), edm::DataFrameContainer::size(), tdc1_, tdc2_, tdcmax_, tok_electronicsMap_, tok_HBHEDigiCollection_, tok_HFDigiCollection_, tok_QIE10DigiCollection_, tok_QIE11DigiCollection_, tok_TPDigiCollection_, EcalDeadCellTriggerPrimitiveFilter_cfi::tpDigiCollection, and UHTRpacker::uhtrs.

94  {
95  using namespace edm;
96 
98  const HcalElectronicsMap* readoutMap = item.product();
99 
100  //collection to be inserted into event
101  std::unique_ptr<FEDRawDataCollection> fed_buffers(new FEDRawDataCollection());
102 
103  //
104  // Extracting All the Collections containing useful Info
105  edm::Handle<QIE10DigiCollection> qie10DigiCollection;
106  edm::Handle<QIE11DigiCollection> qie11DigiCollection;
107  edm::Handle<HBHEDigiCollection> hbheDigiCollection;
108  edm::Handle<HFDigiCollection> hfDigiCollection;
110  iEvent.getByToken(tok_QIE10DigiCollection_, qie10DigiCollection);
111  iEvent.getByToken(tok_QIE11DigiCollection_, qie11DigiCollection);
112  iEvent.getByToken(tok_HBHEDigiCollection_, hbheDigiCollection);
113  iEvent.getByToken(tok_HFDigiCollection_, hfDigiCollection);
115 
116  // first argument is the fedid (minFEDID+crateId)
117  map<int, unique_ptr<HCalFED>> fedMap;
118 
119  // - - - - - - - - - - - - - - - - - - - - - - - - - - -
120  // QIE10 precision data
121  // - - - - - - - - - - - - - - - - - - - - - - - - - - -
122  UHTRpacker uhtrs;
123  // loop over each digi and allocate memory for each
124  if (qie10DigiCollection.isValid()) {
125  const QIE10DigiCollection& qie10dc = *(qie10DigiCollection);
126  for (unsigned int j = 0; j < qie10dc.size(); j++) {
127  QIE10DataFrame qiedf = static_cast<QIE10DataFrame>(qie10dc[j]);
128  DetId detid = qiedf.detid();
129  HcalElectronicsId eid(readoutMap->lookup(detid));
130  int crateId = eid.crateId();
131  int slotId = eid.slot();
132  int uhtrIndex = ((slotId & 0xF) << 8) | (crateId & 0xFF);
133  int presamples = qiedf.presamples();
134 
135  /* Defining a custom index that will encode only
136  the information about the crate and slot of a
137  given channel: crate: bits 0-7
138  slot: bits 8-12 */
139 
140  if (!uhtrs.exist(uhtrIndex)) {
141  uhtrs.newUHTR(uhtrIndex, presamples);
142  }
143  uhtrs.addChannel(uhtrIndex, qiedf, readoutMap, _verbosity);
144  }
145  }
146  // - - - - - - - - - - - - - - - - - - - - - - - - - - -
147  // QIE11 precision data
148  // - - - - - - - - - - - - - - - - - - - - - - - - - - -
149  //UHTRpacker uhtrs;
150  // loop over each digi and allocate memory for each
151  if (qie11DigiCollection.isValid()) {
152  const QIE11DigiCollection& qie11dc = *(qie11DigiCollection);
153  for (unsigned int j = 0; j < qie11dc.size(); j++) {
154  QIE11DataFrame qiedf = static_cast<QIE11DataFrame>(qie11dc[j]);
155  DetId detid = qiedf.detid();
156  HcalElectronicsId eid(readoutMap->lookup(detid));
157  int crateId = eid.crateId();
158  int slotId = eid.slot();
159  int uhtrIndex = ((slotId & 0xF) << 8) | (crateId & 0xFF);
160  int presamples = qiedf.presamples();
161 
162  // convert to hb qie data if hb
163  if (packHBTDC_ && HcalDetId(detid.rawId()).subdet() == HcalSubdetector::HcalBarrel)
164  qiedf = convertHB(qiedf, tdc1_, tdc2_, tdcmax_);
165 
166  if (!uhtrs.exist(uhtrIndex)) {
167  uhtrs.newUHTR(uhtrIndex, presamples);
168  }
169  uhtrs.addChannel(uhtrIndex, qiedf, readoutMap, _verbosity);
170  }
171  }
172  // - - - - - - - - - - - - - - - - - - - - - - - - - - -
173  // HF (QIE8) precision data
174  // - - - - - - - - - - - - - - - - - - - - - - - - - - -
175  // loop over each digi and allocate memory for each
176  if (hfDigiCollection.isValid()) {
177  const HFDigiCollection& qie8hfdc = *(hfDigiCollection);
178  for (HFDigiCollection::const_iterator qiedf = qie8hfdc.begin(); qiedf != qie8hfdc.end(); qiedf++) {
179  DetId detid = qiedf->id();
180 
181  HcalElectronicsId eid(readoutMap->lookup(detid));
182  int crateId = eid.crateId();
183  int slotId = eid.slot();
184  int uhtrIndex = (crateId & 0xFF) | ((slotId & 0xF) << 8);
185  int presamples = qiedf->presamples();
186 
187  if (!uhtrs.exist(uhtrIndex)) {
188  uhtrs.newUHTR(uhtrIndex, presamples);
189  }
190  uhtrs.addChannel(uhtrIndex, qiedf, readoutMap, premix_, _verbosity);
191  }
192  }
193  // - - - - - - - - - - - - - - - - - - - - - - - - - - -
194  // HBHE (QIE8) precision data
195  // - - - - - - - - - - - - - - - - - - - - - - - - - - -
196  // loop over each digi and allocate memory for each
197  if (hbheDigiCollection.isValid()) {
198  const HBHEDigiCollection& qie8hbhedc = *(hbheDigiCollection);
199  for (HBHEDigiCollection::const_iterator qiedf = qie8hbhedc.begin(); qiedf != qie8hbhedc.end(); qiedf++) {
200  DetId detid = qiedf->id();
201 
202  HcalElectronicsId eid(readoutMap->lookup(detid));
203  int crateId = eid.crateId();
204  int slotId = eid.slot();
205  int uhtrIndex = (crateId & 0xFF) | ((slotId & 0xF) << 8);
206  int presamples = qiedf->presamples();
207 
208  if (!uhtrs.exist(uhtrIndex)) {
209  uhtrs.newUHTR(uhtrIndex, presamples);
210  }
211  uhtrs.addChannel(uhtrIndex, qiedf, readoutMap, premix_, _verbosity);
212  }
213  }
214  // - - - - - - - - - - - - - - - - - - - - - - - - - - -
215  // TP data
216  // - - - - - - - - - - - - - - - - - - - - - - - - - - -
217  // loop over each digi and allocate memory for each
218  if (tpDigiCollection.isValid()) {
219  const HcalTrigPrimDigiCollection& qietpdc = *(tpDigiCollection);
220  for (HcalTrigPrimDigiCollection::const_iterator qiedf = qietpdc.begin(); qiedf != qietpdc.end(); qiedf++) {
221  DetId detid = qiedf->id();
223 
224  int crateId = eid.crateId();
225  int slotId = eid.slot();
226  int uhtrIndex = (crateId & 0xFF) | ((slotId & 0xF) << 8);
227  int ilink = eid.fiberIndex();
228  int itower = eid.fiberChanId();
229  int channelid = (itower & 0xF) | ((ilink & 0xF) << 4);
230  int presamples = qiedf->presamples();
231 
232  if (!uhtrs.exist(uhtrIndex)) {
233  uhtrs.newUHTR(uhtrIndex, presamples);
234  }
235  uhtrs.addChannel(uhtrIndex, qiedf, channelid, _verbosity);
236  }
237  }
238  // -----------------------------------------------------
239  // -----------------------------------------------------
240  // loop over each uHTR and format data
241  // -----------------------------------------------------
242  // -----------------------------------------------------
243  // loop over each uHTR and format data
244  for (UHTRpacker::UHTRMap::iterator uhtr = uhtrs.uhtrs.begin(); uhtr != uhtrs.uhtrs.end(); ++uhtr) {
245  uint64_t crateId = (uhtr->first) & 0xFF;
246  uint64_t slotId = (uhtr->first & 0xF00) >> 8;
247 
248  uhtrs.finalizeHeadTail(&(uhtr->second), _verbosity);
249  int fedId = FEDNumbering::MINHCALuTCAFEDID + crateId;
250  if (fedMap.find(fedId) == fedMap.end()) {
251  /* QUESTION: where should the orbit number come from? */
252  fedMap[fedId] =
253  std::make_unique<HCalFED>(fedId, iEvent.id().event(), iEvent.orbitNumber(), iEvent.bunchCrossing());
254  }
255  fedMap[fedId]->addUHTR(uhtr->second, crateId, slotId);
256  } // end loop over uhtr containers
257 
258  /* ------------------------------------------------------
259  ------------------------------------------------------
260  putting together the FEDRawDataCollection
261  ------------------------------------------------------
262  ------------------------------------------------------ */
263  for (map<int, unique_ptr<HCalFED>>::iterator fed = fedMap.begin(); fed != fedMap.end(); ++fed) {
264  int fedId = fed->first;
265 
266  auto& rawData = fed_buffers->FEDData(fedId);
267  fed->second->formatFEDdata(rawData);
268 
269  FEDHeader hcalFEDHeader(rawData.data());
270  hcalFEDHeader.set(rawData.data(), 1, iEvent.id().event(), iEvent.bunchCrossing(), fedId);
271  FEDTrailer hcalFEDTrailer(rawData.data() + (rawData.size() - 8));
272  hcalFEDTrailer.set(rawData.data() + (rawData.size() - 8),
273  rawData.size() / 8,
274  evf::compute_crc(rawData.data(), rawData.size()),
275  0,
276  0);
277 
278  } // end loop over FEDs with data
279 
280  iEvent.put(std::move(fed_buffers));
281 }
constexpr DetId detid() const
Get the detector id.
constexpr edm::DataFrame::id_type id() const
const edm::EDGetTokenT< HBHEDigiCollection > tok_HBHEDigiCollection_
void finalizeHeadTail(uhtrData *uhtr, bool verbosity)
Definition: PackerHelp.h:484
QIE11DataFrame convertHB(QIE11DataFrame qiehe, std::vector< int > const &tdc1, std::vector< int > const &tdc2, const int tdcmax)
Definition: PackerHelp.h:620
const DetId lookup(HcalElectronicsId fId) const
lookup the logical detid associated with the given electronics id
uhtrData * newUHTR(int uhtrIndex, int ps=0, int orn=0, int bcn=0, uint64_t evt=0)
Definition: PackerHelp.h:444
std::vector< T >::const_iterator const_iterator
static constexpr int tdcmax_
constexpr int presamples() const
for backward compatibility
constexpr DetId detid() const
Get the detector id.
int iEvent
Definition: GenABIO.cc:224
unsigned short compute_crc(unsigned char *buffer, unsigned int bufSize)
Definition: CRC16.h:46
const edm::ESGetToken< HcalElectronicsMap, HcalElectronicsMapRcd > tok_electronicsMap_
const_iterator begin() const
constexpr int presamples() const
for backward compatibility
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:130
const_iterator end() const
UHTRMap uhtrs
Definition: PackerHelp.h:316
Definition: DetId.h:17
unsigned long long uint64_t
Definition: Time.h:13
void addChannel(int uhtrIndex, edm::SortedCollection< HFDataFrame >::const_iterator &qiedf, const HcalElectronicsMap *readoutMap, bool premix, int verbosity=0)
Definition: PackerHelp.h:506
bool isValid() const
Definition: HandleBase.h:70
bool exist(int uhtrIndex)
Definition: PackerHelp.h:347
HLT enums.
const vector< int > tdc1_
static void set(unsigned char *header, uint8_t triggerType, uint32_t lvl1ID, uint16_t bxID, uint16_t sourceID, uint8_t version=0, bool moreHeaders=false)
Set all fields in the header.
Definition: FEDHeader.cc:25
const DetId lookupTrigger(HcalElectronicsId fId) const
brief lookup the trigger logical detid associated with the given electronics id
Readout chain identification for Hcal.
const edm::EDGetTokenT< HcalDataFrameContainer< QIE11DataFrame > > tok_QIE11DigiCollection_
const edm::EDGetTokenT< HcalTrigPrimDigiCollection > tok_TPDigiCollection_
def move(src, dest)
Definition: eostools.py:511
const edm::EDGetTokenT< HFDigiCollection > tok_HFDigiCollection_
const vector< int > tdc2_
const edm::EDGetTokenT< HcalDataFrameContainer< QIE10DataFrame > > tok_QIE10DigiCollection_

Member Data Documentation

◆ _verbosity

const int HcalDigiToRawuHTR::_verbosity
private

Definition at line 53 of file HcalDigiToRawuHTR.cc.

Referenced by produce().

◆ packHBTDC_

const bool HcalDigiToRawuHTR::packHBTDC_
private

Definition at line 56 of file HcalDigiToRawuHTR.cc.

Referenced by produce().

◆ premix_

const bool HcalDigiToRawuHTR::premix_
private

Definition at line 66 of file HcalDigiToRawuHTR.cc.

Referenced by produce().

◆ tdc1_

const vector<int> HcalDigiToRawuHTR::tdc1_
private

Definition at line 54 of file HcalDigiToRawuHTR.cc.

Referenced by HcalDigiToRawuHTR(), and produce().

◆ tdc2_

const vector<int> HcalDigiToRawuHTR::tdc2_
private

Definition at line 55 of file HcalDigiToRawuHTR.cc.

Referenced by HcalDigiToRawuHTR(), and produce().

◆ tdcmax_

constexpr int HcalDigiToRawuHTR::tdcmax_ = 49
staticprivate

Definition at line 57 of file HcalDigiToRawuHTR.cc.

Referenced by HcalDigiToRawuHTR(), and produce().

◆ tok_electronicsMap_

const edm::ESGetToken<HcalElectronicsMap, HcalElectronicsMapRcd> HcalDigiToRawuHTR::tok_electronicsMap_
private

Definition at line 64 of file HcalDigiToRawuHTR.cc.

Referenced by produce().

◆ tok_HBHEDigiCollection_

const edm::EDGetTokenT<HBHEDigiCollection> HcalDigiToRawuHTR::tok_HBHEDigiCollection_
private

Definition at line 61 of file HcalDigiToRawuHTR.cc.

Referenced by produce().

◆ tok_HFDigiCollection_

const edm::EDGetTokenT<HFDigiCollection> HcalDigiToRawuHTR::tok_HFDigiCollection_
private

Definition at line 62 of file HcalDigiToRawuHTR.cc.

Referenced by produce().

◆ tok_QIE10DigiCollection_

const edm::EDGetTokenT<HcalDataFrameContainer<QIE10DataFrame> > HcalDigiToRawuHTR::tok_QIE10DigiCollection_
private

Definition at line 59 of file HcalDigiToRawuHTR.cc.

Referenced by produce().

◆ tok_QIE11DigiCollection_

const edm::EDGetTokenT<HcalDataFrameContainer<QIE11DataFrame> > HcalDigiToRawuHTR::tok_QIE11DigiCollection_
private

Definition at line 60 of file HcalDigiToRawuHTR.cc.

Referenced by produce().

◆ tok_TPDigiCollection_

const edm::EDGetTokenT<HcalTrigPrimDigiCollection> HcalDigiToRawuHTR::tok_TPDigiCollection_
private

Definition at line 63 of file HcalDigiToRawuHTR.cc.

Referenced by produce().