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) |
|
◆ ecalEnergyInCone() [1/2]
Definition at line 156 of file CommonUsefulStuff.h.
References edm::SortedCollection< T, SORT >::begin(), EcalBarrel, EcalEndcap, edm::SortedCollection< T, SORT >::end(), getDistInPlaneSimple(), CaloGeometry::getPosition(), EBDetId::hashedIndex(), EEDetId::hashedIndex(), mps_fire::i, and CosmicsPD_Skims::radius.
160 double eECALcone = 0;
161 std::vector<int> usedHitsEcal;
162 usedHitsEcal.clear();
164 for (std::vector<EcalRecHit>::const_iterator ehit = ecalCol.
begin(); ehit != ecalCol.
end(); ehit++) {
166 bool hitIsUsed =
false;
167 int hitHashedIndex = -10000;
176 for (uint32_t
i = 0;
i < usedHitsEcal.size();
i++) {
177 if (usedHitsEcal[
i] == hitHashedIndex)
182 usedHitsEcal.push_back(hitHashedIndex);
188 eECALcone += ehit->energy();
GlobalPoint getPosition(const DetId &id) const
Get the position of a given detector id.
const_iterator begin() const
const_iterator end() const
double getDistInPlaneSimple(const GlobalPoint caloPoint, const GlobalPoint rechitPoint)
int hashedIndex() const
get a compact index for arrays
◆ ecalEnergyInCone() [2/2]
Definition at line 195 of file CommonUsefulStuff.h.
References edm::SortedCollection< T, SORT >::begin(), EcalBarrel, EcalEndcap, edm::SortedCollection< T, SORT >::end(), getDistInPlaneTrackDir(), CaloGeometry::getPosition(), EBDetId::hashedIndex(), EEDetId::hashedIndex(), mps_fire::i, and CosmicsPD_Skims::radius.
200 double eECALcone = 0;
201 std::vector<int> usedHitsEcal;
202 usedHitsEcal.clear();
203 for (std::vector<EcalRecHit>::const_iterator ehit = ecalCol.
begin(); ehit != ecalCol.
end(); ehit++) {
205 bool hitIsUsed =
false;
206 int hitHashedIndex = -10000;
215 for (uint32_t
i = 0;
i < usedHitsEcal.size();
i++) {
216 if (usedHitsEcal[
i] == hitHashedIndex)
221 usedHitsEcal.push_back(hitHashedIndex);
227 eECALcone += ehit->energy();
double getDistInPlaneTrackDir(const GlobalPoint caloPoint, const GlobalVector caloVector, const GlobalPoint rechitPoint)
GlobalPoint getPosition(const DetId &id) const
Get the position of a given detector id.
const_iterator begin() const
const_iterator end() const
int hashedIndex() const
get a compact index for arrays
◆ getDistInPlane()
Definition at line 86 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().
110 const GlobalVector heightVector = trackDirection * coneHeight;
114 const GlobalVector caloIntersectVector(caloPoint.
x(), caloPoint.
y(), caloPoint.
z());
117 const GlobalVector coneBaseVector = heightVector + caloIntersectVector;
120 const GlobalPoint coneBasePoint(coneBaseVector.x(), coneBaseVector.y(), coneBaseVector.z());
123 const GlobalVector rechitVector(rechitPoint.
x(), rechitPoint.
y(), rechitPoint.
z());
142 double rechitdist = trackDirection.
dot(coneBaseVector) / trackDirection.
dot(rechitDirection);
147 const GlobalVector effectiveRechitVector = rechitdist * rechitDirection;
149 effectiveRechitVector.
x(), effectiveRechitVector.
y(), effectiveRechitVector.
z());
151 GlobalVector distance_vector = effectiveRechitPoint - coneBasePoint;
152 return distance_vector.
mag();
PreciseFloatType< T, U >::Type dot(const Vector3DBase< U, FrameTag > &v) const
Vector3DBase unit() const
◆ getDistInPlaneSimple()
Definition at line 33 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().
Referenced by ecalEnergyInCone().
37 const GlobalVector caloIntersectVector(caloPoint.
x(), caloPoint.
y(), caloPoint.
z());
41 const GlobalVector rechitVector(rechitPoint.
x(), rechitPoint.
y(), rechitPoint.
z());
44 double dotprod = caloIntersectUnitVector.
dot(rechitUnitVector);
45 double rechitdist = caloIntersectVector.mag() / dotprod;
47 const GlobalVector effectiveRechitVector = rechitdist * rechitUnitVector;
49 effectiveRechitVector.
x(), effectiveRechitVector.
y(), effectiveRechitVector.
z());
51 GlobalVector distance_vector = effectiveRechitPoint - caloPoint;
54 return distance_vector.
mag();
PreciseFloatType< T, U >::Type dot(const Vector3DBase< U, FrameTag > &v) const
Vector3DBase unit() const
◆ getDistInPlaneTrackDir()
Definition at line 60 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().
Referenced by ecalEnergyInCone().
66 const GlobalVector caloIntersectVector(caloPoint.
x(), caloPoint.
y(),
70 const GlobalVector rechitVector(rechitPoint.
x(), rechitPoint.
y(), rechitPoint.
z());
72 double dotprod_denominator = caloUnitVector.
dot(rechitUnitVector);
73 double dotprod_numerator = caloUnitVector.dot(caloIntersectVector);
74 double rechitdist = dotprod_numerator / dotprod_denominator;
75 const GlobalVector effectiveRechitVector = rechitdist * rechitUnitVector;
77 effectiveRechitVector.
x(), effectiveRechitVector.
y(), effectiveRechitVector.
z());
78 GlobalVector distance_vector = effectiveRechitPoint - caloPoint;
79 if (dotprod_denominator > 0. && dotprod_numerator > 0.) {
80 return distance_vector.
mag();
PreciseFloatType< T, U >::Type dot(const Vector3DBase< U, FrameTag > &v) const
Vector3DBase unit() const