CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Private Attributes
ScCaloRawToDigi Class Reference

#include <ScCALORawToDigi.h>

Inheritance diagram for ScCaloRawToDigi:
edm::stream::EDProducer<>

Public Member Functions

 ScCaloRawToDigi (const edm::ParameterSet &)
 
 ~ScCaloRawToDigi () 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
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Private Types

enum  CaloObjectType { CaloObjectType::Jet, CaloObjectType::EGamma, CaloObjectType::Tau, CaloObjectType::EtSum }
 

Private Member Functions

void produce (edm::Event &, const edm::EventSetup &) override
 
void unpackEGammas (uint32_t *dataBlock, int bx, int nObjets)
 
void unpackEtSums (uint32_t *dataBlock, int bx)
 
void unpackJets (uint32_t *dataBlock, int bx, int nObjets)
 
void unpackOrbitFromDMA (edm::Handle< SDSRawDataCollection > &ScoutingRawDataCollection, int sourceId)
 
void unpackOrbitFromTCP (const unsigned char *buf, size_t len, CaloObjectType dataType)
 
void unpackTaus (uint32_t *dataBlock, int bx, int nObjets)
 
void unpackTcpData (edm::Handle< SDSRawDataCollection > &ScoutingRawDataCollection, std::vector< int > sourceList, CaloObjectType dataType)
 

Private Attributes

edm::ParameterSet dataSourceConfig_
 
std::string dataSourceMode_
 
bool debug_ = false
 
std::vector< int > eGammaSourceIdList_
 
bool enableAllSums_ = false
 
std::vector< int > etSumSourceIdList_
 
std::vector< int > jetSourceIdList_
 
int nEGammasOrbit_
 
int nEtSumsOrbit_
 
int nJetsOrbit_
 
int nTausOrbit_
 
std::vector< std::vector< l1ScoutingRun3::EGamma > > orbitBufferEGammas_
 
std::vector< std::vector< l1ScoutingRun3::BxSums > > orbitBufferEtSums_
 
std::vector< std::vector< l1ScoutingRun3::Jet > > orbitBufferJets_
 
std::vector< std::vector< l1ScoutingRun3::Tau > > orbitBufferTaus_
 
edm::EDGetToken rawToken_
 
edm::InputTag srcInputTag_
 
std::vector< int > tauSourceIdList_
 

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 25 of file ScCALORawToDigi.h.

Member Enumeration Documentation

◆ CaloObjectType

enum ScCaloRawToDigi::CaloObjectType
strongprivate
Enumerator
Jet 
EGamma 
Tau 
EtSum 

Definition at line 35 of file ScCALORawToDigi.h.

35 { Jet, EGamma, Tau, EtSum };

Constructor & Destructor Documentation

◆ ScCaloRawToDigi()

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

Definition at line 3 of file ScCALORawToDigi.cc.

References dataSourceConfig_, debug_, enableAllSums_, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), nEGammasOrbit_, nEtSumsOrbit_, nJetsOrbit_, nTausOrbit_, orbitBufferEGammas_, orbitBufferEtSums_, orbitBufferJets_, orbitBufferTaus_, rawToken_, and srcInputTag_.

3  {
4  using namespace edm;
5  using namespace l1ScoutingRun3;
6  srcInputTag_ = iConfig.getParameter<InputTag>("srcInputTag");
7  enableAllSums_ = iConfig.getParameter<bool>("enableAllSums");
8  debug_ = iConfig.getUntrackedParameter<bool>("debug", false);
9  dataSourceConfig_ = iConfig.getParameter<edm::ParameterSet>("dataSource");
10  rawToken_ = consumes<SDSRawDataCollection>(srcInputTag_);
11 
12  orbitBufferJets_ = std::vector<std::vector<Jet>>(3565);
13  orbitBufferEGammas_ = std::vector<std::vector<EGamma>>(3565);
14  orbitBufferTaus_ = std::vector<std::vector<Tau>>(3565);
15  orbitBufferEtSums_ = std::vector<std::vector<BxSums>>(3565);
16 
17  nJetsOrbit_ = 0;
18  nEGammasOrbit_ = 0;
19  nTausOrbit_ = 0;
20  nEtSumsOrbit_ = 0;
21 
22  produces<JetOrbitCollection>("Jet").setBranchAlias("JetOrbitCollection");
23  produces<TauOrbitCollection>("Tau").setBranchAlias("TauOrbitCollection");
24  produces<EGammaOrbitCollection>("EGamma").setBranchAlias("EGammaOrbitCollection");
25  produces<BxSumsOrbitCollection>("EtSum").setBranchAlias("BxSumsOrbitCollection");
26 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
edm::InputTag srcInputTag_
std::vector< std::vector< l1ScoutingRun3::Tau > > orbitBufferTaus_
T getUntrackedParameter(std::string const &, T const &) const
std::vector< std::vector< l1ScoutingRun3::BxSums > > orbitBufferEtSums_
std::vector< std::vector< l1ScoutingRun3::EGamma > > orbitBufferEGammas_
edm::ParameterSet dataSourceConfig_
std::vector< std::vector< l1ScoutingRun3::Jet > > orbitBufferJets_
HLT enums.
edm::EDGetToken rawToken_

◆ ~ScCaloRawToDigi()

ScCaloRawToDigi::~ScCaloRawToDigi ( )
override

Definition at line 28 of file ScCALORawToDigi.cc.

28 {};

Member Function Documentation

◆ fillDescriptions()

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

Definition at line 423 of file ScCALORawToDigi.cc.

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

423  {
425  desc.add<edm::InputTag>("srcInputTag", edm::InputTag("rawDataCollector"));
426  {
428  dataSource.add<std::string>("dataSourceMode", std::string("TCP"));
429  dataSource.add<std::vector<int>>("jetSourceIdList", std::vector<int>({22}));
430  dataSource.add<std::vector<int>>("eGammaSourceIdList", std::vector<int>({23}));
431  dataSource.add<std::vector<int>>("tauSourceIdList", std::vector<int>({25}));
432  dataSource.add<std::vector<int>>("etSumSourceIdList", std::vector<int>({24}));
433  dataSource.add<int>("dmaSourceId", 2);
434  desc.add("dataSource", dataSource);
435  }
436  desc.add<bool>("enableAllSums", true);
437  desc.addUntracked<bool>("debug", false);
438  descriptions.add("ScCaloRawToDigi", desc);
439 }
void add(std::string const &label, ParameterSetDescription const &psetDescription)

◆ produce()

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

Definition at line 30 of file ScCALORawToDigi.cc.

References SDSNumbering::CaloSDSID, dataSourceConfig_, ScCaloRawToDigi_cfi::dataSourceMode, EGamma, eGammaSourceIdList_, EtSum, etSumSourceIdList_, Exception, edm::ParameterSet::getParameter(), iEvent, Jet, jetSourceIdList_, eostools::move(), nEGammasOrbit_, nEtSumsOrbit_, nJetsOrbit_, nTausOrbit_, orbitBufferEGammas_, orbitBufferEtSums_, orbitBufferJets_, orbitBufferTaus_, rawToken_, objects.autophobj::sourceId, AlCaHLTBitMon_QueryRunRegistry::string, Tau, tauSourceIdList_, unpackOrbitFromDMA(), and unpackTcpData().

30  {
31  using namespace edm;
32  using namespace l1ScoutingRun3;
33 
34  Handle<SDSRawDataCollection> ScoutingRawDataCollection;
35  iEvent.getByToken(rawToken_, ScoutingRawDataCollection);
36 
37  std::unique_ptr<JetOrbitCollection> unpackedJets(new JetOrbitCollection);
38  std::unique_ptr<TauOrbitCollection> unpackedTaus(new TauOrbitCollection);
39  std::unique_ptr<EGammaOrbitCollection> unpackedEGammas(new EGammaOrbitCollection);
40  std::unique_ptr<BxSumsOrbitCollection> unpackedEtSums(new BxSumsOrbitCollection);
41 
42  // reset counters
43  nJetsOrbit_ = 0;
44  nEGammasOrbit_ = 0;
45  nTausOrbit_ = 0;
46  nEtSumsOrbit_ = 0;
47 
49  if (dataSourceMode == "DMA") {
50  // Packet from DMA contains all the objects
51  int sourceId = dataSourceConfig_.getParameter<int>("dmaSourceId");
53  edm::LogWarning("ScCaloRawToDIgi::produce") << "Provided an unexpected source ID: " << sourceId << "/"
54  << SDSNumbering::CaloSDSID << " [provided/expected]";
55  unpackOrbitFromDMA(ScoutingRawDataCollection, sourceId);
56  } else if (dataSourceMode == "TCP") {
57  // unpack jets
58  jetSourceIdList_ = dataSourceConfig_.getParameter<std::vector<int>>("jetSourceIdList");
59  unpackTcpData(ScoutingRawDataCollection, jetSourceIdList_, CaloObjectType::Jet);
60 
61  // unpack e/gamma
62  eGammaSourceIdList_ = dataSourceConfig_.getParameter<std::vector<int>>("eGammaSourceIdList");
63  unpackTcpData(ScoutingRawDataCollection, eGammaSourceIdList_, CaloObjectType::EGamma);
64 
65  // unpack taus
66  tauSourceIdList_ = dataSourceConfig_.getParameter<std::vector<int>>("tauSourceIdList");
67  unpackTcpData(ScoutingRawDataCollection, tauSourceIdList_, CaloObjectType::Tau);
68 
69  // unpack et sums
70  etSumSourceIdList_ = dataSourceConfig_.getParameter<std::vector<int>>("etSumSourceIdList");
71  unpackTcpData(ScoutingRawDataCollection, etSumSourceIdList_, CaloObjectType::EtSum);
72  } else {
73  throw cms::Exception("ScCaloRawToDIgi::produce") << "Unknown data source mode. Use DMA or TCP(default).";
74  }
75 
76  // fill orbit collection and clear the Bx buffer vector
77  unpackedJets->fillAndClear(orbitBufferJets_, nJetsOrbit_);
78  unpackedEGammas->fillAndClear(orbitBufferEGammas_, nEGammasOrbit_);
79  unpackedTaus->fillAndClear(orbitBufferTaus_, nTausOrbit_);
80  unpackedEtSums->fillAndClear(orbitBufferEtSums_, nEtSumsOrbit_);
81 
82  // store collections in the event
83  iEvent.put(std::move(unpackedJets), "Jet");
84  iEvent.put(std::move(unpackedTaus), "Tau");
85  iEvent.put(std::move(unpackedEGammas), "EGamma");
86  iEvent.put(std::move(unpackedEtSums), "EtSum");
87 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
void unpackTcpData(edm::Handle< SDSRawDataCollection > &ScoutingRawDataCollection, std::vector< int > sourceList, CaloObjectType dataType)
std::vector< int > etSumSourceIdList_
std::vector< std::vector< l1ScoutingRun3::Tau > > orbitBufferTaus_
std::vector< int > eGammaSourceIdList_
int iEvent
Definition: GenABIO.cc:224
std::vector< std::vector< l1ScoutingRun3::BxSums > > orbitBufferEtSums_
static constexpr int CaloSDSID
Definition: SDSNumbering.h:18
std::vector< std::vector< l1ScoutingRun3::EGamma > > orbitBufferEGammas_
edm::ParameterSet dataSourceConfig_
std::vector< int > tauSourceIdList_
std::vector< int > jetSourceIdList_
std::vector< std::vector< l1ScoutingRun3::Jet > > orbitBufferJets_
HLT enums.
edm::EDGetToken rawToken_
void unpackOrbitFromDMA(edm::Handle< SDSRawDataCollection > &ScoutingRawDataCollection, int sourceId)
Log< level::Warning, false > LogWarning
def move(src, dest)
Definition: eostools.py:511

◆ unpackEGammas()

void ScCaloRawToDigi::unpackEGammas ( uint32_t *  dataBlock,
int  bx,
int  nObjets 
)
private

Definition at line 257 of file ScCALORawToDigi.cc.

References nano_mu_digi_cff::bx, gather_cfg::cout, debug_, TauDecayModes::dec, ET, PVValHelper::eta, mps_fire::i, nEGammasOrbit_, orbitBufferEGammas_, PVValHelper::phi, VtxSmearedParameters_cfi::Phi, and l1ScoutingRun3::printEGamma().

Referenced by unpackOrbitFromDMA(), and unpackOrbitFromTCP().

257  {
258  using namespace l1ScoutingRun3;
259 
260  int32_t ET(0), Eta(0), Phi(0), Iso(0);
261  for (int i = 0; i < nObjets; i++) {
262  ET = ((dataBlock[i] >> demux::shiftsEGamma::ET) & demux::masksEGamma::ET);
263  if (ET != 0) {
264  Eta = ((dataBlock[i] >> demux::shiftsEGamma::eta) & demux::masksEGamma::eta);
266  Iso = ((dataBlock[i] >> demux::shiftsEGamma::iso) & demux::masksEGamma::iso);
267 
268  if (Eta > 127)
269  Eta = Eta - 256;
270 
271  EGamma eGamma(ET, Eta, Phi, Iso);
272  orbitBufferEGammas_[bx].push_back(eGamma);
273  nEGammasOrbit_++;
274 
275  if (debug_) {
276  std::cout << "E/g " << i << std::endl;
277  std::cout << " Raw: 0x" << std::hex << dataBlock[i] << std::dec << std::endl;
278  printEGamma(eGamma);
279  }
280  }
281  } // end link e/gammas unpacking loop
282 }
void printEGamma(const EGamma &eGamma, std::ostream &outs=std::cout)
std::vector< std::vector< l1ScoutingRun3::EGamma > > orbitBufferEGammas_
#define ET

◆ unpackEtSums()

void ScCaloRawToDigi::unpackEtSums ( uint32_t *  dataBlock,
int  bx 
)
private

Definition at line 311 of file ScCALORawToDigi.cc.

References nano_mu_digi_cff::bx, gather_cfg::cout, debug_, TauDecayModes::dec, enableAllSums_, amptDefault_cfi::frame, nEtSumsOrbit_, orbitBufferEtSums_, l1ScoutingRun3::printBxSums(), l1ScoutingRun3::BxSums::setCentrality(), l1ScoutingRun3::BxSums::setHwAsymEt(), l1ScoutingRun3::BxSums::setHwAsymEtHF(), l1ScoutingRun3::BxSums::setHwAsymHt(), l1ScoutingRun3::BxSums::setHwAsymHtHF(), l1ScoutingRun3::BxSums::setHwMissEt(), l1ScoutingRun3::BxSums::setHwMissEtHF(), l1ScoutingRun3::BxSums::setHwMissEtHFPhi(), l1ScoutingRun3::BxSums::setHwMissEtPhi(), l1ScoutingRun3::BxSums::setHwMissHt(), l1ScoutingRun3::BxSums::setHwMissHtHF(), l1ScoutingRun3::BxSums::setHwMissHtHFPhi(), l1ScoutingRun3::BxSums::setHwMissHtPhi(), l1ScoutingRun3::BxSums::setHwTotalEt(), l1ScoutingRun3::BxSums::setHwTotalEtEm(), l1ScoutingRun3::BxSums::setHwTotalHt(), l1ScoutingRun3::BxSums::setMinBiasHFM0(), l1ScoutingRun3::BxSums::setMinBiasHFM1(), l1ScoutingRun3::BxSums::setMinBiasHFP0(), l1ScoutingRun3::BxSums::setMinBiasHFP1(), and l1ScoutingRun3::BxSums::setTowerCount().

Referenced by unpackOrbitFromDMA(), and unpackOrbitFromTCP().

311  {
312  using namespace l1ScoutingRun3;
313 
314  BxSums bxSums;
315 
316  int32_t ETEt(0), ETEttem(0), ETMinBiasHFP0(0); // ET block
317  int32_t HTEt(0), HTtowerCount(0), HTMinBiasHFM0(0); // HT block
318  int32_t ETmissEt(0), ETmissPhi(0), ETmissASYMET(0), ETmissMinBiasHFP1(0); // ETMiss block
319  int32_t HTmissEt(0), HTmissPhi(0), HTmissASYMHT(0), HTmissMinBiasHFM1(0); // HTMiss block
320  int32_t ETHFmissEt(0), ETHFmissPhi(0), ETHFmissASYMETHF(0), ETHFmissCENT(0); // ETHFMiss block
321  int32_t HTHFmissEt(0), HTHFmissPhi(0), HTHFmissASYMHTHF(0), HTHFmissCENT(0); // HTHFMiss block
322 
323  // ET block
324  ETEt = ((dataBlock[0] >> demux::shiftsESums::ETEt) & demux::masksESums::ETEt);
325  ETEttem = ((dataBlock[0] >> demux::shiftsESums::ETEttem) & demux::masksESums::ETEttem);
326 
327  bxSums.setHwTotalEt(ETEt);
328  bxSums.setHwTotalEtEm(ETEttem);
329 
330  // HT block
331  HTEt = ((dataBlock[1] >> demux::shiftsESums::HTEt) & demux::masksESums::HTEt);
332 
333  bxSums.setHwTotalHt(HTEt);
334 
335  // ETMiss block
336  ETmissEt = ((dataBlock[2] >> demux::shiftsESums::ETmissEt) & demux::masksESums::ETmissEt);
337  ETmissPhi = ((dataBlock[2] >> demux::shiftsESums::ETmissPhi) & demux::masksESums::ETmissPhi);
338 
339  if (ETmissEt > 0) {
340  bxSums.setHwMissEt(ETmissEt);
341  bxSums.setHwMissEtPhi(ETmissPhi);
342  }
343 
344  // HTMiss block
345  HTmissEt = ((dataBlock[3] >> demux::shiftsESums::HTmissEt) & demux::masksESums::HTmissEt);
346  HTmissPhi = ((dataBlock[3] >> demux::shiftsESums::HTmissPhi) & demux::masksESums::HTmissPhi);
347 
348  if (HTmissEt > 0) {
349  bxSums.setHwMissHt(HTmissEt);
350  bxSums.setHwMissHtPhi(HTmissPhi);
351  }
352 
353  // ETHFMiss block
354  ETHFmissEt = ((dataBlock[4] >> demux::shiftsESums::ETHFmissEt) & demux::masksESums::ETHFmissEt);
355  ETHFmissPhi = ((dataBlock[4] >> demux::shiftsESums::ETHFmissPhi) & demux::masksESums::ETHFmissPhi);
356 
357  if (ETHFmissEt > 0) {
358  bxSums.setHwMissEtHF(ETHFmissEt);
359  bxSums.setHwMissEtHFPhi(ETHFmissPhi);
360  }
361 
362  // HTHFMiss block
363  HTHFmissEt = ((dataBlock[5] >> demux::shiftsESums::ETHFmissEt) & demux::masksESums::ETHFmissEt);
364  HTHFmissPhi = ((dataBlock[5] >> demux::shiftsESums::ETHFmissPhi) & demux::masksESums::ETHFmissPhi);
365 
366  if (HTHFmissEt > 0) {
367  bxSums.setHwMissHtHF(HTHFmissEt);
368  bxSums.setHwMissHtHFPhi(HTHFmissPhi);
369  }
370 
371  // Insert additional sums
372  if (enableAllSums_) {
373  // ET block
374  ETMinBiasHFP0 = ((dataBlock[0] >> demux::shiftsESums::ETMinBiasHF) & demux::masksESums::ETMinBiasHF);
375  bxSums.setMinBiasHFP0(ETMinBiasHFP0);
376 
377  // HT block
378  HTtowerCount = ((dataBlock[1] >> demux::shiftsESums::HTtowerCount) & demux::masksESums::HTtowerCount);
379  HTMinBiasHFM0 = ((dataBlock[1] >> demux::shiftsESums::HTMinBiasHF) & demux::masksESums::HTMinBiasHF);
380 
381  bxSums.setTowerCount(HTtowerCount);
382  bxSums.setMinBiasHFM0(HTMinBiasHFM0);
383 
384  // ET Miss block
385  ETmissASYMET = ((dataBlock[2] >> demux::shiftsESums::ETmissASYMET) & demux::masksESums::ETmissASYMET);
386  ETmissMinBiasHFP1 = ((dataBlock[2] >> demux::shiftsESums::ETmissMinBiasHF) & demux::masksESums::ETmissMinBiasHF);
387  bxSums.setHwAsymEt(ETmissASYMET);
388  bxSums.setMinBiasHFP1(ETmissMinBiasHFP1);
389 
390  // HT Miss block
391  HTmissASYMHT = ((dataBlock[3] >> demux::shiftsESums::HTmissASYMHT) & demux::masksESums::HTmissASYMHT);
392  HTmissMinBiasHFM1 = ((dataBlock[3] >> demux::shiftsESums::HTmissMinBiasHF) & demux::masksESums::HTmissMinBiasHF);
393 
394  bxSums.setHwAsymHt(HTmissASYMHT);
395  bxSums.setMinBiasHFM1(HTmissMinBiasHFM1);
396 
397  // ETHFMiss
398  ETHFmissASYMETHF = ((dataBlock[4] >> demux::shiftsESums::ETHFmissASYMETHF) & demux::masksESums::ETHFmissASYMETHF);
399  ETHFmissCENT = ((dataBlock[4] >> demux::shiftsESums::ETHFmissCENT) & demux::masksESums::ETHFmissCENT);
400 
401  bxSums.setHwAsymEtHF(ETHFmissASYMETHF);
402 
403  // HTHFMiss
404  HTHFmissASYMHTHF = ((dataBlock[5] >> demux::shiftsESums::ETHFmissASYMETHF) & demux::masksESums::ETHFmissASYMETHF);
405  HTHFmissCENT = ((dataBlock[5] >> demux::shiftsESums::ETHFmissCENT) & demux::masksESums::ETHFmissCENT);
406 
407  bxSums.setHwAsymHtHF(HTHFmissASYMHTHF);
408  bxSums.setCentrality((HTHFmissCENT << 4) + ETHFmissCENT);
409  }
410 
411  orbitBufferEtSums_[bx].push_back(bxSums);
412  nEtSumsOrbit_ += 1;
413 
414  if (debug_) {
415  std::cout << "Raw frames:\n";
416  for (int frame = 0; frame < 6; frame++) {
417  std::cout << " frame " << frame << ": 0x" << std::hex << dataBlock[frame] << std::dec << std::endl;
418  }
419  printBxSums(bxSums);
420  }
421 }
void setHwTotalEtEm(int hwTotalEtEm)
void setHwMissEtHFPhi(int hwMissEtHFPhi)
void setMinBiasHFM0(int minBiasHFM0)
void setMinBiasHFP0(int minBiasHFP0)
void setHwAsymHtHF(int hwAsymHtHF)
void printBxSums(const BxSums &sums, std::ostream &outs=std::cout)
void setHwMissEtHF(int hwMissEtHF)
void setHwAsymHt(int hwAsymHt)
void setHwMissHtHF(int hwMissHtHF)
void setHwTotalHt(int hwTotalHt)
std::vector< std::vector< l1ScoutingRun3::BxSums > > orbitBufferEtSums_
void setHwAsymEtHF(int hwAsymEtHF)
void setCentrality(int centrality)
void setTowerCount(int towerCount)
void setHwMissHt(int hwMissHt)
void setHwAsymEt(int hwAsymEt)
void setMinBiasHFM1(int minBiasHFM1)
void setMinBiasHFP1(int minBiasHFP1)
void setHwMissEtPhi(int hwMissEtPhi)
void setHwTotalEt(int hwTotalEt)
void setHwMissHtPhi(int hwMissHtPhi)
void setHwMissEt(int hwMissEt)
void setHwMissHtHFPhi(int hwMissHtHFPhi)

◆ unpackJets()

void ScCaloRawToDigi::unpackJets ( uint32_t *  dataBlock,
int  bx,
int  nObjets 
)
private

Definition at line 229 of file ScCALORawToDigi.cc.

References nano_mu_digi_cff::bx, gather_cfg::cout, debug_, TauDecayModes::dec, ET, PVValHelper::eta, mps_fire::i, metsig::jet, nJetsOrbit_, orbitBufferJets_, PVValHelper::phi, VtxSmearedParameters_cfi::Phi, l1ScoutingRun3::printJet(), and l1tGTMenu_lepSeeds_cff::qual.

Referenced by unpackOrbitFromDMA(), and unpackOrbitFromTCP().

229  {
230  using namespace l1ScoutingRun3;
231 
232  int32_t ET(0), Eta(0), Phi(0), Qual(0);
233  for (int i = 0; i < nObjets; i++) {
234  ET = ((dataBlock[i] >> demux::shiftsJet::ET) & demux::masksJet::ET);
235 
236  if (ET != 0) {
237  Eta = ((dataBlock[i] >> demux::shiftsJet::eta) & demux::masksJet::eta);
238  Phi = ((dataBlock[i] >> demux::shiftsJet::phi) & demux::masksJet::phi);
239  Qual = ((dataBlock[i] >> demux::shiftsJet::qual) & demux::masksJet::qual);
240 
241  if (Eta > 127)
242  Eta = Eta - 256;
243 
244  Jet jet(ET, Eta, Phi, Qual);
245  orbitBufferJets_[bx].push_back(jet);
246  nJetsOrbit_++;
247 
248  if (debug_) {
249  std::cout << "Jet " << i << std::endl;
250  std::cout << " Raw: 0x" << std::hex << dataBlock[i] << std::dec << std::endl;
251  printJet(jet);
252  }
253  }
254  } // end link jets unpacking loop
255 }
void printJet(const Jet &jet, std::ostream &outs=std::cout)
Definition: Jet.py:1
std::vector< std::vector< l1ScoutingRun3::Jet > > orbitBufferJets_
#define ET

◆ unpackOrbitFromDMA()

void ScCaloRawToDigi::unpackOrbitFromDMA ( edm::Handle< SDSRawDataCollection > &  ScoutingRawDataCollection,
int  sourceId 
)
private

Definition at line 89 of file ScCALORawToDigi.cc.

References cms::cuda::assert(), visDQMUpload::buf, l1ScoutingRun3::demux::dmaBlock::bx, nano_mu_digi_cff::bx, gather_cfg::cout, FEDRawData::data(), debug_, l1ScoutingRun3::demux::dmaBlock::egamma1, l1ScoutingRun3::demux::dmaBlock::egamma2, SDSRawDataCollection::FEDData(), l1ScoutingRun3::demux::dmaBlock::jet1, l1ScoutingRun3::demux::dmaBlock::jet2, l1ScoutingRun3::demux::dmaBlock::orbit, FEDRawData::size(), objects.autophobj::sourceId, l1ScoutingRun3::demux::dmaBlock::sum, l1ScoutingRun3::demux::dmaBlock::tau1, l1ScoutingRun3::demux::dmaBlock::tau2, unpackEGammas(), unpackEtSums(), unpackJets(), and unpackTaus().

Referenced by produce().

89  {
90  using namespace l1ScoutingRun3;
91 
92  const FEDRawData& sourceRawData = ScoutingRawDataCollection->FEDData(sourceId);
93  if ((sourceRawData.size() == 0) && debug_) {
94  std::cout << "No raw data for CALO DMA source ID=" << sourceId << std::endl;
95  }
96 
97  // get orbit size and raw data
98  size_t len = sourceRawData.size();
99  const unsigned char* buf = sourceRawData.data();
100 
101  size_t pos = 0;
102 
103  while (pos < len) {
104  assert(pos + sizeof(demux::dmaBlock) <= len);
105 
107  pos += sizeof(demux::dmaBlock);
108 
109  assert(pos <= len);
110  uint32_t orbit = bl->orbit & 0x7FFFFFFF;
111  uint32_t bx = bl->bx;
112 
113  if (debug_) {
114  std::cout << "CALO Orbit " << orbit << ", BX -> " << bx << std::endl;
115  }
116 
117  // unpack jets from first link
118  if (debug_)
119  std::cout << "--- Jets link 1 ---\n";
120  unpackJets(bl->jet1, bx, 6);
121 
122  // unpack jets from second link
123  if (debug_)
124  std::cout << "--- Jets link 2 ---\n";
125  unpackJets(bl->jet2, bx, 6);
126 
127  // unpack eg from first link
128  if (debug_)
129  std::cout << "--- E/g link 1 ---\n";
130  unpackEGammas(bl->egamma1, bx, 6);
131 
132  // unpack eg from second link link
133  if (debug_)
134  std::cout << "--- E/g link 2 ---\n";
135  unpackEGammas(bl->egamma2, bx, 6);
136 
137  // unpack taus from first link
138  if (debug_)
139  std::cout << "--- Taus link 1 ---\n";
140  unpackTaus(bl->tau1, bx, 6);
141 
142  // unpack taus from second link
143  if (debug_)
144  std::cout << "--- Taus link 2 ---\n";
145  unpackTaus(bl->tau2, bx, 6);
146 
147  // unpack et sums
148  if (debug_)
149  std::cout << "--- Sums ---\n";
150  unpackEtSums(bl->sum, bx);
151 
152  } // end of bx objects
153 }
void unpackJets(uint32_t *dataBlock, int bx, int nObjets)
const FEDRawData & FEDData(int sourceId) const
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:48
assert(be >=bs)
void unpackTaus(uint32_t *dataBlock, int bx, int nObjets)
void unpackEtSums(uint32_t *dataBlock, int bx)
void unpackEGammas(uint32_t *dataBlock, int bx, int nObjets)
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
Definition: FEDRawData.cc:24

◆ unpackOrbitFromTCP()

void ScCaloRawToDigi::unpackOrbitFromTCP ( const unsigned char *  buf,
size_t  len,
CaloObjectType  dataType 
)
private

Definition at line 178 of file ScCALORawToDigi.cc.

References cms::cuda::assert(), visDQMUpload::buf, l1ScoutingRun3::demux::caloObjTcpBlock::bx, l1ScoutingRun3::demux::caloSumTcpBlock::bx, gather_cfg::cout, DTskim_cfg::dataType, debug_, EGamma, EtSum, Exception, l1ScoutingRun3::demux::caloObjTcpBlock::header, Jet, l1ScoutingRun3::demux::caloObjTcpBlock::obj, l1ScoutingRun3::demux::caloSumTcpBlock::sum, Tau, unpackEGammas(), unpackEtSums(), unpackJets(), and unpackTaus().

Referenced by unpackTcpData().

178  {
179  using namespace l1ScoutingRun3;
180  size_t pos = 0;
181 
182  while (pos < len) {
183  // frame header is present
184  assert(pos + 4 <= len);
185 
186  // unpack calo sums block
189  pos += sizeof(demux::caloSumTcpBlock);
190  assert(pos <= len);
191  if (debug_)
192  std::cout << "Sums BX -> " << bl->bx << std::endl;
193  unpackEtSums(bl->sum, bl->bx);
194  } else {
195  // unpack jet/eg/tau
197  int nObj = (bl->header) & 0xff;
198  pos += 12 + nObj * 4;
199 
200  switch (dataType) {
201  case CaloObjectType::Jet:
202  if (debug_)
203  std::cout << "Jets BX -> " << bl->bx << std::endl;
204  unpackJets(bl->obj, bl->bx, nObj);
205  break;
206 
208  if (debug_)
209  std::cout << "E/Gammas BX -> " << bl->bx << std::endl;
210  unpackEGammas(bl->obj, bl->bx, nObj);
211  break;
212 
213  case CaloObjectType::Tau:
214  if (debug_)
215  std::cout << "Taus BX -> " << bl->bx << std::endl;
216  unpackTaus(bl->obj, bl->bx, nObj);
217  break;
218 
219  default:
220  throw cms::Exception("ScCaloRawToDigi::unpackOrbitFromTCP") << "Unknown data type.";
221  break;
222  }
223 
224  } // unpack sums and calo objects
225 
226  } // end of bx objects
227 }
void unpackJets(uint32_t *dataBlock, int bx, int nObjets)
assert(be >=bs)
void unpackTaus(uint32_t *dataBlock, int bx, int nObjets)
void unpackEtSums(uint32_t *dataBlock, int bx)
void unpackEGammas(uint32_t *dataBlock, int bx, int nObjets)

◆ unpackTaus()

void ScCaloRawToDigi::unpackTaus ( uint32_t *  dataBlock,
int  bx,
int  nObjets 
)
private

Definition at line 284 of file ScCALORawToDigi.cc.

References nano_mu_digi_cff::bx, gather_cfg::cout, debug_, TauDecayModes::dec, ET, PVValHelper::eta, mps_fire::i, nTausOrbit_, orbitBufferTaus_, PVValHelper::phi, VtxSmearedParameters_cfi::Phi, l1ScoutingRun3::printTau(), and metsig::tau.

Referenced by unpackOrbitFromDMA(), and unpackOrbitFromTCP().

284  {
285  using namespace l1ScoutingRun3;
286 
287  int32_t ET(0), Eta(0), Phi(0), Iso(0);
288  for (int i = 0; i < nObjets; i++) {
289  ET = ((dataBlock[i] >> demux::shiftsTau::ET) & demux::masksTau::ET);
290  if (ET != 0) {
291  Eta = ((dataBlock[i] >> demux::shiftsTau::eta) & demux::masksTau::eta);
292  Phi = ((dataBlock[i] >> demux::shiftsTau::phi) & demux::masksTau::phi);
293  Iso = ((dataBlock[i] >> demux::shiftsTau::iso) & demux::masksTau::iso);
294 
295  if (Eta > 127)
296  Eta = Eta - 256;
297 
298  Tau tau(ET, Eta, Phi, Iso);
299  orbitBufferTaus_[bx].push_back(tau);
300  nTausOrbit_++;
301 
302  if (debug_) {
303  std::cout << "Tau " << i << std::endl;
304  std::cout << " Raw: 0x" << std::hex << dataBlock[i] << std::dec << std::endl;
305  printTau(tau);
306  }
307  }
308  } // end link taus unpacking loop
309 }
std::vector< std::vector< l1ScoutingRun3::Tau > > orbitBufferTaus_
Definition: Tau.py:1
void printTau(const Tau &tau, std::ostream &outs=std::cout)
#define ET

◆ unpackTcpData()

void ScCaloRawToDigi::unpackTcpData ( edm::Handle< SDSRawDataCollection > &  ScoutingRawDataCollection,
std::vector< int >  sourceList,
CaloObjectType  dataType 
)
private

Definition at line 155 of file ScCALORawToDigi.cc.

References SDSNumbering::CaloTCPMaxSDSID, SDSNumbering::CaloTCPMinSDSID, gather_cfg::cout, FEDRawData::data(), DTskim_cfg::dataType, debug_, SDSRawDataCollection::FEDData(), FEDRawData::size(), objects.autophobj::sourceId, and unpackOrbitFromTCP().

Referenced by produce().

157  {
158  using namespace l1ScoutingRun3;
159  for (const int& sourceId : sourceList) {
161  edm::LogWarning("ScCaloRawToDIgi::unpackTCPData")
162  << "Source ID outside the expected range " << sourceId << "/[" << SDSNumbering::CaloTCPMinSDSID << "-"
164  << " [provided/expected range]";
165  }
166  const FEDRawData& sourceRawData = ScoutingRawDataCollection->FEDData(sourceId);
167  size_t orbitSize = sourceRawData.size();
168 
169  if ((sourceRawData.size() == 0) && debug_) {
170  //std::cout << "No raw data for calo " << CaloObjTypeTxt[dataType] << ", TCP source ID=" << sourceId << std::endl;
171  std::cout << "No raw data for calo TCP source ID=" << sourceId << std::endl;
172  }
173 
174  unpackOrbitFromTCP(sourceRawData.data(), orbitSize, dataType);
175  }
176 }
void unpackOrbitFromTCP(const unsigned char *buf, size_t len, CaloObjectType dataType)
static constexpr int CaloTCPMinSDSID
Definition: SDSNumbering.h:22
const FEDRawData & FEDData(int sourceId) const
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:48
static constexpr int CaloTCPMaxSDSID
Definition: SDSNumbering.h:23
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
Definition: FEDRawData.cc:24
Log< level::Warning, false > LogWarning

Member Data Documentation

◆ dataSourceConfig_

edm::ParameterSet ScCaloRawToDigi::dataSourceConfig_
private

Definition at line 61 of file ScCALORawToDigi.h.

Referenced by produce(), and ScCaloRawToDigi().

◆ dataSourceMode_

std::string ScCaloRawToDigi::dataSourceMode_
private

Definition at line 60 of file ScCALORawToDigi.h.

◆ debug_

bool ScCaloRawToDigi::debug_ = false
private

◆ eGammaSourceIdList_

std::vector<int> ScCaloRawToDigi::eGammaSourceIdList_
private

Definition at line 63 of file ScCALORawToDigi.h.

Referenced by produce().

◆ enableAllSums_

bool ScCaloRawToDigi::enableAllSums_ = false
private

Definition at line 57 of file ScCALORawToDigi.h.

Referenced by ScCaloRawToDigi(), and unpackEtSums().

◆ etSumSourceIdList_

std::vector<int> ScCaloRawToDigi::etSumSourceIdList_
private

Definition at line 65 of file ScCALORawToDigi.h.

Referenced by produce().

◆ jetSourceIdList_

std::vector<int> ScCaloRawToDigi::jetSourceIdList_
private

Definition at line 62 of file ScCALORawToDigi.h.

Referenced by produce().

◆ nEGammasOrbit_

int ScCaloRawToDigi::nEGammasOrbit_
private

Definition at line 48 of file ScCALORawToDigi.h.

Referenced by produce(), ScCaloRawToDigi(), and unpackEGammas().

◆ nEtSumsOrbit_

int ScCaloRawToDigi::nEtSumsOrbit_
private

Definition at line 48 of file ScCALORawToDigi.h.

Referenced by produce(), ScCaloRawToDigi(), and unpackEtSums().

◆ nJetsOrbit_

int ScCaloRawToDigi::nJetsOrbit_
private

Definition at line 48 of file ScCALORawToDigi.h.

Referenced by produce(), ScCaloRawToDigi(), and unpackJets().

◆ nTausOrbit_

int ScCaloRawToDigi::nTausOrbit_
private

Definition at line 48 of file ScCALORawToDigi.h.

Referenced by produce(), ScCaloRawToDigi(), and unpackTaus().

◆ orbitBufferEGammas_

std::vector<std::vector<l1ScoutingRun3::EGamma> > ScCaloRawToDigi::orbitBufferEGammas_
private

Definition at line 52 of file ScCALORawToDigi.h.

Referenced by produce(), ScCaloRawToDigi(), and unpackEGammas().

◆ orbitBufferEtSums_

std::vector<std::vector<l1ScoutingRun3::BxSums> > ScCaloRawToDigi::orbitBufferEtSums_
private

Definition at line 54 of file ScCALORawToDigi.h.

Referenced by produce(), ScCaloRawToDigi(), and unpackEtSums().

◆ orbitBufferJets_

std::vector<std::vector<l1ScoutingRun3::Jet> > ScCaloRawToDigi::orbitBufferJets_
private

Definition at line 51 of file ScCALORawToDigi.h.

Referenced by produce(), ScCaloRawToDigi(), and unpackJets().

◆ orbitBufferTaus_

std::vector<std::vector<l1ScoutingRun3::Tau> > ScCaloRawToDigi::orbitBufferTaus_
private

Definition at line 53 of file ScCALORawToDigi.h.

Referenced by produce(), ScCaloRawToDigi(), and unpackTaus().

◆ rawToken_

edm::EDGetToken ScCaloRawToDigi::rawToken_
private

Definition at line 59 of file ScCALORawToDigi.h.

Referenced by produce(), and ScCaloRawToDigi().

◆ srcInputTag_

edm::InputTag ScCaloRawToDigi::srcInputTag_
private

Definition at line 58 of file ScCALORawToDigi.h.

Referenced by ScCaloRawToDigi().

◆ tauSourceIdList_

std::vector<int> ScCaloRawToDigi::tauSourceIdList_
private

Definition at line 64 of file ScCALORawToDigi.h.

Referenced by produce().