diff --git a/InnerDetector/InDetMonitoring/PixelMonitoring/PixelMonitoring/PixelMainMon.h b/InnerDetector/InDetMonitoring/PixelMonitoring/PixelMonitoring/PixelMainMon.h index ff33613551f24cd7837180a72227d8a31f1911d9..0115dc2ce8d90fe8074b1ba9302eb3f76dd598ce 100755 --- a/InnerDetector/InDetMonitoring/PixelMonitoring/PixelMonitoring/PixelMainMon.h +++ b/InnerDetector/InDetMonitoring/PixelMonitoring/PixelMonitoring/PixelMainMon.h @@ -340,6 +340,7 @@ private: TH1F_LW* m_maxocc_per_bcid_mod[PixLayerIBL2D3D::COUNT]; PixelMon2DMaps* m_occupancy; PixelMon2DMapsLW* m_average_pixocc; + PixelMon2DProfilesLW* m_occupancy_pix_evt; PixelMon2DMaps* m_occupancy_10min; TProfile* m_occupancy_time1; TProfile* m_occupancy_time2; diff --git a/InnerDetector/InDetMonitoring/PixelMonitoring/PixelMonitoring/PixelMon2DProfilesLW.h b/InnerDetector/InDetMonitoring/PixelMonitoring/PixelMonitoring/PixelMon2DProfilesLW.h index e3059dac19f45b23fdfa0c29183f4ea56b295dff..40c012a6637e5d05f3028acf5205c5737ec7c2ae 100644 --- a/InnerDetector/InDetMonitoring/PixelMonitoring/PixelMonitoring/PixelMon2DProfilesLW.h +++ b/InnerDetector/InDetMonitoring/PixelMonitoring/PixelMonitoring/PixelMon2DProfilesLW.h @@ -12,6 +12,7 @@ class TH2F_LW; class Identifier; class PixelID; class StatusCode; +class PixelMon2DMaps; class PixelMon2DMapsLW; // A helper class to facilitate definition of per-layer 2D profile maps. @@ -41,7 +42,7 @@ public: //TProfile2D_LW* DBMC; void Fill(Identifier &id, const PixelID* pixID, float value); void Fill2DMon(PixelMon2DProfilesLW* oldmap); - void FillFromMap(PixelMon2DMapsLW* inputmap); + void FillFromMap(PixelMon2DMaps* inputmap, bool clear_inputmap); StatusCode regHist(ManagedMonitorToolBase::MonGroup &group); private: StatusCode sc; diff --git a/InnerDetector/InDetMonitoring/PixelMonitoring/src/Clusters.cxx b/InnerDetector/InDetMonitoring/PixelMonitoring/src/Clusters.cxx index 75eb551e5cd881e0b156242f8131a80afaeeab52..a7353ea7594a66e1c1db35446b44b2c6f7ead463 100644 --- a/InnerDetector/InDetMonitoring/PixelMonitoring/src/Clusters.cxx +++ b/InnerDetector/InDetMonitoring/PixelMonitoring/src/Clusters.cxx @@ -8,12 +8,8 @@ #include "PixelMonitoring/PixelMainMon.h" #include "InDetRawData/InDetTimeCollection.h" -//#include "TrkSpacePoint/SpacePointContainer.h" #include "InDetPrepRawData/PixelClusterContainer.h" #include "InDetConditionsSummaryService/IInDetConditionsSvc.h" -//#include "TrkParameters/MeasuredAtaPlane.h" -//#include "TrkParameters/MeasuredPerigee.h" -//#include "InDetRIO_OnTrack/SiClusterOnTrack.h" #include "PixelConditionsServices/IPixelByteStreamErrorsSvc.h" #include "InDetIdentifier/PixelID.h" #include "TH1F.h" @@ -29,19 +25,12 @@ #include "LWHists/TProfile2D_LW.h" #include <sstream> -//#include "InDetRawData/InDetRawDataContainer.h" -//#include "InDetRawData/InDetRawDataCLASS_DEF.h" -//#include "TrkTrack/TrackCollection.h" -//#include "InDetReadoutGeometry/SiDetectorElement.h" -//#include "TrkTrackSummary/TrackSummary.h" #include "PixelMonitoring/PixelMon2DMaps.h" #include "PixelMonitoring/DBMMon2DMaps.h" #include "PixelMonitoring/PixelMonModules.h" #include "PixelMonitoring/PixelMonProfiles.h" #include "PixelMonitoring/PixelMon2DProfilesLW.h" -//#include "EventInfo/EventInfo.h" -//#include "EventInfo/TriggerInfo.h" #include "PixelCabling/IPixelCablingSvc.h" @@ -51,220 +40,214 @@ StatusCode PixelMainMon::BookClustersMon(void) { - if(msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "starting Book Clusters" << endmsg; - - std::string path = "Pixel/Clusters"; - if(m_doOnTrack) path.replace(path.begin(), path.end(), "Pixel/ClustersOnTrack"); - if(m_doOnPixelTrack) path.replace(path.begin(), path.end(), "Pixel/ClustersOnPixelTrack"); - MonGroup clusterShift( this, path.c_str(), run, ATTRIB_MANAGED ); //declare a group of histograms - MonGroup clusterExpert ( this, path.c_str(), run, ATTRIB_MANAGED ); //declare a group of histograms - - std::string pathT = "Pixel/Timing"; - if(m_doOnTrack) pathT.replace(pathT.begin(), pathT.end(), "Pixel/TimingOnTrack"); - if(m_doOnPixelTrack) pathT.replace(pathT.begin(), pathT.end(), "Pixel/TimingOnPixelTrack"); - MonGroup timeShift( this, pathT.c_str(), run, ATTRIB_MANAGED ); //declare a group of histograms - MonGroup timeExpert( this, pathT.c_str(), run, ATTRIB_MANAGED ); //declare a group of histograms - - std::string addOnTrack = "_OnTrack"; - - int nbins_LB = m_lbRange; double min_LB = -0.5; double max_LB = min_LB + (1.0*nbins_LB); - int nbins_BCID = m_bcidRange; double min_BCID = -0.5; double max_BCID = min_BCID + (1.0*nbins_BCID); - int nbins_npix = 300; double min_npix = -0.5; double max_npix = min_npix + (1.0*nbins_npix); - int nbins_nwid = 50; double min_nwid = -0.5; double max_nwid = min_nwid + (1.0*nbins_nwid); - int nbins_eta = 13; double min_eta = -6.5; double max_eta = min_eta + (1.0*nbins_eta); - int nbins_tot = 300; double min_tot = -0.5; double max_tot = min_tot + (1.0*nbins_tot); - int nbins_ibl_tot = 150; double min_ibl_tot = -0.5; double max_ibl_tot = min_tot + (1.0*nbins_tot); - int nbins_Q = 70; double min_Q = -0.5; double max_Q = min_Q + (3000.0*nbins_Q); - //int nbins_nevt = 50; double min_nevt = -0.5; double max_nevt = min_nevt + (1.0*nbins_nevt); - int nbins_lvl1 = 14; double min_lvl1 = -1.5; double max_lvl1 = min_lvl1 + (1.0*nbins_lvl1); - std::string atext_LB = ";lumi block"; - std::string atext_BCID = ";BCID"; - std::string atext_clu = ";# clusters/event"; - std::string atext_npix = ";# pixels/cluster"; - std::string atext_nclu = ";# clusters"; - std::string atext_nevt = ";# events"; - std::string atext_cluw = ";cluster width"; - std::string atext_eta = ";Module eta index"; - std::string atext_tot = ";ToT [BC]"; - std::string atext_Q = ";Charge [e]"; - std::string atext_lvl1 = ";LVL1A"; - std::string tmp; - std::string tmp2; - std::string atitles; - std::string hname; - std::string htitles; + if(msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "start booking pixel cluster monitoring histograms" << endmsg; + + std::string path = "Pixel/Clusters"; + if(m_doOnTrack) path.replace(path.begin(), path.end(), "Pixel/ClustersOnTrack"); + if(m_doOnPixelTrack) path.replace(path.begin(), path.end(), "Pixel/ClustersOnPixelTrack"); + MonGroup clusterShift( this, path.c_str(), run, ATTRIB_MANAGED ); //declare a group of histograms + MonGroup clusterExpert ( this, path.c_str(), run, ATTRIB_MANAGED ); //declare a group of histograms + + std::string pathT = "Pixel/Timing"; + if(m_doOnTrack) pathT.replace(pathT.begin(), pathT.end(), "Pixel/TimingOnTrack"); + if(m_doOnPixelTrack) pathT.replace(pathT.begin(), pathT.end(), "Pixel/TimingOnPixelTrack"); + MonGroup timeShift( this, pathT.c_str(), run, ATTRIB_MANAGED ); //declare a group of histograms + MonGroup timeExpert( this, pathT.c_str(), run, ATTRIB_MANAGED ); //declare a group of histograms + + std::string addOnTrack = "_OnTrack"; + + int nbins_LB = m_lbRange; double min_LB = -0.5; double max_LB = min_LB + (1.0*nbins_LB); + int nbins_BCID = m_bcidRange; double min_BCID = -0.5; double max_BCID = min_BCID + (1.0*nbins_BCID); + int nbins_npix = 300; double min_npix = -0.5; double max_npix = min_npix + (1.0*nbins_npix); + int nbins_nwid = 50; double min_nwid = -0.5; double max_nwid = min_nwid + (1.0*nbins_nwid); + int nbins_eta = 13; double min_eta = -6.5; double max_eta = min_eta + (1.0*nbins_eta); + int nbins_tot = 300; double min_tot = -0.5; double max_tot = min_tot + (1.0*nbins_tot); + int nbins_ibl_tot = 150; double min_ibl_tot = -0.5; double max_ibl_tot = min_tot + (1.0*nbins_tot); + int nbins_Q = 70; double min_Q = -0.5; double max_Q = min_Q + (3000.0*nbins_Q); + int nbins_lvl1 = 14; double min_lvl1 = -1.5; double max_lvl1 = min_lvl1 + (1.0*nbins_lvl1); + std::string atext_LB = ";lumi block"; + std::string atext_BCID = ";BCID"; + std::string atext_clu = ";# clusters/event"; + std::string atext_npix = ";# pixels/cluster"; + std::string atext_nclu = ";# clusters"; + std::string atext_nevt = ";# events"; + std::string atext_cluw = ";cluster width"; + std::string atext_eta = ";Module eta index"; + std::string atext_tot = ";ToT [BC]"; + std::string atext_Q = ";Charge [e]"; + std::string atext_lvl1 = ";LVL1A"; + std::string tmp; + std::string tmp2; + std::string atitles; + std::string hname; + std::string htitles; + + hname = makeHistname("ClusterSize_vs_eta", false); + htitles = makeHisttitle("Average cluster size as a function of barrel module eta", (atext_eta+atext_cluw), false); + sc = clusterExpert.regHist(m_clusterSize_eta = TProfile_LW::create(hname.c_str(), htitles.c_str(), nbins_eta, min_eta, max_eta)); + + hname = makeHistname("LargeClusters_per_lumi", true); + htitles = makeHisttitle("Avetarge number of large clusters (with >10 pixels) per event", (atext_LB+atext_clu), true); + sc = clusterShift.regHist(m_largeclusters_per_lumi = TProfile_LW::create(hname.c_str(), htitles.c_str(), nbins_LB, min_LB, max_LB)); + + hname = makeHistname("VeryLargeClusters_per_lumi", true); + htitles = makeHisttitle("Average number of very large clusters (with >50 pixels) per event", (atext_LB+atext_clu), true); + sc = clusterShift.regHist(m_verylargeclusters_per_lumi = TProfile_LW::create(hname.c_str(), htitles.c_str(), nbins_LB, min_LB, max_LB)); + + hname = makeHistname("HighNClusters_per_lumi", true); + htitles = makeHisttitle("Number of events with >1000 clusters/event", (atext_LB+atext_nevt), true); + sc = clusterExpert.regHist(m_highNclusters_per_lumi = TH1I_LW::create(hname.c_str(), htitles.c_str(), nbins_LB, min_LB, max_LB)); + + hname = makeHistname("Clusters_per_lumi", true); + htitles = makeHisttitle("Average number of pixel clusters per event", (atext_LB+atext_clu), true); + sc = clusterShift.regHist(m_clusters_per_lumi = TProfile_LW::create(hname.c_str(), htitles.c_str(), nbins_LB, min_LB, max_LB)); + + hname = makeHistname("TotalClusters_per_lumi", true); + htitles = makeHisttitle("Total number of pixel clusters", (atext_LB+atext_nclu), true); + sc = clusterShift.regHist(m_totalclusters_per_lumi = TH1I_LW::create(hname.c_str(), htitles.c_str(), nbins_LB, min_LB, max_LB)); + + hname = makeHistname("Cluster_groupsize", true); + htitles = makeHisttitle("Number of pixels in a cluster", (atext_npix+atext_nclu), true); + sc = clusterExpert.regHist(m_cluster_groupsize = TH1F_LW::create(hname.c_str(), htitles.c_str(), nbins_npix, min_npix, max_npix)); + + hname = makeHistname("Cluster_column_width", false); + htitles = makeHisttitle("Column width of a cluster", (atext_cluw+atext_nclu), false); + sc = clusterExpert.regHist(m_cluster_col_width = TH1F_LW::create(hname.c_str(), htitles.c_str(), nbins_nwid, min_nwid, max_nwid)); + + hname = makeHistname("Cluster_row_width", false); + htitles = makeHisttitle("Row width of a cluster", (atext_cluw+atext_nclu), false); + sc = clusterExpert.regHist(m_cluster_row_width = TH1F_LW::create(hname.c_str(), htitles.c_str(), nbins_nwid, min_nwid, max_nwid)); + + hname = makeHistname("Cluster_LVL1A", true); + htitles = makeHisttitle("Cluster Level 1 Accept", (atext_lvl1+atext_nclu), true); + sc = timeShift.regHist(m_cluster_LVL1A = TH1F_LW::create(hname.c_str(), htitles.c_str(), nbins_lvl1, min_lvl1, max_lvl1)); + + /// per-layer histograms + for (int i=0; i<PixLayer::COUNT-1+(int)(m_doIBL); i++) { + hname = makeHistname(("Clusters_per_lumi_"+m_modLabel_PixLayerIBL2D3D[i]), false); + htitles = makeHisttitle(("Average number of pixel clusters per event per LB, "+m_modLabel_PixLayerIBL2D3D[i]), (atext_LB+atext_clu), false); + sc = clusterExpert.regHist(m_clusters_per_lumi_mod[i] = TProfile_LW::create(hname.c_str(), htitles.c_str(), nbins_LB, min_LB, max_LB)); + + hname = makeHistname(("1Hit_Cluster_ToT_"+m_modLabel_PixLayerIBL2D3D[i]), false); + htitles = makeHisttitle(("ToT for 1-hit clusters, "+m_modLabel_PixLayerIBL2D3D[i]), (atext_tot+atext_nclu), false); + sc = clusterExpert.regHist(m_1cluster_ToT_mod[i] = TH1F_LW::create(hname.c_str(), htitles.c_str(), nbins_tot, min_tot, max_tot)); + + hname = makeHistname(("2Hit_Cluster_ToT_"+m_modLabel_PixLayerIBL2D3D[i]), false); + htitles = makeHisttitle(("ToT for 2-hit clusters, "+m_modLabel_PixLayerIBL2D3D[i]), (atext_tot+atext_nclu), false); + sc = clusterExpert.regHist(m_2cluster_ToT_mod[i] = TH1F_LW::create(hname.c_str(), htitles.c_str(), nbins_tot, min_tot, max_tot)); + + hname = makeHistname(("3Hit_Cluster_ToT_"+m_modLabel_PixLayerIBL2D3D[i]), false); + htitles = makeHisttitle(("ToT for 3-hit clusters, "+m_modLabel_PixLayerIBL2D3D[i]), (atext_tot+atext_nclu), false); + sc = clusterExpert.regHist(m_3cluster_ToT_mod[i] = TH1F_LW::create(hname.c_str(), htitles.c_str(), nbins_tot, min_tot, max_tot)); + + hname = makeHistname(("BigHit_Cluster_ToT_"+m_modLabel_PixLayerIBL2D3D[i]), false); + htitles = makeHisttitle(("ToT for cluster size > 3, "+m_modLabel_PixLayerIBL2D3D[i]), (atext_tot+atext_nclu), false); + sc = clusterExpert.regHist(m_bigcluster_ToT_mod[i] = TH1F_LW::create(hname.c_str(), htitles.c_str(), nbins_tot, min_tot, max_tot)); + + hname = makeHistname(("1Hit_Cluster_Q_"+m_modLabel_PixLayerIBL2D3D[i]), false); + htitles = makeHisttitle(("Charge for 1-hit clusters, "+m_modLabel_PixLayerIBL2D3D[i]), (atext_Q+atext_nclu), false); + sc = clusterExpert.regHist(m_1cluster_Q_mod[i] = TH1F_LW::create(hname.c_str(), htitles.c_str(), nbins_Q, min_Q, max_Q)); + + hname = makeHistname(("2Hit_Cluster_Q_"+m_modLabel_PixLayerIBL2D3D[i]), false); + htitles = makeHisttitle(("Charge for 2-hit clusters, "+m_modLabel_PixLayerIBL2D3D[i]), (atext_Q+atext_nclu), false); + sc = clusterExpert.regHist(m_2cluster_Q_mod[i] = TH1F_LW::create(hname.c_str(), htitles.c_str(), nbins_Q, min_Q, max_Q)); + + hname = makeHistname(("3Hit_Cluster_Q_"+m_modLabel_PixLayerIBL2D3D[i]), false); + htitles = makeHisttitle(("Charge for 3-hit clusters, "+m_modLabel_PixLayerIBL2D3D[i]), (atext_Q+atext_nclu), false); + sc = clusterExpert.regHist(m_3cluster_Q_mod[i] = TH1F_LW::create(hname.c_str(), htitles.c_str(), nbins_Q, min_Q, max_Q)); + + hname = makeHistname(("BigHit_Cluster_Q_"+m_modLabel_PixLayerIBL2D3D[i]), false); + htitles = makeHisttitle(("Charge for cluster size > 3, "+m_modLabel_PixLayerIBL2D3D[i]), (atext_Q+atext_nclu), false); + sc = clusterExpert.regHist(m_bigcluster_Q_mod[i] = TH1F_LW::create(hname.c_str(), htitles.c_str(), nbins_Q, min_Q, max_Q)); + + hname = makeHistname(("Cluster_LVL1A_"+m_modLabel_PixLayerIBL2D3D[i]), true); + if(i != PixLayer::kIBL) htitles = makeHisttitle(("Cluster Level 1 Accept with ToT > 15, "+m_modLabel_PixLayerIBL2D3D[i]), (atext_lvl1+atext_nclu), false); + else htitles = makeHisttitle(("Cluster Level 1 Accept with ToT > 4, "+m_modLabel_PixLayerIBL2D3D[i]), (atext_lvl1+atext_nclu), false); + sc = timeExpert.regHist(m_cluster_LVL1A1d_mod[i] = TH1F_LW::create(hname.c_str(), htitles.c_str(), nbins_lvl1, min_lvl1, max_lvl1)); + + hname = makeHistname(("Cluster_groupsize_vs_eta_"+m_modLabel_PixLayerIBL2D3D[i]), false); + htitles = makeHisttitle(("Number of pixels per cluster vs eta, "+m_modLabel_PixLayerIBL2D3D[i]), (atext_eta+atext_npix), false); + sc = clusterExpert.regHist(m_clussize_vs_eta_mod[i] = TProfile_LW::create(hname.c_str(), htitles.c_str(), nbins_eta, min_eta, max_eta)); + + if (m_doESD && !m_doOnline){ + hname = makeHistname(("ClusterToT_vs_eta_"+m_modLabel_PixLayerIBL2D3D[i]), false); + htitles = makeHisttitle(("Cluster ToT vs eta, "+m_modLabel_PixLayerIBL2D3D[i]), (atext_eta+atext_tot), false); + sc = clusterExpert.regHist(m_clusToT_vs_eta_mod[i] = TH2F_LW::create(hname.c_str(), htitles.c_str(), nbins_eta, min_eta, max_eta, nbins_tot, min_tot, max_tot)); + + hname = makeHistname(("ClusterToT_vs_groupsize_"+m_modLabel_PixLayerIBL2D3D[i]), false); + htitles = makeHisttitle(("Cluster ToT vs groupsize, "+m_modLabel_PixLayerIBL2D3D[i]), (atext_tot+atext_npix), false); + sc= clusterExpert.regHist(m_ToT_vs_clussize_mod[i] = TH2F_LW::create(hname.c_str(), htitles.c_str(), nbins_tot, min_tot, max_tot, nbins_npix, min_npix, max_npix)); + } + } + for (int i=0; i<PixLayerIBL2D3D::COUNT; i++){ + hname = makeHistname(("Cluster_ToT_"+m_modLabel_PixLayerIBL2D3D[i]), false); + htitles = makeHisttitle(("Cluster ToT, "+m_modLabel_PixLayerIBL2D3D[i]), (atext_tot+atext_nclu), false); + if ( i<PixLayer::kIBL ){ + sc = clusterExpert.regHist(m_cluster_ToT1d_mod[i] = TH1F_LW::create(hname.c_str(), htitles.c_str(), nbins_tot, min_tot, max_tot)); + } else if(m_doIBL){ + sc = clusterExpert.regHist(m_cluster_ToT1d_mod[i] = TH1F_LW::create(hname.c_str(), htitles.c_str(), nbins_ibl_tot, min_ibl_tot, max_ibl_tot)); + } + + hname = makeHistname(("Cluster_Q_"+m_modLabel_PixLayerIBL2D3D[i]), false); + htitles = makeHisttitle(("Charge, "+m_modLabel_PixLayerIBL2D3D[i]), (atext_Q+atext_nclu), false); + sc = clusterExpert.regHist(m_cluster_Q_mod[i] = TH1F_LW::create(hname.c_str(), htitles.c_str(), nbins_Q, min_Q, max_Q)); + + hname = makeHistname(("Cluster_groupsize_"+m_modLabel_PixLayerIBL2D3D[i]), false); + htitles = makeHisttitle(("Number of pixels in a cluster, "+m_modLabel_PixLayerIBL2D3D[i]), (atext_npix+atext_nclu), false); + sc = clusterExpert.regHist(m_cluster_groupsize_mod[i] = TH1F_LW::create(hname.c_str(), htitles.c_str(), nbins_npix+1, min_npix, max_npix+1)); + + hname = makeHistname(("Cluster_column_width_"+m_modLabel_PixLayerIBL2D3D[i]), false); + htitles = makeHisttitle(("Column width of a cluster, "+m_modLabel_PixLayerIBL2D3D[i]), (atext_cluw+atext_nclu), false); + sc = clusterExpert.regHist(m_cluster_col_width_mod[i] = TH1F_LW::create(hname.c_str(), htitles.c_str(), nbins_nwid, min_nwid, max_nwid)); + + hname = makeHistname(("Cluster_row_width_"+m_modLabel_PixLayerIBL2D3D[i]), false); + htitles = makeHisttitle(("Row width of a cluster, "+m_modLabel_PixLayerIBL2D3D[i]), (atext_cluw+atext_nclu), false); + sc = clusterExpert.regHist(m_cluster_row_width_mod[i] = TH1F_LW::create(hname.c_str(), htitles.c_str(), nbins_nwid, min_nwid, max_nwid)); + + hname = makeHistname(("TotalClusters_per_lumi_"+m_modLabel_PixLayerIBL2D3D[i]), false); + htitles = makeHisttitle(("Total number of pixel clusters per LB, "+m_modLabel_PixLayerIBL2D3D[i]), (atext_LB+atext_nclu), false); + sc = clusterExpert.regHist(m_totalclusters_per_lumi_mod[i] = TH1I_LW::create(hname.c_str(), htitles.c_str(), nbins_LB, min_LB, max_LB)); + + hname = makeHistname(("TotalClusters_per_bcid_"+m_modLabel_PixLayerIBL2D3D[i]), false); + htitles = makeHisttitle(("Total number of pixel clusters per BCID, "+m_modLabel_PixLayerIBL2D3D[i]), (atext_LB+atext_nclu), false); + + hname = makeHistname(("Clusters_row_width_per_lumi_"+m_modLabel_PixLayerIBL2D3D[i]), true); + htitles = makeHisttitle("Average row width per LB", (atext_LB+atext_clu), true); + sc = clusterShift.regHist(m_clusters_row_width_per_lumi_mod[i] = TProfile_LW::create(hname.c_str(), htitles.c_str(), nbins_LB, min_LB, max_LB)); + + hname = makeHistname(("Clusters_column_width_per_lumi_"+m_modLabel_PixLayerIBL2D3D[i]), true); + htitles = makeHisttitle("Average column width per LB", (atext_LB+atext_clu), true); + sc = clusterShift.regHist(m_clusters_col_width_per_lumi_mod[i] = TProfile_LW::create(hname.c_str(), htitles.c_str(), nbins_LB, min_LB, max_LB)); + + hname = makeHistname(("Clusters_row_width_per_bcid_"+m_modLabel_PixLayerIBL2D3D[i]), true); + htitles = makeHisttitle("Average row width per BCID", (atext_BCID+atext_clu), true); + sc = clusterShift.regHist(m_clusters_row_width_per_bcid_mod[i] = TProfile_LW::create(hname.c_str(), htitles.c_str(), nbins_BCID, min_BCID, max_BCID)); + + hname = makeHistname(("Clusters_column_width_per_bcid_"+m_modLabel_PixLayerIBL2D3D[i]), true); + htitles = makeHisttitle("Average column width per BCID", (atext_BCID+atext_clu), true); + sc = clusterShift.regHist(m_clusters_col_width_per_bcid_mod[i] = TProfile_LW::create(hname.c_str(), htitles.c_str(), nbins_BCID, min_BCID, max_BCID)); + + hname = makeHistname(("ClusterSize_OnTrack_"+m_modLabel_PixLayerIBL2D3D[i]), false); + htitles = makeHisttitle(("cluster size for clusters on tracks, "+m_modLabel_PixLayerIBL2D3D[i]), ";cluster size;#clusters", false); + sc = clusterExpert.regHist(m_clusize_ontrack_mod[i] = TH1F_LW::create(hname.c_str(), htitles.c_str(), 300, -0.5, -0.5+300.0)); + + hname = makeHistname(("ClusterSize_OffTrack_"+m_modLabel_PixLayerIBL2D3D[i]), false); + htitles = makeHisttitle(("cluster size for clusters out of tracks , "+m_modLabel_PixLayerIBL2D3D[i]), ";cluster size;#clusters", false); + sc = clusterExpert.regHist(m_clusize_offtrack_mod[i] = TH1F_LW::create(hname.c_str(), htitles.c_str(), 300, -0.5, -0.5+300.0)); + } - hname = makeHistname("ClusterSize_vs_eta", false); - htitles = makeHisttitle("Average cluster size as a function of barrel module eta", (atext_eta+atext_cluw), false); - sc = clusterExpert.regHist(m_clusterSize_eta = TProfile_LW::create(hname.c_str(), htitles.c_str(), nbins_eta, min_eta, max_eta)); - - hname = makeHistname("LargeClusters_per_lumi", true); - htitles = makeHisttitle("Avetarge number of large clusters (with >10 pixels) per event", (atext_LB+atext_clu), true); - sc = clusterShift.regHist(m_largeclusters_per_lumi = TProfile_LW::create(hname.c_str(), htitles.c_str(), nbins_LB, min_LB, max_LB)); - - hname = makeHistname("VeryLargeClusters_per_lumi", true); - htitles = makeHisttitle("Average number of very large clusters (with >50 pixels) per event", (atext_LB+atext_clu), true); - sc = clusterShift.regHist(m_verylargeclusters_per_lumi = TProfile_LW::create(hname.c_str(), htitles.c_str(), nbins_LB, min_LB, max_LB)); - - hname = makeHistname("HighNClusters_per_lumi", true); - htitles = makeHisttitle("Number of events with >1000 clusters/event", (atext_LB+atext_nevt), true); - sc = clusterExpert.regHist(m_highNclusters_per_lumi = TH1I_LW::create(hname.c_str(), htitles.c_str(), nbins_LB, min_LB, max_LB)); - - hname = makeHistname("Clusters_per_lumi", true); - htitles = makeHisttitle("Average number of pixel clusters per event", (atext_LB+atext_clu), true); - sc = clusterShift.regHist(m_clusters_per_lumi = TProfile_LW::create(hname.c_str(), htitles.c_str(), nbins_LB, min_LB, max_LB)); - - hname = makeHistname("TotalClusters_per_lumi", true); - htitles = makeHisttitle("Total number of pixel clusters", (atext_LB+atext_nclu), true); - sc = clusterShift.regHist(m_totalclusters_per_lumi = TH1I_LW::create(hname.c_str(), htitles.c_str(), nbins_LB, min_LB, max_LB)); - - hname = makeHistname("Cluster_groupsize", true); - htitles = makeHisttitle("Number of pixels in a cluster", (atext_npix+atext_nclu), true); - sc = clusterExpert.regHist(m_cluster_groupsize = TH1F_LW::create(hname.c_str(), htitles.c_str(), nbins_npix, min_npix, max_npix)); - - hname = makeHistname("Cluster_column_width", false); - htitles = makeHisttitle("Column width of a cluster", (atext_cluw+atext_nclu), false); - sc = clusterExpert.regHist(m_cluster_col_width = TH1F_LW::create(hname.c_str(), htitles.c_str(), nbins_nwid, min_nwid, max_nwid)); - - hname = makeHistname("Cluster_row_width", false); - htitles = makeHisttitle("Row width of a cluster", (atext_cluw+atext_nclu), false); - sc = clusterExpert.regHist(m_cluster_row_width = TH1F_LW::create(hname.c_str(), htitles.c_str(), nbins_nwid, min_nwid, max_nwid)); - - hname = makeHistname("Cluster_LVL1A", true); - htitles = makeHisttitle("Cluster Level 1 Accept", (atext_lvl1+atext_nclu), true); - sc = timeShift.regHist(m_cluster_LVL1A = TH1F_LW::create(hname.c_str(), htitles.c_str(), nbins_lvl1, min_lvl1, max_lvl1)); - - /// Histograms for each layer - for(int i=0; i<PixLayer::COUNT-1+(int)(m_doIBL); i++){ - hname = makeHistname(("Clusters_per_lumi_"+m_modLabel_PixLayerIBL2D3D[i]), false); - htitles = makeHisttitle(("Average number of pixel clusters per event per LB, "+m_modLabel_PixLayerIBL2D3D[i]), (atext_LB+atext_clu), false); - sc = clusterExpert.regHist(m_clusters_per_lumi_mod[i] = TProfile_LW::create(hname.c_str(), htitles.c_str(), nbins_LB, min_LB, max_LB)); - - hname = makeHistname(("1Hit_Cluster_ToT_"+m_modLabel_PixLayerIBL2D3D[i]), false); - htitles = makeHisttitle(("ToT for 1-hit clusters, "+m_modLabel_PixLayerIBL2D3D[i]), (atext_tot+atext_nclu), false); - sc = clusterExpert.regHist(m_1cluster_ToT_mod[i] = TH1F_LW::create(hname.c_str(), htitles.c_str(), nbins_tot, min_tot, max_tot)); - - hname = makeHistname(("2Hit_Cluster_ToT_"+m_modLabel_PixLayerIBL2D3D[i]), false); - htitles = makeHisttitle(("ToT for 2-hit clusters, "+m_modLabel_PixLayerIBL2D3D[i]), (atext_tot+atext_nclu), false); - sc = clusterExpert.regHist(m_2cluster_ToT_mod[i] = TH1F_LW::create(hname.c_str(), htitles.c_str(), nbins_tot, min_tot, max_tot)); - - hname = makeHistname(("3Hit_Cluster_ToT_"+m_modLabel_PixLayerIBL2D3D[i]), false); - htitles = makeHisttitle(("ToT for 3-hit clusters, "+m_modLabel_PixLayerIBL2D3D[i]), (atext_tot+atext_nclu), false); - sc = clusterExpert.regHist(m_3cluster_ToT_mod[i] = TH1F_LW::create(hname.c_str(), htitles.c_str(), nbins_tot, min_tot, max_tot)); - - hname = makeHistname(("BigHit_Cluster_ToT_"+m_modLabel_PixLayerIBL2D3D[i]), false); - htitles = makeHisttitle(("ToT for cluster size > 3, "+m_modLabel_PixLayerIBL2D3D[i]), (atext_tot+atext_nclu), false); - sc = clusterExpert.regHist(m_bigcluster_ToT_mod[i] = TH1F_LW::create(hname.c_str(), htitles.c_str(), nbins_tot, min_tot, max_tot)); - - hname = makeHistname(("1Hit_Cluster_Q_"+m_modLabel_PixLayerIBL2D3D[i]), false); - htitles = makeHisttitle(("Charge for 1-hit clusters, "+m_modLabel_PixLayerIBL2D3D[i]), (atext_Q+atext_nclu), false); - sc = clusterExpert.regHist(m_1cluster_Q_mod[i] = TH1F_LW::create(hname.c_str(), htitles.c_str(), nbins_Q, min_Q, max_Q)); - - hname = makeHistname(("2Hit_Cluster_Q_"+m_modLabel_PixLayerIBL2D3D[i]), false); - htitles = makeHisttitle(("Charge for 2-hit clusters, "+m_modLabel_PixLayerIBL2D3D[i]), (atext_Q+atext_nclu), false); - sc = clusterExpert.regHist(m_2cluster_Q_mod[i] = TH1F_LW::create(hname.c_str(), htitles.c_str(), nbins_Q, min_Q, max_Q)); - - hname = makeHistname(("3Hit_Cluster_Q_"+m_modLabel_PixLayerIBL2D3D[i]), false); - htitles = makeHisttitle(("Charge for 3-hit clusters, "+m_modLabel_PixLayerIBL2D3D[i]), (atext_Q+atext_nclu), false); - sc = clusterExpert.regHist(m_3cluster_Q_mod[i] = TH1F_LW::create(hname.c_str(), htitles.c_str(), nbins_Q, min_Q, max_Q)); - - hname = makeHistname(("BigHit_Cluster_Q_"+m_modLabel_PixLayerIBL2D3D[i]), false); - htitles = makeHisttitle(("Charge for cluster size > 3, "+m_modLabel_PixLayerIBL2D3D[i]), (atext_Q+atext_nclu), false); - sc = clusterExpert.regHist(m_bigcluster_Q_mod[i] = TH1F_LW::create(hname.c_str(), htitles.c_str(), nbins_Q, min_Q, max_Q)); - - hname = makeHistname(("Cluster_LVL1A_"+m_modLabel_PixLayerIBL2D3D[i]), true); - if(i != PixLayer::kIBL) htitles = makeHisttitle(("Cluster Level 1 Accept with ToT > 15, "+m_modLabel_PixLayerIBL2D3D[i]), (atext_lvl1+atext_nclu), false); - else htitles = makeHisttitle(("Cluster Level 1 Accept with ToT > 4, "+m_modLabel_PixLayerIBL2D3D[i]), (atext_lvl1+atext_nclu), false); - sc = timeExpert.regHist(m_cluster_LVL1A1d_mod[i] = TH1F_LW::create(hname.c_str(), htitles.c_str(), nbins_lvl1, min_lvl1, max_lvl1)); - - hname = makeHistname(("Cluster_groupsize_vs_eta_"+m_modLabel_PixLayerIBL2D3D[i]), false); - htitles = makeHisttitle(("Number of pixels per cluster vs eta, "+m_modLabel_PixLayerIBL2D3D[i]), (atext_eta+atext_npix), false); - sc = clusterExpert.regHist(m_clussize_vs_eta_mod[i] = TProfile_LW::create(hname.c_str(), htitles.c_str(), nbins_eta, min_eta, max_eta)); - - if(m_doESD && !m_doOnline){ - hname = makeHistname(("ClusterToT_vs_eta_"+m_modLabel_PixLayerIBL2D3D[i]), false); - htitles = makeHisttitle(("Cluster ToT vs eta, "+m_modLabel_PixLayerIBL2D3D[i]), (atext_eta+atext_tot), false); - sc = clusterExpert.regHist(m_clusToT_vs_eta_mod[i] = TH2F_LW::create(hname.c_str(), htitles.c_str(), nbins_eta, min_eta, max_eta, nbins_tot, min_tot, max_tot)); - - hname = makeHistname(("ClusterToT_vs_groupsize_"+m_modLabel_PixLayerIBL2D3D[i]), false); - htitles = makeHisttitle(("Cluster ToT vs groupsize, "+m_modLabel_PixLayerIBL2D3D[i]), (atext_tot+atext_npix), false); - sc= clusterExpert.regHist(m_ToT_vs_clussize_mod[i] = TH2F_LW::create(hname.c_str(), htitles.c_str(), nbins_tot, min_tot, max_tot, nbins_npix, min_npix, max_npix)); - - hname = makeHistname(("ClusterQ_vs_groupsize_"+m_modLabel_PixLayerIBL2D3D[i]), false); - htitles = makeHisttitle(("Cluster Charge vs groupsize, "+m_modLabel_PixLayerIBL2D3D[i]), (atext_tot+atext_npix), false); - //sc= clusterExpert.regHist(m_Q_vs_clussize_mod[i] = TH2F_LW::create(hname.c_str(), htitles.c_str(), nbins_Q, min_Q, max_Q, nbins_npix, min_npix, max_npix)); - - } - } - for(int i=0; i<PixLayerIBL2D3D::COUNT; i++){ - hname = makeHistname(("Cluster_ToT_"+m_modLabel_PixLayerIBL2D3D[i]), false); - htitles = makeHisttitle(("Cluster ToT, "+m_modLabel_PixLayerIBL2D3D[i]), (atext_tot+atext_nclu), false); - if( i<PixLayer::kIBL ){ - sc = clusterExpert.regHist(m_cluster_ToT1d_mod[i] = TH1F_LW::create(hname.c_str(), htitles.c_str(), nbins_tot, min_tot, max_tot)); - }else if(m_doIBL){ - sc = clusterExpert.regHist(m_cluster_ToT1d_mod[i] = TH1F_LW::create(hname.c_str(), htitles.c_str(), nbins_ibl_tot, min_ibl_tot, max_ibl_tot)); - } - - hname = makeHistname(("Cluster_Q_"+m_modLabel_PixLayerIBL2D3D[i]), false); - htitles = makeHisttitle(("Charge, "+m_modLabel_PixLayerIBL2D3D[i]), (atext_Q+atext_nclu), false); - sc = clusterExpert.regHist(m_cluster_Q_mod[i] = TH1F_LW::create(hname.c_str(), htitles.c_str(), nbins_Q, min_Q, max_Q)); - - hname = makeHistname(("Cluster_groupsize_"+m_modLabel_PixLayerIBL2D3D[i]), false); - htitles = makeHisttitle(("Number of pixels in a cluster, "+m_modLabel_PixLayerIBL2D3D[i]), (atext_npix+atext_nclu), false); - sc = clusterExpert.regHist(m_cluster_groupsize_mod[i] = TH1F_LW::create(hname.c_str(), htitles.c_str(), nbins_npix+1, min_npix, max_npix+1)); - - hname = makeHistname(("Cluster_column_width_"+m_modLabel_PixLayerIBL2D3D[i]), false); - htitles = makeHisttitle(("Column width of a cluster, "+m_modLabel_PixLayerIBL2D3D[i]), (atext_cluw+atext_nclu), false); - sc = clusterExpert.regHist(m_cluster_col_width_mod[i] = TH1F_LW::create(hname.c_str(), htitles.c_str(), nbins_nwid, min_nwid, max_nwid)); - - hname = makeHistname(("Cluster_row_width_"+m_modLabel_PixLayerIBL2D3D[i]), false); - htitles = makeHisttitle(("Row width of a cluster, "+m_modLabel_PixLayerIBL2D3D[i]), (atext_cluw+atext_nclu), false); - sc = clusterExpert.regHist(m_cluster_row_width_mod[i] = TH1F_LW::create(hname.c_str(), htitles.c_str(), nbins_nwid, min_nwid, max_nwid)); - - hname = makeHistname(("TotalClusters_per_lumi_"+m_modLabel_PixLayerIBL2D3D[i]), false); - htitles = makeHisttitle(("Total number of pixel clusters per LB, "+m_modLabel_PixLayerIBL2D3D[i]), (atext_LB+atext_nclu), false); - sc = clusterExpert.regHist(m_totalclusters_per_lumi_mod[i] = TH1I_LW::create(hname.c_str(), htitles.c_str(), nbins_LB, min_LB, max_LB)); - - hname = makeHistname(("TotalClusters_per_bcid_"+m_modLabel_PixLayerIBL2D3D[i]), false); - htitles = makeHisttitle(("Total number of pixel clusters per BCID, "+m_modLabel_PixLayerIBL2D3D[i]), (atext_LB+atext_nclu), false); - - hname = makeHistname(("Clusters_row_width_per_lumi_"+m_modLabel_PixLayerIBL2D3D[i]), true); - htitles = makeHisttitle("Average row width per LB", (atext_LB+atext_clu), true); - sc = clusterShift.regHist(m_clusters_row_width_per_lumi_mod[i] = TProfile_LW::create(hname.c_str(), htitles.c_str(), nbins_LB, min_LB, max_LB)); - - hname = makeHistname(("Clusters_column_width_per_lumi_"+m_modLabel_PixLayerIBL2D3D[i]), true); - htitles = makeHisttitle("Average column width per LB", (atext_LB+atext_clu), true); - sc = clusterShift.regHist(m_clusters_col_width_per_lumi_mod[i] = TProfile_LW::create(hname.c_str(), htitles.c_str(), nbins_LB, min_LB, max_LB)); - - hname = makeHistname(("Clusters_row_width_per_bcid_"+m_modLabel_PixLayerIBL2D3D[i]), true); - htitles = makeHisttitle("Average row width per BCID", (atext_BCID+atext_clu), true); - sc = clusterShift.regHist(m_clusters_row_width_per_bcid_mod[i] = TProfile_LW::create(hname.c_str(), htitles.c_str(), nbins_BCID, min_BCID, max_BCID)); - - hname = makeHistname(("Clusters_column_width_per_bcid_"+m_modLabel_PixLayerIBL2D3D[i]), true); - htitles = makeHisttitle("Average column width per BCID", (atext_BCID+atext_clu), true); - sc = clusterShift.regHist(m_clusters_col_width_per_bcid_mod[i] = TProfile_LW::create(hname.c_str(), htitles.c_str(), nbins_BCID, min_BCID, max_BCID)); - - hname = makeHistname(("ClusterSize_OnTrack_"+m_modLabel_PixLayerIBL2D3D[i]), false); - htitles = makeHisttitle(("cluster size for clusters on tracks, "+m_modLabel_PixLayerIBL2D3D[i]), ";cluster size;#clusters", false); - sc = clusterExpert.regHist(m_clusize_ontrack_mod[i] = TH1F_LW::create(hname.c_str(), htitles.c_str(), 300, -0.5, -0.5+300.0)); - - hname = makeHistname(("ClusterSize_OffTrack_"+m_modLabel_PixLayerIBL2D3D[i]), false); - htitles = makeHisttitle(("cluster size for clusters out of tracks , "+m_modLabel_PixLayerIBL2D3D[i]), ";cluster size;#clusters", false); - sc = clusterExpert.regHist(m_clusize_offtrack_mod[i] = TH1F_LW::create(hname.c_str(), htitles.c_str(), 300, -0.5, -0.5+300.0)); - } - - if (m_doOnTrack || m_doOnPixelTrack) { - sc = clusterExpert.regHist(m_clustersOnOffTrack_per_lumi = TProfile_LW::create("ClustersOnOffTrack_per_lumi",("Fraction pixel clusters on track per event per LB" + m_histTitleExt + ";lumi block; fraction clusters/event").c_str(),2500,-0.5,2499.5)); - } + if (m_doOnTrack || m_doOnPixelTrack) { + sc = clusterExpert.regHist(m_clustersOnOffTrack_per_lumi = TProfile_LW::create("ClustersOnOffTrack_per_lumi",("Fraction pixel clusters on track per event per LB" + m_histTitleExt + ";lumi block; fraction clusters/event").c_str(),2500,-0.5,2499.5)); + } - if(m_do2DMaps) - { + if (m_do2DMaps) + { tmp = "Cluster_Occupancy"; tmp2 = "Cluster occupancy"; m_cluster_occupancy = new PixelMon2DMaps(tmp.c_str(), (tmp2 + m_histTitleExt).c_str()); 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()); sc = m_cluster_LVL1A_mod->regHist(timeShift); @@ -277,7 +260,7 @@ StatusCode PixelMainMon::BookClustersMon(void) m_clus_LVL1A_sizenot1 = new PixelMonProfiles(tmp.c_str(), (tmp2 + m_histTitleExt).c_str()); sc = m_clus_LVL1A_sizenot1->regHist(timeShift); - if(m_doOnline){ + if (m_doOnline){ tmp = "ClusterMap_Mon"; tmp2 = "Cluster map for monitoring"; m_clustermap_mon = new PixelMon2DMaps(tmp.c_str(), (tmp2 + m_histTitleExt).c_str()); sc = m_clustermap_mon->regHist(clusterShift); @@ -286,52 +269,52 @@ StatusCode PixelMainMon::BookClustersMon(void) m_clustermap_tmp = new PixelMon2DMaps(tmp.c_str(), (tmp2 + m_histTitleExt).c_str()); 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()); - 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()); - 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()); - sc = m_clusToT_map->regHist(clusterExpert); - - - hname = makeHistname("Cluster_Occupancy_FEMap_mon", true); - tmp2 = "Cluster Occ."; - sc = clusterExpert.regHist(m_cluster_occupancy_FE_B0_mon = TH2F_LW::create((hname+"_B0").c_str(), (tmp2 + ", B0 " + ";eta index of FE;phi index of FE").c_str(), 13*8, -48.5, -48.5+(13*8), 22*2, -0.5, -0.5+(22*2))); - - - /// - /// For FE map (temporary) - /// - const int nmod = 13; - const char *mod[nmod] = { "M6C", "M5C", "M4C", "M3C", "M2C", "M1C", "M0","M1A", "M2A", "M3A", "M4A", "M5A", "M6A" } ; - 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" - }; - for(unsigned int x=0 ; x < m_cluster_occupancy_FE_B0_mon->GetNbinsX() ; x++){ - if( x%8 == 0 ) m_cluster_occupancy_FE_B0_mon->GetXaxis()->SetBinLabel( x+1, mod[x/8] ); - } - for(unsigned int y=0 ; y < m_cluster_occupancy_FE_B0_mon->GetNbinsY() ; y++){ - if( y%2 == 0 ) m_cluster_occupancy_FE_B0_mon->GetYaxis()->SetBinLabel( y+1, stave0[y/2] ); - } - m_cluster_occupancy_FE_B0_mon->GetYaxis()->SetLabelSize(0.03); - m_cluster_occupancy_FE_B0_mon->SetOption("colz"); + 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()); + 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()); + 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()); + sc = m_clusToT_map->regHist(clusterExpert); + + + hname = makeHistname("Cluster_Occupancy_FEMap_mon", true); + tmp2 = "Cluster Occ."; + sc = clusterExpert.regHist(m_cluster_occupancy_FE_B0_mon = TH2F_LW::create((hname+"_B0").c_str(), (tmp2 + ", B0 " + ";eta index of FE;phi index of FE").c_str(), 13*8, -48.5, -48.5+(13*8), 22*2, -0.5, -0.5+(22*2))); + + + /// + /// For FE map (temporary) + /// + const int nmod = 13; + const char *mod[nmod] = { "M6C", "M5C", "M4C", "M3C", "M2C", "M1C", "M0","M1A", "M2A", "M3A", "M4A", "M5A", "M6A" } ; + 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" + }; + for(unsigned int x=0 ; x < m_cluster_occupancy_FE_B0_mon->GetNbinsX() ; x++){ + if( x%8 == 0 ) m_cluster_occupancy_FE_B0_mon->GetXaxis()->SetBinLabel( x+1, mod[x/8] ); + } + for(unsigned int y=0 ; y < m_cluster_occupancy_FE_B0_mon->GetNbinsY() ; y++){ + if( y%2 == 0 ) m_cluster_occupancy_FE_B0_mon->GetYaxis()->SetBinLabel( y+1, stave0[y/2] ); + } + m_cluster_occupancy_FE_B0_mon->GetYaxis()->SetLabelSize(0.03); + m_cluster_occupancy_FE_B0_mon->SetOption("colz"); } - } + } - if(m_doModules) - { + 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); - + 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); @@ -340,401 +323,371 @@ StatusCode PixelMainMon::BookClustersMon(void) 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); - } - if(m_doOnline) - { - sc = clusterShift.regHist(m_cluster_occupancy_time1= new TProfile("cluster_occupancy_time_10min", ("Module hit occupancy as function of time over 10 minutes. 6 sec/bin" + m_histTitleExt + ";time;module occupancy").c_str(), 99,0.,1.,"i")); - sc = clusterShift.regHist(m_cluster_occupancy_time2= new TProfile("cluster_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 = clusterShift.regHist(m_cluster_occupancy_time3= new TProfile("cluster_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")); - } - - if(m_doLowOccupancy || m_doHighOccupancy){ - - /// - /// binning - /// - int nbins_clusters = 1000; float max_clusters = 40000.; - int nbins_clusters_region = 200; float max_clusters_region = 8000.; - int nbins_avclusters = 100; float max_avclusters = 50.; - - if(m_doLowOccupancy){ - nbins_clusters = 200; max_clusters = 200.; - nbins_clusters_region = 200; max_clusters_region = 8000.; - nbins_avclusters = 50; max_avclusters = 2.; - } - if (m_doHeavyIonMon) {max_clusters = 100000; max_clusters_region = 40000; max_avclusters = 1000; } - - tmp = "num_clusters"; tmp2 = "Number of pixel clusters in an event"; - if(m_doOnTrack) { tmp = tmp + addOnTrack; tmp2 = tmp2 + addOnTrack; } - tmp = "num_clusters"; tmp2 = "Number of pixel clusters in an event"; - sc = clusterShift.regHist(m_num_clusters = TH1I_LW::create(tmp.c_str(), (tmp2 + ";# pixel clusters/event" + m_histTitleExt + ";# events").c_str(), nbins_clusters, 0., max_clusters)); - - for(int i=0; i<PixLayer::COUNT-1+(int)(m_doIBL); i++){ - - hname = makeHistname(("num_clusters_"+m_modLabel_PixLayerIBL2D3D[i]), false); - tmp2 = "Number of pixel clusters in an event, " + m_modLabel_PixLayerIBL2D3D[i] + m_histTitleExt + ";# pixel clusters/event;# events"; - sc = clusterExpert.regHist(m_num_clusters_mod[i] = TH1I_LW::create(hname.c_str(), tmp2.c_str(), nbins_clusters_region, 0., max_clusters_region)); - - hname = makeHistname(("cluster_occupancy_summary_" + m_modLabel_PixLayerIBL2D3D[i]), true); - tmp2 = "Average cluster occupancy, " + m_modLabel_PixLayerIBL2D3D[i] + m_histTitleExt + ";average # of clusters per module per event;# modules"; - sc = clusterExpert.regHist(m_cluster_occupancy_summary_mod[i]= TH1F_LW::create(hname.c_str(), tmp2.c_str(), nbins_avclusters, 0., max_avclusters)); - - if(m_doOnTrack || m_doOnPixelTrack) { - hname = makeHistname(("num_clusters_per_track_per_lumi_"+m_modLabel_PixLayerIBL2D3D[i]), true); - tmp2 = "Number of pixel clusters in an event, " + m_modLabel_PixLayerIBL2D3D[i] + m_histTitleExt + atext_LB + ";Avg #clusters/track/event"; - sc = clusterExpert.regHist(m_clusters_per_track_per_lumi_mod[i] = TProfile_LW::create(hname.c_str(), tmp2.c_str(), nbins_LB, min_LB, max_LB)); - } - - } - - } - //if(m_doLowOccupancy) - //{ - // tmp = "num_clusters_low_occupancy"; tmp2 = "Number of pixel clusters in an event"; - // if(m_doOnTrack) { tmp = tmp + addOnTrack; tmp2 = tmp2 + addOnTrack; } - // sc = clusterShift.regHist(m_num_clusters_low = TH1I_LW::create(tmp.c_str(), (tmp2 + m_histTitleExt + ";# pixel clusters/event;# events").c_str(), 200,-0.5,199.5)); - // - // for(int i=0; i<PixLayer::COUNT-1+(int)(m_doIBL); i++){ - // hname = makeHistname(("cluster_occupancy_summary_low_occupancy_" + m_modLabel_PixLayerIBL2D3D[i]), true); - // tmp2 = "Average cluster occupancy, " + m_modLabel_PixLayerIBL2D3D[i] + m_histTitleExt + ";average # of clusters per module per event;# modules"; - // sc = clusterExpert.regHist(m_cluster_occupancy_summary_low_mod[i]= TH1F_LW::create(hname.c_str(), tmp2.c_str(), 50, 0., 2.)); - // } - //} - - /// Quick Status - if(m_doOfflineAnalysis){ - if(m_do2DMaps && !m_doOnline){ - /// - /// Study for Quick Status - /// - //hname = makeHistname("Cluster_Occupamcy_L0_B11_S2_C6", true); - //tmp2 = "Cluster Occupancy., L0_B11_S2_C6;lumi block;FE ID (8*(pix_phi/164) + (eta_pix/18);# clusters"; - //sc = clusterExpert.regHist(m_cluster_occupancy_FE_L0_B11_S2_C6 = TH2F_LW::create((hname+"_L0_B11_S2_C6").c_str(), tmp2.c_str(), nbins_LB, min_LB, max_LB, 16, -0.5, -0.5+16)); - //m_cluster_occupancy_FE_L0_B11_S2_C6->SetOption("colz"); - - //hname = makeHistname("Cluster_Occupamcy_isGood_L0_B11_S2_C6", true); - //tmp2 = "Cluster Occupancy., L0_B11_S2_C6(isGood);lumi block;FE ID (8*(pix_phi/164) + (eta_pix/18);# clusters"; - //sc = clusterExpert.regHist(m_cluster_occupancy_isgood_FE_L0_B11_S2_C6 = TH2F_LW::create((hname+"_L0_B11_S2_C6").c_str(), tmp2.c_str(), nbins_LB, min_LB, max_LB, 16, -0.5, -0.5+16)); - //m_cluster_occupancy_isgood_FE_L0_B11_S2_C6->SetOption("colz"); - - //hname = makeHistname("Cluster_ToTMean_L0_B11_S2_C6", true); - //tmp2 = "Cluster ToT Mean, L0_B11_S2_C6;lumi block;FE ID (8*(pix_phi/164) + (eta_pix/18);Mean Cluster ToT"; - //sc = clusterExpert.regHist(m_cluster_totmean_L0_B11_S2_C6 = TProfile2D_LW::create((hname+"_L0_B11_S2_C6").c_str(), tmp2.c_str(), nbins_LB, min_LB, max_LB, 16, -0.5, -0.5+16)); - //m_cluster_totmean_L0_B11_S2_C6->SetOption("colz"); - } - if(m_doOnTrack || m_doOnPixelTrack) { - hname = makeHistname("Clusters_onTrack_per_lumi_L0_B11_S2_C6", false); - htitles = makeHisttitle("Number of clusters on track, L0_B11_S2_C6", ";lumi block;FE ID (16*(6-eta_mod) + 8*(pix_phi/164) + (eta_pix/18);#hits", false); - sc = clusterExpert.regHist(m_clusters_onTrack_L0_B11_S2_C6 = TH2F_LW::create(hname.c_str(), htitles.c_str(), nbins_LB, min_LB, max_LB, 96, -0.5, -0.5+96)); - m_clusters_onTrack_L0_B11_S2_C6->SetOption("colz"); - - hname = makeHistname("Clusters_offTrack_per_lumi_L0_B11_S2_C6", false); - htitles = makeHisttitle("Number of clusters not on track, L0_B11_S2_C6", ";lumi block;FE ID (16*(6-eta_mod) + 8*(pix_phi/164) + (eta_pix/18);#hits", false); - sc = clusterExpert.regHist(m_clusters_offTrack_L0_B11_S2_C6 = TH2F_LW::create(hname.c_str(), htitles.c_str(), nbins_LB, min_LB, max_LB, 96, -0.5, -0.5+96)); - m_clusters_offTrack_L0_B11_S2_C6->SetOption("colz"); - } - } - + } + if (m_doOnline) + { + sc = clusterShift.regHist(m_cluster_occupancy_time1= new TProfile("cluster_occupancy_time_10min", ("Module hit occupancy as function of time over 10 minutes. 6 sec/bin" + m_histTitleExt + ";time;module occupancy").c_str(), 99,0.,1.,"i")); + sc = clusterShift.regHist(m_cluster_occupancy_time2= new TProfile("cluster_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 = clusterShift.regHist(m_cluster_occupancy_time3= new TProfile("cluster_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")); + } + + if (m_doLowOccupancy || m_doHighOccupancy) { + + /// + /// binning + /// + int nbins_clusters = 1000; float max_clusters = 40000.; + int nbins_clusters_region = 200; float max_clusters_region = 8000.; + int nbins_avclusters = 100; float max_avclusters = 50.; + + if(m_doLowOccupancy){ + nbins_clusters = 200; max_clusters = 200.; + nbins_clusters_region = 200; max_clusters_region = 8000.; + nbins_avclusters = 50; max_avclusters = 2.; + } + if (m_doHeavyIonMon) {max_clusters = 100000; max_clusters_region = 40000; max_avclusters = 1000; } + + tmp = "num_clusters"; tmp2 = "Number of pixel clusters in an event"; + if (m_doOnTrack) { tmp = tmp + addOnTrack; tmp2 = tmp2 + addOnTrack; } + tmp = "num_clusters"; tmp2 = "Number of pixel clusters in an event"; + sc = clusterShift.regHist(m_num_clusters = TH1I_LW::create(tmp.c_str(), (tmp2 + ";# pixel clusters/event" + m_histTitleExt + ";# events").c_str(), nbins_clusters, 0., max_clusters)); + + for(int i=0; i<PixLayer::COUNT-1+(int)(m_doIBL); i++){ + + hname = makeHistname(("num_clusters_"+m_modLabel_PixLayerIBL2D3D[i]), false); + tmp2 = "Number of pixel clusters in an event, " + m_modLabel_PixLayerIBL2D3D[i] + m_histTitleExt + ";# pixel clusters/event;# events"; + sc = clusterExpert.regHist(m_num_clusters_mod[i] = TH1I_LW::create(hname.c_str(), tmp2.c_str(), nbins_clusters_region, 0., max_clusters_region)); + + hname = makeHistname(("cluster_occupancy_summary_" + m_modLabel_PixLayerIBL2D3D[i]), true); + tmp2 = "Average cluster occupancy, " + m_modLabel_PixLayerIBL2D3D[i] + m_histTitleExt + ";average # of clusters per module per event;# modules"; + sc = clusterExpert.regHist(m_cluster_occupancy_summary_mod[i]= TH1F_LW::create(hname.c_str(), tmp2.c_str(), nbins_avclusters, 0., max_avclusters)); - if(sc.isFailure())if(msgLvl(MSG::WARNING)) msg(MSG::WARNING) << "histograms not booked" << endmsg; - return StatusCode::SUCCESS; + if(m_doOnTrack || m_doOnPixelTrack) { + hname = makeHistname(("num_clusters_per_track_per_lumi_"+m_modLabel_PixLayerIBL2D3D[i]), true); + tmp2 = "Number of pixel clusters in an event, " + m_modLabel_PixLayerIBL2D3D[i] + m_histTitleExt + atext_LB + ";Avg #clusters/track/event"; + sc = clusterExpert.regHist(m_clusters_per_track_per_lumi_mod[i] = TProfile_LW::create(hname.c_str(), tmp2.c_str(), nbins_LB, min_LB, max_LB)); + } + + } + + } + + /// Quick Status + if (m_doOfflineAnalysis) { + if (m_doOnTrack || m_doOnPixelTrack) { + hname = makeHistname("Clusters_onTrack_per_lumi_L0_B11_S2_C6", false); + htitles = makeHisttitle("Number of clusters on track, L0_B11_S2_C6", ";lumi block;FE ID (16*(6-eta_mod) + 8*(pix_phi/164) + (eta_pix/18);#hits", false); + sc = clusterExpert.regHist(m_clusters_onTrack_L0_B11_S2_C6 = TH2F_LW::create(hname.c_str(), htitles.c_str(), nbins_LB, min_LB, max_LB, 96, -0.5, -0.5+96)); + m_clusters_onTrack_L0_B11_S2_C6->SetOption("colz"); + + hname = makeHistname("Clusters_offTrack_per_lumi_L0_B11_S2_C6", false); + htitles = makeHisttitle("Number of clusters not on track, L0_B11_S2_C6", ";lumi block;FE ID (16*(6-eta_mod) + 8*(pix_phi/164) + (eta_pix/18);#hits", false); + sc = clusterExpert.regHist(m_clusters_offTrack_L0_B11_S2_C6 = TH2F_LW::create(hname.c_str(), htitles.c_str(), nbins_LB, min_LB, max_LB, 96, -0.5, -0.5+96)); + m_clusters_offTrack_L0_B11_S2_C6->SetOption("colz"); + } + } + + + if ( sc.isFailure() && msgLvl(MSG::WARNING) ) msg(MSG::WARNING) << "Pixel cluster monitoring histograms not booked" << endmsg; + return StatusCode::SUCCESS; } StatusCode PixelMainMon::BookClustersLumiBlockMon(void) { - if(msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "starting Book Clusters for lowStat" << endmsg; - - std::string path = "Pixel/LumiBlock"; - if(m_doOnTrack) path.replace(path.begin(), path.end(), "Pixel/LumiBlockOnTrack"); - if(m_doOnPixelTrack) path.replace(path.begin(), path.end(), "Pixel/LumiBlockOnPixelTrack"); - MonGroup lumiBlockHist( this, path.c_str(), lowStat, ATTRIB_MANAGED); //declare a group of histograms - - 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()); - sc = m_cluster_occupancy_LB->regHist(lumiBlockHist); - } - if(m_doLowOccupancy || m_doHighOccupancy) { - int nbins_nclusters = 150; double min_nclusters = -0.5; double max_nclusters = min_nclusters + 15000.0; - if(m_doLowOccupancy) { nbins_nclusters = 200; max_nclusters = min_nclusters + 200.0;} - sc = lumiBlockHist.regHist(m_num_clusters_LB = TH1I_LW::create("num_clusters_LB", ("Number of pixel clusters per event" + m_histTitleExt + ";# pixel clusters/event;# events").c_str(), nbins_nclusters, min_nclusters, max_nclusters)); - } - - 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); - 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); - } - - if(sc.isFailure())if(msgLvl(MSG::WARNING)) msg(MSG::WARNING) << "histograms not booked" << endmsg; - return StatusCode::SUCCESS; + if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "starting Book Clusters for lowStat" << endmsg; + + std::string path = "Pixel/LumiBlock"; + if (m_doOnTrack) path.replace(path.begin(), path.end(), "Pixel/LumiBlockOnTrack"); + if (m_doOnPixelTrack) path.replace(path.begin(), path.end(), "Pixel/LumiBlockOnPixelTrack"); + MonGroup lumiBlockHist( this, path.c_str(), lowStat, ATTRIB_MANAGED); //declare a group of histograms + + 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()); + sc = m_cluster_occupancy_LB->regHist(lumiBlockHist); + } + if (m_doLowOccupancy || m_doHighOccupancy) { + int nbins_nclusters = 150; double min_nclusters = -0.5; double max_nclusters = min_nclusters + 15000.0; + if(m_doLowOccupancy) { nbins_nclusters = 200; max_nclusters = min_nclusters + 200.0;} + sc = lumiBlockHist.regHist(m_num_clusters_LB = TH1I_LW::create("num_clusters_LB", ("Number of pixel clusters per event" + m_histTitleExt + ";# pixel clusters/event;# events").c_str(), nbins_nclusters, min_nclusters, max_nclusters)); + } + + 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); + 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); + } + + if (sc.isFailure() && msgLvl(MSG::WARNING) ) msg(MSG::WARNING) << "Per LB pixel cluster monitoring histograms not booked" << endmsg; + return StatusCode::SUCCESS; } - + StatusCode PixelMainMon::FillClustersMon(void) { - sc = evtStore()->retrieve(m_Pixel_clcontainer, m_Pixel_SiClustersName); - if (sc.isFailure() || !m_Pixel_clcontainer) - { - if(msgLvl(MSG::INFO)) msg(MSG::INFO) <<"Pixel Cluster container for Pixels not found"<< endmsg; - if(m_storegate_errors) m_storegate_errors->Fill(3.,3.); + sc = evtStore()->retrieve(m_Pixel_clcontainer, m_Pixel_SiClustersName); + if (sc.isFailure() || !m_Pixel_clcontainer) + { + if (msgLvl(MSG::INFO)) msg(MSG::INFO) <<"Pixel Cluster container for Pixels not found"<< endmsg; + if (m_storegate_errors) m_storegate_errors->Fill(3.,3.); return StatusCode::SUCCESS; - } else { - if(msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) <<"Pixel Cluster container for Pixels found" <<endmsg; - } - - int nclusters=0; - int nclusters_mod[PixLayer::COUNT] = {0}; - int nlargeclusters=0; - int nverylargeclusters=0; - int nclusters_all=0; - int nclusters_ontrack=0; - - if (m_doModules){ - if(m_doIBL){ - for(int i=0;i<20;i++){ - for(int j=0;j<14;j++) m_ClusPerEventArray_lI[j][i]=0; - } + } else { + if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) <<"Pixel Cluster container for Pixels found" <<endmsg; + } + + int nclusters=0; + int nclusters_mod[PixLayer::COUNT] = {0}; + int nlargeclusters=0; + int nverylargeclusters=0; + int nclusters_all=0; + int nclusters_ontrack=0; + + if (m_doModules){ + if(m_doIBL){ + for(int i=0;i<20;i++){ + for(int j=0;j<14;j++) m_ClusPerEventArray_lI[j][i]=0; } - for(int i=0;i<13;i++){ - for(int j=0;j<22;j++) m_ClusPerEventArray_l0[j][i]=0; - for(int j=0;j<38;j++) m_ClusPerEventArray_l1[j][i]=0; - for(int j=0;j<52;j++) m_ClusPerEventArray_l2[j][i]=0; - } - for(int j=0;j<3;j++){ - for(int i=0;i<48;i++){ - m_ClusPerEventArray_disksA[i][j]=0; - m_ClusPerEventArray_disksC[i][j]=0; - } - } - }//end Initialize - - Identifier clusID; - IdentifierHash id_hash; - InDet::PixelClusterContainer::const_iterator colNext = m_Pixel_clcontainer->begin(); - InDet::PixelClusterContainer::const_iterator lastCol = m_Pixel_clcontainer->end(); - DataVector<PixelCluster>::const_iterator p_clus; - - for (; colNext != lastCol; ++colNext) - { + } + for(int i=0;i<13;i++){ + for(int j=0;j<22;j++) m_ClusPerEventArray_l0[j][i]=0; + for(int j=0;j<38;j++) m_ClusPerEventArray_l1[j][i]=0; + for(int j=0;j<52;j++) m_ClusPerEventArray_l2[j][i]=0; + } + for(int j=0;j<3;j++){ + for(int i=0;i<48;i++){ + m_ClusPerEventArray_disksA[i][j]=0; + m_ClusPerEventArray_disksC[i][j]=0; + } + } + } + + Identifier clusID; + InDet::PixelClusterContainer::const_iterator colNext = m_Pixel_clcontainer->begin(); + InDet::PixelClusterContainer::const_iterator lastCol = m_Pixel_clcontainer->end(); + DataVector<PixelCluster>::const_iterator p_clus; + + for (; colNext != lastCol; ++colNext) + { const InDet::PixelClusterCollection* ClusterCollection(*colNext); if (!ClusterCollection) - { - if(m_storegate_errors) m_storegate_errors->Fill(3.,5.); //first entry (1). is for RDO, second (4) is for data problem - continue; - } + { + if(m_storegate_errors) m_storegate_errors->Fill(3.,5.); //first entry (1). is for RDO, second (4) is for data problem + continue; + } for(p_clus=ClusterCollection->begin(); p_clus!=ClusterCollection->end(); ++p_clus) - { - clusID=(*p_clus)->identify(); - id_hash = m_pixelid->wafer_hash(clusID); - int pixlayer = GetPixLayerID(m_pixelid->barrel_ec(clusID), m_pixelid->layer_disk(clusID), m_doIBL); - int pixlayerdbm = GetPixLayerIDDBM(m_pixelid->barrel_ec(clusID), m_pixelid->layer_disk(clusID), m_doIBL); - int pixlayeribl2d3d = pixlayer; - if( pixlayeribl2d3d == PixLayerIBL2D3D::kIBL ){ - pixlayeribl2d3d = GetPixLayerIDIBL2D3D(m_pixelid->barrel_ec(clusID), m_pixelid->layer_disk(clusID), m_pixelid->eta_module(clusID), m_doIBL); - } - int pixlayeribl2d3ddbm = pixlayerdbm; - if( pixlayeribl2d3ddbm == PixLayerDBM::kIBL ){ - pixlayeribl2d3ddbm = GetPixLayerIDIBL2D3DDBM(m_pixelid->barrel_ec(clusID), m_pixelid->layer_disk(clusID), m_pixelid->eta_module(clusID), m_doIBL); - } - if(pixlayer == 99) continue; - - //std::cout << id_hash << std::endl; - - int lumiblock = m_manager->lumiBlockNumber(); - - const PixelCluster& cluster = **p_clus; - const InDet::SiWidth clusWidth = cluster.width(); - - //note: description is wrong in SiWidth! <x,y> = <row,col> - int npixHitsInClusterRaw = cluster.rdoList().size(); - int npixHitsInCluster = cluster.rdoList().size(); - if( npixHitsInCluster > m_cluster_groupsize_mod[pixlayer]->getXMax()){ - npixHitsInCluster = (int)(m_cluster_groupsize_mod[pixlayer]->getXMax()-0.5); - } - int colWidth = clusWidth.colRow().y(); - int rowWidth = clusWidth.colRow().x(); - - - nclusters_all++; // count all clusters for ontrack - - - /// Quick Status - int fephi=0; - int feeta=0; - if ( m_doOfflineAnalysis ) { - if ( pixlayer == PixLayer::kB0 && GetFEID( pixlayer, m_pixelid->phi_index(clusID), m_pixelid->eta_index(clusID), fephi, feeta) ) { - if ( m_doOnTrack || m_doOnPixelTrack ) { - if ( m_pixelid->phi_module(clusID) == 0 && m_pixelid->eta_module(clusID) < 0 ) { - if ( OnTrack(clusID,true) ) { - if ( m_clusters_onTrack_L0_B11_S2_C6 ) m_clusters_onTrack_L0_B11_S2_C6->Fill( m_manager->lumiBlockNumber(), (16*fabs(6+m_pixelid->eta_module(clusID)))+(8.0*fephi)+feeta ); - } else { - if ( m_clusters_offTrack_L0_B11_S2_C6 ) m_clusters_offTrack_L0_B11_S2_C6->Fill( m_manager->lumiBlockNumber(), (16*fabs(6+m_pixelid->eta_module(clusID)))+(8.0*fephi)+feeta ); - } - } - } - } - } - - if( (m_doOnTrack || m_doOnPixelTrack) && !OnTrack(clusID,true) ){ - continue; - /// if we only want hits on track, and the hit is NOT on the track, skip filling. - /// true means doing clusters, false means rdos - } - - - nclusters_ontrack++; - - - ////////////////////////////////////////////////////// - /////////////Start main fill block here/////////////// - //be sure to check each histo exists before filling it - ////////////////////////////////////////////////////// - - //if( m_currentBCID != ) continue; - /// - /// 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(pixlayer != PixLayer::kIBL){ - if(cluster.totalToT() > 15 && m_cluster_LVL1A1d_mod[pixlayer]) m_cluster_LVL1A1d_mod[pixlayer]->Fill(cluster.LVL1A()); - }else{ - if(cluster.totalToT() > 4 && m_cluster_LVL1A1d_mod[pixlayer]) m_cluster_LVL1A1d_mod[pixlayer]->Fill(cluster.LVL1A()); - } - - /// - /// Fill ToT - /// - if(m_cluster_ToT_mod) m_cluster_ToT_mod->Fill(cluster.totalToT(),clusID,m_pixelid,m_doIBL); - if(m_cluster_ToT1d_mod[pixlayerdbm]) m_cluster_ToT1d_mod[pixlayerdbm]->Fill(cluster.totalToT()); - if(pixlayerdbm == PixLayerDBM::kIBL && m_cluster_ToT1d_mod[pixlayeribl2d3ddbm]) m_cluster_ToT1d_mod[pixlayeribl2d3ddbm]->Fill(cluster.totalToT()); - 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()); - if(cluster.rdoList().size()==3 && m_3cluster_ToT_mod[pixlayer] ) m_3cluster_ToT_mod[pixlayer]->Fill(cluster.totalToT()); - if(cluster.rdoList().size()>3 && m_bigcluster_ToT_mod[pixlayer] ) m_bigcluster_ToT_mod[pixlayer]->Fill(cluster.totalToT()); - - /// - /// Fill Charge - /// - if(m_cluster_Q_mod[pixlayerdbm]) m_cluster_Q_mod[pixlayerdbm]->Fill(cluster.totalCharge()); - if(pixlayerdbm == PixLayerDBM::kIBL && m_cluster_Q_mod[pixlayeribl2d3ddbm]) m_cluster_Q_mod[pixlayeribl2d3ddbm]->Fill(cluster.totalCharge()); - if(cluster.rdoList().size()==1 && m_1cluster_Q_mod[pixlayer] ) m_1cluster_Q_mod[pixlayer]->Fill(cluster.totalCharge()); - if(cluster.rdoList().size()==2 && m_2cluster_Q_mod[pixlayer] ) m_2cluster_Q_mod[pixlayer]->Fill(cluster.totalCharge()); - if(cluster.rdoList().size()==3 && m_3cluster_Q_mod[pixlayer] ) m_3cluster_Q_mod[pixlayer]->Fill(cluster.totalCharge()); - if(cluster.rdoList().size()> 3 && m_bigcluster_Q_mod[pixlayer] ) m_bigcluster_Q_mod[pixlayer]->Fill(cluster.totalCharge()); - - /// - /// 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_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_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); - } - - /// - /// Fill the number of pixel hits in a cluster - /// - if(m_cluster_groupsize) m_cluster_groupsize->Fill(npixHitsInClusterRaw); - if(m_cluster_col_width) m_cluster_col_width->Fill(colWidth); - if(m_cluster_row_width) m_cluster_row_width->Fill(rowWidth); - if(m_clusterSize_eta && m_pixelid->barrel_ec(clusID)==0 ) m_clusterSize_eta->Fill(m_pixelid->eta_module(clusID), npixHitsInClusterRaw); - if(m_cluster_groupsize_mod[pixlayer]) m_cluster_groupsize_mod[pixlayer]->Fill( npixHitsInCluster ); - if(pixlayer == PixLayer::kIBL && m_cluster_groupsize_mod[pixlayeribl2d3d]) m_cluster_groupsize_mod[pixlayeribl2d3d]->Fill( npixHitsInCluster ); - if(m_cluster_col_width_mod[pixlayer]) m_cluster_col_width_mod[pixlayer]->Fill( colWidth ); - if(pixlayer == PixLayer::kIBL && m_cluster_col_width_mod[pixlayeribl2d3d]) m_cluster_col_width_mod[pixlayeribl2d3d]->Fill( colWidth ); - if(m_cluster_row_width_mod[pixlayer]) m_cluster_row_width_mod[pixlayer]->Fill( rowWidth ); - if(pixlayer == PixLayer::kIBL && m_cluster_row_width_mod[pixlayeribl2d3d]) m_cluster_row_width_mod[pixlayeribl2d3d]->Fill( rowWidth ); - if(m_clusters_col_width_per_lumi_mod[pixlayer]) m_clusters_col_width_per_lumi_mod[pixlayer]->Fill(m_manager->lumiBlockNumber(), colWidth); - if(pixlayer == PixLayer::kIBL && m_clusters_col_width_per_lumi_mod[pixlayeribl2d3d]) m_clusters_col_width_per_lumi_mod[pixlayeribl2d3d]->Fill(lumiblock, colWidth); - if(m_clusters_row_width_per_lumi_mod[pixlayer]) m_clusters_row_width_per_lumi_mod[pixlayer]->Fill(m_manager->lumiBlockNumber(), rowWidth); - if(pixlayer == PixLayer::kIBL && m_clusters_row_width_per_lumi_mod[pixlayeribl2d3d]) m_clusters_row_width_per_lumi_mod[pixlayeribl2d3d]->Fill(lumiblock, rowWidth); - if(m_clusters_col_width_per_bcid_mod[pixlayer]) m_clusters_col_width_per_bcid_mod[pixlayer]->Fill(1.0*m_currentBCID, colWidth); - if(pixlayer == PixLayer::kIBL && m_clusters_col_width_per_bcid_mod[pixlayeribl2d3d]) m_clusters_col_width_per_bcid_mod[pixlayeribl2d3d]->Fill(1.0*m_currentBCID, colWidth); - if(m_clusters_row_width_per_bcid_mod[pixlayer]) m_clusters_row_width_per_bcid_mod[pixlayer]->Fill(1.0*m_currentBCID, rowWidth); - if(pixlayer == PixLayer::kIBL && m_clusters_row_width_per_bcid_mod[pixlayeribl2d3d]) m_clusters_row_width_per_bcid_mod[pixlayeribl2d3d]->Fill(1.0*m_currentBCID, rowWidth); - - - /// - /// Total Number of Clusters - /// - if(m_totalclusters_per_lumi) m_totalclusters_per_lumi->Fill(lumiblock); - if(m_totalclusters_per_lumi_mod[pixlayer] ) m_totalclusters_per_lumi_mod[pixlayer]->Fill( lumiblock ); - if(pixlayer == PixLayer::kIBL && m_totalclusters_per_lumi_mod[pixlayeribl2d3d] ) m_totalclusters_per_lumi_mod[pixlayeribl2d3d]->Fill( lumiblock ); - if(m_totalclusters_per_bcid_mod[pixlayer] ) m_totalclusters_per_bcid_mod[pixlayer]->Fill( 1.0*m_currentBCID ); - if(pixlayer == PixLayer::kIBL && m_totalclusters_per_bcid_mod[pixlayeribl2d3d] ) m_totalclusters_per_bcid_mod[pixlayeribl2d3d]->Fill( 1.0*m_currentBCID ); - - /// - /// Fill Occupancy - /// - if(m_cluster_occupancy) m_cluster_occupancy->Fill(clusID,m_pixelid,m_doIBL); - 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); - - /// 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_cluster_size_mod)m_cluster_size_mod->Fill(cluster.rdoList().size(),clusID,m_pixelid,m_doIBL); - - 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()); - if(m_clussize_vs_eta_mod[pixlayer]) m_clussize_vs_eta_mod[pixlayer]->Fill( 1.0*m_pixelid->eta_module(clusID), cluster.rdoList().size() ); - - - nclusters++; - nclusters_mod[pixlayer]++; - if(cluster.rdoList().size() > 10) nlargeclusters++; - if(cluster.rdoList().size() > 50) nverylargeclusters++; - - if (m_doModules)//fill module cluster arrays - { - if(m_pixelid->barrel_ec(clusID)==2 ) m_ClusPerEventArray_disksA[m_pixelid->phi_module(clusID)][m_pixelid->layer_disk(clusID)]++; - if(m_pixelid->barrel_ec(clusID)==-2) m_ClusPerEventArray_disksC[m_pixelid->phi_module(clusID)][m_pixelid->layer_disk(clusID)]++; - if(m_pixelid->barrel_ec(clusID)==0 ) - { - if(m_doIBL && m_pixelid->layer_disk(clusID)==0) m_ClusPerEventArray_lI[m_pixelid->phi_module(clusID)][m_pixelid->eta_module(clusID)+10]++; - if(m_pixelid->layer_disk(clusID)==0+m_doIBL) m_ClusPerEventArray_l0[m_pixelid->phi_module(clusID)][m_pixelid->eta_module(clusID)+6]++; - if(m_pixelid->layer_disk(clusID)==1+m_doIBL) m_ClusPerEventArray_l1[m_pixelid->phi_module(clusID)][m_pixelid->eta_module(clusID)+6]++; - if(m_pixelid->layer_disk(clusID)==2+m_doIBL) m_ClusPerEventArray_l2[m_pixelid->phi_module(clusID)][m_pixelid->eta_module(clusID)+6]++; - } - } - - if (m_doLumiBlock) { - if (m_cluster_occupancy_LB) m_cluster_occupancy_LB->Fill(clusID,m_pixelid,m_doIBL); - 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); + { + clusID=(*p_clus)->identify(); + int pixlayer = GetPixLayerID(m_pixelid->barrel_ec(clusID), m_pixelid->layer_disk(clusID), m_doIBL); + + int pixlayeribl2d3d = pixlayer; + if( pixlayeribl2d3d == PixLayerIBL2D3D::kIBL ){ + pixlayeribl2d3d = GetPixLayerIDIBL2D3D(m_pixelid->barrel_ec(clusID), m_pixelid->layer_disk(clusID), m_pixelid->eta_module(clusID), m_doIBL); + } + + if(pixlayer == 99) continue; + + int lumiblock = m_manager->lumiBlockNumber(); + + const PixelCluster& cluster = **p_clus; + const InDet::SiWidth clusWidth = cluster.width(); + + //note: description is wrong in SiWidth! <x,y> = <row,col> + int npixHitsInClusterRaw = cluster.rdoList().size(); + int npixHitsInCluster = cluster.rdoList().size(); + if( npixHitsInCluster > m_cluster_groupsize_mod[pixlayer]->getXMax()){ + npixHitsInCluster = (int)(m_cluster_groupsize_mod[pixlayer]->getXMax()-0.5); + } + int colWidth = clusWidth.colRow().y(); + int rowWidth = clusWidth.colRow().x(); + + nclusters_all++; // count all clusters for ontrack + + /// Quick Status + int fephi=0; + int feeta=0; + if ( m_doOfflineAnalysis ) { + if ( pixlayer == PixLayer::kB0 && GetFEID( pixlayer, m_pixelid->phi_index(clusID), m_pixelid->eta_index(clusID), fephi, feeta) ) { + if ( m_doOnTrack || m_doOnPixelTrack ) { + if ( m_pixelid->phi_module(clusID) == 0 && m_pixelid->eta_module(clusID) < 0 ) { + if ( OnTrack(clusID,true) ) { + if ( m_clusters_onTrack_L0_B11_S2_C6 ) m_clusters_onTrack_L0_B11_S2_C6->Fill( m_manager->lumiBlockNumber(), (16*fabs(6+m_pixelid->eta_module(clusID)))+(8.0*fephi)+feeta ); + } else { + if ( m_clusters_offTrack_L0_B11_S2_C6 ) m_clusters_offTrack_L0_B11_S2_C6->Fill( m_manager->lumiBlockNumber(), (16*fabs(6+m_pixelid->eta_module(clusID)))+(8.0*fephi)+feeta ); + } + } } - - /// Quick Status - fephi=0; - feeta=0; - if( pixlayer == PixLayer::kB0 && GetFEID( pixlayer, m_pixelid->phi_index(clusID), m_pixelid->eta_index(clusID), fephi, feeta) ){ - if(m_doOnline){ - if(m_cluster_occupancy_FE_B0_mon) m_cluster_occupancy_FE_B0_mon->Fill( (8.0*m_pixelid->eta_module(clusID))+(1.0*feeta), (2.0*m_pixelid->phi_module(clusID))+(1.0*fephi)); - if(m_doRefresh5min && m_cluster_occupancy_FE_B0_mon) m_cluster_occupancy_FE_B0_mon->Reset(); } - } + } + + if( (m_doOnTrack || m_doOnPixelTrack) && !OnTrack(clusID,true) ){ + continue; + /// if we only want hits on track, and the hit is NOT on the track, skip filling. + /// true means doing clusters, false means rdos + } + + + nclusters_ontrack++; + + + ////////////////////////////////////////////////////// + /////////////Start main fill block here/////////////// + //be sure to check each histo exists before filling it + ////////////////////////////////////////////////////// + + //if( m_currentBCID != ) continue; + /// + /// 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 (pixlayer != PixLayer::kIBL) { + if (cluster.totalToT() > 15 && m_cluster_LVL1A1d_mod[pixlayer]) m_cluster_LVL1A1d_mod[pixlayer]->Fill(cluster.LVL1A()); + } else { + if (cluster.totalToT() > 4 && m_cluster_LVL1A1d_mod[pixlayer]) m_cluster_LVL1A1d_mod[pixlayer]->Fill(cluster.LVL1A()); + } + + /// + /// Fill ToT + /// + if (m_cluster_ToT_mod) m_cluster_ToT_mod->Fill(cluster.totalToT(),clusID,m_pixelid,m_doIBL); + + if (m_cluster_ToT1d_mod[pixlayer]) m_cluster_ToT1d_mod[pixlayer]->Fill(cluster.totalToT()); + if (pixlayer == PixLayer::kIBL && m_cluster_ToT1d_mod[pixlayeribl2d3d]) m_cluster_ToT1d_mod[pixlayeribl2d3d]->Fill(cluster.totalToT()); + + 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()); + if (cluster.rdoList().size()==3 && m_3cluster_ToT_mod[pixlayer] ) m_3cluster_ToT_mod[pixlayer]->Fill(cluster.totalToT()); + if (cluster.rdoList().size()>3 && m_bigcluster_ToT_mod[pixlayer] ) m_bigcluster_ToT_mod[pixlayer]->Fill(cluster.totalToT()); + + /// + /// Fill Charge + /// + if (m_cluster_Q_mod[pixlayer]) m_cluster_Q_mod[pixlayer]->Fill(cluster.totalCharge()); + if (pixlayer == PixLayer::kIBL && m_cluster_Q_mod[pixlayeribl2d3d]) m_cluster_Q_mod[pixlayeribl2d3d]->Fill(cluster.totalCharge()); + + if (cluster.rdoList().size()==1 && m_1cluster_Q_mod[pixlayer] ) m_1cluster_Q_mod[pixlayer]->Fill(cluster.totalCharge()); + if (cluster.rdoList().size()==2 && m_2cluster_Q_mod[pixlayer] ) m_2cluster_Q_mod[pixlayer]->Fill(cluster.totalCharge()); + if (cluster.rdoList().size()==3 && m_3cluster_Q_mod[pixlayer] ) m_3cluster_Q_mod[pixlayer]->Fill(cluster.totalCharge()); + if (cluster.rdoList().size()> 3 && m_bigcluster_Q_mod[pixlayer] ) m_bigcluster_Q_mod[pixlayer]->Fill(cluster.totalCharge()); + + /// + /// 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_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_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); + } + + /// + /// Fill the number of pixel hits in a cluster + /// + if (m_cluster_groupsize) m_cluster_groupsize->Fill(npixHitsInClusterRaw); + if (m_cluster_col_width) m_cluster_col_width->Fill(colWidth); + if (m_cluster_row_width) m_cluster_row_width->Fill(rowWidth); + if (m_clusterSize_eta && m_pixelid->barrel_ec(clusID)==0 ) m_clusterSize_eta->Fill(m_pixelid->eta_module(clusID), npixHitsInClusterRaw); + + if (m_cluster_groupsize_mod[pixlayer]) m_cluster_groupsize_mod[pixlayer]->Fill( npixHitsInCluster ); + if (pixlayer == PixLayer::kIBL && m_cluster_groupsize_mod[pixlayeribl2d3d]) m_cluster_groupsize_mod[pixlayeribl2d3d]->Fill( npixHitsInCluster ); + + if (m_cluster_col_width_mod[pixlayer]) m_cluster_col_width_mod[pixlayer]->Fill( colWidth ); + if (pixlayer == PixLayer::kIBL && m_cluster_col_width_mod[pixlayeribl2d3d]) m_cluster_col_width_mod[pixlayeribl2d3d]->Fill( colWidth ); + + if (m_cluster_row_width_mod[pixlayer]) m_cluster_row_width_mod[pixlayer]->Fill( rowWidth ); + if (pixlayer == PixLayer::kIBL && m_cluster_row_width_mod[pixlayeribl2d3d]) m_cluster_row_width_mod[pixlayeribl2d3d]->Fill( rowWidth ); + + if (m_clusters_col_width_per_lumi_mod[pixlayer]) m_clusters_col_width_per_lumi_mod[pixlayer]->Fill(m_manager->lumiBlockNumber(), colWidth); + if (pixlayer == PixLayer::kIBL && m_clusters_col_width_per_lumi_mod[pixlayeribl2d3d]) m_clusters_col_width_per_lumi_mod[pixlayeribl2d3d]->Fill(lumiblock, colWidth); + + if (m_clusters_row_width_per_lumi_mod[pixlayer]) m_clusters_row_width_per_lumi_mod[pixlayer]->Fill(m_manager->lumiBlockNumber(), rowWidth); + if (pixlayer == PixLayer::kIBL && m_clusters_row_width_per_lumi_mod[pixlayeribl2d3d]) m_clusters_row_width_per_lumi_mod[pixlayeribl2d3d]->Fill(lumiblock, rowWidth); + + if (m_clusters_col_width_per_bcid_mod[pixlayer]) m_clusters_col_width_per_bcid_mod[pixlayer]->Fill(1.0*m_currentBCID, colWidth); + if (pixlayer == PixLayer::kIBL && m_clusters_col_width_per_bcid_mod[pixlayeribl2d3d]) m_clusters_col_width_per_bcid_mod[pixlayeribl2d3d]->Fill(1.0*m_currentBCID, colWidth); + + if (m_clusters_row_width_per_bcid_mod[pixlayer]) m_clusters_row_width_per_bcid_mod[pixlayer]->Fill(1.0*m_currentBCID, rowWidth); + if (pixlayer == PixLayer::kIBL && m_clusters_row_width_per_bcid_mod[pixlayeribl2d3d]) m_clusters_row_width_per_bcid_mod[pixlayeribl2d3d]->Fill(1.0*m_currentBCID, rowWidth); + + + /// + /// Total Number of Clusters + /// + if (m_totalclusters_per_lumi) m_totalclusters_per_lumi->Fill(lumiblock); + if (m_totalclusters_per_lumi_mod[pixlayer] ) m_totalclusters_per_lumi_mod[pixlayer]->Fill( lumiblock ); + if (pixlayer == PixLayer::kIBL && m_totalclusters_per_lumi_mod[pixlayeribl2d3d] ) m_totalclusters_per_lumi_mod[pixlayeribl2d3d]->Fill( lumiblock ); + if (m_totalclusters_per_bcid_mod[pixlayer] ) m_totalclusters_per_bcid_mod[pixlayer]->Fill( 1.0*m_currentBCID ); + if (pixlayer == PixLayer::kIBL && m_totalclusters_per_bcid_mod[pixlayeribl2d3d] ) m_totalclusters_per_bcid_mod[pixlayeribl2d3d]->Fill( 1.0*m_currentBCID ); + + /// + /// Fill Occupancy + /// + if (m_cluster_occupancy) m_cluster_occupancy->Fill(clusID,m_pixelid,m_doIBL); + 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); + + /// 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_cluster_size_mod)m_cluster_size_mod->Fill(cluster.rdoList().size(),clusID,m_pixelid,m_doIBL); + + 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()); + if (m_clussize_vs_eta_mod[pixlayer]) m_clussize_vs_eta_mod[pixlayer]->Fill( 1.0*m_pixelid->eta_module(clusID), cluster.rdoList().size() ); + + + nclusters++; + nclusters_mod[pixlayer]++; + if (cluster.rdoList().size() > 10) nlargeclusters++; + if (cluster.rdoList().size() > 50) nverylargeclusters++; + + if (m_doModules)//fill module cluster arrays + { + if (m_pixelid->barrel_ec(clusID)==2 ) m_ClusPerEventArray_disksA[m_pixelid->phi_module(clusID)][m_pixelid->layer_disk(clusID)]++; + if (m_pixelid->barrel_ec(clusID)==-2) m_ClusPerEventArray_disksC[m_pixelid->phi_module(clusID)][m_pixelid->layer_disk(clusID)]++; + if (m_pixelid->barrel_ec(clusID)==0 ) + { + if (m_doIBL && m_pixelid->layer_disk(clusID)==0) m_ClusPerEventArray_lI[m_pixelid->phi_module(clusID)][m_pixelid->eta_module(clusID)+10]++; + if (m_pixelid->layer_disk(clusID)==0+m_doIBL) m_ClusPerEventArray_l0[m_pixelid->phi_module(clusID)][m_pixelid->eta_module(clusID)+6]++; + if (m_pixelid->layer_disk(clusID)==1+m_doIBL) m_ClusPerEventArray_l1[m_pixelid->phi_module(clusID)][m_pixelid->eta_module(clusID)+6]++; + if (m_pixelid->layer_disk(clusID)==2+m_doIBL) m_ClusPerEventArray_l2[m_pixelid->phi_module(clusID)][m_pixelid->eta_module(clusID)+6]++; + } + } + + if (m_doLumiBlock) { + if (m_cluster_occupancy_LB) m_cluster_occupancy_LB->Fill(clusID,m_pixelid,m_doIBL); + 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); + } + + /// Quick Status + fephi=0; + feeta=0; + if ( pixlayer == PixLayer::kB0 && GetFEID( pixlayer, m_pixelid->phi_index(clusID), m_pixelid->eta_index(clusID), fephi, feeta) ){ + if (m_doOnline){ + if (m_cluster_occupancy_FE_B0_mon) m_cluster_occupancy_FE_B0_mon->Fill( (8.0*m_pixelid->eta_module(clusID))+(1.0*feeta), (2.0*m_pixelid->phi_module(clusID))+(1.0*fephi)); + if (m_doRefresh5min && m_cluster_occupancy_FE_B0_mon) m_cluster_occupancy_FE_B0_mon->Reset(); + } + } - ///////////End of main fill block//////////////////// - } // PixelClusterContainer loop - }//end of event loop - - //////////////////////Fill after event block//////////////// - if(m_doOnline)//should we fill these mid run or only at the end? - { - //FillSummaryHistos(m_cluster_occupancy,m_ecA_cluster_occupancy_summary,m_ecC_cluster_occupancy_summary,m_bar_layI_cluster_occupancy_summary,m_bar_lay0_cluster_occupancy_summary,m_bar_lay1_cluster_occupancy_summary,m_bar_lay2_cluster_occupancy_summary); + ///////////End of main fill block//////////////////// + } // PixelClusterContainer loop + }//end of event loop + + //////////////////////Fill after event block//////////////// + if (m_doOnline)//should we fill these mid run or only at the end? + { FillSummaryHistos(m_cluster_occupancy, m_cluster_occupancy_summary_mod[PixLayer::kECA], m_cluster_occupancy_summary_mod[PixLayer::kECC], @@ -742,91 +695,83 @@ StatusCode PixelMainMon::FillClustersMon(void) m_cluster_occupancy_summary_mod[PixLayer::kB0], m_cluster_occupancy_summary_mod[PixLayer::kB1], m_cluster_occupancy_summary_mod[PixLayer::kB2]); - //FillSummaryHistos(m_cluster_occupancy, - // m_cluster_occupancy_summary_low_mod[PixLayer::kECA], - // m_cluster_occupancy_summary_low_mod[PixLayer::kECC], - // m_cluster_occupancy_summary_low_mod[PixLayer::kIBL], - // m_cluster_occupancy_summary_low_mod[PixLayer::kB0], - // m_cluster_occupancy_summary_low_mod[PixLayer::kB1], - // m_cluster_occupancy_summary_low_mod[PixLayer::kB2]); - //FillSummaryHistos(m_cluster_occupancy,m_ecA_cluster_occupancy_summary_low,m_ecC_cluster_occupancy_summary_low,m_bar_layI_cluster_occupancy_summary_low,m_bar_lay0_cluster_occupancy_summary_low,m_bar_lay1_cluster_occupancy_summary_low,m_bar_lay2_cluster_occupancy_summary_low); - if(m_doRefresh) { - if(m_clustermap_mon && m_clustermap_tmp) m_clustermap_mon->Fill2DMon(m_clustermap_tmp); + if (m_doRefresh) { + if (m_clustermap_mon && m_clustermap_tmp) m_clustermap_mon->Fill2DMon(m_clustermap_tmp); } - } - - - if(m_clusters_per_lumi)m_clusters_per_lumi->Fill(m_manager->lumiBlockNumber(), nclusters); - //if(m_clusters_per_lumi_PIX)m_clusters_per_lumi_PIX->Fill(m_manager->lumiBlockNumber(),nclusters-nclusters_IBL); - for( int i=0; i<PixLayer::COUNT-1+(int)(m_doIBL); i++){ - if(m_clusters_per_lumi_mod[i]) m_clusters_per_lumi_mod[i]->Fill( m_manager->lumiBlockNumber(), nclusters_mod[i]); - if(m_doOnTrack || m_doOnPixelTrack) { - if(m_clusters_per_track_per_lumi_mod[i] && m_ntracksPerEvent>0) m_clusters_per_track_per_lumi_mod[i]->Fill(m_manager->lumiBlockNumber(), (1.0*nclusters_mod[i])/(1.0*m_ntracksPerEvent)); - } - } - - if(m_largeclusters_per_lumi)m_largeclusters_per_lumi->Fill(m_manager->lumiBlockNumber(), nlargeclusters); - if(m_verylargeclusters_per_lumi)m_verylargeclusters_per_lumi->Fill(m_manager->lumiBlockNumber(),nverylargeclusters); - if((nclusters>=1000) && m_highNclusters_per_lumi) m_highNclusters_per_lumi->Fill(m_manager->lumiBlockNumber()); - if (m_doOnTrack || m_doOnPixelTrack) { - if(m_clustersOnOffTrack_per_lumi && nclusters_all>0) m_clustersOnOffTrack_per_lumi->Fill(m_manager->lumiBlockNumber(),(float)nclusters_ontrack/nclusters_all); - } - - ////Fill some histograms only if =< 50% of modules disabled - if (!m_majorityDisabled) { - - if(m_num_clusters) m_num_clusters->Fill(nclusters); - //if(m_num_clusters_low) m_num_clusters_low->Fill(nclusters); - - for( int i=0; i<PixLayer::COUNT-1+(int)(m_doIBL); i++){ - if(m_num_clusters_mod[i]) m_num_clusters_mod[i]->Fill( nclusters_mod[i] ); - } + } + - if(m_cluster_occupancy_time1&&m_cluster_occupancy_time2&&m_cluster_occupancy_time3) FillTimeHisto(double(nclusters/(1744.0+280*m_doIBL)),m_cluster_occupancy_time1, m_cluster_occupancy_time2, m_cluster_occupancy_time3,10.,60.,360. ); - if(m_doLumiBlock && m_num_clusters_LB) m_num_clusters_LB->Fill(nclusters); - - if (m_doModules) + if (m_clusters_per_lumi)m_clusters_per_lumi->Fill(m_manager->lumiBlockNumber(), nclusters); + //if(m_clusters_per_lumi_PIX)m_clusters_per_lumi_PIX->Fill(m_manager->lumiBlockNumber(),nclusters-nclusters_IBL); + for ( int i=0; i<PixLayer::COUNT-1+(int)(m_doIBL); i++){ + if (m_clusters_per_lumi_mod[i]) m_clusters_per_lumi_mod[i]->Fill( m_manager->lumiBlockNumber(), nclusters_mod[i]); + if (m_doOnTrack || m_doOnPixelTrack) { + if (m_clusters_per_track_per_lumi_mod[i] && m_ntracksPerEvent>0) m_clusters_per_track_per_lumi_mod[i]->Fill(m_manager->lumiBlockNumber(), (1.0*nclusters_mod[i])/(1.0*m_ntracksPerEvent)); + } + } + + if (m_largeclusters_per_lumi)m_largeclusters_per_lumi->Fill(m_manager->lumiBlockNumber(), nlargeclusters); + if (m_verylargeclusters_per_lumi)m_verylargeclusters_per_lumi->Fill(m_manager->lumiBlockNumber(),nverylargeclusters); + if ((nclusters>=1000) && m_highNclusters_per_lumi) m_highNclusters_per_lumi->Fill(m_manager->lumiBlockNumber()); + if (m_doOnTrack || m_doOnPixelTrack) { + if (m_clustersOnOffTrack_per_lumi && nclusters_all>0) m_clustersOnOffTrack_per_lumi->Fill(m_manager->lumiBlockNumber(),(float)nclusters_ontrack/nclusters_all); + } + + /// Fill some histograms only if =< 50% of modules disabled + /// + if (!m_majorityDisabled) { + + if (m_num_clusters) m_num_clusters->Fill(nclusters); + //if(m_num_clusters_low) m_num_clusters_low->Fill(nclusters); + + for ( int i=0; i<PixLayer::COUNT-1+(int)(m_doIBL); i++){ + if (m_num_clusters_mod[i]) m_num_clusters_mod[i]->Fill( nclusters_mod[i] ); + } + + if (m_cluster_occupancy_time1&&m_cluster_occupancy_time2&&m_cluster_occupancy_time3) FillTimeHisto(double(nclusters/(1744.0+280*m_doIBL)),m_cluster_occupancy_time1, m_cluster_occupancy_time2, m_cluster_occupancy_time3,10.,60.,360. ); + if (m_doLumiBlock && m_num_clusters_LB) m_num_clusters_LB->Fill(nclusters); + + if (m_doModules) { - PixelID::const_id_iterator idIt = m_pixelid->wafer_begin(); - PixelID::const_id_iterator idItEnd = m_pixelid->wafer_end(); - for (; idIt != idItEnd; ++idIt) + PixelID::const_id_iterator idIt = m_pixelid->wafer_begin(); + PixelID::const_id_iterator idItEnd = m_pixelid->wafer_end(); + 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)==0 ) { - 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)==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_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)==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->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_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)==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); + } + } + } } - } - ////////////////////End fill after event block/////////// - if(nclusters==0 && m_storegate_errors) m_storegate_errors->Fill(3.,4.);//first entry for RDO, second for size = 0 - - return StatusCode::SUCCESS; + } //if (!m_majorityDisabled) + ////////////////////End fill after event block/////////// + if (nclusters==0 && m_storegate_errors) m_storegate_errors->Fill(3.,4.);//first entry for RDO, second for size = 0 + + return StatusCode::SUCCESS; } StatusCode PixelMainMon::ProcClustersMon(void) { - if(m_doOffline) //run these only for offline - { - //FillSummaryHistos(m_cluster_occupancy,m_ecA_cluster_occupancy_summary,m_ecC_cluster_occupancy_summary,m_bar_layI_cluster_occupancy_summary,m_bar_lay0_cluster_occupancy_summary,m_bar_lay1_cluster_occupancy_summary,m_bar_lay2_cluster_occupancy_summary); + if (m_doOffline) + { FillSummaryHistos(m_cluster_occupancy, m_cluster_occupancy_summary_mod[PixLayer::kECA], m_cluster_occupancy_summary_mod[PixLayer::kECC], @@ -834,21 +779,13 @@ StatusCode PixelMainMon::ProcClustersMon(void) m_cluster_occupancy_summary_mod[PixLayer::kB0], m_cluster_occupancy_summary_mod[PixLayer::kB1], m_cluster_occupancy_summary_mod[PixLayer::kB2]); - //FillSummaryHistos(m_cluster_occupancy, - // m_cluster_occupancy_summary_low_mod[PixLayer::kECA], - // m_cluster_occupancy_summary_low_mod[PixLayer::kECC], - // m_cluster_occupancy_summary_low_mod[PixLayer::kIBL], - // m_cluster_occupancy_summary_low_mod[PixLayer::kB0], - // m_cluster_occupancy_summary_low_mod[PixLayer::kB1], - // m_cluster_occupancy_summary_low_mod[PixLayer::kB2]); - //FillSummaryHistos(m_cluster_occupancy,m_ecA_cluster_occupancy_summary_low,m_ecC_cluster_occupancy_summary_low,m_bar_layI_cluster_occupancy_summary_low,m_bar_lay0_cluster_occupancy_summary_low,m_bar_lay1_cluster_occupancy_summary_low,m_bar_lay2_cluster_occupancy_summary_low); - } + } - double events = m_event; - if(events==0) return StatusCode::SUCCESS; //if no events, the rest of the test is pointless and would divide by 0 - if( m_event != m_event2) events = m_event2; - - return StatusCode::SUCCESS; + double events = m_event; + if (events==0) return StatusCode::SUCCESS; //if no events, the rest of the test is pointless and would divide by 0 + if ( m_event != m_event2) events = m_event2; + + return StatusCode::SUCCESS; } diff --git a/InnerDetector/InDetMonitoring/PixelMonitoring/src/Hits.cxx b/InnerDetector/InDetMonitoring/PixelMonitoring/src/Hits.cxx index f6acba9cebb3d77caff5c0bd31dfc15c97aad616..3c129572b7bdcffb3d218561db20aabe0b14280a 100644 --- a/InnerDetector/InDetMonitoring/PixelMonitoring/src/Hits.cxx +++ b/InnerDetector/InDetMonitoring/PixelMonitoring/src/Hits.cxx @@ -9,12 +9,6 @@ #include "PixelMonitoring/PixelMainMon.h" #include "InDetRawData/InDetTimeCollection.h" #include "InDetConditionsSummaryService/IInDetConditionsSvc.h" -//#include "TrkSpacePoint/SpacePointContainer.h" -//#include "InDetPrepRawData/PixelClusterContainer.h" -//#include "TrkParameters/MeasuredAtaPlane.h" -//#include "TrkParameters/MeasuredPerigee.h" -//#include "InDetRIO_OnTrack/SiClusterOnTrack.h" -//#include "PixelConditionsServices/IPixelByteStreamErrorsSvc.h" #include "InDetIdentifier/PixelID.h" #include "TH1F.h" #include "TH1I.h" @@ -34,6 +28,7 @@ #include "InDetRawData/InDetRawDataCLASS_DEF.h" #include "PixelMonitoring/PixelMon2DMaps.h" #include "PixelMonitoring/PixelMon2DMapsLW.h" +#include "PixelMonitoring/PixelMon2DProfilesLW.h" #include "PixelMonitoring/DBMMon2DMaps.h" #include "PixelMonitoring/PixelMonModules.h" #include "PixelMonitoring/PixelMon2DLumiProfiles.h" @@ -159,10 +154,11 @@ 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); + if(m_doOnline) { m_hitmap_mon = new PixelMon2DMaps("HitMap_Mon", ("Hit map for monitoring" + m_histTitleExt).c_str()); sc = m_hitmap_mon->regHist(rdoShift); - m_hitmap_tmp = new PixelMon2DMaps("HitMap_tmp", ("Hit map for monitoring" + m_histTitleExt).c_str()); sc = m_hitmap_tmp->regHist(rdoShift); for(int i=0; i<PixLayer::COUNT-1+(int)(m_doIBL); i++){ hname = makeHistname(("Hit_ToT_Mon_"+m_modLabel_PixLayerIBL2D3D[i]), false); @@ -227,6 +223,10 @@ StatusCode PixelMainMon::BookHitsMon(void) 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_occupancy_pix_evt = new PixelMon2DProfilesLW("Occupancy_per_pixel_event", ("#hits / pixel / event" + m_histTitleExt).c_str(), m_doIBL, false, false); + 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); @@ -336,7 +336,7 @@ StatusCode PixelMainMon::BookHitsMon(void) sc = rdoExpert.regHist(m_nFEswithHits_mod[i] = new TH3F(hname.c_str(), htitles.c_str(), nbins_LB, min_LB, max_LB, nmod_eta[i], -0.5, -0.5 + nmod_eta[i], 18, -0.5, 17.5)); } - if(m_doOfflineAnalysis){ + if (m_doOfflineAnalysis) { /// Quick Status hname = makeHistname("Hits_per_lumi_L0_B11_S2_C6", false); @@ -547,17 +547,14 @@ StatusCode PixelMainMon::FillHitsMon(void) //Called once per event Identifier rdoID; - //int nGood_mod[PixLayerIBL2D3D::COUNT] = {m_nGood_ECA, m_nGood_ECC, m_nGood_B0, m_nGood_B1, m_nGood_B2, (int)((2* m_nGood_IBL2D)+m_nGood_IBL3D), m_nGood_IBL2D, m_nGood_IBL3D}; - int nchannels[PixLayerIBL2D3D::COUNT] = {46080, 46080, 46080, 46080, 46080, 26880, 53760, 26880}; - double nactivechannels = 0.; - double nGoodChannels_mod[PixLayerIBL2D3D::COUNT]; - double nActiveChannels_mod[PixLayerIBL2D3D::COUNT]; + int nChannels_mod[PixLayerIBL2D3D::COUNT] = {46080, 46080, 46080, 46080, 46080, 26880, 53760, 26880}; + double nActiveChannels_total = 0.; + double nGoodChannels_layer[PixLayerIBL2D3D::COUNT]; + double nActiveChannels_layer[PixLayerIBL2D3D::COUNT]; for( int i=0; i<PixLayerIBL2D3D::COUNT; i++){ - //nGoodChannels_mod[i] = 1.0*nchannels[i]*nGood_mod[i]; - //nActiveChannels_mod[i] = 1.0 * nchannels[i] * m_nActivAndSync_mod[i]; - nGoodChannels_mod[i] = 1.0*nchannels[i]*m_nGood_mod[i]; - nActiveChannels_mod[i] = 1.0 * nchannels[i] * m_nActive_mod[i]; - nactivechannels =+ nGoodChannels_mod[i]; + nGoodChannels_layer[i] = 1.0 * nChannels_mod[i] * m_nGood_mod[i]; + nActiveChannels_layer[i] = 1.0 * nChannels_mod[i] * m_nActive_mod[i]; + nActiveChannels_total =+ nGoodChannels_layer[i]; } @@ -576,16 +573,16 @@ StatusCode PixelMainMon::FillHitsMon(void) //Called once per event PixelRDO_Container::const_iterator lastCol = m_rdocontainer->end(); DataVector<PixelRDORawData>::const_iterator p_rdo; - for (; colNext != lastCol; ++colNext) // Pixel ROD Loop + for (; colNext != lastCol; ++colNext) // Pixel RDO (hits) Loop { - const InDetRawDataCollection<PixelRDORawData>* PixelCollection(*colNext); - if (!PixelCollection) - { + const InDetRawDataCollection<PixelRDORawData>* PixelCollection(*colNext); + if (!PixelCollection) + { if(m_storegate_errors) m_storegate_errors->Fill(1.,5.); //first entry (1). is for RDO, second (4) is for data problem continue; } - for (p_rdo=PixelCollection->begin(); p_rdo!=PixelCollection->end(); ++p_rdo) { + for(p_rdo=PixelCollection->begin(); p_rdo!=PixelCollection->end(); ++p_rdo) { rdoID=(*p_rdo)->identify(); @@ -612,8 +609,9 @@ StatusCode PixelMainMon::FillHitsMon(void) //Called once per event /// 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_average_pixocc && nchannels[pixlayeribl2d3d] > 0) m_average_pixocc->WeightingFill(rdoID, m_pixelid, m_doIBL, 1.0/( 1.0*nchannels[pixlayeribl2d3d]) ); - if (m_doOnline && m_hitmap_tmp) m_hitmap_tmp->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]) ); + /// Fill Lvl1A if (m_Lvl1A) { @@ -665,21 +663,21 @@ StatusCode PixelMainMon::FillHitsMon(void) //Called once per event } - /// Fill ToT - if (pixlayerdbm != 99 && m_hit_ToT[pixlayerdbm]) m_hit_ToT[pixlayerdbm]->Fill((*p_rdo)->getToT()); - if (pixlayer != 99 && m_hit_ToTMean_mod[pixlayer]) m_hit_ToTMean_mod[pixlayer]->Fill(m_manager->lumiBlockNumber(), (*p_rdo)->getToT()); - if (pixlayerdbm == PixLayerDBM::kIBL){ - int ibl2d3d = GetPixLayerIDIBL2D3DDBM(m_pixelid->barrel_ec(rdoID), m_pixelid->layer_disk(rdoID), m_pixelid->eta_module(rdoID), m_doIBL); - if(m_hit_ToT[ibl2d3d]) m_hit_ToT[ibl2d3d]->Fill((*p_rdo)->getToT()); - } - if (m_doLumiBlock && pixlayer != 99){ - if (m_hit_ToT_LB_mod[pixlayer]) m_hit_ToT_LB_mod[pixlayer]->Fill((*p_rdo)->getToT()); - } - if (pixlayer != 99 && m_ToT_etaphi_mod[pixlayer] ) m_ToT_etaphi_mod[pixlayer]->Fill(m_pixelid->eta_module(rdoID), m_pixelid->phi_module(rdoID), (*p_rdo)->getToT()); - - /// for Pixel Operation TF - if (pixlayer != 99 && m_hit_ToT_per_lumi_mod[pixlayer] && nGoodChannels_mod[pixlayer]>0) m_hit_ToT_per_lumi_mod[pixlayer]->Fill(m_manager->lumiBlockNumber(), (*p_rdo)->getToT(), 1.0/nGoodChannels_mod[pixlayer]); - if (pixlayer == PixLayer::kIBL && m_hit_ToT_per_lumi_mod[pixlayeribl2d3d] && nGoodChannels_mod[pixlayeribl2d3d]>0) m_hit_ToT_per_lumi_mod[pixlayeribl2d3d]->Fill(m_manager->lumiBlockNumber(), (*p_rdo)->getToT(), 1.0/nGoodChannels_mod[pixlayeribl2d3d]); + /// Fill ToT + if(pixlayerdbm != 99 && m_hit_ToT[pixlayerdbm]) m_hit_ToT[pixlayerdbm]->Fill((*p_rdo)->getToT()); + if(pixlayer != 99 && m_hit_ToTMean_mod[pixlayer]) m_hit_ToTMean_mod[pixlayer]->Fill(m_manager->lumiBlockNumber(), (*p_rdo)->getToT()); + if(pixlayerdbm == PixLayerDBM::kIBL){ + int ibl2d3d = GetPixLayerIDIBL2D3DDBM(m_pixelid->barrel_ec(rdoID), m_pixelid->layer_disk(rdoID), m_pixelid->eta_module(rdoID), m_doIBL); + if(m_hit_ToT[ibl2d3d]) m_hit_ToT[ibl2d3d]->Fill((*p_rdo)->getToT()); + } + if(m_doLumiBlock && pixlayer != 99){ + if(m_hit_ToT_LB_mod[pixlayer]) m_hit_ToT_LB_mod[pixlayer]->Fill((*p_rdo)->getToT()); + } + if(pixlayer != 99 && m_ToT_etaphi_mod[pixlayer] ) m_ToT_etaphi_mod[pixlayer]->Fill(m_pixelid->eta_module(rdoID), m_pixelid->phi_module(rdoID), (*p_rdo)->getToT()); + + /// for Pixel Operation TF + if(pixlayer != 99 && m_hit_ToT_per_lumi_mod[pixlayer] && nGoodChannels_layer[pixlayer]>0) m_hit_ToT_per_lumi_mod[pixlayer]->Fill(m_manager->lumiBlockNumber(), (*p_rdo)->getToT(), 1.0/nGoodChannels_layer[pixlayer]); + if(pixlayer == PixLayer::kIBL && m_hit_ToT_per_lumi_mod[pixlayeribl2d3d] && nGoodChannels_layer[pixlayeribl2d3d]>0) m_hit_ToT_per_lumi_mod[pixlayeribl2d3d]->Fill(m_manager->lumiBlockNumber(), (*p_rdo)->getToT(), 1.0/nGoodChannels_layer[pixlayeribl2d3d]); /// Monitoring!! if (m_doOnline) @@ -726,13 +724,14 @@ StatusCode PixelMainMon::FillHitsMon(void) //Called once per event /// Quick Status int fephi=0; int feeta=0; - if ( pixlayer == PixLayer::kB0 && GetFEID( pixlayer, m_pixelid->phi_index(rdoID), m_pixelid->eta_index(rdoID), fephi, feeta) ){ - if (m_pixelid->phi_module(rdoID) == 0 && m_pixelid->eta_module(rdoID) < 0 && m_nhits_L0_B11_S2_C6) { - m_nhits_L0_B11_S2_C6->Fill( m_manager->lumiBlockNumber(), (16*fabs(6+m_pixelid->eta_module(rdoID)))+(8.0*fephi)+feeta ); - nhits_L0_B11_S2_C6[ (int)(16*fabs(6+m_pixelid->eta_module(rdoID)))+(8*fephi)+feeta ]++; + if (m_doOfflineAnalysis) { + if ( pixlayer == PixLayer::kB0 && GetFEID( pixlayer, m_pixelid->phi_index(rdoID), m_pixelid->eta_index(rdoID), fephi, feeta) ){ + if (m_pixelid->phi_module(rdoID) == 0 && m_pixelid->eta_module(rdoID) < 0 && m_nhits_L0_B11_S2_C6) { + m_nhits_L0_B11_S2_C6->Fill( m_manager->lumiBlockNumber(), (16*fabs(6+m_pixelid->eta_module(rdoID)))+(8.0*fephi)+feeta ); + nhits_L0_B11_S2_C6[ (int)(16*fabs(6+m_pixelid->eta_module(rdoID)))+(8*fephi)+feeta ]++; + } } } - if ( pixlayer == PixLayer::kB0 && GetFEID( pixlayer, m_pixelid->phi_index(rdoID), m_pixelid->eta_index(rdoID), fephi, feeta) ){ fewithHits_B0[m_pixelid->phi_module(rdoID)][(int)(fabs(6+m_pixelid->eta_module(rdoID)))][(int)((8*fephi)+feeta)] = 1; } @@ -751,7 +750,7 @@ StatusCode PixelMainMon::FillHitsMon(void) //Called once per event ///////////End of main fill block//////////////////// } - } //end of ROD loop + } //end of RDO (hit) loop @@ -759,84 +758,85 @@ StatusCode PixelMainMon::FillHitsMon(void) //Called once per event if (m_doOnline)//should we fill these mid run or only at the end? { FillSummaryHistos(m_occupancy, m_occupancy_summary_mod[PixLayer::kECA], m_occupancy_summary_mod[PixLayer::kECC], - m_occupancy_summary_mod[PixLayer::kIBL], m_occupancy_summary_mod[PixLayer::kB0], - m_occupancy_summary_mod[PixLayer::kB1], m_occupancy_summary_mod[PixLayer::kB2]); - //FillSummaryHistos(m_occupancy, m_occupancy_summary_low_mod[PixLayer::kECA], m_occupancy_summary_low_mod[PixLayer::kECC], - // m_occupancy_summary_low_mod[PixLayer::kIBL], m_occupancy_summary_low_mod[PixLayer::kB0], - // m_occupancy_summary_low_mod[PixLayer::kB1], m_occupancy_summary_low_mod[PixLayer::kB2]); - if(m_doRefresh) { + m_occupancy_summary_mod[PixLayer::kIBL], m_occupancy_summary_mod[PixLayer::kB0], + m_occupancy_summary_mod[PixLayer::kB1], m_occupancy_summary_mod[PixLayer::kB2]); + if (m_doRefresh) { for(int i=0; i<PixLayer::COUNT; i++){ if( m_hit_ToT_Mon_mod[i] && m_hit_ToT_tmp_mod[i]) TH1FFillMonitoring(m_hit_ToT_Mon_mod[i], m_hit_ToT_tmp_mod[i]); } - if(m_hitmap_mon) m_hitmap_mon->Fill2DMon(m_hitmap_tmp); + if ( m_hitmap_tmp && m_hitmap_mon) { + if ( m_occupancy_pix_evt ) m_occupancy_pix_evt->FillFromMap(m_hitmap_tmp, false); + m_hitmap_mon->Fill2DMon(m_hitmap_tmp); + } } - }//end of doOnline loop processing - + } //end of doOnline loop processing /// Fill number of hits per lLB - if (m_hits_per_lumi) m_hits_per_lumi->Fill(m_manager->lumiBlockNumber(), nhits); - for ( int i=0; i<PixLayer::COUNT-1+(int)(m_doIBL); i++){ - if (m_hits_per_lumi_mod[i]) m_hits_per_lumi_mod[i]->Fill(m_manager->lumiBlockNumber(), nhits_mod[i]); + if(m_hits_per_lumi) m_hits_per_lumi->Fill(m_manager->lumiBlockNumber(), nhits); + for( int i=0; i<PixLayer::COUNT-1+(int)(m_doIBL); i++){ + if(m_hits_per_lumi_mod[i]) m_hits_per_lumi_mod[i]->Fill(m_manager->lumiBlockNumber(), nhits_mod[i]); } /// Fill average occupancy + if ( m_doOffline && m_occupancy_pix_evt && m_hitmap_tmp) m_occupancy_pix_evt->FillFromMap(m_hitmap_tmp, true); + double avgocc = 0; double avgocc_mod[PixLayerIBL2D3D::COUNT] = {0}; double avgocc_active_mod[PixLayerIBL2D3D::COUNT] = {0}; - if(nactivechannels>0) avgocc = nhits/nactivechannels; + if(nActiveChannels_total>0) avgocc = nhits/nActiveChannels_total; if(m_avgocc_per_lumi) m_avgocc_per_lumi->Fill(m_manager->lumiBlockNumber(), avgocc); for( int i=0; i<PixLayerIBL2D3D::COUNT; i++){ - if(nGoodChannels_mod[i] > 0){ - avgocc_mod[i] = nhits_mod[i]/nGoodChannels_mod[i]; - } - if( nActiveChannels_mod[i] > 0){ - avgocc_active_mod[i] = nhits_mod[i]/nActiveChannels_mod[i]; - } - /// - if(m_avgocc_per_lumi_mod[i]) m_avgocc_per_lumi_mod[i]->Fill(m_manager->lumiBlockNumber(),avgocc_mod[i]); - if(m_avgocc_per_bcid_mod[i]) m_avgocc_per_bcid_mod[i]->Fill(prev_pix_bcid, avgocc_mod[i]); - if(m_avgocc_per_bcid_per_lumi_mod[i]) m_avgocc_per_bcid_per_lumi_mod[i]->Fill(m_manager->lumiBlockNumber(), prev_pix_bcid, avgocc_mod[i]); - if(m_avgocc_active_per_lumi_mod[i]) m_avgocc_active_per_lumi_mod[i]->Fill(m_manager->lumiBlockNumber(),avgocc_active_mod[i]); - if(m_maxocc_per_lumi_mod[i]) m_maxocc_per_lumi_mod[i]->Fill(m_manager->lumiBlockNumber(), avgocc_mod[i]); - if(m_maxocc_per_bcid_mod[i]){ - int bin = m_maxocc_per_bcid_mod[i]->GetXaxis()->FindBin( 1.0*prev_pix_bcid ); - double content = m_maxocc_per_bcid_mod[i]->GetBinContent( bin ); - if( avgocc_mod[i] > content ) m_maxocc_per_bcid_mod[i]->SetBinContent(bin, avgocc_mod[i]); - } - if(m_totalhits_per_bcid_mod[i]) m_totalhits_per_bcid_mod[i]->Fill(1.0*prev_pix_bcid, nhits_mod[i]); - if(avgocc_mod[i] > 0.0007 && m_nlargeevt_per_lumi_mod[i]) m_nlargeevt_per_lumi_mod[i]->Fill( m_lumiBlockNum ); + if(nGoodChannels_layer[i] > 0){ + avgocc_mod[i] = nhits_mod[i]/nGoodChannels_layer[i]; + } + if( nActiveChannels_layer[i] > 0){ + avgocc_active_mod[i] = nhits_mod[i]/nActiveChannels_layer[i]; + } + /// + if(m_avgocc_per_lumi_mod[i]) m_avgocc_per_lumi_mod[i]->Fill(m_manager->lumiBlockNumber(),avgocc_mod[i]); + if(m_avgocc_per_bcid_mod[i]) m_avgocc_per_bcid_mod[i]->Fill(prev_pix_bcid, avgocc_mod[i]); + if(m_avgocc_per_bcid_per_lumi_mod[i]) m_avgocc_per_bcid_per_lumi_mod[i]->Fill(m_manager->lumiBlockNumber(), prev_pix_bcid, avgocc_mod[i]); + if(m_avgocc_active_per_lumi_mod[i]) m_avgocc_active_per_lumi_mod[i]->Fill(m_manager->lumiBlockNumber(),avgocc_active_mod[i]); + if(m_maxocc_per_lumi_mod[i]) m_maxocc_per_lumi_mod[i]->Fill(m_manager->lumiBlockNumber(), avgocc_mod[i]); + if(m_maxocc_per_bcid_mod[i]){ + int bin = m_maxocc_per_bcid_mod[i]->GetXaxis()->FindBin( 1.0*prev_pix_bcid ); + double content = m_maxocc_per_bcid_mod[i]->GetBinContent( bin ); + if( avgocc_mod[i] > content ) m_maxocc_per_bcid_mod[i]->SetBinContent(bin, avgocc_mod[i]); + } + if(m_totalhits_per_bcid_mod[i]) m_totalhits_per_bcid_mod[i]->Fill(1.0*prev_pix_bcid, nhits_mod[i]); + if(avgocc_mod[i] > 0.0007 && m_nlargeevt_per_lumi_mod[i]) m_nlargeevt_per_lumi_mod[i]->Fill( m_lumiBlockNum ); } - + if(avgocc_mod[PixLayer::kB0] > 0 && m_avgocc_ratioIBLB0_per_lumi) - m_avgocc_ratioIBLB0_per_lumi->Fill(m_manager->lumiBlockNumber(), avgocc_mod[PixLayer::kIBL]/avgocc_mod[PixLayer::kB0]); - + m_avgocc_ratioIBLB0_per_lumi->Fill(m_manager->lumiBlockNumber(), avgocc_mod[PixLayer::kIBL]/avgocc_mod[PixLayer::kB0]); + if(m_occupancy_time1&&m_occupancy_time2&&m_occupancy_time3) FillTimeHisto(double(nhits/(1744.0+280*m_doIBL)),m_occupancy_time1, m_occupancy_time2, m_occupancy_time3,10.,60.,360. ); - + if(m_Atlas_BCID_hits) m_Atlas_BCID_hits->Fill(prev_pix_bcid,nhits); - + /// Fill the #hit per module per event //if(!m_doOnline){ for(int i=0; i<PixLayer::COUNT; i++){ - for(int phi=0; phi<nmod_phi[i]; phi++){ - for(int eta=0; eta<nmod_eta[i]; eta++){ - if(i == PixLayer::kECA && m_nhits_mod[i]) m_nhits_mod[i]->Fill( m_HitPerEventArray_disksA[phi][eta] ); - if(i == PixLayer::kECC && m_nhits_mod[i]) m_nhits_mod[i]->Fill( m_HitPerEventArray_disksC[phi][eta] ); - if(i == PixLayer::kB0 && m_nhits_mod[i]) m_nhits_mod[i]->Fill( m_HitPerEventArray_l0[phi][eta]); - if(i == PixLayer::kB1 && m_nhits_mod[i]) m_nhits_mod[i]->Fill( m_HitPerEventArray_l1[phi][eta]); - if(i == PixLayer::kB2 && m_nhits_mod[i]) m_nhits_mod[i]->Fill( m_HitPerEventArray_l2[phi][eta]); - if(i == PixLayer::kIBL && m_nhits_mod[i]) m_nhits_mod[i]->Fill( m_HitPerEventArray_lI[phi][eta]); - } - } + for(int phi=0; phi<nmod_phi[i]; phi++){ + for(int eta=0; eta<nmod_eta[i]; eta++){ + if(i == PixLayer::kECA && m_nhits_mod[i]) m_nhits_mod[i]->Fill( m_HitPerEventArray_disksA[phi][eta] ); + if(i == PixLayer::kECC && m_nhits_mod[i]) m_nhits_mod[i]->Fill( m_HitPerEventArray_disksC[phi][eta] ); + if(i == PixLayer::kB0 && m_nhits_mod[i]) m_nhits_mod[i]->Fill( m_HitPerEventArray_l0[phi][eta]); + if(i == PixLayer::kB1 && m_nhits_mod[i]) m_nhits_mod[i]->Fill( m_HitPerEventArray_l1[phi][eta]); + if(i == PixLayer::kB2 && m_nhits_mod[i]) m_nhits_mod[i]->Fill( m_HitPerEventArray_l2[phi][eta]); + if(i == PixLayer::kIBL && m_nhits_mod[i]) m_nhits_mod[i]->Fill( m_HitPerEventArray_lI[phi][eta]); + } + } } /// Put the #hits per event for each layer - if ( m_event == 0){ - for( int i=0; i<PixLayer::COUNT-1+(int)(m_doIBL); i++){ + if ( m_event == 0) { + for( int i=0; i<PixLayer::COUNT-1+(int)(m_doIBL); i++) { m_hitocc_stock[i].push_back( avgocc_mod[i] ); } } else if ( !newLumiBlockFlag() ) { - for( int i=0; i<PixLayer::COUNT-1+(int)(m_doIBL); i++){ + for( int i=0; i<PixLayer::COUNT-1+(int)(m_doIBL); i++) { m_hitocc_stock[i].push_back( avgocc_mod[i] ); } } @@ -892,31 +892,31 @@ StatusCode PixelMainMon::FillHitsMon(void) //Called once per event } /// Quick Status - if(m_doOfflineAnalysis){ + if (m_doOfflineAnalysis) { for(int i=0 ; i<96 ; i++){ if( m_occupancy_L0_B11_S2_C6 ) m_occupancy_L0_B11_S2_C6->Fill(m_manager->lumiBlockNumber(), i, (1.0*nhits_L0_B11_S2_C6[i]/(18.0*164.0))); } } - + for(int i=0; i<PixLayer::COUNT; i++){ - for( int phi=0; phi<nmod_phi[i]; phi++){ - for(int eta=0; eta<nmod_eta[i]; eta++){ - int nfes = 0; - for(int j=0 ; j<16 ; j++){ - if(i==PixLayer::kECA) nfes += fewithHits_EA[phi][eta][j]; - if(i==PixLayer::kECC) nfes += fewithHits_EC[phi][eta][j]; - if(i==PixLayer::kB0) nfes += fewithHits_B0[phi][eta][j]; - if(i==PixLayer::kB1) nfes += fewithHits_B1[phi][eta][j]; - if(i==PixLayer::kB2) nfes += fewithHits_B2[phi][eta][j]; - } - if(m_nFEswithHits_mod[i]) m_nFEswithHits_mod[i]->Fill(m_manager->lumiBlockNumber(), eta, nfes); + for( int phi=0; phi<nmod_phi[i]; phi++){ + for(int eta=0; eta<nmod_eta[i]; eta++){ + int nfes = 0; + for(int j=0 ; j<16 ; j++){ + if(i==PixLayer::kECA) nfes += fewithHits_EA[phi][eta][j]; + if(i==PixLayer::kECC) nfes += fewithHits_EC[phi][eta][j]; + if(i==PixLayer::kB0) nfes += fewithHits_B0[phi][eta][j]; + if(i==PixLayer::kB1) nfes += fewithHits_B1[phi][eta][j]; + if(i==PixLayer::kB2) nfes += fewithHits_B2[phi][eta][j]; + } + if(m_nFEswithHits_mod[i]) m_nFEswithHits_mod[i]->Fill(m_manager->lumiBlockNumber(), eta, nfes); + } } - } } - + ////////////////////End fill after event block/////////// if(nhits==0 && m_storegate_errors) m_storegate_errors->Fill(1.,4.);//first entry for RDO, second for size = 0 - + return StatusCode::SUCCESS; } diff --git a/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelMainMon.cxx b/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelMainMon.cxx index 4e9bd6d1bf6909c25016917ef0bdeb45e8b1facf..bdc35ae7716698410324e59f9ad4e21022ffa49d 100755 --- a/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelMainMon.cxx +++ b/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelMainMon.cxx @@ -218,6 +218,7 @@ PixelMainMon::PixelMainMon(const std::string & type, memset(m_maxocc_per_bcid_mod, 0, sizeof(m_maxocc_per_bcid_mod)); m_occupancy = 0; m_average_pixocc = 0; + m_occupancy_pix_evt = 0; m_occupancy_10min = 0; m_occupancy_time1 = 0; m_occupancy_time2 = 0; diff --git a/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelMon2DProfilesLW.cxx b/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelMon2DProfilesLW.cxx index 6290fcfba16bcaead98c9e13c6691c7b4b1c81d2..500c9d3b8d55864abc5afff0b4d2e535b4e63f47 100644 --- a/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelMon2DProfilesLW.cxx +++ b/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelMon2DProfilesLW.cxx @@ -8,6 +8,7 @@ #include "PixelMonitoring/PixelMon2DProfilesLW.h" #include "PixelMonitoring/PixelMon2DMapsLW.h" +#include "PixelMonitoring/PixelMon2DMaps.h" #include "InDetIdentifier/PixelID.h" #include "LWHists/TProfile2D_LW.h" #include "LWHists/TH2F_LW.h" @@ -335,7 +336,7 @@ void PixelMon2DProfilesLW::Fill2DMon(PixelMon2DProfilesLW* oldmap) } } -void PixelMon2DProfilesLW::FillFromMap(PixelMon2DMapsLW* inputmap) +void PixelMon2DProfilesLW::FillFromMap(PixelMon2DMaps* inputmap, bool clear_inputmap) { float weightIBL = 1.0 / 26880.0; float weightPixel = 1.0 / 46080.0; @@ -345,14 +346,14 @@ void PixelMon2DProfilesLW::FillFromMap(PixelMon2DMapsLW* inputmap) // 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); - // inputmap->DBMA->SetBinContent(x, y, 0); + // if (clear_inputmap) inputmap->DBMA->SetBinContent(x, y, 0); // } //} //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); - // inputmap->DBMC->SetBinContent(x, y, 0); + // if (clear_inputmap) inputmap->DBMC->SetBinContent(x, y, 0); // } //} @@ -360,56 +361,56 @@ void PixelMon2DProfilesLW::FillFromMap(PixelMon2DMapsLW* inputmap) 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); - inputmap->A->SetBinContent(x, y, 0); + if (clear_inputmap) inputmap->A->SetBinContent(x, y, 0); } } 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); - inputmap->C->SetBinContent(x, y, 0); + if (clear_inputmap) inputmap->C->SetBinContent(x, y, 0); } } 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); - inputmap->B0->SetBinContent(x, y, 0); + if (clear_inputmap) inputmap->B0->SetBinContent(x, y, 0); } } 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); - inputmap->B1->SetBinContent(x, y, 0); + if (clear_inputmap) inputmap->B1->SetBinContent(x, y, 0); } } 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); - inputmap->B2->SetBinContent(x, y, 0); + if (clear_inputmap) inputmap->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 = inputmap->IBL->GetBinContent(x, y); IBL->Fill(inputmap->IBL->GetXaxis()->GetBinCenter(x), inputmap->IBL->GetYaxis()->GetBinCenter(y), content*weightIBL); - inputmap->IBL->SetBinContent(x, y, 0); + if (clear_inputmap) inputmap->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 = inputmap->IBL2D->GetBinContent(x, y); IBL2D->Fill(inputmap->IBL2D->GetXaxis()->GetBinCenter(x), inputmap->IBL2D->GetYaxis()->GetBinCenter(y), content*weightIBL); - inputmap->IBL2D->SetBinContent(x, y, 0); + if (clear_inputmap) inputmap->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 = inputmap->IBL3D->GetBinContent(x, y); IBL3D->Fill(inputmap->IBL3D->GetXaxis()->GetBinCenter(x), inputmap->IBL3D->GetYaxis()->GetBinCenter(y), content*weightIBL); - inputmap->IBL3D->SetBinContent(x, y, 0); + if (clear_inputmap) inputmap->IBL3D->SetBinContent(x, y, 0); } } } diff --git a/InnerDetector/InDetMonitoring/PixelMonitoring/src/Status.cxx b/InnerDetector/InDetMonitoring/PixelMonitoring/src/Status.cxx index 51f73d4c76752315a29679d080b86683351e586b..b287282b5723e6ef6bef29b40c562f904f12fa41 100644 --- a/InnerDetector/InDetMonitoring/PixelMonitoring/src/Status.cxx +++ b/InnerDetector/InDetMonitoring/PixelMonitoring/src/Status.cxx @@ -31,223 +31,216 @@ StatusCode PixelMainMon::BookStatusMon(void) { - if(msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "starting Book Status" << endmsg; - - std::string path = "Pixel/Status"; - if(m_doOnTrack) path.replace(path.begin(), path.end(), "Pixel/StatusOnTrack"); - if(m_doOnPixelTrack) path.replace(path.begin(), path.end(), "Pixel/StatusOnPixelTrack"); - MonGroup statusHistos( this, path.c_str(), run, ATTRIB_MANAGED ); //declare a group of histograms - - // use the following definitions for modules states: - // GOOD = active + good - // DISABLED "BAD" = active + bad - // DISABLED "INACTIVE" = inactive + good/bad (inactive implicitely means bad though) - - m_status = new PixelMonProfiles("Map_Of_Modules_Status", ("Modules Status (0=Active+Good, 1=Active+Bad, 2=Inactive)" + m_histTitleExt).c_str()); - 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()); - sc = m_status_mon->regHist(statusHistos); - m_status_mon->SetMaxValue( 2.0 ); - - //m_disabled = new PixelMonProfiles("Map_Of_Modules_Disabled", ("Modules Disabled" + m_histTitleExt).c_str()); - //sc = m_disabled->regHist(statusHistos); - //m_disabled->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); - + if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "starting Book Status" << endmsg; + + std::string path = "Pixel/Status"; + if (m_doOnTrack) path.replace(path.begin(), path.end(), "Pixel/StatusOnTrack"); + if (m_doOnPixelTrack) path.replace(path.begin(), path.end(), "Pixel/StatusOnPixelTrack"); + MonGroup statusHistos( this, path.c_str(), run, ATTRIB_MANAGED ); //declare a group of histograms + + // use the following definitions for modules states: + // GOOD = active + good + // DISABLED "BAD" = active + bad + // DISABLED "INACTIVE" = inactive + good/bad (inactive implicitely means bad though) + + m_status = new PixelMonProfiles("Map_Of_Modules_Status", ("Modules Status (0=Active+Good, 1=Active+Bad, 2=Inactive)" + m_histTitleExt).c_str()); + 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()); + 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); m_Status_modules->SetBinLabel( "Status",2 ); m_Status_modules->formatHist("status",m_doIBL); - } - if(m_doOffline) - { + } + 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()); sc = m_dqStatus->regHist(statusHistos); - } - std::string tmp; - std::string tmp2; - - int nbins_LB = m_lbRange; double min_LB = -0.5; double max_LB = min_LB + (1.0*nbins_LB); - std::string atext_LB = ";lumi block"; - std::string atext_nmod = ";# modules/event"; - const std::string modlabel[PixLayerIBL2D3D::COUNT] = {"ECA", "ECC", "B0", "B1", "B2", "IBL", "IBL2D", "IBL3D"}; - - for( int i=0; i<PixLayerIBL2D3D::COUNT; i++){ - tmp = makeHistname(("BadModules_per_lumi_"+modlabel[i]), false); - tmp2 = makeHisttitle(("Number of bad modules (bad+active) per event per LB, "+modlabel[i]), (atext_LB+atext_nmod), false); - sc = statusHistos.regHist(m_badModules_per_lumi_mod[i] = TProfile_LW::create(tmp.c_str(), (tmp2+m_histTitleExt+atext_LB+atext_nmod).c_str(), nbins_LB, min_LB, max_LB)); - - tmp = makeHistname(("DisabledModules_per_lumi_"+modlabel[i]), false); - tmp2 = makeHisttitle(("Number of disabled modules per event per LB, "+modlabel[i]), (atext_LB+atext_nmod), false); - sc = statusHistos.regHist(m_disabledModules_per_lumi_mod[i] = TProfile_LW::create(tmp.c_str(), (tmp2+m_histTitleExt+atext_LB+atext_nmod).c_str(), nbins_LB, min_LB, max_LB)); - - tmp = makeHistname(("BadDisabledModules_per_lumi_"+modlabel[i]), false); - tmp2 = makeHisttitle(("Number of disabled & bad modules per event per LB, "+modlabel[i]), (atext_LB+atext_nmod), false); - sc = statusHistos.regHist(m_baddisabledModules_per_lumi_mod[i] = TProfile_LW::create(tmp.c_str(), (tmp2+m_histTitleExt+atext_LB+atext_nmod).c_str(), nbins_LB, min_LB, max_LB)); - } + } + + std::string tmp; + std::string tmp2; + + int nbins_LB = m_lbRange; double min_LB = -0.5; double max_LB = min_LB + (1.0*nbins_LB); + std::string atext_LB = ";lumi block"; + std::string atext_nmod = ";# modules/event"; + const std::string modlabel[PixLayerIBL2D3D::COUNT] = {"ECA", "ECC", "B0", "B1", "B2", "IBL", "IBL2D", "IBL3D"}; + + for (int i=0; i<PixLayerIBL2D3D::COUNT; i++) { + tmp = makeHistname(("BadModules_per_lumi_"+modlabel[i]), false); + tmp2 = makeHisttitle(("Number of bad modules (bad+active) per event per LB, "+modlabel[i]), (atext_LB+atext_nmod), false); + sc = statusHistos.regHist(m_badModules_per_lumi_mod[i] = TProfile_LW::create(tmp.c_str(), (tmp2+m_histTitleExt+atext_LB+atext_nmod).c_str(), nbins_LB, min_LB, max_LB)); + + tmp = makeHistname(("DisabledModules_per_lumi_"+modlabel[i]), false); + tmp2 = makeHisttitle(("Number of disabled modules per event per LB, "+modlabel[i]), (atext_LB+atext_nmod), false); + sc = statusHistos.regHist(m_disabledModules_per_lumi_mod[i] = TProfile_LW::create(tmp.c_str(), (tmp2+m_histTitleExt+atext_LB+atext_nmod).c_str(), nbins_LB, min_LB, max_LB)); + + tmp = makeHistname(("BadDisabledModules_per_lumi_"+modlabel[i]), false); + tmp2 = makeHisttitle(("Number of disabled & bad modules per event per LB, "+modlabel[i]), (atext_LB+atext_nmod), false); + sc = statusHistos.regHist(m_baddisabledModules_per_lumi_mod[i] = TProfile_LW::create(tmp.c_str(), (tmp2+m_histTitleExt+atext_LB+atext_nmod).c_str(), nbins_LB, min_LB, max_LB)); + } - tmp = makeHistname("DisabledModules_per_lumi_PIX", false); - tmp2 = makeHisttitle("Number of disabled modules per event per LB for Pixel barrel", (atext_LB+atext_nmod), false); - sc = statusHistos.regHist(m_disabledModules_per_lumi_PIX = TProfile_LW::create(tmp.c_str(), (tmp2+m_histTitleExt+atext_LB+atext_nmod).c_str(), nbins_LB, min_LB, max_LB)); + tmp = makeHistname("DisabledModules_per_lumi_PIX", false); + tmp2 = makeHisttitle("Number of disabled modules per event per LB for Pixel barrel", (atext_LB+atext_nmod), false); + sc = statusHistos.regHist(m_disabledModules_per_lumi_PIX = TProfile_LW::create(tmp.c_str(), (tmp2+m_histTitleExt+atext_LB+atext_nmod).c_str(), nbins_LB, min_LB, max_LB)); - if(sc.isFailure())if(msgLvl(MSG::WARNING)) msg(MSG::WARNING) << "histograms not booked" << endmsg; - return StatusCode::SUCCESS; + if (sc.isFailure())if(msgLvl(MSG::WARNING)) msg(MSG::WARNING) << "histograms not booked" << endmsg; + return StatusCode::SUCCESS; } StatusCode PixelMainMon::BookStatusLumiBlockMon(void) { - if(msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "starting Book Status for lowStat" << endmsg; + if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "starting Book Status for lowStat" << endmsg; - std::string path = "Pixel/LumiBlock"; - if(m_doOnTrack) path.replace(path.begin(), path.end(), "Pixel/LumiBlockOnTrack"); - if(m_doOnPixelTrack) path.replace(path.begin(), path.end(), "Pixel/LumiBlockOnPixelTrack"); - MonGroup lumiBlockHist(this, path.c_str(), lowStat, ATTRIB_MANAGED); //declare a group of histograms + std::string path = "Pixel/LumiBlock"; + if (m_doOnTrack) path.replace(path.begin(), path.end(), "Pixel/LumiBlockOnTrack"); + 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()); - sc = m_status_LB->regHist(lumiBlockHist); - m_status_LB->SetMaxValue( 2.0 ); + m_status_LB = new PixelMonProfiles("Map_Of_Modules_Status_LB", ("Module Status (0=Active+Good, 1=Active+Bad, 2=Inactive)"+ m_histTitleExt).c_str()); + sc = m_status_LB->regHist(lumiBlockHist); + m_status_LB->SetMaxValue( 2.0 ); - if(sc.isFailure())if(msgLvl(MSG::WARNING)) msg(MSG::WARNING) << "histograms not booked" << endmsg; - return StatusCode::SUCCESS; + if(sc.isFailure())if(msgLvl(MSG::WARNING)) msg(MSG::WARNING) << "histograms not booked" << endmsg; + return StatusCode::SUCCESS; } StatusCode PixelMainMon::FillStatusMon(void) { - int Index = -1; - PixelID::const_id_iterator idIt = m_pixelid->wafer_begin(); - PixelID::const_id_iterator idItEnd = m_pixelid->wafer_end(); + int Index = -1; + PixelID::const_id_iterator idIt = m_pixelid->wafer_begin(); + PixelID::const_id_iterator idItEnd = m_pixelid->wafer_end(); - int nBad=0; - int nBad_mod[PixLayerIBL2D3D::COUNT]={0}; + int nBad=0; + int nBad_mod[PixLayerIBL2D3D::COUNT]={0}; + + int nDisabled=0; + int nDisabled_mod[PixLayerIBL2D3D::COUNT]={0}; - int nDisabled=0; - int nDisabled_mod[PixLayerIBL2D3D::COUNT]={0}; + if (m_isNewLumiBlock && m_Status_modules) m_Status_modules->Reset(); - if(m_isNewLumiBlock && m_Status_modules) m_Status_modules->Reset(); - - for (; idIt != idItEnd; ++idIt) - { + for (; idIt != idItEnd; ++idIt) + { Identifier WaferID = *idIt; IdentifierHash id_hash = m_pixelid->wafer_hash(WaferID); int pixlayer = GetPixLayerID(m_pixelid->barrel_ec(WaferID), m_pixelid->layer_disk(WaferID), m_doIBL); int pixlayeribl2d3d = 0; - if( pixlayer == PixLayer::kIBL ){ + if ( pixlayer == PixLayer::kIBL ) { pixlayeribl2d3d = GetPixLayerIDIBL2D3D(m_pixelid->barrel_ec(WaferID), m_pixelid->layer_disk(WaferID), m_pixelid->eta_module(WaferID), m_doIBL); } - if( pixlayer == 99 ) continue; + if ( pixlayer == 99 ) continue; // check in order of occurrence to reduce number of calls to conditions service if (m_pixelCondSummarySvc->isActive(id_hash) == true && m_pixelCondSummarySvc->isGood(id_hash) == true ) {Index=0;} 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_disabled) m_disabled->Fill(WaferID, m_pixelid, 1.0, m_doIBL); + 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_doLumiBlock){ - if(m_status_LB) m_status_LB->Fill(WaferID,m_pixelid,Index,m_doIBL); + if (m_doLumiBlock){ + if (m_status_LB) m_status_LB->Fill(WaferID,m_pixelid,Index,m_doIBL); } - if(Index > 0) // bad but active modules + if (Index > 0) // bad but active modules { - if (Index == 1) { - nBad++; - nBad_mod[pixlayer]++; - if(pixlayeribl2d3d != 0) nBad_mod[pixlayeribl2d3d]++; - } - // inactive or bad modules - // should maybe use only inactive modules for these, however, since tracking etc use "disabled module" as !(active+good) - // continue monitoring that quantity for now - if(Index == 2) - { + if (Index == 1) { + nBad++; + nBad_mod[pixlayer]++; + if(pixlayeribl2d3d != 0) nBad_mod[pixlayeribl2d3d]++; + } + // inactive or bad modules + // should maybe use only inactive modules for these, however, since tracking etc use "disabled module" as !(active+good) + // continue monitoring that quantity for now + if (Index == 2) + { nDisabled++; nDisabled_mod[pixlayer]++; if(pixlayeribl2d3d != 0) nDisabled_mod[pixlayeribl2d3d]++; - } + } - if (m_Status_modules) - { + if (m_Status_modules) + { int diffToFill=0; double content = floor(m_Status_modules->GetBinContent(1.5,WaferID,m_pixelid)); // 1.5 refers to the bin [1,2] // If we have module in state 1 (active+bad), and get 2 later (inactive), want to add 1 it to put module in state 2 - if(content==2) - { - diffToFill=0; - } - else if(content==1 && (Index==2)) - { - diffToFill=1; - } - else if(content==0) - { - 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 + if (content==2) + { + diffToFill=0; + } + else if (content==1 && (Index==2)) + { + diffToFill=1; + } + else if (content==0) + { + 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 } } - } // End of loop - - //static float nmod[PixLayer::COUNT] = {144., 144., 286., 494., 676., 280.}; - static float nmod2[PixLayerIBL2D3D::COUNT] = {144., 144., 286., 494., 676., 280., 168., 112.}; - - for(int i=0 ; i<PixLayerIBL2D3D::COUNT ; i++){ - if(m_badModules_per_lumi_mod[i] && nmod2[i] > 0) m_badModules_per_lumi_mod[i]->Fill( m_manager->lumiBlockNumber(), nBad_mod[i]/nmod2[i] ); - if(m_disabledModules_per_lumi_mod[i]) m_disabledModules_per_lumi_mod[i]->Fill( m_manager->lumiBlockNumber(), nDisabled_mod[i] ); - if(m_baddisabledModules_per_lumi_mod[i]) m_baddisabledModules_per_lumi_mod[i]->Fill(m_manager->lumiBlockNumber(),nDisabled_mod[i]+nBad_mod[i]); - } - if(m_disabledModules_per_lumi_PIX) m_disabledModules_per_lumi_PIX->Fill( m_manager->lumiBlockNumber(), nDisabled_mod[PixLayerIBL2D3D::kB0] + nDisabled_mod[PixLayerIBL2D3D::kB1] + nDisabled_mod[PixLayerIBL2D3D::kB2]); - - if (nDisabled > (1744+280*m_doIBL)*0.50) { - m_majorityDisabled = true; - } - else { - m_majorityDisabled = false; - } - - if(m_doRefresh && m_status_mon) m_status_mon->Reset(); - - return StatusCode::SUCCESS; - + } // of pixelid wafer loop + + static float nmod_per_layer[PixLayerIBL2D3D::COUNT] = {144., 144., 286., 494., 676., 280., 168., 112.}; + + for (int i=0 ; i<PixLayerIBL2D3D::COUNT ; i++){ + if (m_badModules_per_lumi_mod[i] && nmod_per_layer[i] > 0) m_badModules_per_lumi_mod[i]->Fill( m_manager->lumiBlockNumber(), nBad_mod[i]/nmod_per_layer[i] ); + if (m_disabledModules_per_lumi_mod[i]) m_disabledModules_per_lumi_mod[i]->Fill( m_manager->lumiBlockNumber(), nDisabled_mod[i] ); + if (m_baddisabledModules_per_lumi_mod[i]) m_baddisabledModules_per_lumi_mod[i]->Fill(m_manager->lumiBlockNumber(),nDisabled_mod[i]+nBad_mod[i]); + } + if (m_disabledModules_per_lumi_PIX) m_disabledModules_per_lumi_PIX->Fill( m_manager->lumiBlockNumber(), nDisabled_mod[PixLayerIBL2D3D::kB0] + nDisabled_mod[PixLayerIBL2D3D::kB1] + nDisabled_mod[PixLayerIBL2D3D::kB2]); + + if (nDisabled > (1744+280*m_doIBL)*0.50) { + m_majorityDisabled = true; + } + else { + m_majorityDisabled = false; + } + + if (m_doRefresh && m_status_mon) m_status_mon->Reset(); + + return StatusCode::SUCCESS; } StatusCode PixelMainMon::ProcStatusMon(void) { - if(m_status && m_dqStatus && m_occupancy) - { - if(m_doIBL){ - for(int i=1;i<=12;i++){ - for(int j=1;j<=14;j++){ - m_dqStatus->IBL2D->SetBinContent(i,j, m_occupancy->IBL2D->GetBinContent(i,j) + m_status->IBL2D->GetBinContent(i,j) ); - } - } - for(int i=1;i<=8;i++){ - for(int j=1;j<=14;j++){ - m_dqStatus->IBL3D->SetBinContent(i,j, m_occupancy->IBL3D->GetBinContent(i,j) + m_status->IBL3D->GetBinContent(i,j) ); - } - } + if (m_status && m_dqStatus && m_occupancy) + { + if (m_doIBL) { + for (int i=1;i<=12;i++) { + for (int j=1;j<=14;j++) { + m_dqStatus->IBL2D->SetBinContent(i,j, m_occupancy->IBL2D->GetBinContent(i,j) + m_status->IBL2D->GetBinContent(i,j) ); + } + } + for (int i=1;i<=8;i++) { + for (int j=1;j<=14;j++) { + m_dqStatus->IBL3D->SetBinContent(i,j, m_occupancy->IBL3D->GetBinContent(i,j) + m_status->IBL3D->GetBinContent(i,j) ); + } + } } - for(int i=1;i<=13;i++){ - for(int j=1;j<=22;j++) - m_dqStatus->B0->SetBinContent(i,j, m_occupancy->B0->GetBinContent(i,j) + m_status->B0->GetBinContent(i,j) ); - for(int j=1;j<=38;j++) - m_dqStatus->B1->SetBinContent(i,j, m_occupancy->B1->GetBinContent(i,j) + m_status->B1->GetBinContent(i,j) ); - for(int j=1;j<=52;j++) - m_dqStatus->B2->SetBinContent(i,j, m_occupancy->B2->GetBinContent(i,j) + m_status->B2->GetBinContent(i,j) ); - } - for(int i=1;i<=48;i++){ - for(int j=1;j<=3;j++){ - m_dqStatus->A->SetBinContent(j,i, m_occupancy->A->GetBinContent(j,i) + m_status->A->GetBinContent(j,i) ); - m_dqStatus->C->SetBinContent(j,i, m_occupancy->C->GetBinContent(j,i) + m_status->C->GetBinContent(j,i) ); - } - } - } - return StatusCode::SUCCESS; + for (int i=1;i<=13;i++) { + for (int j=1;j<=22;j++) + m_dqStatus->B0->SetBinContent(i,j, m_occupancy->B0->GetBinContent(i,j) + m_status->B0->GetBinContent(i,j) ); + for (int j=1;j<=38;j++) + m_dqStatus->B1->SetBinContent(i,j, m_occupancy->B1->GetBinContent(i,j) + m_status->B1->GetBinContent(i,j) ); + for (int j=1;j<=52;j++) + m_dqStatus->B2->SetBinContent(i,j, m_occupancy->B2->GetBinContent(i,j) + m_status->B2->GetBinContent(i,j) ); + } + for (int i=1;i<=48;i++) { + for (int j=1;j<=3;j++) { + m_dqStatus->A->SetBinContent(j,i, m_occupancy->A->GetBinContent(j,i) + m_status->A->GetBinContent(j,i) ); + m_dqStatus->C->SetBinContent(j,i, m_occupancy->C->GetBinContent(j,i) + m_status->C->GetBinContent(j,i) ); + } + } + } + return StatusCode::SUCCESS; } diff --git a/InnerDetector/InDetMonitoring/PixelMonitoring/src/Track.cxx b/InnerDetector/InDetMonitoring/PixelMonitoring/src/Track.cxx index 229ead3c09b538c767d51b67f8535af52dc6bc54..3d62958a6dd0e81c4882b85e49df9ec53c340155 100644 --- a/InnerDetector/InDetMonitoring/PixelMonitoring/src/Track.cxx +++ b/InnerDetector/InDetMonitoring/PixelMonitoring/src/Track.cxx @@ -10,8 +10,6 @@ #include "InDetRawData/InDetTimeCollection.h" #include "TrkSpacePoint/SpacePointContainer.h" #include "InDetPrepRawData/PixelClusterContainer.h" -//#include "TrkParameters/MeasuredAtaPlane.h" -//#include "TrkParameters/MeasuredPerigee.h" #include "InDetConditionsSummaryService/IInDetConditionsSvc.h" #include "TrkParameters/TrackParameters.h" #include "InDetRIO_OnTrack/SiClusterOnTrack.h" @@ -50,167 +48,164 @@ /////////////////////////////////////////////////////////////////////////////// StatusCode PixelMainMon::BookTrackMon(void) { - if(msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "starting Book Tracks" << endmsg; - - std::string path = "Pixel/Track"; - if(m_doOnTrack) path.replace(path.begin(), path.end(), "Pixel/TrackOnTrack"); - if(m_doOnPixelTrack) path.replace(path.begin(), path.end(), "Pixel/TrackOnPixelTrack"); - MonGroup trackHistos( this, path.c_str(), run, ATTRIB_MANAGED ); //declare a group of histograms - - std::string modlabel[9]; - modlabel[0]="ECA"; modlabel[1]="ECC"; - modlabel[2]="B0"; modlabel[3]="B1"; modlabel[4]="B2"; - modlabel[5]="IBL"; modlabel[6]="IBL2D"; modlabel[7]="IBL3D"; - std::string hname; - std::string htitles; - - int nbins_LB = m_lbRange; double min_LB = -0.5; double max_LB = min_LB + (1.0*nbins_LB); - - /// - /// Track Parameter - /// - sc = trackHistos.regHist(m_track_res_phi = TH1F_LW::create("Track_res_phi", ("Pixel Residual LocX(phi)" + m_histTitleExt).c_str(),100,-0.1,0.1)); - sc = trackHistos.regHist(m_track_res_eta = TH1F_LW::create("Track_res_eta", ("Pixel Residual LocY(eta)" + m_histTitleExt).c_str(),100,-0.3,0.3)); - sc = trackHistos.regHist(m_track_pull_phi = TH1F_LW::create("Track_pull_phi", ("Pixel pull LocX(phi)" + m_histTitleExt).c_str(),100,-1.2,1.2)); - sc = trackHistos.regHist(m_track_pull_eta = TH1F_LW::create("Track_pull_eta", ("Pixel pull LocY(eta)" + m_histTitleExt).c_str(),100,-2.0,2.0)); - sc = trackHistos.regHist(m_track_chi2 = TH1F_LW::create("Track_chi2", ("chi2 of rec. track" + m_histTitleExt + ";#chi^{2}/DoF;#tracks").c_str(), 50,-0.,10.)); - sc = trackHistos.regHist(m_tracksPerEvt_per_lumi = TProfile_LW::create("tracksPerEvt_per_lumi", ("Number of tracks per event per LB" + m_histTitleExt + ";lumi block;tracks/event").c_str(), nbins_LB, min_LB, max_LB)); - //sc=trackHistos.regHist(m_tracksPerEvtPerMu_per_lumi = TProfile_LW::create("tracksPerEvtPerMu_per_lumi", ("Number of tracks per event per mu per LB (pixel tracks)" + m_histTitleExt + ";lumi block;tracks/event").c_str(), m_lbRange, -0.5, -0.5+(float)m_lbRange)); - - /// - /// Lorentz Angle - /// - hname = makeHistname("LorentzAngle_IBL", false); - htitles = makeHisttitle("Lorentz angle IBL", ";#phi of track incidence [rad];phi module index;cluster row (phi) width [pixels]", false); - sc = trackHistos.regHist(m_LorentzAngle_IBL = TProfile2D_LW::create(hname.c_str(), htitles.c_str(), 100, -0.4, 0.6, 14, -0.5, 13.5)); - hname = makeHistname("LorentzAngle_IBL2D", false); - htitles = makeHisttitle("Lorentz angle IBL2D", ";#phi of track incidence [rad];phi module index;cluster row (phi) width [pixels]", false); - sc = trackHistos.regHist(m_LorentzAngle_IBL2D = TProfile2D_LW::create(hname.c_str(), htitles.c_str(), 100, -0.4, 0.6, 14, -0.5, 13.5)); - hname = makeHistname("LorentzAngle_IBL3D", false); - htitles = makeHisttitle("Lorentz angle IBL3D", ";#phi of track incidence [rad];phi module index;cluster row (phi) width [pixels]", false); - sc = trackHistos.regHist(m_LorentzAngle_IBL3D = TProfile2D_LW::create(hname.c_str(), htitles.c_str(), 100, -0.4, 0.6, 14, -0.5, 13.5)); - hname = makeHistname("LorentzAngle_B0", false); - htitles = makeHisttitle("Lorentz angle B0", ";#phi of track incidence [rad];phi module index;cluster row (phi) width [pixels]", false); - sc = trackHistos.regHist(m_LorentzAngle_B0 = TProfile2D_LW::create(hname.c_str(), htitles.c_str(), 100, -0.4, 0.6, 22, -0.5, 21.5)); - hname = makeHistname("LorentzAngle_B1", false); - htitles = makeHisttitle("Lorentz angle B1", ";#phi of track incidence [rad];phi module index;cluster row (phi) width [pixels]", false); - sc = trackHistos.regHist(m_LorentzAngle_B1 = TProfile2D_LW::create(hname.c_str(), htitles.c_str(), 100, -0.4, 0.6, 38, -0.5, 37.5)); - hname = makeHistname("LorentzAngle_B2", false); - htitles = makeHisttitle("Lorentz angle B2", ";#phi of track incidence [rad];phi module index;cluster row (phi) width [pixels]", false); - sc = trackHistos.regHist(m_LorentzAngle_B2 = TProfile2D_LW::create(hname.c_str(), htitles.c_str(), 100, -0.4, 0.6, 52, -0.5, 51.5)); - - if(m_LorentzAngle_IBL) m_LorentzAngle_IBL->SetOption("colz"); - if(m_LorentzAngle_IBL2D) m_LorentzAngle_IBL2D->SetOption("colz"); - if(m_LorentzAngle_IBL3D) m_LorentzAngle_IBL3D->SetOption("colz"); - if(m_LorentzAngle_B0) m_LorentzAngle_B0->SetOption("colz"); - if(m_LorentzAngle_B1) m_LorentzAngle_B1->SetOption("colz"); - if(m_LorentzAngle_B2) m_LorentzAngle_B2->SetOption("colz"); - - sc=trackHistos.regHist(m_degFactorMap_per_lumi = TProfile_LW::create("degFactorMap_per_lumi", ("deg. factor per lumi" + m_histTitleExt + ";lumi block;avg deg. factor").c_str(), nbins_LB, min_LB, max_LB)); - sc=trackHistos.regHist(m_degFactorMap = TProfile2D_LW::create("degFactorMap", ("deg. factor map" + m_histTitleExt + ";track #eta;track #phi").c_str(), 60, -3.0, 3.0, 60, -3.0, 3.0)); - m_degFactorMap->SetOption("colz"); - m_degFactorMap->SetMinimum(1.0); - 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_measratio = new PixelMon2DProfilesLW("TSOS_MeasRatio", ("TSOS of type Meas per track" + m_histTitleExt), m_doIBL, false, true); - //sc = m_tsos_measratio->regHist(trackHistos); - //m_tsos_holeratio = new PixelMon2DProfilesLW("TSOS_HoleRatio", ("TSOS of type Hole per track" + m_histTitleExt), m_doIBL, false, true); - //sc = m_tsos_holeratio->regHist(trackHistos); - //m_misshits_ratio = new PixelMon2DProfilesLW("MissHitsRatioOnTrack", ("Hole+Outlier per track" + m_histTitleExt), m_doIBL, false, true); - //sc = m_misshits_ratio->regHist(trackHistos); - } - if(m_doOnline){ - m_tsos_holeratio_tmp = new PixelMon2DProfilesLW("HoleRatio_tmp", ("TSOS of type Hole per track tmp" + m_histTitleExt), m_doIBL, false, true); - sc = m_tsos_holeratio_tmp->regHist(trackHistos); - m_tsos_holeratio_mon = new PixelMon2DProfilesLW("HoleRatio_mon", ("TSOS of type Hole per track for monitoring" + m_histTitleExt), m_doIBL, false, true); - sc = m_tsos_holeratio_mon->regHist(trackHistos); - m_misshits_ratio_tmp = new PixelMon2DProfilesLW("MissHitsRatioOnTrack_tmp", ("Hole+Outlier per track" + m_histTitleExt), m_doIBL, false, true); - sc = m_misshits_ratio_tmp->regHist(trackHistos); - m_misshits_ratio_mon = new PixelMon2DProfilesLW("MissHitsRatioOnTrack_mon", ("Hole+Outlier per track for monitoring" + m_histTitleExt), m_doIBL, false, true); - sc = m_misshits_ratio_mon->regHist(trackHistos); - } - - 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); - 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)); - sc=trackHistos.regHist(m_1hitclustot_lowpt = TH1F_LW::create("m_1hitclustot_lowpt",("1-Hit cluster ToT vs track pT (pT<10GeV)" + m_histTitleExt + "; Track pT; Cluster ToT (on track)").c_str(),250,0,250)); - sc=trackHistos.regHist(m_1hitclustot_highpt = TH1F_LW::create("m_1hitclustot_highpt",("1-Hit cluster ToT vs track pT (pT>=10GeV)" + m_histTitleExt + "; Track pT; Cluster ToT (on track)").c_str(),250,0,250)); - sc=trackHistos.regHist(m_2hitclustot_lowpt = TH1F_LW::create("m_2hitclustot_lowpt",("2-Hit cluster ToT vs track pT (pT<10GeV)" + m_histTitleExt + "; Track pT; Cluster ToT (on track)").c_str(),250,0,250)); - sc=trackHistos.regHist(m_2hitclustot_highpt = TH1F_LW::create("m_2hitclustot_highpt",("2-Hit 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_vs_pt = TH2F_LW::create("m_clustot_vs_pt",("Cluster ToT vs Track pT" + m_histTitleExt + "; Track pT; Cluster ToT (on track)").c_str(),10,0,50,250,0,250)); - sc=trackHistos.regHist(m_track_chi2_bcl1 = TH1F_LW::create("m_Pixel_track_chi2_bcl1", ("track chi2 with 1 1-hit, low-ToT cluster" + m_histTitleExt + "; #chi^{ 2}/DoF;").c_str(), 50,-0.,10.)); - sc=trackHistos.regHist(m_track_chi2_bcl0 = TH1F_LW::create("m_Pixel_track_chi2_bcl0", ("track chi2 with 0 1-hit, low-ToT clusters" + m_histTitleExt + "; #chi^ {2}/DoF;").c_str(), 50,-0.,10.)); - sc=trackHistos.regHist(m_track_chi2_bclgt1 = TH1F_LW::create("m_Pixel_track_chi2_bclgt1", ("track chi2 with >1 1-hit, low-ToT cluster" + m_histTitleExt + "; # chi^{2}/DoF;").c_str(), 50,-0.,10.)); - sc=trackHistos.regHist(m_track_chi2_bcl1_highpt = TH1F_LW::create("m_Pixel_track_chi2_bcl1_highpt", ("track chi2 with 1 1-hit, low-ToT cluster (pT>=10GeV)" + m_histTitleExt + "; #chi^{2}/DoF;").c_str(), 50,-0.,10.)); - sc=trackHistos.regHist(m_track_chi2_bcl0_highpt = TH1F_LW::create("m_Pixel_track_chi2_bcl0_highpt", ("track chi2 with 0 1-hit, low-ToT clusters (pT>=10GeV)" + m_histTitleExt + "; #chi^{2}/DoF;").c_str(), 50,-0.,10.)); - sc=trackHistos.regHist(m_track_chi2_bclgt1_highpt = TH1F_LW::create("m_Pixel_track_chi2_bclgt1_highpt", ("track chi2 with >1 1-hit, low-ToT cluster (pT>=10GeV)" + m_histTitleExt + "; #chi^{2}/DoF;").c_str(), 50,-0.,10.)); - } - } - - for(int i=0; i<PixLayerDisk::COUNT; i++){ - hname = makeHistname(("HitEff_all_"+m_modLabel_PixLayerDisk[i]), false); - htitles = makeHisttitle(("hit efficiency, "+m_modLabel_PixLayerDisk[i]), ";lumi block;hit efficiency", false); - sc = trackHistos.regHist(m_hiteff_incl_mod[i] = TProfile_LW::create(hname.c_str(), htitles.c_str(), nbins_LB, min_LB, max_LB)); - } + if(msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "starting Book Tracks" << endmsg; + + std::string path = "Pixel/Track"; + if(m_doOnTrack) path.replace(path.begin(), path.end(), "Pixel/TrackOnTrack"); + if(m_doOnPixelTrack) path.replace(path.begin(), path.end(), "Pixel/TrackOnPixelTrack"); + MonGroup trackHistos( this, path.c_str(), run, ATTRIB_MANAGED ); //declare a group of histograms + + std::string modlabel[9]; + modlabel[0]="ECA"; modlabel[1]="ECC"; + modlabel[2]="B0"; modlabel[3]="B1"; modlabel[4]="B2"; + modlabel[5]="IBL"; modlabel[6]="IBL2D"; modlabel[7]="IBL3D"; + std::string hname; + std::string htitles; + + int nbins_LB = m_lbRange; double min_LB = -0.5; double max_LB = min_LB + (1.0*nbins_LB); + + /// + /// Track Parameter + /// + sc = trackHistos.regHist(m_track_res_phi = TH1F_LW::create("Track_res_phi", ("Pixel Residual LocX(phi)" + m_histTitleExt).c_str(),100,-0.1,0.1)); + sc = trackHistos.regHist(m_track_res_eta = TH1F_LW::create("Track_res_eta", ("Pixel Residual LocY(eta)" + m_histTitleExt).c_str(),100,-0.3,0.3)); + sc = trackHistos.regHist(m_track_pull_phi = TH1F_LW::create("Track_pull_phi", ("Pixel pull LocX(phi)" + m_histTitleExt).c_str(),100,-1.2,1.2)); + sc = trackHistos.regHist(m_track_pull_eta = TH1F_LW::create("Track_pull_eta", ("Pixel pull LocY(eta)" + m_histTitleExt).c_str(),100,-2.0,2.0)); + sc = trackHistos.regHist(m_track_chi2 = TH1F_LW::create("Track_chi2", ("chi2 of rec. track" + m_histTitleExt + ";#chi^{2}/DoF;#tracks").c_str(), 50,-0.,10.)); + sc = trackHistos.regHist(m_tracksPerEvt_per_lumi = TProfile_LW::create("tracksPerEvt_per_lumi", ("Number of tracks per event per LB" + m_histTitleExt + ";lumi block;tracks/event").c_str(), nbins_LB, min_LB, max_LB)); + + /// + /// Lorentz Angle + /// + hname = makeHistname("LorentzAngle_IBL", false); + htitles = makeHisttitle("Lorentz angle IBL", ";#phi of track incidence [rad];phi module index;cluster row (phi) width [pixels]", false); + sc = trackHistos.regHist(m_LorentzAngle_IBL = TProfile2D_LW::create(hname.c_str(), htitles.c_str(), 100, -0.4, 0.6, 14, -0.5, 13.5)); + hname = makeHistname("LorentzAngle_IBL2D", false); + htitles = makeHisttitle("Lorentz angle IBL2D", ";#phi of track incidence [rad];phi module index;cluster row (phi) width [pixels]", false); + sc = trackHistos.regHist(m_LorentzAngle_IBL2D = TProfile2D_LW::create(hname.c_str(), htitles.c_str(), 100, -0.4, 0.6, 14, -0.5, 13.5)); + hname = makeHistname("LorentzAngle_IBL3D", false); + htitles = makeHisttitle("Lorentz angle IBL3D", ";#phi of track incidence [rad];phi module index;cluster row (phi) width [pixels]", false); + sc = trackHistos.regHist(m_LorentzAngle_IBL3D = TProfile2D_LW::create(hname.c_str(), htitles.c_str(), 100, -0.4, 0.6, 14, -0.5, 13.5)); + hname = makeHistname("LorentzAngle_B0", false); + htitles = makeHisttitle("Lorentz angle B0", ";#phi of track incidence [rad];phi module index;cluster row (phi) width [pixels]", false); + sc = trackHistos.regHist(m_LorentzAngle_B0 = TProfile2D_LW::create(hname.c_str(), htitles.c_str(), 100, -0.4, 0.6, 22, -0.5, 21.5)); + hname = makeHistname("LorentzAngle_B1", false); + htitles = makeHisttitle("Lorentz angle B1", ";#phi of track incidence [rad];phi module index;cluster row (phi) width [pixels]", false); + sc = trackHistos.regHist(m_LorentzAngle_B1 = TProfile2D_LW::create(hname.c_str(), htitles.c_str(), 100, -0.4, 0.6, 38, -0.5, 37.5)); + hname = makeHistname("LorentzAngle_B2", false); + htitles = makeHisttitle("Lorentz angle B2", ";#phi of track incidence [rad];phi module index;cluster row (phi) width [pixels]", false); + sc = trackHistos.regHist(m_LorentzAngle_B2 = TProfile2D_LW::create(hname.c_str(), htitles.c_str(), 100, -0.4, 0.6, 52, -0.5, 51.5)); + + if (m_LorentzAngle_IBL) m_LorentzAngle_IBL->SetOption("colz"); + if (m_LorentzAngle_IBL2D) m_LorentzAngle_IBL2D->SetOption("colz"); + if (m_LorentzAngle_IBL3D) m_LorentzAngle_IBL3D->SetOption("colz"); + if (m_LorentzAngle_B0) m_LorentzAngle_B0->SetOption("colz"); + if (m_LorentzAngle_B1) m_LorentzAngle_B1->SetOption("colz"); + if (m_LorentzAngle_B2) m_LorentzAngle_B2->SetOption("colz"); + + sc=trackHistos.regHist(m_degFactorMap_per_lumi = TProfile_LW::create("degFactorMap_per_lumi", ("deg. factor per lumi" + m_histTitleExt + ";lumi block;avg deg. factor").c_str(), nbins_LB, min_LB, max_LB)); + sc=trackHistos.regHist(m_degFactorMap = TProfile2D_LW::create("degFactorMap", ("deg. factor map" + m_histTitleExt + ";track #eta;track #phi").c_str(), 60, -3.0, 3.0, 60, -3.0, 3.0)); + m_degFactorMap->SetOption("colz"); + m_degFactorMap->SetMinimum(1.0); + 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_measratio = new PixelMon2DProfilesLW("TSOS_MeasRatio", ("TSOS of type Meas per track" + m_histTitleExt), m_doIBL, false, true); + //sc = m_tsos_measratio->regHist(trackHistos); + //m_tsos_holeratio = new PixelMon2DProfilesLW("TSOS_HoleRatio", ("TSOS of type Hole per track" + m_histTitleExt), m_doIBL, false, true); + //sc = m_tsos_holeratio->regHist(trackHistos); + //m_misshits_ratio = new PixelMon2DProfilesLW("MissHitsRatioOnTrack", ("Hole+Outlier per track" + m_histTitleExt), m_doIBL, false, true); + //sc = m_misshits_ratio->regHist(trackHistos); + } + if (m_doOnline) { + m_tsos_holeratio_tmp = new PixelMon2DProfilesLW("HoleRatio_tmp", ("TSOS of type Hole per track tmp" + m_histTitleExt), m_doIBL, false, true); + sc = m_tsos_holeratio_tmp->regHist(trackHistos); + m_tsos_holeratio_mon = new PixelMon2DProfilesLW("HoleRatio_mon", ("TSOS of type Hole per track for monitoring" + m_histTitleExt), m_doIBL, false, true); + sc = m_tsos_holeratio_mon->regHist(trackHistos); + m_misshits_ratio_tmp = new PixelMon2DProfilesLW("MissHitsRatioOnTrack_tmp", ("Hole+Outlier per track" + m_histTitleExt), m_doIBL, false, true); + sc = m_misshits_ratio_tmp->regHist(trackHistos); + m_misshits_ratio_mon = new PixelMon2DProfilesLW("MissHitsRatioOnTrack_mon", ("Hole+Outlier per track for monitoring" + m_histTitleExt), m_doIBL, false, true); + sc = m_misshits_ratio_mon->regHist(trackHistos); + } + + 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); + 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)); + sc=trackHistos.regHist(m_1hitclustot_lowpt = TH1F_LW::create("m_1hitclustot_lowpt",("1-Hit cluster ToT vs track pT (pT<10GeV)" + m_histTitleExt + "; Track pT; Cluster ToT (on track)").c_str(),250,0,250)); + sc=trackHistos.regHist(m_1hitclustot_highpt = TH1F_LW::create("m_1hitclustot_highpt",("1-Hit cluster ToT vs track pT (pT>=10GeV)" + m_histTitleExt + "; Track pT; Cluster ToT (on track)").c_str(),250,0,250)); + sc=trackHistos.regHist(m_2hitclustot_lowpt = TH1F_LW::create("m_2hitclustot_lowpt",("2-Hit cluster ToT vs track pT (pT<10GeV)" + m_histTitleExt + "; Track pT; Cluster ToT (on track)").c_str(),250,0,250)); + sc=trackHistos.regHist(m_2hitclustot_highpt = TH1F_LW::create("m_2hitclustot_highpt",("2-Hit 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_vs_pt = TH2F_LW::create("m_clustot_vs_pt",("Cluster ToT vs Track pT" + m_histTitleExt + "; Track pT; Cluster ToT (on track)").c_str(),10,0,50,250,0,250)); + sc=trackHistos.regHist(m_track_chi2_bcl1 = TH1F_LW::create("m_Pixel_track_chi2_bcl1", ("track chi2 with 1 1-hit, low-ToT cluster" + m_histTitleExt + "; #chi^{ 2}/DoF;").c_str(), 50,-0.,10.)); + sc=trackHistos.regHist(m_track_chi2_bcl0 = TH1F_LW::create("m_Pixel_track_chi2_bcl0", ("track chi2 with 0 1-hit, low-ToT clusters" + m_histTitleExt + "; #chi^ {2}/DoF;").c_str(), 50,-0.,10.)); + sc=trackHistos.regHist(m_track_chi2_bclgt1 = TH1F_LW::create("m_Pixel_track_chi2_bclgt1", ("track chi2 with >1 1-hit, low-ToT cluster" + m_histTitleExt + "; # chi^{2}/DoF;").c_str(), 50,-0.,10.)); + sc=trackHistos.regHist(m_track_chi2_bcl1_highpt = TH1F_LW::create("m_Pixel_track_chi2_bcl1_highpt", ("track chi2 with 1 1-hit, low-ToT cluster (pT>=10GeV)" + m_histTitleExt + "; #chi^{2}/DoF;").c_str(), 50,-0.,10.)); + sc=trackHistos.regHist(m_track_chi2_bcl0_highpt = TH1F_LW::create("m_Pixel_track_chi2_bcl0_highpt", ("track chi2 with 0 1-hit, low-ToT clusters (pT>=10GeV)" + m_histTitleExt + "; #chi^{2}/DoF;").c_str(), 50,-0.,10.)); + sc=trackHistos.regHist(m_track_chi2_bclgt1_highpt = TH1F_LW::create("m_Pixel_track_chi2_bclgt1_highpt", ("track chi2 with >1 1-hit, low-ToT cluster (pT>=10GeV)" + m_histTitleExt + "; #chi^{2}/DoF;").c_str(), 50,-0.,10.)); + } + } + + for (int i=0; i<PixLayerDisk::COUNT; i++) { + hname = makeHistname(("HitEff_all_"+m_modLabel_PixLayerDisk[i]), false); + htitles = makeHisttitle(("hit efficiency, "+m_modLabel_PixLayerDisk[i]), ";lumi block;hit efficiency", false); + sc = trackHistos.regHist(m_hiteff_incl_mod[i] = TProfile_LW::create(hname.c_str(), htitles.c_str(), nbins_LB, min_LB, max_LB)); + } - if(sc.isFailure())if(msgLvl(MSG::WARNING)) msg(MSG::WARNING) << "histograms not booked" << endmsg; - return StatusCode::SUCCESS; + if (sc.isFailure())if(msgLvl(MSG::WARNING)) msg(MSG::WARNING) << "histograms not booked" << endmsg; + return StatusCode::SUCCESS; } StatusCode PixelMainMon::FillTrackMon(void) { - if(msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "MainFillTrackMon" << endmsg; - - /// - /// Retrieve and Check Store Gate Error - /// - StatusCode sc; - sc = evtStore()->retrieve(m_tracks, m_TracksName); - if (sc.isFailure()) - { - if(msgLvl(MSG::INFO)) msg(MSG::INFO) <<"No tracks in StoreGate found"<< endmsg; - if(m_storegate_errors) m_storegate_errors->Fill(4.,3.); + if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "MainFillTrackMon" << endmsg; + + /// + /// Retrieve and Check Store Gate Error + /// + StatusCode sc; + sc = evtStore()->retrieve(m_tracks, m_TracksName); + if (sc.isFailure()) + { + if (msgLvl(MSG::INFO)) msg(MSG::INFO) <<"No tracks in StoreGate found"<< endmsg; + if (m_storegate_errors) m_storegate_errors->Fill(4.,3.); return StatusCode::SUCCESS; - } else{ - if(msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) <<"Tracks in StoreGate found" <<endmsg; - } - - m_ntracksPerEvent = 0; - //int nTracks=0; - int nPixelHits=0; + } + else + { + if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) <<"Tracks in StoreGate found" <<endmsg; + } + + m_ntracksPerEvent = 0; + int nPixelHits=0; - /// - /// Clear - /// - if(m_doOnTrack || m_doOnPixelTrack)m_RDOIDs.clear();//reset these so you can fill them with the new id's - if(m_doOnTrack || m_doOnPixelTrack)m_ClusterIDs.clear(); + /// + /// Clear + /// + if (m_doOnTrack || m_doOnPixelTrack)m_RDOIDs.clear();//reset these so you can fill them with the new id's + if (m_doOnTrack || m_doOnPixelTrack)m_ClusterIDs.clear(); - /// - /// Track Loop - /// - for (int i=0; i<(int)m_tracks->size(); i++) - { + /// + /// Track Loop + /// + for (int i=0; i<(int)m_tracks->size(); i++) + { const Trk::Track *track0=(*m_tracks)[i]; if (track0 == 0) { - if (msgLvl(MSG::ERROR) ) msg(MSG::ERROR) << "no pointer to track!!!" << endmsg; - break; + if (msgLvl(MSG::ERROR) ) msg(MSG::ERROR) << "no pointer to track!!!" << endmsg; + break; } - - //double mass = 0; - //double dedx = 0; float degradationFactor = 1.0; int nholes=-1; int nbadclus=0; @@ -239,6 +234,7 @@ StatusCode PixelMainMon::FillTrackMon(void) /// /// get the track state on surfaces (a vector, on element per surface) and loop over it /// + nholes = summary->get(Trk::numberOfPixelHoles); if (m_doHoleSearch && !m_doOnline && nholes>0) { track = m_holeSearchTool->getTrackWithHoles(*track0); @@ -248,25 +244,25 @@ StatusCode PixelMainMon::FillTrackMon(void) /// Track Quality Cut /// - if( measPerigee->pT()/1000.0 > 5.0 && fabs(measPerigee->eta()) < 2.5) passQualityCut = true; + if ( measPerigee->pT()/1000.0 > 5.0 && fabs(measPerigee->eta()) < 2.5) passQualityCut = true; - if( ((fabs(measPerigee->eta()) <= 1.65 && summary->get(Trk::numberOfPixelHits)+summary->get(Trk::numberOfSCTHits) >= 9) || - (fabs(measPerigee->eta()) > 1.65 && summary->get(Trk::numberOfPixelHits)+summary->get(Trk::numberOfSCTHits) >= 11) ) && - (summary->get(Trk::numberOfNextToInnermostPixelLayerHits)+summary->get(Trk::numberOfInnermostPixelLayerHits ) > 0 ) && - (summary->get(Trk::numberOfPixelHoles) == 0 ) && - (fabs(measPerigee->parameters()[Trk::d0]) < 2.0) && - (fabs(measPerigee->parameters()[Trk::z0]) < 150.0) ){ - passTightCut = true; + if ( ((fabs(measPerigee->eta()) <= 1.65 && summary->get(Trk::numberOfPixelHits)+summary->get(Trk::numberOfSCTHits) >= 9) || + (fabs(measPerigee->eta()) > 1.65 && summary->get(Trk::numberOfPixelHits)+summary->get(Trk::numberOfSCTHits) >= 11) ) && + (summary->get(Trk::numberOfNextToInnermostPixelLayerHits)+summary->get(Trk::numberOfInnermostPixelLayerHits ) > 0 ) && + (summary->get(Trk::numberOfPixelHoles) == 0 ) && + (fabs(measPerigee->parameters()[Trk::d0]) < 2.0) && + (fabs(measPerigee->parameters()[Trk::z0]) < 150.0) ){ + passTightCut = true; } - if( measPerigee->pT()/1000.0 > 5.0 && - ((fabs(measPerigee->eta()) <= 1.65 && summary->get(Trk::numberOfPixelHits)+summary->get(Trk::numberOfSCTHits) >= 9) || - (fabs(measPerigee->eta()) > 1.65 && summary->get(Trk::numberOfPixelHits)+summary->get(Trk::numberOfSCTHits) >= 11) ) && - (summary->get(Trk::numberOfNextToInnermostPixelLayerHits)+summary->get(Trk::numberOfInnermostPixelLayerHits ) > 0 ) && - (summary->get(Trk::numberOfPixelHoles) < 2 ) && - (fabs(measPerigee->parameters()[Trk::d0]) < 2.0) && - (fabs(measPerigee->parameters()[Trk::z0]) < 150.0) ){ - pass1hole2GeVTightCut = true; + if ( measPerigee->pT()/1000.0 > 5.0 && + ((fabs(measPerigee->eta()) <= 1.65 && summary->get(Trk::numberOfPixelHits)+summary->get(Trk::numberOfSCTHits) >= 9) || + (fabs(measPerigee->eta()) > 1.65 && summary->get(Trk::numberOfPixelHits)+summary->get(Trk::numberOfSCTHits) >= 11) ) && + (summary->get(Trk::numberOfNextToInnermostPixelLayerHits)+summary->get(Trk::numberOfInnermostPixelLayerHits ) > 0 ) && + (summary->get(Trk::numberOfPixelHoles) < 2 ) && + (fabs(measPerigee->parameters()[Trk::d0]) < 2.0) && + (fabs(measPerigee->parameters()[Trk::z0]) < 150.0) ){ + pass1hole2GeVTightCut = true; } /// @@ -275,65 +271,65 @@ StatusCode PixelMainMon::FillTrackMon(void) const DataVector< const Trk::TrackStateOnSurface>* trackStates=track->trackStateOnSurfaces(); for(DataVector< const Trk::TrackStateOnSurface>::const_iterator trackStateOnSurfaceIterator=trackStates->begin(); trackStateOnSurfaceIterator!=trackStates->end(); trackStateOnSurfaceIterator++) { - /// Change the track state on 1 surface into the cluster it represents - Identifier clusID; - Identifier surfaceID; - IdentifierHash id_hash; - const InDet::SiClusterOnTrack *clus=0; - const InDetDD::SiDetectorElement *side = 0; - const Trk::MeasurementBase* mesb=(*trackStateOnSurfaceIterator)->measurementOnTrack(); - - const Trk::RIO_OnTrack* hit = mesb ? dynamic_cast<const Trk::RIO_OnTrack*>(mesb) : 0; + /// Change the track state on 1 surface into the cluster it represents + Identifier clusID; + Identifier surfaceID; + IdentifierHash id_hash; + const InDet::SiClusterOnTrack *clus=0; + const InDetDD::SiDetectorElement *side = 0; + const Trk::MeasurementBase* mesb=(*trackStateOnSurfaceIterator)->measurementOnTrack(); + + const Trk::RIO_OnTrack* hit = mesb ? dynamic_cast<const Trk::RIO_OnTrack*>(mesb) : 0; - //float nMeasurement = 0.; - float nOutlier = 0.; - float nHole = 0.; - float npixHitsInCluster = 0; - //float colWidthOfCluster = 0; - float rowWidthOfCluster = 0; - float totalToTOfCluster = 0; - bool passClusterSelection = false; - - /// - /// Requiements - /// - if(mesb && !hit) continue; // skip pseudomeasurements etc. - if(mesb && mesb->associatedSurface().associatedDetectorElement()) { - surfaceID = mesb->associatedSurface().associatedDetectorElement()->identify(); - side = dynamic_cast<const InDetDD::SiDetectorElement *>( mesb->associatedSurface().associatedDetectorElement() ); - }else{ // holes, perigee - if(not (*trackStateOnSurfaceIterator)->trackParameters() ) { - msg(MSG::INFO) << "pointer of TSOS to track parameters or associated surface is null" << endmsg; - continue; - } - surfaceID = (*trackStateOnSurfaceIterator)->trackParameters()->associatedSurface().associatedDetectorElementIdentifier();//check ptr - } - - if( !m_idHelper->is_pixel(surfaceID)) continue; - - int pixlayer = GetPixLayerID(m_pixelid->barrel_ec(surfaceID), m_pixelid->layer_disk(surfaceID), m_doIBL); - int pixlayerdisk = GetPixLayerDiskID(m_pixelid->barrel_ec(surfaceID), m_pixelid->layer_disk(surfaceID), m_doIBL); - //int pixlayerdbm = GetPixLayerIDDBM(m_pixelid->barrel_ec(surfaceID), m_pixelid->layer_disk(surfaceID), m_doIBL); - int pixlayeribl2d3d = pixlayer; - if( pixlayeribl2d3d == PixLayer::kIBL ){ - pixlayeribl2d3d = GetPixLayerIDIBL2D3D(m_pixelid->barrel_ec(surfaceID), m_pixelid->layer_disk(surfaceID), m_pixelid->eta_module(surfaceID), m_doIBL); - } - if( pixlayer == 99) continue; + //float nMeasurement = 0.; + float nOutlier = 0.; + float nHole = 0.; + float npixHitsInCluster = 0; + //float colWidthOfCluster = 0; + float rowWidthOfCluster = 0; + float totalToTOfCluster = 0; + bool passClusterSelection = false; + + /// + /// Requiements + /// + if (mesb && !hit) continue; // skip pseudomeasurements etc. + if (mesb && mesb->associatedSurface().associatedDetectorElement()) { + surfaceID = mesb->associatedSurface().associatedDetectorElement()->identify(); + side = dynamic_cast<const InDetDD::SiDetectorElement *>( mesb->associatedSurface().associatedDetectorElement() ); + } else { // holes, perigee + if(not (*trackStateOnSurfaceIterator)->trackParameters() ) { + msg(MSG::INFO) << "pointer of TSOS to track parameters or associated surface is null" << endmsg; + continue; + } + surfaceID = (*trackStateOnSurfaceIterator)->trackParameters()->associatedSurface().associatedDetectorElementIdentifier();//check ptr + } + + if ( !m_idHelper->is_pixel(surfaceID)) continue; + + int pixlayer = GetPixLayerID(m_pixelid->barrel_ec(surfaceID), m_pixelid->layer_disk(surfaceID), m_doIBL); + int pixlayerdisk = GetPixLayerDiskID(m_pixelid->barrel_ec(surfaceID), m_pixelid->layer_disk(surfaceID), m_doIBL); + //int pixlayerdbm = GetPixLayerIDDBM(m_pixelid->barrel_ec(surfaceID), m_pixelid->layer_disk(surfaceID), m_doIBL); + int pixlayeribl2d3d = pixlayer; + if ( pixlayeribl2d3d == PixLayer::kIBL ){ + pixlayeribl2d3d = GetPixLayerIDIBL2D3D(m_pixelid->barrel_ec(surfaceID), m_pixelid->layer_disk(surfaceID), m_pixelid->eta_module(surfaceID), m_doIBL); + } + if ( pixlayer == 99) continue; - id_hash = m_pixelid->wafer_hash(surfaceID); - //bool active = m_pixelCondSummarySvc->isActive(id_hash); + id_hash = m_pixelid->wafer_hash(surfaceID); + //bool active = m_pixelCondSummarySvc->isActive(id_hash); - if((*trackStateOnSurfaceIterator)->type(Trk::TrackStateOnSurface::Measurement)){ - clus = dynamic_cast< const InDet::SiClusterOnTrack*>(mesb); - if(clus) clusID = clus->identify(); - //nMeasurement = 1.0; + if ((*trackStateOnSurfaceIterator)->type(Trk::TrackStateOnSurface::Measurement)){ + clus = dynamic_cast< const InDet::SiClusterOnTrack*>(mesb); + 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_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 ); - } + 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_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 ); + } if((*trackStateOnSurfaceIterator)->type(Trk::TrackStateOnSurface::Outlier)){ clus = dynamic_cast< const InDet::SiClusterOnTrack*>((*trackStateOnSurfaceIterator)->measurementOnTrack()); @@ -509,34 +505,10 @@ StatusCode PixelMainMon::FillTrackMon(void) } } - if(nPixelHits>0)//track properties for tracks through the pixel detector - { - //const Trk::Perigee *measPerigee = dynamic_cast< const Trk::Perigee *>(track0->perigeeParameters()); - //if (measPerigee != NULL){ - // //m_track_qOverP->Fill((measPerigee->parameters()[Trk::qOverP]*1000.0)); - // //if (measPerigee->parameters()[Trk::qOverP] != 0) { - // //m_track_qOverP_inv->Fill((1./(measPerigee->parameters()[Trk::qOverP]*1000.0))); - // //m_track_dedx->Fill(1./(measPerigee->parameters()[Trk::qOverP]),dedx); - // //} - // //if (std::abs(mass-139.57)>.00001&&mass>0&&dedx>1.8) m_track_mass_dedx->Fill(mass); - // //m_track_pt->Fill((measPerigee->pT()/1000.0)); - // //m_track_d0->Fill(measPerigee->parameters()[Trk::d0]); - // //m_track_z0->Fill(measPerigee->parameters()[Trk::z0]); - // //m_track_phi0->Fill(measPerigee->parameters()[Trk::phi0]); - // //m_track_theta->Fill(measPerigee->parameters()[Trk::theta]); - // //m_track_eta->Fill(measPerigee->eta()); - // if (track0->fitQuality()->numberDoF() > 0){ - // if(m_track_chi2) m_track_chi2->Fill(track0->fitQuality()->chiSquared()/track0->fitQuality()->numberDoF()); - // if(m_track_chi2_LB) m_track_chi2_LB->Fill(track0->fitQuality()->chiSquared()/track0->fitQuality()->numberDoF()); - // }else{ - // if(m_track_chi2) m_track_chi2->Fill(-1); - // if(m_track_chi2_LB) m_track_chi2_LB->Fill(-1); - // } - // if(m_tracks_per_lumi) m_tracks_per_lumi->Fill(m_manager->lumiBlockNumber()); - //nTracks++; - m_ntracksPerEvent++; - //} - } + if (nPixelHits>0) + { + m_ntracksPerEvent++; + } /// IP degradation factor map if( m_doDegFactorMap ){ @@ -579,9 +551,7 @@ StatusCode PixelMainMon::FillTrackMon(void) /// if(m_tracksPerEvt_per_lumi) m_tracksPerEvt_per_lumi->Fill(m_manager->lumiBlockNumber(), m_ntracksPerEvent); - //if(m_tracksPerEvtPerMu_per_lumi && m_lumiTool->lbAverageInteractionsPerCrossing() > 0 ){ - // m_tracksPerEvtPerMu_per_lumi->Fill(m_manager->lumiBlockNumber(),nTracks/m_lumiTool->lbAverageInteractionsPerCrossing()); - //} + if(m_doOnTrack || m_doOnPixelTrack)sort (m_RDOIDs.begin(), m_RDOIDs.end()); if(m_doOnTrack || m_doOnPixelTrack)sort (m_ClusterIDs.begin(), m_ClusterIDs.end());