40 edm::LogVerbatim (
"DTDQM|DTMonitorModule|DTResolutionAnalysisTask") <<
"[DTResolutionAnalysisTask] Constructor called!" << endl;
43 theRecHits4DLabel = pset.
getParameter<
string>(
"recHits4DLabel");
58 edm::LogVerbatim (
"DTDQM|DTMonitorModule|DTResolutionAnalysisTask") <<
"[DTResolutionAnalysisTask] Destructor called!" << endl;
72 vector<DTChamber*>
chambers = dtGeom->chambers();
73 for(vector<DTChamber*>::const_iterator chamber = chambers.begin();
74 chamber != chambers.end(); ++chamber) {
76 for(
int sl = 1; sl <= 3; ++sl) {
77 if(dtChId.
station() == 4 && sl == 2)
continue;
91 edm::LogVerbatim (
"DTDQM|DTMonitorModule|DTResolutionAnalysisTask") <<
"[DTResolutionTask]: Begin of LS transition"<<endl;
95 histo != histosPerSL.end();
97 int size = (*histo).second.size();
99 (*histo).second[
i]->Reset();
108 edm::LogVerbatim (
"DTDQM|DTMonitorModule|DTResolutionAnalysisTask") <<
"[DTResolutionAnalysisTask] endjob called!"<<endl;
116 edm::LogVerbatim (
"DTDQM|DTMonitorModule|DTResolutionAnalysisTask") <<
"[DTResolutionAnalysisTask] Analyze #Run: " <<
event.id().run()
117 <<
" #Event: " <<
event.id().event() << endl;
122 event.getByLabel(theRecHits4DLabel, all4DSegments);
125 if(!all4DSegments.
isValid())
return;
129 for (chamberId = all4DSegments->id_begin();
130 chamberId != all4DSegments->id_end();
138 const DTChamber* chamber = dtGeom->chamber(*chamberId);
142 segment4D!=range.second;
148 if((*chamberId).station() != 4 && (*segment4D).dimension() != 4) {
149 edm::LogVerbatim (
"DTDQM|DTMonitorModule|DTResolutionAnalysisTask") <<
"[DTResolutionAnalysisTask]***Warning: RecSegment dimension is not 4 but "
150 << (*segment4D).dimension() <<
"!" << endl;
152 }
else if((*chamberId).station() == 4 && (*segment4D).dimension() != 2) {
153 edm::LogVerbatim (
"DTDQM|DTMonitorModule|DTResolutionAnalysisTask") <<
"[DTResolutionAnalysisTask]***Warning: RecSegment dimension is not 2 but "
154 << (*segment4D).dimension() <<
"!" << endl;
160 vector<DTRecHit1D> recHits1D_S3;
166 if((*segment4D).hasPhi()) {
170 if(phiRecHits.size() < thePhiHitsCut) {
175 copy(phiRecHits.begin(), phiRecHits.end(), back_inserter(recHits1D_S3));
180 if((*segment4D).hasZed()) {
183 if(zRecHits.size() < theZHitsCut) {
188 copy(zRecHits.begin(), zRecHits.end(), back_inserter(recHits1D_S3));
192 for(vector<DTRecHit1D>::const_iterator recHit1D = recHits1D_S3.begin();
193 recHit1D != recHits1D_S3.end();
195 const DTWireId wireId = (*recHit1D).wireId();
202 float distRecHitToWire = fabs(wireX - (*recHit1D).localPosition().x());
207 LocalPoint wirePosInLay(wireX,(*recHit1D).localPosition().y(),(*recHit1D).localPosition().z());
212 LocalPoint segPosAtZWire = (*segment4D).localPosition()
213 + (*segment4D).localDirection()*wirePosInChamber.
z()/
cos((*segment4D).localDirection().theta());
218 double distSegmToWire = -1;
219 if(sl == 1 || sl == 3) {
221 distSegmToWire = fabs(wirePosInChamber.
x() - segPosAtZWire.
x());
224 distSegmToWire = fabs(wirePosInChamber.
y() - segPosAtZWire.
y());
227 if(distSegmToWire > 2.1)
228 edm::LogVerbatim (
"DTDQM|DTMonitorModule|DTResolutionAnalysisTask") <<
" Warning: dist segment-wire: " << distSegmToWire << endl;
230 double residual = distRecHitToWire - distSegmToWire;
232 fillHistos(wireId.
superlayerId(), distSegmToWire, residual);
249 edm::LogVerbatim (
"DTDQM|DTMonitorModule|DTResolutionAnalysisTask") <<
" Booking histos for SL: " << slId << endl;
252 stringstream wheel; wheel << slId.
wheel();
254 stringstream sector; sector << slId.
sector();
255 stringstream superLayer; superLayer << slId.
superlayer();
260 "_St" + station.str() +
261 "_Sec" + sector.str() +
262 "_SL" + superLayer.str();
264 theDbe->setCurrentFolder(topHistoFolder +
"/Wheel" + wheel.str() +
265 "/Sector" + sector.str() +
266 "/Station" + station.str());
268 vector<MonitorElement *>
histos;
270 histos.push_back(theDbe->book1D(
"hResDist"+slHistoName,
271 "Residuals on the distance from wire (rec_hit - segm_extr) (cm)",
277 histosPerSL[slId] =
histos;
285 vector<MonitorElement *>
histos = histosPerSL[slId];
286 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)
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")
virtual ~DTResolutionAnalysisTask()
Destructor.
tuple size
Write out results.
const DTSuperLayer * superLayer(DTSuperLayerId id) const
Return the superlayer corresponding to the given id.