CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_10_patch1/src/RecoMuon/TrackingTools/interface/MuonErrorMatrix.h

Go to the documentation of this file.
00001 #ifndef MUONERRORMATRIX_H
00002 #define MUONERRORMATRIX_H
00003 
00021 #include <TrackingTools/TrajectoryState/interface/TrajectoryStateOnSurface.h>
00022 #include <TrackingTools/TrajectoryState/interface/FreeTrajectoryState.h>
00023 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00024 
00025 #include <TFile.h>
00026 #include <TProfile3D.h>
00027 #include <TString.h>
00028 #include <TAxis.h>
00029 
00030 
00031 class MuonErrorMatrix{
00032  public:
00034   enum action { use , constructor};
00036   MuonErrorMatrix(const edm::ParameterSet & pset);
00037   
00039   ~MuonErrorMatrix();
00040 
00042   void close();
00043   
00045   CurvilinearTrajectoryError get(GlobalVector momentum,bool convolute=true);
00046   CurvilinearTrajectoryError getFast(GlobalVector momentum);
00047 
00049   static  void multiply(CurvilinearTrajectoryError & initial_error, const CurvilinearTrajectoryError & scale_error);
00050 
00052   static  bool divide(CurvilinearTrajectoryError & num_error, const CurvilinearTrajectoryError & denom_error);
00053 
00055   inline TProfile3D * get(int i , int j) {return Index(i,j);}
00056   inline unsigned int index(int i, int j){return Pindex(i,j);}
00057 
00059   static const TString vars[5];
00060 
00062   static double Term(const AlgebraicSymMatrix55 & curv, int i, int j);
00063 
00065   int findBin(TAxis * axis, double value);
00066 
00068   void simpleTerm(const AlgebraicSymMatrix55 & input, AlgebraicSymMatrix55 & output);
00069   
00071   void complicatedTerm(const AlgebraicSymMatrix55 & input, AlgebraicSymMatrix55 & output);
00072 
00074   void adjust(FreeTrajectoryState & state);
00075 
00077   void adjust(TrajectoryStateOnSurface & state);
00078 
00079  private:
00081   std::string theCategory;
00082 
00084   TDirectory * theD;
00086   TProfile3D * theData[15];
00087   TProfile3D * theData_fast[5][5];
00088 
00090   enum TermAction  { error, scale, assign };
00091   TermAction theTermAction[15];  
00092 
00094   inline int Pindex(int i , int j) {
00095     static const int offset[5]={0,5,5+4,5+4+3,5+4+3+2};
00096     return offset[i]+abs(j-i);}
00098   inline TProfile3D * Index(int i , int j) {
00099     return theData[Pindex(i,j)];}
00100 
00101 
00103   double Value(GlobalVector & momentum, int i, int j,bool convolute=true);
00105   double Rms(GlobalVector & momentum, int i, int j);
00106   
00107 
00108 };
00109 
00110 
00111 
00112 #endif