diff --git a/InnerDetector/InDetMonitoring/PixelMonitoring/PixelMonitoring/PixelMon2DLumiMaps.h b/InnerDetector/InDetMonitoring/PixelMonitoring/PixelMonitoring/PixelMon2DLumiMaps.h index 2ed6da6176cd33999796d7aea70045d97fb1569a..a87c8ba3b251900443ca60dfe128defa57097d03 100644 --- a/InnerDetector/InDetMonitoring/PixelMonitoring/PixelMonitoring/PixelMon2DLumiMaps.h +++ b/InnerDetector/InDetMonitoring/PixelMonitoring/PixelMonitoring/PixelMon2DLumiMaps.h @@ -22,7 +22,7 @@ class StatusCode; class PixelMon2DLumiMaps { public: - PixelMon2DLumiMaps(std::string name, std::string title, std::string zlabel,bool doIBL=false,bool errorHist=false); + PixelMon2DLumiMaps(std::string name, std::string title, std::string zlabel, bool doIBL, bool errorHist = false); ~PixelMon2DLumiMaps(); TH2F_LW* IBLlbm; TH2F_LW* B0lbm; @@ -30,11 +30,13 @@ class PixelMon2DLumiMaps TH2F_LW* B2lbm; TH2F_LW* Albm; TH2F_LW* Clbm; - void Fill(double LB,Identifier &id, const PixelID* pixID,double weight=1, bool doIBL=false, bool errorHist=false); - void Scale(double number,bool doIBL,bool errorHist); - StatusCode regHist(ManagedMonitorToolBase::MonGroup &group,bool doIBL=false,bool errorHist=false); + void Fill(double LB,Identifier &id, const PixelID* pixID, double weight = 1); + void Scale(double number); + StatusCode regHist(ManagedMonitorToolBase::MonGroup &group); private: - void formatHist(bool doIBL=false,bool errorHist=false); + void formatHist(); + const bool m_doIBL; + const bool m_errorHist; }; diff --git a/InnerDetector/InDetMonitoring/PixelMonitoring/PixelMonitoring/PixelMon2DLumiProfiles.h b/InnerDetector/InDetMonitoring/PixelMonitoring/PixelMonitoring/PixelMon2DLumiProfiles.h index 8bb61097462fe954ff1bea2cfc7e83e26e187aa6..e1083c72f966d562dea406cc82a8daad5a5f54b4 100644 --- a/InnerDetector/InDetMonitoring/PixelMonitoring/PixelMonitoring/PixelMon2DLumiProfiles.h +++ b/InnerDetector/InDetMonitoring/PixelMonitoring/PixelMonitoring/PixelMon2DLumiProfiles.h @@ -22,7 +22,7 @@ class StatusCode; class PixelMon2DLumiProfiles { public: - PixelMon2DLumiProfiles(std::string name, std::string title, std::string zlabel,bool doIBL=false,bool errorHist=false); + PixelMon2DLumiProfiles(std::string name, std::string title, std::string zlabel, bool doIBL, bool errorHist = false); ~PixelMon2DLumiProfiles(); TProfile2D_LW* IBLlbp; TProfile2D_LW* B0lbp; @@ -30,10 +30,12 @@ class PixelMon2DLumiProfiles TProfile2D_LW* B2lbp; TProfile2D_LW* Albp; TProfile2D_LW* Clbp; - void Fill(double LB, Identifier &id, const PixelID* pixID,double weight=1,bool doIBL=false,bool errorHist=false); - StatusCode regHist(ManagedMonitorToolBase::MonGroup &group,bool doIBL=false,bool errorHist=false); + void Fill(double LB, Identifier &id, const PixelID* pixID, double weight = 1); + StatusCode regHist(ManagedMonitorToolBase::MonGroup &group); private: - void formatHist(bool doIBL,bool errorHist); + void formatHist(); + const bool m_doIBL; + const bool m_errorHist; }; diff --git a/InnerDetector/InDetMonitoring/PixelMonitoring/PixelMonitoring/PixelMon2DMaps.h b/InnerDetector/InDetMonitoring/PixelMonitoring/PixelMonitoring/PixelMon2DMaps.h index fce0150373c14e625df96cef3f248403bbe727b3..9b9c7548b02312732d303c0c1ed9e0d70e1bd572 100644 --- a/InnerDetector/InDetMonitoring/PixelMonitoring/PixelMonitoring/PixelMon2DMaps.h +++ b/InnerDetector/InDetMonitoring/PixelMonitoring/PixelMonitoring/PixelMon2DMaps.h @@ -22,7 +22,7 @@ class StatusCode; class PixelMon2DMaps { public: - PixelMon2DMaps(std::string name, std::string title); + PixelMon2DMaps(std::string name, std::string title, bool doIBL); ~PixelMon2DMaps(); TH2F* IBL2D; TH2F* IBL3D; @@ -36,18 +36,16 @@ class PixelMon2DMaps TH2F* DBMC; int m_cnt; void Reset(); - void Fill(Identifier &id, const PixelID* pixID, bool doIBL); - void WeightingFill(Identifier &id, const PixelID* pixID, bool doIBL, float weight); - //void Scale(double number); - void Scale(double number, bool doIBL); + 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, bool doIBL); - //void FillNormalized(PixelMon2DMaps* old, int nevent, int nActive_IBL2D, int nActive_IBL3D, int nActive_B0, int nActive_B1, int nActive_B2, int nActive_ECA, int nActive_ECC, bool doIBL); - //void FillNormalized(PixelMon2DMaps* old, int nevent, int nActive_IBL2D, int nActive_IBL3D, int nActive_B0, int nActive_B1, int nActive_B2, int nActive_ECA, int nActive_ECC); + void ScaleBynPixnEvt(int nevent); void Fill2DMon(PixelMon2DMaps* oldmap); StatusCode regHist(ManagedMonitorToolBase::MonGroup &group); private: void formatHist(); + const bool m_doIBL; }; #endif diff --git a/InnerDetector/InDetMonitoring/PixelMonitoring/PixelMonitoring/PixelMon2DMapsLW.h b/InnerDetector/InDetMonitoring/PixelMonitoring/PixelMonitoring/PixelMon2DMapsLW.h index b7ae4f0a4cb10db3e06a7de4fa74798e8cd25f61..d71846fff02f2ef324147118e9e563ebd4832e4b 100644 --- a/InnerDetector/InDetMonitoring/PixelMonitoring/PixelMonitoring/PixelMon2DMapsLW.h +++ b/InnerDetector/InDetMonitoring/PixelMonitoring/PixelMonitoring/PixelMon2DMapsLW.h @@ -22,7 +22,7 @@ class StatusCode; class PixelMon2DMapsLW { public: - PixelMon2DMapsLW(std::string name, std::string title, bool doIBL, bool errorHist); + PixelMon2DMapsLW(std::string name, std::string title, bool doIBL, bool errorHist = false); ~PixelMon2DMapsLW(); TH2F_LW* IBL; TH2F_LW* IBL2D; @@ -34,14 +34,15 @@ class PixelMon2DMapsLW TH2F_LW* C; TH2F_LW* DBMA; TH2F_LW* DBMC; - void Fill(Identifier &id, const PixelID* pixID, bool doIBL, bool errorHist); + void Fill(Identifier &id, const PixelID* pixID); void FillNormalized(PixelMon2DMapsLW* old, int nevent); - void WeightingFill(Identifier &id, const PixelID* pixID, bool doIBL, float weight); + void WeightingFill(Identifier &id, const PixelID* pixID, float weight); void Scale(double number); - StatusCode regHist(ManagedMonitorToolBase::MonGroup &group, bool doIBL, bool errorHist); + StatusCode regHist(ManagedMonitorToolBase::MonGroup &group); private: - void formatHist(bool doIBL, bool errorHist); - + void formatHist(); + const bool m_doIBL; + const bool m_errorHist; }; #endif diff --git a/InnerDetector/InDetMonitoring/PixelMonitoring/PixelMonitoring/PixelMon2DProfilesLW.h b/InnerDetector/InDetMonitoring/PixelMonitoring/PixelMonitoring/PixelMon2DProfilesLW.h index 59851d164d6479a6a422a0d12a7509bec9c272c7..34a676f60e11fce218a0deae3a09d755bcb6031e 100644 --- a/InnerDetector/InDetMonitoring/PixelMonitoring/PixelMonitoring/PixelMon2DProfilesLW.h +++ b/InnerDetector/InDetMonitoring/PixelMonitoring/PixelMonitoring/PixelMon2DProfilesLW.h @@ -28,7 +28,7 @@ class PixelMon2DMapsLW; class PixelMon2DProfilesLW { public: - PixelMon2DProfilesLW(std::string name, std::string title, bool doIBL, bool errorHist, bool copy2DFEval); + PixelMon2DProfilesLW(std::string name, std::string title, bool doIBL, bool errorHist = false, bool copy2DFEval = false); ~PixelMon2DProfilesLW(); TProfile2D_LW* IBL; TProfile2D_LW* IBL2D; @@ -46,9 +46,9 @@ public: StatusCode regHist(ManagedMonitorToolBase::MonGroup &group); private: void formatHist(); - bool mDoIBL; - bool mDoErrorHist; - bool mCopy2DFEval; + const bool m_doIBL; + const bool m_errorHist; + const bool m_copy2DFEval; }; #endif diff --git a/InnerDetector/InDetMonitoring/PixelMonitoring/PixelMonitoring/PixelMonModules.h b/InnerDetector/InDetMonitoring/PixelMonitoring/PixelMonitoring/PixelMonModules.h index 5e2eb8d1db2ce3d897741a841f874b1995935fbe..eba7765dcc06bba60f9bc590a099b1d7a5a6e998 100644 --- a/InnerDetector/InDetMonitoring/PixelMonitoring/PixelMonitoring/PixelMonModules.h +++ b/InnerDetector/InDetMonitoring/PixelMonitoring/PixelMonitoring/PixelMonModules.h @@ -25,63 +25,60 @@ class PixelMonModules { public: //PixelMonModules(); - virtual ~PixelMonModules()=0; - virtual void formatHist(std::string, bool doIBL)=0;//pass the bin lables here if needed - virtual void Reset()=0; - virtual StatusCode regHist(ManagedMonitorToolBase* thisptr, std::string path, ManagedMonitorToolBase::Interval_t Run, bool doIBL)=0; - //virtual StatusCode regHist(ManagedMonitorToolBase* thisptr, std::string path, ManagedMonitorToolBase::Interval_t Run, ManagedMonitorToolBase::MgmtAttr_t m=ATTRIB_MANAGED, bool doIBL)=0; -protected: + virtual ~PixelMonModules() = 0; + virtual void formatHist(std::string) = 0; //pass the bin labels here if needed + virtual void Reset() = 0; + virtual StatusCode regHist(ManagedMonitorToolBase* thisptr, std::string path, ManagedMonitorToolBase::Interval_t Run) = 0; + protected: int m_nBins; - std::string getHistName(int i, bool forPath=false, bool doIBL=false); - + std::string getHistName(int i, bool forPath = false, bool doIBL = false); }; class PixelMonModules1D : public PixelMonModules { - public: + public: PixelMonModules1D(std::string name, std::string title, int nbins, double low, double high, bool doIBL); PixelMonModules1D(std::string name, std::string title, int nbins, double *arr, bool doIBL); -virtual ~PixelMonModules1D(); - StatusCode regHist(ManagedMonitorToolBase* thisptr, std::string path, ManagedMonitorToolBase::Interval_t Run, bool doIBL); -//StatusCode regHist(ManagedMonitorToolBase* thisptr, std::string path, ManagedMonitorToolBase::Interval_t Run, ManagedMonitorToolBase::MgmtAttr_t m=ATTRIB_MANAGED,bool doIBL); + virtual ~PixelMonModules1D(); + StatusCode regHist(ManagedMonitorToolBase* thisptr, std::string path, ManagedMonitorToolBase::Interval_t Run); TH1F* IBL[20][14]; TH1F* B0[13][22]; TH1F* B1[13][38]; TH1F* B2[13][52]; TH1F* A[3][48]; TH1F* C[3][48]; - virtual void formatHist(std::string opt="", bool doIBL=false); //pass the bin lables here if needed - void Fill(double value, Identifier &id, const PixelID* pixID,bool doIBL); + virtual void formatHist(std::string opt = ""); //pass the bin labels here if needed + void Fill(double value, Identifier &id, const PixelID* pixID); void SetBinLabel(const char* lable, int binN); virtual void Reset(); double GetBinContent(double value, Identifier &id, const PixelID* pixID); private: TH1F* m_Dummy; //shouldn't be used unless messed up; TH1F* &getHist(int i); //make looping over all the histos easier. + const bool m_doIBL; }; class PixelMonModulesProf : public PixelMonModules { - public: + public: PixelMonModulesProf(std::string name, std::string title, int nbins, double low, double high, bool doIBL); PixelMonModulesProf(std::string name, std::string title, int nbins, double *arr, bool doIBL); -virtual ~PixelMonModulesProf(); - StatusCode regHist(ManagedMonitorToolBase* thisptr, std::string path, ManagedMonitorToolBase::Interval_t Run, bool doIBL); -//StatusCode regHist(ManagedMonitorToolBase* thisptr, std::string path, ManagedMonitorToolBase::Interval_t Run, ManagedMonitorToolBase::MgmtAttr_t m=ATTRIB_MANAGED,bool doIBL); + virtual ~PixelMonModulesProf(); + StatusCode regHist(ManagedMonitorToolBase* thisptr, std::string path, ManagedMonitorToolBase::Interval_t Run); TProfile_LW* IBL[20][14]; TProfile_LW* B0[13][22]; TProfile_LW* B1[13][38]; TProfile_LW* B2[13][52]; TProfile_LW* A[3][48]; TProfile_LW* C[3][48]; - virtual void formatHist(std::string opt="", bool doIBL=false); //pass the bin lables here if needed - void Fill(double value0, double value1, Identifier &id, const PixelID* pixID,bool doIBL); + virtual void formatHist(std::string opt = ""); //pass the bin labels here if needed + void Fill(double value0, double value1, Identifier &id, const PixelID* pixID); void SetBinLabel(const char* lable, int binN); virtual void Reset(); - //double GetBinContent(double value, Identifier &id, const PixelID* pixID); private: TProfile_LW* m_Dummy; //shouldn't be used unless messed up; TProfile_LW* &getHist(int i); //make looping over all the histos easier. + const bool m_doIBL; }; class PixelMonModules2D : public PixelMonModules @@ -89,21 +86,21 @@ class PixelMonModules2D : public PixelMonModules public: PixelMonModules2D(std::string name, std::string title, int nbins0, double low0, double high0,int nbins1, double low1, double high1, bool doIBL); virtual ~PixelMonModules2D(); - StatusCode regHist(ManagedMonitorToolBase* thisptr, std::string path, ManagedMonitorToolBase::Interval_t Run, bool doIBL); - //StatusCode regHist(ManagedMonitorToolBase* thisptr, std::string path, ManagedMonitorToolBase::Interval_t Run, ManagedMonitorToolBase::MgmtAttr_t m=ATTRIB_MANAGED, bool doIBL); + StatusCode regHist(ManagedMonitorToolBase* thisptr, std::string path, ManagedMonitorToolBase::Interval_t Run); TH2F* IBL[20][14]; TH2F* B0[13][22]; TH2F* B1[13][38]; TH2F* B2[13][52]; TH2F* A[3][48]; TH2F* C[3][48]; - virtual void formatHist(std::string opt="", bool doIBL=false); //pass the bin lables here if needed - void Fill(double value0, double value1, Identifier &id, const PixelID* pixID,double weight,bool doIBL); - void Fill(double value0, double value1, Identifier &id, const PixelID* pixID,bool doIBL); + 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); virtual void Reset(); private: TH2F* m_Dummy; //shouldn't be used unless messed up; TH2F* &getHist(int i); //make looping over all the histos easier. + const bool m_doIBL; }; #endif diff --git a/InnerDetector/InDetMonitoring/PixelMonitoring/PixelMonitoring/PixelMonProfiles.h b/InnerDetector/InDetMonitoring/PixelMonitoring/PixelMonitoring/PixelMonProfiles.h index cfea601049ba54b456f02e405f823c5736e1263d..203fec416f3d1f4d1e05989d3e153b7cda5cc1f8 100644 --- a/InnerDetector/InDetMonitoring/PixelMonitoring/PixelMonitoring/PixelMonProfiles.h +++ b/InnerDetector/InDetMonitoring/PixelMonitoring/PixelMonitoring/PixelMonProfiles.h @@ -24,7 +24,7 @@ class StatusCode; class PixelMonProfiles { public: - PixelMonProfiles(std::string name, std::string title); + PixelMonProfiles(std::string name, std::string title, bool doIBL); ~PixelMonProfiles(); TProfile2D_LW* IBL; TProfile2D_LW* IBL2D; @@ -34,12 +34,13 @@ class PixelMonProfiles TProfile2D_LW* B2; TProfile2D_LW* A; TProfile2D_LW* C; - void Fill(Identifier &id, const PixelID* pixID, float Index, bool doIBL); + 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 diff --git a/InnerDetector/InDetMonitoring/PixelMonitoring/src/Clusters.cxx b/InnerDetector/InDetMonitoring/PixelMonitoring/src/Clusters.cxx index 5b0683a080737e7a54f3268f91c6eb9bbf777986..eef19f371bc5463f036379ff60a668061831f3c9 100644 --- a/InnerDetector/InDetMonitoring/PixelMonitoring/src/Clusters.cxx +++ b/InnerDetector/InDetMonitoring/PixelMonitoring/src/Clusters.cxx @@ -251,41 +251,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_cluster_occupancy = new PixelMon2DMaps(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_cluster_LVL1A_mod = new PixelMonProfiles(tmp.c_str(), (tmp2 + m_histTitleExt).c_str(), m_doIBL); 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_clusocc_sizenot1 = new PixelMon2DMaps(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_clus_LVL1A_sizenot1 = new PixelMonProfiles(tmp.c_str(), (tmp2 + m_histTitleExt).c_str(), m_doIBL); 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_clustermap_mon = new PixelMon2DMaps(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_clustermap_tmp = new PixelMon2DMaps(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_clussize_map = new PixelMonProfiles(tmp.c_str(), (tmp2 + m_histTitleExt).c_str(), m_doIBL); 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_cluscharge_map = new PixelMonProfiles(tmp.c_str(), (tmp2 + m_histTitleExt).c_str(), m_doIBL); 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_clusToT_map = new PixelMonProfiles(tmp.c_str(), (tmp2 + m_histTitleExt).c_str(), m_doIBL); sc = m_clusToT_map->regHist(clusterExpert); @@ -319,16 +319,16 @@ StatusCode PixelMainMon::BookClustersMon(void) if (m_doModules) { m_cluseff_mod = new PixelMonModulesProf("Clus_track_eff", ("Proportion of clusters on track vs t in module" + m_histTitleExt).c_str(), 2500,-0.5,2499.5,m_doIBL); - sc = m_cluseff_mod->regHist(this,(path+"/Modules_Cluseff").c_str(),run, m_doIBL); + sc = m_cluseff_mod->regHist(this,(path+"/Modules_Cluseff").c_str(),run); m_cluster_size_mod = new PixelMonModules1D("Cluster_size", ("Cluster size in Module" + m_histTitleExt).c_str(), 20,-0.5,19.5,m_doIBL); - sc = m_cluster_size_mod->regHist(this,(path+"/Modules_ClusterSize").c_str(),run,m_doIBL); + sc = m_cluster_size_mod->regHist(this,(path+"/Modules_ClusterSize").c_str(),run); m_cluster_num_mod = new PixelMonModules1D("Cluster_num", ("Number of clusters per event in module" + m_histTitleExt).c_str(), 30,-0.5,29.5,m_doIBL); - sc = m_cluster_num_mod->regHist(this,(path+"/Modules_NumberOfClusters").c_str(),run,m_doIBL); + sc = m_cluster_num_mod->regHist(this,(path+"/Modules_NumberOfClusters").c_str(),run); m_cluster_ToT_mod = new PixelMonModules1D("Cluster_ToT", ("Cluster ToT in Module" + m_histTitleExt).c_str(), 200,0.,200.,m_doIBL); - sc = m_cluster_ToT_mod->regHist(this,(path+"/Modules_ClusToT").c_str(),run,m_doIBL); + sc = m_cluster_ToT_mod->regHist(this,(path+"/Modules_ClusToT").c_str(),run); } if (m_doOnline) { @@ -411,7 +411,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_cluster_occupancy_LB = new PixelMon2DMaps("Cluster_Occupancy_LB", ("Cluster Occupancy" + m_histTitleExt).c_str(), m_doIBL); sc = m_cluster_occupancy_LB->regHist(lumiBlockHist); } if (m_doLowOccupancy || m_doHighOccupancy) { @@ -422,9 +422,9 @@ StatusCode PixelMainMon::BookClustersLumiBlockMon(void) if (m_doModules) { m_cluster_num_mod_LB = new PixelMonModules1D("Cluster_num_LB", ("Number of clusters per event in module" + m_histTitleExt).c_str(), 20,-0.5,59.5,m_doIBL); - sc = m_cluster_num_mod_LB->regHist(this,(path+"/Modules_NumberOfClusters").c_str(),lowStat,m_doIBL); + sc = m_cluster_num_mod_LB->regHist(this,(path+"/Modules_NumberOfClusters").c_str(),lowStat); m_cluster_ToT_mod_LB = new PixelMonModules1D("Cluster_ToT_mod_LB", ("Cluster ToT in Module" + m_histTitleExt).c_str(), 75,0.,300.,m_doIBL); - sc = m_cluster_ToT_mod_LB->regHist(this,(path+"/Modules_ClusToT").c_str(),lowStat,m_doIBL); + sc = m_cluster_ToT_mod_LB->regHist(this,(path+"/Modules_ClusToT").c_str(),lowStat); } if (sc.isFailure() && msgLvl(MSG::WARNING) ) msg(MSG::WARNING) << "Per LB pixel cluster monitoring histograms not booked" << endmsg; @@ -552,7 +552,7 @@ StatusCode PixelMainMon::FillClustersMon(void) if (pixlayerdbm == PixLayerDBM::kIBL && m_cluster_Q_mod[pixlayerdbm]) m_cluster_Q_mod[pixlayerdbm]->Fill(cluster.totalCharge()); if (pixlayeribl2d3ddbm!=99 && m_cluster_groupsize_mod[pixlayeribl2d3ddbm]) m_cluster_groupsize_mod[pixlayeribl2d3ddbm]->Fill( npixHitsInCluster ); if (pixlayerdbm == PixLayerDBM::kIBL && m_cluster_groupsize_mod[pixlayerdbm]) m_cluster_groupsize_mod[pixlayerdbm]->Fill( npixHitsInCluster ); - if (m_cluster_occupancy) m_cluster_occupancy->Fill(clusID,m_pixelid,m_doIBL); + if (m_cluster_occupancy) m_cluster_occupancy->Fill(clusID, m_pixelid); if (pixlayer == 99) continue; // DBM case @@ -562,8 +562,8 @@ StatusCode PixelMainMon::FillClustersMon(void) /// Fill LVL1 Accepted /// if (m_cluster_LVL1A) m_cluster_LVL1A->Fill(cluster.LVL1A()); - if (m_cluster_LVL1A_mod) m_cluster_LVL1A_mod->Fill(clusID,m_pixelid,cluster.LVL1A()+0.00001,m_doIBL); //avoid filling exactly zero to distinguish from disabled modules - if (cluster.rdoList().size()>1 && m_clus_LVL1A_sizenot1) m_clus_LVL1A_sizenot1->Fill(clusID,m_pixelid,cluster.LVL1A()+0.00001,m_doIBL); //avoid filling exactly zero to distinguish from disabled modules + if (m_cluster_LVL1A_mod) m_cluster_LVL1A_mod->Fill(clusID,m_pixelid,cluster.LVL1A()+0.00001); //avoid filling exactly zero to distinguish from disabled modules + if (cluster.rdoList().size()>1 && m_clus_LVL1A_sizenot1) m_clus_LVL1A_sizenot1->Fill(clusID,m_pixelid,cluster.LVL1A()+0.00001); //avoid filling exactly zero to distinguish from disabled modules if (pixlayer != PixLayer::kIBL) { if (cluster.totalToT() > 15 && m_cluster_LVL1A1d_mod[pixlayer]) m_cluster_LVL1A1d_mod[pixlayer]->Fill(cluster.LVL1A()); } else { @@ -573,7 +573,7 @@ StatusCode PixelMainMon::FillClustersMon(void) /// /// Fill ToT /// - if (m_cluster_ToT_mod) m_cluster_ToT_mod->Fill(cluster.totalToT(),clusID,m_pixelid,m_doIBL); + if (m_cluster_ToT_mod) m_cluster_ToT_mod->Fill(cluster.totalToT(), clusID, m_pixelid); if (cluster.rdoList().size()==1 && m_1cluster_ToT_mod[pixlayer] ) m_1cluster_ToT_mod[pixlayer]->Fill(cluster.totalToT()); if (cluster.rdoList().size()==2 && m_2cluster_ToT_mod[pixlayer] ) m_2cluster_ToT_mod[pixlayer]->Fill(cluster.totalToT()); @@ -592,12 +592,12 @@ StatusCode PixelMainMon::FillClustersMon(void) /// Fill Cluster efficiency /// if ( OnTrack(clusID,true) ) { - if (m_cluseff_mod) m_cluseff_mod->Fill(m_manager->lumiBlockNumber(),1.,clusID,m_pixelid,m_doIBL); + if (m_cluseff_mod) m_cluseff_mod->Fill(m_manager->lumiBlockNumber(),1.,clusID,m_pixelid); if (m_clusize_ontrack_mod[pixlayer]) m_clusize_ontrack_mod[pixlayer]->Fill(cluster.rdoList().size()); if (pixlayer == PixLayer::kIBL && m_clusize_ontrack_mod[pixlayeribl2d3d]) m_clusize_ontrack_mod[pixlayeribl2d3d]->Fill( npixHitsInClusterRaw ); } else { - if (m_cluseff_mod) m_cluseff_mod->Fill(m_manager->lumiBlockNumber(),0.,clusID,m_pixelid,m_doIBL); + if (m_cluseff_mod) m_cluseff_mod->Fill(m_manager->lumiBlockNumber(),0.,clusID,m_pixelid); if (m_clusize_offtrack_mod[pixlayer]) m_clusize_offtrack_mod[pixlayer]->Fill(cluster.rdoList().size()); if (pixlayer == PixLayer::kIBL && m_clusize_offtrack_mod[pixlayeribl2d3d]) m_clusize_offtrack_mod[pixlayeribl2d3d]->Fill(npixHitsInClusterRaw); @@ -642,15 +642,15 @@ StatusCode PixelMainMon::FillClustersMon(void) /// /// Fill Occupancy /// - if (cluster.rdoList().size()>1 && m_clusocc_sizenot1) m_clusocc_sizenot1->Fill(clusID,m_pixelid,m_doIBL); - if (m_doOnline && m_clustermap_tmp) m_clustermap_tmp->Fill(clusID, m_pixelid, m_doIBL); + if (cluster.rdoList().size()>1 && m_clusocc_sizenot1) m_clusocc_sizenot1->Fill(clusID, m_pixelid); + if (m_doOnline && m_clustermap_tmp) m_clustermap_tmp->Fill(clusID, m_pixelid); /// 2D Map - if (m_clussize_map) m_clussize_map->Fill(clusID,m_pixelid,cluster.rdoList().size(),m_doIBL); - if (m_cluscharge_map) m_cluscharge_map->Fill(clusID,m_pixelid,cluster.totalCharge(),m_doIBL); - if (m_clusToT_map) m_clusToT_map->Fill(clusID,m_pixelid,cluster.totalToT(),m_doIBL); + if (m_clussize_map) m_clussize_map->Fill(clusID,m_pixelid,cluster.rdoList().size()); + if (m_cluscharge_map) m_cluscharge_map->Fill(clusID,m_pixelid,cluster.totalCharge()); + if (m_clusToT_map) m_clusToT_map->Fill(clusID,m_pixelid,cluster.totalToT()); - if (m_cluster_size_mod)m_cluster_size_mod->Fill(cluster.rdoList().size(),clusID,m_pixelid,m_doIBL); + if (m_cluster_size_mod)m_cluster_size_mod->Fill(cluster.rdoList().size(),clusID,m_pixelid); if (m_clusToT_vs_eta_mod[pixlayer]) m_clusToT_vs_eta_mod[pixlayer]->Fill(m_pixelid->eta_module(clusID), cluster.totalToT()); if (m_ToT_vs_clussize_mod[pixlayer]) m_ToT_vs_clussize_mod[pixlayer]->Fill(cluster.totalToT(), cluster.rdoList().size()); @@ -676,9 +676,9 @@ StatusCode PixelMainMon::FillClustersMon(void) } if (m_doLumiBlock) { - if (m_cluster_occupancy_LB) m_cluster_occupancy_LB->Fill(clusID,m_pixelid,m_doIBL); + if (m_cluster_occupancy_LB) m_cluster_occupancy_LB->Fill(clusID,m_pixelid); if (m_cluster_ToT_LB)m_cluster_ToT_LB->Fill(cluster.totalToT()); - if (m_cluster_ToT_mod_LB) m_cluster_ToT_mod_LB->Fill(cluster.totalToT(),clusID,m_pixelid,m_doIBL); + if (m_cluster_ToT_mod_LB) m_cluster_ToT_mod_LB->Fill(cluster.totalToT(),clusID,m_pixelid); } /// Quick Status @@ -748,24 +748,24 @@ StatusCode PixelMainMon::FillClustersMon(void) for (; idIt != idItEnd; ++idIt) { Identifier WaferID = *idIt; - if (m_pixelid->barrel_ec(WaferID)==2 ) m_cluster_num_mod->Fill( m_ClusPerEventArray_disksA[m_pixelid->phi_module(WaferID)][m_pixelid->layer_disk(WaferID)], WaferID, m_pixelid ,m_doIBL); - if (m_pixelid->barrel_ec(WaferID)==-2) m_cluster_num_mod->Fill( m_ClusPerEventArray_disksC[m_pixelid->phi_module(WaferID)][m_pixelid->layer_disk(WaferID)], WaferID, m_pixelid ,m_doIBL); + if (m_pixelid->barrel_ec(WaferID)==2 ) m_cluster_num_mod->Fill( m_ClusPerEventArray_disksA[m_pixelid->phi_module(WaferID)][m_pixelid->layer_disk(WaferID)], WaferID, m_pixelid); + if (m_pixelid->barrel_ec(WaferID)==-2) m_cluster_num_mod->Fill( m_ClusPerEventArray_disksC[m_pixelid->phi_module(WaferID)][m_pixelid->layer_disk(WaferID)], WaferID, m_pixelid); if (m_pixelid->barrel_ec(WaferID)==0 ) { - if (m_doIBL && m_pixelid->layer_disk(WaferID)==0) m_cluster_num_mod->Fill( m_ClusPerEventArray_lI[m_pixelid->phi_module(WaferID)][m_pixelid->eta_module(WaferID)+10], WaferID, m_pixelid ,m_doIBL); - if (m_pixelid->layer_disk(WaferID)==0+m_doIBL) m_cluster_num_mod->Fill( m_ClusPerEventArray_l0[m_pixelid->phi_module(WaferID)][m_pixelid->eta_module(WaferID)+6], WaferID, m_pixelid ,m_doIBL); - if (m_pixelid->layer_disk(WaferID)==1+m_doIBL) m_cluster_num_mod->Fill( m_ClusPerEventArray_l1[m_pixelid->phi_module(WaferID)][m_pixelid->eta_module(WaferID)+6], WaferID, m_pixelid ,m_doIBL); - if (m_pixelid->layer_disk(WaferID)==2+m_doIBL) m_cluster_num_mod->Fill( m_ClusPerEventArray_l2[m_pixelid->phi_module(WaferID)][m_pixelid->eta_module(WaferID)+6], WaferID, m_pixelid ,m_doIBL); + if (m_doIBL && m_pixelid->layer_disk(WaferID)==0) m_cluster_num_mod->Fill( m_ClusPerEventArray_lI[m_pixelid->phi_module(WaferID)][m_pixelid->eta_module(WaferID)+10], WaferID, m_pixelid); + if (m_pixelid->layer_disk(WaferID)==0+m_doIBL) m_cluster_num_mod->Fill( m_ClusPerEventArray_l0[m_pixelid->phi_module(WaferID)][m_pixelid->eta_module(WaferID)+6], WaferID, m_pixelid); + if (m_pixelid->layer_disk(WaferID)==1+m_doIBL) m_cluster_num_mod->Fill( m_ClusPerEventArray_l1[m_pixelid->phi_module(WaferID)][m_pixelid->eta_module(WaferID)+6], WaferID, m_pixelid); + if (m_pixelid->layer_disk(WaferID)==2+m_doIBL) m_cluster_num_mod->Fill( m_ClusPerEventArray_l2[m_pixelid->phi_module(WaferID)][m_pixelid->eta_module(WaferID)+6], WaferID, m_pixelid); } if (m_doLumiBlock) { - if (m_pixelid->barrel_ec(WaferID)==2 ) m_cluster_num_mod_LB->Fill( m_ClusPerEventArray_disksA[m_pixelid->phi_module(WaferID)][m_pixelid->layer_disk(WaferID)], WaferID, m_pixelid ,m_doIBL); - if (m_pixelid->barrel_ec(WaferID)==-2) m_cluster_num_mod_LB->Fill( m_ClusPerEventArray_disksC[m_pixelid->phi_module(WaferID)][m_pixelid->layer_disk(WaferID)], WaferID, m_pixelid ,m_doIBL); + if (m_pixelid->barrel_ec(WaferID)==2 ) m_cluster_num_mod_LB->Fill( m_ClusPerEventArray_disksA[m_pixelid->phi_module(WaferID)][m_pixelid->layer_disk(WaferID)], WaferID, m_pixelid); + if (m_pixelid->barrel_ec(WaferID)==-2) m_cluster_num_mod_LB->Fill( m_ClusPerEventArray_disksC[m_pixelid->phi_module(WaferID)][m_pixelid->layer_disk(WaferID)], WaferID, m_pixelid); if (m_pixelid->barrel_ec(WaferID)==0 ) { - if (m_doIBL && m_pixelid->layer_disk(WaferID)==0) m_cluster_num_mod_LB->Fill( m_ClusPerEventArray_lI[m_pixelid->phi_module(WaferID)][m_pixelid->eta_module(WaferID)+10], WaferID, m_pixelid ,m_doIBL); - if (m_pixelid->layer_disk(WaferID)==0+m_doIBL) m_cluster_num_mod_LB->Fill( m_ClusPerEventArray_l0[m_pixelid->phi_module(WaferID)][m_pixelid->eta_module(WaferID)+6], WaferID, m_pixelid ,m_doIBL); - if (m_pixelid->layer_disk(WaferID)==1+m_doIBL) m_cluster_num_mod_LB->Fill( m_ClusPerEventArray_l1[m_pixelid->phi_module(WaferID)][m_pixelid->eta_module(WaferID)+6], WaferID, m_pixelid ,m_doIBL); - if (m_pixelid->layer_disk(WaferID)==2+m_doIBL) m_cluster_num_mod_LB->Fill( m_ClusPerEventArray_l2[m_pixelid->phi_module(WaferID)][m_pixelid->eta_module(WaferID)+6], WaferID, m_pixelid ,m_doIBL); + if (m_doIBL && m_pixelid->layer_disk(WaferID)==0) m_cluster_num_mod_LB->Fill( m_ClusPerEventArray_lI[m_pixelid->phi_module(WaferID)][m_pixelid->eta_module(WaferID)+10], WaferID, m_pixelid); + if (m_pixelid->layer_disk(WaferID)==0+m_doIBL) m_cluster_num_mod_LB->Fill( m_ClusPerEventArray_l0[m_pixelid->phi_module(WaferID)][m_pixelid->eta_module(WaferID)+6], WaferID, m_pixelid); + if (m_pixelid->layer_disk(WaferID)==1+m_doIBL) m_cluster_num_mod_LB->Fill( m_ClusPerEventArray_l1[m_pixelid->phi_module(WaferID)][m_pixelid->eta_module(WaferID)+6], WaferID, m_pixelid); + if (m_pixelid->layer_disk(WaferID)==2+m_doIBL) m_cluster_num_mod_LB->Fill( m_ClusPerEventArray_l2[m_pixelid->phi_module(WaferID)][m_pixelid->eta_module(WaferID)+6], WaferID, m_pixelid); } } } diff --git a/InnerDetector/InDetMonitoring/PixelMonitoring/src/DBMMon2DMaps.cxx b/InnerDetector/InDetMonitoring/PixelMonitoring/src/DBMMon2DMaps.cxx index c4fcfb3cbb7aae754ad2f3141159891f485990da..67c8fa0a54645145ae4eb20726ae2ea3d6d4f4fd 100644 --- a/InnerDetector/InDetMonitoring/PixelMonitoring/src/DBMMon2DMaps.cxx +++ b/InnerDetector/InDetMonitoring/PixelMonitoring/src/DBMMon2DMaps.cxx @@ -8,37 +8,35 @@ #include "PixelMonitoring/DBMMon2DMaps.h" #include "InDetIdentifier/PixelID.h" -//#include "TH2I.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); + 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(); + formatHist(); } DBMMon2DMaps::~DBMMon2DMaps() { - delete DBMA; - delete DBMC; + delete DBMA; + delete DBMC; } void DBMMon2DMaps::Fill(Identifier &id, const PixelID* pixID) { - int bec = pixID->barrel_ec(id); - int ld = pixID->layer_disk(id); - int pm = pixID->phi_module(id); + 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) { + DBMA->Fill(ld, pm); } - if(bec==-4){ - DBMC->Fill(ld,pm); + if (bec == -4) { + DBMC->Fill(ld, pm); } } @@ -46,7 +44,6 @@ void DBMMon2DMaps::Fill(Identifier &id, const PixelID* pixID) 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); } @@ -55,18 +52,16 @@ void DBMMon2DMaps::formatHist() { const int ndisk = 3; const int nphi = 4; - const char *phi[nphi] = { "M1","M2","M3","M4"}; + 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 < 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] ); + 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 diff --git a/InnerDetector/InDetMonitoring/PixelMonitoring/src/Errors.cxx b/InnerDetector/InDetMonitoring/PixelMonitoring/src/Errors.cxx index f2f57f5ba278afa51b83707e9e968dbc3adfc194..5bb33c3dc65c6a0aeca44c19016390c4776b7af4 100644 --- a/InnerDetector/InDetMonitoring/PixelMonitoring/src/Errors.cxx +++ b/InnerDetector/InDetMonitoring/PixelMonitoring/src/Errors.cxx @@ -28,7 +28,6 @@ #include "PixelMonitoring/PixelMon2DMapsLW.h" #include "PixelMonitoring/PixelMonModules.h" #include "PixelMonitoring/PixelMon2DLumiMaps.h" -#include "PixelMonitoring/PixelMon2DLumiProfiles.h" /////////////////////////////////////////////////////////////////////////////// @@ -184,25 +183,25 @@ StatusCode PixelMainMon::BookRODErrorMon(void) if (m_doModules) { m_errors = new PixelMonModules1D("errors", ("Errors in module:ErrorType" + m_histTitleExt + ";Number of Errors").c_str(), 7, 0.5, 7.5, m_doIBL); - sc = m_errors->regHist(this, (path+"/ModulesErrors").c_str(), run, m_doIBL); + sc = m_errors->regHist(this, (path+"/ModulesErrors").c_str(), run); for (int k = 0; k < 7; k++) m_errors->SetBinLabel(error_type_labels[k].second.c_str(), k+1); } 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, false); - sc = m_errhist_errtype_map[i]->regHist(rodHistos, m_doIBL, false); + m_errhist_errtype_map[i] = new PixelMon2DMapsLW(error_type_labels[i].first, (error_type_labels[i].second + m_histTitleExt).c_str(), m_doIBL); + 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, false); - sc = m_errhist_errcat_map[i]->regHist(rodHistos, m_doIBL, false); + 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); + sc = m_errhist_errcat_map[i]->regHist(rodHistos); } } if (m_do2DMaps && !m_doOnline) { for (int j = 0; j < kNumErrorStates; j++) { - m_errhist_expert_LB_maps[j] = new PixelMon2DLumiMaps(error_state_labels[j].first + "_int_LB", error_state_labels[j].second + " per event per LB" + m_histTitleExt, "# Errors", m_doIBL, false); - sc = m_errhist_expert_LB_maps[j]->regHist(rodExpert, m_doIBL, false); + m_errhist_expert_LB_maps[j] = new PixelMon2DLumiMaps(error_state_labels[j].first + "_int_LB", error_state_labels[j].second + " per event per LB" + m_histTitleExt, "# Errors", m_doIBL, true); + sc = m_errhist_expert_LB_maps[j]->regHist(rodExpert); } } @@ -214,8 +213,8 @@ 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, false); - sc = m_errhist_expert_maps[j]->regHist(rodExpert, m_doIBL, false); + m_errhist_expert_maps[j] = new PixelMon2DMapsLW(hname.c_str(), htitles.c_str(), m_doIBL, true); + sc = m_errhist_expert_maps[j]->regHist(rodExpert); } hname = makeHistname("ServiceRecord_Unweighted_IBL", false); @@ -264,14 +263,14 @@ 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, false); - sc = m_errors_LB->regHist(lumiBlockHist, m_doIBL, false); + m_errors_LB = new PixelMon2DMapsLW("Errors_LB", ("Errors" + m_histTitleExt).c_str(), m_doIBL); + sc = m_errors_LB->regHist(lumiBlockHist); - m_errors_RODSync_mod = new PixelMon2DMapsLW("Errors_RODSync_LB", ("Errors_RODSync" + m_histTitleExt).c_str(), m_doIBL, false); - sc = m_errors_RODSync_mod->regHist(lumiBlockHist, m_doIBL, false); + m_errors_RODSync_mod = new PixelMon2DMapsLW("Errors_RODSync_LB", ("Errors_RODSync" + m_histTitleExt).c_str(), m_doIBL); + sc = m_errors_RODSync_mod->regHist(lumiBlockHist); - m_errors_ModSync_mod = new PixelMon2DMapsLW("Errors_ModSync_LB", ("Errors_ModSync" + m_histTitleExt).c_str(), m_doIBL, false); - sc = m_errors_ModSync_mod->regHist(lumiBlockHist, m_doIBL, false); + m_errors_ModSync_mod = new PixelMon2DMapsLW("Errors_ModSync_LB", ("Errors_ModSync" + m_histTitleExt).c_str(), m_doIBL); + sc = m_errors_ModSync_mod->regHist(lumiBlockHist); } if (sc.isFailure() && msgLvl(MSG::WARNING)) msg(MSG::WARNING) << "histograms not booked" << endmsg; @@ -360,15 +359,15 @@ StatusCode PixelMainMon::FillRODErrorMon(void) if (error_type == 6) error_cat = ErrorCategory::kSeu; if (error_type == 7) error_cat = ErrorCategory::kTout; - if (m_errors) m_errors->Fill(error_type, WaferID, m_pixelid, m_doIBL); + if (m_errors) m_errors->Fill(error_type, WaferID, m_pixelid); if (m_doLumiBlock && m_errors_LB) { - m_errors_LB->Fill(WaferID, m_pixelid, m_doIBL, true); + m_errors_LB->Fill(WaferID, m_pixelid); } if (!has_err_type[error_type-1]) { if (m_errhist_errtype_map[error_type-1] && !m_doOnline) { - m_errhist_errtype_map[error_type-1]->Fill(WaferID, m_pixelid, m_doIBL, false); + m_errhist_errtype_map[error_type-1]->Fill(WaferID, m_pixelid); } num_errormodules_per_type[kLayer][error_type-1]++; if (kLayerIBL != 99) num_errormodules_per_type[kLayerIBL][error_type-1]++; @@ -376,7 +375,7 @@ StatusCode PixelMainMon::FillRODErrorMon(void) } if (!has_err_cat[error_cat]) { if (m_errhist_errcat_map[error_cat] && !m_doOnline) { - m_errhist_errcat_map[error_cat]->Fill(WaferID, m_pixelid, m_doIBL, false); + m_errhist_errcat_map[error_cat]->Fill(WaferID, m_pixelid); } num_errormodules_per_cat[kLayer][error_cat]++; if (kLayerIBL != 99) { @@ -409,9 +408,9 @@ StatusCode PixelMainMon::FillRODErrorMon(void) if (getErrorState(bit, is_ibl) != 99) { num_errors_per_state[kLayer][getErrorState(bit, is_ibl)]++; if (m_errhist_expert_maps[getErrorState(bit, is_ibl)]) - m_errhist_expert_maps[getErrorState(bit, is_ibl)]->Fill(WaferID, m_pixelid, m_doIBL, true); + m_errhist_expert_maps[getErrorState(bit, is_ibl)]->Fill(WaferID, m_pixelid); if (m_errhist_expert_LB_maps[getErrorState(bit, is_ibl)]) - m_errhist_expert_LB_maps[getErrorState(bit, is_ibl)]->Fill(kLumiBlock, WaferID, m_pixelid, 1, m_doIBL, true); + m_errhist_expert_LB_maps[getErrorState(bit, is_ibl)]->Fill(kLumiBlock, WaferID, m_pixelid, 1); } if (kLayer == PixLayer::kIBL) { @@ -424,9 +423,9 @@ StatusCode PixelMainMon::FillRODErrorMon(void) if (m_doLumiBlock) { if (m_errors_ModSync_mod && has_err_type[0]) - m_errors_ModSync_mod->Fill(WaferID, m_pixelid, m_doIBL, true); + m_errors_ModSync_mod->Fill(WaferID, m_pixelid); if (m_errors_RODSync_mod && has_err_type[1]) - m_errors_RODSync_mod->Fill(WaferID, m_pixelid, m_doIBL, true); + m_errors_RODSync_mod->Fill(WaferID, m_pixelid); } } //end loop over all identifiers diff --git a/InnerDetector/InDetMonitoring/PixelMonitoring/src/Hits.cxx b/InnerDetector/InDetMonitoring/PixelMonitoring/src/Hits.cxx index 2c19997fbc8813c111af618d3a4365c3dd43548b..1f49faf7dfe7023d6d65d09924892a333145f5ad 100644 --- a/InnerDetector/InDetMonitoring/PixelMonitoring/src/Hits.cxx +++ b/InnerDetector/InDetMonitoring/PixelMonitoring/src/Hits.cxx @@ -155,7 +155,8 @@ StatusCode PixelMainMon::BookHitsMon(void) } } - m_hitmap_tmp = new PixelMon2DMaps("HitMap_tmp", ("Hit map for monitoring" + m_histTitleExt).c_str()); sc = m_hitmap_tmp->regHist(rdoShift); + m_hitmap_tmp = new PixelMon2DMaps("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++){ hname = makeHistname(("nFEswithHits_"+m_modLabel_PixLayerIBL2D3D[i]), false); @@ -169,7 +170,8 @@ 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()); sc = m_hitmap_mon->regHist(rdoShift); + m_hitmap_mon = new PixelMon2DMaps("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++){ hname = makeHistname(("Hit_ToT_Mon_"+m_modLabel_PixLayerIBL2D3D[i]), false); @@ -228,33 +230,33 @@ StatusCode PixelMainMon::BookHitsMon(void) if (m_do2DMaps) { - m_occupancy = new PixelMon2DMaps("Occupancy", ("hit map"+ m_histTitleExt).c_str()); + m_occupancy = new PixelMon2DMaps("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, false); - sc = m_average_pixocc->regHist(rdoShift, m_doIBL, false); + m_average_pixocc = new PixelMon2DMapsLW("Occupancy_per_pixel", ("#hits / pixel" + m_histTitleExt).c_str(), m_doIBL); + 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, false, false); + m_occupancy_pix_evt = new PixelMon2DProfilesLW("Occupancy_per_pixel_event", ("#hits / pixel / event" + m_histTitleExt).c_str(), m_doIBL); sc = m_occupancy_pix_evt->regHist(rdoShift); - m_Lvl1ID_diff_mod_ATLAS_per_LB = new PixelMon2DLumiProfiles("Lvl1ID_diff_ATLAS_mod_per_LB", ("ATLAS_{Level 1 ID} - Module_{Level 1 ID} per LB" + m_histTitleExt).c_str(),"#Delta Level 1 ID",m_doIBL,false); - sc = m_Lvl1ID_diff_mod_ATLAS_per_LB->regHist(timeExpert,m_doIBL,false); + m_Lvl1ID_diff_mod_ATLAS_per_LB = new PixelMon2DLumiProfiles("Lvl1ID_diff_ATLAS_mod_per_LB", ("ATLAS_{Level 1 ID} - Module_{Level 1 ID} per LB" + m_histTitleExt).c_str(),"#Delta Level 1 ID",m_doIBL); + sc = m_Lvl1ID_diff_mod_ATLAS_per_LB->regHist(timeExpert); - m_Lvl1ID_absdiff_mod_ATLAS_per_LB = new PixelMon2DLumiProfiles("Lvl1ID_absdiff_ATLAS_mod_per_LB", ("ATLAS_{Level 1 ID} - Module_{Level 1 ID} per LB" + m_histTitleExt).c_str(),"#Delta Level 1 ID",m_doIBL,false); - sc = m_Lvl1ID_absdiff_mod_ATLAS_per_LB->regHist(timeExpert,m_doIBL,false); + m_Lvl1ID_absdiff_mod_ATLAS_per_LB = new PixelMon2DLumiProfiles("Lvl1ID_absdiff_ATLAS_mod_per_LB", ("ATLAS_{Level 1 ID} - Module_{Level 1 ID} per LB" + m_histTitleExt).c_str(),"#Delta Level 1 ID",m_doIBL); + sc = m_Lvl1ID_absdiff_mod_ATLAS_per_LB->regHist(timeExpert); } if (m_doModules) { m_hit_num_mod = new PixelMonModules1D("Hit_num", ("Number of hits in a module in an event" + m_histTitleExt).c_str(), 15,-0.5,149.5,m_doIBL); - sc = m_hit_num_mod->regHist(this,(path+"/Modules_NumberOfHits").c_str(),run, m_doIBL); + sc = m_hit_num_mod->regHist(this,(path+"/Modules_NumberOfHits").c_str(),run); m_hiteff_mod = new PixelMonModulesProf("Hit_track_eff", ("Proportion of hits on track" + m_histTitleExt).c_str(), 2500,-0.5,2499.5,m_doIBL); - sc = m_hiteff_mod->regHist(this,(path+"/Modules_HitEff").c_str(),run, m_doIBL); + sc = m_hiteff_mod->regHist(this,(path+"/Modules_HitEff").c_str(),run); } if (m_doFEChipSummary) { m_FE_chip_hit_summary = new PixelMonModules1D("FE_Chip_Summary", ("FE Chip Summary" + m_histTitleExt).c_str(), 16,-0.5,15.5,m_doIBL); - sc = m_FE_chip_hit_summary->regHist(this,(path+"/Modules_FEChipSummary").c_str(),run, m_doIBL); + sc = m_FE_chip_hit_summary->regHist(this,(path+"/Modules_FEChipSummary").c_str(),run); } if (m_doLowOccupancy || m_doHighOccupancy) { @@ -279,7 +281,7 @@ StatusCode PixelMainMon::BookHitsMon(void) if (m_doPixelOccupancy) { m_pixel_occupancy = new PixelMonModules2D("Pixel_Occupancy", ("Pixel Occupancy" + m_histTitleExt).c_str(), 160, -0.,160.,336,0.,336.,m_doIBL); - sc = m_pixel_occupancy->regHist(this,(path+"/PixelOccupancy").c_str(),run, m_doIBL); + sc = m_pixel_occupancy->regHist(this,(path+"/PixelOccupancy").c_str(),run); } if (m_doRodSim) { @@ -368,7 +370,7 @@ StatusCode PixelMainMon::BookHitsLumiBlockMon(void) hname = makeHistname("num_Hits_mod_LB", false); htitles = makeHisttitle("Number of pixel hits in a module in an event", (atext_hit+atext_nevt), false); m_hit_num_mod_LB = new PixelMonModules1D(hname.c_str(), htitles.c_str(), 20, -0.5, 19.5, m_doIBL); - sc = m_hit_num_mod_LB->regHist(this, (path+"/Modules_NumberOfHits").c_str(), lowStat, m_doIBL); + sc = m_hit_num_mod_LB->regHist(this, (path+"/Modules_NumberOfHits").c_str(), lowStat); } for( int i=0; i<PixLayer::COUNT; i++){ hname = makeHistname(("Hit_ToT_LB_"+m_modLabel_PixLayerIBL2D3D[i]), false); @@ -384,7 +386,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_occupancy_10min = new PixelMon2DMaps("Occupancy_10min", ("hit occupancy" + m_histTitleExt).c_str(), m_doIBL); sc = m_occupancy_10min->regHist(lumiBlockHist); if(sc.isFailure())if(msgLvl(MSG::WARNING)) msg(MSG::WARNING) << "histograms not booked" << endmsg; @@ -548,10 +550,10 @@ StatusCode PixelMainMon::FillHitsMon(void) //Called once per event //be sure to check each histo exists before filling it /// Fill Occupancy - if ( m_occupancy) m_occupancy->Fill(rdoID, m_pixelid, m_doIBL); - if ( m_occupancy_10min && m_doLumiBlock) m_occupancy_10min->Fill(rdoID, m_pixelid, m_doIBL); - if ( m_hitmap_tmp ) m_hitmap_tmp->Fill(rdoID, m_pixelid, m_doIBL); - if ( m_average_pixocc && nChannels_mod[pixlayeribl2d3d] > 0 ) m_average_pixocc->WeightingFill(rdoID, m_pixelid, m_doIBL, 1.0/( 1.0*nChannels_mod[pixlayeribl2d3d]) ); + if ( m_occupancy) m_occupancy->Fill(rdoID, m_pixelid); + if ( m_occupancy_10min && m_doLumiBlock) m_occupancy_10min->Fill(rdoID, m_pixelid); + if ( m_hitmap_tmp ) m_hitmap_tmp->Fill(rdoID, m_pixelid); + if ( m_average_pixocc && nChannels_mod[pixlayeribl2d3d] > 0 ) m_average_pixocc->WeightingFill(rdoID, m_pixelid, 1.0/( 1.0*nChannels_mod[pixlayeribl2d3d]) ); /// Fill Lvl1A @@ -569,8 +571,8 @@ StatusCode PixelMainMon::FillHitsMon(void) //Called once per event int difflvl1id = lvl1idATLAS - lvl1idMOD%32; if(pixlayer != 99 && m_Lvl1ID_diff_mod_ATLAS_mod[pixlayer]) m_Lvl1ID_diff_mod_ATLAS_mod[pixlayer]->Fill(difflvl1id); - if(m_Lvl1ID_diff_mod_ATLAS_per_LB) m_Lvl1ID_diff_mod_ATLAS_per_LB->Fill(m_manager->lumiBlockNumber(),rdoID,m_pixelid,difflvl1id,m_doIBL,false); - if(m_Lvl1ID_absdiff_mod_ATLAS_per_LB) m_Lvl1ID_absdiff_mod_ATLAS_per_LB->Fill(m_manager->lumiBlockNumber(),rdoID,m_pixelid,fabs(difflvl1id),m_doIBL,false); + if(m_Lvl1ID_diff_mod_ATLAS_per_LB) m_Lvl1ID_diff_mod_ATLAS_per_LB->Fill(m_manager->lumiBlockNumber(),rdoID,m_pixelid,difflvl1id); + if(m_Lvl1ID_absdiff_mod_ATLAS_per_LB) m_Lvl1ID_absdiff_mod_ATLAS_per_LB->Fill(m_manager->lumiBlockNumber(),rdoID,m_pixelid,fabs(difflvl1id)); /// Fill BCID @@ -583,13 +585,13 @@ StatusCode PixelMainMon::FillHitsMon(void) //Called once per event if (m_RodSim_BCID_minus_ToT) m_RodSim_BCID_minus_ToT->Fill((*p_rdo)->getBCID() - (*p_rdo)->getToT() ); } - if (m_FE_chip_hit_summary) m_FE_chip_hit_summary->Fill(m_pixelCableSvc->getFE(&rdoID,rdoID),rdoID,m_pixelid,m_doIBL); + if (m_FE_chip_hit_summary) m_FE_chip_hit_summary->Fill(m_pixelCableSvc->getFE(&rdoID,rdoID),rdoID,m_pixelid); if (m_hiteff_mod) { if (OnTrack(rdoID,false)) { - m_hiteff_mod->Fill(m_manager->lumiBlockNumber(),1.,rdoID,m_pixelid,m_doIBL); + m_hiteff_mod->Fill(m_manager->lumiBlockNumber(),1.,rdoID,m_pixelid); } else { - m_hiteff_mod->Fill(m_manager->lumiBlockNumber(),0.,rdoID,m_pixelid,m_doIBL); + m_hiteff_mod->Fill(m_manager->lumiBlockNumber(),0.,rdoID,m_pixelid); } } @@ -621,7 +623,7 @@ StatusCode PixelMainMon::FillHitsMon(void) //Called once per event if(m_Details_mod3_ToT && currentID==DetailsMod3) m_Details_mod3_ToT->Fill((*p_rdo)->getToT()); if(m_Details_mod4_ToT && currentID==DetailsMod4) m_Details_mod4_ToT->Fill((*p_rdo)->getToT()); } - if (m_pixel_occupancy) m_pixel_occupancy->Fill(m_pixelid->eta_index(rdoID),m_pixelid->phi_index(rdoID),rdoID, m_pixelid,m_doIBL); + if (m_pixel_occupancy) m_pixel_occupancy->Fill(m_pixelid->eta_index(rdoID),m_pixelid->phi_index(rdoID),rdoID, m_pixelid); if (pixlayer != 99) nhits_mod[pixlayer]++; nhits++; @@ -787,30 +789,30 @@ StatusCode PixelMainMon::FillHitsMon(void) //Called once per event for (; idIt != idItEnd; ++idIt) { Identifier WaferID = *idIt; if(m_pixelid->barrel_ec(WaferID)==2 ){ - m_hit_num_mod->Fill( HitPerEventArray_disksA[m_pixelid->phi_module(WaferID)][m_pixelid->layer_disk(WaferID)], WaferID, m_pixelid ,m_doIBL); + m_hit_num_mod->Fill( HitPerEventArray_disksA[m_pixelid->phi_module(WaferID)][m_pixelid->layer_disk(WaferID)], WaferID, m_pixelid); } - if(m_pixelid->barrel_ec(WaferID)==-2) m_hit_num_mod->Fill( HitPerEventArray_disksC[m_pixelid->phi_module(WaferID)][m_pixelid->layer_disk(WaferID)], WaferID, m_pixelid ,m_doIBL); + if(m_pixelid->barrel_ec(WaferID)==-2) m_hit_num_mod->Fill( HitPerEventArray_disksC[m_pixelid->phi_module(WaferID)][m_pixelid->layer_disk(WaferID)], WaferID, m_pixelid); if(m_pixelid->barrel_ec(WaferID)==0 ) { if(m_doIBL && m_pixelid->layer_disk(WaferID)==0) { - m_hit_num_mod->Fill( HitPerEventArray_lI[m_pixelid->phi_module(WaferID)][m_pixelid->eta_module(WaferID)+10], WaferID, m_pixelid ,m_doIBL); + m_hit_num_mod->Fill( HitPerEventArray_lI[m_pixelid->phi_module(WaferID)][m_pixelid->eta_module(WaferID)+10], WaferID, m_pixelid); } if(m_pixelid->layer_disk(WaferID)==0+m_doIBL) { - m_hit_num_mod->Fill( HitPerEventArray_l0[m_pixelid->phi_module(WaferID)][m_pixelid->eta_module(WaferID)+6], WaferID, m_pixelid ,m_doIBL); + m_hit_num_mod->Fill( HitPerEventArray_l0[m_pixelid->phi_module(WaferID)][m_pixelid->eta_module(WaferID)+6], WaferID, m_pixelid); } - if(m_pixelid->layer_disk(WaferID)==1+m_doIBL) m_hit_num_mod->Fill( HitPerEventArray_l1[m_pixelid->phi_module(WaferID)][m_pixelid->eta_module(WaferID)+6], WaferID, m_pixelid ,m_doIBL); - if(m_pixelid->layer_disk(WaferID)==2+m_doIBL) m_hit_num_mod->Fill( HitPerEventArray_l2[m_pixelid->phi_module(WaferID)][m_pixelid->eta_module(WaferID)+6], WaferID, m_pixelid ,m_doIBL); + if(m_pixelid->layer_disk(WaferID)==1+m_doIBL) m_hit_num_mod->Fill( HitPerEventArray_l1[m_pixelid->phi_module(WaferID)][m_pixelid->eta_module(WaferID)+6], WaferID, m_pixelid); + if(m_pixelid->layer_disk(WaferID)==2+m_doIBL) m_hit_num_mod->Fill( HitPerEventArray_l2[m_pixelid->phi_module(WaferID)][m_pixelid->eta_module(WaferID)+6], WaferID, m_pixelid); } if (m_doLumiBlock) { - if(m_pixelid->barrel_ec(WaferID)==2 ) m_hit_num_mod_LB->Fill( HitPerEventArray_disksA[m_pixelid->phi_module(WaferID)][m_pixelid->layer_disk(WaferID)], WaferID, m_pixelid ,m_doIBL); - if(m_pixelid->barrel_ec(WaferID)==-2) m_hit_num_mod_LB->Fill( HitPerEventArray_disksC[m_pixelid->phi_module(WaferID)][m_pixelid->layer_disk(WaferID)], WaferID, m_pixelid ,m_doIBL); + if(m_pixelid->barrel_ec(WaferID)==2 ) m_hit_num_mod_LB->Fill( HitPerEventArray_disksA[m_pixelid->phi_module(WaferID)][m_pixelid->layer_disk(WaferID)], WaferID, m_pixelid); + if(m_pixelid->barrel_ec(WaferID)==-2) m_hit_num_mod_LB->Fill( HitPerEventArray_disksC[m_pixelid->phi_module(WaferID)][m_pixelid->layer_disk(WaferID)], WaferID, m_pixelid); if(m_pixelid->barrel_ec(WaferID)==0 ) { - if(m_doIBL && m_pixelid->layer_disk(WaferID)==0) m_hit_num_mod_LB->Fill( HitPerEventArray_lI[m_pixelid->phi_module(WaferID)][m_pixelid->eta_module(WaferID)+10], WaferID, m_pixelid ,m_doIBL); - if(m_pixelid->layer_disk(WaferID)==0+m_doIBL) m_hit_num_mod_LB->Fill( HitPerEventArray_l0[m_pixelid->phi_module(WaferID)][m_pixelid->eta_module(WaferID)+6], WaferID, m_pixelid ,m_doIBL); - if(m_pixelid->layer_disk(WaferID)==1+m_doIBL) m_hit_num_mod_LB->Fill( HitPerEventArray_l1[m_pixelid->phi_module(WaferID)][m_pixelid->eta_module(WaferID)+6], WaferID, m_pixelid ,m_doIBL); - if(m_pixelid->layer_disk(WaferID)==2+m_doIBL) m_hit_num_mod_LB->Fill( HitPerEventArray_l2[m_pixelid->phi_module(WaferID)][m_pixelid->eta_module(WaferID)+6], WaferID, m_pixelid ,m_doIBL); + if(m_doIBL && m_pixelid->layer_disk(WaferID)==0) m_hit_num_mod_LB->Fill( HitPerEventArray_lI[m_pixelid->phi_module(WaferID)][m_pixelid->eta_module(WaferID)+10], WaferID, m_pixelid); + if(m_pixelid->layer_disk(WaferID)==0+m_doIBL) m_hit_num_mod_LB->Fill( HitPerEventArray_l0[m_pixelid->phi_module(WaferID)][m_pixelid->eta_module(WaferID)+6], WaferID, m_pixelid); + if(m_pixelid->layer_disk(WaferID)==1+m_doIBL) m_hit_num_mod_LB->Fill( HitPerEventArray_l1[m_pixelid->phi_module(WaferID)][m_pixelid->eta_module(WaferID)+6], WaferID, m_pixelid); + if(m_pixelid->layer_disk(WaferID)==2+m_doIBL) m_hit_num_mod_LB->Fill( HitPerEventArray_l2[m_pixelid->phi_module(WaferID)][m_pixelid->eta_module(WaferID)+6], WaferID, m_pixelid); } } } diff --git a/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelMon2DLumiMaps.cxx b/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelMon2DLumiMaps.cxx index 5371891a280c84d236d68ad7e7e867c69c42a8d0..9a0787cfc438f919c7b257c116e95e438e395bc9 100644 --- a/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelMon2DLumiMaps.cxx +++ b/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelMon2DLumiMaps.cxx @@ -13,22 +13,26 @@ #include "GaudiKernel/StatusCode.h" #include <string.h> -PixelMon2DLumiMaps::PixelMon2DLumiMaps(std::string name, std::string title,std::string zlabel,bool doIBL,bool errorHist) +PixelMon2DLumiMaps::PixelMon2DLumiMaps(std::string name, std::string title, std::string zlabel, bool doIBL, bool errorHist) : m_doIBL(doIBL), m_errorHist(errorHist) { - const int lbRange = 3000; - IBLlbm = TH2F_LW::create((name+"_2D_Map_IBL").c_str(),(title + ", IBL " + " (Map);LB;Module;" + zlabel).c_str(),lbRange,-0.5,-0.5 + (float)lbRange,280,-0.5,279.5); - B0lbm = TH2F_LW::create((name+"_2D_Map_B0").c_str(), (title + ", B0 " + " (Map);LB;Module;" + zlabel).c_str(),lbRange,-0.5,-0.5 + (float)lbRange,286,-0.5,285.5); - B1lbm = TH2F_LW::create((name+"_2D_Map_B1").c_str(), (title + ", B1 " + " (Map);LB;Module;" + zlabel).c_str(),lbRange,-0.5,-0.5 + (float)lbRange,494,-0.5,493.5); - B2lbm = TH2F_LW::create((name+"_2D_Map_B2").c_str(), (title + ", B2 " + " (Map);LB;Module;" + zlabel).c_str(),lbRange,-0.5,-0.5 + (float)lbRange,676,-0.5,675.5); - Albm = TH2F_LW::create((name+"_2D_Map_ECA" ).c_str(),(title + ", ECA " + " (Map);LB;Module;" + zlabel).c_str(),lbRange,-0.5,-0.5 + (float)lbRange,144,-0.5,143.5); - Clbm = TH2F_LW::create((name+"_2D_Map_ECC" ).c_str(),(title + ", ECC " + " (Map);LB;Module;" + zlabel).c_str(),lbRange,-0.5,-0.5 + (float)lbRange,144,-0.5,143.5); + const int lbRange = 3000; + if (m_doIBL && !m_errorHist) { + IBLlbm = TH2F_LW::create((name+"_2D_Map_IBL").c_str(),(title + ", IBL " + " (Map);LB;Module;" + zlabel).c_str(),lbRange,-0.5,-0.5 + (float)lbRange,280,-0.5,279.5); + } + B0lbm = TH2F_LW::create((name+"_2D_Map_B0").c_str(), (title + ", B0 " + " (Map);LB;Module;" + zlabel).c_str(),lbRange,-0.5,-0.5 + (float)lbRange,286,-0.5,285.5); + B1lbm = TH2F_LW::create((name+"_2D_Map_B1").c_str(), (title + ", B1 " + " (Map);LB;Module;" + zlabel).c_str(),lbRange,-0.5,-0.5 + (float)lbRange,494,-0.5,493.5); + B2lbm = TH2F_LW::create((name+"_2D_Map_B2").c_str(), (title + ", B2 " + " (Map);LB;Module;" + zlabel).c_str(),lbRange,-0.5,-0.5 + (float)lbRange,676,-0.5,675.5); + Albm = TH2F_LW::create((name+"_2D_Map_ECA" ).c_str(),(title + ", ECA " + " (Map);LB;Module;" + zlabel).c_str(),lbRange,-0.5,-0.5 + (float)lbRange,144,-0.5,143.5); + Clbm = TH2F_LW::create((name+"_2D_Map_ECC" ).c_str(),(title + ", ECC " + " (Map);LB;Module;" + zlabel).c_str(),lbRange,-0.5,-0.5 + (float)lbRange,144,-0.5,143.5); - formatHist(doIBL,errorHist); + formatHist(); } PixelMon2DLumiMaps::~PixelMon2DLumiMaps() { - LWHist::safeDelete(IBLlbm);//includes null pointer check + if (m_doIBL && !m_errorHist) { + LWHist::safeDelete(IBLlbm);//includes null pointer check + } LWHist::safeDelete(B0lbm); LWHist::safeDelete(B1lbm); LWHist::safeDelete(B2lbm); @@ -36,38 +40,32 @@ PixelMon2DLumiMaps::~PixelMon2DLumiMaps() LWHist::safeDelete(Clbm); } -void PixelMon2DLumiMaps::Fill(double LB,Identifier &id, const PixelID* pixID,double weight, bool doIBL, bool errorHist) +void PixelMon2DLumiMaps::Fill(double LB,Identifier &id, const PixelID* pixID,double weight) { - int bec = pixID->barrel_ec(id); - int ld = pixID->layer_disk(id); - int pm = pixID->phi_module(id); + const int bec = pixID->barrel_ec(id); + const int pm = pixID->phi_module(id); + int ld = pixID->layer_disk(id); - if(bec==2){ - Albm->Fill(LB,ld*48+pm,weight); - } - else if(bec==-2){ - Clbm->Fill(LB,ld*48+pm,weight); - } - else if(bec==0) - { - if(doIBL){ld--;} - int em = pixID->eta_module(id)+6; - if(ld ==0){ - B0lbm->Fill(LB,em+13*pm,weight); - } - else if(ld ==1){ - B1lbm->Fill(LB,em+13*pm,weight); - } - else if(ld ==2){ - B2lbm->Fill(LB,em+13*pm,weight); - } - else if(ld ==-1 && !errorHist && doIBL){ - IBLlbm->Fill(LB,em+4+20*pm,weight); + if (bec == 2) { + Albm->Fill(LB, ld * 48 + pm, weight); + } else if (bec == -2) { + Clbm->Fill(LB, ld * 48 + pm, weight); + } else if (bec == 0) { + if (m_doIBL) ld--; + const int em = pixID->eta_module(id) + 6; + if (ld == 0) { + B0lbm->Fill(LB, em + 13 * pm, weight); + }else if (ld == 1) { + B1lbm->Fill(LB, em + 13 * pm, weight); + } else if (ld == 2) { + B2lbm->Fill(LB, em + 13 * pm, weight); + } else if (ld == -1 && !m_errorHist && m_doIBL) { + IBLlbm->Fill(LB, em + 4 + 20 * pm, weight); } } } -void PixelMon2DLumiMaps::Scale (double number,bool doIBL,bool errorHist) +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 @@ -76,29 +74,31 @@ void PixelMon2DLumiMaps::Scale (double number,bool doIBL,bool errorHist) B0lbm->scaleContentsAndErrors((float) 1.0/number); B1lbm->scaleContentsAndErrors((float) 1.0/number); B2lbm->scaleContentsAndErrors((float) 1.0/number); - if(!errorHist && doIBL)IBLlbm->scaleContentsAndErrors((float) 1.0/number); + if (!m_errorHist && m_doIBL) IBLlbm->scaleContentsAndErrors((float) 1.0/number); } -void PixelMon2DLumiMaps::formatHist(bool doIBL, bool errorHist) +void PixelMon2DLumiMaps::formatHist() { const int ndisk = 3; const int nphi = 48; const char *disk[ndisk] = { "D1", "D2", "D3" }; const int nmod = 13; const int nmodIBL = 20; - const char *mod[nmod] = { "M6C", "M5C", "M4C", "M3C", "M2C", "M1C", "M0", "M1A", "M2A", "M3A", "M4A", "M5A", "M6A" } ; - const char *modIBL[nmodIBL] = { "M4_C8_2","M4_C8_1","M4_C7_2","M4_C7_1","M3_C6", "M3_C5", "M2_C4", "M1_C3", "M1_C2", "M1_C1", "M1_A1", "M1_A2", "M2_A3", "M2_A4", "M3_A5", "M3_A6","M4_A7_1","M4_A7_2","M4_A8_1","M4_A8_2"}; + const char *mod[nmod] = { "M6C", "M5C", "M4C", "M3C", "M2C", "M1C", "M0", "M1A", "M2A", "M3A", "M4A", "M5A", "M6A" }; + const char *modIBL[nmodIBL] = { + "M4_C8_2", "M4_C8_1", "M4_C7_2", "M4_C7_1", "M3_C6", "M3_C5", "M2_C4", "M1_C3", "M1_C2", "M1_C1", + "M1_A1", "M1_A2", "M2_A3", "M2_A4", "M3_A5", "M3_A6","M4_A7_1","M4_A7_2","M4_A8_1","M4_A8_2" }; char label[30]; const int nstaveb = 14; const char *staveb[nstaveb] = { - "S01", "S02", "S03", "S04", "S05", "S06","S07", - "S08", "S09", "S10", "S11", "S12", "S13","S14"}; + "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 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", @@ -110,15 +110,15 @@ void PixelMon2DLumiMaps::formatHist(bool doIBL, bool errorHist) "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" }; + "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", @@ -139,56 +139,53 @@ void PixelMon2DLumiMaps::formatHist(bool doIBL, bool errorHist) "B01_S1_M4", "B01_S1_M3", "B01_S1_M5", "B01_S1_M2", "B01_S1_M6", "B01_S1_M1"}; int count = 1; - for (int j=0;j<ndisk;j++){ - for (int i=0; i<nphi; i++){ - sprintf(label,"%sA_%s",disk[j],nstaveA[i]); - Albm->GetYaxis()->SetBinLabel( count, label ); - sprintf(label,"%sC_%s",disk[j],nstaveC[i]); - Clbm->GetYaxis()->SetBinLabel( count, label ); + for (int j = 0; j < ndisk; j++) { + for (int i = 0; i < nphi; i++) { + sprintf(label, "%sA_%s", disk[j], nstaveA[i]); + Albm->GetYaxis()->SetBinLabel(count, label); + sprintf(label, "%sC_%s", disk[j], nstaveC[i]); + Clbm->GetYaxis()->SetBinLabel(count, label); count++; } } count = 1; - for (int i=0; i<nstave0; i++){ - for (int j=0; j<nmod; j++){ - sprintf(label,"L0_%s_%s",stave0[i],mod[j]); - B0lbm->GetYaxis()->SetBinLabel( count, label ); + for (int i = 0; i < nstave0; i++) { + for (int j = 0; j < nmod; j++) { + sprintf(label, "L0_%s_%s", stave0[i], mod[j]); + B0lbm->GetYaxis()->SetBinLabel(count, label); count++; } } count = 1; - for (int i=0; i<nstave1; i++) - { - for (int j=0; j<nmod; j++){ - sprintf(label,"L1_%s_%s",stave1[i],mod[j]); - B1lbm->GetYaxis()->SetBinLabel( count,label ); + for (int i = 0; i < nstave1; i++) { + for (int j = 0; j < nmod; j++) { + sprintf(label, "L1_%s_%s", stave1[i], mod[j]); + B1lbm->GetYaxis()->SetBinLabel(count, label); count++; } } count = 1; - for (int i=0; i<nstave2; i++) - { - for (int j=0; j<nmod; j++){ - sprintf(label,"L2_%s_%s",stave2[i],mod[j]); - B2lbm->GetYaxis()->SetBinLabel( count, label ); + for (int i = 0; i < nstave2; i++) { + for (int j = 0; j < nmod; j++) { + sprintf(label, "L2_%s_%s", stave2[i], mod[j]); + B2lbm->GetYaxis()->SetBinLabel(count, label); count++; } } count = 1; - if(!errorHist && doIBL){ - for (int i=0; i<nstaveb; i++) - { - for (int j=0; j<nmodIBL; j++){ - sprintf(label,"IBL_%s_%s",staveb[i],modIBL[j]); - IBLlbm->GetYaxis()->SetBinLabel( count, label ); - count++; + if (!m_errorHist && m_doIBL) { + for (int i = 0; i < nstaveb; i++) { + for (int j = 0; j < nmodIBL; j++) { + sprintf(label, "IBL_%s_%s", staveb[i], modIBL[j]); + IBLlbm->GetYaxis()->SetBinLabel(count, label); + count++; } - } + } } - if(!errorHist && doIBL){ - IBLlbm->GetYaxis()->SetLabelSize(0.04); - IBLlbm->SetOption("colz"); + if (!m_errorHist && m_doIBL) { + IBLlbm->GetYaxis()->SetLabelSize(0.04); + IBLlbm->SetOption("colz"); } //Make the text smaller @@ -203,26 +200,19 @@ void PixelMon2DLumiMaps::formatHist(bool doIBL, bool errorHist) B2lbm->SetOption("colz"); Albm->SetOption("colz"); Clbm->SetOption("colz"); - //force the minimum to be 0 so you can spot empty blocks easily -// B0lbm->SetMinimum(0.); -// B1lbm->SetMinimum(0.); -// B2lbm->SetMinimum(0.); -// Albm->SetMinimum(0.); -// Clbm->SetMinimum(0.); - } -StatusCode PixelMon2DLumiMaps::regHist(ManagedMonitorToolBase::MonGroup &group,bool doIBL,bool errorHist) +StatusCode PixelMon2DLumiMaps::regHist(ManagedMonitorToolBase::MonGroup &group) { - StatusCode sc = StatusCode::SUCCESS; - if(!errorHist && doIBL) { - if (group.regHist(IBLlbm).isFailure()) sc = StatusCode::FAILURE; - } - if (group.regHist(B0lbm).isFailure()) sc = StatusCode::FAILURE; - if (group.regHist(B1lbm).isFailure()) sc = StatusCode::FAILURE; - if (group.regHist(B2lbm).isFailure()) sc = StatusCode::FAILURE; - if (group.regHist(Albm).isFailure()) sc = StatusCode::FAILURE; - if (group.regHist(Clbm).isFailure()) sc = StatusCode::FAILURE; + StatusCode sc = StatusCode::SUCCESS; + if (!m_errorHist && m_doIBL) { + if (group.regHist(IBLlbm).isFailure()) sc = StatusCode::FAILURE; + } + if (group.regHist(B0lbm).isFailure()) sc = StatusCode::FAILURE; + if (group.regHist(B1lbm).isFailure()) sc = StatusCode::FAILURE; + if (group.regHist(B2lbm).isFailure()) sc = StatusCode::FAILURE; + if (group.regHist(Albm).isFailure()) sc = StatusCode::FAILURE; + if (group.regHist(Clbm).isFailure()) sc = StatusCode::FAILURE; - return sc; + return sc; } diff --git a/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelMon2DLumiProfiles.cxx b/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelMon2DLumiProfiles.cxx index a8ccc9c8a4436dc1c19269755ed83ded4c9b960b..3305c5d597eb57a7b27d7ad055226528087ba7cd 100644 --- a/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelMon2DLumiProfiles.cxx +++ b/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelMon2DLumiProfiles.cxx @@ -14,22 +14,26 @@ #include "GaudiKernel/StatusCode.h" #include <string.h> -PixelMon2DLumiProfiles::PixelMon2DLumiProfiles(std::string name, std::string title,std::string zlabel,bool doIBL,bool errorHist) +PixelMon2DLumiProfiles::PixelMon2DLumiProfiles(std::string name, std::string title, std::string zlabel, bool doIBL, bool errorHist) : m_doIBL(doIBL), m_errorHist(errorHist) { - const int lbRange = 3000; - IBLlbp= TProfile2D_LW::create((name+"_2D_Profile_IBL").c_str(), (title + ", IBL " + title + " (Profile);LB;Module;" + zlabel).c_str(),lbRange,-0.5,-0.5+(float)lbRange,280,-0.5,279.5); - B0lbp = TProfile2D_LW::create((name+"_2D_Profile_B0").c_str(), (title + ", B0 " + title + " (Profile);LB;Module;" + zlabel).c_str(),lbRange,-0.5,-0.5+(float)lbRange,286,-0.5,285.5); - B1lbp = TProfile2D_LW::create((name+"_2D_Profile_B1").c_str(), (title + ", B1 " + title + " (Profile);LB;Module;" + zlabel).c_str(),lbRange,-0.5,-0.5+(float)lbRange,494,-0.5,493.5); - B2lbp = TProfile2D_LW::create((name+"_2D_Profile_B2").c_str(), (title + ", B2 " + title + " (Profile);LB;Module;" + zlabel).c_str(),lbRange,-0.5,-0.5+(float)lbRange,676,-0.5,675.5); - Albp = TProfile2D_LW::create((name+"_2D_Profile_ECA" ).c_str(),(title + ", ECA " + title + " (Profile);LB;Module;" + zlabel).c_str(),lbRange,-0.5,-0.5+(float)lbRange,144,-0.5,143.5); - Clbp = TProfile2D_LW::create((name+"_2D_Profile_ECC" ).c_str(),(title + ", ECC " + title + " (Profile);LB;Module;" + zlabel).c_str(),lbRange,-0.5,-0.5+(float)lbRange,144,-0.5,143.5); + const int lbRange = 3000; + if (m_doIBL && !m_errorHist) { + IBLlbp= TProfile2D_LW::create((name+"_2D_Profile_IBL").c_str(), (title + ", IBL " + title + " (Profile);LB;Module;" + zlabel).c_str(),lbRange,-0.5,-0.5+(float)lbRange,280,-0.5,279.5); + } + B0lbp = TProfile2D_LW::create((name+"_2D_Profile_B0").c_str(), (title + ", B0 " + title + " (Profile);LB;Module;" + zlabel).c_str(),lbRange,-0.5,-0.5+(float)lbRange,286,-0.5,285.5); + B1lbp = TProfile2D_LW::create((name+"_2D_Profile_B1").c_str(), (title + ", B1 " + title + " (Profile);LB;Module;" + zlabel).c_str(),lbRange,-0.5,-0.5+(float)lbRange,494,-0.5,493.5); + B2lbp = TProfile2D_LW::create((name+"_2D_Profile_B2").c_str(), (title + ", B2 " + title + " (Profile);LB;Module;" + zlabel).c_str(),lbRange,-0.5,-0.5+(float)lbRange,676,-0.5,675.5); + Albp = TProfile2D_LW::create((name+"_2D_Profile_ECA" ).c_str(),(title + ", ECA " + title + " (Profile);LB;Module;" + zlabel).c_str(),lbRange,-0.5,-0.5+(float)lbRange,144,-0.5,143.5); + Clbp = TProfile2D_LW::create((name+"_2D_Profile_ECC" ).c_str(),(title + ", ECC " + title + " (Profile);LB;Module;" + zlabel).c_str(),lbRange,-0.5,-0.5+(float)lbRange,144,-0.5,143.5); - formatHist(doIBL,errorHist); + formatHist(); } PixelMon2DLumiProfiles::~PixelMon2DLumiProfiles() { - LWHist::safeDelete(IBLlbp); + if (m_doIBL && !m_errorHist) { + LWHist::safeDelete(IBLlbp); + } LWHist::safeDelete(B0lbp); LWHist::safeDelete(B1lbp); LWHist::safeDelete(B2lbp); @@ -37,39 +41,33 @@ PixelMon2DLumiProfiles::~PixelMon2DLumiProfiles() LWHist::safeDelete(Clbp); } -void PixelMon2DLumiProfiles::Fill(double LB,Identifier &id, const PixelID* pixID,double weight,bool doIBL,bool errorHist) +void PixelMon2DLumiProfiles::Fill(double LB,Identifier &id, const PixelID* pixID, double weight) { - int bec = pixID->barrel_ec(id); - int ld = pixID->layer_disk(id); - int pm = pixID->phi_module(id); + const int bec = pixID->barrel_ec(id); + const int pm = pixID->phi_module(id); + int ld = pixID->layer_disk(id); - if(bec==2){ - Albp->Fill(LB,ld*48+pm,weight); - } - else if(bec==-2){ - Clbp->Fill(LB,ld*48+pm,weight); - } - else if(bec==0) - { - if(doIBL){ld--;} - int em = pixID->eta_module(id)+6; - if(ld ==0){ - B0lbp->Fill(LB,em+13*pm,weight); - } - else if(ld ==1){ - B1lbp->Fill(LB,em+13*pm,weight); - } - else if(ld ==2){ - B2lbp->Fill(LB,em+13*pm,weight); - } - else if(ld ==-1 && !errorHist && doIBL){ - IBLlbp->Fill(LB,em+4+20*pm,weight); + if (bec == 2) { + Albp->Fill(LB, ld * 48 + pm, weight); + } else if (bec == -2) { + Clbp->Fill(LB, ld * 48 + pm, weight); + } else if (bec == 0) { + if (m_doIBL) ld--; + const int em = pixID->eta_module(id) + 6; + if (ld == 0) { + B0lbp->Fill(LB, em + 13 * pm, weight); + } else if (ld == 1) { + B1lbp->Fill(LB, em + 13 * pm, weight); + } else if (ld == 2) { + B2lbp->Fill(LB, em + 13 * pm, weight); + } else if (ld == -1 && !m_errorHist && m_doIBL) { + IBLlbp->Fill(LB, em + 4 + 20 * pm, weight); } } } -void PixelMon2DLumiProfiles::formatHist(bool doIBL,bool errorHist) +void PixelMon2DLumiProfiles::formatHist() { const int ndisk = 3; const int nphi = 48; @@ -77,19 +75,21 @@ void PixelMon2DLumiProfiles::formatHist(bool doIBL,bool errorHist) const int nmod = 13; const int nmodIBL = 20; const char *mod[nmod] = { "M6C", "M5C", "M4C", "M3C", "M2C", "M1C", "M0", "M1A", "M2A", "M3A", "M4A", "M5A", "M6A" } ; - const char *modIBL[nmodIBL] = { "M4_C8_2","M4_C8_1","M4_C7_2","M4_C7_1","M3_C6", "M3_C5", "M2_C4", "M1_C3", "M1_C2", "M1_C1", "M1_A1", "M1_A2", "M2_A3", "M2_A4", "M3_A5", "M3_A6","M4_A7_1","M4_A7_2","M4_A8_1","M4_A8_2"}; + const char *modIBL[nmodIBL] = { + "M4_C8_2", "M4_C8_1", "M4_C7_2", "M4_C7_1", "M3_C6", "M3_C5", "M2_C4", "M1_C3", "M1_C2", "M1_C1", + "M1_A1", "M1_A2", "M2_A3", "M2_A4", "M3_A5", "M3_A6", "M4_A7_1", "M4_A7_2", "M4_A8_1", "M4_A8_2" }; char label[30]; const int nstaveb = 14; const char *staveb[nstaveb] = { - "S01", "S02", "S03", "S04", "S05", "S06","S07", - "S08", "S09", "S10", "S11", "S12", "S13","S14"}; + "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 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", @@ -101,15 +101,15 @@ void PixelMon2DLumiProfiles::formatHist(bool doIBL,bool errorHist) "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" }; + "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", @@ -130,54 +130,51 @@ void PixelMon2DLumiProfiles::formatHist(bool doIBL,bool errorHist) "B01_S1_M4", "B01_S1_M3", "B01_S1_M5", "B01_S1_M2", "B01_S1_M6", "B01_S1_M1"}; int count = 1; - for (int j=0;j<ndisk;j++){ - for (int i=0; i<nphi; i++){ - sprintf(label,"%sA_%s",disk[j],nstaveA[i]); - Albp->GetYaxis()->SetBinLabel( count, label ); - sprintf(label,"%sC_%s",disk[j],nstaveC[i]); - Clbp->GetYaxis()->SetBinLabel( count, label ); + for (int j = 0; j < ndisk; j++) { + for (int i = 0; i < nphi; i++) { + sprintf(label, "%sA_%s", disk[j], nstaveA[i]); + Albp->GetYaxis()->SetBinLabel(count, label); + sprintf(label, "%sC_%s", disk[j], nstaveC[i]); + Clbp->GetYaxis()->SetBinLabel(count, label); count++; } } count = 1; - for (int i=0; i<nstave0; i++){ - for (int j=0; j<nmod; j++){ - sprintf(label,"L0_%s_%s",stave0[i],mod[j]); - B0lbp->GetYaxis()->SetBinLabel( count, label ); + for (int i = 0; i < nstave0; i++) { + for (int j = 0; j < nmod; j++) { + sprintf(label, "L0_%s_%s", stave0[i], mod[j]); + B0lbp->GetYaxis()->SetBinLabel(count, label); count++; } } count = 1; - for (int i=0; i<nstave1; i++) - { - for (int j=0; j<nmod; j++){ - sprintf(label,"L1_%s_%s",stave1[i],mod[j]); - B1lbp->GetYaxis()->SetBinLabel( count,label ); + for (int i = 0; i < nstave1; i++) { + for (int j = 0; j < nmod; j++) { + sprintf(label, "L1_%s_%s", stave1[i], mod[j]); + B1lbp->GetYaxis()->SetBinLabel(count,label); count++; } } count = 1; - for (int i=0; i<nstave2; i++) - { - for (int j=0; j<nmod; j++){ - sprintf(label,"L2_%s_%s",stave2[i],mod[j]); - B2lbp->GetYaxis()->SetBinLabel( count, label ); + for (int i = 0; i < nstave2; i++) { + for (int j = 0; j < nmod; j++) { + sprintf(label, "L2_%s_%s", stave2[i], mod[j]); + B2lbp->GetYaxis()->SetBinLabel(count, label); count++; } } count = 1; - if(!errorHist && doIBL){ - for (int i=0; i<nstaveb; i++) - { - for (int j=0; j<nmodIBL; j++){ - sprintf(label,"IBL_%s_%s",staveb[i],modIBL[j]); - IBLlbp->GetYaxis()->SetBinLabel( count, label ); - count++; + if (!m_errorHist && m_doIBL) { + for (int i = 0; i < nstaveb; i++) { + for (int j = 0; j < nmodIBL; j++) { + sprintf(label, "IBL_%s_%s", staveb[i], modIBL[j]); + IBLlbp->GetYaxis()->SetBinLabel(count, label); + count++; } - } + } } - if(!errorHist && doIBL){ + if (!m_errorHist && m_doIBL) { IBLlbp->GetYaxis()->SetLabelSize(0.03); IBLlbp->SetOption("colz"); } @@ -186,39 +183,27 @@ void PixelMon2DLumiProfiles::formatHist(bool doIBL,bool errorHist) B0lbp->GetYaxis()->SetLabelSize(0.03); B1lbp->GetYaxis()->SetLabelSize(0.03); B2lbp->GetYaxis()->SetLabelSize(0.03); - Albp->GetYaxis()->SetLabelSize(0.02); - Clbp->GetYaxis()->SetLabelSize(0.02); + Albp->GetYaxis()->SetLabelSize(0.02); + Clbp->GetYaxis()->SetLabelSize(0.02); //put histograms in the easier to read colz format - B0lbp->SetOption("colz"); + B0lbp->SetOption("colz"); B1lbp->SetOption("colz"); B2lbp->SetOption("colz"); - Albp->SetOption("colz"); - Clbp->SetOption("colz"); - //force the minimum to be 0 so you can spot empty blocks easily -// B0lbp->SetMinimum(0.); -// B1lbp->SetMinimum(0.); -// B2lbp->SetMinimum(0.); -// Albp->SetMinimum(0.); -// Clbp->SetMinimum(0.); - //IBLlbp->SetStats(0.); - //B0lbp->SetStats(0.); - //B1lbp->SetStats(0.); - //B2lbp->SetStats(0.); - //Albp->SetStats(0.); - //Clbp->SetStats(0.); + Albp->SetOption("colz"); + Clbp->SetOption("colz"); } -StatusCode PixelMon2DLumiProfiles::regHist(ManagedMonitorToolBase::MonGroup &group,bool doIBL,bool errorHist) +StatusCode PixelMon2DLumiProfiles::regHist(ManagedMonitorToolBase::MonGroup &group) { - StatusCode sc = StatusCode::SUCCESS; - if(!errorHist && doIBL) { - if (group.regHist(IBLlbp).isFailure()) sc = StatusCode::FAILURE; - } - if (group.regHist(B0lbp).isFailure()) sc = StatusCode::FAILURE; - if (group.regHist(B1lbp).isFailure()) sc = StatusCode::FAILURE; - if (group.regHist(B2lbp).isFailure()) sc = StatusCode::FAILURE; - if (group.regHist(Albp).isFailure()) sc = StatusCode::FAILURE; - if (group.regHist(Clbp).isFailure()) sc = StatusCode::FAILURE; + StatusCode sc = StatusCode::SUCCESS; + if (!m_errorHist && m_doIBL) { + if (group.regHist(IBLlbp).isFailure()) sc = StatusCode::FAILURE; + } + if (group.regHist(B0lbp).isFailure()) sc = StatusCode::FAILURE; + if (group.regHist(B1lbp).isFailure()) sc = StatusCode::FAILURE; + if (group.regHist(B2lbp).isFailure()) sc = StatusCode::FAILURE; + if (group.regHist(Albp).isFailure()) sc = StatusCode::FAILURE; + if (group.regHist(Clbp).isFailure()) sc = StatusCode::FAILURE; - return sc; + return sc; } diff --git a/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelMon2DMaps.cxx b/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelMon2DMaps.cxx index 0f7d32a132c784871b05e4ab51a2852f67d55eae..5856783b4b1388d84ce10a56790758a56170c063 100644 --- a/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelMon2DMaps.cxx +++ b/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelMon2DMaps.cxx @@ -13,28 +13,32 @@ #include "GaudiKernel/StatusCode.h" #include <string.h> -PixelMon2DMaps::PixelMon2DMaps(std::string name, std::string title) +PixelMon2DMaps::PixelMon2DMaps(std::string name, std::string title, bool doIBL) : m_doIBL(doIBL) { m_cnt = 0; - 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); + 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() { - delete IBL3D; - delete IBL2D; - delete IBL; + if (m_doIBL) { + delete IBL3D; + delete IBL2D; + delete IBL; + } delete B0; delete B1; delete B2; @@ -46,9 +50,11 @@ PixelMon2DMaps::~PixelMon2DMaps() void PixelMon2DMaps::Reset() { - IBL3D->Reset(); - IBL2D->Reset(); - IBL->Reset(); + if (m_doIBL) { + IBL3D->Reset(); + IBL2D->Reset(); + IBL->Reset(); + } B0->Reset(); B1->Reset(); B2->Reset(); @@ -58,121 +64,106 @@ void PixelMon2DMaps::Reset() DBMC->Reset(); } -void PixelMon2DMaps::Fill(Identifier &id, const PixelID* pixID, bool doIBL) +void PixelMon2DMaps::Fill(Identifier &id, const PixelID* pixID) { - int bec = pixID->barrel_ec(id); - int ld = pixID->layer_disk(id); - int pm = pixID->phi_module(id); + 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(doIBL){ld--;} - 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); + 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, bool doIBL, float weight) +void PixelMon2DMaps::WeightingFill(Identifier &id, const PixelID* pixID, float weight) { - int bec = pixID->barrel_ec(id); - int ld = pixID->layer_disk(id); - int pm = pixID->phi_module(id); + 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(doIBL){ld--;} + 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); + 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, bool doIBL) +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); + 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(doIBL){ + 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, bool doIBL) -//void PixelMon2DMaps::FillNormalized(PixelMon2DMaps* old, int nevent, int nActive_IBL2D, int nActive_IBL3D, int nActive_B0, int nActive_B1, int nActive_B2, int nActive_ECA, int nActive_ECC, bool doIBL) -//void PixelMon2DMaps::FillNormalized(PixelMon2DMaps* old, int nevent, int nActive_IBL2D, int nActive_IBL3D, int nActive_B0, int nActive_B1, int nActive_B2, int nActive_ECA, int nActive_ECC) +void PixelMon2DMaps::ScaleBynPixnEvt(int nevent) { - double nactivechannels_DBMA = 1.0*nevent*46080; - double nactivechannels_DBMC = 1.0*nevent*46080; + 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; @@ -184,134 +175,92 @@ void PixelMon2DMaps::ScaleBynPixnEvt(int nevent, bool doIBL) 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); + 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(doIBL){ + if (m_doIBL) { IBL2D->Scale((float) 1.0/nactivechannels_IBL2D); IBL3D->Scale((float) 1.0/nactivechannels_IBL3D); IBL->Scale((float) 1.0/nactivechannels_IBL); } - /* - for(int x=1; x<=A->GetXaxis()->GetNbins(); x++){ - for(int y=1; y<=A->GetYaxis()->GetNbins(); y++){ - A->SetBinContent(x, y, old->A->GetBinContent(x, y)/nactivechannels_ECA ); - } - } - for(int x=1; x<=C->GetXaxis()->GetNbins(); x++){ - for(int y=1; y<=C->GetYaxis()->GetNbins(); y++){ - C->SetBinContent(x, y, old->C->GetBinContent(x, y)/nactivechannels_ECC ); - } - } - for(int x=1; x<=B0->GetXaxis()->GetNbins(); x++){ - for(int y=1; y<=B0->GetYaxis()->GetNbins(); y++){ - B0->SetBinContent(x, y, old->B0->GetBinContent(x, y)/nactivechannels_B0 ); - } - } - for(int x=1; x<=B1->GetXaxis()->GetNbins(); x++){ - for(int y=1; y<=B1->GetYaxis()->GetNbins(); y++){ - B1->SetBinContent(x, y, old->B1->GetBinContent(x, y)/nactivechannels_B1 ); - } - } - for(int x=1; x<=B2->GetXaxis()->GetNbins(); x++){ - for(int y=1; y<=B2->GetYaxis()->GetNbins(); y++){ - B2->SetBinContent(x, y, old->B2->GetBinContent(x, y)/nactivechannels_B2 ); - } - } - if(doIBL){ - for(int x=1; x<=IBL->GetXaxis()->GetNbins(); x++){ - for(int y=1; y<=IBL->GetYaxis()->GetNbins(); y++){ - IBL->SetBinContent(x, y, old->IBL->GetBinContent(x, y)/nactivechannels_IBL ); - } - } - for(int x=1; x<=IBL2D->GetXaxis()->GetNbins(); x++){ - for(int y=1; y<=IBL2D->GetYaxis()->GetNbins(); y++){ - IBL2D->SetBinContent(x, y, old->IBL2D->GetBinContent(x, y)/nactivechannels_IBL2D ); - } - } - for(int x=1; x<=IBL3D->GetXaxis()->GetNbins(); x++){ - for(int y=1; y<=IBL3D->GetYaxis()->GetNbins(); y++){ - IBL3D->SetBinContent(x, y, old->IBL3D->GetBinContent(x, y)/nactivechannels_IBL3D ); - } - } - } - */ } void PixelMon2DMaps::Fill2DMon(PixelMon2DMaps* oldmap) { - for(int x=1; x<=DBMA->GetNbinsX(); x++){ - for(int y=1; y<=DBMA->GetNbinsY(); y++){ + 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++){ + 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++){ + 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++){ + 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++){ + 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++){ + 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++){ + 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); } } - 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); + 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 <= 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); + 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); + } } } } @@ -337,9 +286,11 @@ void PixelMon2DMaps::ScaleByNChannels(int nActive_IBL2D, int nActive_IBL3D, int 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(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); + 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() @@ -356,16 +307,6 @@ void PixelMon2DMaps::formatHist() 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_2","C8_1","C7_2","C7_1", - "C6_2","C6_1","C5_2","C5_1", - "C4_2","C4_1","C3_2","C3_1", - "C2_2","C2_1","C1_2","C1_1", - "A1_1","A1_2","A2_1","A2_2", - "A3_1","A3_2","A4_1","A4_2", - "A5_1","A5_2","A6_1","A6_2", - "A7_1","A7_2","A8_1","A8_2"}; - */ const char *modIBL[nmodIBL] = {"C8","","C7","", "C6","","C5","", "C4","","C3","", @@ -377,14 +318,14 @@ void PixelMon2DMaps::formatHist() const int nstaveb = 14; const char *staveb[nstaveb] = { - "S01", "S02", "S03", "S04", "S05", "S06","S07", - "S08", "S09", "S10", "S11", "S12", "S13","S14"}; + "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 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", @@ -396,14 +337,14 @@ void PixelMon2DMaps::formatHist() "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", + "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", @@ -424,74 +365,51 @@ void PixelMon2DMaps::formatHist() "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 < nphi; i++) { + A->GetYaxis()->SetBinLabel(i + 1, nstaveA[i]); + C->GetYaxis()->SetBinLabel(i + 1, nstaveC[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 < nphi_dbm; i++) { + DBMA->GetYaxis()->SetBinLabel(i + 1, phi_dbm[i]); + DBMC->GetYaxis()->SetBinLabel(i + 1, phi_dbm[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] ); + 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<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 < 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]); } - 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] ); + 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 < 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 < nstave1; i++) { + B1->GetYaxis()->SetBinLabel(i + 1, stave1[i]); } - for (int i=0; i<nstave2; i++) - { - B2->GetYaxis()->SetBinLabel( i+1, stave2[i] ); + for (int i = 0; i < nstave2; i++) { + B2->GetYaxis()->SetBinLabel(i + 1, stave2[i]); } //Make the text smaller - IBL2D->GetYaxis()->SetLabelSize(0.03); - IBL3D->GetYaxis()->SetLabelSize(0.03); - IBL->GetYaxis()->SetLabelSize(0.03); + 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); @@ -500,9 +418,11 @@ void PixelMon2DMaps::formatHist() DBMA->GetYaxis()->SetLabelSize(0.02); DBMC->GetYaxis()->SetLabelSize(0.02); //Move the lable so you can read it - IBL2D->GetYaxis()->SetTitleOffset(1.35); - IBL3D->GetYaxis()->SetTitleOffset(1.35); - IBL->GetYaxis()->SetTitleOffset(1.35); + 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); @@ -511,9 +431,11 @@ void PixelMon2DMaps::formatHist() DBMA->GetYaxis()->SetTitleOffset(1.35); DBMC->GetYaxis()->SetTitleOffset(1.35); //put histograms in the easier to read colz format - IBL2D->SetOption("colz"); - IBL3D->SetOption("colz"); - IBL->SetOption("colz"); + if (m_doIBL) { + IBL2D->SetOption("colz"); + IBL3D->SetOption("colz"); + IBL->SetOption("colz"); + } B0->SetOption("colz"); B1->SetOption("colz"); B2->SetOption("colz"); @@ -522,9 +444,11 @@ void PixelMon2DMaps::formatHist() DBMA->SetOption("colz"); DBMC->SetOption("colz"); //force the minimum to be 0 so you can spot empty blocks easily - IBL2D->SetMinimum(0.); - IBL3D->SetMinimum(0.); - IBL->SetMinimum(0.); + if (m_doIBL) { + IBL2D->SetMinimum(0.); + IBL3D->SetMinimum(0.); + IBL->SetMinimum(0.); + } B0->SetMinimum(0.); B1->SetMinimum(0.); B2->SetMinimum(0.); @@ -533,9 +457,11 @@ void PixelMon2DMaps::formatHist() DBMA->SetMinimum(0.); DBMC->SetMinimum(0.); //Remvoe the stats box because it's in the way - IBL2D->SetStats(0.); - IBL3D->SetStats(0.); - IBL->SetStats(0.); + if (m_doIBL) { + IBL2D->SetStats(0.); + IBL3D->SetStats(0.); + IBL->SetStats(0.); + } B0->SetStats(0.); B1->SetStats(0.); B2->SetStats(0.); @@ -549,9 +475,11 @@ void PixelMon2DMaps::formatHist() StatusCode PixelMon2DMaps::regHist(ManagedMonitorToolBase::MonGroup &group) { StatusCode sc = StatusCode::SUCCESS; - 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 (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; diff --git a/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelMon2DMapsLW.cxx b/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelMon2DMapsLW.cxx index edaf900085c9dfd6cf4fdfd85a721fa4fca512cf..3f8216c77022b417e73bd04d786a8050ee2dccfe 100644 --- a/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelMon2DMapsLW.cxx +++ b/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelMon2DMapsLW.cxx @@ -14,131 +14,125 @@ #include "GaudiKernel/StatusCode.h" #include <string.h> -PixelMon2DMapsLW::PixelMon2DMapsLW(std::string name, std::string title,bool doIBL, bool errorHist) - +PixelMon2DMapsLW::PixelMon2DMapsLW(std::string name, std::string title, bool doIBL, bool errorHist) : m_doIBL(doIBL), m_errorHist(errorHist) { - std::string setatext = ";shifted eta index of module"; - std::string etatext = ";eta index of module"; - std::string phitext = ";phi index of module"; - std::string disktext = ";disk number"; + std::string setatext = ";shifted eta index of module"; + std::string etatext = ";eta index of module"; + std::string phitext = ";phi index of module"; + std::string disktext = ";disk number"; - IBL3D = TH2F_LW::create((name+"_IBL3D").c_str(), (title + ", IBL 3D modules " + etatext + phitext).c_str(),8,-.5,7.5,14,-0.5,13.5); - IBL2D = TH2F_LW::create((name+"_IBL2D").c_str(), (title + ", IBL planar modules " + setatext + phitext).c_str(),12,-6.5,5.5,14,-0.5,13.5); - IBL = TH2F_LW::create((name+"_IBL").c_str(), (title + ", IBL " + setatext + phitext).c_str(),32,-16.5,15.5,14,-0.5,13.5); - B0 = TH2F_LW::create((name+"_B0").c_str(), (title + ", B0 " + etatext + phitext).c_str(),13,-6.5,6.5,22,-0.5,21.5); - B1 = TH2F_LW::create((name+"_B1").c_str(), (title + ", B1 " + etatext + phitext).c_str(),13,-6.5,6.5,38,-0.5,37.5); - B2 = TH2F_LW::create((name+"_B2").c_str(), (title + ", B2 " + etatext + phitext).c_str(),13,-6.5,6.5,52,-0.5,51.5); - A = TH2F_LW::create((name+"_ECA" ).c_str(), (title + ", ECA " + disktext + phitext).c_str(),3,-0.5,2.5,48,-0.5,47.5); - C = TH2F_LW::create((name+"_ECC" ).c_str(), (title + ", ECC " + disktext + phitext).c_str(),3,-0.5,2.5,48,-0.5,47.5); - DBMA = TH2F_LW::create((name+"_DBMA" ).c_str(), (title + ", DBMA " + disktext + phitext).c_str(),3,-0.5,2.5,4,-0.5,3.5); - DBMC = TH2F_LW::create((name+"_DBMC" ).c_str(), (title + ", DBMC " + disktext + phitext).c_str(),3,-0.5,2.5,4,-0.5,3.5); + if (m_doIBL && !m_errorHist) { + IBL3D = TH2F_LW::create((name+"_IBL3D").c_str(), (title + ", IBL 3D modules " + etatext + phitext).c_str(),8,-.5,7.5,14,-0.5,13.5); + IBL2D = TH2F_LW::create((name+"_IBL2D").c_str(), (title + ", IBL planar modules " + setatext + phitext).c_str(),12,-6.5,5.5,14,-0.5,13.5); + IBL = TH2F_LW::create((name+"_IBL").c_str(), (title + ", IBL " + setatext + phitext).c_str(),32,-16.5,15.5,14,-0.5,13.5); + } + B0 = TH2F_LW::create((name+"_B0").c_str(), (title + ", B0 " + etatext + phitext).c_str(),13,-6.5,6.5,22,-0.5,21.5); + B1 = TH2F_LW::create((name+"_B1").c_str(), (title + ", B1 " + etatext + phitext).c_str(),13,-6.5,6.5,38,-0.5,37.5); + B2 = TH2F_LW::create((name+"_B2").c_str(), (title + ", B2 " + etatext + phitext).c_str(),13,-6.5,6.5,52,-0.5,51.5); + A = TH2F_LW::create((name+"_ECA" ).c_str(), (title + ", ECA " + disktext + phitext).c_str(),3,-0.5,2.5,48,-0.5,47.5); + C = TH2F_LW::create((name+"_ECC" ).c_str(), (title + ", ECC " + disktext + phitext).c_str(),3,-0.5,2.5,48,-0.5,47.5); + if (!m_errorHist) { + DBMA = TH2F_LW::create((name+"_DBMA" ).c_str(), (title + ", DBMA " + disktext + phitext).c_str(),3,-0.5,2.5,4,-0.5,3.5); + DBMC = TH2F_LW::create((name+"_DBMC" ).c_str(), (title + ", DBMC " + disktext + phitext).c_str(),3,-0.5,2.5,4,-0.5,3.5); + } - formatHist(doIBL,errorHist); + formatHist(); } PixelMon2DMapsLW::~PixelMon2DMapsLW() { - LWHist::safeDelete(IBL3D); - LWHist::safeDelete(IBL2D); - LWHist::safeDelete(IBL); + if (m_doIBL && !m_errorHist) { + LWHist::safeDelete(IBL3D); + LWHist::safeDelete(IBL2D); + LWHist::safeDelete(IBL); + } LWHist::safeDelete(B0); LWHist::safeDelete(B1); LWHist::safeDelete(B2); LWHist::safeDelete(A); LWHist::safeDelete(C); - LWHist::safeDelete(DBMA); - LWHist::safeDelete(DBMC); + if (!m_errorHist) { + LWHist::safeDelete(DBMA); + LWHist::safeDelete(DBMC); + } } -void PixelMon2DMapsLW::Fill(Identifier &id, const PixelID* pixID, bool doIBL,bool errorHist) +void PixelMon2DMapsLW::Fill(Identifier &id, const PixelID* pixID) { - int bec = pixID->barrel_ec(id); - int ld = pixID->layer_disk(id); - int pm = pixID->phi_module(id); + 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(doIBL){ld--;} - int em = pixID->eta_module(id); - if(ld ==0){ - B0->Fill(em,pm); - } - else if(ld ==1){ + if (bec == 2) A->Fill(ld, pm); + else if (bec == -2) C->Fill(ld, pm); + else if (bec == 4 && !m_errorHist) DBMA->Fill(ld, pm); + else if (bec == -4 && !m_errorHist) 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){ + } else if (ld == 2) { B2->Fill(em,pm); - } - else if(ld ==-1 && doIBL && !errorHist){ + } else if (ld == -1 && m_doIBL && !m_errorHist) { int feid = 0; int emf = 0; - bool copy = false; - if(em<6 && em>-7){ - if(pixID->eta_index(id) >= 80) feid = 1; - emf = 2 * em + feid; - IBL2D->Fill(em,pm); - copy = true; - } - else if(em<-6){ - emf = em - 6; - IBL3D->Fill(em+10,pm); - } - else{ - emf = em + 6; - IBL3D->Fill(em-2,pm); + bool copy = false; + if (em < 6 && em > -7) { + if (pixID->eta_index(id) >= 80) feid = 1; + emf = 2 * em + feid; + IBL2D->Fill(em, pm); + copy = true; + } 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); - if(copy) IBL->Fill(emf+1, pm); - } - } + IBL->Fill(emf, pm); + if (copy) IBL->Fill(emf + 1, pm); + } + } } -void PixelMon2DMapsLW::WeightingFill(Identifier &id, const PixelID* pixID, bool doIBL, float weight) +void PixelMon2DMapsLW::WeightingFill(Identifier &id, const PixelID* pixID, float weight) { - int bec = pixID->barrel_ec(id); - int ld = pixID->layer_disk(id); - int pm = pixID->phi_module(id); + 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); + if (bec == 2) A->Fill(ld, pm, weight); + else if (bec == -2) C->Fill(ld, pm, weight); + else if (bec == 4 && !m_errorHist) DBMA->Fill(ld, pm, weight); + else if (bec == -4 && !m_errorHist) DBMC->Fill(ld, pm, weight); - else if(bec==0) - { - if(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); + else if (bec == 0) { + if (m_doIBL) ld--; + const 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 && m_doIBL && !m_errorHist) { + 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); } } } @@ -154,62 +148,51 @@ void PixelMon2DMapsLW::FillNormalized(PixelMon2DMapsLW* old, int 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 ); + 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); } } - 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->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<=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->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<=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->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<=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->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<=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 ); + 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<=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->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<=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->GetXaxis()->GetNbins(); x++) { + for (unsigned int y = 1; y <= IBL3D->GetYaxis()->GetNbins(); y++) { + IBL3D->SetBinContent(x, y, old->IBL3D->GetBinContent(x, y)/nactivechannels_IBL3D); + } } } } -// void PixelMon2DMapsLW::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); -// B0->Scale((float) 1.0/number); -// B1->Scale((float) 1.0/number); -// B2->Scale((float) 1.0/number); -// IBL2D->Scale((float) 1.0/number); -// IBL3D->Scale((float) 1.0/number); -// } - -void PixelMon2DMapsLW::formatHist(bool doIBL, bool errorHist) +void PixelMon2DMapsLW::formatHist() { const int ndisk = 3; const int nphi = 48; @@ -233,14 +216,14 @@ void PixelMon2DMapsLW::formatHist(bool doIBL, bool errorHist) "A7","","A8",""}; const int nstaveb = 14; const char *staveb[nstaveb] = { - "S01", "S02", "S03", "S04", "S05", "S06","S07", - "S08", "S09", "S10", "S11", "S12", "S13","S14"}; + "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 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", @@ -252,15 +235,15 @@ void PixelMon2DMapsLW::formatHist(bool doIBL, bool errorHist) "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" }; + "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", @@ -280,79 +263,79 @@ void PixelMon2DMapsLW::formatHist(bool doIBL, bool errorHist) "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; 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] ); + if (!m_errorHist) { + 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++) { + DBMA->GetXaxis()->SetBinLabel(i + 1, disk[i]); + DBMC->GetXaxis()->SetBinLabel(i + 1, disk[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 < ndisk; i++) { + A->GetXaxis()->SetBinLabel(i + 1, disk[i]); + C->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] ); + 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(doIBL && !errorHist){ - 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] ); - } + if (m_doIBL && !m_errorHist) { + 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 < 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 < nstave1; i++) { + B1->GetYaxis()->SetBinLabel(i + 1, stave1[i]); } - for (int i=0; i<nstave2; i++) - { - B2->GetYaxis()->SetBinLabel( i+1, stave2[i] ); + for (int i = 0; i < nstave2; i++) { + B2->GetYaxis()->SetBinLabel(i + 1, stave2[i]); } - if(doIBL && !errorHist){ - IBL->GetYaxis()->SetLabelSize(0.03); - IBL2D->GetYaxis()->SetLabelSize(0.03); - IBL3D->GetYaxis()->SetLabelSize(0.03); - IBL->SetOption("colz"); - IBL2D->SetOption("colz"); - IBL3D->SetOption("colz"); - IBL->SetMinimum(0.); - IBL2D->SetMinimum(0.); - IBL3D->SetMinimum(0.); + if (m_doIBL && !m_errorHist) { + IBL->GetYaxis()->SetLabelSize(0.03); + IBL2D->GetYaxis()->SetLabelSize(0.03); + IBL3D->GetYaxis()->SetLabelSize(0.03); + IBL->SetOption("colz"); + IBL2D->SetOption("colz"); + IBL3D->SetOption("colz"); + IBL->SetMinimum(0.); + IBL2D->SetMinimum(0.); + IBL3D->SetMinimum(0.); + } + + if (!m_errorHist) { + DBMA->GetYaxis()->SetLabelSize(0.02); + DBMC->GetYaxis()->SetLabelSize(0.02); + DBMA->SetOption("colz"); + DBMC->SetOption("colz"); + DBMA->SetMinimum(0.); + DBMC->SetMinimum(0.); } //Make the text smaller @@ -361,59 +344,38 @@ void PixelMon2DMapsLW::formatHist(bool doIBL, bool errorHist) 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 - // IBL2D->GetYaxis()->SetTitleOffset(1.35); - // IBL3D->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); //put histograms in the easier to read colz format 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 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 - // IBL2D->SetStats(0.); - // IBL3D->SetStats(0.); - // B0->SetStats(0.); - // B1->SetStats(0.); - // B2->SetStats(0.); - // A->SetStats(0.); - // C->SetStats(0.); - } -StatusCode PixelMon2DMapsLW::regHist(ManagedMonitorToolBase::MonGroup &group, bool doIBL, bool errorHist) +StatusCode PixelMon2DMapsLW::regHist(ManagedMonitorToolBase::MonGroup &group) { - StatusCode sc = StatusCode::SUCCESS; + StatusCode sc = StatusCode::SUCCESS; - if(doIBL && !errorHist){ - if (group.regHist(IBL).isFailure()) sc = StatusCode::FAILURE; - if (group.regHist(IBL2D).isFailure()) sc = StatusCode::FAILURE; - if (group.regHist(IBL3D).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; + if(m_doIBL && !m_errorHist){ + if (group.regHist(IBL).isFailure()) sc = StatusCode::FAILURE; + if (group.regHist(IBL2D).isFailure()) sc = StatusCode::FAILURE; + if (group.regHist(IBL3D).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 (!m_errorHist) { + if (group.regHist(DBMA).isFailure()) sc = StatusCode::FAILURE; + if (group.regHist(DBMC).isFailure()) sc = StatusCode::FAILURE; + } - return sc; + return sc; } diff --git a/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelMon2DProfilesLW.cxx b/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelMon2DProfilesLW.cxx index 1f3dbc4b8f73741f3c6b46ff229676b4935b5a68..c3fd85d4fb9f2c48f2ca9677a47c1183822e6ea8 100644 --- a/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelMon2DProfilesLW.cxx +++ b/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelMon2DProfilesLW.cxx @@ -15,34 +15,35 @@ #include "GaudiKernel/StatusCode.h" #include <string.h> -PixelMon2DProfilesLW::PixelMon2DProfilesLW(std::string name, std::string title, bool doIBL, bool errorHist, bool copy2DFEval) +PixelMon2DProfilesLW::PixelMon2DProfilesLW(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"; - std::string phitext = ";phi index of module"; - std::string disktext = ";disk number"; + std::string setatext = ";shifted eta index of module"; + std::string etatext = ";eta index of module"; + std::string phitext = ";phi index of module"; + std::string disktext = ";disk number"; - IBL3D = TProfile2D_LW::create((name+"_IBL3D").c_str(), (title + ", IBL 3D modules " + etatext + phitext).c_str(),8,-.5,7.5,14,-0.5,13.5); - IBL2D = TProfile2D_LW::create((name+"_IBL2D").c_str(), (title + ", IBL planar modules " + setatext + phitext).c_str(),12,-6.5,5.5,14,-0.5,13.5); - IBL = TProfile2D_LW::create((name+"_IBL").c_str(), (title + ", IBL " + setatext + phitext).c_str(),32,-16.5,15.5,14,-0.5,13.5); - B0 = TProfile2D_LW::create((name+"_B0").c_str(), (title + ", B0 " + etatext + phitext).c_str(),13,-6.5,6.5,22,-0.5,21.5); - B1 = TProfile2D_LW::create((name+"_B1").c_str(), (title + ", B1 " + etatext + phitext).c_str(),13,-6.5,6.5,38,-0.5,37.5); - B2 = TProfile2D_LW::create((name+"_B2").c_str(), (title + ", B2 " + etatext + phitext).c_str(),13,-6.5,6.5,52,-0.5,51.5); - A = TProfile2D_LW::create((name+"_ECA" ).c_str(), (title + ", ECA " + disktext + phitext).c_str(),3,-0.5,2.5,48,-0.5,47.5); - C = TProfile2D_LW::create((name+"_ECC" ).c_str(), (title + ", ECC " + disktext + phitext).c_str(),3,-0.5,2.5,48,-0.5,47.5); - //DBMA = TProfile2D_LW::create((name+"_DBMA" ).c_str(), (title + ", DBMA " + disktext + phitext).c_str(),3,-0.5,2.5,4,-0.5,3.5); - //DBMC = TProfile2D_LW::create((name+"_DBMC" ).c_str(), (title + ", DBMC " + disktext + phitext).c_str(),3,-0.5,2.5,4,-0.5,3.5); - mDoIBL = doIBL; - mDoErrorHist = errorHist; - mCopy2DFEval = copy2DFEval; - formatHist(); + if (m_doIBL && !m_errorHist) { + IBL3D = TProfile2D_LW::create((name+"_IBL3D").c_str(), (title + ", IBL 3D modules " + etatext + phitext).c_str(),8,-.5,7.5,14,-0.5,13.5); + IBL2D = TProfile2D_LW::create((name+"_IBL2D").c_str(), (title + ", IBL planar modules " + setatext + phitext).c_str(),12,-6.5,5.5,14,-0.5,13.5); + IBL = TProfile2D_LW::create((name+"_IBL").c_str(), (title + ", IBL " + setatext + phitext).c_str(),32,-16.5,15.5,14,-0.5,13.5); + } + B0 = TProfile2D_LW::create((name+"_B0").c_str(), (title + ", B0 " + etatext + phitext).c_str(),13,-6.5,6.5,22,-0.5,21.5); + B1 = TProfile2D_LW::create((name+"_B1").c_str(), (title + ", B1 " + etatext + phitext).c_str(),13,-6.5,6.5,38,-0.5,37.5); + B2 = TProfile2D_LW::create((name+"_B2").c_str(), (title + ", B2 " + etatext + phitext).c_str(),13,-6.5,6.5,52,-0.5,51.5); + A = TProfile2D_LW::create((name+"_ECA" ).c_str(), (title + ", ECA " + disktext + phitext).c_str(),3,-0.5,2.5,48,-0.5,47.5); + C = TProfile2D_LW::create((name+"_ECC" ).c_str(), (title + ", ECC " + disktext + phitext).c_str(),3,-0.5,2.5,48,-0.5,47.5); + //DBMA = TProfile2D_LW::create((name+"_DBMA" ).c_str(), (title + ", DBMA " + disktext + phitext).c_str(),3,-0.5,2.5,4,-0.5,3.5); + //DBMC = TProfile2D_LW::create((name+"_DBMC" ).c_str(), (title + ", DBMC " + disktext + phitext).c_str(),3,-0.5,2.5,4,-0.5,3.5); + formatHist(); } PixelMon2DProfilesLW::~PixelMon2DProfilesLW() { - LWHist::safeDelete(IBL3D); - LWHist::safeDelete(IBL2D); - LWHist::safeDelete(IBL); + if (m_doIBL && !m_errorHist) { + LWHist::safeDelete(IBL3D); + LWHist::safeDelete(IBL2D); + LWHist::safeDelete(IBL); + } LWHist::safeDelete(B0); LWHist::safeDelete(B1); LWHist::safeDelete(B2); @@ -54,58 +55,52 @@ PixelMon2DProfilesLW::~PixelMon2DProfilesLW() void PixelMon2DProfilesLW::Fill(Identifier &id, const PixelID* pixID, float weight) { - int bec = pixID->barrel_ec(id); - int ld = pixID->layer_disk(id); - int pm = pixID->phi_module(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); + const int bec = pixID->barrel_ec(id); + const int pm = pixID->phi_module(id); + int ld = pixID->layer_disk(id); - else if (bec==0) { - if (mDoIBL) 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 && mDoIBL && !mDoErrorHist) { - int feid = 0; - int emf = 0; - bool copy = false; - if (em<6 && em>-7) { - if (pixID->eta_index(id) >= 80) feid = 1; - emf = 2 * em + feid; - IBL2D->Fill(em,pm,weight); - copy = true; + 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--; + const 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 && m_doIBL && !m_errorHist) { + int feid = 0; + int emf = 0; + bool copy = false; + if (em < 6 && em > -7) { + if (pixID->eta_index(id) >= 80) feid = 1; + emf = 2 * em + feid; + IBL2D->Fill(em, pm, weight); + copy = true; + } 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); + if (m_copy2DFEval && copy) IBL->Fill(emf + 1, 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); - if (mCopy2DFEval && copy) IBL->Fill(emf+1, pm, weight); - } - } + } } void PixelMon2DProfilesLW::formatHist() { const int ndisk = 3; const int nphi = 48; - const int nphi_dbm = 4; + // const int nphi_dbm = 4; const char *disk[ndisk] = { "Disk 1", "Disk 2", "Disk 3" }; - //const char *phi_dbm[nphi_dbm] = { "M1","M2","M3","M4"}; + // const char *phi_dbm[nphi_dbm] = { "M1","M2","M3","M4"}; const int nmod = 13; const int nmodIBL2D = 12; const int nmodIBL3D = 8; @@ -123,14 +118,14 @@ void PixelMon2DProfilesLW::formatHist() "A7","","A8",""}; const int nstaveb = 14; const char *staveb[nstaveb] = { - "S01", "S02", "S03", "S04", "S05", "S06","S07", - "S08", "S09", "S10", "S11", "S12", "S13","S14"}; + "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 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", @@ -142,15 +137,15 @@ void PixelMon2DProfilesLW::formatHist() "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" }; + "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", @@ -170,53 +165,53 @@ void PixelMon2DProfilesLW::formatHist() "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; 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<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 < 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] ); + 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 (mDoIBL && !mDoErrorHist) { - 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] ); + if (m_doIBL && !m_errorHist) { + 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] ); + 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]); - if (mDoIBL && !mDoErrorHist){ - IBL->GetYaxis()->SetLabelSize(0.03); - IBL2D->GetYaxis()->SetLabelSize(0.03); - IBL3D->GetYaxis()->SetLabelSize(0.03); - IBL->SetOption("colz"); - IBL2D->SetOption("colz"); - IBL3D->SetOption("colz"); - IBL->SetMinimum(0.); - IBL2D->SetMinimum(0.); - IBL3D->SetMinimum(0.); + if (m_doIBL && !m_errorHist){ + IBL->GetYaxis()->SetLabelSize(0.03); + IBL2D->GetYaxis()->SetLabelSize(0.03); + IBL3D->GetYaxis()->SetLabelSize(0.03); + IBL->SetOption("colz"); + IBL2D->SetOption("colz"); + IBL3D->SetOption("colz"); + IBL->SetMinimum(0.); + IBL2D->SetMinimum(0.); + IBL3D->SetMinimum(0.); } //Make the text smaller @@ -227,14 +222,6 @@ void PixelMon2DProfilesLW::formatHist() C->GetYaxis()->SetLabelSize(0.02); //DBMA->GetYaxis()->SetLabelSize(0.02); //DBMC->GetYaxis()->SetLabelSize(0.02); - //Move the lable so you can read it - // IBL2D->GetYaxis()->SetTitleOffset(1.35); - // IBL3D->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); //put histograms in the easier to read colz format B0->SetOption("colz"); B1->SetOption("colz"); @@ -251,87 +238,80 @@ void PixelMon2DProfilesLW::formatHist() C->SetMinimum(0.); //DBMA->SetMinimum(0.); //DBMC->SetMinimum(0.); - //Remvoe the stats box because it's in the way - // IBL2D->SetStats(0.); - // IBL3D->SetStats(0.); - // B0->SetStats(0.); - // B1->SetStats(0.); - // B2->SetStats(0.); - // A->SetStats(0.); - // C->SetStats(0.); - } void PixelMon2DProfilesLW::Fill2DMon(PixelMon2DProfilesLW* oldmap) { - //for(int x=1; x<=DBMA->GetNbinsX(); x++){ - // for(int y=1; y<=DBMA->GetNbinsY(); y++){ + //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++){ + //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(unsigned int x=1; x<=A->GetNbinsX(); x++){ - for(unsigned int y=1; y<=A->GetNbinsY(); y++){ + 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->GetNbinsX(); x++){ - for(unsigned int y=1; y<=C->GetNbinsY(); y++){ + 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->GetNbinsX(); x++){ - for(unsigned int y=1; y<=B0->GetNbinsY(); y++){ + 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->GetNbinsX(); x++){ - for(unsigned int y=1; y<=B1->GetNbinsY(); y++){ + 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->GetNbinsX(); x++){ - for(unsigned int y=1; y<=B2->GetNbinsY(); y++){ + 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); } } - 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); + if (m_doIBL && !m_errorHist) { + 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->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 <= 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->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); + 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); + } } } } @@ -341,96 +321,97 @@ void PixelMon2DProfilesLW::FillFromMap(PixelMon2DMaps* inputmap, bool clear_inpu float weightIBL = 1.0 / 26880.0; float weightPixel = 1.0 / 46080.0; - - //for(int x=1; x<=DBMA->GetNbinsX(); x++){ - // for(int y=1; y<=DBMA->GetNbinsY(); y++){ - // float content = inputmap->DBMA->GetBinContent(x, y); - // DBMA->Fill(inputmap->DBMA->GetXaxis()->GetBinCenter(x), inputmap->DBMA->GetYaxis()->GetBinCenter(y), content*weightIBL); - // } - //} - if (clear_inputmap) inputmap->DBMA->Reset(); - //for(int x=1; x<=DBMC->GetNbinsX(); x++){ - // for(int y=1; y<=DBMC->GetNbinsY(); y++){ - // float content = inputmap->DBMC->GetBinContent(x, y); - // DBMC->Fill(inputmap->DBMC->GetXaxis()->GetBinCenter(x), inputmap->DBMC->GetYaxis()->GetBinCenter(y), content*weightIBL); - // } - //} - if (clear_inputmap) inputmap->DBMC->Reset(); + // for (int x = 1; x <= DBMA->GetNbinsX(); x++) { + // for (int y = 1; y <= DBMA->GetNbinsY(); y++) { + // float content = inputmap->DBMA->GetBinContent(x, y); + // DBMA->Fill(inputmap->DBMA->GetXaxis()->GetBinCenter(x), inputmap->DBMA->GetYaxis()->GetBinCenter(y), content * weightIBL); + // } + // } + // if (clear_inputmap) inputmap->DBMA->Reset(); + // for (int x = 1; x <= DBMC->GetNbinsX(); x++) { + // for (int y = 1; y <= DBMC->GetNbinsY(); y++) { + // float content = inputmap->DBMC->GetBinContent(x, y); + // DBMC->Fill(inputmap->DBMC->GetXaxis()->GetBinCenter(x), inputmap->DBMC->GetYaxis()->GetBinCenter(y), content * weightIBL); + // } + // } + // if (clear_inputmap) inputmap->DBMC->Reset(); - for(unsigned int x=1; x<=A->GetNbinsX(); x++){ - for(unsigned int y=1; y<=A->GetNbinsY(); y++){ - float content = inputmap->A->GetBinContent(x, y); - A->Fill(inputmap->A->GetXaxis()->GetBinCenter(x), inputmap->A->GetYaxis()->GetBinCenter(y), content*weightPixel); - } + for (unsigned int x = 1; x <= A->GetNbinsX(); x++) { + for (unsigned int y = 1; y <= A->GetNbinsY(); y++) { + float content = inputmap->A->GetBinContent(x, y); + A->Fill(inputmap->A->GetXaxis()->GetBinCenter(x), inputmap->A->GetYaxis()->GetBinCenter(y), content * weightPixel); + } } if (clear_inputmap) inputmap->A->Reset(); - for(unsigned int x=1; x<=C->GetNbinsX(); x++){ - for(unsigned int y=1; y<=C->GetNbinsY(); y++){ - float content = inputmap->C->GetBinContent(x, y); - C->Fill(inputmap->C->GetXaxis()->GetBinCenter(x), inputmap->C->GetYaxis()->GetBinCenter(y), content*weightPixel); - } + for (unsigned int x = 1; x <= C->GetNbinsX(); x++) { + for (unsigned int y = 1; y <= C->GetNbinsY(); y++) { + float content = inputmap->C->GetBinContent(x, y); + C->Fill(inputmap->C->GetXaxis()->GetBinCenter(x), inputmap->C->GetYaxis()->GetBinCenter(y), content * weightPixel); + } } if (clear_inputmap) inputmap->C->Reset(); - for(unsigned int x=1; x<=B0->GetNbinsX(); x++){ - for(unsigned int y=1; y<=B0->GetNbinsY(); y++){ - float content = inputmap->B0->GetBinContent(x, y); - B0->Fill(inputmap->B0->GetXaxis()->GetBinCenter(x), inputmap->B0->GetYaxis()->GetBinCenter(y), content*weightPixel); - } + for (unsigned int x = 1; x <= B0->GetNbinsX(); x++) { + for (unsigned int y = 1; y <= B0->GetNbinsY(); y++) { + float content = inputmap->B0->GetBinContent(x, y); + B0->Fill(inputmap->B0->GetXaxis()->GetBinCenter(x), inputmap->B0->GetYaxis()->GetBinCenter(y), content * weightPixel); + } } if (clear_inputmap) inputmap->B0->Reset(); - for(unsigned int x=1; x<=B1->GetNbinsX(); x++){ - for(unsigned int y=1; y<=B1->GetNbinsY(); y++){ - float content = inputmap->B1->GetBinContent(x, y); - B1->Fill(inputmap->B1->GetXaxis()->GetBinCenter(x), inputmap->B1->GetYaxis()->GetBinCenter(y), content*weightPixel); - } + for (unsigned int x = 1; x <= B1->GetNbinsX(); x++) { + for (unsigned int y = 1; y <= B1->GetNbinsY(); y++) { + float content = inputmap->B1->GetBinContent(x, y); + B1->Fill(inputmap->B1->GetXaxis()->GetBinCenter(x), inputmap->B1->GetYaxis()->GetBinCenter(y), content * weightPixel); + } } if (clear_inputmap) inputmap->B1->Reset(); - for(unsigned int x=1; x<=B2->GetNbinsX(); x++){ - for(unsigned int y=1; y<=B2->GetNbinsY(); y++){ - float content = inputmap->B2->GetBinContent(x, y); - B2->Fill(inputmap->B2->GetXaxis()->GetBinCenter(x), inputmap->B2->GetYaxis()->GetBinCenter(y), content*weightPixel); - } + for (unsigned int x = 1; x <= B2->GetNbinsX(); x++) { + for (unsigned int y = 1; y <= B2->GetNbinsY(); y++) { + float content = inputmap->B2->GetBinContent(x, y); + B2->Fill(inputmap->B2->GetXaxis()->GetBinCenter(x), inputmap->B2->GetYaxis()->GetBinCenter(y), content * weightPixel); + } } if (clear_inputmap) inputmap->B2->Reset(); - for(unsigned int x=1; x<=IBL->GetNbinsX(); x++){ - for(unsigned int y=1; y<=IBL->GetNbinsY(); y++){ - float content = inputmap->IBL->GetBinContent(x, y); - IBL->Fill(inputmap->IBL->GetXaxis()->GetBinCenter(x), inputmap->IBL->GetYaxis()->GetBinCenter(y), content*weightIBL); - } - } - if (clear_inputmap) inputmap->IBL->Reset(); - for(unsigned int x=1; x<=IBL2D->GetNbinsX(); x++){ - for(unsigned int y=1; y<=IBL2D->GetNbinsY(); y++){ - float content = inputmap->IBL2D->GetBinContent(x, y); - IBL2D->Fill(inputmap->IBL2D->GetXaxis()->GetBinCenter(x), inputmap->IBL2D->GetYaxis()->GetBinCenter(y), content*weightIBL*0.5); - } + if (m_doIBL && !m_errorHist) { + for (unsigned int x = 1; x <= IBL->GetNbinsX(); x++) { + for (unsigned int y = 1; y <= IBL->GetNbinsY(); y++) { + float content = inputmap->IBL->GetBinContent(x, y); + IBL->Fill(inputmap->IBL->GetXaxis()->GetBinCenter(x), inputmap->IBL->GetYaxis()->GetBinCenter(y), content * weightIBL); + } + } + if (clear_inputmap) inputmap->IBL->Reset(); + for (unsigned int x = 1; x <= IBL2D->GetNbinsX(); x++) { + for (unsigned int y = 1; y <= IBL2D->GetNbinsY(); y++) { + float content = inputmap->IBL2D->GetBinContent(x, y); + IBL2D->Fill(inputmap->IBL2D->GetXaxis()->GetBinCenter(x), inputmap->IBL2D->GetYaxis()->GetBinCenter(y), content * weightIBL*0.5); + } + } + if (clear_inputmap) inputmap->IBL2D->Reset(); + for (unsigned int x = 1; x <= IBL3D->GetNbinsX(); x++) { + for (unsigned int y = 1; y <= IBL3D->GetNbinsY(); y++) { + float content = inputmap->IBL3D->GetBinContent(x, y); + IBL3D->Fill(inputmap->IBL3D->GetXaxis()->GetBinCenter(x), inputmap->IBL3D->GetYaxis()->GetBinCenter(y), content * weightIBL); + } + } + if (clear_inputmap) inputmap->IBL3D->Reset(); } - if (clear_inputmap) inputmap->IBL2D->Reset(); - for(unsigned int x=1; x<=IBL3D->GetNbinsX(); x++){ - for(unsigned int y=1; y<=IBL3D->GetNbinsY(); y++){ - float content = inputmap->IBL3D->GetBinContent(x, y); - IBL3D->Fill(inputmap->IBL3D->GetXaxis()->GetBinCenter(x), inputmap->IBL3D->GetYaxis()->GetBinCenter(y), content*weightIBL); - } - } - if (clear_inputmap) inputmap->IBL3D->Reset(); } StatusCode PixelMon2DProfilesLW::regHist(ManagedMonitorToolBase::MonGroup &group) { - StatusCode sc = StatusCode::SUCCESS; - if (mDoIBL && !mDoErrorHist) { - if (group.regHist(IBL).isFailure()) sc = StatusCode::FAILURE; - if (group.regHist(IBL2D).isFailure()) sc = StatusCode::FAILURE; - if (group.regHist(IBL3D).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; - //sc = group.regHist(DBMA); - //sc = group.regHist(DBMC); + StatusCode sc = StatusCode::SUCCESS; + if (m_doIBL && !m_errorHist) { + if (group.regHist(IBL).isFailure()) sc = StatusCode::FAILURE; + if (group.regHist(IBL2D).isFailure()) sc = StatusCode::FAILURE; + if (group.regHist(IBL3D).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; + //sc = group.regHist(DBMA); + //sc = group.regHist(DBMC); - return sc; + return sc; } diff --git a/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelMonModules.cxx b/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelMonModules.cxx index 54a65caa385ba0a566377f8a218e9868f2eb9038..0180a974ae86349b2a4832dfb175e1df0cd0a37a 100644 --- a/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelMonModules.cxx +++ b/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelMonModules.cxx @@ -22,423 +22,361 @@ PixelMonModules::~PixelMonModules() { } -PixelMonModulesProf::PixelMonModulesProf(std::string name, std::string title, int nbins, double* arr, bool doIBL) +PixelMonModulesProf::PixelMonModulesProf(std::string name, std::string title, int nbins, double* arr, bool doIBL) : m_doIBL(doIBL) { - m_nBins=nbins; - for(int i=0; i < 1744 +280*doIBL; i++) - { - //getHist(i) = new TProfile((getHistName(i,false,doIBL)+"_"+name).c_str(), (getHistName(i,false,doIBL)+" "+title).c_str(), nbins, arr); - getHist(i) = TProfile_LW::create((getHistName(i,false,doIBL)+"_"+name).c_str(), (getHistName(i,false,doIBL)+" "+title).c_str(), nbins, arr); - } - if(doIBL==false){ - for(int i=1744; i < 2024; i++){ - getHist(i)=0; - } - } - formatHist("",doIBL); - m_Dummy=0; + m_nBins=nbins; + for (int i = 0; i < 1744 + 280 * m_doIBL; i++) { + getHist(i) = TProfile_LW::create((getHistName(i,false,m_doIBL)+"_"+name).c_str(), (getHistName(i,false,m_doIBL)+" "+title).c_str(), nbins, arr); + } + if (m_doIBL == false) { + for (int i = 1744; i < 2024; i++) { + getHist(i) = 0; + } + } + formatHist(""); + m_Dummy = 0; } -PixelMonModulesProf::PixelMonModulesProf(std::string name, std::string title, int nbins, double low, double high, bool doIBL) +PixelMonModulesProf::PixelMonModulesProf(std::string name, std::string title, int nbins, double low, double high, bool doIBL) : m_doIBL(doIBL) { - m_nBins=nbins; - for(int i=0; i < 1744 +280*doIBL; i++) - { - //getHist(i) = new TProfile((getHistName(i,false,doIBL)+"_"+name).c_str(), (getHistName(i,false,doIBL)+" "+title).c_str(), nbins, low, high); - getHist(i) = TProfile_LW::create((getHistName(i,false,doIBL)+"_"+name).c_str(), (getHistName(i,false,doIBL)+" "+title).c_str(), nbins, low, high); - } - if(doIBL==false){ - for(int i=1744; i < 2024; i++){ - getHist(i)=0; - } - } - formatHist("",doIBL); - m_Dummy=0; + m_nBins = nbins; + for (int i = 0; i < 1744 + 280 * m_doIBL; i++) { + getHist(i) = TProfile_LW::create((getHistName(i,false,m_doIBL)+"_"+name).c_str(), (getHistName(i,false,m_doIBL)+" "+title).c_str(), nbins, low, high); + } + if (m_doIBL == false) { + for (int i = 1744; i < 2024; i++) { + getHist(i) = 0; + } + } + formatHist(""); + m_Dummy = 0; } PixelMonModulesProf::~PixelMonModulesProf() { - for(int i=0; i < 2024; i++) - { - //if(getHist(i)){ delete getHist(i); } - if(getHist(i)){ LWHist::safeDelete( getHist(i) ); } - } + for (int i = 0; i < 2024; i++) { + if (getHist(i)) LWHist::safeDelete(getHist(i)); + } } -PixelMonModules1D::PixelMonModules1D(std::string name, std::string title, int nbins, double* arr, bool doIBL) +PixelMonModules1D::PixelMonModules1D(std::string name, std::string title, int nbins, double* arr, bool doIBL) : m_doIBL(doIBL) { - m_nBins=nbins; - for(int i=0; i < 1744 +280*doIBL; i++) - { - getHist(i) = new TH1F((getHistName(i,false,doIBL)+"_"+name).c_str(), (getHistName(i,false,doIBL)+" "+title).c_str(), nbins, arr); - //getHist(i) = TH1F_LW::create((getHistName(i,false,doIBL)+"_"+name).c_str(), (getHistName(i,false,doIBL)+" "+title).c_str(), nbins, arr); - } - if(doIBL==false){ - for(int i=1744; i < 2024; i++){ - getHist(i)=0; - } - } - formatHist("",doIBL); - //formatHist(doIBL); - m_Dummy=0; + m_nBins = nbins; + for (int i = 0; i < 1744 + 280 * m_doIBL; i++) { + getHist(i) = new TH1F((getHistName(i,false,m_doIBL)+"_"+name).c_str(), (getHistName(i,false,m_doIBL)+" "+title).c_str(), nbins, arr); + } + if (m_doIBL == false) { + for (int i = 1744; i < 2024; i++) { + getHist(i) = 0; + } + } + formatHist(""); + m_Dummy = 0; } -PixelMonModules1D::PixelMonModules1D(std::string name, std::string title, int nbins, double low, double high, bool doIBL) +PixelMonModules1D::PixelMonModules1D(std::string name, std::string title, int nbins, double low, double high, bool doIBL) : m_doIBL(doIBL) { - m_nBins=nbins; - for(int i=0; i < 1744 +280*doIBL; i++) - { - getHist(i) = new TH1F((getHistName(i,false,doIBL)+"_"+name).c_str(), (getHistName(i,false,doIBL)+" "+title).c_str(), nbins, low, high); - //getHist(i) = TH1F_LW::create((getHistName(i,false,doIBL)+"_"+name).c_str(), (getHistName(i,false,doIBL)+" "+title).c_str(), nbins, low, high); - } - if(doIBL==false){ - for(int i=1744; i < 2024; i++){ - getHist(i)=0; - } - } - formatHist("",doIBL); - //formatHist(doIBL); - m_Dummy=0; + m_nBins=nbins; + for (int i = 0; i < 1744 + 280 * m_doIBL; i++) { + getHist(i) = new TH1F((getHistName(i,false,m_doIBL)+"_"+name).c_str(), (getHistName(i,false,m_doIBL)+" "+title).c_str(), nbins, low, high); + } + if (m_doIBL == false) { + for (int i = 1744; i < 2024; i++) { + getHist(i) = 0; + } + } + formatHist(""); + m_Dummy = 0; } PixelMonModules1D::~PixelMonModules1D() { - for(int i=0; i < 2024; i++) - { - if(getHist(i)){ delete getHist(i); } - //if(getHist(i)){ LWHist::safeDelete( getHist(i) ); } - } + for (int i=0; i < 2024; i++) { + if (getHist(i)) delete getHist(i); + } } -PixelMonModules2D::PixelMonModules2D(std::string name, std::string title, int nbins0, double low0, double high0, int nbins1, double low1, double high1, bool doIBL) +PixelMonModules2D::PixelMonModules2D(std::string name, std::string title, int nbins0, double low0, double high0, int nbins1, double low1, double high1, bool doIBL) : m_doIBL(doIBL) { - m_nBins=nbins0*nbins1; - for(int i=0; i < 1744 +280*doIBL; i++) - { - getHist(i) = new TH2F((getHistName(i,false,doIBL)+"_"+name).c_str(), (getHistName(i,false,doIBL)+" "+title).c_str(), nbins0, low0, high0, nbins1, low1, high1); - } - if(doIBL==false){ - for(int i=1744; i < 2024; i++){ - getHist(i)=0; - } - } - formatHist("",doIBL); - m_Dummy=0; + m_nBins = nbins0 * nbins1; + for (int i = 0; i < 1744 + 280 * m_doIBL; i++) { + getHist(i) = new TH2F((getHistName(i,false,m_doIBL)+"_"+name).c_str(), (getHistName(i,false,m_doIBL)+" "+title).c_str(), nbins0, low0, high0, nbins1, low1, high1); + } + if (m_doIBL == false) { + for (int i = 1744; i < 2024; i++) { + getHist(i) = 0; + } + } + formatHist(""); + m_Dummy = 0; } PixelMonModules2D::~PixelMonModules2D() { - for(int i=0; i < 2024; i++) - { - if(getHist(i)){ - delete getHist(i); - } - } + for (int i = 0; i < 2024; i++) { + if (getHist(i)) delete getHist(i); + } } void PixelMonModulesProf::Reset() { - for(int i=0; i < 2024; i++) - { - if(getHist(i)){ - getHist(i)->Reset(); - } - } + for (int i = 0; i < 2024; i++) { + if (getHist(i)) getHist(i)->Reset(); + } } -//double PixelMonModulesProf::GetBinContent(double value, Identifier &id, const PixelID* pixID) -//{ -// int bec = pixID->barrel_ec(id); -// int ld = pixID->layer_disk(id); -// int pm = pixID->phi_module(id); -// -// if(bec==2) return A[ld][pm]->GetBinContent(A[ld][pm]->FindBin(value)); -// else if(bec==-2)return C[ld][pm]->GetBinContent(C[ld][pm]->FindBin(value)); -// else if(bec==0) -// { -// int em = pixID->eta_module(id); -// if(ld ==0) return B0[em+6][pm]->GetBinContent(B0[em+6][pm]->FindBin(value)); -// else if(ld ==1) return B1[em+6][pm]->GetBinContent(B1[em+6][pm]->FindBin(value)); -// else if(ld ==2) return B2[em+6][pm]->GetBinContent(B2[em+6][pm]->FindBin(value)); -// else if (ld==-1)return IBL[em+10][pm]->GetBinContent(IBL[em+10][pm]->FindBin(value)); -// } -// return 0.0; -//} - -StatusCode PixelMonModulesProf::regHist(ManagedMonitorToolBase* thisptr, std::string path, ManagedMonitorToolBase::Interval_t Run, bool doIBL) +StatusCode PixelMonModulesProf::regHist(ManagedMonitorToolBase* thisptr, std::string path, ManagedMonitorToolBase::Interval_t Run) { - for(int i=0; i<1744 +280*doIBL; i++) - { - ManagedMonitorToolBase::MonGroup mgroup(thisptr, (path+"/"+getHistName(i,true,doIBL)).c_str(),Run); + for (int i = 0; i < 1744 + 280 * m_doIBL; i++) { + ManagedMonitorToolBase::MonGroup mgroup(thisptr, (path+"/"+getHistName(i,true)).c_str(),Run); if (mgroup.regHist(getHist(i)).isFailure()) { - return StatusCode::FAILURE; + return StatusCode::FAILURE; } - } - return StatusCode::SUCCESS; + } + return StatusCode::SUCCESS; } void PixelMonModules1D::Reset() { - for(int i=0; i < 2024; i++) - { - if(getHist(i)){getHist(i)->Reset(); } - } + for (int i=0; i < 2024; i++) { + if (getHist(i)) getHist(i)->Reset(); + } } void PixelMonModules2D::Reset() { - for(int i=0; i < 2024; i++) - { - if(getHist(i)){getHist(i)->Reset();} - } + for (int i = 0; i < 2024; i++) { + if (getHist(i)) getHist(i)->Reset(); + } } -void PixelMonModulesProf::Fill(double value0, double value1, Identifier &id, const PixelID* pixID, bool doIBL) +void PixelMonModulesProf::Fill(double value0, double value1, Identifier &id, const PixelID* pixID) { - int bec = pixID->barrel_ec(id); - int ld = pixID->layer_disk(id); - int pm = pixID->phi_module(id); - - if(bec==2) A[ld][pm]->Fill(value0,value1); - else if(bec==-2)C[ld][pm]->Fill(value0,value1); - else if(bec==0) - { - if(doIBL){ld--;} - int em = pixID->eta_module(id); - if(ld ==0) B0[em+6][pm]->Fill(value0,value1); - else if(ld ==1) B1[em+6][pm]->Fill(value0,value1); - else if(ld ==2) B2[em+6][pm]->Fill(value0,value1); - else if(ld ==-1){IBL[em+10][pm]->Fill(value0,value1);} - } + const int bec = pixID->barrel_ec(id); + const int pm = pixID->phi_module(id); + int ld = pixID->layer_disk(id); + + if (bec == 2) A[ld][pm]->Fill(value0, value1); + else if (bec == -2) C[ld][pm]->Fill(value0, value1); + else if (bec == 0) { + if (m_doIBL) ld--; + const int em = pixID->eta_module(id); + if (ld == 0) B0[em+6][pm]->Fill(value0, value1); + else if (ld == 1) B1[em+6][pm]->Fill(value0, value1); + else if (ld == 2) B2[em+6][pm]->Fill(value0, value1); + else if (ld == -1) IBL[em+10][pm]->Fill(value0, value1); + } } -void PixelMonModules2D::Fill(double value0, double value1, Identifier &id, const PixelID* pixID, bool doIBL) +void PixelMonModules2D::Fill(double value0, double value1, Identifier &id, const PixelID* pixID) { - int bec = pixID->barrel_ec(id); - int ld = pixID->layer_disk(id); - int pm = pixID->phi_module(id); - - if(bec==2) A[ld][pm]->Fill(value0,value1); - else if(bec==-2)C[ld][pm]->Fill(value0,value1); - else if(bec==0) - { - if(doIBL){ld--;} - int em = pixID->eta_module(id); - if(ld ==0) B0[em+6][pm]->Fill(value0,value1); - else if(ld ==1) B1[em+6][pm]->Fill(value0,value1); - else if(ld ==2) B2[em+6][pm]->Fill(value0,value1); - else if(ld ==-1){IBL[em+10][pm]->Fill(value0,value1);} - } + const int bec = pixID->barrel_ec(id); + const int pm = pixID->phi_module(id); + int ld = pixID->layer_disk(id); + + if (bec == 2) A[ld][pm]->Fill(value0, value1); + else if (bec == -2) C[ld][pm]->Fill(value0, value1); + else if (bec == 0) { + if (m_doIBL) ld--; + const int em = pixID->eta_module(id); + if (ld == 0) B0[em+6][pm]->Fill(value0, value1); + else if (ld == 1) B1[em+6][pm]->Fill(value0, value1); + else if (ld == 2) B2[em+6][pm]->Fill(value0, value1); + else if (ld == -1) IBL[em+10][pm]->Fill(value0, value1); + } } -void PixelMonModules2D::Fill(double value0, double value1, Identifier &id, const PixelID* pixID, double weight, bool doIBL) +void PixelMonModules2D::Fill(double value0, double value1, Identifier &id, const PixelID* pixID, double weight) { - int bec = pixID->barrel_ec(id); - int ld = pixID->layer_disk(id); - int pm = pixID->phi_module(id); - - if(bec==2) A[ld][pm]->Fill(value0,value1,weight); - else if(bec==-2)C[ld][pm]->Fill(value0,value1,weight); - else if(bec==0) - { - if(doIBL){ld--;} + const int bec = pixID->barrel_ec(id); + const int pm = pixID->phi_module(id); + int ld = pixID->layer_disk(id); + + if (bec == 2) A[ld][pm]->Fill(value0, value1, weight); + else if (bec == -2) C[ld][pm]->Fill(value0, value1, weight); + else if (bec == 0) { + if (m_doIBL) ld--; int em = pixID->eta_module(id); - if(ld ==0) B0[em+6][pm]->Fill(value0,value1,weight); - else if(ld ==1) B1[em+6][pm]->Fill(value0,value1,weight); - else if(ld ==2) B2[em+6][pm]->Fill(value0,value1,weight); - else if (ld==-1){IBL[em+10][pm]->Fill(value0,value1,weight);} - } + if (ld == 0) B0[em+6][pm]->Fill(value0, value1, weight); + else if (ld == 1) B1[em+6][pm]->Fill(value0, value1, weight); + else if (ld == 2) B2[em+6][pm]->Fill(value0, value1, weight); + else if (ld == -1) IBL[em+10][pm]->Fill(value0, value1, weight); + } } double PixelMonModules1D::GetBinContent(double value, Identifier &id, const PixelID* pixID) { - int bec = pixID->barrel_ec(id); - int ld = pixID->layer_disk(id); - int pm = pixID->phi_module(id); - - if(bec==2) return A[ld][pm]->GetBinContent(A[ld][pm]->GetXaxis()->FindBin(value)); - else if(bec==-2)return C[ld][pm]->GetBinContent(C[ld][pm]->GetXaxis()->FindBin(value)); - else if(bec==0) - { - int em = pixID->eta_module(id); - if(ld ==0) return B0[em+6][pm]->GetBinContent(B0[em+6][pm]->GetXaxis()->FindBin(value)); - else if(ld ==1) return B1[em+6][pm]->GetBinContent(B1[em+6][pm]->GetXaxis()->FindBin(value)); - else if(ld ==2) return B2[em+6][pm]->GetBinContent(B2[em+6][pm]->GetXaxis()->FindBin(value)); - else if (ld==-1)return IBL[em+10][pm]->GetBinContent(IBL[em+10][pm]->GetXaxis()->FindBin(value)); - } - return 0.0; + const int bec = pixID->barrel_ec(id); + const int pm = pixID->phi_module(id); + int ld = pixID->layer_disk(id); + + if (bec == 2) return A[ld][pm]->GetBinContent(A[ld][pm]->GetXaxis()->FindBin(value)); + else if (bec == -2)return C[ld][pm]->GetBinContent(C[ld][pm]->GetXaxis()->FindBin(value)); + else if (bec == 0) { + const int em = pixID->eta_module(id); + if (ld == 0) return B0[em+6][pm]->GetBinContent(B0[em+6][pm]->GetXaxis()->FindBin(value)); + else if (ld == 1) return B1[em+6][pm]->GetBinContent(B1[em+6][pm]->GetXaxis()->FindBin(value)); + else if (ld == 2) return B2[em+6][pm]->GetBinContent(B2[em+6][pm]->GetXaxis()->FindBin(value)); + else if (ld == -1)return IBL[em+10][pm]->GetBinContent(IBL[em+10][pm]->GetXaxis()->FindBin(value)); + } + return 0.0; } -void PixelMonModules1D::Fill(double value, Identifier &id, const PixelID* pixID, bool doIBL) +void PixelMonModules1D::Fill(double value, Identifier &id, const PixelID* pixID) { - int bec = pixID->barrel_ec(id); - int ld = pixID->layer_disk(id); - int pm = pixID->phi_module(id); + const int bec = pixID->barrel_ec(id); + const int pm = pixID->phi_module(id); + int ld = pixID->layer_disk(id); - if(bec==2) A[ld][pm]->Fill(value); - else if(bec==-2)C[ld][pm]->Fill(value); - else if(bec==0) - { - if(doIBL){ld--;} - int em = pixID->eta_module(id); - if(ld ==0) B0[em+6][pm]->Fill(value); - else if(ld ==1) B1[em+6][pm]->Fill(value); - else if(ld ==2) B2[em+6][pm]->Fill(value); - else if (ld==-1)IBL[em+10][pm]->Fill(value); - } + if (bec == 2) A[ld][pm]->Fill(value); + else if (bec == -2) C[ld][pm]->Fill(value); + else if (bec == 0) { + if (m_doIBL) ld--; + const int em = pixID->eta_module(id); + if (ld == 0) B0[em+6][pm]->Fill(value); + else if (ld == 1) B1[em+6][pm]->Fill(value); + else if (ld == 2) B2[em+6][pm]->Fill(value); + else if (ld == -1)IBL[em+10][pm]->Fill(value); + } } -StatusCode PixelMonModules1D::regHist(ManagedMonitorToolBase* thisptr, std::string path, ManagedMonitorToolBase::Interval_t Run, bool doIBL) +StatusCode PixelMonModules1D::regHist(ManagedMonitorToolBase* thisptr, std::string path, ManagedMonitorToolBase::Interval_t Run) { - for(int i=0; i<1744 +280*doIBL; i++) - { - ManagedMonitorToolBase::MonGroup mgroup(thisptr, (path+"/"+getHistName(i,true,doIBL)).c_str(),Run); + for (int i = 0; i < 1744 + 280 * m_doIBL; i++) { + ManagedMonitorToolBase::MonGroup mgroup(thisptr, (path+"/"+getHistName(i,true)).c_str(),Run); if (mgroup.regHist(getHist(i)).isFailure()) { - return StatusCode::FAILURE; + return StatusCode::FAILURE; } - } - return StatusCode::SUCCESS; + } + return StatusCode::SUCCESS; } -StatusCode PixelMonModules2D::regHist(ManagedMonitorToolBase* thisptr, std::string path, ManagedMonitorToolBase::Interval_t Run, bool doIBL) +StatusCode PixelMonModules2D::regHist(ManagedMonitorToolBase* thisptr, std::string path, ManagedMonitorToolBase::Interval_t Run) { - for(int i=0; i<1744 +280*doIBL; i++) - { - ManagedMonitorToolBase::MonGroup mgroup(thisptr, (path+"/"+getHistName(i,true,doIBL)).c_str(),Run); + for (int i = 0; i < 1744 + 280 * m_doIBL; i++) { + ManagedMonitorToolBase::MonGroup mgroup(thisptr, (path+"/"+getHistName(i,true)).c_str(),Run); if (mgroup.regHist(getHist(i)).isFailure()) { - return StatusCode::FAILURE; + return StatusCode::FAILURE; } - } + } - return StatusCode::SUCCESS; + return StatusCode::SUCCESS; } -void PixelMonModules1D::formatHist(std::string opt, bool doIBL) +void PixelMonModules1D::formatHist(std::string opt) { - for(int i=0; i < 1744+280*doIBL; i++) - { - if(!opt.compare("status"))getHist(i)->GetXaxis()->SetRangeUser(1.,2.); + for (int i = 0; i < 1744 + 280 * m_doIBL; i++) { + if (!opt.compare("status"))getHist(i)->GetXaxis()->SetRangeUser(1., 2.); getHist(i)->SetMinimum(0); - } + } } -void PixelMonModulesProf::formatHist(std::string /*opt*/, bool doIBL) +void PixelMonModulesProf::formatHist(std::string /*opt*/) { - for(int i=0; i < 1744+280*doIBL; i++) - { + for (int i = 0; i < 1744 + 280 * m_doIBL; i++) { getHist(i)->SetMinimum(0); - } + } } -void PixelMonModules2D::formatHist(std::string opt, bool doIBL) +void PixelMonModules2D::formatHist(std::string /*opt*/) { - if(!opt.compare("status")) {} - - for(int i=0; i < 1744+280*doIBL; i++) - { + for (int i = 0; i < 1744 + 280 * m_doIBL; i++) { getHist(i)->SetMinimum(0); getHist(i)->SetOption("colz"); getHist(i)->SetStats(0.); - } + } } void PixelMonModules1D::SetBinLabel(const char* label, int binN) { - if(binN > m_nBins) return; - for(int i=0; i < 2024; i++) - { - if(getHist(i)){getHist(i)->GetXaxis()->SetBinLabel(binN,label);} - } + if (binN > m_nBins) return; + for (int i = 0; i < 2024; i++) { + if (getHist(i)) getHist(i)->GetXaxis()->SetBinLabel(binN,label); + } } TProfile_LW* &PixelMonModulesProf::getHist(int i) { - if(i < 286) return B0[i/22][i%22]; - i -= 286; - if(i < 494) return B1[i/38][i%38]; - i -= 494; - if(i < 676) return B2[i/52][i%52]; - i -= 676; - if(i < 144) return A[i/48][i%48]; - i -= 144; - if(i < 144) return C[i/48][i%48]; - i -= 144; - if(i<280){ - return IBL[i/14][i%14]; - } - return m_Dummy; + if (i < 286) return B0[i/22][i%22]; + i -= 286; + if (i < 494) return B1[i/38][i%38]; + i -= 494; + if (i < 676) return B2[i/52][i%52]; + i -= 676; + if (i < 144) return A[i/48][i%48]; + i -= 144; + if (i < 144) return C[i/48][i%48]; + i -= 144; + if (i < 280) return IBL[i/14][i%14]; + return m_Dummy; } TH1F* &PixelMonModules1D::getHist(int i) { - if(i < 286) return B0[i/22][i%22]; - i -= 286; - if(i < 494) return B1[i/38][i%38]; - i -= 494; - if(i < 676) return B2[i/52][i%52]; - i -= 676; - if(i < 144) return A[i/48][i%48]; - i -= 144; - if(i < 144) return C[i/48][i%48]; - i -= 144; - if(i<280){ - return IBL[i/14][i%14]; - } - return m_Dummy; + if (i < 286) return B0[i/22][i%22]; + i -= 286; + if (i < 494) return B1[i/38][i%38]; + i -= 494; + if (i < 676) return B2[i/52][i%52]; + i -= 676; + if (i < 144) return A[i/48][i%48]; + i -= 144; + if (i < 144) return C[i/48][i%48]; + i -= 144; + if (i < 280) return IBL[i/14][i%14]; + return m_Dummy; } TH2F* &PixelMonModules2D::getHist(int i) { - if(i < 286) return B0[i/22][i%22]; - i -= 286; - if(i < 494) return B1[i/38][i%38]; - i -= 494; - if(i < 676) return B2[i/52][i%52]; - i -= 676; - if(i < 144) return A[i/48][i%48]; - i -= 144; - if(i < 144) return C[i/48][i%48]; - i -= 144; - if(i<280){ - return IBL[i/14][i%14]; - } - return m_Dummy; + if (i < 286) return B0[i/22][i%22]; + i -= 286; + if (i < 494) return B1[i/38][i%38]; + i -= 494; + if (i < 676) return B2[i/52][i%52]; + i -= 676; + if (i < 144) return A[i/48][i%48]; + i -= 144; + if (i < 144) return C[i/48][i%48]; + i -= 144; + if (i < 280) return IBL[i/14][i%14]; + return m_Dummy; } std::string PixelMonModules::getHistName(int i, bool forPath, bool doIBL) { - const int ndisk = 3; - const int nphi = 48; - const int nmod = 13; - const int nmodIBL = 20; - const int nstaveb = 14; - const int nstave0 = 22; - const int nstave1 = 38; - const int nstave2 = 52; - std::string diskA[ndisk] = { "D1A", "D2A", "D3A" }; - std::string diskC[ndisk] = { "D1C", "D2C", "D3C" }; - std::string barrel[3] = {"L0" , "L1" , "L2" }; - std::string newbarrel[4] = {"LI", "L0" , "L1" , "L2" }; - if(forPath) - { + const int ndisk = 3; + const int nphi = 48; + const int nmod = 13; + const int nmodIBL = 20; + const int nstaveb = 14; + const int nstave0 = 22; + const int nstave1 = 38; + const int nstave2 = 52; + std::string diskA[ndisk] = { "D1A", "D2A", "D3A" }; + std::string diskC[ndisk] = { "D1C", "D2C", "D3C" }; + std::string barrel[3] = {"L0" , "L1" , "L2" }; + std::string newbarrel[4] = {"LI", "L0" , "L1" , "L2" }; + if (forPath) + { diskA[0].replace(diskA[0].begin(), diskA[0].end(), "ECA/Disk1"); diskA[1].replace(diskA[1].begin(), diskA[1].end(), "ECA/Disk2"); diskA[2].replace(diskA[2].begin(), diskA[2].end(), "ECA/Disk3"); diskC[0].replace(diskC[0].begin(), diskC[0].end(), "ECC/Disk1"); diskC[1].replace(diskC[1].begin(), diskC[1].end(), "ECC/Disk2"); diskC[2].replace(diskC[2].begin(), diskC[2].end(), "ECC/Disk3"); - } - std::string mod[nmod] = { "M6C", "M5C", "M4C", "M3C", "M2C", "M1C", "M0", "M1A", "M2A", "M3A", "M4A", "M5A", "M6A" } ; - std::string modIBL[nmodIBL] = { "M4_C8_2","M4_C8_1","M4_C7_2","M4_C7_1","M3_C6", "M3_C5", "M2_C4", "M2_C3", "M1_C2", "M1_C1", "M1_A1", "M1_A2", "M2_A3", "M2_A4", "M3_A5", "M3_A6","M4_A7_1","M4_A7_2","M4_A8_1","M4_A8_2"} ; - std::string staveb[nstaveb] = { - "S01", "S02", "S03", "S04", "S05", "S06","S07", - "S08", "S09", "S10", "S11", "S12", "S13","S14"}; - std::string 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" }; + } + std::string mod[nmod] = { "M6C", "M5C", "M4C", "M3C", "M2C", "M1C", "M0", "M1A", "M2A", "M3A", "M4A", "M5A", "M6A" } ; + std::string modIBL[nmodIBL] = { "M4_C8_2","M4_C8_1","M4_C7_2","M4_C7_1","M3_C6", "M3_C5", "M2_C4", "M2_C3", "M1_C2", "M1_C1", "M1_A1", "M1_A2", "M2_A3", "M2_A4", "M3_A5", "M3_A6","M4_A7_1","M4_A7_2","M4_A8_1","M4_A8_2"} ; + std::string staveb[nstaveb] = { + "S01", "S02", "S03", "S04", "S05", "S06","S07", + "S08", "S09", "S10", "S11", "S12", "S13","S14"}; + std::string 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" }; std::string 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", @@ -448,15 +386,15 @@ std::string PixelMonModules::getHistName(int i, bool forPath, bool doIBL) "B16_S1", "B16_S2", "B17_S1", "B17_S2", "B18_S1", "B18_S2", "B19_S1", "B19_S2" }; std::string 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" }; + "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" }; std::string staveA[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", @@ -476,43 +414,33 @@ std::string PixelMonModules::getHistName(int i, bool forPath, bool doIBL) "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"}; - if(forPath){ - std::string joint = "/"; - if(i < 286) return barrel[0]+joint+stave0[i%22]; - i -= 286; - if(i < 494) return barrel[1]+joint+stave1[i%38]; - i -= 494; - if(i < 676) return barrel[2]+joint+stave2[i%52]; - i -= 676; - if(i < 144) return diskA[i/48]; - i -= 144; - if(i < 144) return diskC[i/48]; - i -= 144; - if(doIBL){ - if(i < 280){ - return newbarrel[0]+joint+staveb[i%14]; - } - } - - // if(i>0){std::cout<<"ERROR! too many modules"<<std::endl;} - }else{ - std::string joint = "_"; - if(i < 286) return barrel[0]+joint+stave0[i%22]+joint+mod[i/22]; - i -= 286; - if(i < 494) return barrel[1]+joint+stave1[i%38]+joint+mod[i/38]; - i -= 494; - if(i < 676) return barrel[2]+joint+stave2[i%52]+joint+mod[i/52]; - i -= 676; - if(i < 144) return diskA[i/48]+joint+staveA[i%48]; - i -= 144; - if(i < 144) return diskC[i/48]+joint+staveC[i%48]; - i -= 144; - if(doIBL){ - if(i < 280){ - return newbarrel[0]+joint+staveb[i%14]+joint+modIBL[i/14];; - } - } - // if(i>0){std::cout<<"ERROR! too many modules"<<std::endl;} + if (forPath) { + std::string joint = "/"; + if (i < 286) return barrel[0]+joint+stave0[i%22]; + i -= 286; + if (i < 494) return barrel[1]+joint+stave1[i%38]; + i -= 494; + if (i < 676) return barrel[2]+joint+stave2[i%52]; + i -= 676; + if (i < 144) return diskA[i/48]; + i -= 144; + if (i < 144) return diskC[i/48]; + i -= 144; + if (doIBL && i < 280) return newbarrel[0]+joint+staveb[i%14]; + + } else { + std::string joint = "_"; + if (i < 286) return barrel[0]+joint+stave0[i%22]+joint+mod[i/22]; + i -= 286; + if (i < 494) return barrel[1]+joint+stave1[i%38]+joint+mod[i/38]; + i -= 494; + if (i < 676) return barrel[2]+joint+stave2[i%52]+joint+mod[i/52]; + i -= 676; + if (i < 144) return diskA[i/48]+joint+staveA[i%48]; + i -= 144; + if (i < 144) return diskC[i/48]+joint+staveC[i%48]; + i -= 144; + if (doIBL && i < 280) return newbarrel[0]+joint+staveb[i%14]+joint+modIBL[i/14];; } std::string dummy="wrong initialization"; return dummy; //should never get here diff --git a/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelMonProfiles.cxx b/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelMonProfiles.cxx index bc7b0c6b3ecde5d47d68776296a5b9bd26aa7cea..f2489ff86f2e2d58ab903b76623a5cd7742fddba 100644 --- a/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelMonProfiles.cxx +++ b/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelMonProfiles.cxx @@ -12,19 +12,18 @@ #include "GaudiKernel/StatusCode.h" #include <string.h> -PixelMonProfiles::PixelMonProfiles(std::string name, std::string title ) +PixelMonProfiles::PixelMonProfiles(std::string name, std::string title, bool doIBL) : m_doIBL(doIBL) { + IBL3D = TProfile2D_LW::create((name+"_IBL3D").c_str(),(title + ", IBL 3D module " + ";eta index of module;phi index of module").c_str(),8,-.5,7.5,14,-0.5,13.5); + IBL2D = TProfile2D_LW::create((name+"_IBL2D").c_str(),(title + ", IBL planar module " + ";eta index of module;phi index of module").c_str(),12,-6.5,5.5,14,-0.5,13.5); + IBL = TProfile2D_LW::create((name+"_IBL").c_str(), (title + ", IBL " + ";eta index of module;phi index of module").c_str(), 32, -16.5, 15.5, 14, -0.5, 13.5); + B0 = TProfile2D_LW::create((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 = TProfile2D_LW::create((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 = TProfile2D_LW::create((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 = TProfile2D_LW::create((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 = TProfile2D_LW::create((name+"_ECC").c_str(), (title + ", ECC "+ ";disk number;phi index of module").c_str(), 3,-0.5,2.5,48,-0.5,47.5); - IBL3D = TProfile2D_LW::create((name+"_IBL3D").c_str(),(title + ", IBL 3D module " + ";eta index of module;phi index of module").c_str(),8,-.5,7.5,14,-0.5,13.5); - IBL2D = TProfile2D_LW::create((name+"_IBL2D").c_str(),(title + ", IBL planar module " + ";eta index of module;phi index of module").c_str(),12,-6.5,5.5,14,-0.5,13.5); - IBL = TProfile2D_LW::create((name+"_IBL").c_str(), (title + ", IBL " + ";eta index of module;phi index of module").c_str(), 32, -16.5, 15.5, 14, -0.5, 13.5); - B0 = TProfile2D_LW::create((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 = TProfile2D_LW::create((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 = TProfile2D_LW::create((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 = TProfile2D_LW::create((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 = TProfile2D_LW::create((name+"_ECC" ).c_str(), (title + ", ECC "+ ";disk number;phi index of module").c_str(), 3,-0.5,2.5,48,-0.5,47.5); - - formatHist(); + formatHist(); } PixelMonProfiles::~PixelMonProfiles() @@ -41,14 +40,14 @@ PixelMonProfiles::~PixelMonProfiles() void PixelMonProfiles::SetMaxValue(float max) { - IBL->SetMaximum( max ); - IBL2D->SetMaximum( max ); - IBL3D->SetMaximum( max ); - B0->SetMaximum( max ); - B1->SetMaximum( max ); - B2->SetMaximum( max ); - A->SetMaximum( max ); - C->SetMaximum( max ); + 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 PixelMonProfiles::Reset() @@ -63,56 +62,54 @@ void PixelMonProfiles::Reset() C->Reset(); } -void PixelMonProfiles::Fill(Identifier &id, const PixelID* pixID, float Index, bool doIBL) +void PixelMonProfiles::Fill(Identifier &id, const PixelID* pixID, float Index) { - int bec = pixID->barrel_ec(id); - int ld = pixID->layer_disk(id); - int pm = pixID->phi_module(id); + 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,Index); - else if(bec==-2) C->Fill(ld,pm,Index); - else if(bec==0) - { - if(doIBL){ld--;} - int em = pixID->eta_module(id); - if(ld ==0) B0->Fill(em,pm,Index); - else if(ld ==1) B1->Fill(em,pm,Index); - else if(ld ==2) B2->Fill(em,pm,Index); - else if(ld ==-1){ - int feid = 0; - int emf = 0; - bool dep = false; - if(em<6 && em>-7){ - if(pixID->eta_index(id) >= 80) feid = 1; - emf = 2 * em + feid; - IBL2D->Fill(em,pm,Index); - dep = true; - }else if(em<-6){ - emf = em - 6; - IBL3D->Fill(em+10,pm,Index); - }else{ - emf = em + 6; - IBL3D->Fill(em-2,pm,Index); - } - //std::cout << "!!! " << emf << " " << pm << " " << Index << std::endl; - IBL->Fill(emf, pm, Index); - if(dep) IBL->Fill(emf+1, pm, Index); /// Temporary!!!! should be removed later + if (bec == 2) A->Fill(ld, pm, Index); + else if (bec == -2) C->Fill(ld, pm, Index); + else if (bec == 0) { + if (m_doIBL) ld--; + const int em = pixID->eta_module(id); + if (ld == 0) B0->Fill(em, pm, Index); + else if (ld == 1) B1->Fill(em, pm, Index); + else if (ld == 2) B2->Fill(em, pm, Index); + else if (ld == -1) { + int feid = 0; + int emf = 0; + bool dep = false; + if (em < 6 && em > -7) { + if (pixID->eta_index(id) >= 80) feid = 1; + emf = 2 * em + feid; + IBL2D->Fill(em, pm, Index); + dep = true; + } else if (em < -6) { + emf = em - 6; + IBL3D->Fill(em + 10, pm, Index); + } else { + emf = em + 6; + IBL3D->Fill(em - 2, pm, Index); + } + IBL->Fill(emf, pm, Index); + if (dep) IBL->Fill(emf + 1, pm, Index); /// Temporary!!!! should be removed later } } } void PixelMonProfiles::formatHist() { - const int ndisk = 3; - const int nphi = 48; - const char *disk[ndisk] = { "Disk 1", "Disk 2", "Disk 3" }; - 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 int ndisk = 3; + const int nphi = 48; + const char *disk[ndisk] = { "Disk 1", "Disk 2", "Disk 3" }; + 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","", @@ -123,18 +120,18 @@ void PixelMonProfiles::formatHist() "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 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 *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", @@ -145,15 +142,15 @@ void PixelMonProfiles::formatHist() "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" }; + "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", @@ -174,61 +171,48 @@ void PixelMonProfiles::formatHist() "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; i++) { + A->GetYaxis()->SetBinLabel(i + 1, nstaveA[i]); + C->GetYaxis()->SetBinLabel(i + 1, nstaveC[i]); } - for (int i=0; i<ndisk; i++) - { - A->GetXaxis()->SetBinLabel( i+1, disk[i] ); - C->GetXaxis()->SetBinLabel( i+1, disk[i] ); + for (int i = 0; i < ndisk; i++) { + A->GetXaxis()->SetBinLabel(i + 1, disk[i]); + C->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] ); + 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]); } - 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 < 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 < nmodIBL2D; i++) { + IBL2D->GetXaxis()->SetBinLabel(i + 1, modIBL2D[i]); } - for (int i=0; i<nstave1; i++) - { - B1->GetYaxis()->SetBinLabel( i+1, stave1[i] ); + for (int i = 0; i < nstaveb; i++) { + IBL2D->GetYaxis()->SetBinLabel(i + 1, staveb[i]); } - for (int i=0; i<nstave2; i++) - { - B2->GetYaxis()->SetBinLabel( i+1, stave2[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 IBL2D->GetYaxis()->SetLabelSize(0.03); @@ -239,15 +223,6 @@ void PixelMonProfiles::formatHist() B2->GetYaxis()->SetLabelSize(0.03); A->GetYaxis()->SetLabelSize(0.02); C->GetYaxis()->SetLabelSize(0.02); - //Move the lable so you can read it - //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); //put histograms in the easier to read colz format IBL->SetOption("colz"); IBL2D->SetOption("colz"); @@ -266,28 +241,18 @@ void PixelMonProfiles::formatHist() B2->SetMinimum(0.); A->SetMinimum(0.); C->SetMinimum(0.); - //Remvoe the stats box because it's in the way - //IBL->SetStats(0.); - //IBL2D->SetStats(0.); - //IBL3D->SetStats(0.); - //B0->SetStats(0.); - //B1->SetStats(0.); - //B2->SetStats(0.); - //A->SetStats(0.); - //C->SetStats(0.); - } StatusCode PixelMonProfiles::regHist(ManagedMonitorToolBase::MonGroup &group) { - StatusCode sc = StatusCode::SUCCESS; - 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; - return sc; + StatusCode sc = StatusCode::SUCCESS; + 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; + return sc; } diff --git a/InnerDetector/InDetMonitoring/PixelMonitoring/src/Status.cxx b/InnerDetector/InDetMonitoring/PixelMonitoring/src/Status.cxx index 94da3a5deacf337b924d7deac4f50a1a9b276d87..4bfac3004ae19bce19371bd9563aff0838b4de48 100644 --- a/InnerDetector/InDetMonitoring/PixelMonitoring/src/Status.cxx +++ b/InnerDetector/InDetMonitoring/PixelMonitoring/src/Status.cxx @@ -45,24 +45,24 @@ StatusCode PixelMainMon::BookStatusMon(void) StatusCode sc; - m_status = new PixelMonProfiles("Map_Of_Modules_Status", ("Modules Status (0=Active+Good, 1=Active+Bad, 2=Inactive)" + m_histTitleExt).c_str()); + m_status = new PixelMonProfiles("Map_Of_Modules_Status", ("Modules Status (0=Active+Good, 1=Active+Bad, 2=Inactive)" + m_histTitleExt).c_str(), m_doIBL); sc = m_status->regHist(statusHistos); m_status->SetMaxValue( 2.0 ); - m_status_mon = new PixelMonProfiles("Map_Of_Modules_Status_Mon", ("Modules Status (0=Active+Good, 1=Active+Bad, 2=Inactive) for monitoring" + m_histTitleExt).c_str()); + m_status_mon = new PixelMonProfiles("Map_Of_Modules_Status_Mon", ("Modules Status (0=Active+Good, 1=Active+Bad, 2=Inactive) for monitoring" + m_histTitleExt).c_str(), m_doIBL); sc = m_status_mon->regHist(statusHistos); m_status_mon->SetMaxValue( 2.0 ); if (m_doModules) { m_Status_modules = new PixelMonModules1D("Status_of_Module", ("Module Status (0=Active+Good, 1=Active+Bad, 2=Inactive)" + m_histTitleExt + ";Status").c_str(),2,0,2,m_doIBL); - sc = m_Status_modules->regHist(this, (path+"/Modules_Status").c_str(),run,m_doIBL); + sc = m_Status_modules->regHist(this, (path+"/Modules_Status").c_str(),run); m_Status_modules->SetBinLabel( "Status",2 ); - m_Status_modules->formatHist("status",m_doIBL); + m_Status_modules->formatHist("status"); } if (m_doOffline) { - m_dqStatus = new PixelMon2DMaps("Ok_modules", ("module problems, empty bin means dead module not listed in status database"+ m_histTitleExt).c_str()); + m_dqStatus = new PixelMon2DMaps("Ok_modules", ("module problems, empty bin means dead module not listed in status database"+ m_histTitleExt).c_str(), m_doIBL); sc = m_dqStatus->regHist(statusHistos); } @@ -106,7 +106,7 @@ StatusCode PixelMainMon::BookStatusLumiBlockMon(void) if (m_doOnPixelTrack) path.replace(path.begin(), path.end(), "Pixel/LumiBlockOnPixelTrack"); MonGroup lumiBlockHist(this, path.c_str(), lowStat, ATTRIB_MANAGED); - m_status_LB = new PixelMonProfiles("Map_Of_Modules_Status_LB", ("Module Status (0=Active+Good, 1=Active+Bad, 2=Inactive)"+ m_histTitleExt).c_str()); + m_status_LB = new PixelMonProfiles("Map_Of_Modules_Status_LB", ("Module Status (0=Active+Good, 1=Active+Bad, 2=Inactive)"+ m_histTitleExt).c_str(), m_doIBL); StatusCode sc = m_status_LB->regHist(lumiBlockHist); m_status_LB->SetMaxValue( 2.0 ); @@ -145,11 +145,11 @@ StatusCode PixelMainMon::FillStatusMon(void) else if (m_pixelCondSummarySvc->isActive(id_hash) == false) {Index=2;} else {Index=1;} - if (m_status) m_status->Fill(WaferID,m_pixelid,Index,m_doIBL); - if (m_status_mon) m_status_mon->Fill(WaferID,m_pixelid,Index,m_doIBL); + if (m_status) m_status->Fill(WaferID,m_pixelid,Index); + if (m_status_mon) m_status_mon->Fill(WaferID,m_pixelid,Index); if (m_doLumiBlock){ - if (m_status_LB) m_status_LB->Fill(WaferID,m_pixelid,Index,m_doIBL); + if (m_status_LB) m_status_LB->Fill(WaferID,m_pixelid,Index); } if (Index > 0) // bad but active modules @@ -186,7 +186,7 @@ StatusCode PixelMainMon::FillStatusMon(void) { diffToFill=Index; } - for (int i=0; i<diffToFill; i++) m_Status_modules->Fill(1.5,WaferID,m_pixelid,m_doIBL); //fill to the required value + for (int i=0; i<diffToFill; i++) m_Status_modules->Fill(1.5,WaferID,m_pixelid); //fill to the required value } } } // of pixelid wafer loop diff --git a/InnerDetector/InDetMonitoring/PixelMonitoring/src/Track.cxx b/InnerDetector/InDetMonitoring/PixelMonitoring/src/Track.cxx index 0d12a15a3e2843341bb3e45bfe3557b2404a0fb6..fe9b6c09254d6c580a1e573974954cc80d697636 100644 --- a/InnerDetector/InDetMonitoring/PixelMonitoring/src/Track.cxx +++ b/InnerDetector/InDetMonitoring/PixelMonitoring/src/Track.cxx @@ -112,12 +112,12 @@ StatusCode PixelMainMon::BookTrackMon(void) m_degFactorMap->SetMaximum(2.0); if (m_do2DMaps && !m_doOnline) { - m_tsos_hitmap = new PixelMon2DMapsLW("TSOS_Measurement", ("TSOS of type Measurement" + m_histTitleExt), m_doIBL, false); - sc = m_tsos_hitmap->regHist(trackHistos, m_doIBL, false); - m_tsos_holemap = new PixelMon2DMapsLW("TSOS_Hole", ("TSOS of type Hole" + m_histTitleExt), m_doIBL, false); - sc = m_tsos_holemap->regHist(trackHistos, m_doIBL, false); - m_tsos_outliermap = new PixelMon2DMapsLW("TSOS_Outlier", ("TSOS of type Outlier" + m_histTitleExt), m_doIBL, false); - sc = m_tsos_outliermap->regHist(trackHistos, m_doIBL, false); + m_tsos_hitmap = new PixelMon2DMapsLW("TSOS_Measurement", ("TSOS of type Measurement" + m_histTitleExt), m_doIBL); + sc = m_tsos_hitmap->regHist(trackHistos); + m_tsos_holemap = new PixelMon2DMapsLW("TSOS_Hole", ("TSOS of type Hole" + m_histTitleExt), m_doIBL); + sc = m_tsos_holemap->regHist(trackHistos); + m_tsos_outliermap = new PixelMon2DMapsLW("TSOS_Outlier", ("TSOS of type Outlier" + m_histTitleExt), m_doIBL); + sc = m_tsos_outliermap->regHist(trackHistos); //m_tsos_measratio = new PixelMon2DProfilesLW("TSOS_MeasRatio", ("TSOS of type Meas per track" + m_histTitleExt), m_doIBL, false, true); //sc = m_tsos_measratio->regHist(trackHistos); @@ -139,7 +139,7 @@ StatusCode PixelMainMon::BookTrackMon(void) if (m_doModules) { m_tsos_hiteff_vs_lumi = new PixelMonModulesProf("TSOS_HitEfficiency",("TSOS-based hit efficiency in module" + m_histTitleExt).c_str(),2500,-0.5,2499.5,m_doIBL); - sc = m_tsos_hiteff_vs_lumi->regHist(this,(path+"/Modules_TSOSHitEff").c_str(),run, m_doIBL); + sc = m_tsos_hiteff_vs_lumi->regHist(this,(path+"/Modules_TSOSHitEff").c_str(),run); if (!m_doOnline) { sc=trackHistos.regHist(m_clustot_lowpt = TH1F_LW::create("m_clustot_lowpt",("Cluster ToT vs Track pT (pT<10GeV)" + m_histTitleExt + "; Track pT; Cluster ToT (on track)").c_str(),250,0,250)); sc=trackHistos.regHist(m_clustot_highpt = TH1F_LW::create("m_clustot_highpt",("Cluster ToT vs Track pT (pT>=10GeV)" + m_histTitleExt + "; Track pT; Cluster ToT (on track)").c_str(),250,0,250)); @@ -327,8 +327,8 @@ StatusCode PixelMainMon::FillTrackMon(void) if (clus) clusID = clus->identify(); //nMeasurement = 1.0; - if ( m_tsos_hitmap ) m_tsos_hitmap->Fill(surfaceID,m_pixelid,m_doIBL,false); - if ( m_tsos_hiteff_vs_lumi ) m_tsos_hiteff_vs_lumi->Fill(m_manager->lumiBlockNumber(),1.,surfaceID,m_pixelid,m_doIBL); + if ( m_tsos_hitmap ) m_tsos_hitmap->Fill(surfaceID, m_pixelid); + if ( m_tsos_hiteff_vs_lumi ) m_tsos_hiteff_vs_lumi->Fill(m_manager->lumiBlockNumber(),1.,surfaceID,m_pixelid); //if( m_hiteff_incl_mod[pixlayerdisk] && passQualityCut ) m_hiteff_incl_mod[pixlayerdisk]->Fill( m_manager->lumiBlockNumber(), 1.0 ); if ( m_hiteff_incl_mod[pixlayerdisk] && pass1hole2GeVTightCut ) m_hiteff_incl_mod[pixlayerdisk]->Fill( m_manager->lumiBlockNumber(), 1.0 ); } @@ -338,8 +338,8 @@ StatusCode PixelMainMon::FillTrackMon(void) if(clus) clusID = clus->identify(); nOutlier = 1.0; - if( m_tsos_holemap ) m_tsos_holemap->Fill(surfaceID,m_pixelid,m_doIBL,false); - if( m_tsos_hiteff_vs_lumi ) m_tsos_hiteff_vs_lumi->Fill(m_manager->lumiBlockNumber(),0.,surfaceID,m_pixelid,m_doIBL); + if( m_tsos_holemap ) m_tsos_holemap->Fill(surfaceID, m_pixelid); + if( m_tsos_hiteff_vs_lumi ) m_tsos_hiteff_vs_lumi->Fill(m_manager->lumiBlockNumber(),0.,surfaceID,m_pixelid); //if( m_hiteff_incl_mod[pixlayerdisk] && passQualityCut ) m_hiteff_incl_mod[pixlayerdisk]->Fill( m_manager->lumiBlockNumber(), 0.0 ); if( m_hiteff_incl_mod[pixlayerdisk] && pass1hole2GeVTightCut ) m_hiteff_incl_mod[pixlayerdisk]->Fill( m_manager->lumiBlockNumber(), 0.0 ); } @@ -349,8 +349,8 @@ StatusCode PixelMainMon::FillTrackMon(void) if(clus) clusID = clus->identify(); nHole = 1.0; - if( m_tsos_outliermap)m_tsos_outliermap->Fill(surfaceID,m_pixelid,m_doIBL,false); - if( m_tsos_hiteff_vs_lumi) m_tsos_hiteff_vs_lumi->Fill(m_manager->lumiBlockNumber(),0.,surfaceID,m_pixelid,m_doIBL); + if( m_tsos_outliermap)m_tsos_outliermap->Fill(surfaceID, m_pixelid); + if( m_tsos_hiteff_vs_lumi) m_tsos_hiteff_vs_lumi->Fill(m_manager->lumiBlockNumber(),0.,surfaceID,m_pixelid); //if( m_hiteff_incl_mod[pixlayerdisk] && passQualityCut ) m_hiteff_incl_mod[pixlayerdisk]->Fill( m_manager->lumiBlockNumber(), 0.0 ); if( m_hiteff_incl_mod[pixlayerdisk] && pass1hole2GeVTightCut ) m_hiteff_incl_mod[pixlayerdisk]->Fill( m_manager->lumiBlockNumber(), 0.0 ); }