143 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 (std::vector<Alignable*>::const_iterator iter = tmp1.begin(); iter != tmp1.end(); ++iter) chambers.push_back(*iter);
204 for (std::vector<Alignable*>::const_iterator iter = tmp2.begin(); iter != tmp2.end(); ++iter) chambers.push_back(*iter);
206 for (std::vector<Alignable*>::const_iterator chamber = chambers.begin(); chamber != chambers.end(); ++chamber) {
207 int id = (*chamber)->geomDetId().rawId();
220 m_sumnumx =
book1D(
"/iterN/",
"numx",
"number of x hits", chambers.size(), 0.5, chambers.size() + 0.5);
221 m_sumnumy =
book1D(
"/iterN/",
"numy",
"number of y hits", chambers.size(), 0.5, chambers.size() + 0.5);
222 m_xsummary =
book1D(
"/iterN/",
"xsummary",
"summary of x means and errors (mm vertical axis)", chambers.size(), 0.5, chambers.size() + 0.5);
223 m_ysummary =
book1D(
"/iterN/",
"ysummary",
"summary of y means and errors (mm vertical axis)", chambers.size(), 0.5, chambers.size() + 0.5);
569 for (ConstTrajTrackPairCollection::const_iterator it = tracks.begin(); it != tracks.end(); ++it) {
573 std::vector<TrajectoryMeasurement> measurements = traj->
measurements();
575 for (std::vector<TrajectoryMeasurement>::const_iterator im = measurements.begin(); im != measurements.end(); ++im) {
587 double x_residual = 10. * (trackPos.
x() - hitPos.
x());
588 double y_residual = 10. * (trackPos.
y() - hitPos.
y());
589 double x_reserr2 = 100. * (trackErr.
xx() + hitErr.
xx());
590 double y_reserr2 = 100. * (trackErr.
yy() + hitErr.
yy());
597 y_residual = x_residual;
598 y_reserr2 = x_reserr2;
608 if (x_reserr2 > 0.) {
609 m_xresid->Fill(x_residual, 1./x_reserr2);
612 if (y_reserr2 > 0.) {
613 m_yresid->Fill(y_residual, 1./y_reserr2);
618 int rawId = dtId.
rawId();
619 if (x_reserr2 > 0.) {
621 m_x_w[rawId] += 1./x_reserr2;
622 m_x_ww[rawId] += 1./x_reserr2/x_reserr2;
623 m_x_wx[rawId] += x_residual/x_reserr2;
624 m_x_wxx[rawId] += x_residual*x_residual/x_reserr2;
626 if (y_reserr2 > 0.) {
628 m_y_w[rawId] += 1./y_reserr2;
629 m_y_ww[rawId] += 1./y_reserr2/y_reserr2;
630 m_y_wy[rawId] += y_residual/y_reserr2;
631 m_y_wyy[rawId] += y_residual*y_residual/y_reserr2;
635 if (x_reserr2 > 0.) {
638 if (y_reserr2 > 0.) {
642 else if (dtId.
station() == 2) {
643 if (x_reserr2 > 0.) {
646 if (y_reserr2 > 0.) {
650 else if (dtId.
station() == 3) {
651 if (x_reserr2 > 0.) {
654 if (y_reserr2 > 0.) {
658 else if (dtId.
station() == 4) {
659 if (x_reserr2 > 0.) {
662 if (y_reserr2 > 0.) {
667 if (dtId.
wheel() == -2) {
668 if (x_reserr2 > 0.) {
671 if (y_reserr2 > 0.) {
675 else if (dtId.
wheel() == -1) {
676 if (x_reserr2 > 0.) {
679 if (y_reserr2 > 0.) {
683 else if (dtId.
wheel() == 0) {
684 if (x_reserr2 > 0.) {
687 if (y_reserr2 > 0.) {
691 else if (dtId.
wheel() == 1) {
692 if (x_reserr2 > 0.) {
695 if (y_reserr2 > 0.) {
699 else if (dtId.
wheel() == 2) {
700 if (x_reserr2 > 0.) {
703 if (y_reserr2 > 0.) {
710 m_xresid->Fill(x_residual, 1./x_reserr2);
711 m_yresid->Fill(y_residual, 1./y_reserr2);
718 if (x_reserr2 > 0.) {
720 m_x_w[rawId] += 1./x_reserr2;
721 m_x_ww[rawId] += 1./x_reserr2/x_reserr2;
722 m_x_wx[rawId] += x_residual/x_reserr2;
723 m_x_wxx[rawId] += x_residual*x_residual/x_reserr2;
725 if (y_reserr2 > 0.) {
727 m_y_w[rawId] += 1./y_reserr2;
728 m_y_ww[rawId] += 1./y_reserr2/y_reserr2;
729 m_y_wy[rawId] += y_residual/y_reserr2;
730 m_y_wyy[rawId] += y_residual*y_residual/y_reserr2;
737 else if ((cscId.
endcap() == 1? 1: -1)*cscId.
station() == -1 && cscId.
ring() == 1) {
741 else if ((cscId.
endcap() == 1? 1: -1)*cscId.
station() == 1 && cscId.
ring() == 2) {
745 else if ((cscId.
endcap() == 1? 1: -1)*cscId.
station() == -1 && cscId.
ring() == 2) {
749 else if ((cscId.
endcap() == 1? 1: -1)*cscId.
station() == 1 && cscId.
ring() == 3) {
753 else if ((cscId.
endcap() == 1? 1: -1)*cscId.
station() == -1 && cscId.
ring() == 3) {
757 else if ((cscId.
endcap() == 1? 1: -1)*cscId.
station() == 1 && cscId.
ring() == 4) {
761 else if ((cscId.
endcap() == 1? 1: -1)*cscId.
station() == -1 && cscId.
ring() == 4) {
765 else if ((cscId.
endcap() == 1? 1: -1)*cscId.
station() == 2 && cscId.
ring() == 1) {
769 else if ((cscId.
endcap() == 1? 1: -1)*cscId.
station() == -2 && cscId.
ring() == 1) {
773 else if ((cscId.
endcap() == 1? 1: -1)*cscId.
station() == 2 && cscId.
ring() == 2) {
777 else if ((cscId.
endcap() == 1? 1: -1)*cscId.
station() == -2 && cscId.
ring() == 2) {
781 else if ((cscId.
endcap() == 1? 1: -1)*cscId.
station() == 3 && cscId.
ring() == 1) {
785 else if ((cscId.
endcap() == 1? 1: -1)*cscId.
station() == -3 && cscId.
ring() == 1) {
789 else if ((cscId.
endcap() == 1? 1: -1)*cscId.
station() == 3 && cscId.
ring() == 2) {
793 else if ((cscId.
endcap() == 1? 1: -1)*cscId.
station() == -3 && cscId.
ring() == 2) {
797 else if ((cscId.
endcap() == 1? 1: -1)*cscId.
station() == 4 && cscId.
ring() == 1) {
801 else if ((cscId.
endcap() == 1? 1: -1)*cscId.
station() == -4 && cscId.
ring() == 1) {
816 for (std::vector<Alignable*>::const_iterator iter = tmp1.begin(); iter != tmp1.end(); ++iter) chambers.push_back(*iter);
818 for (std::vector<Alignable*>::const_iterator iter = tmp2.begin(); iter != tmp2.end(); ++iter) chambers.push_back(*iter);
821 for (std::vector<Alignable*>::const_iterator chamber = chambers.begin(); chamber != chambers.end(); ++chamber) {
822 const int id = (*chamber)->geomDetId().rawId();
840 std::ostringstream
name;
843 name <<
"MB" << dtId.
wheel() <<
"/" << dtId.station() <<
" (" << dtId.sector() <<
")";
852 CSCDetId cscId((*chamber)->geomDetId());
853 name <<
"ME" << (cscId.endcap() == 1?
"+":
"-") << cscId.
station() <<
"/" << cscId.ring() <<
" (" << cscId.chamber() <<
")";
863 m_sumnumx->GetXaxis()->SetBinLabel(index, name.str().c_str());
864 m_sumnumy->GetXaxis()->SetBinLabel(index, name.str().c_str());
865 m_xsummary->GetXaxis()->SetBinLabel(index, name.str().c_str());
866 m_ysummary->GetXaxis()->SetBinLabel(index, name.str().c_str());
871 double xerronmean = xstdev /
sqrt(
m_numx[
id]);
893 if (
id.wheel() == -2) {
896 else if (
id.wheel() == -1) {
899 else if (
id.wheel() == 0) {
902 else if (
id.wheel() == 1) {
905 else if (
id.wheel() == 2) {
912 CSCDetId id((*chamber)->geomDetId().rawId());
914 if ((
id.
endcap() == 1? 1: -1)*
id.station() == 1 &&
id.ring() == 1) {
992 double yerronmean = ystdev /
sqrt(
m_numy[
id]);
1014 if (
id.wheel() == -2) {
1017 else if (
id.wheel() == -1) {
1020 else if (
id.wheel() == 0) {
1023 else if (
id.wheel() == 1) {
1026 else if (
id.wheel() == 2) {
1033 CSCDetId id((*chamber)->geomDetId().rawId());
1035 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
TH1F * m_xerronmean_mep21
std::map< int, int > m_numy
TSOS combine(const TSOS &pTsos1, const TSOS &pTsos2) const
unsigned int yerronmean_bins
align::Alignables CSCChambers()
LocalPoint localPosition() const
TH1F * m_yerronmean_mem32
void book() override
Book or retrieve histograms; MUST be reimplemented.
TH1F * m_yerronmean_mem12
void afterAlignment(const edm::EventSetup &iSetup) override
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
uint32_t rawId() const
get the raw id
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
align::Alignables DTChambers()
TH1F * m_xerronmean_mem21
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
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
~AlignmentMonitorMuonResiduals()
std::map< int, double > m_y_wy
virtual LocalError localPositionError() const =0
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
TH1F * m_xerronmean_plus2
TH1F * m_xerronmean_mem12
TH1F * m_yerronmean_mem14
TH1F * m_xerronmean_minus2
#define DEFINE_EDM_PLUGIN(factory, type, name)
AlignmentMonitorMuonResiduals(const edm::ParameterSet &cfg)
DetId geographicalId() const
TH1F * m_yerronmean_minus2
TH1F * m_xerronmean_mem11
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.
virtual LocalPoint localPosition() const =0
TH1F * m_yerronmean_mep12
TH1F * m_xerronmean_mem32
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