|
|
#include <DTCalibValidation.h>
|
void | bookHistos (DTSuperLayerId slId, int step) |
|
template<typename type > |
void | compute (const DTGeometry *dtGeom, const DTRecSegment4D &segment, const std::map< DTWireId, std::vector< type > > &recHitsPerWire, int step) |
|
void | fillHistos (DTSuperLayerId slId, float distance, float residualOnDistance, float position, float residualOnPosition, int step) |
|
template<typename type > |
const type * | findBestRecHit (const DTLayer *layer, DTWireId wireId, const std::vector< type > &recHits, const float simHitDist) |
|
std::map< DTWireId, std::vector< DTRecHit1DPair > > | map1DRecHitsPerWire (const DTRecHitCollection *dt1DRecHitPairs) |
|
std::map< DTWireId, std::vector< DTRecHit1D > > | map1DRecHitsPerWire (const DTRecSegment2DCollection *segment2Ds) |
|
std::map< DTWireId, std::vector< DTRecHit1D > > | map1DRecHitsPerWire (const DTRecSegment4DCollection *segment4Ds) |
|
float | recHitDistFromWire (const DTRecHit1D &recHit, const DTLayer *layer) |
|
float | recHitDistFromWire (const DTRecHit1DPair &hitPair, const DTLayer *layer) |
|
float | recHitPosition (const DTRecHit1D &recHit, const DTLayer *layer, const DTChamber *chamber, float segmPos, int sl) |
|
float | recHitPosition (const DTRecHit1DPair &hitPair, const DTLayer *layer, const DTChamber *chamber, float segmPos, int sl) |
|
Analysis on DT residuals to validate the kFactor
- Author
- G. Mila - INFN Torino
Definition at line 39 of file DTCalibValidation.h.
◆ DTCalibValidation()
◆ ~DTCalibValidation()
DTCalibValidation::~DTCalibValidation |
( |
| ) |
|
|
override |
◆ analyze()
◆ bookHistograms()
Implements DQMEDAnalyzer.
Definition at line 374 of file DTCalibValidation.cc.
378 ibooker.setCurrentFolder(
"DT/DTCalibValidation");
383 vector<const DTChamber*>::const_iterator ch_it =
dtGeom->
chambers().begin();
384 vector<const DTChamber*>::const_iterator ch_end =
dtGeom->
chambers().end();
385 for (; ch_it != ch_end; ++ch_it) {
386 vector<const DTSuperLayer*>::const_iterator sl_it = (*ch_it)->superLayers().begin();
387 vector<const DTSuperLayer*>::const_iterator sl_end = (*ch_it)->superLayers().end();
389 for (; sl_it != sl_end; ++sl_it) {
390 slId = (*sl_it)->id();
397 LogTrace(
"DTCalibValidation") <<
" Booking histos for SL: " << slId;
406 stringstream superLayer;
412 string slHistoName =
"_STEP" + Step.str() +
"_W" +
wheel.str() +
"_St" +
station.str() +
"_Sec" + sector.str() +
413 "_SL" + superLayer.str();
415 ibooker.setCurrentFolder(
"DT/DTCalibValidation/Wheel" +
wheel.str() +
"/Station" +
station.str() +
"/Sector" +
418 vector<MonitorElement*>
histos;
420 histos.push_back(ibooker.book1D(
421 "hResDist" + slHistoName,
"Residuals on the distance from wire (rec_hit - segm_extr) (cm)", 200, -0.4, 0.4));
423 ibooker.book2D(
"hResDistVsDist" + slHistoName,
424 "Residuals on the distance (cm) from wire (rec_hit - segm_extr) vs distance (cm)",
432 histos.push_back(ibooker.book1D(
"hResPos" + slHistoName,
433 "Residuals on the position from wire (rec_hit - segm_extr) (cm)",
438 ibooker.book2D(
"hResPosVsPos" + slHistoName,
439 "Residuals on the position (cm) from wire (rec_hit - segm_extr) vs distance (cm)",
References dqm::implementation::IBooker::book1D(), dqm::implementation::IBooker::book2D(), dtNoiseAnalysis_cfi::detailedAnalysis, combine::histos, LogTrace, DTChamberId::sector(), dqm::implementation::NavigatorBase::setCurrentFolder(), DTChamberId::station(), relativeConstraints::station, DTSuperLayerId::superlayer(), DTChamberId::wheel(), and makeMuonMisalignmentScenario::wheel.
◆ bookHistos()
◆ compute()
Definition at line 241 of file DTCalibValidation.cc.
245 bool computeResidual =
true;
248 vector<DTRecHit1D> recHits1D_S3;
255 if (phiRecHits.size() != 8) {
256 LogTrace(
"DTCalibValidation") <<
"[DTCalibValidation] Phi segments has: " << phiRecHits.size()
257 <<
" hits, skipping";
258 computeResidual =
false;
260 copy(phiRecHits.begin(), phiRecHits.end(), back_inserter(recHits1D_S3));
263 LogTrace(
"DTCalibValidation") <<
" [DTCalibValidation] 4D segment has not the phi segment! ";
264 computeResidual =
false;
271 if (zRecHits.size() != 4) {
272 LogTrace(
"DTCalibValidation") <<
"[DTCalibValidation] Theta segments has: " << zRecHits.size()
273 <<
" hits, skipping";
274 computeResidual =
false;
276 copy(zRecHits.begin(), zRecHits.end(), back_inserter(recHits1D_S3));
279 LogTrace(
"DTCalibValidation") <<
" [DTCalibValidation] 4D segment has not the z segment! ";
280 computeResidual =
false;
284 if (!computeResidual)
286 if (computeResidual) {
289 for (vector<DTRecHit1D>::const_iterator recHit1D = recHits1D_S3.begin(); recHit1D != recHits1D_S3.end();
291 const DTWireId wireId = (*recHit1D).wireId();
300 LocalPoint wirePosInLay(wireX, (*recHit1D).localPosition().y(), (*recHit1D).localPosition().z());
311 float SegmDistance = -1;
312 if (sl == 1 || sl == 3) {
314 SegmDistance = fabs(wirePosInChamber.
x() - segPosAtZWire.
x());
315 LogTrace(
"DTCalibValidation") <<
"SegmDistance: " << SegmDistance;
316 }
else if (sl == 2) {
318 SegmDistance = fabs(segPosAtZWire.
y() - wirePosInChamber.
y());
319 LogTrace(
"DTCalibValidation") <<
"SegmDistance: " << SegmDistance;
321 if (SegmDistance > 2.1)
322 LogTrace(
"DTCalibValidation") <<
" Warning: dist segment-wire: " << SegmDistance;
325 if (recHitsPerWire.find(wireId) == recHitsPerWire.end()) {
326 LogTrace(
"DTCalibValidation") <<
" No RecHit found at Step: " <<
step <<
" in cell: " << wireId;
328 const vector<type>&
recHits = recHitsPerWire.at(wireId);
330 <<
" in channel: " << wireId;
338 LogTrace(
"DTCalibValidation") <<
"recHitWireDist: " << recHitWireDist;
341 float residualOnDistance = recHitWireDist - SegmDistance;
342 LogTrace(
"DTCalibValidation") <<
"WireId: " << wireId <<
" ResidualOnDistance: " << residualOnDistance;
343 float residualOnPosition = -1;
344 float recHitPos = -1;
345 if (sl == 1 || sl == 3) {
347 residualOnPosition = recHitPos - segPosAtZWire.
x();
350 residualOnPosition = recHitPos - segPosAtZWire.
y();
352 LogTrace(
"DTCalibValidation") <<
"WireId: " << wireId <<
" ResidualOnPosition: " << residualOnPosition;
355 if (sl == 1 || sl == 3)
359 (wirePosInChamber.
x() - segPosAtZWire.
x()),
366 (wirePosInChamber.
y() - segPosAtZWire.
y()),
References relativeConstraints::chamber, DTGeometry::chamber(), filterCSVwithJSON::copy, funct::cos(), DTRecSegment4D::dimension(), DTGeometry::layer(), DTRecSegment4D::localDirection(), DTRecSegment4D::localPosition(), LogTrace, DTRecSegment4D::phiSegment(), FastTrackerRecHitMaskProducer_cfi::recHits, DTRecSegment2D::specificRecHits(), DTLayer::specificTopology(), DTSuperLayerId::superlayer(), PV3DBase< T, PVType, FrameType >::theta(), GeomDet::toGlobal(), DTWireId::wire(), DTTopology::wirePosition(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), PV3DBase< T, PVType, FrameType >::z(), and DTRecSegment4D::zSegment().
◆ dqmBeginRun()
◆ fillHistos()
void DTCalibValidation::fillHistos |
( |
DTSuperLayerId |
slId, |
|
|
float |
distance, |
|
|
float |
residualOnDistance, |
|
|
float |
position, |
|
|
float |
residualOnPosition, |
|
|
int |
step |
|
) |
| |
|
private |
◆ findBestRecHit()
template<typename type >
const type * DTCalibValidation::findBestRecHit |
( |
const DTLayer * |
layer, |
|
|
DTWireId |
wireId, |
|
|
const std::vector< type > & |
recHits, |
|
|
const float |
simHitDist |
|
) |
| |
|
private |
◆ map1DRecHitsPerWire() [1/3]
◆ map1DRecHitsPerWire() [2/3]
Definition at line 128 of file DTCalibValidation.cc.
129 map<DTWireId, vector<DTRecHit1D> >
ret;
134 vector<DTRecHit1D> component1DHits = (*segment).specificRecHits();
136 for (vector<DTRecHit1D>::const_iterator
hit = component1DHits.begin();
hit != component1DHits.end(); ++
hit) {
137 ret[(*hit).wireId()].push_back(*
hit);
References runTheMatrix::ret.
◆ map1DRecHitsPerWire() [3/3]
◆ recHitDistFromWire() [1/2]
float DTCalibValidation::recHitDistFromWire |
( |
const DTRecHit1D & |
recHit, |
|
|
const DTLayer * |
layer |
|
) |
| |
|
private |
◆ recHitDistFromWire() [2/2]
◆ recHitPosition() [1/2]
float DTCalibValidation::recHitPosition |
( |
const DTRecHit1D & |
recHit, |
|
|
const DTLayer * |
layer, |
|
|
const DTChamber * |
chamber, |
|
|
float |
segmPos, |
|
|
int |
sl |
|
) |
| |
|
private |
◆ recHitPosition() [2/2]
Definition at line 199 of file DTCalibValidation.cc.
207 float recHitPos = -1;
209 if (fabs(hitPosInChamber_left.
x() - segmentPos) < fabs(hitPosInChamber_right.
x() - segmentPos))
210 recHitPos = hitPosInChamber_left.
x();
212 recHitPos = hitPosInChamber_right.
x();
214 if (fabs(hitPosInChamber_left.
y() - segmentPos) < fabs(hitPosInChamber_right.
y() - segmentPos))
215 recHitPos = hitPosInChamber_left.
y();
217 recHitPos = hitPosInChamber_right.
y();
References relativeConstraints::chamber, DTEnums::Left, DTRecHit1DPair::localPosition(), DTEnums::Right, GeomDet::toGlobal(), PV3DBase< T, PVType, FrameType >::x(), and PV3DBase< T, PVType, FrameType >::y().
◆ detailedAnalysis
bool DTCalibValidation::detailedAnalysis |
|
private |
◆ dtGeom
◆ histosPerSL
◆ nevent
int DTCalibValidation::nevent |
|
private |
◆ parameters
◆ recHits1DToken_
◆ rightSegment
int DTCalibValidation::rightSegment |
|
private |
◆ segment2DToken_
◆ segment4DToken_
◆ wrongSegment
int DTCalibValidation::wrongSegment |
|
private |
ret
prodAgent to be discontinued
T const * product() const
int wire() const
Return the wire number.
int dimension() const override
Dimension (in parameter space)
LocalVector localDirection() const override
Local direction in Chamber frame.
T const * product() const
edm::EDGetTokenT< DTRecSegment2DCollection > segment2DToken_
Geom::Theta< T > theta() const
int superlayer() const
Return the superlayer number (deprecated method name)
LocalPoint localPosition() const override
Local position in Chamber frame.
const DTSLRecSegment2D * zSegment() const
The Z segment: 0 if not zed projection available.
const DTChamber * chamber(const DTChamberId &id) const
Return a DTChamber given its id.
void compute(const DTGeometry *dtGeom, const DTRecSegment4D &segment, const std::map< DTWireId, std::vector< type > > &recHitsPerWire, int step)
float wirePosition(int wireNumber) const
Returns the x position in the layer of a given wire number.
DTWireId wireId() const
Return the wireId.
Cos< T >::type cos(const T &t)
edm::ESHandle< DTGeometry > dtGeom
const std::vector< const DTChamber * > & chambers() const
Return a vector of all Chamber.
std::map< DTWireId, std::vector< DTRecHit1DPair > > map1DRecHitsPerWire(const DTRecHitCollection *dt1DRecHitPairs)
void fillHistos(DTSuperLayerId slId, float distance, float residualOnDistance, float position, float residualOnPosition, int step)
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
const DTLayer * layer(const DTLayerId &id) const
Return a layer given its id.
edm::EDGetTokenT< DTRecSegment4DCollection > segment4DToken_
C::const_iterator const_iterator
constant access iterator type
static int position[264][3]
LocalPoint localPosition() const override
std::map< std::pair< DTSuperLayerId, int >, std::vector< MonitorElement * > > histosPerSL
edm::EDGetTokenT< DTRecHitCollection > recHits1DToken_
std::vector< DTRecHit1D > specificRecHits() const
Access to specific components.
const DTTopology & specificTopology() const
const type * findBestRecHit(const DTLayer *layer, DTWireId wireId, const std::vector< type > &recHits, const float simHitDist)
const DTChamberRecSegment2D * phiSegment() const
The superPhi segment: 0 if no phi projection available.
int wheel() const
Return the wheel number.
float recHitDistFromWire(const DTRecHit1DPair &hitPair, const DTLayer *layer)
float recHitPosition(const DTRecHit1DPair &hitPair, const DTLayer *layer, const DTChamber *chamber, float segmPos, int sl)
int station() const
Return the station number.