CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 22 of file BremRecoveryClusterAlgo.h.

Member Enumeration Documentation

Constructor & Destructor Documentation

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 28 of file BremRecoveryClusterAlgo.h.

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

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

Member Function Documentation

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

Definition at line 42 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().

44 {
45 
46  for ( reco::CaloCluster_iterator currentSeed = clusters_v.begin(); currentSeed != clusters_v.end(); ++currentSeed)
47  {
48  // Does our highest energy cluster have high enough energy?
49  if ((*currentSeed)->energy() * sin((*currentSeed)->position().theta()) < seedTransverseEnergyThreshold) break;
50 
51  // if yes, make it a seed for a new SuperCluster:
52  double energy_ = (*currentSeed)->energy();
53  math::XYZVector position_((*currentSeed)->position().X(),
54  (*currentSeed)->position().Y(),
55  (*currentSeed)->position().Z());
56  position_ *= energy_;
57 
58  if (verbosity <= pINFO)
59  {
60  std::cout << "*****************************" << std::endl;
61  std::cout << "******NEW SUPERCLUSTER*******" << std::endl;
62  std::cout << "Seed R = " << (*currentSeed)->position().Rho() << std::endl;
63  }
64 
65  // and add the matching clusters:
66  reco::CaloClusterPtrVector constituentClusters;
67  constituentClusters.push_back( *currentSeed );
68  reco::CaloCluster_iterator currentCluster = currentSeed + 1;
69  while (currentCluster != clusters_v.end())
70  {
71  if (match(*currentSeed, *currentCluster, etaRoad, phiRoad))
72  {
73  constituentClusters.push_back(*currentCluster);
74  energy_ += (*currentCluster)->energy();
75  position_ += (*currentCluster)->energy() * math::XYZVector((*currentCluster)->position().X(),
76  (*currentCluster)->position().Y(),
77  (*currentCluster)->position().Z());
78  if (verbosity <= pINFO)
79  {
80  std::cout << "Cluster R = " << (*currentCluster)->position().Rho() << std::endl;
81  }
82 
83  }
84  ++currentCluster;
85  }
86 
87  position_ /= energy_;
88 
89  if (verbosity <= pINFO)
90  {
91  std::cout << "Final SuperCluster R = " << position_.Rho() << std::endl;
92  }
93 
94  reco::SuperCluster newSuperCluster(energy_,
95  math::XYZPoint(position_.X(), position_.Y(), position_.Z()),
96  (*currentSeed),
97  constituentClusters);
98 
99  superclusters_v.push_back(newSuperCluster);
100 
101  if (verbosity <= pINFO)
102  {
103  std::cout << "created a new supercluster of: " << std::endl;
104  std::cout << "Energy = " << newSuperCluster.energy() << std::endl;
105  std::cout << "Position in (R, phi, theta) = ("
106  << newSuperCluster.position().Rho() << ", "
107  << newSuperCluster.position().phi() << ", "
108  << newSuperCluster.position().theta() << ")" << std::endl;
109  }
110  }
111  clusters_v.clear();
112 }
void push_back(Ptr< T > const &iPtr)
Definition: PtrVector.h:138
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
const_iterator begin() const
Definition: PtrVector.h:127
const_iterator end() const
Definition: PtrVector.h:132
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:30
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
void clear()
Clear the PtrVector.
Definition: PtrVectorBase.h:79
tuple cout
Definition: gather_cfg.py:121
bool match(reco::CaloClusterPtr seed_p, reco::CaloClusterPtr cluster_p, double etaRoad, double phiRoad)
reco::SuperClusterCollection superclusters_v
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.

6 {
7  const float etaBorder = 1.479;
8 
9  superclusters_v.clear();
10 
11  // create vectors of references to clusters of a specific origin...
12  reco::CaloClusterPtrVector islandClustersBarrel_v;
13  reco::CaloClusterPtrVector islandClustersEndCap_v;
14 
15  // ...and populate them:
16  for (reco::CaloCluster_iterator it = clustersCollection.begin(); it != clustersCollection.end(); it++)
17  {
18  reco::CaloClusterPtr cluster_p = *it;
19  if (cluster_p->algo() == reco::CaloCluster::island)
20  {
21  if (fabs(cluster_p->position().eta()) < etaBorder)
22  {
23  islandClustersBarrel_v.push_back(cluster_p);
24  }
25  else
26  {
27  islandClustersEndCap_v.push_back(cluster_p);
28  }
29  }
30  }
31 
32  // make the superclusters from the Barrel clusters - Island
33  makeIslandSuperClusters(islandClustersBarrel_v, eb_rdeta_, eb_rdphi_);
34  // make the superclusters from the EndCap clusters - Island
35  makeIslandSuperClusters(islandClustersEndCap_v, ec_rdeta_, ec_rdphi_);
36 
37  return superclusters_v;
38 }
void push_back(Ptr< T > const &iPtr)
Definition: PtrVector.h:138
void makeIslandSuperClusters(reco::CaloClusterPtrVector &clusters_v, double etaRoad, double phiRoad)
reco::SuperClusterCollection superclusters_v
bool BremRecoveryClusterAlgo::match ( reco::CaloClusterPtr  seed_p,
reco::CaloClusterPtr  cluster_p,
double  etaRoad,
double  phiRoad 
)
private

Definition at line 115 of file BremRecoveryClusterAlgo.cc.

References funct::cos(), and dPhi().

Referenced by makeIslandSuperClusters().

118 {
119  math::XYZPoint clusterPosition = cluster_p->position();
120  math::XYZPoint seedPosition = seed_p->position();
121 
122  double dPhi = acos(cos(seedPosition.phi() - clusterPosition.phi()));
123 
124  double dEta = fabs(seedPosition.eta() - clusterPosition.eta());
125 
126  if (dEta > dEtaMax) return false;
127  if (dPhi > dPhiMax) return false;
128 
129  return true;
130 }
double dPhi(double phi1, double phi2)
Definition: JetUtil.h:30
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
void BremRecoveryClusterAlgo::setVerbosity ( VerbosityLevel  the_verbosity)
inline

Definition at line 47 of file BremRecoveryClusterAlgo.h.

References verbosity.

48  {
49  verbosity = the_verbosity;
50  }

Member Data Documentation

double BremRecoveryClusterAlgo::eb_rdeta_
private

Definition at line 70 of file BremRecoveryClusterAlgo.h.

Referenced by BremRecoveryClusterAlgo(), and makeSuperClusters().

double BremRecoveryClusterAlgo::eb_rdphi_
private

Definition at line 71 of file BremRecoveryClusterAlgo.h.

Referenced by BremRecoveryClusterAlgo(), and makeSuperClusters().

double BremRecoveryClusterAlgo::ec_rdeta_
private

Definition at line 72 of file BremRecoveryClusterAlgo.h.

Referenced by BremRecoveryClusterAlgo(), and makeSuperClusters().

double BremRecoveryClusterAlgo::ec_rdphi_
private

Definition at line 73 of file BremRecoveryClusterAlgo.h.

Referenced by BremRecoveryClusterAlgo(), and makeSuperClusters().

double BremRecoveryClusterAlgo::seedTransverseEnergyThreshold
private

Definition at line 75 of file BremRecoveryClusterAlgo.h.

Referenced by BremRecoveryClusterAlgo(), and makeIslandSuperClusters().

reco::SuperClusterCollection BremRecoveryClusterAlgo::superclusters_v
private

Definition at line 77 of file BremRecoveryClusterAlgo.h.

Referenced by makeIslandSuperClusters(), and makeSuperClusters().

VerbosityLevel BremRecoveryClusterAlgo::verbosity
private