CMS 3D CMS Logo

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

#include <BremRecoveryClusterAlgo.h>

Public Types

enum  VerbosityLevel { pDEBUG = 0, pWARNING = 1, pINFO = 2, pERROR = 3 }
 

Public Member Functions

 BremRecoveryClusterAlgo (double eb_sc_road_etasize=0.06, double eb_sc_road_phisize=0.80, double ec_sc_road_etasize=0.14, double ec_sc_road_phisize=0.40, double theSeedTransverseEnergyThreshold=0.40, VerbosityLevel the_verbosity=pERROR)
 
reco::SuperClusterCollection makeSuperClusters (reco::CaloClusterPtrVector &clusters)
 
void setVerbosity (VerbosityLevel the_verbosity)
 

Private Member Functions

void makeIslandSuperClusters (reco::CaloClusterPtrVector &clusters_v, double etaRoad, double phiRoad)
 
bool match (reco::CaloClusterPtr seed_p, reco::CaloClusterPtr cluster_p, double etaRoad, double phiRoad)
 

Private Attributes

double eb_rdeta_
 
double eb_rdphi_
 
double ec_rdeta_
 
double ec_rdphi_
 
double seedTransverseEnergyThreshold
 
reco::SuperClusterCollection superclusters_v
 
VerbosityLevel verbosity
 

Detailed Description

Definition at line 21 of file BremRecoveryClusterAlgo.h.

Member Enumeration Documentation

◆ VerbosityLevel

Enumerator
pDEBUG 
pWARNING 
pINFO 
pERROR 

Definition at line 23 of file BremRecoveryClusterAlgo.h.

23 { pDEBUG = 0, pWARNING = 1, pINFO = 2, pERROR = 3 };

Constructor & Destructor Documentation

◆ BremRecoveryClusterAlgo()

BremRecoveryClusterAlgo::BremRecoveryClusterAlgo ( double  eb_sc_road_etasize = 0.06,
double  eb_sc_road_phisize = 0.80,
double  ec_sc_road_etasize = 0.14,
double  ec_sc_road_phisize = 0.40,
double  theSeedTransverseEnergyThreshold = 0.40,
VerbosityLevel  the_verbosity = pERROR 
)
inline

Definition at line 25 of file BremRecoveryClusterAlgo.h.

30  {
31  // e*_rdeta_ and e*_rdphi_ are half the total window
32  // because they correspond to one direction (positive or negative)
33  eb_rdeta_ = eb_sc_road_etasize / 2;
34  eb_rdphi_ = eb_sc_road_phisize / 2;
35  ec_rdeta_ = ec_sc_road_etasize / 2;
36  ec_rdphi_ = ec_sc_road_phisize / 2;
37 
38  seedTransverseEnergyThreshold = theSeedTransverseEnergyThreshold;
39  verbosity = the_verbosity;
40  }

References eb_rdeta_, eb_rdphi_, ec_rdeta_, ec_rdphi_, seedTransverseEnergyThreshold, and verbosity.

Member Function Documentation

◆ makeIslandSuperClusters()

void BremRecoveryClusterAlgo::makeIslandSuperClusters ( reco::CaloClusterPtrVector clusters_v,
double  etaRoad,
double  phiRoad 
)
private

Definition at line 36 of file BremRecoveryClusterAlgo.cc.

38  {
39  for (reco::CaloCluster_iterator currentSeed = clusters_v.begin(); currentSeed != clusters_v.end(); ++currentSeed) {
40  // Does our highest energy cluster have high enough energy?
41  if ((*currentSeed)->energy() * sin((*currentSeed)->position().theta()) < seedTransverseEnergyThreshold)
42  break;
43 
44  // if yes, make it a seed for a new SuperCluster:
45  double energy_ = (*currentSeed)->energy();
46  math::XYZVector position_(
47  (*currentSeed)->position().X(), (*currentSeed)->position().Y(), (*currentSeed)->position().Z());
48  position_ *= energy_;
49 
50  if (verbosity <= pINFO) {
51  std::cout << "*****************************" << std::endl;
52  std::cout << "******NEW SUPERCLUSTER*******" << std::endl;
53  std::cout << "Seed R = " << (*currentSeed)->position().Rho() << std::endl;
54  }
55 
56  // and add the matching clusters:
57  reco::CaloClusterPtrVector constituentClusters;
58  constituentClusters.push_back(*currentSeed);
59  reco::CaloCluster_iterator currentCluster = currentSeed + 1;
60  while (currentCluster != clusters_v.end()) {
61  if (match(*currentSeed, *currentCluster, etaRoad, phiRoad)) {
62  constituentClusters.push_back(*currentCluster);
63  energy_ += (*currentCluster)->energy();
64  position_ += (*currentCluster)->energy() * math::XYZVector((*currentCluster)->position().X(),
65  (*currentCluster)->position().Y(),
66  (*currentCluster)->position().Z());
67  if (verbosity <= pINFO) {
68  std::cout << "Cluster R = " << (*currentCluster)->position().Rho() << std::endl;
69  }
70  }
71  ++currentCluster;
72  }
73 
74  position_ /= energy_;
75 
76  if (verbosity <= pINFO) {
77  std::cout << "Final SuperCluster R = " << position_.Rho() << std::endl;
78  }
79 
80  reco::SuperCluster newSuperCluster(
81  energy_, math::XYZPoint(position_.X(), position_.Y(), position_.Z()), (*currentSeed), constituentClusters);
82 
83  superclusters_v.push_back(newSuperCluster);
84 
85  if (verbosity <= pINFO) {
86  std::cout << "created a new supercluster of: " << std::endl;
87  std::cout << "Energy = " << newSuperCluster.energy() << std::endl;
88  std::cout << "Position in (R, phi, theta) = (" << newSuperCluster.position().Rho() << ", "
89  << newSuperCluster.position().phi() << ", " << newSuperCluster.position().theta() << ")" << std::endl;
90  }
91  }
92  clusters_v.clear();
93 }

References edm::PtrVector< T >::begin(), edm::PtrVectorBase::clear(), gather_cfg::cout, edm::PtrVector< T >::end(), match(), pINFO, edm::PtrVector< T >::push_back(), seedTransverseEnergyThreshold, funct::sin(), superclusters_v, and verbosity.

Referenced by makeSuperClusters().

◆ makeSuperClusters()

reco::SuperClusterCollection BremRecoveryClusterAlgo::makeSuperClusters ( reco::CaloClusterPtrVector clusters)

Definition at line 5 of file BremRecoveryClusterAlgo.cc.

5  {
6  const float etaBorder = 1.479;
7 
8  superclusters_v.clear();
9 
10  // create vectors of references to clusters of a specific origin...
11  reco::CaloClusterPtrVector islandClustersBarrel_v;
12  reco::CaloClusterPtrVector islandClustersEndCap_v;
13 
14  // ...and populate them:
15  for (reco::CaloCluster_iterator it = clustersCollection.begin(); it != clustersCollection.end(); it++) {
16  reco::CaloClusterPtr cluster_p = *it;
17  if (cluster_p->algo() == reco::CaloCluster::island) {
18  if (fabs(cluster_p->position().eta()) < etaBorder) {
19  islandClustersBarrel_v.push_back(cluster_p);
20  } else {
21  islandClustersEndCap_v.push_back(cluster_p);
22  }
23  }
24  }
25 
26  // make the superclusters from the Barrel clusters - Island
27  makeIslandSuperClusters(islandClustersBarrel_v, eb_rdeta_, eb_rdphi_);
28  // make the superclusters from the EndCap clusters - Island
29  makeIslandSuperClusters(islandClustersEndCap_v, ec_rdeta_, ec_rdphi_);
30 
31  return superclusters_v;
32 }

References edm::PtrVector< T >::begin(), eb_rdeta_, eb_rdphi_, ec_rdeta_, ec_rdphi_, edm::PtrVector< T >::end(), reco::CaloCluster::island, makeIslandSuperClusters(), edm::PtrVector< T >::push_back(), and superclusters_v.

◆ match()

bool BremRecoveryClusterAlgo::match ( reco::CaloClusterPtr  seed_p,
reco::CaloClusterPtr  cluster_p,
double  etaRoad,
double  phiRoad 
)
private

Definition at line 95 of file BremRecoveryClusterAlgo.cc.

98  {
99  math::XYZPoint clusterPosition = cluster_p->position();
100  math::XYZPoint seedPosition = seed_p->position();
101 
102  double dPhi = acos(cos(seedPosition.phi() - clusterPosition.phi()));
103 
104  double dEta = fabs(seedPosition.eta() - clusterPosition.eta());
105 
106  if (dEta > dEtaMax)
107  return false;
108  if (dPhi > dPhiMax)
109  return false;
110 
111  return true;
112 }

References funct::cos(), HLT_2018_cff::dEta, photonValidator_cfi::dEtaMax, HLT_2018_cff::dPhi, and cscSegments_cfi::dPhiMax.

Referenced by makeIslandSuperClusters().

◆ setVerbosity()

void BremRecoveryClusterAlgo::setVerbosity ( VerbosityLevel  the_verbosity)
inline

Definition at line 42 of file BremRecoveryClusterAlgo.h.

42 { verbosity = the_verbosity; }

References verbosity.

Member Data Documentation

◆ eb_rdeta_

double BremRecoveryClusterAlgo::eb_rdeta_
private

Definition at line 58 of file BremRecoveryClusterAlgo.h.

Referenced by BremRecoveryClusterAlgo(), and makeSuperClusters().

◆ eb_rdphi_

double BremRecoveryClusterAlgo::eb_rdphi_
private

Definition at line 59 of file BremRecoveryClusterAlgo.h.

Referenced by BremRecoveryClusterAlgo(), and makeSuperClusters().

◆ ec_rdeta_

double BremRecoveryClusterAlgo::ec_rdeta_
private

Definition at line 60 of file BremRecoveryClusterAlgo.h.

Referenced by BremRecoveryClusterAlgo(), and makeSuperClusters().

◆ ec_rdphi_

double BremRecoveryClusterAlgo::ec_rdphi_
private

Definition at line 61 of file BremRecoveryClusterAlgo.h.

Referenced by BremRecoveryClusterAlgo(), and makeSuperClusters().

◆ seedTransverseEnergyThreshold

double BremRecoveryClusterAlgo::seedTransverseEnergyThreshold
private

Definition at line 63 of file BremRecoveryClusterAlgo.h.

Referenced by BremRecoveryClusterAlgo(), and makeIslandSuperClusters().

◆ superclusters_v

reco::SuperClusterCollection BremRecoveryClusterAlgo::superclusters_v
private

Definition at line 65 of file BremRecoveryClusterAlgo.h.

Referenced by makeIslandSuperClusters(), and makeSuperClusters().

◆ verbosity

VerbosityLevel BremRecoveryClusterAlgo::verbosity
private
BremRecoveryClusterAlgo::pINFO
Definition: BremRecoveryClusterAlgo.h:23
BremRecoveryClusterAlgo::superclusters_v
reco::SuperClusterCollection superclusters_v
Definition: BremRecoveryClusterAlgo.h:65
photonValidator_cfi.dEtaMax
dEtaMax
Definition: photonValidator_cfi.py:76
reco::SuperCluster
Definition: SuperCluster.h:18
BremRecoveryClusterAlgo::ec_rdphi_
double ec_rdphi_
Definition: BremRecoveryClusterAlgo.h:61
BremRecoveryClusterAlgo::verbosity
VerbosityLevel verbosity
Definition: BremRecoveryClusterAlgo.h:56
gather_cfg.cout
cout
Definition: gather_cfg.py:144
edm::PtrVector::begin
const_iterator begin() const
Definition: PtrVector.h:144
edm::PtrVectorItr
Definition: PtrVector.h:51
BremRecoveryClusterAlgo::pERROR
Definition: BremRecoveryClusterAlgo.h:23
HLT_2018_cff.dEta
dEta
Definition: HLT_2018_cff.py:12289
funct::sin
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
funct::cos
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
edm::PtrVector< CaloCluster >
HLT_2018_cff.dPhi
dPhi
Definition: HLT_2018_cff.py:12290
edm::PtrVector::push_back
void push_back(Ptr< T > const &iPtr)
Definition: PtrVector.h:149
BremRecoveryClusterAlgo::eb_rdphi_
double eb_rdphi_
Definition: BremRecoveryClusterAlgo.h:59
math::XYZPoint
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
BremRecoveryClusterAlgo::ec_rdeta_
double ec_rdeta_
Definition: BremRecoveryClusterAlgo.h:60
math::XYZVector
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:31
edm::PtrVector::end
const_iterator end() const
Definition: PtrVector.h:146
BremRecoveryClusterAlgo::pWARNING
Definition: BremRecoveryClusterAlgo.h:23
edm::PtrVectorBase::clear
void clear()
Clear the PtrVector.
Definition: PtrVectorBase.h:79
BremRecoveryClusterAlgo::eb_rdeta_
double eb_rdeta_
Definition: BremRecoveryClusterAlgo.h:58
reco::CaloCluster::island
Definition: CaloCluster.h:34
edm::Ptr< CaloCluster >
BremRecoveryClusterAlgo::pDEBUG
Definition: BremRecoveryClusterAlgo.h:23
BremRecoveryClusterAlgo::seedTransverseEnergyThreshold
double seedTransverseEnergyThreshold
Definition: BremRecoveryClusterAlgo.h:63
BremRecoveryClusterAlgo::match
bool match(reco::CaloClusterPtr seed_p, reco::CaloClusterPtr cluster_p, double etaRoad, double phiRoad)
Definition: BremRecoveryClusterAlgo.cc:95
BremRecoveryClusterAlgo::makeIslandSuperClusters
void makeIslandSuperClusters(reco::CaloClusterPtrVector &clusters_v, double etaRoad, double phiRoad)
Definition: BremRecoveryClusterAlgo.cc:36
cscSegments_cfi.dPhiMax
dPhiMax
Definition: cscSegments_cfi.py:11