20 double dotprod_denominator = caloUnitVector.
dot(rechitUnitVector);
21 double dotprod_numerator = caloUnitVector.dot(caloIntersectVector);
22 double rechitdist = dotprod_numerator/dotprod_denominator;
23 const GlobalVector effectiveRechitVector = rechitdist*rechitUnitVector;
24 const GlobalPoint effectiveRechitPoint(effectiveRechitVector.
x(),
25 effectiveRechitVector.
y(),
26 effectiveRechitVector.
z());
27 GlobalVector distance_vector = effectiveRechitPoint-caloPoint;
29 std::cout <<
"getDistInPlaneTrackDir: point " << caloPoint <<
" dirn " 30 << caloVector <<
" numerator " << dotprod_numerator
31 <<
" denominator " << dotprod_denominator <<
" distance " 32 << distance_vector.
mag() << std::endl;
34 if (dotprod_denominator > 0. && dotprod_numerator > 0.) {
35 return distance_vector.mag();
48 double ce1=cosh(eta1);
49 double ce2=cosh(eta2);
50 double te1=tanh(eta1);
51 double te2=tanh(eta2);
53 double z=
cos(phi1-phi2)/ce1/ce2+te1*te2;
54 if(z!=0) dR=fabs(Rec*ce1*
sqrt(1./z/z-1.));
56 if (debug)
std::cout <<
"getDistInCMatEcal: between (" << eta1 <<
", " 57 << phi1 <<
") and (" << eta2 <<
", " << phi2 <<
" is " 73 double ce1=cosh(eta1);
74 double ce2=cosh(eta2);
75 double te1=tanh(eta1);
76 double te2=tanh(eta2);
78 double z=
cos(phi1-phi2)/ce1/ce2+te1*te2;
79 if(z!=0) dR=fabs(Rec*ce1*
sqrt(1./z/z-1.));
82 if (debug)
std::cout <<
"getDistInCMatHcal: between (" << eta1 <<
", " 83 << phi1 <<
") and (" << eta2 <<
", " << phi2 <<
" is " 89 RH_ieta.push_back(hit->id().ieta());
90 RH_iphi.push_back(hit->id().iphi());
91 RH_ene.push_back(hit->energy());
94 void getEtaPhi(edm::PCaloHitContainer::const_iterator
hit, std::vector<int>& RH_ieta, std::vector<int>& RH_iphi, std::vector<double>& RH_ene,
bool) {
96 RH_ieta.push_back(-9);
97 RH_iphi.push_back(-9);
98 RH_ene.push_back(-9.);
103 RH_ieta.push_back(-9);
104 RH_iphi.push_back(-9);
105 RH_ene.push_back(-9.);
110 ieta = hit->id().ieta();
111 iphi = hit->id().iphi();
114 void getEtaPhi(edm::PCaloHitContainer::const_iterator hit,
int& ieta,
int& iphi,
131 DetId id = hit->id();
142 double energy = (useRaw) ? hit->eraw() : hit->energy();
147 return hit->energy();
150 double getEnergy(edm::PCaloHitContainer::const_iterator hit,
bool,
bool) {
152 double samplingWeight = 1.;
155 DetId id = hit->id();
159 samplingWeight = 114.1;
161 samplingWeight = 167.3;
168 return samplingWeight*hit->energy();
172 DetId detId(hit->id());
177 DetId detId(hit->id());
193 double energy = (useRaw) ? hit->eraw() : hit->energy();
198 return hit->energy();
201 double getRawEnergy(edm::PCaloHitContainer::const_iterator hit,
bool) {
202 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)