CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
SimG4HcalHitCluster Class Reference

#include <SimG4HcalHitCluster.h>

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.

SimG4HcalHitCluster::~SimG4HcalHitCluster ( )
virtual

Definition at line 11 of file SimG4HcalHitCluster.cc.

11 {}

Member Function Documentation

double SimG4HcalHitCluster::collectEcalEnergyR ( )

Definition at line 57 of file SimG4HcalHitCluster.cc.

References hitsc.

57  {
58 
59  double sum = 0.;
60  std::vector<CaloHit>::iterator itr;
61 
62  for (itr = hitsc.begin(); itr < hitsc.end(); itr++) {
63  if (itr->det() == 10 || itr->det() == 11 || itr->det() == 12) {
64  sum += itr->e();
65  }
66  }
67  return sum;
68 }
std::vector< CaloHit > hitsc
double SimG4HcalHitCluster::e ( ) const
inline

Definition at line 19 of file SimG4HcalHitCluster.h.

References ec.

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

19 {return ec;}
double SimG4HcalHitCluster::eta ( void  ) const
inline
std::vector<CaloHit>* SimG4HcalHitCluster::getHits ( )
inline

Definition at line 22 of file SimG4HcalHitCluster.h.

References hitsc.

22 {return &hitsc;}
std::vector< CaloHit > hitsc
double SimG4HcalHitCluster::my_cosh ( float  eta)
inlineprivate

Definition at line 31 of file SimG4HcalHitCluster.h.

References create_public_lumi_plots::exp.

Referenced by operator+=().

31 {return 0.5 * (exp(eta) + exp(-eta));}
double SimG4HcalHitCluster::my_sinh ( float  eta)
inlineprivate

Definition at line 32 of file SimG4HcalHitCluster.h.

References create_public_lumi_plots::exp.

Referenced by operator+=().

32 {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, cmsBatch::log, my_cosh(), my_sinh(), CaloHit::phi(), phic, funct::sin(), funct::tan(), and theta().

17  {
18 
19  hitsc.push_back(hit);
20 
21  if (ec == 0. && etac == 0. && phic == 0.) {
22  ec = hit.e();
23  etac = hit.eta();
24  phic = hit.phi();
25  } else {
26  // cluster px,py,pz
27  double et = ec / my_cosh(etac);
28  double px = et * cos(phic);
29  double py = et * sin(phic);
30  double pz = et * my_sinh(etac);
31 
32  CLHEP::HepLorentzVector clusHLV(px,py,pz,ec);
33 
34  // hit px,py,pz
35  double eh = hit.e();
36  double etah = hit.eta();
37  double phih = hit.phi();
38  et = eh / my_cosh(etah);
39  px = et * cos(phih);
40  py = et * sin(phih);
41  pz = et * my_sinh(etah);
42 
43  CLHEP::HepLorentzVector hitHLV(px,py,pz,eh);
44 
45  // clus + hit
46  clusHLV += hitHLV;
47 
48  double theta = clusHLV.theta();
49  etac = -log(tan(theta/2.));
50  phic = clusHLV.phi();
51  ec = clusHLV.t();
52  }
53 
54  return *this;
55 }
double phi() const
Definition: CaloHit.h:26
std::vector< CaloHit > hitsc
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Geom::Theta< T > theta() const
double eta() const
Definition: CaloHit.h:25
double my_sinh(float eta)
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
double my_cosh(float eta)
double e() const
Definition: CaloHit.h:24
tuple log
Definition: cmsBatch.py:341
bool SimG4HcalHitCluster::operator< ( const SimG4HcalHitCluster cluster) const

Definition at line 13 of file SimG4HcalHitCluster.cc.

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

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

Definition at line 21 of file SimG4HcalHitCluster.h.

References phic.

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

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