40 edm::LogVerbatim (
"DTDQM|DTMonitorModule|DTChamberEfficiencyTask") <<
"[DTChamberEfficiencyTask] Constructor called!";
45 theDbe->setCurrentFolder(
"DT/DTChamberEfficiencyTask");
54 edm::LogVerbatim (
"DTDQM|DTMonitorModule|DTChamberEfficiencyTask") <<
"[DTChamberEfficiencyTask] Destructor called!";
61 theRecHits4DLabel =
parameters.getParameter<
string>(
"recHits4DLabel");
64 theMinHitsSegment =
static_cast<unsigned int>(
parameters.getParameter<
int>(
"minHitsSegment"));
65 theMinChi2NormSegment =
parameters.getParameter<
double>(
"minChi2NormSegment");
67 theMinCloseDist =
parameters.getParameter<
double>(
"minCloseDist");
70 onlineMonitor =
parameters.getUntrackedParameter<
bool>(
"onlineMonitor");
80 edm::LogVerbatim (
"DTDQM|DTMonitorModule|DTChamberEfficiencyTask")<<
"[DTChamberEfficiencyTask]: Begin of LS transition";
83 for(
map<
DTChamberId, vector<MonitorElement*> > ::const_iterator
histo = histosPerCh.begin();
84 histo != histosPerCh.end();
86 int size = (*histo).second.size();
88 (*histo).second[
i]->Reset();
102 vector<DTChamber*>::const_iterator ch_it = dtGeom->chambers().begin();
103 vector<DTChamber*>::const_iterator ch_end = dtGeom->chambers().end();
104 for (; ch_it != ch_end; ++ch_it) {
115 edm::LogVerbatim (
"DTDQM|DTMonitorModule|DTChamberEfficiencyTask")<<
"[DTChamberEfficiencyTask] endjob called!";
123 edm::LogVerbatim (
"DTDQM|DTMonitorModule|DTChamberEfficiencyTask") <<
" Booking histos for CH : " << chId;
126 stringstream wheel; wheel << chId.
wheel();
128 stringstream sector; sector << chId.
sector();
132 "_St" + station.str() +
133 "_Sec" + sector.str();
135 theDbe->setCurrentFolder(
"DT/01-DTChamberEfficiency/Task/Wheel" + wheel.str() +
136 "/Sector" + sector.str() +
137 "/Station" + station.str());
140 vector<MonitorElement *>
histos;
152 histos.push_back(theDbe->book2D(
"hEffGoodSegVsPosDen"+HistoName,
"Eff vs local position (good) ",25,-250.,250., 25,-250.,250.));
154 histos.push_back(theDbe->book2D(
"hEffGoodCloseSegVsPosNum"+HistoName,
"Eff vs local position (good and close segs) ", 25,-250.,250., 25,-250.,250.));
156 histos.push_back(theDbe->book1D(
"hDistSegFromExtrap"+HistoName,
"Distance segments from extrap position ",200,0.,200.));
158 histos.push_back(theDbe->book1D(
"hNaiveEffSeg"+HistoName,
"Naive eff ",10,0.,10.));
160 histos.push_back(theDbe->book2D(
"hEffSegVsPosDen"+HistoName,
"Eff vs local position (all) ",25,-250.,250., 25,-250.,250.));
162 histos.push_back(theDbe->book2D(
"hEffSegVsPosNum"+HistoName,
"Eff vs local position ",25,-250.,250., 25,-250.,250.));
164 histos.push_back(theDbe->book2D(
"hEffGoodSegVsPosNum"+HistoName,
"Eff vs local position (good segs) ", 25,-250.,250., 25,-250.,250.));
166 histosPerCh[chId] =
histos;
172 edm::LogVerbatim (
"DTDQM|DTMonitorModule|DTChamberEfficiencyTask") <<
"[DTChamberEfficiencyTask] Analyze #Run: " <<
event.id().run()
173 <<
" #Event: " <<
event.id().event();
176 event.getByLabel(theRecHits4DLabel, segs);
182 vector<DTChamber*>::const_iterator ch_it = dtGeom->chambers().begin();
183 vector<DTChamber*>::const_iterator ch_end = dtGeom->chambers().end();
184 for (; ch_it != ch_end; ++ch_it) {
187 int wheel = ch.
wheel();
224 int nSegsBot=segsBot.second-segsBot.first;
226 if (nSegsBot==0)
continue;
228 vector<MonitorElement *>
histos = histosPerCh[MidId];
232 int nSegsTop=segsTop.second-segsTop.first;
240 pBestTopSeg =
const_cast<DTRecSegment4D*
>(&getBestSegment(segsTop));
245 int nSegsTop14=segsTop14.second-segsTop14.first;
246 nSegsTop+=nSegsTop14;
250 pBestTopSeg =
const_cast<DTRecSegment4D*
>(getBestSegment(pBestTopSeg, pBestTopSeg14));
253 if (!pBestTopSeg)
continue;
257 int nSegsMid=segsMid.second-segsMid.first;
262 if (nSegsMid>0) histos[3]->Fill(1);
270 if (isGoodSegment(bestBotSeg) && isGoodSegment(bestTopSeg)) {
272 histos[4]->Fill(posAtMid.
x(),posAtMid.
y());
274 if ((dtGeom->chamber(MidId))->surface().bounds().inside(posAtMid)) {
275 histos[0]->Fill(posAtMid.
x(),posAtMid.
y());
280 histos[5]->Fill(posAtMid.
x(),posAtMid.
y());
285 if (isGoodSegment(bestMidSeg)) {
288 histos[6]->Fill(posAtMid.
x(),posAtMid.
y());
293 if (bestMidSeg.
hasPhi()) {
295 dist = (midSegPos-posAtMid).
mag();
297 dist = fabs((midSegPos-posAtMid).
x());
300 dist = fabs((midSegPos-posAtMid).
y());
302 if (dist < theMinCloseDist ) {
303 histos[1]->Fill(posAtMid.
x(),posAtMid.
y());
306 histos[2]->Fill(dist);
321 unsigned int nHitBest=0;
322 double chi2Best=99999.;
324 seg!=segs.second ; ++seg ) {
325 unsigned int nHits= ((*seg).hasPhi() ? (*seg).phiSegment()->recHits().size() : 0 ) ;
326 nHits+= ((*seg).hasZed() ? (*seg).zSegment()->recHits().size() : 0 );
328 if (nHits==nHitBest) {
329 if ((*seg).chi2()/(*seg).degreesOfFreedom() < chi2Best ) {
330 chi2Best=(*seg).
chi2()/(*seg).degreesOfFreedom();
334 else if (nHits>nHitBest) {
353 if (nHits1==nHits2) {
359 else if (nHits1>nHits2)
return s1;
399 return ( nHits >= theMinHitsSegment &&
LuminosityBlockID id() const
T getUntrackedParameter(std::string const &, T const &) const
std::pair< const_iterator, const_iterator > range
iterator range
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.
virtual int degreesOfFreedom() const
Degrees of freedom of the segment fit.
void bookHistos(DTChamberId chId)
C::const_iterator const_iterator
constant access iterator type
void analyze(const edm::Event &event, const edm::EventSetup &setup)
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
virtual std::vector< const TrackingRecHit * > recHits() const
Access to component RecHits (if any)
LocalPoint interpolate(const DTRecSegment4D &seg1, const DTRecSegment4D &seg3, const DTChamberId &MB2) const
bool hasPhi() const
Does it have the Phi projection?
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
virtual LocalPoint localPosition() const
Local position in Chamber frame.
DTChamberEfficiencyTask(const edm::ParameterSet &pset)
Constructor.
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
LuminosityBlockNumber_t luminosityBlock() const
const DTRecSegment4D & getBestSegment(const DTRecSegment4DCollection::range &segs) const
LocalVector toLocal(const reco::Track::Vector &v, const Surface &s)
void beginRun(const edm::Run &run, const edm::EventSetup &setup)
BeginRun.
virtual ~DTChamberEfficiencyTask()
Destructor.
virtual double chi2() const
Chi2 of the segment fit.
int station() const
Return the station number.
int wheel() const
Return the wheel number.
tuple size
Write out results.
void beginLuminosityBlock(edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &context)
To reset the MEs.