40 edm::LogVerbatim (
"DTDQM|DTMonitorModule|DTResolutionAnalysisTask") <<
"[DTResolutionAnalysisTask] Constructor called!" << endl;
43 theRecHits4DLabel = pset.
getParameter<
string>(
"recHits4DLabel");
55 edm::LogVerbatim (
"DTDQM|DTMonitorModule|DTResolutionAnalysisTask") <<
"[DTResolutionAnalysisTask] Destructor called!" << endl;
69 vector<DTChamber*>
chambers = dtGeom->chambers();
70 for(vector<DTChamber*>::const_iterator chamber = chambers.begin();
71 chamber != chambers.end(); ++chamber) {
73 for(
int sl = 1; sl <= 3; ++sl) {
74 if(dtChId.
station() == 4 && sl == 2)
continue;
88 edm::LogVerbatim (
"DTDQM|DTMonitorModule|DTResolutionAnalysisTask") <<
"[DTResolutionTask]: Begin of LS transition"<<endl;
92 histo != histosPerSL.end();
94 int size = (*histo).second.size();
96 (*histo).second[
i]->Reset();
105 edm::LogVerbatim (
"DTDQM|DTMonitorModule|DTResolutionAnalysisTask") <<
"[DTResolutionAnalysisTask] endjob called!"<<endl;
113 edm::LogVerbatim (
"DTDQM|DTMonitorModule|DTResolutionAnalysisTask") <<
"[DTResolutionAnalysisTask] Analyze #Run: " <<
event.id().run()
114 <<
" #Event: " <<
event.id().event() << endl;
119 event.getByLabel(theRecHits4DLabel, all4DSegments);
122 if(!all4DSegments.
isValid())
return;
126 for (chamberId = all4DSegments->id_begin();
127 chamberId != all4DSegments->id_end();
135 const DTChamber* chamber = dtGeom->chamber(*chamberId);
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;
229 fillHistos(wireId.
superlayerId(), distSegmToWire, residual);
246 edm::LogVerbatim (
"DTDQM|DTMonitorModule|DTResolutionAnalysisTask") <<
" Booking histos for SL: " << slId << endl;
249 stringstream wheel; wheel << slId.
wheel();
251 stringstream sector; sector << slId.
sector();
252 stringstream superLayer; superLayer << slId.
superlayer();
257 "_St" + station.str() +
258 "_Sec" + sector.str() +
259 "_SL" + superLayer.str();
261 theDbe->setCurrentFolder(
topHistoFolder +
"/Wheel" + wheel.str() +
262 "/Sector" + sector.str() +
263 "/Station" + station.str());
265 vector<MonitorElement *>
histos;
267 histos.push_back(theDbe->book1D(
"hResDist"+slHistoName,
268 "Residuals on the distance from wire (rec_hit - segm_extr) (cm)",
274 histosPerSL[slId] =
histos;
282 vector<MonitorElement *>
histos = histosPerSL[slId];
283 histos[0]->Fill(residual);
LuminosityBlockID id() const
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
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.
static char chambers[TOTALCHAMBERS][20]
DTSuperLayerId superlayerId() const
Return the corresponding SuperLayerId.
void analyze(const edm::Event &event, const edm::EventSetup &setup)
C::const_iterator const_iterator
constant access iterator type
const DTTopology & specificTopology() const
Cos< T >::type cos(const T &t)
void beginRun(const edm::Run &, const edm::EventSetup &)
BeginRun.
void beginLuminosityBlock(edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &context)
To reset the MEs.
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
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)
LuminosityBlockNumber_t luminosityBlock() const
DTLayerId layerId() const
Return the corresponding LayerId.
void fillHistos(DTSuperLayerId slId, float distExtr, float residual)
int station() const
Return the station number.
int wheel() const
Return the wheel number.
DTResolutionAnalysisTask(const edm::ParameterSet &pset)
Constructor.
void bookHistos(DTSuperLayerId slId)
virtual ~DTResolutionAnalysisTask()
Destructor.
tuple size
Write out results.
const DTSuperLayer * superLayer(DTSuperLayerId id) const
Return the superlayer corresponding to the given id.