|
|
Go to the documentation of this file.
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;
101 ibooker.
setCurrentFolder(
"DT/01-DTChamberEfficiency/Task/Wheel" +
wheel.str() +
"/Sector" + sector.str() +
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;
212 pBestTopSeg = const_cast<DTRecSegment4D*>(&
getBestSegment(segsTop));
217 int nSegsTop14 = segsTop14.second - segsTop14.first;
218 nSegsTop += nSegsTop14;
222 pBestTopSeg = const_cast<DTRecSegment4D*>(
getBestSegment(pBestTopSeg, pBestTopSeg14));
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)
edm::ParameterSet parameters
edm::EDGetTokenT< DTRecSegment4DCollection > recHits4DToken_
double theMinChi2NormSegment
edm::ESGetToken< DTGeometry, MuonGeometryRecord > muonGeomToken_
virtual DTChamberId chamberId() const
The (specific) DetId of the chamber on which the segment resides.
virtual void setCurrentFolder(std::string const &fullpath)
T getUntrackedParameter(std::string const &, T const &) const
Point3DBase< Scalar, LocalTag > LocalPoint
LocalPoint localPosition() const override
Local position in Chamber frame.
const DTSLRecSegment2D * zSegment() const
The Z segment: 0 if not zed projection available.
const DTChamber * chamber(const DTChamberId &id) const
Return a DTChamber given its id.
void dqmBeginRun(const edm::Run &run, const edm::EventSetup &setup) override
BeginRun.
~DTChamberEfficiencyTask() override
Destructor.
std::vector< const TrackingRecHit * > recHits() const override
Access to component RecHits (if any)
LocalPoint interpolate(const DTRecSegment4D &seg1, const DTRecSegment4D &seg3, const DTChamberId &MB2) const
const caConstants::TupleMultiplicity *__restrict__ const HitsOnGPU *__restrict__ double *__restrict__ float *__restrict__ double *__restrict__ uint32_t nHits
const std::vector< const DTChamber * > & chambers() const
Return a vector of all Chamber.
edm::Handle< DTRecSegment4DCollection > segs
void beginLuminosityBlock(edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &context) override
To reset the MEs.
int degreesOfFreedom() const override
Degrees of freedom of the segment fit.
std::map< DTChamberId, std::vector< MonitorElement * > > histosPerCh
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
void analyze(const edm::Event &event, const edm::EventSetup &setup) override
const DTRecSegment4D & getBestSegment(const DTRecSegment4DCollection::range &segs) const
const DTGeometry * dtGeom
C::const_iterator const_iterator
constant access iterator type
LuminosityBlockNumber_t luminosityBlock() const
LuminosityBlockID id() const
LocalVector toLocal(const reco::Track::Vector &v, const Surface &s)
Basic3DVector unit() const
bool isGoodSegment(const DTRecSegment4D &seg) const
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
std::pair< const_iterator, const_iterator > range
iterator range
bool hasZed() const
Does it have the Z projection?
DTChamberEfficiencyTask(const edm::ParameterSet &pset)
Constructor.
void bookHistos(DQMStore::IBooker &ibooker, DTChamberId chId)
Log< level::Info, true > LogVerbatim
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
double chi2() const override
Chi2 of the segment fit.
T getParameter(std::string const &) const
bool hasPhi() const
Does it have the Phi projection?
unsigned int theMinHitsSegment
const DTChamberRecSegment2D * phiSegment() const
The superPhi segment: 0 if no phi projection available.
int wheel() const
Return the wheel number.
int station() const
Return the station number.
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())