28 double dotprod_denominator = caloUnitVector.
dot(rechitUnitVector);
29 double dotprod_numerator = caloUnitVector.dot(caloIntersectVector);
30 double rechitdist = dotprod_numerator/dotprod_denominator;
31 const GlobalVector effectiveRechitVector = rechitdist*rechitUnitVector;
32 const GlobalPoint effectiveRechitPoint(effectiveRechitVector.
x(),
33 effectiveRechitVector.
y(),
34 effectiveRechitVector.
z());
35 GlobalVector distance_vector = effectiveRechitPoint-caloPoint;
38 std::cout <<
"getDistInPlaneTrackDir: point " << caloPoint <<
" dirn " 39 << caloVector <<
" numerator " << dotprod_numerator
40 <<
" denominator " << dotprod_denominator <<
" distance " 41 << distance_vector.
mag() << std::endl;
44 if (dotprod_denominator > 0. && dotprod_numerator > 0.) {
45 return distance_vector.mag();
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.));
70 if (
debug)
std::cout <<
"getDistInCMatEcal: between (" << eta1 <<
", " 71 << phi1 <<
") and (" << eta2 <<
", " << phi2 <<
" is " 91 double ce1=cosh(eta1);
92 double ce2=cosh(eta2);
93 double te1=tanh(eta1);
94 double te2=tanh(eta2);
96 double z=
cos(phi1-phi2)/ce1/ce2+te1*te2;
97 if(z!=0) dR=fabs(Rec*ce1*
sqrt(1./z/z-1.));
101 if (
debug)
std::cout <<
"getDistInCMatHcal: between (" << eta1 <<
", " 102 << phi1 <<
") and (" << eta2 <<
", " << phi2 <<
" is " 109 RH_ieta.push_back(hit->id().ieta());
110 RH_iphi.push_back(hit->id().iphi());
111 RH_ene.push_back(hit->energy());
114 void getEtaPhi(edm::PCaloHitContainer::const_iterator
hit, std::vector<int>& RH_ieta, std::vector<int>& RH_iphi, std::vector<double>& RH_ene,
bool) {
116 RH_ieta.push_back(-9);
117 RH_iphi.push_back(-9);
118 RH_ene.push_back(-9.);
123 RH_ieta.push_back(-9);
124 RH_iphi.push_back(-9);
125 RH_ene.push_back(-9.);
130 ieta = hit->id().ieta();
131 iphi = hit->id().iphi();
134 void getEtaPhi(edm::PCaloHitContainer::const_iterator hit,
int& ieta,
int& iphi,
151 DetId id = hit->id();
162 double energy = (useRaw) ? hit->eraw() : hit->energy();
167 return hit->energy();
170 double getEnergy(edm::PCaloHitContainer::const_iterator hit,
bool,
bool) {
172 double samplingWeight = 1.;
175 DetId id = hit->id();
179 samplingWeight = 114.1;
181 samplingWeight = 167.3;
188 return samplingWeight*hit->energy();
192 DetId detId(hit->id());
197 DetId detId(hit->id());
213 double energy = (useRaw) ? hit->eraw() : hit->energy();
218 return hit->energy();
221 double getRawEnergy(edm::PCaloHitContainer::const_iterator hit,
bool) {
222 return hit->energy();
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)
HcalSubdetector subdet() const
get the subdetector
static const double etaBEHcal
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
double getEnergy(HBHERecHitCollection::const_iterator hit, bool useRaw=false, bool debug=false)
double getRawEnergy(HBHERecHitCollection::const_iterator hit, bool useRaw=false)
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)
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)