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;
28 std::cout <<
"getDistInPlaneTrackDir: point " << caloPoint <<
" dirn "
29 << caloVector <<
" numerator " << dotprod_numerator
30 <<
" denominator " << dotprod_denominator <<
" distance "
31 << distance_vector.
mag() << std::endl;
33 if (dotprod_denominator > 0. && dotprod_numerator > 0.) {
34 return distance_vector.mag();
45 if (fabs(eta1)<1.479) Rec=129;
47 double ce1=cosh(eta1);
48 double ce2=cosh(eta2);
49 double te1=tanh(eta1);
50 double te2=tanh(eta2);
52 double z=
cos(phi1-phi2)/ce1/ce2+te1*te2;
53 if(z!=0) dR=fabs(Rec*ce1*
sqrt(1./z/z-1.));
55 if (debug)
std::cout <<
"getDistInCMatEcal: between (" << eta1 <<
", "
56 << phi1 <<
") and (" << eta2 <<
", " << phi2 <<
" is "
70 if (fabs(eta1)<1.392) Rec=177.5;
72 double ce1=cosh(eta1);
73 double ce2=cosh(eta2);
74 double te1=tanh(eta1);
75 double te2=tanh(eta2);
77 double z=
cos(phi1-phi2)/ce1/ce2+te1*te2;
78 if(z!=0) dR=fabs(Rec*ce1*
sqrt(1./z/z-1.));
81 if (debug)
std::cout <<
"getDistInCMatHcal: between (" << eta1 <<
", "
82 << phi1 <<
") and (" << eta2 <<
", " << phi2 <<
" is "
88 RH_ieta.push_back(hit->id().ieta());
89 RH_iphi.push_back(hit->id().iphi());
90 RH_ene.push_back(hit->energy());
93 void getEtaPhi(edm::PCaloHitContainer::const_iterator
hit, std::vector<int>& RH_ieta, std::vector<int>& RH_iphi, std::vector<double>& RH_ene,
bool) {
95 RH_ieta.push_back(-9);
96 RH_iphi.push_back(-9);
97 RH_ene.push_back(-9.);
102 RH_ieta.push_back(-9);
103 RH_iphi.push_back(-9);
104 RH_ene.push_back(-9.);
109 ieta = hit->id().ieta();
110 iphi = hit->id().iphi();
113 void getEtaPhi(edm::PCaloHitContainer::const_iterator hit,
int& ieta,
int& iphi,
130 DetId id = hit->id();
141 return hit->energy();
145 return hit->energy();
148 double getEnergy(edm::PCaloHitContainer::const_iterator hit,
bool) {
150 double samplingWeight = 1.;
155 samplingWeight = 114.1;
157 samplingWeight = 167.3;
163 return samplingWeight*hit->energy();
167 DetId detId(hit->id());
172 DetId detId(hit->id());
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)
std::vector< T >::const_iterator const_iterator
PreciseFloatType< T, U >::Type dot(const Vector3DBase< U, FrameTag > &v) const
double getDistInCMatEcal(double eta1, double phi1, double eta2, double phi2, bool debug=false)
double getEnergy(HBHERecHitCollection::const_iterator hit, bool debug=false)
Cos< T >::type cos(const T &t)
const GlobalPoint & getPosition(const DetId &id) const
Get the position of a given detector id.
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)