#include "Calibration/Tools/interface/InvMatrixUtils.h"
#include "Calibration/Tools/interface/InvMatrixCommonDefs.h"
#include "TStyle.h"
#include "TROOT.h"
#include "CLHEP/Geometry/Point3D.h"
#include "Calibration/Tools/interface/matrixSaver.h"
#include <iostream>
#include <string>
#include <fstream>
#include <sstream>
#include <vector>
#include <cassert>
Go to the source code of this file.
Functions | |
double | effectiveSigma (TH1F &histogram, int vSteps) |
double | etaCorrE1E25 (int eta) |
double | etaCorrE1E49 (int eta) |
double | etaCorrE1E9 (int eta) |
int | etaFromXtal (const int &xtal) |
int | extract (std::vector< int > *output, const std::string &dati) |
std::pair< int, int > | findSupport (TH1F &histogram, double thres) |
double | get3x3 (const Float_t energy[7][7]) |
double | get5x5 (const Float_t energy[7][7]) |
TCanvas * | getGlobalCanvas (std::string name) |
TFile * | getGlobalTFile (std::string name) |
CLHEP::HepMatrix * | getSavedMatrix (const std::string &name) |
int | ietaFromXtal (const int &xtal) |
int | iphiFromXtal (const int &xtal) |
void | mtrTransfer (double output[85][20], CLHEP::HepMatrix *input, double Default) |
int | phiFromXtal (const int &xtal) |
int | readCMSSWcoeff (CLHEP::HepMatrix &calibcoeff, const std::string &inputFileName, double defaultVal) |
int | readCMSSWcoeffForComparison (CLHEP::HepMatrix &calibcoeff, const std::string &inputFileName) |
int | saveGlobalTFile (std::string name) |
void | setStyle () |
TH1D * | smartError (TH1D *strip) |
TH1D * | smartGausProfile (TH2F *strip, double width) |
TH1D * | smartProfile (TH2F *strip, double width) |
HepGeom::Point3D< Float_t > | TBposition (const Float_t amplit[7][7], const Float_t beamEne, const Float_t w0, const Float_t x0, const Float_t a0, const Float_t sideX, const Float_t sideY) |
int | translateCoeff (const CLHEP::HepMatrix &calibcoeff, const CLHEP::HepMatrix &sigmaMatrix, const CLHEP::HepMatrix &statisticMatrix, std::string SMnumber, double calibThres, std::string fileName, std::string genTag, std::string method, std::string version, std::string type) |
int | writeCalibTxt (const CLHEP::HepMatrix &AmplitudeMatrix, const CLHEP::HepMatrix &SigmaMatrix, const CLHEP::HepMatrix &StatisticMatrix, std::string fileName) |
int | writeCMSSWCoeff (const CLHEP::HepMatrix &lMatrix, double calibThres, float ERef, const CLHEP::HepMatrix &sigmaMatrix, const CLHEP::HepMatrix &statisticMatrix, std::string fileName, std::string genTag, std::string method, std::string version, std::string type) |
int | writeCMSSWCoeff (const CLHEP::HepMatrix &lMatrix, double calibThres, int etaRef, int phiRef, const CLHEP::HepMatrix &sigmaMatrix, const CLHEP::HepMatrix &statisticMatrix, std::string fileName, std::string genTag, std::string method, std::string version, std::string type) |
int | xtalFromEtaPhi (const int &myEta, const int &myPhi) |
int | xtalFromiEtaiPhi (const int &iEta, const int &iPhi) |
double effectiveSigma | ( | TH1F & | histogram, |
int | vSteps = 100 |
||
) |
find the effective sigma as the half width of the sub-distribution containing 68.3% of the total distribution
Definition at line 758 of file InvMatrixUtils.cc.
References jets_cff::area, createfilelist::int, and electronIdCutBased_cfi::threshold.
double etaCorrE1E25 | ( | int | eta | ) |
correction for eta containment for 5*5 cluster
Definition at line 855 of file InvMatrixUtils.cc.
References corr, PVValHelper::eta, p1, p2, p3, and p4.
Referenced by mtrReset().
double etaCorrE1E49 | ( | int | eta | ) |
correction for eta containment for 7*7 cluster
Definition at line 870 of file InvMatrixUtils.cc.
References corr, PVValHelper::eta, p1, p2, p3, and p4.
Referenced by mtrReset().
double etaCorrE1E9 | ( | int | eta | ) |
correction for eta containment for 3*3 cluster
Definition at line 885 of file InvMatrixUtils.cc.
References corr, PVValHelper::eta, p1, p2, p3, and p4.
Referenced by mtrReset().
int etaFromXtal | ( | const int & | xtal | ) |
get the eta coord [0,84]
Definition at line 275 of file InvMatrixUtils.cc.
References createfilelist::int.
Referenced by ietaFromXtal(), phiFromXtal(), readCMSSWcoeff(), and readCMSSWcoeffForComparison().
int extract | ( | std::vector< int > * | output, |
const std::string & | dati | ||
) |
to read a file containing unserted integers while avoiding comment lines
Definition at line 313 of file InvMatrixUtils.cc.
References edmScanValgrind::buffer, and AlCaHLTBitMon_QueryRunRegistry::string.
Referenced by SiStripCalibLorentzAngle::algoBeginJob(), CalibrationHistosUsingDb::CalibrationHistosUsingDb(), reco::tau::disc::ChargedOutlierAngle(), reco::tau::disc::ChargedOutlierPt(), clone(), CommissioningTask::HistoSet::histo(), OptoScanHistograms::histoAnalysis(), PedestalsHistograms::histoAnalysis(), ApvTimingHistograms::histoAnalysis(), PedsFullNoiseHistograms::histoAnalysis(), FastFedCablingHistograms::histoAnalysis(), PedsOnlyHistograms::histoAnalysis(), VpspScanHistograms::histoAnalysis(), NoiseHistograms::histoAnalysis(), SamplingHistograms::histoAnalysis(), CalibrationHistograms::histoAnalysis(), FedCablingHistograms::histoAnalysis(), CommissioningHistograms::histogram(), SummaryPlotFactory< CommissioningAnalysis * >::init(), reco::tau::disc::IsolationChargedSumHard(), reco::tau::disc::IsolationChargedSumSoft(), reco::tau::disc::IsolationECALSumHard(), reco::tau::disc::IsolationECALSumSoft(), DQMStore::mtEnabled(), reco::tau::disc::NeutralOutlierAngle(), reco::tau::disc::NeutralOutlierPt(), reco::tau::disc::OutlierAngle(), reco::tau::disc::OutlierPt(), reco::tau::disc::PiZeroAngle(), reco::tau::disc::PiZeroEta(), reco::tau::disc::PiZeroPt(), reco::tau::disc::TrackAngle(), reco::tau::disc::TrackEta(), reco::tau::disc::TrackPt(), PedestalsTask::update(), NoiseTask::update(), PedsOnlyTask::update(), PedsFullNoiseTask::update(), and CommissioningTask::updateHistoSet().
std::pair<int,int> findSupport | ( | TH1F & | histogram, |
double | thres = 0. |
||
) |
find the support of the histogram above a threshold return the min and max bins
Definition at line 805 of file InvMatrixUtils.cc.
References stringResolutionProvider_cfi::bin.
double get3x3 | ( | const Float_t | energy[7][7] | ) |
get the energy in the 3x3 from the 7x7 array around the most energetic crystal
Definition at line 199 of file InvMatrixUtils.cc.
References PVValHelper::eta, PVValHelper::phi, and pileupDistInMC::total.
Referenced by TBposition().
double get5x5 | ( | const Float_t | energy[7][7] | ) |
get the energy in the 5x5 from the 7x7 array around the most energetic crystal
Definition at line 182 of file InvMatrixUtils.cc.
References PVValHelper::eta, PVValHelper::phi, and pileupDistInMC::total.
TCanvas* getGlobalCanvas | ( | std::string | name = "Inv MatrixCanvas" | ) |
search for an existing canvas with the name and returns the poiter to it
Definition at line 42 of file InvMatrixUtils.cc.
References setStyle().
TFile* getGlobalTFile | ( | std::string | name = "Inv MatrixTFile.root" | ) |
search for an existing TFile with the name and returns the poiter to it
Definition at line 64 of file InvMatrixUtils.cc.
CLHEP::HepMatrix* getSavedMatrix | ( | const std::string & | name | ) |
search for an existing calib matrix saved with the name and returns the poiter to it, the deletion is responsiblity of the user
Definition at line 97 of file InvMatrixUtils.cc.
References matrixSaver::getMatrix(), matplotRender::reader, SCMaxEta, SCMaxPhi, and matrixSaver::touch().
int ietaFromXtal | ( | const int & | xtal | ) |
get the eta coord [1,85]
Definition at line 295 of file InvMatrixUtils.cc.
References etaFromXtal().
int iphiFromXtal | ( | const int & | xtal | ) |
get the phi coord [1,20]
Definition at line 304 of file InvMatrixUtils.cc.
References phiFromXtal().
void mtrTransfer | ( | double | output[85][20], |
CLHEP::HepMatrix * | input, | ||
double | Default | ||
) |
transfers a CLHEP matrix into a double array with the size of a supermodule
Definition at line 839 of file InvMatrixUtils.cc.
References Default, PVValHelper::eta, convertSQLitetoXML_cfg::output, PVValHelper::phi, reco::return(), SCMaxEta, and SCMaxPhi.
int phiFromXtal | ( | const int & | xtal | ) |
get the phi coord [0,19]
Definition at line 285 of file InvMatrixUtils.cc.
References etaFromXtal(), and PVValHelper::phi.
Referenced by iphiFromXtal(), readCMSSWcoeff(), readCMSSWcoeffForComparison(), and xtalFromEtaPhi().
int readCMSSWcoeff | ( | CLHEP::HepMatrix & | calibcoeff, |
const std::string & | inputFileName, | ||
double | defaultVal = 1. |
||
) |
translates the calib coefficients format, from the CMSSW one to the TB06Studies one
Definition at line 559 of file InvMatrixUtils.cc.
References edmScanValgrind::buffer, etaFromXtal(), phiFromXtal(), and AlCaHLTBitMon_QueryRunRegistry::string.
int readCMSSWcoeffForComparison | ( | CLHEP::HepMatrix & | calibcoeff, |
const std::string & | inputFileName | ||
) |
translates the calib coefficients format, from the CMSSW one to the TB06Studies one
Definition at line 594 of file InvMatrixUtils.cc.
References edmScanValgrind::buffer, etaFromXtal(), phiFromXtal(), and AlCaHLTBitMon_QueryRunRegistry::string.
int saveGlobalTFile | ( | std::string | name = "Inv MatrixFile.root" | ) |
search for an existing TFile with the name and saves it to disk with his name
Definition at line 82 of file InvMatrixUtils.cc.
void setStyle | ( | ) |
set the style for the printout
Definition at line 20 of file InvMatrixUtils.cc.
References reco::return().
Referenced by getGlobalCanvas().
TH1D* smartError | ( | TH1D * | strip | ) |
Definition at line 731 of file InvMatrixUtils.cc.
References stringResolutionProvider_cfi::bin, relativeConstraints::error, dataset::name, AlCaHLTBitMon_QueryRunRegistry::string, TrackerOfflineValidation_Dqm_cff::xmax, and TrackerOfflineValidation_Dqm_cff::xmin.
TH1D* smartGausProfile | ( | TH2F * | strip, |
double | width | ||
) |
smart profiling by fixing gaussian parameters and range from a first averaging
Definition at line 676 of file InvMatrixUtils.cc.
References stringResolutionProvider_cfi::bin, TkAlMuonSelectors_cfi::cut, dataset::name, pileupCalc::nbins, AlCaHLTBitMon_QueryRunRegistry::string, TrackerOfflineValidation_Dqm_cff::xmax, and TrackerOfflineValidation_Dqm_cff::xmin.
TH1D* smartProfile | ( | TH2F * | strip, |
double | width | ||
) |
smart profiling by double averaging
Definition at line 628 of file InvMatrixUtils.cc.
References stringResolutionProvider_cfi::bin, TkAlMuonSelectors_cfi::cut, dataset::name, pileupCalc::nbins, AlCaHLTBitMon_QueryRunRegistry::string, TrackerOfflineValidation_Dqm_cff::xmax, and TrackerOfflineValidation_Dqm_cff::xmin.
HepGeom::Point3D<Float_t> TBposition | ( | const Float_t | amplit[7][7], |
const Float_t | beamEne, | ||
const Float_t | w0, | ||
const Float_t | x0, | ||
const Float_t | a0, | ||
const Float_t | sideX, | ||
const Float_t | sideY | ||
) |
return the impact position of the electron over ECAL
Definition at line 131 of file InvMatrixUtils.cc.
References particleFlowClusterECALTimeSelected_cfi::depth, PVValHelper::eta, get3x3(), cmsBatch::log, PVValHelper::phi, and mps_merge::weight.
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" |
||
) |
translates the calib coefficients format, from the TB06Studies one to the CMSSSW one
Definition at line 502 of file InvMatrixUtils.cc.
References gather_cfg::cout, PVValHelper::eta, PVValHelper::phi, SCMaxEta, SCMaxPhi, and xtalFromiEtaiPhi().
int writeCalibTxt | ( | const CLHEP::HepMatrix & | AmplitudeMatrix, |
const CLHEP::HepMatrix & | SigmaMatrix, | ||
const CLHEP::HepMatrix & | StatisticMatrix, | ||
std::string | fileName = "calibOutput.txt" |
||
) |
to write the calibration constants file
Definition at line 341 of file InvMatrixUtils.cc.
References MessageLogger_cfi::cerr, gather_cfg::cout, PVValHelper::eta, PVValHelper::phi, RecoTauValidation_cfi::reference, SCMaxEta, SCMaxPhi, and xtalFromEtaPhi().
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" |
||
) |
to write the file fpr the CMSSW in the DB compliant format (using Energy as reference)
Definition at line 395 of file InvMatrixUtils.cc.
References PVValHelper::eta, PVValHelper::phi, RecoTauValidation_cfi::reference, SCMaxEta, SCMaxPhi, and xtalFromiEtaiPhi().
int writeCMSSWCoeff | ( | const CLHEP::HepMatrix & | amplMatrix, |
double | calibThres, | ||
int | etaRef, | ||
int | phiRef, | ||
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" |
||
) |
to write the file fpr the CMSSW in the DB compliant format (using Crystal as reference)
Definition at line 445 of file InvMatrixUtils.cc.
References MessageLogger_cfi::cerr, PVValHelper::eta, PVValHelper::phi, RecoTauValidation_cfi::reference, SCMaxEta, SCMaxPhi, and xtalFromiEtaiPhi().
int xtalFromEtaPhi | ( | const int & | myEta, |
const int & | myPhi | ||
) |
to get the parameters from a congiguration file
Definition at line 243 of file InvMatrixUtils.cc.
References phiFromXtal(), vertices_cff::x, anotherprimaryvertexanalyzer_cfi::xMax, and anotherprimaryvertexanalyzer_cfi::xMin.
Referenced by writeCalibTxt().
int xtalFromiEtaiPhi | ( | const int & | iEta, |
const int & | iPhi | ||
) |
to get the crystal number from iEta and iPhi iEta runs from 1 to 85 iPhi runs from 1 to 20
Definition at line 262 of file InvMatrixUtils.cc.
Referenced by translateCoeff(), and writeCMSSWCoeff().