CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

SimG4HcalHitCluster Class Reference

#include <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.

: ec(0), etac(0), phic(0) {}
SimG4HcalHitCluster::~SimG4HcalHitCluster ( ) [virtual]

Definition at line 11 of file SimG4HcalHitCluster.cc.

{}

Member Function Documentation

double SimG4HcalHitCluster::collectEcalEnergyR ( )

Definition at line 57 of file SimG4HcalHitCluster.cc.

References hitsc.

                                               {

  double sum = 0.;
  std::vector<CaloHit>::iterator itr;

  for (itr = hitsc.begin(); itr < hitsc.end(); itr++) {
    if (itr->det() == 10 || itr->det() == 11 || itr->det() == 12) {
      sum += itr->e(); 
    }    
  }
  return sum;
}
double SimG4HcalHitCluster::e ( ) const [inline]

Definition at line 19 of file SimG4HcalHitCluster.h.

References ec.

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

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

{return etac;}
std::vector<CaloHit>* SimG4HcalHitCluster::getHits ( ) [inline]

Definition at line 22 of file SimG4HcalHitCluster.h.

References hitsc.

{return &hitsc;}
double SimG4HcalHitCluster::my_cosh ( float  eta) [inline, private]

Definition at line 31 of file SimG4HcalHitCluster.h.

References funct::exp().

Referenced by operator+=().

{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+=().

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

                                                                       {

  hitsc.push_back(hit);
 
  if (ec == 0. && etac == 0. && phic == 0.) {
    ec   = hit.e();
    etac = hit.eta();
    phic = hit.phi();
  } else {   
    // cluster px,py,pz
    double et = ec / my_cosh(etac);
    double px = et * cos(phic);
    double py = et * sin(phic);
    double pz = et * my_sinh(etac); 

    CLHEP::HepLorentzVector clusHLV(px,py,pz,ec);
      
    // hit px,py,pz
    double eh   = hit.e();
    double etah = hit.eta();
    double phih = hit.phi();
    et = eh / my_cosh(etah);
    px = et * cos(phih);
    py = et * sin(phih);
    pz = et * my_sinh(etah); 
      
    CLHEP::HepLorentzVector hitHLV(px,py,pz,eh);
      
    // clus + hit
    clusHLV += hitHLV;
      
    double theta  = clusHLV.theta();
    etac = -log(tan(theta/2.));
    phic = clusHLV.phi();
    ec   = clusHLV.t();
  }

  return *this;
}
bool SimG4HcalHitCluster::operator< ( const SimG4HcalHitCluster cluster) const

Definition at line 13 of file SimG4HcalHitCluster.cc.

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

                                                                            {
  return (ec/cosh(etac) < cluster.e()/cosh(cluster.eta())) ? false : true ;
}
double SimG4HcalHitCluster::phi ( void  ) const [inline]

Definition at line 21 of file SimG4HcalHitCluster.h.

References phic.

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

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