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
 
void makeSummary (DQMStore::IGetter &getter, TFileService &fs) 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
 
void writeBadStripPayload (const SiStripQuality &quality) const
 

Private Attributes

const bool autoIneffModTagging_
 
const bool doStoreOnDB_
 
const std::string inputFolder_
 
const bool isAtPCL_
 
const int nModsMin_
 
const unsigned int nTEClayers_
 
const std::string record_
 
const bool showRings_
 
std::vector< DetIdstripDetIds_
 
std::unique_ptr< SiStripQualitystripQuality_
 
const edm::ESGetToken< SiStripQuality, SiStripQualityRcdstripQualityToken_
 
const double threshold_
 
const std::string title_
 
std::unique_ptr< TkDetMaptkDetMap_
 
const edm::ESGetToken< TkDetMap, TrackerTopologyRcdtkDetMapToken_
 
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecordtkGeomToken_
 
const double tkMapMin_
 
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
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 33 of file SiStripHitEfficiencyHarvester.cc.

Constructor & Destructor Documentation

◆ SiStripHitEfficiencyHarvester()

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

Definition at line 73 of file SiStripHitEfficiencyHarvester.cc.

74  : inputFolder_(conf.getParameter<std::string>("inputFolder")),
75  isAtPCL_(conf.getParameter<bool>("isAtPCL")),
76  showRings_(conf.getUntrackedParameter<bool>("ShowRings", false)),
77  autoIneffModTagging_(conf.getUntrackedParameter<bool>("AutoIneffModTagging", false)),
78  doStoreOnDB_(conf.getParameter<bool>("doStoreOnDB")),
79  nTEClayers_(showRings_ ? 7 : 9), // number of rings or wheels
80  threshold_(conf.getParameter<double>("Threshold")),
81  nModsMin_(conf.getParameter<int>("nModsMin")),
82  tkMapMin_(conf.getUntrackedParameter<double>("TkMapMin", 0.9)),
83  title_(conf.getParameter<std::string>("Title")),
84  record_(conf.getParameter<std::string>("Record")),
85  tTopoToken_(esConsumes<edm::Transition::EndRun>()),
86  tkDetMapToken_(esConsumes<edm::Transition::EndRun>()),
87  stripQualityToken_(esConsumes<edm::Transition::EndRun>()),
88  tkGeomToken_(esConsumes<edm::Transition::EndRun>()) {}
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken_
const edm::ESGetToken< SiStripQuality, SiStripQualityRcd > stripQualityToken_
T getUntrackedParameter(std::string const &, T const &) const
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > tkGeomToken_
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 110 of file SiStripHitEfficiencyHarvester.cc.

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

Referenced by dqmEndJob().

111  {
112  std::vector<bool> isAvailable;
113  isAvailable.reserve(maps.size());
115  maps.begin() + 1, maps.end(), std::back_inserter(isAvailable), [](auto& x) { return !(x == nullptr); });
116 
117  int count{0};
118  for (const auto& it : isAvailable) {
119  count++;
120  LogDebug("SiStripHitEfficiencyHarvester") << " layer: " << count << " " << it << std::endl;
121  if (it)
122  LogDebug("SiStripHitEfficiencyHarvester") << "resolving to " << maps[count]->getName() << std::endl;
123  }
124 
125  // check on the input TkHistoMap
126  bool areMapsAvailable{true};
127  int layerCount{0};
128  for (const auto& it : isAvailable) {
129  layerCount++;
130  if (!it) {
131  edm::LogError("SiStripHitEfficiencyHarvester")
132  << type << " TkHistoMap for layer " << layerCount << " was not found.\n -> Aborting!";
133  areMapsAvailable = false;
134  break;
135  }
136  }
137  return areMapsAvailable;
138 }
Log< level::Error, false > LogError
#define LogDebug(id)
unsigned transform(const HcalDetId &id, unsigned transformCode)

◆ dqmEndJob()

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

Implements DQMEDHarvester.

Definition at line 140 of file SiStripHitEfficiencyHarvester.cc.

References autoIneffModTagging_, dqm::implementation::IBooker::book1D(), checkMapsValidity(), makePileupJSON::denom, doStoreOnDB_, dqm-mbProfile::format, compareTotals::fs, mps_fire::i, inputFolder_, isAtPCL_, SiStripDetInfoFileReader::kDefaultFile, phase1PixelTopology::layer, phase1PixelTopology::layerName, LogDebug, LOGPRINT, makeSummary(), makeSummaryVsBX(), makeSummaryVsCM(), 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_, sistrip::STRIPS_PER_APV, threshold_, title_, tkDetMap_, tkMapMin_, tTopo_, and writeBadStripPayload().

140  {
142  LOGPRINT << "A module is bad if efficiency < " << threshold_ << " and has at least " << nModsMin_ << " nModsMin.";
143  else
144  LOGPRINT << "A module is bad if the upper limit on the efficiency is < to the avg in the layer - " << threshold_
145  << " and has at least " << nModsMin_ << " nModsMin.";
146 
147  auto h_module_total = std::make_unique<TkHistoMap>(tkDetMap_.get());
148  h_module_total->loadTkHistoMap(fmt::format("{}/TkDetMaps", inputFolder_), "perModule_total");
149  auto h_module_found = std::make_unique<TkHistoMap>(tkDetMap_.get());
150  h_module_found->loadTkHistoMap(fmt::format("{}/TkDetMaps", inputFolder_), "perModule_found");
151 
152  // collect how many layers are missing
153  const auto& totalMaps = h_module_total->getAllMaps();
154  const auto& foundMaps = h_module_found->getAllMaps();
155 
156  LogDebug("SiStripHitEfficiencyHarvester")
157  << "totalMaps.size(): " << totalMaps.size() << " foundMaps.size() " << foundMaps.size() << std::endl;
158 
159  // check on the input TkHistoMaps
160  bool isTotalMapAvailable = this->checkMapsValidity(totalMaps, std::string("Total"));
161  bool isFoundMapAvailable = this->checkMapsValidity(foundMaps, std::string("Found"));
162 
163  LogDebug("SiStripHitEfficiencyHarvester")
164  << "isTotalMapAvailable: " << isTotalMapAvailable << " isFoundMapAvailable " << isFoundMapAvailable << std::endl;
165 
166  // no input TkHistoMaps -> early return
167  if (!isTotalMapAvailable or !isFoundMapAvailable)
168  return;
169 
170  LogDebug("SiStripHitEfficiencyHarvester")
171  << "Entries in total TkHistoMap for layer 3: " << h_module_total->getMap(3)->getEntries() << ", found "
172  << h_module_found->getMap(3)->getEntries();
173 
174  // come back to the main folder
176 
177  std::vector<MonitorElement*> hEffInLayer(std::size_t(1), nullptr);
178  hEffInLayer.reserve(bounds::k_END_OF_LAYERS);
179  for (std::size_t i = 1; i != bounds::k_END_OF_LAYERS; ++i) {
180  const auto lyrName = ::layerName(i, showRings_, nTEClayers_);
181  hEffInLayer.push_back(booker.book1D(
182  Form("eff_layer%i", int(i)), Form("Module efficiency in layer %s", lyrName.c_str()), 201, 0, 1.005));
183  }
184  std::array<long, bounds::k_END_OF_LAYERS> layerTotal{};
185  std::array<long, bounds::k_END_OF_LAYERS> layerFound{};
186  layerTotal.fill(0);
187  layerFound.fill(0);
188 
190  // Effiency calculation, bad module tagging, and tracker maps //
192 
193  TrackerMap tkMap{" Detector Inefficiency "};
194  TrackerMap tkMapBad{" Inefficient Modules "};
195  TrackerMap tkMapEff{title_};
196  TrackerMap tkMapNum{" Detector numerator "};
197  TrackerMap tkMapDen{" Detector denominator "};
198  std::map<unsigned int, double> badModules;
199 
200  for (auto det : stripDetIds_) {
201  auto layer = ::checkLayer(det, tTopo_.get());
202  const auto num = h_module_found->getValue(det);
203  const auto denom = h_module_total->getValue(det);
204  if (denom) {
205  const auto eff = num / denom;
206  hEffInLayer[layer]->Fill(eff);
207  if (!autoIneffModTagging_) {
208  if ((denom >= nModsMin_) && (eff < threshold_)) {
209  // We have a bad module, put it in the list!
210  badModules[det] = eff;
211  tkMapBad.fillc(det, 255, 0, 0);
212  LOGPRINT << "Layer " << layer << " (" << ::layerName(layer, showRings_, nTEClayers_) << ") module "
213  << det.rawId() << " efficiency: " << eff << " , " << num << "/" << denom;
214  } else {
215  //Fill the bad list with empty results for every module
216  tkMapBad.fillc(det, 255, 255, 255);
217  }
218  if (eff < threshold_)
219  LOGPRINT << "Layer " << layer << " (" << ::layerName(layer, showRings_, nTEClayers_) << ") module "
220  << det.rawId() << " efficiency: " << eff << " , " << num << "/" << denom;
221 
222  if (denom < nModsMin_) {
223  LOGPRINT << "Layer " << layer << " (" << ::layerName(layer, showRings_, nTEClayers_) << ") module "
224  << det.rawId() << " is under occupancy at " << denom;
225  }
226  }
227  //Put any module into the TKMap
228  tkMap.fill(det, 1. - eff);
229  tkMapEff.fill(det, eff);
230  tkMapNum.fill(det, num);
231  tkMapDen.fill(det, denom);
232 
233  layerTotal[layer] += denom;
234  layerFound[layer] += num;
235  }
236  }
237 
238  if (autoIneffModTagging_) {
239  for (Long_t i = 1; i <= k_LayersAtTECEnd; i++) {
240  //Compute threshold to use for each layer
241  hEffInLayer[i]->getTH1()->GetXaxis()->SetRange(
242  3, hEffInLayer[i]->getNbinsX() + 1); // Remove from the avg modules below 1%
243  const double layer_min_eff = hEffInLayer[i]->getMean() - std::max(2.5 * hEffInLayer[i]->getRMS(), threshold_);
244  LOGPRINT << "Layer " << i << " threshold for bad modules: <" << layer_min_eff
245  << " (layer mean: " << hEffInLayer[i]->getMean() << " rms: " << hEffInLayer[i]->getRMS() << ")";
246 
247  hEffInLayer[i]->getTH1()->GetXaxis()->SetRange(1, hEffInLayer[i]->getNbinsX() + 1);
248 
249  for (auto det : stripDetIds_) {
250  const auto layer = ::checkLayer(det, tTopo_.get());
251  if (layer == i) {
252  const auto num = h_module_found->getValue(det);
253  const auto denom = h_module_total->getValue(det);
254  if (denom) {
255  const auto eff = num / denom;
256  const auto eff_up = TEfficiency::Bayesian(denom, num, .99, 1, 1, true);
257 
258  if ((denom >= nModsMin_) && (eff_up < layer_min_eff)) {
259  //We have a bad module, put it in the list!
260  badModules[det] = eff;
261  tkMapBad.fillc(det, 255, 0, 0);
262  } else {
263  //Fill the bad list with empty results for every module
264  tkMapBad.fillc(det, 255, 255, 255);
265  }
266  if (eff_up < layer_min_eff + 0.08) // printing message also for modules sligthly above (8%) the limit
267 
268  LOGPRINT << "Layer " << layer << " (" << ::layerName(layer, showRings_, nTEClayers_) << ") module "
269  << det.rawId() << " efficiency: " << eff << " , " << num << "/" << denom
270  << " , upper limit: " << eff_up;
271  if (denom < nModsMin_) {
272  LOGPRINT << "Layer " << layer << " (" << ::layerName(layer, showRings_, nTEClayers_) << ") module "
273  << det.rawId() << " layer " << layer << " is under occupancy at " << denom;
274  }
275  }
276  }
277  }
278  }
279  }
280 
281  tkMap.save(true, 0, 0, "SiStripHitEffTKMap_NEW.png");
282  tkMapBad.save(true, 0, 0, "SiStripHitEffTKMapBad_NEW.png");
283  tkMapEff.save(true, tkMapMin_, 1., "SiStripHitEffTKMapEff_NEW.png");
284  tkMapNum.save(true, 0, 0, "SiStripHitEffTKMapNum_NEW.png");
285  tkMapDen.save(true, 0, 0, "SiStripHitEffTKMapDen_NEW.png");
286 
287  const auto detInfo =
289  SiStripQuality pQuality{detInfo};
290  //This is the list of the bad strips, use to mask out entire APVs
291  //Now simply go through the bad hit list and mask out things that
292  //are bad!
293  for (const auto it : badModules) {
294  const auto det = it.first;
295  std::vector<unsigned int> badStripList;
296  //We need to figure out how many strips are in this particular module
297  //To Mask correctly!
298  const auto nStrips = detInfo.getNumberOfApvsAndStripLength(det).first * sistrip::STRIPS_PER_APV;
299  LOGPRINT << "Number of strips module " << det << " is " << nStrips;
300  badStripList.push_back(pQuality.encode(0, nStrips, 0));
301  //Now compact into a single bad module
302  LOGPRINT << "ID1 shoudl match list of modules above " << det;
303  pQuality.compact(det, badStripList);
304  pQuality.put(det, SiStripQuality::Range(badStripList.begin(), badStripList.end()));
305  }
306  pQuality.fillBadComponents();
307  if (doStoreOnDB_) {
308  writeBadStripPayload(pQuality);
309  } else {
310  edm::LogInfo("SiStripHitEfficiencyHarvester") << "Will not produce payload!";
311  }
312 
313  printTotalStatistics(layerFound, layerTotal); // statistics by layer and subdetector
314  //LOGPRINT << "\n-----------------\nNew IOV starting from run " << e.id().run() << " event " << e.id().event()
315  // << " lumiBlock " << e.luminosityBlock() << " time " << e.time().value() << "\n-----------------\n";
316  printAndWriteBadModules(pQuality, detInfo); // TODO
317 
318  if (!isAtPCL_) {
320  makeSummary(getter, *fs); // TODO
321  makeSummaryVsBX(getter, *fs); // TODO
322  makeSummaryVsCM(getter, *fs); // TODO
323  }
324 
325  makeSummaryVsLumi(getter); // TODO
326 }
constexpr char const * layerName[numberOfLayers]
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
std::unique_ptr< TrackerTopology > tTopo_
void printAndWriteBadModules(const SiStripQuality &quality, const SiStripDetInfo &detInfo) const
void makeSummaryVsLumi(DQMStore::IGetter &getter) const
nStrips
1.2 is to make the matching window safely the two nearest strips 0.35 is the size of an ME0 chamber i...
constexpr std::array< uint8_t, layerIndexSize > layer
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
void writeBadStripPayload(const SiStripQuality &quality) const
void makeSummaryVsBX(DQMStore::IGetter &getter, TFileService &fs) const
SiStripDetInfo read(std::string filePath)
void makeSummaryVsCM(DQMStore::IGetter &getter, TFileService &fs) const
Log< level::Info, false > LogInfo
static const uint16_t STRIPS_PER_APV
std::pair< ContainerIterator, ContainerIterator > Range
static constexpr char const *const kDefaultFile
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
void makeSummary(DQMStore::IGetter &getter, TFileService &fs) const
#define LogDebug(id)

◆ endRun()

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

Definition at line 90 of file SiStripHitEfficiencyHarvester.cc.

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

90  {
91  if (!tTopo_) {
92  tTopo_ = std::make_unique<TrackerTopology>(iSetup.getData(tTopoToken_));
93  }
94  if (!tkDetMap_) {
95  tkDetMap_ = std::make_unique<TkDetMap>(iSetup.getData(tkDetMapToken_));
96  }
97  if (!stripQuality_) {
98  stripQuality_ = std::make_unique<SiStripQuality>(iSetup.getData(stripQualityToken_));
99  }
100  if (stripDetIds_.empty()) {
101  const auto& tkGeom = iSetup.getData(tkGeomToken_);
102  for (const auto& det : tkGeom.detUnits()) {
103  if (dynamic_cast<const StripGeomDetUnit*>(det)) {
104  stripDetIds_.push_back(det->geographicalId());
105  }
106  }
107  }
108 }
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 660 of file SiStripHitEfficiencyHarvester.cc.

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

660  {
662  desc.add<std::string>("inputFolder", "AlCaReco/SiStripHitEfficiency");
663  desc.add<bool>("isAtPCL", false);
664  desc.add<bool>("doStoreOnDB", false);
665  desc.add<std::string>("Record", "SiStripBadStrip");
666  desc.add<double>("Threshold", 0.1);
667  desc.add<std::string>("Title", "Hit Efficiency");
668  desc.add<int>("nModsMin", 5);
669  desc.addUntracked<bool>("AutoIneffModTagging", false);
670  desc.addUntracked<double>("TkMapMin", 0.9);
671  desc.addUntracked<bool>("ShowRings", false);
672  descriptions.addWithDefaultLabel(desc);
673 }
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)

◆ makeSummary()

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

Definition at line 394 of file SiStripHitEfficiencyHarvester.cc.

Referenced by dqmEndJob().

394  {
395  // use goodlayer_total/found and alllayer_total/found, collapse side and/or ring if needed
396 }

◆ makeSummaryVsBX()

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

Definition at line 398 of file SiStripHitEfficiencyHarvester.cc.

Referenced by dqmEndJob().

398  {
399  // use found/totalVsBx_layer%i [0,23)
400 }

◆ makeSummaryVsCM()

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

Definition at line 435 of file SiStripHitEfficiencyHarvester.cc.

Referenced by dqmEndJob().

435 {}

◆ makeSummaryVsLumi()

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

Definition at line 402 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().

402  {
403  for (unsigned int iLayer = 1; iLayer != (showRings_ ? 20 : 22); ++iLayer) {
404  auto hfound = getter.get(fmt::format("{}/VsLumi/layerfound_vsLumi_layer_{}", inputFolder_, iLayer))->getTH1F();
405  auto htotal = getter.get(fmt::format("{}/VsLumi/layertotal_vsLumi_layer_{}", inputFolder_, iLayer))->getTH1F();
406 
407  if (hfound == nullptr or htotal == nullptr) {
408  if (hfound == nullptr)
409  edm::LogError("SiStripHitEfficiencyHarvester")
410  << fmt::format("{}/VsLumi/layerfound_vsLumi_layer_{}", inputFolder_, iLayer) << " was not found!";
411  if (htotal == nullptr)
412  edm::LogError("SiStripHitEfficiencyHarvester")
413  << fmt::format("{}/VsLumi/layertotal_vsLumi_layer_{}", inputFolder_, iLayer) << " was not found!";
414  // no input histograms -> continue in the loop
415  continue;
416  }
417 
418  if (!hfound->GetSumw2())
419  hfound->Sumw2();
420  if (!htotal->GetSumw2())
421  htotal->Sumw2();
422  for (Long_t i = 0; i != hfound->GetNbinsX() + 1; ++i) {
423  if (hfound->GetBinContent(i) == 0)
424  hfound->SetBinContent(i, 1e-6);
425  if (htotal->GetBinContent(i) == 0)
426  htotal->SetBinContent(i, 1);
427  }
428  LogDebug("SiStripHitEfficiencyHarvester")
429  << "Total hits for layer " << iLayer << " (vs lumi): " << htotal->GetEntries() << ", found "
430  << hfound->GetEntries();
431  }
432  // continue
433 }
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:673
#define LogDebug(id)

◆ printAndWriteBadModules()

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

Definition at line 474 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().

475  {
477  //try to write out what's in the quality record
479  int nTkBadComp[4]; //k: 0=BadModule, 1=BadFiber, 2=BadApv, 3=BadStrips
480  int nBadComp[4][19][4];
481  //legend: nBadComp[i][j][k]= SubSystem i, layer/disk/wheel j, BadModule/Fiber/Apv k
482  // i: 0=TIB, 1=TID, 2=TOB, 3=TEC
483  // k: 0=BadModule, 1=BadFiber, 2=BadApv, 3=BadStrips
484  std::stringstream ssV[4][19];
485 
486  for (int i = 0; i < 4; ++i) {
487  nTkBadComp[i] = 0;
488  for (int j = 0; j < 19; ++j) {
489  ssV[i][j].str("");
490  for (int k = 0; k < 4; ++k)
491  nBadComp[i][j][k] = 0;
492  }
493  }
494 
495  for (const auto& bc : quality.getBadComponentList()) {
496  // Full Tk
497  if (bc.BadModule)
498  nTkBadComp[0]++;
499  if (bc.BadFibers)
500  nTkBadComp[1] += ((bc.BadFibers >> 2) & 0x1) + ((bc.BadFibers >> 1) & 0x1) + ((bc.BadFibers) & 0x1);
501  if (bc.BadApvs)
502  nTkBadComp[2] += ((bc.BadApvs >> 5) & 0x1) + ((bc.BadApvs >> 4) & 0x1) + ((bc.BadApvs >> 3) & 0x1) +
503  ((bc.BadApvs >> 2) & 0x1) + ((bc.BadApvs >> 1) & 0x1) + ((bc.BadApvs) & 0x1);
504  // single subsystem
505  DetId det(bc.detid);
506  if ((det.subdetId() >= SiStripSubdetector::TIB) && (det.subdetId() <= SiStripSubdetector::TEC)) {
507  const auto nAPV = detInfo.getNumberOfApvsAndStripLength(det).first;
508  switch (det.subdetId()) {
510  setBadComponents(0, tTopo_->tibLayer(det), bc, ssV, nBadComp, nAPV);
511  break;
514  (tTopo_->tidSide(det) == 2 ? tTopo_->tidWheel(det) : tTopo_->tidWheel(det) + 3),
515  bc,
516  ssV,
517  nBadComp,
518  nAPV);
519  break;
521  setBadComponents(2, tTopo_->tobLayer(det), bc, ssV, nBadComp, nAPV);
522  break;
525  (tTopo_->tecSide(det) == 2 ? tTopo_->tecWheel(det) : tTopo_->tecWheel(det) + 9),
526  bc,
527  ssV,
528  nBadComp,
529  nAPV);
530  break;
531  default:
532  break;
533  }
534  }
535  }
536  // single strip info
537  for (auto rp = quality.getRegistryVectorBegin(); rp != quality.getRegistryVectorEnd(); ++rp) {
538  DetId det{rp->detid};
539  int subdet = -999;
540  int component = -999;
541  switch (det.subdetId()) {
543  subdet = 0;
544  component = tTopo_->tibLayer(det);
545  break;
547  subdet = 1;
548  component = tTopo_->tidSide(det) == 2 ? tTopo_->tidWheel(det) : tTopo_->tidWheel(det) + 3;
549  break;
551  subdet = 2;
552  component = tTopo_->tobLayer(det);
553  break;
555  subdet = 3;
556  component = tTopo_->tecSide(det) == 2 ? tTopo_->tecWheel(det) : tTopo_->tecWheel(det) + 9;
557  break;
558  default:
559  break;
560  }
561 
562  const auto pQdvBegin = quality.getDataVectorBegin();
563  const auto sqrange = SiStripQuality::Range(pQdvBegin + rp->ibegin, pQdvBegin + rp->iend);
564  float percentage = 0;
565  for (int it = 0; it < sqrange.second - sqrange.first; it++) {
566  unsigned int range = quality.decode(*(sqrange.first + it)).range;
567  nTkBadComp[3] += range;
568  nBadComp[subdet][0][3] += range;
569  nBadComp[subdet][component][3] += range;
570  percentage += range;
571  }
572  if (percentage != 0)
573  percentage /= (sistrip::STRIPS_PER_APV * detInfo.getNumberOfApvsAndStripLength(det).first);
574  if (percentage > 1)
575  edm::LogError("SiStripHitEfficiencyHarvester") << "PROBLEM detid " << det.rawId() << " value " << percentage;
576  }
577 
578  // printout
579  std::ostringstream ss;
580  ss << "\n-----------------\nGlobal Info\n-----------------";
581  ss << "\nBadComp \t Modules \tFibers "
582  "\tApvs\tStrips\n----------------------------------------------------------------";
583  ss << "\nTracker:\t\t" << nTkBadComp[0] << "\t" << nTkBadComp[1] << "\t" << nTkBadComp[2] << "\t" << nTkBadComp[3];
584  ss << "\nTIB:\t\t\t" << nBadComp[0][0][0] << "\t" << nBadComp[0][0][1] << "\t" << nBadComp[0][0][2] << "\t"
585  << nBadComp[0][0][3];
586  ss << "\nTID:\t\t\t" << nBadComp[1][0][0] << "\t" << nBadComp[1][0][1] << "\t" << nBadComp[1][0][2] << "\t"
587  << nBadComp[1][0][3];
588  ss << "\nTOB:\t\t\t" << nBadComp[2][0][0] << "\t" << nBadComp[2][0][1] << "\t" << nBadComp[2][0][2] << "\t"
589  << nBadComp[2][0][3];
590  ss << "\nTEC:\t\t\t" << nBadComp[3][0][0] << "\t" << nBadComp[3][0][1] << "\t" << nBadComp[3][0][2] << "\t"
591  << nBadComp[3][0][3];
592  ss << "\n";
593 
594  for (int i = 1; i < 5; ++i)
595  ss << "\nTIB Layer " << i << " :\t\t" << nBadComp[0][i][0] << "\t" << nBadComp[0][i][1] << "\t" << nBadComp[0][i][2]
596  << "\t" << nBadComp[0][i][3];
597  ss << "\n";
598  for (int i = 1; i < 4; ++i)
599  ss << "\nTID+ Disk " << i << " :\t\t" << nBadComp[1][i][0] << "\t" << nBadComp[1][i][1] << "\t" << nBadComp[1][i][2]
600  << "\t" << nBadComp[1][i][3];
601  for (int i = 4; i < 7; ++i)
602  ss << "\nTID- Disk " << i - 3 << " :\t\t" << nBadComp[1][i][0] << "\t" << nBadComp[1][i][1] << "\t"
603  << nBadComp[1][i][2] << "\t" << nBadComp[1][i][3];
604  ss << "\n";
605  for (int i = 1; i < 7; ++i)
606  ss << "\nTOB Layer " << i << " :\t\t" << nBadComp[2][i][0] << "\t" << nBadComp[2][i][1] << "\t" << nBadComp[2][i][2]
607  << "\t" << nBadComp[2][i][3];
608  ss << "\n";
609  for (int i = 1; i < 10; ++i)
610  ss << "\nTEC+ Disk " << i << " :\t\t" << nBadComp[3][i][0] << "\t" << nBadComp[3][i][1] << "\t" << nBadComp[3][i][2]
611  << "\t" << nBadComp[3][i][3];
612  for (int i = 10; i < 19; ++i)
613  ss << "\nTEC- Disk " << i - 9 << " :\t\t" << nBadComp[3][i][0] << "\t" << nBadComp[3][i][1] << "\t"
614  << nBadComp[3][i][2] << "\t" << nBadComp[3][i][3];
615  ss << "\n";
616 
617  ss << "\n----------------------------------------------------------------\n\t\t Detid \tModules Fibers "
618  "Apvs\n----------------------------------------------------------------";
619  for (int i = 1; i < 5; ++i)
620  ss << "\nTIB Layer " << i << " :" << ssV[0][i].str();
621  ss << "\n";
622  for (int i = 1; i < 4; ++i)
623  ss << "\nTID+ Disk " << i << " :" << ssV[1][i].str();
624  for (int i = 4; i < 7; ++i)
625  ss << "\nTID- Disk " << i - 3 << " :" << ssV[1][i].str();
626  ss << "\n";
627  for (int i = 1; i < 7; ++i)
628  ss << "\nTOB Layer " << i << " :" << ssV[2][i].str();
629  ss << "\n";
630  for (int i = 1; i < 10; ++i)
631  ss << "\nTEC+ Disk " << i << " :" << ssV[3][i].str();
632  for (int i = 10; i < 19; ++i)
633  ss << "\nTEC- Disk " << i - 9 << " :" << ssV[3][i].str();
634 
635  LOGPRINT << ss.str();
636 
637  // store also bad modules in log file
638  std::ofstream badModules;
639  badModules.open("BadModules_NEW.log");
640  badModules << "\n----------------------------------------------------------------\n\t\t Detid \tModules Fibers "
641  "Apvs\n----------------------------------------------------------------";
642  for (int i = 1; i < 5; ++i)
643  badModules << "\nTIB Layer " << i << " :" << ssV[0][i].str();
644  badModules << "\n";
645  for (int i = 1; i < 4; ++i)
646  badModules << "\nTID+ Disk " << i << " :" << ssV[1][i].str();
647  for (int i = 4; i < 7; ++i)
648  badModules << "\nTID- Disk " << i - 3 << " :" << ssV[1][i].str();
649  badModules << "\n";
650  for (int i = 1; i < 7; ++i)
651  badModules << "\nTOB Layer " << i << " :" << ssV[2][i].str();
652  badModules << "\n";
653  for (int i = 1; i < 10; ++i)
654  badModules << "\nTEC+ Disk " << i << " :" << ssV[3][i].str();
655  for (int i = 10; i < 19; ++i)
656  badModules << "\nTEC- Disk " << i - 9 << " :" << ssV[3][i].str();
657  badModules.close();
658 }
std::unique_ptr< TrackerTopology > tTopo_
Log< level::Error, false > LogError
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
string quality
#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 328 of file SiStripHitEfficiencyHarvester.cc.

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

Referenced by dqmEndJob().

330  {
331  //Calculate the statistics by layer
332  int totalfound = 0;
333  int totaltotal = 0;
334  double layereff;
335  int subdetfound[5];
336  int subdettotal[5];
337 
338  for (Long_t i = 1; i < 5; i++) {
339  subdetfound[i] = 0;
340  subdettotal[i] = 0;
341  }
342 
343  for (Long_t i = 1; i <= bounds::k_LayersAtTECEnd; i++) {
344  layereff = double(layerFound[i]) / double(layerTotal[i]);
345  LOGPRINT << "Layer " << i << " (" << ::layerName(i, showRings_, nTEClayers_) << ") has total efficiency "
346  << layereff << " " << layerFound[i] << "/" << layerTotal[i];
347  totalfound += layerFound[i];
348  totaltotal += layerTotal[i];
349  if (i <= bounds::k_LayersAtTIBEnd) {
350  subdetfound[1] += layerFound[i];
351  subdettotal[1] += layerTotal[i];
352  }
353  if (i > bounds::k_LayersAtTIBEnd && i <= bounds::k_LayersAtTOBEnd) {
354  subdetfound[2] += layerFound[i];
355  subdettotal[2] += layerTotal[i];
356  }
357  if (i > bounds::k_LayersAtTOBEnd && i <= bounds::k_LayersAtTIDEnd) {
358  subdetfound[3] += layerFound[i];
359  subdettotal[3] += layerTotal[i];
360  }
361  if (i > bounds::k_LayersAtTIDEnd) {
362  subdetfound[4] += layerFound[i];
363  subdettotal[4] += layerTotal[i];
364  }
365  }
366 
367  LOGPRINT << "The total efficiency is " << double(totalfound) / double(totaltotal);
368  LOGPRINT << " TIB: " << double(subdetfound[1]) / subdettotal[1] << " " << subdetfound[1] << "/"
369  << subdettotal[1];
370  LOGPRINT << " TOB: " << double(subdetfound[2]) / subdettotal[2] << " " << subdetfound[2] << "/"
371  << subdettotal[2];
372  LOGPRINT << " TID: " << double(subdetfound[3]) / subdettotal[3] << " " << subdetfound[3] << "/"
373  << subdettotal[3];
374  LOGPRINT << " TEC: " << double(subdetfound[4]) / subdettotal[4] << " " << subdetfound[4] << "/"
375  << subdettotal[4];
376 }
constexpr char const * layerName[numberOfLayers]

◆ writeBadStripPayload()

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

Definition at line 378 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().

378  {
379  SiStripBadStrip pBadStrip{};
380  const auto pQdvBegin = quality.getDataVectorBegin();
381  for (auto rIt = quality.getRegistryVectorBegin(); rIt != quality.getRegistryVectorEnd(); ++rIt) {
382  const auto range = SiStripBadStrip::Range(pQdvBegin + rIt->ibegin, pQdvBegin + rIt->iend);
383  if (!pBadStrip.put(rIt->detid, range))
384  edm::LogError("SiStripHitEfficiencyHarvester") << "detid already exists in SiStripBadStrip";
385  }
387  if (poolDbService.isAvailable()) {
388  poolDbService->writeOneIOV(pBadStrip, poolDbService->currentTime(), record_);
389  } else {
390  throw cms::Exception("PoolDBService required");
391  }
392 }
Hash writeOneIOV(const T &payload, Time_t time, const std::string &recordName)
std::pair< ContainerIterator, ContainerIterator > Range
bool isAvailable() const
Definition: Service.h:40
string quality

Member Data Documentation

◆ autoIneffModTagging_

const bool SiStripHitEfficiencyHarvester::autoIneffModTagging_
private

Definition at line 45 of file SiStripHitEfficiencyHarvester.cc.

Referenced by dqmEndJob().

◆ doStoreOnDB_

const bool SiStripHitEfficiencyHarvester::doStoreOnDB_
private

Definition at line 45 of file SiStripHitEfficiencyHarvester.cc.

Referenced by dqmEndJob().

◆ inputFolder_

const std::string SiStripHitEfficiencyHarvester::inputFolder_
private

Definition at line 43 of file SiStripHitEfficiencyHarvester.cc.

Referenced by dqmEndJob(), and makeSummaryVsLumi().

◆ isAtPCL_

const bool SiStripHitEfficiencyHarvester::isAtPCL_
private

Definition at line 44 of file SiStripHitEfficiencyHarvester.cc.

Referenced by dqmEndJob().

◆ nModsMin_

const int SiStripHitEfficiencyHarvester::nModsMin_
private

Definition at line 48 of file SiStripHitEfficiencyHarvester.cc.

Referenced by dqmEndJob().

◆ nTEClayers_

const unsigned int SiStripHitEfficiencyHarvester::nTEClayers_
private

Definition at line 46 of file SiStripHitEfficiencyHarvester.cc.

Referenced by dqmEndJob(), and printTotalStatistics().

◆ record_

const std::string SiStripHitEfficiencyHarvester::record_
private

Definition at line 50 of file SiStripHitEfficiencyHarvester.cc.

Referenced by writeBadStripPayload().

◆ showRings_

const bool SiStripHitEfficiencyHarvester::showRings_
private

◆ stripDetIds_

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

Definition at line 60 of file SiStripHitEfficiencyHarvester.cc.

Referenced by dqmEndJob(), and endRun().

◆ stripQuality_

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

Definition at line 59 of file SiStripHitEfficiencyHarvester.cc.

Referenced by endRun().

◆ stripQualityToken_

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

Definition at line 54 of file SiStripHitEfficiencyHarvester.cc.

Referenced by endRun().

◆ threshold_

const double SiStripHitEfficiencyHarvester::threshold_
private

Definition at line 47 of file SiStripHitEfficiencyHarvester.cc.

Referenced by dqmEndJob().

◆ title_

const std::string SiStripHitEfficiencyHarvester::title_
private

Definition at line 50 of file SiStripHitEfficiencyHarvester.cc.

Referenced by dqmEndJob().

◆ tkDetMap_

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

Definition at line 58 of file SiStripHitEfficiencyHarvester.cc.

Referenced by dqmEndJob(), and endRun().

◆ tkDetMapToken_

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

Definition at line 53 of file SiStripHitEfficiencyHarvester.cc.

Referenced by endRun().

◆ tkGeomToken_

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

Definition at line 55 of file SiStripHitEfficiencyHarvester.cc.

Referenced by endRun().

◆ tkMapMin_

const double SiStripHitEfficiencyHarvester::tkMapMin_
private

Definition at line 49 of file SiStripHitEfficiencyHarvester.cc.

Referenced by dqmEndJob().

◆ tTopo_

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

Definition at line 57 of file SiStripHitEfficiencyHarvester.cc.

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

◆ tTopoToken_

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

Definition at line 52 of file SiStripHitEfficiencyHarvester.cc.

Referenced by endRun().