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

Definition at line 9 of file SimG4HcalHitCluster.cc.

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

◆ ~SimG4HcalHitCluster()

SimG4HcalHitCluster::~SimG4HcalHitCluster ( )
virtual

Definition at line 11 of file SimG4HcalHitCluster.cc.

11 {}

Member Function Documentation

◆ collectEcalEnergyR()

double SimG4HcalHitCluster::collectEcalEnergyR ( )

Definition at line 56 of file SimG4HcalHitCluster.cc.

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

References hitsc.

◆ e()

double SimG4HcalHitCluster::e ( ) const
inline

Definition at line 17 of file SimG4HcalHitCluster.h.

17 { return ec; }

References ec.

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

◆ eta()

double SimG4HcalHitCluster::eta ( void  ) const
inline

◆ getHits()

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

Definition at line 20 of file SimG4HcalHitCluster.h.

20 { return &hitsc; }

References hitsc.

◆ my_cosh()

double SimG4HcalHitCluster::my_cosh ( float  eta)
inlineprivate

Definition at line 28 of file SimG4HcalHitCluster.h.

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

References eta(), and JetChargeProducer_cfi::exp.

Referenced by operator+=().

◆ my_sinh()

double SimG4HcalHitCluster::my_sinh ( float  eta)
inlineprivate

Definition at line 29 of file SimG4HcalHitCluster.h.

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

References eta(), and JetChargeProducer_cfi::exp.

Referenced by operator+=().

◆ operator+=()

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

Definition at line 17 of file SimG4HcalHitCluster.cc.

17  {
18  hitsc.push_back(hit);
19 
20  if (ec == 0. && etac == 0. && phic == 0.) {
21  ec = hit.e();
22  etac = hit.eta();
23  phic = hit.phi();
24  } else {
25  // cluster px,py,pz
26  double et = ec / my_cosh(etac);
27  double px = et * cos(phic);
28  double py = et * sin(phic);
29  double pz = et * my_sinh(etac);
30 
31  CLHEP::HepLorentzVector clusHLV(px, py, pz, ec);
32 
33  // hit px,py,pz
34  double eh = hit.e();
35  double etah = hit.eta();
36  double phih = hit.phi();
37  et = eh / my_cosh(etah);
38  px = et * cos(phih);
39  py = et * sin(phih);
40  pz = et * my_sinh(etah);
41 
42  CLHEP::HepLorentzVector hitHLV(px, py, pz, eh);
43 
44  // clus + hit
45  clusHLV += hitHLV;
46 
47  double theta = clusHLV.theta();
48  etac = -log(tan(theta / 2.));
49  phic = clusHLV.phi();
50  ec = clusHLV.t();
51  }
52 
53  return *this;
54 }

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

◆ operator<()

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

Definition at line 13 of file SimG4HcalHitCluster.cc.

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

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

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

SimG4HcalHitCluster::hitsc
std::vector< CaloHit > hitsc
Definition: SimG4HcalHitCluster.h:32
funct::false
false
Definition: Factorize.h:34
multPhiCorr_741_25nsDY_cfi.py
py
Definition: multPhiCorr_741_25nsDY_cfi.py:12
SimG4HcalHitCluster::eta
double eta() const
Definition: SimG4HcalHitCluster.h:18
funct::sin
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
funct::cos
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
theta
Geom::Theta< T > theta() const
Definition: Basic3DVectorLD.h:150
SimG4HcalHitCluster::e
double e() const
Definition: SimG4HcalHitCluster.h:17
funct::tan
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
SimG4HcalHitCluster::my_sinh
double my_sinh(float eta)
Definition: SimG4HcalHitCluster.h:29
EgHLTOffHistBins_cfi.et
et
Definition: EgHLTOffHistBins_cfi.py:8
SimG4HcalHitCluster::ec
double ec
Definition: SimG4HcalHitCluster.h:31
itr
std::vector< std::pair< float, float > >::iterator itr
Definition: HGCDigitizer.cc:28
multPhiCorr_741_25nsDY_cfi.px
px
Definition: multPhiCorr_741_25nsDY_cfi.py:10
SimG4HcalHitCluster::my_cosh
double my_cosh(float eta)
Definition: SimG4HcalHitCluster.h:28
SimG4HcalHitCluster::etac
double etac
Definition: SimG4HcalHitCluster.h:31
dqm-mbProfile.log
log
Definition: dqm-mbProfile.py:17
JetChargeProducer_cfi.exp
exp
Definition: JetChargeProducer_cfi.py:6
hit
Definition: SiStripHitEffFromCalibTree.cc:88
SimG4HcalHitCluster::phic
double phic
Definition: SimG4HcalHitCluster.h:31