File indexing completed on 2024-04-06 12:27:17
0001 #ifndef MUONERRORMATRIX_H
0002 #define MUONERRORMATRIX_H
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015 #include <TrackingTools/TrajectoryState/interface/TrajectoryStateOnSurface.h>
0016 #include <TrackingTools/TrajectoryState/interface/FreeTrajectoryState.h>
0017 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0018
0019 #include <TFile.h>
0020 #include <TProfile3D.h>
0021 #include <TString.h>
0022 #include <TAxis.h>
0023
0024 class MuonErrorMatrix {
0025 public:
0026
0027 enum action { use, constructor };
0028
0029 MuonErrorMatrix(const edm::ParameterSet& pset);
0030
0031
0032 ~MuonErrorMatrix();
0033
0034
0035 void close();
0036
0037
0038 CurvilinearTrajectoryError get(GlobalVector momentum, bool convolute = true);
0039 CurvilinearTrajectoryError getFast(GlobalVector momentum);
0040
0041
0042 static void multiply(CurvilinearTrajectoryError& initial_error, const CurvilinearTrajectoryError& scale_error);
0043
0044
0045 static bool divide(CurvilinearTrajectoryError& num_error, const CurvilinearTrajectoryError& denom_error);
0046
0047
0048 inline TProfile3D* get(int i, int j) { return Index(i, j); }
0049 inline unsigned int index(int i, int j) { return Pindex(i, j); }
0050
0051
0052 static const TString vars[5];
0053
0054
0055 static double Term(const AlgebraicSymMatrix55& curv, int i, int j);
0056
0057
0058 int findBin(TAxis* axis, double value);
0059
0060
0061 void simpleTerm(const AlgebraicSymMatrix55& input, AlgebraicSymMatrix55& output);
0062
0063
0064 void complicatedTerm(const AlgebraicSymMatrix55& input, AlgebraicSymMatrix55& output);
0065
0066
0067 void adjust(FreeTrajectoryState& state);
0068
0069
0070 void adjust(TrajectoryStateOnSurface& state);
0071
0072 private:
0073
0074 std::string theCategory;
0075
0076
0077 TDirectory* theD;
0078
0079 TProfile3D* theData[15];
0080 TProfile3D* theData_fast[5][5];
0081
0082
0083 enum TermAction { error, scale, assign };
0084 TermAction theTermAction[15];
0085
0086
0087 inline int Pindex(int i, int j) {
0088 static const int offset[5] = {0, 5, 5 + 4, 5 + 4 + 3, 5 + 4 + 3 + 2};
0089 return offset[i] + abs(j - i);
0090 }
0091
0092 inline TProfile3D* Index(int i, int j) { return theData[Pindex(i, j)]; }
0093
0094
0095 double Value(GlobalVector& momentum, int i, int j, bool convolute = true);
0096
0097 double Rms(GlobalVector& momentum, int i, int j);
0098 };
0099
0100 #endif