CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
HGCalTriggerNtupleHGCTriggerSums Class Reference
Inheritance diagram for HGCalTriggerNtupleHGCTriggerSums:
HGCalTriggerNtupleBase

Public Member Functions

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

Private Member Functions

void clear () final
 

Private Attributes

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_
 

Additional Inherited Members

- Protected Attributes inherited from HGCalTriggerNtupleBase
bool accessEventSetup_ = true
 
const std::string name_
 

Detailed Description

Definition at line 11 of file HGCalTriggerNtupleHGCTriggerSums.cc.

Constructor & Destructor Documentation

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

Definition at line 47 of file HGCalTriggerNtupleHGCTriggerSums.cc.

References HGCalTriggerNtupleBase::accessEventSetup_.

48  : HGCalTriggerNtupleBase(conf) {
49  accessEventSetup_ = false;
50 }
HGCalTriggerNtupleBase(const edm::ParameterSet &conf)
HGCalTriggerNtupleHGCTriggerSums::~HGCalTriggerNtupleHGCTriggerSums ( )
inlineoverride

Definition at line 14 of file HGCalTriggerNtupleHGCTriggerSums.cc.

14 {};

Member Function Documentation

void HGCalTriggerNtupleHGCTriggerSums::clear ( void  )
finalprivatevirtual

Implements HGCalTriggerNtupleBase.

Definition at line 127 of file HGCalTriggerNtupleHGCTriggerSums.cc.

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

Referenced by fill().

127  {
128  ts_n_ = 0;
129  ts_id_.clear();
130  ts_subdet_.clear();
131  ts_side_.clear();
132  ts_layer_.clear();
133  ts_wafer_.clear();
134  ts_wafertype_.clear();
135  ts_data_.clear();
136  ts_mipPt_.clear();
137  ts_pt_.clear();
138  ts_energy_.clear();
139  ts_eta_.clear();
140  ts_phi_.clear();
141  ts_x_.clear();
142  ts_y_.clear();
143  ts_z_.clear();
144 }
void HGCalTriggerNtupleHGCTriggerSums::fill ( const edm::Event e,
const HGCalTriggerNtupleEventSetup es 
)
finalvirtual

Reimplemented from HGCalTriggerNtupleBase.

Definition at line 84 of file HGCalTriggerNtupleHGCTriggerSums.cc.

References BXVector< T >::begin(), clear(), BXVector< T >::end(), HGCalTriggerNtupleEventSetup::geometry, edm::Event::getByToken(), DetId::HGCalHSc, DetId::HGCalTrigger, gpuClustering::id, HGCalTriggerTools::layerWithOffset(), gpuClustering::moduleId, edm::ESHandle< class >::product(), HGCalTriggerTools::setGeometry(), trigger_sums_token_, triggerTools_, ts_data_, ts_energy_, ts_eta_, ts_id_, ts_layer_, ts_mipPt_, ts_n_, ts_phi_, ts_pt_, ts_side_, ts_subdet_, ts_wafertype_, ts_x_, ts_y_, ts_z_, and HGCalTriggerTools::zside().

84  {
85  // retrieve trigger cells
87  e.getByToken(trigger_sums_token_, trigger_sums_h);
88  const l1t::HGCalTriggerSumsBxCollection& trigger_sums = *trigger_sums_h;
89 
91 
92  clear();
93  for (auto ts_itr = trigger_sums.begin(0); ts_itr != trigger_sums.end(0); ts_itr++) {
94  if (ts_itr->pt() > 0) {
95  ts_n_++;
96  // hardware data
97  DetId moduleId(ts_itr->detId());
98  ts_id_.emplace_back(ts_itr->detId());
99  ts_side_.emplace_back(triggerTools_.zside(moduleId));
101  if (moduleId.det() == DetId::HGCalTrigger) {
103  ts_subdet_.emplace_back(id.subdet());
104  ts_wafertype_.emplace_back(id.type());
105  } else if (moduleId.det() == DetId::HGCalHSc) {
107  ts_subdet_.emplace_back(id.subdet());
108  ts_wafertype_.emplace_back(id.type());
109  } else {
110  ts_subdet_.emplace_back(-999);
111  ts_wafertype_.emplace_back(-999);
112  }
113  ts_data_.emplace_back(ts_itr->hwPt());
114  ts_mipPt_.emplace_back(ts_itr->mipPt());
115  // physical values
116  ts_pt_.emplace_back(ts_itr->pt());
117  ts_energy_.emplace_back(ts_itr->energy());
118  ts_eta_.emplace_back(ts_itr->eta());
119  ts_phi_.emplace_back(ts_itr->phi());
120  ts_x_.emplace_back(ts_itr->position().x());
121  ts_y_.emplace_back(ts_itr->position().y());
122  ts_z_.emplace_back(ts_itr->position().z());
123  }
124  }
125 }
const_iterator end(int bx) const
uint16_t *__restrict__ id
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
unsigned layerWithOffset(const DetId &) const
edm::ESHandle< HGCalTriggerGeometryBase > geometry
void setGeometry(const HGCalTriggerGeometryBase *const)
int zside(const DetId &) const
uint16_t *__restrict__ uint16_t const *__restrict__ uint32_t const *__restrict__ uint32_t *__restrict__ uint32_t const *__restrict__ moduleId
Definition: DetId.h:17
T const * product() const
Definition: ESHandle.h:86
const_iterator begin(int bx) const
void HGCalTriggerNtupleHGCTriggerSums::initialize ( TTree &  tree,
const edm::ParameterSet conf,
edm::ConsumesCollector &&  collector 
)
finalvirtual

Implements HGCalTriggerNtupleBase.

Definition at line 52 of file HGCalTriggerNtupleHGCTriggerSums.cc.

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

54  {
57 
58  std::string prefix(conf.getUntrackedParameter<std::string>("Prefix", "ts"));
59 
60  std::string bname;
61  auto withPrefix([&prefix, &bname](char const* vname) -> char const* {
62  bname = prefix + "_" + vname;
63  return bname.c_str();
64  });
65 
66  tree.Branch(withPrefix("n"), &ts_n_, (prefix + "_n/I").c_str());
67  tree.Branch(withPrefix("id"), &ts_id_);
68  tree.Branch(withPrefix("subdet"), &ts_subdet_);
69  tree.Branch(withPrefix("zside"), &ts_side_);
70  tree.Branch(withPrefix("layer"), &ts_layer_);
71  tree.Branch(withPrefix("wafer"), &ts_wafer_);
72  tree.Branch(withPrefix("wafertype"), &ts_wafertype_);
73  tree.Branch(withPrefix("data"), &ts_data_);
74  tree.Branch(withPrefix("pt"), &ts_pt_);
75  tree.Branch(withPrefix("mipPt"), &ts_mipPt_);
76  tree.Branch(withPrefix("energy"), &ts_energy_);
77  tree.Branch(withPrefix("eta"), &ts_eta_);
78  tree.Branch(withPrefix("phi"), &ts_phi_);
79  tree.Branch(withPrefix("x"), &ts_x_);
80  tree.Branch(withPrefix("y"), &ts_y_);
81  tree.Branch(withPrefix("z"), &ts_z_);
82 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getUntrackedParameter(std::string const &, T const &) const
T getParameter(std::string const &) const
Definition: ParameterSet.h:303

Member Data Documentation

edm::EDGetToken HGCalTriggerNtupleHGCTriggerSums::trigger_sums_token_
private

Definition at line 23 of file HGCalTriggerNtupleHGCTriggerSums.cc.

Referenced by fill(), and initialize().

HGCalTriggerTools HGCalTriggerNtupleHGCTriggerSums::triggerTools_
private

Definition at line 21 of file HGCalTriggerNtupleHGCTriggerSums.cc.

Referenced by fill().

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

Definition at line 34 of file HGCalTriggerNtupleHGCTriggerSums.cc.

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

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

Definition at line 37 of file HGCalTriggerNtupleHGCTriggerSums.cc.

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

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

Definition at line 38 of file HGCalTriggerNtupleHGCTriggerSums.cc.

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

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

Definition at line 26 of file HGCalTriggerNtupleHGCTriggerSums.cc.

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

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

Definition at line 29 of file HGCalTriggerNtupleHGCTriggerSums.cc.

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

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

Definition at line 35 of file HGCalTriggerNtupleHGCTriggerSums.cc.

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

int HGCalTriggerNtupleHGCTriggerSums::ts_n_
private

Definition at line 25 of file HGCalTriggerNtupleHGCTriggerSums.cc.

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

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

Definition at line 30 of file HGCalTriggerNtupleHGCTriggerSums.cc.

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

Definition at line 31 of file HGCalTriggerNtupleHGCTriggerSums.cc.

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

Definition at line 39 of file HGCalTriggerNtupleHGCTriggerSums.cc.

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

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

Definition at line 36 of file HGCalTriggerNtupleHGCTriggerSums.cc.

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

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

Definition at line 28 of file HGCalTriggerNtupleHGCTriggerSums.cc.

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

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

Definition at line 27 of file HGCalTriggerNtupleHGCTriggerSums.cc.

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

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

Definition at line 32 of file HGCalTriggerNtupleHGCTriggerSums.cc.

Referenced by clear(), and initialize().

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

Definition at line 33 of file HGCalTriggerNtupleHGCTriggerSums.cc.

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

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

Definition at line 40 of file HGCalTriggerNtupleHGCTriggerSums.cc.

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

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

Definition at line 41 of file HGCalTriggerNtupleHGCTriggerSums.cc.

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

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

Definition at line 42 of file HGCalTriggerNtupleHGCTriggerSums.cc.

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