Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-03-17 11:26:36

0001 #ifndef TrackingTools_TrackRefitter_RefitDirection_H
0002 #define TrackingTools_TrackRefitter_RefitDirection_H
0003 
0004 /** \class RefitDirection
0005  *  Help class in order to handle the different refit possibilities
0006  *
0007  *  \author R. Bellan - INFN Torino <riccardo.bellan@cern.ch>
0008  */
0009 
0010 #include "DataFormats/TrajectorySeed/interface/PropagationDirection.h"
0011 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0012 
0013 class RefitDirection {
0014 public:
0015   enum GeometricalDirection { insideOut, outsideIn, undetermined };
0016 
0017   /// Constructor
0018   RefitDirection() {
0019     thePropagationDirection = anyDirection;
0020     theGeoDirection = undetermined;
0021   }
0022 
0023   explicit RefitDirection(std::string const& type) {
0024     thePropagationDirection = anyDirection;
0025     theGeoDirection = undetermined;
0026 
0027     if (type == "alongMomentum")
0028       thePropagationDirection = alongMomentum;
0029     else if (type == "oppositeToMomentum")
0030       thePropagationDirection = oppositeToMomentum;
0031     else if (type == "insideOut")
0032       theGeoDirection = insideOut;
0033     else if (type == "outsideIn")
0034       theGeoDirection = outsideIn;
0035     else
0036       throw cms::Exception("RefitDirection")
0037           << "Wrong refit direction chosen in TrackTransformer ParameterSet"
0038           << "\n"
0039           << "Possible choices are:"
0040           << "\n"
0041           << "RefitDirection = [alongMomentum, oppositeToMomentum, insideOut, outsideIn]";
0042   }
0043 
0044   // Operations
0045   inline GeometricalDirection geometricalDirection() const {
0046     if (theGeoDirection == undetermined)
0047       LogTrace("Reco|TrackingTools|TrackTransformer") << "Try to use undetermined geometrical direction";
0048     return theGeoDirection;
0049   }
0050   inline PropagationDirection propagationDirection() const {
0051     if (thePropagationDirection == anyDirection)
0052       LogTrace("Reco|TrackingTools|TrackTransformer") << "Try to use anyDirection as propagation direction";
0053     return thePropagationDirection;
0054   }
0055 
0056 protected:
0057 private:
0058   GeometricalDirection theGeoDirection;
0059   PropagationDirection thePropagationDirection;
0060 };
0061 #endif