22 produces<JetOrbitCollection>(
"Jet").setBranchAlias(
"JetOrbitCollection");
23 produces<TauOrbitCollection>(
"Tau").setBranchAlias(
"TauOrbitCollection");
24 produces<EGammaOrbitCollection>(
"EGamma").setBranchAlias(
"EGammaOrbitCollection");
25 produces<BxSumsOrbitCollection>(
"EtSum").setBranchAlias(
"BxSumsOrbitCollection");
73 throw cms::Exception(
"ScCaloRawToDIgi::produce") <<
"Unknown data source mode. Use DMA or TCP(default).";
98 size_t len = sourceRawData.
size();
99 const unsigned char*
buf = sourceRawData.
data();
110 uint32_t orbit = bl->
orbit & 0x7FFFFFFF;
111 uint32_t
bx = bl->
bx;
114 std::cout <<
"CALO Orbit " << orbit <<
", BX -> " <<
bx << std::endl;
156 std::vector<int> sourceList,
159 for (
const int&
sourceId : sourceList) {
164 <<
" [provided/expected range]";
167 size_t orbitSize = sourceRawData.
size();
197 int nObj = (bl->
header) & 0xff;
198 pos += 12 + nObj * 4;
209 std::cout <<
"E/Gammas BX -> " << bl->
bx << std::endl;
220 throw cms::Exception(
"ScCaloRawToDigi::unpackOrbitFromTCP") <<
"Unknown data type.";
232 int32_t
ET(0), Eta(0),
Phi(0), Qual(0);
233 for (
int i = 0;
i < nObjets;
i++) {
260 int32_t
ET(0), Eta(0),
Phi(0), Iso(0);
261 for (
int i = 0;
i < nObjets;
i++) {
287 int32_t
ET(0), Eta(0),
Phi(0), Iso(0);
288 for (
int i = 0;
i < nObjets;
i++) {
316 int32_t ETEt(0), ETEttem(0), ETMinBiasHFP0(0);
317 int32_t HTEt(0), HTtowerCount(0), HTMinBiasHFM0(0);
318 int32_t ETmissEt(0), ETmissPhi(0), ETmissASYMET(0), ETmissMinBiasHFP1(0);
319 int32_t HTmissEt(0), HTmissPhi(0), HTmissASYMHT(0), HTmissMinBiasHFM1(0);
320 int32_t ETHFmissEt(0), ETHFmissPhi(0), ETHFmissASYMETHF(0), ETHFmissCENT(0);
321 int32_t HTHFmissEt(0), HTHFmissPhi(0), HTHFmissASYMHTHF(0), HTHFmissCENT(0);
324 ETEt = ((dataBlock[0] >> demux::shiftsESums::ETEt) & demux::masksESums::ETEt);
325 ETEttem = ((dataBlock[0] >> demux::shiftsESums::ETEttem) & demux::masksESums::ETEttem);
331 HTEt = ((dataBlock[1] >> demux::shiftsESums::HTEt) & demux::masksESums::HTEt);
336 ETmissEt = ((dataBlock[2] >> demux::shiftsESums::ETmissEt) & demux::masksESums::ETmissEt);
337 ETmissPhi = ((dataBlock[2] >> demux::shiftsESums::ETmissPhi) & demux::masksESums::ETmissPhi);
345 HTmissEt = ((dataBlock[3] >> demux::shiftsESums::HTmissEt) & demux::masksESums::HTmissEt);
346 HTmissPhi = ((dataBlock[3] >> demux::shiftsESums::HTmissPhi) & demux::masksESums::HTmissPhi);
354 ETHFmissEt = ((dataBlock[4] >> demux::shiftsESums::ETHFmissEt) & demux::masksESums::ETHFmissEt);
355 ETHFmissPhi = ((dataBlock[4] >> demux::shiftsESums::ETHFmissPhi) & demux::masksESums::ETHFmissPhi);
357 if (ETHFmissEt > 0) {
363 HTHFmissEt = ((dataBlock[5] >> demux::shiftsESums::ETHFmissEt) & demux::masksESums::ETHFmissEt);
364 HTHFmissPhi = ((dataBlock[5] >> demux::shiftsESums::ETHFmissPhi) & demux::masksESums::ETHFmissPhi);
366 if (HTHFmissEt > 0) {
374 ETMinBiasHFP0 = ((dataBlock[0] >> demux::shiftsESums::ETMinBiasHF) & demux::masksESums::ETMinBiasHF);
378 HTtowerCount = ((dataBlock[1] >> demux::shiftsESums::HTtowerCount) & demux::masksESums::HTtowerCount);
379 HTMinBiasHFM0 = ((dataBlock[1] >> demux::shiftsESums::HTMinBiasHF) & demux::masksESums::HTMinBiasHF);
385 ETmissASYMET = ((dataBlock[2] >> demux::shiftsESums::ETmissASYMET) & demux::masksESums::ETmissASYMET);
386 ETmissMinBiasHFP1 = ((dataBlock[2] >> demux::shiftsESums::ETmissMinBiasHF) & demux::masksESums::ETmissMinBiasHF);
391 HTmissASYMHT = ((dataBlock[3] >> demux::shiftsESums::HTmissASYMHT) & demux::masksESums::HTmissASYMHT);
392 HTmissMinBiasHFM1 = ((dataBlock[3] >> demux::shiftsESums::HTmissMinBiasHF) & demux::masksESums::HTmissMinBiasHF);
398 ETHFmissASYMETHF = ((dataBlock[4] >> demux::shiftsESums::ETHFmissASYMETHF) & demux::masksESums::ETHFmissASYMETHF);
399 ETHFmissCENT = ((dataBlock[4] >> demux::shiftsESums::ETHFmissCENT) & demux::masksESums::ETHFmissCENT);
404 HTHFmissASYMHTHF = ((dataBlock[5] >> demux::shiftsESums::ETHFmissASYMETHF) & demux::masksESums::ETHFmissASYMETHF);
405 HTHFmissCENT = ((dataBlock[5] >> demux::shiftsESums::ETHFmissCENT) & demux::masksESums::ETHFmissCENT);
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}));
436 desc.add<
bool>(
"enableAllSums",
true);
437 desc.addUntracked<
bool>(
"debug",
false);
438 descriptions.
add(
"ScCaloRawToDigi",
desc);
void setHwTotalEtEm(int hwTotalEtEm)
T getParameter(std::string const &) const
void setHwMissEtHFPhi(int hwMissEtHFPhi)
void produce(edm::Event &, const edm::EventSetup &) override
void setMinBiasHFM0(int minBiasHFM0)
void unpackOrbitFromTCP(const unsigned char *buf, size_t len, CaloObjectType dataType)
void setMinBiasHFP0(int minBiasHFP0)
static constexpr int CaloTCPMinSDSID
edm::InputTag srcInputTag_
void unpackTcpData(edm::Handle< SDSRawDataCollection > &ScoutingRawDataCollection, std::vector< int > sourceList, CaloObjectType dataType)
void setHwAsymHtHF(int hwAsymHtHF)
~ScCaloRawToDigi() override
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.
void printJet(const Jet &jet, std::ostream &outs=std::cout)
void printEGamma(const EGamma &eGamma, std::ostream &outs=std::cout)
void printBxSums(const BxSums &sums, std::ostream &outs=std::cout)
std::vector< int > etSumSourceIdList_
std::vector< std::vector< l1ScoutingRun3::Tau > > orbitBufferTaus_
T getUntrackedParameter(std::string const &, T const &) const
void unpackTaus(uint32_t *dataBlock, int bx, int nObjets)
ScCaloRawToDigi(const edm::ParameterSet &)
std::vector< int > eGammaSourceIdList_
void setHwMissEtHF(int hwMissEtHF)
void setHwAsymHt(int hwAsymHt)
void setHwMissHtHF(int hwMissHtHF)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
void unpackEtSums(uint32_t *dataBlock, int bx)
void setHwTotalHt(int hwTotalHt)
std::vector< std::vector< l1ScoutingRun3::BxSums > > orbitBufferEtSums_
#define DEFINE_FWK_MODULE(type)
static constexpr int CaloSDSID
void setHwAsymEtHF(int hwAsymEtHF)
void setCentrality(int centrality)
std::vector< std::vector< l1ScoutingRun3::EGamma > > orbitBufferEGammas_
edm::ParameterSet dataSourceConfig_
void setTowerCount(int towerCount)
void setHwMissHt(int hwMissHt)
std::vector< int > tauSourceIdList_
void setHwAsymEt(int hwAsymEt)
void setMinBiasHFM1(int minBiasHFM1)
void setMinBiasHFP1(int minBiasHFP1)
void printTau(const Tau &tau, std::ostream &outs=std::cout)
static constexpr int CaloTCPMaxSDSID
void add(std::string const &label, ParameterSetDescription const &psetDescription)
std::vector< int > jetSourceIdList_
std::vector< std::vector< l1ScoutingRun3::Jet > > orbitBufferJets_
void setHwMissEtPhi(int hwMissEtPhi)
void unpackEGammas(uint32_t *dataBlock, int bx, int nObjets)
void setHwTotalEt(int hwTotalEt)
void setHwMissHtPhi(int hwMissHtPhi)
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
edm::EDGetToken rawToken_
void unpackOrbitFromDMA(edm::Handle< SDSRawDataCollection > &ScoutingRawDataCollection, int sourceId)
Log< level::Warning, false > LogWarning
void setHwMissEt(int hwMissEt)
void setHwMissHtHFPhi(int hwMissHtHFPhi)