CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
HGCalTriggerNtupleHGCTriggerSums Class Reference
Inheritance diagram for HGCalTriggerNtupleHGCTriggerSums:
HGCalTriggerNtupleBase

Public Member Functions

void fill (const edm::Event &e, const edm::EventSetup &es) final
 
 HGCalTriggerNtupleHGCTriggerSums (const edm::ParameterSet &conf)
 
void initialize (TTree &, const edm::ParameterSet &, edm::ConsumesCollector &&) final
 
 ~HGCalTriggerNtupleHGCTriggerSums () override
 
- Public Member Functions inherited from HGCalTriggerNtupleBase
 HGCalTriggerNtupleBase (const edm::ParameterSet &conf)
 
virtual ~HGCalTriggerNtupleBase ()
 

Private Member Functions

void clear () final
 

Private Attributes

edm::ESHandle< HGCalTriggerGeometryBasegeometry_
 
edm::EDGetToken trigger_sums_token_
 
HGCalTriggerTools triggerTools_
 
std::vector< uint32_t > ts_data_
 
std::vector< float > ts_energy_
 
std::vector< float > ts_eta_
 
std::vector< uint32_t > ts_id_
 
std::vector< int > ts_layer_
 
std::vector< float > ts_mipPt_
 
int ts_n_
 
std::vector< int > ts_panel_number_
 
std::vector< int > ts_panel_sector_
 
std::vector< float > ts_phi_
 
std::vector< float > ts_pt_
 
std::vector< int > ts_side_
 
std::vector< int > ts_subdet_
 
std::vector< int > ts_wafer_
 
std::vector< int > ts_wafertype_
 
std::vector< float > ts_x_
 
std::vector< float > ts_y_
 
std::vector< float > ts_z_
 

Static Private Attributes

static constexpr unsigned kPanelMask_ = 0x7F
 
static constexpr unsigned kPanelOffset_ = 0
 
static constexpr unsigned kSectorMask_ = 0x7
 
static constexpr unsigned kSectorOffset_ = 7
 

Additional Inherited Members

Detailed Description

Definition at line 11 of file HGCalTriggerNtupleHGCTriggerSums.cc.

Constructor & Destructor Documentation

◆ HGCalTriggerNtupleHGCTriggerSums()

HGCalTriggerNtupleHGCTriggerSums::HGCalTriggerNtupleHGCTriggerSums ( const edm::ParameterSet conf)

Definition at line 53 of file HGCalTriggerNtupleHGCTriggerSums.cc.

54  : HGCalTriggerNtupleBase(conf) {}

◆ ~HGCalTriggerNtupleHGCTriggerSums()

HGCalTriggerNtupleHGCTriggerSums::~HGCalTriggerNtupleHGCTriggerSums ( )
inlineoverride

Definition at line 14 of file HGCalTriggerNtupleHGCTriggerSums.cc.

14 {};

Member Function Documentation

◆ clear()

void HGCalTriggerNtupleHGCTriggerSums::clear ( void  )
finalprivatevirtual

Implements HGCalTriggerNtupleBase.

Definition at line 158 of file HGCalTriggerNtupleHGCTriggerSums.cc.

158  {
159  ts_n_ = 0;
160  ts_id_.clear();
161  ts_subdet_.clear();
162  ts_side_.clear();
163  ts_layer_.clear();
164  ts_wafer_.clear();
165  ts_wafertype_.clear();
166  ts_panel_number_.clear();
167  ts_panel_sector_.clear();
168  ts_data_.clear();
169  ts_mipPt_.clear();
170  ts_pt_.clear();
171  ts_energy_.clear();
172  ts_eta_.clear();
173  ts_phi_.clear();
174  ts_x_.clear();
175  ts_y_.clear();
176  ts_z_.clear();
177 }

References ts_data_, ts_energy_, ts_eta_, ts_id_, ts_layer_, ts_mipPt_, ts_n_, ts_panel_number_, ts_panel_sector_, ts_phi_, ts_pt_, ts_side_, ts_subdet_, ts_wafer_, ts_wafertype_, ts_x_, ts_y_, and ts_z_.

Referenced by fill().

◆ fill()

void HGCalTriggerNtupleHGCTriggerSums::fill ( const edm::Event e,
const edm::EventSetup es 
)
finalvirtual

Implements HGCalTriggerNtupleBase.

Definition at line 90 of file HGCalTriggerNtupleHGCTriggerSums.cc.

90  {
91  // retrieve trigger cells
93  e.getByToken(trigger_sums_token_, trigger_sums_h);
94  const l1t::HGCalTriggerSumsBxCollection& trigger_sums = *trigger_sums_h;
95 
96  // retrieve geometry
98 
100 
101  clear();
102  for (auto ts_itr = trigger_sums.begin(0); ts_itr != trigger_sums.end(0); ts_itr++) {
103  if (ts_itr->pt() > 0) {
104  ts_n_++;
105  // hardware data
106  DetId panelId(ts_itr->detId());
107  int panel_sector = -999;
108  int panel_number = -999;
109  if (panelId.det() == DetId::Forward) {
110  HGCalDetId panelIdHGCal(panelId);
111  if (panelId.subdetId() == ForwardSubdetector::HGCHEB) {
112  panel_number = panelIdHGCal.wafer();
113  } else {
114  panel_sector = (panelIdHGCal.wafer() >> kSectorOffset_) & kSectorMask_;
115  panel_number = (panelIdHGCal.wafer() >> kPanelOffset_) & kPanelMask_;
116  }
117  } else if (panelId.det() == DetId::HGCalHSc) {
118  HGCScintillatorDetId panelIdSci(panelId);
119  panel_sector = panelIdSci.iphi();
120  panel_number = panelIdSci.ietaAbs();
121  }
122  ts_panel_number_.emplace_back(panel_number);
123  ts_panel_sector_.emplace_back(panel_sector);
124  ts_id_.emplace_back(ts_itr->detId());
125  ts_side_.emplace_back(triggerTools_.zside(panelId));
126  ts_layer_.emplace_back(triggerTools_.layerWithOffset(panelId));
127  // V9 detids
128  if (panelId.det() == DetId::HGCalTrigger) {
129  HGCalTriggerDetId idv9(panelId);
130  ts_subdet_.emplace_back(idv9.subdet());
131  ts_wafertype_.emplace_back(idv9.type());
132  } else if (panelId.det() == DetId::HGCalHSc) {
133  HGCScintillatorDetId idv9(panelId);
134  ts_subdet_.emplace_back(idv9.subdet());
135  ts_wafertype_.emplace_back(idv9.type());
136  }
137  // V8 detids
138  else {
139  HGCalDetId idv8(panelId);
140  ts_subdet_.emplace_back(panelId.subdetId());
141  ts_wafer_.emplace_back(idv8.wafer());
142  ts_wafertype_.emplace_back(idv8.waferType());
143  }
144  ts_data_.emplace_back(ts_itr->hwPt());
145  ts_mipPt_.emplace_back(ts_itr->mipPt());
146  // physical values
147  ts_pt_.emplace_back(ts_itr->pt());
148  ts_energy_.emplace_back(ts_itr->energy());
149  ts_eta_.emplace_back(ts_itr->eta());
150  ts_phi_.emplace_back(ts_itr->phi());
151  ts_x_.emplace_back(ts_itr->position().x());
152  ts_y_.emplace_back(ts_itr->position().y());
153  ts_z_.emplace_back(ts_itr->position().z());
154  }
155  }
156 }

References BXVector< T >::begin(), clear(), MillePedeFileConverter_cfg::e, BXVector< T >::end(), HGCalTriggerTools::eventSetup(), DetId::Forward, geometry_, edm::EventSetup::get(), get, DetId::HGCalHSc, DetId::HGCalTrigger, HGCHEB, HGCScintillatorDetId::ietaAbs(), HGCScintillatorDetId::iphi(), kPanelMask_, kPanelOffset_, kSectorMask_, kSectorOffset_, HGCalTriggerTools::layerWithOffset(), HGCScintillatorDetId::subdet(), HGCalTriggerDetId::subdet(), trigger_sums_token_, triggerTools_, ts_data_, ts_energy_, ts_eta_, ts_id_, ts_layer_, ts_mipPt_, ts_n_, ts_panel_number_, ts_panel_sector_, ts_phi_, ts_pt_, ts_side_, ts_subdet_, ts_wafer_, ts_wafertype_, ts_x_, ts_y_, ts_z_, HGCScintillatorDetId::type(), HGCalTriggerDetId::type(), HGCalDetId::wafer(), HGCalDetId::waferType(), and HGCalTriggerTools::zside().

◆ initialize()

void HGCalTriggerNtupleHGCTriggerSums::initialize ( TTree &  tree,
const edm::ParameterSet conf,
edm::ConsumesCollector &&  collector 
)
finalvirtual

Implements HGCalTriggerNtupleBase.

Definition at line 56 of file HGCalTriggerNtupleHGCTriggerSums.cc.

58  {
61 
62  std::string prefix(conf.getUntrackedParameter<std::string>("Prefix", "ts"));
63 
64  std::string bname;
65  auto withPrefix([&prefix, &bname](char const* vname) -> char const* {
66  bname = prefix + "_" + vname;
67  return bname.c_str();
68  });
69 
70  tree.Branch(withPrefix("n"), &ts_n_, (prefix + "_n/I").c_str());
71  tree.Branch(withPrefix("id"), &ts_id_);
72  tree.Branch(withPrefix("subdet"), &ts_subdet_);
73  tree.Branch(withPrefix("zside"), &ts_side_);
74  tree.Branch(withPrefix("layer"), &ts_layer_);
75  tree.Branch(withPrefix("wafer"), &ts_wafer_);
76  tree.Branch(withPrefix("wafertype"), &ts_wafertype_);
77  tree.Branch(withPrefix("panel_number"), &ts_panel_number_);
78  tree.Branch(withPrefix("panel_sector"), &ts_panel_sector_);
79  tree.Branch(withPrefix("data"), &ts_data_);
80  tree.Branch(withPrefix("pt"), &ts_pt_);
81  tree.Branch(withPrefix("mipPt"), &ts_mipPt_);
82  tree.Branch(withPrefix("energy"), &ts_energy_);
83  tree.Branch(withPrefix("eta"), &ts_eta_);
84  tree.Branch(withPrefix("phi"), &ts_phi_);
85  tree.Branch(withPrefix("x"), &ts_x_);
86  tree.Branch(withPrefix("y"), &ts_y_);
87  tree.Branch(withPrefix("z"), &ts_z_);
88 }

References edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), ZMuMuAnalysisNtupler_cff::prefix, AlCaHLTBitMon_QueryRunRegistry::string, trigger_sums_token_, ts_data_, ts_energy_, ts_eta_, ts_id_, ts_layer_, ts_mipPt_, ts_n_, ts_panel_number_, ts_panel_sector_, ts_phi_, ts_pt_, ts_side_, ts_subdet_, ts_wafer_, ts_wafertype_, ts_x_, ts_y_, and ts_z_.

Member Data Documentation

◆ geometry_

edm::ESHandle<HGCalTriggerGeometryBase> HGCalTriggerNtupleHGCTriggerSums::geometry_
private

Definition at line 24 of file HGCalTriggerNtupleHGCTriggerSums.cc.

Referenced by fill().

◆ kPanelMask_

constexpr unsigned HGCalTriggerNtupleHGCTriggerSums::kPanelMask_ = 0x7F
staticconstexprprivate

Definition at line 27 of file HGCalTriggerNtupleHGCTriggerSums.cc.

Referenced by fill().

◆ kPanelOffset_

constexpr unsigned HGCalTriggerNtupleHGCTriggerSums::kPanelOffset_ = 0
staticconstexprprivate

Definition at line 26 of file HGCalTriggerNtupleHGCTriggerSums.cc.

Referenced by fill().

◆ kSectorMask_

constexpr unsigned HGCalTriggerNtupleHGCTriggerSums::kSectorMask_ = 0x7
staticconstexprprivate

Definition at line 29 of file HGCalTriggerNtupleHGCTriggerSums.cc.

Referenced by fill().

◆ kSectorOffset_

constexpr unsigned HGCalTriggerNtupleHGCTriggerSums::kSectorOffset_ = 7
staticconstexprprivate

Definition at line 28 of file HGCalTriggerNtupleHGCTriggerSums.cc.

Referenced by fill().

◆ trigger_sums_token_

edm::EDGetToken HGCalTriggerNtupleHGCTriggerSums::trigger_sums_token_
private

Definition at line 23 of file HGCalTriggerNtupleHGCTriggerSums.cc.

Referenced by fill(), and initialize().

◆ triggerTools_

HGCalTriggerTools HGCalTriggerNtupleHGCTriggerSums::triggerTools_
private

Definition at line 21 of file HGCalTriggerNtupleHGCTriggerSums.cc.

Referenced by fill().

◆ ts_data_

std::vector<uint32_t> HGCalTriggerNtupleHGCTriggerSums::ts_data_
private

Definition at line 40 of file HGCalTriggerNtupleHGCTriggerSums.cc.

Referenced by clear(), fill(), and initialize().

◆ ts_energy_

std::vector<float> HGCalTriggerNtupleHGCTriggerSums::ts_energy_
private

Definition at line 43 of file HGCalTriggerNtupleHGCTriggerSums.cc.

Referenced by clear(), fill(), and initialize().

◆ ts_eta_

std::vector<float> HGCalTriggerNtupleHGCTriggerSums::ts_eta_
private

Definition at line 44 of file HGCalTriggerNtupleHGCTriggerSums.cc.

Referenced by clear(), fill(), and initialize().

◆ ts_id_

std::vector<uint32_t> HGCalTriggerNtupleHGCTriggerSums::ts_id_
private

Definition at line 32 of file HGCalTriggerNtupleHGCTriggerSums.cc.

Referenced by clear(), fill(), and initialize().

◆ ts_layer_

std::vector<int> HGCalTriggerNtupleHGCTriggerSums::ts_layer_
private

Definition at line 35 of file HGCalTriggerNtupleHGCTriggerSums.cc.

Referenced by clear(), fill(), and initialize().

◆ ts_mipPt_

std::vector<float> HGCalTriggerNtupleHGCTriggerSums::ts_mipPt_
private

Definition at line 41 of file HGCalTriggerNtupleHGCTriggerSums.cc.

Referenced by clear(), fill(), and initialize().

◆ ts_n_

int HGCalTriggerNtupleHGCTriggerSums::ts_n_
private

Definition at line 31 of file HGCalTriggerNtupleHGCTriggerSums.cc.

Referenced by clear(), fill(), and initialize().

◆ ts_panel_number_

std::vector<int> HGCalTriggerNtupleHGCTriggerSums::ts_panel_number_
private

Definition at line 36 of file HGCalTriggerNtupleHGCTriggerSums.cc.

Referenced by clear(), fill(), and initialize().

◆ ts_panel_sector_

std::vector<int> HGCalTriggerNtupleHGCTriggerSums::ts_panel_sector_
private

Definition at line 37 of file HGCalTriggerNtupleHGCTriggerSums.cc.

Referenced by clear(), fill(), and initialize().

◆ ts_phi_

std::vector<float> HGCalTriggerNtupleHGCTriggerSums::ts_phi_
private

Definition at line 45 of file HGCalTriggerNtupleHGCTriggerSums.cc.

Referenced by clear(), fill(), and initialize().

◆ ts_pt_

std::vector<float> HGCalTriggerNtupleHGCTriggerSums::ts_pt_
private

Definition at line 42 of file HGCalTriggerNtupleHGCTriggerSums.cc.

Referenced by clear(), fill(), and initialize().

◆ ts_side_

std::vector<int> HGCalTriggerNtupleHGCTriggerSums::ts_side_
private

Definition at line 34 of file HGCalTriggerNtupleHGCTriggerSums.cc.

Referenced by clear(), fill(), and initialize().

◆ ts_subdet_

std::vector<int> HGCalTriggerNtupleHGCTriggerSums::ts_subdet_
private

Definition at line 33 of file HGCalTriggerNtupleHGCTriggerSums.cc.

Referenced by clear(), fill(), and initialize().

◆ ts_wafer_

std::vector<int> HGCalTriggerNtupleHGCTriggerSums::ts_wafer_
private

Definition at line 38 of file HGCalTriggerNtupleHGCTriggerSums.cc.

Referenced by clear(), fill(), and initialize().

◆ ts_wafertype_

std::vector<int> HGCalTriggerNtupleHGCTriggerSums::ts_wafertype_
private

Definition at line 39 of file HGCalTriggerNtupleHGCTriggerSums.cc.

Referenced by clear(), fill(), and initialize().

◆ ts_x_

std::vector<float> HGCalTriggerNtupleHGCTriggerSums::ts_x_
private

Definition at line 46 of file HGCalTriggerNtupleHGCTriggerSums.cc.

Referenced by clear(), fill(), and initialize().

◆ ts_y_

std::vector<float> HGCalTriggerNtupleHGCTriggerSums::ts_y_
private

Definition at line 47 of file HGCalTriggerNtupleHGCTriggerSums.cc.

Referenced by clear(), fill(), and initialize().

◆ ts_z_

std::vector<float> HGCalTriggerNtupleHGCTriggerSums::ts_z_
private

Definition at line 48 of file HGCalTriggerNtupleHGCTriggerSums.cc.

Referenced by clear(), fill(), and initialize().

HGCalTriggerTools::eventSetup
void eventSetup(const edm::EventSetup &)
Definition: HGCalTriggerTools.cc:35
HGCalTriggerNtupleHGCTriggerSums::kSectorMask_
static constexpr unsigned kSectorMask_
Definition: HGCalTriggerNtupleHGCTriggerSums.cc:29
DetId::HGCalTrigger
Definition: DetId.h:35
HGCalTriggerNtupleHGCTriggerSums::kSectorOffset_
static constexpr unsigned kSectorOffset_
Definition: HGCalTriggerNtupleHGCTriggerSums.cc:28
HGCalTriggerNtupleHGCTriggerSums::ts_mipPt_
std::vector< float > ts_mipPt_
Definition: HGCalTriggerNtupleHGCTriggerSums.cc:41
HGCalTriggerNtupleHGCTriggerSums::ts_n_
int ts_n_
Definition: HGCalTriggerNtupleHGCTriggerSums.cc:31
CaloGeometryRecord
Definition: CaloGeometryRecord.h:30
tree
Definition: tree.py:1
HGCalTriggerNtupleHGCTriggerSums::ts_z_
std::vector< float > ts_z_
Definition: HGCalTriggerNtupleHGCTriggerSums.cc:48
HGCalTriggerNtupleHGCTriggerSums::ts_energy_
std::vector< float > ts_energy_
Definition: HGCalTriggerNtupleHGCTriggerSums.cc:43
HGCalTriggerNtupleHGCTriggerSums::clear
void clear() final
Definition: HGCalTriggerNtupleHGCTriggerSums.cc:158
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
edm::Handle
Definition: AssociativeIterator.h:50
HGCalTriggerNtupleHGCTriggerSums::ts_panel_sector_
std::vector< int > ts_panel_sector_
Definition: HGCalTriggerNtupleHGCTriggerSums.cc:37
BXVector
Definition: BXVector.h:15
DetId
Definition: DetId.h:17
HGCalTriggerNtupleHGCTriggerSums::geometry_
edm::ESHandle< HGCalTriggerGeometryBase > geometry_
Definition: HGCalTriggerNtupleHGCTriggerSums.cc:24
HGCalTriggerNtupleBase::HGCalTriggerNtupleBase
HGCalTriggerNtupleBase(const edm::ParameterSet &conf)
Definition: HGCalTriggerNtupleBase.h:12
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
HGCalTriggerNtupleHGCTriggerSums::ts_pt_
std::vector< float > ts_pt_
Definition: HGCalTriggerNtupleHGCTriggerSums.cc:42
HGCalTriggerNtupleHGCTriggerSums::ts_phi_
std::vector< float > ts_phi_
Definition: HGCalTriggerNtupleHGCTriggerSums.cc:45
HGCalTriggerNtupleHGCTriggerSums::ts_eta_
std::vector< float > ts_eta_
Definition: HGCalTriggerNtupleHGCTriggerSums.cc:44
HGCalTriggerNtupleHGCTriggerSums::kPanelOffset_
static constexpr unsigned kPanelOffset_
Definition: HGCalTriggerNtupleHGCTriggerSums.cc:26
HGCalTriggerNtupleHGCTriggerSums::ts_panel_number_
std::vector< int > ts_panel_number_
Definition: HGCalTriggerNtupleHGCTriggerSums.cc:36
edm::ConsumesCollector::consumes
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Definition: ConsumesCollector.h:49
HGCalTriggerTools::layerWithOffset
unsigned layerWithOffset(const DetId &) const
Definition: HGCalTriggerTools.cc:134
HGCalTriggerTools::zside
int zside(const DetId &) const
Definition: HGCalTriggerTools.cc:210
HGCalTriggerNtupleHGCTriggerSums::ts_id_
std::vector< uint32_t > ts_id_
Definition: HGCalTriggerNtupleHGCTriggerSums.cc:32
BXVector::begin
const_iterator begin(int bx) const
HGCalTriggerNtupleHGCTriggerSums::ts_x_
std::vector< float > ts_x_
Definition: HGCalTriggerNtupleHGCTriggerSums.cc:46
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
HGCalTriggerDetId
Definition: HGCalTriggerDetId.h:26
BXVector::end
const_iterator end(int bx) const
HGCalTriggerNtupleHGCTriggerSums::trigger_sums_token_
edm::EDGetToken trigger_sums_token_
Definition: HGCalTriggerNtupleHGCTriggerSums.cc:23
HGCalTriggerNtupleHGCTriggerSums::ts_layer_
std::vector< int > ts_layer_
Definition: HGCalTriggerNtupleHGCTriggerSums.cc:35
get
#define get
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
HGCalDetId
Definition: HGCalDetId.h:8
HGCalTriggerNtupleHGCTriggerSums::kPanelMask_
static constexpr unsigned kPanelMask_
Definition: HGCalTriggerNtupleHGCTriggerSums.cc:27
HGCalTriggerNtupleHGCTriggerSums::ts_side_
std::vector< int > ts_side_
Definition: HGCalTriggerNtupleHGCTriggerSums.cc:34
HGCalTriggerNtupleHGCTriggerSums::ts_wafertype_
std::vector< int > ts_wafertype_
Definition: HGCalTriggerNtupleHGCTriggerSums.cc:39
HGCScintillatorDetId
Definition: HGCScintillatorDetId.h:21
DetId::HGCalHSc
Definition: DetId.h:34
HGCalTriggerNtupleHGCTriggerSums::ts_data_
std::vector< uint32_t > ts_data_
Definition: HGCalTriggerNtupleHGCTriggerSums.cc:40
HGCalTriggerNtupleHGCTriggerSums::ts_y_
std::vector< float > ts_y_
Definition: HGCalTriggerNtupleHGCTriggerSums.cc:47
HGCalTriggerNtupleHGCTriggerSums::triggerTools_
HGCalTriggerTools triggerTools_
Definition: HGCalTriggerNtupleHGCTriggerSums.cc:21
HGCalTriggerNtupleHGCTriggerSums::ts_wafer_
std::vector< int > ts_wafer_
Definition: HGCalTriggerNtupleHGCTriggerSums.cc:38
HGCalTriggerNtupleHGCTriggerSums::ts_subdet_
std::vector< int > ts_subdet_
Definition: HGCalTriggerNtupleHGCTriggerSums.cc:33
DetId::Forward
Definition: DetId.h:30
edm::InputTag
Definition: InputTag.h:15
HGCHEB
Definition: ForwardSubdetector.h:10
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
ZMuMuAnalysisNtupler_cff.prefix
prefix
Definition: ZMuMuAnalysisNtupler_cff.py:14