41 edm::LogVerbatim (
"DTDQM|DTMonitorModule|DTSegmentAnalysisTask") <<
"[DTSegmentAnalysisTask] Constructor called!";
70 edm::LogVerbatim (
"DTDQM|DTMonitorModule|DTSegmentAnalysisTask") <<
"[DTSegmentAnalysisTask] Destructor called!";
88 for(
int wh=-2; wh<=2; wh++){
89 stringstream
wheel; wheel << wh;
91 string histoName =
"numberOfSegments_W" + wheel.str();
115 vector<const DTChamber*>::const_iterator ch_it = chambers.begin();
116 vector<const DTChamber*>::const_iterator ch_end = chambers.end();
117 for (; ch_it != ch_end; ++ch_it) {
122 int modeTimeHisto = 0;
125 for(
int sector = 1; sector <= 12; ++sector) {
127 stringstream wheelstr; wheelstr <<
wheel;
128 stringstream sectorstr; sectorstr << sector;
129 string sectorHistoName =
"NSegmPerEvent_W" + wheelstr.str()
130 +
"_Sec" + sectorstr.str();
131 string sectorHistoTitle =
"# segm. W" + wheelstr.str() +
" Sect." + sectorstr.str();
134 "/Sector" + sectorstr.str());
155 edm::LogVerbatim (
"DTDQM|DTMonitorModule|DTSegmentAnalysisTask") <<
"[DTSegmentAnalysisTask] Analyze #Run: " <<
event.id().run()
156 <<
" #Event: " <<
event.id().event();
158 edm::LogVerbatim (
"DTDQM|DTMonitorModule|DTSegmentAnalysisTask") <<
"[DTSegmentAnalysisTask] Analyze #Run: " <<
event.id().run()
159 <<
" #Event: " <<
event.id().event();
173 if(!all4DSegments.
isValid())
return;
177 for (chamberId = all4DSegments->id_begin();
178 chamberId != all4DSegments->id_end();
183 edm::LogVerbatim (
"DTDQM|DTMonitorModule|DTSegmentAnalysisTask") <<
" Chamber: " << *chamberId <<
" has " <<
distance(range.first, range.second)
188 segment4D!=range.second;
192 bool segmNoisy =
false;
195 if((*segment4D).hasPhi()){
198 map<DTSuperLayerId,vector<DTRecHit1D> > hitsBySLMap;
199 for(vector<DTRecHit1D>::const_iterator
hit = phiHits.begin();
200 hit != phiHits.end(); ++
hit) {
204 bool isNoisy =
false;
205 bool isFEMasked =
false;
206 bool isTDCMasked =
false;
207 bool isTrigMask =
false;
210 statusMap->
cellStatus(wireId, isNoisy, isFEMasked, isTDCMasked, isTrigMask, isDead, isNohv);
212 edm::LogVerbatim (
"DTDQM|DTMonitorModule|DTSegmentAnalysisTask") <<
"Wire: " << wireId <<
" is noisy, skipping!";
218 if((*segment4D).hasZed()) {
222 for(vector<DTRecHit1D>::const_iterator
hit = zHits.begin();
223 hit != zHits.end(); ++
hit) {
225 bool isNoisy =
false;
226 bool isFEMasked =
false;
227 bool isTDCMasked =
false;
228 bool isTrigMask =
false;
231 statusMap->
cellStatus(wireId, isNoisy, isFEMasked, isTDCMasked, isTrigMask, isDead, isNohv);
233 edm::LogVerbatim (
"DTDQM|DTMonitorModule|DTSegmentAnalysisTask") <<
"Wire: " << wireId <<
" is noisy, skipping!";
241 edm::LogVerbatim (
"DTDQM|DTMonitorModule|DTSegmentAnalysisTask")<<
"skipping the segment: it contains noisy cells";
247 if((*segment4D).hasPhi())
248 nHits = (((*segment4D).phiSegment())->specificRecHits()).
size();
249 if((*segment4D).hasZed())
250 nHits = nHits + ((((*segment4D).zSegment())->specificRecHits()).
size());
252 double anglePhiSegm(0.);
253 if( (*segment4D).hasPhi() ) {
254 double xdir = (*segment4D).phiSegment()->localDirection().x();
255 double zdir = (*segment4D).phiSegment()->localDirection().z();
257 anglePhiSegm = atan(xdir/zdir)*180./
TMath::Pi();
259 if( fabs(anglePhiSegm) >
phiSegmCut )
continue;
262 if( fabs((*chamberId).wheel()) == 2 && (*chamberId).station() == 1 ) {
267 DTChamberId checkMB((*chamberId).wheel(),mb,(*chamberId).sector());
271 cksegment4D!=ckrange.second;
275 if((*cksegment4D).hasPhi())
276 nHits = (((*cksegment4D).phiSegment())->specificRecHits()).
size();
277 if((*cksegment4D).hasZed())
278 nHits = nHits + ((((*cksegment4D).zSegment())->specificRecHits()).
size());
280 if( nHits >=
nhitsCut ) segmOk=
true;
286 if( !segmOk )
continue;
291 (*segment4D).chi2()/(*segment4D).degreesOfFreedom());
302 edm::LogVerbatim (
"DTDQM|DTMonitorModule|DTSegmentAnalysisTask") <<
" Booking histos for chamber: " << chamberId;
306 stringstream
wheel; wheel << chamberId.
wheel();
308 stringstream sector; sector << chamberId.
sector();
310 string chamberHistoName =
312 "_St" + station.str() +
313 "_Sec" + sector.str();
316 "/Sector" + sector.str() +
317 "/Station" + station.str());
320 vector<MonitorElement *>
histos;
321 histos.push_back(ibooker.
book1D(
"h4DSegmNHits"+chamberHistoName,
322 "# of hits per segment",
325 histos.push_back(ibooker.
book1D(
"h4DChi2"+chamberHistoName,
326 "4D Segment reduced Chi2",
337 int sector = chamberId.
sector();
338 if(chamberId.
sector()==13) {
340 }
else if(chamberId.
sector()==14) {
348 histos[0]->Fill(nHits);
350 histos[1]->Fill(chi2);
361 for(
int sector = 1; sector <= 12; ++sector) {
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
void analyze(const edm::Event &event, const edm::EventSetup &setup) override
DTTimeEvolutionHisto * hNevtPerLS
def setup(process, global_tag, zero_tesla=False)
std::map< int, MonitorElement * > summaryHistos
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.
void setCurrentFolder(std::string const &fullpath)
~DTSegmentAnalysisTask() override
Destructor.
void bookHistos(DQMStore::IBooker &ibooker, DTChamberId chamberId)
MonitorElement * book1D(Args &&...args)
edm::ESHandle< DTGeometry > dtGeom
std::vector< DTRecHit1D > specificRecHits() const
Access to specific components.
MonitorElement * book2D(Args &&...args)
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 * bookFloat(Args &&...args)
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