Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:31:28

0001 #ifndef _CR_PropagationDirectionFromPath
0002 #define _CR_PropagationDirectionFromPath
0003 
0004 #include "DataFormats/TrajectorySeed/interface/PropagationDirection.h"
0005 /** \class PropagationDirectionFromPath
0006  *  Converts sign of path to propagation direction.
0007  */
0008 class PropagationDirectionFromPath {
0009 public:
0010   /// Direction from sign of path length
0011   inline PropagationDirection operator()(const double& s) const { return s >= 0 ? alongMomentum : oppositeToMomentum; }
0012   /// Direction from second argument, from sign of path length,
0013   inline PropagationDirection operator()(const double& s, const PropagationDirection propDir) const {
0014     if (propDir != anyDirection)
0015       return propDir;
0016     return (*this)(s);
0017   }
0018 };
0019 #endif