13 const GlobalVector caloIntersectVector(caloPoint.
x(), caloPoint.
y(),
17 const GlobalVector rechitVector(rechitPoint.
x(), rechitPoint.
y(), rechitPoint.
z());
19 double dotprod_denominator = caloUnitVector.
dot(rechitUnitVector);
20 double dotprod_numerator = caloUnitVector.dot(caloIntersectVector);
21 double rechitdist = dotprod_numerator / dotprod_denominator;
22 const GlobalVector effectiveRechitVector = rechitdist * rechitUnitVector;
24 effectiveRechitVector.
x(), effectiveRechitVector.
y(), effectiveRechitVector.
z());
25 GlobalVector distance_vector = effectiveRechitPoint - caloPoint;
27 edm::LogVerbatim(
"IsoTrack") <<
"getDistInPlaneTrackDir: point " << caloPoint <<
" dirn " << caloVector
28 <<
" numerator " << dotprod_numerator <<
" denominator " << dotprod_denominator
29 <<
" distance " << distance_vector.
mag();
31 if (dotprod_denominator > 0. && dotprod_numerator > 0.) {
32 return distance_vector.mag();
45 double ce1 = cosh(eta1);
46 double ce2 = cosh(eta2);
47 double te1 = tanh(eta1);
48 double te2 = tanh(eta2);
50 double z =
cos(phi1 - phi2) / ce1 / ce2 + te1 * te2;
52 dR = fabs(Rec * ce1 *
sqrt(1. / z / z - 1.));
56 edm::LogVerbatim(
"IsoTrack") <<
"getDistInCMatEcal: between (" << eta1 <<
", " << phi1 <<
") and (" << eta2
57 <<
", " << phi2 <<
" is " << dR;
71 double ce1 = cosh(eta1);
72 double ce2 = cosh(eta2);
73 double te1 = tanh(eta1);
74 double te2 = tanh(eta2);
76 double z =
cos(phi1 - phi2) / ce1 / ce2 + te1 * te2;
78 dR = fabs(Rec * ce1 *
sqrt(1. / z / z - 1.));
83 edm::LogVerbatim(
"IsoTrack") <<
"getDistInCMatHcal: between (" << eta1 <<
", " << phi1 <<
") and (" << eta2
84 <<
", " << phi2 <<
" is " << dR;
88 std::vector<int>& RH_ieta,
89 std::vector<int>& RH_iphi,
90 std::vector<double>& RH_ene,
92 RH_ieta.push_back(hit->id().ieta());
93 RH_iphi.push_back(hit->id().iphi());
94 RH_ene.push_back(hit->energy());
98 std::vector<int>& RH_ieta,
99 std::vector<int>& RH_iphi,
100 std::vector<double>& RH_ene,
103 RH_ieta.push_back(-9);
104 RH_iphi.push_back(-9);
105 RH_ene.push_back(-9.);
109 std::vector<int>& RH_ieta,
110 std::vector<int>& RH_iphi,
111 std::vector<double>& RH_ene,
114 RH_ieta.push_back(-9);
115 RH_iphi.push_back(-9);
116 RH_ene.push_back(-9.);
120 ieta = hit->id().ieta();
121 iphi = hit->id().iphi();
124 void getEtaPhi(edm::PCaloHitContainer::const_iterator hit,
int& ieta,
int& iphi,
bool) {
139 DetId id = hit->id();
150 double energy = ((useRaw == 1) ? hit->eraw() : ((useRaw == 2) ? hit->eaux() : hit->energy()));
156 double getEnergy(edm::PCaloHitContainer::const_iterator hit,
int,
bool) {
158 double samplingWeight = 1.;
161 DetId id = hit->id();
165 samplingWeight = 114.1;
167 samplingWeight = 167.3;
174 return samplingWeight * hit->energy();
178 DetId detId(hit->id());
183 DetId detId(hit->id());
202 double energy = ((useRaw == 1) ? hit->eraw() : ((useRaw == 2) ? hit->eaux() : hit->energy()));
208 double getRawEnergy(edm::PCaloHitContainer::const_iterator hit,
int) {
return hit->energy(); }
Log< level::Info, true > LogVerbatim
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
static const double etaBEEcal
double getDistInCMatHcal(double eta1, double phi1, double eta2, double phi2, bool debug=false)
double getDistInPlaneTrackDir(const GlobalPoint &caloPoint, const GlobalVector &caloVector, const GlobalPoint &rechitPoint, bool debug=false)
static const double etaBEHcal
double getEnergy(HBHERecHitCollection::const_iterator hit, int useRaw=0, bool debug=false)
static const double zFrontHE
std::vector< T >::const_iterator const_iterator
PreciseFloatType< T, U >::Type dot(const Vector3DBase< U, FrameTag > &v) const
static const double rFrontHB
constexpr HcalSubdetector subdet() const
get the subdetector
static const double zFrontEE
double getDistInCMatEcal(double eta1, double phi1, double eta2, double phi2, bool debug=false)
static const double rFrontEB
Cos< T >::type cos(const T &t)
GlobalPoint getPosition(const DetId &id) const
Get the position of a given detector id.
double getRawEnergy(HBHERecHitCollection::const_iterator hit, int useRaw=0)
Vector3DBase unit() const
void getEtaPhi(HBHERecHitCollection::const_iterator hit, std::vector< int > &RH_ieta, std::vector< int > &RH_iphi, std::vector< double > &RH_ene, bool debug=false)
GlobalPoint getGpos(const CaloGeometry *geo, HBHERecHitCollection::const_iterator hit, bool debug=false)
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point