CMS 3D CMS Logo

Classes | Namespaces | Functions | Variables
PackerHelp.h File Reference
#include "DataFormats/HcalDetId/interface/HcalElectronicsId.h"
#include "DataFormats/HcalDigi/interface/HcalDigiCollections.h"
#include "DataFormats/FEDRawData/interface/FEDNumbering.h"
#include "DataFormats/FEDRawData/interface/FEDRawData.h"
#include "DataFormats/FEDRawData/interface/FEDHeader.h"
#include "CondFormats/HcalObjects/interface/HcalElectronicsMap.h"
#include "DataFormats/HcalDigi/interface/QIE10DataFrame.h"
#include "DataFormats/HcalDigi/interface/QIE11DataFrame.h"
#include <iostream>
#include <cstdio>
#include <vector>
#include <map>
#include <cmath>

Go to the source code of this file.

Classes

class  HCalFED
 
class  UHTRpacker
 

Namespaces

 AMC13HeaderSpec
 
 AMCHeaderSpec
 
 CDFHeaderSpec
 
 QIE10HeaderSpec
 
 QIE11HeaderSpec0
 
 QIE11HeaderSpec3
 
 QIE8HeaderSpec
 
 QIE8SampleSpec
 
 TPHeaderSpec
 

Functions

QIE11DataFrame convertHB (QIE11DataFrame qiehe, std::vector< int > const &tdc1, std::vector< int > const &tdc2, const int tdcmax)
 

Variables

static const int AMC13HeaderSpec::FIXED_LSB = 0x0
 
static const uint64_t CDFHeaderSpec::FIXED_MSB = 0x5
 
static const int QIE8SampleSpec::MASK_ADC = 0x7F
 
static const int AMCHeaderSpec::MASK_AMC_NO = 0xF
 
static const int AMCHeaderSpec::MASK_AMCN_SIZE = 0xFFFFFF
 
static const int AMCHeaderSpec::MASK_BLK_NO = 0xFF
 
static const int CDFHeaderSpec::MASK_BX_ID = 0xFFF
 
static const int AMCHeaderSpec::MASK_C = 0x1
 
static const int QIE8HeaderSpec::MASK_CAPID = 0x3
 
static const int QIE11HeaderSpec0::MASK_CAPID = 0x3
 
static const int QIE8SampleSpec::MASK_CAPID = 0x3
 
static const int TPHeaderSpec::MASK_CHANID = 0xFF
 
static const int AMCHeaderSpec::MASK_CRATE_ID = 0xFF
 
static const int QIE8SampleSpec::MASK_DV = 0x1
 
static const int AMCHeaderSpec::MASK_E = 0x1
 
static const int QIE8SampleSpec::MASK_ER = 0x1
 
static const int CDFHeaderSpec::MASK_EVT_TY = 0xF
 
static const int QIE8HeaderSpec::MASK_FIBER = 0x1F
 
static const int QIE10HeaderSpec::MASK_FIBER = 0x1F
 
static const int QIE11HeaderSpec0::MASK_FIBER = 0x1F
 
static const int QIE11HeaderSpec3::MASK_FIBER = 0x1F
 
static const int QIE8HeaderSpec::MASK_FIBERCHAN = 0x3
 
static const int QIE10HeaderSpec::MASK_FIBERCHAN = 0x7
 
static const int QIE11HeaderSpec0::MASK_FIBERCHAN = 0x7
 
static const int QIE11HeaderSpec3::MASK_FIBERCHAN = 0x7
 
static const int QIE8HeaderSpec::MASK_FIBERERR = 0x3
 
static const int QIE11HeaderSpec0::MASK_FIBERERR = 0x3
 
static const int AMCHeaderSpec::MASK_FIXED = 0xF
 
static const int AMC13HeaderSpec::MASK_FIXED_LSB = 0xF
 
static const int CDFHeaderSpec::MASK_FIXED_MSB = 0xF
 
static const int QIE8HeaderSpec::MASK_FLAVOR = 0x7
 
static const int QIE10HeaderSpec::MASK_FLAVOR = 0x7
 
static const int QIE11HeaderSpec0::MASK_FLAVOR = 0x7
 
static const int QIE11HeaderSpec3::MASK_FLAVOR = 0x7
 
static const int TPHeaderSpec::MASK_FLAVOR = 0x7
 
static const int CDFHeaderSpec::MASK_FOV = 0xF
 
static const int CDFHeaderSpec::MASK_H = 0x8
 
static const int QIE8HeaderSpec::MASK_HEADER_BIT = 0x1
 
static const int QIE10HeaderSpec::MASK_HEADER_BIT = 0x1
 
static const int QIE11HeaderSpec0::MASK_HEADER_BIT = 0x1
 
static const int QIE11HeaderSpec3::MASK_HEADER_BIT = 0x1
 
static const int TPHeaderSpec::MASK_HEADER_BIT = 0x1
 
static const int AMCHeaderSpec::MASK_L = 0x1
 
static const int QIE10HeaderSpec::MASK_LE = 0x1
 
static const int TPHeaderSpec::MASK_LINK = 0xF
 
static const int QIE11HeaderSpec3::MASK_LINKERROR = 0x1
 
static const int CDFHeaderSpec::MASK_LV1_ID = 0xFFFFFF
 
static const int AMCHeaderSpec::MASK_M = 0x1
 
static const int QIE10HeaderSpec::MASK_MP = 0x1
 
static const int QIE11HeaderSpec3::MASK_MP = 0x1
 
static const int AMC13HeaderSpec::MASK_NAMC = 0xF
 
static const int AMC13HeaderSpec::MASK_ORN = 0xFFFFFFFF
 
static const int AMCHeaderSpec::MASK_P = 0x1
 
static const int AMCHeaderSpec::MASK_PRESAMPLES = 0xF
 
static const int AMC13HeaderSpec::MASK_RES = 0xF
 
static const int QIE10HeaderSpec::MASK_RESERV = 0x3
 
static const int AMC13HeaderSpec::MASK_RESERVED = 0xFFFF
 
static const int TPHeaderSpec::MASK_RESV = 0x3
 
static const int AMCHeaderSpec::MASK_S = 0x1
 
static const int AMCHeaderSpec::MASK_SLOT_ID = 0xF
 
static const int TPHeaderSpec::MASK_SOI_BIT = 0x1
 
static const int CDFHeaderSpec::MASK_SOURCE_ID = 0xFFF
 
static const int QIE8HeaderSpec::MASK_TECHNICAL_DATA_TYPE = 0xF
 
static const int TPHeaderSpec::MASK_TOWER = 0xF
 
static const int TPHeaderSpec::MASK_TPERR = 0x3
 
static const int AMC13HeaderSpec::MASK_UFOV = 0xF
 
static const int AMCHeaderSpec::MASK_V = 0x1
 
static const int QIE8SampleSpec::OFFSET_ADC = 0
 
static const int AMCHeaderSpec::OFFSET_AMC_NO = 16
 
static const int AMCHeaderSpec::OFFSET_AMCN_SIZE = 32
 
static const int AMCHeaderSpec::OFFSET_BLK_NO = 20
 
static const int CDFHeaderSpec::OFFSET_BX_ID = 20
 
static const int AMCHeaderSpec::OFFSET_C = 56
 
static const int QIE8HeaderSpec::OFFSET_CAPID = 8
 
static const int QIE11HeaderSpec0::OFFSET_CAPID = 8
 
static const int QIE8SampleSpec::OFFSET_CAPID = 8
 
static const int TPHeaderSpec::OFFSET_CHANID = 0
 
static const int AMCHeaderSpec::OFFSET_CRATE_ID = 0
 
static const int QIE8SampleSpec::OFFSET_DV = 10
 
static const int AMCHeaderSpec::OFFSET_E = 59
 
static const int QIE8SampleSpec::OFFSET_ER = 11
 
static const int CDFHeaderSpec::OFFSET_EVT_TY = 56
 
static const int QIE8HeaderSpec::OFFSET_FIBER = 2
 
static const int QIE10HeaderSpec::OFFSET_FIBER = 3
 
static const int QIE11HeaderSpec0::OFFSET_FIBER = 3
 
static const int QIE11HeaderSpec3::OFFSET_FIBER = 3
 
static const int QIE8HeaderSpec::OFFSET_FIBERCHAN = 0
 
static const int QIE10HeaderSpec::OFFSET_FIBERCHAN = 0
 
static const int QIE11HeaderSpec0::OFFSET_FIBERCHAN = 0
 
static const int QIE11HeaderSpec3::OFFSET_FIBERCHAN = 0
 
static const int QIE8HeaderSpec::OFFSET_FIBERERR = 10
 
static const int QIE11HeaderSpec0::OFFSET_FIBERERR = 10
 
static const int AMCHeaderSpec::OFFSET_FIXED = 28
 
static const int AMC13HeaderSpec::OFFSET_FIXED_LSB = 0
 
static const int CDFHeaderSpec::OFFSET_FIXED_MSB = 60
 
static const int QIE8HeaderSpec::OFFSET_FLAVOR = 12
 
static const int QIE10HeaderSpec::OFFSET_FLAVOR = 12
 
static const int QIE11HeaderSpec0::OFFSET_FLAVOR = 12
 
static const int QIE11HeaderSpec3::OFFSET_FLAVOR = 12
 
static const int TPHeaderSpec::OFFSET_FLAVOR = 12
 
static const int CDFHeaderSpec::OFFSET_FOV = 4
 
static const int CDFHeaderSpec::OFFSET_H = 0
 
static const int QIE8HeaderSpec::OFFSET_HEADER_BIT = 15
 
static const int QIE10HeaderSpec::OFFSET_HEADER_BIT = 15
 
static const int QIE11HeaderSpec0::OFFSET_HEADER_BIT = 15
 
static const int QIE11HeaderSpec3::OFFSET_HEADER_BIT = 15
 
static const int TPHeaderSpec::OFFSET_HEADER_BIT = 15
 
static const int AMCHeaderSpec::OFFSET_L = 62
 
static const int QIE10HeaderSpec::OFFSET_LE = 11
 
static const int TPHeaderSpec::OFFSET_LINK = 4
 
static const int QIE11HeaderSpec3::OFFSET_LINKERROR = 11
 
static const uint64_t CDFHeaderSpec::OFFSET_LV1_ID = 32
 
static const int AMCHeaderSpec::OFFSET_M = 61
 
static const int QIE10HeaderSpec::OFFSET_MP = 8
 
static const int QIE11HeaderSpec3::OFFSET_MP = 8
 
static const int AMC13HeaderSpec::OFFSET_NAMC = 52
 
static const int AMC13HeaderSpec::OFFSET_ORN = 4
 
static const int AMCHeaderSpec::OFFSET_P = 58
 
static const int AMCHeaderSpec::OFFSET_PRESAMPLES = 12
 
static const int AMC13HeaderSpec::OFFSET_RES = 56
 
static const int QIE10HeaderSpec::OFFSET_RESERV = 9
 
static const int AMC13HeaderSpec::OFFSET_RESERVED = 36
 
static const int TPHeaderSpec::OFFSET_RESV = 8
 
static const int AMCHeaderSpec::OFFSET_S = 60
 
static const int AMCHeaderSpec::OFFSET_SLOT_ID = 8
 
static const int TPHeaderSpec::OFFSET_SOI_BIT = 14
 
static const int CDFHeaderSpec::OFFSET_SOURCE_ID = 8
 
static const int QIE8HeaderSpec::OFFSET_TECHNICAL_DATA_TYPE = 8
 
static const int TPHeaderSpec::OFFSET_TOWER = 0
 
static const int TPHeaderSpec::OFFSET_TPERR = 10
 
static const int AMC13HeaderSpec::OFFSET_UFOV = 60
 
static const int AMCHeaderSpec::OFFSET_V = 57
 

Function Documentation

◆ convertHB()

QIE11DataFrame convertHB ( QIE11DataFrame  qiehe,
std::vector< int > const &  tdc1,
std::vector< int > const &  tdc2,
const int  tdcmax 
)
inline

Definition at line 620 of file PackerHelp.h.

References funct::abs(), gpuClustering::adc, QIE11DataFrame::begin(), HcalDetId::depth(), QIE11DataFrame::detid(), QIE11DataFrame::end(), mps_splice::entry, dqmdumpme::first, HcalDetId::ieta(), edm::second(), QIE11DataFrame::setCapid0(), QIE11DataFrame::setFlavor(), and QIE11DataFrame::setSample().

Referenced by HcalDigiToRawuHTR::produce().

623  {
624  QIE11DataFrame qiehb = qiehe;
625  HcalDetId did = HcalDetId(qiehb.detid());
626  int adc, tdc;
627  bool soi;
628  int is = 0;
629  int capid = qiehe[0].capid();
630  // flavor for HB digies is hardcoded here
631  static const int hbflavor = 3;
632  // maximum HB depth
633  static const int maxHBdepth = 4;
634 
635  const int entry = (abs(did.ieta()) - 1) * maxHBdepth + did.depth() - 1;
636  const int first = tdc1.at(entry);
637  const int second = tdc2.at(entry);
638 
639  // iterator over samples
640  for (edm::DataFrame::const_iterator it = qiehe.begin(); it != qiehe.end(); ++it) {
641  if (it == qiehe.begin())
642  continue;
643  adc = qiehe[is].adc();
644  tdc = qiehe[is].tdc();
645  soi = qiehe[is].soi();
646 
647  if (tdc >= 0 && tdc <= first)
648  tdc = 0;
649  else if (tdc > first && tdc <= second)
650  tdc = 1;
651  else if (tdc > second && tdc <= tdcmax)
652  tdc = 2;
653  else
654  tdc = 3;
655 
656  qiehb.setSample(is, adc, tdc, soi);
657  is++;
658  };
659 
660  // puting flavor is safe here because flavor is stored in the same bits for all flavors
661  qiehb.setFlavor(hbflavor);
662  qiehb.setCapid0(capid);
663 
664  return qiehb;
665 }
constexpr DetId detid() const
Get the detector id.
U second(std::pair< T, U > const &p)
constexpr void setFlavor(int flavor)
constexpr int ieta() const
get the cell ieta
Definition: HcalDetId.h:155
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
constexpr edm::DataFrame::iterator end()
constexpr void setSample(edm::DataFrame::size_type isample, int adc, int tdc, bool soi=false)
set the sample contents
constexpr edm::DataFrame::iterator begin()
iterators
data_type const * const_iterator
Definition: DataFrame.h:21
constexpr void setCapid0(int cap0)
uint16_t *__restrict__ uint16_t const *__restrict__ adc
constexpr int depth() const
get the tower depth
Definition: HcalDetId.h:164