diff --git a/InnerDetector/InDetMonitoring/PixelMonitoring/PixelMonitoring/Components.h b/InnerDetector/InDetMonitoring/PixelMonitoring/PixelMonitoring/Components.h index bbab10c2b77ffd69c449543ef2256ca2a02183e5..3558ad42d9c63ffced74921b7ceaa3439b5af3b9 100644 --- a/InnerDetector/InDetMonitoring/PixelMonitoring/PixelMonitoring/Components.h +++ b/InnerDetector/InDetMonitoring/PixelMonitoring/PixelMonitoring/Components.h @@ -51,7 +51,7 @@ extern const std::array<std::string, kNumModulesDBM> ModulesDBM; * * This object is given to all histogram classes and determines for which * components the histograms are initialised. - * - Pix = pixel components (L0, L1, L2, ECA, ECC) + * - Pix = pixel components (L0, L1, L2, ECA, ECC) * - IBL = IBL * - IBL2D3D = IBL plus additional IBL2D and IBL3D * - DBM = DBM @@ -66,6 +66,6 @@ enum class HistConf {kPix = 0, kPixIBL, kPixIBL2D3D, kPixDBM, kPixDBMIBL, kPixDB * @param component: the pixel detector component to be tested */ bool HasComponent(const HistConf& config, const LayerIBL2D3DDBM& component); -} +} // namespace PixMon #endif // PIXMON_COMPONENTS_H_ diff --git a/InnerDetector/InDetMonitoring/PixelMonitoring/PixelMonitoring/HolderTemplate.h b/InnerDetector/InDetMonitoring/PixelMonitoring/PixelMonitoring/HolderTemplate.h index c6bc1e50a208dfa69f738e677e5de8acde9af968..e37d3dc486b741076b97fa0e9d7068e4980706eb 100644 --- a/InnerDetector/InDetMonitoring/PixelMonitoring/PixelMonitoring/HolderTemplate.h +++ b/InnerDetector/InDetMonitoring/PixelMonitoring/PixelMonitoring/HolderTemplate.h @@ -5,7 +5,7 @@ #ifndef HOLDERTEMPLATE_H_ #define HOLDERTEMPLATE_H_ #include "AthenaMonitoring/ManagedMonitorToolBase.h" -#include "GaudiKernel/StatusCode.h" +#include "GaudiKernel/StatusCode.h" #include "InDetIdentifier/PixelID.h" class array; @@ -22,7 +22,7 @@ enum class HistConf; */ template <typename T> struct LWHistDeleter { - void operator() (T* hist) { + void operator()(T* hist) { // To avoid "unused variable" compiler warnings for the parameter. (void)hist; } @@ -136,6 +136,6 @@ class HolderTemplate { //! Boolean for job option 'doIBL'. --> TO BE REMOVED const bool m_doIBL; }; -} +} // namespace PixMon #endif // HOLDERTEMPLATE_H_ diff --git a/InnerDetector/InDetMonitoring/PixelMonitoring/PixelMonitoring/PixelMainMon.h b/InnerDetector/InDetMonitoring/PixelMonitoring/PixelMonitoring/PixelMainMon.h index 68af156cd96a8ef4654290de78d831635c10d7c9..8d82f149baf87a9ad02541cf7901c772fc111a4b 100755 --- a/InnerDetector/InDetMonitoring/PixelMonitoring/PixelMonitoring/PixelMainMon.h +++ b/InnerDetector/InDetMonitoring/PixelMonitoring/PixelMonitoring/PixelMainMon.h @@ -5,21 +5,20 @@ #ifndef PIXMAINMON_H_ #define PIXMAINMON_H_ -#include <string.h> -#include <vector> -#include <map> #include <stdint.h> +#include <string.h> #include <time.h> +#include <map> +#include <vector> #include "AthenaMonitoring/ManagedMonitorToolBase.h" -#include "GaudiKernel/ServiceHandle.h" -#include "InDetRawData/InDetRawDataContainer.h" -#include "InDetPrepRawData/PixelClusterContainer.h" +#include "GaudiKernel/ServiceHandle.h" +#include "InDetPrepRawData/PixelClusterContainer.h" #include "InDetRawData/InDetRawDataCLASS_DEF.h" -#include "TrkTrack/TrackCollection.h" -//#include "TrkToolInterfaces/ITrackSummaryTool.h" -#include "LumiBlockComps/ILuminosityTool.h" +#include "InDetRawData/InDetRawDataContainer.h" +#include "TrkTrack/TrackCollection.h" #include "AtlasDetDescr/AtlasDetectorID.h" +#include "LumiBlockComps/ILuminosityTool.h" #include "PixelGeoModel/IBLParameterSvc.h" class PixelMonModules1D; @@ -45,749 +44,688 @@ class TProfile; class TProfile2D; class TProfile_LW; class TProfile2D_LW; -namespace InDetDD{ class PixelDetectorManager;} -namespace InDet{ class PixelCluster;} -namespace Trk{ - class SpacePoint; - class ITrackHoleSearchTool; - //class ITrackSummaryTool; -} +namespace InDetDD { class PixelDetectorManager; } +namespace InDet { class PixelCluster; } +namespace Trk { +class SpacePoint; +class ITrackHoleSearchTool; +} // namespace Trk class IPixelCablingSvc; -//class ILuminosityTool; class SpacePointContainer; class IPixelByteStreamErrorsSvc; class IInDetConditionsSvc; -//class StoreGateSvc; class PixelRDORawData; -typedef InDet::PixelCluster PixelCluster; +typedef InDet::PixelCluster PixelCluster; typedef InDetRawDataCollection<PixelRDORawData> RDO_Collection; typedef Trk::SpacePoint SpacePoint; - -class ErrorCategory{ - public: - enum ErrorCategoryID {kSync = 0, kTrunc, kOpt, kSeu, kTout, COUNT}; +class ErrorCategory { + public: + enum ErrorCategoryID {kSync = 0, kTrunc, kOpt, kSeu, kTout, COUNT}; }; -class ErrorCategoryMODROD{ - public: - enum ErrorCategoryMODRODID {kSyncMod = 0, kSyncROD, kTruncMod, kTruncROD, kOpt, kSeu, kTout, COUNT}; +class ErrorCategoryMODROD { + public: + enum ErrorCategoryMODRODID {kSyncMod = 0, kSyncROD, kTruncMod, kTruncROD, kOpt, kSeu, kTout, COUNT}; }; -class PixLayerIBL2D3D{ - public: - enum PixLayerIBL2D3DID {kECA = 0, kECC, kB0, kB1, kB2, kIBL, kIBL2D, kIBL3D, COUNT}; +class PixLayerIBL2D3D { + public: + enum PixLayerIBL2D3DID {kECA = 0, kECC, kB0, kB1, kB2, kIBL, kIBL2D, kIBL3D, COUNT}; }; -class PixLayer{ - public: - enum PixLayerID {kECA = 0, kECC, kB0, kB1, kB2, kIBL, COUNT}; +class PixLayer { + public: + enum PixLayerID {kECA = 0, kECC, kB0, kB1, kB2, kIBL, COUNT}; }; -class PixLayerDisk{ - public: - enum PixLayerDiskID {kECA0 = 0, kECA1, kECA2, kECC0, kECC1, kECC2, kB0, kB1, kB2, kIBL, COUNT}; +class PixLayerDisk { + public: + enum PixLayerDiskID {kECA0 = 0, kECA1, kECA2, kECC0, kECC1, kECC2, kB0, kB1, kB2, kIBL, COUNT}; }; -class IBLStave{ - public: - enum IBLStaveID {kS01 = 0, kS02, kS03, kS04, kS05, kS06, kS07, kS08, kS09, kS10, kS11, kS12, kS13, kS14, COUNT}; +class IBLStave { + public: + enum IBLStaveID {kS01 = 0, kS02, kS03, kS04, kS05, kS06, kS07, kS08, kS09, kS10, kS11, kS12, kS13, kS14, COUNT}; }; -class PixLayerDBM{ - public: - enum PixLayerDBMID {kECA = 0, kECC, kB0, kB1, kB2, kDBMA, kDBMC, kIBL, COUNT}; +class PixLayerDBM { + public: + enum PixLayerDBMID {kECA = 0, kECC, kB0, kB1, kB2, kDBMA, kDBMC, kIBL, COUNT}; }; -class PixLayerIBL2D3DDBM{ - public: - enum PixLayerIBL2D3DDBMID {kECA = 0, kECC, kB0, kB1, kB2, kDBMA, kDBMC, kIBL, kIBL2D, kIBL3D, COUNT}; +class PixLayerIBL2D3DDBM { + public: + enum PixLayerIBL2D3DDBMID {kECA = 0, kECC, kB0, kB1, kB2, kDBMA, kDBMC, kIBL, kIBL2D, kIBL3D, COUNT}; }; -class PixelMainMon:public ManagedMonitorToolBase -{ -public: - - PixelMainMon (const std::string & type, - const std::string & name, - const IInterface* parent); - virtual ~PixelMainMon(); - virtual StatusCode initialize(); //!< Runs once at the start of the code. Sets up services etc. - virtual StatusCode bookHistograms(); //!< Runs at the start of every event. Books some histograms if one of the function parameters is true - virtual StatusCode fillHistograms(); //!< Runs at every event, bulk of the code is inside here. Fills the histograms. - virtual StatusCode procHistograms(); //! - - /** Convert the module ID in the job options. - * Input is a string in the form "L0_B11_S2_M5A" - * Output uses an int with each bit corisponding to part of the offline identifier. - */ - int GetPixLayerID(int ec, int ld, bool ibl); - int GetPixLayerIDIBL2D3D(int ec, int ld, int eta, bool ibl); - int GetPixLayerIDIBL2D3DDBM(int ec, int ld, int eta, bool ibl); - int GetPixLayerIDDBM(int ec, int ld, bool ibl); - int GetPixLayerDiskID(int ec, int ld, bool ibl); - int GetPhiID(Identifier &id, const PixelID* pixID); - int GetEtaID(Identifier &id, const PixelID* pixID, bool doIBL, bool doIBL2D3D); - void TH1FFillMonitoring(TH1F_LW* mon, TH1F_LW* tmp); - void TH2FSetBinScaled(TH2F_LW* mon, TH2F_LW* tmp, int nevent); - void FillTimeHisto(double, TProfile*, TProfile*, TProfile*, double, double, double); - void FillSummaryHistos(PixelMon2DMapsLW* occupancy, TH1F_LW* A, TH1F_LW* C, TH1F_LW* IBL, TH1F_LW* B0, TH1F_LW* B1, TH1F_LW* B2); - int ParseDetailsString(std::string & detailsMod); - bool OnTrack(Identifier id, bool isCluster); - double getErrorBitFraction(const Identifier& WaferID, const unsigned int& num_femcc_errorwords); - int getErrorState(int bit, bool isibl); - std::string makeHistname(std::string set, bool ontrk); - std::string makeHisttitle(std::string set, std::string axis, bool ontrk); - bool GetFEID( int pixlayer, int phiid, int etaid, int &oufephi, int &outfeeta); - - StatusCode BookClustersMon(void); - StatusCode BookClustersLumiBlockMon(void); - StatusCode FillClustersMon(void); - StatusCode ProcClustersMon(void); - - StatusCode BookHitsMon(void); - StatusCode BookHitsLumiBlockMon(void); - StatusCode FillHitsMon(void); - StatusCode ProcHitsMon(void); - - StatusCode BookStatusMon(void); - StatusCode BookStatusLumiBlockMon(void); - StatusCode FillStatusMon(void); - StatusCode ProcStatusMon(void); - - StatusCode BookTrackMon(void); - StatusCode BookTrackLumiBlockMon(void); - StatusCode FillTrackMon(void); - StatusCode ProcTrackMon(void); - - StatusCode BookRODErrorMon(void); - StatusCode BookRODErrorLumiBlockMon(void); - StatusCode FillRODErrorMon(void); - - StatusCode BookSpacePointMon(void); - StatusCode FillSpacePointMon(void); - - StatusCode BookPixelDCSMon(void); - StatusCode FillPixelDCSMon(void); - StatusCode ProcPixelDCSMon(void); - -private: - - ServiceHandle <IInDetConditionsSvc> m_pixelCondSummarySvc; - ServiceHandle <IPixelByteStreamErrorsSvc> m_ErrorSvc; - ServiceHandle <IPixelCablingSvc> m_pixelCableSvc; - ServiceHandle <IBLParameterSvc> m_IBLParameterSvc; - ToolHandle<Trk::ITrackHoleSearchTool> m_holeSearchTool; - ToolHandle<ILuminosityTool> m_lumiTool; - - //IPixelByteStreamErrorsSvc* m_ErrorSvc; - - //ActiveStoreSvc* m_activeStore; - //StoreGateSvc* m_StoreGate; - //StoreGateSvc* m_detStore; - const PixelID* m_pixelid; // Pixel ID helper - uint64_t m_event; - uint64_t m_event2; - - time_t m_startTime; - bool m_majorityDisabled; //check for each event, true if >50% modules disabled - - int m_lbRange; - int m_bcidRange; - int m_lumiBlockNum; - unsigned int m_firstBookTime; - unsigned int m_currentTime; - unsigned int m_LBstartTime; - unsigned int m_LBendTime; - unsigned int m_currentBCID; - int m_runNum; - int m_ntracksPerEvent; - int m_nGood_mod[PixLayerIBL2D3D::COUNT]; - int m_nActive_mod[PixLayerIBL2D3D::COUNT]; - - unsigned int m_nRefresh; - unsigned int m_nRefresh5min; - - const AtlasDetectorID* m_idHelper; - - std::vector<Identifier> m_RDOIDs; ///////Make class scope - std::vector<Identifier> m_ClusterIDs; ///////Make class scope - - const DataHandle<PixelRDO_Container> m_rdocontainer; //container for pixel RDO - //PixelRODErrorCollection* m_error_summary;//container for pixel ROD errors - const InDet::PixelClusterContainer* m_Pixel_clcontainer; //container for cluster - const SpacePointContainer* m_Pixel_spcontainer; //container for spacepoints - const TrackCollection *m_tracks; //container for tracks - - std::string m_Pixel_RDOName; //storegate container names - std::string m_detector_error_name; - std::string m_Pixel_SpacePointsName; - std::string m_Pixel_SiClustersName; - std::string m_TracksName; - std::string m_error_summary; //commissioning - - std::string m_histTitleExt; - - std::string m_modLabel_PixLayerIBL2D3D[PixLayerIBL2D3D::COUNT] = { - "ECA", "ECC", "B0", "B1", "B2", - "IBL", "IBL2D", "IBL3D" - }; - std::string m_modLabel_PixLayerDBM[PixLayerDBM::COUNT] = { - "ECA", "ECC", - "B0", "B1", "B2", - "DBMA", "DBMC", "IBL" - }; - std::string m_modLabel_PixLayerIBL2D3DDBM[PixLayerIBL2D3DDBM::COUNT] = { - "ECA", "ECC", - "B0", "B1", "B2", - "DBMA", "DBMC", "IBL", "IBL2D", "IBL3D" - }; - std::string m_modLabel_PixLayerDisk[PixLayerDisk::COUNT] = { - "ECA0", "ECA1", "ECA2", - "ECC0", "ECC1", "ECC2", - "B0", "B1", "B2", "IBL" - }; - - bool m_doRDO; //storegate type flags from jobOptions - bool m_doRODError; - bool m_doCluster; - bool m_doSpacePoint; - bool m_doTrack; - bool m_doStatus; - bool m_doDCS; - - bool m_doHoleSearch; - bool m_doESD; - bool m_do2DMaps; - bool m_doModules; - bool m_doOffline; - bool m_doOnline; - bool m_doLowOccupancy; - bool m_doHighOccupancy; - bool m_doOnTrack; - bool m_doPixelOccupancy; - bool m_doDetails; - bool m_doTiming; - bool m_doLumiBlock; //store module status, error etc for each lumiblock - bool m_doRefresh; - bool m_doRefresh5min; - bool m_isFirstBook; - bool m_doOfflineAnalysis; - - bool m_doHeavyIonMon; //modifications for heavy ion monitoring - - std::string m_DetailsMod1; //other inputs from job options - std::string m_DetailsMod2; - std::string m_DetailsMod3; - std::string m_DetailsMod4; - - bool m_doIBL; - - bool m_isNewRun; - bool m_isNewLumiBlock; - bool m_newLowStatInterval; - - double m_occupancy_cut; - - int m_ClusPerEventArray_disksA[48][3]; - int m_ClusPerEventArray_disksC[48][3]; - int m_ClusPerEventArray_lI[14][20]; - int m_ClusPerEventArray_l0[22][13]; - int m_ClusPerEventArray_l1[38][13]; - int m_ClusPerEventArray_l2[52][13]; - - int m_HitPerEventArray_disksA[48][3] = {0}; - int m_HitPerEventArray_disksC[48][3] = {0}; - int m_HitPerEventArray_lI[14][20] = {0}; - int m_HitPerEventArray_l0[22][13] = {0}; - int m_HitPerEventArray_l1[38][13] = {0}; - int m_HitPerEventArray_l2[52][13] = {0}; - - //////////////////////Histograms/////////////////////////// - - /// - /// Event Info - /// - - TH1F_LW* m_events_per_lumi; - TProfile_LW* m_mu_vs_bcid; - TProfile_LW* m_mu_vs_lumi; - TH2F_LW* m_storegate_errors;//Reconstruction (storegate) Error Monitoring - - /// - /// Hitmap histograms - /// - /// the number of hits - TProfile_LW* m_hits_per_lumi; - TH1I_LW* m_num_hits; - std::unique_ptr<PixelMon2DMapsLW> m_hitmap_mon; - std::unique_ptr<PixelMon2DMapsLW> m_hitmap_tmp; - TH1F_LW* m_nhits_mod[PixLayer::COUNT]; - TProfile_LW* m_hits_per_lumi_mod[PixLayer::COUNT]; - TH1F_LW* m_nlargeevt_per_lumi_mod[PixLayerIBL2D3D::COUNT]; - TH1F_LW* m_totalhits_per_bcid_mod[PixLayerIBL2D3D::COUNT]; - /// hit occupancy - TProfile_LW* m_avgocc_per_lumi; - TProfile_LW* m_avgocc_ratioIBLB0_per_lumi; - TProfile_LW* m_avgocc_per_lumi_mod[PixLayerIBL2D3D::COUNT]; - TProfile_LW* m_avgocc_per_bcid_mod[PixLayerIBL2D3D::COUNT]; - TProfile2D_LW* m_avgocc_per_bcid_per_lumi_mod[PixLayerIBL2D3D::COUNT]; - TProfile_LW* m_avgocc_active_per_lumi_mod[PixLayerIBL2D3D::COUNT]; - TH2F_LW* m_maxocc_per_lumi_mod[PixLayerIBL2D3D::COUNT]; - TH2F_LW* m_modocc_per_lumi[PixLayer::COUNT]; - TH1F_LW* m_maxocc_per_bcid_mod[PixLayerIBL2D3D::COUNT]; - std::unique_ptr<PixelMon2DMapsLW> m_occupancy; - std::unique_ptr<PixelMon2DMapsLW> m_average_pixocc; - std::unique_ptr<PixelMon2DProfilesLW> m_occupancy_pix_evt; - std::unique_ptr<PixelMon2DMapsLW> m_occupancy_10min; - TProfile* m_occupancy_time1; - TProfile* m_occupancy_time2; - TProfile* m_occupancy_time3; - TH1F_LW* m_occupancy_summary_mod[PixLayer::COUNT]; - TH3F* m_nFEswithHits_mod[PixLayer::COUNT]; - /// hit tot - TH1F_LW* m_hit_ToT[PixLayerIBL2D3DDBM::COUNT]; - TH2F_LW* m_hit_ToT_per_lumi_mod[PixLayerIBL2D3D::COUNT]; - TH1F_LW* m_hit_ToT_tmp_mod[PixLayer::COUNT]; - TH1F_LW* m_hit_ToT_Mon_mod[PixLayer::COUNT]; - TProfile2D_LW* m_ToT_etaphi_mod[PixLayer::COUNT]; - TProfile_LW* m_hit_ToTMean_mod[PixLayer::COUNT]; - /// timing - TH1I_LW* m_Lvl1ID_PIX; - TH1I_LW* m_Lvl1ID_IBL; - TH1F_LW* m_Atlas_BCID; - TH2F_LW* m_Atlas_BCID_hits; - TH1I_LW* m_BCID; - TProfile_LW* m_BCID_Profile; - TH1F_LW* m_Lvl1A; - TH1F_LW* m_Lvl1A_mod[PixLayerDBM::COUNT]; - TH1F_LW* m_Lvl1A_10min_mod[PixLayer::COUNT]; - TH1I_LW* m_Lvl1ID_diff_mod_ATLAS_mod[PixLayer::COUNT]; - TH1I_LW* m_diff_ROD_vs_Module_BCID_mod[PixLayer::COUNT]; - std::unique_ptr<PixelMon2DLumiProfiles> m_Lvl1ID_diff_mod_ATLAS_per_LB; - std::unique_ptr<PixelMon2DLumiProfiles> m_Lvl1ID_absdiff_mod_ATLAS_per_LB; - /// Quick status - TH2F_LW* m_nhits_L0_B11_S2_C6; - TProfile2D_LW* m_occupancy_L0_B11_S2_C6; - - /// module histo - std::unique_ptr<PixelMonModules1D> m_hit_num_mod; - std::unique_ptr<PixelMonModulesProf> m_hiteff_mod; - std::unique_ptr<PixelMonModules1D> m_FE_chip_hit_summary; - std::unique_ptr<PixelMonModules2D> m_pixel_occupancy; - /// details - TH1F_LW* m_Details_mod1_num_hits; - TH1F_LW* m_Details_mod2_num_hits; - TH1F_LW* m_Details_mod3_num_hits; - TH1F_LW* m_Details_mod4_num_hits; - TH2F_LW* m_Details_mod1_occupancy; - TH2F_LW* m_Details_mod2_occupancy; - TH2F_LW* m_Details_mod3_occupancy; - TH2F_LW* m_Details_mod4_occupancy; - TH1F_LW* m_Details_mod1_ToT; - TH1F_LW* m_Details_mod2_ToT; - TH1F_LW* m_Details_mod3_ToT; - TH1F_LW* m_Details_mod4_ToT; - - - //----------------- - // track histograms - //----------------- - /// Track quality - TH1F_LW* m_track_res_phi; - TH1F_LW* m_track_pull_phi; - TH1F_LW* m_track_res_eta; - TH1F_LW* m_track_pull_eta; - TH1F_LW* m_track_chi2; - /// The number of tracks - TProfile_LW* m_tracksPerEvt_per_lumi; - TProfile_LW* m_tracksPerEvtPerMu_per_lumi; - /// track state on surface - std::unique_ptr<PixelMon2DMapsLW> m_tsos_hitmap; - std::unique_ptr<PixelMon2DMapsLW> m_tsos_holemap; - std::unique_ptr<PixelMon2DMapsLW> m_tsos_outliermap; - //std::unique_ptr<PixelMon2DProfilesLW> m_tsos_measratio; - //std::unique_ptr<PixelMon2DProfilesLW> m_tsos_holeratio; - std::unique_ptr<PixelMon2DProfilesLW> m_misshits_ratio; - std::unique_ptr<PixelMon2DProfilesLW> m_tsos_holeratio_tmp; - std::unique_ptr<PixelMon2DProfilesLW> m_tsos_holeratio_mon; - std::unique_ptr<PixelMon2DProfilesLW> m_misshits_ratio_tmp; - std::unique_ptr<PixelMon2DProfilesLW> m_misshits_ratio_mon; - /// hit efficiency - TProfile_LW* m_hiteff_incl_mod[PixLayerDisk::COUNT]; - /// Lorentz Angle - TProfile2D_LW* m_LorentzAngle_IBL; - TProfile2D_LW* m_LorentzAngle_IBL2D; - TProfile2D_LW* m_LorentzAngle_IBL3D; - TProfile2D_LW* m_LorentzAngle_B0; - TProfile2D_LW* m_LorentzAngle_B1; - TProfile2D_LW* m_LorentzAngle_B2; - - /// cluster size - TH1F_LW* m_clusize_ontrack_mod[PixLayerIBL2D3D::COUNT]; - TH1F_LW* m_clusize_offtrack_mod[PixLayerIBL2D3D::COUNT]; - /// module histo - TH1F_LW* m_track_chi2_bcl1; - TH1F_LW* m_track_chi2_bcl0; - TH1F_LW* m_track_chi2_bclgt1; - TH1F_LW* m_track_chi2_bcl1_highpt; - TH1F_LW* m_track_chi2_bcl0_highpt; - TH1F_LW* m_track_chi2_bclgt1_highpt; - TH2F_LW* m_clustot_vs_pt; - TH1F_LW* m_clustot_lowpt; - TH1F_LW* m_1hitclustot_lowpt; - TH1F_LW* m_2hitclustot_lowpt; - TH1F_LW* m_clustot_highpt; - TH1F_LW* m_1hitclustot_highpt; - TH1F_LW* m_2hitclustot_highpt; - std::unique_ptr<PixelMonModulesProf> m_tsos_hiteff_vs_lumi; - - - /// - /// Cluster histograms - /// - TProfile_LW* m_clusters_per_lumi; - TProfile_LW* m_clusters_per_lumi_mod[PixLayer::COUNT]; - TProfile_LW* m_clusters_row_width_per_lumi_mod[PixLayerIBL2D3D::COUNT]; - TProfile_LW* m_clusters_col_width_per_lumi_mod[PixLayerIBL2D3D::COUNT]; - TProfile_LW* m_clusters_row_width_per_bcid_mod[PixLayerIBL2D3D::COUNT]; - TProfile_LW* m_clusters_col_width_per_bcid_mod[PixLayerIBL2D3D::COUNT]; - TProfile_LW* m_largeclusters_per_lumi; - TProfile_LW* m_verylargeclusters_per_lumi; - TH1I_LW* m_totalclusters_per_lumi; - TH1I_LW* m_totalclusters_per_lumi_mod[PixLayerIBL2D3D::COUNT]; - TH1I_LW* m_totalclusters_per_bcid_mod[PixLayerIBL2D3D::COUNT]; - TH1I_LW* m_highNclusters_per_lumi; - TH1F_LW* m_cluster_ToT1d_mod[PixLayerIBL2D3DDBM::COUNT]; - TH1F_LW* m_1cluster_ToT_mod[PixLayer::COUNT]; - TH1F_LW* m_2cluster_ToT_mod[PixLayer::COUNT]; - TH1F_LW* m_3cluster_ToT_mod[PixLayer::COUNT]; - TH1F_LW* m_bigcluster_ToT_mod[PixLayer::COUNT]; - TH1F_LW* m_cluster_Q_mod[PixLayerIBL2D3DDBM::COUNT]; - TH1F_LW* m_1cluster_Q_mod[PixLayer::COUNT]; - TH1F_LW* m_2cluster_Q_mod[PixLayer::COUNT]; - TH1F_LW* m_3cluster_Q_mod[PixLayer::COUNT]; - TH1F_LW* m_bigcluster_Q_mod[PixLayer::COUNT]; - std::unique_ptr<PixelMon2DProfilesLW> m_clussize_map; - std::unique_ptr<PixelMon2DProfilesLW> m_cluscharge_map; - std::unique_ptr<PixelMon2DProfilesLW> m_clusToT_map; - TH1F_LW* m_cluster_groupsize; - TH1F_LW* m_cluster_col_width; - TH1F_LW* m_cluster_row_width; - TH1F_LW* m_cluster_col_width_mod[PixLayerIBL2D3D::COUNT]; - TH1F_LW* m_cluster_row_width_mod[PixLayerIBL2D3D::COUNT]; - TH1F_LW* m_cluster_groupsize_mod[PixLayerIBL2D3DDBM::COUNT]; - TH1F_LW* m_cluster_LVL1A; - TH1F_LW* m_cluster_LVL1A1d_mod[PixLayer::COUNT]; - TProfile_LW* m_clusterSize_eta; - TH2F_LW* m_clusToT_vs_eta_mod[PixLayer::COUNT]; - TH2F_LW* m_ToT_vs_clussize_mod[PixLayer::COUNT]; - TProfile_LW* m_clussize_vs_eta_mod[PixLayer::COUNT]; - - std::unique_ptr<PixelMon2DMapsLW> m_clustermap_mon; - std::unique_ptr<PixelMon2DMapsLW> m_clustermap_tmp; - std::unique_ptr<PixelMon2DMapsLW> m_cluster_occupancy; - TH2F_LW* m_cluster_occupancy_FE_B0_mon; - TProfile* m_cluster_occupancy_time1; - TProfile* m_cluster_occupancy_time2; - TProfile* m_cluster_occupancy_time3; - - std::unique_ptr<PixelMon2DMapsLW> m_clusocc_sizenot1; - std::unique_ptr<PixelMonModulesProf> m_cluseff_mod; - std::unique_ptr<PixelMonModules1D> m_cluster_ToT_mod; - std::unique_ptr<PixelMonModules1D> m_cluster_size_mod; - std::unique_ptr<PixelMonModules1D> m_cluster_num_mod; - TH1I_LW* m_num_clusters; - TProfile_LW* m_clusters_per_track_per_lumi_mod[PixLayer::COUNT]; - TH1I_LW* m_num_clusters_mod[PixLayer::COUNT]; - TH1F_LW* m_cluster_occupancy_summary_mod[PixLayer::COUNT]; - std::unique_ptr<PixelMon2DProfilesLW> m_cluster_LVL1A_mod; - std::unique_ptr<PixelMon2DProfilesLW> m_clus_LVL1A_sizenot1; - TProfile_LW* m_clustersOnOffTrack_per_lumi; - /// Quick status - TH2F_LW* m_clusters_onTrack_L0_B11_S2_C6; - TH2F_LW* m_clusters_offTrack_L0_B11_S2_C6; - - - /// - ///Status histograms - /// - std::unique_ptr<PixelMonModules1D> m_Status_modules; - std::unique_ptr<PixelMon2DProfilesLW> m_status; - std::unique_ptr<PixelMon2DProfilesLW> m_status_mon; - std::unique_ptr<PixelMon2DProfilesLW> m_status_LB; - std::unique_ptr<PixelMon2DMapsLW> m_dqStatus; - TProfile_LW* m_disabledModules_per_lumi_PIX; - TProfile_LW* m_badModules_per_lumi_mod[PixLayerIBL2D3D::COUNT]; - TProfile_LW* m_disabledModules_per_lumi_mod[PixLayerIBL2D3D::COUNT]; - TProfile_LW* m_baddisabledModules_per_lumi_mod[PixLayerIBL2D3D::COUNT]; - - /// - /// ROD Error histograms - /// - static const int kNumErrorBits{32}; - static const int kNumErrorStates{16}; - static const int kNumErrorStatesIBL{27}; - TProfile_LW* m_errhist_errcat_LB[PixLayerIBL2D3D::COUNT][ErrorCategory::COUNT]; - TProfile_LW* m_errhist_errtype_LB[PixLayerIBL2D3D::COUNT][ErrorCategoryMODROD::COUNT - 3]; - std::unique_ptr<PixelMon2DMapsLW> m_errhist_errcat_map[ErrorCategory::COUNT]; - std::unique_ptr<PixelMon2DMapsLW> m_errhist_errtype_map[ErrorCategoryMODROD::COUNT]; - TProfile_LW* m_errhist_errcat_avg[ErrorCategory::COUNT][PixLayerIBL2D3D::COUNT]; - TProfile_LW* m_errhist_errtype_avg[ErrorCategoryMODROD::COUNT - 3][PixLayerIBL2D3D::COUNT]; - TProfile_LW* m_errhist_tot_LB[PixLayerIBL2D3D::COUNT]; - TProfile2D_LW* m_errhist_per_bit_LB[PixLayerIBL2D3D::COUNT]; - TProfile2D_LW* m_errhist_per_type_LB[PixLayerIBL2D3D::COUNT]; - TProfile_LW* m_errhist_syncerr_LB_pix; - TProfile* m_error_time1; - TProfile* m_error_time2; - TProfile* m_error_time3; - std::unique_ptr<PixelMonModules1D> m_errors; - std::unique_ptr<PixelMon2DProfilesLW> m_errhist_femcc_errwords_map; - - // Histograms in 'ErrorsExpert' folder - std::unique_ptr<PixelMon2DLumiMaps> m_errhist_expert_LB_maps[kNumErrorStates + kNumErrorStatesIBL]; - std::unique_ptr<PixelMon2DMapsLW> m_errhist_expert_maps[kNumErrorStates + kNumErrorStatesIBL]; - TProfile_LW* m_errhist_expert_LB[PixLayer::COUNT-1][kNumErrorStates]; - TProfile_LW* m_errhist_expert_IBL_LB[kNumErrorStatesIBL]; - TH3F* m_errhist_expert_fe_trunc_err_3d[PixLayer::COUNT]; - TH1F_LW* m_errhist_expert_servrec_ibl_unweighted; - TH1F_LW* m_errhist_expert_servrec_ibl_weighted; - TH1F_LW* m_errhist_expert_servrec_ibl_count; - - // Histograms in low-stat folder - std::unique_ptr<PixelMon2DMapsLW> m_errors_LB; - std::unique_ptr<PixelMon2DMapsLW> m_errors_RODSync_mod; - std::unique_ptr<PixelMon2DMapsLW> m_errors_ModSync_mod; - - /// - /// SP Histograms - /// - TH1I_LW* m_num_spacepoints; - TH1I_LW* m_num_spacepoints_low; - TH1F_LW* m_spHit_x; - TH1F_LW* m_spHit_y; - TH1F_LW* m_spHit_z; - TH1F_LW* m_spHit_r; - TH1F_LW* m_spHit_phi; - TH2F_LW* m_spHit_xy; - TH2F_LW* m_spHit_rz; - - //Histograms stored for certain number of LB at a time - std::unique_ptr<PixelMon2DMapsLW> m_cluster_occupancy_LB; //cluster occupancy (shows module status) - std::unique_ptr<PixelMonModules1D> m_cluster_ToT_mod_LB; - std::unique_ptr<PixelMonModules1D> m_cluster_num_mod_LB; - std::unique_ptr<PixelMonModules1D> m_hit_num_mod_LB; - - TH1I_LW* m_num_hits_LB; - TH1F_LW* m_hit_ToT_LB_mod[PixLayer::COUNT]; - TH1F_LW* m_cluster_ToT_LB; - TH1I_LW* m_num_clusters_LB; - - //--------------------- - // DCS Monitoring - //--------------------- - - //// Basic histograms //// - // TEMPERATURE - TProfile2D_LW* m_hist_moduleTemperatureEtaPhi; - TH2F_LW* m_hist_moduleTemperature2Dscatter[IBLStave::COUNT]; - TProfile_LW* m_hist_moduleTemperatureLB[IBLStave::COUNT]; - TProfile2D_LW* m_hist_LB_staveID_moduleTemperature; - TProfile2D_LW* m_hist_LB_moduleGroup_moduleTemperature[IBLStave::COUNT]; - // HV - TProfile2D_LW* m_hist_HVoltageEtaPhi; - TH2F_LW* m_hist_HVoltage2Dscatter[IBLStave::COUNT]; - TProfile_LW* m_hist_HVoltageLB[IBLStave::COUNT]; - TProfile2D_LW* m_hist_LB_staveID_HVoltage; - TProfile2D_LW* m_hist_LB_moduleGroup_HVoltage[IBLStave::COUNT]; - // PIPES Inlet - //TProfile2D_LW* m_hist_Pipes_inletEtaPhi; - TH2F_LW* m_hist_Pipes_inlet2Dscatter; - TProfile_LW* m_hist_Pipes_inletLB[IBLStave::COUNT]; - TProfile2D_LW* m_hist_LB_staveID_coolingPipeInlet; - //TProfile2D_LW* m_hist_LB_moduleGroup_coolingPipeInlet[IBLStave::COUNT]; - // PIPES Outlet - //TProfile2D_LW* m_hist_Pipes_outletEtaPhi; - TH2F_LW* m_hist_Pipes_outlet2Dscatter; - TProfile_LW* m_hist_Pipes_outletLB[IBLStave::COUNT]; - TProfile2D_LW* m_hist_LB_staveID_coolingPipeOutlet; - //TProfile2D_LW* m_hist_LB_moduleGroup_coolingPipeOutlet[IBLStave::COUNT]; - // LV - TProfile2D_LW* m_hist_LVoltageEtaPhi; - TH2F_LW* m_hist_LVoltage2Dscatter[IBLStave::COUNT]; - TProfile_LW* m_hist_LVoltageLB[IBLStave::COUNT]; - TProfile2D_LW* m_hist_LB_staveID_LVoltage; - TProfile2D_LW* m_hist_LB_moduleGroup_LVoltage[IBLStave::COUNT]; - // LV CURRENT - TProfile2D_LW* m_hist_LVcurrentEtaPhi; - TH2F_LW* m_hist_LVcurrent2Dscatter[IBLStave::COUNT]; - TProfile_LW* m_hist_LVcurrentLB[IBLStave::COUNT]; - TProfile2D_LW* m_hist_LB_staveID_LVcurrent; - TProfile2D_LW* m_hist_LB_moduleGroup_LVcurrent[IBLStave::COUNT]; - // HVCURRENT - TProfile2D_LW* m_hist_HVcurrentEtaPhi; - TH2F_LW* m_hist_HVcurrent2Dscatter[IBLStave::COUNT]; - TProfile_LW* m_hist_HVcurrentLB[IBLStave::COUNT]; - TProfile2D_LW* m_hist_LB_staveID_HVcurrent; - TProfile2D_LW* m_hist_LB_moduleGroup_HVcurrent[IBLStave::COUNT]; - // FSMSTATE - //TProfile2D_LW* m_hist_FSMstateEtaPhi; - //TH2F_LW* m_hist_FSMstateEtaPhi; - TH2F* m_hist_FSMstateEtaPhi; - TH2F_LW* m_hist_FSMstate2Dscatter[IBLStave::COUNT]; - //TProfile_LW* m_hist_FSMstateLB[IBLStave::COUNT]; - TH2F_LW* m_hist_FSMstateLB[IBLStave::COUNT]; - //TProfile2D_LW* m_hist_LB_staveID_FSMstate; - //TH2F_LW* m_hist_LB_staveID_FSMstate; - TH2F* m_hist_LB_staveID_FSMstate; - //TProfile2D_LW* m_hist_LB_moduleGroup_FSMstate[IBLStave::COUNT]; - //TProfile2D* m_hist_LB_moduleGroup_FSMstate[IBLStave::COUNT]; - TH2F* m_hist_LB_moduleGroup_FSMstate[IBLStave::COUNT]; - // FSMSTATUS - //TProfile2D_LW* m_hist_FSMstatusEtaPhi; - //TH2F_LW* m_hist_FSMstatusEtaPhi; - TH2F* m_hist_FSMstatusEtaPhi; - TH2F_LW* m_hist_FSMstatus2Dscatter[IBLStave::COUNT]; - //TProfile_LW* m_hist_FSMstatusLB[IBLStave::COUNT]; - TH2F_LW* m_hist_FSMstatusLB[IBLStave::COUNT]; - //TProfile2D_LW* m_hist_LB_staveID_FSMstatus; - //TH2F_LW* m_hist_LB_staveID_FSMstatus; - TH2F* m_hist_LB_staveID_FSMstatus; - //TProfile2D_LW* m_hist_LB_moduleGroup_FSMstatus[IBLStave::COUNT]; - TH2F* m_hist_LB_moduleGroup_FSMstatus[IBLStave::COUNT]; - // PLANTS - - //// Combination histograms //// - // dT := module temperature - cooling pipe outlet - TProfile2D_LW* m_hist_dTEtaPhi; - TProfile2D_LW* m_hist_LB_moduleGroup_dT[IBLStave::COUNT]; - TProfile2D_LW* m_hist_LB_staveID_dT; - // LV Power consumption - TProfile2D_LW* m_hist_LVPowerConsumptionEtaPhi; - TProfile2D_LW* m_hist_LB_moduleGroup_LVPowerConsumption[IBLStave::COUNT]; - TProfile2D_LW* m_hist_LB_staveID_LVPowerConsumption; - // HV Power consumption - TProfile2D_LW* m_hist_HVPowerConsumptionEtaPhi; - TProfile2D_LW* m_hist_LB_moduleGroup_HVPowerConsumption[IBLStave::COUNT]; - TProfile2D_LW* m_hist_LB_staveID_HVPowerConsumption; - // LV+HV Power consumption - TProfile2D_LW* m_hist_LVHVPowerConsumptionEtaPhi; - TProfile2D_LW* m_hist_LB_moduleGroup_LVHVPowerConsumption[IBLStave::COUNT]; - TProfile2D_LW* m_hist_LB_staveID_LVHVPowerConsumption; - // effective FLEX temperature = dT * 0.6 + cooling pipe outlet - TProfile2D_LW* m_hist_effFLEXtempEtaPhi; - TProfile2D_LW* m_hist_LB_moduleGroup_effFLEXtemp[IBLStave::COUNT]; - TProfile2D_LW* m_hist_LB_staveID_effFLEXtemp; - // thermal figure of merit (/size) = dT/Power consumption - TProfile2D_LW* m_hist_thermalFigureMeritEtaPhi; - TProfile2D_LW* m_hist_LB_moduleGroup_thermalFigureMerit[IBLStave::COUNT]; - TProfile2D_LW* m_hist_LB_staveID_thermalFigureMerit; - - std::vector<std::string> m_atrcollist; - std::map<std::string,std::vector< std::string> > m_elementsMap; - int m_currentLumiBlockNumber; - //typedef struct dcsDataHolder - class dcsDataHolder { - public: - dcsDataHolder() : - m_values(new std::map<int, std::map<int, float>* >), - m_maps(new std::map<std::string, int>) - {}; - ~dcsDataHolder() { - for (auto lbmap : *m_values) { - delete lbmap.second; - } - delete m_values; - delete m_maps; - }; - std::map<int, std::map<int, float>* > *m_values; // <channel number, <LB, value> > - std::map<std::string, int> *m_maps; // <module name, channel number> - }; - dcsDataHolder *m_moduleTemperature; - dcsDataHolder *m_coolingPipeTemperatureInlet; - dcsDataHolder *m_coolingPipeTemperatureOutlet; - dcsDataHolder *m_HV; - dcsDataHolder *m_HV_current; - dcsDataHolder *m_LV_voltage; - dcsDataHolder *m_LV_current; - dcsDataHolder *m_FSM_state; - dcsDataHolder *m_FSM_status; - - class moduleDcsDataHolder { - public: - moduleDcsDataHolder() : - m_tempModule(new std::map<int, std::map<int, float>* >), - m_tempInlet (new std::map<int, std::map<int, float>* >), - m_tempOutlet(new std::map<int, std::map<int, float>* >), - m_hv_voltage(new std::map<int, std::map<int, float>* >), - m_lv_voltage(new std::map<int, std::map<int, float>* >), - m_hv_current(new std::map<int, std::map<int, float>* >), - m_lv_current(new std::map<int, std::map<int, float>* >), - m_fsm_state (new std::map<int, std::map<int, float>* >), - m_fsm_status(new std::map<int, std::map<int, float>* >), - m_moduleMap(new std::map<std::string, int>) - {}; - ~moduleDcsDataHolder() { - for (auto lbmap : *m_tempModule) delete lbmap.second; - for (auto lbmap : *m_tempInlet ) delete lbmap.second; - for (auto lbmap : *m_tempOutlet) delete lbmap.second; - for (auto lbmap : *m_hv_voltage) delete lbmap.second; - for (auto lbmap : *m_lv_voltage) delete lbmap.second; - for (auto lbmap : *m_hv_current) delete lbmap.second; - for (auto lbmap : *m_lv_current) delete lbmap.second; - for (auto lbmap : *m_fsm_state ) delete lbmap.second; - for (auto lbmap : *m_fsm_status) delete lbmap.second; - delete m_tempModule; - delete m_tempInlet; - delete m_tempOutlet; - delete m_hv_voltage; - delete m_lv_voltage; - delete m_hv_current; - delete m_lv_current; - delete m_fsm_state; - delete m_fsm_status; - delete m_moduleMap; - }; - // <module number, <LB, value> > - std::map<int, std::map<int, float>* > *m_tempModule; - std::map<int, std::map<int, float>* > *m_tempInlet; - std::map<int, std::map<int, float>* > *m_tempOutlet; - std::map<int, std::map<int, float>* > *m_hv_voltage; - std::map<int, std::map<int, float>* > *m_lv_voltage; - std::map<int, std::map<int, float>* > *m_hv_current; - std::map<int, std::map<int, float>* > *m_lv_current; - std::map<int, std::map<int, float>* > *m_fsm_state; - std::map<int, std::map<int, float>* > *m_fsm_status; - // <module name, channel number> - std::map<std::string, int> *m_moduleMap; - }; - moduleDcsDataHolder *m_moduleDCSDataHolder; - -public: - int getIBLetaIndexFromModuleName(std::string moduleName){ - int module_eta = m_name2etaIndex[moduleName.substr(static_cast<int>(moduleName.find("S")) + 4)]; - return module_eta; - } - - int getIBLmoduleGroupFromModuleName(std::string moduleName){ - int moduleGroup = m_name2moduleGroup[moduleName.substr(static_cast<int>(moduleName.find("S")) + 4, 4)]; // LI_S01_A_M4_A8_2 - return moduleGroup; - } - - int getIBLstaveIdFromModuleName(std::string moduleName){ - std::string staveNumStr(moduleName, moduleName.find("S") + 1, 2); // LI_S01_A_... - int staveNum = std::stoi(staveNumStr); - return staveNum; - } - -private: - std::map<std::string, int> m_name2etaIndex; - std::map<std::string, int> m_name2moduleGroup; - - std::map<std::string, float> m_fsmState2enum; - std::map<std::string, float> m_fsmStatus2enum; -}; // end class PixelMainMon : public ManagedMonitorToolBase - - -#endif +class PixelMainMon : public ManagedMonitorToolBase { + public: + PixelMainMon(const std::string& type, const std::string& name, const IInterface* parent); + virtual ~PixelMainMon(); + virtual StatusCode initialize(); //!< Runs once at the start of the code. Sets up services etc. + virtual StatusCode bookHistograms(); //!< Runs at the start of every event. Books some histograms if one of the function parameters is true + virtual StatusCode fillHistograms(); //!< Runs at every event, bulk of the code is inside here. Fills the histograms. + virtual StatusCode procHistograms(); //! + + int getPixLayerID(int ec, int ld, bool ibl); + int getPixLayerIDIBL2D3D(int ec, int ld, int eta, bool ibl); + int getPixLayerIDIBL2D3DDBM(int ec, int ld, int eta, bool ibl); + int getPixLayerIDDBM(int ec, int ld, bool ibl); + int getPixLayerDiskID(int ec, int ld, bool ibl); + void th1FillMonitoring(TH1F_LW* mon, TH1F_LW* tmp); + void fillTimeHisto(double, TProfile*, TProfile*, TProfile*, double, double, double); + void fillSummaryHistos(PixelMon2DMapsLW* occupancy, TH1F_LW* A, TH1F_LW* C, TH1F_LW* IBL, TH1F_LW* B0, TH1F_LW* B1, TH1F_LW* B2); + int parseDetailsString(std::string& detailsMod); + bool isOnTrack(Identifier id, bool isCluster); + double getErrorBitFraction(const Identifier& WaferID, const unsigned int& num_femcc_errorwords); + int getErrorState(int bit, bool isibl); + std::string makeHistname(std::string set, bool ontrk); + std::string makeHisttitle(std::string set, std::string axis, bool ontrk); + bool getFEID(int pixlayer, int phiid, int etaid, int& oufephi, int& outfeeta); + + StatusCode bookClustersMon(void); + StatusCode bookClustersLumiBlockMon(void); + StatusCode fillClustersMon(void); + StatusCode procClustersMon(void); + + StatusCode bookHitsMon(void); + StatusCode bookHitsLumiBlockMon(void); + StatusCode fillHitsMon(void); + StatusCode procHitsMon(void); + + StatusCode bookStatusMon(void); + StatusCode bookStatusLumiBlockMon(void); + StatusCode fillStatusMon(void); + StatusCode procStatusMon(void); + + StatusCode bookTrackMon(void); + StatusCode bookTrackLumiBlockMon(void); + StatusCode fillTrackMon(void); + StatusCode procTrackMon(void); + + StatusCode bookRODErrorMon(void); + StatusCode bookRODErrorLumiBlockMon(void); + StatusCode fillRODErrorMon(void); + + StatusCode bookSpacePointMon(void); + StatusCode fillSpacePointMon(void); + + StatusCode bookPixelDCSMon(void); + StatusCode fillPixelDCSMon(void); + StatusCode procPixelDCSMon(void); + + private: + ServiceHandle<IInDetConditionsSvc> m_pixelCondSummarySvc; + ServiceHandle<IPixelByteStreamErrorsSvc> m_ErrorSvc; + ServiceHandle<IPixelCablingSvc> m_pixelCableSvc; + ServiceHandle<IBLParameterSvc> m_IBLParameterSvc; + ToolHandle<Trk::ITrackHoleSearchTool> m_holeSearchTool; + ToolHandle<ILuminosityTool> m_lumiTool; + + const PixelID* m_pixelid; + uint64_t m_event; + uint64_t m_event2; + + time_t m_startTime; + bool m_majorityDisabled; // check for each event, true if >50% modules disabled + + int m_lbRange; + int m_bcidRange; + int m_lumiBlockNum; + unsigned int m_firstBookTime; + unsigned int m_currentTime; + unsigned int m_LBstartTime; + unsigned int m_LBendTime; + unsigned int m_currentBCID; + int m_runNum; + int m_ntracksPerEvent; + int m_nGood_mod[PixLayerIBL2D3D::COUNT]; + int m_nActive_mod[PixLayerIBL2D3D::COUNT]; + + unsigned int m_nRefresh; + unsigned int m_nRefresh5min; + + const AtlasDetectorID* m_idHelper; + + std::vector<Identifier> m_RDOIDs; + std::vector<Identifier> m_ClusterIDs; + + const DataHandle<PixelRDO_Container> m_rdocontainer; + const InDet::PixelClusterContainer* m_Pixel_clcontainer; + const SpacePointContainer* m_Pixel_spcontainer; + const TrackCollection* m_tracks; + + std::string m_Pixel_RDOName; + std::string m_detector_error_name; + std::string m_Pixel_SpacePointsName; + std::string m_Pixel_SiClustersName; + std::string m_TracksName; + std::string m_error_summary; + + std::string m_histTitleExt; + + std::string m_modLabel_PixLayerIBL2D3D[PixLayerIBL2D3D::COUNT] = { + "ECA", "ECC", "B0", "B1", "B2", + "IBL", "IBL2D", "IBL3D" + }; + std::string m_modLabel_PixLayerDBM[PixLayerDBM::COUNT] = { + "ECA", "ECC", + "B0", "B1", "B2", + "DBMA", "DBMC", "IBL" + }; + std::string m_modLabel_PixLayerIBL2D3DDBM[PixLayerIBL2D3DDBM::COUNT] = { + "ECA", "ECC", + "B0", "B1", "B2", + "DBMA", "DBMC", "IBL", "IBL2D", "IBL3D" + }; + std::string m_modLabel_PixLayerDisk[PixLayerDisk::COUNT] = { + "ECA0", "ECA1", "ECA2", + "ECC0", "ECC1", "ECC2", + "B0", "B1", "B2", "IBL" + }; + + bool m_doRDO; + bool m_doRODError; + bool m_doCluster; + bool m_doSpacePoint; + bool m_doTrack; + bool m_doStatus; + bool m_doDCS; + + bool m_doHoleSearch; + bool m_doESD; + bool m_do2DMaps; + bool m_doModules; + bool m_doOffline; + bool m_doOnline; + bool m_doLowOccupancy; + bool m_doHighOccupancy; + bool m_doOnTrack; + bool m_doPixelOccupancy; + bool m_doDetails; + bool m_doTiming; + bool m_doLumiBlock; + bool m_doRefresh; + bool m_doRefresh5min; + bool m_isFirstBook; + bool m_doOfflineAnalysis; + + bool m_doHeavyIonMon; + + std::string m_DetailsMod1; + std::string m_DetailsMod2; + std::string m_DetailsMod3; + std::string m_DetailsMod4; + + bool m_doIBL; + + bool m_isNewRun; + bool m_isNewLumiBlock; + bool m_newLowStatInterval; + + double m_occupancy_cut; + + int m_ClusPerEventArray_disksA[48][3]; + int m_ClusPerEventArray_disksC[48][3]; + int m_ClusPerEventArray_lI[14][20]; + int m_ClusPerEventArray_l0[22][13]; + int m_ClusPerEventArray_l1[38][13]; + int m_ClusPerEventArray_l2[52][13]; + + int m_HitPerEventArray_disksA[48][3] = {0}; + int m_HitPerEventArray_disksC[48][3] = {0}; + int m_HitPerEventArray_lI[14][20] = {0}; + int m_HitPerEventArray_l0[22][13] = {0}; + int m_HitPerEventArray_l1[38][13] = {0}; + int m_HitPerEventArray_l2[52][13] = {0}; + + //////////////////////Histograms/////////////////////////// + + // event info + TH1F_LW* m_events_per_lumi; + TProfile_LW* m_mu_vs_bcid; + TProfile_LW* m_mu_vs_lumi; + TH2F_LW* m_storegate_errors; + + // number of hits + TProfile_LW* m_hits_per_lumi; + TH1I_LW* m_num_hits; + std::unique_ptr<PixelMon2DMapsLW> m_hitmap_mon; + std::unique_ptr<PixelMon2DMapsLW> m_hitmap_tmp; + TH1F_LW* m_nhits_mod[PixLayer::COUNT]; + TProfile_LW* m_hits_per_lumi_mod[PixLayer::COUNT]; + TH1F_LW* m_nlargeevt_per_lumi_mod[PixLayerIBL2D3D::COUNT]; + TH1F_LW* m_totalhits_per_bcid_mod[PixLayerIBL2D3D::COUNT]; + + // hit occupancy + TProfile_LW* m_avgocc_per_lumi; + TProfile_LW* m_avgocc_ratioIBLB0_per_lumi; + TProfile_LW* m_avgocc_per_lumi_mod[PixLayerIBL2D3D::COUNT]; + TProfile_LW* m_avgocc_per_bcid_mod[PixLayerIBL2D3D::COUNT]; + TProfile2D_LW* m_avgocc_per_bcid_per_lumi_mod[PixLayerIBL2D3D::COUNT]; + TProfile_LW* m_avgocc_active_per_lumi_mod[PixLayerIBL2D3D::COUNT]; + TH2F_LW* m_maxocc_per_lumi_mod[PixLayerIBL2D3D::COUNT]; + TH2F_LW* m_modocc_per_lumi[PixLayer::COUNT]; + TH1F_LW* m_maxocc_per_bcid_mod[PixLayerIBL2D3D::COUNT]; + std::unique_ptr<PixelMon2DMapsLW> m_occupancy; + std::unique_ptr<PixelMon2DMapsLW> m_average_pixocc; + std::unique_ptr<PixelMon2DProfilesLW> m_occupancy_pix_evt; + std::unique_ptr<PixelMon2DMapsLW> m_occupancy_10min; + TProfile* m_occupancy_time1; + TProfile* m_occupancy_time2; + TProfile* m_occupancy_time3; + TH1F_LW* m_occupancy_summary_mod[PixLayer::COUNT]; + TH3F* m_nFEswithHits_mod[PixLayer::COUNT]; + + // hit tot + TH1F_LW* m_hit_ToT[PixLayerIBL2D3DDBM::COUNT]; + TH2F_LW* m_hit_ToT_per_lumi_mod[PixLayerIBL2D3D::COUNT]; + TH1F_LW* m_hit_ToT_tmp_mod[PixLayer::COUNT]; + TH1F_LW* m_hit_ToT_Mon_mod[PixLayer::COUNT]; + TProfile2D_LW* m_ToT_etaphi_mod[PixLayer::COUNT]; + TProfile_LW* m_hit_ToTMean_mod[PixLayer::COUNT]; + + // timing + TH1I_LW* m_Lvl1ID_PIX; + TH1I_LW* m_Lvl1ID_IBL; + TH1F_LW* m_Atlas_BCID; + TH2F_LW* m_Atlas_BCID_hits; + TH1I_LW* m_BCID; + TProfile_LW* m_BCID_Profile; + TH1F_LW* m_Lvl1A; + TH1F_LW* m_Lvl1A_mod[PixLayerDBM::COUNT]; + TH1F_LW* m_Lvl1A_10min_mod[PixLayer::COUNT]; + TH1I_LW* m_Lvl1ID_diff_mod_ATLAS_mod[PixLayer::COUNT]; + TH1I_LW* m_diff_ROD_vs_Module_BCID_mod[PixLayer::COUNT]; + std::unique_ptr<PixelMon2DLumiProfiles> m_Lvl1ID_diff_mod_ATLAS_per_LB; + std::unique_ptr<PixelMon2DLumiProfiles> m_Lvl1ID_absdiff_mod_ATLAS_per_LB; + + // quick status + TH2F_LW* m_nhits_L0_B11_S2_C6; + TProfile2D_LW* m_occupancy_L0_B11_S2_C6; + + // module histograms + std::unique_ptr<PixelMonModules1D> m_hit_num_mod; + std::unique_ptr<PixelMonModulesProf> m_hiteff_mod; + std::unique_ptr<PixelMonModules1D> m_FE_chip_hit_summary; + std::unique_ptr<PixelMonModules2D> m_pixel_occupancy; + + // detailed histograms + TH1F_LW* m_Details_mod1_num_hits; + TH1F_LW* m_Details_mod2_num_hits; + TH1F_LW* m_Details_mod3_num_hits; + TH1F_LW* m_Details_mod4_num_hits; + TH2F_LW* m_Details_mod1_occupancy; + TH2F_LW* m_Details_mod2_occupancy; + TH2F_LW* m_Details_mod3_occupancy; + TH2F_LW* m_Details_mod4_occupancy; + TH1F_LW* m_Details_mod1_ToT; + TH1F_LW* m_Details_mod2_ToT; + TH1F_LW* m_Details_mod3_ToT; + TH1F_LW* m_Details_mod4_ToT; + + // track quality + TH1F_LW* m_track_res_phi; + TH1F_LW* m_track_pull_phi; + TH1F_LW* m_track_res_eta; + TH1F_LW* m_track_pull_eta; + TH1F_LW* m_track_chi2; + TProfile_LW* m_tracksPerEvt_per_lumi; + TProfile_LW* m_tracksPerEvtPerMu_per_lumi; + + // track state on surface + std::unique_ptr<PixelMon2DMapsLW> m_tsos_hitmap; + std::unique_ptr<PixelMon2DMapsLW> m_tsos_holemap; + std::unique_ptr<PixelMon2DMapsLW> m_tsos_outliermap; + std::unique_ptr<PixelMon2DProfilesLW> m_tsos_holeratio_tmp; + std::unique_ptr<PixelMon2DProfilesLW> m_tsos_holeratio_mon; + std::unique_ptr<PixelMon2DProfilesLW> m_misshits_ratio_tmp; + std::unique_ptr<PixelMon2DProfilesLW> m_misshits_ratio_mon; + + // hit efficiency + TProfile_LW* m_hiteff_incl_mod[PixLayerDisk::COUNT]; + + // lorentz angle + TProfile2D_LW* m_LorentzAngle_IBL; + TProfile2D_LW* m_LorentzAngle_IBL2D; + TProfile2D_LW* m_LorentzAngle_IBL3D; + TProfile2D_LW* m_LorentzAngle_B0; + TProfile2D_LW* m_LorentzAngle_B1; + TProfile2D_LW* m_LorentzAngle_B2; + + // cluster size + TH1F_LW* m_clusize_ontrack_mod[PixLayerIBL2D3D::COUNT]; + TH1F_LW* m_clusize_offtrack_mod[PixLayerIBL2D3D::COUNT]; + + // module histograms + TH1F_LW* m_track_chi2_bcl1; + TH1F_LW* m_track_chi2_bcl0; + TH1F_LW* m_track_chi2_bclgt1; + TH1F_LW* m_track_chi2_bcl1_highpt; + TH1F_LW* m_track_chi2_bcl0_highpt; + TH1F_LW* m_track_chi2_bclgt1_highpt; + TH2F_LW* m_clustot_vs_pt; + TH1F_LW* m_clustot_lowpt; + TH1F_LW* m_1hitclustot_lowpt; + TH1F_LW* m_2hitclustot_lowpt; + TH1F_LW* m_clustot_highpt; + TH1F_LW* m_1hitclustot_highpt; + TH1F_LW* m_2hitclustot_highpt; + std::unique_ptr<PixelMonModulesProf> m_tsos_hiteff_vs_lumi; + + // cluster histograms + TProfile_LW* m_clusters_per_lumi; + TProfile_LW* m_clusters_per_lumi_mod[PixLayer::COUNT]; + TProfile_LW* m_clusters_row_width_per_lumi_mod[PixLayerIBL2D3D::COUNT]; + TProfile_LW* m_clusters_col_width_per_lumi_mod[PixLayerIBL2D3D::COUNT]; + TProfile_LW* m_clusters_row_width_per_bcid_mod[PixLayerIBL2D3D::COUNT]; + TProfile_LW* m_clusters_col_width_per_bcid_mod[PixLayerIBL2D3D::COUNT]; + TProfile_LW* m_largeclusters_per_lumi; + TProfile_LW* m_verylargeclusters_per_lumi; + TH1I_LW* m_totalclusters_per_lumi; + TH1I_LW* m_totalclusters_per_lumi_mod[PixLayerIBL2D3D::COUNT]; + TH1I_LW* m_totalclusters_per_bcid_mod[PixLayerIBL2D3D::COUNT]; + TH1I_LW* m_highNclusters_per_lumi; + TH1F_LW* m_cluster_ToT1d_mod[PixLayerIBL2D3DDBM::COUNT]; + TH1F_LW* m_1cluster_ToT_mod[PixLayer::COUNT]; + TH1F_LW* m_2cluster_ToT_mod[PixLayer::COUNT]; + TH1F_LW* m_3cluster_ToT_mod[PixLayer::COUNT]; + TH1F_LW* m_bigcluster_ToT_mod[PixLayer::COUNT]; + TH1F_LW* m_cluster_Q_mod[PixLayerIBL2D3DDBM::COUNT]; + TH1F_LW* m_1cluster_Q_mod[PixLayer::COUNT]; + TH1F_LW* m_2cluster_Q_mod[PixLayer::COUNT]; + TH1F_LW* m_3cluster_Q_mod[PixLayer::COUNT]; + TH1F_LW* m_bigcluster_Q_mod[PixLayer::COUNT]; + std::unique_ptr<PixelMon2DProfilesLW> m_clussize_map; + std::unique_ptr<PixelMon2DProfilesLW> m_cluscharge_map; + std::unique_ptr<PixelMon2DProfilesLW> m_clusToT_map; + TH1F_LW* m_cluster_groupsize; + TH1F_LW* m_cluster_col_width; + TH1F_LW* m_cluster_row_width; + TH1F_LW* m_cluster_col_width_mod[PixLayerIBL2D3D::COUNT]; + TH1F_LW* m_cluster_row_width_mod[PixLayerIBL2D3D::COUNT]; + TH1F_LW* m_cluster_groupsize_mod[PixLayerIBL2D3DDBM::COUNT]; + TH1F_LW* m_cluster_LVL1A; + TH1F_LW* m_cluster_LVL1A1d_mod[PixLayer::COUNT]; + TProfile_LW* m_clusterSize_eta; + TH2F_LW* m_clusToT_vs_eta_mod[PixLayer::COUNT]; + TH2F_LW* m_ToT_vs_clussize_mod[PixLayer::COUNT]; + TProfile_LW* m_clussize_vs_eta_mod[PixLayer::COUNT]; + + std::unique_ptr<PixelMon2DMapsLW> m_clustermap_mon; + std::unique_ptr<PixelMon2DMapsLW> m_clustermap_tmp; + std::unique_ptr<PixelMon2DMapsLW> m_cluster_occupancy; + TH2F_LW* m_cluster_occupancy_FE_B0_mon; + TProfile* m_cluster_occupancy_time1; + TProfile* m_cluster_occupancy_time2; + TProfile* m_cluster_occupancy_time3; + + std::unique_ptr<PixelMon2DMapsLW> m_clusocc_sizenot1; + std::unique_ptr<PixelMonModulesProf> m_cluseff_mod; + std::unique_ptr<PixelMonModules1D> m_cluster_ToT_mod; + std::unique_ptr<PixelMonModules1D> m_cluster_size_mod; + std::unique_ptr<PixelMonModules1D> m_cluster_num_mod; + TH1I_LW* m_num_clusters; + TProfile_LW* m_clusters_per_track_per_lumi_mod[PixLayer::COUNT]; + TH1I_LW* m_num_clusters_mod[PixLayer::COUNT]; + TH1F_LW* m_cluster_occupancy_summary_mod[PixLayer::COUNT]; + std::unique_ptr<PixelMon2DProfilesLW> m_cluster_LVL1A_mod; + std::unique_ptr<PixelMon2DProfilesLW> m_clus_LVL1A_sizenot1; + TProfile_LW* m_clustersOnOffTrack_per_lumi; + + // quick status + TH2F_LW* m_clusters_onTrack_L0_B11_S2_C6; + TH2F_LW* m_clusters_offTrack_L0_B11_S2_C6; + + // status histograms + std::unique_ptr<PixelMonModules1D> m_Status_modules; + std::unique_ptr<PixelMon2DProfilesLW> m_status; + std::unique_ptr<PixelMon2DProfilesLW> m_status_mon; + std::unique_ptr<PixelMon2DProfilesLW> m_status_LB; + std::unique_ptr<PixelMon2DMapsLW> m_dqStatus; + TProfile_LW* m_disabledModules_per_lumi_PIX; + TProfile_LW* m_badModules_per_lumi_mod[PixLayerIBL2D3D::COUNT]; + TProfile_LW* m_disabledModules_per_lumi_mod[PixLayerIBL2D3D::COUNT]; + TProfile_LW* m_baddisabledModules_per_lumi_mod[PixLayerIBL2D3D::COUNT]; + + // ROD error histograms + static const int kNumErrorBits{32}; + static const int kNumErrorStates{16}; + static const int kNumErrorStatesIBL{27}; + TProfile_LW* m_errhist_errcat_LB[PixLayerIBL2D3D::COUNT][ErrorCategory::COUNT]; + TProfile_LW* m_errhist_errtype_LB[PixLayerIBL2D3D::COUNT][ErrorCategoryMODROD::COUNT - 3]; + std::unique_ptr<PixelMon2DMapsLW> m_errhist_errcat_map[ErrorCategory::COUNT]; + std::unique_ptr<PixelMon2DMapsLW> m_errhist_errtype_map[ErrorCategoryMODROD::COUNT]; + TProfile_LW* m_errhist_errcat_avg[ErrorCategory::COUNT][PixLayerIBL2D3D::COUNT]; + TProfile_LW* m_errhist_errtype_avg[ErrorCategoryMODROD::COUNT - 3][PixLayerIBL2D3D::COUNT]; + TProfile_LW* m_errhist_tot_LB[PixLayerIBL2D3D::COUNT]; + TProfile2D_LW* m_errhist_per_bit_LB[PixLayerIBL2D3D::COUNT]; + TProfile2D_LW* m_errhist_per_type_LB[PixLayerIBL2D3D::COUNT]; + TProfile_LW* m_errhist_syncerr_LB_pix; + TProfile* m_error_time1; + TProfile* m_error_time2; + TProfile* m_error_time3; + std::unique_ptr<PixelMonModules1D> m_errors; + std::unique_ptr<PixelMon2DProfilesLW> m_errhist_femcc_errwords_map; + + // Histograms in 'ErrorsExpert' folder + std::unique_ptr<PixelMon2DLumiMaps> m_errhist_expert_LB_maps[kNumErrorStates + kNumErrorStatesIBL]; + std::unique_ptr<PixelMon2DMapsLW> m_errhist_expert_maps[kNumErrorStates + kNumErrorStatesIBL]; + TProfile_LW* m_errhist_expert_LB[PixLayer::COUNT - 1][kNumErrorStates]; + TProfile_LW* m_errhist_expert_IBL_LB[kNumErrorStatesIBL]; + TH3F* m_errhist_expert_fe_trunc_err_3d[PixLayer::COUNT]; + TH1F_LW* m_errhist_expert_servrec_ibl_unweighted; + TH1F_LW* m_errhist_expert_servrec_ibl_weighted; + TH1F_LW* m_errhist_expert_servrec_ibl_count; + + // Histograms in low-stat folder + std::unique_ptr<PixelMon2DMapsLW> m_errors_LB; + std::unique_ptr<PixelMon2DMapsLW> m_errors_RODSync_mod; + std::unique_ptr<PixelMon2DMapsLW> m_errors_ModSync_mod; + + // space-point histograms + TH1I_LW* m_num_spacepoints; + TH1I_LW* m_num_spacepoints_low; + TH1F_LW* m_spHit_x; + TH1F_LW* m_spHit_y; + TH1F_LW* m_spHit_z; + TH1F_LW* m_spHit_r; + TH1F_LW* m_spHit_phi; + TH2F_LW* m_spHit_xy; + TH2F_LW* m_spHit_rz; + + std::unique_ptr<PixelMon2DMapsLW> m_cluster_occupancy_LB; // cluster occupancy (shows module status) + std::unique_ptr<PixelMonModules1D> m_cluster_ToT_mod_LB; + std::unique_ptr<PixelMonModules1D> m_cluster_num_mod_LB; + std::unique_ptr<PixelMonModules1D> m_hit_num_mod_LB; + + TH1I_LW* m_num_hits_LB; + TH1F_LW* m_hit_ToT_LB_mod[PixLayer::COUNT]; + TH1F_LW* m_cluster_ToT_LB; + TH1I_LW* m_num_clusters_LB; + + // DCS Monitoring + TProfile2D_LW* m_hist_moduleTemperatureEtaPhi; + TH2F_LW* m_hist_moduleTemperature2Dscatter[IBLStave::COUNT]; + TProfile_LW* m_hist_moduleTemperatureLB[IBLStave::COUNT]; + TProfile2D_LW* m_hist_LB_staveID_moduleTemperature; + TProfile2D_LW* m_hist_LB_moduleGroup_moduleTemperature[IBLStave::COUNT]; + TProfile2D_LW* m_hist_HVoltageEtaPhi; + TH2F_LW* m_hist_HVoltage2Dscatter[IBLStave::COUNT]; + TProfile_LW* m_hist_HVoltageLB[IBLStave::COUNT]; + TProfile2D_LW* m_hist_LB_staveID_HVoltage; + TProfile2D_LW* m_hist_LB_moduleGroup_HVoltage[IBLStave::COUNT]; + TH2F_LW* m_hist_Pipes_inlet2Dscatter; + TProfile_LW* m_hist_Pipes_inletLB[IBLStave::COUNT]; + TProfile2D_LW* m_hist_LB_staveID_coolingPipeInlet; + TH2F_LW* m_hist_Pipes_outlet2Dscatter; + TProfile_LW* m_hist_Pipes_outletLB[IBLStave::COUNT]; + TProfile2D_LW* m_hist_LB_staveID_coolingPipeOutlet; + TProfile2D_LW* m_hist_LVoltageEtaPhi; + TH2F_LW* m_hist_LVoltage2Dscatter[IBLStave::COUNT]; + TProfile_LW* m_hist_LVoltageLB[IBLStave::COUNT]; + TProfile2D_LW* m_hist_LB_staveID_LVoltage; + TProfile2D_LW* m_hist_LB_moduleGroup_LVoltage[IBLStave::COUNT]; + TProfile2D_LW* m_hist_LVcurrentEtaPhi; + TH2F_LW* m_hist_LVcurrent2Dscatter[IBLStave::COUNT]; + TProfile_LW* m_hist_LVcurrentLB[IBLStave::COUNT]; + TProfile2D_LW* m_hist_LB_staveID_LVcurrent; + TProfile2D_LW* m_hist_LB_moduleGroup_LVcurrent[IBLStave::COUNT]; + TProfile2D_LW* m_hist_HVcurrentEtaPhi; + TH2F_LW* m_hist_HVcurrent2Dscatter[IBLStave::COUNT]; + TProfile_LW* m_hist_HVcurrentLB[IBLStave::COUNT]; + TProfile2D_LW* m_hist_LB_staveID_HVcurrent; + TProfile2D_LW* m_hist_LB_moduleGroup_HVcurrent[IBLStave::COUNT]; + TH2F* m_hist_FSMstateEtaPhi; + TH2F_LW* m_hist_FSMstate2Dscatter[IBLStave::COUNT]; + TH2F_LW* m_hist_FSMstateLB[IBLStave::COUNT]; + TH2F* m_hist_LB_staveID_FSMstate; + TH2F* m_hist_LB_moduleGroup_FSMstate[IBLStave::COUNT]; + TH2F* m_hist_FSMstatusEtaPhi; + TH2F_LW* m_hist_FSMstatus2Dscatter[IBLStave::COUNT]; + TH2F_LW* m_hist_FSMstatusLB[IBLStave::COUNT]; + TH2F* m_hist_LB_staveID_FSMstatus; + TH2F* m_hist_LB_moduleGroup_FSMstatus[IBLStave::COUNT]; + + // Combination histograms + TProfile2D_LW* m_hist_dTEtaPhi; + TProfile2D_LW* m_hist_LB_moduleGroup_dT[IBLStave::COUNT]; + TProfile2D_LW* m_hist_LB_staveID_dT; + TProfile2D_LW* m_hist_LVPowerConsumptionEtaPhi; + TProfile2D_LW* m_hist_LB_moduleGroup_LVPowerConsumption[IBLStave::COUNT]; + TProfile2D_LW* m_hist_LB_staveID_LVPowerConsumption; + TProfile2D_LW* m_hist_HVPowerConsumptionEtaPhi; + TProfile2D_LW* m_hist_LB_moduleGroup_HVPowerConsumption[IBLStave::COUNT]; + TProfile2D_LW* m_hist_LB_staveID_HVPowerConsumption; + TProfile2D_LW* m_hist_LVHVPowerConsumptionEtaPhi; + TProfile2D_LW* m_hist_LB_moduleGroup_LVHVPowerConsumption[IBLStave::COUNT]; + TProfile2D_LW* m_hist_LB_staveID_LVHVPowerConsumption; + TProfile2D_LW* m_hist_effFLEXtempEtaPhi; + TProfile2D_LW* m_hist_LB_moduleGroup_effFLEXtemp[IBLStave::COUNT]; + TProfile2D_LW* m_hist_LB_staveID_effFLEXtemp; + TProfile2D_LW* m_hist_thermalFigureMeritEtaPhi; + TProfile2D_LW* m_hist_LB_moduleGroup_thermalFigureMerit[IBLStave::COUNT]; + TProfile2D_LW* m_hist_LB_staveID_thermalFigureMerit; + + std::vector<std::string> m_atrcollist; + std::map<std::string, std::vector<std::string> > m_elementsMap; + int m_currentLumiBlockNumber; + + class dcsDataHolder { + public: + dcsDataHolder() : m_values(new std::map<int, std::map<int, float>*>), + m_maps(new std::map<std::string, int>){}; + ~dcsDataHolder() { + for (auto lbmap : *m_values) { + delete lbmap.second; + } + delete m_values; + delete m_maps; + }; + std::map<int, std::map<int, float>*>* m_values; // <channel number, <LB, value> > + std::map<std::string, int>* m_maps; // <module name, channel number> + }; + dcsDataHolder* m_moduleTemperature; + dcsDataHolder* m_coolingPipeTemperatureInlet; + dcsDataHolder* m_coolingPipeTemperatureOutlet; + dcsDataHolder* m_HV; + dcsDataHolder* m_HV_current; + dcsDataHolder* m_LV_voltage; + dcsDataHolder* m_LV_current; + dcsDataHolder* m_FSM_state; + dcsDataHolder* m_FSM_status; + + class moduleDcsDataHolder { + public: + moduleDcsDataHolder() : m_tempModule(new std::map<int, std::map<int, float>*>), + m_tempInlet(new std::map<int, std::map<int, float>*>), + m_tempOutlet(new std::map<int, std::map<int, float>*>), + m_hv_voltage(new std::map<int, std::map<int, float>*>), + m_lv_voltage(new std::map<int, std::map<int, float>*>), + m_hv_current(new std::map<int, std::map<int, float>*>), + m_lv_current(new std::map<int, std::map<int, float>*>), + m_fsm_state(new std::map<int, std::map<int, float>*>), + m_fsm_status(new std::map<int, std::map<int, float>*>), + m_moduleMap(new std::map<std::string, int>){}; + ~moduleDcsDataHolder() { + for (auto lbmap : *m_tempModule) { + delete lbmap.second; + } + for (auto lbmap : *m_tempInlet) { + delete lbmap.second; + } + for (auto lbmap : *m_tempOutlet) { + delete lbmap.second; + } + for (auto lbmap : *m_hv_voltage) { + delete lbmap.second; + } + for (auto lbmap : *m_lv_voltage) { + delete lbmap.second; + } + for (auto lbmap : *m_hv_current) { + delete lbmap.second; + } + for (auto lbmap : *m_lv_current) { + delete lbmap.second; + } + for (auto lbmap : *m_fsm_state) { + delete lbmap.second; + } + for (auto lbmap : *m_fsm_status) { + delete lbmap.second; + } + delete m_tempModule; + delete m_tempInlet; + delete m_tempOutlet; + delete m_hv_voltage; + delete m_lv_voltage; + delete m_hv_current; + delete m_lv_current; + delete m_fsm_state; + delete m_fsm_status; + delete m_moduleMap; + }; + // <module number, <LB, value> > + std::map<int, std::map<int, float>*>* m_tempModule; + std::map<int, std::map<int, float>*>* m_tempInlet; + std::map<int, std::map<int, float>*>* m_tempOutlet; + std::map<int, std::map<int, float>*>* m_hv_voltage; + std::map<int, std::map<int, float>*>* m_lv_voltage; + std::map<int, std::map<int, float>*>* m_hv_current; + std::map<int, std::map<int, float>*>* m_lv_current; + std::map<int, std::map<int, float>*>* m_fsm_state; + std::map<int, std::map<int, float>*>* m_fsm_status; + // <module name, channel number> + std::map<std::string, int>* m_moduleMap; + }; + moduleDcsDataHolder* m_moduleDCSDataHolder; + + public: + int getIBLetaIndexFromModuleName(std::string moduleName) { + int module_eta = m_name2etaIndex[moduleName.substr(static_cast<int>(moduleName.find("S")) + 4)]; + return module_eta; + } + + int getIBLmoduleGroupFromModuleName(std::string moduleName) { + int moduleGroup = m_name2moduleGroup[moduleName.substr(static_cast<int>(moduleName.find("S")) + 4, 4)]; // LI_S01_A_M4_A8_2 + return moduleGroup; + } + + int getIBLstaveIdFromModuleName(std::string moduleName) { + std::string staveNumStr(moduleName, moduleName.find("S") + 1, 2); // LI_S01_A_... + int staveNum = std::stoi(staveNumStr); + return staveNum; + } + + private: + std::map<std::string, int> m_name2etaIndex; + std::map<std::string, int> m_name2moduleGroup; + + std::map<std::string, float> m_fsmState2enum; + std::map<std::string, float> m_fsmStatus2enum; +}; // end class PixelMainMon : public ManagedMonitorToolBase + +#endif diff --git a/InnerDetector/InDetMonitoring/PixelMonitoring/PixelMonitoring/PixelMon2DLumiMaps.h b/InnerDetector/InDetMonitoring/PixelMonitoring/PixelMonitoring/PixelMon2DLumiMaps.h index ecd0bcc8e4ed7d8ecb2a7a9f3268890a595e105b..112285429bf18ca45c85707cc9d11d8bb1006cde 100644 --- a/InnerDetector/InDetMonitoring/PixelMonitoring/PixelMonitoring/PixelMon2DLumiMaps.h +++ b/InnerDetector/InDetMonitoring/PixelMonitoring/PixelMonitoring/PixelMon2DLumiMaps.h @@ -45,7 +45,7 @@ class PixelMon2DLumiMaps : public PixMon::HolderTemplate<TH2F_LW> { * into readable info (e.g. eta/phi module index) * @param weight: optional weighting factor */ - void Fill(double LB, Identifier &id, const PixelID* pixID, float weight = 1.0); + void fill(double LB, Identifier &id, const PixelID* pixID, float weight = 1.0); //! Formatting function for histograms (reimplemented from template) virtual void formatHist() override; diff --git a/InnerDetector/InDetMonitoring/PixelMonitoring/PixelMonitoring/PixelMon2DLumiProfiles.h b/InnerDetector/InDetMonitoring/PixelMonitoring/PixelMonitoring/PixelMon2DLumiProfiles.h index a5cef713cdeb5abfcf463f2b448551129b985b68..40d0b3a59c2dbd7f6a6caa496b94de37e4835799 100644 --- a/InnerDetector/InDetMonitoring/PixelMonitoring/PixelMonitoring/PixelMon2DLumiProfiles.h +++ b/InnerDetector/InDetMonitoring/PixelMonitoring/PixelMonitoring/PixelMon2DLumiProfiles.h @@ -46,7 +46,7 @@ class PixelMon2DLumiProfiles : public PixMon::HolderTemplate<TProfile2D_LW> { * into readable info (e.g. eta/phi module index) * @param weight: optional weighting factor */ - void Fill(double LB, Identifier &id, const PixelID* pixID, double weight = 1.0); + void fill(double LB, Identifier &id, const PixelID* pixID, double weight = 1.0); //! Formatting function for histograms (reimplemented from template) void formatHist(); diff --git a/InnerDetector/InDetMonitoring/PixelMonitoring/PixelMonitoring/PixelMon2DMapsLW.h b/InnerDetector/InDetMonitoring/PixelMonitoring/PixelMonitoring/PixelMon2DMapsLW.h index f0c81cc8b73fa82edb6718af5df5e8781c82563c..74462684ca8896b2a15710d6858dbbed7532ca74 100644 --- a/InnerDetector/InDetMonitoring/PixelMonitoring/PixelMonitoring/PixelMon2DMapsLW.h +++ b/InnerDetector/InDetMonitoring/PixelMonitoring/PixelMonitoring/PixelMon2DMapsLW.h @@ -41,10 +41,10 @@ class PixelMon2DMapsLW : public PixMon::HolderTemplate<TH2F_LW> { * into readable info (e.g. eta/phi module index) * @param weight: optional weighting factor */ - void Fill(Identifier &id, const PixelID* pixID, float weight = 1.0); + void fill(Identifier &id, const PixelID* pixID, float weight = 1.0); //! Fill method which takes values from another map - void Fill2DMon(PixelMon2DMapsLW* oldmap); + void fill2DMon(PixelMon2DMapsLW* oldmap); //! Formatting function for histograms (reimplemented from template) virtual void formatHist() override; diff --git a/InnerDetector/InDetMonitoring/PixelMonitoring/PixelMonitoring/PixelMon2DProfilesLW.h b/InnerDetector/InDetMonitoring/PixelMonitoring/PixelMonitoring/PixelMon2DProfilesLW.h index f8772336fe96b63c912901c080cce8f9fd444763..8c9d23ca138f91bf414e091c663d62ceeec851ee 100644 --- a/InnerDetector/InDetMonitoring/PixelMonitoring/PixelMonitoring/PixelMon2DProfilesLW.h +++ b/InnerDetector/InDetMonitoring/PixelMonitoring/PixelMonitoring/PixelMon2DProfilesLW.h @@ -42,19 +42,19 @@ public: * into readable info (e.g. eta/phi module index) * @param value: the fill value */ - void Fill(Identifier &id, const PixelID* pixID, float value); + void fill(Identifier &id, const PixelID* pixID, float value); //! Fill method which takes values from another 2D profile - void Fill2DMon(PixelMon2DProfilesLW* oldmap); + void fill2DMon(PixelMon2DProfilesLW* oldmap); //! Fill method which takes values from a 2D map object - void FillFromMap(PixelMon2DMapsLW* inputmap, bool clear_inputmap); + void fillFromMap(PixelMon2DMapsLW* inputmap, bool clear_inputmap); //! Set maximal value of the 2D profile bins - void SetMaxValue(float max); + void setMaxValue(float max); //! Reset the 2D profiles - void Reset(); + void reset(); //! Formatting function for histograms (reimplemented from template) virtual void formatHist() override; diff --git a/InnerDetector/InDetMonitoring/PixelMonitoring/PixelMonitoring/PixelMonModules.h b/InnerDetector/InDetMonitoring/PixelMonitoring/PixelMonitoring/PixelMonModules.h index 26e416271eaf5f44fdcd38aec9868b24c433d2a6..3cd88602a3699d93d9762ac49085c81cb94c486d 100644 --- a/InnerDetector/InDetMonitoring/PixelMonitoring/PixelMonitoring/PixelMonModules.h +++ b/InnerDetector/InDetMonitoring/PixelMonitoring/PixelMonitoring/PixelMonModules.h @@ -17,83 +17,84 @@ class PixelID; class StatusCode; // A helper class to remove a lot of the code duplication. -// This is a collection of 1744 1D histograms which make up one set of module histograms. -// It will book the histograms in the constructor. The fill method will take the identifier -// as the input and fill the correct histogram and bin. +// This is a collection of 1744 1D histograms which make up one set of module +// histograms. It will book the histograms in the constructor. The fill method +// will take the identifier as the input and fill the correct histogram and bin. -class PixelMonModules -{ - public: - //PixelMonModules(); - virtual void formatHist(std::string) = 0; //pass the bin labels here if needed - virtual void Reset() = 0; - virtual StatusCode regHist(ManagedMonitorToolBase* thisptr, std::string path, ManagedMonitorToolBase::Interval_t Run) = 0; - protected: - int m_nBins; - std::string getHistName(int i, bool forPath = false); - static const bool m_doIBL; +class PixelMonModules { + public: + // PixelMonModules(); + virtual void formatHist(std::string) = 0; // pass the bin labels here if needed + virtual void reset() = 0; + virtual StatusCode regHist(ManagedMonitorToolBase* thisptr, std::string path, ManagedMonitorToolBase::Interval_t Run) = 0; + + protected: + int m_nBins; + std::string getHistName(int i, bool forPath = false); + static const bool m_doIBL; }; -class PixelMonModules1D : public PixelMonModules -{ - public: - PixelMonModules1D(std::string name, std::string title, int nbins, double low, double high); - PixelMonModules1D(std::string name, std::string title, int nbins, double *arr); - StatusCode regHist(ManagedMonitorToolBase* thisptr, std::string path, ManagedMonitorToolBase::Interval_t Run); - TH1F* IBL[20][14]; - TH1F* B0[13][22]; - TH1F* B1[13][38]; - TH1F* B2[13][52]; - TH1F* A[3][48]; - TH1F* C[3][48]; - virtual void formatHist(std::string opt = ""); //pass the bin labels here if needed - void Fill(double value, Identifier &id, const PixelID* pixID); - void SetBinLabel(const char* lable, int binN); - virtual void Reset(); - double GetBinContent(double value, Identifier &id, const PixelID* pixID); - private: - TH1F* m_Dummy; //shouldn't be used unless messed up; - TH1F* &getHist(int i); //make looping over all the histos easier. +class PixelMonModules1D : public PixelMonModules { + public: + PixelMonModules1D(std::string name, std::string title, int nbins, double low, double high); + PixelMonModules1D(std::string name, std::string title, int nbins, double* arr); + StatusCode regHist(ManagedMonitorToolBase* thisptr, std::string path, ManagedMonitorToolBase::Interval_t Run); + TH1F* IBL[20][14]; + TH1F* B0[13][22]; + TH1F* B1[13][38]; + TH1F* B2[13][52]; + TH1F* A[3][48]; + TH1F* C[3][48]; + virtual void formatHist(std::string opt = ""); // pass the bin labels here if needed + void fill(double value, Identifier& id, const PixelID* pixID); + void setBinLabel(const char* lable, int binN); + virtual void reset(); + double getBinContent(double value, Identifier& id, const PixelID* pixID); + + private: + TH1F* m_Dummy; // shouldn't be used unless messed up; + TH1F*& getHist(int i); // make looping over all the histos easier. }; -class PixelMonModulesProf : public PixelMonModules -{ - public: - PixelMonModulesProf(std::string name, std::string title, int nbins, double low, double high); - PixelMonModulesProf(std::string name, std::string title, int nbins, double *arr); - StatusCode regHist(ManagedMonitorToolBase* thisptr, std::string path, ManagedMonitorToolBase::Interval_t Run); - TProfile_LW* IBL[20][14]; - TProfile_LW* B0[13][22]; - TProfile_LW* B1[13][38]; - TProfile_LW* B2[13][52]; - TProfile_LW* A[3][48]; - TProfile_LW* C[3][48]; - virtual void formatHist(std::string opt = ""); //pass the bin labels here if needed - void Fill(double value0, double value1, Identifier &id, const PixelID* pixID); - void SetBinLabel(const char* lable, int binN); - virtual void Reset(); - private: - TProfile_LW* m_Dummy; //shouldn't be used unless messed up; - TProfile_LW* &getHist(int i); //make looping over all the histos easier. +class PixelMonModulesProf : public PixelMonModules { + public: + PixelMonModulesProf(std::string name, std::string title, int nbins, double low, double high); + PixelMonModulesProf(std::string name, std::string title, int nbins, double* arr); + StatusCode regHist(ManagedMonitorToolBase* thisptr, std::string path, ManagedMonitorToolBase::Interval_t Run); + TProfile_LW* IBL[20][14]; + TProfile_LW* B0[13][22]; + TProfile_LW* B1[13][38]; + TProfile_LW* B2[13][52]; + TProfile_LW* A[3][48]; + TProfile_LW* C[3][48]; + virtual void formatHist(std::string opt = ""); // pass the bin labels here if needed + void fill(double value0, double value1, Identifier& id, const PixelID* pixID); + void setBinLabel(const char* lable, int binN); + virtual void reset(); + + private: + TProfile_LW* m_Dummy; // shouldn't be used unless messed up; + TProfile_LW*& getHist(int i); // make looping over all the histos easier. }; -class PixelMonModules2D : public PixelMonModules -{ - public: - PixelMonModules2D(std::string name, std::string title, int nbins0, double low0, double high0,int nbins1, double low1, double high1); - StatusCode regHist(ManagedMonitorToolBase* thisptr, std::string path, ManagedMonitorToolBase::Interval_t Run); - TH2F* IBL[20][14]; - TH2F* B0[13][22]; - TH2F* B1[13][38]; - TH2F* B2[13][52]; - TH2F* A[3][48]; - TH2F* C[3][48]; - virtual void formatHist(std::string opt=""); //pass the bin labels here if needed - void Fill(double value0, double value1, Identifier &id, const PixelID* pixID, double weight = 1.); - virtual void Reset(); - private: - TH2F* m_Dummy; //shouldn't be used unless messed up; - TH2F* &getHist(int i); //make looping over all the histos easier. +class PixelMonModules2D : public PixelMonModules { + public: + PixelMonModules2D(std::string name, std::string title, int nbins0, + double low0, double high0, int nbins1, double low1, double high1); + StatusCode regHist(ManagedMonitorToolBase* thisptr, std::string path, ManagedMonitorToolBase::Interval_t Run); + TH2F* IBL[20][14]; + TH2F* B0[13][22]; + TH2F* B1[13][38]; + TH2F* B2[13][52]; + TH2F* A[3][48]; + TH2F* C[3][48]; + virtual void formatHist(std::string opt = ""); // pass the bin labels here if needed + void fill(double value0, double value1, Identifier& id, const PixelID* pixID, double weight = 1.); + virtual void reset(); + + private: + TH2F* m_Dummy; // shouldn't be used unless messed up; + TH2F*& getHist(int i); // make looping over all the histos easier. }; #endif diff --git a/InnerDetector/InDetMonitoring/PixelMonitoring/src/Clusters.cxx b/InnerDetector/InDetMonitoring/PixelMonitoring/src/Clusters.cxx index 9a1e7101eb5b57ea2ddebffdf8435fcce9fc458c..19361d7c2f5fcc3c0140084bfb6d75222774f096 100644 --- a/InnerDetector/InDetMonitoring/PixelMonitoring/src/Clusters.cxx +++ b/InnerDetector/InDetMonitoring/PixelMonitoring/src/Clusters.cxx @@ -6,73 +6,89 @@ // Book and fill histograms showing pixel cluster properties /////////////////////////////////////////////////////////////////////////////// -#include "PixelMonitoring/PixelMainMon.h" -#include "InDetRawData/InDetTimeCollection.h" -#include "InDetPrepRawData/PixelClusterContainer.h" +#include <sstream> #include "InDetConditionsSummaryService/IInDetConditionsSvc.h" -#include "PixelConditionsServices/IPixelByteStreamErrorsSvc.h" #include "InDetIdentifier/PixelID.h" -#include "TH1F.h" -#include "TH1I.h" -#include "TH2F.h" -#include "TH2I.h" +#include "InDetPrepRawData/PixelClusterContainer.h" +#include "InDetRawData/InDetTimeCollection.h" #include "LWHists/TH1F_LW.h" #include "LWHists/TH1I_LW.h" #include "LWHists/TH2F_LW.h" #include "LWHists/TH2I_LW.h" -#include "TProfile.h" -#include "LWHists/TProfile_LW.h" #include "LWHists/TProfile2D_LW.h" -#include <sstream> +#include "LWHists/TProfile_LW.h" +#include "PixelConditionsServices/IPixelByteStreamErrorsSvc.h" +#include "PixelMonitoring/PixelMainMon.h" +#include "TH1F.h" +#include "TH1I.h" +#include "TH2F.h" +#include "TH2I.h" +#include "TProfile.h" #include "PixelMonitoring/Components.h" #include "PixelMonitoring/PixelMon2DMapsLW.h" -#include "PixelMonitoring/PixelMonModules.h" #include "PixelMonitoring/PixelMon2DProfilesLW.h" +#include "PixelMonitoring/PixelMonModules.h" #include "PixelCabling/IPixelCablingSvc.h" - /////////////////////////////////////////////////////////////////////////////// //////////////////////booking methods////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////// -StatusCode PixelMainMon::BookClustersMon(void) -{ - if(msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "start booking pixel cluster monitoring histograms" << endmsg; - +StatusCode PixelMainMon::bookClustersMon(void) { + 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"); - 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 - + if (m_doOnTrack) path.replace(path.begin(), path.end(), "Pixel/ClustersOnTrack"); + 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"); - 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 - + if (m_doOnTrack) pathT.replace(pathT.begin(), pathT.end(), "Pixel/TimingOnTrack"); + 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"; + + 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; @@ -80,386 +96,401 @@ StatusCode PixelMainMon::BookClustersMon(void) std::string htitles; StatusCode sc; - + hname = makeHistname("ClusterSize_vs_eta", false); - htitles = makeHisttitle("Average cluster size as a function of barrel module eta", (atext_eta+atext_cluw), 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("Average number of large clusters (with >10 pixels) per event", (atext_LB+atext_clu), true); + htitles = makeHisttitle("Average 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); + 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); + 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); + 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); + 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); + 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)); - + 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); + 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); + 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); + + // 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); + + 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); + + 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); + + 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); + + 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); + + 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); + + 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); + + 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); + + 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); + + 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); + + 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); + + 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(("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<PixLayerIBL2D3DDBM::COUNT; i++){ - hname = makeHistname(("Cluster_ToT_"+m_modLabel_PixLayerIBL2D3DDBM[i]), false); - htitles = makeHisttitle(("Cluster ToT, "+m_modLabel_PixLayerIBL2D3DDBM[i]), (atext_tot+atext_nclu), false); - if( i<PixLayer::kIBL ){ + for (int i = 0; i < PixLayerIBL2D3DDBM::COUNT; i++) { + hname = makeHistname(("Cluster_ToT_" + m_modLabel_PixLayerIBL2D3DDBM[i]), false); + htitles = makeHisttitle(("Cluster ToT, " + m_modLabel_PixLayerIBL2D3DDBM[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){ + } 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_PixLayerIBL2D3DDBM[i]), false); - htitles = makeHisttitle(("Charge, "+m_modLabel_PixLayerIBL2D3DDBM[i]), (atext_Q+atext_nclu), false); + + hname = makeHistname(("Cluster_Q_" + m_modLabel_PixLayerIBL2D3DDBM[i]), false); + htitles = makeHisttitle(("Charge, " + m_modLabel_PixLayerIBL2D3DDBM[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_PixLayerIBL2D3DDBM[i]), false); - htitles = makeHisttitle(("Number of pixels in a cluster, "+m_modLabel_PixLayerIBL2D3DDBM[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_groupsize_" + m_modLabel_PixLayerIBL2D3DDBM[i]), false); + htitles = makeHisttitle(("Number of pixels in a cluster, " + m_modLabel_PixLayerIBL2D3DDBM[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)); } - for (int i=0; i<PixLayerIBL2D3D::COUNT; i++){ - - 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); + for (int i = 0; i < PixLayerIBL2D3D::COUNT; i++) { + 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); + + 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); + + 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); + + 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); + + 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); + + 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); + + 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_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) { - 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) { + 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) - { - tmp = "Cluster_Occupancy"; tmp2 = "Cluster occupancy"; - m_cluster_occupancy = std::make_unique<PixelMon2DMapsLW>(PixelMon2DMapsLW(tmp.c_str(), (tmp2 + m_histTitleExt).c_str(), PixMon::HistConf::kPixDBMIBL2D3D)); - sc = m_cluster_occupancy->regHist(clusterShift); - - tmp = "Cluster_LVL1A_Mod"; tmp2 = "Average cluster Level 1 Accept"; - m_cluster_LVL1A_mod = std::make_unique<PixelMon2DProfilesLW>(PixelMon2DProfilesLW(tmp.c_str(), (tmp2 + m_histTitleExt).c_str(), PixMon::HistConf::kPixIBL2D3D, true)); - sc = m_cluster_LVL1A_mod->regHist(timeShift); - - tmp = "Clus_Occ_SizeCut"; tmp2 = "Size>1 Cluster occupancy"; - m_clusocc_sizenot1 = std::make_unique<PixelMon2DMapsLW>(PixelMon2DMapsLW(tmp.c_str(), (tmp2 + m_histTitleExt).c_str(), PixMon::HistConf::kPixDBMIBL2D3D)); - sc = m_clusocc_sizenot1->regHist(clusterShift); - - tmp = "Clus_LVL1A_SizeCut"; tmp2 = "Average Size>1 Cluster Level 1 Accept"; - m_clus_LVL1A_sizenot1 = std::make_unique<PixelMon2DProfilesLW>(PixelMon2DProfilesLW(tmp.c_str(), (tmp2 + m_histTitleExt).c_str(), PixMon::HistConf::kPixIBL2D3D, true)); - sc = m_clus_LVL1A_sizenot1->regHist(timeShift); - - if (m_doOnline){ - tmp = "ClusterMap_Mon"; tmp2 = "Cluster map for monitoring"; - m_clustermap_mon = std::make_unique<PixelMon2DMapsLW>(PixelMon2DMapsLW(tmp.c_str(), (tmp2 + m_histTitleExt).c_str(), PixMon::HistConf::kPixDBMIBL2D3D)); - sc = m_clustermap_mon->regHist(clusterShift); - - tmp = "ClusterMap_tmp"; tmp2 = "Cluster map for monitoring"; - m_clustermap_tmp = std::make_unique<PixelMon2DMapsLW>(PixelMon2DMapsLW(tmp.c_str(), (tmp2 + m_histTitleExt).c_str(), PixMon::HistConf::kPixDBMIBL2D3D)); - sc = m_clustermap_tmp->regHist(clusterShift); + if (m_do2DMaps) { + tmp = "Cluster_Occupancy"; + tmp2 = "Cluster occupancy"; + m_cluster_occupancy = std::make_unique<PixelMon2DMapsLW>(PixelMon2DMapsLW(tmp.c_str(), (tmp2 + m_histTitleExt).c_str(), PixMon::HistConf::kPixDBMIBL2D3D)); + sc = m_cluster_occupancy->regHist(clusterShift); + + tmp = "Cluster_LVL1A_Mod"; + tmp2 = "Average cluster Level 1 Accept"; + m_cluster_LVL1A_mod = std::make_unique<PixelMon2DProfilesLW>(PixelMon2DProfilesLW(tmp.c_str(), (tmp2 + m_histTitleExt).c_str(), PixMon::HistConf::kPixIBL2D3D, true)); + sc = m_cluster_LVL1A_mod->regHist(timeShift); + + tmp = "Clus_Occ_SizeCut"; + tmp2 = "Size>1 Cluster occupancy"; + m_clusocc_sizenot1 = std::make_unique<PixelMon2DMapsLW>(PixelMon2DMapsLW(tmp.c_str(), (tmp2 + m_histTitleExt).c_str(), PixMon::HistConf::kPixDBMIBL2D3D)); + sc = m_clusocc_sizenot1->regHist(clusterShift); + + tmp = "Clus_LVL1A_SizeCut"; + tmp2 = "Average Size>1 Cluster Level 1 Accept"; + m_clus_LVL1A_sizenot1 = std::make_unique<PixelMon2DProfilesLW>(PixelMon2DProfilesLW(tmp.c_str(), (tmp2 + m_histTitleExt).c_str(), PixMon::HistConf::kPixIBL2D3D, true)); + sc = m_clus_LVL1A_sizenot1->regHist(timeShift); + + if (m_doOnline) { + tmp = "ClusterMap_Mon"; + tmp2 = "Cluster map for monitoring"; + m_clustermap_mon = std::make_unique<PixelMon2DMapsLW>(PixelMon2DMapsLW(tmp.c_str(), (tmp2 + m_histTitleExt).c_str(), PixMon::HistConf::kPixDBMIBL2D3D)); + sc = m_clustermap_mon->regHist(clusterShift); + + tmp = "ClusterMap_tmp"; + tmp2 = "Cluster map for monitoring"; + m_clustermap_tmp = std::make_unique<PixelMon2DMapsLW>(PixelMon2DMapsLW(tmp.c_str(), (tmp2 + m_histTitleExt).c_str(), PixMon::HistConf::kPixDBMIBL2D3D)); + sc = m_clustermap_tmp->regHist(clusterShift); + } + if (!m_doOnline) { + tmp = "Cluster_Size_Map"; + tmp2 = "Average cluster size map"; + m_clussize_map = std::make_unique<PixelMon2DProfilesLW>(PixelMon2DProfilesLW(tmp.c_str(), (tmp2 + m_histTitleExt).c_str(), PixMon::HistConf::kPixIBL2D3D, true)); + sc = m_clussize_map->regHist(clusterExpert); + + tmp = "Cluster_Charge_Map"; + tmp2 = "Average cluster charge map"; + m_cluscharge_map = std::make_unique<PixelMon2DProfilesLW>(PixelMon2DProfilesLW(tmp.c_str(), (tmp2 + m_histTitleExt).c_str(), PixMon::HistConf::kPixIBL2D3D, true)); + sc = m_cluscharge_map->regHist(clusterExpert); + + tmp = "Cluster_ToT_Map"; + tmp2 = "Average cluster ToT map"; + m_clusToT_map = std::make_unique<PixelMon2DProfilesLW>(PixelMon2DProfilesLW(tmp.c_str(), (tmp2 + m_histTitleExt).c_str(), PixMon::HistConf::kPixIBL2D3D, true)); + 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]); } - if (!m_doOnline){ - tmp = "Cluster_Size_Map"; tmp2 = "Average cluster size map"; - m_clussize_map = std::make_unique<PixelMon2DProfilesLW>(PixelMon2DProfilesLW(tmp.c_str(), (tmp2 + m_histTitleExt).c_str(), PixMon::HistConf::kPixIBL2D3D, true)); - sc = m_clussize_map->regHist(clusterExpert); - - tmp = "Cluster_Charge_Map"; tmp2 = "Average cluster charge map"; - m_cluscharge_map = std::make_unique<PixelMon2DProfilesLW>(PixelMon2DProfilesLW(tmp.c_str(), (tmp2 + m_histTitleExt).c_str(), PixMon::HistConf::kPixIBL2D3D, true)); - sc = m_cluscharge_map->regHist(clusterExpert); - - tmp = "Cluster_ToT_Map"; tmp2 = "Average cluster ToT map"; - m_clusToT_map = std::make_unique<PixelMon2DProfilesLW>(PixelMon2DProfilesLW(tmp.c_str(), (tmp2 + m_histTitleExt).c_str(), PixMon::HistConf::kPixIBL2D3D, true)); - 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"); + 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 && m_doOnTrack) { + m_cluseff_mod = std::make_unique<PixelMonModulesProf>(PixelMonModulesProf("Clus_track_eff", ("Proportion of clusters on track vs t in module" + m_histTitleExt).c_str(), 2500, -0.5, 2499.5)); + sc = m_cluseff_mod->regHist(this, (path + "/Modules_Cluseff").c_str(), run); + + m_cluster_size_mod = std::make_unique<PixelMonModules1D>(PixelMonModules1D("Cluster_size", ("Cluster size in Module" + m_histTitleExt).c_str(), 20, -0.5, 19.5)); + sc = m_cluster_size_mod->regHist(this, (path + "/Modules_ClusterSize").c_str(), run); + + m_cluster_num_mod = std::make_unique<PixelMonModules1D>(PixelMonModules1D("Cluster_num", ("Number of clusters per event in module" + m_histTitleExt).c_str(), 30, -0.5, 29.5)); + sc = m_cluster_num_mod->regHist(this, (path + "/Modules_NumberOfClusters").c_str(), run); - if (m_doModules && m_doOnTrack) - { - m_cluseff_mod = std::make_unique<PixelMonModulesProf>(PixelMonModulesProf("Clus_track_eff", ("Proportion of clusters on track vs t in module" + m_histTitleExt).c_str(), 2500,-0.5,2499.5)); - sc = m_cluseff_mod->regHist(this,(path+"/Modules_Cluseff").c_str(),run); - - m_cluster_size_mod = std::make_unique<PixelMonModules1D>(PixelMonModules1D("Cluster_size", ("Cluster size in Module" + m_histTitleExt).c_str(), 20,-0.5,19.5)); - sc = m_cluster_size_mod->regHist(this,(path+"/Modules_ClusterSize").c_str(),run); - - m_cluster_num_mod = std::make_unique<PixelMonModules1D>(PixelMonModules1D("Cluster_num", ("Number of clusters per event in module" + m_histTitleExt).c_str(), 30,-0.5,29.5)); - sc = m_cluster_num_mod->regHist(this,(path+"/Modules_NumberOfClusters").c_str(),run); - - m_cluster_ToT_mod = std::make_unique<PixelMonModules1D>(PixelMonModules1D("Cluster_ToT", ("Cluster ToT in Module" + m_histTitleExt).c_str(), 200,0.,200.)); - sc = m_cluster_ToT_mod->regHist(this,(path+"/Modules_ClusToT").c_str(),run); + m_cluster_ToT_mod = std::make_unique<PixelMonModules1D>(PixelMonModules1D("Cluster_ToT", ("Cluster ToT in Module" + m_histTitleExt).c_str(), 200, 0., 200.)); + sc = m_cluster_ToT_mod->regHist(this, (path + "/Modules_ClusToT").c_str(), run); + } + 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) { + 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_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_doHeavyIonMon) { + max_clusters = 100000; + max_clusters_region = 40000; + max_avclusters = 1000; } - - 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"; + 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); + + 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)); + 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) { - 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_doOnTrack) { + 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 + + // Quick Status if (m_doOfflineAnalysis) { - if (m_doOnTrack) { + if (m_doOnTrack) { 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)); + 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)); + 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; + + 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; -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"); - MonGroup lumiBlockHist( this, path.c_str(), lowStat, ATTRIB_MANAGED); //declare a group of histograms - + MonGroup lumiBlockHist(this, path.c_str(), lowStat, ATTRIB_MANAGED); // declare a group of histograms + StatusCode sc; - 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)); - + 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 = std::make_unique<PixelMon2DMapsLW>(PixelMon2DMapsLW("Cluster_Occupancy_LB", ("Cluster Occupancy" + m_histTitleExt).c_str(), PixMon::HistConf::kPixDBMIBL2D3D)); 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;} + 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_doOnTrack) { // normally not booked, as doModules is online, doLumiBlock is offline - m_cluster_num_mod_LB = std::make_unique<PixelMonModules1D>(PixelMonModules1D("Cluster_num_LB", ("Number of clusters per event in module" + m_histTitleExt).c_str(), 20,-0.5,59.5)); - sc = m_cluster_num_mod_LB->regHist(this,(path+"/Modules_NumberOfClusters").c_str(),lowStat); - m_cluster_ToT_mod_LB = std::make_unique<PixelMonModules1D>(PixelMonModules1D("Cluster_ToT_mod_LB", ("Cluster ToT in Module" + m_histTitleExt).c_str(), 75,0.,300.)); - sc = m_cluster_ToT_mod_LB->regHist(this,(path+"/Modules_ClusToT").c_str(),lowStat); + + // normally not booked, as doModules is online, doLumiBlock is offline + if (m_doModules && m_doOnTrack) { + m_cluster_num_mod_LB = std::make_unique<PixelMonModules1D>(PixelMonModules1D("Cluster_num_LB", ("Number of clusters per event in module" + m_histTitleExt).c_str(), 20, -0.5, 59.5)); + sc = m_cluster_num_mod_LB->regHist(this, (path + "/Modules_NumberOfClusters").c_str(), lowStat); + m_cluster_ToT_mod_LB = std::make_unique<PixelMonModules1D>(PixelMonModules1D("Cluster_ToT_mod_LB", ("Cluster ToT in Module" + m_histTitleExt).c_str(), 75, 0., 300.)); + sc = m_cluster_ToT_mod_LB->regHist(this, (path + "/Modules_ClusToT").c_str(), lowStat); } - - if (sc.isFailure() && msgLvl(MSG::WARNING) ) msg(MSG::WARNING) << "Per LB pixel cluster monitoring histograms not booked" << endmsg; + + 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) -{ +StatusCode PixelMainMon::fillClustersMon(void) { StatusCode 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; + 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 = 0; int nclusters_mod[PixLayer::COUNT] = {0}; - int nlargeclusters=0; - int nverylargeclusters=0; - int nclusters_all=0; - int nclusters_ontrack=0; + int nlargeclusters = 0; + int nverylargeclusters = 0; + int nclusters_all = 0; + int nclusters_ontrack = 0; if (m_doModules && m_doOnTrack) { 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 < 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 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; + 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; } } } @@ -468,329 +499,278 @@ StatusCode PixelMainMon::FillClustersMon(void) 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; - } - for(p_clus=ClusterCollection->begin(); p_clus!=ClusterCollection->end(); ++p_clus) - { - 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); - } - - int pixlayerdbm = GetPixLayerIDDBM(m_pixelid->barrel_ec(clusID), m_pixelid->layer_disk(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); - } - - - 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 colWidth = clusWidth.colRow().y(); - int rowWidth = clusWidth.colRow().x(); - - int npixHitsInClusterRaw = cluster.rdoList().size(); - int npixHitsInCluster = cluster.rdoList().size(); - if( pixlayeribl2d3ddbm!=99 && npixHitsInCluster > m_cluster_groupsize_mod[pixlayeribl2d3ddbm]->getXMax()){ - npixHitsInCluster = (int)(m_cluster_groupsize_mod[pixlayeribl2d3ddbm]->getXMax()-0.5); - } - - /// 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 ) { - 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 (pixlayer != 99) nclusters_all++; // count all (no DBM) clusters on and off track - - if( m_doOnTrack && !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 - } - - ////////////////////////////////////////////////////// - /////////////Start main fill block here/////////////// - //be sure to check each histo exists before filling it - ////////////////////////////////////////////////////// - - // - // Fill first histograms with DBM - // - if (pixlayeribl2d3ddbm!=99 && m_cluster_ToT1d_mod[pixlayeribl2d3ddbm]) m_cluster_ToT1d_mod[pixlayeribl2d3ddbm]->Fill(cluster.totalToT()); - if (pixlayerdbm == PixLayerDBM::kIBL && m_cluster_ToT1d_mod[pixlayerdbm]) m_cluster_ToT1d_mod[pixlayerdbm]->Fill(cluster.totalToT()); - if (pixlayeribl2d3ddbm!=99 && m_cluster_Q_mod[pixlayeribl2d3ddbm]) m_cluster_Q_mod[pixlayeribl2d3ddbm]->Fill(cluster.totalCharge()); - if (pixlayerdbm == PixLayerDBM::kIBL && m_cluster_Q_mod[pixlayerdbm]) m_cluster_Q_mod[pixlayerdbm]->Fill(cluster.totalCharge()); - if (pixlayeribl2d3ddbm!=99 && m_cluster_groupsize_mod[pixlayeribl2d3ddbm]) m_cluster_groupsize_mod[pixlayeribl2d3ddbm]->Fill( npixHitsInCluster ); - if (pixlayerdbm == PixLayerDBM::kIBL && m_cluster_groupsize_mod[pixlayerdbm]) m_cluster_groupsize_mod[pixlayerdbm]->Fill( npixHitsInCluster ); - if (m_cluster_occupancy) m_cluster_occupancy->Fill(clusID, m_pixelid); - - if (pixlayer == 99) continue; // DBM case - - nclusters_ontrack++; - - /// - /// 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); //avoid filling exactly zero to distinguish from disabled modules - if (cluster.rdoList().size()>1 && m_clus_LVL1A_sizenot1) m_clus_LVL1A_sizenot1->Fill(clusID,m_pixelid,cluster.LVL1A()+0.00001); //avoid filling exactly zero to distinguish from disabled modules - if (pixlayer != PixLayer::kIBL) { - if (cluster.totalToT() > 15 && m_cluster_LVL1A1d_mod[pixlayer]) m_cluster_LVL1A1d_mod[pixlayer]->Fill(cluster.LVL1A()); - } else { - 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); - - 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 (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); - - 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); - - 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_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 (cluster.rdoList().size()>1 && m_clusocc_sizenot1) m_clusocc_sizenot1->Fill(clusID, m_pixelid); - if (m_doOnline && m_clustermap_tmp) m_clustermap_tmp->Fill(clusID, m_pixelid); - - /// 2D Map - if (m_clussize_map) m_clussize_map->Fill(clusID,m_pixelid,cluster.rdoList().size()); - if (m_cluscharge_map) m_cluscharge_map->Fill(clusID,m_pixelid,cluster.totalCharge()); - if (m_clusToT_map) m_clusToT_map->Fill(clusID,m_pixelid,cluster.totalToT()); - - if (m_cluster_size_mod)m_cluster_size_mod->Fill(cluster.rdoList().size(),clusID,m_pixelid); - - 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 && m_doOnTrack) // 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); - 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); - } - - /// 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(); + + for (; colNext != lastCol; ++colNext) { + const InDet::PixelClusterCollection* ClusterCollection(*colNext); + + if (!ClusterCollection) { + // first entry is for RDO, second is for data problem + if (m_storegate_errors) m_storegate_errors->Fill(3., 5.); + continue; + } + for (p_clus = ClusterCollection->begin(); p_clus != ClusterCollection->end(); ++p_clus) { + 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); + } + + int pixlayerdbm = getPixLayerIDDBM(m_pixelid->barrel_ec(clusID), m_pixelid->layer_disk(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); + } + + 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 colWidth = clusWidth.colRow().y(); + int rowWidth = clusWidth.colRow().x(); + + int npixHitsInClusterRaw = cluster.rdoList().size(); + int npixHitsInCluster = cluster.rdoList().size(); + if (pixlayeribl2d3ddbm != 99 && npixHitsInCluster > m_cluster_groupsize_mod[pixlayeribl2d3ddbm]->getXMax()) { + npixHitsInCluster = (int)(m_cluster_groupsize_mod[pixlayeribl2d3ddbm]->getXMax() - 0.5); + } + + // 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) { + if (m_pixelid->phi_module(clusID) == 0 && m_pixelid->eta_module(clusID) < 0) { + if (isOnTrack(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); + } } - } - - ///////////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.get(), - m_cluster_occupancy_summary_mod[PixLayer::kECA], - m_cluster_occupancy_summary_mod[PixLayer::kECC], - m_cluster_occupancy_summary_mod[PixLayer::kIBL], - m_cluster_occupancy_summary_mod[PixLayer::kB0], - m_cluster_occupancy_summary_mod[PixLayer::kB1], - m_cluster_occupancy_summary_mod[PixLayer::kB2]); - if (m_doRefresh) { - if (m_clustermap_mon && m_clustermap_tmp) m_clustermap_mon->Fill2DMon(m_clustermap_tmp.get()); - } - } - - - 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) { - 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 (pixlayer != 99) nclusters_all++; // count all (no DBM) clusters on and off track + + if (m_doOnTrack && !isOnTrack(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 + } + + ////////////////////////////////////////////////////// + /////////////Start main fill block here/////////////// + ////////////////////////////////////////////////////// + + // Fill first histograms with DBM + if (pixlayeribl2d3ddbm != 99 && m_cluster_ToT1d_mod[pixlayeribl2d3ddbm]) m_cluster_ToT1d_mod[pixlayeribl2d3ddbm]->Fill(cluster.totalToT()); + if (pixlayerdbm == PixLayerDBM::kIBL && m_cluster_ToT1d_mod[pixlayerdbm]) m_cluster_ToT1d_mod[pixlayerdbm]->Fill(cluster.totalToT()); + if (pixlayeribl2d3ddbm != 99 && m_cluster_Q_mod[pixlayeribl2d3ddbm]) m_cluster_Q_mod[pixlayeribl2d3ddbm]->Fill(cluster.totalCharge()); + if (pixlayerdbm == PixLayerDBM::kIBL && m_cluster_Q_mod[pixlayerdbm]) m_cluster_Q_mod[pixlayerdbm]->Fill(cluster.totalCharge()); + if (pixlayeribl2d3ddbm != 99 && m_cluster_groupsize_mod[pixlayeribl2d3ddbm]) m_cluster_groupsize_mod[pixlayeribl2d3ddbm]->Fill(npixHitsInCluster); + if (pixlayerdbm == PixLayerDBM::kIBL && m_cluster_groupsize_mod[pixlayerdbm]) m_cluster_groupsize_mod[pixlayerdbm]->Fill(npixHitsInCluster); + if (m_cluster_occupancy) m_cluster_occupancy->fill(clusID, m_pixelid); + + if (pixlayer == 99) continue; // DBM case + + nclusters_ontrack++; + + // 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); // avoid filling exactly zero to distinguish from disabled modules + if (cluster.rdoList().size() > 1 && m_clus_LVL1A_sizenot1) m_clus_LVL1A_sizenot1->fill(clusID, m_pixelid, cluster.LVL1A() + 0.00001); // avoid filling exactly zero to distinguish from disabled modules + if (pixlayer != PixLayer::kIBL) { + if (cluster.totalToT() > 15 && m_cluster_LVL1A1d_mod[pixlayer]) m_cluster_LVL1A1d_mod[pixlayer]->Fill(cluster.LVL1A()); + } else { + if (cluster.totalToT() > 4 && m_cluster_LVL1A1d_mod[pixlayer]) m_cluster_LVL1A1d_mod[pixlayer]->Fill(cluster.LVL1A()); + } + + if (m_cluster_ToT_mod) m_cluster_ToT_mod->fill(cluster.totalToT(), clusID, m_pixelid); + if (cluster.rdoList().size() == 1 && m_1cluster_ToT_mod[pixlayer]) m_1cluster_ToT_mod[pixlayer]->Fill(cluster.totalToT()); + if (cluster.rdoList().size() == 2 && m_2cluster_ToT_mod[pixlayer]) m_2cluster_ToT_mod[pixlayer]->Fill(cluster.totalToT()); + 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()); + + 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()); + + if (isOnTrack(clusID, true)) { + if (m_cluseff_mod) m_cluseff_mod->fill(m_manager->lumiBlockNumber(), 1., clusID, m_pixelid); + if (m_clusize_ontrack_mod[pixlayer]) m_clusize_ontrack_mod[pixlayer]->Fill(cluster.rdoList().size()); + if (pixlayer == PixLayer::kIBL && m_clusize_ontrack_mod[pixlayeribl2d3d]) m_clusize_ontrack_mod[pixlayeribl2d3d]->Fill(npixHitsInClusterRaw); + } else { + if (m_cluseff_mod) m_cluseff_mod->fill(m_manager->lumiBlockNumber(), 0., clusID, m_pixelid); + 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_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 (cluster.rdoList().size() > 1 && m_clusocc_sizenot1) m_clusocc_sizenot1->fill(clusID, m_pixelid); + if (m_doOnline && m_clustermap_tmp) m_clustermap_tmp->fill(clusID, m_pixelid); + + // 2D Map + if (m_clussize_map) m_clussize_map->fill(clusID, m_pixelid, cluster.rdoList().size()); + if (m_cluscharge_map) m_cluscharge_map->fill(clusID, m_pixelid, cluster.totalCharge()); + if (m_clusToT_map) m_clusToT_map->fill(clusID, m_pixelid, cluster.totalToT()); + if (m_cluster_size_mod) m_cluster_size_mod->fill(cluster.rdoList().size(), clusID, m_pixelid); + + 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 && m_doOnTrack) { + 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); + 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); + } + + // 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(); + } + } + } // PixelClusterContainer loop + } //end of event loop + + if (m_doOnline) { + fillSummaryHistos(m_cluster_occupancy.get(), + m_cluster_occupancy_summary_mod[PixLayer::kECA], + m_cluster_occupancy_summary_mod[PixLayer::kECC], + m_cluster_occupancy_summary_mod[PixLayer::kIBL], + m_cluster_occupancy_summary_mod[PixLayer::kB0], + m_cluster_occupancy_summary_mod[PixLayer::kB1], + m_cluster_occupancy_summary_mod[PixLayer::kB2]); + if (m_doRefresh) { + if (m_clustermap_mon && m_clustermap_tmp) m_clustermap_mon->fill2DMon(m_clustermap_tmp.get()); } } - - 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) { - if (m_clustersOnOffTrack_per_lumi && nclusters_all>0) m_clustersOnOffTrack_per_lumi->Fill(m_manager->lumiBlockNumber(),(float)nclusters_ontrack/nclusters_all); + + if (m_clusters_per_lumi) m_clusters_per_lumi->Fill(m_manager->lumiBlockNumber(), nclusters); + 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_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_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 - /// + + // 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] ); + + 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_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 && m_doOnTrack) - { - 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); - if (m_pixelid->barrel_ec(WaferID)==-2) m_cluster_num_mod->Fill( m_ClusPerEventArray_disksC[m_pixelid->phi_module(WaferID)][m_pixelid->layer_disk(WaferID)], WaferID, m_pixelid); - if (m_pixelid->barrel_ec(WaferID)==0 ) - { - if (m_doIBL && m_pixelid->layer_disk(WaferID)==0) m_cluster_num_mod->Fill( m_ClusPerEventArray_lI[m_pixelid->phi_module(WaferID)][m_pixelid->eta_module(WaferID)+10], WaferID, m_pixelid); - if (m_pixelid->layer_disk(WaferID)==0+m_doIBL) m_cluster_num_mod->Fill( m_ClusPerEventArray_l0[m_pixelid->phi_module(WaferID)][m_pixelid->eta_module(WaferID)+6], WaferID, m_pixelid); - if (m_pixelid->layer_disk(WaferID)==1+m_doIBL) m_cluster_num_mod->Fill( m_ClusPerEventArray_l1[m_pixelid->phi_module(WaferID)][m_pixelid->eta_module(WaferID)+6], WaferID, m_pixelid); - if (m_pixelid->layer_disk(WaferID)==2+m_doIBL) m_cluster_num_mod->Fill( m_ClusPerEventArray_l2[m_pixelid->phi_module(WaferID)][m_pixelid->eta_module(WaferID)+6], WaferID, m_pixelid); - } - if (m_doLumiBlock) { - if (m_pixelid->barrel_ec(WaferID)==2 ) m_cluster_num_mod_LB->Fill( m_ClusPerEventArray_disksA[m_pixelid->phi_module(WaferID)][m_pixelid->layer_disk(WaferID)], WaferID, m_pixelid); - if (m_pixelid->barrel_ec(WaferID)==-2) m_cluster_num_mod_LB->Fill( m_ClusPerEventArray_disksC[m_pixelid->phi_module(WaferID)][m_pixelid->layer_disk(WaferID)], WaferID, m_pixelid); - if (m_pixelid->barrel_ec(WaferID)==0 ) - { - if (m_doIBL && m_pixelid->layer_disk(WaferID)==0) m_cluster_num_mod_LB->Fill( m_ClusPerEventArray_lI[m_pixelid->phi_module(WaferID)][m_pixelid->eta_module(WaferID)+10], WaferID, m_pixelid); - if (m_pixelid->layer_disk(WaferID)==0+m_doIBL) m_cluster_num_mod_LB->Fill( m_ClusPerEventArray_l0[m_pixelid->phi_module(WaferID)][m_pixelid->eta_module(WaferID)+6], WaferID, m_pixelid); - if (m_pixelid->layer_disk(WaferID)==1+m_doIBL) m_cluster_num_mod_LB->Fill( m_ClusPerEventArray_l1[m_pixelid->phi_module(WaferID)][m_pixelid->eta_module(WaferID)+6], WaferID, m_pixelid); - if (m_pixelid->layer_disk(WaferID)==2+m_doIBL) m_cluster_num_mod_LB->Fill( m_ClusPerEventArray_l2[m_pixelid->phi_module(WaferID)][m_pixelid->eta_module(WaferID)+6], WaferID, m_pixelid); - } - } - } + + if (m_doModules && m_doOnTrack) { + 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); + if (m_pixelid->barrel_ec(WaferID) == -2) m_cluster_num_mod->fill(m_ClusPerEventArray_disksC[m_pixelid->phi_module(WaferID)][m_pixelid->layer_disk(WaferID)], WaferID, m_pixelid); + if (m_pixelid->barrel_ec(WaferID) == 0) { + if (m_doIBL && m_pixelid->layer_disk(WaferID) == 0) m_cluster_num_mod->fill(m_ClusPerEventArray_lI[m_pixelid->phi_module(WaferID)][m_pixelid->eta_module(WaferID) + 10], WaferID, m_pixelid); + if (m_pixelid->layer_disk(WaferID) == 0 + m_doIBL) m_cluster_num_mod->fill(m_ClusPerEventArray_l0[m_pixelid->phi_module(WaferID)][m_pixelid->eta_module(WaferID) + 6], WaferID, m_pixelid); + if (m_pixelid->layer_disk(WaferID) == 1 + m_doIBL) m_cluster_num_mod->fill(m_ClusPerEventArray_l1[m_pixelid->phi_module(WaferID)][m_pixelid->eta_module(WaferID) + 6], WaferID, m_pixelid); + if (m_pixelid->layer_disk(WaferID) == 2 + m_doIBL) m_cluster_num_mod->fill(m_ClusPerEventArray_l2[m_pixelid->phi_module(WaferID)][m_pixelid->eta_module(WaferID) + 6], WaferID, m_pixelid); + } + if (m_doLumiBlock) { + if (m_pixelid->barrel_ec(WaferID) == 2) m_cluster_num_mod_LB->fill(m_ClusPerEventArray_disksA[m_pixelid->phi_module(WaferID)][m_pixelid->layer_disk(WaferID)], WaferID, m_pixelid); + if (m_pixelid->barrel_ec(WaferID) == -2) m_cluster_num_mod_LB->fill(m_ClusPerEventArray_disksC[m_pixelid->phi_module(WaferID)][m_pixelid->layer_disk(WaferID)], WaferID, m_pixelid); + if (m_pixelid->barrel_ec(WaferID) == 0) { + if (m_doIBL && m_pixelid->layer_disk(WaferID) == 0) m_cluster_num_mod_LB->fill(m_ClusPerEventArray_lI[m_pixelid->phi_module(WaferID)][m_pixelid->eta_module(WaferID) + 10], WaferID, m_pixelid); + if (m_pixelid->layer_disk(WaferID) == 0 + m_doIBL) m_cluster_num_mod_LB->fill(m_ClusPerEventArray_l0[m_pixelid->phi_module(WaferID)][m_pixelid->eta_module(WaferID) + 6], WaferID, m_pixelid); + if (m_pixelid->layer_disk(WaferID) == 1 + m_doIBL) m_cluster_num_mod_LB->fill(m_ClusPerEventArray_l1[m_pixelid->phi_module(WaferID)][m_pixelid->eta_module(WaferID) + 6], WaferID, m_pixelid); + if (m_pixelid->layer_disk(WaferID) == 2 + m_doIBL) m_cluster_num_mod_LB->fill(m_ClusPerEventArray_l2[m_pixelid->phi_module(WaferID)][m_pixelid->eta_module(WaferID) + 6], WaferID, m_pixelid); + } + } } - } //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 - + } + } // if (!m_majorityDisabled) + + 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) { + fillSummaryHistos(m_cluster_occupancy.get(), + m_cluster_occupancy_summary_mod[PixLayer::kECA], + m_cluster_occupancy_summary_mod[PixLayer::kECC], + m_cluster_occupancy_summary_mod[PixLayer::kIBL], + m_cluster_occupancy_summary_mod[PixLayer::kB0], + m_cluster_occupancy_summary_mod[PixLayer::kB1], + m_cluster_occupancy_summary_mod[PixLayer::kB2]); + } -StatusCode PixelMainMon::ProcClustersMon(void) -{ - if (m_doOffline) - { - FillSummaryHistos(m_cluster_occupancy.get(), - m_cluster_occupancy_summary_mod[PixLayer::kECA], - m_cluster_occupancy_summary_mod[PixLayer::kECC], - m_cluster_occupancy_summary_mod[PixLayer::kIBL], - m_cluster_occupancy_summary_mod[PixLayer::kB0], - m_cluster_occupancy_summary_mod[PixLayer::kB1], - m_cluster_occupancy_summary_mod[PixLayer::kB2]); - } - 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; - + // if no events, the rest of the test is pointless and would divide by 0 + if (events == 0) return StatusCode::SUCCESS; + if (m_event != m_event2) events = m_event2; + return StatusCode::SUCCESS; } - - diff --git a/InnerDetector/InDetMonitoring/PixelMonitoring/src/Components.cxx b/InnerDetector/InDetMonitoring/PixelMonitoring/src/Components.cxx index 13a7735e91a6ab089f6b006c435551b000b2dbb9..61e0d7aebdcfb8d1a6f7079722e270028ffdc8f3 100644 --- a/InnerDetector/InDetMonitoring/PixelMonitoring/src/Components.cxx +++ b/InnerDetector/InDetMonitoring/PixelMonitoring/src/Components.cxx @@ -49,11 +49,9 @@ const std::array<std::string, kNumModulesBarrel> ModulesBarrel = {{ // Definitions for end-caps and DBM -const std::array<std::string, kNumLayersDisk> LayersDisk = {{ - "Disk 1", "Disk 2", "Disk 3"}}; +const std::array<std::string, kNumLayersDisk> LayersDisk = {{"Disk 1", "Disk 2", "Disk 3"}}; -const std::array<std::string, kNumLayersDBM> LayersDBM = {{ - "Layer 0", "Layer 1", "Layer 2"}}; +const std::array<std::string, kNumLayersDBM> LayersDBM = {{"Layer 0", "Layer 1", "Layer 2"}}; const std::array<std::string, kNumModulesDisk> ModulesECA = {{ "B01_S2_M1", "B01_S2_M6", "B01_S2_M2", "B01_S2_M5", "B01_S2_M3", @@ -79,37 +77,36 @@ const std::array<std::string, kNumModulesDisk> ModulesECC = {{ "B04_S2_M6", "B04_S2_M1", "B01_S1_M4", "B01_S1_M3", "B01_S1_M5", "B01_S1_M2", "B01_S1_M6", "B01_S1_M1"}}; -const std::array<std::string, kNumModulesDBM> ModulesDBM = {{ - "M3", "M4", "M1", "M2"}}; +const std::array<std::string, kNumModulesDBM> ModulesDBM = {{"M3", "M4", "M1", "M2"}}; bool HasComponent(const HistConf& config, const LayerIBL2D3DDBM& component) { - if (component >= LayerIBL2D3DDBM::COUNT) { - // return here if we are out of scope - return false; - } else if (config == HistConf::kPix && component <= LayerIBL2D3DDBM::kB2) { - return true; - } else if (config == HistConf::kPixIBL && (component <= LayerIBL2D3DDBM::kB2 || component == LayerIBL2D3DDBM::kIBL)) { - return true; - } else if (config == HistConf::kPixIBL2D3D && (component <= LayerIBL2D3DDBM::kB2 || component >= LayerIBL2D3DDBM::kIBL)) { - return true; - } else if (config == HistConf::kPixDBM && component <= LayerIBL2D3DDBM::kDBMC) { - return true; - } else if (config == HistConf::kPixDBMIBL && component <= LayerIBL2D3DDBM::kIBL) { - return true; - } else if (config == HistConf::kPixDBMIBL2D3D) { - return true; - } else if (config == HistConf::kDBM && (component == LayerIBL2D3DDBM::kDBMA || component == LayerIBL2D3DDBM::kDBMC)) { - return true; - } else if (config == HistConf::kDBMIBL && component >= LayerIBL2D3DDBM::kDBMA && component <= LayerIBL2D3DDBM::kIBL) { - return true; - } else if (config == HistConf::kDBMIBL2D3D && component >= LayerIBL2D3DDBM::kDBMA) { - return true; - } else if (config == HistConf::kIBL && component == LayerIBL2D3DDBM::kIBL) { - return true; - } else if (config == HistConf::kIBL2D3D && component >= LayerIBL2D3DDBM::kIBL) { - return true; - } else { - return false; - } + if (component >= LayerIBL2D3DDBM::COUNT) { + // return here if we are out of scope + return false; + } else if (config == HistConf::kPix && component <= LayerIBL2D3DDBM::kB2) { + return true; + } else if (config == HistConf::kPixIBL && (component <= LayerIBL2D3DDBM::kB2 || component == LayerIBL2D3DDBM::kIBL)) { + return true; + } else if (config == HistConf::kPixIBL2D3D && (component <= LayerIBL2D3DDBM::kB2 || component >= LayerIBL2D3DDBM::kIBL)) { + return true; + } else if (config == HistConf::kPixDBM && component <= LayerIBL2D3DDBM::kDBMC) { + return true; + } else if (config == HistConf::kPixDBMIBL && component <= LayerIBL2D3DDBM::kIBL) { + return true; + } else if (config == HistConf::kPixDBMIBL2D3D) { + return true; + } else if (config == HistConf::kDBM && (component == LayerIBL2D3DDBM::kDBMA || component == LayerIBL2D3DDBM::kDBMC)) { + return true; + } else if (config == HistConf::kDBMIBL && component >= LayerIBL2D3DDBM::kDBMA && component <= LayerIBL2D3DDBM::kIBL) { + return true; + } else if (config == HistConf::kDBMIBL2D3D && component >= LayerIBL2D3DDBM::kDBMA) { + return true; + } else if (config == HistConf::kIBL && component == LayerIBL2D3DDBM::kIBL) { + return true; + } else if (config == HistConf::kIBL2D3D && component >= LayerIBL2D3DDBM::kIBL) { + return true; + } else { + return false; + } } } // namespace PixMon diff --git a/InnerDetector/InDetMonitoring/PixelMonitoring/src/Errors.cxx b/InnerDetector/InDetMonitoring/PixelMonitoring/src/Errors.cxx index 481a1ca0e03b1ca573336c4d9b43f2cbc4dd46f7..7611e3a88113c0b2095f2d0cde48382dbe235fe0 100644 --- a/InnerDetector/InDetMonitoring/PixelMonitoring/src/Errors.cxx +++ b/InnerDetector/InDetMonitoring/PixelMonitoring/src/Errors.cxx @@ -6,792 +6,828 @@ // Book and fill histograms showing module errors /////////////////////////////////////////////////////////////////////////////// -#include "PixelMonitoring/PixelMainMon.h" -#include "PixelConditionsServices/IPixelByteStreamErrorsSvc.h" +#include <sstream> #include "InDetIdentifier/PixelID.h" -#include "TH1F.h" -#include "TH1I.h" -#include "TH2F.h" -#include "TH3F.h" -#include "TH2I.h" -#include "TString.h" #include "LWHists/TH1F_LW.h" #include "LWHists/TH1I_LW.h" #include "LWHists/TH2F_LW.h" #include "LWHists/TH2I_LW.h" -#include "TProfile.h" -#include "LWHists/TProfile_LW.h" #include "LWHists/TProfile2D_LW.h" -#include <sstream> +#include "LWHists/TProfile_LW.h" +#include "PixelConditionsServices/IPixelByteStreamErrorsSvc.h" +#include "PixelMonitoring/PixelMainMon.h" +#include "TH1F.h" +#include "TH1I.h" +#include "TH2F.h" +#include "TH2I.h" +#include "TH3F.h" +#include "TProfile.h" +#include "TString.h" #include "InDetReadoutGeometry/SiDetectorElement.h" #include "PixelMonitoring/Components.h" +#include "PixelMonitoring/PixelMon2DLumiMaps.h" #include "PixelMonitoring/PixelMon2DMapsLW.h" #include "PixelMonitoring/PixelMon2DProfilesLW.h" #include "PixelMonitoring/PixelMonModules.h" -#include "PixelMonitoring/PixelMon2DLumiMaps.h" - /////////////////////////////////////////////////////////////////////////////// //////////////////////booking methods////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////// -StatusCode PixelMainMon::BookRODErrorMon(void) -{ - if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "starting Book Errors" << endmsg; - - std::string path = "Pixel/Errors"; - std::string path2 = "Pixel/ErrorsExpert"; - if (m_doOnTrack) path.replace(path.begin(), path.end(), "Pixel/ErrorsOnTrack"); - MonGroup rodHistos(this, path.c_str(), run, ATTRIB_MANAGED); //declare a group of histograms - MonGroup rodExpert(this, path2.c_str(), run, ATTRIB_MANAGED); //declare a group of histograms - - const std::array <std::pair <std::string, std::string>, kNumErrorStates > error_state_labels = {{ - std::make_pair("Mod_Sync_BCID1_errors", "FE/MCC BCID1 Sync Errors"), - std::make_pair("Mod_Sync_BCID2_errors", "FE/MCC BCID2 Sync Errors"), - std::make_pair("Mod_Sync_LVL1ID_errors", "FE/MCC LVL1ID Sync Errors"), - std::make_pair("ROD_Sync_BCID_errors", "ROD BCID Sync Errors"), - std::make_pair("ROD_Sync_LVL1ID_errors", "ROD LVL1ID Sync Errors"), - std::make_pair("Mod_Trunc_EOC_errors", "FE/MCC EoC Trunc Errors"), - std::make_pair("Mod_Trunc_Hit_Overflow_errors", "FE/MCC Hit Overflow Trunc Errors"), - std::make_pair("Mod_Trunc_EoE_Overflow_errors", "FE/MCC EoE Overflow Trunc Errors"), - std::make_pair("ROD_Trunc_HT_Limit_errors", "ROD H/T Limit Trunc Errors"), - std::make_pair("ROD_Trunc_ROD_OF_errors", "ROD Overflow Trunc Errors"), - std::make_pair("Optical_Errors", "Preamble/Header Errors"), - std::make_pair("SEU_Hit_Parity", "SEU Hit Parity Errors"), - std::make_pair("SEU_Register_Parity", "SEU Register Parity Errors"), - std::make_pair("SEU_Hamming", "SEU Hamming Code Errors"), - std::make_pair("ROD_Timeout", "ROD Formatter Timeout Errors"), - std::make_pair("FE_Warning", "FE Warning Errors"), - }}; - - std::array <std::pair <std::string, std::string>, kNumErrorStatesIBL > error_state_labelsIBL = {{ - std::make_pair("BCID_errors", "Synchronization BCID errors"), - std::make_pair("LVL1ID_errors", "Synchronization LVL1ID errors"), - std::make_pair("Row_Column_errors", "Row Column errors"), - std::make_pair("Limit_errors", "Limit_errors"), - std::make_pair("Preamble_errors", "Preamble errors"), - std::make_pair("Masked_link_errors", "Masked link errors"), - std::make_pair("Hamming_code_0_errors", "Hamming code 0 errors"), - std::make_pair("Hamming_code_1_errors", "Hamming code 1 errors"), - std::make_pair("Hamming_code_2_errors", "Hamming code 2 errors"), - std::make_pair("L1_incounter_errors", "L1 in counter errors"), - std::make_pair("L1_request_counter_errors", "L1 request counter errors"), - std::make_pair("L1_register_errors", "L1 register errors"), - std::make_pair("L1_Trigger_ID_errors", "L1 trigger ID errors"), - std::make_pair("Readout_processor_errors", "Readout processor errors"), - std::make_pair("Skipped_trig_counter_errors", "Skipped trigger counter errors"), - std::make_pair("Truncated_event_flag_errors", "Truncated event errors"), - std::make_pair("Triple redundant_errors", "Triple redundant errors"), - std::make_pair("Write_reg_data_errors", "Write register data errors"), - std::make_pair("Address_errors", "Address errors"), - std::make_pair("Other_CMD_decoder_errors", "CMD decoder errors"), - std::make_pair("CMD_decoder_bitflip_errors", "CMD decoder bit flip errors"), - std::make_pair("CMD_decoder_SEU_errors", "CMD decoder SEU errors"), - std::make_pair("Data_bus_address_errors", "Data bus address errors"), - std::make_pair("ROD_Timeout_errors", "ROD Timeout errors"), - std::make_pair("Timeout_errors", "Timeout errors"), - std::make_pair("BCID_counter_errors", "BCID counter errors"), - std::make_pair("Triple_redundant_errors2", "Triple redundant errors 2"), - }}; - - const char * errorBitsPIX[kNumErrorBits] = { - "ROD Overflow Trunc", "ROD H/T Limit Trunc", "2", "3", - "FE/MCC EoC Trunc", "SEU Hit Parity", "SEU Register Parity", "SEU Hamming Code", - "FE Warning (Bit Flip)", "9", "10", "11", - "FE/MCC Hit Overflow Trunc", "FE/MCC EoE Overflow Trunc", "FE/MCC BCID1 Sync", "FE/MCC BCID2 Sync", - "FE/MCC LVL1ID Sync", "17", "18", "19", - "ROD BCID Sync", "ROD LVL1ID Sync", "ROD Formatter Timeout", "Preamble/Header", - "24", "25", "26", "27", - "28", "29", "30", "31" - }; - - const char* errorBitsIBL[kNumErrorBits] = { - "Row/ Column Error", "Limit Error", "Timeout Error", "BCID Error", - "LVL1ID Error", "Preamble Error", "Masked Link", "Timeout Error", - "BCID counter", "Hamming code 0", "Hamming code 1", "Hamming code 2", - "L1_in counter", "L1 request counter", "L1 register", "L1 Trigger ID", - "readout processor", "Skipped trig counter", "Truncated event flag","Triple Redundant", - "Write reg data", "Address error", "Other CMD decoder", "CMD decoder bit flip", - "CMD decoder SEU", "Data bus address", "Triple redundant", "27", - "28", "29", "30", "31" - }; - - const std::array <std::pair <std::string, std::string>, ErrorCategoryMODROD::COUNT> error_type_labels = {{ - std::make_pair("SyncErrors_Mod", "FE/MCC Sync Errors"), - std::make_pair("SyncErrors_ROD", "ROD Sync Errors"), - std::make_pair("TruncErrors_Mod", "FE/MCC Trunc Errors"), - std::make_pair("TruncErrors_ROD", "ROD Trunc Errors"), - std::make_pair("OpticalErrors_RODMod", "Preamble/Header Errors"), - std::make_pair("SEUErrors_RODMod", "SEU Errors"), - std::make_pair("TimeoutErrors_RODMod", "Timeout Errors"), - }}; - - const std::array <std::pair <std::string, std::string>, ErrorCategory::COUNT> error_cat_labels = {{ - std::make_pair("SyncErrors", "Sync Errors (FE/MCC & ROD)"), - std::make_pair("TruncErrors", "Trunc Errors (FE/MCC & ROD)"), - std::make_pair("OpticalErrors", "Preamble/Header Errors"), - std::make_pair("SEUErrors", "SEU Errors"), - std::make_pair("TimeoutErrors", "Timeout Errors"), - }}; - - const std::string modlabel2[PixLayerIBL2D3D::COUNT] = {"ECA", "ECC", "B0", "B1", "B2", "IBL", "IBL2D", "IBL3D"}; - - unsigned int nmod_eta[PixLayer::COUNT] = {3, 3, 13, 13, 13, 32}; - - std::string atext_LB = ";lumi block"; - std::string atext_err = ";# errors/event"; - std::string atext_erf = ";# errors/module/event"; - std::string atext_erb = ";error bit"; - std::string atext_ers = ";error type"; - int nbins_LB = m_lbRange; float minbin_LB = -0.5; float maxbin_LB = minbin_LB + (1.0*nbins_LB); - std::string hname; - std::string htitles; - - StatusCode sc; - - hname = makeHistname("SyncErrors_per_lumi_PIX", false); - htitles = makeHisttitle("Average Synchronization errors per event, PIXEL BARREL", (atext_LB+atext_err), false); - sc = rodHistos.regHist(m_errhist_syncerr_LB_pix = TProfile_LW::create(hname.c_str(), htitles.c_str(), nbins_LB, minbin_LB, maxbin_LB)); - - for (int i = 0; i < PixLayerIBL2D3D::COUNT; i++) { - for (int j = 0; j < ErrorCategory::COUNT; ++j) { - hname = makeHistname((error_cat_labels[j].first + "_per_lumi_" + modlabel2[i]), false); - htitles = makeHisttitle(("Average " + error_cat_labels[j].second + ", " + modlabel2[i]), (atext_LB+atext_err), false); - sc = rodHistos.regHist(m_errhist_errcat_LB[i][j] = TProfile_LW::create(hname.c_str(), htitles.c_str(), nbins_LB, minbin_LB, maxbin_LB)); +StatusCode PixelMainMon::bookRODErrorMon(void) { + if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "starting Book Errors" << endmsg; + + std::string path = "Pixel/Errors"; + std::string path2 = "Pixel/ErrorsExpert"; + if (m_doOnTrack) path.replace(path.begin(), path.end(), "Pixel/ErrorsOnTrack"); + MonGroup rodHistos(this, path.c_str(), run, ATTRIB_MANAGED); // declare a group of histograms + MonGroup rodExpert(this, path2.c_str(), run, ATTRIB_MANAGED); // declare a group of histograms + + const std::array<std::pair<std::string, std::string>, kNumErrorStates> error_state_labels = {{ + std::make_pair("Mod_Sync_BCID1_errors", "FE/MCC BCID1 Sync Errors"), + std::make_pair("Mod_Sync_BCID2_errors", "FE/MCC BCID2 Sync Errors"), + std::make_pair("Mod_Sync_LVL1ID_errors", "FE/MCC LVL1ID Sync Errors"), + std::make_pair("ROD_Sync_BCID_errors", "ROD BCID Sync Errors"), + std::make_pair("ROD_Sync_LVL1ID_errors", "ROD LVL1ID Sync Errors"), + std::make_pair("Mod_Trunc_EOC_errors", "FE/MCC EoC Trunc Errors"), + std::make_pair("Mod_Trunc_Hit_Overflow_errors", "FE/MCC Hit Overflow Trunc Errors"), + std::make_pair("Mod_Trunc_EoE_Overflow_errors", "FE/MCC EoE Overflow Trunc Errors"), + std::make_pair("ROD_Trunc_HT_Limit_errors", "ROD H/T Limit Trunc Errors"), + std::make_pair("ROD_Trunc_ROD_OF_errors", "ROD Overflow Trunc Errors"), + std::make_pair("Optical_Errors", "Preamble/Header Errors"), + std::make_pair("SEU_Hit_Parity", "SEU Hit Parity Errors"), + std::make_pair("SEU_Register_Parity", "SEU Register Parity Errors"), + std::make_pair("SEU_Hamming", "SEU Hamming Code Errors"), + std::make_pair("ROD_Timeout", "ROD Formatter Timeout Errors"), + std::make_pair("FE_Warning", "FE Warning Errors"), + }}; + + std::array<std::pair<std::string, std::string>, kNumErrorStatesIBL> error_state_labelsIBL = {{ + std::make_pair("BCID_errors", "Synchronization BCID errors"), + std::make_pair("LVL1ID_errors", "Synchronization LVL1ID errors"), + std::make_pair("Row_Column_errors", "Row Column errors"), + std::make_pair("Limit_errors", "Limit_errors"), + std::make_pair("Preamble_errors", "Preamble errors"), + std::make_pair("Masked_link_errors", "Masked link errors"), + std::make_pair("Hamming_code_0_errors", "Hamming code 0 errors"), + std::make_pair("Hamming_code_1_errors", "Hamming code 1 errors"), + std::make_pair("Hamming_code_2_errors", "Hamming code 2 errors"), + std::make_pair("L1_incounter_errors", "L1 in counter errors"), + std::make_pair("L1_request_counter_errors", "L1 request counter errors"), + std::make_pair("L1_register_errors", "L1 register errors"), + std::make_pair("L1_Trigger_ID_errors", "L1 trigger ID errors"), + std::make_pair("Readout_processor_errors", "Readout processor errors"), + std::make_pair("Skipped_trig_counter_errors", "Skipped trigger counter errors"), + std::make_pair("Truncated_event_flag_errors", "Truncated event errors"), + std::make_pair("Triple redundant_errors", "Triple redundant errors"), + std::make_pair("Write_reg_data_errors", "Write register data errors"), + std::make_pair("Address_errors", "Address errors"), + std::make_pair("Other_CMD_decoder_errors", "CMD decoder errors"), + std::make_pair("CMD_decoder_bitflip_errors", "CMD decoder bit flip errors"), + std::make_pair("CMD_decoder_SEU_errors", "CMD decoder SEU errors"), + std::make_pair("Data_bus_address_errors", "Data bus address errors"), + std::make_pair("ROD_Timeout_errors", "ROD Timeout errors"), + std::make_pair("Timeout_errors", "Timeout errors"), + std::make_pair("BCID_counter_errors", "BCID counter errors"), + std::make_pair("Triple_redundant_errors2", "Triple redundant errors 2"), + }}; + + const char* errorBitsPIX[kNumErrorBits] = { + "ROD Overflow Trunc", "ROD H/T Limit Trunc", "2", "3", + "FE/MCC EoC Trunc", "SEU Hit Parity", "SEU Register Parity", "SEU Hamming Code", + "FE Warning (Bit Flip)", "9", "10", "11", + "FE/MCC Hit Overflow Trunc", "FE/MCC EoE Overflow Trunc", "FE/MCC BCID1 Sync", "FE/MCC BCID2 Sync", + "FE/MCC LVL1ID Sync", "17", "18", "19", + "ROD BCID Sync", "ROD LVL1ID Sync", "ROD Formatter Timeout", "Preamble/Header", + "24", "25", "26", "27", + "28", "29", "30", "31" + }; + + const char* errorBitsIBL[kNumErrorBits] = { + "Row/ Column Error", "Limit Error", "Timeout Error", "BCID Error", + "LVL1ID Error", "Preamble Error", "Masked Link", "Timeout Error", + "BCID counter", "Hamming code 0", "Hamming code 1", "Hamming code 2", + "L1_in counter", "L1 request counter", "L1 register", "L1 Trigger ID", + "readout processor", "Skipped trig counter", "Truncated event flag", "Triple Redundant", + "Write reg data", "Address error", "Other CMD decoder", "CMD decoder bit flip", + "CMD decoder SEU", "Data bus address", "Triple redundant", "27", + "28", "29", "30", "31" + }; + + const std::array<std::pair<std::string, std::string>, ErrorCategoryMODROD::COUNT> error_type_labels = {{ + std::make_pair("SyncErrors_Mod", "FE/MCC Sync Errors"), + std::make_pair("SyncErrors_ROD", "ROD Sync Errors"), + std::make_pair("TruncErrors_Mod", "FE/MCC Trunc Errors"), + std::make_pair("TruncErrors_ROD", "ROD Trunc Errors"), + std::make_pair("OpticalErrors_RODMod", "Preamble/Header Errors"), + std::make_pair("SEUErrors_RODMod", "SEU Errors"), + std::make_pair("TimeoutErrors_RODMod", "Timeout Errors"), + }}; + + const std::array<std::pair<std::string, std::string>, ErrorCategory::COUNT> error_cat_labels = {{ + std::make_pair("SyncErrors", "Sync Errors (FE/MCC & ROD)"), + std::make_pair("TruncErrors", "Trunc Errors (FE/MCC & ROD)"), + std::make_pair("OpticalErrors", "Preamble/Header Errors"), + std::make_pair("SEUErrors", "SEU Errors"), + std::make_pair("TimeoutErrors", "Timeout Errors"), + }}; + + const std::string modlabel2[PixLayerIBL2D3D::COUNT] = {"ECA", "ECC", "B0", "B1", "B2", "IBL", "IBL2D", "IBL3D"}; + + unsigned int nmod_eta[PixLayer::COUNT] = {3, 3, 13, 13, 13, 32}; + + std::string atext_LB = ";lumi block"; + std::string atext_err = ";# errors/event"; + std::string atext_erf = ";# errors/module/event"; + std::string atext_erb = ";error bit"; + std::string atext_ers = ";error type"; + int nbins_LB = m_lbRange; + float minbin_LB = -0.5; + float maxbin_LB = minbin_LB + (1.0 * nbins_LB); + std::string hname; + std::string htitles; + + StatusCode sc; + + hname = makeHistname("SyncErrors_per_lumi_PIX", false); + htitles = makeHisttitle("Average Synchronization errors per event, PIXEL BARREL", (atext_LB + atext_err), false); + sc = rodHistos.regHist(m_errhist_syncerr_LB_pix = TProfile_LW::create(hname.c_str(), htitles.c_str(), nbins_LB, minbin_LB, maxbin_LB)); + + for (int i = 0; i < PixLayerIBL2D3D::COUNT; i++) { + for (int j = 0; j < ErrorCategory::COUNT; ++j) { + hname = makeHistname((error_cat_labels[j].first + "_per_lumi_" + modlabel2[i]), false); + htitles = makeHisttitle(("Average " + error_cat_labels[j].second + ", " + modlabel2[i]), (atext_LB + atext_err), false); + sc = rodHistos.regHist(m_errhist_errcat_LB[i][j] = TProfile_LW::create(hname.c_str(), htitles.c_str(), nbins_LB, minbin_LB, maxbin_LB)); + } + + for (int j = 0; j < ErrorCategoryMODROD::COUNT - 3; ++j) { + hname = makeHistname((error_type_labels[j].first + "_per_lumi_" + modlabel2[i]), false); + htitles = makeHisttitle(("Average " + error_type_labels[j].second + ", " + modlabel2[i]), (atext_LB + atext_err), false); + sc = rodHistos.regHist(m_errhist_errtype_LB[i][j] = TProfile_LW::create(hname.c_str(), htitles.c_str(), nbins_LB, minbin_LB, maxbin_LB)); + } + + hname = makeHistname(("errors_per_lumi_" + modlabel2[i]), false); + htitles = makeHisttitle(("Average Total Errors, " + modlabel2[i]), (atext_LB + atext_err), false); + sc = rodHistos.regHist(m_errhist_tot_LB[i] = TProfile_LW::create(hname.c_str(), htitles.c_str(), nbins_LB, minbin_LB, maxbin_LB)); + + hname = makeHistname(("ErrorBit_per_lumi_" + modlabel2[i]), false); + htitles = makeHisttitle(("Average Errors by Error Bits, " + modlabel2[i]), (atext_LB + atext_erb + atext_erf), false); + sc = rodHistos.regHist(m_errhist_per_bit_LB[i] = TProfile2D_LW::create(hname.c_str(), htitles.c_str(), nbins_LB, minbin_LB, maxbin_LB, 31, 0., 31.)); + m_errhist_per_bit_LB[i]->SetOption("colz"); + + hname = makeHistname(("Error_per_lumi_" + modlabel2[i]), false); + htitles = makeHisttitle(("Average Errors by Error Types, " + modlabel2[i]), (atext_LB + atext_ers + atext_err), false); + sc = rodHistos.regHist(m_errhist_per_type_LB[i] = TProfile2D_LW::create(hname.c_str(), htitles.c_str(), nbins_LB, minbin_LB, maxbin_LB, 7, 0., 7.)); + m_errhist_per_type_LB[i]->SetOption("colz"); + + if (i < PixLayerIBL2D3D::kIBL) { + for (unsigned int y = 1; y <= m_errhist_per_bit_LB[i]->GetYaxis()->GetNbins(); y++) { + m_errhist_per_bit_LB[i]->GetYaxis()->SetBinLabel(y, errorBitsPIX[y - 1]); } - - for (int j = 0; j < ErrorCategoryMODROD::COUNT - 3; ++j) { - hname = makeHistname((error_type_labels[j].first + "_per_lumi_" + modlabel2[i]), false); - htitles = makeHisttitle(("Average " + error_type_labels[j].second + ", " + modlabel2[i]), (atext_LB+atext_err), false); - sc = rodHistos.regHist(m_errhist_errtype_LB[i][j] = TProfile_LW::create(hname.c_str(), htitles.c_str(), nbins_LB, minbin_LB, maxbin_LB)); - } - - hname = makeHistname(("errors_per_lumi_"+modlabel2[i]), false); - htitles = makeHisttitle(("Average Total Errors, "+modlabel2[i]), (atext_LB+atext_err), false); - sc = rodHistos.regHist(m_errhist_tot_LB[i] = TProfile_LW::create(hname.c_str(), htitles.c_str(), nbins_LB, minbin_LB, maxbin_LB)); - - hname = makeHistname(("ErrorBit_per_lumi_"+modlabel2[i]), false); - htitles = makeHisttitle(("Average Errors by Error Bits, "+modlabel2[i]), (atext_LB+atext_erb+atext_erf), false); - sc = rodHistos.regHist(m_errhist_per_bit_LB[i] = TProfile2D_LW::create(hname.c_str(), htitles.c_str(), nbins_LB, minbin_LB, maxbin_LB, 31, 0., 31.)); - m_errhist_per_bit_LB[i]->SetOption("colz"); - - hname = makeHistname(("Error_per_lumi_"+modlabel2[i]), false); - htitles = makeHisttitle(("Average Errors by Error Types, "+modlabel2[i]), (atext_LB+atext_ers+atext_err), false); - sc = rodHistos.regHist(m_errhist_per_type_LB[i] = TProfile2D_LW::create(hname.c_str(), htitles.c_str(), nbins_LB, minbin_LB, maxbin_LB, 7, 0., 7.)); - m_errhist_per_type_LB[i]->SetOption("colz"); - - if (i < PixLayerIBL2D3D::kIBL) { - for (unsigned int y = 1; y <= m_errhist_per_bit_LB[i]->GetYaxis()->GetNbins(); y++) { - m_errhist_per_bit_LB[i]->GetYaxis()->SetBinLabel(y, errorBitsPIX[y-1]); - } - } else { - for (unsigned int y = 1; y <= m_errhist_per_bit_LB[i]->GetYaxis()->GetNbins(); y++) { - m_errhist_per_bit_LB[i]->GetYaxis()->SetBinLabel(y, errorBitsIBL[y-1]); - } + } else { + for (unsigned int y = 1; y <= m_errhist_per_bit_LB[i]->GetYaxis()->GetNbins(); y++) { + m_errhist_per_bit_LB[i]->GetYaxis()->SetBinLabel(y, errorBitsIBL[y - 1]); } - - for (unsigned int y = 1; y <= m_errhist_per_type_LB[i]->GetYaxis()->GetNbins(); y++) { - m_errhist_per_type_LB[i]->GetYaxis()->SetBinLabel(y, error_type_labels[y-1].second.c_str()); - } - - const std::string tmp[ErrorCategory::COUNT] = {"SyncErrorsFrac_per_event", "TruncationErrorsFrac_per_event", "OpticalErrorsFrac_per_event", "SEUErrorsFrac_per_event", "TimeoutErrorsFrac_per_event"}; - for (int j = 0; j < ErrorCategory::COUNT; j++) { - hname = makeHistname((tmp[j]+"_"+modlabel2[i]), false); - htitles = makeHisttitle(("Average " + error_cat_labels[j].second + " per Module" + ", " + modlabel2[i]), (atext_LB + atext_erf), false); - sc = rodHistos.regHist(m_errhist_errcat_avg[j][i] = TProfile_LW::create(hname.c_str(), htitles.c_str(), nbins_LB, minbin_LB, maxbin_LB)); - } - - const std::string tmp2[ErrorCategoryMODROD::COUNT - 3] = {"SyncErrors_Mod_Frac_per_event", "SyncErrors_ROD_Frac_per_event", "TruncErrors_Mod_Frac_per_event", "TruncErrors_ROD_Frac_per_event"}; - for (int j = 0; j < ErrorCategoryMODROD::COUNT - 3; j++) { - hname = makeHistname((tmp2[j]+"_"+modlabel2[i]), false); - htitles = makeHisttitle((tmp2[j]+", "+modlabel2[i]), (atext_LB+atext_erf), false); - sc = rodHistos.regHist(m_errhist_errtype_avg[j][i] = TProfile_LW::create(hname.c_str(), htitles.c_str(), nbins_LB, minbin_LB, maxbin_LB)); - } - } - - if (m_doOnline) { - const std::string tmp = "errors_over_time"; - const std::string tmp2 = "Number of Errors as function of time over"; - int nbin = 99; float min = 0.0; float max = 1.0; - sc = rodHistos.regHist(m_error_time1 = new TProfile((tmp + "_10min").c_str(), (tmp2 + " 10 minutes. 6 sec/bin" + m_histTitleExt + ";time;module occupancy").c_str(), nbin, min, max, "i")); - sc = rodHistos.regHist(m_error_time2 = new TProfile((tmp + "_1hr").c_str(), (tmp2 + " 1 hour. 36 sec/bin" + m_histTitleExt + ";time;module occupancy").c_str(), nbin, min, max, "i")); - sc = rodHistos.regHist(m_error_time3 = new TProfile((tmp + "_6hr").c_str(), (tmp2 + " 6 hours. 3.6 min/bin" + m_histTitleExt + ";time;module occupancy").c_str(), nbin, min, max, "i")); - } - - if (m_doModules) { - m_errors = std::make_unique<PixelMonModules1D>(PixelMonModules1D("errors", ("Errors in module:ErrorType" + m_histTitleExt + ";Number of Errors").c_str(), 7, 0.5, 7.5)); - sc = m_errors->regHist(this, (path+"/ModulesErrors").c_str(), run); - for (int k = 0; k < 7; k++) m_errors->SetBinLabel(error_type_labels[k].second.c_str(), k+1); - } - - if (m_do2DMaps && !m_doOnline) { - for (int i = 0; i < ErrorCategoryMODROD::COUNT - 3; i++) { - m_errhist_errtype_map[i] = std::make_unique<PixelMon2DMapsLW>(PixelMon2DMapsLW(error_type_labels[i].first, ("Total " + error_type_labels[i].second + m_histTitleExt).c_str(), PixMon::HistConf::kPixDBMIBL2D3D, true)); - sc = m_errhist_errtype_map[i]->regHist(rodHistos); - } - for (int i = 0; i < ErrorCategory::COUNT; i++) { - m_errhist_errcat_map[i] = std::make_unique<PixelMon2DMapsLW>(PixelMon2DMapsLW(error_cat_labels[i].first, ("Total " + error_cat_labels[i].second + m_histTitleExt).c_str(), PixMon::HistConf::kPixDBMIBL2D3D, true)); - sc = m_errhist_errcat_map[i]->regHist(rodHistos); - } - } - - if (m_doOfflineAnalysis) { - for (int j = 0; j < kNumErrorStates; j++) { - m_errhist_expert_LB_maps[j] = std::make_unique<PixelMon2DLumiMaps>(PixelMon2DLumiMaps(error_state_labels[j].first + "_int_LB", error_state_labels[j].second + " per event per LB" + m_histTitleExt, "# Errors", PixMon::HistConf::kPix)); - sc = m_errhist_expert_LB_maps[j]->regHist(rodExpert); - } - for (int j = kNumErrorStates; j < kNumErrorStates+kNumErrorStatesIBL; j++) { - m_errhist_expert_LB_maps[j] = std::make_unique<PixelMon2DLumiMaps>(PixelMon2DLumiMaps(error_state_labelsIBL[j - kNumErrorStates].first + "_int_LB", error_state_labelsIBL[j - kNumErrorStates].second + " per event per LB" + m_histTitleExt, "# Errors", PixMon::HistConf::kIBL)); - sc = m_errhist_expert_LB_maps[j]->regHist(rodExpert); - } - } - - for (int j = 0; j < kNumErrorStates; j++) { - for (int i = 0; i < PixLayer::COUNT - 1; i++) { - hname = makeHistname((error_state_labels[j].first+"_per_lumi_"+modlabel2[i]), false); - htitles = makeHisttitle(("Average "+error_state_labels[j].second+" per event per LB, "+modlabel2[i]), (atext_LB+atext_erf), false); - sc = rodExpert.regHist(m_errhist_expert_LB[i][j] = TProfile_LW::create(hname.c_str(), htitles.c_str(), nbins_LB, minbin_LB, maxbin_LB)); - } - hname = makeHistname((error_state_labels[j].first+"_Map"), false); - htitles = makeHisttitle((error_state_labels[j].second + " per event per LB"), "", false); - m_errhist_expert_maps[j] = std::make_unique<PixelMon2DMapsLW>(PixelMon2DMapsLW(hname.c_str(), htitles.c_str(), PixMon::HistConf::kPix, true)); - sc = m_errhist_expert_maps[j]->regHist(rodExpert); - } - - if (m_do2DMaps) { - m_errhist_femcc_errwords_map = std::make_unique<PixelMon2DProfilesLW>(PixelMon2DProfilesLW("femcc_errorwords", ("Average FE/MCC Error Words" + m_histTitleExt).c_str(), PixMon::HistConf::kPixIBL2D3D)); - sc = m_errhist_femcc_errwords_map->regHist(rodHistos); - } - - for (int j = 0; j < kNumErrorStatesIBL; j++) { - hname = makeHistname((error_state_labelsIBL[j].first + "_per_lumi_" + modlabel2[PixLayerIBL2D3D::kIBL]), false); - htitles = makeHisttitle(("Average " + error_state_labelsIBL[j].second + " per event per LB, " + modlabel2[PixLayerIBL2D3D::kIBL]), (atext_LB + atext_erf), false); - sc = rodExpert.regHist(m_errhist_expert_IBL_LB[j] = TProfile_LW::create(hname.c_str(), htitles.c_str(), nbins_LB, minbin_LB, maxbin_LB)); - } - - for (int j = kNumErrorStates; j < kNumErrorStates+kNumErrorStatesIBL; j++) { - hname = makeHistname((error_state_labelsIBL[j - kNumErrorStates].first+"_Map"), false); - htitles = makeHisttitle((error_state_labelsIBL[j - kNumErrorStates].second + " per event per LB"), "", false); - m_errhist_expert_maps[j] = std::make_unique<PixelMon2DMapsLW>(PixelMon2DMapsLW(hname.c_str(), htitles.c_str(), PixMon::HistConf::kIBL, m_doIBL)); - sc = m_errhist_expert_maps[j]->regHist(rodExpert); - } - - hname = makeHistname("ServiceRecord_Unweighted_IBL", false); - htitles = makeHisttitle("ServiceRecord Unweighted, IBL", ";SR;Count", false); - sc = rodExpert.regHist(m_errhist_expert_servrec_ibl_unweighted = TH1F_LW::create(hname.c_str(), htitles.c_str(), 32, -0.5, 31.5)); - - hname = makeHistname("ServiceRecord_Weighted_IBL", false); - htitles = makeHisttitle("ServiceRecord Weighted, IBL", ";SR;Count", false); - sc = rodExpert.regHist(m_errhist_expert_servrec_ibl_weighted = TH1F_LW::create(hname.c_str(), htitles.c_str(), 32, -0.5, 31.5)); - - hname = makeHistname("ServiceRecord_Count_IBL", false); - htitles = makeHisttitle("ServiceRecord Count, IBL", ";SR;Count", false); - sc = rodExpert.regHist(m_errhist_expert_servrec_ibl_count = TH1F_LW::create(hname.c_str(), htitles.c_str(), 100, -0.5, 99.5)); - - if (m_errhist_expert_servrec_ibl_unweighted) { - for (int i = 0; i < kNumErrorBits; i++) { - m_errhist_expert_servrec_ibl_unweighted->GetXaxis()->SetBinLabel(i+1, errorBitsIBL[i]); - } - } - - if (m_errhist_expert_servrec_ibl_weighted) { - for (int i = 0; i < kNumErrorBits; i++) { - m_errhist_expert_servrec_ibl_weighted->GetXaxis()->SetBinLabel(i+1, errorBitsIBL[i]); - } - } - - for (int i = 0; i < PixLayer::COUNT; i++) { - hname = makeHistname(("nFEswithTruncErr_"+m_modLabel_PixLayerIBL2D3D[i]), false); - htitles = makeHisttitle(("Number of FEs with FE EoC Trunc error, "+m_modLabel_PixLayerIBL2D3D[i]), ";lumi block;eta index of module;# FEs with errors in a module in an event;# event #times # modules", false); - sc = rodExpert.regHist(m_errhist_expert_fe_trunc_err_3d[i] = new TH3F(hname.c_str(), htitles.c_str(), nbins_LB, minbin_LB, maxbin_LB, nmod_eta[i], -0.5, -0.5 + nmod_eta[i], 18, -0.5, 17.5)); - } - if (sc.isFailure() && msgLvl(MSG::WARNING)) - msg(MSG::WARNING) << "histograms not booked" << endmsg; - return StatusCode::SUCCESS; + } + + for (unsigned int y = 1; y <= m_errhist_per_type_LB[i]->GetYaxis()->GetNbins(); y++) { + m_errhist_per_type_LB[i]->GetYaxis()->SetBinLabel(y, error_type_labels[y - 1].second.c_str()); + } + + const std::string tmp[ErrorCategory::COUNT] = {"SyncErrorsFrac_per_event", "TruncationErrorsFrac_per_event", "OpticalErrorsFrac_per_event", "SEUErrorsFrac_per_event", "TimeoutErrorsFrac_per_event"}; + for (int j = 0; j < ErrorCategory::COUNT; j++) { + hname = makeHistname((tmp[j] + "_" + modlabel2[i]), false); + htitles = makeHisttitle(("Average " + error_cat_labels[j].second + " per Module" + ", " + modlabel2[i]), (atext_LB + atext_erf), false); + sc = rodHistos.regHist(m_errhist_errcat_avg[j][i] = TProfile_LW::create(hname.c_str(), htitles.c_str(), nbins_LB, minbin_LB, maxbin_LB)); + } + + const std::string tmp2[ErrorCategoryMODROD::COUNT - 3] = {"SyncErrors_Mod_Frac_per_event", "SyncErrors_ROD_Frac_per_event", "TruncErrors_Mod_Frac_per_event", "TruncErrors_ROD_Frac_per_event"}; + for (int j = 0; j < ErrorCategoryMODROD::COUNT - 3; j++) { + hname = makeHistname((tmp2[j] + "_" + modlabel2[i]), false); + htitles = makeHisttitle((tmp2[j] + ", " + modlabel2[i]), (atext_LB + atext_erf), false); + sc = rodHistos.regHist(m_errhist_errtype_avg[j][i] = TProfile_LW::create(hname.c_str(), htitles.c_str(), nbins_LB, minbin_LB, maxbin_LB)); + } + } + + if (m_doOnline) { + const std::string tmp = "errors_over_time"; + const std::string tmp2 = "Number of Errors as function of time over"; + int nbin = 99; + float min = 0.0; + float max = 1.0; + sc = rodHistos.regHist(m_error_time1 = new TProfile((tmp + "_10min").c_str(), (tmp2 + " 10 minutes. 6 sec/bin" + m_histTitleExt + ";time;module occupancy").c_str(), nbin, min, max, "i")); + sc = rodHistos.regHist(m_error_time2 = new TProfile((tmp + "_1hr").c_str(), (tmp2 + " 1 hour. 36 sec/bin" + m_histTitleExt + ";time;module occupancy").c_str(), nbin, min, max, "i")); + sc = rodHistos.regHist(m_error_time3 = new TProfile((tmp + "_6hr").c_str(), (tmp2 + " 6 hours. 3.6 min/bin" + m_histTitleExt + ";time;module occupancy").c_str(), nbin, min, max, "i")); + } + + if (m_doModules) { + m_errors = std::make_unique<PixelMonModules1D>(PixelMonModules1D("errors", ("Errors in module:ErrorType" + m_histTitleExt + ";Number of Errors").c_str(), 7, 0.5, 7.5)); + sc = m_errors->regHist(this, (path + "/ModulesErrors").c_str(), run); + for (int k = 0; k < 7; k++) { + m_errors->setBinLabel(error_type_labels[k].second.c_str(), k + 1); + } + } + + if (m_do2DMaps && !m_doOnline) { + for (int i = 0; i < ErrorCategoryMODROD::COUNT - 3; i++) { + m_errhist_errtype_map[i] = std::make_unique<PixelMon2DMapsLW>(PixelMon2DMapsLW(error_type_labels[i].first, ("Total " + error_type_labels[i].second + m_histTitleExt).c_str(), PixMon::HistConf::kPixDBMIBL2D3D, true)); + sc = m_errhist_errtype_map[i]->regHist(rodHistos); + } + for (int i = 0; i < ErrorCategory::COUNT; i++) { + m_errhist_errcat_map[i] = std::make_unique<PixelMon2DMapsLW>(PixelMon2DMapsLW(error_cat_labels[i].first, ("Total " + error_cat_labels[i].second + m_histTitleExt).c_str(), PixMon::HistConf::kPixDBMIBL2D3D, true)); + sc = m_errhist_errcat_map[i]->regHist(rodHistos); + } + } + + if (m_doOfflineAnalysis) { + for (int j = 0; j < kNumErrorStates; j++) { + m_errhist_expert_LB_maps[j] = std::make_unique<PixelMon2DLumiMaps>(PixelMon2DLumiMaps(error_state_labels[j].first + "_int_LB", error_state_labels[j].second + " per event per LB" + m_histTitleExt, "# Errors", PixMon::HistConf::kPix)); + sc = m_errhist_expert_LB_maps[j]->regHist(rodExpert); + } + for (int j = kNumErrorStates; j < kNumErrorStates + kNumErrorStatesIBL; j++) { + m_errhist_expert_LB_maps[j] = std::make_unique<PixelMon2DLumiMaps>(PixelMon2DLumiMaps(error_state_labelsIBL[j - kNumErrorStates].first + "_int_LB", error_state_labelsIBL[j - kNumErrorStates].second + " per event per LB" + m_histTitleExt, "# Errors", PixMon::HistConf::kIBL)); + sc = m_errhist_expert_LB_maps[j]->regHist(rodExpert); + } + } + + for (int j = 0; j < kNumErrorStates; j++) { + for (int i = 0; i < PixLayer::COUNT - 1; i++) { + hname = makeHistname((error_state_labels[j].first + "_per_lumi_" + modlabel2[i]), false); + htitles = makeHisttitle(("Average " + error_state_labels[j].second + " per event per LB, " + modlabel2[i]), (atext_LB + atext_erf), false); + sc = rodExpert.regHist(m_errhist_expert_LB[i][j] = TProfile_LW::create(hname.c_str(), htitles.c_str(), nbins_LB, minbin_LB, maxbin_LB)); + } + hname = makeHistname((error_state_labels[j].first + "_Map"), false); + htitles = makeHisttitle((error_state_labels[j].second + " per event per LB"), "", false); + m_errhist_expert_maps[j] = std::make_unique<PixelMon2DMapsLW>(PixelMon2DMapsLW(hname.c_str(), htitles.c_str(), PixMon::HistConf::kPix, true)); + sc = m_errhist_expert_maps[j]->regHist(rodExpert); + } + + if (m_do2DMaps) { + m_errhist_femcc_errwords_map = std::make_unique<PixelMon2DProfilesLW>(PixelMon2DProfilesLW("femcc_errorwords", ("Average FE/MCC Error Words" + m_histTitleExt).c_str(), PixMon::HistConf::kPixIBL2D3D)); + sc = m_errhist_femcc_errwords_map->regHist(rodHistos); + } + + for (int j = 0; j < kNumErrorStatesIBL; j++) { + hname = makeHistname((error_state_labelsIBL[j].first + "_per_lumi_" + modlabel2[PixLayerIBL2D3D::kIBL]), false); + htitles = makeHisttitle(("Average " + error_state_labelsIBL[j].second + " per event per LB, " + modlabel2[PixLayerIBL2D3D::kIBL]), (atext_LB + atext_erf), false); + sc = rodExpert.regHist(m_errhist_expert_IBL_LB[j] = TProfile_LW::create(hname.c_str(), htitles.c_str(), nbins_LB, minbin_LB, maxbin_LB)); + } + + for (int j = kNumErrorStates; j < kNumErrorStates + kNumErrorStatesIBL; j++) { + hname = makeHistname((error_state_labelsIBL[j - kNumErrorStates].first + "_Map"), false); + htitles = makeHisttitle((error_state_labelsIBL[j - kNumErrorStates].second + " per event per LB"), "", false); + m_errhist_expert_maps[j] = std::make_unique<PixelMon2DMapsLW>(PixelMon2DMapsLW(hname.c_str(), htitles.c_str(), PixMon::HistConf::kIBL, m_doIBL)); + sc = m_errhist_expert_maps[j]->regHist(rodExpert); + } + + hname = makeHistname("ServiceRecord_Unweighted_IBL", false); + htitles = makeHisttitle("ServiceRecord Unweighted, IBL", ";SR;Count", false); + sc = rodExpert.regHist(m_errhist_expert_servrec_ibl_unweighted = TH1F_LW::create(hname.c_str(), htitles.c_str(), 32, -0.5, 31.5)); + + hname = makeHistname("ServiceRecord_Weighted_IBL", false); + htitles = makeHisttitle("ServiceRecord Weighted, IBL", ";SR;Count", false); + sc = rodExpert.regHist(m_errhist_expert_servrec_ibl_weighted = TH1F_LW::create(hname.c_str(), htitles.c_str(), 32, -0.5, 31.5)); + + hname = makeHistname("ServiceRecord_Count_IBL", false); + htitles = makeHisttitle("ServiceRecord Count, IBL", ";SR;Count", false); + sc = rodExpert.regHist(m_errhist_expert_servrec_ibl_count = TH1F_LW::create(hname.c_str(), htitles.c_str(), 100, -0.5, 99.5)); + + if (m_errhist_expert_servrec_ibl_unweighted) { + for (int i = 0; i < kNumErrorBits; i++) { + m_errhist_expert_servrec_ibl_unweighted->GetXaxis()->SetBinLabel(i + 1, errorBitsIBL[i]); + } + } + + if (m_errhist_expert_servrec_ibl_weighted) { + for (int i = 0; i < kNumErrorBits; i++) { + m_errhist_expert_servrec_ibl_weighted->GetXaxis()->SetBinLabel(i + 1, errorBitsIBL[i]); + } + } + + for (int i = 0; i < PixLayer::COUNT; i++) { + hname = makeHistname(("nFEswithTruncErr_" + m_modLabel_PixLayerIBL2D3D[i]), false); + htitles = makeHisttitle(("Number of FEs with FE EoC Trunc error, " + m_modLabel_PixLayerIBL2D3D[i]), ";lumi block;eta index of module;# FEs with errors in a module in an event;# event #times # modules", false); + sc = rodExpert.regHist(m_errhist_expert_fe_trunc_err_3d[i] = new TH3F(hname.c_str(), htitles.c_str(), nbins_LB, minbin_LB, maxbin_LB, nmod_eta[i], -0.5, -0.5 + nmod_eta[i], 18, -0.5, 17.5)); + } + if (sc.isFailure() && msgLvl(MSG::WARNING)) msg(MSG::WARNING) << "histograms not booked" << endmsg; + return StatusCode::SUCCESS; } -StatusCode PixelMainMon::BookRODErrorLumiBlockMon(void) -{ - if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "starting Book Errors for lowStat" << endmsg; +StatusCode PixelMainMon::bookRODErrorLumiBlockMon(void) { + if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "starting Book Errors for lowStat" << endmsg; - std::string path = "Pixel/LumiBlock"; - if (m_doOnTrack) path.replace(path.begin(), path.end(), "Pixel/LumiBlockOnTrack"); - 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"); + MonGroup lumiBlockHist(this, path.c_str(), lowStat, ATTRIB_MANAGED); // declare a group of histograms - StatusCode sc; + StatusCode sc; - if (m_do2DMaps && !m_doOnline) { - m_errors_LB = std::make_unique<PixelMon2DMapsLW>(PixelMon2DMapsLW("Errors_LB", ("Errors" + m_histTitleExt).c_str(), PixMon::HistConf::kPixDBMIBL2D3D, true)); - sc = m_errors_LB->regHist(lumiBlockHist); + if (m_do2DMaps && !m_doOnline) { + m_errors_LB = std::make_unique<PixelMon2DMapsLW>(PixelMon2DMapsLW("Errors_LB", ("Errors" + m_histTitleExt).c_str(), PixMon::HistConf::kPixDBMIBL2D3D, true)); + sc = m_errors_LB->regHist(lumiBlockHist); - m_errors_RODSync_mod = std::make_unique<PixelMon2DMapsLW>(PixelMon2DMapsLW("Errors_RODSync_LB", ("Errors_RODSync" + m_histTitleExt).c_str(), PixMon::HistConf::kPixDBMIBL2D3D, true)); - sc = m_errors_RODSync_mod->regHist(lumiBlockHist); + m_errors_RODSync_mod = std::make_unique<PixelMon2DMapsLW>(PixelMon2DMapsLW("Errors_RODSync_LB", ("Errors_RODSync" + m_histTitleExt).c_str(), PixMon::HistConf::kPixDBMIBL2D3D, true)); + sc = m_errors_RODSync_mod->regHist(lumiBlockHist); - m_errors_ModSync_mod = std::make_unique<PixelMon2DMapsLW>(PixelMon2DMapsLW("Errors_ModSync_LB", ("Errors_ModSync" + m_histTitleExt).c_str(), PixMon::HistConf::kPixDBMIBL2D3D, true)); - sc = m_errors_ModSync_mod->regHist(lumiBlockHist); - } + m_errors_ModSync_mod = std::make_unique<PixelMon2DMapsLW>(PixelMon2DMapsLW("Errors_ModSync_LB", ("Errors_ModSync" + m_histTitleExt).c_str(), PixMon::HistConf::kPixDBMIBL2D3D, true)); + sc = m_errors_ModSync_mod->regHist(lumiBlockHist); + } - if (sc.isFailure() && msgLvl(MSG::WARNING)) msg(MSG::WARNING) << "histograms not booked" << endmsg; - return StatusCode::SUCCESS; + if (sc.isFailure() && msgLvl(MSG::WARNING)) msg(MSG::WARNING) << "histograms not booked" << endmsg; + return StatusCode::SUCCESS; } -StatusCode PixelMainMon::FillRODErrorMon(void) -{ - const int kLumiBlock = m_manager->lumiBlockNumber(); - const int kNumFEs{16}; - - static constexpr int kNumModulesPhi[PixLayer::COUNT] = {48, 48, 22, 38, 52, 14}; - static constexpr int kNumModulesEta[PixLayer::COUNT] = { 3, 3, 13, 13, 13, 20}; - - // Error counters: total; errors by bit; errors by state (sync etc.) - int num_errors[PixLayerIBL2D3D::COUNT] = {0}; - int num_errors_per_bit[PixLayerIBL2D3D::COUNT][kNumErrorBits] = {0}; - int num_errors_per_state[PixLayer::COUNT - 1][kNumErrorStates] = {0}; // no IBL here - int num_errors_per_stateIBL[kNumErrorStatesIBL] = {0}; // IBL - - // Counter for erroneous modules on the layer, per error type and - // category (error cat. = error type w/o ROD/MOD distinction). - int num_errormodules_per_cat[PixLayerIBL2D3D::COUNT][ErrorCategory::COUNT] = {0}; - int num_errormodules_per_type[PixLayerIBL2D3D::COUNT][ErrorCategoryMODROD::COUNT] = {0}; - - // Counter for erroneous FEs per module per layer. - int num_errorFEs_EA[kNumModulesPhi[PixLayer::kECA]][kNumModulesEta[PixLayer::kECA]][kNumFEs] = {0}; - int num_errorFEs_EC[kNumModulesPhi[PixLayer::kECC]][kNumModulesEta[PixLayer::kECC]][kNumFEs] = {0}; - int num_errorFEs_B0[kNumModulesPhi[PixLayer::kB0] ][kNumModulesEta[PixLayer::kB0] ][kNumFEs] = {0}; - int num_errorFEs_B1[kNumModulesPhi[PixLayer::kB1] ][kNumModulesEta[PixLayer::kB1] ][kNumFEs] = {0}; - int num_errorFEs_B2[kNumModulesPhi[PixLayer::kB2] ][kNumModulesEta[PixLayer::kB2] ][kNumFEs] = {0}; - - const auto& kFeErrorWords = m_ErrorSvc->getAllFeErrors(); - - PixelID::const_id_iterator idIt = m_pixelid->wafer_begin(); - PixelID::const_id_iterator idItEnd = m_pixelid->wafer_end(); - - ///// Pixel ID Loop - for (; idIt != idItEnd; ++idIt) { - Identifier WaferID = *idIt; - IdentifierHash id_hash = m_pixelid->wafer_hash(WaferID); - const uint64_t kErrorWord = m_ErrorSvc->getModuleErrors(id_hash); - - bool is_ibl = false; - if (m_ErrorSvc->isActive(id_hash) && m_pixelid->barrel_ec(WaferID) == 0 && m_pixelid->layer_disk(WaferID) == 0 && m_doIBL) is_ibl = true; - - // Determine layer; functions return '99' for non-sensible IDs. - const int kLayer = GetPixLayerID(m_pixelid->barrel_ec(WaferID), m_pixelid->layer_disk(WaferID), m_doIBL); - const int kLayerIBL = GetPixLayerIDIBL2D3D(m_pixelid->barrel_ec(WaferID), m_pixelid->layer_disk(WaferID), m_pixelid->eta_module(WaferID), m_doIBL); - if (kLayer == 99) continue; - - // Boolean whether current module has an error of type/category. - bool has_err_cat[ErrorCategory::COUNT] = {false}; - bool has_err_type[ErrorCategoryMODROD::COUNT] = {false}; - - for (unsigned int bit = 0; bit < kNumErrorBits; bit++) { - if ((kErrorWord & (static_cast<uint64_t>(1)<<bit)) != 0) { - // For non-IBL, We deal with FE/MCC errors separately, so ignore them here! - if (!is_ibl && bit >= 4 && bit <=16) continue; - - num_errors[kLayer]++; - num_errors_per_bit[kLayer][bit]++; +StatusCode PixelMainMon::fillRODErrorMon(void) { + const int kLumiBlock = m_manager->lumiBlockNumber(); + const int kNumFEs{16}; + + static constexpr int kNumModulesPhi[PixLayer::COUNT] = {48, 48, 22, 38, 52, 14}; + static constexpr int kNumModulesEta[PixLayer::COUNT] = {3, 3, 13, 13, 13, 20}; + + // Error counters: total; errors by bit; errors by state (sync etc.) + int num_errors[PixLayerIBL2D3D::COUNT] = {0}; + int num_errors_per_bit[PixLayerIBL2D3D::COUNT][kNumErrorBits] = {0}; + int num_errors_per_state[PixLayer::COUNT - 1][kNumErrorStates] = {0}; // no IBL here + int num_errors_per_stateIBL[kNumErrorStatesIBL] = {0}; // IBL + + // Counter for erroneous modules on the layer, per error type and + // category (error cat. = error type w/o ROD/MOD distinction). + int num_errormodules_per_cat[PixLayerIBL2D3D::COUNT][ErrorCategory::COUNT] = {0}; + int num_errormodules_per_type[PixLayerIBL2D3D::COUNT][ErrorCategoryMODROD::COUNT] = {0}; + + // Counter for erroneous FEs per module per layer. + int num_errorFEs_EA[kNumModulesPhi[PixLayer::kECA]][kNumModulesEta[PixLayer::kECA]][kNumFEs] = {0}; + int num_errorFEs_EC[kNumModulesPhi[PixLayer::kECC]][kNumModulesEta[PixLayer::kECC]][kNumFEs] = {0}; + int num_errorFEs_B0[kNumModulesPhi[PixLayer::kB0]][kNumModulesEta[PixLayer::kB0]][kNumFEs] = {0}; + int num_errorFEs_B1[kNumModulesPhi[PixLayer::kB1]][kNumModulesEta[PixLayer::kB1]][kNumFEs] = {0}; + int num_errorFEs_B2[kNumModulesPhi[PixLayer::kB2]][kNumModulesEta[PixLayer::kB2]][kNumFEs] = {0}; + + const auto& kFeErrorWords = m_ErrorSvc->getAllFeErrors(); + + PixelID::const_id_iterator idIt = m_pixelid->wafer_begin(); + PixelID::const_id_iterator idItEnd = m_pixelid->wafer_end(); + + // Pixel ID Loop + for (; idIt != idItEnd; ++idIt) { + Identifier WaferID = *idIt; + IdentifierHash id_hash = m_pixelid->wafer_hash(WaferID); + const uint64_t kErrorWord = m_ErrorSvc->getModuleErrors(id_hash); + + bool is_ibl = false; + if (m_ErrorSvc->isActive(id_hash) && m_pixelid->barrel_ec(WaferID) == 0 && m_pixelid->layer_disk(WaferID) == 0 && m_doIBL) is_ibl = true; + + // Determine layer; functions return '99' for non-sensible IDs. + const int kLayer = getPixLayerID(m_pixelid->barrel_ec(WaferID), m_pixelid->layer_disk(WaferID), m_doIBL); + const int kLayerIBL = getPixLayerIDIBL2D3D(m_pixelid->barrel_ec(WaferID), m_pixelid->layer_disk(WaferID), m_pixelid->eta_module(WaferID), m_doIBL); + if (kLayer == 99) continue; + + // Boolean whether current module has an error of type/category. + bool has_err_cat[ErrorCategory::COUNT] = {false}; + bool has_err_type[ErrorCategoryMODROD::COUNT] = {false}; + + for (unsigned int bit = 0; bit < kNumErrorBits; bit++) { + if ((kErrorWord & (static_cast<uint64_t>(1) << bit)) != 0) { + // For non-IBL, We deal with FE/MCC errors separately, so ignore them here! + if (!is_ibl && bit >= 4 && bit <= 16) continue; + + num_errors[kLayer]++; + num_errors_per_bit[kLayer][bit]++; + if (kLayerIBL != 99) { + num_errors[kLayerIBL]++; + num_errors_per_bit[kLayerIBL][bit]++; + } + + int error_type = 0; + int error_cat = 0; + + if (!is_ibl) { + if (bit == 14 || bit == 15 || bit == 16) error_type = 1; // module synchronization errors (14: BCID, 15: BCID. 16: LVL1ID) + if (bit == 20 || bit == 21) error_type = 2; // ROD synchronization errors (20: BCID, 21: LVL1ID) + if (bit == 4 || bit == 12 || bit == 13) error_type = 3; // module truncation errors (4: EOC, 12: hit overflow, 13: EoE overflow) + if (bit == 0 || bit == 1) error_type = 4; // ROD truncation errors (0: FIFO Overflow, 1: H/T Limit) + if (bit == 23) error_type = 5; // optical errors (23: preamble (bitflip)) + if (bit >= 5 && bit <= 7) error_type = 6; // SEU (single event upset) errors (5,6,7: hit parity, register parity, hammingcode) + if (bit == 22) error_type = 7; // timeout errors (22: timeout on ROD formatter) + } else { + if (bit == 3 || bit == 4 || bit == 8) error_type = 1; // synchronization error (3:LVL1ID, 4:BCID, 8:BCID counter error) + if (bit == 0 || bit == 18) error_type = 3; // module truncation error (0:Row/Column error, 18:Truncated event) + if (bit == 1) error_type = 4; // ROD truncation error (1:Limit error) + if (bit == 5) error_type = 5; // optical error (5:Preable error) + if (bit == 9 || bit == 10 || bit == 11 || bit == 19 || bit == 23 || bit == 24 || bit == 26) error_type = 6; // SEU (9,10,11: hammingcode, 19:Triple redundant, 23:Bit flip, 24:SEU, 26:Triple redundant) + if (bit == 2 || bit == 7) error_type = 7; // Timeout error (2:Trailer timeout error, 7:readout timeout + } + + if (error_type) { // if there were any errors we care about + if (error_type == 1 || error_type == 2) error_cat = ErrorCategory::kSync; + if (error_type == 3 || error_type == 4) error_cat = ErrorCategory::kTrunc; + if (error_type == 5) error_cat = ErrorCategory::kOpt; + if (error_type == 6) error_cat = ErrorCategory::kSeu; + if (error_type == 7) error_cat = ErrorCategory::kTout; + + if (m_errors) m_errors->fill(error_type, WaferID, m_pixelid); + + if (m_doLumiBlock && m_errors_LB) { + m_errors_LB->fill(WaferID, m_pixelid); + } + + if (!has_err_type[error_type - 1]) { + if (m_errhist_errtype_map[error_type - 1] && !m_doOnline) { + m_errhist_errtype_map[error_type - 1]->fill(WaferID, m_pixelid); + } + num_errormodules_per_type[kLayer][error_type - 1]++; + if (kLayerIBL != 99) num_errormodules_per_type[kLayerIBL][error_type - 1]++; + has_err_type[error_type - 1] = true; + } + if (!has_err_cat[error_cat]) { + if (m_errhist_errcat_map[error_cat] && !m_doOnline) { + m_errhist_errcat_map[error_cat]->fill(WaferID, m_pixelid); + } + num_errormodules_per_cat[kLayer][error_cat]++; if (kLayerIBL != 99) { - num_errors[kLayerIBL]++; - num_errors_per_bit[kLayerIBL][bit]++; + num_errormodules_per_cat[kLayerIBL][error_cat]++; } - - int error_type = 0; - int error_cat = 0; - - if (!is_ibl) { - if (bit == 14 || bit == 15 || bit == 16) error_type = 1; // module synchronization errors (14: BCID, 15: BCID. 16: LVL1ID) - if (bit == 20 || bit == 21) error_type = 2; // ROD synchronization errors (20: BCID, 21: LVL1ID) - if (bit == 4 || bit == 12 || bit == 13) error_type = 3; // module truncation errors (4: EOC, 12: hit overflow, 13: EoE overflow) - if (bit == 0 || bit == 1) error_type = 4; // ROD truncation errors (0: FIFO Overflow, 1: H/T Limit) - if (bit == 23) error_type = 5; // optical errors (23: preamble (bitflip)) - if (bit >= 5 && bit <= 7) error_type = 6; // SEU (single event upset) errors (5,6,7: hit parity, register parity, hammingcode) - if (bit == 22) error_type = 7; // timeout errors (22: timeout on ROD formatter) - } else { - if (bit == 3 || bit == 4 || bit == 8) error_type = 1; // synchronization error (3:LVL1ID, 4:BCID, 8:BCID counter error) - if (bit == 0 || bit == 18) error_type = 3; // module truncation error (0:Row/Column error, 18:Truncated event) - if (bit == 1) error_type = 4; // ROD truncation error (1:Limit error) - if (bit == 5) error_type = 5; // optical error (5:Preable error) - if (bit == 9 || bit == 10 || bit == 11 || bit == 19 || bit == 23 || bit == 24 || bit == 26) error_type = 6; // SEU (9,10,11: hammingcode, 19:Triple redundant, 23:Bit flip, 24:SEU, 26:Triple redundant) - if (bit == 2 || bit == 7) error_type = 7; // Timeout error (2:Trailer timeout error, 7:readout timeout + has_err_cat[error_cat] = true; + } + + if (bit == 4) { // EoC trunc error + int fephi = 0; + int feeta = 0; + if (kLayer == PixLayer::kB0 && getFEID(kLayer, m_pixelid->phi_index(WaferID), m_pixelid->eta_index(WaferID), fephi, feeta)) { + num_errorFEs_B0[m_pixelid->phi_module(WaferID)][(int)(fabs(6 + m_pixelid->eta_module(WaferID)))][(int)((8 * fephi) + feeta)] = 1; } - - if (error_type) { //if there were any errors we care about - if (error_type == 1 || error_type == 2) error_cat = ErrorCategory::kSync; - if (error_type == 3 || error_type == 4) error_cat = ErrorCategory::kTrunc; - if (error_type == 5) error_cat = ErrorCategory::kOpt; - if (error_type == 6) error_cat = ErrorCategory::kSeu; - if (error_type == 7) error_cat = ErrorCategory::kTout; - - if (m_errors) m_errors->Fill(error_type, WaferID, m_pixelid); - - if (m_doLumiBlock && m_errors_LB) { - m_errors_LB->Fill(WaferID, m_pixelid); - } - - if (!has_err_type[error_type-1]) { - if (m_errhist_errtype_map[error_type-1] && !m_doOnline) { - m_errhist_errtype_map[error_type-1]->Fill(WaferID, m_pixelid); - } - num_errormodules_per_type[kLayer][error_type-1]++; - if (kLayerIBL != 99) num_errormodules_per_type[kLayerIBL][error_type-1]++; - has_err_type[error_type-1] = true; - } - if (!has_err_cat[error_cat]) { - if (m_errhist_errcat_map[error_cat] && !m_doOnline) { - m_errhist_errcat_map[error_cat]->Fill(WaferID, m_pixelid); - } - num_errormodules_per_cat[kLayer][error_cat]++; - if (kLayerIBL != 99) { - num_errormodules_per_cat[kLayerIBL][error_cat]++; - } - has_err_cat[error_cat] = true; - } - - if (bit == 4) { /// EoC trunc error - int fephi = 0; - int feeta = 0; - if (kLayer == PixLayer::kB0 && GetFEID(kLayer, m_pixelid->phi_index(WaferID), m_pixelid->eta_index(WaferID), fephi, feeta)) { - num_errorFEs_B0[m_pixelid->phi_module(WaferID)][(int)(fabs(6+m_pixelid->eta_module(WaferID)))][(int)((8*fephi)+feeta)] = 1; - } - if (kLayer == PixLayer::kB1 && GetFEID(kLayer, m_pixelid->phi_index(WaferID), m_pixelid->eta_index(WaferID), fephi, feeta)) { - num_errorFEs_B1[m_pixelid->phi_module(WaferID)][(int)(fabs(6+m_pixelid->eta_module(WaferID)))][(int)((8*fephi)+feeta)] = 1; - } - if (kLayer == PixLayer::kB2 && GetFEID(kLayer, m_pixelid->phi_index(WaferID), m_pixelid->eta_index(WaferID), fephi, feeta)) { - num_errorFEs_B2[m_pixelid->phi_module(WaferID)][(int)(fabs(6+m_pixelid->eta_module(WaferID)))][(int)((8*fephi)+feeta)] = 1; - } - if (kLayer == PixLayer::kECA && GetFEID(kLayer, m_pixelid->phi_index(WaferID), m_pixelid->eta_index(WaferID), fephi, feeta)) { - num_errorFEs_EA[m_pixelid->phi_module(WaferID)][(int)m_pixelid->layer_disk(WaferID)][(int)((8*fephi)+feeta)] = 1; - } - if (kLayer == PixLayer::kECC && GetFEID(kLayer, m_pixelid->phi_index(WaferID), m_pixelid->eta_index(WaferID), fephi, feeta)) { - num_errorFEs_EC[m_pixelid->phi_module(WaferID)][(int)m_pixelid->layer_disk(WaferID)][(int)((8*fephi)+feeta)] = 1; - } - } - } // End of if(error_type) - - if (getErrorState(bit, is_ibl) != 99) { - num_errors_per_state[kLayer][getErrorState(bit, is_ibl)]++; - num_errors_per_stateIBL[getErrorState(bit, is_ibl)]++; - if (m_errhist_expert_maps[getErrorState(bit, is_ibl)]) - m_errhist_expert_maps[getErrorState(bit, is_ibl)]->Fill(WaferID, m_pixelid); - if (m_errhist_expert_LB_maps[getErrorState(bit, is_ibl)]) - m_errhist_expert_LB_maps[getErrorState(bit, is_ibl)]->Fill(kLumiBlock, WaferID, m_pixelid, 1); + if (kLayer == PixLayer::kB1 && getFEID(kLayer, m_pixelid->phi_index(WaferID), m_pixelid->eta_index(WaferID), fephi, feeta)) { + num_errorFEs_B1[m_pixelid->phi_module(WaferID)][(int)(fabs(6 + m_pixelid->eta_module(WaferID)))][(int)((8 * fephi) + feeta)] = 1; } - - if (kLayer == PixLayer::kIBL) { - if (m_errhist_expert_servrec_ibl_unweighted) m_errhist_expert_servrec_ibl_unweighted->Fill(bit); - if (m_errhist_expert_servrec_ibl_weighted) m_errhist_expert_servrec_ibl_weighted->Fill(bit, m_ErrorSvc->getServiceRecordCount(bit)); - if (m_errhist_expert_servrec_ibl_count) m_errhist_expert_servrec_ibl_count->Fill(m_ErrorSvc->getServiceRecordCount(bit)); + if (kLayer == PixLayer::kB2 && getFEID(kLayer, m_pixelid->phi_index(WaferID), m_pixelid->eta_index(WaferID), fephi, feeta)) { + num_errorFEs_B2[m_pixelid->phi_module(WaferID)][(int)(fabs(6 + m_pixelid->eta_module(WaferID)))][(int)((8 * fephi) + feeta)] = 1; } - } //end bit shifting - } //end for loop over bits - - unsigned int num_femcc_errwords = 0; - - // Do the same bit-shifting again, this time for FE/MCC error words. - if (!is_ibl && kFeErrorWords.find(id_hash) != kFeErrorWords.end()) { - // Collection of: FE ID, associated error word - std::map<unsigned int, unsigned int> fe_errorword_map = kFeErrorWords.find(id_hash)->second; - if (fe_errorword_map.size() > 0) { - num_femcc_errwords = fe_errorword_map.size(); - } - - for (const auto& map_entry : fe_errorword_map) { - const auto& fe_errorword = map_entry.second; - - for (int bit = 0; bit < kNumErrorBits; ++bit) { - if ((fe_errorword & (static_cast<uint64_t>(1) << bit)) != 0) { - // FE Error word contains 'bit', so take appropriate actions. - num_errors[kLayer]++; - num_errors_per_bit[kLayer][bit]++; - - int error_type = 0; // same definitions as above - int error_cat = 0; // same definitions as above - - if (bit == 14 || bit == 15 || bit == 16) error_type = 1; - if (bit == 4 || bit == 12 || bit == 13) error_type = 3; - if (bit >= 5 && bit <= 7) error_type = 6; - - if (error_type) { // if there were any errors we care about - if (error_type == 1) error_cat = ErrorCategory::kSync; - if (error_type == 3) error_cat = ErrorCategory::kTrunc; - if (error_type == 6) error_cat = ErrorCategory::kSeu; - - if (m_errors) m_errors->Fill(error_type, WaferID, m_pixelid); - - if (m_doLumiBlock && m_errors_LB) { - m_errors_LB->Fill(WaferID, m_pixelid); - } - - // Should this stay the same? This counts '1' for errors, - // regardless of how many FEs have that error type. - if (!has_err_type[error_type-1]) { - if (m_errhist_errtype_map[error_type-1] && !m_doOnline) { - m_errhist_errtype_map[error_type-1]->Fill(WaferID, m_pixelid); - } - num_errormodules_per_type[kLayer][error_type-1]++; - if (kLayerIBL != 99) num_errormodules_per_type[kLayerIBL][error_type-1]++; - has_err_type[error_type-1] = true; - } - if (!has_err_cat[error_cat]) { - if (m_errhist_errcat_map[error_cat] && !m_doOnline) { - m_errhist_errcat_map[error_cat]->Fill(WaferID, m_pixelid); - } - num_errormodules_per_cat[kLayer][error_cat]++; - if (kLayerIBL != 99) { - num_errormodules_per_cat[kLayerIBL][error_cat]++; - } - has_err_cat[error_cat] = true; - } - } - - if (getErrorState(bit, is_ibl) != 99) { - num_errors_per_state[kLayer][getErrorState(bit, is_ibl)]++; - if (m_errhist_expert_maps[getErrorState(bit, is_ibl)]) - m_errhist_expert_maps[getErrorState(bit, is_ibl)]->Fill(WaferID, m_pixelid); - if (m_errhist_expert_LB_maps[getErrorState(bit, is_ibl)]) - m_errhist_expert_LB_maps[getErrorState(bit, is_ibl)]->Fill(kLumiBlock, WaferID, m_pixelid, 1); - } - } // end bit shifting - } // end for loop over bits - } // end loop over FE error words - } - - m_errhist_femcc_errwords_map->Fill(WaferID, m_pixelid, num_femcc_errwords); - - if (m_doLumiBlock) { - if (m_errors_ModSync_mod && has_err_type[0]) - m_errors_ModSync_mod->Fill(WaferID, m_pixelid); - if (m_errors_RODSync_mod && has_err_type[1]) - m_errors_RODSync_mod->Fill(WaferID, m_pixelid); + if (kLayer == PixLayer::kECA && getFEID(kLayer, m_pixelid->phi_index(WaferID), m_pixelid->eta_index(WaferID), fephi, feeta)) { + num_errorFEs_EA[m_pixelid->phi_module(WaferID)][(int)m_pixelid->layer_disk(WaferID)][(int)((8 * fephi) + feeta)] = 1; + } + if (kLayer == PixLayer::kECC && getFEID(kLayer, m_pixelid->phi_index(WaferID), m_pixelid->eta_index(WaferID), fephi, feeta)) { + num_errorFEs_EC[m_pixelid->phi_module(WaferID)][(int)m_pixelid->layer_disk(WaferID)][(int)((8 * fephi) + feeta)] = 1; + } + } + } // End of if(error_type) + + if (getErrorState(bit, is_ibl) != 99) { + num_errors_per_state[kLayer][getErrorState(bit, is_ibl)]++; + num_errors_per_stateIBL[getErrorState(bit, is_ibl)]++; + if (m_errhist_expert_maps[getErrorState(bit, is_ibl)]) m_errhist_expert_maps[getErrorState(bit, is_ibl)]->fill(WaferID, m_pixelid); + if (m_errhist_expert_LB_maps[getErrorState(bit, is_ibl)]) m_errhist_expert_LB_maps[getErrorState(bit, is_ibl)]->fill(kLumiBlock, WaferID, m_pixelid, 1); + } + + if (kLayer == PixLayer::kIBL) { + if (m_errhist_expert_servrec_ibl_unweighted) m_errhist_expert_servrec_ibl_unweighted->Fill(bit); + if (m_errhist_expert_servrec_ibl_weighted) m_errhist_expert_servrec_ibl_weighted->Fill(bit, m_ErrorSvc->getServiceRecordCount(bit)); + if (m_errhist_expert_servrec_ibl_count) m_errhist_expert_servrec_ibl_count->Fill(m_ErrorSvc->getServiceRecordCount(bit)); + } + } // end bit shifting + } // end for loop over bits + + unsigned int num_femcc_errwords = 0; + + // Do the same bit-shifting again, this time for FE/MCC error words. + if (!is_ibl && kFeErrorWords.find(id_hash) != kFeErrorWords.end()) { + // Collection of: FE ID, associated error word + std::map<unsigned int, unsigned int> fe_errorword_map = kFeErrorWords.find(id_hash)->second; + if (fe_errorword_map.size() > 0) { + num_femcc_errwords = fe_errorword_map.size(); } - } //end loop over all identifiers + for (const auto& map_entry : fe_errorword_map) { + const auto& fe_errorword = map_entry.second; - double total_errors = 0; - for (int i = 0; i < PixLayerIBL2D3D::COUNT; i++) total_errors += num_errors[i]; - if (m_error_time1 && m_error_time2 && m_error_time3) { - FillTimeHisto(total_errors, m_error_time1, m_error_time2, m_error_time3, 10., 60., 360.); - } + for (int bit = 0; bit < kNumErrorBits; ++bit) { + if ((fe_errorword & (static_cast<uint64_t>(1) << bit)) != 0) { + // FE Error word contains 'bit', so take appropriate actions. + num_errors[kLayer]++; + num_errors_per_bit[kLayer][bit]++; - for (int i = 0; i < PixLayer::COUNT - 1; i++) { - for (int j = 0; j < kNumErrorStates; j++) { - if (m_errhist_expert_LB[i][j]) { - m_errhist_expert_LB[i][j]->Fill(kLumiBlock, (float) num_errors_per_state[i][j]/m_nActive_mod[i]); - } - } - } + int error_type = 0; // same definitions as above + int error_cat = 0; // same definitions as above + + if (bit == 14 || bit == 15 || bit == 16) error_type = 1; + if (bit == 4 || bit == 12 || bit == 13) error_type = 3; + if (bit >= 5 && bit <= 7) error_type = 6; + + if (error_type) { // if there were any errors we care about + if (error_type == 1) error_cat = ErrorCategory::kSync; + if (error_type == 3) error_cat = ErrorCategory::kTrunc; + if (error_type == 6) error_cat = ErrorCategory::kSeu; + + if (m_errors) m_errors->fill(error_type, WaferID, m_pixelid); + + if (m_doLumiBlock && m_errors_LB) { + m_errors_LB->fill(WaferID, m_pixelid); + } + + // Should this stay the same? This counts '1' for errors, + // regardless of how many FEs have that error type. + if (!has_err_type[error_type - 1]) { + if (m_errhist_errtype_map[error_type - 1] && !m_doOnline) { + m_errhist_errtype_map[error_type - 1]->fill(WaferID, m_pixelid); + } + num_errormodules_per_type[kLayer][error_type - 1]++; + if (kLayerIBL != 99) num_errormodules_per_type[kLayerIBL][error_type - 1]++; + has_err_type[error_type - 1] = true; + } + if (!has_err_cat[error_cat]) { + if (m_errhist_errcat_map[error_cat] && !m_doOnline) { + m_errhist_errcat_map[error_cat]->fill(WaferID, m_pixelid); + } + num_errormodules_per_cat[kLayer][error_cat]++; + if (kLayerIBL != 99) { + num_errormodules_per_cat[kLayerIBL][error_cat]++; + } + has_err_cat[error_cat] = true; + } + } - for (int j = 0; j < kNumErrorStatesIBL; j++) { - if (m_errhist_expert_IBL_LB[j]) { - m_errhist_expert_IBL_LB[j]->Fill(kLumiBlock, (float) num_errors_per_stateIBL[j]/m_nActive_mod[PixLayerIBL2D3D::kIBL]); + if (getErrorState(bit, is_ibl) != 99) { + num_errors_per_state[kLayer][getErrorState(bit, is_ibl)]++; + if (m_errhist_expert_maps[getErrorState(bit, is_ibl)]) m_errhist_expert_maps[getErrorState(bit, is_ibl)]->fill(WaferID, m_pixelid); + if (m_errhist_expert_LB_maps[getErrorState(bit, is_ibl)]) m_errhist_expert_LB_maps[getErrorState(bit, is_ibl)]->fill(kLumiBlock, WaferID, m_pixelid, 1); + } + } // end bit shifting + } // end for loop over bits + } // end loop over FE error words + } + + m_errhist_femcc_errwords_map->fill(WaferID, m_pixelid, num_femcc_errwords); + + if (m_doLumiBlock) { + if (m_errors_ModSync_mod && has_err_type[0]) m_errors_ModSync_mod->fill(WaferID, m_pixelid); + if (m_errors_RODSync_mod && has_err_type[1]) m_errors_RODSync_mod->fill(WaferID, m_pixelid); + } + } // end loop over all identifiers + + double total_errors = 0; + for (int i = 0; i < PixLayerIBL2D3D::COUNT; i++) { + total_errors += num_errors[i]; + } + if (m_error_time1 && m_error_time2 && m_error_time3) { + fillTimeHisto(total_errors, m_error_time1, m_error_time2, m_error_time3, 10., 60., 360.); + } + + for (int i = 0; i < PixLayer::COUNT - 1; i++) { + for (int j = 0; j < kNumErrorStates; j++) { + if (m_errhist_expert_LB[i][j]) { + m_errhist_expert_LB[i][j]->Fill(kLumiBlock, (float)num_errors_per_state[i][j] / m_nActive_mod[i]); } - } - - for (int i = 0; i < PixLayerIBL2D3D::COUNT; i++) { - if (m_errhist_per_bit_LB[i] && m_nActive_mod[i] > 0) { - for (int j = 0; j < kNumErrorBits; j++) { - m_errhist_per_bit_LB[i]->Fill(kLumiBlock, j, (float) num_errors_per_bit[i][j]/m_nActive_mod[i]); - } + } + } + + for (int j = 0; j < kNumErrorStatesIBL; j++) { + if (m_errhist_expert_IBL_LB[j]) { + m_errhist_expert_IBL_LB[j]->Fill(kLumiBlock, (float)num_errors_per_stateIBL[j] / m_nActive_mod[PixLayerIBL2D3D::kIBL]); + } + } + + for (int i = 0; i < PixLayerIBL2D3D::COUNT; i++) { + if (m_errhist_per_bit_LB[i] && m_nActive_mod[i] > 0) { + for (int j = 0; j < kNumErrorBits; j++) { + m_errhist_per_bit_LB[i]->Fill(kLumiBlock, j, (float)num_errors_per_bit[i][j] / m_nActive_mod[i]); } - if (m_errhist_per_type_LB[i] && m_nActive_mod[i] > 0) { - for (int j = 0; j < ErrorCategoryMODROD::COUNT; j++) { - m_errhist_per_type_LB[i]->Fill(kLumiBlock, j, (float) num_errormodules_per_type[i][j]/m_nActive_mod[i]); - } + } + if (m_errhist_per_type_LB[i] && m_nActive_mod[i] > 0) { + for (int j = 0; j < ErrorCategoryMODROD::COUNT; j++) { + m_errhist_per_type_LB[i]->Fill(kLumiBlock, j, (float)num_errormodules_per_type[i][j] / m_nActive_mod[i]); } - } + } + } + for (int i = 0; i < PixLayerIBL2D3D::COUNT; i++) { + if (m_errhist_tot_LB[i]) m_errhist_tot_LB[i]->Fill(kLumiBlock, num_errors[i]); - for (int i = 0; i < PixLayerIBL2D3D::COUNT; i++) { - if (m_errhist_tot_LB[i]) m_errhist_tot_LB[i]->Fill(kLumiBlock, num_errors[i]); + for (int j = 0; j < ErrorCategory::COUNT; ++j) { + if (m_errhist_errcat_LB[i][j]) m_errhist_errcat_LB[i][j]->Fill(kLumiBlock, num_errormodules_per_cat[i][j]); + } - for (int j = 0; j < ErrorCategory::COUNT; ++j) { - if (m_errhist_errcat_LB[i][j]) m_errhist_errcat_LB[i][j]->Fill(kLumiBlock, num_errormodules_per_cat[i][j]); - } - - for (int j = 0; j < ErrorCategoryMODROD::COUNT - 3; ++j) { - if (m_errhist_errtype_LB[i][j]) m_errhist_errtype_LB[i][j]->Fill(kLumiBlock, num_errormodules_per_type[i][j]); - } + for (int j = 0; j < ErrorCategoryMODROD::COUNT - 3; ++j) { + if (m_errhist_errtype_LB[i][j]) m_errhist_errtype_LB[i][j]->Fill(kLumiBlock, num_errormodules_per_type[i][j]); + } - for (int j = 0; j < ErrorCategory::COUNT; j++) { - if (m_errhist_errcat_avg[j][i] && m_nActive_mod[i] > 0) { - m_errhist_errcat_avg[j][i]->Fill(kLumiBlock, (float) num_errormodules_per_cat[i][j]/m_nActive_mod[i]); - } + for (int j = 0; j < ErrorCategory::COUNT; j++) { + if (m_errhist_errcat_avg[j][i] && m_nActive_mod[i] > 0) { + m_errhist_errcat_avg[j][i]->Fill(kLumiBlock, (float)num_errormodules_per_cat[i][j] / m_nActive_mod[i]); } - for (int j = 0; j < ErrorCategoryMODROD::COUNT - 3; j++) { - if (m_errhist_errtype_avg[j][i] && m_nActive_mod[i] > 0) { - m_errhist_errtype_avg[j][i]->Fill(kLumiBlock, (float) num_errormodules_per_type[i][j]/m_nActive_mod[i]); - } + } + for (int j = 0; j < ErrorCategoryMODROD::COUNT - 3; j++) { + if (m_errhist_errtype_avg[j][i] && m_nActive_mod[i] > 0) { + m_errhist_errtype_avg[j][i]->Fill(kLumiBlock, (float)num_errormodules_per_type[i][j] / m_nActive_mod[i]); } - } - if (m_errhist_syncerr_LB_pix) { - m_errhist_syncerr_LB_pix->Fill(kLumiBlock, num_errormodules_per_cat[PixLayerIBL2D3D::kB0][ErrorCategory::kSync] - + num_errormodules_per_cat[PixLayerIBL2D3D::kB1][ErrorCategory::kSync] - + num_errormodules_per_cat[PixLayerIBL2D3D::kB2][ErrorCategory::kSync]); - } - - for (int i = 0; i < PixLayer::COUNT; i++) { - for (int phi = 0; phi < kNumModulesPhi[i]; phi++) { - for (int eta = 0; eta < kNumModulesEta[i]; eta++) { - int nfes = 0; - for (int j = 0; j < kNumFEs; j++) { - if (i == PixLayer::kECA) nfes += num_errorFEs_EA[phi][eta][j]; - if (i == PixLayer::kECC) nfes += num_errorFEs_EC[phi][eta][j]; - if (i == PixLayer::kB0) nfes += num_errorFEs_B0[phi][eta][j]; - if (i == PixLayer::kB1) nfes += num_errorFEs_B1[phi][eta][j]; - if (i == PixLayer::kB2) nfes += num_errorFEs_B2[phi][eta][j]; - } - if (m_errhist_expert_fe_trunc_err_3d[i]) m_errhist_expert_fe_trunc_err_3d[i]->Fill(m_manager->lumiBlockNumber(), eta, nfes); - } + } + } + if (m_errhist_syncerr_LB_pix) { + m_errhist_syncerr_LB_pix->Fill(kLumiBlock, num_errormodules_per_cat[PixLayerIBL2D3D::kB0][ErrorCategory::kSync] + + num_errormodules_per_cat[PixLayerIBL2D3D::kB1][ErrorCategory::kSync] + + num_errormodules_per_cat[PixLayerIBL2D3D::kB2][ErrorCategory::kSync]); + } + + for (int i = 0; i < PixLayer::COUNT; i++) { + for (int phi = 0; phi < kNumModulesPhi[i]; phi++) { + for (int eta = 0; eta < kNumModulesEta[i]; eta++) { + int nfes = 0; + for (int j = 0; j < kNumFEs; j++) { + if (i == PixLayer::kECA) nfes += num_errorFEs_EA[phi][eta][j]; + if (i == PixLayer::kECC) nfes += num_errorFEs_EC[phi][eta][j]; + if (i == PixLayer::kB0) nfes += num_errorFEs_B0[phi][eta][j]; + if (i == PixLayer::kB1) nfes += num_errorFEs_B1[phi][eta][j]; + if (i == PixLayer::kB2) nfes += num_errorFEs_B2[phi][eta][j]; + } + if (m_errhist_expert_fe_trunc_err_3d[i]) m_errhist_expert_fe_trunc_err_3d[i]->Fill(m_manager->lumiBlockNumber(), eta, nfes); } - } + } + } - return StatusCode::SUCCESS; + return StatusCode::SUCCESS; } -double PixelMainMon::getErrorBitFraction(const Identifier& WaferID, const unsigned int& num_femcc_errwords) -{ - // Do an estimation of the bit fraction consumed by FE/MCC error words in the - // MCC output. Simplifications: hits are distributed uniformly on all FEs, - // errors only occur on FEs with hits. Without these simplifications, we - // would have to consider the FE ID bit blocks (8 bits) more carefully. - // - // The assumed bit lengths are: - // - 45 bits for event ID, header, trailer - // - 9 bits for each FE ID. If more than 16 hits:, count 16 FE ID blocks; - // otherwise calculate max(number of hits, number of error words). - // - 22 bits for each hit word - // - 22 bits for each error word - const int layer = GetPixLayerID(m_pixelid->barrel_ec(WaferID), m_pixelid->layer_disk(WaferID), m_doIBL); - if (layer == PixLayer::kIBL) return 0.; - - unsigned int num_hits = 0; - if (layer == PixLayer::kB0) { - num_hits = m_HitPerEventArray_l0[m_pixelid->phi_module(WaferID)][static_cast<int>(fabs(6+m_pixelid->eta_module(WaferID)))]; - } else if (layer == PixLayer::kB1) { - num_hits = m_HitPerEventArray_l1[m_pixelid->phi_module(WaferID)][static_cast<int>(fabs(6+m_pixelid->eta_module(WaferID)))]; - } else if (layer == PixLayer::kB2) { - num_hits = m_HitPerEventArray_l2[m_pixelid->phi_module(WaferID)][static_cast<int>(fabs(6+m_pixelid->eta_module(WaferID)))]; - } else if (layer == PixLayer::kECA) { - num_hits = m_HitPerEventArray_disksA[m_pixelid->phi_module(WaferID)][static_cast<int>(fabs(6+m_pixelid->eta_module(WaferID)))]; - } else if (layer == PixLayer::kECC) { - num_hits = m_HitPerEventArray_disksC[m_pixelid->phi_module(WaferID)][static_cast<int>(fabs(6+m_pixelid->eta_module(WaferID)))]; - } - - int total_bits = 45; - if (num_hits >= 16) { - total_bits += 16 * 9; - } else { - total_bits += std::max(num_hits, num_femcc_errwords) * 9; - } - total_bits += num_hits * 22; - total_bits += num_femcc_errwords * 22; - return static_cast<double>(num_femcc_errwords * 22 / total_bits); +double PixelMainMon::getErrorBitFraction(const Identifier& WaferID, const unsigned int& num_femcc_errwords) { + // Do an estimation of the bit fraction consumed by FE/MCC error words in the + // MCC output. Simplifications: hits are distributed uniformly on all FEs, + // errors only occur on FEs with hits. Without these simplifications, we + // would have to consider the FE ID bit blocks (8 bits) more carefully. + // + // The assumed bit lengths are: + // - 45 bits for event ID, header, trailer + // - 9 bits for each FE ID. If more than 16 hits:, count 16 FE ID blocks; + // otherwise calculate max(number of hits, number of error words). + // - 22 bits for each hit word + // - 22 bits for each error word + const int layer = getPixLayerID(m_pixelid->barrel_ec(WaferID), m_pixelid->layer_disk(WaferID), m_doIBL); + if (layer == PixLayer::kIBL) return 0.; + + unsigned int num_hits = 0; + if (layer == PixLayer::kB0) { + num_hits = m_HitPerEventArray_l0[m_pixelid->phi_module(WaferID)][static_cast<int>(fabs(6 + m_pixelid->eta_module(WaferID)))]; + } else if (layer == PixLayer::kB1) { + num_hits = m_HitPerEventArray_l1[m_pixelid->phi_module(WaferID)][static_cast<int>(fabs(6 + m_pixelid->eta_module(WaferID)))]; + } else if (layer == PixLayer::kB2) { + num_hits = m_HitPerEventArray_l2[m_pixelid->phi_module(WaferID)][static_cast<int>(fabs(6 + m_pixelid->eta_module(WaferID)))]; + } else if (layer == PixLayer::kECA) { + num_hits = m_HitPerEventArray_disksA[m_pixelid->phi_module(WaferID)][static_cast<int>(fabs(6 + m_pixelid->eta_module(WaferID)))]; + } else if (layer == PixLayer::kECC) { + num_hits = m_HitPerEventArray_disksC[m_pixelid->phi_module(WaferID)][static_cast<int>(fabs(6 + m_pixelid->eta_module(WaferID)))]; + } + + int total_bits = 45; + if (num_hits >= 16) { + total_bits += 16 * 9; + } else { + total_bits += std::max(num_hits, num_femcc_errwords) * 9; + } + total_bits += num_hits * 22; + total_bits += num_femcc_errwords * 22; + return static_cast<double>(num_femcc_errwords * 22 / total_bits); } -int PixelMainMon::getErrorState(int bit, bool isibl) -{ - int erstate = 99; - if (!isibl) { - switch (bit) { - case 14: - erstate = 0; break; - case 15: - erstate = 1; break; - case 16: - erstate = 2; break; - case 20: - erstate = 3; break; - case 21: - erstate = 4; break; - case 4: - erstate = 5; break; - case 12: - erstate = 6; break; - case 13: - erstate = 7; break; - case 1: - erstate = 8; break; - case 0: - erstate = 9; break; - case 23: - erstate = 10; break; - case 5: - erstate = 11; break; - case 6: - erstate = 12; break; - case 7: - erstate = 13; break; - case 22: - erstate = 14; break; - case 8: - erstate = 15; break; - default: - erstate = 99; break; - } - } - else { - switch (bit) { - case 3: - erstate = 16; break; // BCID, Synch - case 4: - erstate = 17; break; // LVL1ID, Synch - case 8: - erstate = 18; break; // BCID counter, Synch - case 12: - erstate = 19; break; // L1 trigger input in EODCL counter (write pointer), Synch - case 13: - erstate = 20; break; // L1 trigger request counter to EODCL (read pointer), Synch - case 14: - erstate = 21; break; // L1 register, register is full, Synch - case 15: - erstate = 22; break; // L1 trigger ID in BC register, Synch - case 17: - erstate = 23; break; // Skipped trigger because the L1 register is full, Synch - case 0: - erstate = 24; break; // Row/Column, Trunc - case 18: - erstate = 25; break; // Truncated event, Trunc - case 1: - erstate = 26; break; // Limit error ROD, Trunc - case 5: - erstate = 27; break; // Preamble error, Optical - case 9: - erstate = 28; break; // Hamming code in word 0 in EOCHL, SEU - case 10: - erstate = 29; break; // Hamming code in word 1 in EOCHL, SEU - case 11: - erstate = 30; break; // Hamming code in word 2 in EOCHL, SEU - case 19: - erstate = 31; break; // Triple redundant mismatch in Global Configuration Memory (CNFGMEM,) SEU - case 23: - erstate = 32; break; // Bit flip in CMD, SEU - case 24: - erstate = 33; break; // Triple redundant mismatch in CMD, SEU - case 26: - erstate = 34; break; // Triple redundant mismatch in EFUSE, SEU - case 2: - erstate = 35; break; // Trailer timeout, Timeout - case 7: - erstate = 36; break; // Timeout ROD, Timeout - case 6: - erstate = 37; break; // Masked link - case 16: - erstate = 38; break; // FE readout process error - case 20: - erstate = 39; break; // Write register data error - case 21: - erstate = 40; break; // Address error - case 22: - erstate = 41; break; // Other CMD decoder error - case 25: - erstate = 42; break; // Data bus address - default: - erstate = 99; break; - } - } - - return erstate; +int PixelMainMon::getErrorState(int bit, bool isibl) { + int erstate = 99; + if (!isibl) { + switch (bit) { + case 14: + erstate = 0; + break; + case 15: + erstate = 1; + break; + case 16: + erstate = 2; + break; + case 20: + erstate = 3; + break; + case 21: + erstate = 4; + break; + case 4: + erstate = 5; + break; + case 12: + erstate = 6; + break; + case 13: + erstate = 7; + break; + case 1: + erstate = 8; + break; + case 0: + erstate = 9; + break; + case 23: + erstate = 10; + break; + case 5: + erstate = 11; + break; + case 6: + erstate = 12; + break; + case 7: + erstate = 13; + break; + case 22: + erstate = 14; + break; + case 8: + erstate = 15; + break; + default: + erstate = 99; + break; + } + } else { + switch (bit) { + case 3: + erstate = 16; // BCID, Synch + break; + case 4: + erstate = 17; // LVL1ID, Synch + break; + case 8: + erstate = 18; // BCID counter, Synch + break; + case 12: + erstate = 19; // L1 trigger input in EODCL counter (write pointer), Synch + break; + case 13: + erstate = 20; // L1 trigger request counter to EODCL (read pointer), Synch + break; + case 14: + erstate = 21; // L1 register, register is full, Synch + break; + case 15: + erstate = 22; // L1 trigger ID in BC register, Synch + break; + case 17: + erstate = 23; // Skipped trigger because the L1 register is full, Synch + break; + case 0: + erstate = 24; // Row/Column, Trunc + break; + case 18: + erstate = 25; // Truncated event, Trunc + break; + case 1: + erstate = 26; // Limit error ROD, Trunc + break; + case 5: + erstate = 27; // Preamble error, Optical + break; + case 9: + erstate = 28; // Hamming code in word 0 in EOCHL, SEU + break; + case 10: + erstate = 29; // Hamming code in word 1 in EOCHL, SEU + break; + case 11: + erstate = 30; // Hamming code in word 2 in EOCHL, SEU + break; + case 19: + erstate = 31; // Triple redundant mismatch in Global Configuration Memory (CNFGMEM,) SEU + break; + case 23: + erstate = 32; // Bit flip in CMD, SEU + break; + case 24: + erstate = 33; // Triple redundant mismatch in CMD, SEU + break; + case 26: + erstate = 34; // Triple redundant mismatch in EFUSE, SEU + break; + case 2: + erstate = 35; // Trailer timeout, Timeout + break; + case 7: + erstate = 36; // Timeout ROD, Timeout + break; + case 6: + erstate = 37; // Masked link + break; + case 16: + erstate = 38; // FE readout process error + break; + case 20: + erstate = 39; // Write register data error + break; + case 21: + erstate = 40; // Address error + break; + case 22: + erstate = 41; // Other CMD decoder error + break; + case 25: + erstate = 42; // Data bus address + break; + default: + erstate = 99; + break; + } + } + + return erstate; } - diff --git a/InnerDetector/InDetMonitoring/PixelMonitoring/src/HelperFunctions.cxx b/InnerDetector/InDetMonitoring/PixelMonitoring/src/HelperFunctions.cxx index a7fab828199a05528922e292053bb438e2191910..0cbf0fab10b8a881727b65343661442d65bb4e2c 100644 --- a/InnerDetector/InDetMonitoring/PixelMonitoring/src/HelperFunctions.cxx +++ b/InnerDetector/InDetMonitoring/PixelMonitoring/src/HelperFunctions.cxx @@ -6,496 +6,408 @@ // Helper functions used by other methods /////////////////////////////////////////////////////////////////////////////// +#include <algorithm> +#include <sstream> +#include <vector> +#include "InDetIdentifier/PixelID.h" +#include "LWHists/TH1F_LW.h" +#include "LWHists/TH1I_LW.h" +#include "LWHists/TH2F_LW.h" +#include "LWHists/TH2I_LW.h" #include "PixelMonitoring/PixelMainMon.h" -#include "TString.h" +#include "PixelMonitoring/PixelMon2DMapsLW.h" #include "TH1I.h" #include "TH2I.h" -#include "LWHists/TH1I_LW.h" -#include "LWHists/TH2I_LW.h" -#include "LWHists/TH1F_LW.h" -#include "LWHists/TH2F_LW.h" #include "TProfile2D.h" -#include <vector> -#include <sstream> -#include <algorithm> -#include "InDetIdentifier/PixelID.h" -#include "PixelMonitoring/PixelMon2DMapsLW.h" - +#include "TString.h" -std::string PixelMainMon :: makeHistname(std::string set, bool ontrk) -{ - std::string name = set; - if( ontrk && m_doOnTrack ) name += "_OnTrack"; - return name; +std::string PixelMainMon::makeHistname(std::string set, bool ontrk) { + std::string name = set; + if (ontrk && m_doOnTrack) name += "_OnTrack"; + return name; } -std::string PixelMainMon :: makeHisttitle(std::string set, std::string axis, bool ontrk) -{ - std::string name = set; - if( ontrk && m_doOnTrack ) name += "_OnTrack"; - name = name + m_histTitleExt + axis; - return name; +std::string PixelMainMon::makeHisttitle(std::string set, std::string axis, bool ontrk) { + std::string name = set; + if (ontrk && m_doOnTrack) name += "_OnTrack"; + name = name + m_histTitleExt + axis; + return name; } -int PixelMainMon :: GetPixLayerID(int ec, int ld, bool ibl) -{ - int layer = 99; - if(ec==2) layer = PixLayer::kECA; - else if(ec==-2) layer = PixLayer::kECC; - else if(ec==0) { - if(ibl && ld==0) layer = PixLayer::kIBL; - if(ld==0+ibl) layer = PixLayer::kB0; - if(ld==1+ibl) layer = PixLayer::kB1; - if(ld==2+ibl) layer = PixLayer::kB2; - }else{ - if( ec == 4 || ec == -4){ - //std::cout << "[GetPixLayerID] layer == +- 4 : DBM!!" << std::endl; - } - //std::cout << "[ERROR: GetPixLayerID] layer == 99!!" << std::endl; - } - return layer; +int PixelMainMon::getPixLayerID(int ec, int ld, bool ibl) { + int layer = 99; + if (ec == 2) { + layer = PixLayer::kECA; + } else if (ec == -2) { + layer = PixLayer::kECC; + } else if (ec == 0) { + if (ibl && ld == 0) layer = PixLayer::kIBL; + if (ld == 0 + ibl) layer = PixLayer::kB0; + if (ld == 1 + ibl) layer = PixLayer::kB1; + if (ld == 2 + ibl) layer = PixLayer::kB2; + } + return layer; } -int PixelMainMon :: GetPixLayerIDDBM(int ec, int ld, bool ibl) -{ - int layer = 99; - if(ec==2) layer = PixLayerDBM::kECA; - else if(ec==-2) layer = PixLayerDBM::kECC; - else if(ec==0) { - if(ibl && ld==0) layer = PixLayerDBM::kIBL; - if(ld==0+ibl) layer = PixLayerDBM::kB0; - if(ld==1+ibl) layer = PixLayerDBM::kB1; - if(ld==2+ibl) layer = PixLayerDBM::kB2; - }else{ - if( ec == 4 ){ - layer = PixLayerDBM::kDBMA; - } - if( ec == -4 ){ - layer = PixLayerDBM::kDBMC; - //std::cout << "[GetPixLayerDBMID] layer == +- 4 : DBM!!" << std::endl; - } - //std::cout << "[ERROR: GetPixLayerDBMID] layer == 99!!" << std::endl; - } - return layer; +int PixelMainMon::getPixLayerIDDBM(int ec, int ld, bool ibl) { + int layer = 99; + if (ec == 2) { + layer = PixLayerDBM::kECA; + } else if (ec == -2) { + layer = PixLayerDBM::kECC; + } else if (ec == 0) { + if (ibl && ld == 0) layer = PixLayerDBM::kIBL; + if (ld == 0 + ibl) layer = PixLayerDBM::kB0; + if (ld == 1 + ibl) layer = PixLayerDBM::kB1; + if (ld == 2 + ibl) layer = PixLayerDBM::kB2; + } else { + if (ec == 4) layer = PixLayerDBM::kDBMA; + if (ec == -4) layer = PixLayerDBM::kDBMC; + } + return layer; } -int PixelMainMon :: GetPixLayerIDIBL2D3D(int ec, int ld, int eta, bool ibl) -{ - int layer = 99; - if(ec==0) { - if(ibl && ld==0 && eta<6 && eta>-7) layer = PixLayerIBL2D3D::kIBL2D; - if(ibl && ld==0 && !(eta<6 && eta>-7)) layer = PixLayerIBL2D3D::kIBL3D; - }else{ - //std::cout << "[ERROR: GetPixLayerIDIBL2D3D] layer == 99!!" << std::endl; - } - return layer; +int PixelMainMon::getPixLayerIDIBL2D3D(int ec, int ld, int eta, bool ibl) { + int layer = 99; + if (ec == 0) { + if (ibl && ld == 0 && eta < 6 && eta > -7) layer = PixLayerIBL2D3D::kIBL2D; + if (ibl && ld == 0 && !(eta < 6 && eta > -7)) layer = PixLayerIBL2D3D::kIBL3D; + } + return layer; } -int PixelMainMon :: GetPixLayerIDIBL2D3DDBM(int ec, int ld, int eta, bool ibl) -{ - int layer = 99; - if(ec==0) { - if(ibl && ld==0 && eta<6 && eta>-7) layer = PixLayerIBL2D3DDBM::kIBL2D; - if(ibl && ld==0 && !(eta<6 && eta>-7)) layer = PixLayerIBL2D3DDBM::kIBL3D; - }else{ - //std::cout << "[ERROR: GetPixLayerIDIBL2D3D] layer == 99!!" << std::endl; - } - return layer; +int PixelMainMon::getPixLayerIDIBL2D3DDBM(int ec, int ld, int eta, bool ibl) { + int layer = 99; + if (ec == 0) { + if (ibl && ld == 0 && eta < 6 && eta > -7) layer = PixLayerIBL2D3DDBM::kIBL2D; + if (ibl && ld == 0 && !(eta < 6 && eta > -7)) layer = PixLayerIBL2D3DDBM::kIBL3D; + } + return layer; } -int PixelMainMon :: GetPixLayerDiskID(int ec, int ld, bool ibl) -{ - int layer = 99; - if(ec==2) layer = PixLayerDisk::kECA0 + ld; - else if(ec==-2) layer = PixLayerDisk::kECC0 + ld; - else if(ec==0) { - if(ibl && ld==0) layer = PixLayerDisk::kIBL; - if(ld==0+ibl) layer = PixLayerDisk::kB0; - if(ld==1+ibl) layer = PixLayerDisk::kB1; - if(ld==2+ibl) layer = PixLayerDisk::kB2; - }else{ - if( ec == 4 || ec == -4){ - //std::cout << "[GetPixLayerID] layer == +- 4 : DBM!!" << std::endl; - } - //std::cout << "[ERROR: GetPixLayerID] layer == 99!!" << std::endl; - } - return layer; +int PixelMainMon::getPixLayerDiskID(int ec, int ld, bool ibl) { + int layer = 99; + if (ec == 2) { + layer = PixLayerDisk::kECA0 + ld; + } else if (ec == -2) { + layer = PixLayerDisk::kECC0 + ld; + } else if (ec == 0) { + if (ibl && ld == 0) layer = PixLayerDisk::kIBL; + if (ld == 0 + ibl) layer = PixLayerDisk::kB0; + if (ld == 1 + ibl) layer = PixLayerDisk::kB1; + if (ld == 2 + ibl) layer = PixLayerDisk::kB2; + } + return layer; } - -int PixelMainMon :: GetPhiID(Identifier &id, const PixelID* pixID) -{ - int phiid = pixID->phi_module(id); - return phiid; +void PixelMainMon::th1FillMonitoring(TH1F_LW* mon, TH1F_LW* tmp) { + for (unsigned int i = 1; i <= tmp->GetNbinsX(); i++) { + float content = tmp->GetBinContent(i); + mon->SetBinContent(i, content); + } + tmp->Reset(); } -int PixelMainMon :: GetEtaID(Identifier &id, const PixelID* pixID, bool doIBL, bool doIBL2D3D) -{ - int etaid = -1; - - int bec = pixID->barrel_ec(id); - int ld = pixID->layer_disk(id); - - if(bec==2 || bec == -2) etaid = ld; - else if(bec==0) - { - if(doIBL){ld--;} - int em = pixID->eta_module(id); - if(ld == 0 || ld == 1 || ld == 2) etaid = em; - else if(ld ==-1){ - int feid = 0; - int emf = 0; - if(em<6 && em>-7){ - if(pixID->eta_index(id) >= 80) feid = 1; - emf = 2 * em + feid; - etaid = em; - } - else if(em<-6){ - emf = em - 6; - etaid = em+10; - } - else{ - emf = em + 6; - etaid = em-2; - } - if(!doIBL2D3D) etaid = emf; +void PixelMainMon::fillTimeHisto(double value, TProfile* one = 0, TProfile* two = 0, TProfile* three = 0, double time1 = 10., double time2 = 60., double time3 = 360.) { + // This function fills time profile histograms + time_t rawtime; + struct tm* timeinfo; + char buffer1[14]; + + time_t endtime; + struct tm* endtimeinfo; + char buffer2[14]; + + time(&rawtime); + timeinfo = localtime(&rawtime); + strftime(buffer1, 14, "%I:%M:%S", timeinfo); + char* buffer = buffer1; + + // Make m_startTime a global variable + double lagtime = difftime(rawtime, m_startTime); // how long since we started the run; + + if (one) { + int binNo = one->GetNbinsX(); + double histoTime = time1 * 60.; // number of seconds this histogram represents; + double timeInterval = histoTime / binNo; // number of seconds per bin + int intervalNumber = int(lagtime / timeInterval); // what interval we are in. Keep this stored as number of Entries; + int bins2shift = intervalNumber - int(one->GetEntries()); // how many bins to shift the bin contents; + if (bins2shift) { // shift bins, skip this if we are in the same bin + for (int iii = 0; iii <= binNo - bins2shift; iii++) { // loop over all bins that need moved; + one->SetBinEntries(iii, one->GetBinEntries(iii + bins2shift)); // move bins to right + one->SetBinContent(iii, one->GetBinContent(iii + bins2shift) * one->GetBinEntries(iii + bins2shift)); // move bins to right } - } - return etaid; -} - -void PixelMainMon :: TH1FFillMonitoring(TH1F_LW* mon, TH1F_LW* tmp) -{ - for(unsigned int i=1; i<=tmp->GetNbinsX(); i++){ - float content = tmp->GetBinContent(i); - mon->SetBinContent(i, content); - } - tmp->Reset(); -} - -void PixelMainMon :: TH2FSetBinScaled(TH2F_LW* mon, TH2F_LW* tmp, int nevent) -{ - for(unsigned int i=1; i<=tmp->GetXaxis()->GetNbins(); i++){ - for(unsigned int j=1; j<=tmp->GetYaxis()->GetNbins(); j++){ - mon->SetBinContent(i, j, tmp->GetBinContent(i, j)/(1.0*nevent) ); + for (int jjj = binNo; jjj > binNo - bins2shift; jjj--) { + one->SetBinContent(jjj, 0.0); + one->SetBinEntries(jjj, 0.0); } - } -} - -void PixelMainMon::FillTimeHisto(double value, TProfile* one=0, TProfile* two=0, TProfile* three=0, double time1=10., double time2=60., double time3=360.) -{ - //This function fills time profile histograms - //int event = m_event; - - time_t rawtime; - struct tm * timeinfo; - char buffer1 [14]; - - time_t endtime; - struct tm * endtimeinfo; - char buffer2 [14]; - - time ( &rawtime ); - timeinfo = localtime ( &rawtime ); - strftime (buffer1,14,"%I:%M:%S",timeinfo); - char* buffer = buffer1; - - - - - //Make m_startTime a global variable - double lagtime = difftime(rawtime, m_startTime); //how long since we started the run; - - - if(one) - { - int binNo = one->GetNbinsX(); - double histoTime = time1*60.; //number of seconds this histogram represents; - double timeInterval = histoTime / binNo; //number of seconds per bin - int intervalNumber = int (lagtime / timeInterval); //what interval we are in. Keep this stored as number of Entries; - int bins2shift = intervalNumber - int(one->GetEntries()); //how many bins to shift the bin contents; - if (bins2shift) //shift bins, skip this if we are in the same bin - { - for(int iii=0; iii <= binNo-bins2shift; iii++) //loop over all bins that need moved; - { - one->SetBinEntries(iii, one->GetBinEntries(iii+bins2shift)); //move bins to right - one->SetBinContent(iii, one->GetBinContent(iii+bins2shift)*one->GetBinEntries(iii+bins2shift)); //move bins to right - } - for(int jjj = binNo; jjj > binNo- bins2shift; jjj--) - { - one->SetBinContent(jjj,0.0); //clear new bins - one->SetBinEntries(jjj,0.0); //clear new bins - } - one->GetXaxis()->SetBinLabel(binNo,buffer);//write the timestamp on the first and last bin - endtime = time_t(rawtime - histoTime); - endtimeinfo = localtime (&endtime); - strftime (buffer2,14,"%I:%M:%S",endtimeinfo); - char* buffer3 = buffer2; - one->GetXaxis()->SetBinLabel(1,buffer3);//write the timestamp on the first and last bin - one->LabelsOption("h","X"); + one->GetXaxis()->SetBinLabel(binNo, buffer); // write the timestamp on the first and last bin + endtime = time_t(rawtime - histoTime); + endtimeinfo = localtime(&endtime); + strftime(buffer2, 14, "%I:%M:%S", endtimeinfo); + char* buffer3 = buffer2; + one->GetXaxis()->SetBinLabel(1, buffer3); // write the timestamp on the first and last bin + one->LabelsOption("h", "X"); + } + double binEntries = one->GetBinEntries(binNo); + double binContent = one->GetBinContent(binNo); + one->SetBinEntries(binNo, binEntries + 1); + one->SetBinContent(binNo, binContent * binEntries + value); + + one->SetEntries(intervalNumber); // store the interval number in a convienent place + } + + if (two) { + int binNo = two->GetNbinsX(); + double histoTime = time2 * 60.; // number of seconds this histogram represents; + double timeInterval = histoTime / binNo; // number of seconds per bin + int intervalNumber = int(lagtime / timeInterval); // what interval we are in. Keep this stored as number of Entries; + int bins2shift = intervalNumber - int(two->GetEntries()); // how many bins to shift the bin contents; + if (bins2shift) { // shift bins, skip this if we are in the same bin + for (int iii = 0; iii <= binNo - bins2shift; iii++) { // loop over all bins that need moved; + two->SetBinEntries(iii, two->GetBinEntries(iii + bins2shift)); // move bins to right + two->SetBinContent(iii, two->GetBinContent(iii + bins2shift) * two->GetBinEntries(iii + bins2shift)); // move bins to right } - double binEntries = one->GetBinEntries(binNo); //save old values - double binContent = one->GetBinContent(binNo); - one->SetBinEntries(binNo,binEntries+1); - one->SetBinContent(binNo,binContent*binEntries + value); //calculate new values for this bin. Do it this way so spread is 0 and errors are calculated consistently across bins - - one->SetEntries(intervalNumber); //store the interval number in a convienent place - } - - if(two) - { - int binNo = two->GetNbinsX(); - double histoTime = time2*60.; //number of seconds this histogram represents; - double timeInterval = histoTime / binNo; //number of seconds per bin - int intervalNumber = int (lagtime / timeInterval); //what interval we are in. Keep this stored as number of Entries; - int bins2shift = intervalNumber - int(two->GetEntries()); //how many bins to shift the bin contents; - if (bins2shift) //shift bins, skip this if we are in the same bin - { - for(int iii=0; iii <= binNo-bins2shift; iii++) //loop over all bins that need moved; - { - two->SetBinEntries(iii, two->GetBinEntries(iii+bins2shift)); //move bins to right - two->SetBinContent(iii, two->GetBinContent(iii+bins2shift)*two->GetBinEntries(iii+bins2shift)); //move bins to right - } - for(int jjj = binNo; jjj > binNo- bins2shift; jjj--) - { - two->SetBinContent(jjj,0.0); //clear new bins - two->SetBinEntries(jjj,0.0); //clear new bins - } - two->GetXaxis()->SetBinLabel(binNo,buffer);//write the timestamp on the first and last bin - endtime = rawtime - time2*60; - endtimeinfo = localtime (&endtime); - strftime (buffer2,14,"%I:%M:%S",endtimeinfo); - char* buffer3 = buffer2; - two->GetXaxis()->SetBinLabel(1,buffer3);//write the timestamp on the first and last bin - two->LabelsOption("h","X"); + for (int jjj = binNo; jjj > binNo - bins2shift; jjj--) { + two->SetBinContent(jjj, 0.0); + two->SetBinEntries(jjj, 0.0); } - double binEntries = two->GetBinEntries(binNo); //save old values - double binContent = two->GetBinContent(binNo); - two->SetBinEntries(binNo,binEntries+1); - two->SetBinContent(binNo,binContent*binEntries + value); //calculate new values for this bin. Do it this way so spread is 0 and errors are calculated consistently across bins - - two->SetEntries(intervalNumber); //store the interval number in a convienent place - } - - if(three) - { - int binNo = three->GetNbinsX(); - double histoTime = time3*60.; //number of seconds this histogram represents; - double timeInterval = histoTime / binNo; //number of seconds per bin - int intervalNumber = int (lagtime / timeInterval); //what interval we are in. Keep this stored as number of Entries; - int bins2shift = intervalNumber - int(three->GetEntries()); //how many bins to shift the bin contents; - if (bins2shift) //shift bins, skip this if we are in the same bin - { - for(int iii=0; iii <= binNo-bins2shift; iii++) //loop over all bins that need moved; - { - three->SetBinEntries(iii, three->GetBinEntries(iii+bins2shift)); //move bins to right - three->SetBinContent(iii, three->GetBinContent(iii+bins2shift)*three->GetBinEntries(iii+bins2shift)); //move bins to right - } - for(int jjj = binNo; jjj > binNo- bins2shift; jjj--) - { - three->SetBinContent(jjj,0.0); //clear new bins - three->SetBinEntries(jjj,0.0); //clear new bins - } - three->GetXaxis()->SetBinLabel(binNo,buffer);//write the timestamp on the first and last bin - endtime = rawtime - time3*60; - endtimeinfo = localtime (&endtime); - strftime (buffer2,14,"%I:%M:%S",endtimeinfo); - char* buffer3 = buffer2; - three->GetXaxis()->SetBinLabel(1,buffer3);//write the timestamp on the first and last bin - three->LabelsOption("h","X"); + two->GetXaxis()->SetBinLabel(binNo, buffer); // write the timestamp on the first and last bin + endtime = rawtime - time2 * 60; + endtimeinfo = localtime(&endtime); + strftime(buffer2, 14, "%I:%M:%S", endtimeinfo); + char* buffer3 = buffer2; + two->GetXaxis()->SetBinLabel(1, buffer3); // write the timestamp on the first and last bin + two->LabelsOption("h", "X"); + } + double binEntries = two->GetBinEntries(binNo); + double binContent = two->GetBinContent(binNo); + two->SetBinEntries(binNo, binEntries + 1); + two->SetBinContent(binNo, binContent * binEntries + value); + + two->SetEntries(intervalNumber); // store the interval number in a convienent place + } + + if (three) { + int binNo = three->GetNbinsX(); + double histoTime = time3 * 60.; // number of seconds this histogram represents; + double timeInterval = histoTime / binNo; // number of seconds per bin + int intervalNumber = int(lagtime / timeInterval); // what interval we are in. Keep this stored as number of Entries; + int bins2shift = intervalNumber - int(three->GetEntries()); // how many bins to shift the bin contents; + if (bins2shift) { // shift bins, skip this if we are in the same bin + for (int iii = 0; iii <= binNo - bins2shift; iii++) { // loop over all bins that need moved; + three->SetBinEntries(iii, three->GetBinEntries(iii + bins2shift)); // move bins to right + three->SetBinContent(iii, three->GetBinContent(iii + bins2shift) * three->GetBinEntries(iii + bins2shift)); // move bins to right } - double binEntries = three->GetBinEntries(binNo); //save old values - double binContent = three->GetBinContent(binNo); - three->SetBinEntries(binNo,binEntries+1); - three->SetBinContent(binNo,binContent*binEntries + value); //calculate new values for this bin. Do it this way so spread is 0 and errors are calculated consistently across bins - - three->SetEntries(intervalNumber); //store the interval number in a convienent place - } + for (int jjj = binNo; jjj > binNo - bins2shift; jjj--) { + three->SetBinContent(jjj, 0.0); + three->SetBinEntries(jjj, 0.0); + } + three->GetXaxis()->SetBinLabel(binNo, buffer); // write the timestamp on the first and last bin + endtime = rawtime - time3 * 60; + endtimeinfo = localtime(&endtime); + strftime(buffer2, 14, "%I:%M:%S", endtimeinfo); + char* buffer3 = buffer2; + three->GetXaxis()->SetBinLabel(1, buffer3); // write the timestamp on the first and last bin + three->LabelsOption("h", "X"); + } + double binEntries = three->GetBinEntries(binNo); + double binContent = three->GetBinContent(binNo); + three->SetBinEntries(binNo, binEntries + 1); + three->SetBinContent(binNo, binContent * binEntries + value); + + three->SetEntries(intervalNumber); // store the interval number in a convienent place + } } -void PixelMainMon::FillSummaryHistos (PixelMon2DMapsLW* occupancy, TH1F_LW* A, TH1F_LW* C, TH1F_LW* IBL, TH1F_LW* B0, TH1F_LW* B1, TH1F_LW* B2) -{ - - if( !(A && C && B0 && B1 && B2 && occupancy) )return; //if the histos don't exist, dont' fill them - double events = m_event; - if(events==0) return; - - if(IBL){ - IBL->Reset(); - } - B0->Reset(); - B1->Reset(); - B2->Reset(); - A->Reset(); - C->Reset(); - - if(IBL){ - for(int etaIndex=1; etaIndex<=12; etaIndex++){ - for(int phiIndex=1; phiIndex <= 14; phiIndex++){ - IBL->Fill(occupancy->IBL2D->GetBinContent(etaIndex,phiIndex)/events); - } - } - for(int etaIndex=1; etaIndex<=8; etaIndex++){ - for(int phiIndex=1; phiIndex <= 14; phiIndex++){ - IBL->Fill(occupancy->IBL3D->GetBinContent(etaIndex,phiIndex)/events); - } - } - } - for(int etaIndex=1; etaIndex<=13; etaIndex++){ - for(int phiIndex=1; phiIndex <= 22; phiIndex++) - B0->Fill(occupancy->B0->GetBinContent(etaIndex,phiIndex)/events); - for(int phiIndex=1; phiIndex <= 38; phiIndex++) - B1->Fill(occupancy->B1->GetBinContent(etaIndex,phiIndex)/events); - for(int phiIndex=1; phiIndex <= 52; phiIndex++) - B2->Fill(occupancy->B2->GetBinContent(etaIndex,phiIndex)/events); - } - for(int etaIndex=1; etaIndex<=3; etaIndex++) - { - for(int phiIndex=1; phiIndex<=48; phiIndex++) - { - A->Fill(occupancy->A->GetBinContent(etaIndex,phiIndex)/events); - C->Fill(occupancy->C->GetBinContent(etaIndex,phiIndex)/events); +void PixelMainMon::fillSummaryHistos(PixelMon2DMapsLW* occupancy, TH1F_LW* A, TH1F_LW* C, TH1F_LW* IBL, TH1F_LW* B0, TH1F_LW* B1, TH1F_LW* B2) { + // if the histos don't exist, dont' fill them + if (!(A && C && B0 && B1 && B2 && occupancy)) return; + double events = m_event; + if (events == 0) return; + + if (IBL) { + IBL->Reset(); + } + B0->Reset(); + B1->Reset(); + B2->Reset(); + A->Reset(); + C->Reset(); + + if (IBL) { + for (int etaIndex = 1; etaIndex <= 12; etaIndex++) { + for (int phiIndex = 1; phiIndex <= 14; phiIndex++) { + IBL->Fill(occupancy->IBL2D->GetBinContent(etaIndex, phiIndex) / events); } - } + } + for (int etaIndex = 1; etaIndex <= 8; etaIndex++) { + for (int phiIndex = 1; phiIndex <= 14; phiIndex++) { + IBL->Fill(occupancy->IBL3D->GetBinContent(etaIndex, phiIndex) / events); + } + } + } + for (int etaIndex = 1; etaIndex <= 13; etaIndex++) { + for (int phiIndex = 1; phiIndex <= 22; phiIndex++) { + B0->Fill(occupancy->B0->GetBinContent(etaIndex, phiIndex) / events); + } + for (int phiIndex = 1; phiIndex <= 38; phiIndex++) { + B1->Fill(occupancy->B1->GetBinContent(etaIndex, phiIndex) / events); + } + for (int phiIndex = 1; phiIndex <= 52; phiIndex++) { + B2->Fill(occupancy->B2->GetBinContent(etaIndex, phiIndex) / events); + } + } + for (int etaIndex = 1; etaIndex <= 3; etaIndex++) { + for (int phiIndex = 1; phiIndex <= 48; phiIndex++) { + A->Fill(occupancy->A->GetBinContent(etaIndex, phiIndex) / events); + C->Fill(occupancy->C->GetBinContent(etaIndex, phiIndex) / events); + } + } } -bool PixelMainMon::OnTrack(Identifier id, bool isCluster) -{ - bool onTrack=false; - if(isCluster) - { - onTrack=binary_search (m_ClusterIDs.begin(), m_ClusterIDs.end(), id); - }else{ - onTrack=binary_search (m_RDOIDs.begin(), m_RDOIDs.end(), id); - } - //search through vector of ID's on track to see if there is a match - return onTrack; +bool PixelMainMon::isOnTrack(Identifier id, bool isCluster) { + bool onTrack = false; + // search through vector of ID's on track to see if there is a match + if (isCluster) { + onTrack = binary_search(m_ClusterIDs.begin(), m_ClusterIDs.end(), id); + } else { + onTrack = binary_search(m_RDOIDs.begin(), m_RDOIDs.end(), id); + } + return onTrack; } -//Not yet updated to include IBL: -int PixelMainMon::ParseDetailsString(std::string & detailsMod) -{ - int modID[4]={0,0,0,0}; - char * pch; - pch = new char [detailsMod.size()+1]; - strcpy (pch, detailsMod.c_str()); - 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" }; - const int nstave1 = 38; - const char *stave1[nstave1] = { "B01_S1", "B01_S2", "B02_S1", "B02_S2", "B03_S1", "B03_S2", - "B04_S1", "B04_S2", "B05_S1", "B05_S2", "B06_S1", "B06_S2", - "B07_S1", "B07_S2", "B08_S1", "B08_S2", "B09_S1", "B09_S2", - "B10_S1", "B10_S2", "B11_S1", "B11_S2", "B12_S1", "B12_S2", - "B13_S1", "B13_S2", "B14_S1", "B14_S2", "B15_S1", "B15_S2", - "B16_S1", "B16_S2", "B17_S1", "B17_S2", "B18_S1", "B18_S2", - "B19_S1", "B19_S2" }; - const int nstave2 = 52; - const char *stave2[nstave2] = { "B01_S2", "B02_S1", "B02_S2", "B03_S1", "B03_S2", - "B04_S1", "B04_S2", "B05_S1", "B05_S2", "B06_S1", "B06_S2", - "B07_S1", "B07_S2", "B08_S1", "B08_S2", "B09_S1", "B09_S2", - "B10_S1", "B10_S2", "B11_S1", "B11_S2", "B12_S1", "B12_S2", - "B13_S1", "B13_S2", "B14_S1", "B14_S2", "B15_S1", "B15_S2", - "B16_S1", "B16_S2", "B17_S1", "B17_S2", "B18_S1", "B18_S2", - "B19_S1", "B19_S2", "B20_S1", "B20_S2", "B21_S1", "B21_S2", - "B22_S1", "B22_S2", "B23_S1", "B23_S2", "B24_S1", "B24_S2", - "B25_S1", "B25_S2", "B26_S1", "B26_S2", - "B01_S1" }; - const char *nstaveA[48] = { - "B01_S2_M1", "B01_S2_M6", "B01_S2_M2", "B01_S2_M5", "B01_S2_M3", "B01_S2_M4", - "B02_S1_M1", "B02_S1_M6", "B02_S1_M2", "B02_S1_M5", "B02_S1_M3", "B02_S1_M4", - "B02_S2_M1", "B02_S2_M6", "B02_S2_M2", "B02_S2_M5", "B02_S2_M3", "B02_S2_M4", - "B03_S1_M1", "B03_S1_M6", "B03_S1_M2", "B03_S1_M5", "B03_S1_M3", "B03_S1_M4", - "B03_S2_M1", "B03_S2_M6", "B03_S2_M2", "B03_S2_M5", "B03_S2_M3", "B03_S2_M4", - "B04_S1_M1", "B04_S1_M6", "B04_S1_M2", "B04_S1_M5", "B04_S1_M3", "B04_S1_M4", - "B04_S2_M1", "B04_S2_M6", "B04_S2_M2", "B04_S2_M5", "B04_S2_M3", "B04_S2_M4", - "B01_S1_M1", "B01_S1_M6", "B01_S1_M2", "B01_S1_M5", "B01_S1_M3", "B01_S1_M4"}; - const char *nstaveC[48] = { - "B01_S2_M4", "B01_S2_M3", "B01_S2_M5", "B01_S2_M2", "B01_S2_M6", "B01_S2_M1", - "B02_S1_M4", "B02_S1_M3", "B02_S1_M5", "B02_S1_M2", "B02_S1_M6", "B02_S1_M1", - "B02_S2_M4", "B02_S2_M3", "B02_S2_M5", "B02_S2_M2", "B02_S2_M6", "B02_S2_M1", - "B03_S1_M4", "B03_S1_M3", "B03_S1_M5", "B03_S1_M2", "B03_S1_M6", "B03_S1_M1", - "B03_S2_M4", "B03_S2_M3", "B03_S2_M5", "B03_S2_M2", "B03_S2_M6", "B03_S2_M1", - "B04_S1_M4", "B04_S1_M3", "B04_S1_M5", "B04_S1_M2", "B04_S1_M6", "B04_S1_M1", - "B04_S2_M4", "B04_S2_M3", "B04_S2_M5", "B04_S2_M2", "B04_S2_M6", "B04_S2_M1", - "B01_S1_M4", "B01_S1_M3", "B01_S1_M5", "B01_S1_M2", "B01_S1_M6", "B01_S1_M1"}; - - - //parse string and get module name - if(strstr(pch, "D1C")) {modID[0]=-2;modID[1]=0;} - else if(strstr(pch, "D2C")) {modID[0]=-2;modID[1]=1;} - else if(strstr(pch, "D3C")) {modID[0]=-2;modID[1]=2;} - else if(strstr(pch, "D1A")) {modID[0]= 2;modID[1]=0;} - else if(strstr(pch, "D2A")) {modID[0]= 2;modID[1]=1;} - else if(strstr(pch, "D3A")) {modID[0]= 2;modID[1]=2;} - - if(strstr(pch, "L0" )) - { - modID[0]= 0;modID[1]=0; - for (int i=0; i<nstave0;i++) - { - if(strstr(pch,stave0[i])) {modID[2]=i; break;} +// Not yet updated to include IBL: +int PixelMainMon::parseDetailsString(std::string& detailsMod) { + int modID[4] = {0, 0, 0, 0}; + char* pch; + pch = new char[detailsMod.size() + 1]; + strcpy(pch, detailsMod.c_str()); + 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"}; + const int nstave1 = 38; + const char* stave1[nstave1] = {"B01_S1", "B01_S2", "B02_S1", "B02_S2", "B03_S1", "B03_S2", "B04_S1", "B04_S2", + "B05_S1", "B05_S2", "B06_S1", "B06_S2", "B07_S1", "B07_S2", "B08_S1", "B08_S2", + "B09_S1", "B09_S2", "B10_S1", "B10_S2", "B11_S1", "B11_S2", "B12_S1", "B12_S2", + "B13_S1", "B13_S2", "B14_S1", "B14_S2", "B15_S1", "B15_S2", "B16_S1", "B16_S2", + "B17_S1", "B17_S2", "B18_S1", "B18_S2", "B19_S1", "B19_S2"}; + const int nstave2 = 52; + const char* stave2[nstave2] = {"B01_S2", "B02_S1", "B02_S2", "B03_S1", "B03_S2", "B04_S1", "B04_S2", "B05_S1", + "B05_S2", "B06_S1", "B06_S2", "B07_S1", "B07_S2", "B08_S1", "B08_S2", "B09_S1", + "B09_S2", "B10_S1", "B10_S2", "B11_S1", "B11_S2", "B12_S1", "B12_S2", "B13_S1", + "B13_S2", "B14_S1", "B14_S2", "B15_S1", "B15_S2", "B16_S1", "B16_S2", "B17_S1", + "B17_S2", "B18_S1", "B18_S2", "B19_S1", "B19_S2", "B20_S1", "B20_S2", "B21_S1", + "B21_S2", "B22_S1", "B22_S2", "B23_S1", "B23_S2", "B24_S1", "B24_S2", "B25_S1", + "B25_S2", "B26_S1", "B26_S2", "B01_S1"}; + const char* nstaveA[48] = {"B01_S2_M1", "B01_S2_M6", "B01_S2_M2", "B01_S2_M5", "B01_S2_M3", "B01_S2_M4", "B02_S1_M1", + "B02_S1_M6", "B02_S1_M2", "B02_S1_M5", "B02_S1_M3", "B02_S1_M4", "B02_S2_M1", "B02_S2_M6", + "B02_S2_M2", "B02_S2_M5", "B02_S2_M3", "B02_S2_M4", "B03_S1_M1", "B03_S1_M6", "B03_S1_M2", + "B03_S1_M5", "B03_S1_M3", "B03_S1_M4", "B03_S2_M1", "B03_S2_M6", "B03_S2_M2", "B03_S2_M5", + "B03_S2_M3", "B03_S2_M4", "B04_S1_M1", "B04_S1_M6", "B04_S1_M2", "B04_S1_M5", "B04_S1_M3", + "B04_S1_M4", "B04_S2_M1", "B04_S2_M6", "B04_S2_M2", "B04_S2_M5", "B04_S2_M3", "B04_S2_M4", + "B01_S1_M1", "B01_S1_M6", "B01_S1_M2", "B01_S1_M5", "B01_S1_M3", "B01_S1_M4"}; + const char* nstaveC[48] = {"B01_S2_M4", "B01_S2_M3", "B01_S2_M5", "B01_S2_M2", "B01_S2_M6", "B01_S2_M1", "B02_S1_M4", + "B02_S1_M3", "B02_S1_M5", "B02_S1_M2", "B02_S1_M6", "B02_S1_M1", "B02_S2_M4", "B02_S2_M3", + "B02_S2_M5", "B02_S2_M2", "B02_S2_M6", "B02_S2_M1", "B03_S1_M4", "B03_S1_M3", "B03_S1_M5", + "B03_S1_M2", "B03_S1_M6", "B03_S1_M1", "B03_S2_M4", "B03_S2_M3", "B03_S2_M5", "B03_S2_M2", + "B03_S2_M6", "B03_S2_M1", "B04_S1_M4", "B04_S1_M3", "B04_S1_M5", "B04_S1_M2", "B04_S1_M6", + "B04_S1_M1", "B04_S2_M4", "B04_S2_M3", "B04_S2_M5", "B04_S2_M2", "B04_S2_M6", "B04_S2_M1", + "B01_S1_M4", "B01_S1_M3", "B01_S1_M5", "B01_S1_M2", "B01_S1_M6", "B01_S1_M1"}; + + // parse string and get module name + if (strstr(pch, "D1C")) { + modID[0] = -2; + modID[1] = 0; + } else if (strstr(pch, "D2C")) { + modID[0] = -2; + modID[1] = 1; + } else if (strstr(pch, "D3C")) { + modID[0] = -2; + modID[1] = 2; + } else if (strstr(pch, "D1A")) { + modID[0] = 2; + modID[1] = 0; + } else if (strstr(pch, "D2A")) { + modID[0] = 2; + modID[1] = 1; + } else if (strstr(pch, "D3A")) { + modID[0] = 2; + modID[1] = 2; + } + + if (strstr(pch, "L0")) { + modID[0] = 0; + modID[1] = 0; + for (int i = 0; i < nstave0; i++) { + if (strstr(pch, stave0[i])) { + modID[2] = i; + break; } - } - else if(strstr(pch, "L1" )) - { - modID[0]= 0;modID[1]=1; - for (int i=0; i<nstave1;i++) - { - if(strstr(pch,stave1[i])) {modID[2]=i; break;} + } + } else if (strstr(pch, "L1")) { + modID[0] = 0; + modID[1] = 1; + for (int i = 0; i < nstave1; i++) { + if (strstr(pch, stave1[i])) { + modID[2] = i; + break; } - } - else if(strstr(pch, "L2" )) - { - modID[0]= 0;modID[1]=2; - for (int i=0; i<nstave2;i++) - { - if(strstr(pch,stave2[i])) {modID[2]=i; break;} + } + } else if (strstr(pch, "L2")) { + modID[0] = 0; + modID[1] = 2; + for (int i = 0; i < nstave2; i++) { + if (strstr(pch, stave2[i])) { + modID[2] = i; + break; } - } - - if(modID[0]==2||modID[0]==-2) - { - for (int i=0; i<48; i++) - { - if(modID[0]==-2 && strstr(pch,nstaveC[i])) {modID[2]=i; break;} - if(modID[0]==2 && strstr(pch,nstaveA[i])) {modID[2]=i; break;} + } + } + + if (modID[0] == 2 || modID[0] == -2) { + for (int i = 0; i < 48; i++) { + if (modID[0] == -2 && strstr(pch, nstaveC[i])) { + modID[2] = i; + break; + } + if (modID[0] == 2 && strstr(pch, nstaveA[i])) { + modID[2] = i; + break; } - } - if(modID[0]==0) - { - for (int i=0; i<nmod;i++) - { - if(strstr(pch,mod[i])) {modID[3]=i; break;} + } + } + if (modID[0] == 0) { + for (int i = 0; i < nmod; i++) { + if (strstr(pch, mod[i])) { + modID[3] = i; + break; } - } + } + } - delete[] pch; - return (1000000 + (modID[0] + 2)*100000 + (modID[1])*10000 + (modID[2])*100 + (modID[3] + 6)); + delete[] pch; + return (1000000 + (modID[0] + 2) * 100000 + (modID[1]) * 10000 + (modID[2]) * 100 + (modID[3] + 6)); } - -bool PixelMainMon :: GetFEID( int pixlayer, int phiid, int etaid, int &oufephi, int &outfeeta) -{ - bool isValid = true; - int npixPerFe_phi, npixPerFe_eta; - if( pixlayer == PixLayer::kECA || pixlayer == PixLayer::kECC) { - npixPerFe_phi = 160+4; - npixPerFe_eta = 18; - }else if(pixlayer != PixLayer::kIBL) { /// for pixel - npixPerFe_phi = 160 + 4; - npixPerFe_eta = 18; - }else{ - npixPerFe_phi = 336; - npixPerFe_eta = 80; - isValid = false; - } - oufephi = phiid/npixPerFe_phi; - outfeeta= etaid/npixPerFe_eta; - return isValid; +bool PixelMainMon::getFEID(int pixlayer, int phiid, int etaid, int& oufephi, int& outfeeta) { + bool isValid = true; + int npixPerFe_phi, npixPerFe_eta; + if (pixlayer == PixLayer::kECA || pixlayer == PixLayer::kECC) { + npixPerFe_phi = 160 + 4; + npixPerFe_eta = 18; + } else if (pixlayer != PixLayer::kIBL) { + npixPerFe_phi = 160 + 4; + npixPerFe_eta = 18; + } else { + npixPerFe_phi = 336; + npixPerFe_eta = 80; + isValid = false; + } + oufephi = phiid / npixPerFe_phi; + outfeeta = etaid / npixPerFe_eta; + return isValid; } diff --git a/InnerDetector/InDetMonitoring/PixelMonitoring/src/Hits.cxx b/InnerDetector/InDetMonitoring/PixelMonitoring/src/Hits.cxx index e064e30cc950f1b69067242d1b2cecfc5f2f162f..701dd664868e4ecf4bc46d5fc0ab2375a1554ac9 100644 --- a/InnerDetector/InDetMonitoring/PixelMonitoring/src/Hits.cxx +++ b/InnerDetector/InDetMonitoring/PixelMonitoring/src/Hits.cxx @@ -6,862 +6,848 @@ // Book and fill histograms showing pixel hit level information /////////////////////////////////////////////////////////////////////////////// -#include "PixelMonitoring/PixelMainMon.h" -#include "InDetRawData/InDetTimeCollection.h" +#include <sstream> #include "InDetConditionsSummaryService/IInDetConditionsSvc.h" #include "InDetIdentifier/PixelID.h" -#include "TH1F.h" -#include "TH1I.h" -#include "TH2F.h" -#include "TH3F.h" -#include "TH2I.h" +#include "InDetRawData/InDetTimeCollection.h" #include "LWHists/TH1F_LW.h" #include "LWHists/TH1I_LW.h" #include "LWHists/TH2F_LW.h" #include "LWHists/TH2I_LW.h" -#include "TProfile.h" #include "LWHists/TProfile2D_LW.h" #include "LWHists/TProfile_LW.h" -#include <sstream> +#include "PixelMonitoring/PixelMainMon.h" +#include "TH1F.h" +#include "TH1I.h" +#include "TH2F.h" +#include "TH2I.h" +#include "TH3F.h" +#include "TProfile.h" +#include "InDetRawData/InDetRawDataCLASS_DEF.h" #include "InDetRawData/InDetRawDataContainer.h" -#include "InDetRawData/InDetRawDataCLASS_DEF.h" #include "PixelMonitoring/Components.h" +#include "PixelMonitoring/PixelMon2DLumiProfiles.h" #include "PixelMonitoring/PixelMon2DMapsLW.h" #include "PixelMonitoring/PixelMon2DProfilesLW.h" #include "PixelMonitoring/PixelMonModules.h" -#include "PixelMonitoring/PixelMon2DLumiProfiles.h" +#include "EventInfo/EventID.h" #include "EventInfo/EventInfo.h" #include "EventInfo/TriggerInfo.h" -#include "EventInfo/EventID.h" #include "PixelCabling/IPixelCablingSvc.h" - /////////////////////////////////////////////////////////////////////////////// //////////////////////booking methods////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////// -StatusCode PixelMainMon::BookHitsMon(void) -{ - ATH_MSG_DEBUG("Start booking Hit histogtams.."); - std::string path = "Pixel/Hits"; - if(m_doOnTrack) path.replace(path.begin(), path.end(), "Pixel/HitsOnTrack"); - MonGroup rdoShift( this, path.c_str(), run, ATTRIB_MANAGED ); //declare a group of histograms - MonGroup rdoExpert ( 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"); - 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 tmp; - std::string tmp2; - std::string atitles; - 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); - int nbins_BCID = m_bcidRange; double min_BCID = -0.5; double max_BCID = min_BCID + (1.0*nbins_BCID); - int nbins_tot3 = 300; double min_tot3 = -0.5; double max_tot3 = min_tot3 + (1.0*nbins_tot3); - int nbins_tot4 = 20; double min_tot4 = -0.5; double max_tot4 = min_tot4 + (1.0*nbins_tot4); - - static constexpr int nmod_phi[PixLayer::COUNT] = {48, 48, 22, 38, 52, 14}; - static constexpr int nmod_eta[PixLayer::COUNT] = {3, 3, 13, 13, 13, 20}; - - std::string atext_LB = ";lumi block"; - std::string atext_BCID = ";BCID"; - std::string atext_nevt = ";# events"; - std::string atext_nhit = ";# hits"; - std::string atext_hit = ";# hits/event"; - std::string atext_occ = ";# hits/pixel/event"; - std::string atext_occ_mod = ";# hits/pixel"; - std::string atext_tot = ";ToT [BC]"; - std::string atext_lv1 = ";Level 1 Accept"; - - StatusCode sc; - - hname = makeHistname("Hits_per_lumi", false); - htitles = makeHisttitle("Average number of pixel hits per event", (atext_LB+atext_hit), false); - sc = rdoShift.regHist(m_hits_per_lumi = TProfile_LW::create(hname.c_str(), htitles.c_str(), nbins_LB, min_LB, max_LB)); - - hname = makeHistname("AvgOcc_per_lumi", false); - htitles = makeHisttitle("Average pixel occupancy per event over all layers", (atext_LB+atext_occ), false); - sc = rdoShift.regHist(m_avgocc_per_lumi = TProfile_LW::create(hname.c_str(), htitles.c_str(), nbins_LB, min_LB, max_LB)); - - hname = makeHistname("AvgOcc_RatioIBLB0_per_lumi", false); - htitles = makeHisttitle("Average pixel occupancy ratio of IBL/B0 per event per LB", (atext_LB+";ratio"), false); - sc = rdoShift.regHist(m_avgocc_ratioIBLB0_per_lumi = TProfile_LW::create(hname.c_str(), htitles.c_str(), nbins_LB, min_LB, max_LB)); - - - for(int i=0; i<PixLayer::COUNT-1+(int)(m_doIBL); i++){ // not include IBL2D and IBL3D - hname = makeHistname(("Hits_per_lumi_"+m_modLabel_PixLayerIBL2D3D[i]), false); - htitles = makeHisttitle(("Average number of pixel hits per event, "+m_modLabel_PixLayerIBL2D3D[i]), (atext_LB+atext_hit), false); - sc = rdoExpert.regHist(m_hits_per_lumi_mod[i] = TProfile_LW::create(hname.c_str(), htitles.c_str(), nbins_LB, min_LB, max_LB)); - - hname = makeHistname(("nHits_per_module_per_event_"+m_modLabel_PixLayerIBL2D3D[i]), false); - htitles = makeHisttitle(("Number of hits in a module in an event, "+m_modLabel_PixLayerIBL2D3D[i]), ";#hits in a module in an event;#events #times #modules", false); - sc = rdoShift.regHist(m_nhits_mod[i] = TH1F_LW::create(hname.c_str(), htitles.c_str(), 1000, -0.5, -0.5+1000.0)); - - hname = makeHistname(("Hit_ToTMean_"+m_modLabel_PixLayerIBL2D3D[i]), false); - htitles = makeHisttitle(("Hit ToT Mean, "+m_modLabel_PixLayerIBL2D3D[i]), (atext_LB+";Average Hit ToT"), false); - sc = rdoExpert.regHist( m_hit_ToTMean_mod[i] = TProfile_LW::create(hname.c_str(), htitles.c_str(), nbins_LB, min_LB, max_LB) ); - - if (!m_doOnline) { - hname = makeHistname(("ModOcc_per_lumi_"+m_modLabel_PixLayerIBL2D3D[i]), false); - htitles = makeHisttitle(("Module occupancy per event, "+m_modLabel_PixLayerIBL2D3D[i]), (atext_LB+atext_occ_mod), false); - sc = rdoShift.regHist(m_modocc_per_lumi[i] = TH2F_LW::create(hname.c_str(), htitles.c_str(), nbins_LB, min_LB, max_LB, 100, 0.0001, 0.0101)); - } - } +StatusCode PixelMainMon::bookHitsMon(void) { + ATH_MSG_DEBUG("Start booking Hit histogtams.."); + std::string path = "Pixel/Hits"; + if (m_doOnTrack) path.replace(path.begin(), path.end(), "Pixel/HitsOnTrack"); + MonGroup rdoShift(this, path.c_str(), run, ATTRIB_MANAGED); // declare a group of histograms + MonGroup rdoExpert(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"); + 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 tmp; + std::string tmp2; + std::string atitles; + 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); + int nbins_BCID = m_bcidRange; + double min_BCID = -0.5; + double max_BCID = min_BCID + (1.0 * nbins_BCID); + int nbins_tot3 = 300; + double min_tot3 = -0.5; + double max_tot3 = min_tot3 + (1.0 * nbins_tot3); + int nbins_tot4 = 20; + double min_tot4 = -0.5; + double max_tot4 = min_tot4 + (1.0 * nbins_tot4); + + static constexpr int nmod_phi[PixLayer::COUNT] = {48, 48, 22, 38, 52, 14}; + static constexpr int nmod_eta[PixLayer::COUNT] = {3, 3, 13, 13, 13, 20}; + + std::string atext_LB = ";lumi block"; + std::string atext_BCID = ";BCID"; + std::string atext_nevt = ";# events"; + std::string atext_nhit = ";# hits"; + std::string atext_hit = ";# hits/event"; + std::string atext_occ = ";# hits/pixel/event"; + std::string atext_occ_mod = ";# hits/pixel"; + std::string atext_tot = ";ToT [BC]"; + std::string atext_lv1 = ";Level 1 Accept"; + + StatusCode sc; + + hname = makeHistname("Hits_per_lumi", false); + htitles = makeHisttitle("Average number of pixel hits per event", (atext_LB + atext_hit), false); + sc = rdoShift.regHist(m_hits_per_lumi = TProfile_LW::create(hname.c_str(), htitles.c_str(), nbins_LB, min_LB, max_LB)); + + hname = makeHistname("AvgOcc_per_lumi", false); + htitles = makeHisttitle("Average pixel occupancy per event over all layers", (atext_LB + atext_occ), false); + sc = rdoShift.regHist(m_avgocc_per_lumi = TProfile_LW::create(hname.c_str(), htitles.c_str(), nbins_LB, min_LB, max_LB)); + + hname = makeHistname("AvgOcc_RatioIBLB0_per_lumi", false); + htitles = makeHisttitle("Average pixel occupancy ratio of IBL/B0 per event per LB", (atext_LB + ";ratio"), false); + sc = rdoShift.regHist(m_avgocc_ratioIBLB0_per_lumi = TProfile_LW::create(hname.c_str(), htitles.c_str(), nbins_LB, min_LB, max_LB)); + + for (int i = 0; i < PixLayer::COUNT - 1 + (int)(m_doIBL); i++) { // not include IBL2D and IBL3D + hname = makeHistname(("Hits_per_lumi_" + m_modLabel_PixLayerIBL2D3D[i]), false); + htitles = makeHisttitle(("Average number of pixel hits per event, " + m_modLabel_PixLayerIBL2D3D[i]), (atext_LB + atext_hit), false); + sc = rdoExpert.regHist(m_hits_per_lumi_mod[i] = TProfile_LW::create(hname.c_str(), htitles.c_str(), nbins_LB, min_LB, max_LB)); + + hname = makeHistname(("nHits_per_module_per_event_" + m_modLabel_PixLayerIBL2D3D[i]), false); + htitles = makeHisttitle(("Number of hits in a module in an event, " + m_modLabel_PixLayerIBL2D3D[i]), ";#hits in a module in an event;#events #times #modules", false); + sc = rdoShift.regHist(m_nhits_mod[i] = TH1F_LW::create(hname.c_str(), htitles.c_str(), 1000, -0.5, -0.5 + 1000.0)); + + hname = makeHistname(("Hit_ToTMean_" + m_modLabel_PixLayerIBL2D3D[i]), false); + htitles = makeHisttitle(("Hit ToT Mean, " + m_modLabel_PixLayerIBL2D3D[i]), (atext_LB + ";Average Hit ToT"), false); + sc = rdoExpert.regHist(m_hit_ToTMean_mod[i] = TProfile_LW::create(hname.c_str(), htitles.c_str(), nbins_LB, min_LB, max_LB)); - for(int i=0; i<PixLayerIBL2D3D::COUNT; i++){ - if(!m_doIBL && i >= PixLayerIBL2D3D::kIBL ) continue; + if (!m_doOnline) { + hname = makeHistname(("ModOcc_per_lumi_" + m_modLabel_PixLayerIBL2D3D[i]), false); + htitles = makeHisttitle(("Module occupancy per event, " + m_modLabel_PixLayerIBL2D3D[i]), (atext_LB + atext_occ_mod), false); + sc = rdoShift.regHist(m_modocc_per_lumi[i] = TH2F_LW::create(hname.c_str(), htitles.c_str(), nbins_LB, min_LB, max_LB, 100, 0.0001, 0.0101)); + } + } + + for (int i = 0; i < PixLayerIBL2D3D::COUNT; i++) { + if (!m_doIBL && i >= PixLayerIBL2D3D::kIBL) continue; - hname = makeHistname(("AvgOcc_per_lumi_"+m_modLabel_PixLayerIBL2D3D[i]), false); - htitles = makeHisttitle(("Average pixel occupancy per event, "+m_modLabel_PixLayerIBL2D3D[i]), (atext_LB+atext_occ), false); - sc = rdoExpert.regHist(m_avgocc_per_lumi_mod[i] = TProfile_LW::create(hname.c_str(), htitles.c_str(), nbins_LB, min_LB, max_LB)); + hname = makeHistname(("AvgOcc_per_lumi_" + m_modLabel_PixLayerIBL2D3D[i]), false); + htitles = makeHisttitle(("Average pixel occupancy per event, " + m_modLabel_PixLayerIBL2D3D[i]), (atext_LB + atext_occ), false); + sc = rdoExpert.regHist(m_avgocc_per_lumi_mod[i] = TProfile_LW::create(hname.c_str(), htitles.c_str(), nbins_LB, min_LB, max_LB)); - hname = makeHistname(("AvgOcc_per_BCID_"+m_modLabel_PixLayerIBL2D3D[i]), false); - htitles = makeHisttitle(("Average pixel occupancy per BCID, "+m_modLabel_PixLayerIBL2D3D[i]), (atext_BCID+atext_occ), false); - sc = rdoExpert.regHist(m_avgocc_per_bcid_mod[i] = TProfile_LW::create(hname.c_str(), htitles.c_str(), nbins_BCID, min_BCID, max_BCID)); + hname = makeHistname(("AvgOcc_per_BCID_" + m_modLabel_PixLayerIBL2D3D[i]), false); + htitles = makeHisttitle(("Average pixel occupancy per BCID, " + m_modLabel_PixLayerIBL2D3D[i]), (atext_BCID + atext_occ), false); + sc = rdoExpert.regHist(m_avgocc_per_bcid_mod[i] = TProfile_LW::create(hname.c_str(), htitles.c_str(), nbins_BCID, min_BCID, max_BCID)); - hname = makeHistname(("AvgOcc_active_per_lumi_"+m_modLabel_PixLayerIBL2D3D[i]), false); - htitles = makeHisttitle(("Average pixel occupancy for active per event, "+m_modLabel_PixLayerIBL2D3D[i]), (atext_LB+atext_occ), false); - sc = rdoExpert.regHist(m_avgocc_active_per_lumi_mod[i] = TProfile_LW::create(hname.c_str(), htitles.c_str(), nbins_LB, min_LB, max_LB)); + hname = makeHistname(("AvgOcc_active_per_lumi_" + m_modLabel_PixLayerIBL2D3D[i]), false); + htitles = makeHisttitle(("Average pixel occupancy for active per event, " + m_modLabel_PixLayerIBL2D3D[i]), (atext_LB + atext_occ), false); + sc = rdoExpert.regHist(m_avgocc_active_per_lumi_mod[i] = TProfile_LW::create(hname.c_str(), htitles.c_str(), nbins_LB, min_LB, max_LB)); - hname = makeHistname(("MaxOcc_per_lumi_"+m_modLabel_PixLayerIBL2D3D[i]), false); - htitles = makeHisttitle(("Max. pixel occupancy per event, "+m_modLabel_PixLayerIBL2D3D[i]), (atext_LB+atext_occ), false); - sc = rdoShift.regHist(m_maxocc_per_lumi_mod[i] = TH2F_LW::create(hname.c_str(), htitles.c_str(), nbins_LB, min_LB, max_LB, 500, 0.0001, 0.01)); + hname = makeHistname(("MaxOcc_per_lumi_" + m_modLabel_PixLayerIBL2D3D[i]), false); + htitles = makeHisttitle(("Max. pixel occupancy per event, " + m_modLabel_PixLayerIBL2D3D[i]), (atext_LB + atext_occ), false); + sc = rdoShift.regHist(m_maxocc_per_lumi_mod[i] = TH2F_LW::create(hname.c_str(), htitles.c_str(), nbins_LB, min_LB, max_LB, 500, 0.0001, 0.01)); - hname = makeHistname(("MaxOcc_per_BCID_"+m_modLabel_PixLayerIBL2D3D[i]), false); - htitles = makeHisttitle(("Max. pixel occupancy per BCID, "+m_modLabel_PixLayerIBL2D3D[i]), (atext_BCID+atext_occ), false); - sc = rdoShift.regHist(m_maxocc_per_bcid_mod[i] = TH1F_LW::create(hname.c_str(), htitles.c_str(), nbins_BCID, min_BCID, max_BCID)); + hname = makeHistname(("MaxOcc_per_BCID_" + m_modLabel_PixLayerIBL2D3D[i]), false); + htitles = makeHisttitle(("Max. pixel occupancy per BCID, " + m_modLabel_PixLayerIBL2D3D[i]), (atext_BCID + atext_occ), false); + sc = rdoShift.regHist(m_maxocc_per_bcid_mod[i] = TH1F_LW::create(hname.c_str(), htitles.c_str(), nbins_BCID, min_BCID, max_BCID)); - hname = makeHistname(("ToatlHits_per_BCID_"+m_modLabel_PixLayerIBL2D3D[i]), false); - htitles = makeHisttitle(("Total Number of hits per BCID, "+m_modLabel_PixLayerIBL2D3D[i]), (atext_BCID+";#hits"), false); - sc = rdoExpert.regHist(m_totalhits_per_bcid_mod[i] = TH1F_LW::create(hname.c_str(), htitles.c_str(), nbins_BCID, min_BCID, max_BCID)); + hname = makeHistname(("ToatlHits_per_BCID_" + m_modLabel_PixLayerIBL2D3D[i]), false); + htitles = makeHisttitle(("Total Number of hits per BCID, " + m_modLabel_PixLayerIBL2D3D[i]), (atext_BCID + ";#hits"), false); + sc = rdoExpert.regHist(m_totalhits_per_bcid_mod[i] = TH1F_LW::create(hname.c_str(), htitles.c_str(), nbins_BCID, min_BCID, max_BCID)); - hname = makeHistname(("nLargeEvent_per_lumi_"+m_modLabel_PixLayerIBL2D3D[i]), false); - htitles = makeHisttitle(("Number of large events (hitocc > 0.7#times 10^{-3}), "+m_modLabel_PixLayerIBL2D3D[i]), (atext_LB+atext_nevt), false); - sc = rdoShift.regHist(m_nlargeevt_per_lumi_mod[i] = TH1F_LW::create(hname.c_str(), htitles.c_str(), nbins_LB, min_LB, max_LB)); + hname = makeHistname(("nLargeEvent_per_lumi_" + m_modLabel_PixLayerIBL2D3D[i]), false); + htitles = makeHisttitle(("Number of large events (hitocc > 0.7#times 10^{-3}), " + m_modLabel_PixLayerIBL2D3D[i]), (atext_LB + atext_nevt), false); + sc = rdoShift.regHist(m_nlargeevt_per_lumi_mod[i] = TH1F_LW::create(hname.c_str(), htitles.c_str(), nbins_LB, min_LB, max_LB)); + } - } + for (int i = 0; i < PixLayerIBL2D3DDBM::COUNT; i++) { + hname = makeHistname(("Hit_ToT_" + m_modLabel_PixLayerIBL2D3DDBM[i]), false); + htitles = makeHisttitle(("Hit ToT, " + m_modLabel_PixLayerIBL2D3DDBM[i]), (atext_tot + atext_nhit), false); + if (i < PixLayerIBL2D3DDBM::kDBMA) { + sc = rdoExpert.regHist(m_hit_ToT[i] = TH1F_LW::create(hname.c_str(), htitles.c_str(), nbins_tot3, min_tot3, max_tot3)); + } else if (m_doIBL) { + sc = rdoExpert.regHist(m_hit_ToT[i] = TH1F_LW::create(hname.c_str(), htitles.c_str(), nbins_tot4, min_tot4, max_tot4)); + } + } - for(int i=0; i<PixLayerIBL2D3DDBM::COUNT; i++){ - hname = makeHistname(("Hit_ToT_"+m_modLabel_PixLayerIBL2D3DDBM[i]), false); - htitles = makeHisttitle(("Hit ToT, "+m_modLabel_PixLayerIBL2D3DDBM[i]), (atext_tot+atext_nhit), false); - if(i<PixLayerIBL2D3DDBM::kDBMA){ - sc = rdoExpert.regHist(m_hit_ToT[i] = TH1F_LW::create(hname.c_str(), htitles.c_str(), nbins_tot3, min_tot3, max_tot3)); - }else if(m_doIBL){ - sc = rdoExpert.regHist(m_hit_ToT[i] = TH1F_LW::create(hname.c_str(), htitles.c_str(), nbins_tot4, min_tot4, max_tot4)); + m_hitmap_tmp = std::make_unique<PixelMon2DMapsLW>(PixelMon2DMapsLW("HitMap_tmp", ("Hit map for monitoring" + m_histTitleExt).c_str(), PixMon::HistConf::kPixDBMIBL2D3D)); + sc = m_hitmap_tmp->regHist(rdoShift); + + for (int i = 0; i < PixLayer::COUNT; i++) { + hname = makeHistname(("nFEswithHits_" + m_modLabel_PixLayerIBL2D3D[i]), false); + htitles = makeHisttitle(("Number of FEs with hits, " + m_modLabel_PixLayerIBL2D3D[i]), ";lumi block;eta index of module;# FEs with hits in a module in an event;# event #times # modules", false); + 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_doOnline) { + sc = rdoShift.regHist(m_occupancy_time1 = new TProfile("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 = rdoShift.regHist(m_occupancy_time2 = new TProfile("occupancy_time_1hr", ("Module hit occupancy as function of time over 1 hour. 36 sec/bin" + m_histTitleExt + ";time;module occupancy").c_str(), 99, 0., 1., "i")); + sc = rdoShift.regHist(m_occupancy_time3 = new TProfile("occupancy_time_6hr", ("Module hit occupancy as function of time over 6 hours. 3.6 min/bin" + m_histTitleExt + ";time;module occupancy").c_str(), 99, 0., 1., "i")); + + m_hitmap_mon = std::make_unique<PixelMon2DMapsLW>(PixelMon2DMapsLW("HitMap_Mon", ("Hit map for monitoring" + m_histTitleExt).c_str(), PixMon::HistConf::kPixDBMIBL2D3D)); + sc = m_hitmap_mon->regHist(rdoShift); + + for (int i = 0; i < PixLayer::COUNT - 1 + (int)(m_doIBL); i++) { + hname = makeHistname(("Hit_ToT_Mon_" + m_modLabel_PixLayerIBL2D3D[i]), false); + htitles = makeHisttitle(("Hit ToT Monitoring, " + m_modLabel_PixLayerIBL2D3D[i]), (atext_tot + atext_nhit), false); + if (i < PixLayer::kIBL) { + sc = rdoExpert.regHist(m_hit_ToT_Mon_mod[i] = TH1F_LW::create(hname.c_str(), htitles.c_str(), nbins_tot3, min_tot3, max_tot3)); + } else { + sc = rdoExpert.regHist(m_hit_ToT_Mon_mod[i] = TH1F_LW::create(hname.c_str(), htitles.c_str(), nbins_tot4, min_tot4, max_tot4)); } - } - - m_hitmap_tmp = std::make_unique<PixelMon2DMapsLW>(PixelMon2DMapsLW("HitMap_tmp", ("Hit map for monitoring" + m_histTitleExt).c_str(), PixMon::HistConf::kPixDBMIBL2D3D)); - sc = m_hitmap_tmp->regHist(rdoShift); - - for( int i=0; i<PixLayer::COUNT; i++){ - hname = makeHistname(("nFEswithHits_"+m_modLabel_PixLayerIBL2D3D[i]), false); - htitles = makeHisttitle(("Number of FEs with hits, "+m_modLabel_PixLayerIBL2D3D[i]), ";lumi block;eta index of module;# FEs with hits in a module in an event;# event #times # modules", false); - 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_doOnline) - { - sc = rdoShift.regHist(m_occupancy_time1= new TProfile("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 = rdoShift.regHist(m_occupancy_time2= new TProfile("occupancy_time_1hr", ("Module hit occupancy as function of time over 1 hour. 36 sec/bin" + m_histTitleExt + ";time;module occupancy").c_str(), 99,0.,1.,"i")); - sc = rdoShift.regHist(m_occupancy_time3= new TProfile("occupancy_time_6hr", ("Module hit occupancy as function of time over 6 hours. 3.6 min/bin" + m_histTitleExt + ";time;module occupancy").c_str(), 99,0.,1.,"i")); - - m_hitmap_mon = std::make_unique<PixelMon2DMapsLW>(PixelMon2DMapsLW("HitMap_Mon", ("Hit map for monitoring" + m_histTitleExt).c_str(), PixMon::HistConf::kPixDBMIBL2D3D)); - sc = m_hitmap_mon->regHist(rdoShift); - - for (int i=0; i<PixLayer::COUNT-1+(int)(m_doIBL); i++){ - hname = makeHistname(("Hit_ToT_Mon_"+m_modLabel_PixLayerIBL2D3D[i]), false); - htitles = makeHisttitle(("Hit ToT Monitoring, "+m_modLabel_PixLayerIBL2D3D[i]), (atext_tot+atext_nhit), false); - if ( i<PixLayer::kIBL ){ - sc = rdoExpert.regHist(m_hit_ToT_Mon_mod[i] = TH1F_LW::create(hname.c_str(), htitles.c_str(), nbins_tot3, min_tot3, max_tot3)); - } else { - sc = rdoExpert.regHist(m_hit_ToT_Mon_mod[i] = TH1F_LW::create(hname.c_str(), htitles.c_str(), nbins_tot4, min_tot4, max_tot4)); - } - - hname = makeHistname(("Hit_ToT_tmp_"+m_modLabel_PixLayerIBL2D3D[i]), false); - htitles = makeHisttitle(("Hit ToT tmp, "+m_modLabel_PixLayerIBL2D3D[i]), (atext_tot+atext_nhit), false); - if ( i<PixLayer::kIBL ){ - sc = rdoExpert.regHist(m_hit_ToT_tmp_mod[i] = TH1F_LW::create(hname.c_str(), htitles.c_str(), nbins_tot3, min_tot3, max_tot3)); - } else{ - sc = rdoExpert.regHist(m_hit_ToT_tmp_mod[i] = TH1F_LW::create(hname.c_str(), htitles.c_str(), nbins_tot4, min_tot4, max_tot4)); - } - } - } - - if(m_doModules && !m_doOnline){ - for( int i=0; i<PixLayer::COUNT; i++){ - tmp = "ToT_etaphi"; tmp2 = "Average Hit ToT Map"; atitles = ";Module eta;Module phi;Avg. ToT"; - float xmin = -0.5; float xmax = xmin + (1.0 * nmod_eta[i]); - float ymin = -0.5; float ymax = ymin + (1.0 * nmod_phi[i]); - sc= rdoExpert.regHist(m_ToT_etaphi_mod[i] = TProfile2D_LW::create((tmp + "_" + m_modLabel_PixLayerIBL2D3D[i]).c_str(), (tmp2 + ", " + m_modLabel_PixLayerIBL2D3D[i] + m_histTitleExt + atitles).c_str(), nmod_eta[i], xmin, xmax, nmod_phi[i], ymin, ymax)); + + hname = makeHistname(("Hit_ToT_tmp_" + m_modLabel_PixLayerIBL2D3D[i]), false); + htitles = makeHisttitle(("Hit ToT tmp, " + m_modLabel_PixLayerIBL2D3D[i]), (atext_tot + atext_nhit), false); + if (i < PixLayer::kIBL) { + sc = rdoExpert.regHist(m_hit_ToT_tmp_mod[i] = TH1F_LW::create(hname.c_str(), htitles.c_str(), nbins_tot3, min_tot3, max_tot3)); + } else { + sc = rdoExpert.regHist(m_hit_ToT_tmp_mod[i] = TH1F_LW::create(hname.c_str(), htitles.c_str(), nbins_tot4, min_tot4, max_tot4)); } - } - - if (m_doTiming) - { - sc = timeExpert.regHist(m_Lvl1ID_PIX = TH1I_LW::create("LvlID_PIX", ("Level 1 ID (PIX)" + m_histTitleExt + ";level 1 ID" + atext_nhit).c_str(), 20,-0.5,19.5)); - sc = timeExpert.regHist(m_Lvl1ID_IBL = TH1I_LW::create("LvlID_IBL", ("Level 1 ID (IBL)" + m_histTitleExt + ";level 1 ID" + atext_nhit).c_str(), 40,-0.5,39.5)); - sc = timeShift.regHist(m_BCID = TH1I_LW::create("Pixel_BCID", ("BCID" + m_histTitleExt + ";Pixel BCID" + atext_nhit).c_str(), 300,-0.5,299.5)); - sc = timeShift.regHist(m_Atlas_BCID = TH1F_LW::create("Atlas_BCID", ("BCID" + m_histTitleExt + ";ATLAS BCID" + atext_nhit).c_str(), 3500,-0.5,3499.5)); - sc = timeShift.regHist(m_Atlas_BCID_hits = TH2F_LW::create("Atlas_BCID_Hits", ("BCID" + m_histTitleExt + ";BCID" + atext_nhit).c_str(), 3500,-0.5,3499.5,100,0,25000)); - sc = timeExpert.regHist(m_BCID_Profile = TProfile_LW::create("Atlas_BCID_Profile", ("BCID_Profile" + m_histTitleExt + ";BCID" + atext_nhit).c_str(), 3500,-0.5,3499.5)); - sc = timeShift.regHist(m_Lvl1A = TH1F_LW::create("Lvl1A", ("Hit Level 1 Accept" + m_histTitleExt + ";Level 1 Accept" + atext_nhit).c_str(), 14, -1.5, 12.5)); - - for(int i=0; i<PixLayer::COUNT-1+(int)(m_doIBL); i++){ - tmp = "ROD_Module_BCID_" + m_modLabel_PixLayerIBL2D3D[i]; - tmp2 = "Difference between BCID of RODs and Modules, " + m_modLabel_PixLayerIBL2D3D[i] + m_histTitleExt + ";BCID:ROD-Module (#bc) ;Number of Pixels"; - sc = timeExpert.regHist(m_diff_ROD_vs_Module_BCID_mod[i] = TH1I_LW::create(tmp.c_str(), tmp2.c_str(),101,-50.5,50.5)); - - tmp = "Lvl1ID_diff_ATLAS_mod_" + m_modLabel_PixLayerIBL2D3D[i]; - tmp2 = "ATLAS_{Level 1 ID} - Module_{Level 1 ID}, " + m_modLabel_PixLayerIBL2D3D[i] + m_histTitleExt + ";#Delta Level 1 ID; # hits"; - sc = timeExpert.regHist(m_Lvl1ID_diff_mod_ATLAS_mod[i] = TH1I_LW::create(tmp.c_str(), tmp2.c_str(), 201, -200.5, 200.5)); - } - - for(int i=0; i<PixLayerDBM::COUNT-1+(int)(m_doIBL); i++){ - hname = makeHistname(("Lvl1A_"+m_modLabel_PixLayerDBM[i]), false); - htitles = makeHisttitle(("Hit Level 1 Accept, "+m_modLabel_PixLayerDBM[i]), (atext_lv1+atext_nhit), false); - sc = timeShift.regHist(m_Lvl1A_mod[i] = TH1F_LW::create(hname.c_str(), htitles.c_str(), 14, -1.5, 12.5)); - } - } - - if (m_do2DMaps) - { - m_occupancy = std::make_unique<PixelMon2DMapsLW>(PixelMon2DMapsLW("Occupancy", ("hit map"+ m_histTitleExt).c_str(), PixMon::HistConf::kPixDBMIBL2D3D)); - sc = m_occupancy->regHist(rdoShift); - - m_average_pixocc = std::make_unique<PixelMon2DMapsLW>(PixelMon2DMapsLW("Occupancy_per_pixel", ("#hits / pixel" + m_histTitleExt).c_str(), PixMon::HistConf::kPixDBMIBL2D3D, false)); - sc = m_average_pixocc->regHist(rdoShift); - - m_occupancy_pix_evt = std::make_unique<PixelMon2DProfilesLW>(PixelMon2DProfilesLW("Occupancy_per_pixel_event", ("#hits / pixel / event" + m_histTitleExt).c_str(), PixMon::HistConf::kPixIBL2D3D)); - sc = m_occupancy_pix_evt->regHist(rdoShift); - - m_Lvl1ID_diff_mod_ATLAS_per_LB = std::make_unique<PixelMon2DLumiProfiles>(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", PixMon::HistConf::kPixIBL)); - sc = m_Lvl1ID_diff_mod_ATLAS_per_LB->regHist(timeExpert); - - m_Lvl1ID_absdiff_mod_ATLAS_per_LB = std::make_unique<PixelMon2DLumiProfiles>(PixelMon2DLumiProfiles("Lvl1ID_absdiff_ATLAS_mod_per_LB", ("ATLAS_{Level 1 ID} - Module_{Level 1 ID} per LB" + m_histTitleExt).c_str(),"#Delta Level 1 ID", PixMon::HistConf::kPixIBL)); - sc = m_Lvl1ID_absdiff_mod_ATLAS_per_LB->regHist(timeExpert); - } - - if (m_doModules) - { - m_hit_num_mod = std::make_unique<PixelMonModules1D>(PixelMonModules1D("Hit_num", ("Number of hits in a module in an event" + m_histTitleExt).c_str(), 15,-0.5,149.5)); - sc = m_hit_num_mod->regHist(this,(path+"/Modules_NumberOfHits").c_str(),run); - m_hiteff_mod = std::make_unique<PixelMonModulesProf>(PixelMonModulesProf("Hit_track_eff", ("Proportion of hits on track" + m_histTitleExt).c_str(), 2500,-0.5,2499.5)); - sc = m_hiteff_mod->regHist(this,(path+"/Modules_HitEff").c_str(),run); - m_FE_chip_hit_summary = std::make_unique<PixelMonModules1D>(PixelMonModules1D("FE_Chip_Summary", ("FE Chip Summary" + m_histTitleExt).c_str(), 16,-0.5,15.5)); - sc = m_FE_chip_hit_summary->regHist(this,(path+"/Modules_FEChipSummary").c_str(),run); - } - - if (m_doLowOccupancy || m_doHighOccupancy) - { - int nbins_hits = 2000; float max_hits = 80000.0; - int nbins_avhits = 100; float max_avhits = 100.0; - - if(m_doLowOccupancy){ - nbins_hits = 200; max_hits = 200.0; - nbins_avhits = 50; max_avhits = 2.0; - } - - if(m_doHeavyIonMon){ max_hits = 350000; max_avhits = 2500; } - - sc = rdoShift.regHist(m_num_hits= TH1I_LW::create("num_hits", ("Number of pixel hits in an event" + m_histTitleExt + ";# pixel hits/event;# events").c_str(), nbins_hits, 0., max_hits)); - - for(int i=0; i<PixLayer::COUNT-1+(int)(m_doIBL); i++){ - hname = makeHistname(("Occupancy_Summary_"+m_modLabel_PixLayerIBL2D3D[i]), false); - htitles = makeHisttitle(("Average hit occupancy, "+m_modLabel_PixLayerIBL2D3D[i]), ";average # hits in a module in an event;# modules", false); - sc = rdoExpert.regHist(m_occupancy_summary_mod[i] = TH1F_LW::create(hname.c_str(), htitles.c_str(), nbins_avhits, 0., max_avhits)); - } - } - if (m_doPixelOccupancy) - { - m_pixel_occupancy = std::make_unique<PixelMonModules2D>(PixelMonModules2D("Pixel_Occupancy", ("Pixel Occupancy" + m_histTitleExt).c_str(), 160, -0.,160.,336,0.,336.)); - sc = m_pixel_occupancy->regHist(this,(path+"/PixelOccupancy").c_str(),run); - } - - if (m_doDetails) - /// 4 special modules - { - sc = rdoExpert.regHist(m_Details_mod1_num_hits = TH1F_LW::create(("Details_num_hits_"+m_DetailsMod1).c_str(), ("number of pixel hits per event for mod1" + m_histTitleExt).c_str(), 100,-0.,100)); - sc = rdoExpert.regHist(m_Details_mod2_num_hits = TH1F_LW::create(("Details_num_hits_"+m_DetailsMod2).c_str(), ("number of pixel hits per event for mod2" + m_histTitleExt).c_str(), 100,-0.,100)); - sc = rdoExpert.regHist(m_Details_mod3_num_hits = TH1F_LW::create(("Details_num_hits_"+m_DetailsMod3).c_str(), ("number of pixel hits per event for mod3" + m_histTitleExt).c_str(), 100,-0.,100)); - sc = rdoExpert.regHist(m_Details_mod4_num_hits = TH1F_LW::create(("Details_num_hits_"+m_DetailsMod4).c_str(), ("number of pixel hits per event for mod4" + m_histTitleExt).c_str(), 100,-0.,100)); - //New ranges for 2 FEI4Bs: - sc = rdoExpert.regHist(m_Details_mod1_occupancy = TH2F_LW::create(("Details_occupancy_"+m_DetailsMod1).c_str(), ("column vs row hitmap for mod1" + m_histTitleExt).c_str(), 160,-0.5,155.5,336,-0.5,335.5)); - sc = rdoExpert.regHist(m_Details_mod2_occupancy = TH2F_LW::create(("Details_occupancy_"+m_DetailsMod2).c_str(), ("column vs row hitmap for mod2" + m_histTitleExt).c_str(), 160,-0.5,155.5,336,-0.5,335.5)); - sc = rdoExpert.regHist(m_Details_mod3_occupancy = TH2F_LW::create(("Details_occupancy_"+m_DetailsMod3).c_str(), ("column vs row hitmap for mod3" + m_histTitleExt).c_str(), 160,-0.5,155.5,336,-0.5,335.5)); - sc = rdoExpert.regHist(m_Details_mod4_occupancy = TH2F_LW::create(("Details_occupancy_"+m_DetailsMod4).c_str(), ("column vs row hitmap for mod4" + m_histTitleExt).c_str(), 160,-0.5,155.5,336,-0.5,335.5)); - sc = rdoExpert.regHist(m_Details_mod1_ToT = TH1F_LW::create(("Details_ToT_"+m_DetailsMod1).c_str(), ("ToT mod1" + m_histTitleExt).c_str(), 300,-0.5,299.5)); - sc = rdoExpert.regHist(m_Details_mod2_ToT = TH1F_LW::create(("Details_ToT_"+m_DetailsMod2).c_str(), ("ToT mod2" + m_histTitleExt).c_str(), 300,-0.5,299.5)); - sc = rdoExpert.regHist(m_Details_mod3_ToT = TH1F_LW::create(("Details_ToT_"+m_DetailsMod3).c_str(), ("ToT mod3" + m_histTitleExt).c_str(), 300,-0.5,299.5)); - sc = rdoExpert.regHist(m_Details_mod4_ToT = TH1F_LW::create(("Details_ToT_"+m_DetailsMod4).c_str(), ("ToT mod4" + m_histTitleExt).c_str(), 300,-0.5,299.5)); - } - - if (m_doOfflineAnalysis) { - /// Quick Status - /// - hname = makeHistname("Hits_per_lumi_L0_B11_S2_C6", false); - htitles = makeHisttitle("Number of hits, L0_B11_S2_C6", ";lumi block;FE ID (16*(6-eta_mod) + 8*(pix_phi/164) + (eta_pix/18);#hits", false); - sc = rdoShift.regHist(m_nhits_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_nhits_L0_B11_S2_C6->SetOption("colz"); - - hname = makeHistname("Occupancy_per_lumi_L0_B11_S2_C6", false); - htitles = makeHisttitle("Average pixel occupancy per event, L0_B11_S2_C6", ";lumi block;FE ID (16*(6-eta_mod) + 8*(pix_phi/164) + (eta_pix/18);#hits/pixel/event", false); - sc = rdoShift.regHist(m_occupancy_L0_B11_S2_C6 = TProfile2D_LW::create(hname.c_str(), htitles.c_str(), nbins_LB, min_LB, max_LB, 96, -0.5, -0.5+96)); - m_occupancy_L0_B11_S2_C6->SetOption("colz"); - - for(int i=0; i<PixLayerIBL2D3D::COUNT; i++){ - hname = makeHistname(("AvgOcc_per_BCID_per_lumi_"+m_modLabel_PixLayerIBL2D3D[i]), false); - htitles = makeHisttitle(("Average pixel occupancy per BCID per lumi, "+m_modLabel_PixLayerIBL2D3D[i]), (atext_LB+atext_BCID+atext_occ), false); - sc = rdoExpert.regHist(m_avgocc_per_bcid_per_lumi_mod[i] = TProfile2D_LW::create(hname.c_str(), htitles.c_str(), 2000, -0.5, -0.5+2000, nbins_BCID, min_BCID, max_BCID)); - - hname = makeHistname(("Hit_ToT_per_lumi_"+m_modLabel_PixLayerIBL2D3D[i]), false); - htitles = makeHisttitle(("Hit ToT per lumi, "+m_modLabel_PixLayerIBL2D3D[i]), (atext_LB+atext_tot+atext_occ), false); - sc = rdoExpert.regHist(m_hit_ToT_per_lumi_mod[i] = TH2F_LW::create(hname.c_str(), htitles.c_str(), 2000, -0.5, -0.5+2000, nbins_tot3, min_tot3, max_tot3)); - - } - } - - if (sc.isFailure()) ATH_MSG_WARNING("Problems with booking Hit histograms"); - return StatusCode::SUCCESS; + } + } + + if (m_doModules && !m_doOnline) { + for (int i = 0; i < PixLayer::COUNT; i++) { + tmp = "ToT_etaphi"; + tmp2 = "Average Hit ToT Map"; + atitles = ";Module eta;Module phi;Avg. ToT"; + float xmin = -0.5; + float xmax = xmin + (1.0 * nmod_eta[i]); + float ymin = -0.5; + float ymax = ymin + (1.0 * nmod_phi[i]); + sc = rdoExpert.regHist(m_ToT_etaphi_mod[i] = TProfile2D_LW::create((tmp + "_" + m_modLabel_PixLayerIBL2D3D[i]).c_str(), (tmp2 + ", " + m_modLabel_PixLayerIBL2D3D[i] + m_histTitleExt + atitles).c_str(), nmod_eta[i], xmin, xmax, nmod_phi[i], ymin, ymax)); + } + } + + if (m_doTiming) { + sc = timeExpert.regHist(m_Lvl1ID_PIX = TH1I_LW::create("LvlID_PIX", ("Level 1 ID (PIX)" + m_histTitleExt + ";level 1 ID" + atext_nhit).c_str(), 20, -0.5, 19.5)); + sc = timeExpert.regHist(m_Lvl1ID_IBL = TH1I_LW::create("LvlID_IBL", ("Level 1 ID (IBL)" + m_histTitleExt + ";level 1 ID" + atext_nhit).c_str(), 40, -0.5, 39.5)); + sc = timeShift.regHist(m_BCID = TH1I_LW::create("Pixel_BCID", ("BCID" + m_histTitleExt + ";Pixel BCID" + atext_nhit).c_str(), 300, -0.5, 299.5)); + sc = timeShift.regHist(m_Atlas_BCID = TH1F_LW::create("Atlas_BCID", ("BCID" + m_histTitleExt + ";ATLAS BCID" + atext_nhit).c_str(), 3500, -0.5, 3499.5)); + sc = timeShift.regHist(m_Atlas_BCID_hits = TH2F_LW::create("Atlas_BCID_Hits", ("BCID" + m_histTitleExt + ";BCID" + atext_nhit).c_str(), 3500, -0.5, 3499.5, 100, 0, 25000)); + sc = timeExpert.regHist(m_BCID_Profile = TProfile_LW::create("Atlas_BCID_Profile", ("BCID_Profile" + m_histTitleExt + ";BCID" + atext_nhit).c_str(), 3500, -0.5, 3499.5)); + sc = timeShift.regHist(m_Lvl1A = TH1F_LW::create("Lvl1A", ("Hit Level 1 Accept" + m_histTitleExt + ";Level 1 Accept" + atext_nhit).c_str(), 14, -1.5, 12.5)); + + for (int i = 0; i < PixLayer::COUNT - 1 + (int)(m_doIBL); i++) { + tmp = "ROD_Module_BCID_" + m_modLabel_PixLayerIBL2D3D[i]; + tmp2 = "Difference between BCID of RODs and Modules, " + m_modLabel_PixLayerIBL2D3D[i] + m_histTitleExt + ";BCID:ROD-Module (#bc) ;Number of Pixels"; + sc = timeExpert.regHist(m_diff_ROD_vs_Module_BCID_mod[i] = TH1I_LW::create(tmp.c_str(), tmp2.c_str(), 101, -50.5, 50.5)); + + tmp = "Lvl1ID_diff_ATLAS_mod_" + m_modLabel_PixLayerIBL2D3D[i]; + tmp2 = "ATLAS_{Level 1 ID} - Module_{Level 1 ID}, " + m_modLabel_PixLayerIBL2D3D[i] + m_histTitleExt + ";#Delta Level 1 ID; # hits"; + sc = timeExpert.regHist(m_Lvl1ID_diff_mod_ATLAS_mod[i] = TH1I_LW::create(tmp.c_str(), tmp2.c_str(), 201, -200.5, 200.5)); + } + + for (int i = 0; i < PixLayerDBM::COUNT - 1 + (int)(m_doIBL); i++) { + hname = makeHistname(("Lvl1A_" + m_modLabel_PixLayerDBM[i]), false); + htitles = makeHisttitle(("Hit Level 1 Accept, " + m_modLabel_PixLayerDBM[i]), (atext_lv1 + atext_nhit), false); + sc = timeShift.regHist(m_Lvl1A_mod[i] = TH1F_LW::create(hname.c_str(), htitles.c_str(), 14, -1.5, 12.5)); + } + } + + if (m_do2DMaps) { + m_occupancy = std::make_unique<PixelMon2DMapsLW>(PixelMon2DMapsLW("Occupancy", ("hit map" + m_histTitleExt).c_str(), PixMon::HistConf::kPixDBMIBL2D3D)); + sc = m_occupancy->regHist(rdoShift); + + m_average_pixocc = std::make_unique<PixelMon2DMapsLW>(PixelMon2DMapsLW("Occupancy_per_pixel", ("#hits / pixel" + m_histTitleExt).c_str(), PixMon::HistConf::kPixDBMIBL2D3D, false)); + sc = m_average_pixocc->regHist(rdoShift); + + m_occupancy_pix_evt = std::make_unique<PixelMon2DProfilesLW>(PixelMon2DProfilesLW("Occupancy_per_pixel_event", ("#hits / pixel / event" + m_histTitleExt).c_str(), PixMon::HistConf::kPixIBL2D3D)); + sc = m_occupancy_pix_evt->regHist(rdoShift); + + m_Lvl1ID_diff_mod_ATLAS_per_LB = std::make_unique<PixelMon2DLumiProfiles>(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", PixMon::HistConf::kPixIBL)); + sc = m_Lvl1ID_diff_mod_ATLAS_per_LB->regHist(timeExpert); + + m_Lvl1ID_absdiff_mod_ATLAS_per_LB = std::make_unique<PixelMon2DLumiProfiles>(PixelMon2DLumiProfiles("Lvl1ID_absdiff_ATLAS_mod_per_LB", ("ATLAS_{Level 1 ID} - Module_{Level 1 ID} per LB" + m_histTitleExt).c_str(), "#Delta Level 1 ID", PixMon::HistConf::kPixIBL)); + sc = m_Lvl1ID_absdiff_mod_ATLAS_per_LB->regHist(timeExpert); + } + + if (m_doModules) { + m_hit_num_mod = std::make_unique<PixelMonModules1D>(PixelMonModules1D("Hit_num", ("Number of hits in a module in an event" + m_histTitleExt).c_str(), 15, -0.5, 149.5)); + sc = m_hit_num_mod->regHist(this, (path + "/Modules_NumberOfHits").c_str(), run); + m_hiteff_mod = std::make_unique<PixelMonModulesProf>(PixelMonModulesProf("Hit_track_eff", ("Proportion of hits on track" + m_histTitleExt).c_str(), 2500, -0.5, 2499.5)); + sc = m_hiteff_mod->regHist(this, (path + "/Modules_HitEff").c_str(), run); + m_FE_chip_hit_summary = std::make_unique<PixelMonModules1D>(PixelMonModules1D("FE_Chip_Summary", ("FE Chip Summary" + m_histTitleExt).c_str(), 16, -0.5, 15.5)); + sc = m_FE_chip_hit_summary->regHist(this, (path + "/Modules_FEChipSummary").c_str(), run); + } + + if (m_doLowOccupancy || m_doHighOccupancy) { + int nbins_hits = 2000; + float max_hits = 80000.0; + int nbins_avhits = 100; + float max_avhits = 100.0; + + if (m_doLowOccupancy) { + nbins_hits = 200; + max_hits = 200.0; + nbins_avhits = 50; + max_avhits = 2.0; + } + + if (m_doHeavyIonMon) { + max_hits = 350000; + max_avhits = 2500; + } + + sc = rdoShift.regHist(m_num_hits = TH1I_LW::create("num_hits", ("Number of pixel hits in an event" + m_histTitleExt + ";# pixel hits/event;# events").c_str(), nbins_hits, 0., max_hits)); + + for (int i = 0; i < PixLayer::COUNT - 1 + (int)(m_doIBL); i++) { + hname = makeHistname(("Occupancy_Summary_" + m_modLabel_PixLayerIBL2D3D[i]), false); + htitles = makeHisttitle(("Average hit occupancy, " + m_modLabel_PixLayerIBL2D3D[i]), ";average # hits in a module in an event;# modules", false); + sc = rdoExpert.regHist(m_occupancy_summary_mod[i] = TH1F_LW::create(hname.c_str(), htitles.c_str(), nbins_avhits, 0., max_avhits)); + } + } + if (m_doPixelOccupancy) { + m_pixel_occupancy = std::make_unique<PixelMonModules2D>(PixelMonModules2D("Pixel_Occupancy", ("Pixel Occupancy" + m_histTitleExt).c_str(), 160, -0., 160., 336, 0., 336.)); + sc = m_pixel_occupancy->regHist(this, (path + "/PixelOccupancy").c_str(), run); + } + + if (m_doDetails) { + // evaluate for specific modules + sc = rdoExpert.regHist(m_Details_mod1_num_hits = TH1F_LW::create(("Details_num_hits_" + m_DetailsMod1).c_str(), ("number of pixel hits per event for mod1" + m_histTitleExt).c_str(), 100, -0., 100)); + sc = rdoExpert.regHist(m_Details_mod2_num_hits = TH1F_LW::create(("Details_num_hits_" + m_DetailsMod2).c_str(), ("number of pixel hits per event for mod2" + m_histTitleExt).c_str(), 100, -0., 100)); + sc = rdoExpert.regHist(m_Details_mod3_num_hits = TH1F_LW::create(("Details_num_hits_" + m_DetailsMod3).c_str(), ("number of pixel hits per event for mod3" + m_histTitleExt).c_str(), 100, -0., 100)); + sc = rdoExpert.regHist(m_Details_mod4_num_hits = TH1F_LW::create(("Details_num_hits_" + m_DetailsMod4).c_str(), ("number of pixel hits per event for mod4" + m_histTitleExt).c_str(), 100, -0., 100)); + // New ranges for 2 FEI4Bs: + sc = rdoExpert.regHist(m_Details_mod1_occupancy = TH2F_LW::create(("Details_occupancy_" + m_DetailsMod1).c_str(), ("column vs row hitmap for mod1" + m_histTitleExt).c_str(), 160, -0.5, 155.5, 336, -0.5, 335.5)); + sc = rdoExpert.regHist(m_Details_mod2_occupancy = TH2F_LW::create(("Details_occupancy_" + m_DetailsMod2).c_str(), ("column vs row hitmap for mod2" + m_histTitleExt).c_str(), 160, -0.5, 155.5, 336, -0.5, 335.5)); + sc = rdoExpert.regHist(m_Details_mod3_occupancy = TH2F_LW::create(("Details_occupancy_" + m_DetailsMod3).c_str(), ("column vs row hitmap for mod3" + m_histTitleExt).c_str(), 160, -0.5, 155.5, 336, -0.5, 335.5)); + sc = rdoExpert.regHist(m_Details_mod4_occupancy = TH2F_LW::create(("Details_occupancy_" + m_DetailsMod4).c_str(), ("column vs row hitmap for mod4" + m_histTitleExt).c_str(), 160, -0.5, 155.5, 336, -0.5, 335.5)); + sc = rdoExpert.regHist(m_Details_mod1_ToT = TH1F_LW::create(("Details_ToT_" + m_DetailsMod1).c_str(), ("ToT mod1" + m_histTitleExt).c_str(), 300, -0.5, 299.5)); + sc = rdoExpert.regHist(m_Details_mod2_ToT = TH1F_LW::create(("Details_ToT_" + m_DetailsMod2).c_str(), ("ToT mod2" + m_histTitleExt).c_str(), 300, -0.5, 299.5)); + sc = rdoExpert.regHist(m_Details_mod3_ToT = TH1F_LW::create(("Details_ToT_" + m_DetailsMod3).c_str(), ("ToT mod3" + m_histTitleExt).c_str(), 300, -0.5, 299.5)); + sc = rdoExpert.regHist(m_Details_mod4_ToT = TH1F_LW::create(("Details_ToT_" + m_DetailsMod4).c_str(), ("ToT mod4" + m_histTitleExt).c_str(), 300, -0.5, 299.5)); + } + + if (m_doOfflineAnalysis) { + // Quick Status + hname = makeHistname("Hits_per_lumi_L0_B11_S2_C6", false); + htitles = makeHisttitle("Number of hits, L0_B11_S2_C6", ";lumi block;FE ID (16*(6-eta_mod) + 8*(pix_phi/164) + (eta_pix/18);#hits", false); + sc = rdoShift.regHist(m_nhits_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_nhits_L0_B11_S2_C6->SetOption("colz"); + + hname = makeHistname("Occupancy_per_lumi_L0_B11_S2_C6", false); + htitles = makeHisttitle("Average pixel occupancy per event, L0_B11_S2_C6", ";lumi block;FE ID (16*(6-eta_mod) + 8*(pix_phi/164) + (eta_pix/18);#hits/pixel/event", false); + sc = rdoShift.regHist(m_occupancy_L0_B11_S2_C6 = TProfile2D_LW::create(hname.c_str(), htitles.c_str(), nbins_LB, min_LB, max_LB, 96, -0.5, -0.5 + 96)); + m_occupancy_L0_B11_S2_C6->SetOption("colz"); + + for (int i = 0; i < PixLayerIBL2D3D::COUNT; i++) { + hname = makeHistname(("AvgOcc_per_BCID_per_lumi_" + m_modLabel_PixLayerIBL2D3D[i]), false); + htitles = makeHisttitle(("Average pixel occupancy per BCID per lumi, " + m_modLabel_PixLayerIBL2D3D[i]), (atext_LB + atext_BCID + atext_occ), false); + sc = rdoExpert.regHist(m_avgocc_per_bcid_per_lumi_mod[i] = TProfile2D_LW::create(hname.c_str(), htitles.c_str(), 2000, -0.5, -0.5 + 2000, nbins_BCID, min_BCID, max_BCID)); + + hname = makeHistname(("Hit_ToT_per_lumi_" + m_modLabel_PixLayerIBL2D3D[i]), false); + htitles = makeHisttitle(("Hit ToT per lumi, " + m_modLabel_PixLayerIBL2D3D[i]), (atext_LB + atext_tot + atext_occ), false); + sc = rdoExpert.regHist(m_hit_ToT_per_lumi_mod[i] = TH2F_LW::create(hname.c_str(), htitles.c_str(), 2000, -0.5, -0.5 + 2000, nbins_tot3, min_tot3, max_tot3)); + } + } + + if (sc.isFailure()) ATH_MSG_WARNING("Problems with booking Hit histograms"); + return StatusCode::SUCCESS; } -StatusCode PixelMainMon::BookHitsLumiBlockMon(void) -{ - ATH_MSG_DEBUG("Start booking Hits histograms per LB (low stat)"); - - std::string path = "Pixel/LumiBlock"; - if(m_doOnTrack) path.replace(path.begin(), path.end(), "Pixel/LumiBlockOnTrack"); - MonGroup lumiBlockHist( this, path.c_str(), lowStat, ATTRIB_MANAGED); //declare a group of histograms - - std::string hname; - std::string htitles; - std::string atext_LB = ";lumi block"; - std::string atext_nevt = ";# events"; - std::string atext_nhit = ";# hits"; - std::string atext_hit = ";# hits/event"; - std::string atext_occ = ";# hits/pixel/event"; - std::string atext_tot = ";ToT [BC]"; - std::string atext_lv1 = ";Level 1 Accept"; - - StatusCode sc; - - if(m_doLowOccupancy || m_doHighOccupancy) { - int nbins_hits = 100; double min_hits = -0.5; double max_hits = min_hits + 25000.0; - if(m_doLowOccupancy){ - nbins_hits = 200; max_hits = min_hits + 200.0; - } - hname = makeHistname("num_hits_LB", false); - htitles = makeHisttitle("Number of pixel hits in an event", (atext_hit+atext_nevt), false); - sc = lumiBlockHist.regHist(m_num_hits_LB = TH1I_LW::create(hname.c_str(), htitles.c_str(), nbins_hits, min_hits, max_hits)); - } - if(m_doModules) { - hname = makeHistname("num_Hits_mod_LB", false); - htitles = makeHisttitle("Number of pixel hits in a module in an event", (atext_hit+atext_nevt), false); - m_hit_num_mod_LB = std::make_unique<PixelMonModules1D>(PixelMonModules1D(hname.c_str(), htitles.c_str(), 20, -0.5, 19.5)); - sc = m_hit_num_mod_LB->regHist(this, (path+"/Modules_NumberOfHits").c_str(), lowStat); - } - for( int i=0; i<PixLayer::COUNT; i++){ - hname = makeHistname(("Hit_ToT_LB_"+m_modLabel_PixLayerIBL2D3D[i]), false); - htitles = makeHisttitle(("Hit ToT, "+m_modLabel_PixLayerIBL2D3D[i]), (atext_tot+atext_nhit), false); - if(i != PixLayer::kIBL){ - sc = lumiBlockHist.regHist(m_hit_ToT_LB_mod[i] = TH1F_LW::create(hname.c_str(), htitles.c_str(), 300, -0.5, 299.5)); - }else{ - sc = lumiBlockHist.regHist(m_hit_ToT_LB_mod[i] = TH1F_LW::create(hname.c_str(), htitles.c_str(), 20, -0.5, 19.5)); - } +StatusCode PixelMainMon::bookHitsLumiBlockMon(void) { + ATH_MSG_DEBUG("Start booking Hits histograms per LB (low stat)"); + + std::string path = "Pixel/LumiBlock"; + if (m_doOnTrack) path.replace(path.begin(), path.end(), "Pixel/LumiBlockOnTrack"); + MonGroup lumiBlockHist(this, path.c_str(), lowStat, ATTRIB_MANAGED); // declare a group of histograms - hname = makeHistname(("Lvl1A_10min_"+m_modLabel_PixLayerIBL2D3D[i]), false); - htitles = makeHisttitle(("Hit Level 1 Accept, "+m_modLabel_PixLayerIBL2D3D[i]), (atext_lv1+atext_nhit), false); - sc = lumiBlockHist.regHist(m_Lvl1A_10min_mod[i] = TH1F_LW::create(hname.c_str(), htitles.c_str(), 14, -1.5, 12.5)); - } + std::string hname; + std::string htitles; + std::string atext_LB = ";lumi block"; + std::string atext_nevt = ";# events"; + std::string atext_nhit = ";# hits"; + std::string atext_hit = ";# hits/event"; + std::string atext_occ = ";# hits/pixel/event"; + std::string atext_tot = ";ToT [BC]"; + std::string atext_lv1 = ";Level 1 Accept"; - m_occupancy_10min = std::make_unique<PixelMon2DMapsLW>(PixelMon2DMapsLW("Occupancy_10min", ("hit occupancy" + m_histTitleExt).c_str(), PixMon::HistConf::kPixDBMIBL2D3D)); - sc = m_occupancy_10min->regHist(lumiBlockHist); - - if (sc.isFailure()) ATH_MSG_WARNING("Problems with booking Hit histograms per LB (low stat)"); - return StatusCode::SUCCESS; + StatusCode sc; + + if (m_doLowOccupancy || m_doHighOccupancy) { + int nbins_hits = 100; + double min_hits = -0.5; + double max_hits = min_hits + 25000.0; + if (m_doLowOccupancy) { + nbins_hits = 200; + max_hits = min_hits + 200.0; + } + hname = makeHistname("num_hits_LB", false); + htitles = makeHisttitle("Number of pixel hits in an event", (atext_hit + atext_nevt), false); + sc = lumiBlockHist.regHist(m_num_hits_LB = TH1I_LW::create(hname.c_str(), htitles.c_str(), nbins_hits, min_hits, max_hits)); + } + if (m_doModules) { + hname = makeHistname("num_Hits_mod_LB", false); + htitles = makeHisttitle("Number of pixel hits in a module in an event", (atext_hit + atext_nevt), false); + m_hit_num_mod_LB = std::make_unique<PixelMonModules1D>(PixelMonModules1D(hname.c_str(), htitles.c_str(), 20, -0.5, 19.5)); + sc = m_hit_num_mod_LB->regHist(this, (path + "/Modules_NumberOfHits").c_str(), lowStat); + } + for (int i = 0; i < PixLayer::COUNT; i++) { + hname = makeHistname(("Hit_ToT_LB_" + m_modLabel_PixLayerIBL2D3D[i]), false); + htitles = makeHisttitle(("Hit ToT, " + m_modLabel_PixLayerIBL2D3D[i]), (atext_tot + atext_nhit), false); + if (i != PixLayer::kIBL) { + sc = lumiBlockHist.regHist(m_hit_ToT_LB_mod[i] = TH1F_LW::create(hname.c_str(), htitles.c_str(), 300, -0.5, 299.5)); + } else { + sc = lumiBlockHist.regHist(m_hit_ToT_LB_mod[i] = TH1F_LW::create(hname.c_str(), htitles.c_str(), 20, -0.5, 19.5)); + } + + hname = makeHistname(("Lvl1A_10min_" + m_modLabel_PixLayerIBL2D3D[i]), false); + htitles = makeHisttitle(("Hit Level 1 Accept, " + m_modLabel_PixLayerIBL2D3D[i]), (atext_lv1 + atext_nhit), false); + sc = lumiBlockHist.regHist(m_Lvl1A_10min_mod[i] = TH1F_LW::create(hname.c_str(), htitles.c_str(), 14, -1.5, 12.5)); + } + + m_occupancy_10min = std::make_unique<PixelMon2DMapsLW>(PixelMon2DMapsLW("Occupancy_10min", ("hit occupancy" + m_histTitleExt).c_str(), PixMon::HistConf::kPixDBMIBL2D3D)); + sc = m_occupancy_10min->regHist(lumiBlockHist); + + if (sc.isFailure()) ATH_MSG_WARNING("Problems with booking Hit histograms per LB (low stat)"); + return StatusCode::SUCCESS; } -StatusCode PixelMainMon::FillHitsMon(void) //Called once per event +StatusCode PixelMainMon::fillHitsMon(void) // Called once per event { - int DetailsMod1 = 0; int DetailsMod2 = 0; int DetailsMod3 = 0; int DetailsMod4 = 0; - int nhitsM1=0; - int nhitsM2=0; - int nhitsM3=0; - int nhitsM4=0; - if(m_doDetails) - { - DetailsMod1 = ParseDetailsString(m_DetailsMod1); - DetailsMod2 = ParseDetailsString(m_DetailsMod2); - DetailsMod3 = ParseDetailsString(m_DetailsMod3); - DetailsMod4 = ParseDetailsString(m_DetailsMod4); - } + int nhitsM1 = 0; + int nhitsM2 = 0; + int nhitsM3 = 0; + int nhitsM4 = 0; + if (m_doDetails) { + DetailsMod1 = parseDetailsString(m_DetailsMod1); + DetailsMod2 = parseDetailsString(m_DetailsMod2); + DetailsMod3 = parseDetailsString(m_DetailsMod3); + DetailsMod4 = parseDetailsString(m_DetailsMod4); + } static constexpr int nmod_phi[PixLayer::COUNT] = {48, 48, 22, 38, 52, 14}; static constexpr int nmod_eta[PixLayer::COUNT] = {3, 3, 13, 13, 13, 20}; - + // Reset the centrally saved hit arrays back to zero. memset(m_HitPerEventArray_disksA, 0, sizeof(m_HitPerEventArray_disksA[0][0]) * nmod_phi[PixLayer::kECA] * nmod_eta[PixLayer::kECA]); memset(m_HitPerEventArray_disksC, 0, sizeof(m_HitPerEventArray_disksC[0][0]) * nmod_phi[PixLayer::kECC] * nmod_eta[PixLayer::kECC]); - memset(m_HitPerEventArray_l0, 0, sizeof(m_HitPerEventArray_l0[0][0]) * nmod_phi[PixLayer::kB0] * nmod_eta[PixLayer::kB0]); - memset(m_HitPerEventArray_l1, 0, sizeof(m_HitPerEventArray_l1[0][0]) * nmod_phi[PixLayer::kB1] * nmod_eta[PixLayer::kB1]); - memset(m_HitPerEventArray_l2, 0, sizeof(m_HitPerEventArray_l2[0][0]) * nmod_phi[PixLayer::kB2] * nmod_eta[PixLayer::kB2]); - memset(m_HitPerEventArray_lI, 0, sizeof(m_HitPerEventArray_lI[0][0]) * nmod_phi[PixLayer::kIBL] * nmod_eta[PixLayer::kIBL]); + memset(m_HitPerEventArray_l0, 0, sizeof(m_HitPerEventArray_l0[0][0]) * nmod_phi[PixLayer::kB0] * nmod_eta[PixLayer::kB0]); + memset(m_HitPerEventArray_l1, 0, sizeof(m_HitPerEventArray_l1[0][0]) * nmod_phi[PixLayer::kB1] * nmod_eta[PixLayer::kB1]); + memset(m_HitPerEventArray_l2, 0, sizeof(m_HitPerEventArray_l2[0][0]) * nmod_phi[PixLayer::kB2] * nmod_eta[PixLayer::kB2]); + memset(m_HitPerEventArray_lI, 0, sizeof(m_HitPerEventArray_lI[0][0]) * nmod_phi[PixLayer::kIBL] * nmod_eta[PixLayer::kIBL]); - double nhits=0; - double nhits_mod[PixLayerIBL2D3D::COUNT]={0}; + double nhits = 0; + double nhits_mod[PixLayerIBL2D3D::COUNT] = {0}; int nhits_L0_B11_S2_C6[96] = {0}; - - int fewithHits_EA[ nmod_phi[PixLayer::kECA]][ nmod_eta[PixLayer::kECA]][16]; - int fewithHits_EC[ nmod_phi[PixLayer::kECC]][ nmod_eta[PixLayer::kECC]][16]; - int fewithHits_B0[ nmod_phi[PixLayer::kB0] ][ nmod_eta[PixLayer::kB0] ][16]; - int fewithHits_B1[ nmod_phi[PixLayer::kB1] ][ nmod_eta[PixLayer::kB1] ][16]; - int fewithHits_B2[ nmod_phi[PixLayer::kB2] ][ nmod_eta[PixLayer::kB2] ][16]; - 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++){ - for(int j=0 ; j<16 ; j++){ - if(i==PixLayer::kECA) fewithHits_EA[phi][eta][j]=0; - if(i==PixLayer::kECC) fewithHits_EC[phi][eta][j]=0; - if(i==PixLayer::kB0) fewithHits_B0[phi][eta][j]=0; - if(i==PixLayer::kB1) fewithHits_B1[phi][eta][j]=0; - if(i==PixLayer::kB2) fewithHits_B2[phi][eta][j]=0; - } + + int fewithHits_EA[nmod_phi[PixLayer::kECA]][nmod_eta[PixLayer::kECA]][16]; + int fewithHits_EC[nmod_phi[PixLayer::kECC]][nmod_eta[PixLayer::kECC]][16]; + int fewithHits_B0[nmod_phi[PixLayer::kB0]][nmod_eta[PixLayer::kB0]][16]; + int fewithHits_B1[nmod_phi[PixLayer::kB1]][nmod_eta[PixLayer::kB1]][16]; + int fewithHits_B2[nmod_phi[PixLayer::kB2]][nmod_eta[PixLayer::kB2]][16]; + 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++) { + for (int j = 0; j < 16; j++) { + if (i == PixLayer::kECA) fewithHits_EA[phi][eta][j] = 0; + if (i == PixLayer::kECC) fewithHits_EC[phi][eta][j] = 0; + if (i == PixLayer::kB0) fewithHits_B0[phi][eta][j] = 0; + if (i == PixLayer::kB1) fewithHits_B1[phi][eta][j] = 0; + if (i == PixLayer::kB2) fewithHits_B2[phi][eta][j] = 0; + } } } } - + Identifier rdoID; - + int nChannels_mod[PixLayerIBL2D3D::COUNT] = {46080, 46080, 46080, 46080, 46080, 26880, 53760, 26880}; double inv_nChannels_mod[PixLayerIBL2D3D::COUNT]; double nGoodChannels_total = 0.; double nGoodChannels_layer[PixLayerIBL2D3D::COUNT]; double nActiveChannels_layer[PixLayerIBL2D3D::COUNT]; - for( int i=0; i<PixLayerIBL2D3D::COUNT; i++){ - inv_nChannels_mod[i] = 1.0/(1.0 * nChannels_mod[i]); - nGoodChannels_layer[i] = 1.0 * nChannels_mod[i] * m_nGood_mod[i]; + for (int i = 0; i < PixLayerIBL2D3D::COUNT; i++) { + inv_nChannels_mod[i] = 1.0 / (1.0 * nChannels_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]; - nGoodChannels_total =+ nGoodChannels_layer[i]; + nGoodChannels_total = +nGoodChannels_layer[i]; } StatusCode sc; - // get Pixel ROD BCID (II - tbc ROD BCID seems to be of the last ROD, why not to take the one from ATLAS in main?) - // this BCID is used for ATLAS fill, but also for diff ROD-module in m_diff_ROD_vs_Module_BCID [# of Hits!] - // change to hit BCID versus ATLAS BCID, useful?? (code in use since Run1) - // - const InDetTimeCollection *Pixel_BCIDColl = 0; - if ( evtStore()->contains<InDetTimeCollection>("PixelBCID") ) sc = evtStore()->retrieve(Pixel_BCIDColl, "PixelBCID"); - int pix_rod_bcid = 0; - if ( !sc.isFailure() && Pixel_BCIDColl!=0 ) - { - ATH_MSG_DEBUG("Found Pixel BCID collection"); - for ( InDetTimeCollection::const_iterator ipix_bcid = Pixel_BCIDColl->begin(); ipix_bcid != Pixel_BCIDColl->end(); ++ipix_bcid ) - { - if (!(*ipix_bcid)) continue; - const unsigned int pix_bcid = (*ipix_bcid)->second; - pix_rod_bcid = pix_bcid; - } + const InDetTimeCollection* Pixel_BCIDColl = 0; + if (evtStore()->contains<InDetTimeCollection>("PixelBCID")) sc = evtStore()->retrieve(Pixel_BCIDColl, "PixelBCID"); + int pix_rod_bcid = 0; + if (!sc.isFailure() && Pixel_BCIDColl != 0) { + ATH_MSG_DEBUG("Found Pixel BCID collection"); + for (InDetTimeCollection::const_iterator ipix_bcid = Pixel_BCIDColl->begin(); ipix_bcid != Pixel_BCIDColl->end(); ++ipix_bcid) { + if (!(*ipix_bcid)) continue; + const unsigned int pix_bcid = (*ipix_bcid)->second; + pix_rod_bcid = pix_bcid; } + } if (sc.isFailure()) ATH_MSG_WARNING("Could not find the data object PixelBCID !"); - // get ATLAS LVL1ID - // int lvl1idATLAS(-1); const EventInfo* thisEventInfo; - sc=evtStore()->retrieve(thisEventInfo); - if (sc != StatusCode::SUCCESS) ATH_MSG_WARNING("No EventInfo object found"); - else - { - lvl1idATLAS = (int)((thisEventInfo->trigger_info()->extendedLevel1ID())&0xf); - } - + sc = evtStore()->retrieve(thisEventInfo); + if (sc != StatusCode::SUCCESS) { + ATH_MSG_WARNING("No EventInfo object found"); + } else { + lvl1idATLAS = (int)((thisEventInfo->trigger_info()->extendedLevel1ID()) & 0xf); + } + // retrieve Pixel RDO container from storegate - sc=evtStore()->retrieve(m_rdocontainer,m_Pixel_RDOName); - if (sc.isFailure() || !m_rdocontainer) - { - ATH_MSG_WARNING("Could not retrieve Pixel RDO container !"); - if (m_storegate_errors) m_storegate_errors->Fill(1.,3.); //first entry (1). is for RDO, second (2) is for retrieve problem - return StatusCode::SUCCESS; //fail gracefully and keep going in the next tool - } else { + sc = evtStore()->retrieve(m_rdocontainer, m_Pixel_RDOName); + if (sc.isFailure() || !m_rdocontainer) { + ATH_MSG_WARNING("Could not retrieve Pixel RDO container !"); + if (m_storegate_errors) m_storegate_errors->Fill(1., 3.); // first entry is for RDO, second is for retrieve problem + return StatusCode::SUCCESS; // fail gracefully and keep going in the next tool + } else { ATH_MSG_DEBUG("Pixel RDO container " << m_Pixel_RDOName << " found"); } - PixelRDO_Container::const_iterator colNext = m_rdocontainer->begin(); - PixelRDO_Container::const_iterator lastCol = m_rdocontainer->end(); + PixelRDO_Container::const_iterator colNext = m_rdocontainer->begin(); + PixelRDO_Container::const_iterator lastCol = m_rdocontainer->end(); DataVector<PixelRDORawData>::const_iterator p_rdo; - - for (; colNext != lastCol; ++colNext) // Pixel RDO (hits) Loop - { - 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) { - - rdoID=(*p_rdo)->identify(); - if (m_doOnTrack) if(!OnTrack(rdoID,false) ) continue; //if we only want hits on track, and the hit is NOT on the track, skip filling - - int pixlayer = GetPixLayerID(m_pixelid->barrel_ec(rdoID), m_pixelid->layer_disk(rdoID), m_doIBL); - int pixlayerdbm = GetPixLayerIDDBM(m_pixelid->barrel_ec(rdoID), m_pixelid->layer_disk(rdoID), m_doIBL); - int pixlayeribl2d3d = pixlayer; - if ( pixlayeribl2d3d == PixLayer::kIBL ){ - pixlayeribl2d3d = GetPixLayerIDIBL2D3D(m_pixelid->barrel_ec(rdoID), m_pixelid->layer_disk(rdoID), m_pixelid->eta_module(rdoID), m_doIBL); - } - int pixlayeribl2d3ddbm = pixlayerdbm; - if ( pixlayeribl2d3ddbm == PixLayerDBM::kIBL ){ - pixlayeribl2d3ddbm = GetPixLayerIDIBL2D3DDBM(m_pixelid->barrel_ec(rdoID), m_pixelid->layer_disk(rdoID), m_pixelid->eta_module(rdoID), m_doIBL); - } - bool isIBL = false; - if (m_pixelid->barrel_ec(rdoID)==0 && m_doIBL && m_Lvl1A_mod[PixLayerDBM::kIBL] && m_pixelid->layer_disk(rdoID)==0) isIBL = true; - - /////////////Start main fill block here/////////////// - //be sure to check each histo exists before filling it - - /// Fill Occupancy - if ( m_occupancy) m_occupancy->Fill(rdoID, m_pixelid); - if ( m_occupancy_10min && m_doLumiBlock) m_occupancy_10min->Fill(rdoID, m_pixelid); - if ( m_hitmap_tmp ) m_hitmap_tmp->Fill(rdoID, m_pixelid); - if ( m_average_pixocc && - pixlayeribl2d3d < PixLayerIBL2D3D::COUNT && - nChannels_mod[pixlayeribl2d3d] > 0 ) - { - m_average_pixocc->Fill(rdoID, m_pixelid, 1.0/( 1.0*nChannels_mod[pixlayeribl2d3d]) ); + + for (; colNext != lastCol; ++colNext) { + const InDetRawDataCollection<PixelRDORawData>* PixelCollection(*colNext); + if (!PixelCollection) { + if (m_storegate_errors) m_storegate_errors->Fill(1., 5.); // first entry is for RDO, second is for data problem + continue; + } + + for (p_rdo = PixelCollection->begin(); p_rdo != PixelCollection->end(); ++p_rdo) { + rdoID = (*p_rdo)->identify(); + if (m_doOnTrack && !isOnTrack(rdoID, false)) { + // if we only want hits on track, and the hit is NOT on the track, skip filling + continue; + } + + int pixlayer = getPixLayerID(m_pixelid->barrel_ec(rdoID), m_pixelid->layer_disk(rdoID), m_doIBL); + int pixlayerdbm = getPixLayerIDDBM(m_pixelid->barrel_ec(rdoID), m_pixelid->layer_disk(rdoID), m_doIBL); + int pixlayeribl2d3d = pixlayer; + if (pixlayeribl2d3d == PixLayer::kIBL) { + pixlayeribl2d3d = getPixLayerIDIBL2D3D(m_pixelid->barrel_ec(rdoID), m_pixelid->layer_disk(rdoID), m_pixelid->eta_module(rdoID), m_doIBL); + } + int pixlayeribl2d3ddbm = pixlayerdbm; + if (pixlayeribl2d3ddbm == PixLayerDBM::kIBL) { + pixlayeribl2d3ddbm = getPixLayerIDIBL2D3DDBM(m_pixelid->barrel_ec(rdoID), m_pixelid->layer_disk(rdoID), m_pixelid->eta_module(rdoID), m_doIBL); + } + bool isIBL = false; + if (m_pixelid->barrel_ec(rdoID) == 0 && m_doIBL && m_Lvl1A_mod[PixLayerDBM::kIBL] && m_pixelid->layer_disk(rdoID) == 0) isIBL = true; + + // Fill Occupancy + if (m_occupancy) m_occupancy->fill(rdoID, m_pixelid); + if (m_occupancy_10min && m_doLumiBlock) m_occupancy_10min->fill(rdoID, m_pixelid); + if (m_hitmap_tmp) m_hitmap_tmp->fill(rdoID, m_pixelid); + if (m_average_pixocc && pixlayeribl2d3d < PixLayerIBL2D3D::COUNT && nChannels_mod[pixlayeribl2d3d] > 0) { + m_average_pixocc->fill(rdoID, m_pixelid, 1.0 / (1.0 * nChannels_mod[pixlayeribl2d3d])); + } + + // Fill Lvl1A + if (m_Lvl1A) { + m_Lvl1A->Fill((*p_rdo)->getLVL1A()); + if (pixlayerdbm != 99 && m_Lvl1A_mod[pixlayerdbm]) m_Lvl1A_mod[pixlayerdbm]->Fill((*p_rdo)->getLVL1A()); + } + if (pixlayer != 99 && m_Lvl1A_10min_mod[pixlayer] && m_doLumiBlock) m_Lvl1A_10min_mod[pixlayer]->Fill((*p_rdo)->getLVL1A()); + if (isIBL && m_Lvl1ID_IBL) m_Lvl1ID_IBL->Fill((*p_rdo)->getLVL1ID() % 32); + if (!isIBL && m_Lvl1ID_PIX) m_Lvl1ID_PIX->Fill((*p_rdo)->getLVL1ID()); + + // Fill difference of Lvl1 + int lvl1idMOD = (int)(*p_rdo)->getLVL1ID(); + int difflvl1id = lvl1idATLAS - lvl1idMOD % 32; + if (pixlayer != 99 && m_Lvl1ID_diff_mod_ATLAS_mod[pixlayer]) m_Lvl1ID_diff_mod_ATLAS_mod[pixlayer]->Fill(difflvl1id); + + if (m_Lvl1ID_diff_mod_ATLAS_per_LB) m_Lvl1ID_diff_mod_ATLAS_per_LB->fill(m_manager->lumiBlockNumber(), rdoID, m_pixelid, difflvl1id); + if (m_Lvl1ID_absdiff_mod_ATLAS_per_LB) m_Lvl1ID_absdiff_mod_ATLAS_per_LB->fill(m_manager->lumiBlockNumber(), rdoID, m_pixelid, fabs(difflvl1id)); + + // Fill BCID + if (m_BCID) m_BCID->Fill((*p_rdo)->getBCID()); + if (m_Atlas_BCID) m_Atlas_BCID->Fill(pix_rod_bcid); + if (m_BCID_Profile) m_BCID_Profile->Fill(double(pix_rod_bcid), double(nhits)); + if (pixlayer != 99 && m_diff_ROD_vs_Module_BCID_mod[pixlayer]) m_diff_ROD_vs_Module_BCID_mod[pixlayer]->Fill((pix_rod_bcid & 0x000000ff) - (*p_rdo)->getBCID()); + + if (m_FE_chip_hit_summary) m_FE_chip_hit_summary->fill(m_pixelCableSvc->getFE(&rdoID, rdoID), rdoID, m_pixelid); + + if (m_hiteff_mod) { + if (isOnTrack(rdoID, false)) { + m_hiteff_mod->fill(m_manager->lumiBlockNumber(), 1., rdoID, m_pixelid); + } else { + m_hiteff_mod->fill(m_manager->lumiBlockNumber(), 0., rdoID, m_pixelid); } + } + + // Fill ToT + if (pixlayeribl2d3ddbm != 99 && m_hit_ToT[pixlayeribl2d3ddbm]) m_hit_ToT[pixlayeribl2d3ddbm]->Fill((*p_rdo)->getToT()); + if (pixlayerdbm == PixLayerDBM::kIBL && 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 (m_doLumiBlock && pixlayer != 99 && 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()); - - /// Fill Lvl1A - if (m_Lvl1A) { - m_Lvl1A->Fill((*p_rdo)->getLVL1A()); - if(pixlayerdbm != 99 && m_Lvl1A_mod[pixlayerdbm]) m_Lvl1A_mod[pixlayerdbm]->Fill( (*p_rdo)->getLVL1A()); - } - if (pixlayer != 99 && m_Lvl1A_10min_mod[pixlayer] && m_doLumiBlock ) m_Lvl1A_10min_mod[pixlayer]->Fill( (*p_rdo)->getLVL1A() ); - if(isIBL && m_Lvl1ID_IBL) m_Lvl1ID_IBL->Fill((*p_rdo)->getLVL1ID()%32); - if(!isIBL && m_Lvl1ID_PIX) m_Lvl1ID_PIX->Fill((*p_rdo)->getLVL1ID()); - - - /// Fill difference of Lvl1 - int lvl1idMOD = (int)(*p_rdo)->getLVL1ID(); - int difflvl1id = lvl1idATLAS - lvl1idMOD%32; - if(pixlayer != 99 && m_Lvl1ID_diff_mod_ATLAS_mod[pixlayer]) m_Lvl1ID_diff_mod_ATLAS_mod[pixlayer]->Fill(difflvl1id); - - if(m_Lvl1ID_diff_mod_ATLAS_per_LB) m_Lvl1ID_diff_mod_ATLAS_per_LB->Fill(m_manager->lumiBlockNumber(),rdoID,m_pixelid,difflvl1id); - if(m_Lvl1ID_absdiff_mod_ATLAS_per_LB) m_Lvl1ID_absdiff_mod_ATLAS_per_LB->Fill(m_manager->lumiBlockNumber(),rdoID,m_pixelid,fabs(difflvl1id)); - - - /// Fill BCID - if (m_BCID) m_BCID->Fill((*p_rdo)->getBCID()); - if (m_Atlas_BCID) m_Atlas_BCID->Fill(pix_rod_bcid); //defined at the start of the method - if (m_BCID_Profile) m_BCID_Profile->Fill(double(pix_rod_bcid),double(nhits)); - if (pixlayer != 99 && m_diff_ROD_vs_Module_BCID_mod[pixlayer]) m_diff_ROD_vs_Module_BCID_mod[pixlayer]->Fill( (pix_rod_bcid&0x000000ff)-(*p_rdo)->getBCID() ); - - if (m_FE_chip_hit_summary) m_FE_chip_hit_summary->Fill(m_pixelCableSvc->getFE(&rdoID,rdoID),rdoID,m_pixelid); - - if (m_hiteff_mod) { - if (OnTrack(rdoID,false)) { - m_hiteff_mod->Fill(m_manager->lumiBlockNumber(),1.,rdoID,m_pixelid); - } else { - m_hiteff_mod->Fill(m_manager->lumiBlockNumber(),0.,rdoID,m_pixelid); - } - } - - - /// Fill ToT - if (pixlayeribl2d3ddbm != 99 && m_hit_ToT[pixlayeribl2d3ddbm]) m_hit_ToT[pixlayeribl2d3ddbm]->Fill((*p_rdo)->getToT()); - if (pixlayerdbm == PixLayerDBM::kIBL && 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 (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()); - - if (m_doOnline) - { - if(pixlayer != 99 && m_hit_ToT_tmp_mod[pixlayer]) m_hit_ToT_tmp_mod[pixlayer]->Fill((*p_rdo)->getToT()); - } - - /// Not yet modified for IBL geometry: - if (m_doDetails) { - int currentID = 1000000 + (-m_pixelid->barrel_ec(rdoID) + 2)*100000 + (m_pixelid->layer_disk(rdoID))*10000 + (m_pixelid->phi_module(rdoID))*100 + (m_pixelid->eta_module(rdoID) + 6); - if(m_Details_mod1_occupancy && currentID==DetailsMod1) m_Details_mod1_occupancy->Fill(m_pixelid->eta_index(rdoID),m_pixelid->phi_index(rdoID)); - if(m_Details_mod2_occupancy && currentID==DetailsMod2) m_Details_mod2_occupancy->Fill(m_pixelid->eta_index(rdoID),m_pixelid->phi_index(rdoID)); - if(m_Details_mod3_occupancy && currentID==DetailsMod3) m_Details_mod3_occupancy->Fill(m_pixelid->eta_index(rdoID),m_pixelid->phi_index(rdoID)); - if(m_Details_mod4_occupancy && currentID==DetailsMod4) m_Details_mod4_occupancy->Fill(m_pixelid->eta_index(rdoID),m_pixelid->phi_index(rdoID)); - if(m_Details_mod1_ToT && currentID==DetailsMod1) m_Details_mod1_ToT->Fill((*p_rdo)->getToT()); - if(m_Details_mod2_ToT && currentID==DetailsMod2) m_Details_mod2_ToT->Fill((*p_rdo)->getToT()); - if(m_Details_mod3_ToT && currentID==DetailsMod3) m_Details_mod3_ToT->Fill((*p_rdo)->getToT()); - if(m_Details_mod4_ToT && currentID==DetailsMod4) m_Details_mod4_ToT->Fill((*p_rdo)->getToT()); - } - if (m_pixel_occupancy) m_pixel_occupancy->Fill(m_pixelid->eta_index(rdoID),m_pixelid->phi_index(rdoID),rdoID, m_pixelid); - - if (pixlayer != 99) nhits_mod[pixlayer]++; - nhits++; - nhitsM1++; - nhitsM2++; - nhitsM3++; - nhitsM4++; - - ///if (m_doModules)//fill module hit arrays so we can calculate the number of hits/event/module - ///{ - if(m_pixelid->barrel_ec(rdoID)==2 ) m_HitPerEventArray_disksA[m_pixelid->phi_module(rdoID)][m_pixelid->layer_disk(rdoID)]++; - if(m_pixelid->barrel_ec(rdoID)==-2) m_HitPerEventArray_disksC[m_pixelid->phi_module(rdoID)][m_pixelid->layer_disk(rdoID)]++; - if(m_pixelid->barrel_ec(rdoID)==0 ) - { - if(m_doIBL && m_pixelid->layer_disk(rdoID)==0) m_HitPerEventArray_lI[m_pixelid->phi_module(rdoID)][m_pixelid->eta_module(rdoID)+10]++; - if(m_pixelid->layer_disk(rdoID)==0+m_doIBL) m_HitPerEventArray_l0[m_pixelid->phi_module(rdoID)][m_pixelid->eta_module(rdoID)+6]++; - if(m_pixelid->layer_disk(rdoID)==1+m_doIBL) m_HitPerEventArray_l1[m_pixelid->phi_module(rdoID)][m_pixelid->eta_module(rdoID)+6]++; - if(m_pixelid->layer_disk(rdoID)==2+m_doIBL) m_HitPerEventArray_l2[m_pixelid->phi_module(rdoID)][m_pixelid->eta_module(rdoID)+6]++; - } - ///} - - /// Quick Status - int fephi=0; - int feeta=0; - 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 ]++; - } - } - /// 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]); - } - 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; - } - if ( pixlayer == PixLayer::kB1 && GetFEID( pixlayer, m_pixelid->phi_index(rdoID), m_pixelid->eta_index(rdoID), fephi, feeta) ){ - fewithHits_B1[m_pixelid->phi_module(rdoID)][(int)(fabs(6+m_pixelid->eta_module(rdoID)))][(int)((8*fephi)+feeta)] = 1; - } - if ( pixlayer == PixLayer::kB2 && GetFEID( pixlayer, m_pixelid->phi_index(rdoID), m_pixelid->eta_index(rdoID), fephi, feeta) ){ - fewithHits_B2[m_pixelid->phi_module(rdoID)][(int)(fabs(6+m_pixelid->eta_module(rdoID)))][(int)((8*fephi)+feeta)] = 1; - } - if ( pixlayer == PixLayer::kECA && GetFEID( pixlayer, m_pixelid->phi_index(rdoID), m_pixelid->eta_index(rdoID), fephi, feeta) ){ - fewithHits_EA[m_pixelid->phi_module(rdoID)][(int)m_pixelid->layer_disk(rdoID)][(int)((8*fephi)+feeta)] = 1; - } - if ( pixlayer == PixLayer::kECC && GetFEID( pixlayer, m_pixelid->phi_index(rdoID), m_pixelid->eta_index(rdoID), fephi, feeta) ){ - fewithHits_EC[m_pixelid->phi_module(rdoID)][(int)m_pixelid->layer_disk(rdoID)][(int)((8*fephi)+feeta)] = 1; - } - - ///////////End of main fill block//////////////////// + if (m_doOnline && pixlayer != 99 && m_hit_ToT_tmp_mod[pixlayer]) { + m_hit_ToT_tmp_mod[pixlayer]->Fill((*p_rdo)->getToT()); + } + + // Not yet modified for IBL geometry: + if (m_doDetails) { + int currentID = 1000000 + (-m_pixelid->barrel_ec(rdoID) + 2) * 100000 + (m_pixelid->layer_disk(rdoID)) * 10000 + (m_pixelid->phi_module(rdoID)) * 100 + (m_pixelid->eta_module(rdoID) + 6); + if (m_Details_mod1_occupancy && currentID == DetailsMod1) m_Details_mod1_occupancy->Fill(m_pixelid->eta_index(rdoID), m_pixelid->phi_index(rdoID)); + if (m_Details_mod2_occupancy && currentID == DetailsMod2) m_Details_mod2_occupancy->Fill(m_pixelid->eta_index(rdoID), m_pixelid->phi_index(rdoID)); + if (m_Details_mod3_occupancy && currentID == DetailsMod3) m_Details_mod3_occupancy->Fill(m_pixelid->eta_index(rdoID), m_pixelid->phi_index(rdoID)); + if (m_Details_mod4_occupancy && currentID == DetailsMod4) m_Details_mod4_occupancy->Fill(m_pixelid->eta_index(rdoID), m_pixelid->phi_index(rdoID)); + if (m_Details_mod1_ToT && currentID == DetailsMod1) m_Details_mod1_ToT->Fill((*p_rdo)->getToT()); + if (m_Details_mod2_ToT && currentID == DetailsMod2) m_Details_mod2_ToT->Fill((*p_rdo)->getToT()); + if (m_Details_mod3_ToT && currentID == DetailsMod3) m_Details_mod3_ToT->Fill((*p_rdo)->getToT()); + if (m_Details_mod4_ToT && currentID == DetailsMod4) m_Details_mod4_ToT->Fill((*p_rdo)->getToT()); + } + if (m_pixel_occupancy) m_pixel_occupancy->fill(m_pixelid->eta_index(rdoID), m_pixelid->phi_index(rdoID), rdoID, m_pixelid); + + if (pixlayer != 99) nhits_mod[pixlayer]++; + nhits++; + nhitsM1++; + nhitsM2++; + nhitsM3++; + nhitsM4++; + + if (m_pixelid->barrel_ec(rdoID) == 2) m_HitPerEventArray_disksA[m_pixelid->phi_module(rdoID)][m_pixelid->layer_disk(rdoID)]++; + if (m_pixelid->barrel_ec(rdoID) == -2) m_HitPerEventArray_disksC[m_pixelid->phi_module(rdoID)][m_pixelid->layer_disk(rdoID)]++; + if (m_pixelid->barrel_ec(rdoID) == 0) { + if (m_doIBL && m_pixelid->layer_disk(rdoID) == 0) m_HitPerEventArray_lI[m_pixelid->phi_module(rdoID)][m_pixelid->eta_module(rdoID) + 10]++; + if (m_pixelid->layer_disk(rdoID) == 0 + m_doIBL) m_HitPerEventArray_l0[m_pixelid->phi_module(rdoID)][m_pixelid->eta_module(rdoID) + 6]++; + if (m_pixelid->layer_disk(rdoID) == 1 + m_doIBL) m_HitPerEventArray_l1[m_pixelid->phi_module(rdoID)][m_pixelid->eta_module(rdoID) + 6]++; + if (m_pixelid->layer_disk(rdoID) == 2 + m_doIBL) m_HitPerEventArray_l2[m_pixelid->phi_module(rdoID)][m_pixelid->eta_module(rdoID) + 6]++; + } + + // Quick Status + int fephi = 0; + int feeta = 0; + 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]++; + } + } + // 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]); + } + } + 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; + } + if (pixlayer == PixLayer::kB1 && getFEID(pixlayer, m_pixelid->phi_index(rdoID), m_pixelid->eta_index(rdoID), fephi, feeta)) { + fewithHits_B1[m_pixelid->phi_module(rdoID)][(int)(fabs(6 + m_pixelid->eta_module(rdoID)))][(int)((8 * fephi) + feeta)] = 1; + } + if (pixlayer == PixLayer::kB2 && getFEID(pixlayer, m_pixelid->phi_index(rdoID), m_pixelid->eta_index(rdoID), fephi, feeta)) { + fewithHits_B2[m_pixelid->phi_module(rdoID)][(int)(fabs(6 + m_pixelid->eta_module(rdoID)))][(int)((8 * fephi) + feeta)] = 1; } - } //end of RDO (hit) loop - - - - ////////////////////Fill after event block//////////////// - if (m_doOnline)//should we fill these mid run or only at the end? - { - FillSummaryHistos(m_occupancy.get(), 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]); - 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_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_tmp && m_hitmap_mon) { - if ( m_occupancy_pix_evt ) m_occupancy_pix_evt->FillFromMap(m_hitmap_tmp.get(), false); - m_hitmap_mon->Fill2DMon(m_hitmap_tmp.get()); - } + if (pixlayer == PixLayer::kECA && getFEID(pixlayer, m_pixelid->phi_index(rdoID), m_pixelid->eta_index(rdoID), fephi, feeta)) { + fewithHits_EA[m_pixelid->phi_module(rdoID)][(int)m_pixelid->layer_disk(rdoID)][(int)((8 * fephi) + feeta)] = 1; } - } //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 (pixlayer == PixLayer::kECC && getFEID(pixlayer, m_pixelid->phi_index(rdoID), m_pixelid->eta_index(rdoID), fephi, feeta)) { + fewithHits_EC[m_pixelid->phi_module(rdoID)][(int)m_pixelid->layer_disk(rdoID)][(int)((8 * fephi) + feeta)] = 1; + } + } + } // end of RDO (hit) loop + + if (m_doOnline) { + fillSummaryHistos(m_occupancy.get(), + 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]); + 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_doRefresh) { + for (int i = 0; i < PixLayer::COUNT; i++) { + if (m_hit_ToT_Mon_mod[i] && m_hit_ToT_tmp_mod[i]) th1FillMonitoring(m_hit_ToT_Mon_mod[i], m_hit_ToT_tmp_mod[i]); + } + if (m_hitmap_tmp && m_hitmap_mon) { + if (m_occupancy_pix_evt) m_occupancy_pix_evt->fillFromMap(m_hitmap_tmp.get(), false); + m_hitmap_mon->fill2DMon(m_hitmap_tmp.get()); + } + } + } + + 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_doOnline && m_occupancy_pix_evt && m_hitmap_tmp) m_occupancy_pix_evt->FillFromMap(m_hitmap_tmp.get(), true); - + } + + if (!m_doOnline && m_occupancy_pix_evt && m_hitmap_tmp) m_occupancy_pix_evt->fillFromMap(m_hitmap_tmp.get(), true); + double avgocc = 0; double avgocc_mod[PixLayerIBL2D3D::COUNT] = {0}; double avgocc_active_mod[PixLayerIBL2D3D::COUNT] = {0}; - if(nGoodChannels_total>0) avgocc = nhits/nGoodChannels_total; - if(m_avgocc_per_lumi) m_avgocc_per_lumi->Fill(m_manager->lumiBlockNumber(), avgocc); - + if (nGoodChannels_total > 0) avgocc = nhits / nGoodChannels_total; + if (m_avgocc_per_lumi) m_avgocc_per_lumi->Fill(m_manager->lumiBlockNumber(), avgocc); if (m_doOfflineAnalysis) { - for( int i=0; i<PixLayerIBL2D3D::COUNT; i++) - if(m_avgocc_per_bcid_per_lumi_mod[i]) m_avgocc_per_bcid_per_lumi_mod[i]->Fill(m_manager->lumiBlockNumber(), pix_rod_bcid, avgocc_mod[i]); + for (int i = 0; i < PixLayerIBL2D3D::COUNT; i++) { + if (m_avgocc_per_bcid_per_lumi_mod[i]) m_avgocc_per_bcid_per_lumi_mod[i]->Fill(m_manager->lumiBlockNumber(), pix_rod_bcid, avgocc_mod[i]); + } } - for( int i=0; i<PixLayerIBL2D3D::COUNT; i++){ - 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(pix_rod_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_active_mod[i]); - if(m_maxocc_per_bcid_mod[i]){ - int bin = m_maxocc_per_bcid_mod[i]->GetXaxis()->FindBin( 1.0*pix_rod_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]); + for (int i = 0; i < PixLayerIBL2D3D::COUNT; i++) { + 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(pix_rod_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_active_mod[i]); + if (m_maxocc_per_bcid_mod[i]) { + int bin = m_maxocc_per_bcid_mod[i]->GetXaxis()->FindBin(1.0 * pix_rod_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*pix_rod_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]); - - - if(m_Atlas_BCID_hits) m_Atlas_BCID_hits->Fill(pix_rod_bcid,nhits); - - /// Fill the #hit per module per event - for(int i=0; i<PixLayer::COUNT; i++){ + if (m_totalhits_per_bcid_mod[i]) m_totalhits_per_bcid_mod[i]->Fill(1.0 * pix_rod_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]); + + if (m_Atlas_BCID_hits) m_Atlas_BCID_hits->Fill(pix_rod_bcid, nhits); + + // Fill the #hit per module per event + for (int i = 0; i < PixLayer::COUNT; i++) { if (m_nhits_mod[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]->Fill( m_HitPerEventArray_disksA[phi][eta] ); - if (i == PixLayer::kECC) m_nhits_mod[i]->Fill( m_HitPerEventArray_disksC[phi][eta] ); - if (i == PixLayer::kB0) m_nhits_mod[i]->Fill( m_HitPerEventArray_l0[phi][eta]); - if (i == PixLayer::kB1) m_nhits_mod[i]->Fill( m_HitPerEventArray_l1[phi][eta]); - if (i == PixLayer::kB2) m_nhits_mod[i]->Fill( m_HitPerEventArray_l2[phi][eta]); - if (i == PixLayer::kIBL) 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]->Fill(m_HitPerEventArray_disksA[phi][eta]); + if (i == PixLayer::kECC) m_nhits_mod[i]->Fill(m_HitPerEventArray_disksC[phi][eta]); + if (i == PixLayer::kB0) m_nhits_mod[i]->Fill(m_HitPerEventArray_l0[phi][eta]); + if (i == PixLayer::kB1) m_nhits_mod[i]->Fill(m_HitPerEventArray_l1[phi][eta]); + if (i == PixLayer::kB2) m_nhits_mod[i]->Fill(m_HitPerEventArray_l2[phi][eta]); + if (i == PixLayer::kIBL) m_nhits_mod[i]->Fill(m_HitPerEventArray_lI[phi][eta]); + } } } } - if ( !m_doOnline ) { - for (int i=0; i<PixLayer::COUNT; i++) { + if (!m_doOnline) { + for (int i = 0; i < PixLayer::COUNT; i++) { if (m_modocc_per_lumi[i]) { - for (int phi=0; phi<nmod_phi[i]; phi++) { - for (int eta=0; eta<nmod_eta[i]; eta++) { - if (i == PixLayer::kECA) m_modocc_per_lumi[i]->Fill( m_manager->lumiBlockNumber(), m_HitPerEventArray_disksA[phi][eta]*inv_nChannels_mod[i] ); - if (i == PixLayer::kECC) m_modocc_per_lumi[i]->Fill( m_manager->lumiBlockNumber(), m_HitPerEventArray_disksC[phi][eta]*inv_nChannels_mod[i] ); - if (i == PixLayer::kB0) m_modocc_per_lumi[i]->Fill( m_manager->lumiBlockNumber(), m_HitPerEventArray_l0[phi][eta]*inv_nChannels_mod[i] ); - if (i == PixLayer::kB1) m_modocc_per_lumi[i]->Fill( m_manager->lumiBlockNumber(), m_HitPerEventArray_l1[phi][eta]*inv_nChannels_mod[i] ); - if (i == PixLayer::kB2) m_modocc_per_lumi[i]->Fill( m_manager->lumiBlockNumber(), m_HitPerEventArray_l2[phi][eta]*inv_nChannels_mod[i] ); - if (i == PixLayer::kIBL) { - if (eta<4 || eta>15) m_modocc_per_lumi[i]->Fill( m_manager->lumiBlockNumber(), m_HitPerEventArray_lI[phi][eta]*inv_nChannels_mod[i] ); - else m_modocc_per_lumi[i]->Fill( m_manager->lumiBlockNumber(), m_HitPerEventArray_lI[phi][eta]*inv_nChannels_mod[i+1] ); - } - } - } + for (int phi = 0; phi < nmod_phi[i]; phi++) { + for (int eta = 0; eta < nmod_eta[i]; eta++) { + if (i == PixLayer::kECA) m_modocc_per_lumi[i]->Fill(m_manager->lumiBlockNumber(), m_HitPerEventArray_disksA[phi][eta] * inv_nChannels_mod[i]); + if (i == PixLayer::kECC) m_modocc_per_lumi[i]->Fill(m_manager->lumiBlockNumber(), m_HitPerEventArray_disksC[phi][eta] * inv_nChannels_mod[i]); + if (i == PixLayer::kB0) m_modocc_per_lumi[i]->Fill(m_manager->lumiBlockNumber(), m_HitPerEventArray_l0[phi][eta] * inv_nChannels_mod[i]); + if (i == PixLayer::kB1) m_modocc_per_lumi[i]->Fill(m_manager->lumiBlockNumber(), m_HitPerEventArray_l1[phi][eta] * inv_nChannels_mod[i]); + if (i == PixLayer::kB2) m_modocc_per_lumi[i]->Fill(m_manager->lumiBlockNumber(), m_HitPerEventArray_l2[phi][eta] * inv_nChannels_mod[i]); + if (i == PixLayer::kIBL) { + if (eta < 4 || eta > 15) { + m_modocc_per_lumi[i]->Fill(m_manager->lumiBlockNumber(), m_HitPerEventArray_lI[phi][eta] * inv_nChannels_mod[i]); + } else { + m_modocc_per_lumi[i]->Fill(m_manager->lumiBlockNumber(), m_HitPerEventArray_lI[phi][eta] * inv_nChannels_mod[i + 1]); + } + } + } + } } } } - - /// Fill some histograms only if =< 50% of modules disabled - if(!m_majorityDisabled) { + + // Fill these histograms only if =< 50% of modules disabled + if (!m_majorityDisabled) { if (m_doDetails) { - if(m_Details_mod1_num_hits) m_Details_mod1_num_hits->Fill(nhitsM1); - if(m_Details_mod2_num_hits) m_Details_mod2_num_hits->Fill(nhitsM2); - if(m_Details_mod3_num_hits) m_Details_mod3_num_hits->Fill(nhitsM3); - if(m_Details_mod4_num_hits) m_Details_mod4_num_hits->Fill(nhitsM4); + if (m_Details_mod1_num_hits) m_Details_mod1_num_hits->Fill(nhitsM1); + if (m_Details_mod2_num_hits) m_Details_mod2_num_hits->Fill(nhitsM2); + if (m_Details_mod3_num_hits) m_Details_mod3_num_hits->Fill(nhitsM3); + if (m_Details_mod4_num_hits) m_Details_mod4_num_hits->Fill(nhitsM4); } - if(m_num_hits) m_num_hits->Fill(nhits); - if(m_doLumiBlock){ - if(m_num_hits_LB) m_num_hits_LB->Fill(nhits); + if (m_num_hits) m_num_hits->Fill(nhits); + if (m_doLumiBlock && m_num_hits_LB) { + m_num_hits_LB->Fill(nhits); } - - 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) { - Identifier WaferID = *idIt; - if(m_pixelid->barrel_ec(WaferID)==2 ){ - m_hit_num_mod->Fill( m_HitPerEventArray_disksA[m_pixelid->phi_module(WaferID)][m_pixelid->layer_disk(WaferID)], WaferID, m_pixelid); - } - if(m_pixelid->barrel_ec(WaferID)==-2) m_hit_num_mod->Fill( m_HitPerEventArray_disksC[m_pixelid->phi_module(WaferID)][m_pixelid->layer_disk(WaferID)], WaferID, m_pixelid); - if(m_pixelid->barrel_ec(WaferID)==0 ) - { - if(m_doIBL && m_pixelid->layer_disk(WaferID)==0) { - m_hit_num_mod->Fill( m_HitPerEventArray_lI[m_pixelid->phi_module(WaferID)][m_pixelid->eta_module(WaferID)+10], WaferID, m_pixelid); - } - if(m_pixelid->layer_disk(WaferID)==0+m_doIBL) { - m_hit_num_mod->Fill( m_HitPerEventArray_l0[m_pixelid->phi_module(WaferID)][m_pixelid->eta_module(WaferID)+6], WaferID, m_pixelid); - } - if(m_pixelid->layer_disk(WaferID)==1+m_doIBL) m_hit_num_mod->Fill( m_HitPerEventArray_l1[m_pixelid->phi_module(WaferID)][m_pixelid->eta_module(WaferID)+6], WaferID, m_pixelid); - if(m_pixelid->layer_disk(WaferID)==2+m_doIBL) m_hit_num_mod->Fill( m_HitPerEventArray_l2[m_pixelid->phi_module(WaferID)][m_pixelid->eta_module(WaferID)+6], WaferID, m_pixelid); - } - - if (m_doLumiBlock) { - if(m_pixelid->barrel_ec(WaferID)==2 ) m_hit_num_mod_LB->Fill( m_HitPerEventArray_disksA[m_pixelid->phi_module(WaferID)][m_pixelid->layer_disk(WaferID)], WaferID, m_pixelid); - if(m_pixelid->barrel_ec(WaferID)==-2) m_hit_num_mod_LB->Fill( m_HitPerEventArray_disksC[m_pixelid->phi_module(WaferID)][m_pixelid->layer_disk(WaferID)], WaferID, m_pixelid); - if(m_pixelid->barrel_ec(WaferID)==0 ) - { - if(m_doIBL && m_pixelid->layer_disk(WaferID)==0) m_hit_num_mod_LB->Fill( m_HitPerEventArray_lI[m_pixelid->phi_module(WaferID)][m_pixelid->eta_module(WaferID)+10], WaferID, m_pixelid); - if(m_pixelid->layer_disk(WaferID)==0+m_doIBL) m_hit_num_mod_LB->Fill( m_HitPerEventArray_l0[m_pixelid->phi_module(WaferID)][m_pixelid->eta_module(WaferID)+6], WaferID, m_pixelid); - if(m_pixelid->layer_disk(WaferID)==1+m_doIBL) m_hit_num_mod_LB->Fill( m_HitPerEventArray_l1[m_pixelid->phi_module(WaferID)][m_pixelid->eta_module(WaferID)+6], WaferID, m_pixelid); - if(m_pixelid->layer_disk(WaferID)==2+m_doIBL) m_hit_num_mod_LB->Fill( m_HitPerEventArray_l2[m_pixelid->phi_module(WaferID)][m_pixelid->eta_module(WaferID)+6], WaferID, m_pixelid); - } - } - } + + 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) { + Identifier WaferID = *idIt; + if (m_pixelid->barrel_ec(WaferID) == 2) { + m_hit_num_mod->fill(m_HitPerEventArray_disksA[m_pixelid->phi_module(WaferID)][m_pixelid->layer_disk(WaferID)], WaferID, m_pixelid); + } + if (m_pixelid->barrel_ec(WaferID) == -2) { + m_hit_num_mod->fill(m_HitPerEventArray_disksC[m_pixelid->phi_module(WaferID)][m_pixelid->layer_disk(WaferID)], WaferID, m_pixelid); + } + if (m_pixelid->barrel_ec(WaferID) == 0) { + if (m_doIBL && m_pixelid->layer_disk(WaferID) == 0) { + m_hit_num_mod->fill(m_HitPerEventArray_lI[m_pixelid->phi_module(WaferID)][m_pixelid->eta_module(WaferID) + 10], WaferID, m_pixelid); + } + if (m_pixelid->layer_disk(WaferID) == 0 + m_doIBL) { + m_hit_num_mod->fill(m_HitPerEventArray_l0[m_pixelid->phi_module(WaferID)][m_pixelid->eta_module(WaferID) + 6], WaferID, m_pixelid); + } + if (m_pixelid->layer_disk(WaferID) == 1 + m_doIBL) { + m_hit_num_mod->fill(m_HitPerEventArray_l1[m_pixelid->phi_module(WaferID)][m_pixelid->eta_module(WaferID) + 6], WaferID, m_pixelid); + } + if (m_pixelid->layer_disk(WaferID) == 2 + m_doIBL) { + m_hit_num_mod->fill(m_HitPerEventArray_l2[m_pixelid->phi_module(WaferID)][m_pixelid->eta_module(WaferID) + 6], WaferID, m_pixelid); + } + } + + if (m_doLumiBlock) { + if (m_pixelid->barrel_ec(WaferID) == 2) m_hit_num_mod_LB->fill(m_HitPerEventArray_disksA[m_pixelid->phi_module(WaferID)][m_pixelid->layer_disk(WaferID)], WaferID, m_pixelid); + if (m_pixelid->barrel_ec(WaferID) == -2) m_hit_num_mod_LB->fill(m_HitPerEventArray_disksC[m_pixelid->phi_module(WaferID)][m_pixelid->layer_disk(WaferID)], WaferID, m_pixelid); + if (m_pixelid->barrel_ec(WaferID) == 0) { + if (m_doIBL && m_pixelid->layer_disk(WaferID) == 0) m_hit_num_mod_LB->fill(m_HitPerEventArray_lI[m_pixelid->phi_module(WaferID)][m_pixelid->eta_module(WaferID) + 10], WaferID, m_pixelid); + if (m_pixelid->layer_disk(WaferID) == 0 + m_doIBL) m_hit_num_mod_LB->fill(m_HitPerEventArray_l0[m_pixelid->phi_module(WaferID)][m_pixelid->eta_module(WaferID) + 6], WaferID, m_pixelid); + if (m_pixelid->layer_disk(WaferID) == 1 + m_doIBL) m_hit_num_mod_LB->fill(m_HitPerEventArray_l1[m_pixelid->phi_module(WaferID)][m_pixelid->eta_module(WaferID) + 6], WaferID, m_pixelid); + if (m_pixelid->layer_disk(WaferID) == 2 + m_doIBL) m_hit_num_mod_LB->fill(m_HitPerEventArray_l2[m_pixelid->phi_module(WaferID)][m_pixelid->eta_module(WaferID) + 6], WaferID, m_pixelid); + } + } } - } - - /// Quick Status - if (m_doOfflineAnalysis) { - if( m_occupancy_L0_B11_S2_C6 ) { - for(int i=0 ; i<96 ; i++) - m_occupancy_L0_B11_S2_C6->Fill(m_manager->lumiBlockNumber(), i, (1.0*nhits_L0_B11_S2_C6[i]/(18.0*164.0))); + } // if (m_doModules) + } // if (!m_majorityDisabled) + + // Quick Status + if (m_doOfflineAnalysis && m_occupancy_L0_B11_S2_C6) { + for (int i = 0; i < 96; i++) { + 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 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); } } } - - ////////////////////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 - + + if (nhits == 0 && m_storegate_errors) m_storegate_errors->Fill(1., 4.); // first entry for RDO, second for size = 0 + return StatusCode::SUCCESS; } -StatusCode PixelMainMon::ProcHitsMon(void) -{ - +StatusCode PixelMainMon::procHitsMon(void) { 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_doOffline) - { - FillSummaryHistos(m_occupancy.get(), 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]); - } + if (events == 0) { + // if no events, the rest of the test is pointless and would divide by 0 + return StatusCode::SUCCESS; + } - if (m_average_pixocc && m_num_hits->GetEntries() == m_event) { - m_event2 = m_num_hits->GetEntries(); //FIXME USED in Clusters!!! + if (m_doOffline) { + fillSummaryHistos(m_occupancy.get(), + 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]); + } + + if (m_average_pixocc && m_num_hits->GetEntries() == m_event) { + m_event2 = m_num_hits->GetEntries(); } return StatusCode::SUCCESS; } - diff --git a/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelDCSMon.cxx b/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelDCSMon.cxx index 9ba2564b1616e028b216367e6ddf7c672a74eda5..b468f9501a92b227832424e17013545cc435d668 100644 --- a/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelDCSMon.cxx +++ b/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelDCSMon.cxx @@ -6,561 +6,497 @@ // Book and fill offline histograms showing status of modules /////////////////////////////////////////////////////////////////////////////// -#include "PixelMonitoring/PixelMainMon.h" +#include <map> +#include <sstream> +#include <string> +#include <vector> +#include "AthenaPoolUtilities/CondAttrListCollection.h" #include "InDetConditionsSummaryService/IInDetConditionsSvc.h" -#include "TH1F.h" -#include "TH1I.h" -#include "TH2F.h" -#include "TH2I.h" +#include "InDetIdentifier/PixelID.h" #include "LWHists/TH1F_LW.h" #include "LWHists/TH1I_LW.h" #include "LWHists/TH2F_LW.h" #include "LWHists/TH2I_LW.h" -#include "TProfile2D.h" #include "LWHists/TProfile2D_LW.h" #include "LWHists/TProfile_LW.h" -#include "InDetIdentifier/PixelID.h" +#include "PixelMonitoring/PixelMainMon.h" #include "PixelMonitoring/PixelMonModules.h" -#include "TString.h" +#include "TH1F.h" +#include "TH1I.h" +#include "TH2F.h" +#include "TH2I.h" #include "TMath.h" -// Database -#include "AthenaPoolUtilities/CondAttrListCollection.h" -// std -#include <sstream> -#include <vector> -#include <string> -#include <map> +#include "TProfile2D.h" +#include "TString.h" /////////////////////////////////////////////////////////////////////////////// //////////////////////booking methods////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////// -StatusCode PixelMainMon::BookPixelDCSMon(void) -{ - if(msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "starting Book Status" << endmsg; - - msg(MSG::DEBUG) << "[BookPixelDCSMon]" << endmsg; - - std::string path = "Pixel/DCS"; - if(m_doOnTrack) path.replace(path.begin(), path.end(), "Pixel/DCSOnTrack"); - MonGroup dcsExpert ( this, path.c_str(), run, ATTRIB_MANAGED ); //declare a group of histograms - - float min_temperature = -20.; float max_temperature = 0.; int nbins_temperature = 100; - float min_LB = 0.; float max_LB = 1500.; int nbins_LB = 1500; - float min_module = -10.; float max_module = 10.; int nbins_module = 20; - float min_HV = 0.; float max_HV = 150.; int nbins_HV = 150; - float min_HVcurrent = 0.; float max_HVcurrent = 0.1; int nbins_HVcurrent = 100; - float min_LV = 0.; float max_LV = 5.; int nbins_LV = 50; - float min_LVcurrent = 0.; float max_LVcurrent = 5.; int nbins_LVcurrent = 50; - float min_moduleGroup = 0.; float max_moduleGroup = 8.; int nbins_moduleGroup = 8; - float min_staveID = 1; float max_staveID = 15; int nbins_staveID = 14; - float min_FSM = 0; float max_FSM = 11; int nbins_FSM = 11; +StatusCode PixelMainMon::bookPixelDCSMon(void) { + if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "starting Book Status" << endmsg; + + msg(MSG::DEBUG) << "[BookPixelDCSMon]" << endmsg; + + std::string path = "Pixel/DCS"; + if (m_doOnTrack) path.replace(path.begin(), path.end(), "Pixel/DCSOnTrack"); + MonGroup dcsExpert(this, path.c_str(), run, ATTRIB_MANAGED); // declare a group of histograms + + float min_temperature = -20.; + float max_temperature = 0.; + int nbins_temperature = 100; + float min_LB = 0.; + float max_LB = 1500.; + int nbins_LB = 1500; + float min_module = -10.; + float max_module = 10.; + int nbins_module = 20; + float min_HV = 0.; + float max_HV = 150.; + int nbins_HV = 150; + float min_HVcurrent = 0.; + float max_HVcurrent = 0.1; + int nbins_HVcurrent = 100; + float min_LV = 0.; + float max_LV = 5.; + int nbins_LV = 50; + float min_LVcurrent = 0.; + float max_LVcurrent = 5.; + int nbins_LVcurrent = 50; + float min_moduleGroup = 0.; + float max_moduleGroup = 8.; + int nbins_moduleGroup = 8; + float min_staveID = 1; + float max_staveID = 15; + int nbins_staveID = 14; + float min_FSM = 0; + float max_FSM = 11; + int nbins_FSM = 11; TString label_moduleTemp = "Module Temperature [#circC]"; - TString label_inletTemp = "Cooling Pipe Inlet Temperature [#circC]"; + TString label_inletTemp = "Cooling Pipe Inlet Temperature [#circC]"; TString label_outletTemp = "Cooling Pipe Outlet Temperature [#circC]"; - TString label_HVoltage = "HV [-V]"; - TString label_LVoltage = "LV [V]"; - TString label_HVcurrent = "HV current [-mA]"; - TString label_LVcurrent = "LV current [A]"; - TString label_dT = "Module - Cooling Pipe Outlet Temperature [#circC]"; - TString label_HVPC = "HV Power Consumption [mW]"; - TString label_LVPC = "LV Power Consumption [W]"; - TString label_LVHVPC = "LV+HV Power Consumption [W]"; - TString label_effFLEXtemp = "Effective FLEX Temperature [#circC]"; - TString label_tfm = "Thermal Figure of Merit [#circC/W]"; - TString label_FSMstate = "FSM State"; - TString label_FSMstatus = "FSM Status"; + TString label_HVoltage = "HV [-V]"; + TString label_LVoltage = "LV [V]"; + TString label_HVcurrent = "HV current [-mA]"; + TString label_LVcurrent = "LV current [A]"; + TString label_dT = "Module - Cooling Pipe Outlet Temperature [#circC]"; + TString label_HVPC = "HV Power Consumption [mW]"; + TString label_LVPC = "LV Power Consumption [W]"; + TString label_LVHVPC = "LV+HV Power Consumption [W]"; + TString label_effFLEXtemp = "Effective FLEX Temperature [#circC]"; + TString label_tfm = "Thermal Figure of Merit [#circC/W]"; + TString label_FSMstate = "FSM State"; + TString label_FSMstatus = "FSM Status"; const int NUMMODULEGROUP = 8; - const char *moduleGroup[NUMMODULEGROUP] = {"M4C", "M3C", "M2C", "M1C", "M1A", "M2A", "M3A", "M4A"}; + const char* moduleGroup[NUMMODULEGROUP] = {"M4C", "M3C", "M2C", "M1C", "M1A", "M2A", "M3A", "M4A"}; const int NUMMODULEETA = 20; - const char *moduleEta[NUMMODULEETA] = {"C8_2", "C8_1", "C7_2", "C7_1", + const char* moduleEta[NUMMODULEETA] = {"C8_2", "C8_1", "C7_2", "C7_1", "C6", "C5", "C4", "C3", "C2", "C1", "A1", "A2", "A3", "A4", "A5", "A6", "A7_1", "A7_2", "A8_1", "A8_2"}; const int NUMFSM = 11; - const char *FSMSTATE[NUMFSM] = {"READY", "ON", "STANDBY", "LV_ON", "TRANSITION", "UNDEFINED", "LOCKED_OUT", "DISABLED", "OFF", "DEAD","UNKNOWN"}; - const char *FSMSTATUS[NUMFSM] = {"OK", "WARNING", "ERROR", "UNINITIALIZED", "DEAD", "5", "6", "7","8","9","UNKNOWN"}; - TAxis *txaxis; - TAxis *tyaxis; - LWHist::LWHistAxis *xaxis; - LWHist::LWHistAxis *yaxis; + const char* FSMSTATE[NUMFSM] = {"READY", "ON", "STANDBY", "LV_ON", "TRANSITION", "UNDEFINED", "LOCKED_OUT", "DISABLED", "OFF", "DEAD", "UNKNOWN"}; + const char* FSMSTATUS[NUMFSM] = {"OK", "WARNING", "ERROR", "UNINITIALIZED", "DEAD", "5", "6", "7", "8", "9", "UNKNOWN"}; + TAxis* txaxis; + TAxis* tyaxis; + LWHist::LWHistAxis* xaxis; + LWHist::LWHistAxis* yaxis; StatusCode sc; - for( int ii = 0; ii < IBLStave::COUNT; ii++){ + for (int ii = 0; ii < IBLStave::COUNT; ii++) { // temperature - sc = dcsExpert.regHist(m_hist_moduleTemperature2Dscatter[ii] - = TH2F_LW::create(Form("moduleTemperature_ModuleNumber_S%02d",ii + 1), "Module Temprerature vs Module Number; Module Number;"+label_moduleTemp+";Number of LBs", - nbins_module,min_module,max_module,nbins_temperature,min_temperature,max_temperature)); + sc = dcsExpert.regHist(m_hist_moduleTemperature2Dscatter[ii] = TH2F_LW::create( + Form("moduleTemperature_ModuleNumber_S%02d", ii + 1), "Module Temprerature vs Module Number; Module Number;" + label_moduleTemp + ";Number of LBs", + nbins_module, min_module, max_module, nbins_temperature, min_temperature, max_temperature)); xaxis = m_hist_moduleTemperature2Dscatter[ii]->GetXaxis(); - for(int jj = 0; jj < NUMMODULEETA; jj++){ - xaxis->SetBinLabel(jj+1, moduleEta[jj]); + for (int jj = 0; jj < NUMMODULEETA; jj++) { + xaxis->SetBinLabel(jj + 1, moduleEta[jj]); } - //m_hist_moduleTemperature2Dscatter[ii]->SetContour(99); - // - sc = dcsExpert.regHist(m_hist_moduleTemperatureLB[ii] - = TProfile_LW::create(Form("moduleTemperature_S%02dvsLB",ii + 1), "Module Temperature vs LB; LB;"+label_moduleTemp,nbins_LB,min_LB,max_LB)); - //m_hist_moduleTemperatureLB[ii]->SetLineColor(kGray); + sc = dcsExpert.regHist(m_hist_moduleTemperatureLB[ii] = TProfile_LW::create(Form("moduleTemperature_S%02dvsLB", ii + 1), "Module Temperature vs LB; LB;" + label_moduleTemp, nbins_LB, min_LB, max_LB)); m_hist_moduleTemperatureLB[ii]->SetMarkerSize(0.5); - // - sc = dcsExpert.regHist(m_hist_LB_moduleGroup_moduleTemperature[ii] - = TProfile2D_LW::create(Form("LB_moduleGroup_moduleTemperature_S%02dvsLB",ii + 1), "LB_moduleGroup_moduleTemperature; LB;moduleGoup;"+label_moduleTemp, - nbins_LB,min_LB,max_LB,nbins_moduleGroup,min_moduleGroup,max_moduleGroup)); - //m_hist_LB_moduleGroup_moduleTemperature[ii]->SetContour(99); + + sc = dcsExpert.regHist(m_hist_LB_moduleGroup_moduleTemperature[ii] = TProfile2D_LW::create( + Form("LB_moduleGroup_moduleTemperature_S%02dvsLB", ii + 1), "LB_moduleGroup_moduleTemperature; LB;moduleGoup;" + label_moduleTemp, + nbins_LB, min_LB, max_LB, nbins_moduleGroup, min_moduleGroup, max_moduleGroup)); yaxis = m_hist_LB_moduleGroup_moduleTemperature[ii]->GetYaxis(); - for(int jj = 0; jj < NUMMODULEGROUP; jj++){ - yaxis->SetBinLabel(jj+1, moduleGroup[jj]); + for (int jj = 0; jj < NUMMODULEGROUP; jj++) { + yaxis->SetBinLabel(jj + 1, moduleGroup[jj]); } - // HV - sc = dcsExpert.regHist(m_hist_HVoltage2Dscatter[ii] - = TH2F_LW::create(Form("HVvoltage_ModuleNumber_S%02d",ii + 1), "HV vs Module Number; Module Number;"+label_HVoltage+";Number of LBs", - nbins_module,min_module,max_module,nbins_HV,min_HV,max_HV)); + + sc = dcsExpert.regHist(m_hist_HVoltage2Dscatter[ii] = TH2F_LW::create( + Form("HVvoltage_ModuleNumber_S%02d", ii + 1), "HV vs Module Number; Module Number;" + label_HVoltage + ";Number of LBs", + nbins_module, min_module, max_module, nbins_HV, min_HV, max_HV)); xaxis = m_hist_HVoltage2Dscatter[ii]->GetXaxis(); - for(int jj = 0; jj < NUMMODULEETA; jj++){ - xaxis->SetBinLabel(jj+1, moduleEta[jj]); + for (int jj = 0; jj < NUMMODULEETA; jj++) { + xaxis->SetBinLabel(jj + 1, moduleEta[jj]); } - //m_hist_HVoltage2Dscatter[ii]->SetContour(99); - // - sc = dcsExpert.regHist(m_hist_HVoltageLB[ii] - = TProfile_LW::create(Form("HVvoltage_S%02dvsLB",ii + 1), "HV vs LB; LB;"+label_HVoltage,nbins_LB,min_LB,max_LB)); - //m_hist_HVoltageLB[ii]->SetLineColor(kGray); + + sc = dcsExpert.regHist(m_hist_HVoltageLB[ii] = TProfile_LW::create(Form("HVvoltage_S%02dvsLB", ii + 1), "HV vs LB; LB;" + label_HVoltage, nbins_LB, min_LB, max_LB)); m_hist_HVoltageLB[ii]->SetMarkerSize(0.5); - // - sc = dcsExpert.regHist(m_hist_LB_moduleGroup_HVoltage[ii] - = TProfile2D_LW::create(Form("LB_moduleGroup_HV_S%02dvsLB",ii + 1), "LB_moduleGroup_HV; LB;moduleGoup;"+label_HVoltage, - nbins_LB,min_LB,max_LB,nbins_moduleGroup,min_moduleGroup,max_moduleGroup)); - //m_hist_LB_moduleGroup_HVoltage[ii]->SetContour(99); + + sc = dcsExpert.regHist(m_hist_LB_moduleGroup_HVoltage[ii] = TProfile2D_LW::create( + Form("LB_moduleGroup_HV_S%02dvsLB", ii + 1), "LB_moduleGroup_HV; LB;moduleGoup;" + label_HVoltage, + nbins_LB, min_LB, max_LB, nbins_moduleGroup, min_moduleGroup, max_moduleGroup)); yaxis = m_hist_LB_moduleGroup_HVoltage[ii]->GetYaxis(); - for(int jj = 0; jj < NUMMODULEGROUP; jj++){ - yaxis->SetBinLabel(jj+1, moduleGroup[jj]); + for (int jj = 0; jj < NUMMODULEGROUP; jj++) { + yaxis->SetBinLabel(jj + 1, moduleGroup[jj]); } - // pipe inlet - sc = dcsExpert.regHist(m_hist_Pipes_inletLB[ii] - = TProfile_LW::create(Form("Pipes_inlet_temperature_S%02dvsLB",ii + 1), "Pipes_inlet_temperature vs LB; LB;"+label_inletTemp+";Number of LBs",nbins_LB,min_LB,max_LB)); - //m_hist_Pipes_inletLB[ii]->SetLineColor(kGray); + + sc = dcsExpert.regHist(m_hist_Pipes_inletLB[ii] = TProfile_LW::create( + Form("Pipes_inlet_temperature_S%02dvsLB", ii + 1), "Pipes_inlet_temperature vs LB; LB;" + label_inletTemp + ";Number of LBs", nbins_LB, min_LB, max_LB)); m_hist_Pipes_inletLB[ii]->SetMarkerSize(0.5); - //sc = dcsExpert.regHist(m_hist_LB_moduleGroup_coolingPipeInlet[ii] - // = TProfile2D_LW::create(Form("LB_moduleGroup_coolingPipeInlet_S%02dvsLB",ii + 1), "LB_moduleGroup_coolingPipeInlet; LB;moduleGoup;coolingPipeInlet", - // nbins_LB,min_LB,max_LB,nbins_moduleGroup,min_moduleGroup,max_moduleGroup)); - //m_hist_LB_moduleGroup_coolingPipeInlet[ii]->SetContour(99); - // pipe outlet - sc = dcsExpert.regHist(m_hist_Pipes_outletLB[ii] - = TProfile_LW::create(Form("Pipes_outlet_temperature_S%02dvsLB",ii + 1), "Pipes_outlet_temperature vs LB; LB;"+label_outletTemp+";Number of LBs",nbins_LB,min_LB,max_LB)); - //m_hist_Pipes_outletLB[ii]->SetLineColor(kGray); + + sc = dcsExpert.regHist(m_hist_Pipes_outletLB[ii] = TProfile_LW::create( + Form("Pipes_outlet_temperature_S%02dvsLB", ii + 1), "Pipes_outlet_temperature vs LB; LB;" + label_outletTemp + ";Number of LBs", nbins_LB, min_LB, max_LB)); m_hist_Pipes_outletLB[ii]->SetMarkerSize(0.5); - //sc = dcsExpert.regHist(m_hist_LB_moduleGroup_coolingPipeOutlet[ii] - // = TProfile2D_LW::create(Form("LB_moduleGroup_coolingPipeOutlet_S%02dvsLB",ii + 1), "LB_moduleGroup_coolingPipeOutlet; LB;moduleGoup;coolingPipeOutlet", - // nbins_LB,min_LB,max_LB,nbins_moduleGroup,min_moduleGroup,max_moduleGroup)); - //m_hist_LB_moduleGroup_coolingPipeOutlet[ii]->SetContour(99); - // LV - sc = dcsExpert.regHist(m_hist_LVoltage2Dscatter[ii] - = TH2F_LW::create(Form("LVvoltage_ModuleNumber_S%02d",ii + 1), "LV vs Module Number; Module Number;"+label_LVoltage+";Number of LBs", - nbins_module,min_module,max_module,nbins_LV,min_LV,max_LV)); + + sc = dcsExpert.regHist(m_hist_LVoltage2Dscatter[ii] = TH2F_LW::create( + Form("LVvoltage_ModuleNumber_S%02d", ii + 1), "LV vs Module Number; Module Number;" + label_LVoltage + ";Number of LBs", + nbins_module, min_module, max_module, nbins_LV, min_LV, max_LV)); xaxis = m_hist_LVoltage2Dscatter[ii]->GetXaxis(); - for(int jj = 0; jj < NUMMODULEETA; jj++){ - xaxis->SetBinLabel(jj+1, moduleEta[jj]); + for (int jj = 0; jj < NUMMODULEETA; jj++) { + xaxis->SetBinLabel(jj + 1, moduleEta[jj]); } - //m_hist_LVoltage2Dscatter[ii]->SetContour(99); - // - sc = dcsExpert.regHist(m_hist_LVoltageLB[ii] - = TProfile_LW::create(Form("LVvoltage_S%02dvsLB",ii + 1), "LV vs LB; LB;"+label_LVoltage,nbins_LB,min_LB,max_LB)); - //m_hist_LVoltageLB[ii]->SetLineColor(kGray); + + sc = dcsExpert.regHist(m_hist_LVoltageLB[ii] = TProfile_LW::create(Form("LVvoltage_S%02dvsLB", ii + 1), "LV vs LB; LB;" + label_LVoltage, nbins_LB, min_LB, max_LB)); m_hist_LVoltageLB[ii]->SetMarkerSize(0.5); - // - sc = dcsExpert.regHist(m_hist_LB_moduleGroup_LVoltage[ii] - = TProfile2D_LW::create(Form("LB_moduleGroup_LVoltage_S%02dvsLB",ii + 1), "LB_moduleGroup_LVoltage; LB;moduleGoup;"+label_LVoltage, - nbins_LB,min_LB,max_LB,nbins_moduleGroup,min_moduleGroup,max_moduleGroup)); - //m_hist_LB_moduleGroup_LVoltage[ii]->SetContour(99); + + sc = dcsExpert.regHist(m_hist_LB_moduleGroup_LVoltage[ii] = TProfile2D_LW::create( + Form("LB_moduleGroup_LVoltage_S%02dvsLB", ii + 1), "LB_moduleGroup_LVoltage; LB;moduleGoup;" + label_LVoltage, + nbins_LB, min_LB, max_LB, nbins_moduleGroup, min_moduleGroup, max_moduleGroup)); yaxis = m_hist_LB_moduleGroup_LVoltage[ii]->GetYaxis(); - for(int jj = 0; jj < NUMMODULEGROUP; jj++){ - yaxis->SetBinLabel(jj+1, moduleGroup[jj]); + for (int jj = 0; jj < NUMMODULEGROUP; jj++) { + yaxis->SetBinLabel(jj + 1, moduleGroup[jj]); } - // LV current - sc = dcsExpert.regHist(m_hist_LVcurrent2Dscatter[ii] - = TH2F_LW::create(Form("LVcurrent_ModuleNumber_S%02d",ii + 1), "LV current vs Module Number; Module Number;"+label_LVcurrent+";Number of LBs", - nbins_module,min_module,max_module,nbins_LVcurrent,min_LVcurrent,max_LVcurrent)); + + sc = dcsExpert.regHist(m_hist_LVcurrent2Dscatter[ii] = TH2F_LW::create( + Form("LVcurrent_ModuleNumber_S%02d", ii + 1), "LV current vs Module Number; Module Number;" + label_LVcurrent + ";Number of LBs", + nbins_module, min_module, max_module, nbins_LVcurrent, min_LVcurrent, max_LVcurrent)); xaxis = m_hist_LVcurrent2Dscatter[ii]->GetXaxis(); - for(int jj = 0; jj < NUMMODULEETA; jj++){ - xaxis->SetBinLabel(jj+1, moduleEta[jj]); + for (int jj = 0; jj < NUMMODULEETA; jj++) { + xaxis->SetBinLabel(jj + 1, moduleEta[jj]); } - //m_hist_LVcurrent2Dscatter[ii]->SetContour(99); - // - sc = dcsExpert.regHist(m_hist_LVcurrentLB[ii] - = TProfile_LW::create(Form("LVcurrent_S%02dvsLB",ii + 1), "LV current vs LB; LB;"+label_LVcurrent,nbins_LB,min_LB,max_LB)); - //m_hist_LVcurrentLB[ii]->SetLineColor(kGray); + + sc = dcsExpert.regHist(m_hist_LVcurrentLB[ii] = TProfile_LW::create(Form("LVcurrent_S%02dvsLB", ii + 1), "LV current vs LB; LB;" + label_LVcurrent, nbins_LB, min_LB, max_LB)); m_hist_LVcurrentLB[ii]->SetMarkerSize(0.5); - // - sc = dcsExpert.regHist(m_hist_LB_moduleGroup_LVcurrent[ii] - = TProfile2D_LW::create(Form("LB_moduleGroup_LVcurrent_S%02dvsLB",ii + 1), "LB_moduleGroup_LVcurrent; LB;moduleGoup;"+label_LVcurrent, - nbins_LB,min_LB,max_LB,nbins_moduleGroup,min_moduleGroup,max_moduleGroup)); - //m_hist_LB_moduleGroup_LVcurrent[ii]->SetContour(99); + + sc = dcsExpert.regHist(m_hist_LB_moduleGroup_LVcurrent[ii] = TProfile2D_LW::create( + Form("LB_moduleGroup_LVcurrent_S%02dvsLB", ii + 1), "LB_moduleGroup_LVcurrent; LB;moduleGoup;" + label_LVcurrent, + nbins_LB, min_LB, max_LB, nbins_moduleGroup, min_moduleGroup, max_moduleGroup)); yaxis = m_hist_LB_moduleGroup_LVcurrent[ii]->GetYaxis(); - for(int jj = 0; jj < NUMMODULEGROUP; jj++){ - yaxis->SetBinLabel(jj+1, moduleGroup[jj]); + for (int jj = 0; jj < NUMMODULEGROUP; jj++) { + yaxis->SetBinLabel(jj + 1, moduleGroup[jj]); } - // HV current - sc = dcsExpert.regHist(m_hist_HVcurrent2Dscatter[ii] - = TH2F_LW::create(Form("HVcurrent_ModuleNumber_S%02d",ii + 1), "HV current vs Module Number; Module Number;"+label_HVcurrent+";Number of LBs", - nbins_module,min_module,max_module,nbins_HVcurrent,min_HVcurrent,max_HVcurrent)); + + sc = dcsExpert.regHist(m_hist_HVcurrent2Dscatter[ii] = TH2F_LW::create( + Form("HVcurrent_ModuleNumber_S%02d", ii + 1), "HV current vs Module Number; Module Number;" + label_HVcurrent + ";Number of LBs", + nbins_module, min_module, max_module, nbins_HVcurrent, min_HVcurrent, max_HVcurrent)); xaxis = m_hist_HVcurrent2Dscatter[ii]->GetXaxis(); - for(int jj = 0; jj < NUMMODULEETA; jj++){ - xaxis->SetBinLabel(jj+1, moduleEta[jj]); + for (int jj = 0; jj < NUMMODULEETA; jj++) { + xaxis->SetBinLabel(jj + 1, moduleEta[jj]); } - //m_hist_HVcurrent2Dscatter[ii]->SetContour(99); - // - sc = dcsExpert.regHist(m_hist_HVcurrentLB[ii] - = TProfile_LW::create(Form("HVcurrent_S%02dvsLB",ii + 1), "HV current vs LB; LB;"+label_HVcurrent,nbins_LB,min_LB,max_LB)); - //m_hist_HVcurrentLB[ii]->SetLineColor(kGray); + + sc = dcsExpert.regHist(m_hist_HVcurrentLB[ii] = TProfile_LW::create(Form("HVcurrent_S%02dvsLB", ii + 1), "HV current vs LB; LB;" + label_HVcurrent, nbins_LB, min_LB, max_LB)); m_hist_HVcurrentLB[ii]->SetMarkerSize(0.5); - // - sc = dcsExpert.regHist(m_hist_LB_moduleGroup_HVcurrent[ii] - = TProfile2D_LW::create(Form("LB_moduleGroup_HVcurrent_S%02dvsLB",ii + 1), "LB_moduleGroup_HVcurrent; LB;moduleGoup;"+label_HVcurrent, - nbins_LB,min_LB,max_LB,nbins_moduleGroup,min_moduleGroup,max_moduleGroup)); - //m_hist_LB_moduleGroup_HVcurrent[ii]->SetContour(99); + + sc = dcsExpert.regHist(m_hist_LB_moduleGroup_HVcurrent[ii] = TProfile2D_LW::create( + Form("LB_moduleGroup_HVcurrent_S%02dvsLB", ii + 1), "LB_moduleGroup_HVcurrent; LB;moduleGoup;" + label_HVcurrent, + nbins_LB, min_LB, max_LB, nbins_moduleGroup, min_moduleGroup, max_moduleGroup)); yaxis = m_hist_LB_moduleGroup_HVcurrent[ii]->GetYaxis(); - for(int jj = 0; jj < NUMMODULEGROUP; jj++){ - yaxis->SetBinLabel(jj+1, moduleGroup[jj]); + for (int jj = 0; jj < NUMMODULEGROUP; jj++) { + yaxis->SetBinLabel(jj + 1, moduleGroup[jj]); } - // dT - sc = dcsExpert.regHist(m_hist_LB_moduleGroup_dT[ii] - = TProfile2D_LW::create(Form("LB_moduleGroup_dT_S%02dvsLB",ii + 1), "LB_moduleGroup_dT; LB;moduleGoup;"+label_dT, - nbins_LB,min_LB,max_LB,nbins_moduleGroup,min_moduleGroup,max_moduleGroup)); - //m_hist_LB_moduleGroup_dT[ii]->SetContour(99); + + sc = dcsExpert.regHist(m_hist_LB_moduleGroup_dT[ii] = TProfile2D_LW::create( + Form("LB_moduleGroup_dT_S%02dvsLB", ii + 1), "LB_moduleGroup_dT; LB;moduleGoup;" + label_dT, + nbins_LB, min_LB, max_LB, nbins_moduleGroup, min_moduleGroup, max_moduleGroup)); yaxis = m_hist_LB_moduleGroup_dT[ii]->GetYaxis(); - for(int jj = 0; jj < NUMMODULEGROUP; jj++){ - yaxis->SetBinLabel(jj+1, moduleGroup[jj]); + for (int jj = 0; jj < NUMMODULEGROUP; jj++) { + yaxis->SetBinLabel(jj + 1, moduleGroup[jj]); } - // LV Power consumption - sc = dcsExpert.regHist(m_hist_LB_moduleGroup_LVPowerConsumption[ii] - = TProfile2D_LW::create(Form("LB_moduleGroup_LVPowerConsumption_S%02dvsLB",ii + 1), "LB_moduleGroup_LVPowerConsumption; LB;moduleGoup;"+label_LVPC, - nbins_LB,min_LB,max_LB,nbins_moduleGroup,min_moduleGroup,max_moduleGroup)); - //m_hist_LB_moduleGroup_LVPowerConsumption[ii]->SetContour(99); + + sc = dcsExpert.regHist(m_hist_LB_moduleGroup_LVPowerConsumption[ii] = TProfile2D_LW::create( + Form("LB_moduleGroup_LVPowerConsumption_S%02dvsLB", ii + 1), "LB_moduleGroup_LVPowerConsumption; LB;moduleGoup;" + label_LVPC, + nbins_LB, min_LB, max_LB, nbins_moduleGroup, min_moduleGroup, max_moduleGroup)); yaxis = m_hist_LB_moduleGroup_LVPowerConsumption[ii]->GetYaxis(); - for(int jj = 0; jj < NUMMODULEGROUP; jj++){ - yaxis->SetBinLabel(jj+1, moduleGroup[jj]); + for (int jj = 0; jj < NUMMODULEGROUP; jj++) { + yaxis->SetBinLabel(jj + 1, moduleGroup[jj]); } - // HV Power consumption - sc = dcsExpert.regHist(m_hist_LB_moduleGroup_HVPowerConsumption[ii] - = TProfile2D_LW::create(Form("LB_moduleGroup_HVPowerConsumption_S%02dvsLB",ii + 1), "LB_moduleGroup_HVPowerConsumption; LB;moduleGoup;"+label_HVPC, - nbins_LB,min_LB,max_LB,nbins_moduleGroup,min_moduleGroup,max_moduleGroup)); - //m_hist_LB_moduleGroup_HVPowerConsumption[ii]->SetContour(99); + + sc = dcsExpert.regHist(m_hist_LB_moduleGroup_HVPowerConsumption[ii] = TProfile2D_LW::create( + Form("LB_moduleGroup_HVPowerConsumption_S%02dvsLB", ii + 1), "LB_moduleGroup_HVPowerConsumption; LB;moduleGoup;" + label_HVPC, + nbins_LB, min_LB, max_LB, nbins_moduleGroup, min_moduleGroup, max_moduleGroup)); yaxis = m_hist_LB_moduleGroup_HVPowerConsumption[ii]->GetYaxis(); - for(int jj = 0; jj < NUMMODULEGROUP; jj++){ - yaxis->SetBinLabel(jj+1, moduleGroup[jj]); + for (int jj = 0; jj < NUMMODULEGROUP; jj++) { + yaxis->SetBinLabel(jj + 1, moduleGroup[jj]); } - // LV+HV Power consumption - sc = dcsExpert.regHist(m_hist_LB_moduleGroup_LVHVPowerConsumption[ii] - = TProfile2D_LW::create(Form("LB_moduleGroup_LVHVPowerConsumption_S%02dvsLB",ii + 1), "LB_moduleGroup_LVHVPowerConsumption; LB;moduleGoup;"+label_LVHVPC, - nbins_LB,min_LB,max_LB,nbins_moduleGroup,min_moduleGroup,max_moduleGroup)); - //m_hist_LB_moduleGroup_LVHVPowerConsumption[ii]->SetContour(99); + + sc = dcsExpert.regHist(m_hist_LB_moduleGroup_LVHVPowerConsumption[ii] = TProfile2D_LW::create( + Form("LB_moduleGroup_LVHVPowerConsumption_S%02dvsLB", ii + 1), "LB_moduleGroup_LVHVPowerConsumption; LB;moduleGoup;" + label_LVHVPC, + nbins_LB, min_LB, max_LB, nbins_moduleGroup, min_moduleGroup, max_moduleGroup)); yaxis = m_hist_LB_moduleGroup_LVHVPowerConsumption[ii]->GetYaxis(); - for(int jj = 0; jj < NUMMODULEGROUP; jj++){ - yaxis->SetBinLabel(jj+1, moduleGroup[jj]); + for (int jj = 0; jj < NUMMODULEGROUP; jj++) { + yaxis->SetBinLabel(jj + 1, moduleGroup[jj]); } - // eff flex temp - sc = dcsExpert.regHist(m_hist_LB_moduleGroup_effFLEXtemp[ii] - = TProfile2D_LW::create(Form("LB_moduleGroup_effFLEXtemp_S%02dvsLB",ii + 1), "LB_moduleGroup_effFLEXtemp; LB;moduleGoup;"+label_effFLEXtemp, - nbins_LB,min_LB,max_LB,nbins_moduleGroup,min_moduleGroup,max_moduleGroup)); - //m_hist_LB_moduleGroup_effFLEXtemp[ii]->SetContour(99); + + sc = dcsExpert.regHist(m_hist_LB_moduleGroup_effFLEXtemp[ii] = TProfile2D_LW::create( + Form("LB_moduleGroup_effFLEXtemp_S%02dvsLB", ii + 1), "LB_moduleGroup_effFLEXtemp; LB;moduleGoup;" + label_effFLEXtemp, + nbins_LB, min_LB, max_LB, nbins_moduleGroup, min_moduleGroup, max_moduleGroup)); yaxis = m_hist_LB_moduleGroup_effFLEXtemp[ii]->GetYaxis(); - for(int jj = 0; jj < NUMMODULEGROUP; jj++){ - yaxis->SetBinLabel(jj+1, moduleGroup[jj]); + for (int jj = 0; jj < NUMMODULEGROUP; jj++) { + yaxis->SetBinLabel(jj + 1, moduleGroup[jj]); } - // thermal figure of merit - sc = dcsExpert.regHist(m_hist_LB_moduleGroup_thermalFigureMerit[ii] - = TProfile2D_LW::create(Form("LB_moduleGroup_thermalFigureMerit_S%02dvsLB",ii + 1), "LB_moduleGroup_thermalFigureMerit; LB;moduleGoup;"+label_tfm, - nbins_LB,min_LB,max_LB,nbins_moduleGroup,min_moduleGroup,max_moduleGroup)); - //m_hist_LB_moduleGroup_thermalFigureMerit[ii]->SetContour(99); + + sc = dcsExpert.regHist(m_hist_LB_moduleGroup_thermalFigureMerit[ii] = TProfile2D_LW::create( + Form("LB_moduleGroup_thermalFigureMerit_S%02dvsLB", ii + 1), "LB_moduleGroup_thermalFigureMerit; LB;moduleGoup;" + label_tfm, + nbins_LB, min_LB, max_LB, nbins_moduleGroup, min_moduleGroup, max_moduleGroup)); yaxis = m_hist_LB_moduleGroup_thermalFigureMerit[ii]->GetYaxis(); - for(int jj = 0; jj < NUMMODULEGROUP; jj++){ - yaxis->SetBinLabel(jj+1, moduleGroup[jj]); + for (int jj = 0; jj < NUMMODULEGROUP; jj++) { + yaxis->SetBinLabel(jj + 1, moduleGroup[jj]); } - // FSM state - sc = dcsExpert.regHist(m_hist_FSMstate2Dscatter[ii] - = TH2F_LW::create(Form("FSMstate_ModuleNumber_S%02d",ii + 1), "FSM State vs Module Number; Module Number;"+label_FSMstate+";Number of LBs", - nbins_module,min_module,max_module,nbins_FSM,min_FSM,max_FSM)); + + sc = dcsExpert.regHist(m_hist_FSMstate2Dscatter[ii] = TH2F_LW::create( + Form("FSMstate_ModuleNumber_S%02d", ii + 1), "FSM State vs Module Number; Module Number;" + label_FSMstate + ";Number of LBs", + nbins_module, min_module, max_module, nbins_FSM, min_FSM, max_FSM)); xaxis = m_hist_FSMstate2Dscatter[ii]->GetXaxis(); - for(int jj = 0; jj < NUMMODULEETA; jj++){ - xaxis->SetBinLabel(jj+1, moduleEta[jj]); + for (int jj = 0; jj < NUMMODULEETA; jj++) { + xaxis->SetBinLabel(jj + 1, moduleEta[jj]); } - //m_hist_FSMstate2Dscatter[ii]->SetContour(99); yaxis = m_hist_FSMstate2Dscatter[ii]->GetYaxis(); - for(int jj = 0; jj < NUMFSM; jj++){ - yaxis->SetBinLabel(jj+1, FSMSTATE[jj]); + for (int jj = 0; jj < NUMFSM; jj++) { + yaxis->SetBinLabel(jj + 1, FSMSTATE[jj]); } - //sc = dcsExpert.regHist(m_hist_FSMstateLB[ii] - // = TProfile_LW::create(Form("FSM State_S%02dvsLB",ii + 1), "FSM State vs LB; LB;"+label_FSMstate,nbins_LB,min_LB,max_LB)); - sc = dcsExpert.regHist(m_hist_FSMstateLB[ii] - = TH2F_LW::create(Form("FSMstate_S%02dvsLB",ii + 1), "FSM State vs LB; LB;"+label_FSMstate+";Number of Modules", - nbins_LB,min_LB,max_LB, nbins_FSM, min_FSM, max_FSM)); + + sc = dcsExpert.regHist(m_hist_FSMstateLB[ii] = TH2F_LW::create( + Form("FSMstate_S%02dvsLB", ii + 1), "FSM State vs LB; LB;" + label_FSMstate + ";Number of Modules", + nbins_LB, min_LB, max_LB, nbins_FSM, min_FSM, max_FSM)); yaxis = m_hist_FSMstateLB[ii]->GetYaxis(); - for(int jj = 0; jj < NUMFSM; jj++){ - yaxis->SetBinLabel(jj+1, FSMSTATE[jj]); + for (int jj = 0; jj < NUMFSM; jj++) { + yaxis->SetBinLabel(jj + 1, FSMSTATE[jj]); } - sc = dcsExpert.regHist(m_hist_LB_moduleGroup_FSMstate[ii] - = new TH2F(Form("LB_moduleGroup_FSMstate_S%02dvsLB",ii + 1), "LB_moduleGroup_FSMstate; LB;moduleGoup;"+label_FSMstate, - nbins_LB,min_LB,max_LB,nbins_moduleGroup,min_moduleGroup,max_moduleGroup)); - //= new TProfile2D(Form("LB_moduleGroup_FSMstate_S%02dvsLB",ii + 1), "LB_moduleGroup_FSMstate; LB;moduleGoup;"+label_FSMstate, + + sc = dcsExpert.regHist(m_hist_LB_moduleGroup_FSMstate[ii] = new TH2F( + Form("LB_moduleGroup_FSMstate_S%02dvsLB", ii + 1), "LB_moduleGroup_FSMstate; LB;moduleGoup;" + label_FSMstate, + nbins_LB, min_LB, max_LB, nbins_moduleGroup, min_moduleGroup, max_moduleGroup)); m_hist_LB_moduleGroup_FSMstate[ii]->SetMaximum(NUMFSM); m_hist_LB_moduleGroup_FSMstate[ii]->SetMinimum(0); m_hist_LB_moduleGroup_FSMstate[ii]->SetContour(NUMFSM); - //yaxis = m_hist_LB_moduleGroup_FSMstate[ii]->GetYaxis(); tyaxis = m_hist_LB_moduleGroup_FSMstate[ii]->GetYaxis(); - for(int jj = 0; jj < NUMMODULEGROUP; jj++){ - tyaxis->SetBinLabel(jj+1, moduleGroup[jj]); - //yaxis->SetBinLabel(jj+1, moduleGroup[jj]); + for (int jj = 0; jj < NUMMODULEGROUP; jj++) { + tyaxis->SetBinLabel(jj + 1, moduleGroup[jj]); } - // FSM status - sc = dcsExpert.regHist(m_hist_FSMstatus2Dscatter[ii] - = TH2F_LW::create(Form("FSMstatus_ModuleNumber_S%02d",ii + 1), "FSM Status vs Module Number; Module Number;"+label_FSMstatus+";Number of LBs", - nbins_module,min_module,max_module,nbins_FSM,min_FSM,max_FSM)); + + sc = dcsExpert.regHist(m_hist_FSMstatus2Dscatter[ii] = TH2F_LW::create( + Form("FSMstatus_ModuleNumber_S%02d", ii + 1), "FSM Status vs Module Number; Module Number;" + label_FSMstatus + ";Number of LBs", + nbins_module, min_module, max_module, nbins_FSM, min_FSM, max_FSM)); xaxis = m_hist_FSMstatus2Dscatter[ii]->GetXaxis(); - for(int jj = 0; jj < NUMMODULEETA; jj++){ - xaxis->SetBinLabel(jj+1, moduleEta[jj]); + for (int jj = 0; jj < NUMMODULEETA; jj++) { + xaxis->SetBinLabel(jj + 1, moduleEta[jj]); } - //m_hist_FSMstatus2Dscatter[ii]->SetContour(99); yaxis = m_hist_FSMstatus2Dscatter[ii]->GetYaxis(); - for(int jj = 0; jj < NUMFSM; jj++){ - yaxis->SetBinLabel(jj+1, FSMSTATUS[jj]); + for (int jj = 0; jj < NUMFSM; jj++) { + yaxis->SetBinLabel(jj + 1, FSMSTATUS[jj]); } - //sc = dcsExpert.regHist(m_hist_FSMstatusLB[ii] - // = TProfile_LW::create(Form("FSM Status_S%02dvsLB",ii + 1), "FSM Status vs LB; LB;"+label_FSMstatus,nbins_LB,min_LB,max_LB)); - sc = dcsExpert.regHist(m_hist_FSMstatusLB[ii] - = TH2F_LW::create(Form("FSMstatus_S%02dvsLB",ii + 1), "FSM Status vs LB; LB;"+label_FSMstatus+";Number of Modules", - nbins_LB,min_LB,max_LB, nbins_FSM, min_FSM, max_FSM)); + + sc = dcsExpert.regHist(m_hist_FSMstatusLB[ii] = TH2F_LW::create( + Form("FSMstatus_S%02dvsLB", ii + 1), "FSM Status vs LB; LB;" + label_FSMstatus + ";Number of Modules", + nbins_LB, min_LB, max_LB, nbins_FSM, min_FSM, max_FSM)); yaxis = m_hist_FSMstatusLB[ii]->GetYaxis(); - for(int jj = 0; jj < NUMFSM; jj++){ - yaxis->SetBinLabel(jj+1, FSMSTATUS[jj]); + for (int jj = 0; jj < NUMFSM; jj++) { + yaxis->SetBinLabel(jj + 1, FSMSTATUS[jj]); } - sc = dcsExpert.regHist(m_hist_LB_moduleGroup_FSMstatus[ii] - = new TH2F(Form("LB_moduleGroup_FSMstatus_S%02dvsLB",ii + 1), "LB_moduleGroup_FSMstatus; LB;moduleGoup;"+label_FSMstatus, - nbins_LB,min_LB,max_LB,nbins_moduleGroup,min_moduleGroup,max_moduleGroup)); - //= new TProfile2D(Form("LB_moduleGroup_FSMstatus_S%02dvsLB",ii + 1), "LB_moduleGroup_FSMstatus; LB;moduleGoup;"+label_FSMstatus, + + sc = dcsExpert.regHist(m_hist_LB_moduleGroup_FSMstatus[ii] = new TH2F( + Form("LB_moduleGroup_FSMstatus_S%02dvsLB", ii + 1), "LB_moduleGroup_FSMstatus; LB;moduleGoup;" + label_FSMstatus, + nbins_LB, min_LB, max_LB, nbins_moduleGroup, min_moduleGroup, max_moduleGroup)); m_hist_LB_moduleGroup_FSMstatus[ii]->SetMaximum(NUMFSM); m_hist_LB_moduleGroup_FSMstatus[ii]->SetMinimum(0); m_hist_LB_moduleGroup_FSMstatus[ii]->SetContour(NUMFSM); - //yaxis = m_hist_LB_moduleGroup_FSMstatus[ii]->GetYaxis(); tyaxis = m_hist_LB_moduleGroup_FSMstatus[ii]->GetYaxis(); - for(int jj = 0; jj < NUMMODULEGROUP; jj++){ - //yaxis->SetBinLabel(jj+1, moduleGroup[jj]); - tyaxis->SetBinLabel(jj+1, moduleGroup[jj]); + for (int jj = 0; jj < NUMMODULEGROUP; jj++) { + tyaxis->SetBinLabel(jj + 1, moduleGroup[jj]); } } - // temperature - sc = dcsExpert.regHist(m_hist_moduleTemperatureEtaPhi - = TProfile2D_LW::create("moduleTemperature_EtaPhi", "Module Temperature EtaPhi; Module #eta Index;staveID;"+label_moduleTemp, - nbins_module,min_module,max_module,nbins_staveID,min_staveID,max_staveID)); - //m_hist_moduleTemperatureEtaPhi->SetContour(99); + + sc = dcsExpert.regHist(m_hist_moduleTemperatureEtaPhi = TProfile2D_LW::create( + "moduleTemperature_EtaPhi", "Module Temperature EtaPhi; Module #eta Index;staveID;" + label_moduleTemp, + nbins_module, min_module, max_module, nbins_staveID, min_staveID, max_staveID)); xaxis = m_hist_moduleTemperatureEtaPhi->GetXaxis(); - for(int jj = 0; jj < NUMMODULEETA; jj++){ - xaxis->SetBinLabel(jj+1, moduleEta[jj]); + for (int jj = 0; jj < NUMMODULEETA; jj++) { + xaxis->SetBinLabel(jj + 1, moduleEta[jj]); } - sc = dcsExpert.regHist(m_hist_LB_staveID_moduleTemperature - = TProfile2D_LW::create("LB_staveID_moduleTemperature", "LB_staveID_moduleTemperature; LB;staveID;"+label_moduleTemp, - nbins_LB,min_LB,max_LB,nbins_staveID,min_staveID,max_staveID)); - //m_hist_LB_staveID_moduleTemperature->SetContour(99); - // HV - sc = dcsExpert.regHist(m_hist_HVoltageEtaPhi - = TProfile2D_LW::create("HV_EtaPhi", "HV EtaPhi; Module #eta Index;staveID;"+label_HVoltage, - nbins_module,min_module,max_module,nbins_staveID,min_staveID,max_staveID)); - //m_hist_HVoltageEtaPhi->SetContour(99); + + sc = dcsExpert.regHist(m_hist_LB_staveID_moduleTemperature = TProfile2D_LW::create( + "LB_staveID_moduleTemperature", "LB_staveID_moduleTemperature; LB;staveID;" + label_moduleTemp, + nbins_LB, min_LB, max_LB, nbins_staveID, min_staveID, max_staveID)); + + sc = dcsExpert.regHist(m_hist_HVoltageEtaPhi = TProfile2D_LW::create( + "HV_EtaPhi", "HV EtaPhi; Module #eta Index;staveID;" + label_HVoltage, + nbins_module, min_module, max_module, nbins_staveID, min_staveID, max_staveID)); xaxis = m_hist_HVoltageEtaPhi->GetXaxis(); - for(int jj = 0; jj < NUMMODULEETA; jj++){ - xaxis->SetBinLabel(jj+1, moduleEta[jj]); + for (int jj = 0; jj < NUMMODULEETA; jj++) { + xaxis->SetBinLabel(jj + 1, moduleEta[jj]); } - sc = dcsExpert.regHist(m_hist_LB_staveID_HVoltage - = TProfile2D_LW::create("LB_staveID_HV", "LB_staveID_HV; LB;staveID;"+label_HVoltage, - nbins_LB,min_LB,max_LB,nbins_staveID,min_staveID,max_staveID)); - //m_hist_LB_staveID_HVoltage->SetContour(99); - // pipe inlet - sc = dcsExpert.regHist(m_hist_Pipes_inlet2Dscatter - = TH2F_LW::create("Pipes_inlet_temperature_StaveNumber", "Pipes_inlet_temperature vs Stave Number; Stave Number;"+label_inletTemp, - nbins_staveID,min_staveID,max_staveID,nbins_temperature,min_temperature,max_temperature)); - //m_hist_Pipes_inlet2Dscatter->SetContour(99); - sc = dcsExpert.regHist(m_hist_LB_staveID_coolingPipeInlet - = TProfile2D_LW::create("LB_staveID_coolingPipeInlet", "LB_staveID_coolingPipeInlet; LB;staveID;"+label_inletTemp, - nbins_LB,min_LB,max_LB,nbins_staveID,min_staveID,max_staveID)); - //m_hist_LB_staveID_coolingPipeInlet->SetContour(99); - // pipe outlet - //sc = dcsExpert.regHist(m_hist_Pipes_outletEtaPhi - // = TProfile2D_LW::create("coolingPipeOutlet EtaPhi", "coolingPipeOutlet EtaPhi; Module #eta Index;staveID;coolingPipeOutlet", - // nbins_module,min_module,max_module,nbins_staveID,min_staveID,max_staveID)); - sc = dcsExpert.regHist(m_hist_Pipes_outlet2Dscatter - = TH2F_LW::create("Pipes_outlet_temperature_StaveNumber", "Pipes_outlet_temperature vs Stave Number; Stave Number;"+label_outletTemp, - nbins_staveID,min_staveID,max_staveID,nbins_temperature,min_temperature,max_temperature)); - //m_hist_Pipes_outlet2Dscatter->SetContour(99); - sc = dcsExpert.regHist(m_hist_LB_staveID_coolingPipeOutlet - = TProfile2D_LW::create("LB_staveID_coolingPipeOutlet", "LB_staveID_coolingPipeOutlet; LB;staveID;"+label_outletTemp, - nbins_LB,min_LB,max_LB,nbins_staveID,min_staveID,max_staveID)); - //m_hist_LB_staveID_coolingPipeOutlet->SetContour(99); - // LV - sc = dcsExpert.regHist(m_hist_LVoltageEtaPhi - = TProfile2D_LW::create("LV_EtaPhi", "LV EtaPhi; Module #eta Index;staveID;"+label_LVoltage, - nbins_module,min_module,max_module,nbins_staveID,min_staveID,max_staveID)); - //m_hist_LVoltageEtaPhi->SetContour(99); + + sc = dcsExpert.regHist(m_hist_LB_staveID_HVoltage = TProfile2D_LW::create( + "LB_staveID_HV", "LB_staveID_HV; LB;staveID;" + label_HVoltage, + nbins_LB, min_LB, max_LB, nbins_staveID, min_staveID, max_staveID)); + sc = dcsExpert.regHist(m_hist_Pipes_inlet2Dscatter = TH2F_LW::create( + "Pipes_inlet_temperature_StaveNumber", "Pipes_inlet_temperature vs Stave Number; Stave Number;" + label_inletTemp, + nbins_staveID, min_staveID, max_staveID, nbins_temperature, min_temperature, max_temperature)); + sc = dcsExpert.regHist(m_hist_LB_staveID_coolingPipeInlet = TProfile2D_LW::create( + "LB_staveID_coolingPipeInlet", "LB_staveID_coolingPipeInlet; LB;staveID;" + label_inletTemp, + nbins_LB, min_LB, max_LB, nbins_staveID, min_staveID, max_staveID)); + sc = dcsExpert.regHist(m_hist_Pipes_outlet2Dscatter = TH2F_LW::create( + "Pipes_outlet_temperature_StaveNumber", "Pipes_outlet_temperature vs Stave Number; Stave Number;" + label_outletTemp, + nbins_staveID, min_staveID, max_staveID, nbins_temperature, min_temperature, max_temperature)); + sc = dcsExpert.regHist(m_hist_LB_staveID_coolingPipeOutlet = TProfile2D_LW::create( + "LB_staveID_coolingPipeOutlet", "LB_staveID_coolingPipeOutlet; LB;staveID;" + label_outletTemp, + nbins_LB, min_LB, max_LB, nbins_staveID, min_staveID, max_staveID)); + + sc = dcsExpert.regHist(m_hist_LVoltageEtaPhi = TProfile2D_LW::create( + "LV_EtaPhi", "LV EtaPhi; Module #eta Index;staveID;" + label_LVoltage, + nbins_module, min_module, max_module, nbins_staveID, min_staveID, max_staveID)); xaxis = m_hist_LVoltageEtaPhi->GetXaxis(); - for(int jj = 0; jj < NUMMODULEETA; jj++){ - xaxis->SetBinLabel(jj+1, moduleEta[jj]); + for (int jj = 0; jj < NUMMODULEETA; jj++) { + xaxis->SetBinLabel(jj + 1, moduleEta[jj]); } - sc = dcsExpert.regHist(m_hist_LB_staveID_LVoltage - = TProfile2D_LW::create("LB_staveID_LV", "LB_staveID_LV; LB;staveID;"+label_LVoltage, - nbins_LB,min_LB,max_LB,nbins_staveID,min_staveID,max_staveID)); - //m_hist_LB_staveID_LVoltage->SetContour(99); - // LV current - sc = dcsExpert.regHist(m_hist_LVcurrentEtaPhi - = TProfile2D_LW::create("LVcurrent_EtaPhi", "LV current EtaPhi; Module #eta Index;staveID;"+label_LVcurrent, - nbins_module,min_module,max_module,nbins_staveID,min_staveID,max_staveID)); - //m_hist_LVcurrentEtaPhi->SetContour(99); + sc = dcsExpert.regHist(m_hist_LB_staveID_LVoltage = TProfile2D_LW::create( + "LB_staveID_LV", "LB_staveID_LV; LB;staveID;" + label_LVoltage, + nbins_LB, min_LB, max_LB, nbins_staveID, min_staveID, max_staveID)); + + sc = dcsExpert.regHist(m_hist_LVcurrentEtaPhi = TProfile2D_LW::create( + "LVcurrent_EtaPhi", "LV current EtaPhi; Module #eta Index;staveID;" + label_LVcurrent, + nbins_module, min_module, max_module, nbins_staveID, min_staveID, max_staveID)); xaxis = m_hist_LVcurrentEtaPhi->GetXaxis(); - for(int jj = 0; jj < NUMMODULEETA; jj++){ - xaxis->SetBinLabel(jj+1, moduleEta[jj]); + for (int jj = 0; jj < NUMMODULEETA; jj++) { + xaxis->SetBinLabel(jj + 1, moduleEta[jj]); } - sc = dcsExpert.regHist(m_hist_LB_staveID_LVcurrent - = TProfile2D_LW::create("LB_staveID_LVcurrent", "LB_staveID_LVcurrent; LB;staveID;"+label_LVcurrent, - nbins_LB,min_LB,max_LB,nbins_staveID,min_staveID,max_staveID)); - //m_hist_LB_staveID_LVcurrent->SetContour(99); - // HV current - sc = dcsExpert.regHist(m_hist_HVcurrentEtaPhi - = TProfile2D_LW::create("HVcurrent_EtaPhi", "HV current EtaPhi; Module #eta Index;staveID;"+label_HVcurrent, - nbins_module,min_module,max_module,nbins_staveID,min_staveID,max_staveID)); - //m_hist_HVcurrentEtaPhi->SetContour(99); + sc = dcsExpert.regHist(m_hist_LB_staveID_LVcurrent = TProfile2D_LW::create( + "LB_staveID_LVcurrent", "LB_staveID_LVcurrent; LB;staveID;" + label_LVcurrent, + nbins_LB, min_LB, max_LB, nbins_staveID, min_staveID, max_staveID)); + + sc = dcsExpert.regHist(m_hist_HVcurrentEtaPhi = TProfile2D_LW::create( + "HVcurrent_EtaPhi", "HV current EtaPhi; Module #eta Index;staveID;" + label_HVcurrent, + nbins_module, min_module, max_module, nbins_staveID, min_staveID, max_staveID)); xaxis = m_hist_HVcurrentEtaPhi->GetXaxis(); - for(int jj = 0; jj < NUMMODULEETA; jj++){ - xaxis->SetBinLabel(jj+1, moduleEta[jj]); + for (int jj = 0; jj < NUMMODULEETA; jj++) { + xaxis->SetBinLabel(jj + 1, moduleEta[jj]); } - sc = dcsExpert.regHist(m_hist_LB_staveID_HVcurrent - = TProfile2D_LW::create("LB_staveID_HVcurrent", "LB_staveID_HVcurrent; LB;staveID;"+label_HVcurrent, - nbins_LB,min_LB,max_LB,nbins_staveID,min_staveID,max_staveID)); - //m_hist_LB_staveID_HVcurrent->SetContour(99); - // FSM state - //sc = dcsExpert.regHist(m_hist_FSMstateEtaPhi - // = TProfile2D_LW::create("FSMstate EtaPhi", "FSMstate EtaPhi; Module #eta Index;staveID;"+label_FSMstate, - // nbins_module,min_module,max_module,nbins_staveID,min_staveID,max_staveID)); - sc = dcsExpert.regHist(m_hist_FSMstateEtaPhi - = new TH2F("FSMstate_EtaPhi", "FSMstate EtaPhi; Module #eta Index;staveID;"+label_FSMstate, - nbins_module,min_module,max_module,nbins_staveID,min_staveID,max_staveID)); + + sc = dcsExpert.regHist(m_hist_LB_staveID_HVcurrent = TProfile2D_LW::create( + "LB_staveID_HVcurrent", "LB_staveID_HVcurrent; LB;staveID;" + label_HVcurrent, + nbins_LB, min_LB, max_LB, nbins_staveID, min_staveID, max_staveID)); + sc = dcsExpert.regHist(m_hist_FSMstateEtaPhi = new TH2F( + "FSMstate_EtaPhi", "FSMstate EtaPhi; Module #eta Index;staveID;" + label_FSMstate, + nbins_module, min_module, max_module, nbins_staveID, min_staveID, max_staveID)); m_hist_FSMstateEtaPhi->SetMaximum(NUMFSM); m_hist_FSMstateEtaPhi->SetMinimum(0); m_hist_FSMstateEtaPhi->SetContour(NUMFSM); - //xaxis = m_hist_FSMstateEtaPhi->GetXaxis(); txaxis = m_hist_FSMstateEtaPhi->GetXaxis(); - for(int jj = 0; jj < NUMMODULEETA; jj++){ + for (int jj = 0; jj < NUMMODULEETA; jj++) { //xaxis->SetBinLabel(jj+1, moduleEta[jj]); - txaxis->SetBinLabel(jj+1, moduleEta[jj]); + txaxis->SetBinLabel(jj + 1, moduleEta[jj]); } - sc = dcsExpert.regHist(m_hist_LB_staveID_FSMstate - = new TH2F("LB_staveID_FSMstate", "LB_staveID_FSMstate; LB;staveID;"+label_FSMstate, - nbins_LB,min_LB,max_LB,nbins_staveID,min_staveID,max_staveID)); - //= TProfile2D_LW::create("LB_staveID_FSMstate", "LB_staveID_FSMstate; LB;staveID;"+label_FSMstate, + + sc = dcsExpert.regHist(m_hist_LB_staveID_FSMstate = new TH2F( + "LB_staveID_FSMstate", "LB_staveID_FSMstate; LB;staveID;" + label_FSMstate, + nbins_LB, min_LB, max_LB, nbins_staveID, min_staveID, max_staveID)); m_hist_LB_staveID_FSMstate->SetMaximum(NUMFSM); m_hist_LB_staveID_FSMstate->SetMinimum(0); m_hist_LB_staveID_FSMstate->SetContour(NUMFSM); - // FSM status - //sc = dcsExpert.regHist(m_hist_FSMstatusEtaPhi - // = TProfile2D_LW::create("FSMstatus EtaPhi", "FSMstatus EtaPhi; Module #eta Index;staveID;"+label_FSMstatus, - // nbins_module,min_module,max_module,nbins_staveID,min_staveID,max_staveID)); - sc = dcsExpert.regHist(m_hist_FSMstatusEtaPhi - = new TH2F("FSMstatus_EtaPhi", "FSMstatus EtaPhi; Module #eta Index;staveID;"+label_FSMstatus, - nbins_module,min_module,max_module,nbins_staveID,min_staveID,max_staveID)); + + sc = dcsExpert.regHist(m_hist_FSMstatusEtaPhi = new TH2F( + "FSMstatus_EtaPhi", "FSMstatus EtaPhi; Module #eta Index;staveID;" + label_FSMstatus, + nbins_module, min_module, max_module, nbins_staveID, min_staveID, max_staveID)); m_hist_FSMstatusEtaPhi->SetMaximum(NUMFSM); m_hist_FSMstatusEtaPhi->SetMinimum(0); m_hist_FSMstatusEtaPhi->SetContour(NUMFSM); - //xaxis = m_hist_FSMstatusEtaPhi->GetXaxis(); txaxis = m_hist_FSMstatusEtaPhi->GetXaxis(); - for(int jj = 0; jj < NUMMODULEETA; jj++){ - //xaxis->SetBinLabel(jj+1, moduleEta[jj]); - txaxis->SetBinLabel(jj+1, moduleEta[jj]); + for (int jj = 0; jj < NUMMODULEETA; jj++) { + txaxis->SetBinLabel(jj + 1, moduleEta[jj]); } - sc = dcsExpert.regHist(m_hist_LB_staveID_FSMstatus - = new TH2F("LB_staveID_FSMstatus", "LB_staveID_FSMstatus; LB;staveID;"+label_FSMstatus, - nbins_LB,min_LB,max_LB,nbins_staveID,min_staveID,max_staveID)); - //= TProfile2D_LW::create("LB_staveID_FSMstatus", "LB_staveID_FSMstatus; LB;staveID;"+label_FSMstatus, + + sc = dcsExpert.regHist(m_hist_LB_staveID_FSMstatus = new TH2F( + "LB_staveID_FSMstatus", "LB_staveID_FSMstatus; LB;staveID;" + label_FSMstatus, + nbins_LB, min_LB, max_LB, nbins_staveID, min_staveID, max_staveID)); m_hist_LB_staveID_FSMstatus->SetMaximum(NUMFSM); m_hist_LB_staveID_FSMstatus->SetMinimum(0); m_hist_LB_staveID_FSMstatus->SetContour(NUMFSM); - // dT - sc = dcsExpert.regHist(m_hist_dTEtaPhi - = TProfile2D_LW::create("dT_EtaPhi", "dT EtaPhi; Module #eta Index;staveID;"+label_dT, - nbins_module,min_module,max_module,nbins_staveID,min_staveID,max_staveID)); - //m_hist_dTEtaPhi->SetContour(99); + + sc = dcsExpert.regHist(m_hist_dTEtaPhi = TProfile2D_LW::create( + "dT_EtaPhi", "dT EtaPhi; Module #eta Index;staveID;" + label_dT, + nbins_module, min_module, max_module, nbins_staveID, min_staveID, max_staveID)); xaxis = m_hist_dTEtaPhi->GetXaxis(); - for(int jj = 0; jj < NUMMODULEETA; jj++){ - xaxis->SetBinLabel(jj+1, moduleEta[jj]); + for (int jj = 0; jj < NUMMODULEETA; jj++) { + xaxis->SetBinLabel(jj + 1, moduleEta[jj]); } - sc = dcsExpert.regHist(m_hist_LB_staveID_dT - = TProfile2D_LW::create("LB_staveID_dT", "LB_staveID_dT; LB;staveID;"+label_dT, - nbins_LB,min_LB,max_LB,nbins_staveID,min_staveID,max_staveID)); - //m_hist_LB_staveID_dT->SetContour(99); - // LV PC - sc = dcsExpert.regHist(m_hist_LVPowerConsumptionEtaPhi - = TProfile2D_LW::create("LVPowerConsumption_EtaPhi", "LV Power Consumption EtaPhi; Module #eta Index;staveID;"+label_LVPC, - nbins_module,min_module,max_module,nbins_staveID,min_staveID,max_staveID)); - //m_hist_LVPowerConsumptionEtaPhi->SetContour(99); + + sc = dcsExpert.regHist(m_hist_LB_staveID_dT = TProfile2D_LW::create( + "LB_staveID_dT", "LB_staveID_dT; LB;staveID;" + label_dT, + nbins_LB, min_LB, max_LB, nbins_staveID, min_staveID, max_staveID)); + sc = dcsExpert.regHist(m_hist_LVPowerConsumptionEtaPhi = TProfile2D_LW::create( + "LVPowerConsumption_EtaPhi", "LV Power Consumption EtaPhi; Module #eta Index;staveID;" + label_LVPC, + nbins_module, min_module, max_module, nbins_staveID, min_staveID, max_staveID)); xaxis = m_hist_LVPowerConsumptionEtaPhi->GetXaxis(); - for(int jj = 0; jj < NUMMODULEETA; jj++){ - xaxis->SetBinLabel(jj+1, moduleEta[jj]); + for (int jj = 0; jj < NUMMODULEETA; jj++) { + xaxis->SetBinLabel(jj + 1, moduleEta[jj]); } - sc = dcsExpert.regHist(m_hist_LB_staveID_LVPowerConsumption - = TProfile2D_LW::create("LB_staveID_LVPowerConsumption", "LB_staveID_LVPowerConsumption; LB;staveID;"+label_LVPC, - nbins_LB,min_LB,max_LB,nbins_staveID,min_staveID,max_staveID)); - //m_hist_LB_staveID_LVPowerConsumption->SetContour(99); - // HV PC - sc = dcsExpert.regHist(m_hist_HVPowerConsumptionEtaPhi - = TProfile2D_LW::create("HVPowerConsumption_EtaPhi", "HV Power Consumption EtaPhi; Module #eta Index;staveID;"+label_HVPC, - nbins_module,min_module,max_module,nbins_staveID,min_staveID,max_staveID)); - //m_hist_HVPowerConsumptionEtaPhi->SetContour(99); + + sc = dcsExpert.regHist(m_hist_LB_staveID_LVPowerConsumption = TProfile2D_LW::create( + "LB_staveID_LVPowerConsumption", "LB_staveID_LVPowerConsumption; LB;staveID;" + label_LVPC, + nbins_LB, min_LB, max_LB, nbins_staveID, min_staveID, max_staveID)); + sc = dcsExpert.regHist(m_hist_HVPowerConsumptionEtaPhi = TProfile2D_LW::create( + "HVPowerConsumption_EtaPhi", "HV Power Consumption EtaPhi; Module #eta Index;staveID;" + label_HVPC, + nbins_module, min_module, max_module, nbins_staveID, min_staveID, max_staveID)); xaxis = m_hist_HVPowerConsumptionEtaPhi->GetXaxis(); - for(int jj = 0; jj < NUMMODULEETA; jj++){ - xaxis->SetBinLabel(jj+1, moduleEta[jj]); + for (int jj = 0; jj < NUMMODULEETA; jj++) { + xaxis->SetBinLabel(jj + 1, moduleEta[jj]); } - sc = dcsExpert.regHist(m_hist_LB_staveID_HVPowerConsumption - = TProfile2D_LW::create("LB_staveID_HVPowerConsumption", "LB_staveID_HVPowerConsumption; LB;staveID;"+label_HVPC, - nbins_LB,min_LB,max_LB,nbins_staveID,min_staveID,max_staveID)); - //m_hist_LB_staveID_HVPowerConsumption->SetContour(99); - // LVHV PC - sc = dcsExpert.regHist(m_hist_LVHVPowerConsumptionEtaPhi - = TProfile2D_LW::create("LVHVPowerConsumption_EtaPhi", "LV+HV Power Consumption EtaPhi; Module #eta Index;staveID;"+label_LVHVPC, - nbins_module,min_module,max_module,nbins_staveID,min_staveID,max_staveID)); - //m_hist_LVHVPowerConsumptionEtaPhi->SetContour(99); + + sc = dcsExpert.regHist(m_hist_LB_staveID_HVPowerConsumption = TProfile2D_LW::create( + "LB_staveID_HVPowerConsumption", "LB_staveID_HVPowerConsumption; LB;staveID;" + label_HVPC, + nbins_LB, min_LB, max_LB, nbins_staveID, min_staveID, max_staveID)); + sc = dcsExpert.regHist(m_hist_LVHVPowerConsumptionEtaPhi = TProfile2D_LW::create( + "LVHVPowerConsumption_EtaPhi", "LV+HV Power Consumption EtaPhi; Module #eta Index;staveID;" + label_LVHVPC, + nbins_module, min_module, max_module, nbins_staveID, min_staveID, max_staveID)); xaxis = m_hist_LVHVPowerConsumptionEtaPhi->GetXaxis(); - for(int jj = 0; jj < NUMMODULEETA; jj++){ - xaxis->SetBinLabel(jj+1, moduleEta[jj]); + for (int jj = 0; jj < NUMMODULEETA; jj++) { + xaxis->SetBinLabel(jj + 1, moduleEta[jj]); } - sc = dcsExpert.regHist(m_hist_LB_staveID_LVHVPowerConsumption - = TProfile2D_LW::create("LB_staveID_LVHVPowerConsumption", "LB_staveID_LVHVPowerConsumption; LB;staveID;"+label_LVHVPC, - nbins_LB,min_LB,max_LB,nbins_staveID,min_staveID,max_staveID)); - //m_hist_LB_staveID_LVHVPowerConsumption->SetContour(99); - // eff flex temp - sc = dcsExpert.regHist(m_hist_effFLEXtempEtaPhi - = TProfile2D_LW::create("effFLEXtemp_EtaPhi", "Effective FLEX Temperature EtaPhi; Module #eta Index;staveID;"+label_effFLEXtemp, - nbins_module,min_module,max_module,nbins_staveID,min_staveID,max_staveID)); - //m_hist_effFLEXtempEtaPhi->SetContour(99); + + sc = dcsExpert.regHist(m_hist_LB_staveID_LVHVPowerConsumption = TProfile2D_LW::create( + "LB_staveID_LVHVPowerConsumption", "LB_staveID_LVHVPowerConsumption; LB;staveID;" + label_LVHVPC, + nbins_LB, min_LB, max_LB, nbins_staveID, min_staveID, max_staveID)); + sc = dcsExpert.regHist(m_hist_effFLEXtempEtaPhi = TProfile2D_LW::create( + "effFLEXtemp_EtaPhi", "Effective FLEX Temperature EtaPhi; Module #eta Index;staveID;" + label_effFLEXtemp, + nbins_module, min_module, max_module, nbins_staveID, min_staveID, max_staveID)); xaxis = m_hist_effFLEXtempEtaPhi->GetXaxis(); - for(int jj = 0; jj < NUMMODULEETA; jj++){ - xaxis->SetBinLabel(jj+1, moduleEta[jj]); + for (int jj = 0; jj < NUMMODULEETA; jj++) { + xaxis->SetBinLabel(jj + 1, moduleEta[jj]); } - sc = dcsExpert.regHist(m_hist_LB_staveID_effFLEXtemp - = TProfile2D_LW::create("LB_staveID_effFLEXtemp", "LB_staveID_effFLEXtemp; LB;staveID;"+label_effFLEXtemp, - nbins_LB,min_LB,max_LB,nbins_staveID,min_staveID,max_staveID)); - //m_hist_LB_staveID_effFLEXtemp->SetContour(99); - // thermal figure of merit - sc = dcsExpert.regHist(m_hist_thermalFigureMeritEtaPhi - = TProfile2D_LW::create("thermalFigureMerit_EtaPhi", "Thermal Figure of Merit EtaPhi; Module #eta Index;staveID;"+label_tfm, - nbins_module,min_module,max_module,nbins_staveID,min_staveID,max_staveID)); - //m_hist_thermalFigureMeritEtaPhi->SetContour(99); + + sc = dcsExpert.regHist(m_hist_LB_staveID_effFLEXtemp = TProfile2D_LW::create( + "LB_staveID_effFLEXtemp", "LB_staveID_effFLEXtemp; LB;staveID;" + label_effFLEXtemp, + nbins_LB, min_LB, max_LB, nbins_staveID, min_staveID, max_staveID)); + sc = dcsExpert.regHist(m_hist_thermalFigureMeritEtaPhi = TProfile2D_LW::create( + "thermalFigureMerit_EtaPhi", "Thermal Figure of Merit EtaPhi; Module #eta Index;staveID;" + label_tfm, + nbins_module, min_module, max_module, nbins_staveID, min_staveID, max_staveID)); xaxis = m_hist_thermalFigureMeritEtaPhi->GetXaxis(); - for(int jj = 0; jj < NUMMODULEETA; jj++){ - xaxis->SetBinLabel(jj+1, moduleEta[jj]); + for (int jj = 0; jj < NUMMODULEETA; jj++) { + xaxis->SetBinLabel(jj + 1, moduleEta[jj]); } - sc = dcsExpert.regHist(m_hist_LB_staveID_thermalFigureMerit - = TProfile2D_LW::create("LB_staveID_thermalFigureMerit", "LB_staveID_thermalFigureMerit; LB;staveID;"+label_tfm, - nbins_LB,min_LB,max_LB,nbins_staveID,min_staveID,max_staveID)); - //m_hist_LB_staveID_thermalFigureMerit->SetContour(99); - if(sc.isFailure())if(msgLvl(MSG::WARNING)) msg(MSG::WARNING) << "histograms not booked" << endmsg; - return StatusCode::SUCCESS; + sc = dcsExpert.regHist(m_hist_LB_staveID_thermalFigureMerit = TProfile2D_LW::create( + "LB_staveID_thermalFigureMerit", "LB_staveID_thermalFigureMerit; LB;staveID;" + label_tfm, + nbins_LB, min_LB, max_LB, nbins_staveID, min_staveID, max_staveID)); + + if (sc.isFailure() && msgLvl(MSG::WARNING)) { + msg(MSG::WARNING) << "histograms not booked" << endmsg; + } + return StatusCode::SUCCESS; } -StatusCode PixelMainMon::FillPixelDCSMon(void) -{ +StatusCode PixelMainMon::fillPixelDCSMon(void) { // see only the first event of LB if (m_lumiBlockNum != m_currentLumiBlockNumber) { ATH_MSG_DEBUG("Current LB Number has been changed from " << m_currentLumiBlockNumber << " to " << m_lumiBlockNum); @@ -569,7 +505,7 @@ StatusCode PixelMainMon::FillPixelDCSMon(void) return StatusCode::SUCCESS; } - msg(MSG::DEBUG) << "[FillPixelDCSMon]" << endmsg; + msg(MSG::DEBUG) << "[FillPixelDCSMon]" << endmsg; // loop over DCS directories const CondAttrListCollection* atrlistcol; @@ -582,680 +518,602 @@ StatusCode PixelMainMon::FillPixelDCSMon(void) const CondAttrListCollection* atrlistcol_fsmstatus; // m_atrcollist is initialised in PixelMainMon.cxx, containing DCS folder names (e.g. /PIXEL/DCS/TEMPERATURE) - for (std::vector<std::string>::const_iterator itr=m_atrcollist.begin(); - itr!=m_atrcollist.end();++itr) { - ATH_MSG_DEBUG("execute(): Reading the data from " << *itr ); - //const CondAttrListCollection* atrlistcol; + for (std::vector<std::string>::const_iterator itr = m_atrcollist.begin(); itr != m_atrcollist.end(); ++itr) { + ATH_MSG_DEBUG("execute(): Reading the data from " << *itr); StatusCode sc = StatusCode::FAILURE; - if(*itr == "/PIXEL/DCS/TEMPERATURE") { - sc = detStore()->retrieve(atrlistcol_temperature,*itr); + if (*itr == "/PIXEL/DCS/TEMPERATURE") { + sc = detStore()->retrieve(atrlistcol_temperature, *itr); atrlistcol = atrlistcol_temperature; - } else if(*itr == "/PIXEL/DCS/HV") { - sc = detStore()->retrieve(atrlistcol_hv,*itr); + } else if (*itr == "/PIXEL/DCS/HV") { + sc = detStore()->retrieve(atrlistcol_hv, *itr); atrlistcol = atrlistcol_hv; - } else if(*itr == "/PIXEL/DCS/HVCURRENT") { - sc = detStore()->retrieve(atrlistcol_hvcurrent,*itr); + } else if (*itr == "/PIXEL/DCS/HVCURRENT") { + sc = detStore()->retrieve(atrlistcol_hvcurrent, *itr); atrlistcol = atrlistcol_hvcurrent; - } else if(*itr == "/PIXEL/DCS/PIPES") { - sc = detStore()->retrieve(atrlistcol_pipes,*itr); + } else if (*itr == "/PIXEL/DCS/PIPES") { + sc = detStore()->retrieve(atrlistcol_pipes, *itr); atrlistcol = atrlistcol_pipes; - } else if(*itr == "/PIXEL/DCS/LV") { - sc = detStore()->retrieve(atrlistcol_lv,*itr); + } else if (*itr == "/PIXEL/DCS/LV") { + sc = detStore()->retrieve(atrlistcol_lv, *itr); atrlistcol = atrlistcol_lv; - } else if(*itr == "/PIXEL/DCS/FSMSTATE") { - sc = detStore()->retrieve(atrlistcol_fsmstate,*itr); + } else if (*itr == "/PIXEL/DCS/FSMSTATE") { + sc = detStore()->retrieve(atrlistcol_fsmstate, *itr); atrlistcol = atrlistcol_fsmstate; - } else if(*itr == "/PIXEL/DCS/FSMSTATUS") { - sc = detStore()->retrieve(atrlistcol_fsmstatus,*itr); + } else if (*itr == "/PIXEL/DCS/FSMSTATUS") { + sc = detStore()->retrieve(atrlistcol_fsmstatus, *itr); atrlistcol = atrlistcol_fsmstatus; } - if(sc == StatusCode::SUCCESS) - //if (StatusCode::SUCCESS==detStore()->retrieve(atrlistcol,*itr)) - { - //int chanNum(0); // loop counter - // loop over collection - for (CondAttrListCollection::const_iterator citr=atrlistcol->begin(); - citr!=atrlistcol->end();++citr) { + if (sc == StatusCode::SUCCESS) { + for (CondAttrListCollection::const_iterator citr = atrlistcol->begin(); citr != atrlistcol->end(); ++citr) { // the following code dumps the attribute list into a string for printing // to access individual elements by name, use e.g. // float var1=(((*citr).second)["T04"]).data<float>(); // to get the value of a float column called T04 into var1 - float tmp_value = 0.; // tmp container of DCS value - int chanNum = 0; // tmp container of channel number - //int element_index = 0; // 0 or 1: sometimes there are two values in one folder (lv_voltage and lv_current in LV folder) - //for (auto& value : (*citr).second) { // one of 1 or 2 element + float tmp_value = 0.; + int chanNum = 0; try { - //tmp_value = value.data<float>(); auto& value = (*citr).second; chanNum = (*citr).first; - //ATH_MSG_DEBUG("FillPixelDCSMon(): folder " << *itr << ", chanNum " << chanNum << ", value " << tmp_value << ", detail " << value); - //std::cout << "FillPixelDCSMon(): folder " << *itr << ", chanNum " << chanNum << ", value " << tmp_value << ", detail " << value << std::endl; - if (*itr == "/PIXEL/DCS/TEMPERATURE"){ - if( m_moduleTemperature->m_values->find(chanNum) == m_moduleTemperature->m_values->end() ) { - m_moduleTemperature->m_values->insert( std::make_pair( chanNum, new std::map<int, float> )); + if (*itr == "/PIXEL/DCS/TEMPERATURE") { + if (m_moduleTemperature->m_values->find(chanNum) == m_moduleTemperature->m_values->end()) { + m_moduleTemperature->m_values->insert(std::make_pair(chanNum, new std::map<int, float>)); } - auto itr_moduleTemp = m_moduleTemperature->m_values->find( chanNum ); + auto itr_moduleTemp = m_moduleTemperature->m_values->find(chanNum); tmp_value = value["temperature"].data<float>(); - itr_moduleTemp->second->insert( std::make_pair( m_currentLumiBlockNumber, tmp_value)); + itr_moduleTemp->second->insert(std::make_pair(m_currentLumiBlockNumber, tmp_value)); } else if (*itr == "/PIXEL/DCS/PIPES") { - //if(element_index == 0) { // Inlet - if( m_coolingPipeTemperatureInlet->m_values->find(chanNum) == m_coolingPipeTemperatureInlet->m_values->end() ) { - m_coolingPipeTemperatureInlet->m_values->insert( std::make_pair( chanNum, new std::map<int, float> )); + if (m_coolingPipeTemperatureInlet->m_values->find(chanNum) == m_coolingPipeTemperatureInlet->m_values->end()) { + m_coolingPipeTemperatureInlet->m_values->insert(std::make_pair(chanNum, new std::map<int, float>)); } tmp_value = value["temp_inlet"].data<float>(); - auto itr_coolingPipeTempInlet = m_coolingPipeTemperatureInlet->m_values->find( chanNum ); - itr_coolingPipeTempInlet->second->insert( std::make_pair( m_currentLumiBlockNumber, tmp_value)); - //} else if (element_index == 1) { // Outlet - if( m_coolingPipeTemperatureOutlet->m_values->find(chanNum) == m_coolingPipeTemperatureOutlet->m_values->end() ) { - m_coolingPipeTemperatureOutlet->m_values->insert( std::make_pair( chanNum, new std::map<int, float> )); + auto itr_coolingPipeTempInlet = m_coolingPipeTemperatureInlet->m_values->find(chanNum); + itr_coolingPipeTempInlet->second->insert(std::make_pair(m_currentLumiBlockNumber, tmp_value)); + if (m_coolingPipeTemperatureOutlet->m_values->find(chanNum) == m_coolingPipeTemperatureOutlet->m_values->end()) { + m_coolingPipeTemperatureOutlet->m_values->insert(std::make_pair(chanNum, new std::map<int, float>)); } tmp_value = value["temp_outlet"].data<float>(); - auto itr_coolingPipeTempOutlet = m_coolingPipeTemperatureOutlet->m_values->find( chanNum ); - itr_coolingPipeTempOutlet->second->insert( std::make_pair( m_currentLumiBlockNumber, tmp_value)); - //} + auto itr_coolingPipeTempOutlet = m_coolingPipeTemperatureOutlet->m_values->find(chanNum); + itr_coolingPipeTempOutlet->second->insert(std::make_pair(m_currentLumiBlockNumber, tmp_value)); } else if (*itr == "/PIXEL/DCS/HV") { - if( m_HV->m_values->find(chanNum) == m_HV->m_values->end() ) { - m_HV->m_values->insert( std::make_pair( chanNum, new std::map<int, float> )); + if (m_HV->m_values->find(chanNum) == m_HV->m_values->end()) { + m_HV->m_values->insert(std::make_pair(chanNum, new std::map<int, float>)); } tmp_value = value["HV"].data<float>(); - auto itr_HV = m_HV->m_values->find( chanNum ); - itr_HV->second->insert( std::make_pair( m_currentLumiBlockNumber, tmp_value)); + auto itr_HV = m_HV->m_values->find(chanNum); + itr_HV->second->insert(std::make_pair(m_currentLumiBlockNumber, tmp_value)); } else if (*itr == "/PIXEL/DCS/HVCURRENT") { - if( m_HV_current->m_values->find(chanNum) == m_HV_current->m_values->end() ) { - m_HV_current->m_values->insert( std::make_pair( chanNum, new std::map<int, float> )); + if (m_HV_current->m_values->find(chanNum) == m_HV_current->m_values->end()) { + m_HV_current->m_values->insert(std::make_pair(chanNum, new std::map<int, float>)); } tmp_value = value["hv_current"].data<float>(); - auto itr_HV_current = m_HV_current->m_values->find( chanNum ); - itr_HV_current->second->insert( std::make_pair( m_currentLumiBlockNumber, tmp_value)); + auto itr_HV_current = m_HV_current->m_values->find(chanNum); + itr_HV_current->second->insert(std::make_pair(m_currentLumiBlockNumber, tmp_value)); } else if (*itr == "/PIXEL/DCS/LV") { - // LV voltage - if( m_LV_voltage->m_values->find(chanNum) == m_LV_voltage->m_values->end() ) { - m_LV_voltage->m_values->insert( std::make_pair( chanNum, new std::map<int, float> )); + if (m_LV_voltage->m_values->find(chanNum) == m_LV_voltage->m_values->end()) { + m_LV_voltage->m_values->insert(std::make_pair(chanNum, new std::map<int, float>)); } tmp_value = value["lv_voltage"].data<float>(); - auto itr_LV_voltage = m_LV_voltage->m_values->find( chanNum ); - itr_LV_voltage->second->insert( std::make_pair( m_currentLumiBlockNumber, tmp_value)); - // LV current - if( m_LV_current->m_values->find(chanNum) == m_LV_current->m_values->end() ) { - m_LV_current->m_values->insert( std::make_pair( chanNum, new std::map<int, float> )); + auto itr_LV_voltage = m_LV_voltage->m_values->find(chanNum); + itr_LV_voltage->second->insert(std::make_pair(m_currentLumiBlockNumber, tmp_value)); + if (m_LV_current->m_values->find(chanNum) == m_LV_current->m_values->end()) { + m_LV_current->m_values->insert(std::make_pair(chanNum, new std::map<int, float>)); } tmp_value = value["lv_current"].data<float>(); - auto itr_LV_current = m_LV_current->m_values->find( chanNum ); - itr_LV_current->second->insert( std::make_pair( m_currentLumiBlockNumber, tmp_value)); + auto itr_LV_current = m_LV_current->m_values->find(chanNum); + itr_LV_current->second->insert(std::make_pair(m_currentLumiBlockNumber, tmp_value)); } else if (*itr == "/PIXEL/DCS/FSMSTATE") { - if( m_FSM_state->m_values->find(chanNum) == m_FSM_state->m_values->end() ) { - m_FSM_state->m_values->insert( std::make_pair( chanNum, new std::map<int, float> )); + if (m_FSM_state->m_values->find(chanNum) == m_FSM_state->m_values->end()) { + m_FSM_state->m_values->insert(std::make_pair(chanNum, new std::map<int, float>)); } try { - tmp_value = m_fsmState2enum.at( value["FSM_state"].data<std::string>() ); + tmp_value = m_fsmState2enum.at(value["FSM_state"].data<std::string>()); } catch (...) { - tmp_value = 10; // Unknown key - ATH_MSG_WARNING( "FSM State: " << value["FSM_state"].data<std::string>() ); + tmp_value = 10; // Unknown key + ATH_MSG_WARNING("FSM State: " << value["FSM_state"].data<std::string>()); } - auto itr_FSM_state = m_FSM_state->m_values->find( chanNum ); - itr_FSM_state->second->insert( std::make_pair( m_currentLumiBlockNumber, tmp_value)); + auto itr_FSM_state = m_FSM_state->m_values->find(chanNum); + itr_FSM_state->second->insert(std::make_pair(m_currentLumiBlockNumber, tmp_value)); } else if (*itr == "/PIXEL/DCS/FSMSTATUS") { - if( m_FSM_status->m_values->find(chanNum) == m_FSM_status->m_values->end() ) { - m_FSM_status->m_values->insert( std::make_pair( chanNum, new std::map<int, float> )); + if (m_FSM_status->m_values->find(chanNum) == m_FSM_status->m_values->end()) { + m_FSM_status->m_values->insert(std::make_pair(chanNum, new std::map<int, float>)); } try { - tmp_value = m_fsmStatus2enum.at( value["FSM_status"].data<std::string>() ); + tmp_value = m_fsmStatus2enum.at(value["FSM_status"].data<std::string>()); } catch (...) { - tmp_value = 10; // Unknown key - ATH_MSG_WARNING( "FSM Status: " << value["FSM_status"].data<std::string>() ); + tmp_value = 10; // Unknown key + ATH_MSG_WARNING("FSM Status: " << value["FSM_status"].data<std::string>()); } - auto itr_FSM_status = m_FSM_status->m_values->find( chanNum ); - itr_FSM_status->second->insert( std::make_pair( m_currentLumiBlockNumber, tmp_value)); + auto itr_FSM_status = m_FSM_status->m_values->find(chanNum); + itr_FSM_status->second->insert(std::make_pair(m_currentLumiBlockNumber, tmp_value)); } - //element_index++; - - //m_moduleTemperature->m_values->at( chanNum )->insert( std::make_pair(m_currentLumiBlockNumber,tmp_value)); - //if( m_elementsMap[*itr][element_index] == "temperature") m_moduleTemperature2D->Fill(chanNum, var); - } - catch (...) - { + } catch (...) { ATH_MSG_WARNING("Channel " << chanNum << " does not have any values!"); continue; } - //} // end for loop over channels - //chanNum++; - } // end for loop over + } // end for loop over } else { ATH_MSG_WARNING("Could not retrieve CondAttrListCollection " << *itr); } } - return StatusCode::SUCCESS; + return StatusCode::SUCCESS; } -StatusCode PixelMainMon::ProcPixelDCSMon(void) -{ - msg(MSG::DEBUG) << "[ProcPixelDCSMon]" << endmsg; - - //--------------------------------------- - // fill dcs data in moduleDcsDataHolder - //-------------------------------------- - int LB = 0; - float value = 0; - for(const auto& nameMap : *(m_moduleDCSDataHolder->m_moduleMap) ){ - if (nameMap.first == "") { - ATH_MSG_WARNING("ProcPixelDCSMon(): Channel " << nameMap.second << " does not have module name"); - continue; - } - std::string moduleName = nameMap.first; - int moduleNum = nameMap.second; - if (moduleName.find("LI_") == std::string::npos || - moduleName.find("LI_S15") != std::string::npos) continue; // if not IBL - int staveNum = PixelMainMon::getIBLstaveIdFromModuleName(moduleName); - //int module_eta = PixelMainMon::getIBLetaIndexFromModuleName(moduleName); - int moduleGroup = PixelMainMon::getIBLmoduleGroupFromModuleName(moduleName); - // module temperature/HV/FSMSTATE/STATUS - if( m_moduleDCSDataHolder->m_tempModule->find(moduleNum) == m_moduleDCSDataHolder->m_tempModule->end() ) { - m_moduleDCSDataHolder->m_tempModule->insert( std::make_pair( moduleNum, new std::map<int, float> )); - } - if( m_moduleDCSDataHolder->m_hv_voltage->find(moduleNum) == m_moduleDCSDataHolder->m_hv_voltage->end() ) { - m_moduleDCSDataHolder->m_hv_voltage->insert( std::make_pair( moduleNum, new std::map<int, float> )); - } - if( m_moduleDCSDataHolder->m_fsm_state->find(moduleNum) == m_moduleDCSDataHolder->m_fsm_state->end() ) { - m_moduleDCSDataHolder->m_fsm_state->insert( std::make_pair( moduleNum, new std::map<int, float> )); - } - if( m_moduleDCSDataHolder->m_fsm_status->find(moduleNum) == m_moduleDCSDataHolder->m_fsm_status->end() ) { - m_moduleDCSDataHolder->m_fsm_status->insert( std::make_pair( moduleNum, new std::map<int, float> )); - } - // module temp - if( m_moduleTemperature->m_values->find( moduleNum ) != m_moduleTemperature->m_values->end() ) { - for(const auto& valueMap : *( m_moduleTemperature->m_values->at( moduleNum ) ) ){ - try { - LB = valueMap.first; - value = valueMap.second; - auto itr_tempModule = m_moduleDCSDataHolder->m_tempModule->find( moduleNum ); - itr_tempModule->second->insert( std::make_pair( LB, value )); - } catch (const std::out_of_range& oor) { - ATH_MSG_DEBUG("Out of Range error: " << oor.what() << " , m_moduleTemperature: chanNum = " << moduleNum); - continue; - } - } // end module temp - } - // HV - if( m_HV->m_values->find( moduleNum ) != m_HV->m_values->end() ) { - for(const auto& valueMap : *( m_HV->m_values->at( moduleNum ) ) ){ - try { - LB = valueMap.first; - value = valueMap.second; - auto itr_hv_voltage = m_moduleDCSDataHolder->m_hv_voltage->find( moduleNum ); - itr_hv_voltage->second->insert( std::make_pair( LB, value )); - } catch (const std::out_of_range& oor) { - ATH_MSG_DEBUG("Out of Range error: " << oor.what() << " , m_HV: chanNum = " << moduleNum); - continue; - } - } // end HV - } - // FSM State - if( m_FSM_state->m_values->find( moduleNum ) != m_FSM_state->m_values->end() ) { - for(const auto& valueMap : *( m_FSM_state->m_values->at( moduleNum ) ) ){ - try { - LB = valueMap.first; - value = valueMap.second; - auto itr_fsm_state = m_moduleDCSDataHolder->m_fsm_state->find( moduleNum ); - itr_fsm_state->second->insert( std::make_pair( LB, value )); - } catch (const std::out_of_range& oor) { - ATH_MSG_DEBUG("Out of Range error: " << oor.what() << " , m_FSM_state: chanNum = " << moduleNum); - continue; - } - } // end FSM State - } - // FSM Status - if( m_FSM_status->m_values->find( moduleNum ) != m_FSM_status->m_values->end() ) { - for(const auto& valueMap : *( m_FSM_status->m_values->at( moduleNum ) ) ){ - try { - LB = valueMap.first; - value = valueMap.second; - auto itr_fsm_status = m_moduleDCSDataHolder->m_fsm_status->find( moduleNum ); - itr_fsm_status->second->insert( std::make_pair( LB, value )); - } catch (const std::out_of_range& oor) { - ATH_MSG_DEBUG("Out of Range error: " << oor.what() << " , m_FSM_status: chanNum = " << moduleNum); - continue; - } - } // end FSM Status - } - // cooling Pipe Inlet/Outlet - if( m_moduleDCSDataHolder->m_tempInlet->find(moduleNum) == m_moduleDCSDataHolder->m_tempInlet->end() ) { - m_moduleDCSDataHolder->m_tempInlet->insert( std::make_pair( moduleNum, new std::map<int, float> )); - } - if( m_moduleDCSDataHolder->m_tempOutlet->find(moduleNum) == m_moduleDCSDataHolder->m_tempOutlet->end() ) { - m_moduleDCSDataHolder->m_tempOutlet->insert( std::make_pair( moduleNum, new std::map<int, float> )); - } - for(const auto& pipeNameMap : *(m_coolingPipeTemperatureInlet->m_maps) ){ - std::string pipeName = pipeNameMap.first; - int chanNum = pipeNameMap.second; - if (staveNum != PixelMainMon::getIBLstaveIdFromModuleName(pipeName)) continue; - // Inlet - if( m_coolingPipeTemperatureInlet->m_values->find( chanNum ) != m_coolingPipeTemperatureInlet->m_values->end() ) { - for(const auto& valueMap : *( m_coolingPipeTemperatureInlet->m_values->at( chanNum ) ) ){ - try { - LB = valueMap.first; - value = valueMap.second; - auto itr_tempInlet = m_moduleDCSDataHolder->m_tempInlet->find( moduleNum ); - itr_tempInlet->second->insert( std::make_pair( LB, value )); - } catch (const std::out_of_range& oor) { - ATH_MSG_DEBUG("Out of Range error: " << oor.what() << " , m_coolingPipeTemperatureInlet: chanNum = " << chanNum); - continue; - } - } - } - // Outlet - if( m_coolingPipeTemperatureOutlet->m_values->find( chanNum ) != m_coolingPipeTemperatureOutlet->m_values->end() ) { - for(const auto& valueMap : *( m_coolingPipeTemperatureOutlet->m_values->at( chanNum ) ) ){ - try { - LB = valueMap.first; - value = valueMap.second; - auto itr_tempOutlet = m_moduleDCSDataHolder->m_tempOutlet->find( moduleNum ); - itr_tempOutlet->second->insert( std::make_pair( LB, value )); - } catch (const std::out_of_range& oor) { - ATH_MSG_DEBUG("Out of Range error: " << oor.what() << " , m_coolingPipeTemperatureOutlet: chanNum = " << chanNum); - continue; - } - } - } - } // end pipe - // LV/LVCURRENT/HVCURRENT - if( m_moduleDCSDataHolder->m_lv_voltage->find(moduleNum) == m_moduleDCSDataHolder->m_lv_voltage->end() ) { - m_moduleDCSDataHolder->m_lv_voltage->insert( std::make_pair( moduleNum, new std::map<int, float> )); - } - if( m_moduleDCSDataHolder->m_lv_current->find(moduleNum) == m_moduleDCSDataHolder->m_lv_current->end() ) { - m_moduleDCSDataHolder->m_lv_current->insert( std::make_pair( moduleNum, new std::map<int, float> )); - } - if( m_moduleDCSDataHolder->m_hv_current->find(moduleNum) == m_moduleDCSDataHolder->m_hv_current->end() ) { - m_moduleDCSDataHolder->m_hv_current->insert( std::make_pair( moduleNum, new std::map<int, float> )); - } - for(const auto& lvNameMap : *(m_LV_voltage->m_maps) ){ - std::string lvName = lvNameMap.first; - int chanNum = lvNameMap.second; - if (staveNum != PixelMainMon::getIBLstaveIdFromModuleName(lvName) || moduleGroup != PixelMainMon::getIBLmoduleGroupFromModuleName(lvName) ) continue; - // lv voltage - if( m_LV_voltage->m_values->find( chanNum ) != m_LV_voltage->m_values->end() ) { - for(const auto& valueMap : *( m_LV_voltage->m_values->at( chanNum ) ) ){ - try { - LB = valueMap.first; - value = valueMap.second; - auto itr_lv_voltage = m_moduleDCSDataHolder->m_lv_voltage->find( moduleNum ); - itr_lv_voltage->second->insert( std::make_pair( LB, value )); - } catch (const std::out_of_range& oor) { - ATH_MSG_DEBUG("Out of Range error: " << oor.what() << " , m_LV_voltage: chanNum = " << chanNum); - continue; - } - } - } - // lv current - if( m_LV_current->m_values->find( chanNum ) != m_LV_current->m_values->end() ) { - for(const auto& valueMap : *( m_LV_current->m_values->at( chanNum ) ) ){ - try { - LB = valueMap.first; - value = valueMap.second; - auto itr_lv_current = m_moduleDCSDataHolder->m_lv_current->find( moduleNum ); - itr_lv_current->second->insert( std::make_pair( LB, value )); - } catch (const std::out_of_range& oor) { - ATH_MSG_DEBUG("Out of Range error: " << oor.what() << " , m_LV_current: chanNum = " << chanNum); - continue; - } - } - } - // hv current - if( m_HV_current->m_values->find( chanNum ) != m_HV_current->m_values->end() ) { - for(const auto& valueMap : *( m_HV_current->m_values->at( chanNum ) ) ){ - try { - LB = valueMap.first; - value = valueMap.second; - auto itr_hv_current = m_moduleDCSDataHolder->m_hv_current->find( moduleNum ); - itr_hv_current->second->insert( std::make_pair( LB, value )); - } catch (const std::out_of_range& oor) { - ATH_MSG_DEBUG("Out of Range error: " << oor.what() << " , m_HV_current: chanNum = " << chanNum); - continue; - } - } - } - } // end lv/hv - // TODO: Plant - } // end fill moduleDcsDataHolder - //---------------------------- - // loop over modules - //--------------------------- - for(const auto& nameMap : *(m_moduleDCSDataHolder->m_moduleMap) ){ - // nameMap.first is module name. nameMap.second is channel number. - if (nameMap.first == "") { - ATH_MSG_WARNING("ProcPixelDCSMon(): Channel " << nameMap.second << " does not have module name"); - continue; - } - std::string moduleName = nameMap.first; - int moduleNum = nameMap.second; - if (moduleName.find("LI_") == std::string::npos || - moduleName.find("LI_S15") != std::string::npos) continue; // if not IBL - int staveNum = PixelMainMon::getIBLstaveIdFromModuleName(moduleName); - int module_eta = PixelMainMon::getIBLetaIndexFromModuleName(moduleName); - int moduleGroup = PixelMainMon::getIBLmoduleGroupFromModuleName(moduleName); - try{ // at is dangerous... - // module temperature - for(const auto& valueMap : *( m_moduleDCSDataHolder->m_tempModule->at( moduleNum ) ) ) { - int LB = valueMap.first; - float tempModule = valueMap.second; - float tempInlet = m_moduleDCSDataHolder->m_tempInlet->at(moduleNum)->at(LB); - float tempOutlet = m_moduleDCSDataHolder->m_tempOutlet->at(moduleNum)->at(LB); - // calibration of the NTCs - // T_corrected = T_meas - DeltaT - // DeltaT = 4x10^{-8} T^4 - 2x10^{-6} T^3 + 5x10^4 T^{-2} - 0.0487xT + 1.1974 - // https://indico.cern.ch/event/380923/session/4/contribution/21/attachments/758833/1040909/IBL_TF_PixelWeek.pdf - //tempInlet = tempInlet - (4e-8 * TMath::Power(tempInlet,4) - 2e-6 * TMath::Power(tempInlet,3) - // + 5e-4 * TMath::Power(tempInlet,2) - 0.0487 * tempInlet + 1.1974); - //tempOutlet = tempOutlet - (4e-8 * TMath::Power(tempOutlet,4) - 2e-6 * TMath::Power(tempOutlet,3) - // + 5e-4 * TMath::Power(tempOutlet,2) - 0.0487 * tempOutlet + 1.1974); - float hv_voltage = TMath::Abs( m_moduleDCSDataHolder->m_hv_voltage->at(moduleNum)->at(LB) ); - float lv_voltage = m_moduleDCSDataHolder->m_lv_voltage->at(moduleNum)->at(LB); - float hv_current = TMath::Abs( m_moduleDCSDataHolder->m_hv_current->at(moduleNum)->at(LB) ); - float lv_current = m_moduleDCSDataHolder->m_lv_current->at(moduleNum)->at(LB); - float fsm_state = m_moduleDCSDataHolder->m_fsm_state->at(moduleNum)->at(LB); - if (fsm_state > m_fsmState2enum.size() ) { // if fsm_state is not initialised properly... - fsm_state = m_fsmState2enum["READY"]; - } - float fsm_status = m_moduleDCSDataHolder->m_fsm_status->at(moduleNum)->at(LB); - if (fsm_status > m_fsmState2enum.size() ) { // if fsm_status is not initialised properly... - fsm_status = m_fsmStatus2enum["OK"]; - } - // fill module temp - m_hist_moduleTemperatureEtaPhi->Fill(module_eta, staveNum, tempModule); - m_hist_moduleTemperature2Dscatter[staveNum - 1]->Fill(module_eta, tempModule); - m_hist_moduleTemperatureLB[staveNum - 1]->Fill(LB, tempModule); - m_hist_LB_staveID_moduleTemperature->Fill(LB, staveNum, tempModule); - m_hist_LB_moduleGroup_moduleTemperature[staveNum - 1]->Fill(LB, moduleGroup, tempModule); - float dT = tempModule - tempOutlet; - m_hist_dTEtaPhi->Fill(module_eta, staveNum, dT); - m_hist_LB_staveID_dT->Fill(LB, staveNum, dT ); - m_hist_LB_moduleGroup_dT[staveNum - 1]->Fill(LB, moduleGroup, dT ); - // fill inlet temp - m_hist_Pipes_inlet2Dscatter->Fill(staveNum, tempInlet); - m_hist_Pipes_inletLB[staveNum - 1]->Fill(LB,tempInlet); - m_hist_LB_staveID_coolingPipeInlet->Fill(LB,staveNum,tempInlet); - // fill outlet temp - m_hist_Pipes_outlet2Dscatter->Fill(staveNum, tempOutlet); - m_hist_Pipes_outletLB[staveNum - 1]->Fill(LB,tempOutlet); - m_hist_LB_staveID_coolingPipeOutlet->Fill(LB,staveNum,tempOutlet); - // fill hv voltage - m_hist_HVoltageEtaPhi->Fill(module_eta, staveNum, hv_voltage); - m_hist_HVoltage2Dscatter[staveNum - 1]->Fill(module_eta, hv_voltage); - m_hist_HVoltageLB[staveNum - 1]->Fill(LB,hv_voltage); - m_hist_LB_staveID_HVoltage->Fill(LB, staveNum, hv_voltage); - m_hist_LB_moduleGroup_HVoltage[staveNum - 1]->Fill(LB, moduleGroup, hv_voltage); - // fill hv current - m_hist_HVcurrentEtaPhi->Fill(module_eta, staveNum, hv_current); - m_hist_HVcurrent2Dscatter[staveNum - 1]->Fill(module_eta, hv_current); - m_hist_HVcurrentLB[staveNum - 1]->Fill(LB,hv_current); - m_hist_LB_moduleGroup_HVcurrent[staveNum - 1]->Fill(LB, moduleGroup, hv_current); - m_hist_LB_staveID_HVcurrent->Fill(LB,staveNum,hv_current); - // fill lv voltage - m_hist_LVoltageEtaPhi->Fill(module_eta, staveNum, lv_voltage); - m_hist_LVoltage2Dscatter[staveNum - 1]->Fill(module_eta, lv_voltage); - m_hist_LVoltageLB[staveNum - 1]->Fill(LB,lv_voltage); - m_hist_LB_staveID_LVoltage->Fill(LB,staveNum,lv_voltage); - m_hist_LB_moduleGroup_LVoltage[staveNum - 1]->Fill(LB, moduleGroup, lv_voltage); - // fill lv current - m_hist_LVcurrentEtaPhi->Fill(module_eta, staveNum, lv_current); - m_hist_LVcurrent2Dscatter[staveNum - 1]->Fill(module_eta, lv_current); - m_hist_LVcurrentLB[staveNum - 1]->Fill(LB,lv_current); - m_hist_LB_moduleGroup_LVcurrent[staveNum - 1]->Fill(LB, moduleGroup, lv_current); - m_hist_LB_staveID_LVcurrent->Fill(LB,staveNum,lv_current); - // fill FSM state - //m_hist_FSMstateEtaPhi->Fill(module_eta, staveNum, fsm_state); - if(fsm_state > m_hist_FSMstateEtaPhi->GetBinContent(module_eta + 11, staveNum) ){ // -10 <= module_eta <= 9, - m_hist_FSMstateEtaPhi->SetBinContent(module_eta + 11, staveNum, fsm_state); // 1 <= staveNum <= 14 - } - m_hist_FSMstate2Dscatter[staveNum - 1]->Fill(module_eta, fsm_state); - m_hist_FSMstateLB[staveNum - 1]->Fill(LB,fsm_state); - if(fsm_state > m_hist_LB_staveID_FSMstate->GetBinContent(LB + 1, staveNum) ){ - m_hist_LB_staveID_FSMstate->SetBinContent(LB + 1, staveNum, fsm_state); - } - //m_hist_LB_staveID_FSMstate->Fill(LB, staveNum, fsm_state); - if(fsm_state > m_hist_LB_moduleGroup_FSMstate[staveNum - 1]->GetBinContent(LB + 1, moduleGroup + 1) ){ - m_hist_LB_moduleGroup_FSMstate[staveNum - 1]->SetBinContent(LB + 1, moduleGroup + 1, fsm_state); - //m_hist_LB_moduleGroup_FSMstate[staveNum - 1]->Fill(LB, moduleGroup, fsm_state); - } - //m_hist_LB_moduleGroup_FSMstate[staveNum - 1]->Fill(LB, moduleGroup, fsm_state); - // fill FSM status - //m_hist_FSMstatusEtaPhi->Fill(module_eta, staveNum, fsm_status); - if(fsm_status > m_hist_FSMstatusEtaPhi->GetBinContent(module_eta + 11, staveNum) ){ // -10 <= module_eta <= 9, - m_hist_FSMstatusEtaPhi->SetBinContent(module_eta + 11, staveNum, fsm_status); // 1 <= staveNum <= 14 - } - m_hist_FSMstatus2Dscatter[staveNum - 1]->Fill(module_eta, fsm_status); - m_hist_FSMstatusLB[staveNum - 1]->Fill(LB,fsm_status); - if(fsm_status > m_hist_LB_staveID_FSMstatus->GetBinContent(LB + 1, staveNum) ){ - m_hist_LB_staveID_FSMstatus->SetBinContent(LB + 1, staveNum, fsm_status); - } - //m_hist_LB_staveID_FSMstatus->Fill(LB, staveNum, fsm_status); - if(fsm_status > m_hist_LB_moduleGroup_FSMstatus[staveNum - 1]->GetBinContent(LB + 1, moduleGroup + 1) ){ - m_hist_LB_moduleGroup_FSMstatus[staveNum - 1]->SetBinContent(LB + 1, moduleGroup + 1, fsm_status); - //m_hist_LB_moduleGroup_FSMstatus[staveNum - 1]->Fill(LB, moduleGroup, fsm_status); - } - m_hist_LB_moduleGroup_FSMstatus[staveNum - 1]->Fill(LB, moduleGroup, fsm_status); - // fill HV Power consumption - float hvpc = TMath::Abs(hv_voltage * hv_current); - m_hist_HVPowerConsumptionEtaPhi->Fill(module_eta, staveNum, hvpc); - m_hist_LB_staveID_HVPowerConsumption->Fill(LB,staveNum,hvpc); - m_hist_LB_moduleGroup_HVPowerConsumption[staveNum - 1]->Fill(LB, moduleGroup, hvpc); - // fill LV Power consumption - float lvpc = TMath::Abs(lv_voltage * lv_current); - m_hist_LVPowerConsumptionEtaPhi->Fill(module_eta, staveNum, lvpc); - m_hist_LB_staveID_LVPowerConsumption->Fill(LB,staveNum,lvpc); - m_hist_LB_moduleGroup_LVPowerConsumption[staveNum - 1]->Fill(LB, moduleGroup, lvpc); - // fill HV+LV Power consumption - m_hist_LVHVPowerConsumptionEtaPhi->Fill(module_eta, staveNum, lvpc + hvpc * 0.001); - m_hist_LB_staveID_LVHVPowerConsumption->Fill(LB,staveNum,lvpc + hvpc * 0.001); - m_hist_LB_moduleGroup_LVHVPowerConsumption[staveNum - 1]->Fill(LB, moduleGroup, lvpc + hvpc * 0.001); - // fill effective FLEX temperature - float tempFlex = dT * 0.6 + tempOutlet; // 0.6 is measured value - m_hist_effFLEXtempEtaPhi->Fill(module_eta, staveNum, tempFlex); - m_hist_LB_staveID_effFLEXtemp->Fill(LB,staveNum,tempFlex); - m_hist_LB_moduleGroup_effFLEXtemp[staveNum - 1]->Fill(LB, moduleGroup, tempFlex); - // fill thermal figure of merit - if (lvpc + hvpc * 0.001 != 0) { - float tfm = dT/(lvpc + hvpc * 0.001); - m_hist_thermalFigureMeritEtaPhi->Fill(module_eta, staveNum, tfm); - m_hist_LB_staveID_thermalFigureMerit->Fill(LB,staveNum,tfm); - m_hist_LB_moduleGroup_thermalFigureMerit[staveNum - 1]->Fill(LB, moduleGroup, tfm); - } - } - } catch (const std::out_of_range& oor) { - //std::cerr << "Out of Range error: " << oor.what() << " , m_moduleTemperature: chanNum = " << chanNum << '\n'; - ATH_MSG_DEBUG("moduleNum " << moduleNum << ", Out of Range error: " << oor.what() ); - continue; - } - } // end loop over modules +StatusCode PixelMainMon::procPixelDCSMon(void) { + msg(MSG::DEBUG) << "[ProcPixelDCSMon]" << endmsg; + + //--------------------------------------- + // fill dcs data in moduleDcsDataHolder + //-------------------------------------- + int LB = 0; + float value = 0; + for (const auto& nameMap : *(m_moduleDCSDataHolder->m_moduleMap)) { + if (nameMap.first == "") { + ATH_MSG_WARNING("ProcPixelDCSMon(): Channel " << nameMap.second << " does not have module name"); + continue; + } + std::string moduleName = nameMap.first; + int moduleNum = nameMap.second; + if (moduleName.find("LI_") == std::string::npos || + moduleName.find("LI_S15") != std::string::npos) continue; // if not IBL + int staveNum = PixelMainMon::getIBLstaveIdFromModuleName(moduleName); + int moduleGroup = PixelMainMon::getIBLmoduleGroupFromModuleName(moduleName); + if (m_moduleDCSDataHolder->m_tempModule->find(moduleNum) == m_moduleDCSDataHolder->m_tempModule->end()) { + m_moduleDCSDataHolder->m_tempModule->insert(std::make_pair(moduleNum, new std::map<int, float>)); + } + if (m_moduleDCSDataHolder->m_hv_voltage->find(moduleNum) == m_moduleDCSDataHolder->m_hv_voltage->end()) { + m_moduleDCSDataHolder->m_hv_voltage->insert(std::make_pair(moduleNum, new std::map<int, float>)); + } + if (m_moduleDCSDataHolder->m_fsm_state->find(moduleNum) == m_moduleDCSDataHolder->m_fsm_state->end()) { + m_moduleDCSDataHolder->m_fsm_state->insert(std::make_pair(moduleNum, new std::map<int, float>)); + } + if (m_moduleDCSDataHolder->m_fsm_status->find(moduleNum) == m_moduleDCSDataHolder->m_fsm_status->end()) { + m_moduleDCSDataHolder->m_fsm_status->insert(std::make_pair(moduleNum, new std::map<int, float>)); + } + + if (m_moduleTemperature->m_values->find(moduleNum) != m_moduleTemperature->m_values->end()) { + for (const auto& valueMap : *(m_moduleTemperature->m_values->at(moduleNum))) { + try { + LB = valueMap.first; + value = valueMap.second; + auto itr_tempModule = m_moduleDCSDataHolder->m_tempModule->find(moduleNum); + itr_tempModule->second->insert(std::make_pair(LB, value)); + } catch (const std::out_of_range& oor) { + ATH_MSG_DEBUG("Out of Range error: " << oor.what() << " , m_moduleTemperature: chanNum = " << moduleNum); + continue; + } + } + } + + if (m_HV->m_values->find(moduleNum) != m_HV->m_values->end()) { + for (const auto& valueMap : *(m_HV->m_values->at(moduleNum))) { + try { + LB = valueMap.first; + value = valueMap.second; + auto itr_hv_voltage = m_moduleDCSDataHolder->m_hv_voltage->find(moduleNum); + itr_hv_voltage->second->insert(std::make_pair(LB, value)); + } catch (const std::out_of_range& oor) { + ATH_MSG_DEBUG("Out of Range error: " << oor.what() << " , m_HV: chanNum = " << moduleNum); + continue; + } + } + } + + if (m_FSM_state->m_values->find(moduleNum) != m_FSM_state->m_values->end()) { + for (const auto& valueMap : *(m_FSM_state->m_values->at(moduleNum))) { + try { + LB = valueMap.first; + value = valueMap.second; + auto itr_fsm_state = m_moduleDCSDataHolder->m_fsm_state->find(moduleNum); + itr_fsm_state->second->insert(std::make_pair(LB, value)); + } catch (const std::out_of_range& oor) { + ATH_MSG_DEBUG("Out of Range error: " << oor.what() << " , m_FSM_state: chanNum = " << moduleNum); + continue; + } + } + } + + if (m_FSM_status->m_values->find(moduleNum) != m_FSM_status->m_values->end()) { + for (const auto& valueMap : *(m_FSM_status->m_values->at(moduleNum))) { + try { + LB = valueMap.first; + value = valueMap.second; + auto itr_fsm_status = m_moduleDCSDataHolder->m_fsm_status->find(moduleNum); + itr_fsm_status->second->insert(std::make_pair(LB, value)); + } catch (const std::out_of_range& oor) { + ATH_MSG_DEBUG("Out of Range error: " << oor.what() << " , m_FSM_status: chanNum = " << moduleNum); + continue; + } + } + } + + if (m_moduleDCSDataHolder->m_tempInlet->find(moduleNum) == m_moduleDCSDataHolder->m_tempInlet->end()) { + m_moduleDCSDataHolder->m_tempInlet->insert(std::make_pair(moduleNum, new std::map<int, float>)); + } + if (m_moduleDCSDataHolder->m_tempOutlet->find(moduleNum) == m_moduleDCSDataHolder->m_tempOutlet->end()) { + m_moduleDCSDataHolder->m_tempOutlet->insert(std::make_pair(moduleNum, new std::map<int, float>)); + } + for (const auto& pipeNameMap : *(m_coolingPipeTemperatureInlet->m_maps)) { + std::string pipeName = pipeNameMap.first; + int chanNum = pipeNameMap.second; + if (staveNum != PixelMainMon::getIBLstaveIdFromModuleName(pipeName)) continue; + if (m_coolingPipeTemperatureInlet->m_values->find(chanNum) != m_coolingPipeTemperatureInlet->m_values->end()) { + for (const auto& valueMap : *(m_coolingPipeTemperatureInlet->m_values->at(chanNum))) { + try { + LB = valueMap.first; + value = valueMap.second; + auto itr_tempInlet = m_moduleDCSDataHolder->m_tempInlet->find(moduleNum); + itr_tempInlet->second->insert(std::make_pair(LB, value)); + } catch (const std::out_of_range& oor) { + ATH_MSG_DEBUG("Out of Range error: " << oor.what() << " , m_coolingPipeTemperatureInlet: chanNum = " << chanNum); + continue; + } + } + } + if (m_coolingPipeTemperatureOutlet->m_values->find(chanNum) != m_coolingPipeTemperatureOutlet->m_values->end()) { + for (const auto& valueMap : *(m_coolingPipeTemperatureOutlet->m_values->at(chanNum))) { + try { + LB = valueMap.first; + value = valueMap.second; + auto itr_tempOutlet = m_moduleDCSDataHolder->m_tempOutlet->find(moduleNum); + itr_tempOutlet->second->insert(std::make_pair(LB, value)); + } catch (const std::out_of_range& oor) { + ATH_MSG_DEBUG("Out of Range error: " << oor.what() << " , m_coolingPipeTemperatureOutlet: chanNum = " << chanNum); + continue; + } + } + } + } + + if (m_moduleDCSDataHolder->m_lv_voltage->find(moduleNum) == m_moduleDCSDataHolder->m_lv_voltage->end()) { + m_moduleDCSDataHolder->m_lv_voltage->insert(std::make_pair(moduleNum, new std::map<int, float>)); + } + if (m_moduleDCSDataHolder->m_lv_current->find(moduleNum) == m_moduleDCSDataHolder->m_lv_current->end()) { + m_moduleDCSDataHolder->m_lv_current->insert(std::make_pair(moduleNum, new std::map<int, float>)); + } + if (m_moduleDCSDataHolder->m_hv_current->find(moduleNum) == m_moduleDCSDataHolder->m_hv_current->end()) { + m_moduleDCSDataHolder->m_hv_current->insert(std::make_pair(moduleNum, new std::map<int, float>)); + } + for (const auto& lvNameMap : *(m_LV_voltage->m_maps)) { + std::string lvName = lvNameMap.first; + int chanNum = lvNameMap.second; + if (staveNum != PixelMainMon::getIBLstaveIdFromModuleName(lvName) || moduleGroup != PixelMainMon::getIBLmoduleGroupFromModuleName(lvName)) continue; + if (m_LV_voltage->m_values->find(chanNum) != m_LV_voltage->m_values->end()) { + for (const auto& valueMap : *(m_LV_voltage->m_values->at(chanNum))) { + try { + LB = valueMap.first; + value = valueMap.second; + auto itr_lv_voltage = m_moduleDCSDataHolder->m_lv_voltage->find(moduleNum); + itr_lv_voltage->second->insert(std::make_pair(LB, value)); + } catch (const std::out_of_range& oor) { + ATH_MSG_DEBUG("Out of Range error: " << oor.what() << " , m_LV_voltage: chanNum = " << chanNum); + continue; + } + } + } + + if (m_LV_current->m_values->find(chanNum) != m_LV_current->m_values->end()) { + for (const auto& valueMap : *(m_LV_current->m_values->at(chanNum))) { + try { + LB = valueMap.first; + value = valueMap.second; + auto itr_lv_current = m_moduleDCSDataHolder->m_lv_current->find(moduleNum); + itr_lv_current->second->insert(std::make_pair(LB, value)); + } catch (const std::out_of_range& oor) { + ATH_MSG_DEBUG("Out of Range error: " << oor.what() << " , m_LV_current: chanNum = " << chanNum); + continue; + } + } + } + + if (m_HV_current->m_values->find(chanNum) != m_HV_current->m_values->end()) { + for (const auto& valueMap : *(m_HV_current->m_values->at(chanNum))) { + try { + LB = valueMap.first; + value = valueMap.second; + auto itr_hv_current = m_moduleDCSDataHolder->m_hv_current->find(moduleNum); + itr_hv_current->second->insert(std::make_pair(LB, value)); + } catch (const std::out_of_range& oor) { + ATH_MSG_DEBUG("Out of Range error: " << oor.what() << " , m_HV_current: chanNum = " << chanNum); + continue; + } + } + } + } // end lv/hv + } // end fill moduleDcsDataHolder + + //---------------------------- + // loop over modules + //--------------------------- + for (const auto& nameMap : *(m_moduleDCSDataHolder->m_moduleMap)) { + // nameMap.first is module name. nameMap.second is channel number. + if (nameMap.first == "") { + ATH_MSG_WARNING("ProcPixelDCSMon(): Channel " << nameMap.second << " does not have module name"); + continue; + } + std::string moduleName = nameMap.first; + int moduleNum = nameMap.second; + if (moduleName.find("LI_") == std::string::npos || moduleName.find("LI_S15") != std::string::npos) { + continue; // if not IBL + } + int staveNum = PixelMainMon::getIBLstaveIdFromModuleName(moduleName); + int module_eta = PixelMainMon::getIBLetaIndexFromModuleName(moduleName); + int moduleGroup = PixelMainMon::getIBLmoduleGroupFromModuleName(moduleName); + try { + for (const auto& valueMap : *(m_moduleDCSDataHolder->m_tempModule->at(moduleNum))) { + int LB = valueMap.first; + float tempModule = valueMap.second; + float tempInlet = m_moduleDCSDataHolder->m_tempInlet->at(moduleNum)->at(LB); + float tempOutlet = m_moduleDCSDataHolder->m_tempOutlet->at(moduleNum)->at(LB); + float hv_voltage = TMath::Abs(m_moduleDCSDataHolder->m_hv_voltage->at(moduleNum)->at(LB)); + float lv_voltage = m_moduleDCSDataHolder->m_lv_voltage->at(moduleNum)->at(LB); + float hv_current = TMath::Abs(m_moduleDCSDataHolder->m_hv_current->at(moduleNum)->at(LB)); + float lv_current = m_moduleDCSDataHolder->m_lv_current->at(moduleNum)->at(LB); + float fsm_state = m_moduleDCSDataHolder->m_fsm_state->at(moduleNum)->at(LB); + if (fsm_state > m_fsmState2enum.size()) { + fsm_state = m_fsmState2enum["READY"]; + } + float fsm_status = m_moduleDCSDataHolder->m_fsm_status->at(moduleNum)->at(LB); + if (fsm_status > m_fsmState2enum.size()) { + fsm_status = m_fsmStatus2enum["OK"]; + } + m_hist_moduleTemperatureEtaPhi->Fill(module_eta, staveNum, tempModule); + m_hist_moduleTemperature2Dscatter[staveNum - 1]->Fill(module_eta, tempModule); + m_hist_moduleTemperatureLB[staveNum - 1]->Fill(LB, tempModule); + m_hist_LB_staveID_moduleTemperature->Fill(LB, staveNum, tempModule); + m_hist_LB_moduleGroup_moduleTemperature[staveNum - 1]->Fill(LB, moduleGroup, tempModule); + float dT = tempModule - tempOutlet; + m_hist_dTEtaPhi->Fill(module_eta, staveNum, dT); + m_hist_LB_staveID_dT->Fill(LB, staveNum, dT); + m_hist_LB_moduleGroup_dT[staveNum - 1]->Fill(LB, moduleGroup, dT); + + m_hist_Pipes_inlet2Dscatter->Fill(staveNum, tempInlet); + m_hist_Pipes_inletLB[staveNum - 1]->Fill(LB, tempInlet); + m_hist_LB_staveID_coolingPipeInlet->Fill(LB, staveNum, tempInlet); + + m_hist_Pipes_outlet2Dscatter->Fill(staveNum, tempOutlet); + m_hist_Pipes_outletLB[staveNum - 1]->Fill(LB, tempOutlet); + m_hist_LB_staveID_coolingPipeOutlet->Fill(LB, staveNum, tempOutlet); + + m_hist_HVoltageEtaPhi->Fill(module_eta, staveNum, hv_voltage); + m_hist_HVoltage2Dscatter[staveNum - 1]->Fill(module_eta, hv_voltage); + m_hist_HVoltageLB[staveNum - 1]->Fill(LB, hv_voltage); + m_hist_LB_staveID_HVoltage->Fill(LB, staveNum, hv_voltage); + m_hist_LB_moduleGroup_HVoltage[staveNum - 1]->Fill(LB, moduleGroup, hv_voltage); + + m_hist_HVcurrentEtaPhi->Fill(module_eta, staveNum, hv_current); + m_hist_HVcurrent2Dscatter[staveNum - 1]->Fill(module_eta, hv_current); + m_hist_HVcurrentLB[staveNum - 1]->Fill(LB, hv_current); + m_hist_LB_moduleGroup_HVcurrent[staveNum - 1]->Fill(LB, moduleGroup, hv_current); + m_hist_LB_staveID_HVcurrent->Fill(LB, staveNum, hv_current); + + m_hist_LVoltageEtaPhi->Fill(module_eta, staveNum, lv_voltage); + m_hist_LVoltage2Dscatter[staveNum - 1]->Fill(module_eta, lv_voltage); + m_hist_LVoltageLB[staveNum - 1]->Fill(LB, lv_voltage); + m_hist_LB_staveID_LVoltage->Fill(LB, staveNum, lv_voltage); + m_hist_LB_moduleGroup_LVoltage[staveNum - 1]->Fill(LB, moduleGroup, lv_voltage); + + m_hist_LVcurrentEtaPhi->Fill(module_eta, staveNum, lv_current); + m_hist_LVcurrent2Dscatter[staveNum - 1]->Fill(module_eta, lv_current); + m_hist_LVcurrentLB[staveNum - 1]->Fill(LB, lv_current); + m_hist_LB_moduleGroup_LVcurrent[staveNum - 1]->Fill(LB, moduleGroup, lv_current); + m_hist_LB_staveID_LVcurrent->Fill(LB, staveNum, lv_current); + + if (fsm_state > m_hist_FSMstateEtaPhi->GetBinContent(module_eta + 11, staveNum)) { // -10 <= module_eta <= 9, + m_hist_FSMstateEtaPhi->SetBinContent(module_eta + 11, staveNum, fsm_state); // 1 <= staveNum <= 14 + } + m_hist_FSMstate2Dscatter[staveNum - 1]->Fill(module_eta, fsm_state); + m_hist_FSMstateLB[staveNum - 1]->Fill(LB, fsm_state); + if (fsm_state > m_hist_LB_staveID_FSMstate->GetBinContent(LB + 1, staveNum)) { + m_hist_LB_staveID_FSMstate->SetBinContent(LB + 1, staveNum, fsm_state); + } + if (fsm_state > m_hist_LB_moduleGroup_FSMstate[staveNum - 1]->GetBinContent(LB + 1, moduleGroup + 1)) { + m_hist_LB_moduleGroup_FSMstate[staveNum - 1]->SetBinContent(LB + 1, moduleGroup + 1, fsm_state); + } + + if (fsm_status > m_hist_FSMstatusEtaPhi->GetBinContent(module_eta + 11, staveNum)) { // -10 <= module_eta <= 9, + m_hist_FSMstatusEtaPhi->SetBinContent(module_eta + 11, staveNum, fsm_status); // 1 <= staveNum <= 14 + } + m_hist_FSMstatus2Dscatter[staveNum - 1]->Fill(module_eta, fsm_status); + m_hist_FSMstatusLB[staveNum - 1]->Fill(LB, fsm_status); + if (fsm_status > m_hist_LB_staveID_FSMstatus->GetBinContent(LB + 1, staveNum)) { + m_hist_LB_staveID_FSMstatus->SetBinContent(LB + 1, staveNum, fsm_status); + } + if (fsm_status > m_hist_LB_moduleGroup_FSMstatus[staveNum - 1]->GetBinContent(LB + 1, moduleGroup + 1)) { + m_hist_LB_moduleGroup_FSMstatus[staveNum - 1]->SetBinContent(LB + 1, moduleGroup + 1, fsm_status); + } + m_hist_LB_moduleGroup_FSMstatus[staveNum - 1]->Fill(LB, moduleGroup, fsm_status); + + float hvpc = TMath::Abs(hv_voltage * hv_current); + m_hist_HVPowerConsumptionEtaPhi->Fill(module_eta, staveNum, hvpc); + m_hist_LB_staveID_HVPowerConsumption->Fill(LB, staveNum, hvpc); + m_hist_LB_moduleGroup_HVPowerConsumption[staveNum - 1]->Fill(LB, moduleGroup, hvpc); + + float lvpc = TMath::Abs(lv_voltage * lv_current); + m_hist_LVPowerConsumptionEtaPhi->Fill(module_eta, staveNum, lvpc); + m_hist_LB_staveID_LVPowerConsumption->Fill(LB, staveNum, lvpc); + m_hist_LB_moduleGroup_LVPowerConsumption[staveNum - 1]->Fill(LB, moduleGroup, lvpc); + + m_hist_LVHVPowerConsumptionEtaPhi->Fill(module_eta, staveNum, lvpc + hvpc * 0.001); + m_hist_LB_staveID_LVHVPowerConsumption->Fill(LB, staveNum, lvpc + hvpc * 0.001); + m_hist_LB_moduleGroup_LVHVPowerConsumption[staveNum - 1]->Fill(LB, moduleGroup, lvpc + hvpc * 0.001); + + float tempFlex = dT * 0.6 + tempOutlet; // 0.6 is measured value + m_hist_effFLEXtempEtaPhi->Fill(module_eta, staveNum, tempFlex); + m_hist_LB_staveID_effFLEXtemp->Fill(LB, staveNum, tempFlex); + m_hist_LB_moduleGroup_effFLEXtemp[staveNum - 1]->Fill(LB, moduleGroup, tempFlex); + + if (lvpc + hvpc * 0.001 != 0) { + float tfm = dT / (lvpc + hvpc * 0.001); + m_hist_thermalFigureMeritEtaPhi->Fill(module_eta, staveNum, tfm); + m_hist_LB_staveID_thermalFigureMerit->Fill(LB, staveNum, tfm); + m_hist_LB_moduleGroup_thermalFigureMerit[staveNum - 1]->Fill(LB, moduleGroup, tfm); + } + } + } catch (const std::out_of_range& oor) { + ATH_MSG_DEBUG("moduleNum " << moduleNum << ", Out of Range error: " << oor.what()); + continue; + } + } // end loop over modules #if 0 - //int moduleNum[IBLStave::COUNT] = {0}; - for(const auto& nameMap : *(m_moduleTemperature->m_maps) ){ - // nameMap.first is module name. nameMap.second is channel number. - //ATH_MSG_DEBUG("ProcPixelDCSMon(): Module Name: " << nameMap.first << ", Channel Num: " << nameMap.second); - //std::cout << "ProcPixelDCSMon(): Module Name: " << nameMap.first << ", Channel Num: " << nameMap.second << std::endl; - if (nameMap.first == "") { - ATH_MSG_WARNING("ProcPixelDCSMon(): Channel " << nameMap.second << " does not have module name"); - continue; - } - std::string moduleName = nameMap.first; - int chanNum = nameMap.second; - if (moduleName.find("LI_") == std::string::npos || - moduleName.find("LI_S15") != std::string::npos) continue; // if not IBL - int staveNum = PixelMainMon::getIBLstaveIdFromModuleName(moduleName); - int module_eta = PixelMainMon::getIBLetaIndexFromModuleName(moduleName); - int moduleGroup = PixelMainMon::getIBLmoduleGroupFromModuleName(moduleName); - //std::cout << "ProcPixelDCSMon(): staveNum " << staveNum << ", module_eta: " << module_eta << std::endl; - try{ // at is dangerous... - // module temperature - for(const auto& valueMap : *( m_moduleTemperature->m_values->at( chanNum ) ) ){ - // valueMap.first is LB. valueMap.second is value. - LB = valueMap.first; - value = valueMap.second; - m_hist_moduleTemperatureEtaPhi->Fill(module_eta, staveNum, value); - m_hist_moduleTemperature2Dscatter[staveNum - 1]->Fill(module_eta, value); - m_hist_moduleTemperatureLB[staveNum - 1]->Fill(LB, value); - m_hist_LB_staveID_moduleTemperature->Fill(LB, staveNum, value); - m_hist_LB_moduleGroup_moduleTemperature[staveNum - 1]->Fill(LB, moduleGroup, value); - try { - float dT = value - m_coolingPipeTemperatureOutlet->m_values->at( staveNum )->at( LB ); // module temp - outlet temp - m_hist_dTEtaPhi->Fill(module_eta, staveNum, dT); - m_hist_LB_staveID_dT->Fill(LB, staveNum, dT ); - m_hist_LB_moduleGroup_dT[staveNum - 1]->Fill(LB, moduleGroup, dT ); - } catch (const std::out_of_range& oor) { - std::cerr << "Out of Range error: " << oor.what() << " , m_coolingPipeTemperatureOutlet: chanNum = " << chanNum << '\n'; - continue; - } - } - } catch (const std::out_of_range& oor) { - std::cerr << "Out of Range error: " << oor.what() << " , m_moduleTemperature: chanNum = " << chanNum << '\n'; - continue; - } - try{ - // HV - for(const auto& valueMap : *( m_HV->m_values->at( chanNum ) ) ){ - // valueMap.first is LB. valueMap.second is value. - LB = valueMap.first; - value = valueMap.second; - m_hist_HVoltageEtaPhi->Fill(module_eta, staveNum, value); - m_hist_HVoltage2Dscatter[staveNum - 1]->Fill(module_eta, value); - m_hist_HVoltageLB[staveNum - 1]->Fill(LB,value); - m_hist_LB_staveID_HVoltage->Fill(LB, staveNum, value); - m_hist_LB_moduleGroup_HVoltage[staveNum - 1]->Fill(LB, moduleGroup, value); - } - } catch (const std::out_of_range& oor) { - std::cerr << "Out of Range error: " << oor.what() << " , m_HV: chanNum = " << chanNum << '\n'; - continue; - } - //moduleNum[staveNum - 1]++; - } - - //-------------------------------- - // loop over cooling pipes - //-------------------------------- - for(const auto& nameMap : *(m_coolingPipeTemperatureInlet->m_maps) ){ - ATH_MSG_DEBUG( "ProcPixelDCSMon(): Pipe Name: " << nameMap.first << ", Channel Num: " << nameMap.second); - if (nameMap.first == ""){ - ATH_MSG_WARNING("ProcPixelDCSMon(): Channel " << nameMap.second << " does not have pipe name"); - continue; - } - std::string moduleName = nameMap.first; - int chanNum = nameMap.second; - //std::string staveNumStr(moduleName, moduleName.find("S") + 1, 2); // LI_S01_A_... - //int staveNum = std::stoi(staveNumStr); - int staveNum = PixelMainMon::getIBLstaveIdFromModuleName(moduleName); - //int moduleGroup = PixelMainMon::getIBLmoduleGroupFromModuleName(moduleName); - //std::cout << "ProcPixelDCSMon(): staveNum " << staveNum << std::endl; - try{ - std::map<int, float>* test = m_coolingPipeTemperatureInlet->m_values->at(chanNum); // vector::at throws an out-of-range - test = nullptr; // just to avoid warning message "unused variable..." - } - catch (const std::out_of_range& oor) { - std::cerr << "Out of Range error: " << oor.what() << " , m_coolingPipeTemperatureInlet: chanNum = " << chanNum << '\n'; - continue; - } - // cooling pipe inlet - for(const auto& valueMap : *( m_coolingPipeTemperatureInlet->m_values->at( chanNum ) ) ){ - LB = valueMap.first; - value = valueMap.second; - m_hist_Pipes_inlet2Dscatter->Fill(staveNum, value); - m_hist_Pipes_inletLB[staveNum - 1]->Fill(LB,value); - m_hist_LB_staveID_coolingPipeInlet->Fill(LB,staveNum,value); - //m_hist_LB_moduleGroup_coolingPipeInlet[staveNum - 1]->Fill(LB,moduleGroup,value); - } - try{ - std::map<int, float>* test = m_coolingPipeTemperatureOutlet->m_values->at(chanNum); // vector::at throws an out-of-range - test = nullptr; // just to avoid warning message "unused variable..." - } - catch (const std::out_of_range& oor) { - std::cerr << "Out of Range error: " << oor.what() << " , m_coolingPipeTemperatureOutlet: chanNum = " << chanNum << '\n'; - continue; - } - // cooling pipe outlet - for(const auto& valueMap : *( m_coolingPipeTemperatureOutlet->m_values->at( chanNum ) ) ){ - LB = valueMap.first; - value = valueMap.second; - //m_hist_Pipes_outletEtaPhi->Fill(module_eta, staveNum, value); - m_hist_Pipes_outlet2Dscatter->Fill(staveNum, value); - m_hist_Pipes_outletLB[staveNum - 1]->Fill(LB,value); - m_hist_LB_staveID_coolingPipeOutlet->Fill(LB,staveNum,value); - //m_hist_LB_moduleGroup_coolingPipeOutlet[staveNum - 1]->Fill(LB,moduleGroup,value); - } - } - - //-------------------- - // loop over LV - //-------------------- - for(const auto& nameMap : *(m_LV_voltage->m_maps) ){ - ATH_MSG_DEBUG( "ProcPixelDCSMon(): LV Name: " << nameMap.first << ", Channel Num: " << nameMap.second); - if (nameMap.first == ""){ - ATH_MSG_WARNING("ProcPixelDCSMon(): Channel " << nameMap.second << " does not have LV channel name"); - continue; - } - std::string moduleName = nameMap.first; - int chanNum = nameMap.second; - //std::string staveNumStr(moduleName, moduleName.find("S") + 1, 2); // LI_S01_A_... - //int staveNum = std::stoi(staveNumStr); - int staveNum = PixelMainMon::getIBLstaveIdFromModuleName(moduleName); - int moduleGroup = PixelMainMon::getIBLmoduleGroupFromModuleName(moduleName); - //std::cout << "ProcPixelDCSMon(): staveNum " << staveNum << ", moduleGroup " << moduleGroup << std::endl; - try{ - std::map<int, float>* test = m_LV_voltage->m_values->at(chanNum); // vector::at throws an out-of-range - test = nullptr; // just to avoid warning message "unused variable..." - } - catch (const std::out_of_range& oor) { - std::cerr << "Out of Range error: " << oor.what() << " , m_LV_voltage: chanNum = " << chanNum << '\n'; - continue; - } - // LV - for(const auto& valueMap : *( m_LV_voltage->m_values->at( chanNum ) ) ){ - LB = valueMap.first; - value = valueMap.second; - //m_hist_Pipes_inlet2D->Fill(staveNum, value); - //m_hist_Pipes_inletLB[staveNum - 1]->Fill(LB,value); - //std::cout << "ProcPixelDCSMon(): LB " << LB << ", value " << value << std::endl; - //m_hist_HVoltageEtaPhi->Fill(module_eta, staveNum, value); - m_hist_LB_moduleGroup_LVoltage[staveNum - 1]->Fill(LB, moduleGroup, value); - m_hist_LB_staveID_LVoltage->Fill(LB,staveNum,value); - try { - float lvpc = value * m_LV_current->m_values->at( chanNum )->at( LB ); // module temp - outlet temp - //m_hist_dTEtaPhi->Fill(module_eta, staveNum, dT); - m_hist_LB_staveID_LVPowerConsumption->Fill(LB, staveNum, lvpc ); - m_hist_LB_moduleGroup_LVPowerConsumption[staveNum - 1]->Fill(LB, moduleGroup, lvpc ); - } catch (const std::out_of_range& oor) { - std::cerr << "Out of Range error: " << oor.what() << " , m_coolingPipeTemperatureOutlet: chanNum = " << chanNum << '\n'; - continue; - } - - } - try{ - std::map<int, float>* test = m_LV_current->m_values->at(chanNum); // vector::at throws an out-of-range - test = nullptr; // just to avoid warning message "unused variable..." - } - catch (const std::out_of_range& oor) { - std::cerr << "Out of Range error: " << oor.what() << " , m_LV_current: chanNum = " << chanNum << '\n'; - continue; - } - // LV current - for(const auto& valueMap : *( m_LV_current->m_values->at( chanNum ) ) ){ - LB = valueMap.first; - value = valueMap.second; - //m_hist_Pipes_outlet2D->Fill(staveNum, value); - //m_hist_Pipes_outletLB[staveNum - 1]->Fill(LB,value); - m_hist_LB_moduleGroup_LVcurrent[staveNum - 1]->Fill(LB, moduleGroup, value); - m_hist_LB_staveID_LVcurrent->Fill(LB,staveNum,value); - } - // HV current - for(const auto& valueMap : *( m_HV_current->m_values->at( chanNum ) ) ){ - LB = valueMap.first; - value = valueMap.second; - m_hist_LB_moduleGroup_HVcurrent[staveNum - 1]->Fill(LB, moduleGroup, value); - m_hist_LB_staveID_HVcurrent->Fill(LB,staveNum,value); - } - - } // end loop over LV + for (const auto& nameMap : *(m_moduleTemperature->m_maps)) { + // nameMap.first is module name. nameMap.second is channel number. + if (nameMap.first == "") { + ATH_MSG_WARNING("ProcPixelDCSMon(): Channel " << nameMap.second << " does not have module name"); + continue; + } + std::string moduleName = nameMap.first; + int chanNum = nameMap.second; + if (moduleName.find("LI_") == std::string::npos || moduleName.find("LI_S15") != std::string::npos) { + continue; // if not IBL + } + int staveNum = PixelMainMon::getIBLstaveIdFromModuleName(moduleName); + int module_eta = PixelMainMon::getIBLetaIndexFromModuleName(moduleName); + int moduleGroup = PixelMainMon::getIBLmoduleGroupFromModuleName(moduleName); + try { + for (const auto& valueMap : *(m_moduleTemperature->m_values->at(chanNum))) { + // valueMap.first is LB. valueMap.second is value. + LB = valueMap.first; + value = valueMap.second; + m_hist_moduleTemperatureEtaPhi->Fill(module_eta, staveNum, value); + m_hist_moduleTemperature2Dscatter[staveNum - 1]->Fill(module_eta, value); + m_hist_moduleTemperatureLB[staveNum - 1]->Fill(LB, value); + m_hist_LB_staveID_moduleTemperature->Fill(LB, staveNum, value); + m_hist_LB_moduleGroup_moduleTemperature[staveNum - 1]->Fill(LB, moduleGroup, value); + try { + float dT = value - m_coolingPipeTemperatureOutlet->m_values->at(staveNum)->at(LB); + m_hist_dTEtaPhi->Fill(module_eta, staveNum, dT); + m_hist_LB_staveID_dT->Fill(LB, staveNum, dT); + m_hist_LB_moduleGroup_dT[staveNum - 1]->Fill(LB, moduleGroup, dT); + } catch (const std::out_of_range& oor) { + std::cerr << "Out of Range error: " << oor.what() << " , m_coolingPipeTemperatureOutlet: chanNum = " << chanNum << '\n'; + continue; + } + } + } catch (const std::out_of_range& oor) { + std::cerr << "Out of Range error: " << oor.what() << " , m_moduleTemperature: chanNum = " << chanNum << '\n'; + continue; + } + try { + for (const auto& valueMap : *(m_HV->m_values->at(chanNum))) { + LB = valueMap.first; + value = valueMap.second; + m_hist_HVoltageEtaPhi->Fill(module_eta, staveNum, value); + m_hist_HVoltage2Dscatter[staveNum - 1]->Fill(module_eta, value); + m_hist_HVoltageLB[staveNum - 1]->Fill(LB, value); + m_hist_LB_staveID_HVoltage->Fill(LB, staveNum, value); + m_hist_LB_moduleGroup_HVoltage[staveNum - 1]->Fill(LB, moduleGroup, value); + } + } catch (const std::out_of_range& oor) { + std::cerr << "Out of Range error: " << oor.what() << " , m_HV: chanNum = " << chanNum << '\n'; + continue; + } + } + + //-------------------------------- + // loop over cooling pipes + //-------------------------------- + for (const auto& nameMap : *(m_coolingPipeTemperatureInlet->m_maps)) { + ATH_MSG_DEBUG("ProcPixelDCSMon(): Pipe Name: " << nameMap.first << ", Channel Num: " << nameMap.second); + if (nameMap.first == "") { + ATH_MSG_WARNING("ProcPixelDCSMon(): Channel " << nameMap.second << " does not have pipe name"); + continue; + } + std::string moduleName = nameMap.first; + int chanNum = nameMap.second; + int staveNum = PixelMainMon::getIBLstaveIdFromModuleName(moduleName); + try { + std::map<int, float>* test = m_coolingPipeTemperatureInlet->m_values->at(chanNum); + test = nullptr; // just to avoid warning message "unused variable..." + } catch (const std::out_of_range& oor) { + std::cerr << "Out of Range error: " << oor.what() << " , m_coolingPipeTemperatureInlet: chanNum = " << chanNum << '\n'; + continue; + } + + for (const auto& valueMap : *(m_coolingPipeTemperatureInlet->m_values->at(chanNum))) { + LB = valueMap.first; + value = valueMap.second; + m_hist_Pipes_inlet2Dscatter->Fill(staveNum, value); + m_hist_Pipes_inletLB[staveNum - 1]->Fill(LB, value); + m_hist_LB_staveID_coolingPipeInlet->Fill(LB, staveNum, value); + } + try { + std::map<int, float>* test = m_coolingPipeTemperatureOutlet->m_values->at(chanNum); + test = nullptr; // just to avoid warning message "unused variable..." + } catch (const std::out_of_range& oor) { + std::cerr << "Out of Range error: " << oor.what() << " , m_coolingPipeTemperatureOutlet: chanNum = " << chanNum << '\n'; + continue; + } + + for (const auto& valueMap : *(m_coolingPipeTemperatureOutlet->m_values->at(chanNum))) { + LB = valueMap.first; + value = valueMap.second; + m_hist_Pipes_outlet2Dscatter->Fill(staveNum, value); + m_hist_Pipes_outletLB[staveNum - 1]->Fill(LB, value); + m_hist_LB_staveID_coolingPipeOutlet->Fill(LB, staveNum, value); + } + } + + //-------------------- + // loop over LV + //-------------------- + for (const auto& nameMap : *(m_LV_voltage->m_maps)) { + ATH_MSG_DEBUG("ProcPixelDCSMon(): LV Name: " << nameMap.first << ", Channel Num: " << nameMap.second); + if (nameMap.first == "") { + ATH_MSG_WARNING("ProcPixelDCSMon(): Channel " << nameMap.second << " does not have LV channel name"); + continue; + } + std::string moduleName = nameMap.first; + int chanNum = nameMap.second; + int staveNum = PixelMainMon::getIBLstaveIdFromModuleName(moduleName); + int moduleGroup = PixelMainMon::getIBLmoduleGroupFromModuleName(moduleName); + try { + std::map<int, float>* test = m_LV_voltage->m_values->at(chanNum); + test = nullptr; // just to avoid warning message "unused variable..." + } catch (const std::out_of_range& oor) { + std::cerr << "Out of Range error: " << oor.what() << " , m_LV_voltage: chanNum = " << chanNum << '\n'; + continue; + } + + for (const auto& valueMap : *(m_LV_voltage->m_values->at(chanNum))) { + LB = valueMap.first; + value = valueMap.second; + m_hist_LB_moduleGroup_LVoltage[staveNum - 1]->Fill(LB, moduleGroup, value); + m_hist_LB_staveID_LVoltage->Fill(LB, staveNum, value); + try { + float lvpc = value * m_LV_current->m_values->at(chanNum)->at(LB); + m_hist_LB_staveID_LVPowerConsumption->Fill(LB, staveNum, lvpc); + m_hist_LB_moduleGroup_LVPowerConsumption[staveNum - 1]->Fill(LB, moduleGroup, lvpc); + } catch (const std::out_of_range& oor) { + std::cerr << "Out of Range error: " << oor.what() << " , m_coolingPipeTemperatureOutlet: chanNum = " << chanNum << '\n'; + continue; + } + } + try { + std::map<int, float>* test = m_LV_current->m_values->at(chanNum); + test = nullptr; // just to avoid warning message "unused variable..." + } catch (const std::out_of_range& oor) { + std::cerr << "Out of Range error: " << oor.what() << " , m_LV_current: chanNum = " << chanNum << '\n'; + continue; + } + + for (const auto& valueMap : *(m_LV_current->m_values->at(chanNum))) { + LB = valueMap.first; + value = valueMap.second; + m_hist_LB_moduleGroup_LVcurrent[staveNum - 1]->Fill(LB, moduleGroup, value); + m_hist_LB_staveID_LVcurrent->Fill(LB, staveNum, value); + } + + for (const auto& valueMap : *(m_HV_current->m_values->at(chanNum))) { + LB = valueMap.first; + value = valueMap.second; + m_hist_LB_moduleGroup_HVcurrent[staveNum - 1]->Fill(LB, moduleGroup, value); + m_hist_LB_staveID_HVcurrent->Fill(LB, staveNum, value); + } + + } // end loop over LV #endif - return StatusCode::SUCCESS; + return StatusCode::SUCCESS; } - diff --git a/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelMainMon.cxx b/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelMainMon.cxx index a6d4be445898da16a9c4e2e2ba63e52f295e01c4..56c2ca7d2b7974bb8f7dd8a6bb346da5796e2875 100755 --- a/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelMainMon.cxx +++ b/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelMainMon.cxx @@ -5,441 +5,412 @@ /////////////////////////////////////////////////////////////////////////////// // This tool is the head of the monitoring. It is called by the job options and // given all the flags. This tool the does the common overhead jobs and calls -// functions which do each individual job. One function to book and fill each +// functions which do each individual job. One function to book and fill each // storegate type for each environment. // For example, filling cluster histograms for Details modules. -// -// Written by: Nathan Triplett (nathan.triplett@cern.ch), Cecile Lapoire (cecile.lapoire@cern.ch) -// Maintained by: Louise Skinnari (louise.skinnari@cern.ch) /////////////////////////////////////////////////////////////////////////////// #include "PixelMonitoring/PixelMainMon.h" -#include "InDetReadoutGeometry/SiDetectorElement.h" -#include "InDetRIO_OnTrack/SiClusterOnTrack.h" -//#include "TrkParameters/MeasuredAtaPlane.h" -//#include "TrkParameters/MeasuredPerigee.h" -#include "TrkParameters/TrackParameters.h" -#include "TrkSpacePoint/SpacePointContainer.h" -#include "TrkTrack/TrackCollection.h" -//#include "StoreGate/StoreGateSvc.h" -//#include "StoreGate/StoreGate.h" -#include "PixelConditionsServices/IPixelByteStreamErrorsSvc.h" #include "InDetConditionsSummaryService/IInDetConditionsSvc.h" -#include "TH2S.h" -#include "TProfile2D.h" -#include "LWHists/TH2F_LW.h" +#include "InDetRIO_OnTrack/SiClusterOnTrack.h" +#include "InDetReadoutGeometry/SiDetectorElement.h" #include "LWHists/TH1F_LW.h" #include "LWHists/TH1I_LW.h" -#include "LWHists/TProfile_LW.h" +#include "LWHists/TH2F_LW.h" #include "LWHists/TProfile2D_LW.h" +#include "LWHists/TProfile_LW.h" +#include "PixelConditionsServices/IPixelByteStreamErrorsSvc.h" +#include "TH2S.h" +#include "TProfile2D.h" +#include "TrkParameters/TrackParameters.h" +#include "TrkSpacePoint/SpacePointContainer.h" +#include "TrkTrack/TrackCollection.h" #include <stdint.h> -#include <vector> +#include <cstdlib> +#include <fstream> +#include <map> #include <sstream> -#include <fstream> // kazuki -#include <cstdlib> // kazuki -#include <map> // kazuki +#include <vector> +#include "EventInfo/EventID.h" +#include "EventInfo/EventInfo.h" #include "GaudiKernel/StatusCode.h" -//#include "Identifier/Identifier.h" +#include "InDetIdentifier/PixelID.h" #include "InDetReadoutGeometry/PixelDetectorManager.h" #include "InDetReadoutGeometry/SiDetectorElement.h" #include "InDetReadoutGeometry/SiDetectorElementCollection.h" -#include "InDetIdentifier/PixelID.h" -#include "PixelCabling/IPixelCablingSvc.h" #include "LumiBlockComps/ILuminosityTool.h" -#include "EventInfo/EventInfo.h" -#include "EventInfo/EventID.h" -#include "TrkToolInterfaces/ITrackHoleSearchTool.h" #include "PathResolver/PathResolver.h" -#include "PixelMonitoring/PixelMon2DMapsLW.h" -#include "PixelMonitoring/PixelMon2DProfilesLW.h" +#include "PixelCabling/IPixelCablingSvc.h" #include "PixelMonitoring/PixelMon2DLumiMaps.h" #include "PixelMonitoring/PixelMon2DLumiProfiles.h" +#include "PixelMonitoring/PixelMon2DMapsLW.h" +#include "PixelMonitoring/PixelMon2DProfilesLW.h" #include "PixelMonitoring/PixelMonModules.h" +#include "TrkToolInterfaces/ITrackHoleSearchTool.h" -////////////////////////////////////////////////////////////////////////////// - -PixelMainMon::PixelMainMon(const std::string & type, - const std::string & name, - const IInterface* parent) : - ManagedMonitorToolBase(type, name, parent), - m_pixelCondSummarySvc("PixelConditionsSummarySvc",name), - m_ErrorSvc("PixelByteStreamErrorsSvc",name), - m_pixelCableSvc("PixelCablingSvc",name), - m_IBLParameterSvc("IBLParameterSvc",name), - m_holeSearchTool("InDet::InDetTrackHoleSearchTool/InDetHoleSearchTool"), - m_lumiTool("LuminosityTool"), - m_moduleTemperature(new dcsDataHolder()), - m_coolingPipeTemperatureInlet(new dcsDataHolder()), - m_coolingPipeTemperatureOutlet(new dcsDataHolder()), - m_HV(new dcsDataHolder()), - m_HV_current(new dcsDataHolder()), - m_LV_voltage(new dcsDataHolder()), - m_LV_current(new dcsDataHolder()), - m_FSM_state(new dcsDataHolder()), - m_FSM_status(new dcsDataHolder()), - m_moduleDCSDataHolder(new moduleDcsDataHolder()) -{ //all job options flags go here - declareProperty("PixelConditionsSummarySvc", m_pixelCondSummarySvc); - declareProperty("PixelByteStreamErrorsSvc", m_ErrorSvc); - declareProperty("PixelCablingSvc", m_pixelCableSvc); - declareProperty("HoleSearchTool", m_holeSearchTool); - declareProperty("LuminosityTool", m_lumiTool); - - declareProperty("RDOName", m_Pixel_RDOName = "PixelRDOs"); //storegate container names - declareProperty("RODErrorName", m_detector_error_name = "pixel_error_summary"); - declareProperty("SpacePointName", m_Pixel_SpacePointsName = "PixelSpacePoints"); - declareProperty("ClusterName", m_Pixel_SiClustersName = "PixelClusters"); - declareProperty("TrackName", m_TracksName = "Pixel_Cosmic_Tracks"); - - declareProperty("onTrack", m_doOnTrack = false); //using inner detector tracks - declareProperty("do2DMaps", m_do2DMaps = false); - declareProperty("doModules", m_doModules = false); - declareProperty("doOffline", m_doOffline = false); - declareProperty("doOnline", m_doOnline = false); - declareProperty("doLowOccupancy", m_doLowOccupancy = false); - declareProperty("doHighOccupancy", m_doHighOccupancy = false); - declareProperty("doPixelOccupancy", m_doPixelOccupancy = false); - declareProperty("doDetails", m_doDetails = false); - declareProperty("doTiming", m_doTiming = false); - declareProperty("doLumiBlock", m_doLumiBlock = false); - declareProperty("doOfflineAnalysis",m_doOfflineAnalysis = false); // !!! if true using a lot of memory to be absolutely avoided for monitoring - - declareProperty("doRDO", m_doRDO = false); //flags to turn on/off parts of the code - declareProperty("doErrors", m_doRODError = false); - declareProperty("doSpacePoint", m_doSpacePoint = false); - declareProperty("doCluster", m_doCluster = false); - declareProperty("doTrack", m_doTrack = false); - declareProperty("doHoleSearch", m_doHoleSearch = false); - declareProperty("doStatus", m_doStatus = false); - declareProperty("doDCS", m_doDCS = false); - - declareProperty("doHeavyIonMon", m_doHeavyIonMon = false); - - declareProperty("doIBL", m_doIBL = false); - declareProperty("doESD", m_doESD = false); - - declareProperty("DetailsMod1", m_DetailsMod1 = ""); - declareProperty("DetailsMod2", m_DetailsMod2 = ""); - declareProperty("DetailsMod3", m_DetailsMod3 = ""); - declareProperty("DetailsMod4", m_DetailsMod4 = ""); - - - m_lbRange = 3000; - m_bcidRange = 3600; - m_isNewRun = false; - m_isNewLumiBlock = false; - m_newLowStatInterval = false; - m_doRefresh = false; - m_doRefresh5min = false; - m_firstBookTime = 0; - m_currentBCID = 0; - m_isFirstBook = false; - m_nRefresh = 0; - m_nRefresh5min = 0; - m_ntracksPerEvent = 0; - memset(m_nGood_mod, 0, sizeof(m_nGood_mod)); - memset(m_nActive_mod, 0, sizeof(m_nActive_mod)); - m_pixelid =0; - m_event =0; - m_event2 =0; - m_startTime =0; - m_majorityDisabled =0; - m_lumiBlockNum =0; - m_currentTime =0; - m_LBstartTime =0; - m_LBendTime =0; - m_runNum =0; - m_idHelper =0; - m_Pixel_clcontainer =0; - m_Pixel_spcontainer =0; - m_tracks =0; - - /// - /// Initalize all pointers for histograms - /// - /// - /// Event info - /// - m_events_per_lumi = 0; - m_mu_vs_bcid = 0; - m_mu_vs_lumi = 0; - m_storegate_errors = 0; - /// - /// Hits - /// - /// number of hits - m_hits_per_lumi = 0; - m_num_hits = 0; - memset(m_nhits_mod, 0, sizeof(m_nhits_mod)); - memset(m_hits_per_lumi_mod, 0, sizeof(m_hits_per_lumi_mod)); - memset(m_nlargeevt_per_lumi_mod, 0, sizeof(m_nlargeevt_per_lumi_mod)); - memset(m_totalhits_per_bcid_mod, 0, sizeof(m_totalhits_per_bcid_mod)); - /// hit occupancy - m_avgocc_per_lumi = 0; - m_avgocc_ratioIBLB0_per_lumi = 0; - memset(m_avgocc_per_lumi_mod, 0, sizeof(m_avgocc_per_lumi_mod)); - memset(m_avgocc_per_bcid_mod, 0, sizeof(m_avgocc_per_bcid_mod)); - memset(m_avgocc_per_bcid_per_lumi_mod, 0, sizeof(m_avgocc_per_bcid_per_lumi_mod)); - memset(m_avgocc_active_per_lumi_mod, 0, sizeof(m_avgocc_active_per_lumi_mod)); - memset(m_maxocc_per_lumi_mod, 0, sizeof(m_maxocc_per_lumi_mod)); - memset(m_maxocc_per_bcid_mod, 0, sizeof(m_maxocc_per_bcid_mod)); - m_occupancy_time1 = 0; - m_occupancy_time2 = 0; - m_occupancy_time3 = 0; - memset(m_occupancy_summary_mod, 0, sizeof(m_occupancy_summary_mod)); - memset(m_nFEswithHits_mod, 0, sizeof(m_nFEswithHits_mod)); - /// hit tot - memset(m_hit_ToT, 0, sizeof(m_hit_ToT)); - memset(m_hit_ToT_per_lumi_mod, 0, sizeof(m_hit_ToT_per_lumi_mod)); - memset(m_hit_ToT_tmp_mod, 0, sizeof(m_hit_ToT_tmp_mod)); - memset(m_hit_ToT_Mon_mod, 0, sizeof(m_hit_ToT_Mon_mod)); - memset(m_ToT_etaphi_mod, 0, sizeof(m_ToT_etaphi_mod)); - memset(m_hit_ToTMean_mod, 0, sizeof(m_hit_ToTMean_mod)); - /// timing - m_Lvl1ID_PIX = 0; - m_Lvl1ID_IBL = 0; - m_Atlas_BCID = 0; - m_Atlas_BCID_hits = 0; - m_BCID = 0; - m_BCID_Profile = 0; - m_Lvl1A = 0; - memset(m_Lvl1A_mod, 0, sizeof(m_Lvl1A_mod)); - memset(m_Lvl1A_10min_mod, 0, sizeof(m_Lvl1A_10min_mod)); - memset(m_Lvl1ID_diff_mod_ATLAS_mod, 0, sizeof(m_Lvl1ID_diff_mod_ATLAS_mod)); - memset(m_diff_ROD_vs_Module_BCID_mod, 0, sizeof(m_diff_ROD_vs_Module_BCID_mod)); - /// Quick status - m_nhits_L0_B11_S2_C6 = 0; - m_occupancy_L0_B11_S2_C6 = 0; - /// details - m_Details_mod1_num_hits = 0; - m_Details_mod2_num_hits = 0; - m_Details_mod3_num_hits = 0; - m_Details_mod4_num_hits = 0; - m_Details_mod1_occupancy = 0; - m_Details_mod2_occupancy = 0; - m_Details_mod3_occupancy = 0; - m_Details_mod4_occupancy = 0; - m_Details_mod1_ToT = 0; - m_Details_mod2_ToT = 0; - m_Details_mod3_ToT = 0; - m_Details_mod4_ToT = 0; - /// - /// track histograms - /// - /// track quality - m_track_res_phi = 0; - m_track_pull_phi = 0; - m_track_res_eta = 0; - m_track_pull_eta = 0; - m_track_chi2 = 0; - /// the number of tracks - m_tracksPerEvt_per_lumi = 0; - m_tracksPerEvtPerMu_per_lumi = 0; - /// track state on surface - /// hit efficiency - memset(m_hiteff_incl_mod, 0, sizeof(m_hiteff_incl_mod)); - /// Lorentz Angle - m_LorentzAngle_IBL = 0; - m_LorentzAngle_IBL2D = 0; - m_LorentzAngle_IBL3D = 0; - m_LorentzAngle_B0 = 0; - m_LorentzAngle_B1 = 0; - m_LorentzAngle_B2 = 0; - /// cluster size - memset(m_clusize_ontrack_mod, 0, sizeof(m_clusize_ontrack_mod)); - memset(m_clusize_offtrack_mod, 0, sizeof(m_clusize_offtrack_mod)); - /// module histo - m_track_chi2_bcl1 = 0; - m_track_chi2_bcl0 = 0; - m_track_chi2_bclgt1 = 0; - m_track_chi2_bcl1_highpt = 0; - m_track_chi2_bcl0_highpt = 0; - m_track_chi2_bclgt1_highpt = 0; - m_clustot_vs_pt = 0; - m_clustot_lowpt = 0; - m_1hitclustot_lowpt = 0; - m_2hitclustot_lowpt = 0; - m_clustot_highpt = 0; - m_1hitclustot_highpt = 0; - m_2hitclustot_highpt = 0; - /// - /// Cluster histograms - /// - m_clusters_per_lumi = 0; - memset(m_clusters_per_lumi_mod, 0, sizeof(m_clusters_per_lumi_mod)); - memset(m_clusters_col_width_per_lumi_mod, 0, sizeof(m_clusters_col_width_per_lumi_mod)); - memset(m_clusters_row_width_per_lumi_mod, 0, sizeof(m_clusters_row_width_per_lumi_mod)); - memset(m_clusters_col_width_per_bcid_mod, 0, sizeof(m_clusters_col_width_per_bcid_mod)); - memset(m_clusters_row_width_per_bcid_mod, 0, sizeof(m_clusters_row_width_per_bcid_mod)); - m_largeclusters_per_lumi = 0; - m_verylargeclusters_per_lumi = 0; - m_totalclusters_per_lumi = 0; - memset(m_totalclusters_per_lumi_mod, 0, sizeof(m_totalclusters_per_lumi_mod)); - memset(m_totalclusters_per_bcid_mod, 0, sizeof(m_totalclusters_per_bcid_mod)); - m_highNclusters_per_lumi = 0; - memset(m_cluster_ToT1d_mod, 0, sizeof(m_cluster_ToT1d_mod)); - memset(m_1cluster_ToT_mod, 0, sizeof(m_1cluster_ToT_mod)); - memset(m_2cluster_ToT_mod, 0, sizeof(m_2cluster_ToT_mod)); - memset(m_3cluster_ToT_mod, 0, sizeof(m_3cluster_ToT_mod)); - memset(m_bigcluster_ToT_mod, 0, sizeof(m_bigcluster_ToT_mod)); - memset(m_cluster_Q_mod, 0, sizeof(m_cluster_Q_mod)); - memset(m_1cluster_Q_mod, 0, sizeof(m_1cluster_Q_mod)); - memset(m_2cluster_Q_mod, 0, sizeof(m_2cluster_Q_mod)); - memset(m_3cluster_Q_mod, 0, sizeof(m_3cluster_Q_mod)); - memset(m_bigcluster_Q_mod, 0, sizeof(m_bigcluster_Q_mod)); - m_cluster_groupsize = 0; - m_cluster_col_width = 0; - m_cluster_row_width = 0; - memset(m_cluster_col_width_mod, 0, sizeof(m_cluster_col_width_mod)); - memset(m_cluster_row_width_mod, 0, sizeof(m_cluster_row_width_mod)); - memset(m_cluster_groupsize_mod, 0, sizeof(m_cluster_groupsize_mod)); - memset(m_cluster_LVL1A1d_mod, 0, sizeof(m_cluster_LVL1A1d_mod)); - m_clusterSize_eta = 0; - memset(m_clusToT_vs_eta_mod, 0, sizeof(m_clusToT_vs_eta_mod)); - memset(m_ToT_vs_clussize_mod, 0, sizeof(m_ToT_vs_clussize_mod)); - memset(m_clussize_vs_eta_mod, 0, sizeof(m_clussize_vs_eta_mod)); - m_cluster_occupancy_FE_B0_mon = 0; - m_cluster_occupancy_time1 = 0; - m_cluster_occupancy_time2 = 0; - m_cluster_occupancy_time3 = 0; - m_num_clusters = 0; - memset(m_clusters_per_track_per_lumi_mod, 0, sizeof(m_clusters_per_track_per_lumi_mod)); - memset(m_num_clusters_mod, 0, sizeof(m_num_clusters_mod)); - memset(m_cluster_occupancy_summary_mod, 0, sizeof(m_cluster_occupancy_summary_mod)); - m_cluster_LVL1A_mod = 0; - m_clustersOnOffTrack_per_lumi = 0; - /// Quick status - m_clusters_onTrack_L0_B11_S2_C6 = 0; - m_clusters_offTrack_L0_B11_S2_C6 = 0; - /// - /// Status - /// - m_disabledModules_per_lumi_PIX = 0; - memset(m_badModules_per_lumi_mod, 0, sizeof(m_badModules_per_lumi_mod)); - memset(m_disabledModules_per_lumi_mod, 0, sizeof(m_disabledModules_per_lumi_mod)); - memset(m_baddisabledModules_per_lumi_mod, 0, sizeof(m_baddisabledModules_per_lumi_mod)); - /// - /// Errors - /// - memset(m_errhist_errcat_avg, 0, sizeof(m_errhist_errcat_avg)); - memset(m_errhist_tot_LB, 0, sizeof(m_errhist_tot_LB)); - m_errhist_syncerr_LB_pix = 0; - memset(m_errhist_errcat_LB, 0, sizeof(m_errhist_errcat_LB)); - memset(m_errhist_errtype_LB, 0, sizeof(m_errhist_errtype_LB)); - m_error_time1 = 0; - m_error_time2 = 0; - m_error_time3 = 0; - memset(m_errhist_expert_LB, 0, sizeof(m_errhist_expert_LB)); - memset(m_errhist_per_bit_LB, 0, sizeof(m_errhist_per_bit_LB)); - memset(m_errhist_per_type_LB, 0, sizeof(m_errhist_per_type_LB)); - memset(m_errhist_expert_fe_trunc_err_3d, 0, sizeof(m_errhist_expert_fe_trunc_err_3d)); - m_errhist_expert_servrec_ibl_unweighted = 0; - m_errhist_expert_servrec_ibl_weighted = 0; - m_errhist_expert_servrec_ibl_count = 0; - /// - /// Space Point - /// - m_num_spacepoints = 0; - m_num_spacepoints_low = 0; - m_spHit_x = 0; - m_spHit_y = 0; - m_spHit_z = 0; - m_spHit_r = 0; - m_spHit_phi = 0; - m_spHit_xy = 0; - m_spHit_rz = 0; - /// - /// Per 20 LB - /// - m_num_hits_LB = 0; - memset(m_hit_ToT_LB_mod, 0, sizeof(m_hit_ToT_LB_mod)); - m_cluster_ToT_LB = 0; - m_num_clusters_LB = 0; - /// - /// DCS Monitorning - /// - /// TEMPERATURE - m_hist_moduleTemperatureEtaPhi = 0; - memset(m_hist_moduleTemperature2Dscatter, 0, sizeof(m_hist_moduleTemperature2Dscatter)); - memset(m_hist_moduleTemperatureLB, 0, sizeof(m_hist_moduleTemperatureLB)); - m_hist_LB_staveID_moduleTemperature = 0; - memset(m_hist_LB_moduleGroup_moduleTemperature, 0, sizeof(m_hist_LB_moduleGroup_moduleTemperature)); - /// HV - m_hist_HVoltageEtaPhi = 0; - memset(m_hist_HVoltage2Dscatter, 0, sizeof(m_hist_HVoltage2Dscatter)); - memset(m_hist_HVoltageLB, 0, sizeof(m_hist_HVoltageLB)); - m_hist_LB_staveID_HVoltage = 0; - memset(m_hist_LB_moduleGroup_HVoltage, 0, sizeof(m_hist_LB_moduleGroup_HVoltage)); - /// PIPES Inlet - //m_hist_Pipes_inletEtaPhi = 0; - memset(m_hist_Pipes_inletLB, 0, sizeof(m_hist_Pipes_inletLB)); - m_hist_Pipes_inlet2Dscatter = 0; - m_hist_LB_staveID_coolingPipeInlet = 0; - /// PIPES Outlet - //m_hist_Pipes_outletEtaPhi = 0; - memset(m_hist_Pipes_outletLB, 0, sizeof(m_hist_Pipes_outletLB)); - m_hist_Pipes_outlet2Dscatter = 0; - m_hist_LB_staveID_coolingPipeOutlet = 0; - /// LV - m_hist_LVoltageEtaPhi = 0; - memset(m_hist_LVoltage2Dscatter, 0, sizeof(m_hist_LVoltage2Dscatter)); - m_hist_LB_staveID_LVoltage = 0; - memset(m_hist_LB_moduleGroup_LVoltage, 0, sizeof(m_hist_LB_moduleGroup_LVoltage)); - /// LV current - m_hist_LVcurrentEtaPhi = 0; - memset(m_hist_LVcurrent2Dscatter, 0, sizeof(m_hist_LVcurrent2Dscatter)); - m_hist_LB_staveID_LVcurrent = 0; - memset(m_hist_LVcurrentLB, 0, sizeof(m_hist_LVcurrentLB)); - memset(m_hist_LB_moduleGroup_LVcurrent, 0, sizeof(m_hist_LB_moduleGroup_LVcurrent)); - /// HV current - m_hist_HVcurrentEtaPhi = 0; - memset(m_hist_HVcurrent2Dscatter, 0, sizeof(m_hist_HVcurrent2Dscatter)); - memset(m_hist_HVcurrentLB, 0, sizeof(m_hist_HVcurrentLB)); - m_hist_LB_staveID_HVcurrent= 0; - memset(m_hist_LB_moduleGroup_HVcurrent, 0, sizeof(m_hist_LB_moduleGroup_HVcurrent)); - /// FSM state - m_hist_FSMstateEtaPhi = 0; - memset(m_hist_FSMstate2Dscatter, 0, sizeof(m_hist_FSMstate2Dscatter)); - memset(m_hist_FSMstateLB, 0, sizeof(m_hist_FSMstateLB)); - m_hist_LB_staveID_FSMstate = 0; - memset(m_hist_LB_moduleGroup_FSMstate, 0, sizeof(m_hist_LB_moduleGroup_FSMstate)); - /// FSM status - m_hist_FSMstatusEtaPhi = 0; - memset(m_hist_FSMstatus2Dscatter, 0, sizeof(m_hist_FSMstatus2Dscatter)); - memset(m_hist_FSMstatusLB, 0, sizeof(m_hist_FSMstatusLB)); - m_hist_LB_staveID_FSMstatus = 0; - memset(m_hist_LB_moduleGroup_FSMstatus, 0, sizeof(m_hist_LB_moduleGroup_FSMstatus)); - /// dT - m_hist_dTEtaPhi = 0; - m_hist_LB_staveID_dT = 0; - memset(m_hist_LB_moduleGroup_dT, 0, sizeof(m_hist_LB_moduleGroup_dT)); // dT := module temp - cooling pipe outlet - /// LV Power Consumption - m_hist_LVPowerConsumptionEtaPhi = 0; - m_hist_LB_staveID_LVPowerConsumption = 0; - memset(m_hist_LB_moduleGroup_LVPowerConsumption, 0, sizeof(m_hist_LB_moduleGroup_LVPowerConsumption)); - /// HV Popwer Consumtion - m_hist_HVPowerConsumptionEtaPhi = 0; - m_hist_LB_staveID_HVPowerConsumption = 0; - memset(m_hist_LB_moduleGroup_HVPowerConsumption, 0, sizeof(m_hist_LB_moduleGroup_HVPowerConsumption)); - /// LV+HV Power Consumption - m_hist_LVHVPowerConsumptionEtaPhi = 0; - m_hist_LB_staveID_LVHVPowerConsumption = 0; - memset(m_hist_LB_moduleGroup_LVHVPowerConsumption, 0, sizeof(m_hist_LB_moduleGroup_LVHVPowerConsumption)); - /// effective FLEX temp - m_hist_effFLEXtempEtaPhi = 0; - m_hist_LB_staveID_effFLEXtemp = 0; - memset(m_hist_LB_moduleGroup_effFLEXtemp, 0, sizeof(m_hist_LB_moduleGroup_effFLEXtemp)); - /// thermal figure of merit - m_hist_thermalFigureMeritEtaPhi = 0; - m_hist_LB_staveID_thermalFigureMerit = 0; - memset(m_hist_LB_moduleGroup_thermalFigureMerit, 0, sizeof(m_hist_LB_moduleGroup_thermalFigureMerit)); +PixelMainMon::PixelMainMon(const std::string& type, const std::string& name, const IInterface* parent) : + ManagedMonitorToolBase(type, name, parent), + m_pixelCondSummarySvc("PixelConditionsSummarySvc", name), + m_ErrorSvc("PixelByteStreamErrorsSvc", name), + m_pixelCableSvc("PixelCablingSvc", name), + m_IBLParameterSvc("IBLParameterSvc", name), + m_holeSearchTool("InDet::InDetTrackHoleSearchTool/InDetHoleSearchTool"), + m_lumiTool("LuminosityTool"), + m_moduleTemperature(new dcsDataHolder()), + m_coolingPipeTemperatureInlet(new dcsDataHolder()), + m_coolingPipeTemperatureOutlet(new dcsDataHolder()), + m_HV(new dcsDataHolder()), + m_HV_current(new dcsDataHolder()), + m_LV_voltage(new dcsDataHolder()), + m_LV_current(new dcsDataHolder()), + m_FSM_state(new dcsDataHolder()), + m_FSM_status(new dcsDataHolder()), + m_moduleDCSDataHolder(new moduleDcsDataHolder()) { + // all job options flags go here + declareProperty("PixelConditionsSummarySvc", m_pixelCondSummarySvc); + declareProperty("PixelByteStreamErrorsSvc", m_ErrorSvc); + declareProperty("PixelCablingSvc", m_pixelCableSvc); + declareProperty("HoleSearchTool", m_holeSearchTool); + declareProperty("LuminosityTool", m_lumiTool); + + declareProperty("RDOName", m_Pixel_RDOName = "PixelRDOs"); // storegate container names + declareProperty("RODErrorName", m_detector_error_name = "pixel_error_summary"); + declareProperty("SpacePointName", m_Pixel_SpacePointsName = "PixelSpacePoints"); + declareProperty("ClusterName", m_Pixel_SiClustersName = "PixelClusters"); + declareProperty("TrackName", m_TracksName = "Pixel_Cosmic_Tracks"); + + declareProperty("onTrack", m_doOnTrack = false); // use inner detector tracks + declareProperty("do2DMaps", m_do2DMaps = false); + declareProperty("doModules", m_doModules = false); + declareProperty("doOffline", m_doOffline = false); + declareProperty("doOnline", m_doOnline = false); + declareProperty("doLowOccupancy", m_doLowOccupancy = false); + declareProperty("doHighOccupancy", m_doHighOccupancy = false); + declareProperty("doPixelOccupancy", m_doPixelOccupancy = false); + declareProperty("doDetails", m_doDetails = false); + declareProperty("doTiming", m_doTiming = false); + declareProperty("doLumiBlock", m_doLumiBlock = false); + declareProperty("doOfflineAnalysis", m_doOfflineAnalysis = false); // uses a lot of memory (to be absolutely avoided for monitoring!) + + // flags to turn on/off parts of the code + declareProperty("doRDO", m_doRDO = false); + declareProperty("doErrors", m_doRODError = false); + declareProperty("doSpacePoint", m_doSpacePoint = false); + declareProperty("doCluster", m_doCluster = false); + declareProperty("doTrack", m_doTrack = false); + declareProperty("doHoleSearch", m_doHoleSearch = false); + declareProperty("doStatus", m_doStatus = false); + declareProperty("doDCS", m_doDCS = false); + declareProperty("doHeavyIonMon", m_doHeavyIonMon = false); + + declareProperty("doIBL", m_doIBL = false); + declareProperty("doESD", m_doESD = false); + declareProperty("DetailsMod1", m_DetailsMod1 = ""); + declareProperty("DetailsMod2", m_DetailsMod2 = ""); + declareProperty("DetailsMod3", m_DetailsMod3 = ""); + declareProperty("DetailsMod4", m_DetailsMod4 = ""); + + m_lbRange = 3000; + m_bcidRange = 3600; + m_isNewRun = false; + m_isNewLumiBlock = false; + m_newLowStatInterval = false; + m_doRefresh = false; + m_doRefresh5min = false; + m_firstBookTime = 0; + m_currentBCID = 0; + m_isFirstBook = false; + m_nRefresh = 0; + m_nRefresh5min = 0; + m_ntracksPerEvent = 0; + memset(m_nGood_mod, 0, sizeof(m_nGood_mod)); + memset(m_nActive_mod, 0, sizeof(m_nActive_mod)); + m_pixelid = 0; + m_event = 0; + m_event2 = 0; + m_startTime = 0; + m_majorityDisabled = 0; + m_lumiBlockNum = 0; + m_currentTime = 0; + m_LBstartTime = 0; + m_LBendTime = 0; + m_runNum = 0; + m_idHelper = 0; + m_Pixel_clcontainer = 0; + m_Pixel_spcontainer = 0; + m_tracks = 0; + + // Initalize all pointers for histograms + + // Event info + m_events_per_lumi = 0; + m_mu_vs_bcid = 0; + m_mu_vs_lumi = 0; + m_storegate_errors = 0; + + // number of hits + m_hits_per_lumi = 0; + m_num_hits = 0; + memset(m_nhits_mod, 0, sizeof(m_nhits_mod)); + memset(m_hits_per_lumi_mod, 0, sizeof(m_hits_per_lumi_mod)); + memset(m_nlargeevt_per_lumi_mod, 0, sizeof(m_nlargeevt_per_lumi_mod)); + memset(m_totalhits_per_bcid_mod, 0, sizeof(m_totalhits_per_bcid_mod)); + + // hit occupancy + m_avgocc_per_lumi = 0; + m_avgocc_ratioIBLB0_per_lumi = 0; + memset(m_avgocc_per_lumi_mod, 0, sizeof(m_avgocc_per_lumi_mod)); + memset(m_avgocc_per_bcid_mod, 0, sizeof(m_avgocc_per_bcid_mod)); + memset(m_avgocc_per_bcid_per_lumi_mod, 0, sizeof(m_avgocc_per_bcid_per_lumi_mod)); + memset(m_avgocc_active_per_lumi_mod, 0, sizeof(m_avgocc_active_per_lumi_mod)); + memset(m_maxocc_per_lumi_mod, 0, sizeof(m_maxocc_per_lumi_mod)); + memset(m_maxocc_per_bcid_mod, 0, sizeof(m_maxocc_per_bcid_mod)); + m_occupancy_time1 = 0; + m_occupancy_time2 = 0; + m_occupancy_time3 = 0; + memset(m_occupancy_summary_mod, 0, sizeof(m_occupancy_summary_mod)); + memset(m_nFEswithHits_mod, 0, sizeof(m_nFEswithHits_mod)); + + // hit tot + memset(m_hit_ToT, 0, sizeof(m_hit_ToT)); + memset(m_hit_ToT_per_lumi_mod, 0, sizeof(m_hit_ToT_per_lumi_mod)); + memset(m_hit_ToT_tmp_mod, 0, sizeof(m_hit_ToT_tmp_mod)); + memset(m_hit_ToT_Mon_mod, 0, sizeof(m_hit_ToT_Mon_mod)); + memset(m_ToT_etaphi_mod, 0, sizeof(m_ToT_etaphi_mod)); + memset(m_hit_ToTMean_mod, 0, sizeof(m_hit_ToTMean_mod)); + + // timing + m_Lvl1ID_PIX = 0; + m_Lvl1ID_IBL = 0; + m_Atlas_BCID = 0; + m_Atlas_BCID_hits = 0; + m_BCID = 0; + m_BCID_Profile = 0; + m_Lvl1A = 0; + memset(m_Lvl1A_mod, 0, sizeof(m_Lvl1A_mod)); + memset(m_Lvl1A_10min_mod, 0, sizeof(m_Lvl1A_10min_mod)); + memset(m_Lvl1ID_diff_mod_ATLAS_mod, 0, sizeof(m_Lvl1ID_diff_mod_ATLAS_mod)); + memset(m_diff_ROD_vs_Module_BCID_mod, 0, sizeof(m_diff_ROD_vs_Module_BCID_mod)); + + // quick status + m_nhits_L0_B11_S2_C6 = 0; + m_occupancy_L0_B11_S2_C6 = 0; + + // details + m_Details_mod1_num_hits = 0; + m_Details_mod2_num_hits = 0; + m_Details_mod3_num_hits = 0; + m_Details_mod4_num_hits = 0; + m_Details_mod1_occupancy = 0; + m_Details_mod2_occupancy = 0; + m_Details_mod3_occupancy = 0; + m_Details_mod4_occupancy = 0; + m_Details_mod1_ToT = 0; + m_Details_mod2_ToT = 0; + m_Details_mod3_ToT = 0; + m_Details_mod4_ToT = 0; + + // track quality + m_track_res_phi = 0; + m_track_pull_phi = 0; + m_track_res_eta = 0; + m_track_pull_eta = 0; + m_track_chi2 = 0; + + // the number of tracks + m_tracksPerEvt_per_lumi = 0; + m_tracksPerEvtPerMu_per_lumi = 0; + memset(m_hiteff_incl_mod, 0, sizeof(m_hiteff_incl_mod)); + + // Lorentz Angle + m_LorentzAngle_IBL = 0; + m_LorentzAngle_IBL2D = 0; + m_LorentzAngle_IBL3D = 0; + m_LorentzAngle_B0 = 0; + m_LorentzAngle_B1 = 0; + m_LorentzAngle_B2 = 0; + + // cluster size + memset(m_clusize_ontrack_mod, 0, sizeof(m_clusize_ontrack_mod)); + memset(m_clusize_offtrack_mod, 0, sizeof(m_clusize_offtrack_mod)); + + // module histo + m_track_chi2_bcl1 = 0; + m_track_chi2_bcl0 = 0; + m_track_chi2_bclgt1 = 0; + m_track_chi2_bcl1_highpt = 0; + m_track_chi2_bcl0_highpt = 0; + m_track_chi2_bclgt1_highpt = 0; + m_clustot_vs_pt = 0; + m_clustot_lowpt = 0; + m_1hitclustot_lowpt = 0; + m_2hitclustot_lowpt = 0; + m_clustot_highpt = 0; + m_1hitclustot_highpt = 0; + m_2hitclustot_highpt = 0; + + // cluster histograms + m_clusters_per_lumi = 0; + memset(m_clusters_per_lumi_mod, 0, sizeof(m_clusters_per_lumi_mod)); + memset(m_clusters_col_width_per_lumi_mod, 0, sizeof(m_clusters_col_width_per_lumi_mod)); + memset(m_clusters_row_width_per_lumi_mod, 0, sizeof(m_clusters_row_width_per_lumi_mod)); + memset(m_clusters_col_width_per_bcid_mod, 0, sizeof(m_clusters_col_width_per_bcid_mod)); + memset(m_clusters_row_width_per_bcid_mod, 0, sizeof(m_clusters_row_width_per_bcid_mod)); + m_largeclusters_per_lumi = 0; + m_verylargeclusters_per_lumi = 0; + m_totalclusters_per_lumi = 0; + memset(m_totalclusters_per_lumi_mod, 0, sizeof(m_totalclusters_per_lumi_mod)); + memset(m_totalclusters_per_bcid_mod, 0, sizeof(m_totalclusters_per_bcid_mod)); + m_highNclusters_per_lumi = 0; + memset(m_cluster_ToT1d_mod, 0, sizeof(m_cluster_ToT1d_mod)); + memset(m_1cluster_ToT_mod, 0, sizeof(m_1cluster_ToT_mod)); + memset(m_2cluster_ToT_mod, 0, sizeof(m_2cluster_ToT_mod)); + memset(m_3cluster_ToT_mod, 0, sizeof(m_3cluster_ToT_mod)); + memset(m_bigcluster_ToT_mod, 0, sizeof(m_bigcluster_ToT_mod)); + memset(m_cluster_Q_mod, 0, sizeof(m_cluster_Q_mod)); + memset(m_1cluster_Q_mod, 0, sizeof(m_1cluster_Q_mod)); + memset(m_2cluster_Q_mod, 0, sizeof(m_2cluster_Q_mod)); + memset(m_3cluster_Q_mod, 0, sizeof(m_3cluster_Q_mod)); + memset(m_bigcluster_Q_mod, 0, sizeof(m_bigcluster_Q_mod)); + m_cluster_groupsize = 0; + m_cluster_col_width = 0; + m_cluster_row_width = 0; + memset(m_cluster_col_width_mod, 0, sizeof(m_cluster_col_width_mod)); + memset(m_cluster_row_width_mod, 0, sizeof(m_cluster_row_width_mod)); + memset(m_cluster_groupsize_mod, 0, sizeof(m_cluster_groupsize_mod)); + memset(m_cluster_LVL1A1d_mod, 0, sizeof(m_cluster_LVL1A1d_mod)); + m_clusterSize_eta = 0; + memset(m_clusToT_vs_eta_mod, 0, sizeof(m_clusToT_vs_eta_mod)); + memset(m_ToT_vs_clussize_mod, 0, sizeof(m_ToT_vs_clussize_mod)); + memset(m_clussize_vs_eta_mod, 0, sizeof(m_clussize_vs_eta_mod)); + m_cluster_occupancy_FE_B0_mon = 0; + m_cluster_occupancy_time1 = 0; + m_cluster_occupancy_time2 = 0; + m_cluster_occupancy_time3 = 0; + m_num_clusters = 0; + memset(m_clusters_per_track_per_lumi_mod, 0, sizeof(m_clusters_per_track_per_lumi_mod)); + memset(m_num_clusters_mod, 0, sizeof(m_num_clusters_mod)); + memset(m_cluster_occupancy_summary_mod, 0, sizeof(m_cluster_occupancy_summary_mod)); + m_cluster_LVL1A_mod = 0; + m_clustersOnOffTrack_per_lumi = 0; + + // quick status + m_clusters_onTrack_L0_B11_S2_C6 = 0; + m_clusters_offTrack_L0_B11_S2_C6 = 0; + + // module status + m_disabledModules_per_lumi_PIX = 0; + memset(m_badModules_per_lumi_mod, 0, sizeof(m_badModules_per_lumi_mod)); + memset(m_disabledModules_per_lumi_mod, 0, sizeof(m_disabledModules_per_lumi_mod)); + memset(m_baddisabledModules_per_lumi_mod, 0, sizeof(m_baddisabledModules_per_lumi_mod)); + + // errors + memset(m_errhist_errcat_avg, 0, sizeof(m_errhist_errcat_avg)); + memset(m_errhist_tot_LB, 0, sizeof(m_errhist_tot_LB)); + m_errhist_syncerr_LB_pix = 0; + memset(m_errhist_errcat_LB, 0, sizeof(m_errhist_errcat_LB)); + memset(m_errhist_errtype_LB, 0, sizeof(m_errhist_errtype_LB)); + m_error_time1 = 0; + m_error_time2 = 0; + m_error_time3 = 0; + memset(m_errhist_expert_LB, 0, sizeof(m_errhist_expert_LB)); + memset(m_errhist_per_bit_LB, 0, sizeof(m_errhist_per_bit_LB)); + memset(m_errhist_per_type_LB, 0, sizeof(m_errhist_per_type_LB)); + memset(m_errhist_expert_fe_trunc_err_3d, 0, sizeof(m_errhist_expert_fe_trunc_err_3d)); + m_errhist_expert_servrec_ibl_unweighted = 0; + m_errhist_expert_servrec_ibl_weighted = 0; + m_errhist_expert_servrec_ibl_count = 0; + + // space point + m_num_spacepoints = 0; + m_num_spacepoints_low = 0; + m_spHit_x = 0; + m_spHit_y = 0; + m_spHit_z = 0; + m_spHit_r = 0; + m_spHit_phi = 0; + m_spHit_xy = 0; + m_spHit_rz = 0; + + m_num_hits_LB = 0; + memset(m_hit_ToT_LB_mod, 0, sizeof(m_hit_ToT_LB_mod)); + m_cluster_ToT_LB = 0; + m_num_clusters_LB = 0; + + // DCS monitorning + m_hist_moduleTemperatureEtaPhi = 0; + memset(m_hist_moduleTemperature2Dscatter, 0, sizeof(m_hist_moduleTemperature2Dscatter)); + memset(m_hist_moduleTemperatureLB, 0, sizeof(m_hist_moduleTemperatureLB)); + m_hist_LB_staveID_moduleTemperature = 0; + memset(m_hist_LB_moduleGroup_moduleTemperature, 0, sizeof(m_hist_LB_moduleGroup_moduleTemperature)); + m_hist_HVoltageEtaPhi = 0; + memset(m_hist_HVoltage2Dscatter, 0, sizeof(m_hist_HVoltage2Dscatter)); + memset(m_hist_HVoltageLB, 0, sizeof(m_hist_HVoltageLB)); + m_hist_LB_staveID_HVoltage = 0; + memset(m_hist_LB_moduleGroup_HVoltage, 0, sizeof(m_hist_LB_moduleGroup_HVoltage)); + memset(m_hist_Pipes_inletLB, 0, sizeof(m_hist_Pipes_inletLB)); + m_hist_Pipes_inlet2Dscatter = 0; + m_hist_LB_staveID_coolingPipeInlet = 0; + memset(m_hist_Pipes_outletLB, 0, sizeof(m_hist_Pipes_outletLB)); + m_hist_Pipes_outlet2Dscatter = 0; + m_hist_LB_staveID_coolingPipeOutlet = 0; + + m_hist_LVoltageEtaPhi = 0; + memset(m_hist_LVoltage2Dscatter, 0, sizeof(m_hist_LVoltage2Dscatter)); + m_hist_LB_staveID_LVoltage = 0; + memset(m_hist_LB_moduleGroup_LVoltage, 0, sizeof(m_hist_LB_moduleGroup_LVoltage)); + + m_hist_LVcurrentEtaPhi = 0; + memset(m_hist_LVcurrent2Dscatter, 0, sizeof(m_hist_LVcurrent2Dscatter)); + m_hist_LB_staveID_LVcurrent = 0; + memset(m_hist_LVcurrentLB, 0, sizeof(m_hist_LVcurrentLB)); + memset(m_hist_LB_moduleGroup_LVcurrent, 0, sizeof(m_hist_LB_moduleGroup_LVcurrent)); + + m_hist_HVcurrentEtaPhi = 0; + memset(m_hist_HVcurrent2Dscatter, 0, sizeof(m_hist_HVcurrent2Dscatter)); + memset(m_hist_HVcurrentLB, 0, sizeof(m_hist_HVcurrentLB)); + m_hist_LB_staveID_HVcurrent = 0; + memset(m_hist_LB_moduleGroup_HVcurrent, 0, sizeof(m_hist_LB_moduleGroup_HVcurrent)); + + m_hist_FSMstateEtaPhi = 0; + memset(m_hist_FSMstate2Dscatter, 0, sizeof(m_hist_FSMstate2Dscatter)); + memset(m_hist_FSMstateLB, 0, sizeof(m_hist_FSMstateLB)); + m_hist_LB_staveID_FSMstate = 0; + memset(m_hist_LB_moduleGroup_FSMstate, 0, sizeof(m_hist_LB_moduleGroup_FSMstate)); + + m_hist_FSMstatusEtaPhi = 0; + memset(m_hist_FSMstatus2Dscatter, 0, sizeof(m_hist_FSMstatus2Dscatter)); + memset(m_hist_FSMstatusLB, 0, sizeof(m_hist_FSMstatusLB)); + m_hist_LB_staveID_FSMstatus = 0; + memset(m_hist_LB_moduleGroup_FSMstatus, 0, sizeof(m_hist_LB_moduleGroup_FSMstatus)); + + m_hist_dTEtaPhi = 0; + m_hist_LB_staveID_dT = 0; + memset(m_hist_LB_moduleGroup_dT, 0, sizeof(m_hist_LB_moduleGroup_dT)); // dT := module temp - cooling pipe outlet + + // power consumption + m_hist_LVPowerConsumptionEtaPhi = 0; + m_hist_LB_staveID_LVPowerConsumption = 0; + memset(m_hist_LB_moduleGroup_LVPowerConsumption, 0, sizeof(m_hist_LB_moduleGroup_LVPowerConsumption)); + m_hist_HVPowerConsumptionEtaPhi = 0; + m_hist_LB_staveID_HVPowerConsumption = 0; + memset(m_hist_LB_moduleGroup_HVPowerConsumption, 0, sizeof(m_hist_LB_moduleGroup_HVPowerConsumption)); + m_hist_LVHVPowerConsumptionEtaPhi = 0; + m_hist_LB_staveID_LVHVPowerConsumption = 0; + memset(m_hist_LB_moduleGroup_LVHVPowerConsumption, 0, sizeof(m_hist_LB_moduleGroup_LVHVPowerConsumption)); + + m_hist_effFLEXtempEtaPhi = 0; + m_hist_LB_staveID_effFLEXtemp = 0; + memset(m_hist_LB_moduleGroup_effFLEXtemp, 0, sizeof(m_hist_LB_moduleGroup_effFLEXtemp)); + m_hist_thermalFigureMeritEtaPhi = 0; + m_hist_LB_staveID_thermalFigureMerit = 0; + memset(m_hist_LB_moduleGroup_thermalFigureMerit, 0, sizeof(m_hist_LB_moduleGroup_thermalFigureMerit)); } - -PixelMainMon::~PixelMainMon() -{ + +PixelMainMon::~PixelMainMon() { delete m_moduleTemperature; delete m_coolingPipeTemperatureInlet; delete m_coolingPipeTemperatureOutlet; @@ -450,122 +421,119 @@ PixelMainMon::~PixelMainMon() delete m_FSM_state; delete m_FSM_status; delete m_moduleDCSDataHolder; - } +StatusCode PixelMainMon::initialize() { + ATH_CHECK(ManagedMonitorToolBase::initialize()); + time(&m_startTime); // mark time for start of run -StatusCode PixelMainMon::initialize() -{ - ATH_CHECK( ManagedMonitorToolBase::initialize() ); - time ( &m_startTime ); //mark time for start of run - //m_idHelper = new AtlasDetectorID; // not need "new" + // Retrieve tools + if (detStore()->retrieve(m_pixelid, "PixelID").isFailure()) { + msg(MSG::FATAL) << "Could not get Pixel ID helper" << endmsg; + return StatusCode::FAILURE; + } - // Retrieve tools - if (detStore()->retrieve(m_pixelid, "PixelID").isFailure()) { - msg(MSG::FATAL) << "Could not get Pixel ID helper" << endmsg; - return StatusCode::FAILURE; - } + ATH_CHECK(detStore()->retrieve(m_idHelper, "AtlasID")); - // Get the dictionary manager from the detector store + if (m_pixelCondSummarySvc.retrieve().isFailure()) { + if (msgLvl(MSG::FATAL)) msg(MSG::FATAL) << "Failed to retrieve tool " << m_pixelCondSummarySvc << endmsg; + return StatusCode::FAILURE; + } else { + if (msgLvl(MSG::INFO)) msg(MSG::INFO) << "Retrieved tool " << m_pixelCondSummarySvc << endmsg; + } - ATH_CHECK( detStore()->retrieve(m_idHelper, "AtlasID") ); + if (m_pixelCableSvc.retrieve().isFailure()) { + if (msgLvl(MSG::FATAL)) msg(MSG::FATAL) << "Failed to retrieve tool " << m_pixelCableSvc << endmsg; + return StatusCode::FAILURE; + } else { + if (msgLvl(MSG::INFO)) msg(MSG::INFO) << "Retrieved tool " << m_pixelCableSvc << endmsg; + } - if ( m_pixelCondSummarySvc.retrieve().isFailure() ) { - if(msgLvl(MSG::FATAL)) msg(MSG::FATAL) << "Failed to retrieve tool " << m_pixelCondSummarySvc << endmsg; - return StatusCode::FAILURE; - } else { - if(msgLvl(MSG::INFO)) msg(MSG::INFO) << "Retrieved tool " << m_pixelCondSummarySvc << endmsg; - } + if (m_ErrorSvc.retrieve().isFailure()) { + if (msgLvl(MSG::FATAL)) msg(MSG::FATAL) << "Failed to retrieve tool " << m_ErrorSvc << endmsg; + return StatusCode::FAILURE; + } else { + if (msgLvl(MSG::INFO)) msg(MSG::INFO) << "Retrieved tool " << m_ErrorSvc << endmsg; + } - if ( m_pixelCableSvc.retrieve().isFailure() ) { - if(msgLvl(MSG::FATAL)) msg(MSG::FATAL) << "Failed to retrieve tool " << m_pixelCableSvc << endmsg; - return StatusCode::FAILURE; - } else { - if(msgLvl(MSG::INFO)) msg(MSG::INFO) << "Retrieved tool " << m_pixelCableSvc << endmsg; - } + if (m_IBLParameterSvc.retrieve().isFailure()) { + if (msgLvl(MSG::FATAL)) msg(MSG::FATAL) << "Could not retrieve IBLParameterSvc" << endmsg; + return StatusCode::FAILURE; + } else { + if (msgLvl(MSG::INFO)) msg(MSG::INFO) << "Retrieved tool " << m_IBLParameterSvc << endmsg; + } - if ( m_ErrorSvc.retrieve().isFailure() ) { - if(msgLvl(MSG::FATAL)) msg(MSG::FATAL) << "Failed to retrieve tool " << m_ErrorSvc << endmsg; - return StatusCode::FAILURE; - } else { - if(msgLvl(MSG::INFO)) msg(MSG::INFO) << "Retrieved tool " << m_ErrorSvc << endmsg; - } + m_doIBL = m_IBLParameterSvc->containsIBL(); + msg(MSG::INFO) << "doIBL set to " << m_doIBL << endmsg; - if (m_IBLParameterSvc.retrieve().isFailure()) { - if(msgLvl(MSG::FATAL)) msg(MSG::FATAL) << "Could not retrieve IBLParameterSvc" << endmsg; - return StatusCode::FAILURE; - } else { - if(msgLvl(MSG::INFO)) msg(MSG::INFO) << "Retrieved tool " << m_IBLParameterSvc << endmsg; - } - - m_doIBL = m_IBLParameterSvc->containsIBL(); - msg(MSG::INFO)<<"doIBL set to "<<m_doIBL<<endmsg; - - if(m_doIBL && !m_IBLParameterSvc->contains3D()){ - msg(MSG::WARNING)<<"Assuming hybrid 2D/3D IBL module composition, but geometry is all-planar"<<endmsg; - } - - if(m_doHoleSearch){ - if ( m_holeSearchTool.retrieve().isFailure() ) { - msg(MSG::FATAL) << "Failed to retrieve tool " << m_holeSearchTool << endmsg; - return StatusCode::FAILURE; - }else{ - msg(MSG::INFO) << "Retrieved tool " << m_holeSearchTool << endmsg; - } - } + if (m_doIBL && !m_IBLParameterSvc->contains3D()) { + msg(MSG::WARNING) << "Assuming hybrid 2D/3D IBL module composition, but geometry is all-planar" << endmsg; + } - if ( m_lumiTool.retrieve().isFailure() ) { - msg(MSG::FATAL) << "Failed to retrieve tool " << m_lumiTool << endmsg; + if (m_doHoleSearch) { + if (m_holeSearchTool.retrieve().isFailure()) { + msg(MSG::FATAL) << "Failed to retrieve tool " << m_holeSearchTool << endmsg; return StatusCode::FAILURE; - } else { - msg(MSG::INFO) << "Retrieved tool " << m_lumiTool << endmsg; - } + } else { + msg(MSG::INFO) << "Retrieved tool " << m_holeSearchTool << endmsg; + } + } + + if (m_lumiTool.retrieve().isFailure()) { + msg(MSG::FATAL) << "Failed to retrieve tool " << m_lumiTool << endmsg; + return StatusCode::FAILURE; + } else { + msg(MSG::INFO) << "Retrieved tool " << m_lumiTool << endmsg; + } if (!m_doDCS) return StatusCode::SUCCESS; - m_atrcollist.push_back(std::string("/PIXEL/DCS/TEMPERATURE")); // module - m_atrcollist.push_back(std::string("/PIXEL/DCS/HV")); // readout unit - m_atrcollist.push_back(std::string("/PIXEL/DCS/FSMSTATE")); // readout unit - m_atrcollist.push_back(std::string("/PIXEL/DCS/FSMSTATUS")); // readout unit - m_atrcollist.push_back(std::string("/PIXEL/DCS/PIPES")); // IBL stave - m_atrcollist.push_back(std::string("/PIXEL/DCS/HVCURRENT")); // IBL readout unit - //m_atrcollist.push_back(std::string("/PIXEL/DCS/PLANTS")); // 1 - m_atrcollist.push_back(std::string("/PIXEL/DCS/LV")); // IBL readout unit + m_atrcollist.push_back(std::string("/PIXEL/DCS/TEMPERATURE")); + m_atrcollist.push_back(std::string("/PIXEL/DCS/HV")); + m_atrcollist.push_back(std::string("/PIXEL/DCS/FSMSTATE")); + m_atrcollist.push_back(std::string("/PIXEL/DCS/FSMSTATUS")); + m_atrcollist.push_back(std::string("/PIXEL/DCS/PIPES")); + m_atrcollist.push_back(std::string("/PIXEL/DCS/HVCURRENT")); + m_atrcollist.push_back(std::string("/PIXEL/DCS/LV")); m_currentLumiBlockNumber = 0; - std::string modMapFileName = PathResolver::find_file ("PixelDQMonitoring/wincc2cool.csv", "CALIBPATH"); - std::string coolPipeFileName = PathResolver::find_file ("PixelDQMonitoring/coolingPipeMap.csv", "CALIBPATH"); - std::string lvMapFileName = PathResolver::find_file ("PixelDQMonitoring/lvMap.csv", "CALIBPATH"); + std::string modMapFileName = PathResolver::find_file("PixelDQMonitoring/wincc2cool.csv", "CALIBPATH"); + std::string coolPipeFileName = PathResolver::find_file("PixelDQMonitoring/coolingPipeMap.csv", "CALIBPATH"); + std::string lvMapFileName = PathResolver::find_file("PixelDQMonitoring/lvMap.csv", "CALIBPATH"); if (modMapFileName == "" || coolPipeFileName == "" || lvMapFileName == "") { ATH_MSG_WARNING("initialize(): can't find DCS mapping files - m_doDCS flag has been changed to False."); m_doDCS = false; - } else { + } else { std::ifstream moduleMapfile(modMapFileName.c_str()); std::ifstream coolingPipeMapfile(coolPipeFileName.c_str()); std::ifstream lvMapfile(lvMapFileName.c_str()); - - if ( moduleMapfile.fail() || coolingPipeMapfile.fail() || lvMapfile.fail() ) { + + if (moduleMapfile.fail() || coolingPipeMapfile.fail() || lvMapfile.fail()) { ATH_MSG_WARNING("initialize(): can't read DCS mapping files - m_doDCS flag has been changed to False."); m_doDCS = false; } else { ATH_MSG_INFO("initialize(): found all DCS channel mapping files accessible, start reading them."); - int channel; std::string moduleName; std::string rest; - std::string inletName; std::string outletName; - std::string lvVoltageName; std::string lvCurrentName; - while(moduleMapfile >> channel >> moduleName >> rest) { - m_moduleTemperature->m_maps->insert(std::make_pair(moduleName, channel)); - m_HV->m_maps->insert(std::make_pair(moduleName, channel)); - m_moduleDCSDataHolder->m_moduleMap->insert(std::make_pair(moduleName, channel)); - ATH_MSG_DEBUG( "initialize(): channel " << channel << ", moduleName " << moduleName ); + int channel; + std::string moduleName; + std::string rest; + std::string inletName; + std::string outletName; + std::string lvVoltageName; + std::string lvCurrentName; + while (moduleMapfile >> channel >> moduleName >> rest) { + m_moduleTemperature->m_maps->insert(std::make_pair(moduleName, channel)); + m_HV->m_maps->insert(std::make_pair(moduleName, channel)); + m_moduleDCSDataHolder->m_moduleMap->insert(std::make_pair(moduleName, channel)); + ATH_MSG_DEBUG("initialize(): channel " << channel << ", moduleName " << moduleName); } - while(coolingPipeMapfile >> channel >> inletName >> outletName) { - m_coolingPipeTemperatureInlet->m_maps->insert(std::make_pair(inletName, channel)); - m_coolingPipeTemperatureOutlet->m_maps->insert(std::make_pair(outletName, channel)); + while (coolingPipeMapfile >> channel >> inletName >> outletName) { + m_coolingPipeTemperatureInlet->m_maps->insert(std::make_pair(inletName, channel)); + m_coolingPipeTemperatureOutlet->m_maps->insert(std::make_pair(outletName, channel)); } - while(lvMapfile >> channel >> lvVoltageName >> lvCurrentName) { - m_LV_voltage->m_maps->insert(std::make_pair(lvVoltageName, channel)); - m_LV_current->m_maps->insert(std::make_pair(lvCurrentName, channel)); + while (lvMapfile >> channel >> lvVoltageName >> lvCurrentName) { + m_LV_voltage->m_maps->insert(std::make_pair(lvVoltageName, channel)); + m_LV_current->m_maps->insert(std::make_pair(lvCurrentName, channel)); } } } @@ -620,382 +588,334 @@ StatusCode PixelMainMon::initialize() return StatusCode::SUCCESS; } +StatusCode PixelMainMon::bookHistograms() { + const EventInfo* thisEventInfo; + if (evtStore()->retrieve(thisEventInfo) != StatusCode::SUCCESS) { + if (msgLvl(MSG::WARNING)) msg(MSG::WARNING) << "No EventInfo object found" << endmsg; + } else { + m_lumiBlockNum = thisEventInfo->event_ID()->lumi_block(); + + if (m_doOnline) { + m_runNum = thisEventInfo->event_ID()->run_number(); + std::stringstream runNumStr; + runNumStr << m_runNum; + m_histTitleExt = " (Run " + runNumStr.str() + ")"; + } else { + m_histTitleExt = ""; + } + if (newLumiBlockFlag()) { + m_LBstartTime = thisEventInfo->event_ID()->time_stamp(); + } + if (!m_isFirstBook) { + m_firstBookTime = thisEventInfo->event_ID()->time_stamp(); + m_isFirstBook = true; + } + } -StatusCode PixelMainMon::bookHistograms() -{ - // m_isNewRun = newRun; - // m_isNewLumiBlock = newLumiBlock; - // m_newLowStatInterval = newLowStatInterval; - //m_doOnline = true; - - const EventInfo* thisEventInfo; - if(evtStore()->retrieve(thisEventInfo) != StatusCode::SUCCESS) { - if(msgLvl(MSG::WARNING)) msg(MSG::WARNING) << "No EventInfo object found" << endmsg; - }else{ - m_lumiBlockNum = thisEventInfo->event_ID()->lumi_block(); - - if(m_doOnline){ - m_runNum = thisEventInfo->event_ID()->run_number(); - std::stringstream runNumStr; - runNumStr << m_runNum; - m_histTitleExt = " (Run " + runNumStr.str() + ")"; - }else{ - m_histTitleExt = ""; - } - if ( newLumiBlockFlag() ) { - m_LBstartTime = thisEventInfo->event_ID()->time_stamp(); - } - if( !m_isFirstBook ){ - m_firstBookTime = thisEventInfo->event_ID()->time_stamp(); - m_isFirstBook = true; - } - } - - if(msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "bookHistograms()" << endmsg; - - if(m_environment==AthenaMonManager::tier0ESD&&!m_doOnline) - { - m_doRDO = false; - m_doRODError = false; - m_doSpacePoint = false; - m_doCluster = false; - m_doStatus = false; - m_doDCS = false; - m_doTrack = false; - } - - if(msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "[PixelMonitoring] flags in bookHisto" << endmsg; - if(msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "m_doESD " << m_doESD << endmsg; - if(msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "m_doRDO " << m_doRDO << endmsg; - if(msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "m_doRODError " << m_doRODError << endmsg; - if(msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "m_doSpacePoint" << m_doSpacePoint << endmsg; - if(msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "m_doCluster " << m_doCluster << endmsg; - if(msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "m_doStatus " << m_doStatus << endmsg; - if(msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "m_doDCS " << m_doDCS << endmsg; - if(msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "m_doTrack " << m_doTrack << endmsg; - - - /// - /// Book histograms - /// - - if(m_doLumiBlock){ - if(m_doRDO){ - if (BookHitsLumiBlockMon().isFailure()) { - if(msgLvl(MSG::INFO)) msg(MSG::INFO) << "Could not book lowStat histograms" << endmsg; - } - if(msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Done booking RDO for lowStat" << endmsg; + if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "bookHistograms()" << endmsg; + + if (m_environment == AthenaMonManager::tier0ESD && !m_doOnline) { + m_doRDO = false; + m_doRODError = false; + m_doSpacePoint = false; + m_doCluster = false; + m_doStatus = false; + m_doDCS = false; + m_doTrack = false; + } + + if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "[PixelMonitoring] flags in bookHisto" << endmsg; + if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "m_doESD " << m_doESD << endmsg; + if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "m_doRDO " << m_doRDO << endmsg; + if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "m_doRODError " << m_doRODError << endmsg; + if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "m_doSpacePoint" << m_doSpacePoint << endmsg; + if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "m_doCluster " << m_doCluster << endmsg; + if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "m_doStatus " << m_doStatus << endmsg; + if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "m_doDCS " << m_doDCS << endmsg; + if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "m_doTrack " << m_doTrack << endmsg; + + // Book histograms + if (m_doLumiBlock) { + if (m_doRDO) { + if (bookHitsLumiBlockMon().isFailure()) { + if (msgLvl(MSG::INFO)) msg(MSG::INFO) << "Could not book lowStat histograms" << endmsg; } - if(m_doRODError){ - if (BookRODErrorLumiBlockMon().isFailure()) { - if(msgLvl(MSG::INFO)) msg(MSG::INFO) << "Could not book lowStat histograms" << endmsg; - } - if(msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Done booking ROD Error for lowStat" << endmsg; + if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Done booking RDO for lowStat" << endmsg; + } + if (m_doRODError) { + if (bookRODErrorLumiBlockMon().isFailure()) { + if (msgLvl(MSG::INFO)) msg(MSG::INFO) << "Could not book lowStat histograms" << endmsg; } - if(m_doCluster){ - if (BookClustersLumiBlockMon().isFailure()) { - if(msgLvl(MSG::INFO)) msg(MSG::INFO) << "Could not book lowStat histograms" << endmsg; - } - if(msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Done booking Cluster for lowStat" << endmsg; + if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Done booking ROD Error for lowStat" << endmsg; + } + if (m_doCluster) { + if (bookClustersLumiBlockMon().isFailure()) { + if (msgLvl(MSG::INFO)) msg(MSG::INFO) << "Could not book lowStat histograms" << endmsg; } - if(m_doStatus){ - if (BookStatusLumiBlockMon().isFailure()) { - if(msgLvl(MSG::INFO)) msg(MSG::INFO) << "Could not book lowStat histograms" << endmsg; - } - if(msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Done booking Status for lowStat" << endmsg; + if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Done booking Cluster for lowStat" << endmsg; + } + if (m_doStatus) { + if (bookStatusLumiBlockMon().isFailure()) { + if (msgLvl(MSG::INFO)) msg(MSG::INFO) << "Could not book lowStat histograms" << endmsg; } - } - - if( m_doRDO ){ // only RAWtoESD - /// - /// Mu vs LB (BCID) - /// - std::string path_hits = "Pixel/Hits"; - if(m_doOnTrack) path_hits.replace(path_hits.begin(), path_hits.end(), "Pixel/HitsOnTrack"); - MonGroup hitsHistos( this, path_hits.c_str(), run, ATTRIB_MANAGED ); //declare a group of histograms - StatusCode sc; - sc = hitsHistos.regHist(m_mu_vs_bcid = TProfile_LW::create("Interactions_vs_bcid", "<Interactions> vs BCID;BCID;<#Interactions/event>" , m_bcidRange,-0.5,-0.5+(1.0*m_bcidRange))); - sc = hitsHistos.regHist(m_mu_vs_lumi = TProfile_LW::create("Interactions_vs_lumi", "<Interactions> vs LB;lumi block;<#Interactions/event>", m_lbRange,-0.5,-0.5+(1.0*m_lbRange))); - sc = hitsHistos.regHist(m_events_per_lumi = TH1F_LW::create("Events_per_lumi", "nEvents vs LB;lumi block;#events", m_lbRange,-0.5,-0.5+(1.0*m_lbRange))); - /// - /// Storegate errors - /// - std::string path = "Pixel/Errors"; - if(m_doOnTrack) path.replace(path.begin(), path.end(), "Pixel/ErrorsOnTrack"); - MonGroup errorHistos( this, path.c_str(), run, ATTRIB_MANAGED ); //declare a group of histograms - sc = errorHistos.regHist(m_storegate_errors = TH2F_LW::create("storegate_errors", ("Storegate Errors" + m_histTitleExt + ";Container Name;Error Type").c_str(), 6,0.5,6.5,5,0.5,5.5)); - if (sc.isFailure()) if(msgLvl(MSG::INFO)) msg(MSG::INFO) << "Could not book histograms" << endmsg; - - /// - ///Set lables and style for error histogram - /// - m_storegate_errors->SetOption("colz"); - const char *xlabel[6] = { "RDOs", "SpacePoints", "Clusters", "Tracks", "RODErrors", "DCS" }; - for (int i=0; i<6; i++){ - if(m_storegate_errors) m_storegate_errors->GetXaxis()->SetBinLabel( i+1, xlabel[i] ); // bin 0 is underflow - } - const char *ylabel[5] = { "Not flagged", "Container not found", "Can't retrieve container", "Container empty", "Data is bad"}; - for (int i=0; i<5; i++){ - if(m_storegate_errors) m_storegate_errors->GetYaxis()->SetBinLabel( i+1, ylabel[i] ); // bin 0 is underflow - } - } - - /// - /// Initialize histograms - /// - if(m_doTrack) - { - if (BookTrackMon().isFailure()) { - if(msgLvl(MSG::INFO)) msg(MSG::INFO) << "Could not book histograms" << endmsg; - } - if(msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Done booking Track" << endmsg; - } - if(m_doRDO) - { - if (BookHitsMon().isFailure()) { - if(msgLvl(MSG::INFO)) msg(MSG::INFO) << "Could not book histograms" << endmsg; - } - if(msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Done booking RDO" << endmsg; - } - if(m_doRODError) - { - if (BookRODErrorMon().isFailure()) { - if(msgLvl(MSG::INFO)) msg(MSG::INFO) << "Could not book histograms" << endmsg; - } - if(msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Done booking ROD Error" << endmsg; - } - if(m_doSpacePoint) - { - if (BookSpacePointMon().isFailure()) { - if(msgLvl(MSG::INFO)) msg(MSG::INFO) << "Could not book histograms" << endmsg; - } - if(msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Done booking SP" << endmsg; - } - if(m_doCluster) - { - if (BookClustersMon().isFailure()) { - if(msgLvl(MSG::INFO)) msg(MSG::INFO) << "Could not book histograms" << endmsg; - } - if(msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Done booking Cluster" << endmsg; - } - if(m_doStatus) - { - if (BookStatusMon().isFailure()) { - if(msgLvl(MSG::INFO)) msg(MSG::INFO) << "Could not book histograms" << endmsg; - } - if(msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Done booking Status" << endmsg; - } - if(m_doDCS) - { - if (BookPixelDCSMon().isFailure()) { - if(msgLvl(MSG::INFO)) msg(MSG::INFO) << "Could not book histograms" << endmsg; - } - if(msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Done booking DCS" << endmsg; - } - - return StatusCode::SUCCESS; + if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Done booking Status for lowStat" << endmsg; + } + } + + if (m_doRDO) { + std::string path_hits = "Pixel/Hits"; + if (m_doOnTrack) path_hits.replace(path_hits.begin(), path_hits.end(), "Pixel/HitsOnTrack"); + MonGroup hitsHistos(this, path_hits.c_str(), run, ATTRIB_MANAGED); // declare a group of histograms + StatusCode sc; + sc = hitsHistos.regHist(m_mu_vs_bcid = TProfile_LW::create("Interactions_vs_bcid", "<Interactions> vs BCID;BCID;<#Interactions/event>", m_bcidRange, -0.5, -0.5 + (1.0 * m_bcidRange))); + sc = hitsHistos.regHist(m_mu_vs_lumi = TProfile_LW::create("Interactions_vs_lumi", "<Interactions> vs LB;lumi block;<#Interactions/event>", m_lbRange, -0.5, -0.5 + (1.0 * m_lbRange))); + sc = hitsHistos.regHist(m_events_per_lumi = TH1F_LW::create("Events_per_lumi", "nEvents vs LB;lumi block;#events", m_lbRange, -0.5, -0.5 + (1.0 * m_lbRange))); + + std::string path = "Pixel/Errors"; + if (m_doOnTrack) path.replace(path.begin(), path.end(), "Pixel/ErrorsOnTrack"); + MonGroup errorHistos(this, path.c_str(), run, ATTRIB_MANAGED); //declare a group of histograms + sc = errorHistos.regHist(m_storegate_errors = TH2F_LW::create("storegate_errors", ("Storegate Errors" + m_histTitleExt + ";Container Name;Error Type").c_str(), 6, 0.5, 6.5, 5, 0.5, 5.5)); + if (sc.isFailure()) { + if (msgLvl(MSG::INFO)) msg(MSG::INFO) << "Could not book histograms" << endmsg; + } + + m_storegate_errors->SetOption("colz"); + const char* xlabel[6] = {"RDOs", "SpacePoints", "Clusters", "Tracks", "RODErrors", "DCS"}; + for (int i = 0; i < 6; i++) { + if (m_storegate_errors) m_storegate_errors->GetXaxis()->SetBinLabel(i + 1, xlabel[i]); // bin 0 is underflow + } + const char* ylabel[5] = {"Not flagged", "Container not found", "Can't retrieve container", "Container empty", "Data is bad"}; + for (int i = 0; i < 5; i++) { + if (m_storegate_errors) m_storegate_errors->GetYaxis()->SetBinLabel(i + 1, ylabel[i]); // bin 0 is underflow + } + } + + // Initialize histograms + if (m_doTrack) { + if (bookTrackMon().isFailure()) { + if (msgLvl(MSG::INFO)) msg(MSG::INFO) << "Could not book histograms" << endmsg; + } + if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Done booking Track" << endmsg; + } + if (m_doRDO) { + if (bookHitsMon().isFailure()) { + if (msgLvl(MSG::INFO)) msg(MSG::INFO) << "Could not book histograms" << endmsg; + } + if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Done booking RDO" << endmsg; + } + if (m_doRODError) { + if (bookRODErrorMon().isFailure()) { + if (msgLvl(MSG::INFO)) msg(MSG::INFO) << "Could not book histograms" << endmsg; + } + if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Done booking ROD Error" << endmsg; + } + if (m_doSpacePoint) { + if (bookSpacePointMon().isFailure()) { + if (msgLvl(MSG::INFO)) msg(MSG::INFO) << "Could not book histograms" << endmsg; + } + if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Done booking SP" << endmsg; + } + if (m_doCluster) { + if (bookClustersMon().isFailure()) { + if (msgLvl(MSG::INFO)) msg(MSG::INFO) << "Could not book histograms" << endmsg; + } + if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Done booking Cluster" << endmsg; + } + if (m_doStatus) { + if (bookStatusMon().isFailure()) { + if (msgLvl(MSG::INFO)) msg(MSG::INFO) << "Could not book histograms" << endmsg; + } + if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Done booking Status" << endmsg; + } + if (m_doDCS) { + if (bookPixelDCSMon().isFailure()) { + if (msgLvl(MSG::INFO)) msg(MSG::INFO) << "Could not book histograms" << endmsg; + } + if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Done booking DCS" << endmsg; + } + + return StatusCode::SUCCESS; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - -StatusCode PixelMainMon::fillHistograms() //get called twice per event -{ - //Get required services, we want to repeat as little as possible in the function calls - // Part 1: Get the messaging service, print where you are - - m_event++; - m_majorityDisabled = false; - - const EventInfo* thisEventInfo; - if(evtStore()->retrieve(thisEventInfo) != StatusCode::SUCCESS) { - if(msgLvl(MSG::WARNING)) msg(MSG::WARNING) << "No EventInfo object found" << endmsg; - }else{ - m_currentTime = thisEventInfo->event_ID()->time_stamp(); - m_currentBCID = thisEventInfo->event_ID()->bunch_crossing_id(); - //msg(MSG::INFO) << "First booking time:" << m_firstBookTime << " Current time: " << m_currentTime << endmsg; - unsigned int currentdiff = (m_currentTime - m_firstBookTime)/100; - unsigned int currentdiff5min = (m_currentTime - m_firstBookTime)/300; - /// for 100 sec - if( currentdiff > m_nRefresh ){ - m_doRefresh = true; - m_nRefresh = currentdiff; - // msg(MSG::INFO) << "m_doRefresh:" << m_doRefresh << " " << m_nRefresh << endmsg; - }else{ - m_doRefresh = false; - } - /// for 5min - if( currentdiff5min > m_nRefresh5min ){ - m_doRefresh5min = true; - m_nRefresh5min = currentdiff5min; - // msg(MSG::INFO) << "m_doRefresh:" << m_doRefresh << " " << m_nRefresh << endmsg; - }else{ - m_doRefresh5min = false; - } +StatusCode PixelMainMon::fillHistograms() { + // Get required services, we want to repeat as little as possible in the function calls + // Part 1: Get the messaging service, print where you are + + m_event++; + m_majorityDisabled = false; + + const EventInfo* thisEventInfo; + if (evtStore()->retrieve(thisEventInfo) != StatusCode::SUCCESS) { + if (msgLvl(MSG::WARNING)) msg(MSG::WARNING) << "No EventInfo object found" << endmsg; + } else { + m_currentTime = thisEventInfo->event_ID()->time_stamp(); + m_currentBCID = thisEventInfo->event_ID()->bunch_crossing_id(); + unsigned int currentdiff = (m_currentTime - m_firstBookTime) / 100; + unsigned int currentdiff5min = (m_currentTime - m_firstBookTime) / 300; + // for 100 sec + if (currentdiff > m_nRefresh) { + m_doRefresh = true; + m_nRefresh = currentdiff; + } else { + m_doRefresh = false; + } + // for 5min + if (currentdiff5min > m_nRefresh5min) { + m_doRefresh5min = true; + m_nRefresh5min = currentdiff5min; + } else { + m_doRefresh5min = false; + } + } - } + PixelID::const_id_iterator idIt = m_pixelid->wafer_begin(); + PixelID::const_id_iterator idItEnd = m_pixelid->wafer_end(); + for (int i = 0; i < PixLayerIBL2D3D::COUNT; i++) { + m_nGood_mod[i] = 0; + m_nActive_mod[i] = 0; + } - 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; + IdentifierHash id_hash = m_pixelid->wafer_hash(WaferID); - for( int i=0; i<PixLayerIBL2D3D::COUNT; i++){ - m_nGood_mod[i] = 0; - m_nActive_mod[i] = 0; - } + int pixlayeribl2d3d = getPixLayerID(m_pixelid->barrel_ec(WaferID), m_pixelid->layer_disk(WaferID), m_doIBL); + if (pixlayeribl2d3d == PixLayer::kIBL) { + pixlayeribl2d3d = getPixLayerIDIBL2D3D(m_pixelid->barrel_ec(WaferID), m_pixelid->layer_disk(WaferID), m_pixelid->eta_module(WaferID), m_doIBL); + } + if (pixlayeribl2d3d == 99) continue; + if (m_pixelCondSummarySvc->isActive(id_hash) == true) { + m_nActive_mod[pixlayeribl2d3d]++; + } + if (m_pixelCondSummarySvc->isActive(id_hash) == true && m_pixelCondSummarySvc->isGood(id_hash) == true) { + m_nGood_mod[pixlayeribl2d3d]++; + } + } + m_nActive_mod[PixLayerIBL2D3D::kIBL] = 2 * m_nActive_mod[PixLayerIBL2D3D::kIBL2D] + m_nActive_mod[PixLayerIBL2D3D::kIBL3D]; + m_nGood_mod[PixLayerIBL2D3D::kIBL] = 2 * m_nGood_mod[PixLayerIBL2D3D::kIBL2D] + m_nGood_mod[PixLayerIBL2D3D::kIBL3D]; + + // event info + if (m_doRDO) { + if (m_mu_vs_bcid) m_mu_vs_bcid->Fill(m_currentBCID, thisEventInfo->actualInteractionsPerCrossing()); + if (m_mu_vs_lumi) m_mu_vs_lumi->Fill(m_manager->lumiBlockNumber(), thisEventInfo->actualInteractionsPerCrossing()); + if (m_events_per_lumi) m_events_per_lumi->Fill(m_manager->lumiBlockNumber()); + } - for (; idIt != idItEnd; ++idIt) - { - Identifier WaferID = *idIt; - IdentifierHash id_hash = m_pixelid->wafer_hash(WaferID); + // pixel info + if (m_doStatus) { + if (fillStatusMon().isFailure()) { + if (msgLvl(MSG::INFO)) msg(MSG::INFO) << "Could not fill histograms" << endmsg; + } + } - int pixlayeribl2d3d = GetPixLayerID(m_pixelid->barrel_ec(WaferID), m_pixelid->layer_disk(WaferID), m_doIBL); - if( pixlayeribl2d3d == PixLayer::kIBL ){ - pixlayeribl2d3d = GetPixLayerIDIBL2D3D(m_pixelid->barrel_ec(WaferID), m_pixelid->layer_disk(WaferID), m_pixelid->eta_module(WaferID), m_doIBL); + // hits + if (m_doRDO) { + if (evtStore()->contains<PixelRDO_Container>(m_Pixel_RDOName)) { + if (fillHitsMon().isFailure()) { + if (msgLvl(MSG::INFO)) { + msg(MSG::INFO) << "Could not fill histograms" << endmsg; + } } - if( pixlayeribl2d3d == 99 ) continue; - if(m_pixelCondSummarySvc->isActive(id_hash) == true){ - m_nActive_mod[pixlayeribl2d3d]++; + } else if (m_storegate_errors) { + m_storegate_errors->Fill(1., 2.); + } + } else { + if (m_storegate_errors) m_storegate_errors->Fill(1., 1.); + } + + if (m_doRODError) { + if (fillRODErrorMon().isFailure()) { + if (msgLvl(MSG::INFO)) { + msg(MSG::INFO) << "Could not fill histograms" << endmsg; } - if(m_pixelCondSummarySvc->isActive(id_hash) == true && m_pixelCondSummarySvc->isGood(id_hash) == true ){ - m_nGood_mod[pixlayeribl2d3d]++; + } + } else { + if (m_storegate_errors) m_storegate_errors->Fill(5., 1.); + } + + // track + if (m_doTrack) { + if (evtStore()->contains<TrackCollection>(m_TracksName)) { + if (fillTrackMon().isFailure()) { + if (msgLvl(MSG::INFO)) msg(MSG::INFO) << "Could not fill histograms" << endmsg; } - } - m_nActive_mod[PixLayerIBL2D3D::kIBL] = 2*m_nActive_mod[PixLayerIBL2D3D::kIBL2D] + m_nActive_mod[PixLayerIBL2D3D::kIBL3D]; - m_nGood_mod[PixLayerIBL2D3D::kIBL] = 2*m_nGood_mod[PixLayerIBL2D3D::kIBL2D] + m_nGood_mod[PixLayerIBL2D3D::kIBL3D]; - - //////////////////////////////////////////////////////////////// - // Fill methods go here - //////////////////////////////////////////////////////////////// - - /// - /// Event Info - /// - if( m_doRDO ){ // only RAWtoESD - if(m_mu_vs_bcid) m_mu_vs_bcid->Fill( m_currentBCID, thisEventInfo->actualInteractionsPerCrossing() ); - if(m_mu_vs_lumi) m_mu_vs_lumi->Fill( m_manager->lumiBlockNumber(), thisEventInfo->actualInteractionsPerCrossing()); - if(m_events_per_lumi) m_events_per_lumi->Fill(m_manager->lumiBlockNumber()); - } - - /// - /// Pixel Info - /// - if(m_doStatus) { //fill status histograms first, to check number of disabled modules - if(FillStatusMon().isFailure()) { - if(msgLvl(MSG::INFO)) msg(MSG::INFO) << "Could not fill histograms" << endmsg; - } - } - - /// Hits - if(m_doRDO){ - if(evtStore()->contains<PixelRDO_Container>(m_Pixel_RDOName) ) { - if (FillHitsMon().isFailure()) { - if(msgLvl(MSG::INFO)) msg(MSG::INFO) << "Could not fill histograms" << endmsg; - } - } - else if(m_storegate_errors) m_storegate_errors->Fill(1.,2.); - }else{ - if(m_storegate_errors) m_storegate_errors->Fill(1.,1.); - } - - //if(m_doRODError&&evtStore()->contains<PixelRODErrorCollection>(m_detector_error_name)) - if(m_doRODError) - { - if (FillRODErrorMon().isFailure()) { - if(msgLvl(MSG::INFO)) msg(MSG::INFO) << "Could not fill histograms" << endmsg; - } - }else{ - if(m_storegate_errors) m_storegate_errors->Fill(5.,1.); - } - - /// Track - if(m_doTrack){ - if(evtStore()->contains< TrackCollection >(m_TracksName)){ - if (FillTrackMon().isFailure()) { - if(msgLvl(MSG::INFO)) msg(MSG::INFO) << "Could not fill histograms" << endmsg; - } - }else if(m_storegate_errors) m_storegate_errors->Fill(4.,2.); - }else{ - if(m_storegate_errors) m_storegate_errors->Fill(4.,1.); - } - - /// Cluster - if(m_doCluster){ - if(evtStore()->contains<InDet::PixelClusterContainer>(m_Pixel_SiClustersName)){ - if (FillClustersMon().isFailure()) { - if(msgLvl(MSG::INFO)) msg(MSG::INFO) << "Could not fill histograms" << endmsg; - } - }else if(m_storegate_errors) m_storegate_errors->Fill(3.,2.); - }else{ - if(m_storegate_errors) m_storegate_errors->Fill(3.,1.); - } - - /// Space Point - if(m_doSpacePoint) - { - if(evtStore()->contains<SpacePointContainer>(m_Pixel_SpacePointsName)){ - if (FillSpacePointMon().isFailure()) { - if(msgLvl(MSG::INFO)) msg(MSG::INFO) << "Could not fill histograms" << endmsg; - } - }else if(m_storegate_errors) m_storegate_errors->Fill(2.,2.); - }else{ - if(m_storegate_errors) m_storegate_errors->Fill(2.,1.); - } + } else if (m_storegate_errors) { + m_storegate_errors->Fill(4., 2.); + } + } else { + if (m_storegate_errors) m_storegate_errors->Fill(4., 1.); + } + // cluster + if (m_doCluster) { + if (evtStore()->contains<InDet::PixelClusterContainer>(m_Pixel_SiClustersName)) { + if (fillClustersMon().isFailure()) { + if (msgLvl(MSG::INFO)) msg(MSG::INFO) << "Could not fill histograms" << endmsg; + } + } else if (m_storegate_errors) { + m_storegate_errors->Fill(3., 2.); + } + } else { + if (m_storegate_errors) m_storegate_errors->Fill(3., 1.); + } - /// DCS - if(m_doDCS){ - if (FillPixelDCSMon().isFailure()) { - if(msgLvl(MSG::INFO)) msg(MSG::INFO) << "Could not fill histograms" << endmsg; - } - }else{ - if(m_storegate_errors)m_storegate_errors->Fill(6.,1.); - } + // space point + if (m_doSpacePoint) { + if (evtStore()->contains<SpacePointContainer>(m_Pixel_SpacePointsName)) { + if (fillSpacePointMon().isFailure()) { + if (msgLvl(MSG::INFO)) msg(MSG::INFO) << "Could not fill histograms" << endmsg; + } + } else if (m_storegate_errors) { + m_storegate_errors->Fill(2., 2.); + } + } else { + if (m_storegate_errors) m_storegate_errors->Fill(2., 1.); + } + // DCS + if (m_doDCS) { + if (fillPixelDCSMon().isFailure()) { + if (msgLvl(MSG::INFO)) msg(MSG::INFO) << "Could not fill histograms" << endmsg; + } + } else { + if (m_storegate_errors) m_storegate_errors->Fill(6., 1.); + } - return StatusCode::SUCCESS; + return StatusCode::SUCCESS; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - -StatusCode PixelMainMon::procHistograms() -{ - - if ( msgLvl(MSG::DEBUG) ) msg(MSG::DEBUG) << "finalize()" << endmsg; +StatusCode PixelMainMon::procHistograms() { + if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "finalize()" << endmsg; + if (endOfLumiBlockFlag()) m_LBendTime = m_currentTime; - if ( endOfLumiBlockFlag() ) - { - m_LBendTime = m_currentTime; - } - - if ( !m_doOnline && endOfRunFlag() ) - { - if (m_doRDO) { - if (ProcHitsMon().isFailure()) { - if(msgLvl(MSG::INFO)) msg(MSG::INFO) << "Could not proc histograms" << endmsg; - } + if (!m_doOnline && endOfRunFlag()) { + if (m_doRDO) { + if (procHitsMon().isFailure()) { + if (msgLvl(MSG::INFO)) msg(MSG::INFO) << "Could not proc histograms" << endmsg; } - if (m_doCluster) { - if (ProcClustersMon().isFailure()) { - if(msgLvl(MSG::INFO)) msg(MSG::INFO) << "Could not proc histograms" << endmsg; - } + } + if (m_doCluster) { + if (procClustersMon().isFailure()) { + if (msgLvl(MSG::INFO)) msg(MSG::INFO) << "Could not proc histograms" << endmsg; } - if (m_doStatus) { - if (ProcStatusMon().isFailure()) { - if(msgLvl(MSG::INFO)) msg(MSG::INFO) << "Could not proc histograms" << endmsg; - } + } + if (m_doStatus) { + if (procStatusMon().isFailure()) { + if (msgLvl(MSG::INFO)) msg(MSG::INFO) << "Could not proc histograms" << endmsg; } - if (m_doDCS) { - if (ProcPixelDCSMon().isFailure()) { - if(msgLvl(MSG::INFO)) msg(MSG::INFO) << "Could not proc histograms" << endmsg; - } + } + if (m_doDCS) { + if (procPixelDCSMon().isFailure()) { + if (msgLvl(MSG::INFO)) msg(MSG::INFO) << "Could not proc histograms" << endmsg; } - if (m_doTrack) { - if (ProcTrackMon().isFailure()) { - if(msgLvl(MSG::INFO)) msg(MSG::INFO) << "Could not proc histograms" << endmsg; - } + } + if (m_doTrack) { + if (procTrackMon().isFailure()) { + if (msgLvl(MSG::INFO)) msg(MSG::INFO) << "Could not proc histograms" << endmsg; } } - + } + return StatusCode::SUCCESS; } - diff --git a/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelMon2DLumiMaps.cxx b/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelMon2DLumiMaps.cxx index d6532d8390d8e9b943e0d491aac5fac89cd45d77..8a8647c197362688d5593817a27abac1746ada05 100644 --- a/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelMon2DLumiMaps.cxx +++ b/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelMon2DLumiMaps.cxx @@ -7,168 +7,166 @@ /////////////////////////////////////////////////////////////////////////////// #include "PixelMonitoring/PixelMon2DLumiMaps.h" -#include "PixelMonitoring/Components.h" -#include "PixelMonitoring/HolderTemplate.h" +#include <string.h> +#include "GaudiKernel/StatusCode.h" #include "InDetIdentifier/PixelID.h" #include "LWHists/TH2F_LW.h" -#include "GaudiKernel/StatusCode.h" -#include <string.h> +#include "PixelMonitoring/Components.h" +#include "PixelMonitoring/HolderTemplate.h" PixelMon2DLumiMaps::PixelMon2DLumiMaps(std::string name, std::string title, std::string zlabel, const PixMon::HistConf& config) - : HolderTemplate<TH2F_LW>(config) { - const int lbRange = 3000; - int num_modules; - if (m_doIBL && PixMon::HasComponent(m_config, PixMon::LayerIBL2D3DDBM::kIBL)) { - num_modules = PixMon::kNumStavesIBL * (PixMon::kNumModulesIBL2D + PixMon::kNumModulesIBL3D); - m_histograms.at(0).reset(TH2F_LW::create((name+"_2D_Map_IBL").c_str(),(title + ", IBL " + " (Map);LB;Module;" + zlabel).c_str(), - lbRange, -0.5, -0.5 + lbRange, - num_modules, -0.5, -0.5 + num_modules)); - } - if (PixMon::HasComponent(m_config, PixMon::LayerIBL2D3DDBM::kB0)) { - num_modules = PixMon::kNumStavesL0 * PixMon::kNumModulesBarrel; - m_histograms.at(3).reset(TH2F_LW::create((name+"_2D_Map_B0").c_str(), (title + ", B0 " + " (Map);LB;Module;" + zlabel).c_str(), - lbRange, -0.5, -0.5 + lbRange, - num_modules, -0.5, -0.5 + num_modules)); - } - if (PixMon::HasComponent(m_config, PixMon::LayerIBL2D3DDBM::kB1)) { - num_modules = PixMon::kNumStavesL1 * PixMon::kNumModulesBarrel; - m_histograms.at(4).reset(TH2F_LW::create((name+"_2D_Map_B1").c_str(), (title + ", B1 " + " (Map);LB;Module;" + zlabel).c_str(), - lbRange, -0.5, -0.5 + lbRange, - num_modules, -0.5, -0.5 + num_modules)); - } - if (PixMon::HasComponent(m_config, PixMon::LayerIBL2D3DDBM::kB2)) { - num_modules = PixMon::kNumStavesL2 * PixMon::kNumModulesBarrel; - m_histograms.at(5).reset(TH2F_LW::create((name+"_2D_Map_B2").c_str(), (title + ", B2 " + " (Map);LB;Module;" + zlabel).c_str(), - lbRange, -0.5, -0.5 + lbRange, - num_modules, -0.5, -0.5 + num_modules)); - } - if (PixMon::HasComponent(m_config, PixMon::LayerIBL2D3DDBM::kECA)) { - num_modules = PixMon::kNumLayersDisk * PixMon::kNumModulesDisk; - m_histograms.at(6).reset(TH2F_LW::create((name+"_2D_Map_ECA" ).c_str(),(title + ", ECA " + " (Map);LB;Module;" + zlabel).c_str(), - lbRange, -0.5, -0.5 + lbRange, - num_modules, -0.5, -0.5 + num_modules)); - } - if (PixMon::HasComponent(m_config, PixMon::LayerIBL2D3DDBM::kECC)) { - num_modules = PixMon::kNumLayersDisk * PixMon::kNumModulesDisk; - m_histograms.at(7).reset(TH2F_LW::create((name+"_2D_Map_ECC" ).c_str(),(title + ", ECC " + " (Map);LB;Module;" + zlabel).c_str(), - lbRange, -0.5, -0.5 + lbRange, - num_modules, -0.5, -0.5 + num_modules)); - } - if (PixMon::HasComponent(m_config, PixMon::LayerIBL2D3DDBM::kDBMA)) { - num_modules = PixMon::kNumLayersDBM * PixMon::kNumModulesDBM; - m_histograms.at(8).reset(TH2F_LW::create((name+"_2D_Map_DBMA").c_str(),(title + ", DBMA " + " (Map);LB;Module;" + zlabel).c_str(), - lbRange, -0.5, -0.5 + lbRange, - num_modules, -0.5, -0.5 + num_modules)); - } - if (PixMon::HasComponent(m_config, PixMon::LayerIBL2D3DDBM::kDBMC)) { - num_modules = PixMon::kNumLayersDBM * PixMon::kNumModulesDBM; - m_histograms.at(9).reset(TH2F_LW::create((name+"_2D_Map_DBMC").c_str(),(title + ", DBMC " + " (Map);LB;Module;" + zlabel).c_str(), - lbRange, -0.5, -0.5 + lbRange, - num_modules, -0.5, -0.5 + num_modules)); - } + : HolderTemplate<TH2F_LW>(config) { + const int lbRange = 3000; + int num_modules; + if (m_doIBL && PixMon::HasComponent(m_config, PixMon::LayerIBL2D3DDBM::kIBL)) { + num_modules = PixMon::kNumStavesIBL * (PixMon::kNumModulesIBL2D + PixMon::kNumModulesIBL3D); + m_histograms.at(0).reset(TH2F_LW::create((name + "_2D_Map_IBL").c_str(), (title + ", IBL " + " (Map);LB;Module;" + zlabel).c_str(), + lbRange, -0.5, -0.5 + lbRange, + num_modules, -0.5, -0.5 + num_modules)); + } + if (PixMon::HasComponent(m_config, PixMon::LayerIBL2D3DDBM::kB0)) { + num_modules = PixMon::kNumStavesL0 * PixMon::kNumModulesBarrel; + m_histograms.at(3).reset(TH2F_LW::create((name + "_2D_Map_B0").c_str(), (title + ", B0 " + " (Map);LB;Module;" + zlabel).c_str(), + lbRange, -0.5, -0.5 + lbRange, + num_modules, -0.5, -0.5 + num_modules)); + } + if (PixMon::HasComponent(m_config, PixMon::LayerIBL2D3DDBM::kB1)) { + num_modules = PixMon::kNumStavesL1 * PixMon::kNumModulesBarrel; + m_histograms.at(4).reset(TH2F_LW::create((name + "_2D_Map_B1").c_str(), (title + ", B1 " + " (Map);LB;Module;" + zlabel).c_str(), + lbRange, -0.5, -0.5 + lbRange, + num_modules, -0.5, -0.5 + num_modules)); + } + if (PixMon::HasComponent(m_config, PixMon::LayerIBL2D3DDBM::kB2)) { + num_modules = PixMon::kNumStavesL2 * PixMon::kNumModulesBarrel; + m_histograms.at(5).reset(TH2F_LW::create((name + "_2D_Map_B2").c_str(), (title + ", B2 " + " (Map);LB;Module;" + zlabel).c_str(), + lbRange, -0.5, -0.5 + lbRange, + num_modules, -0.5, -0.5 + num_modules)); + } + if (PixMon::HasComponent(m_config, PixMon::LayerIBL2D3DDBM::kECA)) { + num_modules = PixMon::kNumLayersDisk * PixMon::kNumModulesDisk; + m_histograms.at(6).reset(TH2F_LW::create((name + "_2D_Map_ECA").c_str(), (title + ", ECA " + " (Map);LB;Module;" + zlabel).c_str(), + lbRange, -0.5, -0.5 + lbRange, + num_modules, -0.5, -0.5 + num_modules)); + } + if (PixMon::HasComponent(m_config, PixMon::LayerIBL2D3DDBM::kECC)) { + num_modules = PixMon::kNumLayersDisk * PixMon::kNumModulesDisk; + m_histograms.at(7).reset(TH2F_LW::create((name + "_2D_Map_ECC").c_str(), (title + ", ECC " + " (Map);LB;Module;" + zlabel).c_str(), + lbRange, -0.5, -0.5 + lbRange, + num_modules, -0.5, -0.5 + num_modules)); + } + if (PixMon::HasComponent(m_config, PixMon::LayerIBL2D3DDBM::kDBMA)) { + num_modules = PixMon::kNumLayersDBM * PixMon::kNumModulesDBM; + m_histograms.at(8).reset(TH2F_LW::create((name + "_2D_Map_DBMA").c_str(), (title + ", DBMA " + " (Map);LB;Module;" + zlabel).c_str(), + lbRange, -0.5, -0.5 + lbRange, + num_modules, -0.5, -0.5 + num_modules)); + } + if (PixMon::HasComponent(m_config, PixMon::LayerIBL2D3DDBM::kDBMC)) { + num_modules = PixMon::kNumLayersDBM * PixMon::kNumModulesDBM; + m_histograms.at(9).reset(TH2F_LW::create((name + "_2D_Map_DBMC").c_str(), (title + ", DBMC " + " (Map);LB;Module;" + zlabel).c_str(), + lbRange, -0.5, -0.5 + lbRange, + num_modules, -0.5, -0.5 + num_modules)); + } - setHistogramPointers(); - formatHist(); + setHistogramPointers(); + formatHist(); } -void PixelMon2DLumiMaps::Fill(double LB,Identifier &id, const PixelID* pixID, float weight) -{ - const int bec = pixID->barrel_ec(id); - const int pm = pixID->phi_module(id); - int ld = pixID->layer_disk(id); +void PixelMon2DLumiMaps::fill(double LB, Identifier& id, const PixelID* pixID, float weight) { + const int bec = pixID->barrel_ec(id); + const int pm = pixID->phi_module(id); + int ld = pixID->layer_disk(id); - if (bec == 2 && A) { - A->Fill(LB, ld * 48 + pm, weight); - } else if (bec == -2 && C) { - C->Fill(LB, ld * 48 + pm, weight); - } else if (bec == 4 && DBMA) { - DBMA->Fill(LB, ld * 4 + pm, weight); - } else if (bec == -4 && DBMC) { - DBMC->Fill(LB, ld * 4 + pm, weight); - } else if (bec == 0) { - if (m_doIBL) ld--; - const int em = pixID->eta_module(id) + 6; - if (ld == 0 && B0) { - B0->Fill(LB, em + 13 * pm, weight); - }else if (ld == 1 && B1) { - B1->Fill(LB, em + 13 * pm, weight); - } else if (ld == 2 && B2) { - B2->Fill(LB, em + 13 * pm, weight); - } else if (ld == -1 && IBL) { - IBL->Fill(LB, em + 4 + 20 * pm, weight); - } - } + if (bec == 2 && A) { + A->Fill(LB, ld * 48 + pm, weight); + } else if (bec == -2 && C) { + C->Fill(LB, ld * 48 + pm, weight); + } else if (bec == 4 && DBMA) { + DBMA->Fill(LB, ld * 4 + pm, weight); + } else if (bec == -4 && DBMC) { + DBMC->Fill(LB, ld * 4 + pm, weight); + } else if (bec == 0) { + if (m_doIBL) ld--; + const int em = pixID->eta_module(id) + 6; + if (ld == 0 && B0) { + B0->Fill(LB, em + 13 * pm, weight); + } else if (ld == 1 && B1) { + B1->Fill(LB, em + 13 * pm, weight); + } else if (ld == 2 && B2) { + B2->Fill(LB, em + 13 * pm, weight); + } else if (ld == -1 && IBL) { + IBL->Fill(LB, em + 4 + 20 * pm, weight); + } + } } -void PixelMon2DLumiMaps::formatHist() -{ - std::string label; - unsigned int count = 1; - if (A && C) { - for (unsigned int j = 0; j < PixMon::kNumLayersDisk; ++j) { - for (unsigned int i = 0; i < PixMon::kNumModulesDisk; ++i) { - label = PixMon::LayersDisk.at(j) + "A_" + PixMon::ModulesECA.at(i); - A->GetYaxis()->SetBinLabel(count, label.c_str()); - label = PixMon::LayersDisk.at(j) + "C_" + PixMon::ModulesECC.at(i); - C->GetYaxis()->SetBinLabel(count, label.c_str()); - count++; - } +void PixelMon2DLumiMaps::formatHist() { + std::string label; + unsigned int count = 1; + if (A && C) { + for (unsigned int j = 0; j < PixMon::kNumLayersDisk; ++j) { + for (unsigned int i = 0; i < PixMon::kNumModulesDisk; ++i) { + label = PixMon::LayersDisk.at(j) + "A_" + PixMon::ModulesECA.at(i); + A->GetYaxis()->SetBinLabel(count, label.c_str()); + label = PixMon::LayersDisk.at(j) + "C_" + PixMon::ModulesECC.at(i); + C->GetYaxis()->SetBinLabel(count, label.c_str()); + count++; } - count = 1; - } - if (DBMA && DBMC) { - for (unsigned int j = 0; j < PixMon::kNumLayersDBM; ++j) { - for (unsigned int i = 0; i < PixMon::kNumModulesDBM; ++i) { - label = PixMon::LayersDBM.at(j) + "A_" + PixMon::ModulesDBM.at(i); - DBMA->GetYaxis()->SetBinLabel(count, label.c_str()); - label = PixMon::LayersDBM.at(j) + "C_" + PixMon::ModulesDBM.at(i); - DBMC->GetYaxis()->SetBinLabel(count, label.c_str()); - count++; - } + } + count = 1; + } + if (DBMA && DBMC) { + for (unsigned int j = 0; j < PixMon::kNumLayersDBM; ++j) { + for (unsigned int i = 0; i < PixMon::kNumModulesDBM; ++i) { + label = PixMon::LayersDBM.at(j) + "A_" + PixMon::ModulesDBM.at(i); + DBMA->GetYaxis()->SetBinLabel(count, label.c_str()); + label = PixMon::LayersDBM.at(j) + "C_" + PixMon::ModulesDBM.at(i); + DBMC->GetYaxis()->SetBinLabel(count, label.c_str()); + count++; } - count = 1; - } - if (B0 && B1 && B2) { - for (unsigned int i = 0; i < PixMon::kNumStavesL0; ++i) { - for (unsigned int j = 0; j < PixMon::kNumModulesBarrel; ++j) { - label = "L0_" + PixMon::StavesL0.at(i) + "_" + PixMon::ModulesBarrel.at(j); - B0->GetYaxis()->SetBinLabel(count, label.c_str()); - count++; - } + } + count = 1; + } + if (B0 && B1 && B2) { + for (unsigned int i = 0; i < PixMon::kNumStavesL0; ++i) { + for (unsigned int j = 0; j < PixMon::kNumModulesBarrel; ++j) { + label = "L0_" + PixMon::StavesL0.at(i) + "_" + PixMon::ModulesBarrel.at(j); + B0->GetYaxis()->SetBinLabel(count, label.c_str()); + count++; } - count = 1; - for (unsigned int i = 0; i < PixMon::kNumStavesL1; ++i) { - for (unsigned int j = 0; j < PixMon::kNumModulesBarrel; ++j) { - label = "L1_" + PixMon::StavesL1.at(i) + "_" + PixMon::ModulesBarrel.at(j); - B1->GetYaxis()->SetBinLabel(count, label.c_str()); - count++; - } + } + count = 1; + for (unsigned int i = 0; i < PixMon::kNumStavesL1; ++i) { + for (unsigned int j = 0; j < PixMon::kNumModulesBarrel; ++j) { + label = "L1_" + PixMon::StavesL1.at(i) + "_" + PixMon::ModulesBarrel.at(j); + B1->GetYaxis()->SetBinLabel(count, label.c_str()); + count++; } - count = 1; - for (unsigned int i = 0; i < PixMon::kNumStavesL2; ++i) { - for (unsigned int j = 0; j < PixMon::kNumModulesBarrel; ++j) { - label = "L2_" + PixMon::StavesL2.at(i) + "_" + PixMon::ModulesBarrel.at(j); - B2->GetYaxis()->SetBinLabel(count, label.c_str()); - count++; - } + } + count = 1; + for (unsigned int i = 0; i < PixMon::kNumStavesL2; ++i) { + for (unsigned int j = 0; j < PixMon::kNumModulesBarrel; ++j) { + label = "L2_" + PixMon::StavesL2.at(i) + "_" + PixMon::ModulesBarrel.at(j); + B2->GetYaxis()->SetBinLabel(count, label.c_str()); + count++; } - count = 1; - } + } + count = 1; + } - if (IBL) { - for (unsigned int i = 0; i < PixMon::kNumStavesIBL; ++i) { - for (unsigned int j = 0; j < PixMon::kNumModulesIBL; ++j) { - label = "IBL_" + PixMon::StavesIBL.at(i) + "_" + PixMon::ModulesIBL.at(j); - IBL->GetYaxis()->SetBinLabel(count, label.c_str()); - count++; - } + if (IBL) { + for (unsigned int i = 0; i < PixMon::kNumStavesIBL; ++i) { + for (unsigned int j = 0; j < PixMon::kNumModulesIBL; ++j) { + label = "IBL_" + PixMon::StavesIBL.at(i) + "_" + PixMon::ModulesIBL.at(j); + IBL->GetYaxis()->SetBinLabel(count, label.c_str()); + count++; } - } + } + } - for (auto& hist : m_histograms) { - if (!hist) continue; - hist->GetYaxis()->SetLabelSize(0.04); - hist->SetOption("colz"); - hist->SetMinimum(0.); - } + for (auto& hist : m_histograms) { + if (!hist) continue; + hist->GetYaxis()->SetLabelSize(0.04); + hist->SetOption("colz"); + hist->SetMinimum(0.); + } } diff --git a/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelMon2DLumiProfiles.cxx b/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelMon2DLumiProfiles.cxx index dd36db2dedd001e72794495052dd9101629507d8..0e445c0b918e1f3dc12887cb4da47cac9223a184 100644 --- a/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelMon2DLumiProfiles.cxx +++ b/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelMon2DLumiProfiles.cxx @@ -6,170 +6,168 @@ // Function to handle 2D maps of modules, one for each region /////////////////////////////////////////////////////////////////////////////// -#include "PixelMonitoring/Components.h" #include "PixelMonitoring/PixelMon2DLumiProfiles.h" +#include <string.h> +#include "GaudiKernel/StatusCode.h" #include "InDetIdentifier/PixelID.h" #include "LWHists/TProfile2D_LW.h" -#include "GaudiKernel/StatusCode.h" -#include <string.h> +#include "PixelMonitoring/Components.h" -PixelMon2DLumiProfiles::PixelMon2DLumiProfiles(std::string name, std::string title, std::string zlabel, const PixMon::HistConf& config) : HolderTemplate<TProfile2D_LW>(config) { - const int lbRange = 3000; - int num_modules; - if (m_doIBL && PixMon::HasComponent(m_config, PixMon::LayerIBL2D3DDBM::kIBL)) { - num_modules = PixMon::kNumStavesIBL * (PixMon::kNumModulesIBL2D + PixMon::kNumModulesIBL3D); - m_histograms.at(0).reset(TProfile2D_LW::create((name+"_2D_Profile_IBL").c_str(), (title + ", IBL " + title + " (Profile);LB;Module;" + zlabel).c_str(), - lbRange, -0.5, -0.5 + lbRange, - num_modules, -0.5, -0.5 + num_modules)); - } - if (m_doIBL && PixMon::HasComponent(m_config, PixMon::LayerIBL2D3DDBM::kB0)) { - num_modules = PixMon::kNumStavesL0 * PixMon::kNumModulesBarrel; - m_histograms.at(3).reset(TProfile2D_LW::create((name+"_2D_Profile_B0").c_str(), (title + ", B0 " + title + " (Profile);LB;Module;" + zlabel).c_str(), - lbRange, -0.5, -0.5 + lbRange, - num_modules, -0.5, -0.5 + num_modules)); - } - if (m_doIBL && PixMon::HasComponent(m_config, PixMon::LayerIBL2D3DDBM::kB1)) { - num_modules = PixMon::kNumStavesL1 * PixMon::kNumModulesBarrel; - m_histograms.at(4).reset(TProfile2D_LW::create((name+"_2D_Profile_B1").c_str(), (title + ", B1 " + title + " (Profile);LB;Module;" + zlabel).c_str(), - lbRange, -0.5, -0.5 + lbRange, - num_modules, -0.5, -0.5 + num_modules)); - } - if (m_doIBL && PixMon::HasComponent(m_config, PixMon::LayerIBL2D3DDBM::kB2)) { - num_modules = PixMon::kNumStavesL2 * PixMon::kNumModulesBarrel;; - m_histograms.at(5).reset(TProfile2D_LW::create((name+"_2D_Profile_B2").c_str(), (title + ", B2 " + title + " (Profile);LB;Module;" + zlabel).c_str(), - lbRange, -0.5, -0.5 + lbRange, - num_modules, -0.5, -0.5 + num_modules)); - } - if (m_doIBL && PixMon::HasComponent(m_config, PixMon::LayerIBL2D3DDBM::kECA)) { - num_modules = PixMon::kNumLayersDisk * PixMon::kNumModulesDisk; - m_histograms.at(6).reset(TProfile2D_LW::create((name+"_2D_Profile_ECA" ).c_str(),(title + ", ECA " + title + " (Profile);LB;Module;" + zlabel).c_str(), - lbRange, -0.5, -0.5 + lbRange, - num_modules, -0.5, -0.5 + num_modules)); - } - if (m_doIBL && PixMon::HasComponent(m_config, PixMon::LayerIBL2D3DDBM::kECC)) { - num_modules = PixMon::kNumLayersDisk * PixMon::kNumModulesDisk; - m_histograms.at(7).reset(TProfile2D_LW::create((name+"_2D_Profile_ECC" ).c_str(),(title + ", ECC " + title + " (Profile);LB;Module;" + zlabel).c_str(), - lbRange, -0.5, -0.5 + lbRange, - num_modules, -0.5, -0.5 + num_modules)); - } - if (PixMon::HasComponent(m_config, PixMon::LayerIBL2D3DDBM::kDBMA)) { - num_modules = PixMon::kNumLayersDBM * PixMon::kNumModulesDBM; - m_histograms.at(8).reset(TProfile2D_LW::create((name+"_2D_Profile_DBMA" ).c_str(),(title + ", DBMA " + title + " (Profile);LB;Module;" + zlabel).c_str(), - lbRange, -0.5, -0.5 + lbRange, - num_modules, -0.5, -0.5 + num_modules)); - } - if (PixMon::HasComponent(m_config, PixMon::LayerIBL2D3DDBM::kDBMC)) { - num_modules = PixMon::kNumLayersDBM * PixMon::kNumModulesDBM; - m_histograms.at(9).reset(TProfile2D_LW::create((name+"_2D_Profile_DBMC" ).c_str(),(title + ", DBMC " + title + " (Profile);LB;Module;" + zlabel).c_str(), - lbRange, -0.5, -0.5 + lbRange, - num_modules, -0.5, -0.5 + num_modules)); - } +PixelMon2DLumiProfiles::PixelMon2DLumiProfiles(std::string name, std::string title, std::string zlabel, const PixMon::HistConf& config) + : HolderTemplate<TProfile2D_LW>(config) { + const int lbRange = 3000; + int num_modules; + if (m_doIBL && PixMon::HasComponent(m_config, PixMon::LayerIBL2D3DDBM::kIBL)) { + num_modules = PixMon::kNumStavesIBL * (PixMon::kNumModulesIBL2D + PixMon::kNumModulesIBL3D); + m_histograms.at(0).reset(TProfile2D_LW::create((name + "_2D_Profile_IBL").c_str(), (title + ", IBL " + title + " (Profile);LB;Module;" + zlabel).c_str(), + lbRange, -0.5, -0.5 + lbRange, + num_modules, -0.5, -0.5 + num_modules)); + } + if (m_doIBL && PixMon::HasComponent(m_config, PixMon::LayerIBL2D3DDBM::kB0)) { + num_modules = PixMon::kNumStavesL0 * PixMon::kNumModulesBarrel; + m_histograms.at(3).reset(TProfile2D_LW::create((name + "_2D_Profile_B0").c_str(), (title + ", B0 " + title + " (Profile);LB;Module;" + zlabel).c_str(), + lbRange, -0.5, -0.5 + lbRange, + num_modules, -0.5, -0.5 + num_modules)); + } + if (m_doIBL && PixMon::HasComponent(m_config, PixMon::LayerIBL2D3DDBM::kB1)) { + num_modules = PixMon::kNumStavesL1 * PixMon::kNumModulesBarrel; + m_histograms.at(4).reset(TProfile2D_LW::create((name + "_2D_Profile_B1").c_str(), (title + ", B1 " + title + " (Profile);LB;Module;" + zlabel).c_str(), + lbRange, -0.5, -0.5 + lbRange, + num_modules, -0.5, -0.5 + num_modules)); + } + if (m_doIBL && PixMon::HasComponent(m_config, PixMon::LayerIBL2D3DDBM::kB2)) { + num_modules = PixMon::kNumStavesL2 * PixMon::kNumModulesBarrel; + m_histograms.at(5).reset(TProfile2D_LW::create((name + "_2D_Profile_B2").c_str(), (title + ", B2 " + title + " (Profile);LB;Module;" + zlabel).c_str(), + lbRange, -0.5, -0.5 + lbRange, + num_modules, -0.5, -0.5 + num_modules)); + } + if (m_doIBL && PixMon::HasComponent(m_config, PixMon::LayerIBL2D3DDBM::kECA)) { + num_modules = PixMon::kNumLayersDisk * PixMon::kNumModulesDisk; + m_histograms.at(6).reset(TProfile2D_LW::create((name + "_2D_Profile_ECA").c_str(), (title + ", ECA " + title + " (Profile);LB;Module;" + zlabel).c_str(), + lbRange, -0.5, -0.5 + lbRange, + num_modules, -0.5, -0.5 + num_modules)); + } + if (m_doIBL && PixMon::HasComponent(m_config, PixMon::LayerIBL2D3DDBM::kECC)) { + num_modules = PixMon::kNumLayersDisk * PixMon::kNumModulesDisk; + m_histograms.at(7).reset(TProfile2D_LW::create((name + "_2D_Profile_ECC").c_str(), (title + ", ECC " + title + " (Profile);LB;Module;" + zlabel).c_str(), + lbRange, -0.5, -0.5 + lbRange, + num_modules, -0.5, -0.5 + num_modules)); + } + if (PixMon::HasComponent(m_config, PixMon::LayerIBL2D3DDBM::kDBMA)) { + num_modules = PixMon::kNumLayersDBM * PixMon::kNumModulesDBM; + m_histograms.at(8).reset(TProfile2D_LW::create((name + "_2D_Profile_DBMA").c_str(), (title + ", DBMA " + title + " (Profile);LB;Module;" + zlabel).c_str(), + lbRange, -0.5, -0.5 + lbRange, + num_modules, -0.5, -0.5 + num_modules)); + } + if (PixMon::HasComponent(m_config, PixMon::LayerIBL2D3DDBM::kDBMC)) { + num_modules = PixMon::kNumLayersDBM * PixMon::kNumModulesDBM; + m_histograms.at(9).reset(TProfile2D_LW::create((name + "_2D_Profile_DBMC").c_str(), (title + ", DBMC " + title + " (Profile);LB;Module;" + zlabel).c_str(), + lbRange, -0.5, -0.5 + lbRange, + num_modules, -0.5, -0.5 + num_modules)); + } - setHistogramPointers(); - formatHist(); + setHistogramPointers(); + formatHist(); } -void PixelMon2DLumiProfiles::Fill(double LB,Identifier &id, const PixelID* pixID, double weight) -{ - const int bec = pixID->barrel_ec(id); - const int pm = pixID->phi_module(id); - int ld = pixID->layer_disk(id); +void PixelMon2DLumiProfiles::fill(double LB, Identifier& id, const PixelID* pixID, double weight) { + const int bec = pixID->barrel_ec(id); + const int pm = pixID->phi_module(id); + int ld = pixID->layer_disk(id); - if (bec == 2 && A) { - A->Fill(LB, ld * 48 + pm, weight); - } else if (bec == -2 && C) { - C->Fill(LB, ld * 48 + pm, weight); - } else if (bec == 4 && DBMA) { - DBMA->Fill(LB, ld * 4 + pm, weight); - } else if (bec == -4 && DBMC) { - DBMC->Fill(LB, ld * 4 + pm, weight); - } else if (bec == 0) { - if (m_doIBL) ld--; - const int em = pixID->eta_module(id) + 6; - if (ld == 0 && B0) { - B0->Fill(LB, em + 13 * pm, weight); - } else if (ld == 1 && B1) { - B1->Fill(LB, em + 13 * pm, weight); - } else if (ld == 2 && B2) { - B2->Fill(LB, em + 13 * pm, weight); - } else if (ld == -1 && IBL) { - IBL->Fill(LB, em + 4 + 20 * pm, weight); - } - } + if (bec == 2 && A) { + A->Fill(LB, ld * 48 + pm, weight); + } else if (bec == -2 && C) { + C->Fill(LB, ld * 48 + pm, weight); + } else if (bec == 4 && DBMA) { + DBMA->Fill(LB, ld * 4 + pm, weight); + } else if (bec == -4 && DBMC) { + DBMC->Fill(LB, ld * 4 + pm, weight); + } else if (bec == 0) { + if (m_doIBL) ld--; + const int em = pixID->eta_module(id) + 6; + if (ld == 0 && B0) { + B0->Fill(LB, em + 13 * pm, weight); + } else if (ld == 1 && B1) { + B1->Fill(LB, em + 13 * pm, weight); + } else if (ld == 2 && B2) { + B2->Fill(LB, em + 13 * pm, weight); + } else if (ld == -1 && IBL) { + IBL->Fill(LB, em + 4 + 20 * pm, weight); + } + } } - -void PixelMon2DLumiProfiles::formatHist() -{ - std::string label; - unsigned int count = 1; - if (A && C) { - for (unsigned int j = 0; j < PixMon::kNumLayersDisk; ++j) { - for (unsigned int i = 0; i < PixMon::kNumModulesDisk; ++i) { - label = PixMon::LayersDisk.at(j) + "A_" + PixMon::ModulesECA.at(i); - A->GetYaxis()->SetBinLabel(count, label.c_str()); - label = PixMon::LayersDisk.at(j) + "C_" + PixMon::ModulesECC.at(i); - C->GetYaxis()->SetBinLabel(count, label.c_str()); - count++; - } +void PixelMon2DLumiProfiles::formatHist() { + std::string label; + unsigned int count = 1; + if (A && C) { + for (unsigned int j = 0; j < PixMon::kNumLayersDisk; ++j) { + for (unsigned int i = 0; i < PixMon::kNumModulesDisk; ++i) { + label = PixMon::LayersDisk.at(j) + "A_" + PixMon::ModulesECA.at(i); + A->GetYaxis()->SetBinLabel(count, label.c_str()); + label = PixMon::LayersDisk.at(j) + "C_" + PixMon::ModulesECC.at(i); + C->GetYaxis()->SetBinLabel(count, label.c_str()); + count++; } - count = 1; - } - if (DBMA && DBMC) { - for (unsigned int j = 0; j < PixMon::kNumLayersDBM; ++j) { - for (unsigned int i = 0; i < PixMon::kNumModulesDBM; ++i) { - label = PixMon::LayersDBM.at(j) + "A_" + PixMon::ModulesDBM.at(i); - DBMA->GetYaxis()->SetBinLabel(count, label.c_str()); - label = PixMon::LayersDBM.at(j) + "C_" + PixMon::ModulesDBM.at(i); - DBMC->GetYaxis()->SetBinLabel(count, label.c_str()); - count++; - } + } + count = 1; + } + if (DBMA && DBMC) { + for (unsigned int j = 0; j < PixMon::kNumLayersDBM; ++j) { + for (unsigned int i = 0; i < PixMon::kNumModulesDBM; ++i) { + label = PixMon::LayersDBM.at(j) + "A_" + PixMon::ModulesDBM.at(i); + DBMA->GetYaxis()->SetBinLabel(count, label.c_str()); + label = PixMon::LayersDBM.at(j) + "C_" + PixMon::ModulesDBM.at(i); + DBMC->GetYaxis()->SetBinLabel(count, label.c_str()); + count++; } - count = 1; - } - if (B0 && B1 && B2) { - for (unsigned int i = 0; i < PixMon::kNumStavesL0; ++i) { - for (unsigned int j = 0; j < PixMon::kNumModulesBarrel; ++j) { - label = "L0_" + PixMon::StavesL0.at(i) + "_" + PixMon::ModulesBarrel.at(j); - B0->GetYaxis()->SetBinLabel(count, label.c_str()); - count++; - } + } + count = 1; + } + if (B0 && B1 && B2) { + for (unsigned int i = 0; i < PixMon::kNumStavesL0; ++i) { + for (unsigned int j = 0; j < PixMon::kNumModulesBarrel; ++j) { + label = "L0_" + PixMon::StavesL0.at(i) + "_" + PixMon::ModulesBarrel.at(j); + B0->GetYaxis()->SetBinLabel(count, label.c_str()); + count++; } - count = 1; - for (unsigned int i = 0; i < PixMon::kNumStavesL1; ++i) { - for (unsigned int j = 0; j < PixMon::kNumModulesBarrel; ++j) { - label = "L1_" + PixMon::StavesL1.at(i) + "_" + PixMon::ModulesBarrel.at(j); - B1->GetYaxis()->SetBinLabel(count, label.c_str()); - count++; - } + } + count = 1; + for (unsigned int i = 0; i < PixMon::kNumStavesL1; ++i) { + for (unsigned int j = 0; j < PixMon::kNumModulesBarrel; ++j) { + label = "L1_" + PixMon::StavesL1.at(i) + "_" + PixMon::ModulesBarrel.at(j); + B1->GetYaxis()->SetBinLabel(count, label.c_str()); + count++; } - count = 1; - for (unsigned int i = 0; i < PixMon::kNumStavesL2; ++i) { - for (unsigned int j = 0; j < PixMon::kNumModulesBarrel; ++j) { - label = "L2_" + PixMon::StavesL2.at(i) + "_" + PixMon::ModulesBarrel.at(j); - B2->GetYaxis()->SetBinLabel(count, label.c_str()); - count++; - } + } + count = 1; + for (unsigned int i = 0; i < PixMon::kNumStavesL2; ++i) { + for (unsigned int j = 0; j < PixMon::kNumModulesBarrel; ++j) { + label = "L2_" + PixMon::StavesL2.at(i) + "_" + PixMon::ModulesBarrel.at(j); + B2->GetYaxis()->SetBinLabel(count, label.c_str()); + count++; } - count = 1; - } - if (IBL) { - for (unsigned int i = 0; i < PixMon::kNumStavesIBL; ++i) { - for (unsigned int j = 0; j < PixMon::kNumModulesIBL; ++j) { - label = "IBL_" + PixMon::StavesIBL.at(i) + "_" + PixMon::ModulesIBL.at(j); - IBL->GetYaxis()->SetBinLabel(count, label.c_str()); - count++; - } + } + count = 1; + } + if (IBL) { + for (unsigned int i = 0; i < PixMon::kNumStavesIBL; ++i) { + for (unsigned int j = 0; j < PixMon::kNumModulesIBL; ++j) { + label = "IBL_" + PixMon::StavesIBL.at(i) + "_" + PixMon::ModulesIBL.at(j); + IBL->GetYaxis()->SetBinLabel(count, label.c_str()); + count++; } - } + } + } - for (auto& hist : m_histograms) { - if (!hist) continue; - if (hist.get() == A || hist.get() == C) { - hist->GetYaxis()->SetLabelSize(0.02); - } else { - hist->GetYaxis()->SetLabelSize(0.03); - } - hist->SetOption("colz"); - } + for (auto& hist : m_histograms) { + if (!hist) continue; + if (hist.get() == A || hist.get() == C) { + hist->GetYaxis()->SetLabelSize(0.02); + } else { + hist->GetYaxis()->SetLabelSize(0.03); + } + hist->SetOption("colz"); + } } diff --git a/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelMon2DMapsLW.cxx b/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelMon2DMapsLW.cxx index 2d1894fa963f762ed8d0ce2c18574828a4b9fdf9..e866cecdac14d82a1ec7d9b08ee52cd1f699df35 100644 --- a/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelMon2DMapsLW.cxx +++ b/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelMon2DMapsLW.cxx @@ -7,199 +7,201 @@ /////////////////////////////////////////////////////////////////////////////// #include "PixelMonitoring/PixelMon2DMapsLW.h" -#include "PixelMonitoring/Components.h" +#include <string.h> +#include "GaudiKernel/StatusCode.h" #include "InDetIdentifier/PixelID.h" #include "LWHists/TH2F_LW.h" -#include "GaudiKernel/StatusCode.h" -#include <string.h> +#include "PixelMonitoring/Components.h" -PixelMon2DMapsLW::PixelMon2DMapsLW(std::string name, std::string title, const PixMon::HistConf& config, bool copy2DFEval) : HolderTemplate<TH2F_LW>(config, copy2DFEval) { - std::string setatext = ";shifted eta index of module"; - std::string etatext = ";eta index of module"; - std::string phitext = ";phi index of module"; - std::string disktext = ";disk number"; - std::string layertext = ";layer number"; +PixelMon2DMapsLW::PixelMon2DMapsLW(std::string name, std::string title, const PixMon::HistConf& config, bool copy2DFEval) + : HolderTemplate<TH2F_LW>(config, copy2DFEval) { + std::string setatext = ";shifted eta index of module"; + std::string etatext = ";eta index of module"; + std::string phitext = ";phi index of module"; + std::string disktext = ";disk number"; + std::string layertext = ";layer number"; - if (m_doIBL && PixMon::HasComponent(m_config, PixMon::LayerIBL2D3DDBM::kIBL)) { - m_histograms.at(0).reset(TH2F_LW::create((name+"_IBL").c_str(), (title + ", IBL " + setatext + phitext).c_str(), - PixMon::kNumModulesIBL, -16.5, -16.5 + PixMon::kNumModulesIBL, - PixMon::kNumStavesIBL, -0.5, -0.5 + PixMon::kNumStavesIBL)); - } - if (m_doIBL && PixMon::HasComponent(m_config, PixMon::LayerIBL2D3DDBM::kIBL2D)) { - m_histograms.at(1).reset(TH2F_LW::create((name+"_IBL2D").c_str(), (title + ", IBL planar modules " + setatext + phitext).c_str(), - PixMon::kNumModulesIBL2D, -6.5, -6.5 + PixMon::kNumModulesIBL2D, - PixMon::kNumStavesIBL, -0.5, -0.5 + PixMon::kNumStavesIBL)); - } - if (m_doIBL && PixMon::HasComponent(m_config, PixMon::LayerIBL2D3DDBM::kIBL3D)) { - m_histograms.at(2).reset(TH2F_LW::create((name+"_IBL3D").c_str(), (title + ", IBL 3D modules " + etatext + phitext).c_str(), - PixMon::kNumModulesIBL3D, -0.5, -0.5 + PixMon::kNumModulesIBL3D, - PixMon::kNumStavesIBL, -0.5, -0.5 + PixMon::kNumStavesIBL)); - } - if (PixMon::HasComponent(m_config, PixMon::LayerIBL2D3DDBM::kB0)) { - m_histograms.at(3).reset(TH2F_LW::create((name+"_B0").c_str(), (title + ", B0 " + etatext + phitext).c_str(), - PixMon::kNumModulesBarrel, -6.5, -6.5 + PixMon::kNumModulesBarrel, - PixMon::kNumStavesL0, -0.5, -0.5 + PixMon::kNumStavesL0)); - } - if (PixMon::HasComponent(m_config, PixMon::LayerIBL2D3DDBM::kB1)) { - m_histograms.at(4).reset(TH2F_LW::create((name+"_B1").c_str(), (title + ", B1 " + etatext + phitext).c_str(), - PixMon::kNumModulesBarrel, -6.5, -6.5 + PixMon::kNumModulesBarrel, - PixMon::kNumStavesL1, -0.5, -0.5 + PixMon::kNumStavesL1)); - } - if (PixMon::HasComponent(m_config, PixMon::LayerIBL2D3DDBM::kB2)) { - m_histograms.at(5).reset(TH2F_LW::create((name+"_B2").c_str(), (title + ", B2 " + etatext + phitext).c_str(), - PixMon::kNumModulesBarrel, -6.5, -6.5 + PixMon::kNumModulesBarrel, - PixMon::kNumStavesL2, -0.5, -0.5 + PixMon::kNumStavesL2)); - } - if (PixMon::HasComponent(m_config, PixMon::LayerIBL2D3DDBM::kECA)) { - m_histograms.at(6).reset(TH2F_LW::create((name+"_ECA" ).c_str(), (title + ", ECA " + disktext + phitext).c_str(), - PixMon::kNumLayersDisk, -0.5, -0.5 + PixMon::kNumLayersDisk, - PixMon::kNumModulesDisk, -0.5, -0.5 + PixMon::kNumModulesDisk)); - } - if (PixMon::HasComponent(m_config, PixMon::LayerIBL2D3DDBM::kECC)) { - m_histograms.at(7).reset(TH2F_LW::create((name+"_ECC" ).c_str(), (title + ", ECC " + disktext + phitext).c_str(), - PixMon::kNumLayersDisk, -0.5, -0.5 + PixMon::kNumLayersDisk, - PixMon::kNumModulesDisk, -0.5, -0.5 + PixMon::kNumModulesDisk)); - } - if (PixMon::HasComponent(m_config, PixMon::LayerIBL2D3DDBM::kDBMA)) { - m_histograms.at(8).reset(TH2F_LW::create((name+"_DBMA" ).c_str(), (title + ", DBMA " + layertext + phitext).c_str(), - PixMon::kNumLayersDBM, -0.5, -0.5 + PixMon::kNumLayersDBM, - PixMon::kNumModulesDBM, -0.5, -0.5 + PixMon::kNumModulesDBM)); - } - if (PixMon::HasComponent(m_config, PixMon::LayerIBL2D3DDBM::kDBMC)) { - m_histograms.at(9).reset(TH2F_LW::create((name+"_DBMC" ).c_str(), (title + ", DBMC " + layertext + phitext).c_str(), - PixMon::kNumLayersDBM, -0.5, -0.5 + PixMon::kNumLayersDBM, - PixMon::kNumModulesDBM, -0.5, -0.5 + PixMon::kNumModulesDBM)); - } + if (m_doIBL && PixMon::HasComponent(m_config, PixMon::LayerIBL2D3DDBM::kIBL)) { + m_histograms.at(0).reset(TH2F_LW::create((name + "_IBL").c_str(), (title + ", IBL " + setatext + phitext).c_str(), + PixMon::kNumModulesIBL, -16.5, -16.5 + PixMon::kNumModulesIBL, + PixMon::kNumStavesIBL, -0.5, -0.5 + PixMon::kNumStavesIBL)); + } + if (m_doIBL && PixMon::HasComponent(m_config, PixMon::LayerIBL2D3DDBM::kIBL2D)) { + m_histograms.at(1).reset(TH2F_LW::create((name + "_IBL2D").c_str(), (title + ", IBL planar modules " + setatext + phitext).c_str(), + PixMon::kNumModulesIBL2D, -6.5, -6.5 + PixMon::kNumModulesIBL2D, + PixMon::kNumStavesIBL, -0.5, -0.5 + PixMon::kNumStavesIBL)); + } + if (m_doIBL && PixMon::HasComponent(m_config, PixMon::LayerIBL2D3DDBM::kIBL3D)) { + m_histograms.at(2).reset(TH2F_LW::create((name + "_IBL3D").c_str(), (title + ", IBL 3D modules " + etatext + phitext).c_str(), + PixMon::kNumModulesIBL3D, -0.5, -0.5 + PixMon::kNumModulesIBL3D, + PixMon::kNumStavesIBL, -0.5, -0.5 + PixMon::kNumStavesIBL)); + } + if (PixMon::HasComponent(m_config, PixMon::LayerIBL2D3DDBM::kB0)) { + m_histograms.at(3).reset(TH2F_LW::create((name + "_B0").c_str(), (title + ", B0 " + etatext + phitext).c_str(), + PixMon::kNumModulesBarrel, -6.5, -6.5 + PixMon::kNumModulesBarrel, + PixMon::kNumStavesL0, -0.5, -0.5 + PixMon::kNumStavesL0)); + } + if (PixMon::HasComponent(m_config, PixMon::LayerIBL2D3DDBM::kB1)) { + m_histograms.at(4).reset(TH2F_LW::create((name + "_B1").c_str(), (title + ", B1 " + etatext + phitext).c_str(), + PixMon::kNumModulesBarrel, -6.5, -6.5 + PixMon::kNumModulesBarrel, + PixMon::kNumStavesL1, -0.5, -0.5 + PixMon::kNumStavesL1)); + } + if (PixMon::HasComponent(m_config, PixMon::LayerIBL2D3DDBM::kB2)) { + m_histograms.at(5).reset(TH2F_LW::create((name + "_B2").c_str(), (title + ", B2 " + etatext + phitext).c_str(), + PixMon::kNumModulesBarrel, -6.5, -6.5 + PixMon::kNumModulesBarrel, + PixMon::kNumStavesL2, -0.5, -0.5 + PixMon::kNumStavesL2)); + } + if (PixMon::HasComponent(m_config, PixMon::LayerIBL2D3DDBM::kECA)) { + m_histograms.at(6).reset(TH2F_LW::create((name + "_ECA").c_str(), (title + ", ECA " + disktext + phitext).c_str(), + PixMon::kNumLayersDisk, -0.5, -0.5 + PixMon::kNumLayersDisk, + PixMon::kNumModulesDisk, -0.5, -0.5 + PixMon::kNumModulesDisk)); + } + if (PixMon::HasComponent(m_config, PixMon::LayerIBL2D3DDBM::kECC)) { + m_histograms.at(7).reset(TH2F_LW::create((name + "_ECC").c_str(), (title + ", ECC " + disktext + phitext).c_str(), + PixMon::kNumLayersDisk, -0.5, -0.5 + PixMon::kNumLayersDisk, + PixMon::kNumModulesDisk, -0.5, -0.5 + PixMon::kNumModulesDisk)); + } + if (PixMon::HasComponent(m_config, PixMon::LayerIBL2D3DDBM::kDBMA)) { + m_histograms.at(8).reset(TH2F_LW::create((name + "_DBMA").c_str(), (title + ", DBMA " + layertext + phitext).c_str(), + PixMon::kNumLayersDBM, -0.5, -0.5 + PixMon::kNumLayersDBM, + PixMon::kNumModulesDBM, -0.5, -0.5 + PixMon::kNumModulesDBM)); + } + if (PixMon::HasComponent(m_config, PixMon::LayerIBL2D3DDBM::kDBMC)) { + m_histograms.at(9).reset(TH2F_LW::create((name + "_DBMC").c_str(), (title + ", DBMC " + layertext + phitext).c_str(), + PixMon::kNumLayersDBM, -0.5, -0.5 + PixMon::kNumLayersDBM, + PixMon::kNumModulesDBM, -0.5, -0.5 + PixMon::kNumModulesDBM)); + } - setHistogramPointers(); - formatHist(); + setHistogramPointers(); + formatHist(); } -void PixelMon2DMapsLW::Fill(Identifier &id, const PixelID* pixID, float weight) -{ - const int bec = pixID->barrel_ec(id); - const int pm = pixID->phi_module(id); - int ld = pixID->layer_disk(id); +void PixelMon2DMapsLW::fill(Identifier& id, const PixelID* pixID, float weight) { + const int bec = pixID->barrel_ec(id); + const int pm = pixID->phi_module(id); + int ld = pixID->layer_disk(id); - if (bec == 2 && A) A->Fill(ld, pm, weight); - else if (bec == -2 && C) C->Fill(ld, pm, weight); - else if (bec == 4 && DBMA) DBMA->Fill(ld, pm, weight); - else if (bec == -4 && DBMC) DBMC->Fill(ld, pm, weight); - else if (bec == 0) { - if (m_doIBL) ld--; - const int em = pixID->eta_module(id); - if (ld == 0 && B0) { - B0->Fill(em, pm, weight); - } else if (ld == 1 && B1) { - B1->Fill(em, pm, weight); - } else if (ld == 2 && B2) { - B2->Fill(em, pm, weight); - } else if (ld == -1 && IBL) { - int feid = 0; - int emf = 0; - bool copy = false; - if (em < 6 && em > -7) { - if (pixID->eta_index(id) >= 80) feid = 1; - emf = 2 * em + feid; - if (IBL2D) IBL2D->Fill(em, pm, weight); - copy = true; - } else if (em < -6) { - emf = em - 6; - if (IBL3D) IBL3D->Fill(em + 10, pm, weight); - } else { - emf = em + 6; - if (IBL3D) IBL3D->Fill(em - 2, pm, weight); - } - IBL->Fill(emf, pm, weight); - if (m_copy2DFEval && copy) IBL->Fill(emf + 1, pm, weight); + if (bec == 2 && A) { + A->Fill(ld, pm, weight); + } else if (bec == -2 && C) { + C->Fill(ld, pm, weight); + } else if (bec == 4 && DBMA) { + DBMA->Fill(ld, pm, weight); + } else if (bec == -4 && DBMC) { + DBMC->Fill(ld, pm, weight); + } else if (bec == 0) { + if (m_doIBL) ld--; + const int em = pixID->eta_module(id); + if (ld == 0 && B0) { + B0->Fill(em, pm, weight); + } else if (ld == 1 && B1) { + B1->Fill(em, pm, weight); + } else if (ld == 2 && B2) { + B2->Fill(em, pm, weight); + } else if (ld == -1 && IBL) { + int feid = 0; + int emf = 0; + bool copy = false; + if (em < 6 && em > -7) { + if (pixID->eta_index(id) >= 80) feid = 1; + emf = 2 * em + feid; + if (IBL2D) IBL2D->Fill(em, pm, weight); + copy = true; + } else if (em < -6) { + emf = em - 6; + if (IBL3D) IBL3D->Fill(em + 10, pm, weight); + } else { + emf = em + 6; + if (IBL3D) IBL3D->Fill(em - 2, pm, weight); } - } + IBL->Fill(emf, pm, weight); + if (m_copy2DFEval && copy) IBL->Fill(emf + 1, pm, weight); + } + } } -void PixelMon2DMapsLW::Fill2DMon(PixelMon2DMapsLW* oldmap) -{ - for (unsigned int index = 0; index < m_histograms.size(); ++index) { - auto& hist = m_histograms.at(index); - auto& oldhist = oldmap->m_histograms.at(index); - if (!hist) continue; - if (!oldhist) continue; - for (unsigned int x = 1; x <= hist->GetNbinsX(); ++x) { - for (unsigned int y = 1; y <= hist->GetNbinsY(); ++y) { - const auto content = oldhist->GetBinContent(x, y); - hist->SetBinContent(x, y, content); - oldhist->SetBinContent(x, y, 0); - } - } - } +void PixelMon2DMapsLW::fill2DMon(PixelMon2DMapsLW* oldmap) { + for (unsigned int index = 0; index < m_histograms.size(); ++index) { + auto& hist = m_histograms.at(index); + auto& oldhist = oldmap->m_histograms.at(index); + if (!hist) continue; + if (!oldhist) continue; + for (unsigned int x = 1; x <= hist->GetNbinsX(); ++x) { + for (unsigned int y = 1; y <= hist->GetNbinsY(); ++y) { + const auto content = oldhist->GetBinContent(x, y); + hist->SetBinContent(x, y, content); + oldhist->SetBinContent(x, y, 0); + } + } + } } -void PixelMon2DMapsLW::formatHist() -{ - if (A && C) { - for (unsigned int i = 0; i < PixMon::kNumModulesDisk; ++i) { - A->GetYaxis()->SetBinLabel(i + 1, PixMon::ModulesECA.at(i).c_str()); - C->GetYaxis()->SetBinLabel(i + 1, PixMon::ModulesECC.at(i).c_str()); - } - for (unsigned int i = 0; i < PixMon::kNumLayersDisk; ++i) { - A->GetXaxis()->SetBinLabel(i + 1, PixMon::LayersDisk.at(i).c_str()); - C->GetXaxis()->SetBinLabel(i + 1, PixMon::LayersDisk.at(i).c_str()); - } - } - if (DBMA && DBMC) { - for (unsigned int i = 0; i < PixMon::kNumModulesDBM; ++i) { - DBMA->GetYaxis()->SetBinLabel(i + 1, PixMon::ModulesDBM.at(i).c_str()); - DBMC->GetYaxis()->SetBinLabel(i + 1, PixMon::ModulesDBM.at(i).c_str()); - } - for (unsigned int i = 0; i < PixMon::kNumLayersDBM; ++i) { - DBMA->GetXaxis()->SetBinLabel(i + 1, PixMon::LayersDBM.at(i).c_str()); - DBMC->GetXaxis()->SetBinLabel(i + 1, PixMon::LayersDBM.at(i).c_str()); - } - } - if (B0 && B1 && B2) { - for (unsigned int i = 0; i < PixMon::kNumModulesBarrel; ++i) { - B0->GetXaxis()->SetBinLabel(i + 1, PixMon::ModulesBarrel.at(i).c_str()); - B1->GetXaxis()->SetBinLabel(i + 1, PixMon::ModulesBarrel.at(i).c_str()); - B2->GetXaxis()->SetBinLabel(i + 1, PixMon::ModulesBarrel.at(i).c_str()); - } - for (unsigned int i = 0; i < PixMon::kNumStavesL0; ++i) { - B0->GetYaxis()->SetBinLabel(i + 1, PixMon::StavesL0.at(i).c_str()); - } - for (unsigned int i = 0; i < PixMon::kNumStavesL1; ++i) { - B1->GetYaxis()->SetBinLabel(i + 1, PixMon::StavesL1.at(i).c_str()); - } - for (unsigned int i = 0; i < PixMon::kNumStavesL2; ++i) { - B2->GetYaxis()->SetBinLabel(i + 1, PixMon::StavesL2.at(i).c_str()); - } - } - if (IBL) { - for (unsigned int i = 0; i < PixMon::kNumModulesIBL; ++i) { - IBL->GetXaxis()->SetBinLabel(i + 1, PixMon::ModulesIBL.at(i).c_str()); - } - for (unsigned int i = 0; i < PixMon::kNumStavesIBL; ++i) { - IBL->GetYaxis()->SetBinLabel(i + 1, PixMon::StavesIBL.at(i).c_str()); - } - } - if (IBL2D && IBL3D) { - for (unsigned int i = 0; i < PixMon::kNumModulesIBL2D; ++i){ - IBL2D->GetXaxis()->SetBinLabel(i + 1, PixMon::ModulesIBL2D.at(i).c_str()); - } - for (unsigned int i = 0; i < PixMon::kNumModulesIBL3D; ++i) { - IBL3D->GetXaxis()->SetBinLabel(i + 1, PixMon::ModulesIBL3D.at(i).c_str()); - } - for (unsigned int i = 0; i < PixMon::kNumStavesIBL; ++i) { - IBL2D->GetYaxis()->SetBinLabel(i + 1, PixMon::StavesIBL.at(i).c_str()); - IBL3D->GetYaxis()->SetBinLabel(i + 1, PixMon::StavesIBL.at(i).c_str()); - } - } +void PixelMon2DMapsLW::formatHist() { + if (A && C) { + for (unsigned int i = 0; i < PixMon::kNumModulesDisk; ++i) { + A->GetYaxis()->SetBinLabel(i + 1, PixMon::ModulesECA.at(i).c_str()); + C->GetYaxis()->SetBinLabel(i + 1, PixMon::ModulesECC.at(i).c_str()); + } + for (unsigned int i = 0; i < PixMon::kNumLayersDisk; ++i) { + A->GetXaxis()->SetBinLabel(i + 1, PixMon::LayersDisk.at(i).c_str()); + C->GetXaxis()->SetBinLabel(i + 1, PixMon::LayersDisk.at(i).c_str()); + } + } + if (DBMA && DBMC) { + for (unsigned int i = 0; i < PixMon::kNumModulesDBM; ++i) { + DBMA->GetYaxis()->SetBinLabel(i + 1, PixMon::ModulesDBM.at(i).c_str()); + DBMC->GetYaxis()->SetBinLabel(i + 1, PixMon::ModulesDBM.at(i).c_str()); + } + for (unsigned int i = 0; i < PixMon::kNumLayersDBM; ++i) { + DBMA->GetXaxis()->SetBinLabel(i + 1, PixMon::LayersDBM.at(i).c_str()); + DBMC->GetXaxis()->SetBinLabel(i + 1, PixMon::LayersDBM.at(i).c_str()); + } + } + if (B0 && B1 && B2) { + for (unsigned int i = 0; i < PixMon::kNumModulesBarrel; ++i) { + B0->GetXaxis()->SetBinLabel(i + 1, PixMon::ModulesBarrel.at(i).c_str()); + B1->GetXaxis()->SetBinLabel(i + 1, PixMon::ModulesBarrel.at(i).c_str()); + B2->GetXaxis()->SetBinLabel(i + 1, PixMon::ModulesBarrel.at(i).c_str()); + } + for (unsigned int i = 0; i < PixMon::kNumStavesL0; ++i) { + B0->GetYaxis()->SetBinLabel(i + 1, PixMon::StavesL0.at(i).c_str()); + } + for (unsigned int i = 0; i < PixMon::kNumStavesL1; ++i) { + B1->GetYaxis()->SetBinLabel(i + 1, PixMon::StavesL1.at(i).c_str()); + } + for (unsigned int i = 0; i < PixMon::kNumStavesL2; ++i) { + B2->GetYaxis()->SetBinLabel(i + 1, PixMon::StavesL2.at(i).c_str()); + } + } + if (IBL) { + for (unsigned int i = 0; i < PixMon::kNumModulesIBL; ++i) { + IBL->GetXaxis()->SetBinLabel(i + 1, PixMon::ModulesIBL.at(i).c_str()); + } + for (unsigned int i = 0; i < PixMon::kNumStavesIBL; ++i) { + IBL->GetYaxis()->SetBinLabel(i + 1, PixMon::StavesIBL.at(i).c_str()); + } + } + if (IBL2D && IBL3D) { + for (unsigned int i = 0; i < PixMon::kNumModulesIBL2D; ++i) { + IBL2D->GetXaxis()->SetBinLabel(i + 1, PixMon::ModulesIBL2D.at(i).c_str()); + } + for (unsigned int i = 0; i < PixMon::kNumModulesIBL3D; ++i) { + IBL3D->GetXaxis()->SetBinLabel(i + 1, PixMon::ModulesIBL3D.at(i).c_str()); + } + for (unsigned int i = 0; i < PixMon::kNumStavesIBL; ++i) { + IBL2D->GetYaxis()->SetBinLabel(i + 1, PixMon::StavesIBL.at(i).c_str()); + IBL3D->GetYaxis()->SetBinLabel(i + 1, PixMon::StavesIBL.at(i).c_str()); + } + } - for (auto& hist : m_histograms) { - if (!hist) continue; - if (hist.get() == A || hist.get() == C) { - hist->GetYaxis()->SetLabelSize(0.02); - } else { - hist->GetYaxis()->SetLabelSize(0.03); - } - hist->SetOption("colz"); - hist->SetMinimum(0.); - } + for (auto& hist : m_histograms) { + if (!hist) continue; + if (hist.get() == A || hist.get() == C) { + hist->GetYaxis()->SetLabelSize(0.02); + } else { + hist->GetYaxis()->SetLabelSize(0.03); + } + hist->SetOption("colz"); + hist->SetMinimum(0.); + } } diff --git a/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelMon2DProfilesLW.cxx b/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelMon2DProfilesLW.cxx index f69f52ce03b92ee80c8d07326b332b0252d87f22..9fc9119f20b972066597cdc87c8b9baf8b5997d2 100644 --- a/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelMon2DProfilesLW.cxx +++ b/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelMon2DProfilesLW.cxx @@ -6,243 +6,242 @@ // Function to handle 2D profile histograms of modules, one for each region /////////////////////////////////////////////////////////////////////////////// -#include "PixelMonitoring/PixelMon2DMapsLW.h" #include "PixelMonitoring/PixelMon2DProfilesLW.h" -#include "PixelMonitoring/Components.h" +#include <string.h> +#include "GaudiKernel/StatusCode.h" #include "InDetIdentifier/PixelID.h" #include "LWHists/TH2F_LW.h" #include "LWHists/TProfile2D_LW.h" -#include "GaudiKernel/StatusCode.h" -#include <string.h> +#include "PixelMonitoring/Components.h" +#include "PixelMonitoring/PixelMon2DMapsLW.h" -PixelMon2DProfilesLW::PixelMon2DProfilesLW(std::string name, std::string title, const PixMon::HistConf& config, bool copy2DFEval) : HolderTemplate<TProfile2D_LW>(config, copy2DFEval) { - std::string setatext = ";shifted eta index of module"; - std::string etatext = ";eta index of module"; - std::string phitext = ";phi index of module"; - std::string disktext = ";disk number"; - std::string layertext = ";layer number"; +PixelMon2DProfilesLW::PixelMon2DProfilesLW(std::string name, std::string title, const PixMon::HistConf& config, bool copy2DFEval) + : HolderTemplate<TProfile2D_LW>(config, copy2DFEval) { + std::string setatext = ";shifted eta index of module"; + std::string etatext = ";eta index of module"; + std::string phitext = ";phi index of module"; + std::string disktext = ";disk number"; + std::string layertext = ";layer number"; - if (m_doIBL && PixMon::HasComponent(m_config, PixMon::LayerIBL2D3DDBM::kIBL)) { - m_histograms.at(0).reset(TProfile2D_LW::create((name+"_IBL").c_str(), (title + ", IBL " + setatext + phitext).c_str(), - PixMon::kNumModulesIBL, -16.5, -16.5 + PixMon::kNumModulesIBL, - PixMon::kNumStavesIBL, -0.5, -0.5 + PixMon::kNumStavesIBL)); - } - if (m_doIBL && PixMon::HasComponent(m_config, PixMon::LayerIBL2D3DDBM::kIBL2D) ){ - m_histograms.at(1).reset(TProfile2D_LW::create((name+"_IBL2D").c_str(), (title + ", IBL planar modules " + setatext + phitext).c_str(), - PixMon::kNumModulesIBL2D, -6.5, -6.5 + PixMon::kNumModulesIBL2D, - PixMon::kNumStavesIBL, -0.5, -0.5 + PixMon::kNumStavesIBL)); - } - if (m_doIBL && PixMon::HasComponent(m_config, PixMon::LayerIBL2D3DDBM::kIBL3D)) { - m_histograms.at(2).reset(TProfile2D_LW::create((name+"_IBL3D").c_str(), (title + ", IBL 3D modules " + etatext + phitext).c_str(), - PixMon::kNumModulesIBL3D, -.5, -.5 + PixMon::kNumModulesIBL3D, - PixMon::kNumStavesIBL, -0.5, -0.5 + PixMon::kNumStavesIBL)); - } - if (PixMon::HasComponent(m_config, PixMon::LayerIBL2D3DDBM::kB0)) { - m_histograms.at(3).reset(TProfile2D_LW::create((name+"_B0").c_str(), (title + ", B0 " + etatext + phitext).c_str(), - PixMon::kNumModulesBarrel, -6.5, -6.5 + PixMon::kNumModulesBarrel, - PixMon::kNumStavesL0, -0.5, -0.5 + PixMon::kNumStavesL0)); - } - if (PixMon::HasComponent(m_config, PixMon::LayerIBL2D3DDBM::kB1)) { - m_histograms.at(4).reset(TProfile2D_LW::create((name+"_B1").c_str(), (title + ", B1 " + etatext + phitext).c_str(), - PixMon::kNumModulesBarrel, -6.5, -6.5 + PixMon::kNumModulesBarrel, - PixMon::kNumStavesL1, -0.5, -0.5 + PixMon::kNumStavesL1)); - } - if (PixMon::HasComponent(m_config, PixMon::LayerIBL2D3DDBM::kB2)) { - m_histograms.at(5).reset(TProfile2D_LW::create((name+"_B2").c_str(), (title + ", B2 " + etatext + phitext).c_str(), - PixMon::kNumModulesBarrel, -6.5, -6.5 + PixMon::kNumModulesBarrel, - PixMon::kNumStavesL2, -0.5, -0.5 + PixMon::kNumStavesL2)); - } - if (PixMon::HasComponent(m_config, PixMon::LayerIBL2D3DDBM::kECA)) { - m_histograms.at(6).reset(TProfile2D_LW::create((name+"_ECA" ).c_str(), (title + ", ECA " + disktext + phitext).c_str(), - PixMon::kNumLayersDisk, -0.5, -0.5 + PixMon::kNumLayersDisk, - PixMon::kNumModulesDisk, -0.5, -0.5 + PixMon::kNumModulesDisk)); - } - if (PixMon::HasComponent(m_config, PixMon::LayerIBL2D3DDBM::kECC)) { - m_histograms.at(7).reset(TProfile2D_LW::create((name+"_ECC" ).c_str(), (title + ", ECC " + disktext + phitext).c_str(), - PixMon::kNumLayersDisk, -0.5, -0.5 + PixMon::kNumLayersDisk, - PixMon::kNumModulesDisk, -0.5, -0.5 + PixMon::kNumModulesDisk)); - } - if (PixMon::HasComponent(m_config, PixMon::LayerIBL2D3DDBM::kDBMA)) { - m_histograms.at(8).reset(TProfile2D_LW::create((name+"_DBMA").c_str(), (title + ", DBMA " + layertext + phitext).c_str(), - PixMon::kNumLayersDBM, -0.5, -0.5 + PixMon::kNumLayersDBM, - PixMon::kNumModulesDBM, -0.5, -0.5 + PixMon::kNumModulesDBM)); - } - if (PixMon::HasComponent(m_config, PixMon::LayerIBL2D3DDBM::kDBMC)) { - m_histograms.at(9).reset(TProfile2D_LW::create((name+"_DBMC").c_str(), (title + ", DBMC " + layertext + phitext).c_str(), - PixMon::kNumLayersDBM, -0.5, -0.5 + PixMon::kNumLayersDBM, - PixMon::kNumModulesDBM, -0.5, -0.5 + PixMon::kNumModulesDBM)); - } + if (m_doIBL && PixMon::HasComponent(m_config, PixMon::LayerIBL2D3DDBM::kIBL)) { + m_histograms.at(0).reset(TProfile2D_LW::create((name + "_IBL").c_str(), (title + ", IBL " + setatext + phitext).c_str(), + PixMon::kNumModulesIBL, -16.5, -16.5 + PixMon::kNumModulesIBL, + PixMon::kNumStavesIBL, -0.5, -0.5 + PixMon::kNumStavesIBL)); + } + if (m_doIBL && PixMon::HasComponent(m_config, PixMon::LayerIBL2D3DDBM::kIBL2D)) { + m_histograms.at(1).reset(TProfile2D_LW::create((name + "_IBL2D").c_str(), (title + ", IBL planar modules " + setatext + phitext).c_str(), + PixMon::kNumModulesIBL2D, -6.5, -6.5 + PixMon::kNumModulesIBL2D, + PixMon::kNumStavesIBL, -0.5, -0.5 + PixMon::kNumStavesIBL)); + } + if (m_doIBL && PixMon::HasComponent(m_config, PixMon::LayerIBL2D3DDBM::kIBL3D)) { + m_histograms.at(2).reset(TProfile2D_LW::create((name + "_IBL3D").c_str(), (title + ", IBL 3D modules " + etatext + phitext).c_str(), + PixMon::kNumModulesIBL3D, -.5, -.5 + PixMon::kNumModulesIBL3D, + PixMon::kNumStavesIBL, -0.5, -0.5 + PixMon::kNumStavesIBL)); + } + if (PixMon::HasComponent(m_config, PixMon::LayerIBL2D3DDBM::kB0)) { + m_histograms.at(3).reset(TProfile2D_LW::create((name + "_B0").c_str(), (title + ", B0 " + etatext + phitext).c_str(), + PixMon::kNumModulesBarrel, -6.5, -6.5 + PixMon::kNumModulesBarrel, + PixMon::kNumStavesL0, -0.5, -0.5 + PixMon::kNumStavesL0)); + } + if (PixMon::HasComponent(m_config, PixMon::LayerIBL2D3DDBM::kB1)) { + m_histograms.at(4).reset(TProfile2D_LW::create((name + "_B1").c_str(), (title + ", B1 " + etatext + phitext).c_str(), + PixMon::kNumModulesBarrel, -6.5, -6.5 + PixMon::kNumModulesBarrel, + PixMon::kNumStavesL1, -0.5, -0.5 + PixMon::kNumStavesL1)); + } + if (PixMon::HasComponent(m_config, PixMon::LayerIBL2D3DDBM::kB2)) { + m_histograms.at(5).reset(TProfile2D_LW::create((name + "_B2").c_str(), (title + ", B2 " + etatext + phitext).c_str(), + PixMon::kNumModulesBarrel, -6.5, -6.5 + PixMon::kNumModulesBarrel, + PixMon::kNumStavesL2, -0.5, -0.5 + PixMon::kNumStavesL2)); + } + if (PixMon::HasComponent(m_config, PixMon::LayerIBL2D3DDBM::kECA)) { + m_histograms.at(6).reset(TProfile2D_LW::create((name + "_ECA").c_str(), (title + ", ECA " + disktext + phitext).c_str(), + PixMon::kNumLayersDisk, -0.5, -0.5 + PixMon::kNumLayersDisk, + PixMon::kNumModulesDisk, -0.5, -0.5 + PixMon::kNumModulesDisk)); + } + if (PixMon::HasComponent(m_config, PixMon::LayerIBL2D3DDBM::kECC)) { + m_histograms.at(7).reset(TProfile2D_LW::create((name + "_ECC").c_str(), (title + ", ECC " + disktext + phitext).c_str(), + PixMon::kNumLayersDisk, -0.5, -0.5 + PixMon::kNumLayersDisk, + PixMon::kNumModulesDisk, -0.5, -0.5 + PixMon::kNumModulesDisk)); + } + if (PixMon::HasComponent(m_config, PixMon::LayerIBL2D3DDBM::kDBMA)) { + m_histograms.at(8).reset(TProfile2D_LW::create((name + "_DBMA").c_str(), (title + ", DBMA " + layertext + phitext).c_str(), + PixMon::kNumLayersDBM, -0.5, -0.5 + PixMon::kNumLayersDBM, + PixMon::kNumModulesDBM, -0.5, -0.5 + PixMon::kNumModulesDBM)); + } + if (PixMon::HasComponent(m_config, PixMon::LayerIBL2D3DDBM::kDBMC)) { + m_histograms.at(9).reset(TProfile2D_LW::create((name + "_DBMC").c_str(), (title + ", DBMC " + layertext + phitext).c_str(), + PixMon::kNumLayersDBM, -0.5, -0.5 + PixMon::kNumLayersDBM, + PixMon::kNumModulesDBM, -0.5, -0.5 + PixMon::kNumModulesDBM)); + } - setHistogramPointers(); - formatHist(); + setHistogramPointers(); + formatHist(); } -void PixelMon2DProfilesLW::SetMaxValue(float max) -{ - for (auto& hist : m_histograms) { - if (hist) hist->SetMaximum(max); - } +void PixelMon2DProfilesLW::setMaxValue(float max) { + for (auto& hist : m_histograms) { + if (hist) hist->SetMaximum(max); + } } -void PixelMon2DProfilesLW::Reset() -{ - for (auto& hist : m_histograms) { - if (hist) hist->Reset(); - } +void PixelMon2DProfilesLW::reset() { + for (auto& hist : m_histograms) { + if (hist) hist->Reset(); + } } -void PixelMon2DProfilesLW::Fill(Identifier &id, const PixelID* pixID, float weight) -{ - const int bec = pixID->barrel_ec(id); - const int pm = pixID->phi_module(id); - int ld = pixID->layer_disk(id); +void PixelMon2DProfilesLW::fill(Identifier& id, const PixelID* pixID, float weight) { + const int bec = pixID->barrel_ec(id); + const int pm = pixID->phi_module(id); + int ld = pixID->layer_disk(id); - if (bec == 2 && A) A->Fill(ld, pm, weight); - else if (bec == -2 && C) C->Fill(ld, pm, weight); - else if (bec == 4 && DBMA) DBMA->Fill(ld, pm, weight); - else if (bec == -4 && DBMC) DBMC->Fill(ld, pm, weight); - else if (bec == 0) { - if (m_doIBL) ld--; - const int em = pixID->eta_module(id); - if (ld == 0 && B0) { - B0->Fill(em, pm, weight); - } else if (ld == 1 && B1) { - B1->Fill(em, pm, weight); - } else if (ld == 2 && B2) { - B2->Fill(em, pm, weight); - } else if (ld == -1 && IBL) { - int feid = 0; - int emf = 0; - bool copy = false; - if (em < 6 && em > -7) { - if (pixID->eta_index(id) >= 80) feid = 1; - emf = 2 * em + feid; - if (IBL2D) IBL2D->Fill(em, pm, weight); - copy = true; - } else if (em < -6) { - emf = em - 6; - if (IBL3D) IBL3D->Fill(em + 10, pm, weight); - } else { - emf = em + 6; - if (IBL3D) IBL3D->Fill(em - 2, pm, weight); - } - IBL->Fill(emf, pm, weight); - if (m_copy2DFEval && copy) IBL->Fill(emf + 1, pm, weight); + if (bec == 2 && A) { + A->Fill(ld, pm, weight); + } else if (bec == -2 && C) { + C->Fill(ld, pm, weight); + } else if (bec == 4 && DBMA) { + DBMA->Fill(ld, pm, weight); + } else if (bec == -4 && DBMC) { + DBMC->Fill(ld, pm, weight); + } else if (bec == 0) { + if (m_doIBL) ld--; + const int em = pixID->eta_module(id); + if (ld == 0 && B0) { + B0->Fill(em, pm, weight); + } else if (ld == 1 && B1) { + B1->Fill(em, pm, weight); + } else if (ld == 2 && B2) { + B2->Fill(em, pm, weight); + } else if (ld == -1 && IBL) { + int feid = 0; + int emf = 0; + bool copy = false; + if (em < 6 && em > -7) { + if (pixID->eta_index(id) >= 80) feid = 1; + emf = 2 * em + feid; + if (IBL2D) IBL2D->Fill(em, pm, weight); + copy = true; + } else if (em < -6) { + emf = em - 6; + if (IBL3D) IBL3D->Fill(em + 10, pm, weight); + } else { + emf = em + 6; + if (IBL3D) IBL3D->Fill(em - 2, pm, weight); } - } + IBL->Fill(emf, pm, weight); + if (m_copy2DFEval && copy) IBL->Fill(emf + 1, pm, weight); + } + } } -void PixelMon2DProfilesLW::formatHist() -{ - if (A && C) { - for (unsigned int i = 0; i < PixMon::kNumModulesDisk; ++i) { - A->GetYaxis()->SetBinLabel(i + 1, PixMon::ModulesECA.at(i).c_str()); - C->GetYaxis()->SetBinLabel(i + 1, PixMon::ModulesECC.at(i).c_str()); - } - for (unsigned int i = 0; i < PixMon::kNumLayersDisk; ++i) { - A->GetXaxis()->SetBinLabel(i + 1, PixMon::LayersDisk.at(i).c_str()); - C->GetXaxis()->SetBinLabel(i + 1, PixMon::LayersDisk.at(i).c_str()); - } - } - if (DBMA && DBMC) { - for (unsigned int i = 0; i < PixMon::kNumModulesDBM; ++i) { - DBMA->GetYaxis()->SetBinLabel(i + 1, PixMon::ModulesDBM.at(i).c_str()); - DBMC->GetYaxis()->SetBinLabel(i + 1, PixMon::ModulesDBM.at(i).c_str()); - } - for (unsigned int i = 0; i < PixMon::kNumLayersDBM; ++i) { - DBMA->GetXaxis()->SetBinLabel(i + 1, PixMon::LayersDBM.at(i).c_str()); - DBMC->GetXaxis()->SetBinLabel(i + 1, PixMon::LayersDBM.at(i).c_str()); - } - } - if (B0 && B1 && B2) { - for (unsigned int i = 0; i < PixMon::kNumModulesBarrel; ++i) { - B0->GetXaxis()->SetBinLabel(i + 1, PixMon::ModulesBarrel.at(i).c_str()); - B1->GetXaxis()->SetBinLabel(i + 1, PixMon::ModulesBarrel.at(i).c_str()); - B2->GetXaxis()->SetBinLabel(i + 1, PixMon::ModulesBarrel.at(i).c_str()); - } - for (unsigned int i = 0; i < PixMon::kNumStavesL0; ++i) { - B0->GetYaxis()->SetBinLabel(i + 1, PixMon::StavesL0.at(i).c_str()); - } - for (unsigned int i = 0; i < PixMon::kNumStavesL1; ++i) { - B1->GetYaxis()->SetBinLabel(i + 1, PixMon::StavesL1.at(i).c_str()); - } - for (unsigned int i = 0; i < PixMon::kNumStavesL2; ++i) { - B2->GetYaxis()->SetBinLabel(i + 1, PixMon::StavesL2.at(i).c_str()); - } - } - if (IBL) { - for (unsigned int i = 0; i < PixMon::kNumModulesIBL; ++i) { - IBL->GetXaxis()->SetBinLabel(i + 1, PixMon::ModulesIBL.at(i).c_str()); - } - for (unsigned int i = 0; i < PixMon::kNumStavesIBL; ++i) { - IBL->GetYaxis()->SetBinLabel(i + 1, PixMon::StavesIBL.at(i).c_str()); - } - } - if (IBL2D && IBL3D) { - for (unsigned int i = 0; i < PixMon::kNumModulesIBL2D; ++i) { - IBL2D->GetXaxis()->SetBinLabel(i + 1, PixMon::ModulesIBL2D.at(i).c_str()); - } - for (unsigned int i = 0; i < PixMon::kNumModulesIBL3D; ++i) { - IBL3D->GetXaxis()->SetBinLabel(i + 1, PixMon::ModulesIBL3D.at(i).c_str()); - } - for (unsigned int i = 0; i < PixMon::kNumStavesIBL; ++i) { - IBL2D->GetYaxis()->SetBinLabel(i + 1, PixMon::StavesIBL.at(i).c_str()); - IBL3D->GetYaxis()->SetBinLabel(i + 1, PixMon::StavesIBL.at(i).c_str()); - } - } +void PixelMon2DProfilesLW::formatHist() { + if (A && C) { + for (unsigned int i = 0; i < PixMon::kNumModulesDisk; ++i) { + A->GetYaxis()->SetBinLabel(i + 1, PixMon::ModulesECA.at(i).c_str()); + C->GetYaxis()->SetBinLabel(i + 1, PixMon::ModulesECC.at(i).c_str()); + } + for (unsigned int i = 0; i < PixMon::kNumLayersDisk; ++i) { + A->GetXaxis()->SetBinLabel(i + 1, PixMon::LayersDisk.at(i).c_str()); + C->GetXaxis()->SetBinLabel(i + 1, PixMon::LayersDisk.at(i).c_str()); + } + } + if (DBMA && DBMC) { + for (unsigned int i = 0; i < PixMon::kNumModulesDBM; ++i) { + DBMA->GetYaxis()->SetBinLabel(i + 1, PixMon::ModulesDBM.at(i).c_str()); + DBMC->GetYaxis()->SetBinLabel(i + 1, PixMon::ModulesDBM.at(i).c_str()); + } + for (unsigned int i = 0; i < PixMon::kNumLayersDBM; ++i) { + DBMA->GetXaxis()->SetBinLabel(i + 1, PixMon::LayersDBM.at(i).c_str()); + DBMC->GetXaxis()->SetBinLabel(i + 1, PixMon::LayersDBM.at(i).c_str()); + } + } + if (B0 && B1 && B2) { + for (unsigned int i = 0; i < PixMon::kNumModulesBarrel; ++i) { + B0->GetXaxis()->SetBinLabel(i + 1, PixMon::ModulesBarrel.at(i).c_str()); + B1->GetXaxis()->SetBinLabel(i + 1, PixMon::ModulesBarrel.at(i).c_str()); + B2->GetXaxis()->SetBinLabel(i + 1, PixMon::ModulesBarrel.at(i).c_str()); + } + for (unsigned int i = 0; i < PixMon::kNumStavesL0; ++i) { + B0->GetYaxis()->SetBinLabel(i + 1, PixMon::StavesL0.at(i).c_str()); + } + for (unsigned int i = 0; i < PixMon::kNumStavesL1; ++i) { + B1->GetYaxis()->SetBinLabel(i + 1, PixMon::StavesL1.at(i).c_str()); + } + for (unsigned int i = 0; i < PixMon::kNumStavesL2; ++i) { + B2->GetYaxis()->SetBinLabel(i + 1, PixMon::StavesL2.at(i).c_str()); + } + } + if (IBL) { + for (unsigned int i = 0; i < PixMon::kNumModulesIBL; ++i) { + IBL->GetXaxis()->SetBinLabel(i + 1, PixMon::ModulesIBL.at(i).c_str()); + } + for (unsigned int i = 0; i < PixMon::kNumStavesIBL; ++i) { + IBL->GetYaxis()->SetBinLabel(i + 1, PixMon::StavesIBL.at(i).c_str()); + } + } + if (IBL2D && IBL3D) { + for (unsigned int i = 0; i < PixMon::kNumModulesIBL2D; ++i) { + IBL2D->GetXaxis()->SetBinLabel(i + 1, PixMon::ModulesIBL2D.at(i).c_str()); + } + for (unsigned int i = 0; i < PixMon::kNumModulesIBL3D; ++i) { + IBL3D->GetXaxis()->SetBinLabel(i + 1, PixMon::ModulesIBL3D.at(i).c_str()); + } + for (unsigned int i = 0; i < PixMon::kNumStavesIBL; ++i) { + IBL2D->GetYaxis()->SetBinLabel(i + 1, PixMon::StavesIBL.at(i).c_str()); + IBL3D->GetYaxis()->SetBinLabel(i + 1, PixMon::StavesIBL.at(i).c_str()); + } + } - for (auto& hist : m_histograms) { - if (!hist) continue; - if (hist.get() == A || hist.get() == C) { - hist->GetYaxis()->SetLabelSize(0.02); - } else { - hist->GetYaxis()->SetLabelSize(0.03); - } - hist->SetOption("colz"); - hist->SetMinimum(0.); - } + for (auto& hist : m_histograms) { + if (!hist) continue; + if (hist.get() == A || hist.get() == C) { + hist->GetYaxis()->SetLabelSize(0.02); + } else { + hist->GetYaxis()->SetLabelSize(0.03); + } + hist->SetOption("colz"); + hist->SetMinimum(0.); + } } -void PixelMon2DProfilesLW::Fill2DMon(PixelMon2DProfilesLW* oldmap) -{ - for (unsigned int index = 0; index < m_histograms.size(); ++index) { - auto& hist = m_histograms.at(index); - auto& oldhist = oldmap->m_histograms.at(index); - if (!hist) continue; - if (!oldhist) continue; - for (unsigned int x = 1; x <= hist->GetNbinsX(); ++x) { - for (unsigned int y = 1; y <= hist->GetNbinsY(); ++y) { - const auto content = oldhist->GetBinContent(x, y); - hist->SetBinContent(x, y, content); - oldhist->SetBinContent(x, y, 0); - } - } - } +void PixelMon2DProfilesLW::fill2DMon(PixelMon2DProfilesLW* oldmap) { + for (unsigned int index = 0; index < m_histograms.size(); ++index) { + auto& hist = m_histograms.at(index); + auto& oldhist = oldmap->m_histograms.at(index); + if (!hist) continue; + if (!oldhist) continue; + for (unsigned int x = 1; x <= hist->GetNbinsX(); ++x) { + for (unsigned int y = 1; y <= hist->GetNbinsY(); ++y) { + const auto content = oldhist->GetBinContent(x, y); + hist->SetBinContent(x, y, content); + oldhist->SetBinContent(x, y, 0); + } + } + } } -void PixelMon2DProfilesLW::FillFromMap(PixelMon2DMapsLW* inputmap, bool clear_inputmap) -{ - const float weightIBL = 1.0 / 26880.0; - const float weightPixel = 1.0 / 46080.0; +void PixelMon2DProfilesLW::fillFromMap(PixelMon2DMapsLW* inputmap, bool clear_inputmap) { + const float weightIBL = 1.0 / 26880.0; + const float weightPixel = 1.0 / 46080.0; - for (unsigned int index = 0; index < m_histograms.size(); ++index) { - auto& hist = m_histograms.at(index); - auto& map = inputmap->m_histograms.at(index); - if (!hist) continue; - if (!map) continue; - for (unsigned int x = 1; x <= hist->GetNbinsX(); x++) { - for (unsigned int y = 1; y <= hist->GetNbinsY(); y++) { - auto content = map->GetBinContent(x, y); - if (hist.get() == IBL || hist.get() == IBL3D || hist.get() == DBMA || hist.get() == DBMC) { - content *= weightIBL; - } else if (hist.get() == IBL2D) { - content *= weightIBL * 0.5; - } else { - content *= weightPixel; - } - hist->Fill(map->GetXaxis()->GetBinCenter(x), map->GetYaxis()->GetBinCenter(y), content); - } - } - if (clear_inputmap) map->Reset(); - } + for (unsigned int index = 0; index < m_histograms.size(); ++index) { + auto& hist = m_histograms.at(index); + auto& map = inputmap->m_histograms.at(index); + if (!hist) continue; + if (!map) continue; + for (unsigned int x = 1; x <= hist->GetNbinsX(); x++) { + for (unsigned int y = 1; y <= hist->GetNbinsY(); y++) { + auto content = map->GetBinContent(x, y); + if (hist.get() == IBL || hist.get() == IBL3D || hist.get() == DBMA || hist.get() == DBMC) { + content *= weightIBL; + } else if (hist.get() == IBL2D) { + content *= weightIBL * 0.5; + } else { + content *= weightPixel; + } + hist->Fill(map->GetXaxis()->GetBinCenter(x), map->GetYaxis()->GetBinCenter(y), content); + } + } + if (clear_inputmap) map->Reset(); + } } diff --git a/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelMonModules.cxx b/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelMonModules.cxx index 50db27390ba7138a04f389f51b9f7408a122bbe4..bf8839aa7ac22f3bc681bd4c43fc878bd40bc119 100644 --- a/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelMonModules.cxx +++ b/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelMonModules.cxx @@ -7,396 +7,419 @@ /////////////////////////////////////////////////////////////////////////////// #include "PixelMonitoring/PixelMonModules.h" +#include <string.h> #include "AthenaMonitoring/ManagedMonitorToolBase.h" +#include "GaudiKernel/StatusCode.h" +#include "InDetIdentifier/PixelID.h" #include "LWHists/TH1F_LW.h" #include "LWHists/TProfile_LW.h" -#include "InDetIdentifier/PixelID.h" -#include "GaudiKernel/StatusCode.h" -#include <string.h> -PixelMonModulesProf::PixelMonModulesProf(std::string name, std::string title, int nbins, double* arr) -{ - m_nBins=nbins; - for (int i = 0; i < 1744 + 280 * m_doIBL; i++) { - getHist(i) = TProfile_LW::create((getHistName(i,false)+"_"+name).c_str(), (getHistName(i,false)+" "+title).c_str(), nbins, arr); - } - if (m_doIBL == false) { - for (int i = 1744; i < 2024; i++) { - getHist(i) = nullptr; - } - } - formatHist(""); - m_Dummy = 0; +PixelMonModulesProf::PixelMonModulesProf(std::string name, std::string title, int nbins, double* arr) { + m_nBins = nbins; + for (int i = 0; i < 1744 + 280 * m_doIBL; i++) { + getHist(i) = TProfile_LW::create((getHistName(i, false) + "_" + name).c_str(), + (getHistName(i, false) + " " + title).c_str(), nbins, arr); + } + if (m_doIBL == false) { + for (int i = 1744; i < 2024; i++) { + getHist(i) = nullptr; + } + } + formatHist(""); + m_Dummy = 0; } -PixelMonModulesProf::PixelMonModulesProf(std::string name, std::string title, int nbins, double low, double high) -{ - m_nBins = nbins; - for (int i = 0; i < 1744 + 280 * m_doIBL; i++) { - getHist(i) = TProfile_LW::create((getHistName(i,false)+"_"+name).c_str(), (getHistName(i,false)+" "+title).c_str(), nbins, low, high); - } - if (m_doIBL == false) { - for (int i = 1744; i < 2024; i++) { - getHist(i) = nullptr; - } - } - formatHist(""); - m_Dummy = 0; +PixelMonModulesProf::PixelMonModulesProf(std::string name, std::string title, int nbins, double low, double high) { + m_nBins = nbins; + for (int i = 0; i < 1744 + 280 * m_doIBL; i++) { + getHist(i) = TProfile_LW::create((getHistName(i, false) + "_" + name).c_str(), + (getHistName(i, false) + " " + title).c_str(), nbins, low, high); + } + if (m_doIBL == false) { + for (int i = 1744; i < 2024; i++) { + getHist(i) = nullptr; + } + } + formatHist(""); + m_Dummy = 0; } -PixelMonModules1D::PixelMonModules1D(std::string name, std::string title, int nbins, double* arr) -{ - m_nBins = nbins; - for (int i = 0; i < 1744 + 280 * m_doIBL; i++) { - getHist(i) = new TH1F((getHistName(i,false)+"_"+name).c_str(), (getHistName(i,false)+" "+title).c_str(), nbins, arr); - } - if (m_doIBL == false) { - for (int i = 1744; i < 2024; i++) { - getHist(i) = nullptr; - } - } - formatHist(""); - m_Dummy = 0; +PixelMonModules1D::PixelMonModules1D(std::string name, std::string title, int nbins, double* arr) { + m_nBins = nbins; + for (int i = 0; i < 1744 + 280 * m_doIBL; i++) { + getHist(i) = new TH1F((getHistName(i, false) + "_" + name).c_str(), + (getHistName(i, false) + " " + title).c_str(), nbins, arr); + } + if (m_doIBL == false) { + for (int i = 1744; i < 2024; i++) { + getHist(i) = nullptr; + } + } + formatHist(""); + m_Dummy = 0; } -PixelMonModules1D::PixelMonModules1D(std::string name, std::string title, int nbins, double low, double high) -{ - m_nBins=nbins; - for (int i = 0; i < 1744 + 280 * m_doIBL; i++) { - getHist(i) = new TH1F((getHistName(i,false)+"_"+name).c_str(), (getHistName(i,false)+" "+title).c_str(), nbins, low, high); - } - if (m_doIBL == false) { - for (int i = 1744; i < 2024; i++) { - getHist(i) = nullptr; - } - } - formatHist(""); - m_Dummy = 0; +PixelMonModules1D::PixelMonModules1D(std::string name, std::string title, int nbins, double low, double high) { + m_nBins = nbins; + for (int i = 0; i < 1744 + 280 * m_doIBL; i++) { + getHist(i) = new TH1F((getHistName(i, false) + "_" + name).c_str(), + (getHistName(i, false) + " " + title).c_str(), nbins, low, high); + } + if (m_doIBL == false) { + for (int i = 1744; i < 2024; i++) { + getHist(i) = nullptr; + } + } + formatHist(""); + m_Dummy = 0; } -PixelMonModules2D::PixelMonModules2D(std::string name, std::string title, int nbins0, double low0, double high0, int nbins1, double low1, double high1) -{ - m_nBins = nbins0 * nbins1; - for (int i = 0; i < 1744 + 280 * m_doIBL; i++) { - getHist(i) = new TH2F((getHistName(i,false)+"_"+name).c_str(), (getHistName(i,false)+" "+title).c_str(), nbins0, low0, high0, nbins1, low1, high1); - } - if (m_doIBL == false) { - for (int i = 1744; i < 2024; i++) { - getHist(i) = nullptr; - } - } - formatHist(""); - m_Dummy = 0; +PixelMonModules2D::PixelMonModules2D(std::string name, std::string title, int nbins0, double low0, double high0, int nbins1, double low1, double high1) { + m_nBins = nbins0 * nbins1; + for (int i = 0; i < 1744 + 280 * m_doIBL; i++) { + getHist(i) = new TH2F((getHistName(i, false) + "_" + name).c_str(), + (getHistName(i, false) + " " + title).c_str(), + nbins0, low0, high0, nbins1, low1, high1); + } + if (m_doIBL == false) { + for (int i = 1744; i < 2024; i++) { + getHist(i) = nullptr; + } + } + formatHist(""); + m_Dummy = 0; } -void PixelMonModulesProf::Reset() -{ - for (int i = 0; i < 2024; i++) { - if (getHist(i)) getHist(i)->Reset(); - } +void PixelMonModulesProf::reset() { + for (int i = 0; i < 2024; i++) { + if (getHist(i)) getHist(i)->Reset(); + } } -StatusCode PixelMonModulesProf::regHist(ManagedMonitorToolBase* thisptr, std::string path, ManagedMonitorToolBase::Interval_t Run) -{ - for (int i = 0; i < 1744 + 280 * m_doIBL; i++) { - ManagedMonitorToolBase::MonGroup mgroup(thisptr, (path+"/"+getHistName(i,true)).c_str(),Run); - if (mgroup.regHist(getHist(i)).isFailure()) { - return StatusCode::FAILURE; - } - } - return StatusCode::SUCCESS; +StatusCode PixelMonModulesProf::regHist(ManagedMonitorToolBase* thisptr, std::string path, ManagedMonitorToolBase::Interval_t Run) { + for (int i = 0; i < 1744 + 280 * m_doIBL; i++) { + ManagedMonitorToolBase::MonGroup mgroup(thisptr, (path + "/" + getHistName(i, true)).c_str(), Run); + if (mgroup.regHist(getHist(i)).isFailure()) { + return StatusCode::FAILURE; + } + } + return StatusCode::SUCCESS; } - -void PixelMonModules1D::Reset() -{ - for (int i=0; i < 2024; i++) { - if (getHist(i)) getHist(i)->Reset(); - } +void PixelMonModules1D::reset() { + for (int i = 0; i < 2024; i++) { + if (getHist(i)) getHist(i)->Reset(); + } } -void PixelMonModules2D::Reset() -{ - for (int i = 0; i < 2024; i++) { - if (getHist(i)) getHist(i)->Reset(); - } +void PixelMonModules2D::reset() { + for (int i = 0; i < 2024; i++) { + if (getHist(i)) getHist(i)->Reset(); + } } -void PixelMonModulesProf::Fill(double value0, double value1, Identifier &id, const PixelID* pixID) -{ - const int bec = pixID->barrel_ec(id); - const int pm = pixID->phi_module(id); - int ld = pixID->layer_disk(id); - - if (bec == 2) A[ld][pm]->Fill(value0, value1); - else if (bec == -2) C[ld][pm]->Fill(value0, value1); - else if (bec == 0) { - if (m_doIBL) ld--; - const int em = pixID->eta_module(id); - if (ld == 0) B0[em+6][pm]->Fill(value0, value1); - else if (ld == 1) B1[em+6][pm]->Fill(value0, value1); - else if (ld == 2) B2[em+6][pm]->Fill(value0, value1); - else if (ld == -1) IBL[em+10][pm]->Fill(value0, value1); - } +void PixelMonModulesProf::fill(double value0, double value1, Identifier& id, const PixelID* pixID) { + const int bec = pixID->barrel_ec(id); + const int pm = pixID->phi_module(id); + int ld = pixID->layer_disk(id); + + if (bec == 2) { + A[ld][pm]->Fill(value0, value1); + } else if (bec == -2) { + C[ld][pm]->Fill(value0, value1); + } else if (bec == 0) { + if (m_doIBL) ld--; + const int em = pixID->eta_module(id); + if (ld == 0) { + B0[em + 6][pm]->Fill(value0, value1); + } else if (ld == 1) { + B1[em + 6][pm]->Fill(value0, value1); + } else if (ld == 2) { + B2[em + 6][pm]->Fill(value0, value1); + } else if (ld == -1) { + IBL[em + 10][pm]->Fill(value0, value1); + } + } } -void PixelMonModules2D::Fill(double value0, double value1, Identifier &id, const PixelID* pixID, double weight) -{ - const int bec = pixID->barrel_ec(id); - const int pm = pixID->phi_module(id); - int ld = pixID->layer_disk(id); - - if (bec == 2) A[ld][pm]->Fill(value0, value1, weight); - else if (bec == -2) C[ld][pm]->Fill(value0, value1, weight); - else if (bec == 0) { - if (m_doIBL) ld--; - int em = pixID->eta_module(id); - if (ld == 0) B0[em+6][pm]->Fill(value0, value1, weight); - else if (ld == 1) B1[em+6][pm]->Fill(value0, value1, weight); - else if (ld == 2) B2[em+6][pm]->Fill(value0, value1, weight); - else if (ld == -1) IBL[em+10][pm]->Fill(value0, value1, weight); - } +void PixelMonModules2D::fill(double value0, double value1, Identifier& id, const PixelID* pixID, double weight) { + const int bec = pixID->barrel_ec(id); + const int pm = pixID->phi_module(id); + int ld = pixID->layer_disk(id); + + if (bec == 2) { + A[ld][pm]->Fill(value0, value1, weight); + } else if (bec == -2) { + C[ld][pm]->Fill(value0, value1, weight); + } else if (bec == 0) { + if (m_doIBL) ld--; + int em = pixID->eta_module(id); + if (ld == 0) { + B0[em + 6][pm]->Fill(value0, value1, weight); + } else if (ld == 1) { + B1[em + 6][pm]->Fill(value0, value1, weight); + } else if (ld == 2) { + B2[em + 6][pm]->Fill(value0, value1, weight); + } else if (ld == -1) { + IBL[em + 10][pm]->Fill(value0, value1, weight); + } + } } -double PixelMonModules1D::GetBinContent(double value, Identifier &id, const PixelID* pixID) -{ - const int bec = pixID->barrel_ec(id); - const int pm = pixID->phi_module(id); - int ld = pixID->layer_disk(id); - - if (bec == 2) return A[ld][pm]->GetBinContent(A[ld][pm]->GetXaxis()->FindBin(value)); - else if (bec == -2)return C[ld][pm]->GetBinContent(C[ld][pm]->GetXaxis()->FindBin(value)); - else if (bec == 0) { - const int em = pixID->eta_module(id); - if (ld == 0) return B0[em+6][pm]->GetBinContent(B0[em+6][pm]->GetXaxis()->FindBin(value)); - else if (ld == 1) return B1[em+6][pm]->GetBinContent(B1[em+6][pm]->GetXaxis()->FindBin(value)); - else if (ld == 2) return B2[em+6][pm]->GetBinContent(B2[em+6][pm]->GetXaxis()->FindBin(value)); - else if (ld == -1)return IBL[em+10][pm]->GetBinContent(IBL[em+10][pm]->GetXaxis()->FindBin(value)); - } - return 0.0; +double PixelMonModules1D::getBinContent(double value, Identifier& id, const PixelID* pixID) { + const int bec = pixID->barrel_ec(id); + const int pm = pixID->phi_module(id); + int ld = pixID->layer_disk(id); + + if (bec == 2) { + return A[ld][pm]->GetBinContent(A[ld][pm]->GetXaxis()->FindBin(value)); + } else if (bec == -2) { + return C[ld][pm]->GetBinContent(C[ld][pm]->GetXaxis()->FindBin(value)); + } else if (bec == 0) { + const int em = pixID->eta_module(id); + if (ld == 0) { + return B0[em + 6][pm]->GetBinContent(B0[em + 6][pm]->GetXaxis()->FindBin(value)); + } else if (ld == 1) { + return B1[em + 6][pm]->GetBinContent(B1[em + 6][pm]->GetXaxis()->FindBin(value)); + } else if (ld == 2) { + return B2[em + 6][pm]->GetBinContent(B2[em + 6][pm]->GetXaxis()->FindBin(value)); + } else if (ld == -1) { + return IBL[em + 10][pm]->GetBinContent(IBL[em + 10][pm]->GetXaxis()->FindBin(value)); + } + } + return 0.0; } -void PixelMonModules1D::Fill(double value, Identifier &id, const PixelID* pixID) -{ - const int bec = pixID->barrel_ec(id); - const int pm = pixID->phi_module(id); - int ld = pixID->layer_disk(id); - - if (bec == 2) A[ld][pm]->Fill(value); - else if (bec == -2) C[ld][pm]->Fill(value); - else if (bec == 0) { - if (m_doIBL) ld--; - const int em = pixID->eta_module(id); - if (ld == 0) B0[em+6][pm]->Fill(value); - else if (ld == 1) B1[em+6][pm]->Fill(value); - else if (ld == 2) B2[em+6][pm]->Fill(value); - else if (ld == -1)IBL[em+10][pm]->Fill(value); - } +void PixelMonModules1D::fill(double value, Identifier& id, const PixelID* pixID) { + const int bec = pixID->barrel_ec(id); + const int pm = pixID->phi_module(id); + int ld = pixID->layer_disk(id); + + if (bec == 2) { + A[ld][pm]->Fill(value); + } else if (bec == -2) { + C[ld][pm]->Fill(value); + } else if (bec == 0) { + if (m_doIBL) ld--; + const int em = pixID->eta_module(id); + if (ld == 0) { + B0[em + 6][pm]->Fill(value); + } else if (ld == 1) { + B1[em + 6][pm]->Fill(value); + } else if (ld == 2) { + B2[em + 6][pm]->Fill(value); + } else if (ld == -1) { + IBL[em + 10][pm]->Fill(value); + } + } } -StatusCode PixelMonModules1D::regHist(ManagedMonitorToolBase* thisptr, std::string path, ManagedMonitorToolBase::Interval_t Run) -{ - for (int i = 0; i < 1744 + 280 * m_doIBL; i++) { - ManagedMonitorToolBase::MonGroup mgroup(thisptr, (path+"/"+getHistName(i,true)).c_str(),Run); - if (mgroup.regHist(getHist(i)).isFailure()) { - return StatusCode::FAILURE; - } - } - return StatusCode::SUCCESS; +StatusCode PixelMonModules1D::regHist(ManagedMonitorToolBase* thisptr, std::string path, ManagedMonitorToolBase::Interval_t Run) { + for (int i = 0; i < 1744 + 280 * m_doIBL; i++) { + ManagedMonitorToolBase::MonGroup mgroup(thisptr, (path + "/" + getHistName(i, true)).c_str(), Run); + if (mgroup.regHist(getHist(i)).isFailure()) { + return StatusCode::FAILURE; + } + } + return StatusCode::SUCCESS; } -StatusCode PixelMonModules2D::regHist(ManagedMonitorToolBase* thisptr, std::string path, ManagedMonitorToolBase::Interval_t Run) -{ - for (int i = 0; i < 1744 + 280 * m_doIBL; i++) { - ManagedMonitorToolBase::MonGroup mgroup(thisptr, (path+"/"+getHistName(i,true)).c_str(),Run); - if (mgroup.regHist(getHist(i)).isFailure()) { - return StatusCode::FAILURE; - } - } +StatusCode PixelMonModules2D::regHist(ManagedMonitorToolBase* thisptr, std::string path, ManagedMonitorToolBase::Interval_t Run) { + for (int i = 0; i < 1744 + 280 * m_doIBL; i++) { + ManagedMonitorToolBase::MonGroup mgroup(thisptr, (path + "/" + getHistName(i, true)).c_str(), Run); + if (mgroup.regHist(getHist(i)).isFailure()) { + return StatusCode::FAILURE; + } + } - return StatusCode::SUCCESS; + return StatusCode::SUCCESS; } -void PixelMonModules1D::formatHist(std::string opt) -{ - for (int i = 0; i < 1744 + 280 * m_doIBL; i++) { - if (!opt.compare("status"))getHist(i)->GetXaxis()->SetRangeUser(1., 2.); - getHist(i)->SetMinimum(0); - } +void PixelMonModules1D::formatHist(std::string opt) { + for (int i = 0; i < 1744 + 280 * m_doIBL; i++) { + if (!opt.compare("status")) getHist(i)->GetXaxis()->SetRangeUser(1., 2.); + getHist(i)->SetMinimum(0); + } } -void PixelMonModulesProf::formatHist(std::string /*opt*/) -{ - for (int i = 0; i < 1744 + 280 * m_doIBL; i++) { - getHist(i)->SetMinimum(0); - } +void PixelMonModulesProf::formatHist(std::string /*opt*/) { + for (int i = 0; i < 1744 + 280 * m_doIBL; i++) { + getHist(i)->SetMinimum(0); + } } -void PixelMonModules2D::formatHist(std::string /*opt*/) -{ - for (int i = 0; i < 1744 + 280 * m_doIBL; i++) { - getHist(i)->SetMinimum(0); - getHist(i)->SetOption("colz"); - getHist(i)->SetStats(0.); - } +void PixelMonModules2D::formatHist(std::string /*opt*/) { + for (int i = 0; i < 1744 + 280 * m_doIBL; i++) { + getHist(i)->SetMinimum(0); + getHist(i)->SetOption("colz"); + getHist(i)->SetStats(0.); + } } -void PixelMonModules1D::SetBinLabel(const char* label, int binN) -{ - if (binN > m_nBins) return; - for (int i = 0; i < 2024; i++) { - if (getHist(i)) getHist(i)->GetXaxis()->SetBinLabel(binN,label); - } +void PixelMonModules1D::setBinLabel(const char* label, int binN) { + if (binN > m_nBins) return; + for (int i = 0; i < 2024; i++) { + if (getHist(i)) getHist(i)->GetXaxis()->SetBinLabel(binN, label); + } } -TProfile_LW* &PixelMonModulesProf::getHist(int i) -{ - if (i < 286) return B0[i/22][i%22]; - i -= 286; - if (i < 494) return B1[i/38][i%38]; - i -= 494; - if (i < 676) return B2[i/52][i%52]; - i -= 676; - if (i < 144) return A[i/48][i%48]; - i -= 144; - if (i < 144) return C[i/48][i%48]; - i -= 144; - if (i < 280) return IBL[i/14][i%14]; - return m_Dummy; +TProfile_LW*& PixelMonModulesProf::getHist(int i) { + if (i < 286) return B0[i / 22][i % 22]; + i -= 286; + if (i < 494) return B1[i / 38][i % 38]; + i -= 494; + if (i < 676) return B2[i / 52][i % 52]; + i -= 676; + if (i < 144) return A[i / 48][i % 48]; + i -= 144; + if (i < 144) return C[i / 48][i % 48]; + i -= 144; + if (i < 280) return IBL[i / 14][i % 14]; + return m_Dummy; } -TH1F* &PixelMonModules1D::getHist(int i) -{ - if (i < 286) return B0[i/22][i%22]; - i -= 286; - if (i < 494) return B1[i/38][i%38]; - i -= 494; - if (i < 676) return B2[i/52][i%52]; - i -= 676; - if (i < 144) return A[i/48][i%48]; - i -= 144; - if (i < 144) return C[i/48][i%48]; - i -= 144; - if (i < 280) return IBL[i/14][i%14]; - return m_Dummy; +TH1F*& PixelMonModules1D::getHist(int i) { + if (i < 286) return B0[i / 22][i % 22]; + i -= 286; + if (i < 494) return B1[i / 38][i % 38]; + i -= 494; + if (i < 676) return B2[i / 52][i % 52]; + i -= 676; + if (i < 144) return A[i / 48][i % 48]; + i -= 144; + if (i < 144) return C[i / 48][i % 48]; + i -= 144; + if (i < 280) return IBL[i / 14][i % 14]; + return m_Dummy; } -TH2F* &PixelMonModules2D::getHist(int i) -{ - if (i < 286) return B0[i/22][i%22]; - i -= 286; - if (i < 494) return B1[i/38][i%38]; - i -= 494; - if (i < 676) return B2[i/52][i%52]; - i -= 676; - if (i < 144) return A[i/48][i%48]; - i -= 144; - if (i < 144) return C[i/48][i%48]; - i -= 144; - if (i < 280) return IBL[i/14][i%14]; - return m_Dummy; +TH2F*& PixelMonModules2D::getHist(int i) { + if (i < 286) return B0[i / 22][i % 22]; + i -= 286; + if (i < 494) return B1[i / 38][i % 38]; + i -= 494; + if (i < 676) return B2[i / 52][i % 52]; + i -= 676; + if (i < 144) return A[i / 48][i % 48]; + i -= 144; + if (i < 144) return C[i / 48][i % 48]; + i -= 144; + if (i < 280) return IBL[i / 14][i % 14]; + return m_Dummy; } -std::string PixelMonModules::getHistName(int i, bool forPath) -{ - const int ndisk = 3; - const int nphi = 48; - const int nmod = 13; - const int nmodIBL = 20; - const int nstaveb = 14; - const int nstave0 = 22; - const int nstave1 = 38; - const int nstave2 = 52; - std::string diskA[ndisk] = { "D1A", "D2A", "D3A" }; - std::string diskC[ndisk] = { "D1C", "D2C", "D3C" }; - std::string barrel[3] = {"L0" , "L1" , "L2" }; - std::string newbarrel[4] = {"LI", "L0" , "L1" , "L2" }; - if (forPath) - { - diskA[0].replace(diskA[0].begin(), diskA[0].end(), "ECA/Disk1"); - diskA[1].replace(diskA[1].begin(), diskA[1].end(), "ECA/Disk2"); - diskA[2].replace(diskA[2].begin(), diskA[2].end(), "ECA/Disk3"); - diskC[0].replace(diskC[0].begin(), diskC[0].end(), "ECC/Disk1"); - diskC[1].replace(diskC[1].begin(), diskC[1].end(), "ECC/Disk2"); - diskC[2].replace(diskC[2].begin(), diskC[2].end(), "ECC/Disk3"); - } - std::string mod[nmod] = { "M6C", "M5C", "M4C", "M3C", "M2C", "M1C", "M0", "M1A", "M2A", "M3A", "M4A", "M5A", "M6A" } ; - std::string modIBL[nmodIBL] = { "M4_C8_2","M4_C8_1","M4_C7_2","M4_C7_1","M3_C6", "M3_C5", "M2_C4", "M2_C3", "M1_C2", "M1_C1", "M1_A1", "M1_A2", "M2_A3", "M2_A4", "M3_A5", "M3_A6","M4_A7_1","M4_A7_2","M4_A8_1","M4_A8_2"} ; - std::string staveb[nstaveb] = { - "S01", "S02", "S03", "S04", "S05", "S06","S07", - "S08", "S09", "S10", "S11", "S12", "S13","S14"}; - std::string stave0[nstave0] = { +std::string PixelMonModules::getHistName(int i, bool forPath) { + const int ndisk = 3; + const int nphi = 48; + const int nmod = 13; + const int nmodIBL = 20; + const int nstaveb = 14; + const int nstave0 = 22; + const int nstave1 = 38; + const int nstave2 = 52; + std::string diskA[ndisk] = {"D1A", "D2A", "D3A"}; + std::string diskC[ndisk] = {"D1C", "D2C", "D3C"}; + std::string barrel[3] = {"L0", "L1", "L2"}; + std::string newbarrel[4] = {"LI", "L0", "L1", "L2"}; + if (forPath) { + diskA[0].replace(diskA[0].begin(), diskA[0].end(), "ECA/Disk1"); + diskA[1].replace(diskA[1].begin(), diskA[1].end(), "ECA/Disk2"); + diskA[2].replace(diskA[2].begin(), diskA[2].end(), "ECA/Disk3"); + diskC[0].replace(diskC[0].begin(), diskC[0].end(), "ECC/Disk1"); + diskC[1].replace(diskC[1].begin(), diskC[1].end(), "ECC/Disk2"); + diskC[2].replace(diskC[2].begin(), diskC[2].end(), "ECC/Disk3"); + } + std::string mod[nmod] = {"M6C", "M5C", "M4C", "M3C", "M2C", "M1C", "M0", + "M1A", "M2A", "M3A", "M4A", "M5A", "M6A"}; + std::string modIBL[nmodIBL] = { + "M4_C8_2", "M4_C8_1", "M4_C7_2", "M4_C7_1", "M3_C6", "M3_C5", "M2_C4", + "M2_C3", "M1_C2", "M1_C1", "M1_A1", "M1_A2", "M2_A3", "M2_A4", + "M3_A5", "M3_A6", "M4_A7_1", "M4_A7_2", "M4_A8_1", "M4_A8_2"}; + std::string staveb[nstaveb] = {"S01", "S02", "S03", "S04", "S05", + "S06", "S07", "S08", "S09", "S10", + "S11", "S12", "S13", "S14"}; + std::string stave0[nstave0] = { "B11_S2", "B01_S1", "B01_S2", "B02_S1", "B02_S2", "B03_S1", "B03_S2", "B04_S1", "B04_S2", "B05_S1", "B05_S2", "B06_S1", "B06_S2", "B07_S1", "B07_S2", "B08_S1", "B08_S2", "B09_S1", - "B09_S2", "B10_S1", "B10_S2", "B11_S1" }; + "B09_S2", "B10_S1", "B10_S2", "B11_S1"}; std::string stave1[nstave1] = { - "B01_S1", "B01_S2", "B02_S1", "B02_S2", "B03_S1", "B03_S2", - "B04_S1", "B04_S2", "B05_S1", "B05_S2", "B06_S1", "B06_S2", - "B07_S1", "B07_S2", "B08_S1", "B08_S2", "B09_S1", "B09_S2", - "B10_S1", "B10_S2", "B11_S1", "B11_S2", "B12_S1", "B12_S2", - "B13_S1", "B13_S2", "B14_S1", "B14_S2", "B15_S1", "B15_S2", - "B16_S1", "B16_S2", "B17_S1", "B17_S2", "B18_S1", "B18_S2", - "B19_S1", "B19_S2" }; - std::string stave2[nstave2] = { - "B01_S2", "B02_S1", "B02_S2", "B03_S1", "B03_S2", "B04_S1", - "B04_S2", "B05_S1", "B05_S2", "B06_S1", "B06_S2", "B07_S1", - "B07_S2", "B08_S1", "B08_S2", "B09_S1", "B09_S2", "B10_S1", - "B10_S2", "B11_S1", "B11_S2", "B12_S1", "B12_S2", "B13_S1", - "B13_S2", "B14_S1", "B14_S2", "B15_S1", "B15_S2", "B16_S1", - "B16_S2", "B17_S1", "B17_S2", "B18_S1", "B18_S2", "B19_S1", - "B19_S2", "B20_S1", "B20_S2", "B21_S1", "B21_S2", "B22_S1", - "B22_S2", "B23_S1", "B23_S2", "B24_S1", "B24_S2", "B25_S1", - "B25_S2", "B26_S1", "B26_S2", "B01_S1" }; + "B01_S1", "B01_S2", "B02_S1", "B02_S2", "B03_S1", "B03_S2", "B04_S1", + "B04_S2", "B05_S1", "B05_S2", "B06_S1", "B06_S2", "B07_S1", "B07_S2", + "B08_S1", "B08_S2", "B09_S1", "B09_S2", "B10_S1", "B10_S2", "B11_S1", + "B11_S2", "B12_S1", "B12_S2", "B13_S1", "B13_S2", "B14_S1", "B14_S2", + "B15_S1", "B15_S2", "B16_S1", "B16_S2", "B17_S1", "B17_S2", "B18_S1", + "B18_S2", "B19_S1", "B19_S2"}; + std::string stave2[nstave2] = { + "B01_S2", "B02_S1", "B02_S2", "B03_S1", "B03_S2", "B04_S1", "B04_S2", + "B05_S1", "B05_S2", "B06_S1", "B06_S2", "B07_S1", "B07_S2", "B08_S1", + "B08_S2", "B09_S1", "B09_S2", "B10_S1", "B10_S2", "B11_S1", "B11_S2", + "B12_S1", "B12_S2", "B13_S1", "B13_S2", "B14_S1", "B14_S2", "B15_S1", + "B15_S2", "B16_S1", "B16_S2", "B17_S1", "B17_S2", "B18_S1", "B18_S2", + "B19_S1", "B19_S2", "B20_S1", "B20_S2", "B21_S1", "B21_S2", "B22_S1", + "B22_S2", "B23_S1", "B23_S2", "B24_S1", "B24_S2", "B25_S1", "B25_S2", + "B26_S1", "B26_S2", "B01_S1"}; std::string staveA[nphi] = { - "B01_S2_M1", "B01_S2_M6", "B01_S2_M2", "B01_S2_M5", "B01_S2_M3", "B01_S2_M4", - "B02_S1_M1", "B02_S1_M6", "B02_S1_M2", "B02_S1_M5", "B02_S1_M3", "B02_S1_M4", - "B02_S2_M1", "B02_S2_M6", "B02_S2_M2", "B02_S2_M5", "B02_S2_M3", "B02_S2_M4", - "B03_S1_M1", "B03_S1_M6", "B03_S1_M2", "B03_S1_M5", "B03_S1_M3", "B03_S1_M4", - "B03_S2_M1", "B03_S2_M6", "B03_S2_M2", "B03_S2_M5", "B03_S2_M3", "B03_S2_M4", - "B04_S1_M1", "B04_S1_M6", "B04_S1_M2", "B04_S1_M5", "B04_S1_M3", "B04_S1_M4", - "B04_S2_M1", "B04_S2_M6", "B04_S2_M2", "B04_S2_M5", "B04_S2_M3", "B04_S2_M4", - "B01_S1_M1", "B01_S1_M6", "B01_S1_M2", "B01_S1_M5", "B01_S1_M3", "B01_S1_M4"}; + "B01_S2_M1", "B01_S2_M6", "B01_S2_M2", "B01_S2_M5", "B01_S2_M3", + "B01_S2_M4", "B02_S1_M1", "B02_S1_M6", "B02_S1_M2", "B02_S1_M5", + "B02_S1_M3", "B02_S1_M4", "B02_S2_M1", "B02_S2_M6", "B02_S2_M2", + "B02_S2_M5", "B02_S2_M3", "B02_S2_M4", "B03_S1_M1", "B03_S1_M6", + "B03_S1_M2", "B03_S1_M5", "B03_S1_M3", "B03_S1_M4", "B03_S2_M1", + "B03_S2_M6", "B03_S2_M2", "B03_S2_M5", "B03_S2_M3", "B03_S2_M4", + "B04_S1_M1", "B04_S1_M6", "B04_S1_M2", "B04_S1_M5", "B04_S1_M3", + "B04_S1_M4", "B04_S2_M1", "B04_S2_M6", "B04_S2_M2", "B04_S2_M5", + "B04_S2_M3", "B04_S2_M4", "B01_S1_M1", "B01_S1_M6", "B01_S1_M2", + "B01_S1_M5", "B01_S1_M3", "B01_S1_M4"}; std::string staveC[nphi] = { - "B01_S2_M4", "B01_S2_M3", "B01_S2_M5", "B01_S2_M2", "B01_S2_M6", "B01_S2_M1", - "B02_S1_M4", "B02_S1_M3", "B02_S1_M5", "B02_S1_M2", "B02_S1_M6", "B02_S1_M1", - "B02_S2_M4", "B02_S2_M3", "B02_S2_M5", "B02_S2_M2", "B02_S2_M6", "B02_S2_M1", - "B03_S1_M4", "B03_S1_M3", "B03_S1_M5", "B03_S1_M2", "B03_S1_M6", "B03_S1_M1", - "B03_S2_M4", "B03_S2_M3", "B03_S2_M5", "B03_S2_M2", "B03_S2_M6", "B03_S2_M1", - "B04_S1_M4", "B04_S1_M3", "B04_S1_M5", "B04_S1_M2", "B04_S1_M6", "B04_S1_M1", - "B04_S2_M4", "B04_S2_M3", "B04_S2_M5", "B04_S2_M2", "B04_S2_M6", "B04_S2_M1", - "B01_S1_M4", "B01_S1_M3", "B01_S1_M5", "B01_S1_M2", "B01_S1_M6", "B01_S1_M1"}; + "B01_S2_M4", "B01_S2_M3", "B01_S2_M5", "B01_S2_M2", "B01_S2_M6", + "B01_S2_M1", "B02_S1_M4", "B02_S1_M3", "B02_S1_M5", "B02_S1_M2", + "B02_S1_M6", "B02_S1_M1", "B02_S2_M4", "B02_S2_M3", "B02_S2_M5", + "B02_S2_M2", "B02_S2_M6", "B02_S2_M1", "B03_S1_M4", "B03_S1_M3", + "B03_S1_M5", "B03_S1_M2", "B03_S1_M6", "B03_S1_M1", "B03_S2_M4", + "B03_S2_M3", "B03_S2_M5", "B03_S2_M2", "B03_S2_M6", "B03_S2_M1", + "B04_S1_M4", "B04_S1_M3", "B04_S1_M5", "B04_S1_M2", "B04_S1_M6", + "B04_S1_M1", "B04_S2_M4", "B04_S2_M3", "B04_S2_M5", "B04_S2_M2", + "B04_S2_M6", "B04_S2_M1", "B01_S1_M4", "B01_S1_M3", "B01_S1_M5", + "B01_S1_M2", "B01_S1_M6", "B01_S1_M1"}; if (forPath) { - std::string joint = "/"; - if (i < 286) return barrel[0]+joint+stave0[i%22]; - i -= 286; - if (i < 494) return barrel[1]+joint+stave1[i%38]; - i -= 494; - if (i < 676) return barrel[2]+joint+stave2[i%52]; - i -= 676; - if (i < 144) return diskA[i/48]; - i -= 144; - if (i < 144) return diskC[i/48]; - i -= 144; - if (m_doIBL && i < 280) return newbarrel[0]+joint+staveb[i%14]; + std::string joint = "/"; + if (i < 286) return barrel[0] + joint + stave0[i % 22]; + i -= 286; + if (i < 494) return barrel[1] + joint + stave1[i % 38]; + i -= 494; + if (i < 676) return barrel[2] + joint + stave2[i % 52]; + i -= 676; + if (i < 144) return diskA[i / 48]; + i -= 144; + if (i < 144) return diskC[i / 48]; + i -= 144; + if (m_doIBL && i < 280) return newbarrel[0] + joint + staveb[i % 14]; } else { - std::string joint = "_"; - if (i < 286) return barrel[0]+joint+stave0[i%22]+joint+mod[i/22]; - i -= 286; - if (i < 494) return barrel[1]+joint+stave1[i%38]+joint+mod[i/38]; - i -= 494; - if (i < 676) return barrel[2]+joint+stave2[i%52]+joint+mod[i/52]; - i -= 676; - if (i < 144) return diskA[i/48]+joint+staveA[i%48]; - i -= 144; - if (i < 144) return diskC[i/48]+joint+staveC[i%48]; - i -= 144; - if (m_doIBL && i < 280) return newbarrel[0]+joint+staveb[i%14]+joint+modIBL[i/14];; + std::string joint = "_"; + if (i < 286) { + return barrel[0] + joint + stave0[i % 22] + joint + mod[i / 22]; + } + i -= 286; + if (i < 494) { + return barrel[1] + joint + stave1[i % 38] + joint + mod[i / 38]; + } + i -= 494; + if (i < 676) { + return barrel[2] + joint + stave2[i % 52] + joint + mod[i / 52]; + } + i -= 676; + if (i < 144) return diskA[i / 48] + joint + staveA[i % 48]; + i -= 144; + if (i < 144) return diskC[i / 48] + joint + staveC[i % 48]; + i -= 144; + if (m_doIBL && i < 280) { + return newbarrel[0] + joint + staveb[i % 14] + joint + modIBL[i / 14]; + } } - std::string dummy="wrong initialization"; - return dummy; //should never get here + std::string dummy = "wrong initialization"; + return dummy; // should never get here } const bool PixelMonModules::m_doIBL{true}; diff --git a/InnerDetector/InDetMonitoring/PixelMonitoring/src/SpacePoints.cxx b/InnerDetector/InDetMonitoring/PixelMonitoring/src/SpacePoints.cxx index 000c95300fb98023f3c1dc03d454c93d33328a74..759041704be9e2471f410b3428470edfe87dd7be 100644 --- a/InnerDetector/InDetMonitoring/PixelMonitoring/src/SpacePoints.cxx +++ b/InnerDetector/InDetMonitoring/PixelMonitoring/src/SpacePoints.cxx @@ -6,96 +6,94 @@ // Book and fill histograms for pixel spacepoints /////////////////////////////////////////////////////////////////////////////// -#include "PixelMonitoring/PixelMainMon.h" -#include "TrkSpacePoint/SpacePointContainer.h" +#include <sstream> #include "InDetIdentifier/PixelID.h" -#include "TH1F.h" -#include "TH1I.h" -#include "TH2F.h" -#include "TH2I.h" #include "LWHists/TH1F_LW.h" #include "LWHists/TH1I_LW.h" #include "LWHists/TH2F_LW.h" #include "LWHists/TH2I_LW.h" -#include <sstream> +#include "PixelMonitoring/PixelMainMon.h" +#include "TH1F.h" +#include "TH1I.h" +#include "TH2F.h" +#include "TH2I.h" +#include "TrkSpacePoint/SpacePointContainer.h" -#include "PixelMonitoring/PixelMonModules.h" #include "GeoPrimitives/GeoPrimitives.h" - +#include "PixelMonitoring/PixelMonModules.h" /////////////////////////////////////////////////////////////////////////////// //////////////////////booking methods////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////// -StatusCode PixelMainMon::BookSpacePointMon(void) -{ +StatusCode PixelMainMon::bookSpacePointMon(void) { ATH_MSG_DEBUG("Start booking SpacePoint histogtams.."); std::string path = "Pixel/SpacePoint"; if (m_doOnTrack) path.replace(path.begin(), path.end(), "Pixel/SpacePointOnTrack"); bool st(true); - MonGroup spacePointHistos( this, path.c_str(),run,ATTRIB_MANAGED ); + MonGroup spacePointHistos(this, path.c_str(), run, ATTRIB_MANAGED); if (m_doHighOccupancy) { - st &= spacePointHistos.regHist(m_num_spacepoints = TH1I_LW::create("num_spacepoints", ("number of pixel spacepoint hits per event" + m_histTitleExt + ";# spacepoints;# events").c_str(), 100,0.,25000)).isSuccess(); + st &= spacePointHistos.regHist(m_num_spacepoints = TH1I_LW::create("num_spacepoints", ("number of pixel spacepoint hits per event" + m_histTitleExt + ";# spacepoints;# events").c_str(), 100, 0., 25000)).isSuccess(); } if (m_doLowOccupancy) { - st &= spacePointHistos.regHist(m_num_spacepoints_low = TH1I_LW::create("num_spacepoints_low_occupancy", ("number of pixel spacepoint hits per event" + m_histTitleExt + ";# spacepoints;# events").c_str(), 100,-0.5,99.5)).isSuccess(); + st &= spacePointHistos.regHist(m_num_spacepoints_low = TH1I_LW::create("num_spacepoints_low_occupancy", ("number of pixel spacepoint hits per event" + m_histTitleExt + ";# spacepoints;# events").c_str(), 100, -0.5, 99.5)).isSuccess(); } - st &= spacePointHistos.regHist(m_spHit_x = TH1F_LW::create("pixel_sp_x",("x location of hit" + m_histTitleExt + ";x (mm);# hits").c_str(),320,-160.,160.)).isSuccess(); - st &= spacePointHistos.regHist(m_spHit_y = TH1F_LW::create("pixel_sp_y",("y location of hit" + m_histTitleExt + ";y (mm);# hits").c_str(),320,-160.,160.)).isSuccess(); - st &= spacePointHistos.regHist(m_spHit_z = TH1F_LW::create("pixel_sp_z",("z location of hit" + m_histTitleExt + ";z (mm);# hits").c_str(),660,-660.,660.)).isSuccess(); - st &= spacePointHistos.regHist(m_spHit_r = TH1F_LW::create("pixel_sp_r",("r location of hit" + m_histTitleExt + ";r (mm);# hits").c_str(),230,-0. ,230.)).isSuccess(); - st &= spacePointHistos.regHist(m_spHit_phi = TH1F_LW::create("pixel_sp_phi",("phi location of hit" + m_histTitleExt + ";phi (mm);# hits").c_str(),60,-4.,4.)).isSuccess(); - st &= spacePointHistos.regHist(m_spHit_xy = TH2F_LW::create("pixel_sp_x_vs_y",("xy location of barrel hits" + m_histTitleExt + ";x (mm);y (mm)").c_str(),100,-160,160,100,-160,160)).isSuccess(); - st &= spacePointHistos.regHist(m_spHit_rz = TH2F_LW::create("pixel_sp_r_vs_z",("rz location of hit" + m_histTitleExt + ";z (mm);r (mm)").c_str(),200,-665,665,200,-0,165)).isSuccess(); + st &= spacePointHistos.regHist(m_spHit_x = TH1F_LW::create("pixel_sp_x", ("x location of hit" + m_histTitleExt + ";x (mm);# hits").c_str(), 320, -160., 160.)).isSuccess(); + st &= spacePointHistos.regHist(m_spHit_y = TH1F_LW::create("pixel_sp_y", ("y location of hit" + m_histTitleExt + ";y (mm);# hits").c_str(), 320, -160., 160.)).isSuccess(); + st &= spacePointHistos.regHist(m_spHit_z = TH1F_LW::create("pixel_sp_z", ("z location of hit" + m_histTitleExt + ";z (mm);# hits").c_str(), 660, -660., 660.)).isSuccess(); + st &= spacePointHistos.regHist(m_spHit_r = TH1F_LW::create("pixel_sp_r", ("r location of hit" + m_histTitleExt + ";r (mm);# hits").c_str(), 230, -0., 230.)).isSuccess(); + st &= spacePointHistos.regHist(m_spHit_phi = TH1F_LW::create("pixel_sp_phi", ("phi location of hit" + m_histTitleExt + ";phi (mm);# hits").c_str(), 60, -4., 4.)).isSuccess(); + st &= spacePointHistos.regHist(m_spHit_xy = TH2F_LW::create("pixel_sp_x_vs_y", ("xy location of barrel hits" + m_histTitleExt + ";x (mm);y (mm)").c_str(), 100, -160, 160, 100, -160, 160)).isSuccess(); + st &= spacePointHistos.regHist(m_spHit_rz = TH2F_LW::create("pixel_sp_r_vs_z", ("rz location of hit" + m_histTitleExt + ";z (mm);r (mm)").c_str(), 200, -665, 665, 200, -0, 165)).isSuccess(); if (!st) ATH_MSG_WARNING("Problems with booking SpacePoint histograms"); return StatusCode::SUCCESS; } -StatusCode PixelMainMon::FillSpacePointMon(void) -{ - StatusCode sc = evtStore()->retrieve(m_Pixel_spcontainer, m_Pixel_SpacePointsName ); - if (sc.isFailure() || !m_Pixel_spcontainer) - { - ATH_MSG_WARNING("SpacePoint container for Pixels not found"); - if (m_storegate_errors) m_storegate_errors->Fill(2.,3.); - return StatusCode::SUCCESS; - } else ATH_MSG_DEBUG("Si SpacePoint container for Pixels found"); - - DataVector<SpacePoint>::const_iterator p_sp; +StatusCode PixelMainMon::fillSpacePointMon(void) { + StatusCode sc = evtStore()->retrieve(m_Pixel_spcontainer, m_Pixel_SpacePointsName); + if (sc.isFailure() || !m_Pixel_spcontainer) { + ATH_MSG_WARNING("SpacePoint container for Pixels not found"); + if (m_storegate_errors) m_storegate_errors->Fill(2., 3.); + return StatusCode::SUCCESS; + } else { + ATH_MSG_DEBUG("Si SpacePoint container for Pixels found"); + } + + DataVector<SpacePoint>::const_iterator p_sp; Identifier PixelModuleId; - int nhits=0; - + int nhits = 0; + //loop over Pixel space points collections - for (SpacePointContainer::const_iterator it=m_Pixel_spcontainer->begin(); it!=m_Pixel_spcontainer->end(); ++it) - { - const SpacePointCollection *colNext=&(**it); - if (!colNext) - { - if (m_storegate_errors) m_storegate_errors->Fill(2.,5.); //first entry (1). is for SP, second (4) is for data problem - continue; - } - for (p_sp=colNext->begin(); p_sp!=colNext->end(); ++p_sp) - { - const SpacePoint& sp = **p_sp; - PixelModuleId = sp.clusterList().first->identify(); - - if (m_doOnTrack) if (!OnTrack(PixelModuleId,true) ) continue; //if we only want hits on track, and the hit is NOT on the track, skip filling - Amg::Vector3D point = sp.globalPosition(); - - if (m_spHit_x) m_spHit_x->Fill(point.x()); - if (m_spHit_y) m_spHit_y->Fill(point.y()); - if (m_spHit_z) m_spHit_z->Fill(point.z()); - if (m_spHit_r) m_spHit_r->Fill(sqrt(point.y()*point.y() + point.x()*point.x())); // spacepoint r. - if (m_spHit_phi) m_spHit_phi->Fill(point.phi()); // spacepoint phi. - if (m_spHit_xy && fabs(point.z()) < 400) m_spHit_xy->Fill(point.x(),point.y()); - if (m_spHit_rz) m_spHit_rz->Fill(point.z(),sqrt(point.y()*point.y() + point.x()*point.x())); - nhits++; - } + for (SpacePointContainer::const_iterator it = m_Pixel_spcontainer->begin(); it != m_Pixel_spcontainer->end(); ++it) { + const SpacePointCollection* colNext = &(**it); + if (!colNext) { + if (m_storegate_errors) m_storegate_errors->Fill(2., 5.); // first entry is for SP, second is for data problem + continue; } + for (p_sp = colNext->begin(); p_sp != colNext->end(); ++p_sp) { + const SpacePoint& sp = **p_sp; + PixelModuleId = sp.clusterList().first->identify(); + + if (m_doOnTrack && !isOnTrack(PixelModuleId, true)) { + // if we only want hits on track, and the hit is NOT on the track, skip filling + continue; + } + Amg::Vector3D point = sp.globalPosition(); + + if (m_spHit_x) m_spHit_x->Fill(point.x()); + if (m_spHit_y) m_spHit_y->Fill(point.y()); + if (m_spHit_z) m_spHit_z->Fill(point.z()); + if (m_spHit_r) m_spHit_r->Fill(sqrt(point.y() * point.y() + point.x() * point.x())); // spacepoint r. + if (m_spHit_phi) m_spHit_phi->Fill(point.phi()); // spacepoint phi. + if (m_spHit_xy && fabs(point.z()) < 400) m_spHit_xy->Fill(point.x(), point.y()); + if (m_spHit_rz) m_spHit_rz->Fill(point.z(), sqrt(point.y() * point.y() + point.x() * point.x())); + nhits++; + } + } if (m_num_spacepoints) m_num_spacepoints->Fill(nhits); if (m_num_spacepoints_low) m_num_spacepoints_low->Fill(nhits); - if (nhits==0 && m_storegate_errors) m_storegate_errors->Fill(2.,4.); //first entry for sp, second for size = 0 + if (nhits == 0 && m_storegate_errors) m_storegate_errors->Fill(2., 4.); // first entry for sp, second for size = 0 return StatusCode::SUCCESS; } diff --git a/InnerDetector/InDetMonitoring/PixelMonitoring/src/Status.cxx b/InnerDetector/InDetMonitoring/PixelMonitoring/src/Status.cxx index 21002552b7786d29c5be282c02fbd553d61d79b3..7bd3e4588b1ffa1f735b379570e9f9c6cb550a9b 100644 --- a/InnerDetector/InDetMonitoring/PixelMonitoring/src/Status.cxx +++ b/InnerDetector/InDetMonitoring/PixelMonitoring/src/Status.cxx @@ -6,21 +6,21 @@ // Book and fill offline histograms showing status of modules /////////////////////////////////////////////////////////////////////////////// -#include "PixelMonitoring/PixelMainMon.h" +#include <sstream> #include "InDetConditionsSummaryService/IInDetConditionsSvc.h" -#include "TH1F.h" -#include "TH1I.h" -#include "TH2F.h" -#include "TH2I.h" +#include "InDetIdentifier/PixelID.h" #include "LWHists/TH1F_LW.h" #include "LWHists/TH1I_LW.h" #include "LWHists/TH2F_LW.h" #include "LWHists/TH2I_LW.h" -#include "TProfile2D.h" #include "LWHists/TProfile2D_LW.h" #include "LWHists/TProfile_LW.h" -#include "InDetIdentifier/PixelID.h" -#include <sstream> +#include "PixelMonitoring/PixelMainMon.h" +#include "TH1F.h" +#include "TH1I.h" +#include "TH2F.h" +#include "TH2I.h" +#include "TProfile2D.h" #include "PixelMonitoring/Components.h" #include "PixelMonitoring/PixelMon2DMapsLW.h" @@ -31,218 +31,205 @@ //////////////////////booking methods////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////// -StatusCode PixelMainMon::BookStatusMon(void) -{ - if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "starting Book Status" << endmsg; +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"); - 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) + MonGroup statusHistos(this, path.c_str(), run, ATTRIB_MANAGED); // declare a group of histograms StatusCode sc; m_status = std::make_unique<PixelMon2DProfilesLW>(PixelMon2DProfilesLW("Map_Of_Modules_Status", ("Modules Status (0=Active+Good, 1=Active+Bad, 2=Inactive)" + m_histTitleExt).c_str(), PixMon::HistConf::kPixIBL2D3D, true)); sc = m_status->regHist(statusHistos); - m_status->SetMaxValue( 2.0 ); + m_status->setMaxValue(2.0); m_status_mon = std::make_unique<PixelMon2DProfilesLW>(PixelMon2DProfilesLW("Map_Of_Modules_Status_Mon", ("Modules Status (0=Active+Good, 1=Active+Bad, 2=Inactive) for monitoring" + m_histTitleExt).c_str(), PixMon::HistConf::kPixIBL2D3D, true)); sc = m_status_mon->regHist(statusHistos); - m_status_mon->SetMaxValue( 2.0 ); - - if (m_doModules) - { - m_Status_modules = std::make_unique<PixelMonModules1D>(PixelMonModules1D("Status_of_Module", ("Module Status (0=Active+Good, 1=Active+Bad, 2=Inactive)" + m_histTitleExt + ";Status").c_str(),2,0,2)); - sc = m_Status_modules->regHist(this, (path+"/Modules_Status").c_str(),run); - m_Status_modules->SetBinLabel( "Status",2 ); - m_Status_modules->formatHist("status"); - } - if (m_doOffline) - { - m_dqStatus = std::make_unique<PixelMon2DMapsLW>(PixelMon2DMapsLW("Ok_modules", ("module problems, empty bin means dead module not listed in status database"+ m_histTitleExt).c_str(), PixMon::HistConf::kPixDBMIBL2D3D)); - sc = m_dqStatus->regHist(statusHistos); - } + m_status_mon->setMaxValue(2.0); + + if (m_doModules) { + m_Status_modules = std::make_unique<PixelMonModules1D>(PixelMonModules1D("Status_of_Module", ("Module Status (0=Active+Good, 1=Active+Bad, 2=Inactive)" + m_histTitleExt + ";Status").c_str(), 2, 0, 2)); + sc = m_Status_modules->regHist(this, (path + "/Modules_Status").c_str(), run); + m_Status_modules->setBinLabel("Status", 2); + m_Status_modules->formatHist("status"); + } + if (m_doOffline) { + m_dqStatus = std::make_unique<PixelMon2DMapsLW>(PixelMon2DMapsLW("Ok_modules", ("module problems, empty bin means dead module not listed in status database" + m_histTitleExt).c_str(), PixMon::HistConf::kPixDBMIBL2D3D)); + 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); + 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)); + 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)); + 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; + 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; +StatusCode PixelMainMon::bookStatusLumiBlockMon(void) { + 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_doOnTrack) path.replace(path.begin(), path.end(), "Pixel/LumiBlockOnTrack"); MonGroup lumiBlockHist(this, path.c_str(), lowStat, ATTRIB_MANAGED); - m_status_LB = std::make_unique<PixelMon2DProfilesLW>(PixelMon2DProfilesLW("Map_Of_Modules_Status_LB", ("Module Status (0=Active+Good, 1=Active+Bad, 2=Inactive)"+ m_histTitleExt).c_str(), PixMon::HistConf::kPixIBL2D3D, true)); + m_status_LB = std::make_unique<PixelMon2DProfilesLW>(PixelMon2DProfilesLW("Map_Of_Modules_Status_LB", ("Module Status (0=Active+Good, 1=Active+Bad, 2=Inactive)" + m_histTitleExt).c_str(), PixMon::HistConf::kPixIBL2D3D, true)); StatusCode 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; + m_status_LB->setMaxValue(2.0); + + if (sc.isFailure()) { + if (msgLvl(MSG::WARNING)) msg(MSG::WARNING) << "histograms not booked" << endmsg; + } return StatusCode::SUCCESS; -} +} -StatusCode PixelMainMon::FillStatusMon(void) -{ +StatusCode PixelMainMon::fillStatusMon(void) { int Index = -1; - PixelID::const_id_iterator idIt = m_pixelid->wafer_begin(); + 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 nDisabled=0; - int nDisabled_mod[PixLayerIBL2D3D::COUNT]={0}; + int nBad = 0; + int nBad_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) - { - 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 ) { - pixlayeribl2d3d = GetPixLayerIDIBL2D3D(m_pixelid->barrel_ec(WaferID), m_pixelid->layer_disk(WaferID), m_pixelid->eta_module(WaferID), m_doIBL); - } - if ( pixlayer == 99 ) continue; + 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) { + pixlayeribl2d3d = getPixLayerIDIBL2D3D(m_pixelid->barrel_ec(WaferID), m_pixelid->layer_disk(WaferID), m_pixelid->eta_module(WaferID), m_doIBL); + } + 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; + } - // 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); + if (m_status_mon) m_status_mon->fill(WaferID, m_pixelid, Index); - if (m_status) m_status->Fill(WaferID,m_pixelid,Index); - if (m_status_mon) m_status_mon->Fill(WaferID,m_pixelid,Index); + if (m_doLumiBlock) { + if (m_status_LB) m_status_LB->fill(WaferID, m_pixelid, Index); + } - if (m_doLumiBlock){ - if (m_status_LB) m_status_LB->Fill(WaferID,m_pixelid,Index); + if (Index > 0) { // bad but active modules + if (Index == 1) { + nBad++; + nBad_mod[pixlayer]++; + if (pixlayeribl2d3d != 0) nBad_mod[pixlayeribl2d3d]++; + } + // inactive or bad modules + if (Index == 2) { + nDisabled++; + nDisabled_mod[pixlayer]++; + if (pixlayeribl2d3d != 0) nDisabled_mod[pixlayeribl2d3d]++; } - 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) - { - nDisabled++; - nDisabled_mod[pixlayer]++; - if(pixlayeribl2d3d != 0) nDisabled_mod[pixlayeribl2d3d]++; - } - - 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); //fill to the required value - } + 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 (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); + } } - } // of pixelid wafer loop + } + } // end 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]); + 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) { + 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 { + } else { m_majorityDisabled = false; } - if (m_doRefresh && m_status_mon) m_status_mon->Reset(); + 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) ); - } - } +} + +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)); + } + } + } + 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 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 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 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) ); - } + 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)); } } - return StatusCode::SUCCESS; -} - + 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 e9e8c60ebef58b9dcf22a7b73a52abab9fa67140..4b0ce31a1d2b257cb0bf1c5ca7d90690b54b4be7 100644 --- a/InnerDetector/InDetMonitoring/PixelMonitoring/src/Track.cxx +++ b/InnerDetector/InDetMonitoring/PixelMonitoring/src/Track.cxx @@ -6,78 +6,77 @@ // Book and fill histograms for tracks (combined ID and pixel only tracks) /////////////////////////////////////////////////////////////////////////////// -#include "PixelMonitoring/PixelMainMon.h" -#include "InDetRawData/InDetTimeCollection.h" -#include "TrkSpacePoint/SpacePointContainer.h" -#include "InDetPrepRawData/PixelClusterContainer.h" +#include <algorithm> +#include <sstream> #include "InDetConditionsSummaryService/IInDetConditionsSvc.h" -#include "TrkParameters/TrackParameters.h" -#include "InDetRIO_OnTrack/SiClusterOnTrack.h" -#include "PixelConditionsServices/IPixelByteStreamErrorsSvc.h" #include "InDetIdentifier/PixelID.h" -#include "TH1F.h" -#include "TH1I.h" -#include "TH2F.h" -#include "TH2I.h" +#include "InDetPrepRawData/PixelClusterContainer.h" +#include "InDetRIO_OnTrack/SiClusterOnTrack.h" +#include "InDetRawData/InDetTimeCollection.h" #include "LWHists/TH1F_LW.h" #include "LWHists/TH1I_LW.h" #include "LWHists/TH2F_LW.h" #include "LWHists/TH2I_LW.h" -#include "LWHists/TProfile_LW.h" #include "LWHists/TProfile2D_LW.h" -#include <sstream> -#include <algorithm> +#include "LWHists/TProfile_LW.h" +#include "PixelConditionsServices/IPixelByteStreamErrorsSvc.h" +#include "PixelMonitoring/PixelMainMon.h" +#include "TH1F.h" +#include "TH1I.h" +#include "TH2F.h" +#include "TH2I.h" +#include "TrkParameters/TrackParameters.h" +#include "TrkSpacePoint/SpacePointContainer.h" +#include "EventPrimitives/EventPrimitives.h" +#include "EventPrimitives/EventPrimitivesHelpers.h" +#include "InDetRawData/InDetRawDataCLASS_DEF.h" #include "InDetRawData/InDetRawDataContainer.h" -#include "InDetRawData/InDetRawDataCLASS_DEF.h" -#include "TrkTrack/TrackCollection.h" #include "InDetReadoutGeometry/SiDetectorElement.h" -#include "TrkTrackSummary/TrackSummary.h" -#include "TrkTrackSummary/InDetTrackSummary.h" -#include "TrkToolInterfaces/ITrackHoleSearchTool.h" #include "PixelMonitoring/Components.h" #include "PixelMonitoring/PixelMon2DMapsLW.h" #include "PixelMonitoring/PixelMon2DProfilesLW.h" #include "PixelMonitoring/PixelMonModules.h" -#include "EventPrimitives/EventPrimitives.h" -#include "EventPrimitives/EventPrimitivesHelpers.h" - +#include "TrkToolInterfaces/ITrackHoleSearchTool.h" +#include "TrkTrack/TrackCollection.h" +#include "TrkTrackSummary/InDetTrackSummary.h" +#include "TrkTrackSummary/TrackSummary.h" /////////////////////////////////////////////////////////////////////////////// //////////////////////booking methods////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////// -StatusCode PixelMainMon::BookTrackMon(void) -{ - ATH_MSG_DEBUG("Start booking Track histogtams.."); - +StatusCode PixelMainMon::bookTrackMon(void) { + ATH_MSG_DEBUG("Start booking Track histogtams.."); + std::string path = "Pixel/Track"; if (m_doOnTrack) path.replace(path.begin(), path.end(), "Pixel/TrackOnTrack"); - MonGroup trackHistos( this, path.c_str(), run, ATTRIB_MANAGED ); //declare a group of track histograms - + MonGroup trackHistos(this, path.c_str(), run, ATTRIB_MANAGED); //declare a group of track 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"; + 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; - + StatusCode sc; - 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.)); + int nbins_LB = m_lbRange; + double min_LB = -0.5; + double max_LB = min_LB + (1.0 * nbins_LB); + + 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)); @@ -96,14 +95,14 @@ StatusCode PixelMainMon::BookTrackMon(void) 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_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"); - + 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"); + if (m_do2DMaps && !m_doOnline) { m_tsos_hitmap = std::make_unique<PixelMon2DMapsLW>(PixelMon2DMapsLW("TSOS_Measurement", ("TSOS of type Measurement" + m_histTitleExt), PixMon::HistConf::kPixDBMIBL2D3D, true)); sc = m_tsos_hitmap->regHist(trackHistos); @@ -111,13 +110,6 @@ StatusCode PixelMainMon::BookTrackMon(void) sc = m_tsos_holemap->regHist(trackHistos); m_tsos_outliermap = std::make_unique<PixelMon2DMapsLW>(PixelMon2DMapsLW("TSOS_Outlier", ("TSOS of type Outlier" + m_histTitleExt), PixMon::HistConf::kPixDBMIBL2D3D, true)); sc = m_tsos_outliermap->regHist(trackHistos); - - //m_tsos_measratio = std::make_unique<PixelMon2DProfilesLW>(PixelMon2DProfilesLW("TSOS_MeasRatio", ("TSOS of type Meas per track" + m_histTitleExt), PixMon::HistConf::kPixIBL2D3D, true)); - //sc = m_tsos_measratio->regHist(trackHistos); - //m_tsos_holeratio = std::make_unique<PixelMon2DProfilesLW>(PixelMon2DProfilesLW("TSOS_HoleRatio", ("TSOS of type Hole per track" + m_histTitleExt), PixMon::HistConf::kPixIBL2D3D, true)); - //sc = m_tsos_holeratio->regHist(trackHistos); - //m_misshits_ratio = std::make_unique<PixelMon2DProfilesLW>(PixelMon2DProfilesLW("MissHitsRatioOnTrack", ("Hole+Outlier per track" + m_histTitleExt), PixMon::HistConf::kPixIBL2D3D, true)); - //sc = m_misshits_ratio->regHist(trackHistos); } if (m_doOnline) { m_tsos_holeratio_tmp = std::make_unique<PixelMon2DProfilesLW>(PixelMon2DProfilesLW("HoleRatio_tmp", ("TSOS of type Hole per track tmp" + m_histTitleExt), PixMon::HistConf::kPixIBL2D3D, true)); @@ -129,30 +121,30 @@ StatusCode PixelMainMon::BookTrackMon(void) m_misshits_ratio_mon = std::make_unique<PixelMon2DProfilesLW>(PixelMon2DProfilesLW("MissHitsRatioOnTrack_mon", ("Hole+Outlier per track for monitoring" + m_histTitleExt), PixMon::HistConf::kPixIBL2D3D, true)); sc = m_misshits_ratio_mon->regHist(trackHistos); } - - if (m_doModules && !m_doOnTrack) { // tbc essentially code weren't used since doModules was enabled only for AllHits; to keep it disabled also now !m_doOnTrack switch was added - m_tsos_hiteff_vs_lumi = std::make_unique<PixelMonModulesProf>(PixelMonModulesProf("TSOS_HitEfficiency",("TSOS-based hit efficiency in module" + m_histTitleExt).c_str(),2500,-0.5,2499.5)); - sc = m_tsos_hiteff_vs_lumi->regHist(this,(path+"/Modules_TSOSHitEff").c_str(),run); + + if (m_doModules && !m_doOnTrack) { // tbc essentially code weren't used since doModules was enabled only for AllHits; to keep it disabled also now !m_doOnTrack switch was added + m_tsos_hiteff_vs_lumi = std::make_unique<PixelMonModulesProf>(PixelMonModulesProf("TSOS_HitEfficiency", ("TSOS-based hit efficiency in module" + m_histTitleExt).c_str(), 2500, -0.5, 2499.5)); + sc = m_tsos_hiteff_vs_lumi->regHist(this, (path + "/Modules_TSOSHitEff").c_str(), run); if (!m_doOnline) { - sc=trackHistos.regHist(m_clustot_lowpt = TH1F_LW::create("m_clustot_lowpt",("Cluster ToT vs Track pT (pT<10GeV)" + m_histTitleExt + "; Track pT; Cluster ToT (on track)").c_str(),250,0,250)); - sc=trackHistos.regHist(m_clustot_highpt = TH1F_LW::create("m_clustot_highpt",("Cluster ToT vs Track pT (pT>=10GeV)" + m_histTitleExt + "; Track pT; Cluster ToT (on track)").c_str(),250,0,250)); - 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.)); + 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); + + 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)); } @@ -160,384 +152,315 @@ StatusCode PixelMainMon::BookTrackMon(void) return StatusCode::SUCCESS; } -StatusCode PixelMainMon::FillTrackMon(void) -{ +StatusCode PixelMainMon::fillTrackMon(void) { ATH_MSG_DEBUG("Filling Track Monitoring Histograms"); - /// - /// Retrieve and Check Store Gate Error - /// StatusCode sc; sc = evtStore()->retrieve(m_tracks, m_TracksName); - if (sc.isFailure()) - { - ATH_MSG_INFO("No tracks in StoreGate found"); - if (m_storegate_errors) m_storegate_errors->Fill(4.,3.); - return StatusCode::SUCCESS; - } - else - { - ATH_MSG_DEBUG("Tracks in StoreGate found"); - } + if (sc.isFailure()) { + ATH_MSG_INFO("No tracks in StoreGate found"); + if (m_storegate_errors) m_storegate_errors->Fill(4., 3.); + return StatusCode::SUCCESS; + } else { + ATH_MSG_DEBUG("Tracks in StoreGate found"); + } m_ntracksPerEvent = 0; - int nPixelHits=0; - - /// - /// Clear - /// + int nPixelHits = 0; + if (m_doOnTrack) { - m_RDOIDs.clear();//reset these so you can fill them with the new id's + m_RDOIDs.clear(); m_ClusterIDs.clear(); } - - /// - /// Track Loop - /// - for (int i=0; i<(int)m_tracks->size(); i++) - { - const Trk::Track *track0=(*m_tracks)[i]; - if (track0 == 0) { - ATH_MSG_ERROR("no valid pointer to track!!!"); - break; + for (int i = 0; i < (int)m_tracks->size(); i++) { + const Trk::Track *track0 = (*m_tracks)[i]; + if (track0 == 0) { + ATH_MSG_ERROR("no valid pointer to track!!!"); + break; + } + + int nholes = -1; + int nbadclus = 0; + int ngoodclus = 0; + bool passQualityCut = false; + bool passTightCut = false; + bool pass1hole2GeVTightCut = false; + + const Trk::TrackParameters *trkParameters = 0; + const Trk::TrackSummary *summary = track0->trackSummary(); + const Trk::Perigee *measPerigee = dynamic_cast<const Trk::Perigee *>(track0->perigeeParameters()); + + if (summary) { + if (summary->get(Trk::numberOfPixelHits) == 0) continue; + } else { + ATH_MSG_INFO("No Track Summary Found"); + continue; + } + + const Trk::Track *track = track0; + + nholes = summary->get(Trk::numberOfPixelHoles); + if (m_doHoleSearch && !m_doOnline && nholes > 0) { + track = m_holeSearchTool->getTrackWithHoles(*track0); + } + + 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 (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; + } + + 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; + + float nOutlier = 0.; + float nHole = 0.; + float npixHitsInCluster = 0; + float rowWidthOfCluster = 0; + float totalToTOfCluster = 0; + bool passClusterSelection = false; + + 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()) { + ATH_MSG_INFO("pointer of TSOS to track parameters or associated surface is null"); + continue; + } + surfaceID = (*trackStateOnSurfaceIterator)->trackParameters()->associatedSurface().associatedDetectorElementIdentifier(); //check ptr } - int nholes=-1; - int nbadclus=0; - int ngoodclus=0; - bool passQualityCut = false; - bool passTightCut = false; - bool pass1hole2GeVTightCut = false; - - const Trk::TrackParameters *trkParameters = 0; - const Trk::TrackSummary* summary = track0->trackSummary(); - const Trk::Perigee *measPerigee = dynamic_cast< const Trk::Perigee *>(track0->perigeeParameters()); - - /// - /// Check the track summary if it exists to see if there are pixel hits on this track. - /// if no hits, skip ahead - if (summary) { - if (summary->get(Trk::numberOfPixelHits)==0) continue; - } else { - ATH_MSG_INFO("No Track Summary Found"); - continue; + 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 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); - const Trk::Track* track = track0; - - /// - /// 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); + if ((*trackStateOnSurfaceIterator)->type(Trk::TrackStateOnSurface::Measurement)) { + clus = dynamic_cast<const InDet::SiClusterOnTrack *>(mesb); + if (clus) clusID = clus->identify(); + + if (m_tsos_hitmap) m_tsos_hitmap->fill(surfaceID, m_pixelid); + if (m_tsos_hiteff_vs_lumi) m_tsos_hiteff_vs_lumi->fill(m_manager->lumiBlockNumber(), 1., surfaceID, m_pixelid); + if (m_hiteff_incl_mod[pixlayerdisk] && pass1hole2GeVTightCut) m_hiteff_incl_mod[pixlayerdisk]->Fill(m_manager->lumiBlockNumber(), 1.0); } - /// - /// Track Quality Cut - /// + if ((*trackStateOnSurfaceIterator)->type(Trk::TrackStateOnSurface::Outlier)) { + clus = dynamic_cast<const InDet::SiClusterOnTrack *>((*trackStateOnSurfaceIterator)->measurementOnTrack()); + if (clus) clusID = clus->identify(); + nOutlier = 1.0; + + if (m_tsos_holemap) m_tsos_holemap->fill(surfaceID, m_pixelid); + if (m_tsos_hiteff_vs_lumi) m_tsos_hiteff_vs_lumi->fill(m_manager->lumiBlockNumber(), 0., surfaceID, m_pixelid); + if (m_hiteff_incl_mod[pixlayerdisk] && pass1hole2GeVTightCut) m_hiteff_incl_mod[pixlayerdisk]->Fill(m_manager->lumiBlockNumber(), 0.0); + } - if ( measPerigee->pT()/1000.0 > 5.0 && fabs(measPerigee->eta()) < 2.5) passQualityCut = true; + if ((*trackStateOnSurfaceIterator)->type(Trk::TrackStateOnSurface::Hole)) { + clus = dynamic_cast<const InDet::SiClusterOnTrack *>((*trackStateOnSurfaceIterator)->measurementOnTrack()); + if (clus) clusID = clus->identify(); + nHole = 1.0; - 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 (m_tsos_outliermap) m_tsos_outliermap->fill(surfaceID, m_pixelid); + if (m_tsos_hiteff_vs_lumi) m_tsos_hiteff_vs_lumi->fill(m_manager->lumiBlockNumber(), 0., surfaceID, m_pixelid); + if (m_hiteff_incl_mod[pixlayerdisk] && pass1hole2GeVTightCut) m_hiteff_incl_mod[pixlayerdisk]->Fill(m_manager->lumiBlockNumber(), 0.0); } - 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 (m_doOnline && m_tsos_holeratio_tmp && passQualityCut) m_tsos_holeratio_tmp->fill(surfaceID, m_pixelid, nHole); + if (passQualityCut) { + if (nOutlier + nHole > 0.) { + if (m_doOnline && m_misshits_ratio_tmp) m_misshits_ratio_tmp->fill(surfaceID, m_pixelid, 1.0); + } else { + if (m_doOnline && m_misshits_ratio_tmp) m_misshits_ratio_tmp->fill(surfaceID, m_pixelid, 0.0); + } } - /// - /// TSOS Loop - /// - 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; - - //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() ) { - ATH_MSG_INFO("pointer of TSOS to track parameters or associated surface is null"); - 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 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); - - 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); - if ( m_tsos_hiteff_vs_lumi ) m_tsos_hiteff_vs_lumi->Fill(m_manager->lumiBlockNumber(),1.,surfaceID,m_pixelid); - //if( m_hiteff_incl_mod[pixlayerdisk] && passQualityCut ) m_hiteff_incl_mod[pixlayerdisk]->Fill( m_manager->lumiBlockNumber(), 1.0 ); - if ( m_hiteff_incl_mod[pixlayerdisk] && pass1hole2GeVTightCut ) m_hiteff_incl_mod[pixlayerdisk]->Fill( m_manager->lumiBlockNumber(), 1.0 ); - } - - if ((*trackStateOnSurfaceIterator)->type(Trk::TrackStateOnSurface::Outlier)) { - clus = dynamic_cast< const InDet::SiClusterOnTrack*>((*trackStateOnSurfaceIterator)->measurementOnTrack()); - if (clus) clusID = clus->identify(); - nOutlier = 1.0; - - if ( m_tsos_holemap ) m_tsos_holemap->Fill(surfaceID, m_pixelid); - if ( m_tsos_hiteff_vs_lumi ) m_tsos_hiteff_vs_lumi->Fill(m_manager->lumiBlockNumber(),0.,surfaceID,m_pixelid); - //if( m_hiteff_incl_mod[pixlayerdisk] && passQualityCut ) m_hiteff_incl_mod[pixlayerdisk]->Fill( m_manager->lumiBlockNumber(), 0.0 ); - if ( m_hiteff_incl_mod[pixlayerdisk] && pass1hole2GeVTightCut ) m_hiteff_incl_mod[pixlayerdisk]->Fill( m_manager->lumiBlockNumber(), 0.0 ); - } - - if ((*trackStateOnSurfaceIterator)->type(Trk::TrackStateOnSurface::Hole)) { - clus = dynamic_cast< const InDet::SiClusterOnTrack*>((*trackStateOnSurfaceIterator)->measurementOnTrack()); - if (clus) clusID = clus->identify(); - nHole = 1.0; - - if ( m_tsos_outliermap) m_tsos_outliermap->Fill(surfaceID, m_pixelid); - if ( m_tsos_hiteff_vs_lumi) m_tsos_hiteff_vs_lumi->Fill(m_manager->lumiBlockNumber(),0.,surfaceID,m_pixelid); - //if( m_hiteff_incl_mod[pixlayerdisk] && passQualityCut ) m_hiteff_incl_mod[pixlayerdisk]->Fill( m_manager->lumiBlockNumber(), 0.0 ); - if ( m_hiteff_incl_mod[pixlayerdisk] && pass1hole2GeVTightCut ) m_hiteff_incl_mod[pixlayerdisk]->Fill( m_manager->lumiBlockNumber(), 0.0 ); - } - - - //if(m_tsos_measratio && passQualityCut) m_tsos_measratio->Fill(surfaceID,m_pixelid,nMeasurement); - //if(m_tsos_holeratio && passQualityCut) m_tsos_holeratio->Fill(surfaceID,m_pixelid,nHole); - if (m_doOnline && m_tsos_holeratio_tmp && passQualityCut) m_tsos_holeratio_tmp->Fill(surfaceID,m_pixelid,nHole); - if (passQualityCut) { - if (nOutlier + nHole > 0.) { - if (m_misshits_ratio) m_misshits_ratio->Fill(surfaceID,m_pixelid,1.0); - if (m_doOnline && m_misshits_ratio_tmp) m_misshits_ratio_tmp->Fill(surfaceID,m_pixelid,1.0); - } else { - if (m_misshits_ratio) m_misshits_ratio->Fill(surfaceID,m_pixelid,0.0); - if (m_doOnline && m_misshits_ratio_tmp) m_misshits_ratio_tmp->Fill(surfaceID,m_pixelid,0.0); - } - } - - /// - /// PixelClusters are valid - /// - if (!(*trackStateOnSurfaceIterator)->type(Trk::TrackStateOnSurface::Measurement)) continue; - if (!clus) continue; - const InDet::SiCluster *RawDataClus = dynamic_cast< const InDet::SiCluster*>(clus->prepRawData()); - if (!RawDataClus) continue; - if (!RawDataClus->detectorElement()->isPixel()) continue; - - nPixelHits++; //add another pixel hit - for (unsigned int loopSize=0;loopSize < RawDataClus->rdoList().size(); loopSize++) { - if (m_doOnTrack) m_RDOIDs.push_back(RawDataClus->rdoList().at(loopSize)); - } - if (m_doOnTrack) m_ClusterIDs.push_back( clus->identify()); - - const InDet::PixelCluster* pixelCluster = dynamic_cast<const InDet::PixelCluster*>(RawDataClus); - if (pixelCluster) { - /// - /// Pixel Cluster Selection - /// - if ( !RawDataClus->gangedPixel() && /// not include ganged-pixel - !pixelCluster->isFake() && /// not fake - ( (pixlayer == PixLayer::kIBL && fabs(clus->localParameters()[Trk::locX])<8.3) - || (pixlayer != PixLayer::kIBL && fabs(clus->localParameters()[Trk::locX])<8.1) ) && - ( (pixlayeribl2d3d == PixLayerIBL2D3D::kIBL2D && fabs(clus->localParameters()[Trk::locY])<19.7) - || (pixlayeribl2d3d == PixLayerIBL2D3D::kIBL3D && fabs(clus->localParameters()[Trk::locY])<9.5) - || (pixlayer != PixLayer::kIBL && fabs(clus->localParameters()[Trk::locY])<28.7) ) - ){ - passClusterSelection = true; - } - /// - /// Cluster Variables - /// - npixHitsInCluster = pixelCluster->rdoList().size(); - //colWidthOfCluster = pixelCluster->width().colRow().y(); - rowWidthOfCluster = pixelCluster->width().colRow().x(); - totalToTOfCluster = pixelCluster->totalToT(); - - if ( npixHitsInCluster == 1 && totalToTOfCluster < 8) { nbadclus++; } - else { ngoodclus++; } - - if (m_doModules && !m_doOnline) { //indirectly disabled - if (measPerigee) { - float pt = measPerigee->pT()/1000.0; - if (m_clustot_vs_pt) m_clustot_vs_pt->Fill(pt, totalToTOfCluster); - if (pt<10) { - if (m_clustot_lowpt) m_clustot_lowpt->Fill(totalToTOfCluster); - if (npixHitsInCluster==1){ if(m_1hitclustot_lowpt) m_1hitclustot_lowpt->Fill(totalToTOfCluster);} - if (npixHitsInCluster==2){ if(m_2hitclustot_lowpt) m_2hitclustot_lowpt->Fill(totalToTOfCluster);} - } else { - if (m_clustot_highpt) m_clustot_highpt->Fill(totalToTOfCluster); - if (npixHitsInCluster==1){ if(m_1hitclustot_highpt) m_1hitclustot_highpt->Fill(totalToTOfCluster);} - if (npixHitsInCluster==2){ if(m_2hitclustot_highpt) m_2hitclustot_highpt->Fill(totalToTOfCluster);} - } - } - } - } - - - /// - /// Get track parameters for current surface (with AtaPlane) - /// - trkParameters = (*trackStateOnSurfaceIterator)->trackParameters(); - const Trk::AtaPlane *trackAtPlane = dynamic_cast<const Trk::AtaPlane*>(trkParameters); - if (trackAtPlane) - { - const Amg::Vector2D localpos = trackAtPlane->localPosition(); - - // Get local error matrix for hit and track and calc pull - const AmgSymMatrix(5) trackErrMat = (*trackAtPlane->covariance()); - const Amg::MatrixX clusErrMat = clus->localCovariance(); - - //pulls and residuals Phi - double error_sum = sqrt(pow(Amg::error(trackErrMat,Trk::locX),2) + pow(Amg::error(clusErrMat,Trk::locX), 2)); - double res = clus->localParameters()[Trk::locX]-localpos[0]; - if (m_track_res_phi) m_track_res_phi->Fill(res); - double pull = 0; - if (error_sum != 0) pull = (res)/error_sum; - if (m_track_pull_phi) m_track_pull_phi->Fill(pull); - - //pulls and residuals Eta - error_sum = sqrt(pow(Amg::error(trackErrMat,Trk::locY),2) + pow(Amg::error(clusErrMat,Trk::locY), 2)); - res = clus->localParameters()[Trk::locY]-localpos[1]; - if (m_track_res_eta) m_track_res_eta->Fill(res); - if (error_sum != 0) pull = (res)/error_sum; - if (m_track_pull_eta) m_track_pull_eta->Fill(pull); - - /// LorentzAngle - Amg::Vector3D mynormal = side->normal(); - Amg::Vector3D myphiax = side->phiAxis(); - Amg::Vector3D mytrack = trackAtPlane->momentum(); - double trkphicomp = mytrack.dot(myphiax); - double trknormcomp = mytrack.dot(mynormal); - double phiIncident = atan2(trkphicomp,trknormcomp); - if (npixHitsInCluster > 0 && passTightCut && passClusterSelection){ - if (pixlayer == PixLayer::kIBL && m_LorentzAngle_IBL) m_LorentzAngle_IBL->Fill(phiIncident, m_pixelid->phi_module(surfaceID), 1.0*rowWidthOfCluster); - if (pixlayeribl2d3d == PixLayerIBL2D3D::kIBL2D && m_LorentzAngle_IBL2D) m_LorentzAngle_IBL2D->Fill(phiIncident, m_pixelid->phi_module(surfaceID), 1.0*rowWidthOfCluster); - if (pixlayeribl2d3d == PixLayerIBL2D3D::kIBL3D && m_LorentzAngle_IBL3D) m_LorentzAngle_IBL3D->Fill(phiIncident, m_pixelid->phi_module(surfaceID), 1.0*rowWidthOfCluster); - if (pixlayer == PixLayer::kB0 && m_LorentzAngle_B0) m_LorentzAngle_B0->Fill(phiIncident, m_pixelid->phi_module(surfaceID), 1.0*rowWidthOfCluster); - if (pixlayer == PixLayer::kB1 && m_LorentzAngle_B1) m_LorentzAngle_B1->Fill(phiIncident, m_pixelid->phi_module(surfaceID), 1.0*rowWidthOfCluster); - if (pixlayer == PixLayer::kB2 && m_LorentzAngle_B2) m_LorentzAngle_B2->Fill(phiIncident, m_pixelid->phi_module(surfaceID), 1.0*rowWidthOfCluster); + if (!(*trackStateOnSurfaceIterator)->type(Trk::TrackStateOnSurface::Measurement)) continue; + if (!clus) continue; + const InDet::SiCluster *RawDataClus = dynamic_cast<const InDet::SiCluster *>(clus->prepRawData()); + if (!RawDataClus) continue; + if (!RawDataClus->detectorElement()->isPixel()) continue; + + nPixelHits++; //add another pixel hit + for (unsigned int loopSize = 0; loopSize < RawDataClus->rdoList().size(); loopSize++) { + if (m_doOnTrack) m_RDOIDs.push_back(RawDataClus->rdoList().at(loopSize)); + } + if (m_doOnTrack) m_ClusterIDs.push_back(clus->identify()); + + const InDet::PixelCluster *pixelCluster = dynamic_cast<const InDet::PixelCluster *>(RawDataClus); + if (pixelCluster) { + if (!RawDataClus->gangedPixel() && // not include ganged-pixel + !pixelCluster->isFake() && // not fake + ((pixlayer == PixLayer::kIBL && fabs(clus->localParameters()[Trk::locX]) < 8.3) || (pixlayer != PixLayer::kIBL && fabs(clus->localParameters()[Trk::locX]) < 8.1)) && + ((pixlayeribl2d3d == PixLayerIBL2D3D::kIBL2D && fabs(clus->localParameters()[Trk::locY]) < 19.7) || (pixlayeribl2d3d == PixLayerIBL2D3D::kIBL3D && fabs(clus->localParameters()[Trk::locY]) < 9.5) || (pixlayer != PixLayer::kIBL && fabs(clus->localParameters()[Trk::locY]) < 28.7))) { + passClusterSelection = true; + } + + npixHitsInCluster = pixelCluster->rdoList().size(); + rowWidthOfCluster = pixelCluster->width().colRow().x(); + totalToTOfCluster = pixelCluster->totalToT(); + + if (npixHitsInCluster == 1 && totalToTOfCluster < 8) { + nbadclus++; + } else { + ngoodclus++; + } + + if (m_doModules && !m_doOnline) { // indirectly disabled + if (measPerigee) { + float pt = measPerigee->pT() / 1000.0; + if (m_clustot_vs_pt) m_clustot_vs_pt->Fill(pt, totalToTOfCluster); + if (pt < 10) { + if (m_clustot_lowpt) m_clustot_lowpt->Fill(totalToTOfCluster); + if (npixHitsInCluster == 1) { + if (m_1hitclustot_lowpt) m_1hitclustot_lowpt->Fill(totalToTOfCluster); + } + if (npixHitsInCluster == 2) { + if (m_2hitclustot_lowpt) m_2hitclustot_lowpt->Fill(totalToTOfCluster); + } + } else { + if (m_clustot_highpt) m_clustot_highpt->Fill(totalToTOfCluster); + if (npixHitsInCluster == 1) { + if (m_1hitclustot_highpt) m_1hitclustot_highpt->Fill(totalToTOfCluster); + } + if (npixHitsInCluster == 2) { + if (m_2hitclustot_highpt) m_2hitclustot_highpt->Fill(totalToTOfCluster); + } } - } - } // end of TSOS loop - - if (m_doModules && !m_doOnline) { //indirectly disabled - float pt = measPerigee->pT()/1000.0; - if (nbadclus==1) { - if (m_track_chi2_bcl1 && track0->fitQuality()->numberDoF() != 0) m_track_chi2_bcl1->Fill(track0->fitQuality()->chiSquared()/track0->fitQuality()->numberDoF()); - } - if (nbadclus==0) { - if (m_track_chi2_bcl0 && track0->fitQuality()->numberDoF() != 0) m_track_chi2_bcl0->Fill(track0->fitQuality()->chiSquared()/track0->fitQuality()->numberDoF()); - } - if (nbadclus>1) { - if (m_track_chi2_bclgt1 && track0->fitQuality()->numberDoF() != 0) m_track_chi2_bclgt1->Fill(track0->fitQuality()->chiSquared()/track0->fitQuality()->numberDoF()); - } - if (pt>=10) { - if (nbadclus==1) { - if (m_track_chi2_bcl1_highpt && track0->fitQuality()->numberDoF() != 0) m_track_chi2_bcl1_highpt->Fill(track0->fitQuality()->chiSquared()/track0->fitQuality()->numberDoF()); - } - if (nbadclus==0) { - if (m_track_chi2_bcl1_highpt && track0->fitQuality()->numberDoF() != 0) m_track_chi2_bcl0_highpt->Fill(track0->fitQuality()->chiSquared()/track0->fitQuality()->numberDoF()); - } - if (nbadclus>1) { - if (m_track_chi2_bclgt1_highpt && track0->fitQuality()->numberDoF() != 0) m_track_chi2_bclgt1_highpt->Fill(track0->fitQuality()->chiSquared()/track0->fitQuality()->numberDoF()); - } - } + } + } } - - if (nPixelHits>0) - { - m_ntracksPerEvent++; - } - - if (m_doHoleSearch && !m_doOnline && nholes>0) delete track; - } // end of track loop - - - /// - /// Fill histograms per event - /// - - if (m_tracksPerEvt_per_lumi) m_tracksPerEvt_per_lumi->Fill(m_manager->lumiBlockNumber(), m_ntracksPerEvent); - - if (m_doOnTrack) { - sort( m_RDOIDs.begin(), m_RDOIDs.end() ); - sort( m_ClusterIDs.begin(), m_ClusterIDs.end() ); - } - - if (m_doOnline) { - if (m_doRefresh5min) { - if (m_tsos_holeratio_mon && m_tsos_holeratio_tmp) m_tsos_holeratio_mon->Fill2DMon(m_tsos_holeratio_tmp.get()); - if (m_misshits_ratio_mon && m_misshits_ratio_tmp) m_misshits_ratio_mon->Fill2DMon(m_misshits_ratio_tmp.get()); + + trkParameters = (*trackStateOnSurfaceIterator)->trackParameters(); + const Trk::AtaPlane *trackAtPlane = dynamic_cast<const Trk::AtaPlane *>(trkParameters); + if (trackAtPlane) { + const Amg::Vector2D localpos = trackAtPlane->localPosition(); + + // Get local error matrix for hit and track and calc pull + const AmgSymMatrix(5) trackErrMat = (*trackAtPlane->covariance()); + const Amg::MatrixX clusErrMat = clus->localCovariance(); + + double error_sum = sqrt(pow(Amg::error(trackErrMat, Trk::locX), 2) + pow(Amg::error(clusErrMat, Trk::locX), 2)); + double res = clus->localParameters()[Trk::locX] - localpos[0]; + if (m_track_res_phi) m_track_res_phi->Fill(res); + double pull = 0; + if (error_sum != 0) pull = (res) / error_sum; + if (m_track_pull_phi) m_track_pull_phi->Fill(pull); + + error_sum = sqrt(pow(Amg::error(trackErrMat, Trk::locY), 2) + pow(Amg::error(clusErrMat, Trk::locY), 2)); + res = clus->localParameters()[Trk::locY] - localpos[1]; + if (m_track_res_eta) m_track_res_eta->Fill(res); + if (error_sum != 0) pull = (res) / error_sum; + if (m_track_pull_eta) m_track_pull_eta->Fill(pull); + + Amg::Vector3D mynormal = side->normal(); + Amg::Vector3D myphiax = side->phiAxis(); + Amg::Vector3D mytrack = trackAtPlane->momentum(); + double trkphicomp = mytrack.dot(myphiax); + double trknormcomp = mytrack.dot(mynormal); + double phiIncident = atan2(trkphicomp, trknormcomp); + if (npixHitsInCluster > 0 && passTightCut && passClusterSelection) { + if (pixlayer == PixLayer::kIBL && m_LorentzAngle_IBL) m_LorentzAngle_IBL->Fill(phiIncident, m_pixelid->phi_module(surfaceID), 1.0 * rowWidthOfCluster); + if (pixlayeribl2d3d == PixLayerIBL2D3D::kIBL2D && m_LorentzAngle_IBL2D) m_LorentzAngle_IBL2D->Fill(phiIncident, m_pixelid->phi_module(surfaceID), 1.0 * rowWidthOfCluster); + if (pixlayeribl2d3d == PixLayerIBL2D3D::kIBL3D && m_LorentzAngle_IBL3D) m_LorentzAngle_IBL3D->Fill(phiIncident, m_pixelid->phi_module(surfaceID), 1.0 * rowWidthOfCluster); + if (pixlayer == PixLayer::kB0 && m_LorentzAngle_B0) m_LorentzAngle_B0->Fill(phiIncident, m_pixelid->phi_module(surfaceID), 1.0 * rowWidthOfCluster); + if (pixlayer == PixLayer::kB1 && m_LorentzAngle_B1) m_LorentzAngle_B1->Fill(phiIncident, m_pixelid->phi_module(surfaceID), 1.0 * rowWidthOfCluster); + if (pixlayer == PixLayer::kB2 && m_LorentzAngle_B2) m_LorentzAngle_B2->Fill(phiIncident, m_pixelid->phi_module(surfaceID), 1.0 * rowWidthOfCluster); + } } - } + } // end of TSOS loop + if (m_doModules && !m_doOnline) { // indirectly disabled + float pt = measPerigee->pT() / 1000.0; + if (nbadclus == 1) { + if (m_track_chi2_bcl1 && track0->fitQuality()->numberDoF() != 0) m_track_chi2_bcl1->Fill(track0->fitQuality()->chiSquared() / track0->fitQuality()->numberDoF()); + } + if (nbadclus == 0) { + if (m_track_chi2_bcl0 && track0->fitQuality()->numberDoF() != 0) m_track_chi2_bcl0->Fill(track0->fitQuality()->chiSquared() / track0->fitQuality()->numberDoF()); + } + if (nbadclus > 1) { + if (m_track_chi2_bclgt1 && track0->fitQuality()->numberDoF() != 0) m_track_chi2_bclgt1->Fill(track0->fitQuality()->chiSquared() / track0->fitQuality()->numberDoF()); + } + if (pt >= 10) { + if (nbadclus == 1) { + if (m_track_chi2_bcl1_highpt && track0->fitQuality()->numberDoF() != 0) m_track_chi2_bcl1_highpt->Fill(track0->fitQuality()->chiSquared() / track0->fitQuality()->numberDoF()); + } + if (nbadclus == 0) { + if (m_track_chi2_bcl1_highpt && track0->fitQuality()->numberDoF() != 0) m_track_chi2_bcl0_highpt->Fill(track0->fitQuality()->chiSquared() / track0->fitQuality()->numberDoF()); + } + if (nbadclus > 1) { + if (m_track_chi2_bclgt1_highpt && track0->fitQuality()->numberDoF() != 0) m_track_chi2_bclgt1_highpt->Fill(track0->fitQuality()->chiSquared() / track0->fitQuality()->numberDoF()); + } + } + } - return StatusCode::SUCCESS; -} + if (nPixelHits > 0) { + m_ntracksPerEvent++; + } + + if (m_doHoleSearch && !m_doOnline && nholes > 0) delete track; + } // end of track loop + + if (m_tracksPerEvt_per_lumi) m_tracksPerEvt_per_lumi->Fill(m_manager->lumiBlockNumber(), m_ntracksPerEvent); -StatusCode PixelMainMon::ProcTrackMon(void) -{ + if (m_doOnTrack) { + sort(m_RDOIDs.begin(), m_RDOIDs.end()); + sort(m_ClusterIDs.begin(), m_ClusterIDs.end()); + } + + if (m_doOnline) { + if (m_doRefresh5min) { + if (m_tsos_holeratio_mon && m_tsos_holeratio_tmp) m_tsos_holeratio_mon->fill2DMon(m_tsos_holeratio_tmp.get()); + if (m_misshits_ratio_mon && m_misshits_ratio_tmp) m_misshits_ratio_mon->fill2DMon(m_misshits_ratio_tmp.get()); + } + } + + return StatusCode::SUCCESS; +} + +StatusCode PixelMainMon::procTrackMon(void) { double lengthLB = 0; lengthLB = m_LBendTime - m_LBstartTime; if (lengthLB <= 0) { - ATH_MSG_INFO("Luminosity block has length <= 0 sec, cannot calculate track rate."); - return StatusCode::SUCCESS; //if LB length is zero, the rest is pointless and would divide by 0 + ATH_MSG_INFO("Luminosity block has length <= 0 sec, cannot calculate track rate."); + return StatusCode::SUCCESS; } - - //if(m_trackRate_per_lumi) { - // if(m_tracks_per_lumi) double ntrkLB = m_tracks_per_lumi->GetBinContent(m_manager->lumiBlockNumber()+1); //value LB number corresponds to bin nbr (m_lumiBlockNum+1) - // double trackRateLB = (double) ntrkLB/lengthLB; - // m_trackRate_per_lumi->Fill(m_manager->lumiBlockNumber(),trackRateLB); - //} - //for(int i=0; i<PixLayer::COUNT-1+(int)(m_doIBL); i++){ - for (int i=0; i<PixLayerDisk::COUNT; i++){ - if (m_hiteff_incl_mod[i]) m_hiteff_incl_mod[i]->SetMinimum(0.8); - if (m_hiteff_incl_mod[i]) m_hiteff_incl_mod[i]->SetMaximum(1.01); + + for (int i = 0; i < PixLayerDisk::COUNT; i++) { + if (m_hiteff_incl_mod[i]) m_hiteff_incl_mod[i]->SetMinimum(0.8); + if (m_hiteff_incl_mod[i]) m_hiteff_incl_mod[i]->SetMaximum(1.01); } - return StatusCode::SUCCESS; + return StatusCode::SUCCESS; }