CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
DTRunConditionVarClient Class Reference

#include <DTRunConditionVarClient.h>

Inheritance diagram for DTRunConditionVarClient:
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 beginRun (const edm::Run &r, const edm::EventSetup &c) override
 
 DTRunConditionVarClient (const edm::ParameterSet &ps)
 Constructor. More...
 
 ~DTRunConditionVarClient () override
 Destructor. More...
 
- 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 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)
 

Protected Member Functions

void bookWheelHistos (DQMStore::IBooker &, std::string histoType, std::string subfolder, int wh, int nbins, float min, float max, bool isVDCorr=false, bool makeRings=false)
 book the report summary More...
 
void dqmEndJob (DQMStore::IBooker &, DQMStore::IGetter &) override
 
void dqmEndLuminosityBlock (DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &) override
 DQM Client Diagnostic. More...
 
void percDevVDrift (DTChamberId indexCh, float meanVD, float sigmaVD, float &devVD, float &errdevVD)
 
float varQuality (float var, float maxGood, float minBad)
 
- 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)
 

Private Member Functions

MonitorElementgetChamberHistos (DQMStore::IGetter &, const DTChamberId &, std::string)
 

Private Attributes

std::map< std::string, MonitorElement * > allwheelHistos
 
bool bookingdone
 
MonitorElementglbT0Summary
 
MonitorElementglbVDriftSummary
 
float maxGoodT0
 
float maxGoodT0Sigma
 
float maxGoodVDriftDev
 
float maxGoodVDriftSigma
 
float maxRangeT0
 
float maxRangeVDrift
 
float minBadT0
 
float minBadT0Sigma
 
float minBadVDriftDev
 
float minBadVDriftSigma
 
float minRangeT0
 
float minRangeVDrift
 
const DTMtimemTimeMap_
 
edm::ESGetToken< DTMtime, DTMtimeRcdmTimeMapToken_
 
int nevents
 
bool readLegacyVDriftDB
 
std::map< std::string, MonitorElement * > summaryHistos
 
const DTRecoConditionsvDriftMap_
 
edm::ESGetToken< DTRecoConditions, DTRecoConditionsVdriftRcdvDriftToken_
 
std::map< int, std::map< std::string, MonitorElement * > > wheelHistos
 
std::map< int, std::map< int, std::map< std::string, MonitorElement * > > > wheelRingHistos
 

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
 
- Static Public Member Functions inherited from edm::one::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- 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

Description:

Author
: Paolo Bellan, Antonio Branca $date : 23/09/2011 15:42:04 CET $

Modification:

threadsafe version (//-) oct/nov 2014 - WATWanAbdullah -ncpp-um-my

Definition at line 50 of file DTRunConditionVarClient.h.

Constructor & Destructor Documentation

◆ DTRunConditionVarClient()

DTRunConditionVarClient::DTRunConditionVarClient ( const edm::ParameterSet ps)

Constructor.

Definition at line 33 of file DTRunConditionVarClient.cc.

References edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), dtRunConditionVarClient_cfi::maxGoodT0, dtRunConditionVarClient_cfi::maxGoodT0Sigma, dtRunConditionVarClient_cfi::maxGoodVDriftDev, dtRunConditionVarClient_cfi::maxGoodVDriftSigma, dtRunConditionVarClient_cfi::maxRangeT0, dtRunConditionVarClient_cfi::maxRangeVDrift, dtRunConditionVarClient_cfi::minBadT0, dtRunConditionVarClient_cfi::minBadT0Sigma, dtRunConditionVarClient_cfi::minBadVDriftDev, dtRunConditionVarClient_cfi::minBadVDriftSigma, dtRunConditionVarClient_cfi::minRangeT0, dtRunConditionVarClient_cfi::minRangeVDrift, cmsHarvester::nevents, and dtRunConditionVarClient_cfi::readLegacyVDriftDB.

33  {
34  LogVerbatim("DTDQM|DTMonitorClient|DTRunConditionVarClient") << "DTRunConditionVarClient: Constructor called";
35 
36  minRangeVDrift = pSet.getUntrackedParameter<double>("minRangeVDrift");
37  maxRangeVDrift = pSet.getUntrackedParameter<double>("maxRangeVDrift");
38  minRangeT0 = pSet.getUntrackedParameter<double>("minRangeT0");
39  maxRangeT0 = pSet.getUntrackedParameter<double>("maxRangeT0");
40 
41  maxGoodVDriftDev = pSet.getUntrackedParameter<double>("maxGoodVDriftDev");
42  minBadVDriftDev = pSet.getUntrackedParameter<double>("minBadVDriftDev");
43  maxGoodT0 = pSet.getUntrackedParameter<double>("maxGoodT0");
44  minBadT0 = pSet.getUntrackedParameter<double>("minBadT0");
45 
46  maxGoodVDriftSigma = pSet.getUntrackedParameter<double>("maxGoodVDriftSigma");
47  minBadVDriftSigma = pSet.getUntrackedParameter<double>("minBadVDriftSigma");
48  maxGoodT0Sigma = pSet.getUntrackedParameter<double>("maxGoodT0Sigma");
49  minBadT0Sigma = pSet.getUntrackedParameter<double>("minBadT0Sigma");
50 
51  readLegacyVDriftDB = pSet.getParameter<bool>("readLegacyVDriftDB");
52 
53  nevents = 0;
54 
55  bookingdone = false;
56 
57  if (readLegacyVDriftDB) {
58  mTimeMapToken_ = esConsumes<edm::Transition::BeginRun>();
59  } else {
60  vDriftToken_ = esConsumes<edm::Transition::BeginRun>();
61  }
62 }
Log< level::Info, true > LogVerbatim
edm::ESGetToken< DTRecoConditions, DTRecoConditionsVdriftRcd > vDriftToken_
edm::ESGetToken< DTMtime, DTMtimeRcd > mTimeMapToken_

◆ ~DTRunConditionVarClient()

DTRunConditionVarClient::~DTRunConditionVarClient ( )
override

Destructor.

Definition at line 64 of file DTRunConditionVarClient.cc.

64  {
65  LogVerbatim("DTDQM|DTMonitorClient|DTRunConditionVarClient") << "DTRunConditionVarClient: Destructor called";
66 }
Log< level::Info, true > LogVerbatim

Member Function Documentation

◆ beginRun()

void DTRunConditionVarClient::beginRun ( const edm::Run r,
const edm::EventSetup c 
)
override

Definition at line 68 of file DTRunConditionVarClient.cc.

References visDQMUpload::context, Exception, LogTrace, dtRunConditionVarClient_cfi::readLegacyVDriftDB, and BeamSplash_cfg::version.

68  {
69  LogTrace("DTDQM|DTMonitorClient|DTResolutionAnalysisTest") << "[DTRunConditionVarClient]: BeginRun";
70  // Get the map of vdrift from the setup
71  if (readLegacyVDriftDB) {
72  mTimeMap_ = &context.getData(mTimeMapToken_);
73  vDriftMap_ = nullptr;
74  } else {
75  vDriftMap_ = &context.getData(vDriftToken_);
76  mTimeMap_ = nullptr;
77  // Consistency check: no parametrization is implemented for the time being
78  int version = vDriftMap_->version();
79  if (version != 1) {
80  throw cms::Exception("Configuration") << "only version 1 is presently supported for VDriftDB";
81  }
82  }
83 }
edm::ESGetToken< DTRecoConditions, DTRecoConditionsVdriftRcd > vDriftToken_
int version() const
Version numer specifying the structure of the payload. See .cc file for details.
#define LogTrace(id)
const DTRecoConditions * vDriftMap_
edm::ESGetToken< DTMtime, DTMtimeRcd > mTimeMapToken_

◆ bookWheelHistos()

void DTRunConditionVarClient::bookWheelHistos ( DQMStore::IBooker ,
std::string  histoType,
std::string  subfolder,
int  wh,
int  nbins,
float  min,
float  max,
bool  isVDCorr = false,
bool  makeRings = false 
)
protected

book the report summary

Definition at line 295 of file DTRunConditionVarClient.cc.

References dqm::implementation::IBooker::book1D(), dqm::implementation::IBooker::book2D(), printsummarytable::folder, fftjetimagerecorder_cfi::histoLabel, HltBtagPostValidation_cff::histoName, edm::max(), hlt_dqm_clientPB-live_cfg::me, edm::min(), LaserClient_cfi::nbins, dqm::implementation::NavigatorBase::setCurrentFolder(), relativeConstraints::station, and makeMuonMisalignmentScenario::wheel.

303  {
304  stringstream wheel;
305  wheel << wh;
306 
307  string folder = "DT/02-Segments/" + subfolder;
308 
309  ibooker.setCurrentFolder(folder);
310 
311  string histoName;
312  string histoLabel;
313 
314  if (makeRings) {
315  ibooker.setCurrentFolder(folder + "/Wheel" + wheel.str());
316  for (int st = 1; st <= 4; st++) {
317  stringstream station;
318  station << st;
319 
320  histoName = histoType + "_W" + wheel.str() + "_MB" + station.str();
321  histoLabel = histoType;
322 
323  (wheelRingHistos[wh][st])[histoType] = ibooker.book1D(histoName, histoLabel, nbins, min, max);
324  }
325  } else {
326  histoName = histoType + "_W" + wheel.str();
327  histoLabel = histoType;
328 
329  (wheelHistos[wh])[histoType] = ibooker.book1D(histoName, histoLabel, nbins, min, max);
330  }
331 
332  ibooker.setCurrentFolder(folder);
333 
334  if (isVDCorr) {
335  histoLabel = "Summary of corrections to VDrift DB values";
336  histoName = "CorrTo" + histoType + "Summary_W" + wheel.str();
337  } else {
338  histoLabel = histoType + "Summary";
339  histoName = histoType + "Summary_W" + wheel.str();
340  }
341 
342  MonitorElement* me = ibooker.book2D(histoName, histoLabel, 12, 1, 13, 4, 1, 5);
343 
344  me->setBinLabel(1, "MB1", 2);
345  me->setBinLabel(2, "MB2", 2);
346  me->setBinLabel(3, "MB3", 2);
347  me->setBinLabel(4, "MB4", 2);
348  me->setAxisTitle("Sector", 1);
349 
350  (wheelHistos[wh])[histoType + "Summary"] = me;
351 
352  return;
353 }
std::map< int, std::map< int, std::map< std::string, MonitorElement * > > > wheelRingHistos
std::map< int, std::map< std::string, MonitorElement * > > wheelHistos

◆ dqmEndJob()

void DTRunConditionVarClient::dqmEndJob ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter 
)
overrideprotectedvirtual

Implements DQMEDHarvester.

Definition at line 90 of file DTRunConditionVarClient.cc.

References dqm::implementation::IBooker::book1D(), dqm::implementation::IBooker::book2D(), HcalObjRepresent::Fill(), dqm::impl::MonitorElement::getEntries(), dqm::impl::MonitorElement::getMean(), dqm::impl::MonitorElement::getRMS(), edm::max(), dtRunConditionVarClient_cfi::maxGoodT0, dtRunConditionVarClient_cfi::maxGoodT0Sigma, dtRunConditionVarClient_cfi::maxGoodVDriftDev, dtRunConditionVarClient_cfi::maxGoodVDriftSigma, dtRunConditionVarClient_cfi::maxRangeT0, dtRunConditionVarClient_cfi::maxRangeVDrift, edm::min(), dtRunConditionVarClient_cfi::minBadT0, dtRunConditionVarClient_cfi::minBadT0Sigma, dtRunConditionVarClient_cfi::minBadVDriftDev, dtRunConditionVarClient_cfi::minBadVDriftSigma, dtRunConditionVarClient_cfi::minRangeT0, dtRunConditionVarClient_cfi::minRangeVDrift, fileinputsource_cfi::sec, dqm::impl::MonitorElement::setAxisRange(), dqm::implementation::NavigatorBase::setCurrentFolder(), edm_modernize_messagelogger::stat, and makeMuonMisalignmentScenario::wheel.

90  {
91  LogVerbatim("DTDQM|DTMonitorClient|DTRunConditionVarClient") << "DTRunConditionVarClient: end job";
92 
93  ibooker.setCurrentFolder("DT/02-Segments");
94 
96  ibooker.book2D("VDriftGlbSummary", "# of MBs with good mean and good sigma of vDrift", 12, 1, 13, 5, -2, 3);
97  glbT0Summary = ibooker.book2D("T0GlbSummary", "# of MBs with good mean and good sigma of t0", 12, 1, 13, 5, -2, 3);
98 
99  ibooker.setCurrentFolder("DT/02-Segments/02-MeanVDrift");
100 
101  summaryHistos["MeanVDriftGlbSummary"] =
102  ibooker.book2D("MeanVDriftGlbSummary", "mean VDrift average per sector", 12, 1., 13., 5, -2., 3.);
103  allwheelHistos["allMeanVDrift"] =
104  ibooker.book1D("VDriftMeanAllWheels", "mean VDrift for all chambers", 60, 0.0048, 0.006);
105 
106  ibooker.setCurrentFolder("DT/02-Segments/02-SigmaVDrift");
107 
108  summaryHistos["SigmaVDriftGlbSummary"] =
109  ibooker.book2D("SigmaVDriftGlbSummary", "# of Chambers with good sigma VDrift", 12, 1., 13., 5, -2., 3.);
110  allwheelHistos["allSigmaVDrift"] =
111  ibooker.book1D("VDriftSigmaAllWheels", "sigma VDrift for all chambers", 30, 0., 0.0006);
112 
113  ibooker.setCurrentFolder("DT/02-Segments/03-MeanT0");
114 
115  summaryHistos["MeanT0GlbSummary"] =
116  ibooker.book2D("MeanT0GlbSummary", "mean T0 average per sector", 12, 1., 13., 5, -2., 3.);
117  allwheelHistos["allMeanT0"] = ibooker.book1D("T0MeanAllWheels", "mean T0 for all chambers", 100, -25., 25.);
118 
119  ibooker.setCurrentFolder("DT/02-Segments/03-SigmaT0");
120 
121  summaryHistos["SigmaT0GlbSummary"] =
122  ibooker.book2D("SigmaT0GlbSummary", "# of Chambers with good sigma T0", 12, 1., 13., 5, -2., 3.);
123  allwheelHistos["allSigmaT0"] = ibooker.book1D("T0SigmaAllWheels", "sigma T0 for all chambers", 50, 0, 25);
124 
125  for (int wh = -2; wh <= 2; wh++) {
126  bookWheelHistos(ibooker, "MeanVDrift", "02-MeanVDrift", wh, 60, 0.0048, 0.006, true);
127  bookWheelHistos(ibooker, "SigmaVDrift", "02-SigmaVDrift", wh, 30, 0., 0.0006);
128  bookWheelHistos(ibooker, "MeanT0", "03-MeanT0", wh, 100, -25., 25., false, true);
129  bookWheelHistos(ibooker, "SigmaT0", "03-SigmaT0", wh, 50, 0, 25, false, true);
130  }
131 
132  for (int wheel = -2; wheel <= 2; wheel++) {
133  for (int sec = 1; sec <= 14; sec++) {
134  for (int stat = 1; stat <= 4; stat++) {
135  if ((sec == 13 || sec == 14) && stat != 4)
136  continue;
137 
138  // Get the ME produced by DTRunConditionVar Source
139  MonitorElement* VDriftME = getChamberHistos(igetter, DTChamberId(wheel, stat, sec), "VDrift_FromSegm");
140  MonitorElement* T0ME = getChamberHistos(igetter, DTChamberId(wheel, stat, sec), "T0_FromSegm");
141 
142  if (!VDriftME || !T0ME) {
143  edm::LogWarning("DTRunConditionVarClient") << "ME not available" << std::endl;
144  return;
145  }
146 
147  // Get the means per chamber
148  float vDriftMean = VDriftME->getMean();
149  T0ME->setAxisRange(-15, 15);
150  float t0Mean = T0ME->getMean();
151 
152  // Get the sigma per chamber
153  float vDriftSigma = VDriftME->getRMS();
154  float t0Sigma = T0ME->getRMS();
155 
156  if (VDriftME->getEntries() != 0) {
157  allwheelHistos["allMeanVDrift"]->Fill(vDriftMean);
158  allwheelHistos["allSigmaVDrift"]->Fill(vDriftSigma);
159 
160  (wheelHistos[wheel])["MeanVDrift"]->Fill(vDriftMean);
161  (wheelHistos[wheel])["SigmaVDrift"]->Fill(vDriftSigma);
162  }
163 
164  if (T0ME->getEntries() != 0) {
165  allwheelHistos["allMeanT0"]->Fill(t0Mean);
166  allwheelHistos["allSigmaT0"]->Fill(t0Sigma);
167 
168  (wheelRingHistos[wheel][stat])["MeanT0"]->Fill(t0Mean);
169  (wheelRingHistos[wheel][stat])["SigmaT0"]->Fill(t0Sigma);
170  }
171 
172  DTChamberId indexCh(wheel, stat, sec);
173 
174  float vDriftDev(0.), errvDriftDev(0.);
175  percDevVDrift(indexCh, vDriftMean, vDriftSigma, vDriftDev, errvDriftDev);
176 
177  int sec_ = sec;
178  if (sec == 13 || sec == 14)
179  sec_ = (sec == 13) ? 4 : 10;
180 
181  float fillvDriftDev = max(min(vDriftDev, maxRangeVDrift), minRangeVDrift);
182  float fillT0Mean = max(min(t0Mean, maxRangeT0), minRangeT0);
183 
184  float vDriftDevQ = varQuality(fabs(vDriftDev), maxGoodVDriftDev, minBadVDriftDev);
185  float t0MeanQ = varQuality(fabs(t0Mean), maxGoodT0, minBadT0);
186 
187  float vDriftSigmQ = varQuality(vDriftSigma, maxGoodVDriftSigma, minBadVDriftSigma);
188  float t0SigmQ = varQuality(t0Sigma, maxGoodT0Sigma, minBadT0Sigma);
189 
190  if (sec == 13 || sec == 14) {
191  float binVDriftDev = (wheelHistos[wheel])["MeanVDriftSummary"]->getBinContent(sec_, stat);
192  binVDriftDev = (fabs(binVDriftDev) > fabs(fillvDriftDev)) ? binVDriftDev : fillvDriftDev;
193  (wheelHistos[wheel])["MeanVDriftSummary"]->setBinContent(sec_, stat, binVDriftDev);
194 
195  float binT0MeanVal = (wheelHistos[wheel])["MeanT0Summary"]->getBinContent(sec_, stat);
196  binT0MeanVal = (fabs(binT0MeanVal) > fabs(fillT0Mean)) ? binT0MeanVal : fillT0Mean;
197  (wheelHistos[wheel])["MeanT0Summary"]->setBinContent(sec_, stat, binT0MeanVal);
198 
199  float binVDriftSigmVal = (wheelHistos[wheel])["SigmaVDriftSummary"]->getBinContent(sec_, stat);
200  binVDriftSigmVal = (binVDriftSigmVal > 0. && binVDriftSigmVal < vDriftSigmQ) ? binVDriftSigmVal : vDriftSigmQ;
201  (wheelHistos[wheel])["SigmaVDriftSummary"]->setBinContent(sec_, stat, binVDriftSigmVal);
202 
203  float binT0SigmVal = (wheelHistos[wheel])["SigmaT0Summary"]->getBinContent(sec_, stat);
204  binT0SigmVal = (binT0SigmVal > 0. && binT0SigmVal < t0SigmQ) ? binT0SigmVal : t0SigmQ;
205  (wheelHistos[wheel])["SigmaT0Summary"]->setBinContent(sec_, stat, binT0SigmVal);
206 
207  } else {
208  (wheelHistos[wheel])["MeanVDriftSummary"]->setBinContent(sec_, stat, fillvDriftDev);
209  (wheelHistos[wheel])["MeanT0Summary"]->setBinContent(sec_, stat, fillT0Mean);
210  (wheelHistos[wheel])["SigmaVDriftSummary"]->setBinContent(sec_, stat, vDriftSigmQ);
211  (wheelHistos[wheel])["SigmaT0Summary"]->setBinContent(sec_, stat, t0SigmQ);
212  }
213 
214  double weight = 1 / 4.;
215  if ((sec_ == 4 || sec_ == 10) && stat == 4)
216  weight = 1 / 8.;
217 
218  if (vDriftDevQ > 0.85 && vDriftSigmQ > 0.85) {
220  summaryHistos["MeanVDriftGlbSummary"]->Fill(sec_, wheel, weight);
221  summaryHistos["SigmaVDriftGlbSummary"]->Fill(sec_, wheel, weight);
222 
223  } else {
224  if (vDriftDevQ > 0.85 && vDriftSigmQ < 0.85) {
225  summaryHistos["MeanVDriftGlbSummary"]->Fill(sec_, wheel, weight);
226  }
227  if (vDriftDevQ < 0.85 && vDriftSigmQ > 0.85) {
228  summaryHistos["SigmaVDriftGlbSummary"]->Fill(sec_, wheel, weight);
229  }
230  }
231 
232  if (t0MeanQ > 0.85 && t0SigmQ > 0.85) {
233  glbT0Summary->Fill(sec_, wheel, weight);
234  summaryHistos["MeanT0GlbSummary"]->Fill(sec_, wheel, weight);
235  summaryHistos["SigmaT0GlbSummary"]->Fill(sec_, wheel, weight);
236  } else {
237  if (t0MeanQ > 0.85 && t0SigmQ < 0.85) {
238  summaryHistos["MeanT0GlbSummary"]->Fill(sec_, wheel, weight);
239  }
240  if (t0MeanQ < 0.85 && t0SigmQ > 0.85) {
241  summaryHistos["SigmaT0GlbSummary"]->Fill(sec_, wheel, weight);
242  }
243  }
244 
245  } // end loop on stations
246  } // end loop on sectors
247  } //end loop on wheels
248 
249  return;
250 }
Log< level::Info, true > LogVerbatim
std::map< std::string, MonitorElement * > summaryHistos
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
Definition: weight.py:1
MonitorElement * getChamberHistos(DQMStore::IGetter &, const DTChamberId &, std::string)
std::map< std::string, MonitorElement * > allwheelHistos
float varQuality(float var, float maxGood, float minBad)
void Fill(long long x)
std::map< int, std::map< int, std::map< std::string, MonitorElement * > > > wheelRingHistos
virtual double getRMS(int axis=1) const
get RMS of histogram along x, y or z axis (axis=1, 2, 3 respectively)
virtual void setAxisRange(double xmin, double xmax, int axis=1)
set x-, y- or z-axis range (axis=1, 2, 3 respectively)
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
void percDevVDrift(DTChamberId indexCh, float meanVD, float sigmaVD, float &devVD, float &errdevVD)
virtual double getEntries() const
get # of entries
void bookWheelHistos(DQMStore::IBooker &, std::string histoType, std::string subfolder, int wh, int nbins, float min, float max, bool isVDCorr=false, bool makeRings=false)
book the report summary
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
Definition: DQMStore.h:212
std::map< int, std::map< std::string, MonitorElement * > > wheelHistos
virtual double getMean(int axis=1) const
get mean value of histogram along x, y or z axis (axis=1, 2, 3 respectively)
Log< level::Warning, false > LogWarning
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98

◆ dqmEndLuminosityBlock()

void DTRunConditionVarClient::dqmEndLuminosityBlock ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter,
edm::LuminosityBlock const &  lumiSeg,
edm::EventSetup const &  context 
)
overrideprotectedvirtual

DQM Client Diagnostic.

Reimplemented from DQMEDHarvester.

Definition at line 85 of file DTRunConditionVarClient.cc.

88  {}

◆ getChamberHistos()

DTRunConditionVarClient::MonitorElement * DTRunConditionVarClient::getChamberHistos ( DQMStore::IGetter ,
const DTChamberId ,
std::string   
)
private

Definition at line 355 of file DTRunConditionVarClient.cc.

References printsummarytable::folder, dqm::implementation::IGetter::get(), dtResolutionTest_cfi::histoTag, LogTrace, DTChamberId::sector(), dqm::implementation::NavigatorBase::setCurrentFolder(), DTChamberId::station(), relativeConstraints::station, DTChamberId::wheel(), and makeMuonMisalignmentScenario::wheel.

357  {
358  int wh = dtCh.wheel();
359  int sc = dtCh.sector();
360  int st = dtCh.station();
361  stringstream wheel;
362  wheel << wh;
363  stringstream station;
364  station << st;
365  stringstream sector;
366  sector << sc;
367 
368  string folder = "DT/02-Segments/Wheel" + wheel.str() + "/Sector" + sector.str() + "/Station" + station.str();
369  string histoTag = "_W" + wheel.str() + "_Sec" + sector.str() + "_St" + station.str();
370  string MEpath = folder + "/" + histoType + histoTag;
371 
372  igetter.setCurrentFolder(folder);
373 
374  LogTrace("DTDQM|DTMonitorModule|DTRunConditionVar") << "[DTRunConditionVar]: getting ME from " << folder << endl;
375 
376  MonitorElement* ME = igetter.get(MEpath);
377 
378  return ME;
379 }
#define LogTrace(id)
Definition: ME.h:11
dqm::harvesting::MonitorElement ME

◆ percDevVDrift()

void DTRunConditionVarClient::percDevVDrift ( DTChamberId  indexCh,
float  meanVD,
float  sigmaVD,
float &  devVD,
float &  errdevVD 
)
protected

Definition at line 265 of file DTRunConditionVarClient.cc.

References DTVelocityUnits::cm_per_ns, Exception, DetId::rawId(), and dtRunConditionVarClient_cfi::readLegacyVDriftDB.

266  {
267  DTSuperLayerId indexSLPhi1(indexCh, 1);
268  DTSuperLayerId indexSLPhi2(indexCh, 3);
269 
270  float vDriftPhi1(0.), vDriftPhi2(0.);
271  float ResPhi1(0.), ResPhi2(0.);
272  if (readLegacyVDriftDB) { // Legacy format
273  int status1 = mTimeMap_->get(indexSLPhi1, vDriftPhi1, ResPhi1, DTVelocityUnits::cm_per_ns);
274  int status2 = mTimeMap_->get(indexSLPhi2, vDriftPhi2, ResPhi2, DTVelocityUnits::cm_per_ns);
275 
276  if (status1 != 0 || status2 != 0) {
277  DTSuperLayerId sl = (status1 != 0) ? indexSLPhi1 : indexSLPhi2;
278  throw cms::Exception("DTRunConditionVarClient") << "Could not find vDrift entry in DB for" << sl << endl;
279  }
280  } else {
281  vDriftPhi1 = vDriftMap_->get(DTWireId(indexSLPhi1.rawId()));
282  vDriftPhi2 = vDriftMap_->get(DTWireId(indexSLPhi2.rawId()));
283  }
284 
285  float vDriftMed = (vDriftPhi1 + vDriftPhi2) / 2.;
286 
287  devVD = (meanVD - vDriftMed) / vDriftMed;
288  devVD = devVD < 1. ? devVD : 1.;
289 
290  errdevVD = sigmaVD / vDriftMed;
291 
292  return;
293 }
float get(const DTWireId &wireid, double *x=nullptr) const
Get the value correspoding to the given WireId, / using x[] as parameters of the parametrization when...
int get(int wheelId, int stationId, int sectorId, int slId, float &mTime, float &mTrms, DTTimeUnits::type unit) const
Definition: DTMtime.cc:56
const DTRecoConditions * vDriftMap_

◆ varQuality()

float DTRunConditionVarClient::varQuality ( float  var,
float  maxGood,
float  minBad 
)
protected

Definition at line 252 of file DTRunConditionVarClient.cc.

References trigObjTnPSource_cfi::var.

252  {
253  float qual(0);
254  if (var <= maxGood) {
255  qual = 1.;
256  } else if (var > maxGood && var < minBad) {
257  qual = 0.9;
258  } else if (var >= minBad) {
259  qual = 0.1;
260  }
261 
262  return qual;
263 }

Member Data Documentation

◆ allwheelHistos

std::map<std::string, MonitorElement*> DTRunConditionVarClient::allwheelHistos
private

Definition at line 119 of file DTRunConditionVarClient.h.

◆ bookingdone

bool DTRunConditionVarClient::bookingdone
private

Definition at line 111 of file DTRunConditionVarClient.h.

◆ glbT0Summary

MonitorElement* DTRunConditionVarClient::glbT0Summary
private

Definition at line 114 of file DTRunConditionVarClient.h.

◆ glbVDriftSummary

MonitorElement* DTRunConditionVarClient::glbVDriftSummary
private

Definition at line 113 of file DTRunConditionVarClient.h.

◆ maxGoodT0

float DTRunConditionVarClient::maxGoodT0
private

Definition at line 96 of file DTRunConditionVarClient.h.

◆ maxGoodT0Sigma

float DTRunConditionVarClient::maxGoodT0Sigma
private

Definition at line 101 of file DTRunConditionVarClient.h.

◆ maxGoodVDriftDev

float DTRunConditionVarClient::maxGoodVDriftDev
private

Definition at line 94 of file DTRunConditionVarClient.h.

◆ maxGoodVDriftSigma

float DTRunConditionVarClient::maxGoodVDriftSigma
private

Definition at line 99 of file DTRunConditionVarClient.h.

◆ maxRangeT0

float DTRunConditionVarClient::maxRangeT0
private

Definition at line 92 of file DTRunConditionVarClient.h.

◆ maxRangeVDrift

float DTRunConditionVarClient::maxRangeVDrift
private

Definition at line 90 of file DTRunConditionVarClient.h.

◆ minBadT0

float DTRunConditionVarClient::minBadT0
private

Definition at line 97 of file DTRunConditionVarClient.h.

◆ minBadT0Sigma

float DTRunConditionVarClient::minBadT0Sigma
private

Definition at line 102 of file DTRunConditionVarClient.h.

◆ minBadVDriftDev

float DTRunConditionVarClient::minBadVDriftDev
private

Definition at line 95 of file DTRunConditionVarClient.h.

◆ minBadVDriftSigma

float DTRunConditionVarClient::minBadVDriftSigma
private

Definition at line 100 of file DTRunConditionVarClient.h.

◆ minRangeT0

float DTRunConditionVarClient::minRangeT0
private

Definition at line 91 of file DTRunConditionVarClient.h.

◆ minRangeVDrift

float DTRunConditionVarClient::minRangeVDrift
private

Definition at line 89 of file DTRunConditionVarClient.h.

◆ mTimeMap_

const DTMtime* DTRunConditionVarClient::mTimeMap_
private

Definition at line 105 of file DTRunConditionVarClient.h.

◆ mTimeMapToken_

edm::ESGetToken<DTMtime, DTMtimeRcd> DTRunConditionVarClient::mTimeMapToken_
private

Definition at line 104 of file DTRunConditionVarClient.h.

◆ nevents

int DTRunConditionVarClient::nevents
private

Definition at line 87 of file DTRunConditionVarClient.h.

◆ readLegacyVDriftDB

bool DTRunConditionVarClient::readLegacyVDriftDB
private

Definition at line 109 of file DTRunConditionVarClient.h.

◆ summaryHistos

std::map<std::string, MonitorElement*> DTRunConditionVarClient::summaryHistos
private

Definition at line 118 of file DTRunConditionVarClient.h.

◆ vDriftMap_

const DTRecoConditions* DTRunConditionVarClient::vDriftMap_
private

Definition at line 108 of file DTRunConditionVarClient.h.

◆ vDriftToken_

edm::ESGetToken<DTRecoConditions, DTRecoConditionsVdriftRcd> DTRunConditionVarClient::vDriftToken_
private

Definition at line 107 of file DTRunConditionVarClient.h.

◆ wheelHistos

std::map<int, std::map<std::string, MonitorElement*> > DTRunConditionVarClient::wheelHistos
private

Definition at line 116 of file DTRunConditionVarClient.h.

◆ wheelRingHistos

std::map<int, std::map<int, std::map<std::string, MonitorElement*> > > DTRunConditionVarClient::wheelRingHistos
private

Definition at line 117 of file DTRunConditionVarClient.h.