CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
SiStripCondVisualizer Class Reference
Inheritance diagram for SiStripCondVisualizer:
edm::one::EDAnalyzer< edm::one::SharedResources, edm::one::WatchRuns > edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

 SiStripCondVisualizer (const edm::ParameterSet &)
 
 ~SiStripCondVisualizer () override=default
 
- Public Member Functions inherited from edm::one::EDAnalyzer< edm::one::SharedResources, edm::one::WatchRuns >
 EDAnalyzer ()=default
 
 EDAnalyzer (const EDAnalyzer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
const EDAnalyzeroperator= (const EDAnalyzer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDAnalyzerBase () 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::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void beginRun (edm::Run const &, edm::EventSetup const &) override
 
HistoMap bookModuleHistograms (const TrackerTopology *tTopo, const SiStripCondTypes::condformat &type)
 
void endRun (edm::Run const &, edm::EventSetup const &) override
 
template<class Payload >
void fillTheHistoMap (const Payload *obj, HistoMap &theMap)
 
void fillTheQualityMap (const SiStripQuality *obj, HistoMap &theMap)
 
bool isDetIdSelected (const uint32_t detid)
 
std::string module_location_type (const unsigned int &mod)
 
std::tuple< std::string, int, int, int > setTopoInfo (uint32_t detId, const TrackerTopology *tTopo)
 

Private Attributes

std::vector< DetIdSelectordetidsels_
 
SiStripDetInfo detInfo_
 
const bool doBadComps_
 
const bool doG1_
 
const bool doG2_
 
const bool doNoise_
 
const bool doPeds_
 
edm::Service< TFileServicefs_
 
HistoMap G1Map_
 
edm::ESGetToken< SiStripApvGain, SiStripApvGainRcdg1Token_
 
HistoMap G2Map_
 
edm::ESGetToken< SiStripApvGain, SiStripApvGain2Rcdg2Token_
 
HistoMap NoiseMap_
 
edm::ESGetToken< SiStripNoises, SiStripNoisesRcdnoiseToken_
 
std::map< std::string, TFileDirectoryoutputFolders_
 
HistoMap PedMap_
 
edm::ESGetToken< SiStripPedestals, SiStripPedestalsRcdpedToken_
 
std::bitset< 5 > plottedConditions_
 
HistoMap QualMap_
 
edm::ESGetToken< SiStripQuality, SiStripQualityRcdqualToken_
 
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcdtopoToken_
 

Additional Inherited Members

- Public Types inherited from edm::one::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- 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)
 

Detailed Description

Definition at line 93 of file SiStripCondVisualizer.cc.

Constructor & Destructor Documentation

◆ SiStripCondVisualizer()

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

Definition at line 137 of file SiStripCondVisualizer.cc.

References detidsels_, detInfo_, doBadComps_, doG1_, doG2_, doNoise_, doPeds_, edm::EDConsumerBase::esConsumes(), contentValuesFiles::fullPath, g1Token_, g2Token_, edm::ParameterSet::getParameter(), SiStripDetInfoFileReader::kDefaultFile, TFileService::kSharedResource, SiStripCondTypes::makeBitSet(), noiseToken_, pedToken_, plottedConditions_, qualToken_, SiStripDetInfoFileReader::read(), corrVsCorr::selection, and AlCaHLTBitMon_QueryRunRegistry::string.

138  : topoToken_(esConsumes<edm::Transition::BeginRun>()),
139  doNoise_(iConfig.getParameter<bool>("doNoise")),
140  doPeds_(iConfig.getParameter<bool>("doPeds")),
141  doG1_(iConfig.getParameter<bool>("doG1")),
142  doG2_(iConfig.getParameter<bool>("doG2")),
143  doBadComps_(iConfig.getParameter<bool>("doBadComps")),
144  detidsels_() {
145  usesResource(TFileService::kSharedResource);
146  // now do what ever initialization is needed
148 
150 
151  // now do the consumes
152  if (doNoise_)
154  if (doPeds_)
155  pedToken_ = esConsumes();
156  if (doG1_)
157  g1Token_ = esConsumes();
158  if (doG2_)
159  g2Token_ = esConsumes();
160  if (doBadComps_)
161  qualToken_ = esConsumes(edm::ESInputTag("", iConfig.getParameter<std::string>("StripQualityLabel")));
162 
163  // detid selection
164  std::vector<edm::ParameterSet> selconfigs = iConfig.getParameter<std::vector<edm::ParameterSet>>("selections");
165  for (std::vector<edm::ParameterSet>::const_iterator selconfig = selconfigs.begin(); selconfig != selconfigs.end();
166  ++selconfig) {
167  DetIdSelector selection(*selconfig);
168  detidsels_.push_back(selection);
169  }
170 }
static const std::string kSharedResource
Definition: TFileService.h:76
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
std::bitset< 5 > plottedConditions_
selection
main part
Definition: corrVsCorr.py:100
edm::ESGetToken< SiStripQuality, SiStripQualityRcd > qualToken_
std::bitset< sizeof...(Args)> makeBitSet(Args... as)
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > topoToken_
edm::ESGetToken< SiStripPedestals, SiStripPedestalsRcd > pedToken_
SiStripDetInfo read(std::string filePath)
edm::ESGetToken< SiStripApvGain, SiStripApvGainRcd > g1Token_
std::vector< DetIdSelector > detidsels_
edm::ESGetToken< SiStripNoises, SiStripNoisesRcd > noiseToken_
static constexpr char const *const kDefaultFile
edm::ESGetToken< SiStripApvGain, SiStripApvGain2Rcd > g2Token_

◆ ~SiStripCondVisualizer()

SiStripCondVisualizer::~SiStripCondVisualizer ( )
overridedefault

Member Function Documentation

◆ analyze()

void SiStripCondVisualizer::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Implements edm::one::EDAnalyzerBase.

Definition at line 255 of file SiStripCondVisualizer.cc.

References doBadComps_, doG1_, doG2_, doNoise_, doPeds_, fillTheQualityMap(), G1Map_, g1Token_, G2Map_, g2Token_, edm::EventSetup::getData(), NoiseMap_, noiseToken_, PedMap_, pedToken_, QualMap_, and qualToken_.

255  {
256  using namespace edm;
257 
258  if (doNoise_) {
259  const SiStripNoises* noiseObj = &iSetup.getData(noiseToken_);
260  this->fillTheHistoMap<SiStripNoises>(noiseObj, NoiseMap_);
261  }
262  if (doPeds_) {
263  const SiStripPedestals* pedestalObj = &iSetup.getData(pedToken_);
264  this->fillTheHistoMap<SiStripPedestals>(pedestalObj, PedMap_);
265  }
266  if (doG1_) {
267  const SiStripApvGain* g1Obj = &iSetup.getData(g1Token_);
268  this->fillTheHistoMap<SiStripApvGain>(g1Obj, G1Map_);
269  }
270  if (doG2_) {
271  const SiStripApvGain* g2Obj = &iSetup.getData(g2Token_);
272  this->fillTheHistoMap<SiStripApvGain>(g2Obj, G2Map_);
273  }
274  if (doBadComps_) { /* special case for the SiStripQuality */
275  const SiStripQuality* siStripQualityObj = &iSetup.getData(qualToken_);
276  this->fillTheQualityMap(siStripQualityObj, QualMap_);
277  }
278 }
edm::ESGetToken< SiStripQuality, SiStripQualityRcd > qualToken_
edm::ESGetToken< SiStripPedestals, SiStripPedestalsRcd > pedToken_
void fillTheQualityMap(const SiStripQuality *obj, HistoMap &theMap)
bool getData(T &iHolder) const
Definition: EventSetup.h:122
edm::ESGetToken< SiStripApvGain, SiStripApvGainRcd > g1Token_
HLT enums.
edm::ESGetToken< SiStripNoises, SiStripNoisesRcd > noiseToken_
edm::ESGetToken< SiStripApvGain, SiStripApvGain2Rcd > g2Token_

◆ beginRun()

void SiStripCondVisualizer::beginRun ( edm::Run const &  iRun,
edm::EventSetup const &  iSetup 
)
overrideprivate

Definition at line 281 of file SiStripCondVisualizer.cc.

References bookModuleHistograms(), detInfo_, doBadComps_, doG1_, doG2_, doNoise_, doPeds_, alignmentValidation::fname, fs_, SiStripCondTypes::G1Gain, G1Map_, SiStripCondTypes::G2Gain, G2Map_, SiStripDetInfo::getAllData(), edm::EventSetup::getData(), mps_fire::i, isDetIdSelected(), LogDebug, LOGINFO, TFileService::mkdir(), SiStripCondTypes::Noise, NoiseMap_, outputFolders_, SiStripCondTypes::Pedestals, PedMap_, plottedConditions_, SiStripCondTypes::Quality, QualMap_, setTopoInfo(), AlCaHLTBitMon_QueryRunRegistry::string, SiStripCondTypes::titles, and topoToken_.

281  {
282  const TrackerTopology* tTopo_ = &iSetup.getData(topoToken_);
283  const std::map<uint32_t, SiStripDetInfo::DetInfo> DetInfos = detInfo_.getAllData();
284 
285  for (const auto& it : DetInfos) {
286  LogDebug("SiStripCondVisualizer") << "detid " << it.first << "isSelected " << this->isDetIdSelected(it.first);
287 
288  if (!this->isDetIdSelected(it.first))
289  continue;
290 
291  auto topolInfo = setTopoInfo(it.first, tTopo_);
292  std::string thePart = std::get<0>(topolInfo);
293 
294  for (std::size_t i = 0; i < plottedConditions_.size(); ++i) {
295  if (plottedConditions_.test(i)) {
296  const std::string fname = Form("%s_%s", SiStripCondTypes::titles[i].c_str(), thePart.c_str());
297 
298  // book the TFileDirectory if it's not already done
299  if (!outputFolders_.count(fname)) {
301  }
302  }
303  } // loop on the bitset of plotted conditions
304  } // loop on modules
305 
306  if (doNoise_) {
307  LOGINFO("SiStripCondVisualizer") << "@SUB=SiStripCondVisualizer::beginRun() \n Before booking NoisMap_.size(): "
308  << NoiseMap_.size();
310  LOGINFO("SiStripCondVisualizer") << "@SUB=SiStripCondVisualizer::beginRun() \n After booking NoisMap_.size(): "
311  << NoiseMap_.size();
312  }
313  if (doPeds_) {
314  LOGINFO("SiStripCondVisualizer") << "@SUB=SiStripCondVisualizer::beginRun() \n Before booking PedMap_.size(): "
315  << PedMap_.size();
317  LOGINFO("SiStripCondVisualizer") << "@SUB=SiStripCondVisualizer::beginRun() \n After booking PedMap_.size(): "
318  << PedMap_.size();
319  }
320  if (doG1_) {
321  LOGINFO("SiStripCondVisualizer") << "@SUB=SiStripCondVisualizer::beginRun() \n Before booking G1Map_.size(): "
322  << G1Map_.size();
324  LOGINFO("SiStripCondVisualizer") << "@SUB=SiStripCondVisualizer::beginRun() \n After booking G1Map_.size(): "
325  << G1Map_.size();
326  }
327  if (doG2_) {
328  LOGINFO("SiStripCondVisualizer") << "@SUB=SiStripCondVisualizer::beginRun() \n Before booking G2Map_.size(): "
329  << G2Map_.size();
331  LOGINFO("SiStripCondVisualizer") << "@SUB=SiStripCondVisualizer::beginRun() \n After booking G2Map_.size(): "
332  << G2Map_.size();
333  }
334  if (doBadComps_) {
335  LOGINFO("SiStripCondVisualizer") << "@SUB=SiStripCondVisualizer::beginRun() \n Before booking QualMap_.size(): "
336  << QualMap_.size();
338  LOGINFO("SiStripCondVisualizer") << "@SUB=SiStripCondVisualizer::beginRun() \n After booking QualMap_.size(): "
339  << QualMap_.size();
340  }
341 }
static const std::array< std::string, 5 > titles
edm::Service< TFileService > fs_
std::bitset< 5 > plottedConditions_
std::tuple< std::string, int, int, int > setTopoInfo(uint32_t detId, const TrackerTopology *tTopo)
#define LOGINFO(x)
HistoMap bookModuleHistograms(const TrackerTopology *tTopo, const SiStripCondTypes::condformat &type)
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > topoToken_
TFileDirectory mkdir(const std::string &dir, const std::string &descr="")
create a new subdirectory
Definition: TFileService.h:69
string fname
main script
bool isDetIdSelected(const uint32_t detid)
const std::map< uint32_t, DetInfo > & getAllData() const noexcept
std::map< std::string, TFileDirectory > outputFolders_
#define LogDebug(id)

◆ bookModuleHistograms()

HistoMap SiStripCondVisualizer::bookModuleHistograms ( const TrackerTopology tTopo,
const SiStripCondTypes::condformat type 
)
private

Definition at line 456 of file SiStripCondVisualizer.cc.

References detInfo_, alignmentValidation::fname, SiStripDetInfo::getAllData(), SiStripDetInfo::getNumberOfApvsAndStripLength(), h, isDetIdSelected(), outputFolders_, setTopoInfo(), AlCaHLTBitMon_QueryRunRegistry::string, sistrip::STRIPS_PER_APV, SiStripCondTypes::titles, and SiStripCondTypes::units.

Referenced by beginRun().

457  {
458  TH1F::SetDefaultSumw2(kTRUE);
459  HistoMap h;
460 
461  const std::map<uint32_t, SiStripDetInfo::DetInfo> DetInfos = detInfo_.getAllData();
462 
463  for (const auto& it : DetInfos) {
464  // check if det id is correct and if it is actually cabled in the detector
465  if (it.first == 0 || it.first == 0xFFFFFFFF) {
466  edm::LogError("DetIdNotGood") << "@SUB=analyze"
467  << "Wrong det id: " << it.first << " ... neglecting!";
468  continue;
469  }
470 
471  if (!this->isDetIdSelected(it.first))
472  continue;
473 
474  auto topolInfo = setTopoInfo(it.first, tTopo_);
475  const std::string thePart = std::get<0>(topolInfo);
476  const std::string fname = Form("%s_%s", SiStripCondTypes::titles[type].c_str(), thePart.c_str());
477 
478  unsigned int nStrip = detInfo_.getNumberOfApvsAndStripLength(it.first).first * sistrip::STRIPS_PER_APV;
479 
480  h[it.first] =
481  outputFolders_[fname].make<TH1F>(Form("%sProfile_%i", SiStripCondTypes::titles[type].c_str(), it.first),
482  Form("%s for module %i (%s);n. strip; %s %s",
484  it.first,
485  thePart.c_str(),
487  SiStripCondTypes::units[type].c_str()),
488  nStrip,
489  -0.5,
490  nStrip + 0.5);
491  }
492  return h;
493 }
static const std::array< std::string, 5 > titles
static const std::array< std::string, 5 > units
std::tuple< std::string, int, int, int > setTopoInfo(uint32_t detId, const TrackerTopology *tTopo)
Log< level::Error, false > LogError
std::map< uint32_t, TH1F * > HistoMap
const std::pair< unsigned short, double > getNumberOfApvsAndStripLength(uint32_t detId) const
string fname
main script
bool isDetIdSelected(const uint32_t detid)
const std::map< uint32_t, DetInfo > & getAllData() const noexcept
static const uint16_t STRIPS_PER_APV
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
std::map< std::string, TFileDirectory > outputFolders_

◆ endRun()

void SiStripCondVisualizer::endRun ( edm::Run const &  ,
edm::EventSetup const &   
)
inlineoverrideprivate

Definition at line 102 of file SiStripCondVisualizer.cc.

102 {};

◆ fillDescriptions()

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

Definition at line 496 of file SiStripCondVisualizer.cc.

References edm::ParameterSetDescription::add(), edm::ParameterSet::addParameter(), edm::ParameterSet::addUntrackedParameter(), edm::ConfigurationDescriptions::addWithDefaultLabel(), submitPVResolutionJobs::desc, and AlCaHLTBitMon_QueryRunRegistry::string.

496  {
498  desc.setComment("Creates a ROOT file with the per-moudle profiles of different SiStrip Database tag contents.");
499  desc.add<bool>("doNoise", false);
500  desc.add<bool>("doPeds", false);
501  desc.add<bool>("doG1", false);
502  desc.add<bool>("doG2", false);
503  desc.add<bool>("doBadComps", false);
504  desc.add<std::string>("StripQualityLabel", "MergedBadComponent");
505 
506  // for the DetId selection
507  edm::ParameterSetDescription desc_detIdSelection;
508  desc_detIdSelection.add<unsigned int>("detSelection");
509  desc_detIdSelection.add<std::string>("detLabel");
510  desc_detIdSelection.addUntracked<std::vector<std::string>>("selection");
511  std::vector<edm::ParameterSet> default_detIdSelectionVector;
512  edm::ParameterSet default_detIdSelector;
513  default_detIdSelector.addParameter<unsigned int>("detSelection", 1);
514  default_detIdSelector.addParameter<std::string>("detLabel", "Tracker");
515  default_detIdSelector.addUntrackedParameter<std::vector<std::string>>("selection",
516  {"0x1e000000-0x16000000",
517  "0x1e006000-0x18002000",
518  "0x1e006000-0x18004000",
519  "0x1e000000-0x1a000000",
520  "0x1e0c0000-0x1c040000",
521  "0x1e0c0000-0x1c080000"});
522  default_detIdSelectionVector.push_back(default_detIdSelector);
523  desc.addVPSet("selections", desc_detIdSelection, default_detIdSelectionVector);
524 
525  descriptions.addWithDefaultLabel(desc);
526 }
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
void addParameter(std::string const &name, T const &value)
Definition: ParameterSet.h:135
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void addUntrackedParameter(std::string const &name, T const &value)
Definition: ParameterSet.h:192

◆ fillTheHistoMap()

template<class Payload >
void SiStripCondVisualizer::fillTheHistoMap ( const Payload *  obj,
HistoMap theMap 
)
private

Definition at line 219 of file SiStripCondVisualizer.cc.

References detInfo_, SiStripDetInfo::getNumberOfApvsAndStripLength(), isDetIdSelected(), LOGWARNING, getGTfromDQMFile::obj, FastTimerService_cff::range, and sistrip::STRIPS_PER_APV.

219  {
220  std::function<float(unsigned int, typename Payload::Range)> payloadFunctor = [&obj](unsigned int istrip,
221  typename Payload::Range range) {
222  if constexpr (std::is_same_v<Payload, SiStripNoises>) {
223  return obj->getNoise(istrip, range);
224  } else if constexpr (std::is_same_v<Payload, SiStripPedestals>) {
225  return obj->getPed(istrip, range);
226  } else if constexpr (std::is_same_v<Payload, SiStripApvGain>) {
227  return obj->getStripGain(istrip, range);
228  }
229  };
230 
231  std::vector<uint32_t> activeDetIds;
232  obj->getDetIds(activeDetIds);
233 
234  for (const uint32_t& detid : activeDetIds) {
235  if (!this->isDetIdSelected(detid))
236  continue;
237 
238  typename Payload::Range condRange = obj->getRange(detid);
239  unsigned int nStrip = detInfo_.getNumberOfApvsAndStripLength(detid).first * sistrip::STRIPS_PER_APV;
240 
241  for (unsigned int istrip_ = 0; istrip_ < nStrip; ++istrip_) {
242  float quant_ = payloadFunctor(istrip_, condRange);
243 
244  if (!theMap.count(detid)) {
245  LOGWARNING("SiStripCondVisualizer")
246  << "@SUB=SiStripCondVisualizer::analyze(): " << detid << " was not found in the histogram map!!!";
247  } else {
248  theMap[detid]->SetBinContent(istrip_, quant_);
249  }
250  } // loop on the strips
251  } // loop on the active detids
252 }
PixelRecoRange< float > Range
const std::pair< unsigned short, double > getNumberOfApvsAndStripLength(uint32_t detId) const
#define LOGWARNING(x)
bool isDetIdSelected(const uint32_t detid)
static const uint16_t STRIPS_PER_APV

◆ fillTheQualityMap()

void SiStripCondVisualizer::fillTheQualityMap ( const SiStripQuality obj,
HistoMap theMap 
)
private

Definition at line 179 of file SiStripCondVisualizer.cc.

References detInfo_, SiStripDetInfo::getNumberOfApvsAndStripLength(), isDetIdSelected(), LogDebug, LOGWARNING, module_location_type(), getGTfromDQMFile::obj, sistrip::STRIPS_PER_APV, and HcalDetIdTransform::transform().

Referenced by analyze().

179  {
180  const auto& badComponentsList = obj->getBadComponentList();
181 
182  for (const auto& bc : badComponentsList) {
183  LogDebug("SiStripCondVisualizer") << "Det:" << bc.detid << " location: " << this->module_location_type(bc.detid)
184  << " bad APVs:" << bc.BadApvs << " bad Fibers:" << bc.BadFibers
185  << " bad Module:" << bc.BadModule;
186  }
187 
188  // now get the detids
189  std::vector<uint32_t> activeDetIds;
190  std::transform(badComponentsList.begin(),
191  badComponentsList.end(),
192  std::back_inserter(activeDetIds),
193  [](const SiStripQuality::BadComponent& bc) { return bc.detid; });
194 
195  for (const uint32_t& detid : activeDetIds) {
196  if (!this->isDetIdSelected(detid))
197  continue;
198 
199  unsigned int nStrip = detInfo_.getNumberOfApvsAndStripLength(detid).first * sistrip::STRIPS_PER_APV;
200 
201  for (unsigned int istrip_ = 0; istrip_ < nStrip; ++istrip_) {
202  bool isStripBad = obj->IsStripBad(detid, istrip_);
203  float quant_ = isStripBad ? 1.f : 0.f;
204  if (!theMap.count(detid)) {
205  LOGWARNING("SiStripCondVisualizer")
206  << "@SUB=SiStripCondVisualizer::analyze(): " << detid << " was not found in the quality histogram map!!!";
207  } else {
208  theMap[detid]->SetBinContent(istrip_, quant_);
209  }
210  } // loop on the strips
211  } // loop on the active detids
212  return;
213 }
std::string module_location_type(const unsigned int &mod)
const std::pair< unsigned short, double > getNumberOfApvsAndStripLength(uint32_t detId) const
#define LOGWARNING(x)
bool isDetIdSelected(const uint32_t detid)
static const uint16_t STRIPS_PER_APV
#define LogDebug(id)
unsigned transform(const HcalDetId &id, unsigned transformCode)

◆ isDetIdSelected()

bool SiStripCondVisualizer::isDetIdSelected ( const uint32_t  detid)
private

Definition at line 443 of file SiStripCondVisualizer.cc.

References detidsels_, and isSelected().

Referenced by beginRun(), bookModuleHistograms(), fillTheHistoMap(), and fillTheQualityMap().

443  {
444  bool isSelected{false};
445  for (std::vector<DetIdSelector>::const_iterator detidsel = detidsels_.begin(); detidsel != detidsels_.end();
446  ++detidsel) {
447  if (detidsel->isSelected(detid)) {
448  isSelected = true;
449  break;
450  }
451  }
452  return isSelected;
453 }
bool isSelected(const std::vector< L1HPSPFTauQualityCut > &qualityCuts, const l1t::PFCandidate &pfCand, float_t primaryVertexZ)
std::vector< DetIdSelector > detidsels_

◆ module_location_type()

std::string SiStripCondVisualizer::module_location_type ( const unsigned int &  mod)
private

Definition at line 384 of file SiStripCondVisualizer.cc.

References createfilelist::int, phase1PixelTopology::layer, mod(), relativeConstraints::ring, SiStripDetId::stereo(), AlCaHLTBitMon_QueryRunRegistry::string, SiStripDetId::subDetector(), SiStripDetId::TEC, SiStripDetId::TIB, SiStripDetId::TID, SiStripDetId::TOB, and makeMuonMisalignmentScenario::wheel.

Referenced by fillTheQualityMap().

384  {
385  const SiStripDetId detid(mod);
386  std::string subdet = "";
387  if (detid.subDetector() == SiStripDetId::TIB)
388  subdet = "TIB";
389  if (detid.subDetector() == SiStripDetId::TOB)
390  subdet = "TOB";
391  if (detid.subDetector() == SiStripDetId::TID)
392  subdet = "TID";
393  if (detid.subDetector() == SiStripDetId::TEC)
394  subdet = "TEC";
395 
396  // Barrel
397  int layer = int((mod >> 14) & 0x7);
398  std::string type = (detid.stereo() ? "s" : "a");
399  std::string d_l_t = Form("%s_L%d%s", subdet.c_str(), layer, type.c_str());
400 
401  // Endcaps
402  if (subdet == "TID" || subdet == "TEC") {
403  unsigned int sideStartBit_{0};
404  unsigned int wheelStartBit_{0};
405  unsigned int ringStartBit_{0};
406  unsigned int sideMask_{0};
407  unsigned int wheelMask_{0};
408  unsigned int ringMask_{0};
409 
410  // TEC
411  if (subdet == "TEC") {
412  sideStartBit_ = 18;
413  wheelStartBit_ = 14;
414  ringStartBit_ = 5;
415  sideMask_ = 0x3;
416  wheelMask_ = 0xF;
417  ringMask_ = 0x7;
418  }
419 
420  // TID
421  if (subdet == "TID") {
422  sideStartBit_ = 13;
423  wheelStartBit_ = 11;
424  ringStartBit_ = 9;
425  sideMask_ = 0x3;
426  wheelMask_ = 0x3;
427  ringMask_ = 0x3;
428  }
429 
430  // TEC+-, TID+- (see also at the bottom of this file
431  int side = int((mod >> sideStartBit_) & sideMask_);
432  int wheel = int((mod >> wheelStartBit_) & wheelMask_);
433  int ring = int((mod >> ringStartBit_) & ringMask_);
434 
435  std::string s_side = (side == 1 ? "Plus" : "Minus");
436 
437  d_l_t = Form("%s%s_W%dR%d", subdet.c_str(), s_side.c_str(), wheel, ring);
438  }
439  return d_l_t;
440 }
static constexpr auto TID
Definition: SiStripDetId.h:38
constexpr std::array< uint8_t, layerIndexSize > layer
static constexpr auto TOB
Definition: SiStripDetId.h:39
Detector identifier class for the strip tracker.
Definition: SiStripDetId.h:18
static constexpr auto TIB
Definition: SiStripDetId.h:37
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
static constexpr auto TEC
Definition: SiStripDetId.h:40

◆ setTopoInfo()

std::tuple< std::string, int, int, int > SiStripCondVisualizer::setTopoInfo ( uint32_t  detId,
const TrackerTopology tTopo 
)
private

Definition at line 344 of file SiStripCondVisualizer.cc.

References sistrip::layer_, runTheMatrix::ret, AlCaHLTBitMon_QueryRunRegistry::string, DetId::subdetId(), SiStripSubdetector::TEC, TrackerTopology::tecSide(), TrackerTopology::tecWheel(), SiStripSubdetector::TIB, TrackerTopology::tibLayer(), SiStripSubdetector::TID, TrackerTopology::tidSide(), TrackerTopology::tidWheel(), SiStripSubdetector::TOB, and TrackerTopology::tobLayer().

Referenced by beginRun(), and bookModuleHistograms().

345  {
346  int subdetId_(-999), layer_(-999), side_(-999);
347  std::string ret = "";
348  std::tuple<std::string, int, int, int> def_tuple{ret, subdetId_, layer_, side_};
349 
350  subdetId_ = DetId(detId).subdetId();
351  switch (subdetId_) {
352  case SiStripSubdetector::TIB: // TIB
353  layer_ = tTopo->tibLayer(detId);
354  side_ = 0;
355  ret += Form("TIB_Layer%i", layer_);
356  break;
357  case SiStripSubdetector::TID: // TID
358  side_ = tTopo->tidSide(detId);
359  layer_ = tTopo->tidWheel(detId);
360  ret += ("TID_");
361  ret += (side_ == 1) ? Form("P_disk%i", layer_) : Form("M_disk%i", layer_);
362  break;
363  case SiStripSubdetector::TOB: // TOB
364  layer_ = tTopo->tobLayer(detId);
365  side_ = 0;
366  ret += Form("TOB_Layer%i", layer_);
367  break;
368  case SiStripSubdetector::TEC: // TEC
369  side_ = tTopo->tecSide(detId);
370  layer_ = tTopo->tecWheel(detId);
371  ret += ("TEC_");
372  ret += (side_ == 1) ? Form("P_disk%i", layer_) : Form("M_disk%i", layer_);
373  break;
374  default:
375  edm::LogError("SiStripCondVisualizer") << "SUB=SiStripCondVisualizer::setTopoInfo() \n unrecognizer partition.";
376  return def_tuple;
377  }
378 
379  return std::make_tuple(ret, subdetId_, layer_, side_);
380 }
static const char layer_[]
unsigned int tobLayer(const DetId &id) const
ret
prodAgent to be discontinued
unsigned int tidSide(const DetId &id) const
unsigned int tidWheel(const DetId &id) const
unsigned int tecWheel(const DetId &id) const
Log< level::Error, false > LogError
unsigned int tecSide(const DetId &id) const
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
Definition: DetId.h:17
unsigned int tibLayer(const DetId &id) const

Member Data Documentation

◆ detidsels_

std::vector<DetIdSelector> SiStripCondVisualizer::detidsels_
private

Definition at line 126 of file SiStripCondVisualizer.cc.

Referenced by isDetIdSelected(), and SiStripCondVisualizer().

◆ detInfo_

SiStripDetInfo SiStripCondVisualizer::detInfo_
private

◆ doBadComps_

const bool SiStripCondVisualizer::doBadComps_
private

Definition at line 124 of file SiStripCondVisualizer.cc.

Referenced by analyze(), beginRun(), and SiStripCondVisualizer().

◆ doG1_

const bool SiStripCondVisualizer::doG1_
private

Definition at line 122 of file SiStripCondVisualizer.cc.

Referenced by analyze(), beginRun(), and SiStripCondVisualizer().

◆ doG2_

const bool SiStripCondVisualizer::doG2_
private

Definition at line 123 of file SiStripCondVisualizer.cc.

Referenced by analyze(), beginRun(), and SiStripCondVisualizer().

◆ doNoise_

const bool SiStripCondVisualizer::doNoise_
private

Definition at line 120 of file SiStripCondVisualizer.cc.

Referenced by analyze(), beginRun(), and SiStripCondVisualizer().

◆ doPeds_

const bool SiStripCondVisualizer::doPeds_
private

Definition at line 121 of file SiStripCondVisualizer.cc.

Referenced by analyze(), beginRun(), and SiStripCondVisualizer().

◆ fs_

edm::Service<TFileService> SiStripCondVisualizer::fs_
private

Definition at line 127 of file SiStripCondVisualizer.cc.

Referenced by beginRun().

◆ G1Map_

HistoMap SiStripCondVisualizer::G1Map_
private

Definition at line 130 of file SiStripCondVisualizer.cc.

Referenced by analyze(), and beginRun().

◆ g1Token_

edm::ESGetToken<SiStripApvGain, SiStripApvGainRcd> SiStripCondVisualizer::g1Token_
private

Definition at line 115 of file SiStripCondVisualizer.cc.

Referenced by analyze(), and SiStripCondVisualizer().

◆ G2Map_

HistoMap SiStripCondVisualizer::G2Map_
private

Definition at line 130 of file SiStripCondVisualizer.cc.

Referenced by analyze(), and beginRun().

◆ g2Token_

edm::ESGetToken<SiStripApvGain, SiStripApvGain2Rcd> SiStripCondVisualizer::g2Token_
private

Definition at line 116 of file SiStripCondVisualizer.cc.

Referenced by analyze(), and SiStripCondVisualizer().

◆ NoiseMap_

HistoMap SiStripCondVisualizer::NoiseMap_
private

Definition at line 130 of file SiStripCondVisualizer.cc.

Referenced by analyze(), and beginRun().

◆ noiseToken_

edm::ESGetToken<SiStripNoises, SiStripNoisesRcd> SiStripCondVisualizer::noiseToken_
private

Definition at line 113 of file SiStripCondVisualizer.cc.

Referenced by analyze(), and SiStripCondVisualizer().

◆ outputFolders_

std::map<std::string, TFileDirectory> SiStripCondVisualizer::outputFolders_
private

Definition at line 129 of file SiStripCondVisualizer.cc.

Referenced by beginRun(), and bookModuleHistograms().

◆ PedMap_

HistoMap SiStripCondVisualizer::PedMap_
private

Definition at line 130 of file SiStripCondVisualizer.cc.

Referenced by analyze(), and beginRun().

◆ pedToken_

edm::ESGetToken<SiStripPedestals, SiStripPedestalsRcd> SiStripCondVisualizer::pedToken_
private

Definition at line 114 of file SiStripCondVisualizer.cc.

Referenced by analyze(), and SiStripCondVisualizer().

◆ plottedConditions_

std::bitset<5> SiStripCondVisualizer::plottedConditions_
private

Definition at line 131 of file SiStripCondVisualizer.cc.

Referenced by beginRun(), and SiStripCondVisualizer().

◆ QualMap_

HistoMap SiStripCondVisualizer::QualMap_
private

Definition at line 130 of file SiStripCondVisualizer.cc.

Referenced by analyze(), and beginRun().

◆ qualToken_

edm::ESGetToken<SiStripQuality, SiStripQualityRcd> SiStripCondVisualizer::qualToken_
private

Definition at line 117 of file SiStripCondVisualizer.cc.

Referenced by analyze(), and SiStripCondVisualizer().

◆ topoToken_

const edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> SiStripCondVisualizer::topoToken_
private

Definition at line 118 of file SiStripCondVisualizer.cc.

Referenced by beginRun().