CMS 3D CMS Logo

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

#include <DTLocalTriggerSynchTest.h>

Inheritance diagram for DTLocalTriggerSynchTest:
DTLocalTriggerBaseTest 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

 DTLocalTriggerSynchTest (const edm::ParameterSet &ps)
 Constructor. More...
 
 ~DTLocalTriggerSynchTest () override
 Destructor. More...
 
- Public Member Functions inherited from DTLocalTriggerBaseTest
 DTLocalTriggerBaseTest ()
 Constructor. More...
 
 ~DTLocalTriggerBaseTest () 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 beginRun (const edm::Run &run, const edm::EventSetup &c) override
 begin Run More...
 
void bookChambHistos (DQMStore::IBooker &, DTChamberId chambId, std::string htype, std::string subfolder="")
 Book the new MEs (for each chamber) More...
 
void dqmEndJob (DQMStore::IBooker &, DQMStore::IGetter &) override
 
void dqmEndLuminosityBlock (DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &) override
 Perform client diagnostic in online. More...
 
float getFloatFromME (DQMStore::IGetter &, DTChamberId chId, std::string meType)
 Get float MEs. More...
 
void makeRatioME (TH1F *numerator, TH1F *denominator, MonitorElement *result)
 Compute efficiency plots. More...
 
void runClientDiagnostic (DQMStore::IBooker &, DQMStore::IGetter &) override
 DQM Client Diagnostic. More...
 
- Protected Member Functions inherited from DTLocalTriggerBaseTest
void beginRun (edm::Run const &run, edm::EventSetup const &context) override
 BeginRun. More...
 
void bookCmsHistos (DQMStore::IBooker &, std::string hTag, std::string folder="", bool isGlb=false)
 Book the new MEs (CMS summary) More...
 
void bookSectorHistos (DQMStore::IBooker &, int wheel, int sector, std::string hTag, std::string folder="")
 Book the new MEs (for each sector) More...
 
void bookWheelHistos (DQMStore::IBooker &, int wheel, std::string hTag, std::string folder="")
 Book the new MEs (for each wheel) More...
 
std::string category ()
 Get message logger name. More...
 
void endRun (edm::Run const &run, edm::EventSetup const &context) override
 Perform client diagnostic in offline. More...
 
std::string fullName (std::string htype)
 Create fullname from histo partial name. More...
 
template<class T >
TgetHisto (MonitorElement *me)
 Convert ME to Histogram fo type T. More...
 
std::string getMEName (std::string histoTag, std::string subfolder, const DTChamberId &chambid)
 Get the ME name (by chamber) More...
 
std::string getMEName (std::string histoTag, std::string subfolder, int wh)
 Get the ME name (by wheel) More...
 
std::pair< float, float > phiRange (const DTChamberId &id)
 Calculate phi range for histograms. More...
 
void setConfig (const edm::ParameterSet &ps, std::string name)
 Set configuration variables. More...
 
std::string & topFolder ()
 Get top folder name. More...
 
- 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 Attributes

bool bookingdone
 
double bxTime
 
std::map< uint32_t, std::map< std::string, MonitorElement * > > chambME
 
std::string denHistoTag
 
int minEntries
 
int nBXHigh
 
int nBXLow
 
std::string numHistoTag
 
bool rangeInBX
 
std::string ratioHistoTag
 
const DTTPGParameterswPhaseMap
 
edm::ESGetToken< DTTPGParameters, DTTPGParametersRcdwPhaseMapToken_
 
bool writeDB
 

Additional Inherited Members

- Public Types inherited from DQMEDHarvester
typedef dqm::harvesting::DQMStore DQMStore
 
typedef dqm::harvesting::MonitorElement MonitorElement
 
- Public Types inherited from edm::one::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
template<typename T >
using BranchAliasSetterT = ProductRegistryHelper::BranchAliasSetterT< T >
 
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex > >
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- 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 DTLocalTriggerBaseTest
std::string baseFolderTM
 
std::map< std::string, MonitorElement * > cmsME
 
std::string hwSource
 
std::vector< std::string > hwSources
 
const DTGeometrymuonGeom
 
edm::ESGetToken< DTGeometry, MuonGeometryRecordmuonGeomToken_
 
int nevents
 
unsigned int nLumiSegs
 
edm::ParameterSet parameters
 
int prescaleFactor
 
int run
 
bool runOnline
 
std::map< int, std::map< std::string, MonitorElement * > > secME
 
std::string sourceFolder
 
std::string testName
 
std::string trigSource
 
std::vector< std::string > trigSources
 
std::map< int, std::map< std::string, MonitorElement * > > whME
 
- 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 21 of file DTLocalTriggerSynchTest.h.

Constructor & Destructor Documentation

◆ DTLocalTriggerSynchTest()

DTLocalTriggerSynchTest::DTLocalTriggerSynchTest ( const edm::ParameterSet ps)

Constructor.

Definition at line 39 of file DTLocalTriggerSynchTest.cc.

References DTLocalTriggerBaseTest::baseFolderTM, bookingdone, and DTLocalTriggerBaseTest::setConfig().

40  : wPhaseMapToken_(esConsumes<edm::Transition::BeginRun>()) {
41  setConfig(ps, "DTLocalTriggerSynch");
42  baseFolderTM = "DT/90-LocalTriggerSynch/";
43 
44  bookingdone = false;
45 }
edm::ESGetToken< DTTPGParameters, DTTPGParametersRcd > wPhaseMapToken_
void setConfig(const edm::ParameterSet &ps, std::string name)
Set configuration variables.

◆ ~DTLocalTriggerSynchTest()

DTLocalTriggerSynchTest::~DTLocalTriggerSynchTest ( )
override

Destructor.

Definition at line 47 of file DTLocalTriggerSynchTest.cc.

47 {}

Member Function Documentation

◆ beginRun()

void DTLocalTriggerSynchTest::beginRun ( const edm::Run run,
const edm::EventSetup c 
)
overrideprotected

begin Run

Definition at line 49 of file DTLocalTriggerSynchTest.cc.

References DTLocalTriggerBaseTest::beginRun(), bxTime, HltBtagPostValidation_cff::c, denHistoTag, edm::ParameterSet::getParameter(), minEntries, nBXHigh, nBXLow, numHistoTag, DTLocalTriggerBaseTest::parameters, rangeInBX, ratioHistoTag, and DTLocalTriggerBaseTest::run.

49  {
50  numHistoTag = parameters.getParameter<string>("numHistoTag");
51  denHistoTag = parameters.getParameter<string>("denHistoTag");
52  ratioHistoTag = parameters.getParameter<string>("ratioHistoTag");
53  bxTime = parameters.getParameter<double>("bxTimeInterval");
54  rangeInBX = parameters.getParameter<bool>("rangeWithinBX");
55  nBXLow = parameters.getParameter<int>("nBXLow");
56  nBXHigh = parameters.getParameter<int>("nBXHigh");
57  minEntries = parameters.getParameter<int>("minEntries");
58 
60 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
void beginRun(edm::Run const &run, edm::EventSetup const &context) override
BeginRun.

◆ bookChambHistos()

void DTLocalTriggerSynchTest::bookChambHistos ( DQMStore::IBooker ,
DTChamberId  chambId,
std::string  htype,
std::string  subfolder = "" 
)
protected

Book the new MEs (for each chamber)

Definition at line 230 of file DTLocalTriggerSynchTest.cc.

References dqm::implementation::IBooker::book1D(), bxTime, DTLocalTriggerBaseTest::category(), reco::ceil(), chambME, printsummarytable::folder, DTLocalTriggerBaseTest::fullName(), SiStripPI::max, SiStripPI::min, LaserClient_cfi::nbins, nBXHigh, nBXLow, rangeInBX, DetId::rawId(), hgcalTBTopologyTester_cfi::sector, DTChamberId::sector(), dqm::implementation::NavigatorBase::setCurrentFolder(), DTChamberId::station(), relativeConstraints::station, DTLocalTriggerBaseTest::testName, DTLocalTriggerBaseTest::topFolder(), DTChamberId::wheel(), and makeMuonMisalignmentScenario::wheel.

Referenced by dqmEndLuminosityBlock().

233  {
234  stringstream wheel;
235  wheel << chambId.wheel();
236  stringstream station;
237  station << chambId.station();
238  stringstream sector;
239  sector << chambId.sector();
240 
241  string fullType = fullName(htype);
242  string HistoName = fullType + "_W" + wheel.str() + "_Sec" + sector.str() + "_St" + station.str();
243 
244  string folder = topFolder() + "Wheel" + wheel.str() + "/Sector" + sector.str() + "/Station" + station.str();
245  if (!subfolder.empty()) {
246  folder += "7" + subfolder;
247  }
248 
249  ibooker.setCurrentFolder(folder);
250 
251  LogPrint(category()) << "[" << testName << "Test]: booking " << folder << "/" << HistoName;
252 
253  uint32_t indexChId = chambId.rawId();
254  float min = rangeInBX ? 0 : nBXLow * bxTime;
255  float max = rangeInBX ? bxTime : nBXHigh * bxTime;
256  int nbins = static_cast<int>(ceil(rangeInBX ? bxTime : (nBXHigh - nBXLow) * bxTime));
257 
258  chambME[indexChId][fullType] =
259  ibooker.book1D(HistoName.c_str(), "All/HH ratio vs Muon Arrival Time", nbins, min, max);
260 }
int station() const
Return the station number.
Definition: DTChamberId.h:42
constexpr int32_t ceil(float num)
std::string & topFolder()
Get top folder name.
Log< level::Warning, true > LogPrint
std::string category()
Get message logger name.
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
std::string HistoName
std::map< uint32_t, std::map< std::string, MonitorElement * > > chambME
int wheel() const
Return the wheel number.
Definition: DTChamberId.h:39
int sector() const
Definition: DTChamberId.h:49
std::string fullName(std::string htype)
Create fullname from histo partial name.

◆ dqmEndJob()

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

Reimplemented from DTLocalTriggerBaseTest.

Definition at line 143 of file DTLocalTriggerSynchTest.cc.

References DTTPGParameters::begin(), bxTime, DTLocalTriggerBaseTest::category(), DTGeometry::chambers(), DTLocalTriggerBaseTest::dqmEndJob(), DTTPGParameters::end(), DTTPGParameters::get(), dqm::implementation::IGetter::get(), getFloatFromME(), DTLocalTriggerBaseTest::getMEName(), edm::ParameterSet::getParameter(), DTLocalTriggerBaseTest::hwSource, minEntries, DTLocalTriggerBaseTest::muonGeom, DTTimeUnits::ns, DTLocalTriggerBaseTest::parameters, ratioHistoTag, DTTPGParameters::set(), DTLocalTriggerBaseTest::testName, wPhaseMap, and DTCalibDBUtils::writeToDB().

143  {
144  DTLocalTriggerBaseTest::dqmEndJob(ibooker, igetter);
145 
146  if (parameters.getParameter<bool>("writeDB")) {
147  LogVerbatim(category()) << "[" << testName << "Test]: writeDB flag set to true. Producing peak position database."
148  << endl;
149 
150  DTTPGParameters delayMap;
151  hwSource = "TM";
152  std::vector<const DTChamber*>::const_iterator chambIt = muonGeom->chambers().begin();
153  std::vector<const DTChamber*>::const_iterator chambEnd = muonGeom->chambers().end();
154  for (; chambIt != chambEnd; ++chambIt) {
155  DTChamberId chId = (*chambIt)->id();
156  float fineDelay = 0;
157  int coarseDelay = static_cast<int>(
158  (getFloatFromME(igetter, chId, "tTrig_SL1") + getFloatFromME(igetter, chId, "tTrig_SL3")) * 0.5 / bxTime);
159 
160  bool fineDiff = parameters.getParameter<bool>("fineParamDiff");
161  bool coarseDiff = parameters.getParameter<bool>("coarseParamDiff");
162 
163  TH1F* ratioH = getHisto<TH1F>(igetter.get(getMEName(ratioHistoTag, "", chId)));
164  if (ratioH->GetEntries() > minEntries) {
165  TF1* fitF = ratioH->GetFunction("mypol8");
166  if (fitF) {
167  fineDelay = fitF->GetMaximumX(0, bxTime);
168  }
169  } else {
170  LogInfo(category()) << "[" << testName << "Test]: Ratio histogram for chamber " << chId
171  << " is empty. Worst Phase value set to 0." << endl;
172  }
173 
174  if (fineDiff || coarseDiff) {
175  float wFine;
176  int wCoarse;
177  wPhaseMap->get(chId, wCoarse, wFine, DTTimeUnits::ns);
178  if (fineDiff) {
179  fineDelay = wFine - fineDelay;
180  }
181  if (coarseDiff) {
182  coarseDelay = wCoarse - coarseDelay;
183  }
184  }
185  delayMap.set(chId, coarseDelay, fineDelay, DTTimeUnits::ns);
186  }
187 
188  std::vector<std::pair<DTTPGParametersId, DTTPGParametersData> >::const_iterator dbIt = delayMap.begin();
189  std::vector<std::pair<DTTPGParametersId, DTTPGParametersData> >::const_iterator dbEnd = delayMap.end();
190  for (; dbIt != dbEnd; ++dbIt) {
191  LogVerbatim(category()) << "[" << testName << "Test]: DB entry for Wh " << (*dbIt).first.wheelId << " Sec "
192  << (*dbIt).first.sectorId << " St " << (*dbIt).first.stationId << " has coarse "
193  << (*dbIt).second.nClock << " and phase " << (*dbIt).second.tPhase << std::endl;
194  }
195 
196  string delayRecord = "DTTPGParametersRcd";
197  DTCalibDBUtils::writeToDB(delayRecord, delayMap);
198  }
199 }
Log< level::Info, true > LogVerbatim
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
static void writeToDB(std::string record, const T &payload)
const_iterator end() const
int set(int wheelId, int stationId, int sectorId, int nc, float ph, DTTimeUnits::type unit)
const DTTPGParameters * wPhaseMap
const_iterator begin() const
int get(int wheelId, int stationId, int sectorId, int &nc, float &ph, DTTimeUnits::type unit) const
get content
float getFloatFromME(DQMStore::IGetter &, DTChamberId chId, std::string meType)
Get float MEs.
std::string category()
Get message logger name.
Log< level::Info, false > LogInfo
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:697
std::string getMEName(std::string histoTag, std::string subfolder, const DTChamberId &chambid)
Get the ME name (by chamber)
void dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &) override
const std::vector< const DTChamber * > & chambers() const
Return a vector of all Chamber.
Definition: DTGeometry.cc:84

◆ dqmEndLuminosityBlock()

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

Perform client diagnostic in online.

Reimplemented from DTLocalTriggerBaseTest.

Definition at line 62 of file DTLocalTriggerSynchTest.cc.

References bookChambHistos(), bookingdone, HltBtagPostValidation_cff::c, DTLocalTriggerBaseTest::category(), DTGeometry::chambers(), edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), DTLocalTriggerBaseTest::hwSource, DTLocalTriggerBaseTest::hwSources, DTLocalTriggerBaseTest::muonGeom, DTLocalTriggerBaseTest::parameters, ratioHistoTag, DTLocalTriggerBaseTest::testName, DTLocalTriggerBaseTest::trigSource, DTLocalTriggerBaseTest::trigSources, wPhaseMap, and wPhaseMapToken_.

65  {
66  if (bookingdone)
67  return;
68 
69  vector<string>::const_iterator iTr = trigSources.begin();
70  vector<string>::const_iterator trEnd = trigSources.end();
71  vector<string>::const_iterator iHw = hwSources.begin();
72  vector<string>::const_iterator hwEnd = hwSources.end();
73 
74  //Booking
75  if (parameters.getUntrackedParameter<bool>("staticBooking", true)) {
76  for (; iTr != trEnd; ++iTr) {
77  trigSource = (*iTr);
78  for (; iHw != hwEnd; ++iHw) {
79  hwSource = (*iHw);
80  std::vector<const DTChamber*>::const_iterator chambIt = muonGeom->chambers().begin();
81  std::vector<const DTChamber*>::const_iterator chambEnd = muonGeom->chambers().end();
82  for (; chambIt != chambEnd; ++chambIt) {
83  DTChamberId chId = ((*chambIt)->id());
84  bookChambHistos(ibooker, chId, ratioHistoTag);
85  }
86  }
87  }
88  }
89 
90  LogVerbatim(category()) << "[" << testName << "Test]: book Histograms" << endl;
91 
92  if (parameters.getParameter<bool>("fineParamDiff")) {
93  wPhaseMap = &c.getData(wPhaseMapToken_);
94  }
95 
96  bookingdone = true;
97 }
edm::ESGetToken< DTTPGParameters, DTTPGParametersRcd > wPhaseMapToken_
Log< level::Info, true > LogVerbatim
std::vector< std::string > trigSources
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
const DTTPGParameters * wPhaseMap
T getUntrackedParameter(std::string const &, T const &) const
std::string category()
Get message logger name.
void bookChambHistos(DQMStore::IBooker &, DTChamberId chambId, std::string htype, std::string subfolder="")
Book the new MEs (for each chamber)
const std::vector< const DTChamber * > & chambers() const
Return a vector of all Chamber.
Definition: DTGeometry.cc:84
std::vector< std::string > hwSources

◆ getFloatFromME()

float DTLocalTriggerSynchTest::getFloatFromME ( DQMStore::IGetter igetter,
DTChamberId  chId,
std::string  meType 
)
protected

Get float MEs.

Definition at line 206 of file DTLocalTriggerSynchTest.cc.

References DTLocalTriggerBaseTest::category(), ctppsRandomDQMSource_cfi::folderName, dqm::implementation::IGetter::get(), hlt_dqm_clientPB-live_cfg::me, hgcalTBTopologyTester_cfi::sector, DTChamberId::sector(), DTLocalTriggerBaseTest::sourceFolder, DTChamberId::station(), relativeConstraints::station, DTLocalTriggerBaseTest::testName, DTLocalTriggerBaseTest::topFolder(), DTChamberId::wheel(), and makeMuonMisalignmentScenario::wheel.

Referenced by dqmEndJob().

206  {
207  stringstream wheel;
208  wheel << chId.wheel();
209  stringstream station;
210  station << chId.station();
211  stringstream sector;
212  sector << chId.sector();
213 
214  string folderName = topFolder() + "Wheel" + wheel.str() + "/Sector" + sector.str() + "/Station" + station.str() + "/";
215 
216  string histoname =
217  sourceFolder + folderName + meType + "_W" + wheel.str() + "_Sec" + sector.str() + "_St" + station.str();
218 
219  MonitorElement* me = igetter.get(histoname);
220  if (me) {
221  return me->getFloatValue();
222  } else {
223  LogProblem(category()) << "[" << testName << "Test]: " << histoname << " is not a valid ME. 0 returned"
224  << std::endl;
225  }
226 
227  return 0;
228 }
int station() const
Return the station number.
Definition: DTChamberId.h:42
std::string & topFolder()
Get top folder name.
std::string category()
Get message logger name.
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:697
int wheel() const
Return the wheel number.
Definition: DTChamberId.h:39
int sector() const
Definition: DTChamberId.h:49
Log< level::Error, true > LogProblem

◆ makeRatioME()

void DTLocalTriggerSynchTest::makeRatioME ( TH1F *  numerator,
TH1F *  denominator,
MonitorElement result 
)
protected

◆ runClientDiagnostic()

void DTLocalTriggerSynchTest::runClientDiagnostic ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter 
)
overrideprotectedvirtual

DQM Client Diagnostic.

Implements DTLocalTriggerBaseTest.

Definition at line 99 of file DTLocalTriggerSynchTest.cc.

References DTLocalTriggerBaseTest::category(), DTGeometry::chambers(), chambME, denHistoTag, DTLocalTriggerBaseTest::fullName(), dqm::implementation::IGetter::get(), DTLocalTriggerBaseTest::getMEName(), dqm::impl::MonitorElement::getName(), DTLocalTriggerBaseTest::hwSource, DTLocalTriggerBaseTest::hwSources, makeRatioME(), minEntries, DTLocalTriggerBaseTest::muonGeom, numHistoTag, ratioHistoTag, DetId::rawId(), DTLocalTriggerBaseTest::testName, DTLocalTriggerBaseTest::trigSource, and DTLocalTriggerBaseTest::trigSources.

99  {
100  // Loop over Trig & Hw sources
101  for (vector<string>::const_iterator iTr = trigSources.begin(); iTr != trigSources.end(); ++iTr) {
102  trigSource = (*iTr);
103  for (vector<string>::const_iterator iHw = hwSources.begin(); iHw != hwSources.end(); ++iHw) {
104  hwSource = (*iHw);
105  std::vector<const DTChamber*>::const_iterator chambIt = muonGeom->chambers().begin();
106  std::vector<const DTChamber*>::const_iterator chambEnd = muonGeom->chambers().end();
107  for (; chambIt != chambEnd; ++chambIt) {
108  DTChamberId chId = (*chambIt)->id();
109  uint32_t indexCh = chId.rawId();
110 
111  // Perform peak finding
112 
113  TH1F* numH = getHisto<TH1F>(igetter.get(getMEName(numHistoTag, "", chId)));
114  TH1F* denH = getHisto<TH1F>(igetter.get(getMEName(denHistoTag, "", chId)));
115 
116  if (numH && denH && numH->GetEntries() > minEntries && denH->GetEntries() > minEntries) {
117  std::map<std::string, MonitorElement*> innerME = chambME[indexCh];
118  MonitorElement* ratioH = innerME.find(fullName(ratioHistoTag))->second;
119  makeRatioME(numH, denH, ratioH);
120  try {
121  //Need our own copy to avoid threading problems
122  TF1 mypol8("mypol8", "pol8");
123  getHisto<TH1F>(ratioH)->Fit(&mypol8, "CQO");
124  } catch (cms::Exception& iException) {
125  edm::LogPrint(category()) << "[" << testName << "Test]: Error fitting " << ratioH->getName()
126  << " returned 0" << endl;
127  }
128  } else {
129  if (!numH || !denH) {
130  LogPrint(category()) << "[" << testName
131  << "Test]: At least one of the required Histograms was not found for chamber " << chId
132  << ". Peaks not computed" << endl;
133  } else {
134  LogPrint(category()) << "[" << testName << "Test]: Number of plots entries for " << chId
135  << " is less than minEntries=" << minEntries << ". Peaks not computed" << endl;
136  }
137  }
138  }
139  }
140  }
141 }
std::vector< std::string > trigSources
Definition: Fit.h:32
Log< level::Warning, true > LogPrint
std::string category()
Get message logger name.
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:697
void makeRatioME(TH1F *numerator, TH1F *denominator, MonitorElement *result)
Compute efficiency plots.
std::string getMEName(std::string histoTag, std::string subfolder, const DTChamberId &chambid)
Get the ME name (by chamber)
const std::string & getName() const
get name of ME
std::map< uint32_t, std::map< std::string, MonitorElement * > > chambME
const std::vector< const DTChamber * > & chambers() const
Return a vector of all Chamber.
Definition: DTGeometry.cc:84
std::vector< std::string > hwSources
std::string fullName(std::string htype)
Create fullname from histo partial name.

Member Data Documentation

◆ bookingdone

bool DTLocalTriggerSynchTest::bookingdone
private

Definition at line 69 of file DTLocalTriggerSynchTest.h.

Referenced by dqmEndLuminosityBlock(), and DTLocalTriggerSynchTest().

◆ bxTime

double DTLocalTriggerSynchTest::bxTime
private

Definition at line 60 of file DTLocalTriggerSynchTest.h.

Referenced by beginRun(), bookChambHistos(), and dqmEndJob().

◆ chambME

std::map<uint32_t, std::map<std::string, MonitorElement *> > DTLocalTriggerSynchTest::chambME
private

Definition at line 56 of file DTLocalTriggerSynchTest.h.

Referenced by bookChambHistos(), and runClientDiagnostic().

◆ denHistoTag

std::string DTLocalTriggerSynchTest::denHistoTag
private

Definition at line 58 of file DTLocalTriggerSynchTest.h.

Referenced by beginRun(), and runClientDiagnostic().

◆ minEntries

int DTLocalTriggerSynchTest::minEntries
private

Definition at line 64 of file DTLocalTriggerSynchTest.h.

Referenced by beginRun(), dqmEndJob(), and runClientDiagnostic().

◆ nBXHigh

int DTLocalTriggerSynchTest::nBXHigh
private

Definition at line 63 of file DTLocalTriggerSynchTest.h.

Referenced by beginRun(), and bookChambHistos().

◆ nBXLow

int DTLocalTriggerSynchTest::nBXLow
private

Definition at line 62 of file DTLocalTriggerSynchTest.h.

Referenced by beginRun(), and bookChambHistos().

◆ numHistoTag

std::string DTLocalTriggerSynchTest::numHistoTag
private

Definition at line 57 of file DTLocalTriggerSynchTest.h.

Referenced by beginRun(), and runClientDiagnostic().

◆ rangeInBX

bool DTLocalTriggerSynchTest::rangeInBX
private

Definition at line 61 of file DTLocalTriggerSynchTest.h.

Referenced by beginRun(), and bookChambHistos().

◆ ratioHistoTag

std::string DTLocalTriggerSynchTest::ratioHistoTag
private

◆ wPhaseMap

const DTTPGParameters* DTLocalTriggerSynchTest::wPhaseMap
private

Definition at line 67 of file DTLocalTriggerSynchTest.h.

Referenced by dqmEndJob(), and dqmEndLuminosityBlock().

◆ wPhaseMapToken_

edm::ESGetToken<DTTPGParameters, DTTPGParametersRcd> DTLocalTriggerSynchTest::wPhaseMapToken_
private

Definition at line 66 of file DTLocalTriggerSynchTest.h.

Referenced by dqmEndLuminosityBlock().

◆ writeDB

bool DTLocalTriggerSynchTest::writeDB
private

Definition at line 65 of file DTLocalTriggerSynchTest.h.