35 edm::LogVerbatim(
"DTDQM|DTMonitorModule|DTSegmentAnalysisTask") <<
"[DTSegmentAnalysisTask] Constructor called!";
41 consumes<DTRecSegment4DCollection>(
edm::InputTag(
pset.getUntrackedParameter<
string>(
"recHits4DLabel")));
44 phiSegmCut =
pset.getUntrackedParameter<
double>(
"phiSegmCut", 30.);
45 nhitsCut =
pset.getUntrackedParameter<
int>(
"nhitsCut", 12);
48 topHistoFolder =
pset.getUntrackedParameter<
string>(
"topHistoFolder",
"DT/02-Segments");
50 hltDQMMode =
pset.getUntrackedParameter<
bool>(
"hltDQMMode",
false);
55 edm::LogVerbatim(
"DTDQM|DTMonitorModule|DTSegmentAnalysisTask") <<
"[DTSegmentAnalysisTask] Destructor called!";
71 for (
int wh = -2; wh <= 2; wh++) {
99 vector<const DTChamber*>::const_iterator ch_it =
chambers.begin();
100 vector<const DTChamber*>::const_iterator ch_end =
chambers.end();
101 for (; ch_it != ch_end; ++ch_it) {
111 <<
"[DTSegmentAnalysisTask] Analyze #Run: " <<
event.id().run() <<
" #Event: " <<
event.id().event();
112 if (!(
event.id().event() % 1000))
114 <<
"[DTSegmentAnalysisTask] Analyze #Run: " <<
event.id().run() <<
" #Event: " <<
event.id().event();
131 for (chamberId = all4DSegments->id_begin(); chamberId != all4DSegments->id_end(); ++chamberId) {
136 <<
" Chamber: " << *chamberId <<
" has " <<
distance(
range.first,
range.second) <<
" 4D segments";
141 bool segmNoisy =
false;
143 if ((*segment4D).hasPhi()) {
146 map<DTSuperLayerId, vector<DTRecHit1D> > hitsBySLMap;
147 for (vector<DTRecHit1D>::const_iterator
hit = phiHits.begin();
hit != phiHits.end(); ++
hit) {
151 bool isNoisy =
false;
152 bool isFEMasked =
false;
153 bool isTDCMasked =
false;
154 bool isTrigMask =
false;
157 statusMap->
cellStatus(wireId, isNoisy, isFEMasked, isTDCMasked, isTrigMask, isDead, isNohv);
160 <<
"Wire: " << wireId <<
" is noisy, skipping!";
166 if ((*segment4D).hasZed()) {
170 for (vector<DTRecHit1D>::const_iterator
hit = zHits.begin();
hit != zHits.end(); ++
hit) {
172 bool isNoisy =
false;
173 bool isFEMasked =
false;
174 bool isTDCMasked =
false;
175 bool isTrigMask =
false;
178 statusMap->
cellStatus(wireId, isNoisy, isFEMasked, isTDCMasked, isTrigMask, isDead, isNohv);
181 <<
"Wire: " << wireId <<
" is noisy, skipping!";
190 <<
"skipping the segment: it contains noisy cells";
196 if ((*segment4D).hasPhi())
197 nHits = (((*segment4D).phiSegment())->specificRecHits()).
size();
198 if ((*segment4D).hasZed())
199 nHits =
nHits + ((((*segment4D).zSegment())->specificRecHits()).
size());
201 double anglePhiSegm(0.);
202 if ((*segment4D).hasPhi()) {
203 double xdir = (*segment4D).phiSegment()->localDirection().x();
204 double zdir = (*segment4D).phiSegment()->localDirection().z();
212 if (fabs((*chamberId).wheel()) == 2 && (*chamberId).station() == 1) {
216 DTChamberId checkMB((*chamberId).wheel(), mb, (*chamberId).sector());
222 if ((*cksegment4D).hasPhi())
223 nHits = (((*cksegment4D).phiSegment())->specificRecHits()).
size();
224 if ((*cksegment4D).hasZed())
225 nHits =
nHits + ((((*cksegment4D).zSegment())->specificRecHits()).
size());
236 fillHistos(*chamberId,
nHits, (*segment4D).chi2() / (*segment4D).degreesOfFreedom());
245 edm::LogVerbatim(
"DTDQM|DTMonitorModule|DTSegmentAnalysisTask") <<
" Booking histos for chamber: " << chamberId;
255 string chamberHistoName =
"_W" +
wheel.str() +
"_St" +
station.str() +
"_Sec" +
sector.str();
261 vector<MonitorElement*>
histos;
262 histos.push_back(ibooker.
book1D(
"h4DSegmNHits" + chamberHistoName,
"# of hits per segment", 16, 0.5, 16.5));
264 histos.push_back(ibooker.
book1D(
"h4DChi2" + chamberHistoName,
"4D Segment reduced Chi2", 20, 0, 20));
272 if (chamberId.
sector() == 13) {
274 }
else if (chamberId.
sector() == 14) {
Log< level::Info, true > LogVerbatim
int station() const
Return the station number.
void fillHistos(DTChamberId chamberId, int nHits, float chi2)
MonitorElement * bookFloat(TString const &name, FUNC onbooking=NOOP())
std::pair< const_iterator, const_iterator > range
iterator range
const DTGeometry * dtGeom
virtual void setCurrentFolder(std::string const &fullpath)
void analyze(const edm::Event &event, const edm::EventSetup &setup) override
edm::ESGetToken< DTStatusFlag, DTStatusFlagRcd > statusMapToken_
edm::ESGetToken< DTGeometry, MuonGeometryRecord > muonGeomToken_
std::map< DTChamberId, std::vector< MonitorElement * > > histosPerCh
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
C::const_iterator const_iterator
constant access iterator type
~DTSegmentAnalysisTask() override
Destructor.
void bookHistos(DQMStore::IBooker &ibooker, DTChamberId chamberId)
const DTStatusFlag * statusMap
std::vector< DTRecHit1D > specificRecHits() const
Access to specific components.
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
MonitorElement * nEventMonitor
void dqmBeginRun(const edm::Run &, const edm::EventSetup &) override
BeginRun.
int wheel() const
Return the wheel number.
std::map< int, MonitorElement * > summaryHistos
const std::vector< const DTChamber * > & chambers() const
Return a vector of all Chamber.
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
TupleMultiplicity< TrackerTraits > const *__restrict__ uint32_t nHits
static char chambers[264][20]
edm::EDGetTokenT< DTRecSegment4DCollection > recHits4DToken_
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
DTSegmentAnalysisTask(const edm::ParameterSet &pset)
Constructor.
std::string topHistoFolder