#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 619 of file InvMatrixUtils.cc.
References cms::cuda::allocator::maxBin, and dtDQMClient_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, fireworks::p1, and fireworks::p2.
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, fireworks::p1, and fireworks::p2.
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, fireworks::p1, and fireworks::p2.
int etaFromXtal | ( | const int & | xtal | ) |
get the eta coord [0,84]
Definition at line 229 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 251 of file InvMatrixUtils.cc.
References edmScanValgrind::buffer, and AlCaHLTBitMon_QueryRunRegistry::string.
Referenced by BeautifulSoup.PageElement::_invert(), SiStripCalibLorentzAngle::algoBeginJob(), clone(), CommissioningTask::HistoSet::histo(), PedsFullNoiseHistograms::histoAnalysis(), CalibrationHistograms::histoAnalysis(), NoiseHistograms::histoAnalysis(), OptoScanHistograms::histoAnalysis(), PedestalsHistograms::histoAnalysis(), ApvTimingHistograms::histoAnalysis(), VpspScanHistograms::histoAnalysis(), DaqScopeModeHistograms::histoAnalysis(), PedsOnlyHistograms::histoAnalysis(), FastFedCablingHistograms::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 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 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 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.
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 matrixSaver::getMatrix(), DQM::reader, SCMaxEta, SCMaxPhi, and matrixSaver::touch().
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 mtrReset | ( | Type | superModules[85][20], |
const Type | val | ||
) |
reset the matrices f the size of a supermodule
Definition at line 178 of file InvMatrixUtils.h.
References alignCSCRings::e, AlCaHLTBitMon_ParallelJobs::p, SCMaxEta, SCMaxPhi, and hgcalPerformanceValidation::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 684 of file InvMatrixUtils.cc.
References PVValHelper::eta, convertSQLitetoXML_cfg::output, PVValHelper::phi, 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 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(), good, 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(), good, 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.
void setStyle | ( | ) |
set the style for the printout
Definition at line 165 of file offsetStack.cc.
Referenced by getGlobalCanvas(), and main().
TH1D* smartError | ( | TH1D * | strip | ) |
Definition at line 598 of file InvMatrixUtils.cc.
References newFWLiteAna::bin, relativeConstraints::error, mergeVDriftHistosByStation::name, AlCaHLTBitMon_QueryRunRegistry::string, hlt_dqm_clientPB-live_cfg::xmax, and hlt_dqm_clientPB-live_cfg::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, GOODCOLL_filter_cfg::cut, mergeVDriftHistosByStation::name, hlt_dqm_clientPB-live_cfg::nbins, AlCaHLTBitMon_QueryRunRegistry::string, hlt_dqm_clientPB-live_cfg::xmax, and hlt_dqm_clientPB-live_cfg::xmin.
TH1D* smartProfile | ( | TH2F * | strip, |
double | width | ||
) |
smart profiling by double averaging
Definition at line 501 of file InvMatrixUtils.cc.
References newFWLiteAna::bin, GOODCOLL_filter_cfg::cut, mergeVDriftHistosByStation::name, hlt_dqm_clientPB-live_cfg::nbins, AlCaHLTBitMon_QueryRunRegistry::string, hlt_dqm_clientPB-live_cfg::xmax, and hlt_dqm_clientPB-live_cfg::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, HLT_FULL_cff::depth, PVValHelper::eta, get3x3(), log, PVValHelper::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 403 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 276 of file InvMatrixUtils.cc.
References EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0::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 320 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 359 of file InvMatrixUtils.cc.
References EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0::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 204 of file InvMatrixUtils.cc.
References phiFromXtal(), and gpuClustering::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 219 of file InvMatrixUtils.cc.
References cms::cuda::assert().
Referenced by translateCoeff(), and writeCMSSWCoeff().