35 <<
"[DTResolutionAnalysisTask] Constructor called!" << endl;
43 topHistoFolder =
pset.getUntrackedParameter<
string>(
"topHistoFolder",
"DT/02-Segments");
51 <<
"[DTResolutionAnalysisTask] Destructor called!" << endl;
67 for (
int sl = 1; sl <= 3; ++sl) {
68 if (dtChId.
station() == 4 && sl == 2)
94 <<
"[DTResolutionAnalysisTask] Analyze #Run: " <<
event.id().run() <<
" #Event: " <<
event.id().event() << endl;
106 for (chamberId = all4DSegments->id_begin(); chamberId != all4DSegments->id_end(); ++chamberId) {
117 if ((*chamberId).station() != 4 && (*segment4D).dimension() != 4) {
119 <<
"[DTResolutionAnalysisTask]***Warning: RecSegment dimension is not 4 but " << (*segment4D).dimension()
122 }
else if ((*chamberId).station() == 4 && (*segment4D).dimension() != 2) {
124 <<
"[DTResolutionAnalysisTask]***Warning: RecSegment dimension is not 2 but " << (*segment4D).dimension()
130 vector<DTRecHit1D> recHits1D_S3;
135 if ((*segment4D).hasPhi()) {
142 copy(phiRecHits.begin(), phiRecHits.end(), back_inserter(recHits1D_S3));
146 if ((*segment4D).hasZed()) {
152 copy(zRecHits.begin(), zRecHits.end(), back_inserter(recHits1D_S3));
156 for (vector<DTRecHit1D>::const_iterator recHit1D = recHits1D_S3.begin(); recHit1D != recHits1D_S3.end();
158 const DTWireId wireId = (*recHit1D).wireId();
162 float wireX =
layer->specificTopology().wirePosition(wireId.
wire());
165 float distRecHitToWire = fabs(wireX - (*recHit1D).localPosition().x());
170 LocalPoint wirePosInLay(wireX, (*recHit1D).localPosition().y(), (*recHit1D).localPosition().z());
175 LocalPoint segPosAtZWire = (*segment4D).localPosition() + (*segment4D).localDirection() * wirePosInChamber.
z() /
176 cos((*segment4D).localDirection().theta());
181 double distSegmToWire = -1;
182 if (sl == 1 || sl == 3) {
184 distSegmToWire = fabs(wirePosInChamber.
x() - segPosAtZWire.
x());
185 }
else if (sl == 2) {
187 distSegmToWire = fabs(wirePosInChamber.
y() - segPosAtZWire.
y());
190 if (distSegmToWire > 2.1)
192 <<
" Warning: dist segment-wire: " << distSegmToWire << endl;
194 double residual = distRecHitToWire - distSegmToWire;
206 edm::LogVerbatim(
"DTDQM|DTMonitorModule|DTResolutionAnalysisTask") <<
" Booking histos for SL: " << slId << endl;
215 stringstream superLayer;
218 string slHistoName =
"_W" +
wheel.str() +
"_St" +
station.str() +
"_Sec" + sector.str() +
"_SL" + superLayer.str();
223 vector<MonitorElement*>
histos;
226 "hResDist" + slHistoName,
"Residuals on the distance from wire (rec_hit - segm_extr) (cm)", 200, -0.4, 0.4));
233 histos[0]->Fill(residual);