35 edm::LogVerbatim(
"DTDQM|DTMonitorModule|DTSegmentAnalysisTask") <<
"[DTSegmentAnalysisTask] Constructor called!";
54 edm::LogVerbatim(
"DTDQM|DTMonitorModule|DTSegmentAnalysisTask") <<
"[DTSegmentAnalysisTask] Destructor called!";
70 for (
int wh = -2; wh <= 2; wh++) {
74 string histoName =
"numberOfSegments_W" + wheel.str();
76 summaryHistos[wh] = ibooker.
book2D(histoName.c_str(), histoName.c_str(), 12, 1, 13, 4, 1, 5);
98 vector<const DTChamber*>::const_iterator ch_it = chambers.begin();
99 vector<const DTChamber*>::const_iterator ch_end = chambers.end();
100 for (; ch_it != ch_end; ++ch_it) {
110 <<
"[DTSegmentAnalysisTask] Analyze #Run: " <<
event.id().run() <<
" #Event: " <<
event.id().event();
111 if (!(event.
id().
event() % 1000))
113 <<
"[DTSegmentAnalysisTask] Analyze #Run: " <<
event.id().run() <<
" #Event: " <<
event.id().event();
130 for (chamberId = all4DSegments->id_begin(); chamberId != all4DSegments->id_end(); ++chamberId) {
135 <<
" Chamber: " << *chamberId <<
" has " <<
distance(range.first, range.second) <<
" 4D segments";
140 bool segmNoisy =
false;
142 if ((*segment4D).hasPhi()) {
145 map<DTSuperLayerId, vector<DTRecHit1D> > hitsBySLMap;
146 for (vector<DTRecHit1D>::const_iterator
hit = phiHits.begin();
hit != phiHits.end(); ++
hit) {
150 bool isNoisy =
false;
151 bool isFEMasked =
false;
152 bool isTDCMasked =
false;
153 bool isTrigMask =
false;
156 statusMap->
cellStatus(wireId, isNoisy, isFEMasked, isTDCMasked, isTrigMask, isDead, isNohv);
159 <<
"Wire: " << wireId <<
" is noisy, skipping!";
165 if ((*segment4D).hasZed()) {
169 for (vector<DTRecHit1D>::const_iterator
hit = zHits.begin();
hit != zHits.end(); ++
hit) {
171 bool isNoisy =
false;
172 bool isFEMasked =
false;
173 bool isTDCMasked =
false;
174 bool isTrigMask =
false;
177 statusMap->
cellStatus(wireId, isNoisy, isFEMasked, isTDCMasked, isTrigMask, isDead, isNohv);
180 <<
"Wire: " << wireId <<
" is noisy, skipping!";
189 <<
"skipping the segment: it contains noisy cells";
195 if ((*segment4D).hasPhi())
196 nHits = (((*segment4D).phiSegment())->specificRecHits()).
size();
197 if ((*segment4D).hasZed())
198 nHits = nHits + ((((*segment4D).zSegment())->specificRecHits()).
size());
200 double anglePhiSegm(0.);
201 if ((*segment4D).hasPhi()) {
202 double xdir = (*segment4D).phiSegment()->localDirection().x();
203 double zdir = (*segment4D).phiSegment()->localDirection().z();
205 anglePhiSegm = atan(xdir / zdir) * 180. /
TMath::Pi();
211 if (fabs((*chamberId).wheel()) == 2 && (*chamberId).station() == 1) {
215 DTChamberId checkMB((*chamberId).wheel(), mb, (*chamberId).sector());
221 if ((*cksegment4D).hasPhi())
222 nHits = (((*cksegment4D).phiSegment())->specificRecHits()).
size();
223 if ((*cksegment4D).hasZed())
224 nHits = nHits + ((((*cksegment4D).zSegment())->specificRecHits()).
size());
235 fillHistos(*chamberId, nHits, (*segment4D).chi2() / (*segment4D).degreesOfFreedom());
244 edm::LogVerbatim(
"DTDQM|DTMonitorModule|DTSegmentAnalysisTask") <<
" Booking histos for chamber: " << chamberId;
248 wheel << chamberId.
wheel();
250 station << chamberId.
station();
252 sector << chamberId.
sector();
254 string chamberHistoName =
"_W" + wheel.str() +
"_St" + station.str() +
"_Sec" + sector.str();
260 vector<MonitorElement*>
histos;
261 histos.push_back(ibooker.
book1D(
"h4DSegmNHits" + chamberHistoName,
"# of hits per segment", 16, 0.5, 16.5));
263 histos.push_back(ibooker.
book1D(
"h4DChi2" + chamberHistoName,
"4D Segment reduced Chi2", 20, 0, 20));
270 int sector = chamberId.
sector();
271 if (chamberId.
sector() == 13) {
273 }
else if (chamberId.
sector() == 14) {
280 histos[0]->Fill(nHits);
282 histos[1]->Fill(chi2);
Log< level::Info, true > LogVerbatim
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.
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
const uint16_t range(const Frame &aFrame)
bool getData(T &iHolder) const
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)
std::vector< DTRecHit1D > specificRecHits() const
Access to specific components.
const DTStatusFlag * statusMap
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
caConstants::TupleMultiplicity const CAHitNtupletGeneratorKernelsGPU::HitToTuple const cms::cuda::AtomicPairCounter GPUCACell const *__restrict__ uint32_t const *__restrict__ gpuPixelDoublets::CellNeighborsVector const gpuPixelDoublets::CellTracksVector const GPUCACell::OuterHitOfCell const int32_t nHits
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
MonitorElement * nEventMonitor
void dqmBeginRun(const edm::Run &, const edm::EventSetup &) override
BeginRun.
std::map< int, MonitorElement * > summaryHistos
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.
static char chambers[264][20]
edm::EDGetTokenT< DTRecSegment4DCollection > recHits4DToken_
int wheel() const
Return the wheel number.
tuple size
Write out results.
DTSegmentAnalysisTask(const edm::ParameterSet &pset)
Constructor.
std::string topHistoFolder