107 edm::LogVerbatim (
"DTDQM|DTMonitorModule|DTResolutionAnalysisTask") <<
"[DTResolutionAnalysisTask] Analyze #Run: " <<
event.id().run()
108 <<
" #Event: " <<
event.id().event() << endl;
116 if(!all4DSegments.
isValid())
return;
119 DTRecSegment4DCollection::id_iterator chamberId;
120 for (chamberId = all4DSegments->id_begin();
121 chamberId != all4DSegments->id_end();
131 segment4D!=range.second;
136 if((*chamberId).station() != 4 && (*segment4D).dimension() != 4) {
137 edm::LogVerbatim (
"DTDQM|DTMonitorModule|DTResolutionAnalysisTask") <<
"[DTResolutionAnalysisTask]***Warning: RecSegment dimension is not 4 but " 138 << (*segment4D).dimension() <<
"!" << endl;
140 }
else if((*chamberId).station() == 4 && (*segment4D).dimension() != 2) {
141 edm::LogVerbatim (
"DTDQM|DTMonitorModule|DTResolutionAnalysisTask") <<
"[DTResolutionAnalysisTask]***Warning: RecSegment dimension is not 2 but " 142 << (*segment4D).dimension() <<
"!" << endl;
148 vector<DTRecHit1D> recHits1D_S3;
154 if((*segment4D).hasPhi()) {
161 copy(phiRecHits.begin(), phiRecHits.end(), back_inserter(recHits1D_S3));
166 if((*segment4D).hasZed()) {
173 copy(zRecHits.begin(), zRecHits.end(), back_inserter(recHits1D_S3));
177 for(vector<DTRecHit1D>::const_iterator recHit1D = recHits1D_S3.begin();
178 recHit1D != recHits1D_S3.end();
180 const DTWireId wireId = (*recHit1D).wireId();
187 float distRecHitToWire = fabs(wireX - (*recHit1D).localPosition().x());
192 LocalPoint wirePosInLay(wireX,(*recHit1D).localPosition().y(),(*recHit1D).localPosition().z());
197 LocalPoint segPosAtZWire = (*segment4D).localPosition()
198 + (*segment4D).localDirection()*wirePosInChamber.
z()/
cos((*segment4D).localDirection().theta());
203 double distSegmToWire = -1;
204 if(sl == 1 || sl == 3) {
206 distSegmToWire = fabs(wirePosInChamber.
x() - segPosAtZWire.
x());
209 distSegmToWire = fabs(wirePosInChamber.
y() - segPosAtZWire.
y());
212 if(distSegmToWire > 2.1)
213 edm::LogVerbatim (
"DTDQM|DTMonitorModule|DTResolutionAnalysisTask") <<
" Warning: dist segment-wire: " << distSegmToWire << endl;
215 double residual = distRecHitToWire - distSegmToWire;
const DTSuperLayer * superLayer(const DTSuperLayerId &id) const
Return the superlayer corresponding to the given id.
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
const DTChamber * chamber(const DTChamberId &id) const
Return a DTChamber given its id.
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