CMS 3D CMS Logo

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

Public Member Functions

void fill (const edm::Event &e, const edm::EventSetup &es) final
 
 HGCalTriggerNtupleHGCPanels (const edm::ParameterSet &conf)
 
void initialize (TTree &, const edm::ParameterSet &, edm::ConsumesCollector &&) final
 
 ~HGCalTriggerNtupleHGCPanels () 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_
 
std::vector< uint32_t > panel_id_
 
std::vector< int > panel_layer_
 
int panel_n_
 
std::vector< int > panel_number_
 
std::vector< int > panel_sector_
 
std::vector< std::vector< uint32_t > > panel_tc_cell_
 
std::vector< std::vector< uint32_t > > panel_tc_id_
 
std::vector< std::vector< float > > panel_tc_mipPt_
 
std::vector< std::vector< uint32_t > > panel_tc_mod_
 
std::vector< unsigned > panel_tc_n_
 
std::vector< std::vector< float > > panel_tc_pt_
 
std::vector< std::vector< uint32_t > > panel_tc_third_
 
std::vector< int > panel_zside_
 
edm::EDGetToken trigger_cells_token_
 

Static Private Attributes

static const unsigned kCell_mask_ = 0xF
 
static const unsigned kPanel_mask_ = 0x1F
 
static const unsigned kPanel_offset_ = 0
 
static const unsigned kSector_mask_ = 0x7
 
static const unsigned kSector_offset_ = 5
 
static const unsigned kThird_mask_ = 0x3
 
static const unsigned kThird_offset_ = 4
 

Additional Inherited Members

Detailed Description

Definition at line 8 of file HGCalTriggerNtupleHGCPanels.cc.

Constructor & Destructor Documentation

HGCalTriggerNtupleHGCPanels::HGCalTriggerNtupleHGCPanels ( const edm::ParameterSet conf)

Definition at line 47 of file HGCalTriggerNtupleHGCPanels.cc.

48  : HGCalTriggerNtupleBase(conf) {}
HGCalTriggerNtupleBase(const edm::ParameterSet &conf)
HGCalTriggerNtupleHGCPanels::~HGCalTriggerNtupleHGCPanels ( )
inlineoverride

Definition at line 11 of file HGCalTriggerNtupleHGCPanels.cc.

References clear(), MillePedeFileConverter_cfg::e, fill(), and initialize().

11 {};

Member Function Documentation

void HGCalTriggerNtupleHGCPanels::clear ( void  )
finalprivatevirtual

Implements HGCalTriggerNtupleBase.

Definition at line 125 of file HGCalTriggerNtupleHGCPanels.cc.

References panel_id_, panel_layer_, panel_n_, panel_number_, panel_sector_, panel_tc_cell_, panel_tc_id_, panel_tc_mipPt_, panel_tc_mod_, panel_tc_n_, panel_tc_pt_, panel_tc_third_, and panel_zside_.

Referenced by fill(), and ~HGCalTriggerNtupleHGCPanels().

125  {
126  panel_n_ = 0;
127  panel_id_.clear();
128  panel_zside_.clear();
129  panel_layer_.clear();
130  panel_sector_.clear();
131  panel_number_.clear();
132  panel_tc_n_.clear();
133  panel_tc_id_.clear();
134  panel_tc_mod_.clear();
135  panel_tc_third_.clear();
136  panel_tc_cell_.clear();
137  panel_tc_mipPt_.clear();
138  panel_tc_pt_.clear();
139 }
std::vector< std::vector< uint32_t > > panel_tc_mod_
std::vector< std::vector< float > > panel_tc_pt_
std::vector< std::vector< uint32_t > > panel_tc_cell_
std::vector< std::vector< float > > panel_tc_mipPt_
std::vector< std::vector< uint32_t > > panel_tc_id_
std::vector< std::vector< uint32_t > > panel_tc_third_
void HGCalTriggerNtupleHGCPanels::fill ( const edm::Event e,
const edm::EventSetup es 
)
finalvirtual

Implements HGCalTriggerNtupleBase.

Definition at line 71 of file HGCalTriggerNtupleHGCPanels.cc.

References BXVector< T >::begin(), clear(), BXVector< T >::end(), geometry_, edm::EventSetup::get(), edm::Event::getByToken(), HGCalTriggerGeometryBase::getModuleFromTriggerCell(), HGCHEB, triggerObjects_cff::id, kCell_mask_, kPanel_mask_, kPanel_offset_, kSector_mask_, kSector_offset_, kThird_mask_, kThird_offset_, panel_id_, panel_layer_, panel_n_, panel_number_, panel_sector_, panel_tc_cell_, panel_tc_id_, panel_tc_mipPt_, panel_tc_mod_, panel_tc_n_, panel_tc_pt_, panel_tc_third_, panel_zside_, trigger_cells_token_, HGCalTriggerGeometryBase::triggerLayer(), HGCalDetId::wafer(), and HGCalDetId::zside().

Referenced by ~HGCalTriggerNtupleHGCPanels().

71  {
72  // retrieve trigger cells
74  e.getByToken(trigger_cells_token_, trigger_cells_h);
75  const l1t::HGCalTriggerCellBxCollection& trigger_cells = *trigger_cells_h;
76 
77  // retrieve geometry
78  es.get<CaloGeometryRecord>().get(geometry_);
79 
80  clear();
81 
82  // Regroup trigger cells by panel
83  std::unordered_map<uint32_t, vector<l1t::HGCalTriggerCellBxCollection::const_iterator> > panelids_tcs;
84  for (auto tc_itr = trigger_cells.begin(0); tc_itr != trigger_cells.end(0); tc_itr++) {
85  if (tc_itr->hwPt() > 0 && tc_itr->subdetId() != ForwardSubdetector::HGCHEB) {
86  HGCalDetId id(tc_itr->detId());
88  panelids_tcs[panelid].push_back(tc_itr);
89  }
90  }
91  for (const auto& panelid_tcs : panelids_tcs) {
92  panel_n_++;
93  HGCalDetId panelid(panelid_tcs.first);
94  int panel_sector = (panelid.wafer() >> kSector_offset_) & kSector_mask_;
95  int panel_number = (panelid.wafer() >> kPanel_offset_) & kPanel_mask_;
96  const auto& tcs = panelid_tcs.second;
97  panel_id_.emplace_back(panelid);
98  panel_zside_.emplace_back(panelid.zside());
99  panel_layer_.emplace_back(geometry_->triggerLayer(panelid));
100  panel_sector_.emplace_back(panel_sector);
101  panel_number_.emplace_back(panel_number);
102  panel_tc_n_.emplace_back(tcs.size());
103  panel_tc_id_.emplace_back();
104  panel_tc_mod_.emplace_back();
105  panel_tc_third_.emplace_back();
106  panel_tc_cell_.emplace_back();
107  panel_tc_mipPt_.emplace_back();
108  panel_tc_pt_.emplace_back();
109 
110  for (const auto& tc : tcs) {
111  panel_tc_id_.back().push_back(tc->detId());
112  panel_tc_mipPt_.back().push_back(tc->mipPt());
113  panel_tc_pt_.back().push_back(tc->pt());
114  HGCalDetId tc_detid(tc->detId());
115  unsigned module_id = tc_detid.wafer();
116  unsigned third_id = (tc_detid.cell() >> kThird_offset_) & kThird_mask_;
117  unsigned cell_id = tc_detid.cell() & kCell_mask_;
118  panel_tc_mod_.back().push_back(module_id);
119  panel_tc_third_.back().push_back(third_id);
120  panel_tc_cell_.back().push_back(cell_id);
121  }
122  }
123 }
const_iterator end(int bx) const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
std::vector< std::vector< uint32_t > > panel_tc_mod_
std::vector< std::vector< float > > panel_tc_pt_
edm::ESHandle< HGCalTriggerGeometryBase > geometry_
std::vector< std::vector< uint32_t > > panel_tc_cell_
std::vector< std::vector< float > > panel_tc_mipPt_
virtual unsigned triggerLayer(const unsigned id) const =0
int wafer() const
get the wafer #
Definition: HGCalDetId.h:42
virtual unsigned getModuleFromTriggerCell(const unsigned trigger_cell_det_id) const =0
T get() const
Definition: EventSetup.h:71
std::vector< std::vector< uint32_t > > panel_tc_id_
const_iterator begin(int bx) const
std::vector< std::vector< uint32_t > > panel_tc_third_
void HGCalTriggerNtupleHGCPanels::initialize ( TTree &  tree,
const edm::ParameterSet conf,
edm::ConsumesCollector &&  collector 
)
finalvirtual

Implements HGCalTriggerNtupleBase.

Definition at line 50 of file HGCalTriggerNtupleHGCPanels.cc.

References edm::ParameterSet::getParameter(), panel_id_, panel_layer_, panel_n_, panel_number_, panel_sector_, panel_tc_cell_, panel_tc_id_, panel_tc_mipPt_, panel_tc_mod_, panel_tc_n_, panel_tc_pt_, panel_tc_third_, panel_zside_, and trigger_cells_token_.

Referenced by ~HGCalTriggerNtupleHGCPanels().

52  {
54  collector.consumes<l1t::HGCalTriggerCellBxCollection>(conf.getParameter<edm::InputTag>("TriggerCells"));
55 
56  tree.Branch("panel_n", &panel_n_, "panel_n/I");
57  tree.Branch("panel_id", &panel_id_);
58  tree.Branch("panel_zside", &panel_zside_);
59  tree.Branch("panel_layer", &panel_layer_);
60  tree.Branch("panel_sector", &panel_sector_);
61  tree.Branch("panel_number", &panel_number_);
62  tree.Branch("panel_tc_n", &panel_tc_n_);
63  tree.Branch("panel_tc_id", &panel_tc_id_);
64  tree.Branch("panel_tc_mod", &panel_tc_mod_);
65  tree.Branch("panel_tc_third", &panel_tc_third_);
66  tree.Branch("panel_tc_cell", &panel_tc_cell_);
67  tree.Branch("panel_tc_mipPt", &panel_tc_mipPt_);
68  tree.Branch("panel_tc_pt", &panel_tc_pt_);
69 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
std::vector< std::vector< uint32_t > > panel_tc_mod_
std::vector< std::vector< float > > panel_tc_pt_
std::vector< std::vector< uint32_t > > panel_tc_cell_
std::vector< std::vector< float > > panel_tc_mipPt_
Definition: tree.py:1
std::vector< std::vector< uint32_t > > panel_tc_id_
std::vector< std::vector< uint32_t > > panel_tc_third_

Member Data Documentation

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

Definition at line 19 of file HGCalTriggerNtupleHGCPanels.cc.

Referenced by fill().

const unsigned HGCalTriggerNtupleHGCPanels::kCell_mask_ = 0xF
staticprivate

Definition at line 42 of file HGCalTriggerNtupleHGCPanels.cc.

Referenced by fill().

const unsigned HGCalTriggerNtupleHGCPanels::kPanel_mask_ = 0x1F
staticprivate

Definition at line 37 of file HGCalTriggerNtupleHGCPanels.cc.

Referenced by fill().

const unsigned HGCalTriggerNtupleHGCPanels::kPanel_offset_ = 0
staticprivate

Definition at line 36 of file HGCalTriggerNtupleHGCPanels.cc.

Referenced by fill().

const unsigned HGCalTriggerNtupleHGCPanels::kSector_mask_ = 0x7
staticprivate

Definition at line 39 of file HGCalTriggerNtupleHGCPanels.cc.

Referenced by fill().

const unsigned HGCalTriggerNtupleHGCPanels::kSector_offset_ = 5
staticprivate

Definition at line 38 of file HGCalTriggerNtupleHGCPanels.cc.

Referenced by fill().

const unsigned HGCalTriggerNtupleHGCPanels::kThird_mask_ = 0x3
staticprivate

Definition at line 41 of file HGCalTriggerNtupleHGCPanels.cc.

Referenced by fill().

const unsigned HGCalTriggerNtupleHGCPanels::kThird_offset_ = 4
staticprivate

Definition at line 40 of file HGCalTriggerNtupleHGCPanels.cc.

Referenced by fill().

std::vector<uint32_t> HGCalTriggerNtupleHGCPanels::panel_id_
private

Definition at line 22 of file HGCalTriggerNtupleHGCPanels.cc.

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

std::vector<int> HGCalTriggerNtupleHGCPanels::panel_layer_
private

Definition at line 24 of file HGCalTriggerNtupleHGCPanels.cc.

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

int HGCalTriggerNtupleHGCPanels::panel_n_
private

Definition at line 21 of file HGCalTriggerNtupleHGCPanels.cc.

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

std::vector<int> HGCalTriggerNtupleHGCPanels::panel_number_
private

Definition at line 26 of file HGCalTriggerNtupleHGCPanels.cc.

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

std::vector<int> HGCalTriggerNtupleHGCPanels::panel_sector_
private

Definition at line 25 of file HGCalTriggerNtupleHGCPanels.cc.

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

std::vector<std::vector<uint32_t> > HGCalTriggerNtupleHGCPanels::panel_tc_cell_
private

Definition at line 31 of file HGCalTriggerNtupleHGCPanels.cc.

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

std::vector<std::vector<uint32_t> > HGCalTriggerNtupleHGCPanels::panel_tc_id_
private

Definition at line 28 of file HGCalTriggerNtupleHGCPanels.cc.

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

std::vector<std::vector<float> > HGCalTriggerNtupleHGCPanels::panel_tc_mipPt_
private

Definition at line 32 of file HGCalTriggerNtupleHGCPanels.cc.

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

std::vector<std::vector<uint32_t> > HGCalTriggerNtupleHGCPanels::panel_tc_mod_
private

Definition at line 29 of file HGCalTriggerNtupleHGCPanels.cc.

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

std::vector<unsigned> HGCalTriggerNtupleHGCPanels::panel_tc_n_
private

Definition at line 27 of file HGCalTriggerNtupleHGCPanels.cc.

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

std::vector<std::vector<float> > HGCalTriggerNtupleHGCPanels::panel_tc_pt_
private

Definition at line 33 of file HGCalTriggerNtupleHGCPanels.cc.

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

std::vector<std::vector<uint32_t> > HGCalTriggerNtupleHGCPanels::panel_tc_third_
private

Definition at line 30 of file HGCalTriggerNtupleHGCPanels.cc.

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

std::vector<int> HGCalTriggerNtupleHGCPanels::panel_zside_
private

Definition at line 23 of file HGCalTriggerNtupleHGCPanels.cc.

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

edm::EDGetToken HGCalTriggerNtupleHGCPanels::trigger_cells_token_
private

Definition at line 18 of file HGCalTriggerNtupleHGCPanels.cc.

Referenced by fill(), and initialize().