113 edm::LogVerbatim (
"DTDQM|DTMonitorModule|DTResolutionAnalysisTask") <<
"[DTResolutionAnalysisTask] Analyze #Run: " <<
event.id().run()
114 <<
" #Event: " <<
event.id().event() << endl;
122 if(!all4DSegments.
isValid())
return;
126 for (chamberId = all4DSegments->id_begin();
127 chamberId != all4DSegments->id_end();
139 segment4D!=range.second;
145 if((*chamberId).station() != 4 && (*segment4D).dimension() != 4) {
146 edm::LogVerbatim (
"DTDQM|DTMonitorModule|DTResolutionAnalysisTask") <<
"[DTResolutionAnalysisTask]***Warning: RecSegment dimension is not 4 but "
147 << (*segment4D).dimension() <<
"!" << endl;
149 }
else if((*chamberId).station() == 4 && (*segment4D).dimension() != 2) {
150 edm::LogVerbatim (
"DTDQM|DTMonitorModule|DTResolutionAnalysisTask") <<
"[DTResolutionAnalysisTask]***Warning: RecSegment dimension is not 2 but "
151 << (*segment4D).dimension() <<
"!" << endl;
157 vector<DTRecHit1D> recHits1D_S3;
163 if((*segment4D).hasPhi()) {
167 if(phiRecHits.size() != 8) {
172 copy(phiRecHits.begin(), phiRecHits.end(), back_inserter(recHits1D_S3));
177 if((*segment4D).hasZed()) {
180 if(zRecHits.size() != 4) {
185 copy(zRecHits.begin(), zRecHits.end(), back_inserter(recHits1D_S3));
189 for(vector<DTRecHit1D>::const_iterator recHit1D = recHits1D_S3.begin();
190 recHit1D != recHits1D_S3.end();
192 const DTWireId wireId = (*recHit1D).wireId();
199 float distRecHitToWire = fabs(wireX - (*recHit1D).localPosition().x());
204 LocalPoint wirePosInLay(wireX,(*recHit1D).localPosition().y(),(*recHit1D).localPosition().z());
209 LocalPoint segPosAtZWire = (*segment4D).localPosition()
210 + (*segment4D).localDirection()*wirePosInChamber.
z()/
cos((*segment4D).localDirection().theta());
215 double distSegmToWire = -1;
216 if(sl == 1 || sl == 3) {
218 distSegmToWire = fabs(wirePosInChamber.
x() - segPosAtZWire.
x());
221 distSegmToWire = fabs(wirePosInChamber.
y() - segPosAtZWire.
y());
224 if(distSegmToWire > 2.1)
225 edm::LogVerbatim (
"DTDQM|DTMonitorModule|DTResolutionAnalysisTask") <<
" Warning: dist segment-wire: " << distSegmToWire << endl;
227 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.