CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
HcalUHTRTableProducer Class Reference
Inheritance diagram for HcalUHTRTableProducer:
edm::stream::EDProducer<>

Public Member Functions

 HcalUHTRTableProducer (const edm::ParameterSet &iConfig)
 
 ~HcalUHTRTableProducer () override
 
- Public Member Functions inherited from edm::stream::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
 
const EDProduceroperator= (const EDProducer &)=delete
 

Private Member Functions

void produce (edm::Event &, edm::EventSetup const &) override
 

Private Attributes

std::vector< int > fedUnpackList_
 
edm::InputTag tagRaw_
 
edm::EDGetTokenT< FEDRawDataCollectiontokenRaw_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

Detailed Description

Definition at line 24 of file HcalUHTRTableProducer.cc.

Constructor & Destructor Documentation

◆ HcalUHTRTableProducer()

HcalUHTRTableProducer::HcalUHTRTableProducer ( const edm::ParameterSet iConfig)
inlineexplicit

Definition at line 31 of file HcalUHTRTableProducer.cc.

References fedUnpackList_, mps_fire::i, FEDNumbering::MAXHCALFEDID, FEDNumbering::MAXHCALuTCAFEDID, FEDNumbering::MINHCALFEDID, FEDNumbering::MINHCALuTCAFEDID, tagRaw_, and tokenRaw_.

32  : tagRaw_(iConfig.getParameter<edm::InputTag>("InputLabel")),
33  fedUnpackList_(iConfig.getUntrackedParameter<std::vector<int>>("FEDs", std::vector<int>())) {
34  tokenRaw_ = consumes<FEDRawDataCollection>(tagRaw_);
35  produces<nanoaod::FlatTable>("uHTRTable");
36 
37  if (fedUnpackList_.empty()) {
38  // VME range for back-compatibility
40  fedUnpackList_.push_back(i);
41 
42  // uTCA range
44  fedUnpackList_.push_back(i);
45  }
46  }
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
edm::EDGetTokenT< FEDRawDataCollection > tokenRaw_
T getUntrackedParameter(std::string const &, T const &) const
std::vector< int > fedUnpackList_

◆ ~HcalUHTRTableProducer()

HcalUHTRTableProducer::~HcalUHTRTableProducer ( )
inlineoverride

Definition at line 48 of file HcalUHTRTableProducer.cc.

48 {};

Member Function Documentation

◆ produce()

void HcalUHTRTableProducer::produce ( edm::Event iEvent,
edm::EventSetup const &  iSetup 
)
overrideprivate

Definition at line 62 of file HcalUHTRTableProducer.cc.

References hcal::AMC13Header::AMCPayload(), hcal::AMC13Header::AMCSize(), FEDRawData::data(), hcalcalib_dqm_sourceclient-live_cfg::eventType, FEDRawDataCollection::FEDData(), fedUnpackList_, mps_fire::i, iEvent, eostools::move(), hcal::AMC13Header::NAMC(), and tokenRaw_.

62  {
63  std::vector<int> crate;
64  std::vector<int> slot;
65  std::vector<uint32_t> evn;
66  std::vector<uint32_t> bcn;
67  std::vector<uint32_t> orn;
68  std::vector<int> eventType;
69 
71  iEvent.getByToken(tokenRaw_, raw);
72  for (std::vector<int>::const_iterator i = fedUnpackList_.begin(); i != fedUnpackList_.end(); i++) {
73  const FEDRawData& fed = raw->FEDData(*i);
74  hcal::AMC13Header const* hamc13 = (hcal::AMC13Header const*)fed.data();
75  if (!hamc13) {
76  continue;
77  }
78  int namc = hamc13->NAMC();
79  for (int iamc = 0; iamc < namc; iamc++) {
80  HcalUHTRData uhtr(hamc13->AMCPayload(iamc), hamc13->AMCSize(iamc));
81  crate.push_back(uhtr.crateId());
82  slot.push_back(uhtr.slot());
83  evn.push_back(uhtr.l1ANumber());
84  bcn.push_back(uhtr.bunchNumber());
85  orn.push_back(uhtr.orbitNumber());
86  eventType.push_back(uhtr.getEventType());
87  }
88  }
89 
90  auto uHTRNanoTable = std::make_unique<nanoaod::FlatTable>(crate.size(), "uHTR", false, false);
91  uHTRNanoTable->addColumn<int>("crate", crate, "crate");
92  uHTRNanoTable->addColumn<int>("slot", slot, "slot");
93  uHTRNanoTable->addColumn<uint32_t>("evn", evn, "evn");
94  uHTRNanoTable->addColumn<uint32_t>("bcn", bcn, "bcn");
95  uHTRNanoTable->addColumn<uint32_t>("orn", orn, "orn");
96  uHTRNanoTable->addColumn<int>("eventType", eventType, "eventType");
97 
98  iEvent.put(std::move(uHTRNanoTable), "uHTRTable");
99 }
edm::EDGetTokenT< FEDRawDataCollection > tokenRaw_
const uint64_t * AMCPayload(int i) const
Definition: AMC13Header.cc:4
int iEvent
Definition: GenABIO.cc:224
int AMCSize(int i) const
Definition: AMC13Header.h:37
const FEDRawData & FEDData(int fedid) const
retrieve data for fed
int NAMC() const
Definition: AMC13Header.h:25
std::vector< int > fedUnpackList_
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
Definition: FEDRawData.cc:24
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

◆ fedUnpackList_

std::vector<int> HcalUHTRTableProducer::fedUnpackList_
private

Definition at line 28 of file HcalUHTRTableProducer.cc.

Referenced by HcalUHTRTableProducer(), and produce().

◆ tagRaw_

edm::InputTag HcalUHTRTableProducer::tagRaw_
private

Definition at line 27 of file HcalUHTRTableProducer.cc.

Referenced by HcalUHTRTableProducer().

◆ tokenRaw_

edm::EDGetTokenT<FEDRawDataCollection> HcalUHTRTableProducer::tokenRaw_
private

Definition at line 26 of file HcalUHTRTableProducer.cc.

Referenced by HcalUHTRTableProducer(), and produce().