CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | 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 superTriggerCellSelectImpl (const std::vector< l1t::HGCalTriggerCell > &trigCellVecInput, std::vector< l1t::HGCalTriggerCell > &trigCellVecOutput)
 

Private Member Functions

int getSuperTriggerCellId (int detid) const
 

Private Attributes

HGCSiliconDetIdToROC detIdToROC_
 
std::vector< unsigned > stcSize_
 
HGCalTriggerTools triggerTools_
 

Static Private Attributes

static int kNLayers_ = 3
 
static int kRocShift_ = 6
 
static int kRotate4_ = 4
 
static const std::map< int, int > kSplit_
 
static int kSplit_v8_Coarse_ = 0x30
 
static int kSplit_v8_Fine_ = 0x3a
 
static int kSplit_v9_ = 0x36
 
static int kSTCsizeCoarse_ = 16
 
static int kSTCsizeFine_ = 4
 
static int kUShift_ = 3
 
static int kWafer_offset_ = 6
 

Detailed Description

Definition at line 16 of file HGCalConcentratorSuperTriggerCellImpl.h.

Constructor & Destructor Documentation

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

Definition at line 6 of file HGCalConcentratorSuperTriggerCellImpl.cc.

References Exception, kNLayers_, kSplit_, kSplit_v8_Coarse_, kSplit_v8_Fine_, kSTCsizeCoarse_, kSTCsizeFine_, and stcSize_.

7  : stcSize_(conf.getParameter<std::vector<unsigned> >("stcSize")) {
8  if (stcSize_.size() != kNLayers_) {
9  throw cms::Exception("HGCTriggerParameterError")
10  << "Inconsistent size of super trigger cell size vector" << stcSize_.size();
11  }
12  for (auto stc : stcSize_) {
13  if (stc != kSTCsizeFine_ && stc != kSTCsizeCoarse_) {
14  throw cms::Exception("HGCTriggerParameterError")
15  << "Super Trigger Cell should be of size " << kSTCsizeFine_ << " or " << kSTCsizeCoarse_;
16  }
17  }
18 }
T getParameter(std::string const &) const

Member Function Documentation

void HGCalConcentratorSuperTriggerCellImpl::eventSetup ( const edm::EventSetup es)
inline
int HGCalConcentratorSuperTriggerCellImpl::getSuperTriggerCellId ( int  detid) const
private

Definition at line 23 of file HGCalConcentratorSuperTriggerCellImpl.cc.

References HGCalDetId::cell(), DetId::det(), detIdToROC_, DetId::Forward, HGCSiliconDetIdToROC::getROCNumber(), DetId::HGCalTrigger, HGCScintillatorDetId::ietaAbs(), HGCScintillatorDetId::iphi(), HGCalTriggerTools::isScintillator(), HGCScintillatorDetId::kHGCalPhiOffset, kRocShift_, kRotate4_, kSplit_, kSplit_v9_, kSTCsizeCoarse_, kUShift_, kWafer_offset_, stcSize_, HGCalTriggerTools::thicknessIndex(), HGCalTriggerDetId::triggerCellU(), HGCalTriggerDetId::triggerCellV(), triggerTools_, HGCalDetId::wafer(), HGCalTriggerDetId::waferU(), and HGCalTriggerDetId::waferV().

Referenced by eventSetup(), and superTriggerCellSelectImpl().

23  {
24  DetId TC_id(detid);
25  if (TC_id.det() == DetId::Forward) { //V8
26 
27  HGCalDetId TC_idV8(detid);
28 
29  if (triggerTools_.isScintillator(detid)) {
30  return TC_idV8.cell(); //scintillator
31  } else {
32  int TC_wafer = TC_idV8.wafer();
33  int thickness = triggerTools_.thicknessIndex(detid, true);
34  int TC_split = (TC_idV8.cell() & kSplit_.at(stcSize_.at(thickness)));
35 
36  return TC_wafer << kWafer_offset_ | TC_split;
37  }
38 
39  }
40 
41  else if (TC_id.det() == DetId::HGCalTrigger) { //V9
42 
43  if (triggerTools_.isScintillator(detid)) {
44  HGCScintillatorDetId TC_idV9(detid);
45  return TC_idV9.ietaAbs() << HGCScintillatorDetId::kHGCalPhiOffset | TC_idV9.iphi(); //scintillator
46  } else {
47  HGCalTriggerDetId TC_idV9(detid);
48 
49  int TC_wafer = TC_idV9.waferU() << kWafer_offset_ | TC_idV9.waferV();
50  int thickness = triggerTools_.thicknessIndex(detid);
51 
52  int TC_12th = 0;
53  int Uprime = 0;
54  int Vprime = 0;
55  int rocnum = detIdToROC_.getROCNumber(TC_idV9.triggerCellU(), TC_idV9.triggerCellV(), 1);
56 
57  if (rocnum == 1) {
58  Uprime = TC_idV9.triggerCellU();
59  Vprime = TC_idV9.triggerCellV() - TC_idV9.triggerCellU();
60 
61  } else if (rocnum == 2) {
62  Uprime = TC_idV9.triggerCellU() - TC_idV9.triggerCellV() - 1;
63  Vprime = TC_idV9.triggerCellV();
64 
65  } else if (rocnum == 3) {
66  Uprime = TC_idV9.triggerCellU() - kRotate4_;
67  Vprime = TC_idV9.triggerCellV() - kRotate4_;
68  }
69 
70  TC_12th = (rocnum << kRocShift_) | ((Uprime << kUShift_ | Vprime) & kSplit_v9_);
71 
72  int TC_split = TC_12th;
73  if (stcSize_.at(thickness) == kSTCsizeCoarse_) {
74  TC_split = rocnum;
75  }
76 
77  return TC_wafer << kWafer_offset_ | TC_split;
78  }
79 
80  } else {
81  return -1;
82  }
83 }
bool isScintillator(const DetId &id) const
Definition: DetId.h:18
int thicknessIndex(const DetId &, bool tc=false) const
static const int kHGCalPhiOffset
int getROCNumber(HGCalTriggerDetId const &id) const
void HGCalConcentratorSuperTriggerCellImpl::superTriggerCellSelectImpl ( const std::vector< l1t::HGCalTriggerCell > &  trigCellVecInput,
std::vector< l1t::HGCalTriggerCell > &  trigCellVecOutput 
)

Definition at line 85 of file HGCalConcentratorSuperTriggerCellImpl.cc.

References PVValHelper::add(), getSuperTriggerCellId(), and HGCHEB.

86  {
87  std::unordered_map<unsigned, SuperTriggerCell> STCs;
88 
89  // first pass, fill the super trigger cells
90  for (const l1t::HGCalTriggerCell& tc : trigCellVecInput) {
91  if (tc.subdetId() == HGCHEB)
92  continue;
93  STCs[getSuperTriggerCellId(tc.detId())].add(tc);
94  }
95 
96  // second pass, write them out
97  for (const l1t::HGCalTriggerCell& tc : trigCellVecInput) {
98  //If scintillator use a simple threshold cut
99  if (tc.subdetId() == HGCHEB) {
100  trigCellVecOutput.push_back(tc);
101  } else {
102  const auto& stc = STCs[getSuperTriggerCellId(tc.detId())];
103  if (tc.detId() == stc.GetMaxId()) {
104  trigCellVecOutput.push_back(tc);
105  stc.assignEnergy(trigCellVecOutput.back());
106  }
107  }
108 
109  } // end of second loop
110 }
void add(std::map< std::string, TH1 * > &h, TH1 *hist)

Member Data Documentation

HGCSiliconDetIdToROC HGCalConcentratorSuperTriggerCellImpl::detIdToROC_
private

Definition at line 40 of file HGCalConcentratorSuperTriggerCellImpl.h.

Referenced by getSuperTriggerCellId().

int HGCalConcentratorSuperTriggerCellImpl::kNLayers_ = 3
staticprivate
int HGCalConcentratorSuperTriggerCellImpl::kRocShift_ = 6
staticprivate

Definition at line 35 of file HGCalConcentratorSuperTriggerCellImpl.h.

Referenced by getSuperTriggerCellId().

int HGCalConcentratorSuperTriggerCellImpl::kRotate4_ = 4
staticprivate

Definition at line 36 of file HGCalConcentratorSuperTriggerCellImpl.h.

Referenced by getSuperTriggerCellId().

const std::map< int, int > HGCalConcentratorSuperTriggerCellImpl::kSplit_
staticprivate
int HGCalConcentratorSuperTriggerCellImpl::kSplit_v8_Coarse_ = 0x30
staticprivate
int HGCalConcentratorSuperTriggerCellImpl::kSplit_v8_Fine_ = 0x3a
staticprivate
int HGCalConcentratorSuperTriggerCellImpl::kSplit_v9_ = 0x36
staticprivate

Definition at line 33 of file HGCalConcentratorSuperTriggerCellImpl.h.

Referenced by getSuperTriggerCellId().

int HGCalConcentratorSuperTriggerCellImpl::kSTCsizeCoarse_ = 16
staticprivate
int HGCalConcentratorSuperTriggerCellImpl::kSTCsizeFine_ = 4
staticprivate
int HGCalConcentratorSuperTriggerCellImpl::kUShift_ = 3
staticprivate

Definition at line 37 of file HGCalConcentratorSuperTriggerCellImpl.h.

Referenced by getSuperTriggerCellId().

int HGCalConcentratorSuperTriggerCellImpl::kWafer_offset_ = 6
staticprivate

Definition at line 27 of file HGCalConcentratorSuperTriggerCellImpl.h.

Referenced by getSuperTriggerCellId().

std::vector<unsigned> HGCalConcentratorSuperTriggerCellImpl::stcSize_
private
HGCalTriggerTools HGCalConcentratorSuperTriggerCellImpl::triggerTools_
private

Definition at line 39 of file HGCalConcentratorSuperTriggerCellImpl.h.

Referenced by eventSetup(), and getSuperTriggerCellId().