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

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 56 of file SimG4HcalHitCluster.cc.

References hitsc.

Referenced by getHits().

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 }
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 collectEcalEnergyR(), hitsc, operator+=(), and operator<().

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

Definition at line 28 of file SimG4HcalHitCluster.h.

References JetChargeProducer_cfi::exp.

Referenced by operator+=().

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

Definition at line 29 of file SimG4HcalHitCluster.h.

References JetChargeProducer_cfi::exp.

Referenced by operator+=().

29 { 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, stringResolutionProvider_cfi::et, CaloHit::eta(), etac, hitsc, cmsBatch::log, my_cosh(), my_sinh(), CaloHit::phi(), phic, funct::sin(), funct::tan(), and theta().

Referenced by getHits().

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 }
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
et
define resolution functions of each parameter
bool SimG4HcalHitCluster::operator< ( const SimG4HcalHitCluster cluster) const

Definition at line 13 of file SimG4HcalHitCluster.cc.

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

Referenced by getHits().

13  {
14  return (ec / cosh(etac) < cluster.e() / cosh(cluster.eta())) ? false : true;
15 }
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().