CMS 3D CMS Logo

BremRecoveryClusterAlgo Class Reference

#include <RecoEcal/EgammaClusterAlgos/interface/BremRecoveryClusterAlgo.h>

List of all members.

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::BasicClusterRefVector &clusters)
void setVerbosity (VerbosityLevel the_verbosity)

Private Member Functions

void makeIslandSuperClusters (reco::BasicClusterRefVector &clusters_v, double etaRoad, double phiRoad)
bool match (reco::BasicClusterRef seed_p, reco::BasicClusterRef 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

enum BremRecoveryClusterAlgo::VerbosityLevel

Enumerator:
pDEBUG 
pWARNING 
pINFO 
pERROR 

Definition at line 25 of file BremRecoveryClusterAlgo.h.

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


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

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

00034     {
00035       // e*_rdeta_ and e*_rdphi_ are half the total window 
00036       // because they correspond to one direction (positive or negative)
00037       eb_rdeta_ = eb_sc_road_etasize / 2;
00038       eb_rdphi_ = eb_sc_road_phisize / 2;
00039       ec_rdeta_ = ec_sc_road_etasize / 2;
00040       ec_rdphi_ = ec_sc_road_phisize / 2;
00041 
00042       seedTransverseEnergyThreshold = theSeedTransverseEnergyThreshold;
00043       verbosity = the_verbosity;
00044     }


Member Function Documentation

void BremRecoveryClusterAlgo::makeIslandSuperClusters ( reco::BasicClusterRefVector clusters_v,
double  etaRoad,
double  phiRoad 
) [private]

Definition at line 41 of file BremRecoveryClusterAlgo.cc.

References edm::RefVector< C, T, F >::begin(), GenMuonPlsPt100GeV_cfg::cout, edm::RefVector< C, T, F >::empty(), edm::RefVector< C, T, F >::end(), lat::endl(), edm::RefVector< C, T, F >::erase(), match(), pINFO, edm::RefVector< C, T, F >::push_back(), seedTransverseEnergyThreshold, funct::sin(), superclusters_v, and verbosity.

Referenced by makeSuperClusters().

00043 {
00044 
00045   reco::basicCluster_iterator currentSeed;
00046   for (currentSeed = clusters_v.begin(); !clusters_v.empty(); clusters_v.erase(currentSeed))
00047     {
00048       // Does our highest energy cluster have high enough energy?
00049       if ((*currentSeed)->energy() * sin((*currentSeed)->position().theta()) < seedTransverseEnergyThreshold) break;
00050 
00051       // if yes, make it a seed for a new SuperCluster:
00052       double energy_ = (*currentSeed)->energy();
00053       math::XYZVector position_((*currentSeed)->position().X(), 
00054                                 (*currentSeed)->position().Y(), 
00055                                 (*currentSeed)->position().Z());
00056       position_ *= energy_;
00057 
00058       if (verbosity <= pINFO)
00059         {
00060           std::cout << "*****************************" << std::endl;
00061           std::cout << "******NEW SUPERCLUSTER*******" << std::endl;
00062           std::cout << "Seed R = " << (*currentSeed)->position().Rho() << std::endl;
00063         }
00064 
00065       // and add the matching clusters:
00066       reco::BasicClusterRefVector constituentClusters;
00067       constituentClusters.push_back(*currentSeed);
00068       reco::basicCluster_iterator currentCluster = currentSeed + 1;
00069       while (currentCluster != clusters_v.end())
00070         {
00071           if (match(*currentSeed, *currentCluster, etaRoad, phiRoad))
00072             {
00073               constituentClusters.push_back(*currentCluster);
00074               energy_   += (*currentCluster)->energy();
00075               position_ += (*currentCluster)->energy() * math::XYZVector((*currentCluster)->position().X(), 
00076                                                                          (*currentCluster)->position().Y(), 
00077                                                                          (*currentCluster)->position().Z()); 
00078               if (verbosity <= pINFO) 
00079                 {
00080                   std::cout << "Cluster R = " << (*currentCluster)->position().Rho() << std::endl;
00081                 }
00082 
00083               clusters_v.erase(currentCluster);
00084             }
00085           else currentCluster++;
00086         }
00087 
00088       position_ /= energy_;
00089 
00090       if (verbosity <= pINFO)
00091         {
00092           std::cout << "Final SuperCluster R = " << position_.Rho() << std::endl;
00093         }
00094 
00095       reco::SuperCluster newSuperCluster(energy_, 
00096                                          math::XYZPoint(position_.X(), position_.Y(), position_.Z()), 
00097                                          (*currentSeed), 
00098                                          constituentClusters);
00099 
00100       superclusters_v.push_back(newSuperCluster);
00101 
00102       if (verbosity <= pINFO)
00103         {
00104           std::cout << "created a new supercluster of: " << std::endl;
00105           std::cout << "Energy = " << newSuperCluster.energy() << std::endl;
00106           std::cout << "Position in (R, phi, theta) = (" 
00107                     << newSuperCluster.position().Rho() << ", " 
00108                     << newSuperCluster.position().phi() << ", "
00109                     << newSuperCluster.position().theta() << ")" << std::endl;
00110         }
00111     }
00112   currentSeed = clusters_v.end();
00113 }

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

Definition at line 3 of file BremRecoveryClusterAlgo.cc.

References edm::RefVector< C, T, F >::begin(), eb_rdeta_, eb_rdphi_, ec_rdeta_, ec_rdphi_, edm::RefVector< C, T, F >::end(), reco::island, it, makeIslandSuperClusters(), edm::RefVector< C, T, F >::push_back(), and superclusters_v.

Referenced by SuperClusterProducer::produceSuperclustersForECALPart().

00004 {
00005   const float etaBorder = 1.479;
00006 
00007   superclusters_v.clear();
00008   
00009   // create vectors of references to clusters of a specific origin...
00010   reco::BasicClusterRefVector islandClustersBarrel_v;
00011   reco::BasicClusterRefVector islandClustersEndCap_v;
00012 
00013   // ...and populate them:
00014   reco::basicCluster_iterator it;
00015   for (it = clustersCollection.begin(); it != clustersCollection.end(); it++)
00016     {
00017       reco::BasicClusterRef cluster_p = *it;
00018       if (cluster_p->algo() == reco::island) 
00019       {
00020           if (fabs(cluster_p->position().eta()) < etaBorder)
00021             {
00022               islandClustersBarrel_v.push_back(cluster_p);
00023             }
00024           else
00025             {
00026               islandClustersEndCap_v.push_back(cluster_p);
00027             }
00028       }
00029     }
00030 
00031   // make the superclusters from the Barrel clusters - Island
00032   makeIslandSuperClusters(islandClustersBarrel_v, eb_rdeta_, eb_rdphi_);
00033   // make the superclusters from the EndCap clusters - Island
00034   makeIslandSuperClusters(islandClustersEndCap_v, ec_rdeta_, ec_rdphi_);
00035 
00036   return superclusters_v;
00037 }

bool BremRecoveryClusterAlgo::match ( reco::BasicClusterRef  seed_p,
reco::BasicClusterRef  cluster_p,
double  etaRoad,
double  phiRoad 
) [private]

Definition at line 116 of file BremRecoveryClusterAlgo.cc.

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

Referenced by makeIslandSuperClusters().

00119 {
00120   math::XYZPoint clusterPosition = cluster_p->position();
00121   math::XYZPoint seedPosition = seed_p->position();
00122 
00123   double dPhi = acos(cos(seedPosition.phi() - clusterPosition.phi()));
00124  
00125   double dEta = fabs(seedPosition.eta() - clusterPosition.eta());
00126  
00127   if (dEta > dEtaMax) return false;
00128   if (dPhi > dPhiMax) return false;
00129 
00130   return true;
00131 }

void BremRecoveryClusterAlgo::setVerbosity ( VerbosityLevel  the_verbosity  )  [inline]

Definition at line 46 of file BremRecoveryClusterAlgo.h.

References verbosity.

00047     {
00048       verbosity = the_verbosity;
00049     }


Member Data Documentation

double BremRecoveryClusterAlgo::eb_rdeta_ [private]

Definition at line 69 of file BremRecoveryClusterAlgo.h.

Referenced by BremRecoveryClusterAlgo(), and makeSuperClusters().

double BremRecoveryClusterAlgo::eb_rdphi_ [private]

Definition at line 70 of file BremRecoveryClusterAlgo.h.

Referenced by BremRecoveryClusterAlgo(), and makeSuperClusters().

double BremRecoveryClusterAlgo::ec_rdeta_ [private]

Definition at line 71 of file BremRecoveryClusterAlgo.h.

Referenced by BremRecoveryClusterAlgo(), and makeSuperClusters().

double BremRecoveryClusterAlgo::ec_rdphi_ [private]

Definition at line 72 of file BremRecoveryClusterAlgo.h.

Referenced by BremRecoveryClusterAlgo(), and makeSuperClusters().

double BremRecoveryClusterAlgo::seedTransverseEnergyThreshold [private]

Definition at line 74 of file BremRecoveryClusterAlgo.h.

Referenced by BremRecoveryClusterAlgo(), and makeIslandSuperClusters().

reco::SuperClusterCollection BremRecoveryClusterAlgo::superclusters_v [private]

Definition at line 76 of file BremRecoveryClusterAlgo.h.

Referenced by makeIslandSuperClusters(), and makeSuperClusters().

VerbosityLevel BremRecoveryClusterAlgo::verbosity [private]

Definition at line 67 of file BremRecoveryClusterAlgo.h.

Referenced by BremRecoveryClusterAlgo(), makeIslandSuperClusters(), and setVerbosity().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:15:03 2009 for CMSSW by  doxygen 1.5.4