144 double xresid_low,
xresid_high,
xmean_low,
xmean_high,
xstdev_low,
xstdev_high,
xerronmean_low,
xerronmean_high,
yresid_low,
yresid_high,
ymean_low,
ymean_high,
ystdev_low,
ystdev_high,
yerronmean_low,
yerronmean_high;
202 for (
const auto& iter:
pMuon()->DTChambers()) chambers.push_back(iter);
203 for (
const auto& iter:
pMuon()->CSCChambers()) chambers.push_back(iter);
205 for (
const auto&
chamber: chambers) {
206 int id =
chamber->geomDetId().rawId();
219 m_sumnumx =
book1D(
"/iterN/",
"numx",
"number of x hits", chambers.size(), 0.5, chambers.size() + 0.5);
220 m_sumnumy =
book1D(
"/iterN/",
"numy",
"number of y hits", chambers.size(), 0.5, chambers.size() + 0.5);
221 m_xsummary =
book1D(
"/iterN/",
"xsummary",
"summary of x means and errors (mm vertical axis)", chambers.size(), 0.5, chambers.size() + 0.5);
222 m_ysummary =
book1D(
"/iterN/",
"ysummary",
"summary of y means and errors (mm vertical axis)", chambers.size(), 0.5, chambers.size() + 0.5);
568 for (ConstTrajTrackPairCollection::const_iterator it = tracks.begin(); it != tracks.end(); ++it) {
572 std::vector<TrajectoryMeasurement> measurements = traj->
measurements();
574 for (std::vector<TrajectoryMeasurement>::const_iterator im = measurements.begin(); im != measurements.end(); ++im) {
589 if (localAPE.valid()) {
591 hitErr.
xy() - localAPE.xy(),
592 hitErr.
yy() - localAPE.yy());
595 double x_residual = 10. * (trackPos.
x() - hitPos.
x());
596 double y_residual = 10. * (trackPos.
y() - hitPos.
y());
597 double x_reserr2 = 100. * (trackErr.
xx() + hitErr.
xx());
598 double y_reserr2 = 100. * (trackErr.
yy() + hitErr.
yy());
605 y_residual = x_residual;
606 y_reserr2 = x_reserr2;
616 if (x_reserr2 > 0.) {
617 m_xresid->Fill(x_residual, 1./x_reserr2);
620 if (y_reserr2 > 0.) {
621 m_yresid->Fill(y_residual, 1./y_reserr2);
626 int rawId = dtId.
rawId();
627 if (x_reserr2 > 0.) {
629 m_x_w[rawId] += 1./x_reserr2;
630 m_x_ww[rawId] += 1./x_reserr2/x_reserr2;
631 m_x_wx[rawId] += x_residual/x_reserr2;
632 m_x_wxx[rawId] += x_residual*x_residual/x_reserr2;
634 if (y_reserr2 > 0.) {
636 m_y_w[rawId] += 1./y_reserr2;
637 m_y_ww[rawId] += 1./y_reserr2/y_reserr2;
638 m_y_wy[rawId] += y_residual/y_reserr2;
639 m_y_wyy[rawId] += y_residual*y_residual/y_reserr2;
643 if (x_reserr2 > 0.) {
646 if (y_reserr2 > 0.) {
650 else if (dtId.
station() == 2) {
651 if (x_reserr2 > 0.) {
654 if (y_reserr2 > 0.) {
658 else if (dtId.
station() == 3) {
659 if (x_reserr2 > 0.) {
662 if (y_reserr2 > 0.) {
666 else if (dtId.
station() == 4) {
667 if (x_reserr2 > 0.) {
670 if (y_reserr2 > 0.) {
675 if (dtId.
wheel() == -2) {
676 if (x_reserr2 > 0.) {
679 if (y_reserr2 > 0.) {
683 else if (dtId.
wheel() == -1) {
684 if (x_reserr2 > 0.) {
687 if (y_reserr2 > 0.) {
691 else if (dtId.
wheel() == 0) {
692 if (x_reserr2 > 0.) {
695 if (y_reserr2 > 0.) {
699 else if (dtId.
wheel() == 1) {
700 if (x_reserr2 > 0.) {
703 if (y_reserr2 > 0.) {
707 else if (dtId.
wheel() == 2) {
708 if (x_reserr2 > 0.) {
711 if (y_reserr2 > 0.) {
718 m_xresid->Fill(x_residual, 1./x_reserr2);
719 m_yresid->Fill(y_residual, 1./y_reserr2);
726 if (x_reserr2 > 0.) {
728 m_x_w[rawId] += 1./x_reserr2;
729 m_x_ww[rawId] += 1./x_reserr2/x_reserr2;
730 m_x_wx[rawId] += x_residual/x_reserr2;
731 m_x_wxx[rawId] += x_residual*x_residual/x_reserr2;
733 if (y_reserr2 > 0.) {
735 m_y_w[rawId] += 1./y_reserr2;
736 m_y_ww[rawId] += 1./y_reserr2/y_reserr2;
737 m_y_wy[rawId] += y_residual/y_reserr2;
738 m_y_wyy[rawId] += y_residual*y_residual/y_reserr2;
745 else if ((cscId.
endcap() == 1? 1: -1)*cscId.
station() == -1 && cscId.
ring() == 1) {
749 else if ((cscId.
endcap() == 1? 1: -1)*cscId.
station() == 1 && cscId.
ring() == 2) {
753 else if ((cscId.
endcap() == 1? 1: -1)*cscId.
station() == -1 && cscId.
ring() == 2) {
757 else if ((cscId.
endcap() == 1? 1: -1)*cscId.
station() == 1 && cscId.
ring() == 3) {
761 else if ((cscId.
endcap() == 1? 1: -1)*cscId.
station() == -1 && cscId.
ring() == 3) {
765 else if ((cscId.
endcap() == 1? 1: -1)*cscId.
station() == 1 && cscId.
ring() == 4) {
769 else if ((cscId.
endcap() == 1? 1: -1)*cscId.
station() == -1 && cscId.
ring() == 4) {
773 else if ((cscId.
endcap() == 1? 1: -1)*cscId.
station() == 2 && cscId.
ring() == 1) {
777 else if ((cscId.
endcap() == 1? 1: -1)*cscId.
station() == -2 && cscId.
ring() == 1) {
781 else if ((cscId.
endcap() == 1? 1: -1)*cscId.
station() == 2 && cscId.
ring() == 2) {
785 else if ((cscId.
endcap() == 1? 1: -1)*cscId.
station() == -2 && cscId.
ring() == 2) {
789 else if ((cscId.
endcap() == 1? 1: -1)*cscId.
station() == 3 && cscId.
ring() == 1) {
793 else if ((cscId.
endcap() == 1? 1: -1)*cscId.
station() == -3 && cscId.
ring() == 1) {
797 else if ((cscId.
endcap() == 1? 1: -1)*cscId.
station() == 3 && cscId.
ring() == 2) {
801 else if ((cscId.
endcap() == 1? 1: -1)*cscId.
station() == -3 && cscId.
ring() == 2) {
805 else if ((cscId.
endcap() == 1? 1: -1)*cscId.
station() == 4 && cscId.
ring() == 1) {
809 else if ((cscId.
endcap() == 1? 1: -1)*cscId.
station() == -4 && cscId.
ring() == 1) {
823 for (
const auto& iter:
pMuon()->DTChambers()) chambers.push_back(iter);
824 for (
const auto& iter:
pMuon()->CSCChambers()) chambers.push_back(iter);
827 for (
const auto&
chamber: chambers) {
828 const int id =
chamber->geomDetId().rawId();
846 std::ostringstream
name;
849 name <<
"MB" << dtId.
wheel() <<
"/" << dtId.station() <<
" (" << dtId.sector() <<
")";
859 name <<
"ME" << (cscId.endcap() == 1?
"+":
"-") << cscId.
station() <<
"/" << cscId.ring() <<
" (" << cscId.chamber() <<
")";
869 m_sumnumx->GetXaxis()->SetBinLabel(index, name.str().c_str());
870 m_sumnumy->GetXaxis()->SetBinLabel(index, name.str().c_str());
871 m_xsummary->GetXaxis()->SetBinLabel(index, name.str().c_str());
872 m_ysummary->GetXaxis()->SetBinLabel(index, name.str().c_str());
877 double xerronmean = xstdev /
sqrt(
m_numx[
id]);
899 if (
id.
wheel() == -2) {
902 else if (
id.
wheel() == -1) {
905 else if (
id.
wheel() == 0) {
908 else if (
id.
wheel() == 1) {
911 else if (
id.
wheel() == 2) {
920 if ((
id.
endcap() == 1? 1: -1)*
id.station() == 1 &&
id.ring() == 1) {
998 double yerronmean = ystdev /
sqrt(
m_numy[
id]);
1020 if (
id.
wheel() == -2) {
1023 else if (
id.
wheel() == -1) {
1026 else if (
id.
wheel() == 0) {
1029 else if (
id.
wheel() == 1) {
1032 else if (
id.
wheel() == 2) {
1041 if ((
id.
endcap() == 1? 1: -1)*
id.station() == 1 &&
id.ring() == 1) {
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
std::map< int, double > m_x_w
T getParameter(std::string const &) const
TH1F * m_xerronmean_mem13
TH1F * m_yerronmean_mep21
AlignableNavigator * pNavigator()
TH1F * m_yerronmean_mem31
virtual const Surface * surface() const
TH1F * m_yerronmean_mem41
TH1F * m_yerronmean_mep13
ConstRecHitPointer const & recHit() const
void afterAlignment() override
TH1F * m_xerronmean_mep21
std::map< int, int > m_numy
TSOS combine(const TSOS &pTsos1, const TSOS &pTsos2) const
unsigned int yerronmean_bins
LocalPoint localPosition() const
TH1F * m_yerronmean_mem32
void book() override
Book or retrieve histograms; MUST be reimplemented.
constexpr uint32_t rawId() const
get the raw id
TH1F * m_yerronmean_mem12
TH1F * m_yerronmean_mep22
TH1F * m_xerronmean_plus1
TH1F * m_xerronmean_mem41
TH1F * m_xerronmean_mep41
LocalError positionError() const
TH1F * m_yerronmean_mep14
TH1F * m_yerronmean_plus2
TH1F * m_xerronmean_mep14
TH1F * m_yerronmean_mep11
std::map< int, double > m_y_ww
TH1F * m_yerronmean_plus1
DataContainer const & measurements() const
TH1F * m_xerronmean_mem31
TH1F * m_yerronmean_mep31
TH1F * m_yerronmean_mep41
TFileDirectory * directory(std::string dir)
std::map< int, double > m_y_wyy
unsigned int xerronmean_bins
TH1F * m_xerronmean_mem21
const GeomDet * det() const
void event(const edm::Event &iEvent, const edm::EventSetup &iSetup, const ConstTrajTrackPairCollection &iTrajTracks) override
Called for each event (by "run()"): may be reimplemented.
CSCDetId chamberId() const
std::map< int, double > m_x_wxx
TH1F * m_yerronmean_mem21
TH1F * m_yerronmean_mem13
T * make(const Args &...args) const
make new ROOT object
TH1F * m_xerronmean_mep32
const LocalTrajectoryError & localError() const
std::vector< ConstTrajTrackPair > ConstTrajTrackPairCollection
std::map< int, double > m_x_wx
virtual LocalPoint localPosition() const =0
TH1F * book1D(std::string dir, std::string name, std::string title, int nchX, double lowX, double highX)
TrajectoryStateOnSurface const & forwardPredictedState() const
Access to forward predicted state (from fitter or builder)
TH1F * m_xerronmean_mep13
TH1F * m_yerronmean_mem22
std::map< int, double > m_y_w
TH1F * m_xerronmean_mep22
TH1F * m_xerronmean_mep31
std::map< int, double > m_y_wy
std::map< int, int > m_numx
TH1F * m_xerronmean_mep12
TH1F * m_xerronmean_mem22
TH1F * m_yerronmean_minus1
TH1F * m_yerronmean_mep32
TH1F * m_yerronmean_mem11
std::vector< Alignable * > Alignables
TH1F * m_xerronmean_plus2
TH1F * m_xerronmean_mem12
TH1F * m_yerronmean_mem14
TH1F * m_xerronmean_minus2
~AlignmentMonitorMuonResiduals() override
#define DEFINE_EDM_PLUGIN(factory, type, name)
AlignmentMonitorMuonResiduals(const edm::ParameterSet &cfg)
DetId geographicalId() const
TH1F * m_yerronmean_minus2
TH1F * m_xerronmean_mem11
virtual LocalError localPositionError() const =0
TH1F * m_xerronmean_mep11
int station() const
Return the station number.
static char chambers[264][20]
bool detAndSubdetInMap(const DetId &detid) const
Given a DetId, returns true if DetIds with this detector and subdetector id are in the map (not neces...
int wheel() const
Return the wheel number.
TH1F * m_yerronmean_mep12
TH1F * m_xerronmean_mem32
LocalError const & localAlignmentError() const
Return local alligment error.
TrajectoryStateOnSurface const & backwardPredictedState() const
Access to backward predicted state (from smoother)
TH1F * m_xerronmean_mem14
std::map< int, double > m_x_ww
TH1F * m_xerronmean_minus1