#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 762 of file InvMatrixUtils.cc.
References prof2calltree::back, and crabWrap::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 279 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 317 of file InvMatrixUtils.cc.
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(), 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 809 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 203 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 186 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 46 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 68 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 101 of file InvMatrixUtils.cc.
References matrixSaver::getMatrix(), SCMaxEta, SCMaxPhi, and matrixSaver::touch().
int ietaFromXtal | ( | const int & | xtal | ) |
get the eta coord [1,85]
Definition at line 299 of file InvMatrixUtils.cc.
References etaFromXtal().
int iphiFromXtal | ( | const int & | xtal | ) |
get the phi coord [1,20]
Definition at line 308 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 843 of file InvMatrixUtils.cc.
References Default, eta(), convertSQLitetoXML_cfg::output, phi, mathSSE::return(), SCMaxEta, and SCMaxPhi.
int phiFromXtal | ( | const int & | xtal | ) |
get the phi coord [0,19]
Definition at line 289 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 563 of file InvMatrixUtils.cc.
References etaFromXtal(), and phiFromXtal().
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 598 of file InvMatrixUtils.cc.
References etaFromXtal(), and phiFromXtal().
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 86 of file InvMatrixUtils.cc.
void setStyle | ( | ) |
set the style for the printout
Definition at line 24 of file InvMatrixUtils.cc.
References mathSSE::return().
Referenced by getGlobalCanvas().
TH1D* smartError | ( | TH1D * | strip | ) |
Definition at line 735 of file InvMatrixUtils.cc.
References newFWLiteAna::bin, error, and AlCaRecoCosmics_cfg::name.
TH1D* smartGausProfile | ( | TH2F * | strip, |
double | width | ||
) |
smart profiling by fixing gaussian parameters and range from a first averaging
Definition at line 680 of file InvMatrixUtils.cc.
References newFWLiteAna::bin, align_tpl::cut, AlCaRecoCosmics_cfg::name, and ExpressReco_HICollisions_FallBack::nbins.
TH1D* smartProfile | ( | TH2F * | strip, |
double | width | ||
) |
smart profiling by double averaging
Definition at line 632 of file InvMatrixUtils.cc.
References newFWLiteAna::bin, align_tpl::cut, AlCaRecoCosmics_cfg::name, and ExpressReco_HICollisions_FallBack::nbins.
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 135 of file InvMatrixUtils.cc.
References eta(), get3x3(), funct::log(), phi, TBposition(), and CommonMethods::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 506 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 345 of file InvMatrixUtils.cc.
References ExpressReco_HICollisions_FallBack::cerr, gather_cfg::cout, eta(), phi, 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 399 of file InvMatrixUtils.cc.
References eta(), phi, 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 449 of file InvMatrixUtils.cc.
References ExpressReco_HICollisions_FallBack::cerr, eta(), phi, SCMaxEta, SCMaxPhi, and xtalFromiEtaiPhi().
int xtalFromEtaPhi | ( | const int & | myEta, |
const int & | myPhi | ||
) |
to get the parameters from a congiguration file
Definition at line 247 of file InvMatrixUtils.cc.
References phiFromXtal(), and ExpressReco_HICollisions_FallBack::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 266 of file InvMatrixUtils.cc.
Referenced by translateCoeff(), and writeCMSSWCoeff().