CMS 3D CMS Logo

SimG4HcalHitCluster Class Reference

#include <Validation/HcalHits/interface/SimG4HcalHitCluster.h>

List of all members.

Public Member Functions

double collectEcalEnergyR ()
double e () const
double eta () const
std::vector< CaloHit > * getHits ()
SimG4HcalHitClusteroperator+= (const CaloHit &hit)
bool operator< (const SimG4HcalHitCluster &cluster) const
double phi () const
 SimG4HcalHitCluster ()
virtual ~SimG4HcalHitCluster ()

Private Member Functions

double my_cosh (float eta)
double my_sinh (float eta)

Private Attributes

double ec
double etac
std::vector< CaloHithitsc
double phic


Detailed Description

Definition at line 12 of file SimG4HcalHitCluster.h.


Constructor & Destructor Documentation

SimG4HcalHitCluster::SimG4HcalHitCluster (  ) 

Definition at line 9 of file SimG4HcalHitCluster.cc.

00009 : ec(0), etac(0), phic(0) {}

SimG4HcalHitCluster::~SimG4HcalHitCluster (  )  [virtual]

Definition at line 11 of file SimG4HcalHitCluster.cc.

00011 {}


Member Function Documentation

double SimG4HcalHitCluster::collectEcalEnergyR (  ) 

Definition at line 57 of file SimG4HcalHitCluster.cc.

References hitsc, and sum().

00057                                                {
00058 
00059   double sum = 0.;
00060   std::vector<CaloHit>::iterator itr;
00061 
00062   for (itr = hitsc.begin(); itr < hitsc.end(); itr++) {
00063     if (itr->det() == 10 || itr->det() == 11 || itr->det() == 12) {
00064       sum += itr->e(); 
00065     }    
00066   }
00067   return sum;
00068 }

double SimG4HcalHitCluster::e (  )  const [inline]

Definition at line 19 of file SimG4HcalHitCluster.h.

References ec.

Referenced by operator<(), and operator<<().

00019 {return ec;}

double SimG4HcalHitCluster::eta ( void   )  const [inline]

Definition at line 20 of file SimG4HcalHitCluster.h.

References etac.

Referenced by operator<(), operator<<(), and SimG4HcalHitJetFinder::rDist().

00020 {return etac;}

std::vector<CaloHit>* SimG4HcalHitCluster::getHits (  )  [inline]

Definition at line 22 of file SimG4HcalHitCluster.h.

References hitsc.

00022 {return &hitsc;}

double SimG4HcalHitCluster::my_cosh ( float  eta  )  [inline, private]

Definition at line 31 of file SimG4HcalHitCluster.h.

References funct::exp().

Referenced by operator+=().

00031 {return 0.5 * (exp(eta) + exp(-eta));}

double SimG4HcalHitCluster::my_sinh ( float  eta  )  [inline, private]

Definition at line 32 of file SimG4HcalHitCluster.h.

References funct::exp().

Referenced by operator+=().

00032 {return 0.5 * (exp(eta) - exp(-eta));}

SimG4HcalHitCluster & SimG4HcalHitCluster::operator+= ( const CaloHit hit  ) 

Definition at line 17 of file SimG4HcalHitCluster.cc.

References funct::cos(), CaloHit::e(), ec, CaloHit::eta(), etac, hitsc, funct::log(), my_cosh(), my_sinh(), CaloHit::phi(), phic, funct::sin(), funct::tan(), and theta.

00017                                                                        {
00018 
00019   hitsc.push_back(hit);
00020  
00021   if (ec == 0. && etac == 0. && phic == 0.) {
00022     ec   = hit.e();
00023     etac = hit.eta();
00024     phic = hit.phi();
00025   } else {   
00026     // cluster px,py,pz
00027     double et = ec / my_cosh(etac);
00028     double px = et * cos(phic);
00029     double py = et * sin(phic);
00030     double pz = et * my_sinh(etac); 
00031 
00032     HepLorentzVector clusHLV(px,py,pz,ec);
00033       
00034     // hit px,py,pz
00035     double eh   = hit.e();
00036     double etah = hit.eta();
00037     double phih = hit.phi();
00038     et = eh / my_cosh(etah);
00039     px = et * cos(phih);
00040     py = et * sin(phih);
00041     pz = et * my_sinh(etah); 
00042       
00043     HepLorentzVector hitHLV(px,py,pz,eh);
00044       
00045     // clus + hit
00046     clusHLV += hitHLV;
00047       
00048     double theta  = clusHLV.theta();
00049     etac = -log(tan(theta/2.));
00050     phic = clusHLV.phi();
00051     ec   = clusHLV.t();
00052   }
00053 
00054   return *this;
00055 }

bool SimG4HcalHitCluster::operator< ( const SimG4HcalHitCluster cluster  )  const

Definition at line 13 of file SimG4HcalHitCluster.cc.

References e(), ec, eta(), etac, and true.

00013                                                                             {
00014   return (ec/cosh(etac) < cluster.e()/cosh(cluster.eta())) ? false : true ;
00015 }

double SimG4HcalHitCluster::phi ( void   )  const [inline]

Definition at line 21 of file SimG4HcalHitCluster.h.

References phic.

Referenced by operator<<(), and SimG4HcalHitJetFinder::rDist().

00021 {return phic;}


Member Data Documentation

double SimG4HcalHitCluster::ec [private]

Definition at line 34 of file SimG4HcalHitCluster.h.

Referenced by e(), operator+=(), and operator<().

double SimG4HcalHitCluster::etac [private]

Definition at line 34 of file SimG4HcalHitCluster.h.

Referenced by eta(), operator+=(), and operator<().

std::vector<CaloHit> SimG4HcalHitCluster::hitsc [private]

Definition at line 35 of file SimG4HcalHitCluster.h.

Referenced by collectEcalEnergyR(), getHits(), and operator+=().

double SimG4HcalHitCluster::phic [private]

Definition at line 34 of file SimG4HcalHitCluster.h.

Referenced by operator+=(), and phi().


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