29 double dotprod_denominator = caloUnitVector.
dot(rechitUnitVector);
30 double dotprod_numerator = caloUnitVector.dot(caloIntersectVector);
31 double rechitdist = dotprod_numerator/dotprod_denominator;
32 const GlobalVector effectiveRechitVector = rechitdist*rechitUnitVector;
33 const GlobalPoint effectiveRechitPoint(effectiveRechitVector.
x(),
34 effectiveRechitVector.
y(),
35 effectiveRechitVector.
z());
36 GlobalVector distance_vector = effectiveRechitPoint-caloPoint;
39 std::cout <<
"getDistInPlaneTrackDir: point " << caloPoint <<
" dirn " 40 << caloVector <<
" numerator " << dotprod_numerator
41 <<
" denominator " << dotprod_denominator <<
" distance " 42 << distance_vector.
mag() << std::endl;
45 if (dotprod_denominator > 0. && dotprod_numerator > 0.) {
46 return distance_vector.mag();
62 double ce1=cosh(eta1);
63 double ce2=cosh(eta2);
64 double te1=tanh(eta1);
65 double te2=tanh(eta2);
67 double z=
cos(phi1-phi2)/ce1/ce2+te1*te2;
68 if(z!=0) dR=fabs(Rec*ce1*
sqrt(1./z/z-1.));
71 if (
debug)
std::cout <<
"getDistInCMatEcal: between (" << eta1 <<
", " 72 << phi1 <<
") and (" << eta2 <<
", " << phi2 <<
" is " 92 double ce1=cosh(eta1);
93 double ce2=cosh(eta2);
94 double te1=tanh(eta1);
95 double te2=tanh(eta2);
97 double z=
cos(phi1-phi2)/ce1/ce2+te1*te2;
98 if(z!=0) dR=fabs(Rec*ce1*
sqrt(1./z/z-1.));
102 if (
debug)
std::cout <<
"getDistInCMatHcal: between (" << eta1 <<
", " 103 << phi1 <<
") and (" << eta2 <<
", " << phi2 <<
" is " 110 RH_ieta.push_back(hit->id().ieta());
111 RH_iphi.push_back(hit->id().iphi());
112 RH_ene.push_back(hit->energy());
115 void getEtaPhi(edm::PCaloHitContainer::const_iterator
hit, std::vector<int>& RH_ieta, std::vector<int>& RH_iphi, std::vector<double>& RH_ene,
bool) {
117 RH_ieta.push_back(-9);
118 RH_iphi.push_back(-9);
119 RH_ene.push_back(-9.);
124 RH_ieta.push_back(-9);
125 RH_iphi.push_back(-9);
126 RH_ene.push_back(-9.);
131 ieta = hit->id().ieta();
132 iphi = hit->id().iphi();
135 void getEtaPhi(edm::PCaloHitContainer::const_iterator hit,
int& ieta,
int& iphi,
152 DetId id = hit->id();
163 double energy = ((useRaw == 1) ? hit->eraw() :
164 ((useRaw == 2) ? hit->eaux() : hit->energy()));
169 return hit->energy();
172 double getEnergy(edm::PCaloHitContainer::const_iterator hit,
int,
bool) {
174 double samplingWeight = 1.;
177 DetId id = hit->id();
181 samplingWeight = 114.1;
183 samplingWeight = 167.3;
190 return samplingWeight*hit->energy();
194 DetId detId(hit->id());
199 DetId detId(hit->id());
217 double energy = ((useRaw == 1) ? hit->eraw() :
218 ((useRaw == 2) ? hit->eaux() : hit->energy()));
223 return hit->energy();
227 return hit->energy();
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)
HcalSubdetector subdet() const
get the subdetector
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
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