43 LogVerbatim(
"DTNoiseTask") <<
"[DTNoiseTask]: Constructor"<<endl;
79 std::map<DTChamberId, int> segmentsChId;
87 DTRecSegment4DCollection::id_iterator chamberId;
88 for (chamberId = all4DSegments->id_begin();
89 chamberId != all4DSegments->id_end();
91 segmentsChId[*chamberId]=1;
101 for (dtLayerId_It=dtdigis->begin(); dtLayerId_It!=dtdigis->end(); ++dtLayerId_It){
103 digiIt!=((*dtLayerId_It).second).
second; ++digiIt){
106 int tdcTime = (*digiIt).countsTDC();
109 tbHistos[(*dtLayerId_It).first.superlayerId()]->Fill(tdcTime);
110 if(tdcTime>upperLimit)
115 segmentsChId.find((*dtLayerId_It).first.superlayerId().chamberId())!=segmentsChId.end())
120 TH2F* noise_root =
noiseHistos[(*dtLayerId_It).first.superlayerId().chamberId()]->getTH2F();
122 if(
mapEvt.find((*dtLayerId_It).first.superlayerId().chamberId())!=
mapEvt.end()) {
123 LogVerbatim(
"DTNoiseTask") <<
" Last fill: # of events: " 124 <<
mapEvt[(*dtLayerId_It).first.superlayerId().chamberId()]
126 normalization = 1e-9*upperLimit*
mapEvt[(*dtLayerId_It).first.superlayerId().chamberId()];
128 noise_root->Scale(normalization);
130 int yBin=(*dtLayerId_It).first.layer()+(4*((*dtLayerId_It).first.superlayerId().superlayer()-1));
131 noise_root->Fill((*digiIt).wire(),
yBin);
134 LogVerbatim(
"DTNoiseTask") << (*dtLayerId_It).first <<
" wire: " << (*digiIt).wire()
135 <<
" # counts: " << noise_root->GetBinContent((*digiIt).wire(),
yBin)
136 <<
" Time interval: " << upperLimit
137 <<
" # of events: " <<
evtNumber << endl;;
138 normalization = double( 1e-9*upperLimit*
mapEvt[(*dtLayerId_It).first.superlayerId().chamberId()]);
140 noise_root->Scale(1./normalization);
142 << noise_root->GetBinContent((*digiIt).wire(),
yBin) << endl;
152 stringstream sector; sector << chId.
sector();
156 "/Sector" + sector.str());
159 string histoName =
string(
"NoiseRate")
161 +
"_St" + station.str()
162 +
"_Sec" + sector.str() ;
164 LogVerbatim(
"DTNoiseTask") <<
"[DTNoiseTask]: booking chamber histo:"<<endl;
165 LogVerbatim(
"DTNoiseTask") <<
" folder "<<
"DT/05-Noise/Wheel" + wheel.str() +
167 "/Sector" + sector.str() +
"/"<<endl;
168 LogVerbatim(
"DTNoiseTask") <<
" histoName "<<histoName<<endl;
173 const vector<const DTSuperLayer*>& superlayers = dtchamber->
superLayers();
176 for(vector<const DTSuperLayer*>::const_iterator sl = superlayers.begin();
177 sl != superlayers.end(); ++sl) {
178 vector<const DTLayer*>
layers = (*sl)->layers();
179 for(vector<const DTLayer*>::const_iterator lay = layers.begin();
180 lay != layers.end(); ++lay) {
181 int nWires = (*lay)->specificTopology().channels();
182 if(nWires > nWires_max) nWires_max = nWires;
186 noiseHistos[chId] = ibooker.
book2D(histoName,
"Noise rate (Hz) per channel", nWires_max,1, nWires_max+1,12,1,13);
210 stringstream superlayer; superlayer << slId.
superlayer();
213 "/Station" + station.str() +
214 "/Sector" + sector.str());
217 string histoName =
string(
"TimeBox")
219 +
"_St" + station.str()
220 +
"_Sec" + sector.str()
221 +
"_SL" + superlayer.str();
223 LogVerbatim(
"DTNoiseTask") <<
"[DTNoiseTask]: booking SL histo:"<<endl;
224 LogVerbatim(
"DTNoiseTask") <<
" folder "<<
"DT/05-Noise/Wheel" + wheel.str() +
225 "/Station" + station.str() +
226 "/Sector" + sector.str() +
"/" << endl;
227 LogVerbatim(
"DTNoiseTask") <<
" histoName "<<histoName<<endl;
229 tbHistos[slId] = ibooker.
book1D(histoName,
"Time Box (TDC counts)", 1000, 0, 6000);
235 LogVerbatim(
"DTNoiseTask") <<
"[DTNoiseTask]: Begin of run"<<endl;
256 vector<const DTChamber*>::const_iterator ch_it =
dtGeom->
chambers().begin();
257 vector<const DTChamber*>::const_iterator ch_end =
dtGeom->
chambers().end();
258 for (; ch_it != ch_end; ++ch_it) {
262 vector<const DTSuperLayer*>::const_iterator sl_it = (*ch_it)->superLayers().begin();
263 vector<const DTSuperLayer*>::const_iterator sl_end = (*ch_it)->superLayers().end();
265 for(; sl_it != sl_end; ++sl_it) {
269 float tTrig, tTrigRMS,
kFactor;
283 LogVerbatim(
"DTNoiseTask") <<
"[DTNoiseTask]: End LS, update rates in all histos" << endl;
286 for(map<DTChamberId, MonitorElement*>::const_iterator meAndChamber =
noiseHistos.begin();
287 meAndChamber !=
noiseHistos.end(); ++meAndChamber) {
289 TH2F* noise_root = (*meAndChamber).second->getTH2F();
294 LogVerbatim(
"DTNoiseTask") <<
" Ch: " << chId <<
" Last fill: # of events: " <<
mapEvt[chId] << endl;
295 normalization = 1
e-9*upperLimit*
mapEvt[chId];
297 noise_root->Scale(normalization);
305 normalization = double( 1
e-9*upperLimit*
evtNumber);
306 noise_root->Scale(1./normalization);
T getParameter(std::string const &) const
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.
std::vector< LayerSetAndLayers > layers(const SeedingLayerSetsHits &sets)
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.
def setup(process, global_tag, zero_tesla=False)
MonitorElement * nEventMonitor
void dqmBeginRun(const edm::Run &, const edm::EventSetup &) override
U second(std::pair< T, U > const &p)
edm::ESHandle< DTGeometry > dtGeom
void setCurrentFolder(std::string const &fullpath)
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_
edm::ESHandle< DTTtrig > tTrigMap
MonitorElement * book1D(Args &&...args)
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
MonitorElement * book2D(Args &&...args)
std::map< DTChamberId, double > tTrigStMap
std::vector< DTDigi >::const_iterator const_iterator
DTNoiseTask(const edm::ParameterSet &ps)
Constructor.
std::map< DTChamberId, MonitorElement * > noiseHistos
MonitorElement * bookFloat(Args &&...args)
int station() const
Return the station number.
int wheel() const
Return the wheel number.
~DTNoiseTask() override
Destructor.