40 edm::LogVerbatim(
"DTDQM|DTMonitorModule|DTSegmentAnalysisTask") <<
"[DTSegmentAnalysisTask] Constructor called!";
66 edm::LogVerbatim(
"DTDQM|DTMonitorModule|DTSegmentAnalysisTask") <<
"[DTSegmentAnalysisTask] Destructor called!";
82 for (
int wh = -2; wh <= 2; wh++) {
86 string histoName =
"numberOfSegments_W" + wheel.str();
88 summaryHistos[wh] = ibooker.
book2D(histoName.c_str(), histoName.c_str(), 12, 1, 13, 4, 1, 5);
110 vector<const DTChamber*>::const_iterator ch_it = chambers.begin();
111 vector<const DTChamber*>::const_iterator ch_end = chambers.end();
112 for (; ch_it != ch_end; ++ch_it) {
117 int modeTimeHisto = 0;
121 for (
int sector = 1; sector <= 12; ++sector) {
123 stringstream wheelstr;
125 stringstream sectorstr;
127 string sectorHistoName =
"NSegmPerEvent_W" + wheelstr.str() +
"_Sec" + sectorstr.str();
128 string sectorHistoTitle =
"# segm. W" + wheelstr.str() +
" Sect." + sectorstr.str();
151 <<
"[DTSegmentAnalysisTask] Analyze #Run: " <<
event.id().run() <<
" #Event: " <<
event.id().event();
152 if (!(event.
id().
event() % 1000))
154 <<
"[DTSegmentAnalysisTask] Analyze #Run: " <<
event.id().run() <<
" #Event: " <<
event.id().event();
172 for (chamberId = all4DSegments->id_begin(); chamberId != all4DSegments->id_end(); ++chamberId) {
177 <<
" Chamber: " << *chamberId <<
" has " <<
distance(range.first, range.second) <<
" 4D segments";
182 bool segmNoisy =
false;
184 if ((*segment4D).hasPhi()) {
187 map<DTSuperLayerId, vector<DTRecHit1D> > hitsBySLMap;
188 for (vector<DTRecHit1D>::const_iterator
hit = phiHits.begin();
hit != phiHits.end(); ++
hit) {
192 bool isNoisy =
false;
193 bool isFEMasked =
false;
194 bool isTDCMasked =
false;
195 bool isTrigMask =
false;
198 statusMap->
cellStatus(wireId, isNoisy, isFEMasked, isTDCMasked, isTrigMask, isDead, isNohv);
201 <<
"Wire: " << wireId <<
" is noisy, skipping!";
207 if ((*segment4D).hasZed()) {
211 for (vector<DTRecHit1D>::const_iterator
hit = zHits.begin();
hit != zHits.end(); ++
hit) {
213 bool isNoisy =
false;
214 bool isFEMasked =
false;
215 bool isTDCMasked =
false;
216 bool isTrigMask =
false;
219 statusMap->
cellStatus(wireId, isNoisy, isFEMasked, isTDCMasked, isTrigMask, isDead, isNohv);
222 <<
"Wire: " << wireId <<
" is noisy, skipping!";
231 <<
"skipping the segment: it contains noisy cells";
237 if ((*segment4D).hasPhi())
238 nHits = (((*segment4D).phiSegment())->specificRecHits()).
size();
239 if ((*segment4D).hasZed())
240 nHits = nHits + ((((*segment4D).zSegment())->specificRecHits()).
size());
242 double anglePhiSegm(0.);
243 if ((*segment4D).hasPhi()) {
244 double xdir = (*segment4D).phiSegment()->localDirection().x();
245 double zdir = (*segment4D).phiSegment()->localDirection().z();
247 anglePhiSegm = atan(xdir / zdir) * 180. /
TMath::Pi();
253 if (fabs((*chamberId).wheel()) == 2 && (*chamberId).station() == 1) {
257 DTChamberId checkMB((*chamberId).wheel(), mb, (*chamberId).sector());
263 if ((*cksegment4D).hasPhi())
264 nHits = (((*cksegment4D).phiSegment())->specificRecHits()).
size();
265 if ((*cksegment4D).hasZed())
266 nHits = nHits + ((((*cksegment4D).zSegment())->specificRecHits()).
size());
277 fillHistos(*chamberId, nHits, (*segment4D).chi2() / (*segment4D).degreesOfFreedom());
286 edm::LogVerbatim(
"DTDQM|DTMonitorModule|DTSegmentAnalysisTask") <<
" Booking histos for chamber: " << chamberId;
290 wheel << chamberId.
wheel();
292 station << chamberId.
station();
294 sector << chamberId.
sector();
296 string chamberHistoName =
"_W" + wheel.str() +
"_St" + station.str() +
"_Sec" + sector.str();
302 vector<MonitorElement*>
histos;
303 histos.push_back(ibooker.
book1D(
"h4DSegmNHits" + chamberHistoName,
"# of hits per segment", 16, 0.5, 16.5));
305 histos.push_back(ibooker.
book1D(
"h4DChi2" + chamberHistoName,
"4D Segment reduced Chi2", 20, 0, 20));
312 int sector = chamberId.
sector();
313 if (chamberId.
sector() == 13) {
315 }
else if (chamberId.
sector() == 14) {
323 histos[0]->Fill(nHits);
325 histos[1]->Fill(chi2);
333 for (
int sector = 1; sector <= 12; ++sector) {
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX)
T getParameter(std::string const &) const
EventNumber_t event() const
void fillHistos(DTChamberId chamberId, int nHits, float chi2)
T getUntrackedParameter(std::string const &, T const &) const
const std::vector< const DTChamber * > & chambers() const
Return a vector of all Chamber.
std::pair< const_iterator, const_iterator > range
iterator range
MonitorElement * bookFloat(TString const &name)
void setCurrentFolder(std::string const &fullpath)
void analyze(const edm::Event &event, const edm::EventSetup &setup) override
DTTimeEvolutionHisto * hNevtPerLS
std::map< DTChamberId, std::vector< MonitorElement * > > histosPerCh
LuminosityBlockNumber_t luminosityBlock() const
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
C::const_iterator const_iterator
constant access iterator type
void beginLuminosityBlock(edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &eSetup) override
Summary.
~DTSegmentAnalysisTask() override
Destructor.
void bookHistos(DQMStore::IBooker &ibooker, DTChamberId chamberId)
edm::ESHandle< DTGeometry > dtGeom
std::vector< DTRecHit1D > specificRecHits() const
Access to specific components.
int cellStatus(int wheelId, int stationId, int sectorId, int slId, int layerId, int cellId, bool &noiseFlag, bool &feMask, bool &tdcMask, bool &trigMask, bool &deadFlag, bool &nohvFlag) const
get content
void updateTimeSlot(int ls, int nEventsInLS)
MonitorElement * nEventMonitor
std::map< int, std::map< int, DTTimeEvolutionHisto * > > histoTimeEvol
void dqmBeginRun(const edm::Run &, const edm::EventSetup &) override
BeginRun.
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
std::map< int, MonitorElement * > summaryHistos
int station() const
Return the station number.
static char chambers[264][20]
edm::EDGetTokenT< DTRecSegment4DCollection > recHits4DToken_
int wheel() const
Return the wheel number.
void endLuminosityBlock(edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &eSetup) override
DTSegmentAnalysisTask(const edm::ParameterSet &pset)
Constructor.
std::string topHistoFolder