CMS 3D CMS Logo

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

Public Member Functions

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

Private Member Functions

void clear () final
 

Private Attributes

std::vector< std::vector< unsigned > > cl_cells_
 
std::vector< float > cl_energy_
 
std::vector< float > cl_eta_
 
std::vector< int > cl_layer_
 
int cl_n_
 
std::vector< int > cl_ncells_
 
std::vector< float > cl_phi_
 
std::vector< float > cl_pt_
 
edm::EDGetToken clusters_token_
 

Additional Inherited Members

Detailed Description

Definition at line 11 of file HGCalTriggerNtupleHGCClusters.cc.

Constructor & Destructor Documentation

HGCalTriggerNtupleHGCClusters::HGCalTriggerNtupleHGCClusters ( const edm::ParameterSet conf)

Definition at line 43 of file HGCalTriggerNtupleHGCClusters.cc.

References initialize().

44 {
45 }
HGCalTriggerNtupleBase(const edm::ParameterSet &conf)
HGCalTriggerNtupleHGCClusters::~HGCalTriggerNtupleHGCClusters ( )
inlineoverride

Definition at line 16 of file HGCalTriggerNtupleHGCClusters.cc.

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

16 {};

Member Function Documentation

void HGCalTriggerNtupleHGCClusters::clear ( void  )
finalprivatevirtual

Implements HGCalTriggerNtupleBase.

Definition at line 99 of file HGCalTriggerNtupleHGCClusters.cc.

References cl_cells_, cl_energy_, cl_eta_, cl_layer_, cl_n_, cl_ncells_, cl_phi_, and cl_pt_.

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

100 {
101  cl_n_ = 0;
102  cl_pt_.clear();
103  cl_energy_.clear();
104  cl_eta_.clear();
105  cl_phi_.clear();
106  cl_layer_.clear();
107  cl_ncells_.clear();
108  cl_cells_.clear();
109 }
std::vector< std::vector< unsigned > > cl_cells_
void HGCalTriggerNtupleHGCClusters::fill ( const edm::Event e,
const edm::EventSetup es 
)
finalvirtual

Implements HGCalTriggerNtupleBase.

Definition at line 65 of file HGCalTriggerNtupleHGCClusters.cc.

References BXVector< T >::begin(), cl_cells_, cl_energy_, cl_eta_, cl_layer_, cl_n_, cl_ncells_, cl_phi_, cl_pt_, clear(), fastPrimaryVertexProducer_cfi::clusters, clusters_token_, BXVector< T >::end(), geometry, edm::EventSetup::get(), edm::Event::getByToken(), and create_public_lumi_plots::transform.

Referenced by initialize(), and ~HGCalTriggerNtupleHGCClusters().

66 {
67 
68  // retrieve clusters
70  e.getByToken(clusters_token_, clusters_h);
71  const l1t::HGCalClusterBxCollection& clusters = *clusters_h;
72 
73  // retrieve geometry
75  es.get<CaloGeometryRecord>().get(geometry);
76 
77  clear();
78  for(auto cl_itr=clusters.begin(0); cl_itr!=clusters.end(0); cl_itr++)
79  {
80  cl_n_++;
81  // physical values
82  cl_pt_.emplace_back(cl_itr->pt());
83  cl_energy_.emplace_back(cl_itr->energy());
84  cl_eta_.emplace_back(cl_itr->eta());
85  cl_phi_.emplace_back(cl_itr->phi());
86  cl_layer_.emplace_back(cl_itr->layer());
87  cl_ncells_.emplace_back(cl_itr->constituents().size());
88  // Retrieve indices of trigger cells inside cluster
89  cl_cells_.emplace_back(cl_itr->constituents().size());
90  std::transform(cl_itr->constituents_begin(), cl_itr->constituents_end(),
91  cl_cells_.back().begin(), [](const edm::Ptr<l1t::HGCalTriggerCell>& tc){return tc.key();}
92  );
93  }
94 }
const_iterator end(int bx) const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:519
std::vector< std::vector< unsigned > > cl_cells_
const T & get() const
Definition: EventSetup.h:58
ESHandle< TrackerGeometry > geometry
const_iterator begin(int bx) const
void HGCalTriggerNtupleHGCClusters::initialize ( TTree &  tree,
const edm::ParameterSet conf,
edm::ConsumesCollector &&  collector 
)
finalvirtual

Implements HGCalTriggerNtupleBase.

Definition at line 49 of file HGCalTriggerNtupleHGCClusters.cc.

References cl_cells_, cl_energy_, cl_eta_, cl_layer_, cl_n_, cl_ncells_, cl_phi_, cl_pt_, clusters_token_, fill(), and edm::ParameterSet::getParameter().

Referenced by HGCalTriggerNtupleHGCClusters(), and ~HGCalTriggerNtupleHGCClusters().

50 {
52 
53  tree.Branch("cl_n", &cl_n_, "cl_n/I");
54  tree.Branch("cl_pt", &cl_pt_);
55  tree.Branch("cl_energy", &cl_energy_);
56  tree.Branch("cl_eta", &cl_eta_);
57  tree.Branch("cl_phi", &cl_phi_);
58  tree.Branch("cl_layer", &cl_layer_);
59  tree.Branch("cl_ncells", &cl_ncells_);
60  tree.Branch("cl_cells", &cl_cells_);
61 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
std::vector< std::vector< unsigned > > cl_cells_
Definition: tree.py:1

Member Data Documentation

std::vector<std::vector<unsigned> > HGCalTriggerNtupleHGCClusters::cl_cells_
private

Definition at line 33 of file HGCalTriggerNtupleHGCClusters.cc.

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

std::vector<float> HGCalTriggerNtupleHGCClusters::cl_energy_
private

Definition at line 28 of file HGCalTriggerNtupleHGCClusters.cc.

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

std::vector<float> HGCalTriggerNtupleHGCClusters::cl_eta_
private

Definition at line 29 of file HGCalTriggerNtupleHGCClusters.cc.

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

std::vector<int> HGCalTriggerNtupleHGCClusters::cl_layer_
private

Definition at line 31 of file HGCalTriggerNtupleHGCClusters.cc.

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

int HGCalTriggerNtupleHGCClusters::cl_n_
private

Definition at line 26 of file HGCalTriggerNtupleHGCClusters.cc.

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

std::vector<int> HGCalTriggerNtupleHGCClusters::cl_ncells_
private

Definition at line 32 of file HGCalTriggerNtupleHGCClusters.cc.

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

std::vector<float> HGCalTriggerNtupleHGCClusters::cl_phi_
private

Definition at line 30 of file HGCalTriggerNtupleHGCClusters.cc.

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

std::vector<float> HGCalTriggerNtupleHGCClusters::cl_pt_
private

Definition at line 27 of file HGCalTriggerNtupleHGCClusters.cc.

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

edm::EDGetToken HGCalTriggerNtupleHGCClusters::clusters_token_
private

Definition at line 24 of file HGCalTriggerNtupleHGCClusters.cc.

Referenced by fill(), and initialize().