27 edm::LogVerbatim(
"DTDQM|DTMonitorModule|DTChamberEfficiencyTask") <<
"[DTChamberEfficiencyTask] Constructor called!";
49 edm::LogVerbatim(
"DTDQM|DTMonitorModule|DTChamberEfficiencyTask") <<
"[DTChamberEfficiencyTask] Destructor called!";
54 <<
"[DTChamberEfficiencyTask]: Begin of LS transition";
60 int size = (*histo).second.size();
61 for (
int i = 0;
i <
size;
i++) {
62 (*histo).second[
i]->Reset();
79 vector<const DTChamber*>::const_iterator ch_it =
dtGeom->
chambers().begin();
80 vector<const DTChamber*>::const_iterator ch_end =
dtGeom->
chambers().end();
81 for (; ch_it != ch_end; ++ch_it) {
89 edm::LogVerbatim(
"DTDQM|DTMonitorModule|DTChamberEfficiencyTask") <<
" Booking histos for CH : " << chId;
93 wheel << chId.
wheel();
99 string HistoName =
"_W" + wheel.str() +
"_St" + station.str() +
"_Sec" + sector.str();
101 ibooker.
setCurrentFolder(
"DT/01-DTChamberEfficiency/Task/Wheel" + wheel.str() +
"/Sector" + sector.str() +
102 "/Station" + station.str());
105 vector<MonitorElement*>
histos;
116 histos.push_back(ibooker.
book2D(
117 "hEffGoodSegVsPosDen" + HistoName,
"Eff vs local position (good) ", 25, -250., 250., 25, -250., 250.));
119 histos.push_back(ibooker.
book2D(
"hEffGoodCloseSegVsPosNum" + HistoName,
120 "Eff vs local position (good and close segs) ",
129 ibooker.
book1D(
"hDistSegFromExtrap" + HistoName,
"Distance segments from extrap position ", 200, 0., 200.));
131 histos.push_back(ibooker.
book1D(
"hNaiveEffSeg" + HistoName,
"Naive eff ", 10, 0., 10.));
133 histos.push_back(ibooker.
book2D(
134 "hEffSegVsPosDen" + HistoName,
"Eff vs local position (all) ", 25, -250., 250., 25, -250., 250.));
137 ibooker.
book2D(
"hEffSegVsPosNum" + HistoName,
"Eff vs local position ", 25, -250., 250., 25, -250., 250.));
139 histos.push_back(ibooker.
book2D(
140 "hEffGoodSegVsPosNum" + HistoName,
"Eff vs local position (good segs) ", 25, -250., 250., 25, -250., 250.));
147 <<
"[DTChamberEfficiencyTask] Analyze #Run: " <<
event.id().run() <<
" #Event: " <<
event.id().event();
152 int bottom = 0, top = 0;
155 vector<const DTChamber*>::const_iterator ch_it =
dtGeom->
chambers().begin();
156 vector<const DTChamber*>::const_iterator ch_end =
dtGeom->
chambers().end();
157 for (; ch_it != ch_end; ++ch_it) {
159 int wheel = ch.
wheel();
195 int nSegsBot = segsBot.second - segsBot.first;
204 int nSegsTop = segsTop.second - segsTop.first;
217 int nSegsTop14 = segsTop14.second - segsTop14.first;
218 nSegsTop += nSegsTop14;
230 int nSegsMid = segsMid.second - segsMid.first;
246 histos[4]->Fill(posAtMid.
x(), posAtMid.
y());
248 if ((
dtGeom->
chamber(MidId))->surface().bounds().inside(posAtMid)) {
249 histos[0]->Fill(posAtMid.
x(), posAtMid.
y());
253 histos[5]->Fill(posAtMid.
x(), posAtMid.
y());
260 histos[6]->Fill(posAtMid.
x(), posAtMid.
y());
265 if (bestMidSeg.
hasPhi()) {
267 dist = (midSegPos - posAtMid).
mag();
269 dist = fabs((midSegPos - posAtMid).
x());
272 dist = fabs((midSegPos - posAtMid).
y());
275 histos[1]->Fill(posAtMid.
x(), posAtMid.
y());
278 histos[2]->Fill(dist);
289 unsigned int nHitBest = 0;
290 double chi2Best = 99999.;
292 unsigned int nHits = ((*seg).hasPhi() ? (*seg).phiSegment()->recHits().size() : 0);
293 nHits += ((*seg).hasZed() ? (*seg).zSegment()->recHits().size() : 0);
295 if (nHits == nHitBest) {
296 if ((*seg).chi2() / (*seg).degreesOfFreedom() < chi2Best) {
297 chi2Best = (*seg).chi2() / (*seg).degreesOfFreedom();
300 }
else if (nHits > nHitBest) {
320 if (nHits1 == nHits2) {
325 }
else if (nHits1 > nHits2)
LuminosityBlockID id() const
Log< level::Info, true > LogVerbatim
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< DTRecSegment4DCollection > recHits4DToken_
const std::vector< const DTChamber * > & chambers() const
Return a vector of all Chamber.
std::pair< const_iterator, const_iterator > range
iterator range
Point3DBase< Scalar, LocalTag > LocalPoint
edm::ParameterSet parameters
virtual void setCurrentFolder(std::string const &fullpath)
const DTChamber * chamber(const DTChamberId &id) const
Return a DTChamber given its id.
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
const DTChamberRecSegment2D * phiSegment() const
The superPhi segment: 0 if no phi projection available.
virtual DTChamberId chamberId() const
The (specific) DetId of the chamber on which the segment resides.
void dqmBeginRun(const edm::Run &run, const edm::EventSetup &setup) override
BeginRun.
LocalPoint localPosition() const override
Local position in Chamber frame.
edm::ESGetToken< DTGeometry, MuonGeometryRecord > muonGeomToken_
edm::Handle< DTRecSegment4DCollection > segs
bool getData(T &iHolder) const
~DTChamberEfficiencyTask() override
Destructor.
C::const_iterator const_iterator
constant access iterator type
const DTGeometry * dtGeom
void beginLuminosityBlock(edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &context) override
To reset the MEs.
void analyze(const edm::Event &event, const edm::EventSetup &setup) override
LocalPoint interpolate(const DTRecSegment4D &seg1, const DTRecSegment4D &seg3, const DTChamberId &MB2) const
std::vector< const TrackingRecHit * > recHits() const override
Access to component RecHits (if any)
bool hasPhi() const
Does it have the Phi projection?
DTChamberEfficiencyTask(const edm::ParameterSet &pset)
Constructor.
LocalVector toLocal(const reco::Track::Vector &v, const Surface &s)
bool hasZed() const
Does it have the Z projection?
const DTSLRecSegment2D * zSegment() const
The Z segment: 0 if not zed projection available.
bool isGoodSegment(const DTRecSegment4D &seg) const
std::map< DTChamberId, std::vector< MonitorElement * > > histosPerCh
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
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
LuminosityBlockNumber_t luminosityBlock() const
const DTRecSegment4D & getBestSegment(const DTRecSegment4DCollection::range &segs) 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 degreesOfFreedom() const override
Degrees of freedom of the segment fit.
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.
int wheel() const
Return the wheel number.
void bookHistos(DQMStore::IBooker &ibooker, DTChamberId chId)
tuple size
Write out results.
double theMinChi2NormSegment
double chi2() const override
Chi2 of the segment fit.
Basic3DVector unit() const
unsigned int theMinHitsSegment