#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 619 of file InvMatrixUtils.cc.
References custom_jme_cff::area, createfilelist::int, cms::alpakatools::config::maxBin, and remoteMonitoring_LASER_era2018_cfg::threshold.
double etaCorrE1E25 | ( | int | eta | ) |
correction for eta containment for 5*5 cluster
Definition at line 697 of file InvMatrixUtils.cc.
References alignCSCRings::corr, PVValHelper::eta, LaserDQM_cfg::p1, SiStripOfflineCRack_cfg::p2, and chargedHadronTrackResolutionFilter_cfi::p3.
double etaCorrE1E49 | ( | int | eta | ) |
correction for eta containment for 7*7 cluster
Definition at line 713 of file InvMatrixUtils.cc.
References alignCSCRings::corr, PVValHelper::eta, LaserDQM_cfg::p1, SiStripOfflineCRack_cfg::p2, and chargedHadronTrackResolutionFilter_cfi::p3.
double etaCorrE1E9 | ( | int | eta | ) |
correction for eta containment for 3*3 cluster
Definition at line 729 of file InvMatrixUtils.cc.
References alignCSCRings::corr, PVValHelper::eta, LaserDQM_cfg::p1, SiStripOfflineCRack_cfg::p2, and chargedHadronTrackResolutionFilter_cfi::p3.
int etaFromXtal | ( | const int & | xtal | ) |
get the eta coord [0,84]
Definition at line 229 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 251 of file InvMatrixUtils.cc.
References edmScanValgrind::buffer, and AlCaHLTBitMon_QueryRunRegistry::string.
Referenced by SiStripCalibLorentzAngle::algoBeginJob(), clone(), CommissioningTask::HistoSet::histo(), PedsFullNoiseHistograms::histoAnalysis(), NoiseHistograms::histoAnalysis(), OptoScanHistograms::histoAnalysis(), ApvTimingHistograms::histoAnalysis(), PedestalsHistograms::histoAnalysis(), DaqScopeModeHistograms::histoAnalysis(), VpspScanHistograms::histoAnalysis(), FastFedCablingHistograms::histoAnalysis(), PedsOnlyHistograms::histoAnalysis(), CalibrationHistograms::histoAnalysis(), SamplingHistograms::histoAnalysis(), FedCablingHistograms::histoAnalysis(), CommissioningHistograms::histogram(), SummaryPlotFactory< CommissioningAnalysis *>::init(), PedestalsTask::update(), PedsOnlyTask::update(), PedsFullNoiseTask::update(), DaqScopeModeTask::update(), NoiseTask::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 658 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 165 of file InvMatrixUtils.cc.
References HCALHighEnergyHPDFilter_cfi::energy, PVValHelper::eta, PVValHelper::phi, and dqmMemoryStats::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 151 of file InvMatrixUtils.cc.
References HCALHighEnergyHPDFilter_cfi::energy, PVValHelper::eta, PVValHelper::phi, and dqmMemoryStats::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 39 of file InvMatrixUtils.cc.
References Skims_PA_cff::name, and 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 55 of file InvMatrixUtils.cc.
References Skims_PA_cff::name.
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 81 of file InvMatrixUtils.cc.
References Skims_PA_cff::name, DQM::reader, SCMaxEta, and SCMaxPhi.
int ietaFromXtal | ( | const int & | xtal | ) |
get the eta coord [1,85]
Definition at line 243 of file InvMatrixUtils.cc.
References etaFromXtal().
int iphiFromXtal | ( | const int & | xtal | ) |
get the phi coord [1,20]
Definition at line 247 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 684 of file InvMatrixUtils.cc.
References cms::soa::RestrictQualify::Default, PVValHelper::eta, input, PVValHelper::phi, SCMaxEta, and SCMaxPhi.
int phiFromXtal | ( | const int & | xtal | ) |
get the phi coord [0,19]
Definition at line 236 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 443 of file InvMatrixUtils.cc.
References edmScanValgrind::buffer, etaFromXtal(), caHitNtupletGeneratorKernels::good, InefficientDoubleROC::inputFileName, 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 472 of file InvMatrixUtils.cc.
References edmScanValgrind::buffer, etaFromXtal(), caHitNtupletGeneratorKernels::good, InefficientDoubleROC::inputFileName, 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 69 of file InvMatrixUtils.cc.
References Skims_PA_cff::name.
void setStyle | ( | ) |
set the style for the printout
Definition at line 20 of file InvMatrixUtils.cc.
Referenced by getGlobalCanvas().
TH1D* smartError | ( | TH1D * | strip | ) |
Definition at line 598 of file InvMatrixUtils.cc.
References newFWLiteAna::bin, relativeConstraints::error, Skims_PA_cff::name, AlCaHLTBitMon_QueryRunRegistry::string, digitizers_cfi::strip, 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 546 of file InvMatrixUtils.cc.
References newFWLiteAna::bin, DMR_cfg::cut, Skims_PA_cff::name, LaserClient_cfi::nbins, AlCaHLTBitMon_QueryRunRegistry::string, digitizers_cfi::strip, ApeEstimator_cff::width, TrackerOfflineValidation_Dqm_cff::xmax, and TrackerOfflineValidation_Dqm_cff::xmin.
TH1D* smartProfile | ( | TH2F * | strip, |
double | width | ||
) |
smart profiling by double averaging
Definition at line 501 of file InvMatrixUtils.cc.
References newFWLiteAna::bin, DMR_cfg::cut, Skims_PA_cff::name, LaserClient_cfi::nbins, AlCaHLTBitMon_QueryRunRegistry::string, digitizers_cfi::strip, ApeEstimator_cff::width, 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 106 of file InvMatrixUtils.cc.
References a0, LEDCalibrationChannels::depth, PVValHelper::eta, get3x3(), dqm-mbProfile::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 403 of file InvMatrixUtils.cc.
References gather_cfg::cout, PVValHelper::eta, MillePedeFileConverter_cfg::fileName, AlcaSiPixelAliHarvester0T_cff::method, PVValHelper::phi, SCMaxEta, SCMaxPhi, BeamSplash_cfg::version, 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 276 of file InvMatrixUtils.cc.
References DMR_cfg::cerr, gather_cfg::cout, PVValHelper::eta, MillePedeFileConverter_cfg::fileName, 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 320 of file InvMatrixUtils.cc.
References PVValHelper::eta, MillePedeFileConverter_cfg::fileName, AlcaSiPixelAliHarvester0T_cff::method, PVValHelper::phi, RecoTauValidation_cfi::reference, SCMaxEta, SCMaxPhi, BeamSplash_cfg::version, 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 359 of file InvMatrixUtils.cc.
References DMR_cfg::cerr, PVValHelper::eta, MillePedeFileConverter_cfg::fileName, AlcaSiPixelAliHarvester0T_cff::method, PVValHelper::phi, RecoTauValidation_cfi::reference, SCMaxEta, SCMaxPhi, BeamSplash_cfg::version, and xtalFromiEtaiPhi().
int xtalFromEtaPhi | ( | const int & | myEta, |
const int & | myPhi | ||
) |
to get the parameters from a congiguration file
Definition at line 204 of file InvMatrixUtils.cc.
References phiFromXtal(), x, multiplicitycorr_cfi::xMax, and photonAnalyzer_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 219 of file InvMatrixUtils.cc.
References cms::cuda::assert(), and l1tTowerCalibrationProducer_cfi::iEta.
Referenced by translateCoeff(), and writeCMSSWCoeff().