#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[SCMaxEta][SCMaxPhi], 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 prof2calltree::back, and dtDQMClient_cfg::threshold.
double etaCorrE1E25 | ( | int | eta | ) |
double etaCorrE1E49 | ( | int | eta | ) |
double etaCorrE1E9 | ( | int | eta | ) |
int etaFromXtal | ( | const int & | xtal | ) |
get the eta coord [0,84]
Definition at line 275 of file InvMatrixUtils.cc.
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 AlCaHLTBitMon_QueryRunRegistry::string.
Referenced by BeautifulSoup.PageElement::_invert(), SiStripCalibLorentzAngle::algoBeginJob(), CalibrationHistosUsingDb::CalibrationHistosUsingDb(), reco::tau::disc::ChargedOutlierAngle(), reco::tau::disc::ChargedOutlierPt(), clone(), CommissioningTask::HistoSet::histo(), NoiseHistograms::histoAnalysis(), OptoScanHistograms::histoAnalysis(), PedestalsHistograms::histoAnalysis(), PedsFullNoiseHistograms::histoAnalysis(), FastFedCablingHistograms::histoAnalysis(), PedsOnlyHistograms::histoAnalysis(), ApvTimingHistograms::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(), 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(), 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 newFWLiteAna::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 eta(), 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 eta(), 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[SCMaxEta][SCMaxPhi], |
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, eta(), convertSQLitetoXML_cfg::output, 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 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 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 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 newFWLiteAna::bin, relativeConstraints::error, mergeVDriftHistosByStation::name, AlCaHLTBitMon_QueryRunRegistry::string, SiStripMonitorClusterAlca_cfi::xmax, and SiStripMonitorClusterAlca_cfi::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 newFWLiteAna::bin, GOODCOLL_filter_cfg::cut, mergeVDriftHistosByStation::name, pileupCalc::nbins, AlCaHLTBitMon_QueryRunRegistry::string, SiStripMonitorClusterAlca_cfi::xmax, and SiStripMonitorClusterAlca_cfi::xmin.
TH1D* smartProfile | ( | TH2F * | strip, |
double | width | ||
) |
smart profiling by double averaging
Definition at line 628 of file InvMatrixUtils.cc.
References newFWLiteAna::bin, GOODCOLL_filter_cfg::cut, mergeVDriftHistosByStation::name, pileupCalc::nbins, AlCaHLTBitMon_QueryRunRegistry::string, SiStripMonitorClusterAlca_cfi::xmax, and SiStripMonitorClusterAlca_cfi::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 eta(), get3x3(), fff_deletion::log, phi, TBposition(), and histoStyle::weight.
Referenced by TBposition().
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, eta(), 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 dtNoiseDBValidation_cfg::cerr, gather_cfg::cout, eta(), 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 eta(), 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 dtNoiseDBValidation_cfg::cerr, eta(), 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(), and x.
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().