CMS 3D CMS Logo

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

#include <DTNoiseTask.h>

Inheritance diagram for DTNoiseTask:
DQMOneEDAnalyzer< edm::one::WatchLuminosityBlocks > edm::one::EDProducer< edm::EndRunProducer, edm::one::WatchRuns, edm::Accumulator, Args... > edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
 DTNoiseTask (const edm::ParameterSet &ps)
 Constructor. More...
 
 ~DTNoiseTask () override
 Destructor. More...
 
- Public Member Functions inherited from DQMOneEDAnalyzer< edm::one::WatchLuminosityBlocks >
void accumulate (edm::Event const &event, edm::EventSetup const &setup) override
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
 DQMOneEDAnalyzer ()
 
void endRun (edm::Run const &, edm::EventSetup const &) final
 
void endRunProduce (edm::Run &run, edm::EventSetup const &setup) final
 
virtual bool getCanSaveByLumi ()
 
- Public Member Functions inherited from edm::one::EDProducer< edm::EndRunProducer, edm::one::WatchRuns, edm::Accumulator, Args... >
 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 analyze (const edm::Event &e, const edm::EventSetup &c) override
 Analyze. More...
 
void beginLuminosityBlock (const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &setup) final
 
void dqmBeginRun (const edm::Run &, const edm::EventSetup &) override
 
void endLuminosityBlock (const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &setup) override
 
- Protected Member Functions inherited from DQMOneEDAnalyzer< edm::one::WatchLuminosityBlocks >
virtual void dqmEndRun (edm::Run const &, edm::EventSetup const &)
 
- 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

void bookHistos (DQMStore::IBooker &, DTChamberId chId)
 
void bookHistos (DQMStore::IBooker &, DTSuperLayerId slId)
 

Private Attributes

bool doSegmentVeto
 
bool doTimeBoxHistos
 
edm::EDGetTokenT< DTDigiCollectiondtDigiToken_
 
const DTGeometrydtGeom
 
int evtNumber
 
std::map< DTChamberId, int > mapEvt
 
edm::ESGetToken< DTGeometry, MuonGeometryRecordmuonGeomToken_
 
MonitorElementnEventMonitor
 
std::map< DTChamberId, MonitorElement * > noiseHistos
 
edm::EDGetTokenT< DTRecSegment4DCollectionrecHits4DToken_
 
double safeMargin
 
std::map< DTSuperLayerId, MonitorElement * > tbHistos
 
const DTTtrigtTrigMap
 
edm::ESGetToken< DTTtrig, DTTtrigRcdtTrigMapToken_
 
std::map< DTChamberId, double > tTrigStMap
 

Additional Inherited Members

- Public Types inherited from DQMOneEDAnalyzer< edm::one::WatchLuminosityBlocks >
typedef dqm::reco::DQMStore DQMStore
 
typedef dqm::reco::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 DQMOneEDAnalyzer< edm::one::WatchLuminosityBlocks >
edm::EDPutTokenT< DQMTokenrunToken_
 

Detailed Description

No description available.

Authors
G. Mila , G. Cerminara - INFN Torino

Definition at line 39 of file DTNoiseTask.h.

Constructor & Destructor Documentation

◆ DTNoiseTask()

DTNoiseTask::DTNoiseTask ( const edm::ParameterSet ps)

Constructor.

Definition at line 37 of file DTNoiseTask.cc.

References doSegmentVeto, doTimeBoxHistos, dtDigiToken_, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), HLT_2022v12_cff::InputTag, recHits4DToken_, and safeMargin.

38  : evtNumber(0),
39  muonGeomToken_(esConsumes<edm::Transition::BeginRun>()),
40  tTrigMapToken_(esConsumes<edm::Transition::BeginRun>()) {
41  LogVerbatim("DTNoiseTask") << "[DTNoiseTask]: Constructor" << endl;
42 
43  //switch for timeBox booking
44  doTimeBoxHistos = ps.getUntrackedParameter<bool>("doTbHistos", false);
45 
46  // The label to retrieve the digis
47  dtDigiToken_ = consumes<DTDigiCollection>(ps.getParameter<InputTag>("dtDigiLabel"));
48 
49  // the name of the 4D rec hits collection
50  recHits4DToken_ = consumes<DTRecSegment4DCollection>(edm::InputTag(ps.getParameter<string>("recHits4DLabel")));
51 
52  // switch for segment veto
53  doSegmentVeto = ps.getUntrackedParameter<bool>("doSegmentVeto", false);
54 
55  // safe margin (ns) between ttrig and beginning of counting area
56  safeMargin = ps.getUntrackedParameter<double>("safeMargin", 200.);
57 }
Log< level::Info, true > LogVerbatim
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
bool doSegmentVeto
Definition: DTNoiseTask.h:72
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< DTRecSegment4DCollection > recHits4DToken_
Definition: DTNoiseTask.h:70
edm::EDGetTokenT< DTDigiCollection > dtDigiToken_
Definition: DTNoiseTask.h:64
double safeMargin
Definition: DTNoiseTask.h:94
edm::ESGetToken< DTTtrig, DTTtrigRcd > tTrigMapToken_
Definition: DTNoiseTask.h:76
bool doTimeBoxHistos
Definition: DTNoiseTask.h:68
edm::ESGetToken< DTGeometry, MuonGeometryRecord > muonGeomToken_
Definition: DTNoiseTask.h:74

◆ ~DTNoiseTask()

DTNoiseTask::~DTNoiseTask ( )
override

Destructor.

Definition at line 59 of file DTNoiseTask.cc.

59 {}

Member Function Documentation

◆ analyze()

void DTNoiseTask::analyze ( const edm::Event e,
const edm::EventSetup c 
)
overrideprotectedvirtual

Analyze.

Reimplemented from DQMOneEDAnalyzer< edm::one::WatchLuminosityBlocks >.

Definition at line 62 of file DTNoiseTask.cc.

References doSegmentVeto, doTimeBoxHistos, dtDigiToken_, MillePedeFileConverter_cfg::e, evtNumber, dqm::impl::MonitorElement::Fill(), mapEvt, nEventMonitor, noiseHistos, PostProcessor_cff::normalization, recHits4DToken_, safeMargin, edm::second(), tbHistos, tTrigStMap, and photonAnalyzer_cfi::yBin.

62  {
63  evtNumber++;
65 
66  if (evtNumber % 1000 == 0)
67  LogVerbatim("DTNoiseTask") << "[DTNoiseTask]: Analyzing evt number :" << evtNumber << endl;
68 
69  // map of the chambers with at least 1 segment
70  std::map<DTChamberId, int> segmentsChId;
71 
72  // Get the 4D segment collection from the event
74  if (doSegmentVeto) {
75  e.getByToken(recHits4DToken_, all4DSegments);
76 
77  // Loop over all chambers containing a segment and look for the number of segments
79  for (chamberId = all4DSegments->id_begin(); chamberId != all4DSegments->id_end(); ++chamberId) {
80  segmentsChId[*chamberId] = 1;
81  }
82  }
83 
84  // Get the digis from the event
86  e.getByToken(dtDigiToken_, dtdigis);
87 
88  // LOOP OVER ALL THE DIGIS OF THE EVENT
90  for (dtLayerId_It = dtdigis->begin(); dtLayerId_It != dtdigis->end(); ++dtLayerId_It) {
91  for (DTDigiCollection::const_iterator digiIt = ((*dtLayerId_It).second).first;
92  digiIt != ((*dtLayerId_It).second).second;
93  ++digiIt) {
94  //Check the TDC trigger width
95  int tdcTime = (*digiIt).countsTDC();
96  double upperLimit = tTrigStMap[(*dtLayerId_It).first.superlayerId().chamberId()] - safeMargin;
97  if (doTimeBoxHistos)
98  tbHistos[(*dtLayerId_It).first.superlayerId()]->Fill(tdcTime);
99  if (tdcTime > upperLimit)
100  continue;
101 
102  //Check the chamber has no 4D segments (optional)
103  if (doSegmentVeto && segmentsChId.find((*dtLayerId_It).first.superlayerId().chamberId()) != segmentsChId.end())
104  continue;
105 
106  // fill the occupancy histo
107  // FIXME: needs to be optimized: no need to rescale the histo for each digi
108  TH2F* noise_root = noiseHistos[(*dtLayerId_It).first.superlayerId().chamberId()]->getTH2F();
109  double normalization = 0;
110  if (mapEvt.find((*dtLayerId_It).first.superlayerId().chamberId()) != mapEvt.end()) {
111  LogVerbatim("DTNoiseTask") << " Last fill: # of events: "
112  << mapEvt[(*dtLayerId_It).first.superlayerId().chamberId()] << endl;
113  normalization = 1e-9 * upperLimit * mapEvt[(*dtLayerId_It).first.superlayerId().chamberId()];
114  // revert back to # of entries
115  noise_root->Scale(normalization);
116  }
117  int yBin = (*dtLayerId_It).first.layer() + (4 * ((*dtLayerId_It).first.superlayerId().superlayer() - 1));
118  noise_root->Fill((*digiIt).wire(), yBin);
119  // normalize the occupancy histo
120  mapEvt[(*dtLayerId_It).first.superlayerId().chamberId()] = evtNumber;
121  LogVerbatim("DTNoiseTask") << (*dtLayerId_It).first << " wire: " << (*digiIt).wire()
122  << " # counts: " << noise_root->GetBinContent((*digiIt).wire(), yBin)
123  << " Time interval: " << upperLimit << " # of events: " << evtNumber << endl;
124  ;
125  normalization = double(1e-9 * upperLimit * mapEvt[(*dtLayerId_It).first.superlayerId().chamberId()]);
126  // update the rate
127  noise_root->Scale(1. / normalization);
128  LogVerbatim("DTNoiseTask") << " noise rate: " << noise_root->GetBinContent((*digiIt).wire(), yBin) << endl;
129  }
130  }
131 }
Log< level::Info, true > LogVerbatim
std::map< DTChamberId, int > mapEvt
Definition: DTNoiseTask.h:86
identifier iterator
Definition: RangeMap.h:130
MonitorElement * nEventMonitor
Definition: DTNoiseTask.h:91
bool doSegmentVeto
Definition: DTNoiseTask.h:72
void Fill(long long x)
U second(std::pair< T, U > const &p)
edm::EDGetTokenT< DTRecSegment4DCollection > recHits4DToken_
Definition: DTNoiseTask.h:70
edm::EDGetTokenT< DTDigiCollection > dtDigiToken_
Definition: DTNoiseTask.h:64
double safeMargin
Definition: DTNoiseTask.h:94
std::map< DTSuperLayerId, MonitorElement * > tbHistos
Definition: DTNoiseTask.h:89
std::map< DTChamberId, double > tTrigStMap
Definition: DTNoiseTask.h:80
std::vector< DigiType >::const_iterator const_iterator
bool doTimeBoxHistos
Definition: DTNoiseTask.h:68
std::map< DTChamberId, MonitorElement * > noiseHistos
Definition: DTNoiseTask.h:83

◆ beginLuminosityBlock()

void DTNoiseTask::beginLuminosityBlock ( const edm::LuminosityBlock lumiSeg,
const edm::EventSetup setup 
)
inlinefinalprotected

Definition at line 53 of file DTNoiseTask.h.

53 {}

◆ bookHistograms()

void DTNoiseTask::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  run,
edm::EventSetup const &  setup 
)
overridevirtual

Implements DQMOneEDAnalyzer< edm::one::WatchLuminosityBlocks >.

Definition at line 227 of file DTNoiseTask.cc.

References dqm::implementation::IBooker::bookFloat(), bookHistos(), DTGeometry::chambers(), doTimeBoxHistos, dtGeom, DTTtrig::get(), dttriganalyzer_cfi::kFactor, nEventMonitor, DTTimeUnits::ns, dqm::implementation::NavigatorBase::setCurrentFolder(), dttriganalyzer_cfi::tTrig, tTrigMap, and tTrigStMap.

227  {
228  ibooker.setCurrentFolder("DT/EventInfo/Counters");
229  nEventMonitor = ibooker.bookFloat("nProcessedEventsNoise");
230 
231  // Loop over all the chambers
232  vector<const DTChamber*>::const_iterator ch_it = dtGeom->chambers().begin();
233  vector<const DTChamber*>::const_iterator ch_end = dtGeom->chambers().end();
234  for (; ch_it != ch_end; ++ch_it) {
235  DTChamberId chId = (*ch_it)->id();
236  // histo booking
237  bookHistos(ibooker, chId);
238  vector<const DTSuperLayer*>::const_iterator sl_it = (*ch_it)->superLayers().begin();
239  vector<const DTSuperLayer*>::const_iterator sl_end = (*ch_it)->superLayers().end();
240  // Loop over the SLs
241  for (; sl_it != sl_end; ++sl_it) {
242  DTSuperLayerId slId = (*sl_it)->id();
243  if (doTimeBoxHistos)
244  bookHistos(ibooker, slId);
245  float tTrig, tTrigRMS, kFactor;
246  tTrigMap->get(slId, tTrig, tTrigRMS, kFactor, DTTimeUnits::ns);
247  // tTrig mapping per station
248  // check that the ttrig is the lowest of the 3 SLs
249  if (tTrigStMap.find(chId) == tTrigStMap.end() ||
250  (tTrigStMap.find(chId) != tTrigStMap.end() && tTrig < tTrigStMap[chId]))
251  tTrigStMap[chId] = tTrig;
252  }
253  }
254 }
MonitorElement * bookFloat(TString const &name, FUNC onbooking=NOOP())
Definition: DQMStore.h:80
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
MonitorElement * nEventMonitor
Definition: DTNoiseTask.h:91
void bookHistos(DQMStore::IBooker &, DTChamberId chId)
Definition: DTNoiseTask.cc:133
std::map< DTChamberId, double > tTrigStMap
Definition: DTNoiseTask.h:80
const DTGeometry * dtGeom
Definition: DTNoiseTask.h:75
int get(int wheelId, int stationId, int sectorId, int slId, float &tTrig, float &tTrms, float &kFact, DTTimeUnits::type unit) const
get content
Definition: DTTtrig.cc:59
bool doTimeBoxHistos
Definition: DTNoiseTask.h:68
const std::vector< const DTChamber * > & chambers() const
Return a vector of all Chamber.
Definition: DTGeometry.cc:84
const DTTtrig * tTrigMap
Definition: DTNoiseTask.h:77

◆ bookHistos() [1/2]

void DTNoiseTask::bookHistos ( DQMStore::IBooker ibooker,
DTChamberId  chId 
)
private

Definition at line 133 of file DTNoiseTask.cc.

References dqm::implementation::IBooker::book2D(), DTGeometry::chamber(), dtGeom, HltBtagPostValidation_cff::histoName, hgcalTopologyTester_cfi::layers, noiseHistos, DTChamberId::sector(), dqm::implementation::NavigatorBase::setCurrentFolder(), DTChamberId::station(), relativeConstraints::station, AlCaHLTBitMon_QueryRunRegistry::string, DTChamber::superLayers(), DTChamberId::wheel(), and makeMuonMisalignmentScenario::wheel.

Referenced by bookHistograms().

133  {
134  // set the folder
135  stringstream wheel;
136  wheel << chId.wheel();
137  stringstream station;
138  station << chId.station();
139  stringstream sector;
140  sector << chId.sector();
141 
142  ibooker.setCurrentFolder("DT/05-Noise/Wheel" + wheel.str() +
143  // "/Station" + station.str() +
144  "/Sector" + sector.str());
145 
146  // Build the histo name
147  string histoName = string("NoiseRate") + "_W" + wheel.str() + "_St" + station.str() + "_Sec" + sector.str();
148 
149  LogVerbatim("DTNoiseTask") << "[DTNoiseTask]: booking chamber histo:" << endl;
150  LogVerbatim("DTNoiseTask") << " folder "
151  << "DT/05-Noise/Wheel" + wheel.str() +
152  // "/Station" + station.str() +
153  "/Sector" + sector.str() + "/"
154  << endl;
155  LogVerbatim("DTNoiseTask") << " histoName " << histoName << endl;
156 
157  // Get the chamber from the geometry
158  int nWires_max = 0;
159  const DTChamber* dtchamber = dtGeom->chamber(chId);
160  const vector<const DTSuperLayer*>& superlayers = dtchamber->superLayers();
161 
162  // Loop over layers and find the max # of wires
163  for (vector<const DTSuperLayer*>::const_iterator sl = superlayers.begin(); sl != superlayers.end();
164  ++sl) { // loop over SLs
165  vector<const DTLayer*> layers = (*sl)->layers();
166  for (vector<const DTLayer*>::const_iterator lay = layers.begin(); lay != layers.end(); ++lay) { // loop over layers
167  int nWires = (*lay)->specificTopology().channels();
168  if (nWires > nWires_max)
169  nWires_max = nWires;
170  }
171  }
172 
173  noiseHistos[chId] =
174  ibooker.book2D(histoName, "Noise rate (Hz) per channel", nWires_max, 1, nWires_max + 1, 12, 1, 13);
175  noiseHistos[chId]->setAxisTitle("wire number", 1);
176  noiseHistos[chId]->setBinLabel(1, "SL1-L1", 2);
177  noiseHistos[chId]->setBinLabel(2, "SL1-L2", 2);
178  noiseHistos[chId]->setBinLabel(3, "SL1-L3", 2);
179  noiseHistos[chId]->setBinLabel(4, "SL1-L4", 2);
180  noiseHistos[chId]->setBinLabel(5, "SL2-L1", 2);
181  noiseHistos[chId]->setBinLabel(6, "SL2-L2", 2);
182  noiseHistos[chId]->setBinLabel(7, "SL2-L3", 2);
183  noiseHistos[chId]->setBinLabel(8, "SL2-L4", 2);
184  noiseHistos[chId]->setBinLabel(9, "SL3-L1", 2);
185  noiseHistos[chId]->setBinLabel(10, "SL3-L2", 2);
186  noiseHistos[chId]->setBinLabel(11, "SL3-L3", 2);
187  noiseHistos[chId]->setBinLabel(12, "SL3-L4", 2);
188 }
Log< level::Info, true > LogVerbatim
int station() const
Return the station number.
Definition: DTChamberId.h:42
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
const std::vector< const DTSuperLayer * > & superLayers() const
Return the superlayers in the chamber.
Definition: DTChamber.cc:51
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
const DTGeometry * dtGeom
Definition: DTNoiseTask.h:75
int wheel() const
Return the wheel number.
Definition: DTChamberId.h:39
int sector() const
Definition: DTChamberId.h:49
std::map< DTChamberId, MonitorElement * > noiseHistos
Definition: DTNoiseTask.h:83
const DTChamber * chamber(const DTChamberId &id) const
Return a DTChamber given its id.
Definition: DTGeometry.cc:90

◆ bookHistos() [2/2]

void DTNoiseTask::bookHistos ( DQMStore::IBooker ibooker,
DTSuperLayerId  slId 
)
private

Definition at line 190 of file DTNoiseTask.cc.

References dqm::implementation::IBooker::book1D(), DTSuperLayerId::chamberId(), HltBtagPostValidation_cff::histoName, DTChamberId::sector(), dqm::implementation::NavigatorBase::setCurrentFolder(), DTChamberId::station(), relativeConstraints::station, AlCaHLTBitMon_QueryRunRegistry::string, DTSuperLayerId::superlayer(), tbHistos, DTChamberId::wheel(), and makeMuonMisalignmentScenario::wheel.

190  {
191  // set the folder
192  stringstream wheel;
193  wheel << slId.chamberId().wheel();
194  stringstream station;
195  station << slId.chamberId().station();
196  stringstream sector;
197  sector << slId.chamberId().sector();
198  stringstream superlayer;
199  superlayer << slId.superlayer();
200 
201  ibooker.setCurrentFolder("DT/05-Noise/Wheel" + wheel.str() + "/Station" + station.str() + "/Sector" + sector.str());
202 
203  // Build the histo name
204  string histoName =
205  string("TimeBox") + "_W" + wheel.str() + "_St" + station.str() + "_Sec" + sector.str() + "_SL" + superlayer.str();
206 
207  LogVerbatim("DTNoiseTask") << "[DTNoiseTask]: booking SL histo:" << endl;
208  LogVerbatim("DTNoiseTask") << " folder "
209  << "DT/05-Noise/Wheel" + wheel.str() + "/Station" + station.str() + "/Sector" +
210  sector.str() + "/"
211  << endl;
212  LogVerbatim("DTNoiseTask") << " histoName " << histoName << endl;
213 
214  tbHistos[slId] = ibooker.book1D(histoName, "Time Box (TDC counts)", 1000, 0, 6000);
215 }
Log< level::Info, true > LogVerbatim
int station() const
Return the station number.
Definition: DTChamberId.h:42
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
DTChamberId chamberId() const
Return the corresponding ChamberId.
std::map< DTSuperLayerId, MonitorElement * > tbHistos
Definition: DTNoiseTask.h:89
int superlayer() const
Return the superlayer number (deprecated method name)
int wheel() const
Return the wheel number.
Definition: DTChamberId.h:39
int sector() const
Definition: DTChamberId.h:49
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98

◆ dqmBeginRun()

void DTNoiseTask::dqmBeginRun ( const edm::Run run,
const edm::EventSetup setup 
)
overrideprotectedvirtual

Reimplemented from DQMOneEDAnalyzer< edm::one::WatchLuminosityBlocks >.

Definition at line 217 of file DTNoiseTask.cc.

References dtGeom, muonGeomToken_, singleTopDQM_cfi::setup, tTrigMap, and tTrigMapToken_.

217  {
218  LogVerbatim("DTNoiseTask") << "[DTNoiseTask]: Begin of run" << endl;
219 
220  // tTrig Map
221  tTrigMap = &setup.getData(tTrigMapToken_);
222 
223  // get the geometry
224  dtGeom = &setup.getData(muonGeomToken_);
225 }
Log< level::Info, true > LogVerbatim
const DTGeometry * dtGeom
Definition: DTNoiseTask.h:75
edm::ESGetToken< DTTtrig, DTTtrigRcd > tTrigMapToken_
Definition: DTNoiseTask.h:76
const DTTtrig * tTrigMap
Definition: DTNoiseTask.h:77
edm::ESGetToken< DTGeometry, MuonGeometryRecord > muonGeomToken_
Definition: DTNoiseTask.h:74

◆ endLuminosityBlock()

void DTNoiseTask::endLuminosityBlock ( const edm::LuminosityBlock lumiSeg,
const edm::EventSetup setup 
)
overrideprotected

Definition at line 256 of file DTNoiseTask.cc.

References MillePedeFileConverter_cfg::e, evtNumber, mapEvt, noiseHistos, PostProcessor_cff::normalization, safeMargin, and tTrigStMap.

256  {
257  LogVerbatim("DTNoiseTask") << "[DTNoiseTask]: End LS, update rates in all histos" << endl;
258 
259  // update the rate of all histos (usefull for histos with few entries: they are not updated very often
260  for (map<DTChamberId, MonitorElement*>::const_iterator meAndChamber = noiseHistos.begin();
261  meAndChamber != noiseHistos.end();
262  ++meAndChamber) {
263  DTChamberId chId = (*meAndChamber).first;
264  TH2F* noise_root = (*meAndChamber).second->getTH2F();
265  double upperLimit = tTrigStMap[chId] - safeMargin;
266 
267  double normalization = 0;
268  if (mapEvt.find(chId) != mapEvt.end()) {
269  LogVerbatim("DTNoiseTask") << " Ch: " << chId << " Last fill: # of events: " << mapEvt[chId] << endl;
270  normalization = 1e-9 * upperLimit * mapEvt[chId];
271  // revert back to # of entries
272  noise_root->Scale(normalization);
273  }
274  //check that event analyzed != 0 might happen oline
275  if (evtNumber) {
276  // set the # of events analyzed until this update
277  LogVerbatim("DTNoiseTask") << " Update for events: " << evtNumber << endl;
278  mapEvt[chId] = evtNumber;
279  // update the rate
280  normalization = double(1e-9 * upperLimit * evtNumber);
281  noise_root->Scale(1. / normalization);
282  }
283  }
284 }
Log< level::Info, true > LogVerbatim
std::map< DTChamberId, int > mapEvt
Definition: DTNoiseTask.h:86
double safeMargin
Definition: DTNoiseTask.h:94
std::map< DTChamberId, double > tTrigStMap
Definition: DTNoiseTask.h:80
std::map< DTChamberId, MonitorElement * > noiseHistos
Definition: DTNoiseTask.h:83

Member Data Documentation

◆ doSegmentVeto

bool DTNoiseTask::doSegmentVeto
private

Definition at line 72 of file DTNoiseTask.h.

Referenced by analyze(), and DTNoiseTask().

◆ doTimeBoxHistos

bool DTNoiseTask::doTimeBoxHistos
private

Definition at line 68 of file DTNoiseTask.h.

Referenced by analyze(), bookHistograms(), and DTNoiseTask().

◆ dtDigiToken_

edm::EDGetTokenT<DTDigiCollection> DTNoiseTask::dtDigiToken_
private

Definition at line 64 of file DTNoiseTask.h.

Referenced by analyze(), and DTNoiseTask().

◆ dtGeom

const DTGeometry* DTNoiseTask::dtGeom
private

Definition at line 75 of file DTNoiseTask.h.

Referenced by bookHistograms(), bookHistos(), and dqmBeginRun().

◆ evtNumber

int DTNoiseTask::evtNumber
private

Definition at line 66 of file DTNoiseTask.h.

Referenced by analyze(), and endLuminosityBlock().

◆ mapEvt

std::map<DTChamberId, int> DTNoiseTask::mapEvt
private

Definition at line 86 of file DTNoiseTask.h.

Referenced by analyze(), and endLuminosityBlock().

◆ muonGeomToken_

edm::ESGetToken<DTGeometry, MuonGeometryRecord> DTNoiseTask::muonGeomToken_
private

Definition at line 74 of file DTNoiseTask.h.

Referenced by dqmBeginRun().

◆ nEventMonitor

MonitorElement* DTNoiseTask::nEventMonitor
private

Definition at line 91 of file DTNoiseTask.h.

Referenced by analyze(), and bookHistograms().

◆ noiseHistos

std::map<DTChamberId, MonitorElement*> DTNoiseTask::noiseHistos
private

Definition at line 83 of file DTNoiseTask.h.

Referenced by analyze(), bookHistos(), and endLuminosityBlock().

◆ recHits4DToken_

edm::EDGetTokenT<DTRecSegment4DCollection> DTNoiseTask::recHits4DToken_
private

Definition at line 70 of file DTNoiseTask.h.

Referenced by analyze(), and DTNoiseTask().

◆ safeMargin

double DTNoiseTask::safeMargin
private

Definition at line 94 of file DTNoiseTask.h.

Referenced by analyze(), DTNoiseTask(), and endLuminosityBlock().

◆ tbHistos

std::map<DTSuperLayerId, MonitorElement*> DTNoiseTask::tbHistos
private

Definition at line 89 of file DTNoiseTask.h.

Referenced by analyze(), and bookHistos().

◆ tTrigMap

const DTTtrig* DTNoiseTask::tTrigMap
private

Definition at line 77 of file DTNoiseTask.h.

Referenced by bookHistograms(), and dqmBeginRun().

◆ tTrigMapToken_

edm::ESGetToken<DTTtrig, DTTtrigRcd> DTNoiseTask::tTrigMapToken_
private

Definition at line 76 of file DTNoiseTask.h.

Referenced by dqmBeginRun().

◆ tTrigStMap

std::map<DTChamberId, double> DTNoiseTask::tTrigStMap
private

Definition at line 80 of file DTNoiseTask.h.

Referenced by analyze(), bookHistograms(), and endLuminosityBlock().