CMS 3D CMS Logo

MuonErrorMatrix.h
Go to the documentation of this file.
1 #ifndef MUONERRORMATRIX_H
2 #define MUONERRORMATRIX_H
3 
18 
19 #include <TFile.h>
20 #include <TProfile3D.h>
21 #include <TString.h>
22 #include <TAxis.h>
23 
25 public:
27  enum action { use, constructor };
30 
33 
35  void close();
36 
38  CurvilinearTrajectoryError get(GlobalVector momentum, bool convolute = true);
40 
42  static void multiply(CurvilinearTrajectoryError& initial_error, const CurvilinearTrajectoryError& scale_error);
43 
45  static bool divide(CurvilinearTrajectoryError& num_error, const CurvilinearTrajectoryError& denom_error);
46 
48  inline TProfile3D* get(int i, int j) { return Index(i, j); }
49  inline unsigned int index(int i, int j) { return Pindex(i, j); }
50 
52  static const TString vars[5];
53 
55  static double Term(const AlgebraicSymMatrix55& curv, int i, int j);
56 
58  int findBin(TAxis* axis, double value);
59 
62 
65 
68 
71 
72 private:
75 
77  TDirectory* theD;
79  TProfile3D* theData[15];
80  TProfile3D* theData_fast[5][5];
81 
85 
87  inline int Pindex(int i, int j) {
88  static const int offset[5] = {0, 5, 5 + 4, 5 + 4 + 3, 5 + 4 + 3 + 2};
89  return offset[i] + abs(j - i);
90  }
92  inline TProfile3D* Index(int i, int j) { return theData[Pindex(i, j)]; }
93 
95  double Value(GlobalVector& momentum, int i, int j, bool convolute = true);
97  double Rms(GlobalVector& momentum, int i, int j);
98 };
99 
100 #endif
void adjust(FreeTrajectoryState &state)
adjust the error matrix on the state
static bool divide(CurvilinearTrajectoryError &num_error, const CurvilinearTrajectoryError &denom_error)
divide term by term the two matrix
int findBin(TAxis *axis, double value)
method to get the bin index, taking care of under/overlow: first(1)/last(GetNbins())returned ...
unsigned int index(int i, int j)
double Value(GlobalVector &momentum, int i, int j, bool convolute=true)
internal method that retreives the value of the parametrization for term i,j
~MuonErrorMatrix()
destructor
static double Term(const AlgebraicSymMatrix55 &curv, int i, int j)
provide the numerical value used. sigma or correlation factor
action
enum type to define if the class is used as a tool or to be created
static std::string const input
Definition: EdmProvDump.cc:47
void complicatedTerm(const AlgebraicSymMatrix55 &input, AlgebraicSymMatrix55 &output)
convert sigma/rho -> sigma2/COV
TermAction theTermAction[15]
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
MuonErrorMatrix(const edm::ParameterSet &pset)
constructor from a parameter set
TermAction
decide whether to scale of to assigne terms
static void multiply(CurvilinearTrajectoryError &initial_error, const CurvilinearTrajectoryError &scale_error)
multiply term by term the two matrix
int Pindex(int i, int j)
internal methods to get the index of a matrix term.
Definition: value.py:1
TProfile3D * theData_fast[5][5]
void simpleTerm(const AlgebraicSymMatrix55 &input, AlgebraicSymMatrix55 &output)
convert sigma2/COV -> sigma/rho
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
double Rms(GlobalVector &momentum, int i, int j)
internal method that retreives the error on the value of the parametrization for term i...
TDirectory * theD
the attached root file, where the parametrization is saved
CurvilinearTrajectoryError getFast(GlobalVector momentum)
vars
Definition: DeepTauId.cc:30
TProfile3D * theData[15]
15 TProfile, each holding he parametrization of each term of the 5x5
std::string theCategory
log category: "MuonErrorMatrix"
void close()
close the root file attached to the class
TProfile3D * Index(int i, int j)
internal method to get access to the profiles