CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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 ()
 
 ~SimG4HcalHitCluster ()=default
 

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 ( )
default

Member Function Documentation

double SimG4HcalHitCluster::collectEcalEnergyR ( )

Definition at line 54 of file SimG4HcalHitCluster.cc.

References hitsc.

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

Definition at line 17 of file SimG4HcalHitCluster.h.

References ec.

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

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

Definition at line 20 of file SimG4HcalHitCluster.h.

References hitsc.

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

Definition at line 28 of file SimG4HcalHitCluster.h.

References funct::exp().

Referenced by operator+=().

28 { return 0.5 * (exp(eta) + exp(-eta)); }
Exp< T >::type exp(const T &t)
Definition: Exp.h:22
double SimG4HcalHitCluster::my_sinh ( float  eta)
inlineprivate

Definition at line 29 of file SimG4HcalHitCluster.h.

References funct::exp().

Referenced by operator+=().

29 { return 0.5 * (exp(eta) - exp(-eta)); }
Exp< T >::type exp(const T &t)
Definition: Exp.h:22
SimG4HcalHitCluster & SimG4HcalHitCluster::operator+= ( const CaloHit hit)

Definition at line 15 of file SimG4HcalHitCluster.cc.

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

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

Definition at line 11 of file SimG4HcalHitCluster.cc.

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

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

Member Data Documentation

double SimG4HcalHitCluster::ec
private

Definition at line 31 of file SimG4HcalHitCluster.h.

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

double SimG4HcalHitCluster::etac
private

Definition at line 31 of file SimG4HcalHitCluster.h.

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

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

Definition at line 32 of file SimG4HcalHitCluster.h.

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

double SimG4HcalHitCluster::phic
private

Definition at line 31 of file SimG4HcalHitCluster.h.

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