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;
23 const GlobalPoint effectiveRechitPoint(effectiveRechitVector.
x(),
24 effectiveRechitVector.
y(),
25 effectiveRechitVector.
z());
26 GlobalVector distance_vector = effectiveRechitPoint-caloPoint;
27 if (dotprod_denominator > 0. && dotprod_numerator > 0.) {
28 return distance_vector.
mag();
38 if (fabs(eta1)<1.479) Rec=129;
40 double ce1=cosh(eta1);
41 double ce2=cosh(eta2);
42 double te1=tanh(eta1);
43 double te2=tanh(eta2);
45 double z=
cos(phi1-phi2)/ce1/ce2+te1*te2;
46 if(z!=0) dR=fabs(Rec*ce1*
sqrt(1./z/z-1.));
59 if (fabs(eta1)<1.392) Rec=177.5;
61 double ce1=cosh(eta1);
62 double ce2=cosh(eta2);
63 double te1=tanh(eta1);
64 double te2=tanh(eta2);
66 double z=
cos(phi1-phi2)/ce1/ce2+te1*te2;
67 if(z!=0) dR=fabs(Rec*ce1*
sqrt(1./z/z-1.));
74 RH_ieta.push_back(hit->id().ieta());
75 RH_iphi.push_back(hit->id().iphi());
76 RH_ene.push_back(hit->energy());
79 void getEtaPhi(edm::PCaloHitContainer::const_iterator
hit, std::vector<int>& RH_ieta, std::vector<int>& RH_iphi, std::vector<double>& RH_ene) {
81 RH_ieta.push_back(-9);
82 RH_iphi.push_back(-9);
83 RH_ene.push_back(-9.);
88 RH_ieta.push_back(-9);
89 RH_iphi.push_back(-9);
90 RH_ene.push_back(-9.);
94 ieta = hit->id().ieta();
95 iphi = hit->id().iphi();
98 void getEtaPhi(edm::PCaloHitContainer::const_iterator hit,
int& ieta,
int& iphi){
113 DetId id = hit->id();
124 return hit->energy();
128 return hit->energy();
131 double getEnergy(edm::PCaloHitContainer::const_iterator hit) {
133 double samplingWeight = 1.;
138 samplingWeight = 114.1;
140 samplingWeight = 167.3;
146 return samplingWeight*hit->energy();
150 DetId detId(hit->id());
155 DetId detId(hit->id());
double getDistInPlaneTrackDir(const GlobalPoint &caloPoint, const GlobalVector &caloVector, const GlobalPoint &rechitPoint)
double getEnergy(HBHERecHitCollection::const_iterator hit)
std::vector< T >::const_iterator const_iterator
PreciseFloatType< T, U >::Type dot(const Vector3DBase< U, FrameTag > &v) const
double getDistInCMatHcal(double eta1, double phi1, double eta2, double phi2)
Cos< T >::type cos(const T &t)
const GlobalPoint & getPosition(const DetId &id) const
Get the position of a given detector id.
GlobalPoint getGpos(const CaloGeometry *geo, HBHERecHitCollection::const_iterator hit)
Vector3DBase unit() const
double getDistInCMatEcal(double eta1, double phi1, double eta2, double phi2)
void getEtaPhi(HBHERecHitCollection::const_iterator hit, std::vector< int > &RH_ieta, std::vector< int > &RH_iphi, std::vector< double > &RH_ene)