CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
HGCalMulticlusteringImpl Class Reference

#include <HGCalMulticlusteringImpl.h>

Public Member Functions

void clusterize (const edm::PtrVector< l1t::HGCalCluster > &clustersPtr, l1t::HGCalMulticlusterBxCollection &multiclusters)
 
 HGCalMulticlusteringImpl (const edm::ParameterSet &conf)
 
bool isPertinent (const l1t::HGCalCluster &clu, const l1t::HGCalMulticluster &mclu, double dR) const
 

Private Attributes

double calibSF_
 
double dr_
 
double ptC3dThreshold_
 

Detailed Description

Definition at line 9 of file HGCalMulticlusteringImpl.h.

Constructor & Destructor Documentation

HGCalMulticlusteringImpl::HGCalMulticlusteringImpl ( const edm::ParameterSet conf)

Definition at line 5 of file HGCalMulticlusteringImpl.cc.

References calibSF_, dr_, and ptC3dThreshold_.

5  :
6  dr_(conf.getParameter<double>("dR_multicluster")),
7  ptC3dThreshold_(conf.getParameter<double>("minPt_multicluster")),
8  calibSF_(conf.getParameter<double>("calibSF_multicluster"))
9 {
10  edm::LogInfo("HGCalMulticlusterParameters") << "Multicluster dR for Near Neighbour search: " << dr_;
11  edm::LogInfo("HGCalMulticlusterParameters") << "Multicluster minimum transverse-momentum: " << ptC3dThreshold_;
12  edm::LogInfo("HGCalMulticlusterParameters") << "Multicluster global calibration factor: " << calibSF_;
13 
14 }
T getParameter(std::string const &) const

Member Function Documentation

void HGCalMulticlusteringImpl::clusterize ( const edm::PtrVector< l1t::HGCalCluster > &  clustersPtr,
l1t::HGCalMulticlusterBxCollection multiclusters 
)

Definition at line 35 of file HGCalMulticlusteringImpl.cc.

References edm::PtrVector< T >::begin(), calibSF_, edmIntegrityCheck::d, dr_, edm::PtrVector< T >::end(), mps_fire::i, isPertinent(), mag(), ptC3dThreshold_, and BXVector< T >::push_back().

37 {
38 
39  std::vector<l1t::HGCalMulticluster> multiclustersTmp;
40 
41  int iclu = 0;
42  for(edm::PtrVector<l1t::HGCalCluster>::const_iterator clu = clustersPtrs.begin(); clu != clustersPtrs.end(); ++clu, ++iclu){
43 
44  int imclu=0;
45  vector<int> tcPertinentMulticlusters;
46  for( const auto& mclu : multiclustersTmp ){
47  if( this->isPertinent(**clu, mclu, dr_) ){
48  tcPertinentMulticlusters.push_back(imclu);
49  }
50  ++imclu;
51  }
52  if( tcPertinentMulticlusters.empty() ){
53  multiclustersTmp.emplace_back( *clu );
54  }
55  else{
56  unsigned minDist = 1;
57  unsigned targetMulticlu = 0;
58  for( int imclu : tcPertinentMulticlusters ){
59  double d = ( multiclustersTmp.at(imclu).centreProj() - (*clu)->centreProj() ).mag() ;
60  if( d < minDist ){
61  minDist = d;
62  targetMulticlu = imclu;
63  }
64  }
65 
66  multiclustersTmp.at( targetMulticlu ).addConstituent( *clu );
67 
68  }
69  }
70 
71  /* making the collection of multiclusters */
72  for( unsigned i(0); i<multiclustersTmp.size(); ++i ){
73  math::PtEtaPhiMLorentzVector calibP4( multiclustersTmp.at(i).pt() * calibSF_,
74  multiclustersTmp.at(i).eta(),
75  multiclustersTmp.at(i).phi(),
76  0. );
77  // overwriting the 4p with the calibrated 4p
78  multiclustersTmp.at(i).setP4( calibP4 );
79  if( multiclustersTmp.at(i).pt() > ptC3dThreshold_ ){
80  multiclusters.push_back( 0, multiclustersTmp.at(i));
81  }
82  }
83 
84 }
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
PtEtaPhiMLorentzVectorD PtEtaPhiMLorentzVector
Lorentz vector with cartesian internal representation.
Definition: LorentzVector.h:25
bool isPertinent(const l1t::HGCalCluster &clu, const l1t::HGCalMulticluster &mclu, double dR) const
void push_back(int bx, T object)
bool HGCalMulticlusteringImpl::isPertinent ( const l1t::HGCalCluster clu,
const l1t::HGCalMulticluster mclu,
double  dR 
) const

Definition at line 17 of file HGCalMulticlusteringImpl.cc.

References l1t::HGCalClusterT< C >::centreProj(), l1t::HGCalClusterT< C >::detId(), PFRecoTauDiscriminationAgainstElectronDeadECAL_cfi::dR, and mag().

Referenced by clusterize().

20 {
21  HGCalDetId cluDetId( clu.detId() );
22  HGCalDetId firstClusterDetId( mclu.detId() );
23 
24  if( cluDetId.zside() != firstClusterDetId.zside() ){
25  return false;
26  }
27  if( ( mclu.centreProj() - clu.centreProj() ).mag() < dR ){
28  return true;
29  }
30  return false;
31 
32 }
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
const GlobalPoint & centreProj() const
uint32_t detId() const
Definition: HGCalClusterT.h:96

Member Data Documentation

double HGCalMulticlusteringImpl::calibSF_
private

Definition at line 26 of file HGCalMulticlusteringImpl.h.

Referenced by clusterize(), and HGCalMulticlusteringImpl().

double HGCalMulticlusteringImpl::dr_
private

Definition at line 24 of file HGCalMulticlusteringImpl.h.

Referenced by clusterize(), and HGCalMulticlusteringImpl().

double HGCalMulticlusteringImpl::ptC3dThreshold_
private

Definition at line 25 of file HGCalMulticlusteringImpl.h.

Referenced by clusterize(), and HGCalMulticlusteringImpl().