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 <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, int tdc1, int tdc2, 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,
int  tdc1,
int  tdc2,
int  tdcmax 
)

Definition at line 619 of file PackerHelp.h.

619  {
620  QIE11DataFrame qiehb = qiehe;
621  int adc, tdc;
622  bool soi;
623  int is = 0;
624 
625  // flavor for HB digies is hardcoded here
626  static const int hbflavor = 3;
627 
628  // iterator over samples
629  for (edm::DataFrame::const_iterator it = qiehe.begin(); it != qiehe.end(); ++it) {
630  if (it == qiehe.begin())
631  continue;
632  adc = qiehe[is].adc();
633  tdc = qiehe[is].tdc();
634  soi = qiehe[is].soi();
635 
636  if (tdc >= 0 && tdc <= tdc1)
637  tdc = 0;
638  else if (tdc > tdc1 && tdc <= tdc2)
639  tdc = 1;
640  else if (tdc > tdc2 && tdc <= tdcmax)
641  tdc = 2;
642  else
643  tdc = 3;
644 
645  qiehb.setSample(is, adc, tdc, soi);
646  is++;
647  };
648 
649  // puting flavor is safe here because flavor is stored in the same bits for all flavors
650  qiehb.setFlavor(hbflavor);
651  int capid = qiehe[0].capid();
652  qiehb.setCapid0(capid);
653 
654  return qiehb;
655 }

References ecalMGPA::adc(), QIE11DataFrame::begin(), QIE11DataFrame::end(), QIE11DataFrame::setCapid0(), QIE11DataFrame::setFlavor(), and QIE11DataFrame::setSample().

Referenced by HcalDigiToRawuHTR::produce().

QIE11DataFrame::begin
constexpr edm::DataFrame::iterator begin()
iterators
Definition: QIE11DataFrame.h:72
ecalMGPA::adc
constexpr int adc(sample_type sample)
get the ADC sample (12 bits)
Definition: EcalMGPASample.h:11
QIE11DataFrame::end
constexpr edm::DataFrame::iterator end()
Definition: QIE11DataFrame.h:73
QIE11DataFrame::setCapid0
constexpr void setCapid0(int cap0)
Definition: QIE11DataFrame.h:109
QIE11DataFrame::setFlavor
constexpr void setFlavor(int flavor)
Definition: QIE11DataFrame.h:104
QIE11DataFrame::setSample
constexpr void setSample(edm::DataFrame::size_type isample, int adc, int tdc, bool soi=false)
set the sample contents
Definition: QIE11DataFrame.h:121
edm::DataFrame::const_iterator
const data_type * const_iterator
Definition: DataFrame.h:21
QIE11DataFrame
Definition: QIE11DataFrame.h:11