65 std::vector<EBDetId>::const_iterator myIt;
66 for (myIt = passedDetIds.begin(); myIt != passedDetIds.end(); myIt++) {
69 thisEne = itt->energy();
76 edm::LogError(
"NegativeClusterEnergy") <<
"cluster with negative energy: " << eTot <<
", setting depth to 0.";
89 double total_weight = 0;
90 double cluster_theta = 0;
91 double cluster_phi = 0;
92 std::vector<EBDetId>::const_iterator myIt2;
93 for (myIt2 = passedDetIds.begin(); myIt2 != passedDetIds.end(); myIt2++) {
98 double ener = itj->energy();
101 if(eTot<=0.) { weight = 0.; }
111 cluster_theta += weight*jth_pos.
theta();
112 cluster_phi += weight*jth_pos.
phi();
116 cluster_theta /= total_weight;
117 cluster_phi /= total_weight;
118 if (cluster_phi >
M_PI) { cluster_phi -= 2.*
M_PI; }
119 if (cluster_phi < -
M_PI){ cluster_phi += 2.*
M_PI; }
122 double radius =
sqrt(center_pos.
x()*center_pos.
x() + center_pos.
y()*center_pos.
y() + center_pos.
z()*center_pos.
z());
123 double xpos = radius*
cos(cluster_phi)*
sin(cluster_theta);
124 double ypos = radius*
sin(cluster_phi)*
sin(cluster_theta);
125 double zpos = radius*
cos(cluster_theta);
127 return CLHEP::Hep3Vector(xpos, ypos, zpos);
Sin< T >::type sin(const T &t)
Geom::Phi< T > phi() const
std::vector< EcalRecHit >::const_iterator const_iterator
CaloGeometry const * getGeometry()
virtual const CaloCellGeometry * getGeometry(const DetId &id) const
Get the cell geometry of a given detector id. Should return false if not found.
Geom::Theta< T > theta() const
const T & max(const T &a, const T &b)
const CaloSubdetectorGeometry * theGeometry_
Cos< T >::type cos(const T &t)
A base class to handle the particular shape of Ecal Xtals. Taken from ORCA Calorimetry Code...
static const int SMCRYSTALMODE