CMS 3D CMS Logo

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

#include <HGCalConcentratorSuperTriggerCellImpl.h>

Classes

class  SuperTriggerCell
 

Public Member Functions

void eventSetup (const edm::EventSetup &es)
 
 HGCalConcentratorSuperTriggerCellImpl (const edm::ParameterSet &conf)
 
void select (const std::vector< l1t::HGCalTriggerCell > &trigCellVecInput, std::vector< l1t::HGCalTriggerCell > &trigCellVecOutput)
 

Private Types

enum  EnergyDivisionType { superTriggerCell, oneBitFraction, equalShare }
 

Private Member Functions

void assignSuperTriggerCellEnergyAndPosition (l1t::HGCalTriggerCell &c, const SuperTriggerCell &stc) const
 
void createAllTriggerCells (std::unordered_map< unsigned, SuperTriggerCell > &STCs, std::vector< l1t::HGCalTriggerCell > &trigCellVecOutput) const
 
uint32_t getCompressedSTCEnergy (const SuperTriggerCell &stc) const
 
float getTriggerCellOneBitFraction (float tcPt, float sumPt) const
 

Private Attributes

HGCalTriggerCellCalibration calibration_
 
std::vector< unsigned > coarsenTriggerCells_
 
HGCalCoarseTriggerCellMapping coarseTCmapping_
 
EnergyDivisionType energyDivisionType_
 
bool fixedDataSizePerHGCROC_
 
double oneBitFractionHighValue_
 
double oneBitFractionLowValue_
 
double oneBitFractionThreshold_
 
HGCalCoarseTriggerCellMapping superTCmapping_
 
HGCalTriggerTools triggerTools_
 
HGCalVFECompressionImpl vfeCompression_
 

Static Private Attributes

static constexpr int kHighDensityThickness_ = 0
 
static constexpr int kOddNumberMask_ = 1
 
static constexpr int kTriggerCellsForDivision_ = 4
 

Detailed Description

Definition at line 13 of file HGCalConcentratorSuperTriggerCellImpl.h.

Member Enumeration Documentation

◆ EnergyDivisionType

Enumerator
superTriggerCell 
oneBitFraction 
equalShare 

Definition at line 27 of file HGCalConcentratorSuperTriggerCellImpl.h.

27  {
30  equalShare,
31  };

Constructor & Destructor Documentation

◆ HGCalConcentratorSuperTriggerCellImpl()

HGCalConcentratorSuperTriggerCellImpl::HGCalConcentratorSuperTriggerCellImpl ( const edm::ParameterSet conf)

Definition at line 3 of file HGCalConcentratorSuperTriggerCellImpl.cc.

4  : fixedDataSizePerHGCROC_(conf.getParameter<bool>("fixedDataSizePerHGCROC")),
5  coarsenTriggerCells_(conf.getParameter<std::vector<unsigned>>("coarsenTriggerCells")),
6  coarseTCmapping_(conf.getParameter<std::vector<unsigned>>("ctcSize")),
7  superTCmapping_(conf.getParameter<std::vector<unsigned>>("stcSize")),
8  calibration_(conf.getParameterSet("superTCCalibration")),
9  vfeCompression_(conf.getParameterSet("superTCCompression")) {
10  std::string energyType(conf.getParameter<string>("type_energy_division"));
11 
12  if (energyType == "superTriggerCell") {
14  } else if (energyType == "oneBitFraction") {
16 
17  oneBitFractionThreshold_ = conf.getParameter<double>("oneBitFractionThreshold");
18  oneBitFractionLowValue_ = conf.getParameter<double>("oneBitFractionLowValue");
19  oneBitFractionHighValue_ = conf.getParameter<double>("oneBitFractionHighValue");
20 
21  } else if (energyType == "equalShare") {
23 
24  } else {
26  }
27 }

References energyDivisionType_, equalShare, edm::ParameterSet::getParameter(), oneBitFraction, oneBitFractionHighValue_, oneBitFractionLowValue_, oneBitFractionThreshold_, AlCaHLTBitMon_QueryRunRegistry::string, and superTriggerCell.

Member Function Documentation

◆ assignSuperTriggerCellEnergyAndPosition()

void HGCalConcentratorSuperTriggerCellImpl::assignSuperTriggerCellEnergyAndPosition ( l1t::HGCalTriggerCell c,
const SuperTriggerCell stc 
) const
private

Definition at line 93 of file HGCalConcentratorSuperTriggerCellImpl.cc.

94  {
95  //Compress and recalibrate STC energy
96  uint32_t compressed_value = getCompressedSTCEnergy(stc);
97 
99  int thickness = triggerTools_.thicknessIndex(c.detId(), true);
100 
104  } else {
105  point = triggerTools_.getTCPosition(c.detId());
106  }
107  c.setPosition(point);
108 
109  math::PtEtaPhiMLorentzVector p4(c.pt(), point.eta(), point.phi(), 0.);
110  c.setP4(p4);
111 
113  if (c.detId() == stc.getMaxId()) {
114  c.setHwPt(compressed_value);
116  } else {
117  throw cms::Exception("NonMaxIdSuperTriggerCell")
118  << "Trigger Cell with detId not equal to the maximum of the superTriggerCell found";
119  }
120  } else if (energyDivisionType_ == equalShare) {
121  double coarseTriggerCellSize =
122  coarsenTriggerCells_[subdet]
123  ? double(
125  .size())
126  : 1.;
127 
128  double denominator =
130  ? double(kTriggerCellsForDivision_)
131  : double(superTCmapping_.getConstituentTriggerCells(stc.getSTCId()).size()) / coarseTriggerCellSize;
132 
133  c.setHwPt(std::round(compressed_value / denominator));
135 
136  } else if (energyDivisionType_ == oneBitFraction) {
137  double frac = 0;
138 
139  if (c.detId() != stc.getMaxId()) {
140  frac = getTriggerCellOneBitFraction(stc.getTCpt(c.detId()), stc.getSumPt());
141  } else {
142  frac = 1 - stc.getFractionSum();
143  }
144 
145  c.setHwPt(std::round(compressed_value * frac));
147  }
148 }

References HltBtagPostValidation_cff::c, HGCalTriggerCellCalibration::calibrateInGeV(), calibration_, coarsenTriggerCells_, coarseTCmapping_, HLTTauDQMOffline_cfi::denominator, energyDivisionType_, equalShare, Exception, fixedDataSizePerHGCROC_, cropTnPTrees::frac, HGCalCoarseTriggerCellMapping::getCoarseTriggerCellId(), HGCalCoarseTriggerCellMapping::getCoarseTriggerCellPosition(), getCompressedSTCEnergy(), HGCalCoarseTriggerCellMapping::getConstituentTriggerCells(), HGCalConcentratorSuperTriggerCellImpl::SuperTriggerCell::getFractionSum(), HGCalConcentratorSuperTriggerCellImpl::SuperTriggerCell::getMaxId(), HGCalConcentratorSuperTriggerCellImpl::SuperTriggerCell::getSTCId(), HGCalTriggerTools::getSubDetectorType(), HGCalConcentratorSuperTriggerCellImpl::SuperTriggerCell::getSumPt(), HGCalTriggerTools::getTCPosition(), HGCalConcentratorSuperTriggerCellImpl::SuperTriggerCell::getTCpt(), getTriggerCellOneBitFraction(), kHighDensityThickness_, kTriggerCellsForDivision_, oneBitFraction, p4, point, findQualityFiles::size, superTCmapping_, superTriggerCell, Calorimetry_cff::thickness, HGCalTriggerTools::thicknessIndex(), and triggerTools_.

Referenced by createAllTriggerCells().

◆ createAllTriggerCells()

void HGCalConcentratorSuperTriggerCellImpl::createAllTriggerCells ( std::unordered_map< unsigned, SuperTriggerCell > &  STCs,
std::vector< l1t::HGCalTriggerCell > &  trigCellVecOutput 
) const
private

Definition at line 36 of file HGCalConcentratorSuperTriggerCellImpl.cc.

37  {
38  for (auto& s : STCs) {
39  std::vector<uint32_t> output_ids = superTCmapping_.getConstituentTriggerCells(s.second.getSTCId());
40  if (output_ids.empty())
41  continue;
42 
44  int thickness = (!output_ids.empty() ? triggerTools_.thicknessIndex(output_ids.at(0), true) : 0);
45 
46  for (const auto& id : output_ids) {
49  continue;
50  }
51 
53  continue;
54  }
55 
56  l1t::HGCalTriggerCell triggerCell;
57  triggerCell.setDetId(id);
58  if (energyDivisionType_ == superTriggerCell && id != s.second.getMaxId()) {
59  continue;
60  }
61 
62  DetId tc_Id(id);
63 
64  //To guard against the case in v8 geometry where
65  //there might be different thicknesses within a module
66  //This is a small effect, but in principle energy might
67  //be lost.
68  if (superTCmapping_.getCoarseTriggerCellId(id) != s.second.getSTCId()) {
70  throw cms::Exception("NonExistingCoarseTC")
71  << "The coarse trigger cell correponsing to the nominal trigger cell does not exist";
72  } else {
73  continue;
74  }
75  }
76  trigCellVecOutput.push_back(triggerCell);
77  if (energyDivisionType_ == oneBitFraction) { //Get the 1 bit fractions
78 
79  if (id != s.second.getMaxId()) {
80  float tc_fraction = getTriggerCellOneBitFraction(s.second.getTCpt(id), s.second.getSumPt());
81  s.second.addToFractionSum(tc_fraction);
82  }
83  }
84  }
85  }
86  // assign energy
87  for (l1t::HGCalTriggerCell& tc : trigCellVecOutput) {
88  const auto& stc = STCs[superTCmapping_.getCoarseTriggerCellId(tc.detId())];
90  }
91 }

References assignSuperTriggerCellEnergyAndPosition(), coarsenTriggerCells_, coarseTCmapping_, energyDivisionType_, Exception, fixedDataSizePerHGCROC_, HGCalCoarseTriggerCellMapping::getCoarseTriggerCellId(), HGCalCoarseTriggerCellMapping::getConstituentTriggerCells(), HGCalCoarseTriggerCellMapping::getRepresentativeDetId(), HGCalTriggerTools::getSubDetectorType(), getTriggerCellOneBitFraction(), HGCalTriggerTools::getTriggerGeometry(), HGCalTriggerGeometryBase::isV9Geometry(), kHighDensityThickness_, oneBitFraction, alignCSCRings::s, l1t::HGCalTriggerCell::setDetId(), superTCmapping_, superTriggerCell, Calorimetry_cff::thickness, HGCalTriggerTools::thicknessIndex(), triggerTools_, and HGCalTriggerGeometryBase::validTriggerCell().

Referenced by select().

◆ eventSetup()

void HGCalConcentratorSuperTriggerCellImpl::eventSetup ( const edm::EventSetup es)
inline

◆ getCompressedSTCEnergy()

uint32_t HGCalConcentratorSuperTriggerCellImpl::getCompressedSTCEnergy ( const SuperTriggerCell stc) const
private

Definition at line 29 of file HGCalConcentratorSuperTriggerCellImpl.cc.

29  {
30  uint32_t code(0);
31  uint32_t compressed_value(0);
32  vfeCompression_.compressSingle(stc.getSumHwPt(), code, compressed_value);
33  return compressed_value;
34 }

References HGCalVFECompressionImpl::compressSingle(), HGCalConcentratorSuperTriggerCellImpl::SuperTriggerCell::getSumHwPt(), and vfeCompression_.

Referenced by assignSuperTriggerCellEnergyAndPosition().

◆ getTriggerCellOneBitFraction()

float HGCalConcentratorSuperTriggerCellImpl::getTriggerCellOneBitFraction ( float  tcPt,
float  sumPt 
) const
private

Definition at line 150 of file HGCalConcentratorSuperTriggerCellImpl.cc.

150  {
151  double f = tcPt / sumPt;
152  double frac = 0;
153  if (f < oneBitFractionThreshold_) {
155  } else {
157  }
158 
159  return frac;
160 }

References f, cropTnPTrees::frac, oneBitFractionHighValue_, oneBitFractionLowValue_, oneBitFractionThreshold_, and TtFullHadEvtBuilder_cfi::sumPt.

Referenced by assignSuperTriggerCellEnergyAndPosition(), and createAllTriggerCells().

◆ select()

void HGCalConcentratorSuperTriggerCellImpl::select ( const std::vector< l1t::HGCalTriggerCell > &  trigCellVecInput,
std::vector< l1t::HGCalTriggerCell > &  trigCellVecOutput 
)

Definition at line 162 of file HGCalConcentratorSuperTriggerCellImpl.cc.

163  {
164  std::unordered_map<unsigned, SuperTriggerCell> STCs;
165  // first pass, fill the "coarse" trigger cells
166  for (const l1t::HGCalTriggerCell& tc : trigCellVecInput) {
167  uint32_t stcid = superTCmapping_.getCoarseTriggerCellId(tc.detId());
168  STCs[stcid].add(tc, stcid);
169  }
170 
171  createAllTriggerCells(STCs, trigCellVecOutput);
172 }

References createAllTriggerCells(), HGCalCoarseTriggerCellMapping::getCoarseTriggerCellId(), and superTCmapping_.

Member Data Documentation

◆ calibration_

HGCalTriggerCellCalibration HGCalConcentratorSuperTriggerCellImpl::calibration_
private

◆ coarsenTriggerCells_

std::vector<unsigned> HGCalConcentratorSuperTriggerCellImpl::coarsenTriggerCells_
private

◆ coarseTCmapping_

HGCalCoarseTriggerCellMapping HGCalConcentratorSuperTriggerCellImpl::coarseTCmapping_
private

◆ energyDivisionType_

EnergyDivisionType HGCalConcentratorSuperTriggerCellImpl::energyDivisionType_
private

◆ fixedDataSizePerHGCROC_

bool HGCalConcentratorSuperTriggerCellImpl::fixedDataSizePerHGCROC_
private

◆ kHighDensityThickness_

constexpr int HGCalConcentratorSuperTriggerCellImpl::kHighDensityThickness_ = 0
staticconstexprprivate

◆ kOddNumberMask_

constexpr int HGCalConcentratorSuperTriggerCellImpl::kOddNumberMask_ = 1
staticconstexprprivate

Definition at line 35 of file HGCalConcentratorSuperTriggerCellImpl.h.

◆ kTriggerCellsForDivision_

constexpr int HGCalConcentratorSuperTriggerCellImpl::kTriggerCellsForDivision_ = 4
staticconstexprprivate

◆ oneBitFractionHighValue_

double HGCalConcentratorSuperTriggerCellImpl::oneBitFractionHighValue_
private

◆ oneBitFractionLowValue_

double HGCalConcentratorSuperTriggerCellImpl::oneBitFractionLowValue_
private

◆ oneBitFractionThreshold_

double HGCalConcentratorSuperTriggerCellImpl::oneBitFractionThreshold_
private

◆ superTCmapping_

HGCalCoarseTriggerCellMapping HGCalConcentratorSuperTriggerCellImpl::superTCmapping_
private

◆ triggerTools_

HGCalTriggerTools HGCalConcentratorSuperTriggerCellImpl::triggerTools_
private

◆ vfeCompression_

HGCalVFECompressionImpl HGCalConcentratorSuperTriggerCellImpl::vfeCompression_
private

Definition at line 52 of file HGCalConcentratorSuperTriggerCellImpl.h.

Referenced by getCompressedSTCEnergy().

HGCalConcentratorSuperTriggerCellImpl::superTriggerCell
Definition: HGCalConcentratorSuperTriggerCellImpl.h:28
HGCalTriggerTools::eventSetup
void eventSetup(const edm::EventSetup &)
Definition: HGCalTriggerTools.cc:35
HGCalConcentratorSuperTriggerCellImpl::oneBitFractionThreshold_
double oneBitFractionThreshold_
Definition: HGCalConcentratorSuperTriggerCellImpl.h:44
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
HGCalConcentratorSuperTriggerCellImpl::kTriggerCellsForDivision_
static constexpr int kTriggerCellsForDivision_
Definition: HGCalConcentratorSuperTriggerCellImpl.h:49
cropTnPTrees.frac
frac
Definition: cropTnPTrees.py:18
HGCalTriggerTools::thicknessIndex
int thicknessIndex(const DetId &, bool tc=false) const
Definition: HGCalTriggerTools.cc:233
HGCalCoarseTriggerCellMapping::getConstituentTriggerCells
std::vector< uint32_t > getConstituentTriggerCells(uint32_t ctcId) const
Definition: HGCalCoarseTriggerCellMapping.cc:122
l1t::HGCalTriggerCell::setDetId
void setDetId(uint32_t detid)
Definition: HGCalTriggerCell.h:22
HGCalCoarseTriggerCellMapping::eventSetup
void eventSetup(const edm::EventSetup &es)
Definition: HGCalCoarseTriggerCellMapping.h:17
HGCalConcentratorSuperTriggerCellImpl::createAllTriggerCells
void createAllTriggerCells(std::unordered_map< unsigned, SuperTriggerCell > &STCs, std::vector< l1t::HGCalTriggerCell > &trigCellVecOutput) const
Definition: HGCalConcentratorSuperTriggerCellImpl.cc:36
HGCalCoarseTriggerCellMapping::getCoarseTriggerCellId
uint32_t getCoarseTriggerCellId(uint32_t detid) const
Definition: HGCalCoarseTriggerCellMapping.cc:60
TtFullHadEvtBuilder_cfi.sumPt
sumPt
Definition: TtFullHadEvtBuilder_cfi.py:38
HGCalTriggerCellCalibration::eventSetup
void eventSetup(const edm::EventSetup &es)
Definition: HGCalTriggerCellCalibration.h:18
HGCalConcentratorSuperTriggerCellImpl::fixedDataSizePerHGCROC_
bool fixedDataSizePerHGCROC_
Definition: HGCalConcentratorSuperTriggerCellImpl.h:38
DetId
Definition: DetId.h:17
alignCSCRings.s
s
Definition: alignCSCRings.py:92
HGCalTriggerTools::getTriggerGeometry
const HGCalTriggerGeometryBase * getTriggerGeometry() const
Definition: HGCalTriggerTools.h:69
Calorimetry_cff.thickness
thickness
Definition: Calorimetry_cff.py:114
l1t::HGCalTriggerCell
Definition: HGCalTriggerCell.h:14
HGCalConcentratorSuperTriggerCellImpl::oneBitFractionLowValue_
double oneBitFractionLowValue_
Definition: HGCalConcentratorSuperTriggerCellImpl.h:45
Point3DBase< float, GlobalTag >
HGCalConcentratorSuperTriggerCellImpl::calibration_
HGCalTriggerCellCalibration calibration_
Definition: HGCalConcentratorSuperTriggerCellImpl.h:51
HGCalTriggerTools::getTCPosition
GlobalPoint getTCPosition(const DetId &id) const
Definition: HGCalTriggerTools.cc:54
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
HGCalTriggerTools::getSubDetectorType
SubDetectorType getSubDetectorType(const DetId &id) const
Definition: HGCalTriggerTools.cc:198
HGCalConcentratorSuperTriggerCellImpl::getCompressedSTCEnergy
uint32_t getCompressedSTCEnergy(const SuperTriggerCell &stc) const
Definition: HGCalConcentratorSuperTriggerCellImpl.cc:29
HGCalConcentratorSuperTriggerCellImpl::triggerTools_
HGCalTriggerTools triggerTools_
Definition: HGCalConcentratorSuperTriggerCellImpl.h:37
HGCalTriggerGeometryBase::validTriggerCell
virtual bool validTriggerCell(const unsigned trigger_cell_id) const =0
p4
double p4[4]
Definition: TauolaWrapper.h:92
HGCalTriggerGeometryBase::isV9Geometry
bool isV9Geometry() const
Definition: HGCalTriggerGeometryBase.h:30
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
HGCalConcentratorSuperTriggerCellImpl::coarseTCmapping_
HGCalCoarseTriggerCellMapping coarseTCmapping_
Definition: HGCalConcentratorSuperTriggerCellImpl.h:40
HGCalCoarseTriggerCellMapping::getCoarseTriggerCellPosition
GlobalPoint getCoarseTriggerCellPosition(uint32_t ctcId) const
Definition: HGCalCoarseTriggerCellMapping.cc:196
HGCalConcentratorSuperTriggerCellImpl::assignSuperTriggerCellEnergyAndPosition
void assignSuperTriggerCellEnergyAndPosition(l1t::HGCalTriggerCell &c, const SuperTriggerCell &stc) const
Definition: HGCalConcentratorSuperTriggerCellImpl.cc:93
HGCalConcentratorSuperTriggerCellImpl::oneBitFraction
Definition: HGCalConcentratorSuperTriggerCellImpl.h:29
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
HLTTauDQMOffline_cfi.denominator
denominator
Definition: HLTTauDQMOffline_cfi.py:195
HGCalTriggerTools::SubDetectorType
SubDetectorType
Definition: HGCalTriggerTools.h:88
HGCalConcentratorSuperTriggerCellImpl::oneBitFractionHighValue_
double oneBitFractionHighValue_
Definition: HGCalConcentratorSuperTriggerCellImpl.h:46
HGCalConcentratorSuperTriggerCellImpl::getTriggerCellOneBitFraction
float getTriggerCellOneBitFraction(float tcPt, float sumPt) const
Definition: HGCalConcentratorSuperTriggerCellImpl.cc:150
Exception
Definition: hltDiff.cc:246
HGCalConcentratorSuperTriggerCellImpl::energyDivisionType_
EnergyDivisionType energyDivisionType_
Definition: HGCalConcentratorSuperTriggerCellImpl.h:33
HGCalConcentratorSuperTriggerCellImpl::kHighDensityThickness_
static constexpr int kHighDensityThickness_
Definition: HGCalConcentratorSuperTriggerCellImpl.h:34
HGCalVFECompressionImpl::compressSingle
void compressSingle(const uint32_t value, uint32_t &compressedCode, uint32_t &compressedValue) const
Definition: HGCalVFECompressionImpl.cc:15
math::PtEtaPhiMLorentzVector
PtEtaPhiMLorentzVectorD PtEtaPhiMLorentzVector
Lorentz vector with cartesian internal representation.
Definition: LorentzVector.h:25
HGCalTriggerCellCalibration::calibrateInGeV
void calibrateInGeV(l1t::HGCalTriggerCell &) const
Definition: HGCalTriggerCellCalibration.cc:104
point
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
Definition: invegas.h:5
HGCalCoarseTriggerCellMapping::getRepresentativeDetId
uint32_t getRepresentativeDetId(uint32_t tcid) const
Definition: HGCalCoarseTriggerCellMapping.cc:47
HGCalConcentratorSuperTriggerCellImpl::equalShare
Definition: HGCalConcentratorSuperTriggerCellImpl.h:30
HGCalConcentratorSuperTriggerCellImpl::superTCmapping_
HGCalCoarseTriggerCellMapping superTCmapping_
Definition: HGCalConcentratorSuperTriggerCellImpl.h:41
edm::ParameterSet::getParameterSet
ParameterSet const & getParameterSet(std::string const &) const
Definition: ParameterSet.cc:2121
HGCalConcentratorSuperTriggerCellImpl::vfeCompression_
HGCalVFECompressionImpl vfeCompression_
Definition: HGCalConcentratorSuperTriggerCellImpl.h:52
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443
HGCalConcentratorSuperTriggerCellImpl::coarsenTriggerCells_
std::vector< unsigned > coarsenTriggerCells_
Definition: HGCalConcentratorSuperTriggerCellImpl.h:39