Skip to content
Snippets Groups Projects
Commit ef253f44 authored by Hass AbouZeid's avatar Hass AbouZeid
Browse files

Merge branch 'mr-2017-01' into '21.0'

PixelMonitoring: revision of histogram holder classes (fixed)

See merge request !3809
parents c77fc386 a6f7ec43
No related merge requests found
Showing
with 142 additions and 846 deletions
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#ifndef DBMMON2DMAPS_H_
#define DBMMON2DMAPS_H_
#include "AthenaMonitoring/ManagedMonitorToolBase.h"
#include <string.h>
class TH2F;
class Identifier;
class PixelID;
class StatusCode;
// A helper class to remove a lot of the code duplication.
// This is a collection of 5 2D histograms which make up the '2D maps' used a lot of in the monitoring.
// Each of the 2D maps correspond to a detector region (B0, B1, B2, ECA, ECC).
// This books and formats the histograms in the constructor. The fill method will take the identifier
// as the input and fill the correct histogram and bin. The histograms are also public so that they
// can be formated/accessed like any other histograms in the monitoring.
class DBMMon2DMaps
{
public:
DBMMon2DMaps(std::string name, std::string title);
~DBMMon2DMaps();
TH2F* DBMA;
TH2F* DBMC;
void Fill(Identifier &id, const PixelID* pixID);
void Scale(double number);
StatusCode regHist(ManagedMonitorToolBase::MonGroup &group);
private:
void formatHist();
};
#endif
......@@ -25,11 +25,8 @@
class PixelMonModules1D;
class PixelMonModulesProf;
class PixelMonModules2D;
class PixelMon2DMaps;
class DBMMon2DMaps;
class PixelMon2DMapsLW;
class PixelMon2DProfilesLW;
class PixelMonProfiles;
class PixelMon2DLumiProfiles;
class PixelMon2DLumiMaps;
class StatusCode;
......@@ -135,7 +132,7 @@ public:
void TH1FFillMonitoring(TH1F_LW* mon, TH1F_LW* tmp);
void TH2FSetBinScaled(TH2F_LW* mon, TH2F_LW* tmp, int nevent);
void FillTimeHisto(double, TProfile*, TProfile*, TProfile*, double, double, double);
void FillSummaryHistos(PixelMon2DMaps* occupancy, TH1F_LW* A, TH1F_LW* C, TH1F_LW* IBL, TH1F_LW* B0, TH1F_LW* B1, TH1F_LW* B2);
void FillSummaryHistos(PixelMon2DMapsLW* occupancy, TH1F_LW* A, TH1F_LW* C, TH1F_LW* IBL, TH1F_LW* B0, TH1F_LW* B1, TH1F_LW* B2);
int ParseDetailsString(std::string & detailsMod);
bool OnTrack(Identifier id, bool isCluster);
double getErrorBitFraction(const Identifier& WaferID, const unsigned int& num_femcc_errorwords);
......@@ -330,8 +327,8 @@ private:
/// the number of hits
TProfile_LW* m_hits_per_lumi;
TH1I_LW* m_num_hits;
PixelMon2DMaps* m_hitmap_mon;
PixelMon2DMaps* m_hitmap_tmp;
PixelMon2DMapsLW* m_hitmap_mon;
PixelMon2DMapsLW* m_hitmap_tmp;
TH1F_LW* m_nhits_mod[PixLayer::COUNT];
TProfile_LW* m_hits_per_lumi_mod[PixLayer::COUNT];
TH1F_LW* m_nlargeevt_per_lumi_mod[PixLayerIBL2D3D::COUNT];
......@@ -346,10 +343,10 @@ private:
TH2F_LW* m_maxocc_per_lumi_mod[PixLayerIBL2D3D::COUNT];
TH2F_LW* m_modocc_per_lumi[PixLayer::COUNT];
TH1F_LW* m_maxocc_per_bcid_mod[PixLayerIBL2D3D::COUNT];
PixelMon2DMaps* m_occupancy;
PixelMon2DMapsLW* m_occupancy;
PixelMon2DMapsLW* m_average_pixocc;
PixelMon2DProfilesLW* m_occupancy_pix_evt;
PixelMon2DMaps* m_occupancy_10min;
PixelMon2DMapsLW* m_occupancy_10min;
TProfile* m_occupancy_time1;
TProfile* m_occupancy_time2;
TProfile* m_occupancy_time3;
......@@ -484,9 +481,9 @@ private:
TH1F_LW* m_2cluster_Q_mod[PixLayer::COUNT];
TH1F_LW* m_3cluster_Q_mod[PixLayer::COUNT];
TH1F_LW* m_bigcluster_Q_mod[PixLayer::COUNT];
PixelMonProfiles* m_clussize_map;
PixelMonProfiles* m_cluscharge_map;
PixelMonProfiles* m_clusToT_map;
PixelMon2DProfilesLW* m_clussize_map;
PixelMon2DProfilesLW* m_cluscharge_map;
PixelMon2DProfilesLW* m_clusToT_map;
TH1F_LW* m_cluster_groupsize;
TH1F_LW* m_cluster_col_width;
TH1F_LW* m_cluster_row_width;
......@@ -500,15 +497,15 @@ private:
TH2F_LW* m_ToT_vs_clussize_mod[PixLayer::COUNT];
TProfile_LW* m_clussize_vs_eta_mod[PixLayer::COUNT];
PixelMon2DMaps* m_clustermap_mon;
PixelMon2DMaps* m_clustermap_tmp;
PixelMon2DMaps* m_cluster_occupancy;
PixelMon2DMapsLW* m_clustermap_mon;
PixelMon2DMapsLW* m_clustermap_tmp;
PixelMon2DMapsLW* m_cluster_occupancy;
TH2F_LW* m_cluster_occupancy_FE_B0_mon;
TProfile* m_cluster_occupancy_time1;
TProfile* m_cluster_occupancy_time2;
TProfile* m_cluster_occupancy_time3;
PixelMon2DMaps* m_clusocc_sizenot1;
PixelMon2DMapsLW* m_clusocc_sizenot1;
PixelMonModulesProf* m_cluseff_mod;
PixelMonModules1D* m_cluster_ToT_mod;
PixelMonModules1D* m_cluster_size_mod;
......@@ -517,8 +514,8 @@ private:
TProfile_LW* m_clusters_per_track_per_lumi_mod[PixLayer::COUNT];
TH1I_LW* m_num_clusters_mod[PixLayer::COUNT];
TH1F_LW* m_cluster_occupancy_summary_mod[PixLayer::COUNT];
PixelMonProfiles* m_cluster_LVL1A_mod;
PixelMonProfiles* m_clus_LVL1A_sizenot1;
PixelMon2DProfilesLW* m_cluster_LVL1A_mod;
PixelMon2DProfilesLW* m_clus_LVL1A_sizenot1;
TProfile_LW* m_clustersOnOffTrack_per_lumi;
/// Quick status
TH2F_LW* m_clusters_onTrack_L0_B11_S2_C6;
......@@ -529,11 +526,10 @@ private:
///Status histograms
///
PixelMonModules1D* m_Status_modules;
PixelMonProfiles* m_status;
PixelMonProfiles* m_status_mon;
PixelMonProfiles* m_status_LB;
PixelMonProfiles* m_disabled;
PixelMon2DMaps* m_dqStatus;
PixelMon2DProfilesLW* m_status;
PixelMon2DProfilesLW* m_status_mon;
PixelMon2DProfilesLW* m_status_LB;
PixelMon2DMapsLW* m_dqStatus;
TProfile_LW* m_disabledModules_per_lumi_PIX;
TProfile_LW* m_badModules_per_lumi_mod[PixLayerIBL2D3D::COUNT];
TProfile_LW* m_disabledModules_per_lumi_mod[PixLayerIBL2D3D::COUNT];
......@@ -558,7 +554,7 @@ private:
TProfile* m_error_time2;
TProfile* m_error_time3;
PixelMonModules1D* m_errors;
PixelMonProfiles* m_errhist_femcc_errwords_map;
PixelMon2DProfilesLW* m_errhist_femcc_errwords_map;
// Histograms in 'ErrorsExpert' folder
PixelMon2DLumiMaps* m_errhist_expert_LB_maps[kNumErrorStates];
......@@ -588,7 +584,7 @@ private:
TH2F_LW* m_spHit_rz;
//Histograms stored for certain number of LB at a time
PixelMon2DMaps* m_cluster_occupancy_LB; //cluster occupancy (shows module status)
PixelMon2DMapsLW* m_cluster_occupancy_LB; //cluster occupancy (shows module status)
PixelMonModules1D* m_cluster_ToT_mod_LB;
PixelMonModules1D* m_cluster_num_mod_LB;
PixelMonModules1D* m_hit_num_mod_LB;
......
......@@ -31,7 +31,6 @@ class PixelMon2DLumiMaps
TH2F_LW* Albm;
TH2F_LW* Clbm;
void Fill(double LB,Identifier &id, const PixelID* pixID, double weight = 1);
void Scale(double number);
StatusCode regHist(ManagedMonitorToolBase::MonGroup &group);
private:
void formatHist();
......
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#ifndef PIXELMON2DMAPS_H_
#define PIXELMON2DMAPS_H_
#include "AthenaMonitoring/ManagedMonitorToolBase.h"
#include <string.h>
class TH2F;
class Identifier;
class PixelID;
class StatusCode;
// A helper class to remove a lot of the code duplication.
// This is a collection of 5 2D histograms which make up the '2D maps' used a lot of in the monitoring.
// Each of the 2D maps correspond to a detector region (B0, B1, B2, ECA, ECC).
// This books and formats the histograms in the constructor. The fill method will take the identifier
// as the input and fill the correct histogram and bin. The histograms are also public so that they
// can be formated/accessed like any other histograms in the monitoring.
class PixelMon2DMaps
{
public:
PixelMon2DMaps(std::string name, std::string title, bool doIBL);
~PixelMon2DMaps();
TH2F* IBL2D;
TH2F* IBL3D;
TH2F* IBL;
TH2F* B0;
TH2F* B1;
TH2F* B2;
TH2F* A;
TH2F* C;
TH2F* DBMA;
TH2F* DBMC;
int m_cnt;
void Reset();
void Fill(Identifier &id, const PixelID* pixID);
void WeightingFill(Identifier &id, const PixelID* pixID, float weight);
void Scale(double number);
void ScaleByNChannels(int nActive_IBL2D, int nActive_IBL3D, int nActive_B0, int nActive_B1, int nActive_B2, int nActive_ECA, int nActive_ECC, int nActive_DBMA, int nActive_DBMC);
void ScaleBynPixnEvt(int nevent);
void Fill2DMon(PixelMon2DMaps* oldmap);
StatusCode regHist(ManagedMonitorToolBase::MonGroup &group);
private:
void formatHist();
const bool m_doIBL;
};
#endif
......@@ -22,7 +22,7 @@ class StatusCode;
class PixelMon2DMapsLW
{
public:
PixelMon2DMapsLW(std::string name, std::string title, bool doIBL, bool errorHist = false);
PixelMon2DMapsLW(std::string name, std::string title, bool doIBL, bool errorHist = false, bool copy2DFEval = false);
~PixelMon2DMapsLW();
TH2F_LW* IBL;
TH2F_LW* IBL2D;
......@@ -35,14 +35,14 @@ class PixelMon2DMapsLW
TH2F_LW* DBMA;
TH2F_LW* DBMC;
void Fill(Identifier &id, const PixelID* pixID);
void FillNormalized(PixelMon2DMapsLW* old, int nevent);
void WeightingFill(Identifier &id, const PixelID* pixID, float weight);
void Scale(double number);
void Fill2DMon(PixelMon2DMapsLW* oldmap);
StatusCode regHist(ManagedMonitorToolBase::MonGroup &group);
private:
void formatHist();
const bool m_doIBL;
const bool m_errorHist;
const bool m_copy2DFEval;
};
#endif
......@@ -8,11 +8,9 @@
#include <string.h>
class TProfile2D_LW;
class TH2F_LW;
class Identifier;
class PixelID;
class StatusCode;
class PixelMon2DMaps;
class PixelMon2DMapsLW;
// A helper class to facilitate definition of per-layer 2D profile maps.
......@@ -21,9 +19,6 @@ class PixelMon2DMapsLW;
// This books and formats the histograms in the constructor. The fill method will take the identifier
// as the input and fill the correct histogram and bin. The histograms are also public so that they
// can be formated/accessed like any other histograms in the monitoring.
//
// N.B. the type of histograms is the same as for PixelMonProfiles class,
// but the filling methods are somewhat different. Candidate for cleanup.
class PixelMon2DProfilesLW
{
......@@ -42,7 +37,9 @@ public:
//TProfile2D_LW* DBMC;
void Fill(Identifier &id, const PixelID* pixID, float value);
void Fill2DMon(PixelMon2DProfilesLW* oldmap);
void FillFromMap(PixelMon2DMaps* inputmap, bool clear_inputmap);
void FillFromMap(PixelMon2DMapsLW* inputmap, bool clear_inputmap);
void SetMaxValue(float max);
void Reset();
StatusCode regHist(ManagedMonitorToolBase::MonGroup &group);
private:
void formatHist();
......
......@@ -94,8 +94,7 @@ class PixelMonModules2D : public PixelMonModules
TH2F* A[3][48];
TH2F* C[3][48];
virtual void formatHist(std::string opt=""); //pass the bin labels here if needed
void Fill(double value0, double value1, Identifier &id, const PixelID* pixID, double weight);
void Fill(double value0, double value1, Identifier &id, const PixelID* pixID);
void Fill(double value0, double value1, Identifier &id, const PixelID* pixID, double weight = 1.);
virtual void Reset();
private:
TH2F* m_Dummy; //shouldn't be used unless messed up;
......
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#ifndef PIXELMONPROFILES_H_
#define PIXELMONPROFILES_H_
#include "AthenaMonitoring/ManagedMonitorToolBase.h"
#include <string.h>
class TProfile2D_LW;
class Identifier;
class PixelID;
class StatusCode;
// A helper class to facilitate definition of per-layer 2D profile maps.
// It defines a collection of TProfile2D_LW histograms for each pixel layer, which then can be declared or
// filled in a single call.
// The fill method will take the identifier as the input and fill the correct histogram and bin.
// The histograms are also public so that they can be formated/accessed just like any other histograms in the monitoring.
//
// N.B. the type of histograms is the same as for PixelMon2DProfilesLW class,
// but the filling methods are somewhat different. Candidate for cleanup.
class PixelMonProfiles
{
public:
PixelMonProfiles(std::string name, std::string title, bool doIBL);
~PixelMonProfiles();
TProfile2D_LW* IBL;
TProfile2D_LW* IBL2D;
TProfile2D_LW* IBL3D;
TProfile2D_LW* B0;
TProfile2D_LW* B1;
TProfile2D_LW* B2;
TProfile2D_LW* A;
TProfile2D_LW* C;
void Fill(Identifier &id, const PixelID* pixID, float Index);
void SetMaxValue(float max);
void Reset();
StatusCode regHist(ManagedMonitorToolBase::MonGroup &group);
private:
void formatHist();
const bool m_doIBL;
};
#endif
......@@ -25,10 +25,8 @@
#include "LWHists/TProfile2D_LW.h"
#include <sstream>
#include "PixelMonitoring/PixelMon2DMaps.h"
#include "PixelMonitoring/DBMMon2DMaps.h"
#include "PixelMonitoring/PixelMon2DMapsLW.h"
#include "PixelMonitoring/PixelMonModules.h"
#include "PixelMonitoring/PixelMonProfiles.h"
#include "PixelMonitoring/PixelMon2DProfilesLW.h"
#include "PixelCabling/IPixelCablingSvc.h"
......@@ -251,41 +249,41 @@ StatusCode PixelMainMon::BookClustersMon(void)
if (m_do2DMaps)
{
tmp = "Cluster_Occupancy"; tmp2 = "Cluster occupancy";
m_cluster_occupancy = new PixelMon2DMaps(tmp.c_str(), (tmp2 + m_histTitleExt).c_str(), m_doIBL);
m_cluster_occupancy = new PixelMon2DMapsLW(tmp.c_str(), (tmp2 + m_histTitleExt).c_str(), m_doIBL);
sc = m_cluster_occupancy->regHist(clusterShift);
tmp = "Cluster_LVL1A_Mod"; tmp2 = "Average cluster Level 1 Accept";
m_cluster_LVL1A_mod = new PixelMonProfiles(tmp.c_str(), (tmp2 + m_histTitleExt).c_str(), m_doIBL);
m_cluster_LVL1A_mod = new PixelMon2DProfilesLW(tmp.c_str(), (tmp2 + m_histTitleExt).c_str(), m_doIBL, false, true);
sc = m_cluster_LVL1A_mod->regHist(timeShift);
tmp = "Clus_Occ_SizeCut"; tmp2 = "Size>1 Cluster occupancy";
m_clusocc_sizenot1 = new PixelMon2DMaps(tmp.c_str(), (tmp2 + m_histTitleExt).c_str(), m_doIBL);
m_clusocc_sizenot1 = new PixelMon2DMapsLW(tmp.c_str(), (tmp2 + m_histTitleExt).c_str(), m_doIBL);
sc = m_clusocc_sizenot1->regHist(clusterShift);
tmp = "Clus_LVL1A_SizeCut"; tmp2 = "Average Size>1 Cluster Level 1 Accept";
m_clus_LVL1A_sizenot1 = new PixelMonProfiles(tmp.c_str(), (tmp2 + m_histTitleExt).c_str(), m_doIBL);
m_clus_LVL1A_sizenot1 = new PixelMon2DProfilesLW(tmp.c_str(), (tmp2 + m_histTitleExt).c_str(), m_doIBL, false, true);
sc = m_clus_LVL1A_sizenot1->regHist(timeShift);
if (m_doOnline){
tmp = "ClusterMap_Mon"; tmp2 = "Cluster map for monitoring";
m_clustermap_mon = new PixelMon2DMaps(tmp.c_str(), (tmp2 + m_histTitleExt).c_str(), m_doIBL);
m_clustermap_mon = new PixelMon2DMapsLW(tmp.c_str(), (tmp2 + m_histTitleExt).c_str(), m_doIBL);
sc = m_clustermap_mon->regHist(clusterShift);
tmp = "ClusterMap_tmp"; tmp2 = "Cluster map for monitoring";
m_clustermap_tmp = new PixelMon2DMaps(tmp.c_str(), (tmp2 + m_histTitleExt).c_str(), m_doIBL);
m_clustermap_tmp = new PixelMon2DMapsLW(tmp.c_str(), (tmp2 + m_histTitleExt).c_str(), m_doIBL);
sc = m_clustermap_tmp->regHist(clusterShift);
}
if (!m_doOnline){
tmp = "Cluster_Size_Map"; tmp2 = "Average cluster size map";
m_clussize_map = new PixelMonProfiles(tmp.c_str(), (tmp2 + m_histTitleExt).c_str(), m_doIBL);
m_clussize_map = new PixelMon2DProfilesLW(tmp.c_str(), (tmp2 + m_histTitleExt).c_str(), m_doIBL, false, true);
sc = m_clussize_map->regHist(clusterExpert);
tmp = "Cluster_Charge_Map"; tmp2 = "Average cluster charge map";
m_cluscharge_map = new PixelMonProfiles(tmp.c_str(), (tmp2 + m_histTitleExt).c_str(), m_doIBL);
m_cluscharge_map = new PixelMon2DProfilesLW(tmp.c_str(), (tmp2 + m_histTitleExt).c_str(), m_doIBL, false, true);
sc = m_cluscharge_map->regHist(clusterExpert);
tmp = "Cluster_ToT_Map"; tmp2 = "Average cluster ToT map";
m_clusToT_map = new PixelMonProfiles(tmp.c_str(), (tmp2 + m_histTitleExt).c_str(), m_doIBL);
m_clusToT_map = new PixelMon2DProfilesLW(tmp.c_str(), (tmp2 + m_histTitleExt).c_str(), m_doIBL, false, true);
sc = m_clusToT_map->regHist(clusterExpert);
......@@ -411,7 +409,7 @@ StatusCode PixelMainMon::BookClustersLumiBlockMon(void)
sc = lumiBlockHist.regHist(m_cluster_ToT_LB = TH1F_LW::create("Cluster_ToT_LB", ("Cluster Time over Threshold" + m_histTitleExt + ";ToT;# clusters").c_str(), 300,-0.5,299.5));
if (m_do2DMaps) {
m_cluster_occupancy_LB = new PixelMon2DMaps("Cluster_Occupancy_LB", ("Cluster Occupancy" + m_histTitleExt).c_str(), m_doIBL);
m_cluster_occupancy_LB = new PixelMon2DMapsLW("Cluster_Occupancy_LB", ("Cluster Occupancy" + m_histTitleExt).c_str(), m_doIBL);
sc = m_cluster_occupancy_LB->regHist(lumiBlockHist);
}
if (m_doLowOccupancy || m_doHighOccupancy) {
......
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
//////////////////////////////////////////////////////////////////////////////
// Function to handle 2D maps of modules, one for each region
///////////////////////////////////////////////////////////////////////////////
#include "PixelMonitoring/DBMMon2DMaps.h"
#include "InDetIdentifier/PixelID.h"
#include "TH2F.h"
#include "GaudiKernel/StatusCode.h"
#include <string.h>
DBMMon2DMaps::DBMMon2DMaps(std::string name, std::string title)
{
DBMA = new TH2F((name+"_A").c_str(),("Side A " + title + "; layer number; phi index of telescope").c_str(),3,-0.5,2.5,4,-.5,3.5);
DBMC = new TH2F((name+"_C").c_str(),("Side C " + title + "; layer number; phi index of telescope").c_str(),3,-0.5,2.5,4,-.5,3.5);
formatHist();
}
DBMMon2DMaps::~DBMMon2DMaps()
{
delete DBMA;
delete DBMC;
}
void DBMMon2DMaps::Fill(Identifier &id, const PixelID* pixID)
{
const int bec = pixID->barrel_ec(id);
const int ld = pixID->layer_disk(id);
const int pm = pixID->phi_module(id);
if (bec == 4) {
DBMA->Fill(ld, pm);
}
if (bec == -4) {
DBMC->Fill(ld, pm);
}
}
void DBMMon2DMaps::Scale (double number)
{
if (number==0) return; //shouldn't happen the way function is called, but dummy check to avoid divide by zero
DBMA->Scale((float) 1.0/number);
DBMC->Scale((float) 1.0/number);
}
void DBMMon2DMaps::formatHist()
{
const int ndisk = 3;
const int nphi = 4;
const char *phi[nphi] = { "M1","M2","M3","M4"};
const char *disk[ndisk] = { "Disk 0","Disk 1","Disk 2"};
for (int i = 0; i < nphi; i++) {
DBMA->GetYaxis()->SetBinLabel(i + 1, phi[i]);
DBMC->GetYaxis()->SetBinLabel(i + 1, phi[i]);
}
for (int i = 0; i < ndisk; i++) {
DBMA->GetXaxis()->SetBinLabel(i + 1, disk[i]);
DBMC->GetXaxis()->SetBinLabel(i + 1, disk[i]);
}
//Make the text smaller
DBMA->GetYaxis()->SetLabelSize(0.04);
DBMC->GetYaxis()->SetLabelSize(0.04);
DBMA->GetXaxis()->SetLabelSize(0.04);
DBMC->GetXaxis()->SetLabelSize(0.04);
//Move the lable so you can read it
DBMA->GetYaxis()->SetTitleOffset(1.35);
DBMC->GetYaxis()->SetTitleOffset(1.35);
//put histograms in the easier to read colz format
DBMA->SetOption("colz");
DBMC->SetOption("colz");
//force the minimum to be 0 so you can spot empty blocks easily
DBMA->SetMinimum(0.);
DBMC->SetMinimum(0.);
//Remvoe the stats box because it's in the way
DBMA->SetStats(0.);
DBMC->SetStats(0.);
}
StatusCode DBMMon2DMaps::regHist(ManagedMonitorToolBase::MonGroup &group)
{
StatusCode sc = StatusCode::SUCCESS;
if (group.regHist(DBMA).isFailure()) sc = StatusCode::FAILURE;
if (group.regHist(DBMC).isFailure()) sc = StatusCode::FAILURE;
return sc;
}
......@@ -26,8 +26,8 @@
#include "InDetReadoutGeometry/SiDetectorElement.h"
#include "PixelMonitoring/PixelMon2DMapsLW.h"
#include "PixelMonitoring/PixelMon2DProfilesLW.h"
#include "PixelMonitoring/PixelMonModules.h"
#include "PixelMonitoring/PixelMonProfiles.h"
#include "PixelMonitoring/PixelMon2DLumiMaps.h"
......@@ -197,11 +197,11 @@ StatusCode PixelMainMon::BookRODErrorMon(void)
if (m_do2DMaps && !m_doOnline) {
for (int i = 0; i < ErrorCategoryMODROD::COUNT - 3; i++) {
m_errhist_errtype_map[i] = new PixelMon2DMapsLW(error_type_labels[i].first, (error_type_labels[i].second + m_histTitleExt).c_str(), m_doIBL);
m_errhist_errtype_map[i] = new PixelMon2DMapsLW(error_type_labels[i].first, (error_type_labels[i].second + m_histTitleExt).c_str(), m_doIBL, false, true);
sc = m_errhist_errtype_map[i]->regHist(rodHistos);
}
for (int i = 0; i < ErrorCategory::COUNT; i++) {
m_errhist_errcat_map[i] = new PixelMon2DMapsLW(error_cat_labels[i].first.c_str(), (error_cat_labels[i].second + m_histTitleExt).c_str(), m_doIBL);
m_errhist_errcat_map[i] = new PixelMon2DMapsLW(error_cat_labels[i].first.c_str(), (error_cat_labels[i].second + m_histTitleExt).c_str(), m_doIBL, false, true);
sc = m_errhist_errcat_map[i]->regHist(rodHistos);
}
}
......@@ -221,12 +221,12 @@ StatusCode PixelMainMon::BookRODErrorMon(void)
}
hname = makeHistname((error_state_labels[j].first+"_Map"), false);
htitles = makeHisttitle((error_state_labels[j].second + " per event per LB"), "", false);
m_errhist_expert_maps[j] = new PixelMon2DMapsLW(hname.c_str(), htitles.c_str(), m_doIBL, true);
m_errhist_expert_maps[j] = new PixelMon2DMapsLW(hname.c_str(), htitles.c_str(), m_doIBL, true, true);
sc = m_errhist_expert_maps[j]->regHist(rodExpert);
}
if (m_do2DMaps) {
m_errhist_femcc_errwords_map = new PixelMonProfiles("femcc_errorwords", ("Average FE/MCC Error Words" + m_histTitleExt).c_str(), m_doIBL);
m_errhist_femcc_errwords_map = new PixelMon2DProfilesLW("femcc_errorwords", ("Average FE/MCC Error Words" + m_histTitleExt).c_str(), m_doIBL);
sc = m_errhist_femcc_errwords_map->regHist(rodHistos);
}
......@@ -276,13 +276,13 @@ StatusCode PixelMainMon::BookRODErrorLumiBlockMon(void)
StatusCode sc;
if (m_do2DMaps && !m_doOnline) {
m_errors_LB = new PixelMon2DMapsLW("Errors_LB", ("Errors" + m_histTitleExt).c_str(), m_doIBL);
m_errors_LB = new PixelMon2DMapsLW("Errors_LB", ("Errors" + m_histTitleExt).c_str(), m_doIBL, false, true);
sc = m_errors_LB->regHist(lumiBlockHist);
m_errors_RODSync_mod = new PixelMon2DMapsLW("Errors_RODSync_LB", ("Errors_RODSync" + m_histTitleExt).c_str(), m_doIBL);
m_errors_RODSync_mod = new PixelMon2DMapsLW("Errors_RODSync_LB", ("Errors_RODSync" + m_histTitleExt).c_str(), m_doIBL, false, true);
sc = m_errors_RODSync_mod->regHist(lumiBlockHist);
m_errors_ModSync_mod = new PixelMon2DMapsLW("Errors_ModSync_LB", ("Errors_ModSync" + m_histTitleExt).c_str(), m_doIBL);
m_errors_ModSync_mod = new PixelMon2DMapsLW("Errors_ModSync_LB", ("Errors_ModSync" + m_histTitleExt).c_str(), m_doIBL, false, true);
sc = m_errors_ModSync_mod->regHist(lumiBlockHist);
}
......
......@@ -19,7 +19,7 @@
#include <sstream>
#include <algorithm>
#include "InDetIdentifier/PixelID.h"
#include "PixelMonitoring/PixelMon2DMaps.h"
#include "PixelMonitoring/PixelMon2DMapsLW.h"
std::string PixelMainMon :: makeHistname(std::string set, bool ontrk)
......@@ -315,7 +315,7 @@ void PixelMainMon::FillTimeHisto(double value, TProfile* one=0, TProfile* two=0,
}
}
void PixelMainMon::FillSummaryHistos (PixelMon2DMaps* occupancy, TH1F_LW* A, TH1F_LW* C, TH1F_LW* IBL, TH1F_LW* B0, TH1F_LW* B1, TH1F_LW* B2)
void PixelMainMon::FillSummaryHistos (PixelMon2DMapsLW* occupancy, TH1F_LW* A, TH1F_LW* C, TH1F_LW* IBL, TH1F_LW* B0, TH1F_LW* B1, TH1F_LW* B2)
{
if( !(A && C && B0 && B1 && B2 && occupancy) )return; //if the histos don't exist, dont' fill them
......
......@@ -26,10 +26,8 @@
#include "InDetRawData/InDetRawDataContainer.h"
#include "InDetRawData/InDetRawDataCLASS_DEF.h"
#include "PixelMonitoring/PixelMon2DMaps.h"
#include "PixelMonitoring/PixelMon2DMapsLW.h"
#include "PixelMonitoring/PixelMon2DProfilesLW.h"
#include "PixelMonitoring/DBMMon2DMaps.h"
#include "PixelMonitoring/PixelMonModules.h"
#include "PixelMonitoring/PixelMon2DLumiProfiles.h"
......@@ -161,7 +159,7 @@ StatusCode PixelMainMon::BookHitsMon(void)
}
}
m_hitmap_tmp = new PixelMon2DMaps("HitMap_tmp", ("Hit map for monitoring" + m_histTitleExt).c_str(), m_doIBL);
m_hitmap_tmp = new PixelMon2DMapsLW("HitMap_tmp", ("Hit map for monitoring" + m_histTitleExt).c_str(), m_doIBL);
sc = m_hitmap_tmp->regHist(rdoShift);
for( int i=0; i<PixLayer::COUNT; i++){
......@@ -176,7 +174,7 @@ StatusCode PixelMainMon::BookHitsMon(void)
sc = rdoShift.regHist(m_occupancy_time2= new TProfile("occupancy_time_1hr", ("Module hit occupancy as function of time over 1 hour. 36 sec/bin" + m_histTitleExt + ";time;module occupancy").c_str(), 99,0.,1.,"i"));
sc = rdoShift.regHist(m_occupancy_time3= new TProfile("occupancy_time_6hr", ("Module hit occupancy as function of time over 6 hours. 3.6 min/bin" + m_histTitleExt + ";time;module occupancy").c_str(), 99,0.,1.,"i"));
m_hitmap_mon = new PixelMon2DMaps("HitMap_Mon", ("Hit map for monitoring" + m_histTitleExt).c_str(), m_doIBL);
m_hitmap_mon = new PixelMon2DMapsLW("HitMap_Mon", ("Hit map for monitoring" + m_histTitleExt).c_str(), m_doIBL);
sc = m_hitmap_mon->regHist(rdoShift);
for (int i=0; i<PixLayer::COUNT-1+(int)(m_doIBL); i++){
......@@ -236,10 +234,10 @@ StatusCode PixelMainMon::BookHitsMon(void)
if (m_do2DMaps)
{
m_occupancy = new PixelMon2DMaps("Occupancy", ("hit map"+ m_histTitleExt).c_str(), m_doIBL);
m_occupancy = new PixelMon2DMapsLW("Occupancy", ("hit map"+ m_histTitleExt).c_str(), m_doIBL);
sc = m_occupancy->regHist(rdoShift);
m_average_pixocc = new PixelMon2DMapsLW("Occupancy_per_pixel", ("#hits / pixel" + m_histTitleExt).c_str(), m_doIBL);
m_average_pixocc = new PixelMon2DMapsLW("Occupancy_per_pixel", ("#hits / pixel" + m_histTitleExt).c_str(), m_doIBL, false, true);
sc = m_average_pixocc->regHist(rdoShift);
m_occupancy_pix_evt = new PixelMon2DProfilesLW("Occupancy_per_pixel_event", ("#hits / pixel / event" + m_histTitleExt).c_str(), m_doIBL);
......@@ -392,7 +390,7 @@ StatusCode PixelMainMon::BookHitsLumiBlockMon(void)
sc = lumiBlockHist.regHist(m_Lvl1A_10min_mod[i] = TH1F_LW::create(hname.c_str(), htitles.c_str(), 14, -1.5, 12.5));
}
m_occupancy_10min = new PixelMon2DMaps("Occupancy_10min", ("hit occupancy" + m_histTitleExt).c_str(), m_doIBL);
m_occupancy_10min = new PixelMon2DMapsLW("Occupancy_10min", ("hit occupancy" + m_histTitleExt).c_str(), m_doIBL);
sc = m_occupancy_10min->regHist(lumiBlockHist);
if (sc.isFailure()) ATH_MSG_WARNING("Problems with booking Hit histograms per LB (low stat)");
......
......@@ -20,9 +20,7 @@
#include "LWHists/TProfile2D_LW.h"
#include "LWHists/TProfile_LW.h"
#include "InDetIdentifier/PixelID.h"
#include "PixelMonitoring/PixelMon2DMaps.h"
#include "PixelMonitoring/PixelMonModules.h"
#include "PixelMonitoring/PixelMonProfiles.h"
#include "TString.h"
#include "TMath.h"
// Database
......
......@@ -28,9 +28,6 @@
#include "InDetConditionsSummaryService/IInDetConditionsSvc.h"
#include "TH2S.h"
#include "TProfile2D.h"
#include "PixelMonitoring/DBMMon2DMaps.h"
#include "PixelMonitoring/PixelMon2DMaps.h"
#include "PixelMonitoring/PixelMonProfiles.h"
#include "LWHists/TH2F_LW.h"
#include "LWHists/TH1F_LW.h"
#include "LWHists/TH1I_LW.h"
......@@ -368,7 +365,6 @@ PixelMainMon::PixelMainMon(const std::string & type,
m_status = 0;
m_status_mon = 0;
m_status_LB = 0;
m_disabled = 0;
m_dqStatus = 0;
m_disabledModules_per_lumi_PIX = 0;
memset(m_badModules_per_lumi_mod, 0, sizeof(m_badModules_per_lumi_mod));
......
......@@ -8,7 +8,6 @@
#include "PixelMonitoring/PixelMon2DLumiMaps.h"
#include "InDetIdentifier/PixelID.h"
//#include "TH2I.h"
#include "LWHists/TH2F_LW.h"
#include "GaudiKernel/StatusCode.h"
#include <string.h>
......@@ -65,18 +64,6 @@ void PixelMon2DLumiMaps::Fill(double LB,Identifier &id, const PixelID* pixID,dou
}
}
void PixelMon2DLumiMaps::Scale (double number)
{
if (number==0) return; //shouldn't happen the way function is called, but dummy check to avoid divide by zero
Albm->scaleContentsAndErrors((float) 1.0/number);
Clbm->scaleContentsAndErrors((float) 1.0/number);
B0lbm->scaleContentsAndErrors((float) 1.0/number);
B1lbm->scaleContentsAndErrors((float) 1.0/number);
B2lbm->scaleContentsAndErrors((float) 1.0/number);
if (!m_errorHist && m_doIBL) IBLlbm->scaleContentsAndErrors((float) 1.0/number);
}
void PixelMon2DLumiMaps::formatHist()
{
const int ndisk = 3;
......
......@@ -8,8 +8,6 @@
#include "PixelMonitoring/PixelMon2DLumiProfiles.h"
#include "InDetIdentifier/PixelID.h"
//#include "TH2I.h"
#include "TH2F.h"
#include "LWHists/TProfile2D_LW.h"
#include "GaudiKernel/StatusCode.h"
#include <string.h>
......
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
//////////////////////////////////////////////////////////////////////////////
// Function to handle 2D maps of modules, one for each region
///////////////////////////////////////////////////////////////////////////////
#include "PixelMonitoring/PixelMon2DMaps.h"
#include "InDetIdentifier/PixelID.h"
//#include "TH2I.h"
#include "TH2F.h"
#include "GaudiKernel/StatusCode.h"
#include <string.h>
PixelMon2DMaps::PixelMon2DMaps(std::string name, std::string title, bool doIBL) : m_doIBL(doIBL)
{
m_cnt = 0;
if (m_doIBL) {
IBL3D = new TH2F((name+"_IBL3D").c_str(),(title + ", IBL 3D modules " + ";eta index of module;phi index of module").c_str(), 8, -.5, 7.5, 14, -0.5, 13.5);
IBL2D = new TH2F((name+"_IBL2D").c_str(),(title + ", IBL planar modules " + ";shifted eta index of module;phi index of module").c_str(), 12, -6.5, 5.5, 14, -0.5, 13.5);
IBL = new TH2F((name+"_IBL").c_str(), (title + ", IBL " + ";shifted eta index of module;phi index of module").c_str(), 32, -16.5, 15.5, 14, -0.5, 13.5);
}
B0 = new TH2F((name+"_B0").c_str(), (title + ", B0 " + ";eta index of module;phi index of module").c_str(), 13, -6.5, 6.5, 22, -0.5, 21.5);
B1 = new TH2F((name+"_B1").c_str(), (title + ", B1 " + ";eta index of module;phi index of module").c_str(), 13, -6.5, 6.5, 38, -0.5, 37.5);
B2 = new TH2F((name+"_B2").c_str(), (title + ", B2 " + ";eta index of module;phi index of module").c_str(), 13, -6.5, 6.5, 52, -0.5, 51.5);
A = new TH2F((name+"_ECA" ).c_str(), (title + ", ECA " + ";disk number;phi index of module").c_str(), 3, -0.5, 2.5, 48, -0.5, 47.5);
C = new TH2F((name+"_ECC" ).c_str(), (title + ", ECC " + ";disk number;phi index of module").c_str(), 3, -0.5, 2.5, 48, -0.5, 47.5);
DBMA = new TH2F((name+"_DBMA" ).c_str(), (title + ", DBMA " + ";layer number;phi index of telescope").c_str(), 3, -0.5, 2.5, 4, -0.5, 3.5);
DBMC = new TH2F((name+"_DBMC" ).c_str(), (title + ", DBMC " + ";layer number;phi index of telescope").c_str(), 3, -0.5, 2.5, 4, -0.5, 3.5);
formatHist();
}
PixelMon2DMaps::~PixelMon2DMaps()
{
if (m_doIBL) {
delete IBL3D;
delete IBL2D;
delete IBL;
}
delete B0;
delete B1;
delete B2;
delete A;
delete C;
delete DBMA;
delete DBMC;
}
void PixelMon2DMaps::Reset()
{
if (m_doIBL) {
IBL3D->Reset();
IBL2D->Reset();
IBL->Reset();
}
B0->Reset();
B1->Reset();
B2->Reset();
A->Reset();
C->Reset();
DBMA->Reset();
DBMC->Reset();
}
void PixelMon2DMaps::Fill(Identifier &id, const PixelID* pixID)
{
const int bec = pixID->barrel_ec(id);
const int pm = pixID->phi_module(id);
int ld = pixID->layer_disk(id);
if (bec == 2) A->Fill(ld, pm);
else if (bec == -2) C->Fill(ld, pm);
else if (bec == 4) DBMA->Fill(ld, pm);
else if (bec == -4) DBMC->Fill(ld, pm);
else if (bec == 0) {
if (m_doIBL) ld--;
const int em = pixID->eta_module(id);
if (ld == 0) {
B0->Fill(em, pm);
} else if (ld == 1) {
B1->Fill(em, pm);
} else if (ld == 2) {
B2->Fill(em, pm);
} else if (ld == -1) {
int feid = 0;
int emf = 0;
if (em < 6 && em > -7) {
if (pixID->eta_index(id) >= 80) feid = 1;
emf = 2 * em + feid;
IBL2D->Fill(em, pm);
} else if (em < -6) {
emf = em - 6;
IBL3D->Fill(em + 10, pm);
} else {
emf = em + 6;
IBL3D->Fill(em - 2, pm);
}
IBL->Fill(emf, pm);
}
}
}
void PixelMon2DMaps::WeightingFill(Identifier &id, const PixelID* pixID, float weight)
{
const int bec = pixID->barrel_ec(id);
const int pm = pixID->phi_module(id);
int ld = pixID->layer_disk(id);
if (bec == 2) A->Fill(ld, pm, weight);
else if (bec == -2) C->Fill(ld, pm, weight);
else if (bec == 4) DBMA->Fill(ld, pm, weight);
else if (bec == -4) DBMC->Fill(ld, pm, weight);
else if (bec == 0) {
if (m_doIBL) ld--;
int em = pixID->eta_module(id);
if (ld == 0) {
B0->Fill(em, pm, weight);
} else if (ld == 1) {
B1->Fill(em, pm, weight);
} else if (ld == 2) {
B2->Fill(em, pm, weight);
} else if (ld == -1) {
int feid = 0;
int emf = 0;
if (em < 6 && em > -7) {
if (pixID->eta_index(id) >= 80) feid = 1;
emf = 2 * em + feid;
IBL2D->Fill(em, pm, weight);
} else if (em < -6) {
emf = em - 6;
IBL3D->Fill(em + 10, pm, weight);
} else {
emf = em + 6;
IBL3D->Fill(em - 2, pm, weight);
}
IBL->Fill(emf, pm, weight);
}
}
}
//void PixelMon2DMaps::Scale (double number)
void PixelMon2DMaps::Scale (double number)
{
if (number==0) return; //shouldn't happen the way function is called, but dummy check to avoid divide by zero
A->Scale((float) 1.0/number);
C->Scale((float) 1.0/number);
DBMA->Scale((float) 1.0/number);
DBMC->Scale((float) 1.0/number);
B0->Scale((float) 1.0/number);
B1->Scale((float) 1.0/number);
B2->Scale((float) 1.0/number);
if (m_doIBL) {
IBL2D->Scale((float) 1.0/number);
IBL3D->Scale((float) 1.0/number);
IBL->Scale((float) 1.0/number);
}
}
void PixelMon2DMaps::ScaleBynPixnEvt(int nevent)
{
double nactivechannels_DBMA = 1.0*nevent*46080;
double nactivechannels_DBMC = 1.0*nevent*46080;
double nactivechannels_ECA = 1.0*nevent*46080;
double nactivechannels_ECC = 1.0*nevent*46080;
double nactivechannels_IBL2D = 1.0*nevent*26880*2;
double nactivechannels_IBL3D = 1.0*nevent*26880;
double nactivechannels_IBL = nactivechannels_IBL2D + nactivechannels_IBL3D;
double nactivechannels_B0 = 1.0*nevent*46080;
double nactivechannels_B1 = 1.0*nevent*46080;
double nactivechannels_B2 = 1.0*nevent*46080;
if (nevent==0) return; //shouldn't happen the way function is called, but dummy check to avoid divide by zero
DBMA->Scale((float) 1.0/nactivechannels_DBMA);
DBMC->Scale((float) 1.0/nactivechannels_DBMC);
A->Scale((float) 1.0/nactivechannels_ECA);
C->Scale((float) 1.0/nactivechannels_ECC);
B0->Scale((float) 1.0/nactivechannels_B0);
B1->Scale((float) 1.0/nactivechannels_B1);
B2->Scale((float) 1.0/nactivechannels_B2);
if (m_doIBL) {
IBL2D->Scale((float) 1.0/nactivechannels_IBL2D);
IBL3D->Scale((float) 1.0/nactivechannels_IBL3D);
IBL->Scale((float) 1.0/nactivechannels_IBL);
}
}
void PixelMon2DMaps::Fill2DMon(PixelMon2DMaps* oldmap)
{
for (int x = 1; x <= DBMA->GetNbinsX(); x++) {
for (int y = 1; y <= DBMA->GetNbinsY(); y++) {
float content = oldmap->DBMA->GetBinContent(x, y);
DBMA->SetBinContent(x, y, content);
oldmap->DBMA->SetBinContent(x, y, 0);
}
}
for (int x = 1; x <= DBMC->GetNbinsX(); x++) {
for (int y = 1; y <= DBMC->GetNbinsY(); y++) {
float content = oldmap->DBMC->GetBinContent(x, y);
DBMC->SetBinContent(x, y, content);
oldmap->DBMC->SetBinContent(x, y, 0);
}
}
for (int x = 1; x <= A->GetNbinsX(); x++) {
for (int y = 1; y <= A->GetNbinsY(); y++) {
float content = oldmap->A->GetBinContent(x, y);
A->SetBinContent(x, y, content);
oldmap->A->SetBinContent(x, y, 0);
}
}
for (int x = 1; x <= C->GetNbinsX(); x++) {
for (int y = 1; y <= C->GetNbinsY(); y++) {
float content = oldmap->C->GetBinContent(x, y);
C->SetBinContent(x, y, content);
oldmap->C->SetBinContent(x, y, 0);
}
}
for (int x = 1; x <= B0->GetNbinsX(); x++) {
for (int y = 1; y <= B0->GetNbinsY(); y++) {
float content = oldmap->B0->GetBinContent(x, y);
B0->SetBinContent(x, y, content);
oldmap->B0->SetBinContent(x, y, 0);
}
}
for (int x = 1; x <= B1->GetNbinsX(); x++) {
for (int y = 1; y <= B1->GetNbinsY(); y++) {
float content = oldmap->B1->GetBinContent(x, y);
B1->SetBinContent(x, y, content);
oldmap->B1->SetBinContent(x, y, 0);
}
}
for (int x = 1; x <= B2->GetNbinsX(); x++) {
for (int y = 1; y <= B2->GetNbinsY(); y++) {
float content = oldmap->B2->GetBinContent(x, y);
B2->SetBinContent(x, y, content );
oldmap->B2->SetBinContent(x, y, 0);
}
}
if (m_doIBL) {
for (int x = 1; x <= IBL->GetNbinsX(); x++) {
for (int y = 1; y <= IBL->GetNbinsY(); y++) {
float content = oldmap->IBL->GetBinContent(x, y);
IBL->SetBinContent(x, y, content);
oldmap->IBL->SetBinContent(x, y, 0);
}
}
for (int x = 1; x <= IBL2D->GetNbinsX(); x++) {
for (int y = 1; y <= IBL2D->GetNbinsY(); y++) {
float content = oldmap->IBL2D->GetBinContent(x, y);
IBL2D->SetBinContent(x, y, content);
oldmap->IBL2D->SetBinContent(x, y, 0);
}
}
for (int x = 1; x <= IBL3D->GetNbinsX(); x++) {
for (int y = 1; y <= IBL3D->GetNbinsY(); y++) {
float content = oldmap->IBL3D->GetBinContent(x, y);
IBL3D->SetBinContent(x, y, content);
oldmap->IBL3D->SetBinContent(x, y, 0);
}
}
}
}
void PixelMon2DMaps::ScaleByNChannels(int nActive_IBL2D, int nActive_IBL3D, int nActive_B0, int nActive_B1, int nActive_B2, int nActive_ECA, int nActive_ECC, int nActive_DBMA, int nActive_DBMC)
{
double nactivechannels_DBMA = 1.0*26880*nActive_DBMA;
double nactivechannels_DBMC = 1.0*26880*nActive_DBMC;
double nactivechannels_ECA = 1.0*46080*nActive_ECA;
double nactivechannels_ECC = 1.0*46080*nActive_ECC;
double nactivechannels_IBL2D = 1.0*26880*2*nActive_IBL2D;
double nactivechannels_IBL3D = 1.0*26880*nActive_IBL3D;
double nactivechannels_IBL = nactivechannels_IBL2D + nactivechannels_IBL3D;
double nactivechannels_B0 = 1.0*46080*nActive_B0;
double nactivechannels_B1 = 1.0*46080*nActive_B1;
double nactivechannels_B2 = 1.0*46080*nActive_B2;
if(nActive_DBMA>0) DBMA->Scale((double) 1.0/nactivechannels_DBMA);
if(nActive_DBMC>0) DBMC->Scale((double) 1.0/nactivechannels_DBMC);
if(nActive_ECA>0) A->Scale((double) 1.0/nactivechannels_ECA);
if(nActive_ECC>0) C->Scale((double) 1.0/nactivechannels_ECC);
if(nActive_B0>0) B0->Scale((double) 1.0/nactivechannels_B0);
if(nActive_B1>0) B1->Scale((double) 1.0/nactivechannels_B1);
if(nActive_B2>0) B2->Scale((double) 1.0/nactivechannels_B2);
if (m_doIBL) {
if(nActive_IBL2D>0) IBL2D->Scale((double) 1.0/nactivechannels_IBL2D);
if(nActive_IBL3D>0) IBL3D->Scale((double) 1.0/nactivechannels_IBL3D);
if(nActive_IBL3D>0 || nActive_IBL2D>0) IBL->Scale((double) 1.0/nactivechannels_IBL);
}
}
void PixelMon2DMaps::formatHist()
{
const int ndisk = 3;
const int nphi_dbm = 4;
const int nphi = 48;
const char *disk[ndisk] = { "Disk 1", "Disk 2", "Disk 3" };
const char *phi_dbm[nphi_dbm] = { "M1","M2","M3","M4"};
const int nmod = 13;
const int nmodIBL2D = 12;
const int nmodIBL3D = 8;
const int nmodIBL = 32;
const char *mod[nmod] = { "M6C", "M5C", "M4C", "M3C", "M2C", "M1C", "M0","M1A", "M2A", "M3A", "M4A", "M5A", "M6A" } ;
const char *modIBL2D[nmodIBL2D] = { "M3_C6", "M3_C5", "M2_C4", "M1_C3", "M1_C2", "M1_C1", "M1_A1", "M1_A2", "M2_A3", "M2_A4", "M3_A5", "M3_A6" } ;
const char *modIBL3D[nmodIBL3D] = {"M4_C8_2","M4_C8_1","M4_C7_2","M4_C7_1","M4_A7_1","M4_A7_2","M4_A8_1","M4_A8_2"};
const char *modIBL[nmodIBL] = {"C8","","C7","",
"C6","","C5","",
"C4","","C3","",
"C2","","C1","",
"A1","","A2","",
"A3","","A4","",
"A5","","A6","",
"A7","","A8",""};
const int nstaveb = 14;
const char *staveb[nstaveb] = {
"S01", "S02", "S03", "S04", "S05", "S06","S07",
"S08", "S09", "S10", "S11", "S12", "S13","S14"};
const int nstave0 = 22;
const char *stave0[nstave0] = {
"B11_S2", "B01_S1", "B01_S2", "B02_S1", "B02_S2", "B03_S1",
"B03_S2", "B04_S1", "B04_S2", "B05_S1", "B05_S2", "B06_S1",
"B06_S2", "B07_S1", "B07_S2", "B08_S1", "B08_S2", "B09_S1",
"B09_S2","B10_S1", "B10_S2", "B11_S1" };
const int nstave1 = 38;
const char *stave1[nstave1] = {
"B01_S1", "B01_S2", "B02_S1", "B02_S2", "B03_S1", "B03_S2",
"B04_S1", "B04_S2", "B05_S1", "B05_S2", "B06_S1", "B06_S2",
"B07_S1", "B07_S2", "B08_S1", "B08_S2", "B09_S1", "B09_S2",
"B10_S1", "B10_S2", "B11_S1", "B11_S2", "B12_S1", "B12_S2",
"B13_S1", "B13_S2", "B14_S1", "B14_S2", "B15_S1", "B15_S2",
"B16_S1", "B16_S2", "B17_S1", "B17_S2", "B18_S1", "B18_S2",
"B19_S1", "B19_S2" };
const int nstave2 = 52;
const char *stave2[nstave2] = {
"B01_S2", "B02_S1", "B02_S2", "B03_S1", "B03_S2", "B04_S1",
"B04_S2", "B05_S1", "B05_S2", "B06_S1", "B06_S2", "B07_S1",
"B07_S2", "B08_S1", "B08_S2", "B09_S1", "B09_S2", "B10_S1",
"B10_S2", "B11_S1", "B11_S2", "B12_S1", "B12_S2", "B13_S1",
"B13_S2", "B14_S1", "B14_S2", "B15_S1", "B15_S2", "B16_S1",
"B16_S2", "B17_S1", "B17_S2", "B18_S1", "B18_S2", "B19_S1",
"B19_S2", "B20_S1", "B20_S2", "B21_S1", "B21_S2", "B22_S1",
"B22_S2", "B23_S1", "B23_S2", "B24_S1", "B24_S2",
"B25_S1", "B25_S2", "B26_S1", "B26_S2", "B01_S1" };
const char *nstaveA[nphi] = {
"B01_S2_M1", "B01_S2_M6", "B01_S2_M2", "B01_S2_M5", "B01_S2_M3", "B01_S2_M4",
"B02_S1_M1", "B02_S1_M6", "B02_S1_M2", "B02_S1_M5", "B02_S1_M3", "B02_S1_M4",
"B02_S2_M1", "B02_S2_M6", "B02_S2_M2", "B02_S2_M5", "B02_S2_M3", "B02_S2_M4",
"B03_S1_M1", "B03_S1_M6", "B03_S1_M2", "B03_S1_M5", "B03_S1_M3", "B03_S1_M4",
"B03_S2_M1", "B03_S2_M6", "B03_S2_M2", "B03_S2_M5", "B03_S2_M3", "B03_S2_M4",
"B04_S1_M1", "B04_S1_M6", "B04_S1_M2", "B04_S1_M5", "B04_S1_M3", "B04_S1_M4",
"B04_S2_M1", "B04_S2_M6", "B04_S2_M2", "B04_S2_M5", "B04_S2_M3", "B04_S2_M4",
"B01_S1_M1", "B01_S1_M6", "B01_S1_M2", "B01_S1_M5", "B01_S1_M3", "B01_S1_M4"};
const char *nstaveC[nphi] = {
"B01_S2_M4", "B01_S2_M3", "B01_S2_M5", "B01_S2_M2", "B01_S2_M6", "B01_S2_M1",
"B02_S1_M4", "B02_S1_M3", "B02_S1_M5", "B02_S1_M2", "B02_S1_M6", "B02_S1_M1",
"B02_S2_M4", "B02_S2_M3", "B02_S2_M5", "B02_S2_M2", "B02_S2_M6", "B02_S2_M1",
"B03_S1_M4", "B03_S1_M3", "B03_S1_M5", "B03_S1_M2", "B03_S1_M6", "B03_S1_M1",
"B03_S2_M4", "B03_S2_M3", "B03_S2_M5", "B03_S2_M2", "B03_S2_M6", "B03_S2_M1",
"B04_S1_M4", "B04_S1_M3", "B04_S1_M5", "B04_S1_M2", "B04_S1_M6", "B04_S1_M1",
"B04_S2_M4", "B04_S2_M3", "B04_S2_M5", "B04_S2_M2", "B04_S2_M6", "B04_S2_M1",
"B01_S1_M4", "B01_S1_M3", "B01_S1_M5", "B01_S1_M2", "B01_S1_M6", "B01_S1_M1"};
for (int i = 0; i < nphi; i++) {
A->GetYaxis()->SetBinLabel(i + 1, nstaveA[i]);
C->GetYaxis()->SetBinLabel(i + 1, nstaveC[i]);
}
for (int i = 0; i < nphi_dbm; i++) {
DBMA->GetYaxis()->SetBinLabel(i + 1, phi_dbm[i]);
DBMC->GetYaxis()->SetBinLabel(i + 1, phi_dbm[i]);
}
for (int i = 0; i < ndisk; i++) {
A->GetXaxis()->SetBinLabel(i + 1, disk[i]);
C->GetXaxis()->SetBinLabel(i + 1, disk[i]);
DBMA->GetXaxis()->SetBinLabel(i + 1, disk[i]);
DBMC->GetXaxis()->SetBinLabel(i + 1, disk[i]);
}
for (int i = 0; i < nmod; i++) {
B0->GetXaxis()->SetBinLabel(i + 1, mod[i]); // bin 0 is underflow
B1->GetXaxis()->SetBinLabel(i + 1, mod[i]);
B2->GetXaxis()->SetBinLabel(i + 1, mod[i]);
}
if (m_doIBL) {
for (int i = 0; i < nmodIBL; i++) IBL->GetXaxis()->SetBinLabel(i + 1, modIBL[i]);
for (int i = 0; i < nstaveb; i++) IBL->GetYaxis()->SetBinLabel(i + 1, staveb[i]);
for (int i = 0; i < nmodIBL2D; i++) IBL2D->GetXaxis()->SetBinLabel(i + 1, modIBL2D[i]);
for (int i = 0; i < nstaveb; i++) IBL2D->GetYaxis()->SetBinLabel(i + 1, staveb[i]);
for (int i = 0; i < nmodIBL3D; i++) IBL3D->GetXaxis()->SetBinLabel(i + 1, modIBL3D[i]);
for (int i = 0; i < nstaveb; i++) IBL3D->GetYaxis()->SetBinLabel(i + 1, staveb[i]);
}
for (int i = 0; i < nstave0; i++) {
B0->GetYaxis()->SetBinLabel(i + 1, stave0[i]);
}
for (int i = 0; i < nstave1; i++) {
B1->GetYaxis()->SetBinLabel(i + 1, stave1[i]);
}
for (int i = 0; i < nstave2; i++) {
B2->GetYaxis()->SetBinLabel(i + 1, stave2[i]);
}
//Make the text smaller
if (m_doIBL) {
IBL2D->GetYaxis()->SetLabelSize(0.03);
IBL3D->GetYaxis()->SetLabelSize(0.03);
IBL->GetYaxis()->SetLabelSize(0.03);
}
B0->GetYaxis()->SetLabelSize(0.03);
B1->GetYaxis()->SetLabelSize(0.03);
B2->GetYaxis()->SetLabelSize(0.03);
A->GetYaxis()->SetLabelSize(0.02);
C->GetYaxis()->SetLabelSize(0.02);
DBMA->GetYaxis()->SetLabelSize(0.02);
DBMC->GetYaxis()->SetLabelSize(0.02);
//Move the lable so you can read it
if (m_doIBL) {
IBL2D->GetYaxis()->SetTitleOffset(1.35);
IBL3D->GetYaxis()->SetTitleOffset(1.35);
IBL->GetYaxis()->SetTitleOffset(1.35);
}
B0->GetYaxis()->SetTitleOffset(1.35);
B1->GetYaxis()->SetTitleOffset(1.35);
B2->GetYaxis()->SetTitleOffset(1.35);
A->GetYaxis()->SetTitleOffset(1.35);
C->GetYaxis()->SetTitleOffset(1.35);
DBMA->GetYaxis()->SetTitleOffset(1.35);
DBMC->GetYaxis()->SetTitleOffset(1.35);
//put histograms in the easier to read colz format
if (m_doIBL) {
IBL2D->SetOption("colz");
IBL3D->SetOption("colz");
IBL->SetOption("colz");
}
B0->SetOption("colz");
B1->SetOption("colz");
B2->SetOption("colz");
A->SetOption("colz");
C->SetOption("colz");
DBMA->SetOption("colz");
DBMC->SetOption("colz");
//force the minimum to be 0 so you can spot empty blocks easily
if (m_doIBL) {
IBL2D->SetMinimum(0.);
IBL3D->SetMinimum(0.);
IBL->SetMinimum(0.);
}
B0->SetMinimum(0.);
B1->SetMinimum(0.);
B2->SetMinimum(0.);
A->SetMinimum(0.);
C->SetMinimum(0.);
DBMA->SetMinimum(0.);
DBMC->SetMinimum(0.);
//Remvoe the stats box because it's in the way
if (m_doIBL) {
IBL2D->SetStats(0.);
IBL3D->SetStats(0.);
IBL->SetStats(0.);
}
B0->SetStats(0.);
B1->SetStats(0.);
B2->SetStats(0.);
A->SetStats(0.);
C->SetStats(0.);
DBMA->SetStats(0.);
DBMC->SetStats(0.);
}
StatusCode PixelMon2DMaps::regHist(ManagedMonitorToolBase::MonGroup &group)
{
StatusCode sc = StatusCode::SUCCESS;
if (m_doIBL) {
if (group.regHist(IBL2D).isFailure()) sc = StatusCode::FAILURE;
if (group.regHist(IBL3D).isFailure()) sc = StatusCode::FAILURE;
if (group.regHist(IBL).isFailure()) sc = StatusCode::FAILURE;
}
if (group.regHist(B0).isFailure()) sc = StatusCode::FAILURE;
if (group.regHist(B1).isFailure()) sc = StatusCode::FAILURE;
if (group.regHist(B2).isFailure()) sc = StatusCode::FAILURE;
if (group.regHist(A).isFailure()) sc = StatusCode::FAILURE;
if (group.regHist(C).isFailure()) sc = StatusCode::FAILURE;
if (group.regHist(DBMA).isFailure()) sc = StatusCode::FAILURE;
if (group.regHist(DBMC).isFailure()) sc = StatusCode::FAILURE;
return sc;
}
......@@ -8,13 +8,11 @@
#include "PixelMonitoring/PixelMon2DMapsLW.h"
#include "InDetIdentifier/PixelID.h"
//#include "TH2I.h"
#include "TH2F.h"
#include "LWHists/TH2F_LW.h"
#include "GaudiKernel/StatusCode.h"
#include <string.h>
PixelMon2DMapsLW::PixelMon2DMapsLW(std::string name, std::string title, bool doIBL, bool errorHist) : m_doIBL(doIBL), m_errorHist(errorHist)
PixelMon2DMapsLW::PixelMon2DMapsLW(std::string name, std::string title, bool doIBL, bool errorHist, bool copy2DFEval) : m_doIBL(doIBL), m_errorHist(errorHist), m_copy2DFEval(copy2DFEval)
{
std::string setatext = ";shifted eta index of module";
std::string etatext = ";eta index of module";
......@@ -93,7 +91,7 @@ void PixelMon2DMapsLW::Fill(Identifier &id, const PixelID* pixID)
IBL3D->Fill(em - 2,pm);
}
IBL->Fill(emf, pm);
if (copy) IBL->Fill(emf + 1, pm);
if (m_copy2DFEval && copy) IBL->Fill(emf + 1, pm);
}
}
}
......@@ -137,56 +135,79 @@ void PixelMon2DMapsLW::WeightingFill(Identifier &id, const PixelID* pixID, float
}
}
void PixelMon2DMapsLW::FillNormalized(PixelMon2DMapsLW* old, int nevent)
void PixelMon2DMapsLW::Fill2DMon(PixelMon2DMapsLW* oldmap)
{
double nactivechannels_ECA = 1.0*nevent;
double nactivechannels_ECC = 1.0*nevent;
double nactivechannels_IBL2D = 1.0*nevent;
double nactivechannels_IBL3D = 1.0*nevent;
double nactivechannels_IBL = nactivechannels_IBL2D + nactivechannels_IBL3D;
double nactivechannels_B0 = 1.0*nevent;
double nactivechannels_B1 = 1.0*nevent;
double nactivechannels_B2 = 1.0*nevent;
for (unsigned int x = 1; x <= A->GetXaxis()->GetNbins(); x++) {
for (unsigned int y = 1; y <= A->GetYaxis()->GetNbins(); y++) {
A->SetBinContent(x, y, old->A->GetBinContent(x, y)/nactivechannels_ECA);
if (!m_errorHist) {
for (unsigned int x = 1; x <= DBMA->GetNbinsX(); x++) {
for (unsigned int y = 1; y <= DBMA->GetNbinsY(); y++) {
float content = oldmap->DBMA->GetBinContent(x, y);
DBMA->SetBinContent(x, y, content);
oldmap->DBMA->SetBinContent(x, y, 0);
}
}
for (unsigned int x = 1; x <= DBMC->GetNbinsX(); x++) {
for (unsigned int y = 1; y <= DBMC->GetNbinsY(); y++) {
float content = oldmap->DBMC->GetBinContent(x, y);
DBMC->SetBinContent(x, y, content);
oldmap->DBMC->SetBinContent(x, y, 0);
}
}
}
for (unsigned int x = 1; x <= A->GetNbinsX(); x++) {
for (unsigned int y = 1; y <= A->GetNbinsY(); y++) {
float content = oldmap->A->GetBinContent(x, y);
A->SetBinContent(x, y, content);
oldmap->A->SetBinContent(x, y, 0);
}
}
for (unsigned int x = 1; x <= C->GetXaxis()->GetNbins(); x++) {
for (unsigned int y = 1; y <= C->GetYaxis()->GetNbins(); y++) {
C->SetBinContent(x, y, old->C->GetBinContent(x, y)/nactivechannels_ECC);
for (unsigned int x = 1; x <= C->GetNbinsX(); x++) {
for (unsigned int y = 1; y <= C->GetNbinsY(); y++) {
float content = oldmap->C->GetBinContent(x, y);
C->SetBinContent(x, y, content);
oldmap->C->SetBinContent(x, y, 0);
}
}
for (unsigned int x = 1; x <= B0->GetXaxis()->GetNbins(); x++) {
for (unsigned int y = 1; y <= B0->GetYaxis()->GetNbins(); y++) {
B0->SetBinContent(x, y, old->B0->GetBinContent(x, y)/nactivechannels_B0);
for (unsigned int x = 1; x <= B0->GetNbinsX(); x++) {
for (unsigned int y = 1; y <= B0->GetNbinsY(); y++) {
float content = oldmap->B0->GetBinContent(x, y);
B0->SetBinContent(x, y, content);
oldmap->B0->SetBinContent(x, y, 0);
}
}
for (unsigned int x = 1; x <= B1->GetXaxis()->GetNbins(); x++) {
for (unsigned int y = 1; y <= B1->GetYaxis()->GetNbins(); y++) {
B1->SetBinContent(x, y, old->B1->GetBinContent(x, y)/nactivechannels_B1);
for (unsigned int x = 1; x <= B1->GetNbinsX(); x++) {
for (unsigned int y = 1; y <= B1->GetNbinsY(); y++) {
float content = oldmap->B1->GetBinContent(x, y);
B1->SetBinContent(x, y, content);
oldmap->B1->SetBinContent(x, y, 0);
}
}
for (unsigned int x = 1; x <= B2->GetXaxis()->GetNbins(); x++) {
for (unsigned int y = 1; y <= B2->GetYaxis()->GetNbins(); y++) {
B2->SetBinContent(x, y, old->B2->GetBinContent(x, y)/nactivechannels_B2);
for (unsigned int x = 1; x <= B2->GetNbinsX(); x++) {
for (unsigned int y = 1; y <= B2->GetNbinsY(); y++) {
float content = oldmap->B2->GetBinContent(x, y);
B2->SetBinContent(x, y, content );
oldmap->B2->SetBinContent(x, y, 0);
}
}
if (m_doIBL && !m_errorHist) {
for (unsigned int x = 1; x <= IBL->GetXaxis()->GetNbins(); x++) {
for (unsigned int y = 1; y <= IBL->GetYaxis()->GetNbins(); y++) {
IBL->SetBinContent(x, y, old->IBL->GetBinContent(x, y)/nactivechannels_IBL);
for (unsigned int x = 1; x <= IBL->GetNbinsX(); x++) {
for (unsigned int y = 1; y <= IBL->GetNbinsY(); y++) {
float content = oldmap->IBL->GetBinContent(x, y);
IBL->SetBinContent(x, y, content);
oldmap->IBL->SetBinContent(x, y, 0);
}
}
for (unsigned int x = 1; x <= IBL2D->GetXaxis()->GetNbins(); x++) {
for (unsigned int y = 1; y <= IBL2D->GetYaxis()->GetNbins(); y++) {
IBL2D->SetBinContent(x, y, old->IBL2D->GetBinContent(x, y)/nactivechannels_IBL2D);
for (unsigned int x = 1; x <= IBL2D->GetNbinsX(); x++) {
for (unsigned int y = 1; y <= IBL2D->GetNbinsY(); y++) {
float content = oldmap->IBL2D->GetBinContent(x, y);
IBL2D->SetBinContent(x, y, content);
oldmap->IBL2D->SetBinContent(x, y, 0);
}
}
for (unsigned int x = 1; x <= IBL3D->GetXaxis()->GetNbins(); x++) {
for (unsigned int y = 1; y <= IBL3D->GetYaxis()->GetNbins(); y++) {
IBL3D->SetBinContent(x, y, old->IBL3D->GetBinContent(x, y)/nactivechannels_IBL3D);
for (unsigned int x = 1; x <= IBL3D->GetNbinsX(); x++) {
for (unsigned int y = 1; y <= IBL3D->GetNbinsY(); y++) {
float content = oldmap->IBL3D->GetBinContent(x, y);
IBL3D->SetBinContent(x, y, content);
oldmap->IBL3D->SetBinContent(x, y, 0);
}
}
}
......
......@@ -8,10 +8,9 @@
#include "PixelMonitoring/PixelMon2DProfilesLW.h"
#include "PixelMonitoring/PixelMon2DMapsLW.h"
#include "PixelMonitoring/PixelMon2DMaps.h"
#include "InDetIdentifier/PixelID.h"
#include "LWHists/TProfile2D_LW.h"
#include "LWHists/TH2F_LW.h"
#include "LWHists/TProfile2D_LW.h"
#include "GaudiKernel/StatusCode.h"
#include <string.h>
......@@ -53,6 +52,34 @@ PixelMon2DProfilesLW::~PixelMon2DProfilesLW()
//LWHist::safeDelete(DBMC);
}
void PixelMon2DProfilesLW::SetMaxValue(float max)
{
if (m_doIBL && !m_errorHist) {
IBL->SetMaximum(max);
IBL2D->SetMaximum(max);
IBL3D->SetMaximum(max);
}
B0->SetMaximum(max);
B1->SetMaximum(max);
B2->SetMaximum(max);
A->SetMaximum(max);
C->SetMaximum(max);
}
void PixelMon2DProfilesLW::Reset()
{
if (m_doIBL && !m_errorHist) {
IBL->Reset();
IBL2D->Reset();
IBL3D->Reset();
}
B0->Reset();
B1->Reset();
B2->Reset();
A->Reset();
C->Reset();
}
void PixelMon2DProfilesLW::Fill(Identifier &id, const PixelID* pixID, float weight)
{
const int bec = pixID->barrel_ec(id);
......@@ -316,7 +343,7 @@ void PixelMon2DProfilesLW::Fill2DMon(PixelMon2DProfilesLW* oldmap)
}
}
void PixelMon2DProfilesLW::FillFromMap(PixelMon2DMaps* inputmap, bool clear_inputmap)
void PixelMon2DProfilesLW::FillFromMap(PixelMon2DMapsLW* inputmap, bool clear_inputmap)
{
float weightIBL = 1.0 / 26880.0;
float weightPixel = 1.0 / 46080.0;
......
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