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;
203 for (std::vector<Alignable*>::const_iterator iter = tmp1.begin(); iter != tmp1.end(); ++iter) chambers.push_back(*iter);
205 for (std::vector<Alignable*>::const_iterator iter = tmp2.begin(); iter != tmp2.end(); ++iter) chambers.push_back(*iter);
207 for (std::vector<Alignable*>::const_iterator
chamber = chambers.begin();
chamber != chambers.end(); ++
chamber) {
208 int id = (*chamber)->geomDetId().rawId();
221 m_sumnumx =
book1D(
"/iterN/",
"numx",
"number of x hits", chambers.size(), 0.5, chambers.size() + 0.5);
222 m_sumnumy =
book1D(
"/iterN/",
"numy",
"number of y hits", chambers.size(), 0.5, chambers.size() + 0.5);
223 m_xsummary =
book1D(
"/iterN/",
"xsummary",
"summary of x means and errors (mm vertical axis)", chambers.size(), 0.5, chambers.size() + 0.5);
224 m_ysummary =
book1D(
"/iterN/",
"ysummary",
"summary of y means and errors (mm vertical axis)", chambers.size(), 0.5, chambers.size() + 0.5);
570 for (ConstTrajTrackPairCollection::const_iterator it = tracks.begin(); it != tracks.end(); ++it) {
574 std::vector<TrajectoryMeasurement> measurements = traj->
measurements();
576 for (std::vector<TrajectoryMeasurement>::const_iterator im = measurements.begin(); im != measurements.end(); ++im) {
591 if (localAPE.valid()) {
593 hitErr.
xy() - localAPE.xy(),
594 hitErr.
yy() - localAPE.yy());
597 double x_residual = 10. * (trackPos.
x() - hitPos.
x());
598 double y_residual = 10. * (trackPos.
y() - hitPos.
y());
599 double x_reserr2 = 100. * (trackErr.
xx() + hitErr.
xx());
600 double y_reserr2 = 100. * (trackErr.
yy() + hitErr.
yy());
607 y_residual = x_residual;
608 y_reserr2 = x_reserr2;
618 if (x_reserr2 > 0.) {
619 m_xresid->Fill(x_residual, 1./x_reserr2);
622 if (y_reserr2 > 0.) {
623 m_yresid->Fill(y_residual, 1./y_reserr2);
628 int rawId = dtId.
rawId();
629 if (x_reserr2 > 0.) {
631 m_x_w[rawId] += 1./x_reserr2;
632 m_x_ww[rawId] += 1./x_reserr2/x_reserr2;
633 m_x_wx[rawId] += x_residual/x_reserr2;
634 m_x_wxx[rawId] += x_residual*x_residual/x_reserr2;
636 if (y_reserr2 > 0.) {
638 m_y_w[rawId] += 1./y_reserr2;
639 m_y_ww[rawId] += 1./y_reserr2/y_reserr2;
640 m_y_wy[rawId] += y_residual/y_reserr2;
641 m_y_wyy[rawId] += y_residual*y_residual/y_reserr2;
645 if (x_reserr2 > 0.) {
648 if (y_reserr2 > 0.) {
652 else if (dtId.
station() == 2) {
653 if (x_reserr2 > 0.) {
656 if (y_reserr2 > 0.) {
660 else if (dtId.
station() == 3) {
661 if (x_reserr2 > 0.) {
664 if (y_reserr2 > 0.) {
668 else if (dtId.
station() == 4) {
669 if (x_reserr2 > 0.) {
672 if (y_reserr2 > 0.) {
677 if (dtId.
wheel() == -2) {
678 if (x_reserr2 > 0.) {
681 if (y_reserr2 > 0.) {
685 else if (dtId.
wheel() == -1) {
686 if (x_reserr2 > 0.) {
689 if (y_reserr2 > 0.) {
693 else if (dtId.
wheel() == 0) {
694 if (x_reserr2 > 0.) {
697 if (y_reserr2 > 0.) {
701 else if (dtId.
wheel() == 1) {
702 if (x_reserr2 > 0.) {
705 if (y_reserr2 > 0.) {
709 else if (dtId.
wheel() == 2) {
710 if (x_reserr2 > 0.) {
713 if (y_reserr2 > 0.) {
720 m_xresid->Fill(x_residual, 1./x_reserr2);
721 m_yresid->Fill(y_residual, 1./y_reserr2);
728 if (x_reserr2 > 0.) {
730 m_x_w[rawId] += 1./x_reserr2;
731 m_x_ww[rawId] += 1./x_reserr2/x_reserr2;
732 m_x_wx[rawId] += x_residual/x_reserr2;
733 m_x_wxx[rawId] += x_residual*x_residual/x_reserr2;
735 if (y_reserr2 > 0.) {
737 m_y_w[rawId] += 1./y_reserr2;
738 m_y_ww[rawId] += 1./y_reserr2/y_reserr2;
739 m_y_wy[rawId] += y_residual/y_reserr2;
740 m_y_wyy[rawId] += y_residual*y_residual/y_reserr2;
747 else if ((cscId.
endcap() == 1? 1: -1)*cscId.
station() == -1 && cscId.
ring() == 1) {
751 else if ((cscId.
endcap() == 1? 1: -1)*cscId.
station() == 1 && cscId.
ring() == 2) {
755 else if ((cscId.
endcap() == 1? 1: -1)*cscId.
station() == -1 && cscId.
ring() == 2) {
759 else if ((cscId.
endcap() == 1? 1: -1)*cscId.
station() == 1 && cscId.
ring() == 3) {
763 else if ((cscId.
endcap() == 1? 1: -1)*cscId.
station() == -1 && cscId.
ring() == 3) {
767 else if ((cscId.
endcap() == 1? 1: -1)*cscId.
station() == 1 && cscId.
ring() == 4) {
771 else if ((cscId.
endcap() == 1? 1: -1)*cscId.
station() == -1 && cscId.
ring() == 4) {
775 else if ((cscId.
endcap() == 1? 1: -1)*cscId.
station() == 2 && cscId.
ring() == 1) {
779 else if ((cscId.
endcap() == 1? 1: -1)*cscId.
station() == -2 && cscId.
ring() == 1) {
783 else if ((cscId.
endcap() == 1? 1: -1)*cscId.
station() == 2 && cscId.
ring() == 2) {
787 else if ((cscId.
endcap() == 1? 1: -1)*cscId.
station() == -2 && cscId.
ring() == 2) {
791 else if ((cscId.
endcap() == 1? 1: -1)*cscId.
station() == 3 && cscId.
ring() == 1) {
795 else if ((cscId.
endcap() == 1? 1: -1)*cscId.
station() == -3 && cscId.
ring() == 1) {
799 else if ((cscId.
endcap() == 1? 1: -1)*cscId.
station() == 3 && cscId.
ring() == 2) {
803 else if ((cscId.
endcap() == 1? 1: -1)*cscId.
station() == -3 && cscId.
ring() == 2) {
807 else if ((cscId.
endcap() == 1? 1: -1)*cscId.
station() == 4 && cscId.
ring() == 1) {
811 else if ((cscId.
endcap() == 1? 1: -1)*cscId.
station() == -4 && cscId.
ring() == 1) {
826 for (std::vector<Alignable*>::const_iterator iter = tmp1.begin(); iter != tmp1.end(); ++iter) chambers.push_back(*iter);
828 for (std::vector<Alignable*>::const_iterator iter = tmp2.begin(); iter != tmp2.end(); ++iter) chambers.push_back(*iter);
831 for (std::vector<Alignable*>::const_iterator
chamber = chambers.begin();
chamber != chambers.end(); ++
chamber) {
832 const int id = (*chamber)->geomDetId().rawId();
850 std::ostringstream
name;
853 name <<
"MB" << dtId.
wheel() <<
"/" << dtId.station() <<
" (" << dtId.sector() <<
")";
862 CSCDetId cscId((*chamber)->geomDetId());
863 name <<
"ME" << (cscId.endcap() == 1?
"+":
"-") << cscId.
station() <<
"/" << cscId.ring() <<
" (" << cscId.chamber() <<
")";
873 m_sumnumx->GetXaxis()->SetBinLabel(index, name.str().c_str());
874 m_sumnumy->GetXaxis()->SetBinLabel(index, name.str().c_str());
875 m_xsummary->GetXaxis()->SetBinLabel(index, name.str().c_str());
876 m_ysummary->GetXaxis()->SetBinLabel(index, name.str().c_str());
881 double xerronmean = xstdev /
sqrt(
m_numx[
id]);
903 if (
id.
wheel() == -2) {
906 else if (
id.
wheel() == -1) {
909 else if (
id.
wheel() == 0) {
912 else if (
id.
wheel() == 1) {
915 else if (
id.
wheel() == 2) {
924 if ((
id.
endcap() == 1? 1: -1)*
id.station() == 1 &&
id.ring() == 1) {
1002 double yerronmean = ystdev /
sqrt(
m_numy[
id]);
1024 if (
id.
wheel() == -2) {
1027 else if (
id.
wheel() == -1) {
1030 else if (
id.
wheel() == 0) {
1033 else if (
id.
wheel() == 1) {
1036 else if (
id.
wheel() == 2) {
1043 CSCDetId id((*chamber)->geomDetId().rawId());
1045 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
align::Alignables CSCChambers()
LocalPoint localPosition() const
TH1F * m_yerronmean_mem32
void book() override
Book or retrieve histograms; MUST be reimplemented.
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
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
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
~AlignmentMonitorMuonResiduals()
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
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
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