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 221 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, pos, and CosmicsPD_Skims::radius.
Referenced by HcalCorrPFCalculation::analyze(), and HcalIsoTrkAnalyzer::analyze().
223 double eECALcone = 0;
224 std::vector<int> usedHitsEcal;
225 usedHitsEcal.clear();
227 for (std::vector<EcalRecHit>::const_iterator ehit=ecalCol.
begin(); ehit!=ecalCol.
end(); ehit++)
230 bool hitIsUsed=
false;
231 int hitHashedIndex=-10000;
242 for (uint32_t
i=0;
i<usedHitsEcal.size();
i++)
244 if (usedHitsEcal[
i]==hitHashedIndex) hitIsUsed=
true;
246 if (hitIsUsed)
continue;
247 usedHitsEcal.push_back(hitHashedIndex);
254 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 261 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, pos, and CosmicsPD_Skims::radius.
264 double eECALcone = 0;
265 std::vector<int> usedHitsEcal;
266 usedHitsEcal.clear();
267 for (std::vector<EcalRecHit>::const_iterator ehit=ecalCol.
begin(); ehit!=ecalCol.
end(); ehit++)
270 bool hitIsUsed=
false;
271 int hitHashedIndex=-10000;
282 for (uint32_t
i=0;
i<usedHitsEcal.size();
i++)
284 if (usedHitsEcal[
i]==hitHashedIndex) hitIsUsed=
true;
286 if (hitIsUsed)
continue;
287 usedHitsEcal.push_back(hitHashedIndex);
294 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 139 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().
166 const GlobalVector heightVector = trackDirection*coneHeight;
175 const GlobalVector coneBaseVector = heightVector+caloIntersectVector;
178 const GlobalPoint coneBasePoint(coneBaseVector.x(),
204 double rechitdist = trackDirection.
dot(coneBaseVector)/trackDirection.
dot(rechitDirection);
209 const GlobalVector effectiveRechitVector = rechitdist*rechitDirection;
210 const GlobalPoint effectiveRechitPoint(effectiveRechitVector.
x(),
211 effectiveRechitVector.
y(),
212 effectiveRechitVector.
z());
215 GlobalVector distance_vector = effectiveRechitPoint-coneBasePoint;
216 return distance_vector.
mag();
PreciseFloatType< T, U >::Type dot(const Vector3DBase< U, FrameTag > &v) const
Vector3DBase unit() const
Definition at line 59 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().
77 double dotprod = caloIntersectUnitVector.
dot(rechitUnitVector);
78 double rechitdist = caloIntersectVector.mag()/dotprod;
81 const GlobalVector effectiveRechitVector = rechitdist*rechitUnitVector;
82 const GlobalPoint effectiveRechitPoint(effectiveRechitVector.
x(),
83 effectiveRechitVector.
y(),
84 effectiveRechitVector.
z());
87 GlobalVector distance_vector = effectiveRechitPoint-caloPoint;
91 return distance_vector.
mag();
PreciseFloatType< T, U >::Type dot(const Vector3DBase< U, FrameTag > &v) const
Vector3DBase unit() const
Definition at line 101 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().
118 double dotprod_denominator = caloUnitVector.
dot(rechitUnitVector);
119 double dotprod_numerator = caloUnitVector.dot(caloIntersectVector);
120 double rechitdist = dotprod_numerator/dotprod_denominator;
121 const GlobalVector effectiveRechitVector = rechitdist*rechitUnitVector;
122 const GlobalPoint effectiveRechitPoint(effectiveRechitVector.
x(),
123 effectiveRechitVector.
y(),
124 effectiveRechitVector.
z());
125 GlobalVector distance_vector = effectiveRechitPoint-caloPoint;
126 if (dotprod_denominator > 0. && dotprod_numerator > 0.)
129 return distance_vector.
mag();
PreciseFloatType< T, U >::Type dot(const Vector3DBase< U, FrameTag > &v) const
Vector3DBase unit() const