CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Private Attributes
SiStripPopConBadComponentsHandlerFromDQM Class Reference
Inheritance diagram for SiStripPopConBadComponentsHandlerFromDQM:
SiStripDQMPopConSourceHandler< SiStripBadStrip > popcon::PopConSourceHandler< SiStripBadStrip >

Public Member Functions

void dqmEndJob (DQMStore::IBooker &booker, DQMStore::IGetter &getter) override
 
SiStripBadStripgetObj () const override
 
void initES (const edm::EventSetup &) override
 
 SiStripPopConBadComponentsHandlerFromDQM (const edm::ParameterSet &iConfig)
 
 ~SiStripPopConBadComponentsHandlerFromDQM () override
 
- Public Member Functions inherited from SiStripDQMPopConSourceHandler< SiStripBadStrip >
virtual bool checkForCompatibility (const std::string otherMetaData) const
 
void getNewObjects () override
 
std::string id () const override
 
 SiStripDQMPopConSourceHandler (const edm::ParameterSet &pset)
 
 ~SiStripDQMPopConSourceHandler () override
 
- Public Member Functions inherited from popcon::PopConSourceHandler< SiStripBadStrip >
void convertFromOld ()
 
SummarydummySummary (typename OldContainer::value_type const &) const
 
void initialize (const cond::persistency::Session &dbSession, cond::TagInfo_t const &tagInfo, cond::LogDBEntry_t const &logDBEntry)
 
Ref lastPayload () const
 
cond::LogDBEntry_t const & logDBEntry () const
 
std::pair< Container const *, std::string const > operator() (const cond::persistency::Session &session, cond::TagInfo_t const &tagInfo, cond::LogDBEntry_t const &logDBEntry) const
 
 PopConSourceHandler ()
 
Container const & returnData ()
 
void sort ()
 
cond::TagInfo_t const & tagInfo () const
 
std::string const & userTextLog () const
 
virtual ~PopConSourceHandler ()
 

Protected Member Functions

std::string getMetaDataString () const override
 
- Protected Member Functions inherited from SiStripDQMPopConSourceHandler< SiStripBadStrip >
uint32_t getRunNumber () const
 
- Protected Member Functions inherited from popcon::PopConSourceHandler< SiStripBadStrip >
int add (value_type *payload, Summary *summary, Time_t time)
 
cond::persistency::SessiondbSession () const
 

Private Attributes

edm::FileInPath fp_
 
SiStripBadStrip m_obj
 
const TrackerTopologytrackerTopo_
 

Additional Inherited Members

- Public Types inherited from popcon::PopConSourceHandler< SiStripBadStrip >
typedef std::vector< Triplet > Container
 
typedef std::vector< std::pair< SiStripBadStrip *, cond::Time_t > > OldContainer
 
typedef PopConSourceHandler< SiStripBadStripself
 
typedef cond::Summary Summary
 
typedef cond::Time_t Time_t
 
typedef SiStripBadStrip value_type
 
- Protected Attributes inherited from popcon::PopConSourceHandler< SiStripBadStrip >
OldContainer m_to_transfer
 
std::string m_userTextLog
 

Detailed Description

Definition at line 10 of file SiStripPopConBadComponentsDQM.cc.

Constructor & Destructor Documentation

SiStripPopConBadComponentsHandlerFromDQM::SiStripPopConBadComponentsHandlerFromDQM ( const edm::ParameterSet iConfig)
explicit

Definition at line 34 of file SiStripPopConBadComponentsDQM.cc.

References edm::ParameterSet::getUntrackedParameter().

36  , fp_{iConfig.getUntrackedParameter<edm::FileInPath>("file", edm::FileInPath("CalibTracker/SiStripCommon/data/SiStripDetInfo.dat"))}
37 {
38  edm::LogInfo("SiStripBadComponentsDQMService") << "[SiStripBadComponentsDQMService::SiStripBadComponentsDQMService]";
39 }
T getUntrackedParameter(std::string const &, T const &) const
SiStripPopConBadComponentsHandlerFromDQM::~SiStripPopConBadComponentsHandlerFromDQM ( )
override

Definition at line 41 of file SiStripPopConBadComponentsDQM.cc.

42 {
43  edm::LogInfo("SiStripBadComponentsDQMService") << "[SiStripBadComponentsDQMService::~SiStripBadComponentsDQMService]";
44 }

Member Function Documentation

void SiStripPopConBadComponentsHandlerFromDQM::dqmEndJob ( DQMStore::IBooker booker,
DQMStore::IGetter getter 
)
overridevirtual

Reimplemented from SiStripDQMPopConSourceHandler< SiStripBadStrip >.

Definition at line 77 of file SiStripPopConBadComponentsDQM.cc.

References DQMStore::IGetter::cd(), gather_cfg::cout, DQMStore::IGetter::dirExists(), RefreshWebPage::dname, SiStripBadStrip::encode(), RemoveAddSevLevel::flag, fp_, edm::FileInPath::fullPath(), DQMStore::IGetter::getContents(), LogDebug, m_obj, SiStripBadStrip::put(), matplotRender::reader, and AlCaHLTBitMon_QueryRunRegistry::string.

78 {
79  //*LOOP OVER THE LIST OF SUMMARY OBJECTS TO INSERT IN DB*//
80 
82 
84 
85  getter.cd();
86 
87  const std::string mechanicalview_dir = "MechanicalView";
88  if ( ! getter.dirExists(mechanicalview_dir) ) return;
89 
90  const std::vector<std::string> subdet_folder = { "TIB", "TOB", "TEC/side_1", "TEC/side_2", "TID/side_1", "TID/side_2" };
91 
92  int nDetsTotal = 0;
93  int nDetsWithErrorTotal = 0;
94  for ( const auto& im : subdet_folder ) {
95  const std::string dname = mechanicalview_dir + "/" + im;
96  getter.cd();
97  if ( ! getter.dirExists(dname) ) continue;
98  getter.cd(dname);
99 
100  std::vector<std::string> module_folders;
101  getModuleFolderList(getter, dname, module_folders);
102  int nDets = module_folders.size();
103 
104  int nDetsWithError = 0;
105  const std::string bad_module_folder = dname + "/" + "BadModuleList";
106  getter.cd();
107  if ( getter.dirExists(bad_module_folder) ) {
108  for ( const MonitorElement* me : getter.getContents(bad_module_folder) ) {
109  nDetsWithError++;
110  std::cout << me->getName() << " " << me->getIntValue() << std::endl;
111  uint32_t detId = std::stoul(me->getName());
112  short flag = me->getIntValue();
113 
114  std::vector<unsigned int> theSiStripVector;
115 
116  unsigned short firstBadStrip=0, NconsecutiveBadStrips=0;
117  unsigned int theBadStripRange;
118 
119  // for(std::vector<uint32_t>::const_iterator is=BadApvList_.begin(); is!=BadApvList_.end(); ++is){
120 
121  // firstBadStrip=(*is)*128;
122  NconsecutiveBadStrips=reader.getNumberOfApvsAndStripLength(detId).first*128;
123 
124  theBadStripRange = m_obj.encode(firstBadStrip,NconsecutiveBadStrips,flag);
125 
126  LogDebug("SiStripBadComponentsDQMService") << "detid " << detId << " \t"
127  << ", flag " << flag
128  << std::endl;
129 
130  theSiStripVector.push_back(theBadStripRange);
131  // }
132 
133  SiStripBadStrip::Range range(theSiStripVector.begin(),theSiStripVector.end());
134  if ( ! m_obj.put(detId,range) ) {
135  edm::LogError("SiStripBadFiberBuilder")<<"[SiStripBadFiberBuilder::analyze] detid already exists"<<std::endl;
136  }
137  }
138  }
139  nDetsTotal += nDets;
140  nDetsWithErrorTotal += nDetsWithError;
141  }
142  getter.cd();
143 }
#define LogDebug(id)
std::vector< MonitorElement * > getContents(Args &&...args)
Definition: DQMStore.h:305
bool dirExists(const std::string &path)
Definition: DQMStore.cc:337
std::pair< ContainerIterator, ContainerIterator > Range
std::string fullPath() const
Definition: FileInPath.cc:197
bool put(const uint32_t &detID, const InputVector &vect)
unsigned int encode(const unsigned short &first, const unsigned short &NconsecutiveBadStrips, const unsigned short &flag=0)
std::string SiStripPopConBadComponentsHandlerFromDQM::getMetaDataString ( ) const
overrideprotectedvirtual

Reimplemented from SiStripDQMPopConSourceHandler< SiStripBadStrip >.

Definition at line 53 of file SiStripPopConBadComponentsDQM.cc.

References DQMStore::IGetter::cd(), getObj(), DQMStore::IGetter::getSubdirs(), SiStripBadStrip::printSummary(), alignCSCRings::pwd, AlCaHLTBitMon_QueryRunRegistry::string, and trackerTopo_.

54 {
55  std::stringstream ss;
56  ss << SiStripDQMPopConSourceHandler<SiStripBadStrip>::getMetaDataString();
58  return ss.str();
59 }
void printSummary(std::stringstream &ss, const TrackerTopology *trackerTopo) const
SiStripBadStrip * SiStripPopConBadComponentsHandlerFromDQM::getObj ( ) const
overridevirtual
void SiStripPopConBadComponentsHandlerFromDQM::initES ( const edm::EventSetup setup)
overridevirtual

Member Data Documentation

edm::FileInPath SiStripPopConBadComponentsHandlerFromDQM::fp_
private

Definition at line 22 of file SiStripPopConBadComponentsDQM.cc.

Referenced by dqmEndJob().

SiStripBadStrip SiStripPopConBadComponentsHandlerFromDQM::m_obj
private

Definition at line 23 of file SiStripPopConBadComponentsDQM.cc.

Referenced by dqmEndJob(), and getObj().

const TrackerTopology* SiStripPopConBadComponentsHandlerFromDQM::trackerTopo_
private

Definition at line 24 of file SiStripPopConBadComponentsDQM.cc.

Referenced by getMetaDataString(), and initES().