Go to the source code of this file.
|
double | ecalEnergyInCone (const GlobalPoint center, double radius, const EcalRecHitCollection ecalCol, const CaloGeometry *geo) |
|
double | ecalEnergyInCone (const GlobalVector trackMom, const GlobalPoint center, double radius, const EcalRecHitCollection ecalCol, const CaloGeometry *geo) |
|
double | getDistInPlane (const GlobalVector trackDirection, const GlobalPoint caloPoint, const GlobalPoint rechitPoint, double coneHeight) |
|
double | getDistInPlaneSimple (const GlobalPoint caloPoint, const GlobalPoint rechitPoint) |
|
double | getDistInPlaneTrackDir (const GlobalPoint caloPoint, const GlobalVector caloVector, const GlobalPoint rechitPoint) |
|
Definition at line 220 of file CommonUsefulStuff.h.
References edm::SortedCollection< T, SORT >::begin(), EcalBarrel, EcalEndcap, edm::SortedCollection< T, SORT >::end(), getDistInPlaneSimple(), CaloGeometry::getPosition(), EBDetId::hashedIndex(), EEDetId::hashedIndex(), i, and CosmicsPD_Skims::radius.
Referenced by HcalCorrPFCalculation::analyze(), and HcalIsoTrkAnalyzer::analyze().
222 double eECALcone = 0;
223 std::vector<int> usedHitsEcal;
224 usedHitsEcal.clear();
226 for (std::vector<EcalRecHit>::const_iterator ehit=ecalCol.
begin(); ehit!=ecalCol.
end(); ehit++)
229 bool hitIsUsed=
false;
230 int hitHashedIndex=-10000;
241 for (uint32_t
i=0;
i<usedHitsEcal.size();
i++)
243 if (usedHitsEcal[
i]==hitHashedIndex) hitIsUsed=
true;
245 if (hitIsUsed)
continue;
246 usedHitsEcal.push_back(hitHashedIndex);
253 eECALcone += ehit->energy();
int hashedIndex() const
get a compact index for arrays
const GlobalPoint & getPosition(const DetId &id) const
Get the position of a given detector id.
const_iterator end() const
double getDistInPlaneSimple(const GlobalPoint caloPoint, const GlobalPoint rechitPoint)
const_iterator begin() const
Definition at line 260 of file CommonUsefulStuff.h.
References edm::SortedCollection< T, SORT >::begin(), EcalBarrel, EcalEndcap, edm::SortedCollection< T, SORT >::end(), getDistInPlaneTrackDir(), CaloGeometry::getPosition(), EBDetId::hashedIndex(), EEDetId::hashedIndex(), i, and CosmicsPD_Skims::radius.
263 double eECALcone = 0;
264 std::vector<int> usedHitsEcal;
265 usedHitsEcal.clear();
266 for (std::vector<EcalRecHit>::const_iterator ehit=ecalCol.
begin(); ehit!=ecalCol.
end(); ehit++)
269 bool hitIsUsed=
false;
270 int hitHashedIndex=-10000;
281 for (uint32_t
i=0;
i<usedHitsEcal.size();
i++)
283 if (usedHitsEcal[
i]==hitHashedIndex) hitIsUsed=
true;
285 if (hitIsUsed)
continue;
286 usedHitsEcal.push_back(hitHashedIndex);
293 eECALcone += ehit->energy();
int hashedIndex() const
get a compact index for arrays
double getDistInPlaneTrackDir(const GlobalPoint caloPoint, const GlobalVector caloVector, const GlobalPoint rechitPoint)
const GlobalPoint & getPosition(const DetId &id) const
Get the position of a given detector id.
const_iterator end() const
const_iterator begin() const
Definition at line 138 of file CommonUsefulStuff.h.
References Vector3DBase< T, FrameTag >::dot(), PV3DBase< T, PVType, FrameType >::mag(), Vector3DBase< T, FrameTag >::unit(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().
165 const GlobalVector heightVector = trackDirection*coneHeight;
174 const GlobalVector coneBaseVector = heightVector+caloIntersectVector;
177 const GlobalPoint coneBasePoint(coneBaseVector.x(),
203 double rechitdist = trackDirection.
dot(coneBaseVector)/trackDirection.
dot(rechitDirection);
208 const GlobalVector effectiveRechitVector = rechitdist*rechitDirection;
209 const GlobalPoint effectiveRechitPoint(effectiveRechitVector.
x(),
210 effectiveRechitVector.
y(),
211 effectiveRechitVector.
z());
214 GlobalVector distance_vector = effectiveRechitPoint-coneBasePoint;
215 return distance_vector.
mag();
PreciseFloatType< T, U >::Type dot(const Vector3DBase< U, FrameTag > &v) const
Vector3DBase unit() const
Definition at line 58 of file CommonUsefulStuff.h.
References Vector3DBase< T, FrameTag >::dot(), PV3DBase< T, PVType, FrameType >::mag(), Vector3DBase< T, FrameTag >::unit(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().
76 double dotprod = caloIntersectUnitVector.
dot(rechitUnitVector);
77 double rechitdist = caloIntersectVector.mag()/dotprod;
80 const GlobalVector effectiveRechitVector = rechitdist*rechitUnitVector;
81 const GlobalPoint effectiveRechitPoint(effectiveRechitVector.
x(),
82 effectiveRechitVector.
y(),
83 effectiveRechitVector.
z());
86 GlobalVector distance_vector = effectiveRechitPoint-caloPoint;
90 return distance_vector.
mag();
PreciseFloatType< T, U >::Type dot(const Vector3DBase< U, FrameTag > &v) const
Vector3DBase unit() const
Definition at line 100 of file CommonUsefulStuff.h.
References Vector3DBase< T, FrameTag >::dot(), PV3DBase< T, PVType, FrameType >::mag(), Vector3DBase< T, FrameTag >::unit(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().
117 double dotprod_denominator = caloUnitVector.
dot(rechitUnitVector);
118 double dotprod_numerator = caloUnitVector.dot(caloIntersectVector);
119 double rechitdist = dotprod_numerator/dotprod_denominator;
120 const GlobalVector effectiveRechitVector = rechitdist*rechitUnitVector;
121 const GlobalPoint effectiveRechitPoint(effectiveRechitVector.
x(),
122 effectiveRechitVector.
y(),
123 effectiveRechitVector.
z());
124 GlobalVector distance_vector = effectiveRechitPoint-caloPoint;
125 if (dotprod_denominator > 0. && dotprod_numerator > 0.)
128 return distance_vector.
mag();
PreciseFloatType< T, U >::Type dot(const Vector3DBase< U, FrameTag > &v) const
Vector3DBase unit() const