#include <string>
#include <map>
#include "TObject.h"
#include "TF1.h"
#include "TH2.h"
#include "TProfile.h"
#include "TCanvas.h"
#include "CLHEP/Geometry/Point3D.h"
#include "CLHEP/Matrix/GenMatrix.h"
#include "CLHEP/Matrix/Matrix.h"
#include "CLHEP/Matrix/Vector.h"
#include "TFile.h"
#include "Calibration/Tools/interface/InvMatrixCommonDefs.h"
Go to the source code of this file.
Functions | |
double | effectiveSigma (TH1F &histogram, int vSteps=100) |
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=0.) |
double | get3x3 (const Float_t energy[7][7]) |
double | get5x5 (const Float_t energy[7][7]) |
TCanvas * | getGlobalCanvas (std::string name="Inv MatrixCanvas") |
TFile * | getGlobalTFile (std::string name="Inv MatrixTFile.root") |
CLHEP::HepMatrix * | getSavedMatrix (const std::string &name) |
int | ietaFromXtal (const int &xtal) |
int | iphiFromXtal (const int &xtal) |
template<class Type > | |
void | mtrReset (Type superModules[85][20], const Type val) |
void | mtrTransfer (double output[85][20], CLHEP::HepMatrix *input, double Default) |
int | parseConfigFile (const TString &config) |
int | phiFromXtal (const int &xtal) |
int | readCMSSWcoeff (CLHEP::HepMatrix &calibcoeff, const std::string &inputFileName, double defaultVal=1.) |
int | readCMSSWcoeffForComparison (CLHEP::HepMatrix &calibcoeff, const std::string &inputFileName) |
int | saveGlobalTFile (std::string name="Inv MatrixFile.root") |
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=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) |
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") |
int | writeCalibTxt (const CLHEP::HepMatrix &AmplitudeMatrix, const CLHEP::HepMatrix &SigmaMatrix, const CLHEP::HepMatrix &StatisticMatrix, std::string fileName="calibOutput.txt") |
int | writeCMSSWCoeff (const CLHEP::HepMatrix &lMatrix, 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") |
int | writeCMSSWCoeff (const CLHEP::HepMatrix &lMatrix, 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") |
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 custom_jme_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(), reco::tau::disc::ChargedOutlierAngle(), reco::tau::disc::ChargedOutlierPt(), clone(), CommissioningTask::HistoSet::histo(), ApvTimingHistograms::histoAnalysis(), OptoScanHistograms::histoAnalysis(), NoiseHistograms::histoAnalysis(), DaqScopeModeHistograms::histoAnalysis(), PedestalsHistograms::histoAnalysis(), PedsFullNoiseHistograms::histoAnalysis(), PedsOnlyHistograms::histoAnalysis(), FastFedCablingHistograms::histoAnalysis(), VpspScanHistograms::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(), PedsOnlyTask::update(), NoiseTask::update(), PedsFullNoiseTask::update(), DaqScopeModeTask::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 mtrReset | ( | Type | superModules[85][20], |
const Type | val | ||
) |
reset the matrices f the size of a supermodule
Definition at line 183 of file InvMatrixUtils.h.
References MillePedeFileConverter_cfg::e, PVValHelper::eta, etaCorrE1E25(), etaCorrE1E49(), etaCorrE1E9(), AlCaHLTBitMon_ParallelJobs::p, SCMaxEta, SCMaxPhi, and heppy_batch::val.
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, mathSSE::return(), SCMaxEta, and SCMaxPhi.
int parseConfigFile | ( | const TString & | config | ) |
to get the parameters from a congiguration file
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 mathSSE::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 egammaForCoreTracking_cff::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 crystal number from eta and phi
to get the parameters from a congiguration file
Definition at line 243 of file InvMatrixUtils.cc.
References phiFromXtal(), genVertex_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().