CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Private Types | Private Member Functions | Friends
CachedTrajectory Class Reference

#include <CachedTrajectory.h>

Public Member Functions

const std::vector< SteppingHelixStateInfo > & getEcalTrajectory () const
 
const std::vector< SteppingHelixStateInfo > & getHcalTrajectory () const
 
const std::vector< SteppingHelixStateInfo > & getHOTrajectory () const
 
const std::vector< SteppingHelixStateInfo > & getPreshowerTrajectory () const
 

Protected Member Functions

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 Protected Member Functions

static int sign (float number)
 

Protected Attributes

std::vector< SteppingHelixStateInfoecalTrajectory_
 
std::deque< SteppingHelixStateInfofullTrajectory_
 
bool fullTrajectoryFilled_
 
std::vector< SteppingHelixStateInfohcalTrajectory_
 
float HOmaxRho_
 
float HOmaxZ_
 
std::vector< SteppingHelixStateInfohoTrajectory_
 
float maxRho_
 
float maxZ_
 
float minRho_
 
float minZ_
 
std::vector< SteppingHelixStateInfopreshowerTrajectory_
 
const Propagatorpropagator_
 
SteppingHelixStateInfo stateAtIP_
 
float step_
 
std::vector< GlobalPointwideEcalTrajectory_
 
std::vector< GlobalPointwideHcalTrajectory_
 
std::vector< GlobalPointwideHOTrajectory_
 

Private Types

enum  TrajectorType { IpToEcal, IpToHcal, IpToHO, FullTrajectory }
 
enum  WideTrajectoryType { Ecal, Hcal, HO }
 

Private Member Functions

 CachedTrajectory ()
 
void findEcalTrajectory (const FiducialVolume &)
 
void findHcalTrajectory (const FiducialVolume &)
 
void findHOTrajectory (const FiducialVolume &)
 
void findPreshowerTrajectory (const FiducialVolume &)
 
SteppingHelixStateInfo getInnerState ()
 
SteppingHelixStateInfo getOuterState ()
 
float getPropagationStep () const
 
SteppingHelixStateInfo getStateAtEcal ()
 
SteppingHelixStateInfo getStateAtHcal ()
 
SteppingHelixStateInfo getStateAtHO ()
 
SteppingHelixStateInfo getStateAtPreshower ()
 
void getTrajectory (std::vector< SteppingHelixStateInfo > &, const FiducialVolume &, int steps=4)
 
std::vector< GlobalPoint > * getWideTrajectory (const std::vector< SteppingHelixStateInfo > &, WideTrajectoryType)
 
void propagate (SteppingHelixStateInfo &state, const Plane &plane)
 
void propagate (SteppingHelixStateInfo &state, const Cylinder &cylinder)
 
TrajectoryStateOnSurface propagate (const Plane *plane)
 get fast to a given DetId surface using cached trajectory More...
 
bool propagateAll (const SteppingHelixStateInfo &initialState)
 propagate through the whole detector, returns true if successful More...
 
void propagateForward (SteppingHelixStateInfo &state, float distance)
 
void reset_trajectory ()
 
void setMaxDetectorLength (float l=2200.)
 
void setMaxDetectorRadius (float r=800.)
 
void setMaxHOLength (float l=2200.)
 
void setMaxHORadius (float r=800.)
 
void setMinDetectorLength (float l=0.)
 
void setMinDetectorRadius (float r=0.)
 
void setPropagationStep (float s=20.)
 
void setPropagator (const Propagator *ptr)
 
void setStateAtIP (const SteppingHelixStateInfo &state)
 
std::pair< float, float > trajectoryDelta (TrajectorType)
 

Friends

std::vector< SteppingHelixStateInfopropagateThoughFromIP (const SteppingHelixStateInfo &state, const Propagator *ptr, const FiducialVolume &volume, int nsteps, float step, float minR, float minZ, float maxR, float maxZ)
 
class TrackDetectorAssociator
 

Detailed Description

Definition at line 44 of file CachedTrajectory.h.

Member Enumeration Documentation

◆ TrajectorType

◆ WideTrajectoryType

Enumerator
Ecal 
Hcal 
HO 

Definition at line 65 of file CachedTrajectory.h.

Constructor & Destructor Documentation

◆ CachedTrajectory()

CachedTrajectory::CachedTrajectory ( )
private

Definition at line 49 of file CachedTrajectory.cc.

References reset_trajectory(), setMaxDetectorLength(), setMaxDetectorRadius(), setMinDetectorLength(), setMinDetectorRadius(), and setPropagationStep().

49  : propagator_(nullptr) {
56 }
const Propagator * propagator_
void setMinDetectorLength(float l=0.)
void setMinDetectorRadius(float r=0.)
void setPropagationStep(float s=20.)
void setMaxDetectorLength(float l=2200.)
void setMaxDetectorRadius(float r=800.)

Member Function Documentation

◆ delta()

std::pair< float, float > CachedTrajectory::delta ( const double &  theta1,
const double &  theta2,
const double &  phi1,
const double &  phi2 
)
protected

Definition at line 319 of file CachedTrajectory.cc.

References M_PI, and mps_fire::result.

Referenced by trajectoryDelta().

322  {
323  std::pair<float, float> result(theta2 - theta1, phi2 - phi1);
324  // this won't work for loopers, since deltaPhi cannot be larger than Pi.
325  if (fabs(result.second) > 2 * M_PI - fabs(result.second)) {
326  if (result.second > 0)
327  result.second -= 2 * M_PI;
328  else
329  result.second += 2 * M_PI;
330  }
331  return result;
332 }
#define M_PI

◆ distance()

float CachedTrajectory::distance ( const Plane plane,
int  index 
)
inlineprotected

Definition at line 136 of file CachedTrajectory.h.

References fullTrajectory_, createfilelist::int, and position.

Referenced by propagate(), and propagateForward().

136  {
137  if (index < 0 || fullTrajectory_.empty() || (unsigned int)index >= fullTrajectory_.size())
138  return 0;
139  return plane->localZ(fullTrajectory_[index].position());
140  }
float localZ(const GlobalPoint &gp) const
Definition: Plane.h:45
std::deque< SteppingHelixStateInfo > fullTrajectory_
static int position[264][3]
Definition: ReadPGInfo.cc:289

◆ findEcalTrajectory()

void CachedTrajectory::findEcalTrajectory ( const FiducialVolume volume)
private

Definition at line 443 of file CachedTrajectory.cc.

References ecalTrajectory_, getTrajectory(), and LogTrace.

443  {
444  LogTrace("TrackAssociator") << "getting trajectory in ECAL";
445  getTrajectory(ecalTrajectory_, volume, 4);
446  LogTrace("TrackAssociator") << "# of points in ECAL trajectory:" << ecalTrajectory_.size();
447 }
std::vector< SteppingHelixStateInfo > ecalTrajectory_
void getTrajectory(std::vector< SteppingHelixStateInfo > &, const FiducialVolume &, int steps=4)
#define LogTrace(id)

◆ findHcalTrajectory()

void CachedTrajectory::findHcalTrajectory ( const FiducialVolume volume)
private

Definition at line 461 of file CachedTrajectory.cc.

References getTrajectory(), hcalTrajectory_, and LogTrace.

461  {
462  LogTrace("TrackAssociator") << "getting trajectory in HCAL";
463  getTrajectory(hcalTrajectory_, volume, 4); // more steps to account for different depth
464  LogTrace("TrackAssociator") << "# of points in HCAL trajectory:" << hcalTrajectory_.size();
465 }
void getTrajectory(std::vector< SteppingHelixStateInfo > &, const FiducialVolume &, int steps=4)
#define LogTrace(id)
std::vector< SteppingHelixStateInfo > hcalTrajectory_

◆ findHOTrajectory()

void CachedTrajectory::findHOTrajectory ( const FiducialVolume volume)
private

Definition at line 469 of file CachedTrajectory.cc.

References getTrajectory(), hoTrajectory_, and LogTrace.

469  {
470  LogTrace("TrackAssociator") << "getting trajectory in HO";
471  getTrajectory(hoTrajectory_, volume, 2);
472  LogTrace("TrackAssociator") << "# of points in HO trajectory:" << hoTrajectory_.size();
473 }
void getTrajectory(std::vector< SteppingHelixStateInfo > &, const FiducialVolume &, int steps=4)
#define LogTrace(id)
std::vector< SteppingHelixStateInfo > hoTrajectory_

◆ findPreshowerTrajectory()

void CachedTrajectory::findPreshowerTrajectory ( const FiducialVolume volume)
private

Definition at line 449 of file CachedTrajectory.cc.

References getTrajectory(), LogTrace, and preshowerTrajectory_.

449  {
450  LogTrace("TrackAssociator") << "getting trajectory in Preshower";
452  LogTrace("TrackAssociator") << "# of points in Preshower trajectory:" << preshowerTrajectory_.size();
453 }
void getTrajectory(std::vector< SteppingHelixStateInfo > &, const FiducialVolume &, int steps=4)
#define LogTrace(id)
std::vector< SteppingHelixStateInfo > preshowerTrajectory_

◆ getEcalTrajectory()

const std::vector< SteppingHelixStateInfo > & CachedTrajectory::getEcalTrajectory ( ) const

Definition at line 455 of file CachedTrajectory.cc.

References ecalTrajectory_.

455 { return ecalTrajectory_; }
std::vector< SteppingHelixStateInfo > ecalTrajectory_

◆ getHcalTrajectory()

const std::vector< SteppingHelixStateInfo > & CachedTrajectory::getHcalTrajectory ( ) const

Definition at line 467 of file CachedTrajectory.cc.

References hcalTrajectory_.

467 { return hcalTrajectory_; }
std::vector< SteppingHelixStateInfo > hcalTrajectory_

◆ getHOTrajectory()

const std::vector< SteppingHelixStateInfo > & CachedTrajectory::getHOTrajectory ( ) const

Definition at line 475 of file CachedTrajectory.cc.

References hoTrajectory_.

475 { return hoTrajectory_; }
std::vector< SteppingHelixStateInfo > hoTrajectory_

◆ getInnerState()

SteppingHelixStateInfo CachedTrajectory::getInnerState ( )
private

Definition at line 598 of file CachedTrajectory.cc.

References fullTrajectory_.

598  {
599  if (fullTrajectory_.empty())
600  return SteppingHelixStateInfo();
601  else
602  return fullTrajectory_.front();
603 }
std::deque< SteppingHelixStateInfo > fullTrajectory_

◆ getOuterState()

SteppingHelixStateInfo CachedTrajectory::getOuterState ( )
private

Definition at line 605 of file CachedTrajectory.cc.

References fullTrajectory_.

605  {
606  if (fullTrajectory_.empty())
607  return SteppingHelixStateInfo();
608  else
609  return fullTrajectory_.back();
610 }
std::deque< SteppingHelixStateInfo > fullTrajectory_

◆ getPreshowerTrajectory()

const std::vector< SteppingHelixStateInfo > & CachedTrajectory::getPreshowerTrajectory ( ) const

Definition at line 457 of file CachedTrajectory.cc.

References preshowerTrajectory_.

457  {
458  return preshowerTrajectory_;
459 }
std::vector< SteppingHelixStateInfo > preshowerTrajectory_

◆ getPropagationStep()

float CachedTrajectory::getPropagationStep ( ) const
inlineprivate

Definition at line 121 of file CachedTrajectory.h.

References step_.

121 { return step_; }

◆ getStateAtEcal()

SteppingHelixStateInfo CachedTrajectory::getStateAtEcal ( )
private

Definition at line 570 of file CachedTrajectory.cc.

References ecalTrajectory_.

570  {
571  if (ecalTrajectory_.empty())
572  return SteppingHelixStateInfo();
573  else
574  return ecalTrajectory_.front();
575 }
std::vector< SteppingHelixStateInfo > ecalTrajectory_

◆ getStateAtHcal()

SteppingHelixStateInfo CachedTrajectory::getStateAtHcal ( )
private

Definition at line 584 of file CachedTrajectory.cc.

References hcalTrajectory_.

584  {
585  if (hcalTrajectory_.empty())
586  return SteppingHelixStateInfo();
587  else
588  return hcalTrajectory_.front();
589 }
std::vector< SteppingHelixStateInfo > hcalTrajectory_

◆ getStateAtHO()

SteppingHelixStateInfo CachedTrajectory::getStateAtHO ( )
private

Definition at line 591 of file CachedTrajectory.cc.

References hoTrajectory_.

591  {
592  if (hoTrajectory_.empty())
593  return SteppingHelixStateInfo();
594  else
595  return hoTrajectory_.front();
596 }
std::vector< SteppingHelixStateInfo > hoTrajectory_

◆ getStateAtPreshower()

SteppingHelixStateInfo CachedTrajectory::getStateAtPreshower ( )
private

Definition at line 577 of file CachedTrajectory.cc.

References preshowerTrajectory_.

577  {
578  if (preshowerTrajectory_.empty())
579  return SteppingHelixStateInfo();
580  else
581  return preshowerTrajectory_.front();
582 }
std::vector< SteppingHelixStateInfo > preshowerTrajectory_

◆ getTrajectory()

void CachedTrajectory::getTrajectory ( std::vector< SteppingHelixStateInfo > &  trajectory,
const FiducialVolume volume,
int  steps = 4 
)
private

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.

References Reference_intrackfit_cff::barrel, Plane::build(), Cylinder::build(), HGC3DClusterGenMatchSelector_cfi::dR, l1ctLayer1_cff::dZ, 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().

336  {
338  throw cms::Exception("FatalError") << "trajectory is not defined yet. Please use propagateAll first.";
339  if (fullTrajectory_.empty()) {
340  LogTrace("TrackAssociator") << "Trajectory is empty. Move on";
341  return;
342  }
343  if (!volume.isValid()) {
344  LogTrace("TrackAssociator") << "no trajectory is expected to be found since the fiducial volume is not valid";
345  return;
346  }
347  double step = std::max(volume.maxR() - volume.minR(), volume.maxZ() - volume.minZ()) / steps;
348 
349  int closestPointOnLeft = -1;
350 
351  // check whether the trajectory crossed the region
352  if (!((fullTrajectory_.front().position().perp() < volume.maxR() &&
353  fabs(fullTrajectory_.front().position().z()) < volume.maxZ()) &&
354  (fullTrajectory_.back().position().perp() > volume.minR() ||
355  fabs(fullTrajectory_.back().position().z()) > volume.minZ()))) {
356  LogTrace("TrackAssociator") << "Track didn't cross the region (R1,R2,L1,L2): " << volume.minR() << ", "
357  << volume.maxR() << ", " << volume.minZ() << ", " << volume.maxZ();
358  return;
359  }
360 
361  // get distance along momentum to the surface.
362 
363  // the following code can be made faster, but it'll hardly be a significant improvement
364  // simplifications:
365  // 1) direct loop over stored trajectory points instead of some sort
366  // of fast root search (Newton method)
367  // 2) propagate from the closest point outside the region with the
368  // requested step ignoring stored trajectory points.
369  double dZ(-1.);
370  double dR(-1.);
371  int firstPointInside(-1);
372  for (unsigned int i = 0; i < fullTrajectory_.size(); i++) {
373  // LogTrace("TrackAssociator") << "Trajectory info (i,perp,r1,r2,z,z1,z2): " << i << ", " << fullTrajectory_[i].position().perp() <<
374  // ", " << volume.minR() << ", " << volume.maxR() << ", " << fullTrajectory_[i].position().z() << ", " << volume.minZ() << ", " <<
375  // volume.maxZ() << ", " << closestPointOnLeft;
376  dR = fullTrajectory_[i].position().perp() - volume.minR();
377  dZ = fabs(fullTrajectory_[i].position().z()) - volume.minZ();
378  if (dR > 0 || dZ > 0) {
379  if (i > 0) {
380  firstPointInside = i;
381  closestPointOnLeft = i - 1;
382  } else {
383  firstPointInside = 0;
384  closestPointOnLeft = 0;
385  }
386  break;
387  }
388  }
389  if (closestPointOnLeft == -1)
390  throw cms::Exception("FatalError") << "This shouls never happen - internal logic error";
391 
392  SteppingHelixStateInfo currentState(fullTrajectory_[closestPointOnLeft]);
393  if (currentState.position().x() * currentState.momentum().x() +
394  currentState.position().y() * currentState.momentum().y() +
395  currentState.position().z() * currentState.momentum().z() <
396  0)
397  step = -step;
398 
399  // propagate to the inner surface of the active volume
400 
401  if (firstPointInside != closestPointOnLeft) {
402  if (dR > 0) {
405  propagate(currentState, *barrel);
406  } else {
408  Plane::build(Plane::PositionType(0, 0, currentState.position().z() > 0 ? volume.minZ() : -volume.minZ()),
410  propagate(currentState, *endcap);
411  }
412  if (currentState.isValid())
413  trajectory.push_back(currentState);
414  } else
415  LogTrace("TrackAssociator") << "Weird message\n";
416 
417  while (currentState.isValid() && currentState.position().perp() < volume.maxR() &&
418  fabs(currentState.position().z()) < volume.maxZ()) {
419  propagateForward(currentState, step);
420  if (!currentState.isValid()) {
421  LogTrace("TrackAssociator") << "Failed to propagate the track; moving on\n";
422  break;
423  }
424  // LogTrace("TrackAssociator") << "New state (perp, z): " << currentState.position().perp() << ", " << currentState.position().z();
425  //if ( ( currentState.position().perp() < volume.maxR() && fabs(currentState.position().z()) < volume.maxZ() ) &&
426  // ( currentState.position().perp()-volume.minR() > 0 || fabs(currentState.position().z()) - volume.minZ() >0 ) )
427  trajectory.push_back(currentState);
428  }
429 }
double maxZ(bool withTolerance=true) const
#define LogTrace(id)
static PlanePointer build(Args &&... args)
Definition: Plane.h:33
bool isValid() const
check whether the volume is properly defined
Point3DBase< float, GlobalTag > PositionType
void propagate(SteppingHelixStateInfo &state, const Plane &plane)
static CylinderPointer build(const PositionType &pos, const RotationType &rot, Scalar radius, Bounds *bounds=nullptr)
Definition: Cylinder.h:45
std::deque< SteppingHelixStateInfo > fullTrajectory_
static int position[264][3]
Definition: ReadPGInfo.cc:289
TkRotation< float > RotationType
double minR(bool withTolerance=true) const
step
Definition: StallMonitor.cc:98
void propagateForward(SteppingHelixStateInfo &state, float distance)
double maxR(bool withTolerance=true) const
double minZ(bool withTolerance=true) const

◆ getWideTrajectory()

std::vector< GlobalPoint > * CachedTrajectory::getWideTrajectory ( const std::vector< SteppingHelixStateInfo > &  states,
WideTrajectoryType  wideTrajectoryType 
)
private

Definition at line 477 of file CachedTrajectory.cc.

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, trackerHitRTTI::vector, wideEcalTrajectory_, wideHcalTrajectory_, wideHOTrajectory_, geometryCSVtoXML::xx, LocalError::xx(), geometryCSVtoXML::xy, LocalError::xy(), geometryCSVtoXML::yy, and LocalError::yy().

478  {
479  std::vector<GlobalPoint>* wideTrajectory = nullptr;
480  switch (wideTrajectoryType) {
481  case Ecal:
482  LogTrace("TrackAssociator") << "Filling ellipses in Ecal trajectory";
483  wideTrajectory = &wideEcalTrajectory_;
484  break;
485  case Hcal:
486  LogTrace("TrackAssociator") << "Filling ellipses in Hcal trajectory";
487  wideTrajectory = &wideHcalTrajectory_;
488  break;
489  case HO:
490  LogTrace("TrackAssociator") << "Filling ellipses in HO trajectory";
491  wideTrajectory = &wideHOTrajectory_;
492  break;
493  }
494  if (!wideTrajectory)
495  return nullptr;
496 
497  for (std::vector<SteppingHelixStateInfo>::const_iterator state = states.begin(); state != states.end(); state++) {
498  // defined a normal plane wrt the particle trajectory direction
499  // let's hope that I computed the rotation matrix correctly.
500  GlobalVector vector(state->momentum().unit());
501  float r21 = 0;
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;
510 
511  Plane::RotationType rotation(r11, r12, r13, r21, r22, r23, r31, r32, r33);
512  Plane* target = new Plane(state->position(), rotation);
513 
514  TrajectoryStateOnSurface tsos = state->getStateOnSurface(*target);
515 
516  if (!tsos.isValid()) {
517  LogTrace("TrackAssociator") << "[getWideTrajectory] TSOS not valid";
518  continue;
519  }
520  if (!tsos.hasError()) {
521  LogTrace("TrackAssociator") << "[getWideTrajectory] TSOS does not have Errors";
522  continue;
523  }
524  LocalError localErr = tsos.localError().positionError();
525  localErr.scale(2); // get the 2 sigma ellipse
526  float xx = localErr.xx();
527  float xy = localErr.xy();
528  float yy = localErr.yy();
529 
530  float denom = yy - xx;
531  float phi = 0.;
532  if (xy == 0 && denom == 0)
533  phi = M_PI_4;
534  else
535  phi = 0.5 * atan2(2. * xy, denom); // angle of MAJOR axis
536  // Unrotate the error ellipse to get the semimajor and minor axes. Then place points on
537  // the endpoints of semiminor an seminajor axes on original(rotated) error ellipse.
538  LocalError rotErr = localErr.rotate(-phi); // xy covariance of rotErr should be zero
539  float semi1 = sqrt(rotErr.xx());
540  float semi2 = sqrt(rotErr.yy());
541 
542  // Just use one point if the ellipse is small
543  // if(semi1 < 0.1 && semi2 < 0.1) {
544  // LogTrace("TrackAssociator") << "[getWideTrajectory] Error ellipse is small, using one trajectory point";
545  // wideTrajectory->push_back(state->position());
546  // continue;
547  // }
548 
549  Local2DPoint bounds[4];
550  bounds[0] = Local2DPoint(semi1 * cos(phi), semi1 * sin(phi));
551  bounds[1] = Local2DPoint(semi1 * cos(phi + M_PI), semi1 * sin(phi + M_PI));
552  phi += M_PI_2; // add pi/2 for the semi2 axis
553  bounds[2] = Local2DPoint(semi2 * cos(phi), semi2 * sin(phi));
554  bounds[3] = Local2DPoint(semi2 * cos(phi + M_PI), semi2 * sin(phi + M_PI));
555 
556  // LogTrace("TrackAssociator") << "Axes " << semi1 <<","<< semi2 <<" phi "<< phi;
557  // LogTrace("TrackAssociator") << "Local error ellipse: " << bounds[0] << bounds[1] << bounds[2] << bounds[3];
558 
559  wideTrajectory->push_back(state->position());
560  for (int index = 0; index < 4; ++index)
561  wideTrajectory->push_back(target->toGlobal(bounds[index]));
562 
563  //LogTrace("TrackAssociator") <<"Global error ellipse: (" << target->toGlobal(bounds[0]) <<","<< target->toGlobal(bounds[1])
564  // <<","<< target->toGlobal(bounds[2]) <<","<< target->toGlobal(bounds[3]) <<","<<state->position() <<")";
565  }
566 
567  return wideTrajectory;
568 }
LocalError scale(float s) const
Definition: LocalError.h:31
LocalError rotate(float x, float y) const
Return a new LocalError, rotated by an angle defined by the direction (x,y)
Definition: LocalError.h:37
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
#define M_PI_2
std::vector< GlobalPoint > wideHcalTrajectory_
Definition: Plane.h:16
#define LogTrace(id)
std::vector< GlobalPoint > wideEcalTrajectory_
std::vector< GlobalPoint > wideHOTrajectory_
float yy() const
Definition: LocalError.h:24
T sqrt(T t)
Definition: SSEVec.h:19
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
#define M_PI
float xy() const
Definition: LocalError.h:23
Point2DBase< float, LocalTag > Local2DPoint
Definition: LocalPoint.h:8
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29
float xx() const
Definition: LocalError.h:22

◆ propagate() [1/3]

void CachedTrajectory::propagate ( SteppingHelixStateInfo state,
const Plane plane 
)
private

Definition at line 77 of file CachedTrajectory.cc.

References cms::Exception::category(), cms::Exception::explainSelf(), TrajectoryStateOnSurface::freeState(), Propagator::propagate(), and propagator_.

Referenced by getTrajectory(), and propagateForward().

77  {
78  if (const SteppingHelixPropagator* shp = dynamic_cast<const SteppingHelixPropagator*>(propagator_)) {
79  try {
80  shp->propagate(state, plane, state);
81  } catch (cms::Exception& ex) {
82  edm::LogWarning("TrackAssociator") << "Caught exception " << ex.category() << ": " << ex.explainSelf();
83  edm::LogWarning("TrackAssociator") << "An exception is caught during the track propagation\n"
84  << state.momentum().x() << ", " << state.momentum().y() << ", "
85  << state.momentum().z();
87  }
88  } else {
90  state.getFreeState(fts);
91  TrajectoryStateOnSurface stateOnSurface = propagator_->propagate(fts, plane);
92  state = SteppingHelixStateInfo(*(stateOnSurface.freeState()));
93  }
94 }
virtual std::string explainSelf() const
Definition: Exception.cc:108
const Propagator * propagator_
std::string const & category() const
Definition: Exception.cc:143
TrajectoryStateOnSurface propagate(STA const &state, SUR const &surface) const
Definition: Propagator.h:50
FreeTrajectoryState const * freeState(bool withErrors=true) const
Log< level::Warning, false > LogWarning

◆ propagate() [2/3]

void CachedTrajectory::propagate ( SteppingHelixStateInfo state,
const Cylinder cylinder 
)
private

Definition at line 96 of file CachedTrajectory.cc.

References cms::Exception::category(), cms::Exception::explainSelf(), TrajectoryStateOnSurface::freeState(), Propagator::propagate(), and propagator_.

96  {
97  if (const SteppingHelixPropagator* shp = dynamic_cast<const SteppingHelixPropagator*>(propagator_)) {
98  try {
99  shp->propagate(state, cylinder, state);
100  } catch (cms::Exception& ex) {
101  edm::LogWarning("TrackAssociator") << "Caught exception " << ex.category() << ": " << ex.explainSelf();
102  edm::LogWarning("TrackAssociator") << "An exception is caught during the track propagation\n"
103  << state.momentum().x() << ", " << state.momentum().y() << ", "
104  << state.momentum().z();
106  }
107  } else {
109  state.getFreeState(fts);
110  TrajectoryStateOnSurface stateOnSurface = propagator_->propagate(fts, cylinder);
111  state = SteppingHelixStateInfo(*(stateOnSurface.freeState()));
112  }
113 }
virtual std::string explainSelf() const
Definition: Exception.cc:108
const Propagator * propagator_
std::string const & category() const
Definition: Exception.cc:143
TrajectoryStateOnSurface propagate(STA const &state, SUR const &surface) const
Definition: Propagator.h:50
FreeTrajectoryState const * freeState(bool withErrors=true) const
Log< level::Warning, false > LogWarning

◆ propagate() [3/3]

TrajectoryStateOnSurface CachedTrajectory::propagate ( const Plane plane)
private

get fast to a given DetId surface using cached trajectory

Definition at line 179 of file CachedTrajectory.cc.

References cms::Exception::category(), distance(), PV3DBase< T, PVType, FrameType >::eta(), cms::Exception::explainSelf(), fullTrajectory_, createfilelist::int, LogTrace, PV3DBase< T, PVType, FrameType >::perp(), PV3DBase< T, PVType, FrameType >::phi(), GloballyPositioned< T >::position(), Propagator::propagate(), propagator_, sign(), and PV3DBase< T, PVType, FrameType >::z().

179  {
180  // TimerStack timers(TimerStack::Disableable);
181  // timers.benchmark("CachedTrajectory::propagate::benchmark");
182  // timers.push("CachedTrajectory::propagate",TimerStack::FastMonitoring);
183  // timers.push("CachedTrajectory::propagate::findClosestPoint",TimerStack::FastMonitoring);
184 
185  // Assume that all points along the trajectory are equally spread out.
186  // For simplication assume that the trajectory is just a straight
187  // line and find a point closest to the target plane. Propagate to
188  // the plane from the point.
189 
190  const float matchingDistance = 1;
191  // find the closest point to the plane
192  int leftIndex = 0;
193  int rightIndex = fullTrajectory_.size() - 1;
194  int closestPointOnLeft = 0;
195 
196  // check whether the trajectory crossed the plane (signs should be different)
197  if (sign(distance(plane, leftIndex)) * sign(distance(plane, rightIndex)) != -1) {
198  LogTrace("TrackAssociator") << "Track didn't cross the plane:\n\tleft distance: " << distance(plane, leftIndex)
199  << "\n\tright distance: " << distance(plane, rightIndex);
200  return TrajectoryStateOnSurface();
201  }
202 
203  while (leftIndex + 1 < rightIndex) {
204  closestPointOnLeft = int((leftIndex + rightIndex) / 2);
205  float dist = distance(plane, closestPointOnLeft);
206  // LogTrace("TrackAssociator") << "Closest point on left: " << closestPointOnLeft << "\n"
207  // << "Distance to the plane: " << dist;
208  if (fabs(dist) < matchingDistance) {
209  // found close match, verify that we are on the left side
210  if (closestPointOnLeft > 0 && sign(distance(plane, closestPointOnLeft - 1)) * dist == -1)
211  closestPointOnLeft--;
212  break;
213  }
214 
215  // check where is the plane
216  if (sign(distance(plane, leftIndex) * dist) == -1)
217  rightIndex = closestPointOnLeft;
218  else
219  leftIndex = closestPointOnLeft;
220 
221  // LogTrace("TrackAssociator") << "Distance on left: " << distance(plane, leftIndex) << "\n"
222  // << "Distance to closest point: " << distance(plane, closestPointOnLeft) << "\n"
223  // << "Left index: " << leftIndex << "\n"
224  // << "Right index: " << rightIndex;
225  }
226  LogTrace("TrackAssociator") << "closestPointOnLeft: " << closestPointOnLeft << "\n\ttrajectory point (z,R,eta,phi): "
227  << fullTrajectory_[closestPointOnLeft].position().z() << ", "
228  << fullTrajectory_[closestPointOnLeft].position().perp() << " , "
229  << fullTrajectory_[closestPointOnLeft].position().eta() << " , "
230  << fullTrajectory_[closestPointOnLeft].position().phi()
231  << "\n\tplane center (z,R,eta,phi): " << plane->position().z() << ", "
232  << plane->position().perp() << " , " << plane->position().eta() << " , "
233  << plane->position().phi();
234 
235  // propagate to the plane
236  // timers.pop_and_push("CachedTrajectory::propagate::localPropagation",TimerStack::FastMonitoring);
237  if (const SteppingHelixPropagator* shp = dynamic_cast<const SteppingHelixPropagator*>(propagator_)) {
239  try {
240  shp->propagate(fullTrajectory_[closestPointOnLeft], *plane, state);
241  } catch (cms::Exception& ex) {
242  edm::LogWarning("TrackAssociator") << "Caught exception " << ex.category() << ": " << ex.explainSelf();
243  edm::LogWarning("TrackAssociator") << "An exception is caught during the track propagation\n"
244  << state.momentum().x() << ", " << state.momentum().y() << ", "
245  << state.momentum().z();
246  return TrajectoryStateOnSurface();
247  }
248  return state.getStateOnSurface(*plane);
249  } else {
251  fullTrajectory_[closestPointOnLeft].getFreeState(fts);
252  return propagator_->propagate(fts, *plane);
253  }
254 }
T perp() const
Definition: PV3DBase.h:69
virtual std::string explainSelf() const
Definition: Exception.cc:108
T z() const
Definition: PV3DBase.h:61
const Propagator * propagator_
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66
T eta() const
Definition: PV3DBase.h:73
std::string const & category() const
Definition: Exception.cc:143
TrajectoryStateOnSurface propagate(STA const &state, SUR const &surface) const
Definition: Propagator.h:50
#define LogTrace(id)
float distance(const Plane *plane, int index)
const PositionType & position() const
std::deque< SteppingHelixStateInfo > fullTrajectory_
Log< level::Warning, false > LogWarning
static int sign(float number)

◆ propagateAll()

bool CachedTrajectory::propagateAll ( const SteppingHelixStateInfo initialState)
private

propagate through the whole detector, returns true if successful

Definition at line 115 of file CachedTrajectory.cc.

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().

115  {
116  if (fullTrajectoryFilled_) {
117  edm::LogWarning("TrackAssociator")
118  << "Reseting all trajectories. Please call reset_trajectory() explicitely to avoid this message";
120  }
121 
122  // TimerStack timers(TimerStack::Disableable);
123 
125  if (propagator_ == nullptr)
126  throw cms::Exception("FatalError") << "Track propagator is not defined\n";
127  SteppingHelixStateInfo currentState(initialState);
128  fullTrajectory_.push_back(currentState);
129 
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() << ")";
134  propagateForward(currentState, step_);
135  if (!currentState.isValid()) {
136  LogTrace("TrackAssociator") << "Failed to propagate the track; moving on\n";
137  break;
138  }
139  LogTrace("TrackAssociator") << "\treached (rho, r, z, phi) (" << currentState.position().perp() << ", "
140  << currentState.position().mag() << ", " << currentState.position().z() << ", "
141  << currentState.position().phi() << ")";
142  fullTrajectory_.push_back(currentState);
143  }
144 
145  SteppingHelixStateInfo currentState2(initialState);
146  SteppingHelixStateInfo previousState;
147  while (currentState2.position().perp() > minRho_ || fabs(currentState2.position().z()) > minZ_) {
148  previousState = currentState2;
149  propagateForward(currentState2, -step_);
150  if (!currentState2.isValid()) {
151  LogTrace("TrackAssociator") << "Failed to propagate the track; moving on\n";
152  break;
153  }
154  if (previousState.position().perp() - currentState2.position().perp() < 0) {
155  LogTrace("TrackAssociator")
156  << "Error: TrackAssociator has propogated the particle past the point of closest approach to IP" << std::endl;
157  break;
158  }
159  LogTrace("TrackAssociator") << "[propagateAll] Propagated inward from (rho, r, z, phi) ("
160  << previousState.position().perp() << ", " << previousState.position().mag() << ", "
161  << previousState.position().z() << "," << previousState.position().phi() << ") to ("
162  << currentState2.position().perp() << ", " << currentState2.position().mag() << ", "
163  << currentState2.position().z() << ", " << currentState2.position().phi() << ")";
164  fullTrajectory_.push_front(currentState2);
165  }
166 
167  // LogTrace("TrackAssociator") << "fullTrajectory_ has " << fullTrajectory_.size() << " states with (R, z):\n";
168  // for(unsigned int i=0; i<fullTrajectory_.size(); i++) {
169  // LogTrace("TrackAssociator") << "state " << i << ": (" << fullTrajectory_[i].position().perp() << ", "
170  // << fullTrajectory_[i].position().z() << ")\n";
171  // }
172 
173  LogTrace("TrackAssociator") << "Done with the track propagation in the detector. Number of steps: "
174  << fullTrajectory_.size();
175  fullTrajectoryFilled_ = true;
176  return !fullTrajectory_.empty();
177 }
T perp() const
Definition: PV3DBase.h:69
T z() const
Definition: PV3DBase.h:61
const Propagator * propagator_
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66
#define LogTrace(id)
GlobalPoint position() const
T mag() const
Definition: PV3DBase.h:64
T1 phi() const
Definition: Phi.h:78
std::deque< SteppingHelixStateInfo > fullTrajectory_
void propagateForward(SteppingHelixStateInfo &state, float distance)
Log< level::Warning, false > LogWarning

◆ propagateForward()

void CachedTrajectory::propagateForward ( SteppingHelixStateInfo state,
float  distance 
)
private

Definition at line 58 of file CachedTrajectory.cc.

References Plane::build(), distance(), funct::pow(), propagate(), dttmaxenums::r32, idealTransformation::rotation, mathSSE::sqrt(), filterCSVwithJSON::target, and trackerHitRTTI::vector.

Referenced by getTrajectory(), and propagateAll().

58  {
59  // defined a normal plane wrt the particle trajectory direction
60  // let's hope that I computed the rotation matrix correctly.
61  GlobalVector vector(state.momentum().unit());
62  float r21 = 0;
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;
71 
72  Surface::RotationType rotation(r11, r12, r13, r21, r22, r23, r31, r32, r33);
75 }
static PlanePointer build(Args &&... args)
Definition: Plane.h:33
T sqrt(T t)
Definition: SSEVec.h:19
float distance(const Plane *plane, int index)
void propagate(SteppingHelixStateInfo &state, const Plane &plane)
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29

◆ 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().

431  {
432  fullTrajectory_.clear();
433  ecalTrajectory_.clear();
434  hcalTrajectory_.clear();
435  hoTrajectory_.clear();
436  preshowerTrajectory_.clear();
437  wideEcalTrajectory_.clear();
438  wideHcalTrajectory_.clear();
439  wideHOTrajectory_.clear();
440  fullTrajectoryFilled_ = false;
441 }
std::vector< SteppingHelixStateInfo > ecalTrajectory_
std::vector< GlobalPoint > wideHcalTrajectory_
std::vector< GlobalPoint > wideEcalTrajectory_
std::vector< SteppingHelixStateInfo > hoTrajectory_
std::vector< GlobalPoint > wideHOTrajectory_
std::vector< SteppingHelixStateInfo > preshowerTrajectory_
std::deque< SteppingHelixStateInfo > fullTrajectory_
std::vector< SteppingHelixStateInfo > hcalTrajectory_

◆ setMaxDetectorLength()

void CachedTrajectory::setMaxDetectorLength ( float  l = 2200.)
inlineprivate

Definition at line 114 of file CachedTrajectory.h.

References MainPageGenerator::l, and maxZ_.

Referenced by CachedTrajectory(), and propagateThoughFromIP().

◆ setMaxDetectorRadius()

void CachedTrajectory::setMaxDetectorRadius ( float  r = 800.)
inlineprivate

Definition at line 113 of file CachedTrajectory.h.

References maxRho_, and alignCSCRings::r.

Referenced by CachedTrajectory(), and propagateThoughFromIP().

◆ setMaxHOLength()

void CachedTrajectory::setMaxHOLength ( float  l = 2200.)
inlineprivate

Definition at line 116 of file CachedTrajectory.h.

References HOmaxZ_, and MainPageGenerator::l.

◆ setMaxHORadius()

void CachedTrajectory::setMaxHORadius ( float  r = 800.)
inlineprivate

Definition at line 115 of file CachedTrajectory.h.

References HOmaxRho_, and alignCSCRings::r.

◆ setMinDetectorLength()

void CachedTrajectory::setMinDetectorLength ( float  l = 0.)
inlineprivate

Definition at line 118 of file CachedTrajectory.h.

References MainPageGenerator::l, and minZ_.

Referenced by CachedTrajectory(), and propagateThoughFromIP().

◆ setMinDetectorRadius()

void CachedTrajectory::setMinDetectorRadius ( float  r = 0.)
inlineprivate

Definition at line 117 of file CachedTrajectory.h.

References minRho_, and alignCSCRings::r.

Referenced by CachedTrajectory(), and propagateThoughFromIP().

◆ setPropagationStep()

void CachedTrajectory::setPropagationStep ( float  s = 20.)
inlineprivate

Definition at line 120 of file CachedTrajectory.h.

References alignCSCRings::s, and step_.

Referenced by CachedTrajectory(), and propagateThoughFromIP().

◆ setPropagator()

void CachedTrajectory::setPropagator ( const Propagator ptr)
inlineprivate

Definition at line 83 of file CachedTrajectory.h.

References propagator_.

Referenced by propagateThoughFromIP().

83 { propagator_ = ptr; }
const Propagator * propagator_

◆ setStateAtIP()

void CachedTrajectory::setStateAtIP ( const SteppingHelixStateInfo state)
inlineprivate

Definition at line 84 of file CachedTrajectory.h.

References stateAtIP_.

Referenced by propagateThoughFromIP().

84 { stateAtIP_ = state; }
SteppingHelixStateInfo stateAtIP_

◆ sign()

static int CachedTrajectory::sign ( float  number)
inlinestaticprotected

Definition at line 124 of file CachedTrajectory.h.

References contentValuesFiles::number.

Referenced by propagate().

124  {
125  if (number == 0)
126  return 0;
127  if (number > 0)
128  return 1;
129  else
130  return -1;
131  }

◆ 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.

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().

256  {
257  // MEaning of trajectory change depends on its usage. In most cases we measure
258  // change in a trajectory as difference between final track position and initial
259  // direction. In some cases such as change of trajectory in the muon detector we
260  // might want to compare theta-phi of two points or even find local maximum and
261  // mimimum. In general it's not essential what defenition of the trajectory change
262  // is used since we use these numbers only as a rough estimate on how much wider
263  // we should make the preselection region.
264  std::pair<float, float> result(0, 0);
265  if (!stateAtIP_.isValid()) {
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";
268  return result;
269  }
270  switch (trajectoryType) {
271  case IpToEcal:
272  if (ecalTrajectory_.empty())
273  edm::LogWarning("TrackAssociator") << "ECAL trajector is empty. Cannot estimate trajectory change. "
274  << "Trajectory change is not taken into account in matching";
275  else
276  return delta(stateAtIP_.momentum().theta(),
277  ecalTrajectory_.front().position().theta(),
278  stateAtIP_.momentum().phi(),
279  ecalTrajectory_.front().position().phi());
280  break;
281  case IpToHcal:
282  if (hcalTrajectory_.empty())
283  edm::LogWarning("TrackAssociator") << "HCAL trajector is empty. Cannot estimate trajectory change. "
284  << "Trajectory change is not taken into account in matching";
285  else
286  return delta(stateAtIP_.momentum().theta(),
287  hcalTrajectory_.front().position().theta(),
288  stateAtIP_.momentum().phi(),
289  hcalTrajectory_.front().position().phi());
290  break;
291  case IpToHO:
292  if (hoTrajectory_.empty())
293  edm::LogWarning("TrackAssociator") << "HO trajector is empty. Cannot estimate trajectory change. "
294  << "Trajectory change is not taken into account in matching";
295  else
296  return delta(stateAtIP_.momentum().theta(),
297  hoTrajectory_.front().position().theta(),
298  stateAtIP_.momentum().phi(),
299  hoTrajectory_.front().position().phi());
300  break;
301  case FullTrajectory:
302  if (fullTrajectory_.empty())
303  edm::LogWarning("TrackAssociator") << "Full trajector is empty. Cannot estimate trajectory change. "
304  << "Trajectory change is not taken into account in matching";
305  else
306  return delta(stateAtIP_.momentum().theta(),
307  fullTrajectory_.back().position().theta(),
308  stateAtIP_.momentum().phi(),
309  fullTrajectory_.back().position().phi());
310  break;
311  default:
312  edm::LogWarning("TrackAssociator")
313  << "Unkown or not supported trajector type. Cannot estimate trajectory change. "
314  << "Trajectory change is not taken into account in matching";
315  }
316  return result;
317 }
SteppingHelixStateInfo stateAtIP_
std::vector< SteppingHelixStateInfo > ecalTrajectory_
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66
std::vector< SteppingHelixStateInfo > hoTrajectory_
std::pair< float, float > delta(const double &theta1, const double &theta2, const double &phi1, const double &phi2)
std::deque< SteppingHelixStateInfo > fullTrajectory_
GlobalVector momentum() const
Log< level::Warning, false > LogWarning
std::vector< SteppingHelixStateInfo > hcalTrajectory_
Geom::Theta< T > theta() const
Definition: PV3DBase.h:72

Friends And Related Function Documentation

◆ propagateThoughFromIP

std::vector<SteppingHelixStateInfo> propagateThoughFromIP ( const SteppingHelixStateInfo state,
const Propagator ptr,
const FiducialVolume volume,
int  nsteps,
float  step,
float  minR,
float  minZ,
float  maxR,
float  maxZ 
)
friend

Definition at line 18 of file CachedTrajectory.cc.

26  {
27  CachedTrajectory neckLace;
28  neckLace.setStateAtIP(state);
29  neckLace.reset_trajectory();
30  neckLace.setPropagator(prop);
31  neckLace.setPropagationStep(0.1);
32  neckLace.setMinDetectorRadius(minR);
33  neckLace.setMinDetectorLength(minZ * 2.);
34  neckLace.setMaxDetectorRadius(maxR);
35  neckLace.setMaxDetectorLength(maxZ * 2.);
36 
37  // Propagate track
38  bool isPropagationSuccessful = neckLace.propagateAll(state);
39 
40  if (!isPropagationSuccessful)
41  return std::vector<SteppingHelixStateInfo>();
42 
43  std::vector<SteppingHelixStateInfo> complicatePoints;
44  neckLace.getTrajectory(complicatePoints, volume, nsteps);
45 
46  return complicatePoints;
47 }
void setMinDetectorLength(float l=0.)
void setMinDetectorRadius(float r=0.)
void setPropagationStep(float s=20.)
void getTrajectory(std::vector< SteppingHelixStateInfo > &, const FiducialVolume &, int steps=4)
bool propagateAll(const SteppingHelixStateInfo &initialState)
propagate through the whole detector, returns true if successful
void setPropagator(const Propagator *ptr)
void setStateAtIP(const SteppingHelixStateInfo &state)
void setMaxDetectorLength(float l=2200.)
void setMaxDetectorRadius(float r=800.)

◆ TrackDetectorAssociator

friend class TrackDetectorAssociator
friend

Definition at line 52 of file CachedTrajectory.h.

Member Data Documentation

◆ ecalTrajectory_

std::vector<SteppingHelixStateInfo> CachedTrajectory::ecalTrajectory_
protected

◆ fullTrajectory_

std::deque<SteppingHelixStateInfo> CachedTrajectory::fullTrajectory_
protected

◆ fullTrajectoryFilled_

bool CachedTrajectory::fullTrajectoryFilled_
protected

Definition at line 152 of file CachedTrajectory.h.

Referenced by getTrajectory(), propagateAll(), and reset_trajectory().

◆ hcalTrajectory_

std::vector<SteppingHelixStateInfo> CachedTrajectory::hcalTrajectory_
protected

◆ HOmaxRho_

float CachedTrajectory::HOmaxRho_
protected

Definition at line 158 of file CachedTrajectory.h.

Referenced by setMaxHORadius().

◆ HOmaxZ_

float CachedTrajectory::HOmaxZ_
protected

Definition at line 159 of file CachedTrajectory.h.

Referenced by setMaxHOLength().

◆ hoTrajectory_

std::vector<SteppingHelixStateInfo> CachedTrajectory::hoTrajectory_
protected

◆ maxRho_

float CachedTrajectory::maxRho_
protected

Definition at line 156 of file CachedTrajectory.h.

Referenced by propagateAll(), and setMaxDetectorRadius().

◆ maxZ_

float CachedTrajectory::maxZ_
protected

Definition at line 157 of file CachedTrajectory.h.

Referenced by propagateAll(), and setMaxDetectorLength().

◆ minRho_

float CachedTrajectory::minRho_
protected

Definition at line 160 of file CachedTrajectory.h.

Referenced by propagateAll(), and setMinDetectorRadius().

◆ minZ_

float CachedTrajectory::minZ_
protected

Definition at line 161 of file CachedTrajectory.h.

Referenced by propagateAll(), and setMinDetectorLength().

◆ preshowerTrajectory_

std::vector<SteppingHelixStateInfo> CachedTrajectory::preshowerTrajectory_
protected

◆ propagator_

const Propagator* CachedTrajectory::propagator_
protected

Definition at line 154 of file CachedTrajectory.h.

Referenced by propagate(), propagateAll(), and setPropagator().

◆ stateAtIP_

SteppingHelixStateInfo CachedTrajectory::stateAtIP_
protected

Definition at line 150 of file CachedTrajectory.h.

Referenced by setStateAtIP(), and trajectoryDelta().

◆ step_

float CachedTrajectory::step_
protected

Definition at line 162 of file CachedTrajectory.h.

Referenced by getPropagationStep(), propagateAll(), and setPropagationStep().

◆ wideEcalTrajectory_

std::vector<GlobalPoint> CachedTrajectory::wideEcalTrajectory_
protected

Definition at line 147 of file CachedTrajectory.h.

Referenced by getWideTrajectory(), and reset_trajectory().

◆ wideHcalTrajectory_

std::vector<GlobalPoint> CachedTrajectory::wideHcalTrajectory_
protected

Definition at line 148 of file CachedTrajectory.h.

Referenced by getWideTrajectory(), and reset_trajectory().

◆ wideHOTrajectory_

std::vector<GlobalPoint> CachedTrajectory::wideHOTrajectory_
protected

Definition at line 149 of file CachedTrajectory.h.

Referenced by getWideTrajectory(), and reset_trajectory().