35 <<
"[DTResolutionAnalysisTask] Constructor called!" << endl;
51 <<
"[DTResolutionAnalysisTask] Destructor called!" << endl;
63 vector<const DTChamber*>
chambers = dtGeom->chambers();
64 for (vector<const DTChamber*>::const_iterator
chamber = chambers.begin();
chamber != chambers.end();
67 for (
int sl = 1; sl <= 3; ++sl) {
68 if (dtChId.
station() == 4 && sl == 2)
78 <<
"[DTResolutionTask]: Begin of LS transition" << endl;
82 histo != histosPerSL.end();
84 int size = (*histo).second.size();
85 for (
int i = 0;
i <
size;
i++) {
86 (*histo).second[
i]->Reset();
94 <<
"[DTResolutionAnalysisTask] Analyze #Run: " <<
event.id().run() <<
" #Event: " <<
event.id().event() << endl;
98 event.getByToken(recHits4DToken_, all4DSegments);
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()) {
139 if (phiRecHits.size() < thePhiHitsCut) {
142 copy(phiRecHits.begin(), phiRecHits.end(), back_inserter(recHits1D_S3));
146 if ((*segment4D).hasZed()) {
149 if (zRecHits.size() < theZHitsCut) {
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();
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;
196 fillHistos(wireId.
superlayerId(), distSegmToWire, residual);
206 edm::LogVerbatim(
"DTDQM|DTMonitorModule|DTResolutionAnalysisTask") <<
" Booking histos for SL: " << slId << endl;
210 wheel << slId.
wheel();
215 stringstream superLayer;
218 string slHistoName =
"_W" + wheel.str() +
"_St" + station.str() +
"_Sec" + sector.str() +
"_SL" + superLayer.str();
223 vector<MonitorElement*>
histos;
225 histos.push_back(ibooker.
book1D(
226 "hResDist" + slHistoName,
"Residuals on the distance from wire (rec_hit - segm_extr) (cm)", 200, -0.4, 0.4));
227 histosPerSL[slId] =
histos;
232 vector<MonitorElement*>
histos = histosPerSL[slId];
233 histos[0]->Fill(residual);
LuminosityBlockID id() const
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX)
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
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
void setCurrentFolder(std::string const &fullpath)
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
void beginLuminosityBlock(edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &context) override
To reset the MEs.
LocalPoint toLocal(const GlobalPoint &gp) const
Conversion to the R.F. of the GeomDet.
~DTResolutionAnalysisTask() override
Destructor.
DTSuperLayerId superlayerId() const
Return the corresponding SuperLayerId.
void analyze(const edm::Event &event, const edm::EventSetup &setup) override
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)
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
BookHistograms.
LuminosityBlockNumber_t luminosityBlock() const
DTLayerId layerId() const
Return the corresponding LayerId.
void bookHistos(DQMStore::IBooker &ibooker, DTSuperLayerId slId)
void dqmBeginRun(const edm::Run &, const edm::EventSetup &) override
BeginRun.
void fillHistos(DTSuperLayerId slId, float distExtr, float residual)
int station() const
Return the station number.
static char chambers[264][20]
int wheel() const
Return the wheel number.
DTResolutionAnalysisTask(const edm::ParameterSet &pset)
Constructor.