CMS 3D CMS Logo

CachedTrajectory.h

Go to the documentation of this file.
00001 #ifndef TrackAssociator_CachedTrajectory_h
00002 #define TrackAssociator_CachedTrajectory_h 1
00003 // -*- C++ -*-
00004 //
00005 // Package:    TrackAssociator
00006 // Class:      CachedTrajectory
00007 // 
00008 /*
00009 
00010  Description: CachedTrajectory is a transient class, which stores a set of
00011  * trajectory states that can be used as starting points when there is need
00012  * propagate the same track to a number of different surfaces, which might 
00013  * not be know in advance.
00014 
00015  Implementation:
00016      <Notes on implementation>
00017 */
00018 //
00019 // Original Author:  Dmytro Kovalskyi
00020 //         Created:  Fri Apr 21 10:59:41 PDT 2006
00021 // $Id: CachedTrajectory.h,v 1.11 2008/08/07 02:06:23 dmytro Exp $
00022 //
00023 //
00024 
00025 #include "TrackingTools/TrackAssociator/interface/DetIdAssociator.h"
00026 #include "TrackingTools/TrackAssociator/interface/TAMuonChamberMatch.h"
00027 #include "TrackingTools/TrackAssociator/interface/FiducialVolume.h"
00028 #include "TrackPropagation/SteppingHelixPropagator/interface/SteppingHelixStateInfo.h"
00029 #include "Geometry/CommonDetUnit/interface/GlobalTrackingGeometry.h"
00030 #include "Geometry/CommonDetUnit/interface/GeomDet.h"
00031 #include "DataFormats/DetId/interface/DetId.h"
00032 #include <deque>
00033 
00034 class CachedTrajectory {
00035  public:
00036    CachedTrajectory();
00037    enum TrajectorType { IpToEcal, IpToHcal, IpToHO, FullTrajectory };
00038    enum WideTrajectoryType { Ecal, Hcal, HO };
00039 
00040    void reset_trajectory();
00041    
00043    bool propagateAll(const SteppingHelixStateInfo& initialState);
00044    
00045    void propagateForward(SteppingHelixStateInfo& state, float distance);
00046 
00048    TrajectoryStateOnSurface propagate(const Plane* plane);
00049  
00052    std::pair<float,float> trajectoryDelta( TrajectorType );
00053    
00054    void setPropagator(const Propagator* ptr){   propagator_ = ptr; }
00055    void setStateAtIP(const SteppingHelixStateInfo& state){ stateAtIP_ = state; }
00056    
00060    void getTrajectory(std::vector<SteppingHelixStateInfo>&,
00061                       const FiducialVolume&,
00062                       int steps = 4);
00063    
00064    void findEcalTrajectory(const FiducialVolume&);
00065    void findHcalTrajectory(const FiducialVolume&);
00066    void findHOTrajectory(const FiducialVolume&);
00067 
00068    const std::vector<SteppingHelixStateInfo>& getEcalTrajectory();
00069    const std::vector<SteppingHelixStateInfo>& getHcalTrajectory();
00070    const std::vector<SteppingHelixStateInfo>& getHOTrajectory();
00071 
00072    std::vector<GlobalPoint>* getWideTrajectory(const std::vector<SteppingHelixStateInfo>&,
00073                                                      WideTrajectoryType);
00074 
00075    SteppingHelixStateInfo getStateAtEcal();
00076    SteppingHelixStateInfo getStateAtHcal();
00077    SteppingHelixStateInfo getStateAtHO();
00078    
00079    //get the innermost state of the whole trajectory 
00080    SteppingHelixStateInfo getInnerState();
00081    //get the outermost state of the whole trajectory 
00082    SteppingHelixStateInfo getOuterState();
00083    
00084    // specify the detector global boundaries to limit the propagator
00085    // units: cm
00086    // HINT: use lower bounds to limit propagateAll() action within
00087    //       smaller region, such as ECAL for example
00088    void setMaxDetectorRadius(float r = 800.){ maxRho_ = r;}
00089    void setMaxDetectorLength(float l = 2200.){ maxZ_ = l/2.;}
00090    void setMaxHORadius(float r = 800.) { HOmaxRho_ = r;}
00091    void setMaxHOLength(float l = 2200.) { HOmaxZ_ = l/2.;}
00092    void setMinDetectorRadius(float r = 0.){ minRho_ = r;}
00093    void setMinDetectorLength(float l = 0.){ minZ_ = l/2.;}
00094 
00095    void setPropagationStep(float s = 20.){ step_ = s;}
00096    float getPropagationStep() const { return step_;}
00097    
00098  protected:
00099    
00100    static int sign (float number){
00101       if (number ==0) return 0;
00102       if (number > 0)
00103         return 1;
00104       else
00105         return -1;
00106    }
00107    
00108    std::pair<float,float> delta( const double& theta1,
00109                                  const double& theta2,
00110                                  const double& phi1,
00111                                  const double& phi2);
00112    
00113    float distance(const Plane* plane, int index) {
00114       if (index<0 || fullTrajectory_.empty() || uint(index) >= fullTrajectory_.size()) return 0;
00115       return plane->localZ(fullTrajectory_[index].position());
00116    }
00117    
00118    std::deque<SteppingHelixStateInfo> fullTrajectory_;
00119    std::vector<SteppingHelixStateInfo> ecalTrajectory_;
00120    std::vector<SteppingHelixStateInfo> hcalTrajectory_;
00121    std::vector<SteppingHelixStateInfo> hoTrajectory_;
00122    std::vector<GlobalPoint> wideEcalTrajectory_; 
00123    std::vector<GlobalPoint> wideHcalTrajectory_;
00124    std::vector<GlobalPoint> wideHOTrajectory_;
00125    SteppingHelixStateInfo stateAtIP_;
00126    
00127    bool fullTrajectoryFilled_;
00128    
00129    const Propagator* propagator_;
00130    
00131    float maxRho_;
00132    float maxZ_;
00133    float HOmaxRho_;
00134    float HOmaxZ_;
00135    float minRho_;
00136    float minZ_;
00137    float step_;
00138 
00139 };
00140 #endif

Generated on Tue Jun 9 17:48:28 2009 for CMSSW by  doxygen 1.5.4