41 LogVerbatim(
"DTNoiseTask") <<
"[DTNoiseTask]: Constructor" << endl;
70 std::map<DTChamberId, int> segmentsChId;
79 for (chamberId = all4DSegments->id_begin(); chamberId != all4DSegments->id_end(); ++chamberId) {
80 segmentsChId[*chamberId] = 1;
90 for (dtLayerId_It = dtdigis->begin(); dtLayerId_It != dtdigis->end(); ++dtLayerId_It) {
92 digiIt != ((*dtLayerId_It).second).
second;
95 int tdcTime = (*digiIt).countsTDC();
98 tbHistos[(*dtLayerId_It).first.superlayerId()]->Fill(tdcTime);
99 if (tdcTime > upperLimit)
103 if (
doSegmentVeto && segmentsChId.find((*dtLayerId_It).first.superlayerId().chamberId()) != segmentsChId.end())
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()];
115 noise_root->Scale(normalization);
117 int yBin = (*dtLayerId_It).first.layer() + (4 * ((*dtLayerId_It).first.superlayerId().superlayer() - 1));
118 noise_root->Fill((*digiIt).wire(),
yBin);
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;
125 normalization = double(1e-9 * upperLimit *
mapEvt[(*dtLayerId_It).first.superlayerId().chamberId()]);
127 noise_root->Scale(1. / normalization);
128 LogVerbatim(
"DTNoiseTask") <<
" noise rate: " << noise_root->GetBinContent((*digiIt).wire(),
yBin) << endl;
136 wheel << chId.
wheel();
144 "/Sector" + sector.str());
147 string histoName =
string(
"NoiseRate") +
"_W" + wheel.str() +
"_St" + station.str() +
"_Sec" + sector.str();
149 LogVerbatim(
"DTNoiseTask") <<
"[DTNoiseTask]: booking chamber histo:" << endl;
151 <<
"DT/05-Noise/Wheel" + wheel.str() +
153 "/Sector" + sector.str() +
"/"
155 LogVerbatim(
"DTNoiseTask") <<
" histoName " << histoName << endl;
160 const vector<const DTSuperLayer*>& superlayers = dtchamber->
superLayers();
163 for (vector<const DTSuperLayer*>::const_iterator sl = superlayers.begin(); sl != superlayers.end();
165 vector<const DTLayer*>
layers = (*sl)->layers();
166 for (vector<const DTLayer*>::const_iterator lay = layers.begin(); lay != layers.end(); ++lay) {
167 int nWires = (*lay)->specificTopology().channels();
168 if (nWires > nWires_max)
174 ibooker.
book2D(histoName,
"Noise rate (Hz) per channel", nWires_max, 1, nWires_max + 1, 12, 1, 13);
198 stringstream superlayer;
201 ibooker.
setCurrentFolder(
"DT/05-Noise/Wheel" + wheel.str() +
"/Station" + station.str() +
"/Sector" + sector.str());
205 string(
"TimeBox") +
"_W" + wheel.str() +
"_St" + station.str() +
"_Sec" + sector.str() +
"_SL" + superlayer.str();
207 LogVerbatim(
"DTNoiseTask") <<
"[DTNoiseTask]: booking SL histo:" << endl;
209 <<
"DT/05-Noise/Wheel" + wheel.str() +
"/Station" + station.str() +
"/Sector" +
212 LogVerbatim(
"DTNoiseTask") <<
" histoName " << histoName << endl;
214 tbHistos[slId] = ibooker.
book1D(histoName,
"Time Box (TDC counts)", 1000, 0, 6000);
218 LogVerbatim(
"DTNoiseTask") <<
"[DTNoiseTask]: Begin of run" << endl;
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) {
238 vector<const DTSuperLayer*>::const_iterator sl_it = (*ch_it)->superLayers().begin();
239 vector<const DTSuperLayer*>::const_iterator sl_end = (*ch_it)->superLayers().end();
241 for (; sl_it != sl_end; ++sl_it) {
245 float tTrig, tTrigRMS, kFactor;
257 LogVerbatim(
"DTNoiseTask") <<
"[DTNoiseTask]: End LS, update rates in all histos" << endl;
260 for (map<DTChamberId, MonitorElement*>::const_iterator meAndChamber =
noiseHistos.begin();
264 TH2F* noise_root = (*meAndChamber).second->getTH2F();
267 double normalization = 0;
269 LogVerbatim(
"DTNoiseTask") <<
" Ch: " << chId <<
" Last fill: # of events: " <<
mapEvt[chId] << endl;
270 normalization = 1
e-9 * upperLimit *
mapEvt[chId];
272 noise_root->Scale(normalization);
280 normalization = double(1
e-9 * upperLimit *
evtNumber);
281 noise_root->Scale(1. / normalization);
Log< level::Info, true > LogVerbatim
std::map< DTChamberId, int > mapEvt
T getUntrackedParameter(std::string const &, T const &) const
const std::vector< const DTChamber * > & chambers() const
Return a vector of all Chamber.
MonitorElement * bookFloat(TString const &name, FUNC onbooking=NOOP())
const edm::EventSetup & c
std::vector< LayerSetAndLayers > layers(const SeedingLayerSetsHits &sets)
virtual void setCurrentFolder(std::string const &fullpath)
const DTChamber * chamber(const DTChamberId &id) const
Return a DTChamber given its id.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
DTChamberId chamberId() const
Return the corresponding ChamberId.
MonitorElement * nEventMonitor
void dqmBeginRun(const edm::Run &, const edm::EventSetup &) override
bool getData(T &iHolder) const
U second(std::pair< T, U > const &p)
void analyze(const edm::Event &e, const edm::EventSetup &c) override
Analyze.
const std::vector< const DTSuperLayer * > & superLayers() const
Return the superlayers in the chamber.
edm::EDGetTokenT< DTRecSegment4DCollection > recHits4DToken_
void endLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &setup) override
edm::EDGetTokenT< DTDigiCollection > dtDigiToken_
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
std::map< DTSuperLayerId, MonitorElement * > tbHistos
void bookHistos(DQMStore::IBooker &, DTChamberId chId)
int superlayer() const
Return the superlayer number (deprecated method name)
int get(int wheelId, int stationId, int sectorId, int slId, float &tTrig, float &tTrms, float &kFact, DTTimeUnits::type unit) const
get content
std::map< DTChamberId, double > tTrigStMap
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
T getParameter(std::string const &) const
const DTGeometry * dtGeom
std::vector< DigiType >::const_iterator const_iterator
edm::ESGetToken< DTTtrig, DTTtrigRcd > tTrigMapToken_
DTNoiseTask(const edm::ParameterSet &ps)
Constructor.
std::map< DTChamberId, MonitorElement * > noiseHistos
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
int station() const
Return the station number.
int wheel() const
Return the wheel number.
edm::ESGetToken< DTGeometry, MuonGeometryRecord > muonGeomToken_
~DTNoiseTask() override
Destructor.