116 edm::LogVerbatim (
"DTDQM|DTMonitorModule|DTResolutionAnalysisTask") <<
"[DTResolutionAnalysisTask] Analyze #Run: " <<
event.id().run()
117 <<
" #Event: " <<
event.id().event() << endl;
125 if(!all4DSegments.
isValid())
return;
129 for (chamberId = all4DSegments->id_begin();
130 chamberId != all4DSegments->id_end();
142 segment4D!=range.second;
148 if((*chamberId).station() != 4 && (*segment4D).dimension() != 4) {
149 edm::LogVerbatim (
"DTDQM|DTMonitorModule|DTResolutionAnalysisTask") <<
"[DTResolutionAnalysisTask]***Warning: RecSegment dimension is not 4 but "
150 << (*segment4D).dimension() <<
"!" << endl;
152 }
else if((*chamberId).station() == 4 && (*segment4D).dimension() != 2) {
153 edm::LogVerbatim (
"DTDQM|DTMonitorModule|DTResolutionAnalysisTask") <<
"[DTResolutionAnalysisTask]***Warning: RecSegment dimension is not 2 but "
154 << (*segment4D).dimension() <<
"!" << endl;
160 vector<DTRecHit1D> recHits1D_S3;
166 if((*segment4D).hasPhi()) {
175 copy(phiRecHits.begin(), phiRecHits.end(), back_inserter(recHits1D_S3));
180 if((*segment4D).hasZed()) {
188 copy(zRecHits.begin(), zRecHits.end(), back_inserter(recHits1D_S3));
192 for(vector<DTRecHit1D>::const_iterator recHit1D = recHits1D_S3.begin();
193 recHit1D != recHits1D_S3.end();
195 const DTWireId wireId = (*recHit1D).wireId();
202 float distRecHitToWire = fabs(wireX - (*recHit1D).localPosition().x());
207 LocalPoint wirePosInLay(wireX,(*recHit1D).localPosition().y(),(*recHit1D).localPosition().z());
212 LocalPoint segPosAtZWire = (*segment4D).localPosition()
213 + (*segment4D).localDirection()*wirePosInChamber.
z()/
cos((*segment4D).localDirection().theta());
218 double distSegmToWire = -1;
219 if(sl == 1 || sl == 3) {
221 distSegmToWire = fabs(wirePosInChamber.
x() - segPosAtZWire.
x());
224 distSegmToWire = fabs(wirePosInChamber.
y() - segPosAtZWire.
y());
227 if(distSegmToWire > 2.1)
228 edm::LogVerbatim (
"DTDQM|DTMonitorModule|DTResolutionAnalysisTask") <<
" Warning: dist segment-wire: " << distSegmToWire << endl;
230 double residual = distRecHitToWire - distSegmToWire;
float wirePosition(int wireNumber) const
Returns the x position in the layer of a given wire number.
std::pair< const_iterator, const_iterator > range
iterator range
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
LocalPoint toLocal(const GlobalPoint &gp) const
Conversion to the R.F. of the GeomDet.
DTSuperLayerId superlayerId() const
Return the corresponding SuperLayerId.
C::const_iterator const_iterator
constant access iterator type
const DTTopology & specificTopology() const
Cos< T >::type cos(const T &t)
std::vector< DTRecHit1D > specificRecHits() const
Access to specific components.
int wire() const
Return the wire number.
int superlayer() const
Return the superlayer number (deprecated method name)
std::string theRecHits4DLabel
DTLayerId layerId() const
Return the corresponding LayerId.
void fillHistos(DTSuperLayerId slId, float distExtr, float residual)
edm::ESHandle< DTGeometry > dtGeom
const DTSuperLayer * superLayer(DTSuperLayerId id) const
Return the superlayer corresponding to the given id.