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 beginRun (edm::Run const &, edm::EventSetup const &) override
 
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

◆ beginRun()

void HcalUHTRTableProducer::beginRun ( edm::Run const &  iRun,
edm::EventSetup const &  iSetup 
)
overrideprivate

Definition at line 63 of file HcalUHTRTableProducer.cc.

63 {}

◆ produce()

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

Definition at line 65 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_.

65  {
66  std::vector<int> crate;
67  std::vector<int> slot;
68  std::vector<uint32_t> evn;
69  std::vector<uint32_t> bcn;
70  std::vector<uint32_t> orn;
71  std::vector<int> eventType;
72 
74  iEvent.getByToken(tokenRaw_, raw);
75  for (std::vector<int>::const_iterator i = fedUnpackList_.begin(); i != fedUnpackList_.end(); i++) {
76  const FEDRawData& fed = raw->FEDData(*i);
77  hcal::AMC13Header const* hamc13 = (hcal::AMC13Header const*)fed.data();
78  if (!hamc13) {
79  continue;
80  }
81  int namc = hamc13->NAMC();
82  for (int iamc = 0; iamc < namc; iamc++) {
83  HcalUHTRData uhtr(hamc13->AMCPayload(iamc), hamc13->AMCSize(iamc));
84  crate.push_back(uhtr.crateId());
85  slot.push_back(uhtr.slot());
86  evn.push_back(uhtr.l1ANumber());
87  bcn.push_back(uhtr.bunchNumber());
88  orn.push_back(uhtr.orbitNumber());
89  eventType.push_back(uhtr.getEventType());
90  }
91  }
92 
93  auto uHTRNanoTable = std::make_unique<nanoaod::FlatTable>(crate.size(), "uHTR", false, false);
94  uHTRNanoTable->addColumn<int>("crate", crate, "crate");
95  uHTRNanoTable->addColumn<int>("slot", slot, "slot");
96  uHTRNanoTable->addColumn<uint32_t>("evn", evn, "evn");
97  uHTRNanoTable->addColumn<uint32_t>("bcn", bcn, "bcn");
98  uHTRNanoTable->addColumn<uint32_t>("orn", orn, "orn");
99  uHTRNanoTable->addColumn<int>("eventType", eventType, "eventType");
100 
101  iEvent.put(std::move(uHTRNanoTable), "uHTRTable");
102 }
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().