CMS 3D CMS Logo

InvMatrixUtils.h
Go to the documentation of this file.
1 
7 #ifndef InvMatrixUtils_h
8 #define InvMatrixUtils_h
9 
10 #include <string>
11 #include <map>
12 #include "TObject.h"
13 #include "TF1.h"
14 #include "TH2.h"
15 #include "TProfile.h"
16 #include "TCanvas.h"
17 #include "CLHEP/Geometry/Point3D.h"
18 #include "CLHEP/Matrix/GenMatrix.h"
19 #include "CLHEP/Matrix/Matrix.h"
20 #include "CLHEP/Matrix/Vector.h"
21 #include "TFile.h"
22 
23 //#include "ConfigParser.h"
25 
27 void setStyle();
28 
31 TCanvas* getGlobalCanvas(std::string name = "Inv MatrixCanvas");
32 
35 TFile* getGlobalTFile(std::string name = "Inv MatrixTFile.root");
36 //TFile * getGlobalTFile (const char* name) ;
37 
40 int saveGlobalTFile(std::string name = "Inv MatrixFile.root");
41 
45 CLHEP::HepMatrix* getSavedMatrix(const std::string& name);
46 
48 HepGeom::Point3D<Float_t> TBposition(const Float_t amplit[7][7],
49  const Float_t beamEne,
50  const Float_t w0 = 4.0,
51  const Float_t x0 = 8.9, //mm
52  const Float_t a0 = 6.2,
53  const Float_t sideX = 24.06, //mm
54  const Float_t sideY = 22.02); //mm
55 
58 double get5x5(const Float_t energy[7][7]);
59 
62 double get3x3(const Float_t energy[7][7]);
63 
65 int parseConfigFile(const TString& config);
66 
68 int xtalFromEtaPhi(const int& myEta, const int& myPhi);
69 
74 int xtalFromiEtaiPhi(const int& iEta, const int& iPhi);
75 
77 int etaFromXtal(const int& xtal);
78 
80 int phiFromXtal(const int& xtal);
81 
83 int ietaFromXtal(const int& xtal);
84 
86 int iphiFromXtal(const int& xtal);
87 
90 int extract(std::vector<int>* output, const std::string& dati);
91 
93 int writeCalibTxt(const CLHEP::HepMatrix& AmplitudeMatrix,
94  const CLHEP::HepMatrix& SigmaMatrix,
95  const CLHEP::HepMatrix& StatisticMatrix,
96  std::string fileName = "calibOutput.txt");
97 
99 int writeCMSSWCoeff(const CLHEP::HepMatrix& amplMatrix,
100  double calibThres,
101  float ERef,
102  const CLHEP::HepMatrix& sigmaMatrix,
103  const CLHEP::HepMatrix& statisticMatrix,
104  std::string fileName = "calibOutput.txt",
105  std::string genTag = "CAL_GENTAG",
106  std::string method = "CAL_METHOD",
107  std::string version = "CAL_VERSION",
108  std::string type = "CAL_TYPE");
109 
112 int writeCMSSWCoeff(const CLHEP::HepMatrix& amplMatrix,
113  double calibThres,
114  int etaRef,
115  int phiRef,
116  const CLHEP::HepMatrix& sigmaMatrix,
117  const CLHEP::HepMatrix& statisticMatrix,
118  std::string fileName = "calibOutput.txt",
119  std::string genTag = "CAL_GENTAG",
120  std::string method = "CAL_METHOD",
121  std::string version = "CAL_VERSION",
122  std::string type = "CAL_TYPE");
123 
126 int translateCoeff(const CLHEP::HepMatrix& calibcoeff,
127  const CLHEP::HepMatrix& sigmaMatrix,
128  const CLHEP::HepMatrix& statisticMatrix,
129  std::string SMnumber = "1",
130  double calibThres = 0.01,
131  std::string fileName = "calibOutput.txt",
132  std::string genTag = "CAL_GENTAG",
133  std::string method = "CAL_METHOD",
134  std::string version = "CAL_VERSION",
135  std::string type = "CAL_TYPE");
136 
139 int readCMSSWcoeff(CLHEP::HepMatrix& calibcoeff, const std::string& inputFileName, double defaultVal = 1.);
140 
143 int readCMSSWcoeffForComparison(CLHEP::HepMatrix& calibcoeff, const std::string& inputFileName);
144 
146 TH1D* smartProfile(TH2F* strip, double width);
147 
150 TH1D* smartGausProfile(TH2F* strip, double width);
151 
154 TH1D* smartError(TH1D* strip);
155 
160 double effectiveSigma(TH1F& histogram, int vSteps = 100);
161 
166 std::pair<int, int> findSupport(TH1F& histogram, double thres = 0.);
167 
172 void mtrTransfer(double output[SCMaxEta][SCMaxPhi], CLHEP::HepMatrix* input, double Default);
173 
177 template <class Type>
178 void mtrReset(Type superModules[SCMaxEta][SCMaxPhi], const Type val) {
179  for (int e = 0; e < SCMaxEta; ++e)
180  for (int p = 0; p < SCMaxPhi; ++p) {
181  superModules[e][p] = val;
182  }
183 }
184 
187 double etaCorrE1E9(int eta);
190 double etaCorrE1E49(int eta);
193 double etaCorrE1E25(int eta);
194 
195 #endif
SCMaxEta
#define SCMaxEta
Definition: InvMatrixCommonDefs.h:16
InvMatrixCommonDefs.h
ApeEstimator_cff.width
width
Definition: ApeEstimator_cff.py:24
effectiveSigma
double effectiveSigma(TH1F &histogram, int vSteps=100)
Definition: InvMatrixUtils.cc:619
ietaFromXtal
int ietaFromXtal(const int &xtal)
Definition: InvMatrixUtils.cc:243
input
static const std::string input
Definition: EdmProvDump.cc:48
SCMaxPhi
#define SCMaxPhi
Definition: InvMatrixCommonDefs.h:15
convertSQLitetoXML_cfg.output
output
Definition: convertSQLitetoXML_cfg.py:32
getGlobalCanvas
TCanvas * getGlobalCanvas(std::string name="Inv MatrixCanvas")
Definition: InvMatrixUtils.cc:39
digitizers_cfi.strip
strip
Definition: digitizers_cfi.py:19
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
AlcaSiPixelAliHarvester0T_cff.method
method
Definition: AlcaSiPixelAliHarvester0T_cff.py:41
smartProfile
TH1D * smartProfile(TH2F *strip, double width)
Definition: InvMatrixUtils.cc:501
xtalFromEtaPhi
int xtalFromEtaPhi(const int &myEta, const int &myPhi)
Definition: InvMatrixUtils.cc:204
iphiFromXtal
int iphiFromXtal(const int &xtal)
Definition: InvMatrixUtils.cc:247
findSupport
std::pair< int, int > findSupport(TH1F &histogram, double thres=0.)
Definition: InvMatrixUtils.cc:658
MillePedeFileConverter_cfg.fileName
fileName
Definition: MillePedeFileConverter_cfg.py:32
smartError
TH1D * smartError(TH1D *strip)
Definition: InvMatrixUtils.cc:598
config
Definition: config.py:1
getGlobalTFile
TFile * getGlobalTFile(std::string name="Inv MatrixTFile.root")
Definition: InvMatrixUtils.cc:55
mtrReset
void mtrReset(Type superModules[85][20], const Type val)
Definition: InvMatrixUtils.h:178
susybsm::HSCParticleType::Type
Type
Definition: HSCParticle.h:20
InefficientDoubleROC.inputFileName
inputFileName
Definition: InefficientDoubleROC.py:437
PVValHelper::eta
Definition: PVValidationHelpers.h:69
HCALHighEnergyHPDFilter_cfi.energy
energy
Definition: HCALHighEnergyHPDFilter_cfi.py:5
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
setStyle
void setStyle()
Definition: offsetStack.cc:165
mtrTransfer
void mtrTransfer(double output[85][20], CLHEP::HepMatrix *input, double Default)
Definition: InvMatrixUtils.cc:684
phiFromXtal
int phiFromXtal(const int &xtal)
Definition: InvMatrixUtils.cc:236
getSavedMatrix
CLHEP::HepMatrix * getSavedMatrix(const std::string &name)
Definition: InvMatrixUtils.cc:81
smartGausProfile
TH1D * smartGausProfile(TH2F *strip, double width)
Definition: InvMatrixUtils.cc:546
writeCMSSWCoeff
int writeCMSSWCoeff(const CLHEP::HepMatrix &amplMatrix, double calibThres, float ERef, const CLHEP::HepMatrix &sigmaMatrix, const CLHEP::HepMatrix &statisticMatrix, std::string fileName="calibOutput.txt", std::string genTag="CAL_GENTAG", std::string method="CAL_METHOD", std::string version="CAL_VERSION", std::string type="CAL_TYPE")
Definition: InvMatrixUtils.cc:320
readCMSSWcoeffForComparison
int readCMSSWcoeffForComparison(CLHEP::HepMatrix &calibcoeff, const std::string &inputFileName)
Definition: InvMatrixUtils.cc:472
parseConfigFile
int parseConfigFile(const TString &config)
etaCorrE1E9
double etaCorrE1E9(int eta)
Definition: InvMatrixUtils.cc:729
etaFromXtal
int etaFromXtal(const int &xtal)
Definition: InvMatrixUtils.cc:229
type
type
Definition: HCALResponse.h:21
heppy_batch.val
val
Definition: heppy_batch.py:351
etaCorrE1E49
double etaCorrE1E49(int eta)
Definition: InvMatrixUtils.cc:713
extract
int extract(std::vector< int > *output, const std::string &dati)
Definition: InvMatrixUtils.cc:251
TBposition
HepGeom::Point3D< Float_t > TBposition(const Float_t amplit[7][7], const Float_t beamEne, const Float_t w0=4.0, const Float_t x0=8.9, const Float_t a0=6.2, const Float_t sideX=24.06, const Float_t sideY=22.02)
Definition: InvMatrixUtils.cc:106
xtalFromiEtaiPhi
int xtalFromiEtaiPhi(const int &iEta, const int &iPhi)
Definition: InvMatrixUtils.cc:219
Default
#define Default
Definition: vmac.h:110
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
etaCorrE1E25
double etaCorrE1E25(int eta)
Definition: InvMatrixUtils.cc:697
L1TowerCalibrationProducer_cfi.iEta
iEta
Definition: L1TowerCalibrationProducer_cfi.py:60
readCMSSWcoeff
int readCMSSWcoeff(CLHEP::HepMatrix &calibcoeff, const std::string &inputFileName, double defaultVal=1.)
Definition: InvMatrixUtils.cc:443
translateCoeff
int translateCoeff(const CLHEP::HepMatrix &calibcoeff, const CLHEP::HepMatrix &sigmaMatrix, const CLHEP::HepMatrix &statisticMatrix, std::string SMnumber="1", double calibThres=0.01, std::string fileName="calibOutput.txt", std::string genTag="CAL_GENTAG", std::string method="CAL_METHOD", std::string version="CAL_VERSION", std::string type="CAL_TYPE")
Definition: InvMatrixUtils.cc:403
BeamSplash_cfg.version
version
Definition: BeamSplash_cfg.py:45
a0
static constexpr float a0
Definition: L1EGammaCrystalsEmulatorProducer.cc:82
writeCalibTxt
int writeCalibTxt(const CLHEP::HepMatrix &AmplitudeMatrix, const CLHEP::HepMatrix &SigmaMatrix, const CLHEP::HepMatrix &StatisticMatrix, std::string fileName="calibOutput.txt")
Definition: InvMatrixUtils.cc:276
get3x3
double get3x3(const Float_t energy[7][7])
Definition: InvMatrixUtils.cc:165
saveGlobalTFile
int saveGlobalTFile(std::string name="Inv MatrixFile.root")
Definition: InvMatrixUtils.cc:69
get5x5
double get5x5(const Float_t energy[7][7])
Definition: InvMatrixUtils.cc:151
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37