Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-03-17 10:56:38

0001 #ifndef _SiStripTrackerMapCreator_h_
0002 #define _SiStripTrackerMapCreator_h_
0003 
0004 #include "CalibFormats/SiStripObjects/interface/SiStripDetCabling.h"
0005 #include "CalibTracker/SiStripCommon/interface/TkDetMap.h"
0006 #include "CommonTools/TrackerMap/interface/TrackerMap.h"
0007 #include "DQMServices/Core/interface/DQMStore.h"
0008 #include "FWCore/Framework/interface/ESHandle.h"
0009 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0010 
0011 #include <TTree.h>
0012 #include <fstream>
0013 #include <map>
0014 #include <memory>
0015 #include <string>
0016 #include <vector>
0017 
0018 class TkDetMap;
0019 class TrackerTopology;
0020 class SiStripQuality;
0021 class GeometricDet;
0022 
0023 class SiStripTrackerMapCreator {
0024 public:
0025   typedef dqm::harvesting::MonitorElement MonitorElement;
0026   typedef dqm::harvesting::DQMStore DQMStore;
0027 
0028   SiStripTrackerMapCreator(const SiStripDetCabling* detCabling, const TkDetMap* tkDetMap, const TrackerTopology* tTopo);
0029   bool readConfiguration();
0030 
0031   void create(edm::ParameterSet const& tkmapPset, DQMStore& dqm_store, std::string const& htype);
0032   void createForOffline(edm::ParameterSet const& tkmapPset,
0033                         DQMStore& dqm_store,
0034                         std::string& htype,
0035                         const SiStripQuality*);
0036   void createInfoFile(std::vector<std::string> const& map_names,
0037                       TTree* tkinfo_tree,
0038                       DQMStore& dqm_store,
0039                       const GeometricDet* geomDet);
0040 
0041 private:
0042   void paintTkMapFromAlarm(uint32_t det_id,
0043                            DQMStore& dqm_store,
0044                            bool isBad,
0045                            std::map<unsigned int, std::string>& badmodmap);
0046   void setTkMapFromHistogram(DQMStore& dqm_store, std::string const& htype);
0047   void setTkMapFromAlarm(DQMStore& dqm_store, const SiStripQuality* stripQuality);
0048   uint16_t getDetectorFlagAndComment(DQMStore* dqm_store, uint32_t det_id, std::ostringstream& comment);
0049 
0050   void paintTkMapFromHistogram(MonitorElement const* me,
0051                                std::string const& map_type,
0052                                std::vector<std::pair<float, uint32_t>>* topNmodVec);
0053   void setTkMapRange(std::string const& map_type);
0054   void setTkMapRangeOffline();
0055   uint16_t getDetectorFlag(uint32_t const det_id) {
0056     return detFlag_.find(det_id) != detFlag_.end() ? detFlag_[det_id] : 0;
0057   }
0058   void printBadModuleList(std::map<unsigned int, std::string> const& badmodmap);
0059   void printTopModules(std::vector<std::pair<float, uint32_t>>& topNmodVec);
0060 
0061   std::unique_ptr<TrackerMap> trackerMap_{nullptr};
0062   std::string sRunNumber;
0063   std::string tkMapName_;
0064   std::string stripTopLevelDir_{};
0065 
0066   float tkMapMax_;
0067   float tkMapMin_;
0068   float meanToMaxFactor_{2.5};
0069   bool ResidualsRMS_;
0070   int nDet_;
0071   const SiStripDetCabling* detCabling_;
0072   TkDetMap const* tkDetMap_;
0073   const TrackerTopology* tTopo_;
0074   DetId cachedDetId_{};
0075   int16_t cachedLayer_{};
0076   std::map<uint32_t, uint16_t> detFlag_;
0077   TkLayerMap::XYbin cachedXYbin_;
0078   bool topModules_;
0079   uint32_t numTopModules_;
0080   std::string topModLabel_;
0081 };
0082 #endif