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

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.

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

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  }

Member Function Documentation

◆ makeIslandSuperClusters()

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

Definition at line 36 of file BremRecoveryClusterAlgo.cc.

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().

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 }
void push_back(Ptr< T > const &iPtr)
Definition: PtrVector.h:149
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
const_iterator end() const
Definition: PtrVector.h:146
const_iterator begin() const
Definition: PtrVector.h:144
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:31
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
void clear()
Clear the PtrVector.
Definition: PtrVectorBase.h:81
bool match(reco::CaloClusterPtr seed_p, reco::CaloClusterPtr cluster_p, double etaRoad, double phiRoad)
reco::SuperClusterCollection superclusters_v

◆ makeSuperClusters()

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

Definition at line 5 of file BremRecoveryClusterAlgo.cc.

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.

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 }
void push_back(Ptr< T > const &iPtr)
Definition: PtrVector.h:149
void makeIslandSuperClusters(reco::CaloClusterPtrVector &clusters_v, double etaRoad, double phiRoad)
reco::SuperClusterCollection 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.

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

Referenced by makeIslandSuperClusters().

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 }
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12

◆ setVerbosity()

void BremRecoveryClusterAlgo::setVerbosity ( VerbosityLevel  the_verbosity)
inline

Definition at line 42 of file BremRecoveryClusterAlgo.h.

References verbosity.

42 { verbosity = the_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