CMS 3D CMS Logo

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::SimG4HcalHitCluster ( )

Definition at line 9 of file SimG4HcalHitCluster.cc.

◆ ~SimG4HcalHitCluster()

SimG4HcalHitCluster::~SimG4HcalHitCluster ( )
default

Member Function Documentation

◆ collectEcalEnergyR()

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

◆ e()

double SimG4HcalHitCluster::e ( ) const
inline

Definition at line 17 of file SimG4HcalHitCluster.h.

References ec.

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

17 { return ec; }

◆ eta()

double SimG4HcalHitCluster::eta ( void  ) const
inline

◆ getHits()

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

Definition at line 20 of file SimG4HcalHitCluster.h.

References hitsc.

20 { return &hitsc; }
std::vector< CaloHit > hitsc

◆ my_cosh()

double SimG4HcalHitCluster::my_cosh ( float  eta)
inlineprivate

Definition at line 28 of file SimG4HcalHitCluster.h.

References eta(), and JetChargeProducer_cfi::exp.

Referenced by operator+=().

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

◆ my_sinh()

double SimG4HcalHitCluster::my_sinh ( float  eta)
inlineprivate

Definition at line 29 of file SimG4HcalHitCluster.h.

References eta(), and JetChargeProducer_cfi::exp.

Referenced by operator+=().

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

◆ operator+=()

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

Definition at line 15 of file SimG4HcalHitCluster.cc.

References funct::cos(), ec, EgHLTOffHistBins_cfi::et, etac, hitsc, dqm-mbProfile::log, my_cosh(), my_sinh(), phic, multPhiCorr_741_25nsDY_cfi::px, multPhiCorr_741_25nsDY_cfi::py, 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 }
std::vector< CaloHit > hitsc
Sin< T >::type sin(const T &t)
Definition: Sin.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)
Geom::Theta< T > theta() const

◆ operator<()

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

Definition at line 11 of file SimG4HcalHitCluster.cc.

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

11  {
12  return (ec / cosh(etac) < cluster.e() / cosh(cluster.eta())) ? false : true;
13 }

◆ phi()

double SimG4HcalHitCluster::phi ( void  ) const
inline

Member Data Documentation

◆ ec

double SimG4HcalHitCluster::ec
private

Definition at line 31 of file SimG4HcalHitCluster.h.

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

◆ etac

double SimG4HcalHitCluster::etac
private

Definition at line 31 of file SimG4HcalHitCluster.h.

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

◆ hitsc

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

Definition at line 32 of file SimG4HcalHitCluster.h.

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

◆ phic

double SimG4HcalHitCluster::phic
private

Definition at line 31 of file SimG4HcalHitCluster.h.

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