|
|
#include <CachedTrajectory.h>
|
std::pair< float, float > | delta (const double &theta1, const double &theta2, const double &phi1, const double &phi2) |
|
float | distance (const Plane *plane, int index) |
|
|
static int | sign (float number) |
|
Definition at line 44 of file CachedTrajectory.h.
◆ TrajectorType
◆ WideTrajectoryType
◆ CachedTrajectory()
CachedTrajectory::CachedTrajectory |
( |
| ) |
|
|
private |
◆ delta()
std::pair< float, float > CachedTrajectory::delta |
( |
const double & |
theta1, |
|
|
const double & |
theta2, |
|
|
const double & |
phi1, |
|
|
const double & |
phi2 |
|
) |
| |
|
protected |
◆ distance()
float CachedTrajectory::distance |
( |
const Plane * |
plane, |
|
|
int |
index |
|
) |
| |
|
inlineprotected |
◆ findEcalTrajectory()
void CachedTrajectory::findEcalTrajectory |
( |
const FiducialVolume & |
volume | ) |
|
|
private |
◆ findHcalTrajectory()
void CachedTrajectory::findHcalTrajectory |
( |
const FiducialVolume & |
volume | ) |
|
|
private |
◆ findHOTrajectory()
void CachedTrajectory::findHOTrajectory |
( |
const FiducialVolume & |
volume | ) |
|
|
private |
◆ findPreshowerTrajectory()
void CachedTrajectory::findPreshowerTrajectory |
( |
const FiducialVolume & |
volume | ) |
|
|
private |
◆ getEcalTrajectory()
◆ getHcalTrajectory()
◆ getHOTrajectory()
◆ getInnerState()
◆ getOuterState()
◆ getPreshowerTrajectory()
◆ getPropagationStep()
float CachedTrajectory::getPropagationStep |
( |
| ) |
const |
|
inlineprivate |
◆ getStateAtEcal()
◆ getStateAtHcal()
◆ getStateAtHO()
◆ getStateAtPreshower()
◆ getTrajectory()
get a set of points representing the trajectory between two cylinders of radius R1 and R2 and length L1 and L2. Parameter steps defines maximal number of steps in the detector.
Definition at line 334 of file CachedTrajectory.cc.
338 throw cms::Exception(
"FatalError") <<
"trajectory is not defined yet. Please use propagateAll first.";
340 LogTrace(
"TrackAssociator") <<
"Trajectory is empty. Move on";
344 LogTrace(
"TrackAssociator") <<
"no trajectory is expected to be found since the fiducial volume is not valid";
349 int closestPointOnLeft = -1;
356 LogTrace(
"TrackAssociator") <<
"Track didn't cross the region (R1,R2,L1,L2): " << volume.
minR() <<
", "
357 << volume.
maxR() <<
", " << volume.
minZ() <<
", " << volume.
maxZ();
371 int firstPointInside(-1);
378 if (
dR > 0 || dZ > 0) {
380 firstPointInside =
i;
381 closestPointOnLeft =
i - 1;
383 firstPointInside = 0;
384 closestPointOnLeft = 0;
389 if (closestPointOnLeft == -1)
390 throw cms::Exception(
"FatalError") <<
"This shouls never happen - internal logic error";
393 if (currentState.position().x() * currentState.momentum().x() +
394 currentState.position().y() * currentState.momentum().y() +
395 currentState.position().z() * currentState.momentum().z() <
401 if (firstPointInside != closestPointOnLeft) {
412 if (currentState.isValid())
413 trajectory.push_back(currentState);
415 LogTrace(
"TrackAssociator") <<
"Weird message\n";
417 while (currentState.isValid() && currentState.position().perp() < volume.
maxR() &&
418 fabs(currentState.position().z()) < volume.
maxZ()) {
420 if (!currentState.isValid()) {
421 LogTrace(
"TrackAssociator") <<
"Failed to propagate the track; moving on\n";
427 trajectory.push_back(currentState);
References Reference_intrackfit_cff::barrel, Plane::build(), Cylinder::build(), HGC3DClusterGenMatchSelector_cfi::dR, makeMuonMisalignmentScenario::endcap, Exception, fullTrajectory_, fullTrajectoryFilled_, mps_fire::i, FiducialVolume::isValid(), SteppingHelixStateInfo::isValid(), LogTrace, SiStripPI::max, FiducialVolume::maxR(), FiducialVolume::maxZ(), FiducialVolume::minR(), FiducialVolume::minZ(), SteppingHelixStateInfo::momentum(), PV3DBase< T, PVType, FrameType >::perp(), SteppingHelixStateInfo::position(), position, propagate(), propagateForward(), customisers::steps, PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), z, and PV3DBase< T, PVType, FrameType >::z().
Referenced by findEcalTrajectory(), findHcalTrajectory(), findHOTrajectory(), findPreshowerTrajectory(), and propagateThoughFromIP().
◆ getWideTrajectory()
Definition at line 477 of file CachedTrajectory.cc.
479 std::vector<GlobalPoint>* wideTrajectory =
nullptr;
480 switch (wideTrajectoryType) {
482 LogTrace(
"TrackAssociator") <<
"Filling ellipses in Ecal trajectory";
486 LogTrace(
"TrackAssociator") <<
"Filling ellipses in Hcal trajectory";
490 LogTrace(
"TrackAssociator") <<
"Filling ellipses in HO trajectory";
497 for (std::vector<SteppingHelixStateInfo>::const_iterator state = states.begin(); state != states.end(); state++) {
502 float r22 = vector.
z() /
sqrt(1 -
pow(vector.x(), 2));
503 float r23 = -vector.y() /
sqrt(1 -
pow(vector.x(), 2));
504 float r31 = vector.x();
505 float r32 = vector.y();
506 float r33 = vector.z();
507 float r11 = r22 * r33 - r23 *
r32;
508 float r12 = r23 * r31;
509 float r13 = -r22 * r31;
516 if (!tsos.isValid()) {
517 LogTrace(
"TrackAssociator") <<
"[getWideTrajectory] TSOS not valid";
520 if (!tsos.hasError()) {
521 LogTrace(
"TrackAssociator") <<
"[getWideTrajectory] TSOS does not have Errors";
524 LocalError localErr = tsos.localError().positionError();
526 float xx = localErr.
xx();
527 float xy = localErr.
xy();
528 float yy = localErr.
yy();
539 float semi1 =
sqrt(rotErr.
xx());
540 float semi2 =
sqrt(rotErr.
yy());
559 wideTrajectory->push_back(state->position());
561 wideTrajectory->push_back(
target->toGlobal(bounds[
index]));
567 return wideTrajectory;
References funct::cos(), makePileupJSON::denom, Ecal, Hcal, HO, LogTrace, M_PI, M_PI_2, phi, funct::pow(), dttmaxenums::r32, LocalError::rotate(), idealTransformation::rotation, LocalError::scale(), funct::sin(), mathSSE::sqrt(), filterCSVwithJSON::target, wideEcalTrajectory_, wideHcalTrajectory_, wideHOTrajectory_, geometryCSVtoXML::xx, LocalError::xx(), geometryCSVtoXML::xy, LocalError::xy(), geometryCSVtoXML::yy, LocalError::yy(), and PV3DBase< T, PVType, FrameType >::z().
◆ propagate() [1/3]
get fast to a given DetId surface using cached trajectory
Definition at line 179 of file CachedTrajectory.cc.
190 const float matchingDistance = 1;
194 int closestPointOnLeft = 0;
198 LogTrace(
"TrackAssociator") <<
"Track didn't cross the plane:\n\tleft distance: " <<
distance(plane, leftIndex)
199 <<
"\n\tright distance: " <<
distance(plane, rightIndex);
203 while (leftIndex + 1 < rightIndex) {
204 closestPointOnLeft =
int((leftIndex + rightIndex) / 2);
205 float dist =
distance(plane, closestPointOnLeft);
208 if (fabs(dist) < matchingDistance) {
210 if (closestPointOnLeft > 0 &&
sign(
distance(plane, closestPointOnLeft - 1)) * dist == -1)
211 closestPointOnLeft--;
217 rightIndex = closestPointOnLeft;
219 leftIndex = closestPointOnLeft;
226 LogTrace(
"TrackAssociator") <<
"closestPointOnLeft: " << closestPointOnLeft <<
"\n\ttrajectory point (z,R,eta,phi): "
231 <<
"\n\tplane center (z,R,eta,phi): " << plane->
position().
z() <<
", "
243 edm::LogWarning(
"TrackAssociator") <<
"An exception is caught during the track propagation\n"
References cms::Exception::category(), distance(), PV3DBase< T, PVType, FrameType >::eta(), cms::Exception::explainSelf(), fullTrajectory_, SteppingHelixStateInfo::getStateOnSurface(), createfilelist::int, LogTrace, SteppingHelixStateInfo::momentum(), PV3DBase< T, PVType, FrameType >::perp(), PV3DBase< T, PVType, FrameType >::phi(), GloballyPositioned< T >::position(), Propagator::propagate(), propagator_, sign(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().
◆ propagate() [2/3]
Definition at line 96 of file CachedTrajectory.cc.
99 shp->propagate(state, cylinder, state);
102 edm::LogWarning(
"TrackAssociator") <<
"An exception is caught during the track propagation\n"
References cms::Exception::category(), cms::Exception::explainSelf(), TrajectoryStateOnSurface::freeState(), SteppingHelixStateInfo::getFreeState(), SteppingHelixStateInfo::momentum(), Propagator::propagate(), propagator_, PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().
◆ propagate() [3/3]
Definition at line 77 of file CachedTrajectory.cc.
80 shp->propagate(state, plane, state);
83 edm::LogWarning(
"TrackAssociator") <<
"An exception is caught during the track propagation\n"
References cms::Exception::category(), cms::Exception::explainSelf(), TrajectoryStateOnSurface::freeState(), SteppingHelixStateInfo::getFreeState(), SteppingHelixStateInfo::momentum(), Propagator::propagate(), propagator_, PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().
Referenced by getTrajectory(), and propagateForward().
◆ propagateAll()
propagate through the whole detector, returns true if successful
Definition at line 115 of file CachedTrajectory.cc.
118 <<
"Reseting all trajectories. Please call reset_trajectory() explicitely to avoid this message";
126 throw cms::Exception(
"FatalError") <<
"Track propagator is not defined\n";
130 while (currentState.position().perp() <
maxRho_ && fabs(currentState.position().z()) <
maxZ_) {
131 LogTrace(
"TrackAssociator") <<
"[propagateAll] Propagate outward from (rho, r, z, phi) ("
132 << currentState.position().perp() <<
", " << currentState.position().mag() <<
", "
133 << currentState.position().z() <<
", " << currentState.position().phi() <<
")";
135 if (!currentState.isValid()) {
136 LogTrace(
"TrackAssociator") <<
"Failed to propagate the track; moving on\n";
139 LogTrace(
"TrackAssociator") <<
"\treached (rho, r, z, phi) (" << currentState.position().perp() <<
", "
140 << currentState.position().mag() <<
", " << currentState.position().z() <<
", "
141 << currentState.position().phi() <<
")";
147 while (currentState2.position().perp() >
minRho_ || fabs(currentState2.position().z()) >
minZ_) {
148 previousState = currentState2;
150 if (!currentState2.isValid()) {
151 LogTrace(
"TrackAssociator") <<
"Failed to propagate the track; moving on\n";
154 if (previousState.
position().
perp() - currentState2.position().perp() < 0) {
156 <<
"Error: TrackAssociator has propogated the particle past the point of closest approach to IP" << std::endl;
159 LogTrace(
"TrackAssociator") <<
"[propagateAll] Propagated inward from (rho, r, z, phi) ("
162 << currentState2.position().perp() <<
", " << currentState2.position().mag() <<
", "
163 << currentState2.position().z() <<
", " << currentState2.position().
phi() <<
")";
173 LogTrace(
"TrackAssociator") <<
"Done with the track propagation in the detector. Number of steps: "
References Exception, fullTrajectory_, fullTrajectoryFilled_, SteppingHelixStateInfo::isValid(), LogTrace, PV3DBase< T, PVType, FrameType >::mag(), maxRho_, maxZ_, minRho_, minZ_, PV3DBase< T, PVType, FrameType >::perp(), PV3DBase< T, PVType, FrameType >::phi(), SteppingHelixStateInfo::position(), propagateForward(), propagator_, reset_trajectory(), step_, and PV3DBase< T, PVType, FrameType >::z().
Referenced by propagateThoughFromIP().
◆ propagateForward()
Definition at line 58 of file CachedTrajectory.cc.
63 float r22 = vector.
z() /
sqrt(1 -
pow(vector.x(), 2));
64 float r23 = -vector.y() /
sqrt(1 -
pow(vector.x(), 2));
65 float r31 = vector.x();
66 float r32 = vector.y();
67 float r33 = vector.z();
68 float r11 = r22 * r33 - r23 *
r32;
69 float r12 = r23 * r31;
70 float r13 = -r22 * r31;
References Plane::build(), distance(), SteppingHelixStateInfo::momentum(), SteppingHelixStateInfo::position(), funct::pow(), propagate(), dttmaxenums::r32, idealTransformation::rotation, mathSSE::sqrt(), filterCSVwithJSON::target, Vector3DBase< T, FrameTag >::unit(), and PV3DBase< T, PVType, FrameType >::z().
Referenced by getTrajectory(), and propagateAll().
◆ reset_trajectory()
void CachedTrajectory::reset_trajectory |
( |
| ) |
|
|
private |
Definition at line 431 of file CachedTrajectory.cc.
References ecalTrajectory_, fullTrajectory_, fullTrajectoryFilled_, hcalTrajectory_, hoTrajectory_, preshowerTrajectory_, wideEcalTrajectory_, wideHcalTrajectory_, and wideHOTrajectory_.
Referenced by CachedTrajectory(), propagateAll(), and propagateThoughFromIP().
◆ setMaxDetectorLength()
void CachedTrajectory::setMaxDetectorLength |
( |
float |
l = 2200. | ) |
|
|
inlineprivate |
◆ setMaxDetectorRadius()
void CachedTrajectory::setMaxDetectorRadius |
( |
float |
r = 800. | ) |
|
|
inlineprivate |
◆ setMaxHOLength()
void CachedTrajectory::setMaxHOLength |
( |
float |
l = 2200. | ) |
|
|
inlineprivate |
◆ setMaxHORadius()
void CachedTrajectory::setMaxHORadius |
( |
float |
r = 800. | ) |
|
|
inlineprivate |
◆ setMinDetectorLength()
void CachedTrajectory::setMinDetectorLength |
( |
float |
l = 0. | ) |
|
|
inlineprivate |
◆ setMinDetectorRadius()
void CachedTrajectory::setMinDetectorRadius |
( |
float |
r = 0. | ) |
|
|
inlineprivate |
◆ setPropagationStep()
void CachedTrajectory::setPropagationStep |
( |
float |
s = 20. | ) |
|
|
inlineprivate |
◆ setPropagator()
void CachedTrajectory::setPropagator |
( |
const Propagator * |
ptr | ) |
|
|
inlineprivate |
◆ setStateAtIP()
◆ sign()
static int CachedTrajectory::sign |
( |
float |
number | ) |
|
|
inlinestaticprotected |
◆ trajectoryDelta()
std::pair< float, float > CachedTrajectory::trajectoryDelta |
( |
TrajectorType |
trajectoryType | ) |
|
|
private |
calculate trajectory change (Theta,Phi) delta = final - original
Definition at line 256 of file CachedTrajectory.cc.
264 std::pair<float, float>
result(0, 0);
266 edm::LogWarning(
"TrackAssociator") <<
"State at IP is not known set. Cannot estimate trajectory change. "
267 <<
"Trajectory change is not taken into account in matching";
270 switch (trajectoryType) {
273 edm::LogWarning(
"TrackAssociator") <<
"ECAL trajector is empty. Cannot estimate trajectory change. "
274 <<
"Trajectory change is not taken into account in matching";
283 edm::LogWarning(
"TrackAssociator") <<
"HCAL trajector is empty. Cannot estimate trajectory change. "
284 <<
"Trajectory change is not taken into account in matching";
293 edm::LogWarning(
"TrackAssociator") <<
"HO trajector is empty. Cannot estimate trajectory change. "
294 <<
"Trajectory change is not taken into account in matching";
303 edm::LogWarning(
"TrackAssociator") <<
"Full trajector is empty. Cannot estimate trajectory change. "
304 <<
"Trajectory change is not taken into account in matching";
313 <<
"Unkown or not supported trajector type. Cannot estimate trajectory change. "
314 <<
"Trajectory change is not taken into account in matching";
References delta(), ecalTrajectory_, FullTrajectory, fullTrajectory_, hcalTrajectory_, hoTrajectory_, IpToEcal, IpToHcal, IpToHO, SteppingHelixStateInfo::isValid(), SteppingHelixStateInfo::momentum(), PV3DBase< T, PVType, FrameType >::phi(), mps_fire::result, stateAtIP_, and PV3DBase< T, PVType, FrameType >::theta().
◆ propagateThoughFromIP
Definition at line 18 of file CachedTrajectory.cc.
38 bool isPropagationSuccessful = neckLace.
propagateAll(state);
40 if (!isPropagationSuccessful)
41 return std::vector<SteppingHelixStateInfo>();
43 std::vector<SteppingHelixStateInfo> complicatePoints;
46 return complicatePoints;
◆ TrackDetectorAssociator
◆ ecalTrajectory_
◆ fullTrajectory_
◆ fullTrajectoryFilled_
bool CachedTrajectory::fullTrajectoryFilled_ |
|
protected |
◆ hcalTrajectory_
◆ HOmaxRho_
float CachedTrajectory::HOmaxRho_ |
|
protected |
◆ HOmaxZ_
float CachedTrajectory::HOmaxZ_ |
|
protected |
◆ hoTrajectory_
◆ maxRho_
float CachedTrajectory::maxRho_ |
|
protected |
◆ maxZ_
float CachedTrajectory::maxZ_ |
|
protected |
◆ minRho_
float CachedTrajectory::minRho_ |
|
protected |
◆ minZ_
float CachedTrajectory::minZ_ |
|
protected |
◆ preshowerTrajectory_
◆ propagator_
◆ stateAtIP_
◆ step_
float CachedTrajectory::step_ |
|
protected |
◆ wideEcalTrajectory_
std::vector<GlobalPoint> CachedTrajectory::wideEcalTrajectory_ |
|
protected |
◆ wideHcalTrajectory_
std::vector<GlobalPoint> CachedTrajectory::wideHcalTrajectory_ |
|
protected |
◆ wideHOTrajectory_
std::vector<GlobalPoint> CachedTrajectory::wideHOTrajectory_ |
|
protected |
GlobalVector momentum() const
void getFreeState(FreeTrajectoryState &fts) const
convert internal structure into the fts
GlobalPoint position() const
void setMaxDetectorRadius(float r=800.)
void setMinDetectorLength(float l=0.)
std::vector< GlobalPoint > wideHOTrajectory_
void setMinDetectorRadius(float r=0.)
Geom::Theta< T > theta() const
double minR(bool withTolerance=true) const
void getTrajectory(std::vector< SteppingHelixStateInfo > &, const FiducialVolume &, int steps=4)
TkRotation< float > RotationType
void setPropagationStep(float s=20.)
void setMaxDetectorLength(float l=2200.)
Sin< T >::type sin(const T &t)
TrajectoryStateOnSurface getStateOnSurface(const Surface &surf, bool returnTangentPlane=false) const
Vector3DBase unit() const
Cos< T >::type cos(const T &t)
FreeTrajectoryState const * freeState(bool withErrors=true) const
bool propagateAll(const SteppingHelixStateInfo &initialState)
propagate through the whole detector, returns true if successful
void setPropagator(const Propagator *ptr)
double maxR(bool withTolerance=true) const
void propagate(SteppingHelixStateInfo &state, const Plane &plane)
const Propagator * propagator_
LocalError scale(float s) const
static PlanePointer build(Args &&... args)
std::vector< GlobalPoint > wideHcalTrajectory_
double minZ(bool withTolerance=true) const
std::deque< SteppingHelixStateInfo > fullTrajectory_
static int sign(float number)
LocalError rotate(float x, float y) const
Return a new LocalError, rotated by an angle defined by the direction (x,y)
float localZ(const GlobalPoint &gp) const
static int position[264][3]
std::vector< GlobalPoint > wideEcalTrajectory_
static CylinderPointer build(const PositionType &pos, const RotationType &rot, Scalar radius, Bounds *bounds=nullptr)
bool isValid() const
check whether the volume is properly defined
std::vector< SteppingHelixStateInfo > hoTrajectory_
TrajectoryStateOnSurface propagate(STA const &state, SUR const &surface) const
std::pair< float, float > delta(const double &theta1, const double &theta2, const double &phi1, const double &phi2)
double maxZ(bool withTolerance=true) const
const PositionType & position() const
void propagateForward(SteppingHelixStateInfo &state, float distance)
Point3DBase< float, GlobalTag > PositionType
bool fullTrajectoryFilled_
void setStateAtIP(const SteppingHelixStateInfo &state)
std::vector< SteppingHelixStateInfo > preshowerTrajectory_
virtual std::string explainSelf() const
SteppingHelixStateInfo stateAtIP_
float distance(const Plane *plane, int index)
Power< A, B >::type pow(const A &a, const B &b)
std::vector< SteppingHelixStateInfo > ecalTrajectory_
Point2DBase< float, LocalTag > Local2DPoint
std::string const & category() const
std::vector< SteppingHelixStateInfo > hcalTrajectory_
Geom::Phi< T > phi() const