CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
SiStripHitEfficiencyHarvester Class Reference
Inheritance diagram for SiStripHitEfficiencyHarvester:
DQMEDHarvester edm::one::EDProducer< edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::EndProcessBlockProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns, edm::one::SharedResources, edm::Accumulator > edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

void dqmEndJob (DQMStore::IBooker &, DQMStore::IGetter &) override
 
void endRun (edm::Run const &, edm::EventSetup const &) override
 
 SiStripHitEfficiencyHarvester (const edm::ParameterSet &)
 
 ~SiStripHitEfficiencyHarvester () override=default
 
- Public Member Functions inherited from DQMEDHarvester
void accumulate (edm::Event const &ev, edm::EventSetup const &es) final
 
void beginJob () override
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &) final
 
void beginRun (edm::Run const &run, edm::EventSetup const &) override
 
virtual void dqmAnalyze (DQMStore::IBooker &, DQMStore::IGetter &, edm::Event const &, edm::EventSetup const &)
 
 DQMEDHarvester (edm::ParameterSet const &iConfig)
 
 DQMEDHarvester ()
 
virtual void dqmEndLuminosityBlock (DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void dqmEndRun (DQMStore::IBooker &, DQMStore::IGetter &, edm::Run const &, edm::EventSetup const &)
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
void endLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &es) final
 
void endProcessBlockProduce (edm::ProcessBlock &) final
 
void endRun (edm::Run const &, edm::EventSetup const &) override
 
void endRunProduce (edm::Run &run, edm::EventSetup const &es) final
 
 ~DQMEDHarvester () override=default
 
- Public Member Functions inherited from edm::one::EDProducer< edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::EndProcessBlockProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns, edm::one::SharedResources, edm::Accumulator >
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
- Public Member Functions inherited from edm::one::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
std::vector< bool > const & recordProvenanceList () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
TypeLabelList const & typeLabelList () const
 used by the fwk to register the list of products of this module More...
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::array< std::vector< ModuleDescription const *> *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const *> const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::one::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Member Functions

bool checkMapsValidity (const std::vector< MonitorElement *> &maps, const std::string &type) const
 
unsigned int countTotalHits (const std::vector< MonitorElement *> &maps)
 
void makeSummary (DQMStore::IGetter &getter, DQMStore::IBooker &booker) const
 
void makeSummaryVsBX (DQMStore::IGetter &getter, TFileService &fs) const
 
void makeSummaryVsCM (DQMStore::IGetter &getter, TFileService &fs) const
 
void makeSummaryVsLumi (DQMStore::IGetter &getter) const
 
void printAndWriteBadModules (const SiStripQuality &quality, const SiStripDetInfo &detInfo) const
 
void printTotalStatistics (const std::array< long, bounds::k_END_OF_LAYERS > &layerFound, const std::array< long, bounds::k_END_OF_LAYERS > &layerTotal) const
 
template<typename T >
void setEffBinLabels (const T gr, const T gr2, const unsigned int nLayers) const
 
void writeBadStripPayload (const SiStripQuality &quality) const
 

Private Attributes

int alllayerfound [bounds::k_END_OF_LAYS_AND_RINGS]
 
int alllayertotal [bounds::k_END_OF_LAYS_AND_RINGS]
 
const bool autoIneffModTagging_
 
SiStripHitEffData calibData_
 
const bool doStoreOnDB_
 
const bool doStoreOnTree_
 
const float effPlotMin_
 
int goodlayerfound [bounds::k_END_OF_LAYS_AND_RINGS]
 
int goodlayertotal [bounds::k_END_OF_LAYS_AND_RINGS]
 
const std::string inputFolder_
 
const bool isAtPCL_
 
const int nModsMin_
 
const unsigned int nTEClayers_
 
const std::string record_
 
const bool showEndcapSides_
 
const bool showOnlyGoodModules_
 
const bool showRings_
 
const bool showTOB6TEC9_
 
std::vector< DetIdstripDetIds_
 
std::unique_ptr< SiStripQualitystripQuality_
 
const edm::ESGetToken< SiStripQuality, SiStripQualityRcdstripQualityToken_
 
unsigned int t_DetId
 
unsigned int t_found
 
bool t_isTaggedIneff
 
unsigned char t_layer
 
float t_threshold
 
unsigned int t_total
 
const double threshold_
 
const std::string title_
 
std::unique_ptr< TkDetMaptkDetMap_
 
const edm::ESGetToken< TkDetMap, TrackerTopologyRcdtkDetMapToken_
 
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecordtkGeomToken_
 
const double tkMapMin_
 
TTree * tree
 
std::unique_ptr< TrackerTopologytTopo_
 
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcdtTopoToken_
 

Additional Inherited Members

- Public Types inherited from DQMEDHarvester
typedef dqm::harvesting::DQMStore DQMStore
 
typedef dqm::harvesting::MonitorElement MonitorElement
 
- Public Types inherited from edm::one::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
template<typename T >
using BranchAliasSetterT = ProductRegistryHelper::BranchAliasSetterT< T >
 
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex > >
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Protected Member Functions inherited from edm::ProducerBase
template<Transition Tr = Transition::Event>
auto produces (std::string instanceName) noexcept
 declare what type of product will make and with which optional label More...
 
template<Transition B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<BranchType B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
template<Transition Tr = Transition::Event>
auto produces () noexcept
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
void resetItemsToGetFrom (BranchType iType)
 
- Protected Attributes inherited from DQMEDHarvester
DQMStoredqmstore_
 
edm::GetterOfProducts< DQMTokenjobmegetter_
 
edm::EDPutTokenT< DQMTokenjobToken_
 
edm::GetterOfProducts< DQMTokenlumimegetter_
 
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::GetterOfProducts< DQMTokenrunmegetter_
 
edm::EDPutTokenT< DQMTokenrunToken_
 

Detailed Description

Definition at line 41 of file SiStripHitEfficiencyHarvester.cc.

Constructor & Destructor Documentation

◆ SiStripHitEfficiencyHarvester()

SiStripHitEfficiencyHarvester::SiStripHitEfficiencyHarvester ( const edm::ParameterSet conf)
explicit

Definition at line 100 of file SiStripHitEfficiencyHarvester.cc.

References alllayerfound, alllayertotal, goodlayerfound, goodlayertotal, and cmsLHEtoEOSManager::l.

101  : inputFolder_(conf.getParameter<std::string>("inputFolder")),
102  isAtPCL_(conf.getParameter<bool>("isAtPCL")),
103  autoIneffModTagging_(conf.getUntrackedParameter<bool>("AutoIneffModTagging", false)),
104  doStoreOnDB_(conf.getParameter<bool>("doStoreOnDB")),
105  doStoreOnTree_(conf.getUntrackedParameter<bool>("doStoreOnTree")),
106  showRings_(conf.getUntrackedParameter<bool>("ShowRings", false)),
107  showEndcapSides_(conf.getUntrackedParameter<bool>("ShowEndcapSides", true)),
108  showTOB6TEC9_(conf.getUntrackedParameter<bool>("ShowTOB6TEC9", false)),
109  showOnlyGoodModules_(conf.getUntrackedParameter<bool>("ShowOnlyGoodModules", false)),
110  nTEClayers_(showRings_ ? 7 : 9), // number of rings or wheels
111  threshold_(conf.getParameter<double>("Threshold")),
112  nModsMin_(conf.getParameter<int>("nModsMin")),
113  effPlotMin_(conf.getUntrackedParameter<double>("EffPlotMin", 0.9)),
114  tkMapMin_(conf.getUntrackedParameter<double>("TkMapMin", 0.9)),
115  title_(conf.getParameter<std::string>("Title")),
116  record_(conf.getParameter<std::string>("Record")),
117  tTopoToken_(esConsumes<edm::Transition::EndRun>()),
118  tkDetMapToken_(esConsumes<edm::Transition::EndRun>()),
119  stripQualityToken_(esConsumes<edm::Transition::EndRun>()),
120  tkGeomToken_(esConsumes<edm::Transition::EndRun>()) {
121  // zero in all counts
122  for (int l = 0; l < bounds::k_END_OF_LAYS_AND_RINGS; l++) {
123  goodlayertotal[l] = 0;
124  goodlayerfound[l] = 0;
125  alllayertotal[l] = 0;
126  alllayerfound[l] = 0;
127  }
128 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
int goodlayerfound[bounds::k_END_OF_LAYS_AND_RINGS]
int goodlayertotal[bounds::k_END_OF_LAYS_AND_RINGS]
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken_
int alllayertotal[bounds::k_END_OF_LAYS_AND_RINGS]
const edm::ESGetToken< SiStripQuality, SiStripQualityRcd > stripQualityToken_
T getUntrackedParameter(std::string const &, T const &) const
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > tkGeomToken_
int alllayerfound[bounds::k_END_OF_LAYS_AND_RINGS]
const edm::ESGetToken< TkDetMap, TrackerTopologyRcd > tkDetMapToken_

◆ ~SiStripHitEfficiencyHarvester()

SiStripHitEfficiencyHarvester::~SiStripHitEfficiencyHarvester ( )
overridedefault

Member Function Documentation

◆ checkMapsValidity()

bool SiStripHitEfficiencyHarvester::checkMapsValidity ( const std::vector< MonitorElement *> &  maps,
const std::string &  type 
) const
private

Definition at line 150 of file SiStripHitEfficiencyHarvester.cc.

References submitPVResolutionJobs::count, LogDebug, HcalDetIdTransform::transform(), and x.

Referenced by dqmEndJob().

151  {
152  std::vector<bool> isThere;
153  isThere.reserve(maps.size());
154  std::transform(maps.begin() + 1, maps.end(), std::back_inserter(isThere), [](auto& x) { return !(x == nullptr); });
155 
156  int count{0};
157  for (const auto& it : isThere) {
158  count++;
159  LogDebug("SiStripHitEfficiencyHarvester") << " layer: " << count << " " << it << std::endl;
160  if (it)
161  LogDebug("SiStripHitEfficiencyHarvester") << "resolving to " << maps[count]->getName() << std::endl;
162  }
163 
164  // check on the input TkHistoMap
165  bool areMapsAvailable{true};
166  int layerCount{0};
167  for (const auto& it : isThere) {
168  layerCount++;
169  if (!it) {
170  edm::LogError("SiStripHitEfficiencyHarvester")
171  << type << " TkHistoMap for layer " << layerCount << " was not found.\n -> Aborting!";
172  areMapsAvailable = false;
173  break;
174  }
175  }
176  return areMapsAvailable;
177 }
Log< level::Error, false > LogError
#define LogDebug(id)
unsigned transform(const HcalDetId &id, unsigned transformCode)

◆ countTotalHits()

unsigned int SiStripHitEfficiencyHarvester::countTotalHits ( const std::vector< MonitorElement *> &  maps)
private

Definition at line 179 of file SiStripHitEfficiencyHarvester.cc.

References B2GTnPMonitor_cfi::item, and dqmMemoryStats::total.

Referenced by dqmEndJob().

179  {
180  return std::accumulate(maps.begin() + 1, maps.end(), 0, [](unsigned int total, MonitorElement* item) {
181  return total + item->getEntries();
182  });
183 }

◆ dqmEndJob()

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

Implements DQMEDHarvester.

Definition at line 185 of file SiStripHitEfficiencyHarvester.cc.

References alllayerfound, alllayertotal, autoIneffModTagging_, dqm::implementation::IBooker::book1D(), calibData_, SiStripHitEffData::checkFedError(), checkMapsValidity(), countTotalHits(), makePileupJSON::denom, doStoreOnDB_, doStoreOnTree_, Exception, SiStripHitEffData::fedErrorCounts, SiStripHitEffData::FEDErrorOccupancy, SiStripHitEffData::fillMapFromTkMap(), dqm-mbProfile::format, HLT_2022v15_cff::fraction, compareTotals::fs, dqm::implementation::IGetter::get(), dqm::impl::MonitorElement::getBinContent(), goodlayerfound, goodlayertotal, mps_fire::i, inputFolder_, isAtPCL_, SiStripDetInfoFileReader::kDefaultFile, pixelTopology::layer, LogDebug, LOGPRINT, makeSummary(), makeSummaryVsLumi(), SiStripPI::max, nModsMin_, me0TriggerPseudoDigis_cff::nStrips, nTEClayers_, EgammaValidation_cff::num, or, printAndWriteBadModules(), printTotalStatistics(), SiStripDetInfoFileReader::read(), dqm::implementation::NavigatorBase::setCurrentFolder(), showRings_, AlCaHLTBitMon_QueryRunRegistry::string, stripDetIds_, stripQuality_, sistrip::STRIPS_PER_APV, t_DetId, t_found, t_isTaggedIneff, t_layer, t_threshold, t_total, threshold_, title_, tkDetMap_, tkMapMin_, tTopo_, and writeBadStripPayload().

185  {
186  if (!isAtPCL_) {
188  if (!fs.isAvailable()) {
189  throw cms::Exception("BadConfig") << "TFileService unavailable: "
190  << "please add it to config file";
191  }
192 
193  if (doStoreOnTree_) {
194  // store information per DetId in the output tree
195  tree = fs->make<TTree>("ModEff", "ModEff");
196  tree->Branch("DetId", &t_DetId, "DetId/i");
197  tree->Branch("Layer", &t_layer, "Layer/b");
198  tree->Branch("FoundHits", &t_found, "FoundHits/i");
199  tree->Branch("AllHits", &t_total, "AllHits/i");
200  tree->Branch("IsTaggedIneff", &t_isTaggedIneff, "IsTaggedIneff/O");
201  tree->Branch("TagThreshold", &t_threshold, "TagThreshold/F");
202  }
203  }
204 
206  LOGPRINT << "A module is bad if efficiency < " << threshold_ << " and has at least " << nModsMin_ << " nModsMin.";
207  else
208  LOGPRINT << "A module is bad if the upper limit on the efficiency is < to the avg in the layer - " << threshold_
209  << " and has at least " << nModsMin_ << " nModsMin.";
210 
211  auto h_module_total = std::make_unique<TkHistoMap>(tkDetMap_.get());
212  h_module_total->loadTkHistoMap(fmt::format("{}/TkDetMaps", inputFolder_), "perModule_total");
213  auto h_module_found = std::make_unique<TkHistoMap>(tkDetMap_.get());
214  h_module_found->loadTkHistoMap(fmt::format("{}/TkDetMaps", inputFolder_), "perModule_found");
215 
216  // collect how many layers are missing
217  const auto& totalMaps = h_module_total->getAllMaps();
218  const auto& foundMaps = h_module_found->getAllMaps();
219 
220  LogDebug("SiStripHitEfficiencyHarvester")
221  << "totalMaps.size(): " << totalMaps.size() << " foundMaps.size() " << foundMaps.size() << std::endl;
222 
223  // check on the input TkHistoMaps
224  bool isTotalMapAvailable = this->checkMapsValidity(totalMaps, std::string("Total"));
225  bool isFoundMapAvailable = this->checkMapsValidity(foundMaps, std::string("Found"));
226 
227  LogDebug("SiStripHitEfficiencyHarvester")
228  << "isTotalMapAvailable: " << isTotalMapAvailable << " isFoundMapAvailable " << isFoundMapAvailable << std::endl;
229 
230  // no input TkHistoMaps -> early return
231  if (!isTotalMapAvailable or !isFoundMapAvailable)
232  return;
233 
234  LogDebug("SiStripHitEfficiencyHarvester")
235  << "Entries in total TkHistoMap for layer 3: " << h_module_total->getMap(3)->getEntries() << ", found "
236  << h_module_found->getMap(3)->getEntries();
237 
238  // count how many hits in the denominator we have
239  const unsigned int totalHits = this->countTotalHits(totalMaps);
240 
241  // set colz
242  for (size_t i = 1; i < totalMaps.size(); i++) {
243  h_module_total->getMap(i)->setOption("colz");
244  h_module_found->getMap(i)->setOption("colz");
245  }
246 
247  // come back to the main folder
249 
250  std::vector<MonitorElement*> hEffInLayer(std::size_t(1), nullptr);
251  hEffInLayer.reserve(bounds::k_END_OF_LAYERS);
252  for (std::size_t i = 1; i != bounds::k_END_OF_LAYERS; ++i) {
253  const auto lyrName = ::layerName(i, showRings_, nTEClayers_);
254  hEffInLayer.push_back(booker.book1D(
255  Form("eff_layer%i", int(i)), Form("Module efficiency in layer %s", lyrName.c_str()), 201, 0, 1.005));
256  }
257  std::array<long, bounds::k_END_OF_LAYERS> layerTotal{};
258  std::array<long, bounds::k_END_OF_LAYERS> layerFound{};
259  layerTotal.fill(0);
260  layerFound.fill(0);
261 
263  // Effiency calculation, bad module tagging, and tracker maps //
265 
266  TrackerMap tkMap{" Detector Inefficiency "};
267  TrackerMap tkMapBad{" Inefficient Modules "};
268  TrackerMap tkMapEff{title_};
269  TrackerMap tkMapNum{" Detector numerator "};
270  TrackerMap tkMapDen{" Detector denominator "};
271  std::map<unsigned int, double> badModules;
272 
273  // load the FEDError map
274  const auto& EventStats = getter.get(fmt::format("{}/EventInfo/EventStats", inputFolder_));
275  const int totalEvents = EventStats->getBinContent(1., 1.); // first bin contains info on number of events run
276  calibData_.FEDErrorOccupancy = std::make_unique<TkHistoMap>(tkDetMap_.get());
277  calibData_.FEDErrorOccupancy->loadTkHistoMap(fmt::format("{}/FEDErrorTkDetMaps", inputFolder_),
278  "perModule_FEDErrors");
279 
280  // tag as bad from FEDErrors the modules that have an error on 75% of the events
281  calibData_.fillMapFromTkMap(totalEvents, 0.75, stripDetIds_);
282 
283  for (const auto& [badId, fraction] : calibData_.fedErrorCounts) {
284  LogDebug("SiStripHitEfficiencyHarvester")
285  << __PRETTY_FUNCTION__ << " bad module from FEDError " << badId << "," << fraction << std::endl;
286  }
287 
288  for (auto det : stripDetIds_) {
289  auto layer = ::checkLayer(det, tTopo_.get());
290  const auto num = h_module_found->getValue(det);
291  const auto denom = h_module_total->getValue(det);
292  if (denom) {
293  // use only the "good" modules
294  if (stripQuality_->getBadApvs(det) == 0 && calibData_.checkFedError(det)) {
295  const auto eff = num / denom;
296  hEffInLayer[layer]->Fill(eff);
297  if (!autoIneffModTagging_) {
298  if ((denom >= nModsMin_) && (eff < threshold_)) {
299  // We have a bad module, put it in the list!
300  badModules[det] = eff;
301  tkMapBad.fillc(det, 255, 0, 0);
302  LOGPRINT << "Layer " << layer << " (" << ::layerName(layer, showRings_, nTEClayers_) << ") module "
303  << det.rawId() << " efficiency: " << eff << " , " << num << "/" << denom;
304  } else {
305  //Fill the bad list with empty results for every module
306  tkMapBad.fillc(det, 255, 255, 255);
307  }
308  if (eff < threshold_)
309  LOGPRINT << "Layer " << layer << " (" << ::layerName(layer, showRings_, nTEClayers_) << ") module "
310  << det.rawId() << " efficiency: " << eff << " , " << num << "/" << denom;
311 
312  if (denom < nModsMin_) {
313  LOGPRINT << "Layer " << layer << " (" << ::layerName(layer, showRings_, nTEClayers_) << ") module "
314  << det.rawId() << " is under occupancy at " << denom;
315  }
316 
317  if (doStoreOnTree_ && !isAtPCL_) {
318  t_DetId = det.rawId();
319  t_layer = layer;
320  t_found = num;
321  t_total = denom;
322  t_isTaggedIneff = false;
323  t_threshold = 0;
324  tree->Fill();
325  }
326  }
327 
328  //Put any module into the TKMap
329  tkMap.fill(det, 1. - eff);
330  tkMapEff.fill(det, eff);
331  tkMapNum.fill(det, num);
332  tkMapDen.fill(det, denom);
333 
334  layerTotal[layer] += denom;
335  layerFound[layer] += num;
336 
337  // for the summary
338  // Have to do the decoding for which side to go on (ugh)
339  if (layer <= bounds::k_LayersAtTOBEnd) {
342  } else if (layer > bounds::k_LayersAtTOBEnd && layer <= bounds::k_LayersAtTIDEnd) {
343  if (tTopo_->tidSide(det) == 1) {
346  } else if (tTopo_->tidSide(det) == 2) {
347  goodlayerfound[layer + 3] += num;
348  goodlayertotal[layer + 3] += denom;
349  }
350  } else if (layer > bounds::k_LayersAtTIDEnd && layer <= bounds::k_LayersAtTECEnd) {
351  if (tTopo_->tecSide(det) == 1) {
352  goodlayerfound[layer + 3] += num;
353  goodlayertotal[layer + 3] += denom;
354  } else if (tTopo_->tecSide(det) == 2) {
357  }
358  }
359  } // if the module is good!
360 
361  //Do the one where we don't exclude bad modules!
362  if (layer <= bounds::k_LayersAtTOBEnd) {
363  alllayerfound[layer] += num;
365  } else if (layer > bounds::k_LayersAtTOBEnd && layer <= bounds::k_LayersAtTIDEnd) {
366  if (tTopo_->tidSide(det) == 1) {
367  alllayerfound[layer] += num;
369  } else if (tTopo_->tidSide(det) == 2) {
370  alllayerfound[layer + 3] += num;
371  alllayertotal[layer + 3] += denom;
372  }
373  } else if (layer > bounds::k_LayersAtTIDEnd && layer <= bounds::k_LayersAtTECEnd) {
374  if (tTopo_->tecSide(det) == 1) {
375  alllayerfound[layer + 3] += num;
376  alllayertotal[layer + 3] += denom;
377  } else if (tTopo_->tecSide(det) == 2) {
380  }
381  }
382 
383  } // if denom
384  } // loop on DetIds
385 
386  if (autoIneffModTagging_) {
387  for (Long_t i = 1; i <= k_LayersAtTECEnd; i++) {
388  //Compute threshold to use for each layer
389  hEffInLayer[i]->getTH1()->GetXaxis()->SetRange(
390  3, hEffInLayer[i]->getNbinsX() + 1); // Remove from the avg modules below 1%
391  const double layer_min_eff = hEffInLayer[i]->getMean() - std::max(2.5 * hEffInLayer[i]->getRMS(), threshold_);
392  LOGPRINT << "Layer " << i << " threshold for bad modules: <" << layer_min_eff
393  << " (layer mean: " << hEffInLayer[i]->getMean() << " rms: " << hEffInLayer[i]->getRMS() << ")";
394 
395  hEffInLayer[i]->getTH1()->GetXaxis()->SetRange(1, hEffInLayer[i]->getNbinsX() + 1);
396 
397  for (auto det : stripDetIds_) {
398  // use only the "good" modules
399  if (stripQuality_->getBadApvs(det) == 0 && calibData_.checkFedError(det)) {
400  const auto layer = ::checkLayer(det, tTopo_.get());
401  if (layer == i) {
402  const auto num = h_module_found->getValue(det);
403  const auto denom = h_module_total->getValue(det);
404  if (denom) {
405  const auto eff = num / denom;
406  const auto eff_up = TEfficiency::Bayesian(denom, num, .99, 1, 1, true);
407 
408  if ((denom >= nModsMin_) && (eff_up < layer_min_eff)) {
409  //We have a bad module, put it in the list!
410  badModules[det] = eff;
411  tkMapBad.fillc(det, 255, 0, 0);
412  if (!isAtPCL_ && doStoreOnTree_) {
413  t_isTaggedIneff = true;
414  }
415  } else {
416  //Fill the bad list with empty results for every module
417  tkMapBad.fillc(det, 255, 255, 255);
418  if (!isAtPCL_ && doStoreOnTree_) {
419  t_isTaggedIneff = false;
420  }
421  }
422  if (eff_up < layer_min_eff + 0.08) {
423  // printing message also for modules sligthly above (8%) the limit
424  LOGPRINT << "Layer " << layer << " (" << ::layerName(layer, showRings_, nTEClayers_) << ") module "
425  << det.rawId() << " efficiency: " << eff << " , " << num << "/" << denom
426  << " , upper limit: " << eff_up;
427  }
428  if (denom < nModsMin_) {
429  LOGPRINT << "Layer " << layer << " (" << ::layerName(layer, showRings_, nTEClayers_) << ") module "
430  << det.rawId() << " layer " << layer << " is under occupancy at " << denom;
431  }
432 
433  if (!isAtPCL_ && doStoreOnTree_) {
434  t_DetId = det.rawId();
435  t_layer = layer;
436  t_found = num;
437  t_total = denom;
438  t_threshold = layer_min_eff;
439  tree->Fill();
440  } // if storing tree
441  } // if denom
442  } // layer = i
443  } // if there are no bad APVs
444  } // loop on detids
445  } // loop on layers
446  } // if auto tagging
447 
448  tkMap.save(true, 0, 0, "SiStripHitEffTKMap_NEW.png");
449  tkMapBad.save(true, 0, 0, "SiStripHitEffTKMapBad_NEW.png");
450  tkMapEff.save(true, tkMapMin_, 1., "SiStripHitEffTKMapEff_NEW.png");
451  tkMapNum.save(true, 0, 0, "SiStripHitEffTKMapNum_NEW.png");
452  tkMapDen.save(true, 0, 0, "SiStripHitEffTKMapDen_NEW.png");
453 
454  const auto detInfo =
456  SiStripQuality pQuality{detInfo};
457  //This is the list of the bad strips, use to mask out entire APVs
458  //Now simply go through the bad hit list and mask out things that
459  //are bad!
460  for (const auto it : badModules) {
461  const auto det = it.first;
462  std::vector<unsigned int> badStripList;
463  //We need to figure out how many strips are in this particular module
464  //To Mask correctly!
465  const auto nStrips = detInfo.getNumberOfApvsAndStripLength(det).first * sistrip::STRIPS_PER_APV;
466  LOGPRINT << "Number of strips module " << det << " is " << nStrips;
467  badStripList.push_back(pQuality.encode(0, nStrips, 0));
468  //Now compact into a single bad module
469  LOGPRINT << "ID1 shoudl match list of modules above " << det;
470  pQuality.compact(det, badStripList);
471  pQuality.put(det, SiStripQuality::Range(badStripList.begin(), badStripList.end()));
472  }
473  pQuality.fillBadComponents();
474  if (doStoreOnDB_) {
475  if (totalHits > 0u) {
476  writeBadStripPayload(pQuality);
477  } else {
478  edm::LogPrint("SiStripHitEfficiencyHarvester")
479  << __PRETTY_FUNCTION__ << " There are no SiStrip hits for a valid measurement, skipping!";
480  }
481  } else {
482  edm::LogInfo("SiStripHitEfficiencyHarvester") << "Will not produce payload!";
483  }
484 
485  printTotalStatistics(layerFound, layerTotal); // statistics by layer and subdetector
486  //LOGPRINT << "\n-----------------\nNew IOV starting from run " << e.id().run() << " event " << e.id().event()
487  // << " lumiBlock " << e.luminosityBlock() << " time " << e.time().value() << "\n-----------------\n";
488  printAndWriteBadModules(pQuality, detInfo); // TODO
489 
490  // make summary plots
491  makeSummary(getter, booker);
492  makeSummaryVsLumi(getter); // TODO
493 
494  /*
495  if (!isAtPCL_) {
496  makeSummaryVsBX(getter, *fs); // TODO
497  makeSummaryVsCM(getter, *fs); // TODO
498  }
499  */
500 }
int goodlayerfound[bounds::k_END_OF_LAYS_AND_RINGS]
int goodlayertotal[bounds::k_END_OF_LAYS_AND_RINGS]
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
void makeSummary(DQMStore::IGetter &getter, DQMStore::IBooker &booker) const
std::unique_ptr< TrackerTopology > tTopo_
int alllayertotal[bounds::k_END_OF_LAYS_AND_RINGS]
void printAndWriteBadModules(const SiStripQuality &quality, const SiStripDetInfo &detInfo) const
void makeSummaryVsLumi(DQMStore::IGetter &getter) const
std::unordered_map< uint32_t, int > fedErrorCounts
nStrips
1.2 is to make the matching window safely the two nearest strips 0.35 is the size of an ME0 chamber i...
std::unique_ptr< TkHistoMap > FEDErrorOccupancy
constexpr std::array< uint8_t, layerIndexSize< TrackerTraits > > layer
const bool checkFedError(const DetId det)
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
void printTotalStatistics(const std::array< long, bounds::k_END_OF_LAYERS > &layerFound, const std::array< long, bounds::k_END_OF_LAYERS > &layerTotal) const
unsigned int countTotalHits(const std::vector< MonitorElement *> &maps)
void writeBadStripPayload(const SiStripQuality &quality) const
SiStripDetInfo read(std::string filePath)
Log< level::Warning, true > LogPrint
Log< level::Info, false > LogInfo
void fillMapFromTkMap(const int nevents, const float threshold, const std::vector< DetId > &stripDetIds)
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:697
static const uint16_t STRIPS_PER_APV
std::pair< ContainerIterator, ContainerIterator > Range
std::unique_ptr< SiStripQuality > stripQuality_
int alllayerfound[bounds::k_END_OF_LAYS_AND_RINGS]
static constexpr char const *const kDefaultFile
Definition: tree.py:1
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
bool checkMapsValidity(const std::vector< MonitorElement *> &maps, const std::string &type) const
#define LogDebug(id)
virtual double getBinContent(int binx) const
get content of bin (1-D)

◆ endRun()

void SiStripHitEfficiencyHarvester::endRun ( edm::Run const &  ,
edm::EventSetup const &  iSetup 
)
override

Definition at line 130 of file SiStripHitEfficiencyHarvester.cc.

References edm::EventSetup::getData(), stripDetIds_, stripQuality_, stripQualityToken_, tkDetMap_, tkDetMapToken_, tkGeomToken_, tTopo_, and tTopoToken_.

130  {
131  if (!tTopo_) {
132  tTopo_ = std::make_unique<TrackerTopology>(iSetup.getData(tTopoToken_));
133  }
134  if (!tkDetMap_) {
135  tkDetMap_ = std::make_unique<TkDetMap>(iSetup.getData(tkDetMapToken_));
136  }
137  if (!stripQuality_) {
138  stripQuality_ = std::make_unique<SiStripQuality>(iSetup.getData(stripQualityToken_));
139  }
140  if (stripDetIds_.empty()) {
141  const auto& tkGeom = iSetup.getData(tkGeomToken_);
142  for (const auto& det : tkGeom.detUnits()) {
143  if (dynamic_cast<const StripGeomDetUnit*>(det)) {
144  stripDetIds_.push_back(det->geographicalId());
145  }
146  }
147  }
148 }
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken_
std::unique_ptr< TrackerTopology > tTopo_
const edm::ESGetToken< SiStripQuality, SiStripQualityRcd > stripQualityToken_
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > tkGeomToken_
std::unique_ptr< SiStripQuality > stripQuality_
const edm::ESGetToken< TkDetMap, TrackerTopologyRcd > tkDetMapToken_

◆ fillDescriptions()

void SiStripHitEfficiencyHarvester::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 1083 of file SiStripHitEfficiencyHarvester.cc.

References edm::ConfigurationDescriptions::addWithDefaultLabel(), submitPVResolutionJobs::desc, and AlCaHLTBitMon_QueryRunRegistry::string.

1083  {
1085  desc.add<std::string>("inputFolder", "AlCaReco/SiStripHitEfficiency");
1086  desc.add<bool>("isAtPCL", false);
1087  desc.add<bool>("doStoreOnDB", false);
1088  desc.add<std::string>("Record", "SiStripBadStrip");
1089  desc.add<double>("Threshold", 0.1);
1090  desc.add<std::string>("Title", "Hit Efficiency");
1091  desc.add<int>("nModsMin", 5);
1092  desc.addUntracked<bool>("doStoreOnTree", false);
1093  desc.addUntracked<bool>("AutoIneffModTagging", false);
1094  desc.addUntracked<double>("TkMapMin", 0.9);
1095  desc.addUntracked<double>("EffPlotMin", 0.9);
1096  desc.addUntracked<bool>("ShowRings", false);
1097  desc.addUntracked<bool>("ShowEndcapSides", true);
1098  desc.addUntracked<bool>("ShowTOB6TEC9", false);
1099  desc.addUntracked<bool>("ShowOnlyGoodModules", false);
1100  descriptions.addWithDefaultLabel(desc);
1101 }
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)

◆ makeSummary()

void SiStripHitEfficiencyHarvester::makeSummary ( DQMStore::IGetter getter,
DQMStore::IBooker booker 
) const
private

Definition at line 568 of file SiStripHitEfficiencyHarvester.cc.

References python.cmstools::all(), alllayerfound, alllayertotal, dqm::implementation::IBooker::book1D(), MillePedeFileConverter_cfg::e, effPlotMin_, Exception, dqm-mbProfile::format, newFWLiteAna::found, compareTotals::fs, dqm::impl::MonitorElement::getBinContent(), dqm::legacy::MonitorElement::getTH1F(), goodlayerfound, goodlayertotal, mps_fire::i, inputFolder_, isAtPCL_, dqmiolumiharvest::j, LOGPRINT, MuonTCMETValueMapProducer_cff::nLayers, nTEClayers_, compare::overlay(), dqm::impl::MonitorElement::setBinContent(), dqm::impl::MonitorElement::setBinError(), dqm::implementation::NavigatorBase::setCurrentFolder(), setEffBinLabels(), showEndcapSides_, showOnlyGoodModules_, and showRings_.

Referenced by dqmEndJob().

568  {
569  // use goodlayer_total/found and alllayer_total/found, collapse side and/or ring if needed
570 
571  unsigned int nLayers{34}; // default
572  if (showRings_)
573  nLayers = 30;
574  if (!showEndcapSides_) {
575  if (!showRings_)
576  nLayers = 22;
577  else
578  nLayers = 20;
579  }
580 
581  // come back to the main folder and create a final efficiency folder
582  booker.setCurrentFolder(fmt::format("{}/EfficiencySummary", inputFolder_));
583  MonitorElement* found = booker.book1D("found", "found", nLayers + 1, 0, nLayers + 1);
584  MonitorElement* all = booker.book1D("all", "all", nLayers + 1, 0, nLayers + 1);
585  MonitorElement* found2 = booker.book1D("found2", "found", nLayers + 1, 0, nLayers + 1);
586  MonitorElement* all2 = booker.book1D("all2", "all2", nLayers + 1, 0, nLayers + 1);
587 
588  // first bin only to keep real data off the y axis so set to -1
589  found->setBinContent(0, -1);
590  all->setBinContent(0, 1);
591 
592  // new ROOT version: TGraph::Divide don't handle null or negative values
593  for (unsigned int i = 1; i < nLayers + 2; ++i) {
594  found->setBinContent(i, 1e-6);
595  all->setBinContent(i, 1);
596  found2->setBinContent(i, 1e-6);
597  all2->setBinContent(i, 1);
598  }
599 
600  TCanvas* c7 = new TCanvas("c7", " test ", 10, 10, 800, 600);
601  c7->SetFillColor(0);
602  c7->SetGrid();
603 
604  unsigned int nLayers_max = nLayers + 1; // barrel+endcap
605  if (!showEndcapSides_)
606  nLayers_max = 11; // barrel
607  for (unsigned int i = 1; i < nLayers_max; ++i) {
608  LOGPRINT << "Fill only good modules layer " << i << ": S = " << goodlayerfound[i]
609  << " B = " << goodlayertotal[i];
610  if (goodlayertotal[i] > 5) {
611  found->setBinContent(i, goodlayerfound[i]);
612  all->setBinContent(i, goodlayertotal[i]);
613  }
614 
615  LOGPRINT << "Filling all modules layer " << i << ": S = " << alllayerfound[i] << " B = " << alllayertotal[i];
616  if (alllayertotal[i] > 5) {
617  found2->setBinContent(i, alllayerfound[i]);
618  all2->setBinContent(i, alllayertotal[i]);
619  }
620  }
621 
622  // endcap - merging sides
623  if (!showEndcapSides_) {
624  for (unsigned int i = 11; i < 14; ++i) { // TID disks
625  LOGPRINT << "Fill only good modules layer " << i << ": S = " << goodlayerfound[i] + goodlayerfound[i + 3]
626  << " B = " << goodlayertotal[i] + goodlayertotal[i + 3];
627  if (goodlayertotal[i] + goodlayertotal[i + 3] > 5) {
628  found->setBinContent(i, goodlayerfound[i] + goodlayerfound[i + 3]);
629  all->setBinContent(i, goodlayertotal[i] + goodlayertotal[i + 3]);
630  }
631  LOGPRINT << "Filling all modules layer " << i << ": S = " << alllayerfound[i] + alllayerfound[i + 3]
632  << " B = " << alllayertotal[i] + alllayertotal[i + 3];
633  if (alllayertotal[i] + alllayertotal[i + 3] > 5) {
634  found2->setBinContent(i, alllayerfound[i] + alllayerfound[i + 3]);
635  all2->setBinContent(i, alllayertotal[i] + alllayertotal[i + 3]);
636  }
637  }
638  for (unsigned int i = 17; i < 17 + nTEClayers_; ++i) { // TEC disks
639  LOGPRINT << "Fill only good modules layer " << i - 3
640  << ": S = " << goodlayerfound[i] + goodlayerfound[i + nTEClayers_]
641  << " B = " << goodlayertotal[i] + goodlayertotal[i + nTEClayers_];
642  if (goodlayertotal[i] + goodlayertotal[i + nTEClayers_] > 5) {
643  found->setBinContent(i - 3, goodlayerfound[i] + goodlayerfound[i + nTEClayers_]);
644  all->setBinContent(i - 3, goodlayertotal[i] + goodlayertotal[i + nTEClayers_]);
645  }
646  LOGPRINT << "Filling all modules layer " << i - 3
647  << ": S = " << alllayerfound[i] + alllayerfound[i + nTEClayers_]
648  << " B = " << alllayertotal[i] + alllayertotal[i + nTEClayers_];
649  if (alllayertotal[i] + alllayertotal[i + nTEClayers_] > 5) {
652  }
653  }
654  }
655 
656  found->getTH1F()->Sumw2();
657  all->getTH1F()->Sumw2();
658 
659  found2->getTH1F()->Sumw2();
660  all2->getTH1F()->Sumw2();
661 
662  MonitorElement* h_eff_all =
663  booker.book1D("eff_all", "Strip hit efficiency for all modules", nLayers + 1, 0, nLayers + 1);
664  MonitorElement* h_eff_good =
665  booker.book1D("eff_good", "Strip hit efficiency for good modules", nLayers + 1, 0, nLayers + 1);
666 
667  for (int i = 1; i < found->getNbinsX(); i++) {
668  const auto& den_all = all2->getBinContent(i);
669  const auto& num_all = found2->getBinContent(i);
670  const auto& den_good = all->getBinContent(i);
671  const auto& num_good = found->getBinContent(i);
672 
673  // fill all modules efficiency
674  if (den_all > 0.) {
675  float eff_all = num_all / den_all;
676  float err_eff_all = (eff_all * (1 - eff_all)) / den_all;
677  h_eff_all->setBinContent(i, eff_all);
678  h_eff_all->setBinError(i, err_eff_all);
679  }
680 
681  // fill good modules efficiency
682  if (den_good > 0.) {
683  float eff_good = num_good / den_good;
684  float err_eff_good = (eff_good * (1 - eff_good)) / den_good;
685  h_eff_good->setBinContent(i, eff_good);
686  h_eff_good->setBinError(i, err_eff_good);
687  }
688  }
689 
690  h_eff_all->getTH1F()->SetMinimum(effPlotMin_);
691  h_eff_good->getTH1F()->SetMinimum(effPlotMin_);
692 
693  // set the histogram bin labels
694  this->setEffBinLabels(h_eff_all->getTH1F(), h_eff_good->getTH1F(), nLayers);
695 
696  if (!isAtPCL_) {
697  // if TFileService is not avaible, just go on
699  if (!fs.isAvailable()) {
700  throw cms::Exception("BadConfig") << "TFileService unavailable: "
701  << "please add it to config file";
702  }
703 
704  TGraphAsymmErrors* gr = (*fs).make<TGraphAsymmErrors>(nLayers + 1);
705  gr->SetName("eff_good");
706  gr->BayesDivide(found->getTH1F(), all->getTH1F());
707 
708  TGraphAsymmErrors* gr2 = (*fs).make<TGraphAsymmErrors>(nLayers + 1);
709  gr2->SetName("eff_all");
710  gr2->BayesDivide(found2->getTH1F(), all2->getTH1F());
711 
712  for (unsigned int j = 0; j < nLayers + 1; j++) {
713  gr->SetPointError(j, 0., 0., gr->GetErrorYlow(j), gr->GetErrorYhigh(j));
714  gr2->SetPointError(j, 0., 0., gr2->GetErrorYlow(j), gr2->GetErrorYhigh(j));
715  }
716 
717  this->setEffBinLabels(gr, gr2, nLayers);
718 
719  gr->GetXaxis()->SetLimits(0, nLayers);
720  gr->SetMarkerColor(2);
721  gr->SetMarkerSize(1.2);
722  gr->SetLineColor(2);
723  gr->SetLineWidth(4);
724  gr->SetMarkerStyle(20);
725  gr->SetMinimum(effPlotMin_);
726  gr->SetMaximum(1.001);
727  gr->GetYaxis()->SetTitle("Efficiency");
728  gStyle->SetTitleFillColor(0);
729  gStyle->SetTitleBorderSize(0);
730  gr->SetTitle("SiStripHitEfficiency by Layer");
731 
732  gr2->GetXaxis()->SetLimits(0, nLayers);
733  gr2->SetMarkerColor(1);
734  gr2->SetMarkerSize(1.2);
735  gr2->SetLineColor(1);
736  gr2->SetLineWidth(4);
737  gr2->SetMarkerStyle(21);
738  gr2->SetMinimum(effPlotMin_);
739  gr2->SetMaximum(1.001);
740  gr2->GetYaxis()->SetTitle("Efficiency");
741  gr2->SetTitle("SiStripHitEfficiency by Layer");
742 
743  gr->Draw("AP");
744  gr->GetXaxis()->SetNdivisions(36);
745 
746  c7->cd();
747  TPad* overlay = new TPad("overlay", "", 0, 0, 1, 1);
748  overlay->SetFillStyle(4000);
749  overlay->SetFillColor(0);
750  overlay->SetFrameFillStyle(4000);
751  overlay->Draw("same");
752  overlay->cd();
754  gr2->Draw("AP");
755 
756  TLegend* leg = new TLegend(0.70, 0.27, 0.88, 0.40);
757  leg->AddEntry(gr, "Good Modules", "p");
759  leg->AddEntry(gr2, "All Modules", "p");
760  leg->SetTextSize(0.020);
761  leg->SetFillColor(0);
762  leg->Draw("same");
763 
764  c7->SaveAs("Summary.png");
765  c7->SaveAs("Summary.root");
766  } // if it's not run at PCL
767 }
void setEffBinLabels(const T gr, const T gr2, const unsigned int nLayers) const
int goodlayerfound[bounds::k_END_OF_LAYS_AND_RINGS]
def all(container)
workaround iterator generators for ROOT classes
Definition: cmstools.py:25
int goodlayertotal[bounds::k_END_OF_LAYS_AND_RINGS]
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
int alllayertotal[bounds::k_END_OF_LAYS_AND_RINGS]
def overlay(hists, ytitle, header, addon)
Definition: compare.py:122
virtual void setBinContent(int binx, double content)
set content of bin (1-D)
virtual TH1F * getTH1F() const
int alllayerfound[bounds::k_END_OF_LAYS_AND_RINGS]
virtual void setBinError(int binx, double error)
set uncertainty on content of bin (1-D)
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
virtual double getBinContent(int binx) const
get content of bin (1-D)

◆ makeSummaryVsBX()

void SiStripHitEfficiencyHarvester::makeSummaryVsBX ( DQMStore::IGetter getter,
TFileService fs 
) const
private

Definition at line 820 of file SiStripHitEfficiencyHarvester.cc.

820  {
821  // use found/totalVsBx_layer%i [0,23)
822 }

◆ makeSummaryVsCM()

void SiStripHitEfficiencyHarvester::makeSummaryVsCM ( DQMStore::IGetter getter,
TFileService fs 
) const
private

Definition at line 825 of file SiStripHitEfficiencyHarvester.cc.

825 {}

◆ makeSummaryVsLumi()

void SiStripHitEfficiencyHarvester::makeSummaryVsLumi ( DQMStore::IGetter getter) const
private

Definition at line 827 of file SiStripHitEfficiencyHarvester.cc.

References MillePedeFileConverter_cfg::e, dqm-mbProfile::format, dqm::implementation::IGetter::get(), dqm::legacy::MonitorElement::getTH1F(), mps_fire::i, inputFolder_, LogDebug, or, and showRings_.

Referenced by dqmEndJob().

827  {
828  for (unsigned int iLayer = 1; iLayer != (showRings_ ? 20 : 22); ++iLayer) {
829  auto hfound = getter.get(fmt::format("{}/VsLumi/layerfound_vsLumi_layer_{}", inputFolder_, iLayer))->getTH1F();
830  auto htotal = getter.get(fmt::format("{}/VsLumi/layertotal_vsLumi_layer_{}", inputFolder_, iLayer))->getTH1F();
831 
832  if (hfound == nullptr or htotal == nullptr) {
833  if (hfound == nullptr)
834  edm::LogError("SiStripHitEfficiencyHarvester")
835  << fmt::format("{}/VsLumi/layerfound_vsLumi_layer_{}", inputFolder_, iLayer) << " was not found!";
836  if (htotal == nullptr)
837  edm::LogError("SiStripHitEfficiencyHarvester")
838  << fmt::format("{}/VsLumi/layertotal_vsLumi_layer_{}", inputFolder_, iLayer) << " was not found!";
839  // no input histograms -> continue in the loop
840  continue;
841  }
842 
843  if (!hfound->GetSumw2())
844  hfound->Sumw2();
845  if (!htotal->GetSumw2())
846  htotal->Sumw2();
847  for (Long_t i = 0; i != hfound->GetNbinsX() + 1; ++i) {
848  if (hfound->GetBinContent(i) == 0)
849  hfound->SetBinContent(i, 1e-6);
850  if (htotal->GetBinContent(i) == 0)
851  htotal->SetBinContent(i, 1);
852  }
853  LogDebug("SiStripHitEfficiencyHarvester")
854  << "Total hits for layer " << iLayer << " (vs lumi): " << htotal->GetEntries() << ", found "
855  << hfound->GetEntries();
856  }
857  // continue
858 }
Log< level::Error, false > LogError
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
virtual TH1F * getTH1F() const
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:697
#define LogDebug(id)

◆ printAndWriteBadModules()

void SiStripHitEfficiencyHarvester::printAndWriteBadModules ( const SiStripQuality quality,
const SiStripDetInfo detInfo 
) const
private

Definition at line 897 of file SiStripHitEfficiencyHarvester.cc.

References SiStripDetInfo::getNumberOfApvsAndStripLength(), mps_fire::i, dqmiolumiharvest::j, dqmdumpme::k, LOGPRINT, quality, FastTimerService_cff::range, SiStripPI::setBadComponents(), contentValuesCheck::ss, str, sistrip::STRIPS_PER_APV, DetId::subdetId(), SiStripSubdetector::TEC, SiStripSubdetector::TIB, SiStripSubdetector::TID, SiStripSubdetector::TOB, tTopo_, and testProducerWithPsetDescEmpty_cfi::x1.

Referenced by dqmEndJob().

898  {
900  //try to write out what's in the quality record
902  int nTkBadComp[4]; //k: 0=BadModule, 1=BadFiber, 2=BadApv, 3=BadStrips
903  int nBadComp[4][19][4];
904  //legend: nBadComp[i][j][k]= SubSystem i, layer/disk/wheel j, BadModule/Fiber/Apv k
905  // i: 0=TIB, 1=TID, 2=TOB, 3=TEC
906  // k: 0=BadModule, 1=BadFiber, 2=BadApv, 3=BadStrips
907  std::stringstream ssV[4][19];
908 
909  for (int i = 0; i < 4; ++i) {
910  nTkBadComp[i] = 0;
911  for (int j = 0; j < 19; ++j) {
912  ssV[i][j].str("");
913  for (int k = 0; k < 4; ++k)
914  nBadComp[i][j][k] = 0;
915  }
916  }
917 
918  for (const auto& bc : quality.getBadComponentList()) {
919  // Full Tk
920  if (bc.BadModule)
921  nTkBadComp[0]++;
922  if (bc.BadFibers)
923  nTkBadComp[1] += ((bc.BadFibers >> 2) & 0x1) + ((bc.BadFibers >> 1) & 0x1) + ((bc.BadFibers) & 0x1);
924  if (bc.BadApvs)
925  nTkBadComp[2] += ((bc.BadApvs >> 5) & 0x1) + ((bc.BadApvs >> 4) & 0x1) + ((bc.BadApvs >> 3) & 0x1) +
926  ((bc.BadApvs >> 2) & 0x1) + ((bc.BadApvs >> 1) & 0x1) + ((bc.BadApvs) & 0x1);
927  // single subsystem
928  DetId det(bc.detid);
929  if ((det.subdetId() >= SiStripSubdetector::TIB) && (det.subdetId() <= SiStripSubdetector::TEC)) {
930  const auto nAPV = detInfo.getNumberOfApvsAndStripLength(det).first;
931  switch (det.subdetId()) {
933  setBadComponents(0, tTopo_->tibLayer(det), bc, ssV, nBadComp, nAPV);
934  break;
937  (tTopo_->tidSide(det) == 2 ? tTopo_->tidWheel(det) : tTopo_->tidWheel(det) + 3),
938  bc,
939  ssV,
940  nBadComp,
941  nAPV);
942  break;
944  setBadComponents(2, tTopo_->tobLayer(det), bc, ssV, nBadComp, nAPV);
945  break;
948  (tTopo_->tecSide(det) == 2 ? tTopo_->tecWheel(det) : tTopo_->tecWheel(det) + 9),
949  bc,
950  ssV,
951  nBadComp,
952  nAPV);
953  break;
954  default:
955  break;
956  }
957  }
958  }
959  // single strip info
960  for (auto rp = quality.getRegistryVectorBegin(); rp != quality.getRegistryVectorEnd(); ++rp) {
961  DetId det{rp->detid};
962  int subdet = -999;
963  int component = -999;
964  switch (det.subdetId()) {
966  subdet = 0;
967  component = tTopo_->tibLayer(det);
968  break;
970  subdet = 1;
971  component = tTopo_->tidSide(det) == 2 ? tTopo_->tidWheel(det) : tTopo_->tidWheel(det) + 3;
972  break;
974  subdet = 2;
975  component = tTopo_->tobLayer(det);
976  break;
978  subdet = 3;
979  component = tTopo_->tecSide(det) == 2 ? tTopo_->tecWheel(det) : tTopo_->tecWheel(det) + 9;
980  break;
981  default:
982  break;
983  }
984 
985  const auto pQdvBegin = quality.getDataVectorBegin();
986  const auto sqrange = SiStripQuality::Range(pQdvBegin + rp->ibegin, pQdvBegin + rp->iend);
987  float percentage = 0;
988  for (int it = 0; it < sqrange.second - sqrange.first; it++) {
989  unsigned int range = quality.decode(*(sqrange.first + it)).range;
990  nTkBadComp[3] += range;
991  nBadComp[subdet][0][3] += range;
992  nBadComp[subdet][component][3] += range;
993  percentage += range;
994  }
995  if (percentage != 0)
996  percentage /= (sistrip::STRIPS_PER_APV * detInfo.getNumberOfApvsAndStripLength(det).first);
997  if (percentage > 1)
998  edm::LogError("SiStripHitEfficiencyHarvester") << "PROBLEM detid " << det.rawId() << " value " << percentage;
999  }
1000 
1001  // printout
1002  std::ostringstream ss;
1003  ss << "\n-----------------\nGlobal Info\n-----------------";
1004  ss << "\nBadComp \t Modules \tFibers "
1005  "\tApvs\tStrips\n----------------------------------------------------------------";
1006  ss << "\nTracker:\t\t" << nTkBadComp[0] << "\t" << nTkBadComp[1] << "\t" << nTkBadComp[2] << "\t" << nTkBadComp[3];
1007  ss << "\nTIB:\t\t\t" << nBadComp[0][0][0] << "\t" << nBadComp[0][0][1] << "\t" << nBadComp[0][0][2] << "\t"
1008  << nBadComp[0][0][3];
1009  ss << "\nTID:\t\t\t" << nBadComp[1][0][0] << "\t" << nBadComp[1][0][1] << "\t" << nBadComp[1][0][2] << "\t"
1010  << nBadComp[1][0][3];
1011  ss << "\nTOB:\t\t\t" << nBadComp[2][0][0] << "\t" << nBadComp[2][0][1] << "\t" << nBadComp[2][0][2] << "\t"
1012  << nBadComp[2][0][3];
1013  ss << "\nTEC:\t\t\t" << nBadComp[3][0][0] << "\t" << nBadComp[3][0][1] << "\t" << nBadComp[3][0][2] << "\t"
1014  << nBadComp[3][0][3];
1015  ss << "\n";
1016 
1017  for (int i = 1; i < 5; ++i)
1018  ss << "\nTIB Layer " << i << " :\t\t" << nBadComp[0][i][0] << "\t" << nBadComp[0][i][1] << "\t" << nBadComp[0][i][2]
1019  << "\t" << nBadComp[0][i][3];
1020  ss << "\n";
1021  for (int i = 1; i < 4; ++i)
1022  ss << "\nTID+ Disk " << i << " :\t\t" << nBadComp[1][i][0] << "\t" << nBadComp[1][i][1] << "\t" << nBadComp[1][i][2]
1023  << "\t" << nBadComp[1][i][3];
1024  for (int i = 4; i < 7; ++i)
1025  ss << "\nTID- Disk " << i - 3 << " :\t\t" << nBadComp[1][i][0] << "\t" << nBadComp[1][i][1] << "\t"
1026  << nBadComp[1][i][2] << "\t" << nBadComp[1][i][3];
1027  ss << "\n";
1028  for (int i = 1; i < 7; ++i)
1029  ss << "\nTOB Layer " << i << " :\t\t" << nBadComp[2][i][0] << "\t" << nBadComp[2][i][1] << "\t" << nBadComp[2][i][2]
1030  << "\t" << nBadComp[2][i][3];
1031  ss << "\n";
1032  for (int i = 1; i < 10; ++i)
1033  ss << "\nTEC+ Disk " << i << " :\t\t" << nBadComp[3][i][0] << "\t" << nBadComp[3][i][1] << "\t" << nBadComp[3][i][2]
1034  << "\t" << nBadComp[3][i][3];
1035  for (int i = 10; i < 19; ++i)
1036  ss << "\nTEC- Disk " << i - 9 << " :\t\t" << nBadComp[3][i][0] << "\t" << nBadComp[3][i][1] << "\t"
1037  << nBadComp[3][i][2] << "\t" << nBadComp[3][i][3];
1038  ss << "\n";
1039 
1040  ss << "\n----------------------------------------------------------------\n\t\t Detid \tModules Fibers "
1041  "Apvs\n----------------------------------------------------------------";
1042  for (int i = 1; i < 5; ++i)
1043  ss << "\nTIB Layer " << i << " :" << ssV[0][i].str();
1044  ss << "\n";
1045  for (int i = 1; i < 4; ++i)
1046  ss << "\nTID+ Disk " << i << " :" << ssV[1][i].str();
1047  for (int i = 4; i < 7; ++i)
1048  ss << "\nTID- Disk " << i - 3 << " :" << ssV[1][i].str();
1049  ss << "\n";
1050  for (int i = 1; i < 7; ++i)
1051  ss << "\nTOB Layer " << i << " :" << ssV[2][i].str();
1052  ss << "\n";
1053  for (int i = 1; i < 10; ++i)
1054  ss << "\nTEC+ Disk " << i << " :" << ssV[3][i].str();
1055  for (int i = 10; i < 19; ++i)
1056  ss << "\nTEC- Disk " << i - 9 << " :" << ssV[3][i].str();
1057 
1058  LOGPRINT << ss.str();
1059 
1060  // store also bad modules in log file
1061  std::ofstream badModules;
1062  badModules.open("BadModules_NEW.log");
1063  badModules << "\n----------------------------------------------------------------\n\t\t Detid \tModules Fibers "
1064  "Apvs\n----------------------------------------------------------------";
1065  for (int i = 1; i < 5; ++i)
1066  badModules << "\nTIB Layer " << i << " :" << ssV[0][i].str();
1067  badModules << "\n";
1068  for (int i = 1; i < 4; ++i)
1069  badModules << "\nTID+ Disk " << i << " :" << ssV[1][i].str();
1070  for (int i = 4; i < 7; ++i)
1071  badModules << "\nTID- Disk " << i - 3 << " :" << ssV[1][i].str();
1072  badModules << "\n";
1073  for (int i = 1; i < 7; ++i)
1074  badModules << "\nTOB Layer " << i << " :" << ssV[2][i].str();
1075  badModules << "\n";
1076  for (int i = 1; i < 10; ++i)
1077  badModules << "\nTEC+ Disk " << i << " :" << ssV[3][i].str();
1078  for (int i = 10; i < 19; ++i)
1079  badModules << "\nTEC- Disk " << i - 9 << " :" << ssV[3][i].str();
1080  badModules.close();
1081 }
std::unique_ptr< TrackerTopology > tTopo_
Log< level::Error, false > LogError
string quality
Definition: DetId.h:17
void setBadComponents(int i, int component, const SiStripQuality::BadComponent &BC, int NBadComponent[4][19][4])
const std::pair< unsigned short, double > getNumberOfApvsAndStripLength(uint32_t detId) const
static const uint16_t STRIPS_PER_APV
std::pair< ContainerIterator, ContainerIterator > Range
#define str(s)

◆ printTotalStatistics()

void SiStripHitEfficiencyHarvester::printTotalStatistics ( const std::array< long, bounds::k_END_OF_LAYERS > &  layerFound,
const std::array< long, bounds::k_END_OF_LAYERS > &  layerTotal 
) const
private

Definition at line 502 of file SiStripHitEfficiencyHarvester.cc.

References mps_fire::i, LOGPRINT, nTEClayers_, and showRings_.

Referenced by dqmEndJob().

504  {
505  //Calculate the statistics by layer
506  int totalfound = 0;
507  int totaltotal = 0;
508  double layereff;
509  int subdetfound[5];
510  int subdettotal[5];
511 
512  for (Long_t i = 1; i < 5; i++) {
513  subdetfound[i] = 0;
514  subdettotal[i] = 0;
515  }
516 
517  for (Long_t i = 1; i <= bounds::k_LayersAtTECEnd; i++) {
518  layereff = double(layerFound[i]) / double(layerTotal[i]);
519  LOGPRINT << "Layer " << i << " (" << ::layerName(i, showRings_, nTEClayers_) << ") has total efficiency "
520  << layereff << " " << layerFound[i] << "/" << layerTotal[i];
521  totalfound += layerFound[i];
522  totaltotal += layerTotal[i];
523  if (i <= bounds::k_LayersAtTIBEnd) {
524  subdetfound[1] += layerFound[i];
525  subdettotal[1] += layerTotal[i];
526  }
527  if (i > bounds::k_LayersAtTIBEnd && i <= bounds::k_LayersAtTOBEnd) {
528  subdetfound[2] += layerFound[i];
529  subdettotal[2] += layerTotal[i];
530  }
531  if (i > bounds::k_LayersAtTOBEnd && i <= bounds::k_LayersAtTIDEnd) {
532  subdetfound[3] += layerFound[i];
533  subdettotal[3] += layerTotal[i];
534  }
535  if (i > bounds::k_LayersAtTIDEnd) {
536  subdetfound[4] += layerFound[i];
537  subdettotal[4] += layerTotal[i];
538  }
539  }
540 
541  LOGPRINT << "The total efficiency is " << double(totalfound) / double(totaltotal);
542  LOGPRINT << " TIB: " << double(subdetfound[1]) / subdettotal[1] << " " << subdetfound[1] << "/"
543  << subdettotal[1];
544  LOGPRINT << " TOB: " << double(subdetfound[2]) / subdettotal[2] << " " << subdetfound[2] << "/"
545  << subdettotal[2];
546  LOGPRINT << " TID: " << double(subdetfound[3]) / subdettotal[3] << " " << subdetfound[3] << "/"
547  << subdettotal[3];
548  LOGPRINT << " TEC: " << double(subdetfound[4]) / subdettotal[4] << " " << subdetfound[4] << "/"
549  << subdettotal[4];
550 }

◆ setEffBinLabels()

template<typename T >
void SiStripHitEfficiencyHarvester::setEffBinLabels ( const T  gr,
const T  gr2,
const unsigned int  nLayers 
) const
private

Definition at line 770 of file SiStripHitEfficiencyHarvester.cc.

References newFWLiteAna::bin, dqmdumpme::k, label, LogDebug, MuonTCMETValueMapProducer_cff::nLayers, nTEClayers_, showEndcapSides_, showRings_, showTOB6TEC9_, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by makeSummary().

770  {
771  LogDebug("SiStripHitEfficiencyHarvester")
772  << "nLayers = " << nLayers << " number of bins, gr1: " << gr->GetXaxis()->GetNbins()
773  << " number of bins, gr2: " << gr2->GetXaxis()->GetNbins() << " showRings: " << showRings_
774  << " showEndcapSides: " << showEndcapSides_ << " type of object is "
775  << boost::typeindex::type_id<T>().pretty_name();
776 
777  for (Long_t k = 1; k < nLayers + 1; k++) {
778  std::string label{};
779  if (showEndcapSides_)
780  label = ::layerSideName(k, showRings_, nTEClayers_);
781  else
782  label = ::layerName(k, showRings_, nTEClayers_);
783  if (!showTOB6TEC9_) {
784  if (k == 10)
785  label = "";
786  if (!showRings_ && k == nLayers)
787  label = "";
788  if (!showRings_ && showEndcapSides_ && k == 25)
789  label = "";
790  }
791 
792  int bin{-1};
793  if constexpr (std::is_same_v<T, TGraphAsymmErrors*>) {
794  edm::LogInfo("SiStripHitEfficiencyHarvester")
795  << "class name: " << gr->ClassName() << " expected TGraphAsymErrors" << std::endl;
796  if (!showRings_) {
797  if (showEndcapSides_) {
798  bin = (((k + 1) * 100 + 2) / (nLayers)-4);
799  } else {
800  bin = ((k + 1) * 100 / (nLayers)-6);
801  }
802  } else {
803  if (showEndcapSides_) {
804  bin = ((k + 1) * 100 / (nLayers)-4);
805  } else {
806  bin = ((k + 1) * 100 / (nLayers)-7);
807  }
808  }
809  } else {
810  edm::LogInfo("SiStripHitEfficiencyHarvester")
811  << "class name: " << gr->ClassName() << " expected TH1F" << std::endl;
812  bin = k;
813  }
814  gr->GetXaxis()->SetBinLabel(bin, label.data());
815  gr2->GetXaxis()->SetBinLabel(bin, label.data());
816  }
817 }
char const * label
Log< level::Info, false > LogInfo
#define LogDebug(id)

◆ writeBadStripPayload()

void SiStripHitEfficiencyHarvester::writeBadStripPayload ( const SiStripQuality quality) const
private

Definition at line 552 of file SiStripHitEfficiencyHarvester.cc.

References cond::service::PoolDBOutputService::currentTime(), Exception, edm::Service< T >::isAvailable(), quality, FastTimerService_cff::range, record_, and cond::service::PoolDBOutputService::writeOneIOV().

Referenced by dqmEndJob().

552  {
553  SiStripBadStrip pBadStrip{};
554  const auto pQdvBegin = quality.getDataVectorBegin();
555  for (auto rIt = quality.getRegistryVectorBegin(); rIt != quality.getRegistryVectorEnd(); ++rIt) {
556  const auto range = SiStripBadStrip::Range(pQdvBegin + rIt->ibegin, pQdvBegin + rIt->iend);
557  if (!pBadStrip.put(rIt->detid, range))
558  edm::LogError("SiStripHitEfficiencyHarvester") << "detid already exists in SiStripBadStrip";
559  }
561  if (poolDbService.isAvailable()) {
562  poolDbService->writeOneIOV(pBadStrip, poolDbService->currentTime(), record_);
563  } else {
564  throw cms::Exception("PoolDBService required");
565  }
566 }
string quality
Hash writeOneIOV(const T &payload, Time_t time, const std::string &recordName)
std::pair< ContainerIterator, ContainerIterator > Range
bool isAvailable() const
Definition: Service.h:40

Member Data Documentation

◆ alllayerfound

int SiStripHitEfficiencyHarvester::alllayerfound[bounds::k_END_OF_LAYS_AND_RINGS]
private

◆ alllayertotal

int SiStripHitEfficiencyHarvester::alllayertotal[bounds::k_END_OF_LAYS_AND_RINGS]
private

◆ autoIneffModTagging_

const bool SiStripHitEfficiencyHarvester::autoIneffModTagging_
private

Definition at line 54 of file SiStripHitEfficiencyHarvester.cc.

Referenced by dqmEndJob().

◆ calibData_

SiStripHitEffData SiStripHitEfficiencyHarvester::calibData_
private

Definition at line 51 of file SiStripHitEfficiencyHarvester.cc.

Referenced by dqmEndJob().

◆ doStoreOnDB_

const bool SiStripHitEfficiencyHarvester::doStoreOnDB_
private

Definition at line 54 of file SiStripHitEfficiencyHarvester.cc.

Referenced by dqmEndJob().

◆ doStoreOnTree_

const bool SiStripHitEfficiencyHarvester::doStoreOnTree_
private

Definition at line 55 of file SiStripHitEfficiencyHarvester.cc.

Referenced by dqmEndJob().

◆ effPlotMin_

const float SiStripHitEfficiencyHarvester::effPlotMin_
private

Definition at line 60 of file SiStripHitEfficiencyHarvester.cc.

Referenced by makeSummary().

◆ goodlayerfound

int SiStripHitEfficiencyHarvester::goodlayerfound[bounds::k_END_OF_LAYS_AND_RINGS]
private

◆ goodlayertotal

int SiStripHitEfficiencyHarvester::goodlayertotal[bounds::k_END_OF_LAYS_AND_RINGS]
private

◆ inputFolder_

const std::string SiStripHitEfficiencyHarvester::inputFolder_
private

Definition at line 52 of file SiStripHitEfficiencyHarvester.cc.

Referenced by dqmEndJob(), makeSummary(), and makeSummaryVsLumi().

◆ isAtPCL_

const bool SiStripHitEfficiencyHarvester::isAtPCL_
private

Definition at line 53 of file SiStripHitEfficiencyHarvester.cc.

Referenced by dqmEndJob(), and makeSummary().

◆ nModsMin_

const int SiStripHitEfficiencyHarvester::nModsMin_
private

Definition at line 59 of file SiStripHitEfficiencyHarvester.cc.

Referenced by dqmEndJob().

◆ nTEClayers_

const unsigned int SiStripHitEfficiencyHarvester::nTEClayers_
private

◆ record_

const std::string SiStripHitEfficiencyHarvester::record_
private

Definition at line 62 of file SiStripHitEfficiencyHarvester.cc.

Referenced by writeBadStripPayload().

◆ showEndcapSides_

const bool SiStripHitEfficiencyHarvester::showEndcapSides_
private

Definition at line 56 of file SiStripHitEfficiencyHarvester.cc.

Referenced by makeSummary(), and setEffBinLabels().

◆ showOnlyGoodModules_

const bool SiStripHitEfficiencyHarvester::showOnlyGoodModules_
private

Definition at line 56 of file SiStripHitEfficiencyHarvester.cc.

Referenced by makeSummary().

◆ showRings_

const bool SiStripHitEfficiencyHarvester::showRings_
private

◆ showTOB6TEC9_

const bool SiStripHitEfficiencyHarvester::showTOB6TEC9_
private

Definition at line 56 of file SiStripHitEfficiencyHarvester.cc.

Referenced by setEffBinLabels().

◆ stripDetIds_

std::vector<DetId> SiStripHitEfficiencyHarvester::stripDetIds_
private

Definition at line 72 of file SiStripHitEfficiencyHarvester.cc.

Referenced by dqmEndJob(), and endRun().

◆ stripQuality_

std::unique_ptr<SiStripQuality> SiStripHitEfficiencyHarvester::stripQuality_
private

Definition at line 71 of file SiStripHitEfficiencyHarvester.cc.

Referenced by dqmEndJob(), and endRun().

◆ stripQualityToken_

const edm::ESGetToken<SiStripQuality, SiStripQualityRcd> SiStripHitEfficiencyHarvester::stripQualityToken_
private

Definition at line 66 of file SiStripHitEfficiencyHarvester.cc.

Referenced by endRun().

◆ t_DetId

unsigned int SiStripHitEfficiencyHarvester::t_DetId
private

Definition at line 81 of file SiStripHitEfficiencyHarvester.cc.

Referenced by dqmEndJob().

◆ t_found

unsigned int SiStripHitEfficiencyHarvester::t_found
private

Definition at line 81 of file SiStripHitEfficiencyHarvester.cc.

Referenced by dqmEndJob().

◆ t_isTaggedIneff

bool SiStripHitEfficiencyHarvester::t_isTaggedIneff
private

Definition at line 83 of file SiStripHitEfficiencyHarvester.cc.

Referenced by dqmEndJob().

◆ t_layer

unsigned char SiStripHitEfficiencyHarvester::t_layer
private

Definition at line 82 of file SiStripHitEfficiencyHarvester.cc.

Referenced by dqmEndJob().

◆ t_threshold

float SiStripHitEfficiencyHarvester::t_threshold
private

Definition at line 84 of file SiStripHitEfficiencyHarvester.cc.

Referenced by dqmEndJob().

◆ t_total

unsigned int SiStripHitEfficiencyHarvester::t_total
private

Definition at line 81 of file SiStripHitEfficiencyHarvester.cc.

Referenced by dqmEndJob().

◆ threshold_

const double SiStripHitEfficiencyHarvester::threshold_
private

Definition at line 58 of file SiStripHitEfficiencyHarvester.cc.

Referenced by dqmEndJob().

◆ title_

const std::string SiStripHitEfficiencyHarvester::title_
private

Definition at line 62 of file SiStripHitEfficiencyHarvester.cc.

Referenced by dqmEndJob().

◆ tkDetMap_

std::unique_ptr<TkDetMap> SiStripHitEfficiencyHarvester::tkDetMap_
private

Definition at line 70 of file SiStripHitEfficiencyHarvester.cc.

Referenced by dqmEndJob(), and endRun().

◆ tkDetMapToken_

const edm::ESGetToken<TkDetMap, TrackerTopologyRcd> SiStripHitEfficiencyHarvester::tkDetMapToken_
private

Definition at line 65 of file SiStripHitEfficiencyHarvester.cc.

Referenced by endRun().

◆ tkGeomToken_

const edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> SiStripHitEfficiencyHarvester::tkGeomToken_
private

Definition at line 67 of file SiStripHitEfficiencyHarvester.cc.

Referenced by endRun().

◆ tkMapMin_

const double SiStripHitEfficiencyHarvester::tkMapMin_
private

Definition at line 61 of file SiStripHitEfficiencyHarvester.cc.

Referenced by dqmEndJob().

◆ tree

TTree* SiStripHitEfficiencyHarvester::tree
private

◆ tTopo_

std::unique_ptr<TrackerTopology> SiStripHitEfficiencyHarvester::tTopo_
private

Definition at line 69 of file SiStripHitEfficiencyHarvester.cc.

Referenced by dqmEndJob(), endRun(), and printAndWriteBadModules().

◆ tTopoToken_

const edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> SiStripHitEfficiencyHarvester::tTopoToken_
private

Definition at line 64 of file SiStripHitEfficiencyHarvester.cc.

Referenced by endRun().