Definition at line 59 of file TBPositionCalc.cc.
66 std::vector<EBDetId>::const_iterator myIt;
67 for (myIt = passedDetIds.begin(); myIt != passedDetIds.end(); myIt++) {
70 thisEne = itt->energy();
77 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++) {
97 double ener = itj->energy();
118 cluster_theta /= total_weight;
119 cluster_phi /= total_weight;
120 if (cluster_phi >
M_PI) {
121 cluster_phi -= 2. *
M_PI;
123 if (cluster_phi < -
M_PI) {
124 cluster_phi += 2. *
M_PI;
129 sqrt(center_pos.
x() * center_pos.
x() + center_pos.
y() * center_pos.
y() + center_pos.
z() * center_pos.
z());
130 double xpos =
radius *
cos(cluster_phi) *
sin(cluster_theta);
131 double ypos =
radius *
sin(cluster_phi) *
sin(cluster_theta);
132 double zpos =
radius *
cos(cluster_theta);
134 return CLHEP::Hep3Vector(xpos, ypos, zpos);
References funct::cos(), LEDCalibrationChannels::depth, edm::SortedCollection< T, SORT >::find(), dqm-mbProfile::log, M_PI, SiStripPI::max, PV3DBase< T, PVType, FrameType >::phi(), CosmicsPD_Skims::radius, funct::sin(), EBDetId::SMCRYSTALMODE, mathSSE::sqrt(), PV3DBase< T, PVType, FrameType >::theta(), mps_merge::weight, PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().