25 debug =
pset.getUntrackedParameter<
bool>(
"debug",
false);
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;
105 vector<MonitorElement*>
histos;
117 "hEffGoodSegVsPosDen" +
HistoName,
"Eff vs local position (good) ", 25, -250., 250., 25, -250., 250.));
120 "Eff vs local position (good and close segs) ",
129 ibooker.
book1D(
"hDistSegFromExtrap" +
HistoName,
"Distance segments from extrap position ", 200, 0., 200.));
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.));
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) {
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());
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)
Log< level::Info, true > LogVerbatim
int station() const
Return the station number.
edm::EDGetTokenT< DTRecSegment4DCollection > recHits4DToken_
LuminosityBlockNumber_t luminosityBlock() const
T getParameter(std::string const &) const
std::pair< const_iterator, const_iterator > range
iterator range
Point3DBase< Scalar, LocalTag > LocalPoint
edm::ParameterSet parameters
bool hasPhi() const
Does it have the Phi projection?
virtual void setCurrentFolder(std::string const &fullpath)
virtual DTChamberId chamberId() const
The (specific) DetId of the chamber on which the segment resides.
LocalPoint interpolate(const DTRecSegment4D &seg1, const DTRecSegment4D &seg3, const DTChamberId &MB2) const
void dqmBeginRun(const edm::Run &run, const edm::EventSetup &setup) override
BeginRun.
LocalPoint localPosition() const override
Local position in Chamber frame.
const DTSLRecSegment2D * zSegment() const
The Z segment: 0 if not zed projection available.
edm::ESGetToken< DTGeometry, MuonGeometryRecord > muonGeomToken_
T getUntrackedParameter(std::string const &, T const &) const
edm::Handle< DTRecSegment4DCollection > segs
~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
std::vector< const TrackingRecHit * > recHits() const override
Access to component RecHits (if any)
Basic3DVector unit() const
DTChamberEfficiencyTask(const edm::ParameterSet &pset)
Constructor.
LocalVector toLocal(const reco::Track::Vector &v, const Surface &s)
const DTRecSegment4D & getBestSegment(const DTRecSegment4DCollection::range &segs) const
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
const DTChamberRecSegment2D * phiSegment() const
The superPhi segment: 0 if no phi projection available.
LuminosityBlockID id() 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())
int degreesOfFreedom() const override
Degrees of freedom of the segment fit.
bool isGoodSegment(const DTRecSegment4D &seg) const
int wheel() const
Return the wheel number.
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
bool hasZed() const
Does it have the Z projection?
void bookHistos(DQMStore::IBooker &ibooker, DTChamberId chId)
const DTChamber * chamber(const DTChamberId &id) const
Return a DTChamber given its id.
double theMinChi2NormSegment
double chi2() const override
Chi2 of the segment fit.
unsigned int theMinHitsSegment