114 edm::LogVerbatim (
"DTDQM|DTMonitorModule|DTResolutionAnalysisTask") <<
"[DTResolutionAnalysisTask] Analyze #Run: " <<
event.id().run()
115 <<
" #Event: " <<
event.id().event() << endl;
123 if(!all4DSegments.
isValid())
return;
126 DTRecSegment4DCollection::id_iterator chamberId;
127 for (chamberId = all4DSegments->id_begin();
128 chamberId != all4DSegments->id_end();
140 segment4D!=range.second;
146 if((*chamberId).station() != 4 && (*segment4D).dimension() != 4) {
147 edm::LogVerbatim (
"DTDQM|DTMonitorModule|DTResolutionAnalysisTask") <<
"[DTResolutionAnalysisTask]***Warning: RecSegment dimension is not 4 but "
148 << (*segment4D).dimension() <<
"!" << endl;
150 }
else if((*chamberId).station() == 4 && (*segment4D).dimension() != 2) {
151 edm::LogVerbatim (
"DTDQM|DTMonitorModule|DTResolutionAnalysisTask") <<
"[DTResolutionAnalysisTask]***Warning: RecSegment dimension is not 2 but "
152 << (*segment4D).dimension() <<
"!" << endl;
158 vector<DTRecHit1D> recHits1D_S3;
164 if((*segment4D).hasPhi()) {
173 copy(phiRecHits.begin(), phiRecHits.end(), back_inserter(recHits1D_S3));
178 if((*segment4D).hasZed()) {
186 copy(zRecHits.begin(), zRecHits.end(), back_inserter(recHits1D_S3));
190 for(vector<DTRecHit1D>::const_iterator recHit1D = recHits1D_S3.begin();
191 recHit1D != recHits1D_S3.end();
193 const DTWireId wireId = (*recHit1D).wireId();
200 float distRecHitToWire = fabs(wireX - (*recHit1D).localPosition().x());
205 LocalPoint wirePosInLay(wireX,(*recHit1D).localPosition().y(),(*recHit1D).localPosition().z());
210 LocalPoint segPosAtZWire = (*segment4D).localPosition()
211 + (*segment4D).localDirection()*wirePosInChamber.
z()/
cos((*segment4D).localDirection().theta());
216 double distSegmToWire = -1;
217 if(sl == 1 || sl == 3) {
219 distSegmToWire = fabs(wirePosInChamber.
x() - segPosAtZWire.
x());
222 distSegmToWire = fabs(wirePosInChamber.
y() - segPosAtZWire.
y());
225 if(distSegmToWire > 2.1)
226 edm::LogVerbatim (
"DTDQM|DTMonitorModule|DTResolutionAnalysisTask") <<
" Warning: dist segment-wire: " << distSegmToWire << endl;
228 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.
const DTTopology & specificTopology() const
Cos< T >::type cos(const T &t)
edm::EDGetTokenT< DTRecSegment4DCollection > recHits4DToken_
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)
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.