22 static const double depth;
23 static const double R_BARREL;
24 static const double R_BARREL2;
25 static const double Z_ENDCAP;
26 static const double R_FORWARD;
27 static const double R_FORWARD2;
28 static const double Z_FORWARD;
29 static const double Z_BIG;
34 const double CaloPoint::R_BARREL = (1. -
depth) * 143. +
depth * 407.;
35 const double CaloPoint::R_BARREL2 = R_BARREL * R_BARREL;
36 const double CaloPoint::Z_ENDCAP = (1. -
depth) * 320. +
depth * 568.;
37 const double CaloPoint::R_FORWARD = Z_ENDCAP /
std::sqrt(std::cosh(3.) * std::cosh(3.) - 1.);
38 const double CaloPoint::R_FORWARD2 = R_FORWARD * R_FORWARD;
39 const double CaloPoint::Z_FORWARD = 1100. +
depth * 165.;
40 const double CaloPoint::Z_BIG = 1.e5;
45 CaloPointZ(
double fZ,
double fEta) {
46 static const double ETA_MAX = 5.2;
53 double tanThetaAbs =
std::sqrt(std::cosh(fEta) * std::cosh(fEta) - 1.);
54 double tanTheta = fEta >= 0 ? tanThetaAbs : -tanThetaAbs;
56 double rEndcap = tanTheta == 0 ? 1.e10 : fEta > 0 ? (Z_ENDCAP - fZ) / tanTheta : (-Z_ENDCAP - fZ) / tanTheta;
57 if (rEndcap > R_BARREL) {
59 mZ = fZ + R_BARREL * tanTheta;
62 if (rEndcap > R_FORWARD)
64 else if (std::fabs(fEta) < ETA_MAX)
67 mZ = fEta > 0 ? zRef : -zRef;
68 mR = std::fabs((mZ - fZ) / tanTheta);
71 double etaReference(
double fZ) {
76 double thetaReference(
double fZ) {
81 double z()
const {
return mZ; }
82 double r()
const {
return mR; }
92 template <
typename Po
int>
95 template <
typename Vector,
typename Po
int2>
100 int side =
dir.z() < -1
e-9 ? -1 :
dir.z() > 1
e-9 ? +1 : 0;
102 double dirR =
dir.Rho();
105 double dirUnit[2] = {
dir.x() / dirR,
dir.y() / dirR};
110 double vtxLong = dirUnit[0] *
vertex.x() + dirUnit[1] *
vertex.y();
113 double tIP = dirUnit[0] *
vertex.y() - dirUnit[1] *
vertex.x();
125 if (
r2 < R_FORWARD2) {
128 z = side * Z_FORWARD;
129 }
else if (
r2 < R_BARREL2) {
146 point =
Point(dirUnit[0] *
r - dirUnit[1] * tIP, dirUnit[1] *
r + dirUnit[0] * tIP, z);
149 const Point &caloPoint()
const {
return point; }
152 template <
typename T>
164 for (
unsigned i = 0;
i < fConstituents.size();
i++) {
175 double phiRef =
phi();
181 double sumEtaPhi = 0;
194 Jet::EtaPhiMoments
result;
196 result.etaMean = sumEta / sumw;
198 result.etaEtaMoment = (sumEta2 - sumEta * sumEta / sumw) / sumw;
199 result.phiPhiMoment = (sumPhi2 - sumPhi * sumPhi / sumw) / sumw;
200 result.etaPhiMoment = (sumEtaPhi - sumEta * sumPhi / sumw) / sumw;
225 return sumw > 0 ? (
sum2 - sum * sum / sumw) / sumw : 0;
230 double phiRef =
phi();
243 return sumw > 0 ? (
sum2 - sum * sum / sumw) / sumw : 0;
248 double phiRef =
phi();
256 double valueA =
towers[
i]->eta();
262 sumAB += valueA * valueB *
weight;
264 return sumw > 0 ? (sumAB - sumA * sumB / sumw) / sumw : 0;
274 if (
r >= fRmin &&
r < fRmax)
286 for (
unsigned i = 0;
i <
towers.size(); ++
i)
288 double fractionEnergy = totalEt * fFraction;
292 if (fractionEnergy <= 0)
302 for (
unsigned i = 0;
i <
towers.size(); ++
i) {
313 CaloPointZ refPoint(0., fDetectorEta);
314 return refPoint.etaReference(fZVertex);
320 CaloPointZ refPoint(fZVertex, fPhysicsEta);
321 return refPoint.etaReference(0.);
327 CaloPoint3D<Point> caloPoint(oldVertex, inParticle.
momentum());
328 Vector physicsDir = caloPoint.caloPoint() - newVertex;
337 static const Point np(0, 0, 0);
338 Vector detectorDir = caloPoint.caloPoint() -
np;
354 std::vector<const Candidate *>
result;
356 for (
int i = 0;
i < nDaughters; ++
i) {
359 <<
"Bad pointer to jet constituent found. Check for possible dropped particle.";
373 for (
unsigned iConst = 0; iConst < constituents.size(); ++iConst) {
374 float pt = constituents[iConst]->p4().Pt();
382 float ptD_value = (sum_pt > 0.) ?
sqrt(sum_pt2 / (sum_pt * sum_pt)) : 0.;
392 float sum_pt2deltaR2 = 0.;
394 for (
unsigned iConst = 0; iConst < constituents.size(); ++iConst) {
397 float pt = thisConstituent.Pt();
399 double dR =
deltaR(*
this, *(constituents[iConst]));
400 float pt2deltaR2 =
pt *
pt *
dR *
dR;
403 sum_pt2deltaR2 += pt2deltaR2;
407 float rmsCand_value = (sum_pt2 > 0.) ? sum_pt2deltaR2 / sum_pt2 : 0.;
409 return rmsCand_value;
414 std::ostringstream
out;
415 out <<
"Jet p/px/py/pz/pt: " <<
p() <<
'/' <<
px() <<
'/' <<
py() <<
'/' <<
pz() <<
'/' <<
pt() << std::endl
416 <<
" eta/phi: " <<
eta() <<
'/' <<
phi() << std::endl
418 out <<
" Constituents:" << std::endl;
421 if (constituent.isNonnull()) {
422 out <<
" #" <<
index <<
" p/pt/eta/phi: " << constituent->p() <<
'/' << constituent->pt() <<
'/'
423 << constituent->eta() <<
'/' << constituent->phi() <<
" productId/index: " << constituent.id() <<
'/'
424 << constituent.key() << std::endl;
426 out <<
" #" <<
index <<
" constituent is not available in the event" << std::endl;