CMS 3D CMS Logo

SimG4HcalHitCluster.cc
Go to the documentation of this file.
1 // File: SimG4HcalHitCluster.cc
3 // Description: Cluster class in SimG4HcalValidation
6 
7 #include "CLHEP/Vector/LorentzVector.h"
8 
9 SimG4HcalHitCluster::SimG4HcalHitCluster() : ec(0), etac(0), phic(0) {}
10 
12 
14  return (ec / cosh(etac) < cluster.e() / cosh(cluster.eta())) ? false : true;
15 }
16 
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 }
55 
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 }
67 
68 std::ostream &operator<<(std::ostream &os, const SimG4HcalHitCluster &cluster) {
69  os << " SimG4HcalHitCluster:: E " << cluster.e() << " eta " << cluster.eta() << " phi " << cluster.phi();
70  return os;
71 }
SimG4HcalHitCluster::hitsc
std::vector< CaloHit > hitsc
Definition: SimG4HcalHitCluster.h:32
funct::false
false
Definition: Factorize.h:34
SimG4HcalHitCluster::collectEcalEnergyR
double collectEcalEnergyR()
Definition: SimG4HcalHitCluster.cc:56
multPhiCorr_741_25nsDY_cfi.py
py
Definition: multPhiCorr_741_25nsDY_cfi.py:12
SimG4HcalHitCluster::operator+=
SimG4HcalHitCluster & operator+=(const CaloHit &hit)
Definition: SimG4HcalHitCluster.cc:17
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
SimG4HcalHitCluster::SimG4HcalHitCluster
SimG4HcalHitCluster()
Definition: SimG4HcalHitCluster.cc:9
SimG4HcalHitCluster::phi
double phi() const
Definition: SimG4HcalHitCluster.h:19
SimG4HcalHitCluster::operator<
bool operator<(const SimG4HcalHitCluster &cluster) const
Definition: SimG4HcalHitCluster.cc:13
theta
Geom::Theta< T > theta() const
Definition: Basic3DVectorLD.h:150
SimG4HcalHitCluster::e
double e() const
Definition: SimG4HcalHitCluster.h:17
operator<<
std::ostream & operator<<(std::ostream &os, const SimG4HcalHitCluster &cluster)
Definition: SimG4HcalHitCluster.cc:68
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
CaloHit
Definition: CaloHit.h:12
SimG4HcalHitCluster::ec
double ec
Definition: SimG4HcalHitCluster.h:31
itr
std::vector< std::pair< float, float > >::iterator itr
Definition: HGCDigitizer.cc:28
SimG4HcalHitCluster::~SimG4HcalHitCluster
virtual ~SimG4HcalHitCluster()
Definition: SimG4HcalHitCluster.cc:11
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
SimG4HcalHitCluster
Definition: SimG4HcalHitCluster.h:12
dqm-mbProfile.log
log
Definition: dqm-mbProfile.py:17
hit
Definition: SiStripHitEffFromCalibTree.cc:88
SimG4HcalHitCluster::phic
double phic
Definition: SimG4HcalHitCluster.h:31
SimG4HcalHitCluster.h