CMS 3D CMS Logo

Multi5x5SuperClusterProducer Class Reference

#include <RecoEcal/EgammaClusterProducers/interface/Multi5x5SuperClusterProducer.h>

Inheritance diagram for Multi5x5SuperClusterProducer:

edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

List of all members.

Public Member Functions

virtual void endJob ()
 Multi5x5SuperClusterProducer (const edm::ParameterSet &ps)
virtual void produce (edm::Event &, const edm::EventSetup &)
 ~Multi5x5SuperClusterProducer ()

Private Member Functions

bool counterExceeded () const
void getClusterRefVector (edm::Event &evt, std::string clusterProducer_, std::string clusterCollection_, reco::BasicClusterRefVector *)
void outputValidationInfo (reco::SuperClusterCollection &superclusterCollection)
void produceSuperclustersForECALPart (edm::Event &evt, std::string clusterProducer, std::string clusterCollection, std::string superclusterColection)

Private Attributes

std::string barrelClusterCollection_
std::string barrelClusterProducer_
float barrelEtaSearchRoad_
float barrelPhiSearchRoad_
std::string barrelSuperclusterCollection_
Multi5x5BremRecoveryClusterAlgobremAlgo_p
bool doBarrel_
bool doEndcaps_
std::string endcapClusterCollection_
std::string endcapClusterProducer_
float endcapEtaSearchRoad_
float endcapPhiSearchRoad_
std::string endcapSuperclusterCollection_
int nEvt_
int nMaxPrintout_
int noSuperClusters
float seedTransverseEnergyThreshold_
double totalE
Multi5x5BremRecoveryClusterAlgo::VerbosityLevel verbosity


Detailed Description

Definition at line 18 of file Multi5x5SuperClusterProducer.h.


Constructor & Destructor Documentation

Multi5x5SuperClusterProducer::Multi5x5SuperClusterProducer ( const edm::ParameterSet ps  ) 

Definition at line 24 of file Multi5x5SuperClusterProducer.cc.

References barrelClusterCollection_, barrelClusterProducer_, barrelEtaSearchRoad_, barrelPhiSearchRoad_, barrelSuperclusterCollection_, bremAlgo_p, doBarrel_, doEndcaps_, endcapClusterCollection_, endcapClusterProducer_, endcapEtaSearchRoad_, endcapPhiSearchRoad_, endcapSuperclusterCollection_, edm::ParameterSet::getParameter(), nEvt_, noSuperClusters, Multi5x5BremRecoveryClusterAlgo::pDEBUG, Multi5x5BremRecoveryClusterAlgo::pERROR, Multi5x5BremRecoveryClusterAlgo::pINFO, Multi5x5BremRecoveryClusterAlgo::pWARNING, seedTransverseEnergyThreshold_, totalE, and verbosity.

00025 {
00026   // The verbosity level
00027   std::string verbosityString = ps.getParameter<std::string>("VerbosityLevel");
00028   if      (verbosityString == "DEBUG")   verbosity = Multi5x5BremRecoveryClusterAlgo::pDEBUG;
00029   else if (verbosityString == "WARNING") verbosity = Multi5x5BremRecoveryClusterAlgo::pWARNING;
00030   else if (verbosityString == "INFO")    verbosity = Multi5x5BremRecoveryClusterAlgo::pINFO;
00031   else                                   verbosity = Multi5x5BremRecoveryClusterAlgo::pERROR;
00032 
00033   endcapClusterProducer_ = ps.getParameter<std::string>("endcapClusterProducer");
00034   barrelClusterProducer_ = ps.getParameter<std::string>("barrelClusterProducer");
00035 
00036   endcapClusterCollection_ = ps.getParameter<std::string>("endcapClusterCollection");
00037   barrelClusterCollection_ = ps.getParameter<std::string>("barrelClusterCollection");
00038 
00039   endcapSuperclusterCollection_ = ps.getParameter<std::string>("endcapSuperclusterCollection");
00040   barrelSuperclusterCollection_ = ps.getParameter<std::string>("barrelSuperclusterCollection");
00041 
00042   doBarrel_ = ps.getParameter<bool>("doBarrel");
00043   doEndcaps_ = ps.getParameter<bool>("doEndcaps");
00044 
00045   barrelEtaSearchRoad_ = ps.getParameter<double>("barrelEtaSearchRoad");
00046   barrelPhiSearchRoad_ = ps.getParameter<double>("barrelPhiSearchRoad");
00047   endcapEtaSearchRoad_ = ps.getParameter<double>("endcapEtaSearchRoad");
00048   endcapPhiSearchRoad_ = ps.getParameter<double>("endcapPhiSearchRoad");
00049   seedTransverseEnergyThreshold_ = ps.getParameter<double>("seedTransverseEnergyThreshold");
00050 
00051   const edm::ParameterSet bremRecoveryPset = ps.getParameter<edm::ParameterSet>("bremRecoveryPset");
00052   bool dynamicPhiRoad = ps.getParameter<bool>("dynamicPhiRoad");
00053 
00054   bremAlgo_p = new Multi5x5BremRecoveryClusterAlgo(bremRecoveryPset, barrelEtaSearchRoad_, barrelPhiSearchRoad_, 
00055                                          endcapEtaSearchRoad_, endcapPhiSearchRoad_, 
00056                                          dynamicPhiRoad, seedTransverseEnergyThreshold_, verbosity);
00057 
00058   produces< reco::SuperClusterCollection >(endcapSuperclusterCollection_);
00059   produces< reco::SuperClusterCollection >(barrelSuperclusterCollection_);
00060 
00061   totalE = 0;
00062   noSuperClusters = 0;
00063   nEvt_ = 0;
00064 }

Multi5x5SuperClusterProducer::~Multi5x5SuperClusterProducer (  ) 

Definition at line 67 of file Multi5x5SuperClusterProducer.cc.

References bremAlgo_p.

00068 {
00069   delete bremAlgo_p;
00070 }


Member Function Documentation

bool Multi5x5SuperClusterProducer::counterExceeded (  )  const [inline, private]

Definition at line 70 of file Multi5x5SuperClusterProducer.h.

References nEvt_, and nMaxPrintout_.

00070 { return ((nEvt_ > nMaxPrintout_) || (nMaxPrintout_ < 0));}

void Multi5x5SuperClusterProducer::endJob ( void   )  [virtual]

Reimplemented from edm::EDProducer.

Definition at line 73 of file Multi5x5SuperClusterProducer.cc.

References noSuperClusters, and totalE.

00073                                      {
00074   double averEnergy = 0.;
00075   std::ostringstream str;
00076   str << "Multi5x5SuperClusterProducer::endJob()\n"
00077       << "  total # reconstructed super clusters: " << noSuperClusters << "\n"
00078       << "  total energy of all clusters: " << totalE << "\n";
00079   if(noSuperClusters>0) { 
00080     averEnergy = totalE / noSuperClusters;
00081     str << "  average SuperCluster energy = " << averEnergy << "\n";
00082   }
00083   edm::LogInfo("Multi5x5SuperClusterProducerInfo") << str.str() << "\n";
00084 
00085 }

void Multi5x5SuperClusterProducer::getClusterRefVector ( edm::Event evt,
std::string  clusterProducer_,
std::string  clusterCollection_,
reco::BasicClusterRefVector clusterRefVector_p 
) [private]

Definition at line 128 of file Multi5x5SuperClusterProducer.cc.

References edm::Event::getByLabel(), i, edm::Handle< T >::isValid(), edm::Handle< T >::product(), and edm::RefVector< C, T, F >::push_back().

Referenced by produceSuperclustersForECALPart().

00129 {  
00130   edm::Handle<reco::BasicClusterCollection> bccHandle;
00131   try
00132     {
00133       evt.getByLabel(clusterProducer_, clusterCollection_, bccHandle);
00134       if (!(bccHandle.isValid()))
00135         {
00136           edm::LogError("Multi5x5SuperClusterProducerError") << "could not get a handle on the BasicCluster Collection!";
00137           clusterRefVector_p = 0;
00138         }
00139     } 
00140   catch ( cms::Exception& ex )
00141     {
00142       edm::LogError("Multi5x5SuperClusterProducerError") << "Error! can't get the product " << clusterCollection_.c_str(); 
00143       clusterRefVector_p = 0;
00144     }
00145 
00146   const reco::BasicClusterCollection *clusterCollection_p = bccHandle.product();
00147   for (unsigned int i = 0; i < clusterCollection_p->size(); i++)
00148     {
00149       clusterRefVector_p->push_back(reco::BasicClusterRef(bccHandle, i));
00150     }
00151 }                               

void Multi5x5SuperClusterProducer::outputValidationInfo ( reco::SuperClusterCollection superclusterCollection  )  [private]

void Multi5x5SuperClusterProducer::produce ( edm::Event evt,
const edm::EventSetup es 
) [virtual]

Implements edm::EDProducer.

Definition at line 88 of file Multi5x5SuperClusterProducer.cc.

References barrelClusterCollection_, barrelClusterProducer_, barrelSuperclusterCollection_, doBarrel_, doEndcaps_, endcapClusterCollection_, endcapClusterProducer_, endcapSuperclusterCollection_, nEvt_, and produceSuperclustersForECALPart().

void Multi5x5SuperClusterProducer::produceSuperclustersForECALPart ( edm::Event evt,
std::string  clusterProducer,
std::string  clusterCollection,
std::string  superclusterColection 
) [private]

Definition at line 100 of file Multi5x5SuperClusterProducer.cc.

References bremAlgo_p, getClusterRefVector(), it, Multi5x5BremRecoveryClusterAlgo::makeSuperClusters(), noSuperClusters, edm::Event::put(), and totalE.

Referenced by produce().

00104 {
00105   // get the cluster collection out and turn it to a BasicClusterRefVector:
00106   reco::BasicClusterRefVector *clusterRefVector_p = new reco::BasicClusterRefVector;
00107   getClusterRefVector(evt, clusterProducer, clusterCollection, clusterRefVector_p);
00108 
00109   // run the brem recovery and get the SC collection
00110   std::auto_ptr<reco::SuperClusterCollection> 
00111     superclusters_ap(new reco::SuperClusterCollection(bremAlgo_p->makeSuperClusters(*clusterRefVector_p)));
00112 
00113   // count the total energy and the number of superclusters
00114   reco::SuperClusterCollection::iterator it;
00115   for (it = superclusters_ap->begin(); it != superclusters_ap->end(); it++)
00116     {
00117       totalE += it->energy();
00118       noSuperClusters++;
00119     }
00120 
00121   // put the SC collection in the event
00122   evt.put(superclusters_ap, superclusterCollection);
00123 
00124   delete clusterRefVector_p;
00125 }


Member Data Documentation

std::string Multi5x5SuperClusterProducer::barrelClusterCollection_ [private]

Definition at line 38 of file Multi5x5SuperClusterProducer.h.

Referenced by Multi5x5SuperClusterProducer(), and produce().

std::string Multi5x5SuperClusterProducer::barrelClusterProducer_ [private]

Definition at line 41 of file Multi5x5SuperClusterProducer.h.

Referenced by Multi5x5SuperClusterProducer(), and produce().

float Multi5x5SuperClusterProducer::barrelEtaSearchRoad_ [private]

Definition at line 46 of file Multi5x5SuperClusterProducer.h.

Referenced by Multi5x5SuperClusterProducer().

float Multi5x5SuperClusterProducer::barrelPhiSearchRoad_ [private]

Definition at line 47 of file Multi5x5SuperClusterProducer.h.

Referenced by Multi5x5SuperClusterProducer().

std::string Multi5x5SuperClusterProducer::barrelSuperclusterCollection_ [private]

Definition at line 44 of file Multi5x5SuperClusterProducer.h.

Referenced by Multi5x5SuperClusterProducer(), and produce().

Multi5x5BremRecoveryClusterAlgo* Multi5x5SuperClusterProducer::bremAlgo_p [private]

Definition at line 55 of file Multi5x5SuperClusterProducer.h.

Referenced by Multi5x5SuperClusterProducer(), produceSuperclustersForECALPart(), and ~Multi5x5SuperClusterProducer().

bool Multi5x5SuperClusterProducer::doBarrel_ [private]

Definition at line 52 of file Multi5x5SuperClusterProducer.h.

Referenced by Multi5x5SuperClusterProducer(), and produce().

bool Multi5x5SuperClusterProducer::doEndcaps_ [private]

Definition at line 53 of file Multi5x5SuperClusterProducer.h.

Referenced by Multi5x5SuperClusterProducer(), and produce().

std::string Multi5x5SuperClusterProducer::endcapClusterCollection_ [private]

Definition at line 37 of file Multi5x5SuperClusterProducer.h.

Referenced by Multi5x5SuperClusterProducer(), and produce().

std::string Multi5x5SuperClusterProducer::endcapClusterProducer_ [private]

Definition at line 40 of file Multi5x5SuperClusterProducer.h.

Referenced by Multi5x5SuperClusterProducer(), and produce().

float Multi5x5SuperClusterProducer::endcapEtaSearchRoad_ [private]

Definition at line 48 of file Multi5x5SuperClusterProducer.h.

Referenced by Multi5x5SuperClusterProducer().

float Multi5x5SuperClusterProducer::endcapPhiSearchRoad_ [private]

Definition at line 49 of file Multi5x5SuperClusterProducer.h.

Referenced by Multi5x5SuperClusterProducer().

std::string Multi5x5SuperClusterProducer::endcapSuperclusterCollection_ [private]

Definition at line 43 of file Multi5x5SuperClusterProducer.h.

Referenced by Multi5x5SuperClusterProducer(), and produce().

int Multi5x5SuperClusterProducer::nEvt_ [private]

Definition at line 33 of file Multi5x5SuperClusterProducer.h.

Referenced by counterExceeded(), Multi5x5SuperClusterProducer(), and produce().

int Multi5x5SuperClusterProducer::nMaxPrintout_ [private]

Definition at line 32 of file Multi5x5SuperClusterProducer.h.

Referenced by counterExceeded().

int Multi5x5SuperClusterProducer::noSuperClusters [private]

Definition at line 58 of file Multi5x5SuperClusterProducer.h.

Referenced by endJob(), Multi5x5SuperClusterProducer(), and produceSuperclustersForECALPart().

float Multi5x5SuperClusterProducer::seedTransverseEnergyThreshold_ [private]

Definition at line 50 of file Multi5x5SuperClusterProducer.h.

Referenced by Multi5x5SuperClusterProducer().

double Multi5x5SuperClusterProducer::totalE [private]

Definition at line 57 of file Multi5x5SuperClusterProducer.h.

Referenced by endJob(), Multi5x5SuperClusterProducer(), and produceSuperclustersForECALPart().

Multi5x5BremRecoveryClusterAlgo::VerbosityLevel Multi5x5SuperClusterProducer::verbosity [private]

Definition at line 35 of file Multi5x5SuperClusterProducer.h.

Referenced by Multi5x5SuperClusterProducer().


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