Skip to content
Snippets Groups Projects
Commit 7af820a6 authored by Siarhei Harkusha's avatar Siarhei Harkusha
Browse files

TileMonitoring: Use new binning for histograms in laser LG and HG

Tile monitoring histograms produced for laser calibration runs
have been modified by Tibor to use new binning in low and high gains
(non-uniform bin width in the case of high gain).

Final calibration units has been made configurable via JO,
and default units have been changed also
(CesiumPicoCoulombs for physics runs and PicoCoulombs for others).
parent 4ede4f81
No related branches found
No related tags found
7 merge requests!69091Fix correlated smearing bug in JER in JetUncertainties in 22.0,!58791DataQualityConfigurations: Modify L1Calo config for web display,!51674Fixing hotSpotInHIST for Run3 HIST,!50012RecExConfig: Adjust log message levels from GetRunNumber and GetLBNumber,!46784MuonCondInterface: Enable thread-safety checking.,!46776Updated LArMonitoring config file for WD to match new files produced using MT,!46699TileMonitoring: Use new binning for histograms in laser LG and HG
......@@ -66,14 +66,14 @@ class TilePaterMonTool: public ManagedMonitorToolBase
protected:
/// Implicit version of book1D
TH1D* book1D(const std::string& nam, const std::string& tit,
TH1D* book1D(const std::string& nam, const std::string& tit,
int nx, double xmin, double xmax)
{
return book1D(m_path, nam, tit, nx, xmin, xmax);
}
/// Implicit version of book2D
TH2D* book2D(const std::string& nam, const std::string& tit,
TH2D* book2D(const std::string& nam, const std::string& tit,
int nx, double xmin, double xmax,
int ny, double ymin, double ymax)
{
......@@ -100,6 +100,11 @@ protected:
Interval_t interval = run, MgmtAttr_t attribute = ATTRIB_MANAGED,
std::string trigChain = "", std::string mergeAlgo = "");
TH1S* book1Sx(std::string dir, std::string nam, std::string tit,
int nx, const Double_t *xlgbins,
Interval_t interval = run, MgmtAttr_t attribute = ATTRIB_MANAGED,
std::string trigChain = "", std::string mergeAlgo = "");
TH1C* book1C(std::string dir, std::string nam, std::string tit,
int nx, double xmin, double xmax,
Interval_t interval = run, MgmtAttr_t attribute = ATTRIB_MANAGED,
......@@ -205,12 +210,12 @@ protected:
using ManagedMonitorToolBase::regGraph;
template <typename T>
void regHist(const std::string& subDir, T* hist,
void regHist(const std::string& subDir, T* hist,
Interval_t interval = run, MgmtAttr_t attribute = ATTRIB_MANAGED,
std::string trigChain = "", std::string mergeAlgo = "" );
template <typename T>
void regGraph(const std::string& subDir, T* graph,
void regGraph(const std::string& subDir, T* graph,
Interval_t interval = run, MgmtAttr_t attribute = ATTRIB_MANAGED,
std::string trigChain = "", std::string mergeAlgo = "" );
......
......@@ -64,6 +64,7 @@ class TileRawChannelMonTool: public TilePaterMonTool {
bool m_bookAll;
bool m_book2D;
bool m_overlaphists;
int m_runType;
std::string m_contName;
std::string m_contNameDSP;
......@@ -170,6 +171,7 @@ class TileRawChannelMonTool: public TilePaterMonTool {
const TileInfo* m_tileInfo;
bool m_is12bit;
SG::ReadHandleKey<TileDQstatus> m_DQstatusKey;
int m_intCalibUnit;
};
#endif
......@@ -176,6 +176,17 @@ TH1S * TilePaterMonTool::book1S(std::string subdir, std::string nam, std::string
return hist;
}
TH1S * TilePaterMonTool::book1Sx(std::string subdir, std::string nam, std::string tit,
int nx, const Double_t *xlgbins,
Interval_t interval, MgmtAttr_t attribute,
std::string trigChain, std::string mergeAlgo)
{
TH1S* hist = new TH1S(TString(nam), TString(tit), nx, xlgbins);
regHist(subdir, hist, interval, attribute, trigChain, mergeAlgo);
return hist;
}
TH1I* TilePaterMonTool::book1I(std::string subdir, std::string nam, std::string tit,
int nx, double xmin, double xmax,
Interval_t interval, MgmtAttr_t attribute,
......
......@@ -54,6 +54,7 @@ TileRawChannelMonTool::TileRawChannelMonTool(const std::string & type, const std
declareInterface<IMonitorToolBase>(this);
declareProperty("bookAllDrawers", m_bookAll = false);
declareProperty("overlaphists", m_overlaphists = false);
declareProperty("book2D", m_book2D = true);
// run type 1 - phys, 2 - las, 4 - ped, 8 - cis
......@@ -79,6 +80,7 @@ TileRawChannelMonTool::TileRawChannelMonTool(const std::string & type, const std
declareProperty("MinAmpForCorrectedTime", m_minAmpForCorrectedTime = 0.5);
declareProperty("TileInfoName", m_infoName = "TileInfo");
declareProperty("TileDQstatus", m_DQstatusKey = "TileDQstatus");
declareProperty("CalibUnit", m_intCalibUnit = (int)TileRawChannelUnit::Invalid);
}
/*---------------------------------------------------------*/
......@@ -123,10 +125,16 @@ StatusCode TileRawChannelMonTool::bookHists()
msg(MSG::DEBUG) << "Using base path " << m_path << endmsg;
}
if ((m_runType == LasRun) || (m_runType == PhysRun) || (m_runType == LedRun)) {
m_calibUnit = TileRawChannelUnit::CesiumPicoCoulombs;
} else
m_calibUnit = TileRawChannelUnit::PicoCoulombs;
if (m_intCalibUnit>=0 && m_intCalibUnit<=3) {
m_calibUnit = (TileRawChannelUnit::UNIT)m_intCalibUnit;
}
if (m_calibUnit == TileRawChannelUnit::Invalid) {
if (m_runType == PhysRun) {
m_calibUnit = TileRawChannelUnit::CesiumPicoCoulombs;
} else {
m_calibUnit = TileRawChannelUnit::PicoCoulombs;
}
}
if (m_bookAll) {
for (int ros = 1; ros < 5; ++ros) {
......@@ -214,9 +222,9 @@ void TileRawChannelMonTool::bookHists(int ros, int drawer)
if (m_book2D) {
std::string Hist2DName[4] = { "_amp_vs_q_100", "_amp_vs_q_5", "_time_vs_time_100", "_time_vs_time_5" };
std::string Hist2DTitle[4] = { " amp vs charge 100 pF", " amp vs charge 5 pF", " time vs time 100 pF", " time vs time 5 pF" };
float factor_charge = m_is12bit ? 2. : 1.;
float factor_adc = m_is12bit ? 4. : 1.;
// Below, static_cast<float> is used to avoid warnings from -Wnarrowing
float factor_charge = m_is12bit ? 2. : 1.;
float factor_adc = m_is12bit ? 4. : 1.;
// Below, static_cast<float> is used to avoid warnings from -Wnarrowing
float LowX_low2D[4] = { -4., -0.5, -0.25, -0.25 };
float HighX_low2D[4] = { 804., 50.5, 25.25, 25.25 };
float LowX_hi2D[4] = { static_cast<float>(-0.0625 * factor_charge), static_cast<float>(-0.0625 * factor_charge), -0.25, -0.25 };
......@@ -276,10 +284,27 @@ void TileRawChannelMonTool::bookHists(int ros, int drawer)
} else {
switch (gn) {
case 0: // low gain
m_data->m_hist1[ros][drawer][ch][gn].push_back(book1S(subDir, histName, histTitle, 1101, -50.5, 1050.5));
if (m_overlaphists) {
const Int_t nlg1 = 49;
const Int_t nlg2 = 500;
const Int_t nlg3 = 1027;
Double_t xlgbin[nlg1 + nlg2 + nlg3 + 1];
for(Int_t i = 0; i <= nlg1; ++i)
xlgbin[i] = -50.5+1.0*i;
for(Int_t i = 1; i <= nlg2; ++i)
xlgbin[i + nlg1] = -1.5 + 0.05 * i;
for(Int_t i = 1; i <= nlg3; ++i)
xlgbin[i + nlg1 + nlg2] = 23.5 + 1.0 * i;
m_data->m_hist1[ros][drawer][ch][gn].push_back(book1Sx(subDir, histName, histTitle, nlg1 + nlg2 + nlg3, xlgbin));
} else {
m_data->m_hist1[ros][drawer][ch][gn].push_back(book1S(subDir, histName, histTitle, 1101, -50.5, 1050.5));
}
break;
case 1: // high gain
m_data->m_hist1[ros][drawer][ch][gn].push_back(book1S(subDir, histName, histTitle, 826, -1.01, 15.51));
if (m_overlaphists)
m_data->m_hist1[ros][drawer][ch][gn].push_back(book1S(subDir, histName, histTitle, 500, -1.5, 23.5));
else
m_data->m_hist1[ros][drawer][ch][gn].push_back(book1S(subDir, histName, histTitle, 826, -1.01, 15.51));
break;
default: // single gain mode
if (m_runType == PhysRun) {
......@@ -1153,7 +1178,14 @@ StatusCode TileRawChannelMonTool::fillSummaryHistograms()
//Lukas
if (m_data->m_hist1[ros][drawer][ch][adc][0]->GetEntries() > 0) {
m_data->m_hist1[ros][drawer][ch][adc][0]->Fit("g", "NQ");
if (adc == 0 && m_overlaphists) { // We have for LB histograms with variable-width bins, not suitable for a fit
TH1S *h4fit=new TH1S(*(m_data->m_hist1[ros][drawer][ch][adc][0]));
h4fit->Scale(1,"width");
h4fit->Fit("g", "NQ");
delete(h4fit);
} else {
m_data->m_hist1[ros][drawer][ch][adc][0]->Fit("g", "NQ");
}
Sigma = fit_gaus->GetParameter(2);
ErrS = fit_gaus->GetParError(2);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment