96 m_muonCollectionTag(
cfg.getParameter<
edm::
InputTag>(
"muonCollectionTag")),
97 m_minTrackPt(
cfg.getParameter<double>(
"minTrackPt")),
98 m_minTrackP(
cfg.getParameter<double>(
"minTrackP")),
99 m_minTrackerHits(
cfg.getParameter<
int>(
"minTrackerHits")),
100 m_maxTrackerRedChi2(
cfg.getParameter<double>(
"maxTrackerRedChi2")),
101 m_allowTIDTEC(
cfg.getParameter<
bool>(
"allowTIDTEC")),
102 m_minNCrossedChambers(
cfg.getParameter<
int>(
"minNCrossedChambers")),
103 m_maxDxy(
cfg.getParameter<double>(
"maxDxy")),
104 m_minDT13Hits(
cfg.getParameter<
int>(
"minDT13Hits")),
105 m_minDT2Hits(
cfg.getParameter<
int>(
"minDT2Hits")),
106 m_minCSCHits(
cfg.getParameter<
int>(
"minCSCHits")),
107 m_layer(
cfg.getParameter<
int>(
"layer")),
108 m_propagator(
cfg.getParameter<
std::
string>(
"propagator")),
109 m_doDT(
cfg.getParameter<
bool>(
"doDT")),
110 m_doCSC(
cfg.getParameter<
bool>(
"doCSC")),
116 std::string wheelname[5] = {
"wheelm2_",
"wheelm1_",
"wheelz_",
"wheelp1_",
"wheelp2_"};
124 char stationname[20];
125 sprintf(stationname,
"st%d_",
station);
128 sprintf(sectorname,
"sector%02d_",
sector);
130 for (
int component = 0; component <
kNumComponents; component++) {
131 std::stringstream th2f_name, tprofile_name;
132 th2f_name <<
"th2f_" << wheelname[
wheel + 2] << stationname << sectorname;
133 tprofile_name <<
"tprofile_" << wheelname[
wheel + 2] << stationname << sectorname;
135 double yminmax = 50., xminmax = 0.05;
140 th2f_name <<
"deltax";
141 tprofile_name <<
"deltax";
143 th2f_name <<
"deltadxdz";
144 tprofile_name <<
"deltadxdz";
148 book2D(
"/iterN/", th2f_name.str(),
"", 30, -xminmax, xminmax, ynbins, -yminmax, yminmax);
150 bookProfile(
"/iterN/", tprofile_name.str(),
"", 30, -xminmax, xminmax);
155 std::string stname[8] = {
"Ep_S1_",
"Ep_S2_",
"Ep_S3_",
"Ep_S4_",
"Em_S1_",
"Em_S2_",
"Em_S3_",
"Em_S4_"};
161 if (st > 1 &&
ring > 2)
167 sprintf(ringname,
"R%d_",
ring);
170 sprintf(chname,
"C%02d_",
chamber);
172 for (
int component = 0; component <
kNumComponents; component++) {
173 std::stringstream componentname;
174 double yminmax = 50., xminmax = 0.05;
180 componentname <<
"deltax";
182 componentname <<
"deltadxdz";
185 std::stringstream th2f_name, tprofile_name;
186 th2f_name <<
"th2f_" << stname[
station] << ringname << chname << componentname.str();
187 tprofile_name <<
"tprofile_" << stname[
station] << ringname << chname << componentname.str();
190 book2D(
"/iterN/", th2f_name.str(),
"", 30, -xminmax, xminmax, 100, -yminmax, yminmax);
192 bookProfile(
"/iterN/", tprofile_name.str(),
"", 30, -xminmax, xminmax);
198 book1D(
"/iterN/",
"trackerRedChi2Diff",
"Fit-minus-refit tracker reduced chi^2", 100, -5., 5.);
214 for (ConstTrajTrackPairCollection::const_iterator trajtrack = trajtracks.begin(); trajtrack != trajtracks.end();
229 if (!(
muon->isTrackerMuon() &&
muon->innerTrack().isNonnull()))
249 std::vector<DetId> chamberIds = mrft.
chamberIds();
250 for (
unsigned ch = 0; ch < chamberIds.size(); ch++)
267 for (std::vector<DetId>::const_iterator chamberId = chamberIds.begin(); chamberId != chamberIds.end(); ++chamberId) {
276 int wheel = dtid.wheel() + 2;
277 int station = dtid.station() - 1;
278 int sector = dtid.sector() - 1;
280 double resid_x = 10. * dt13->global_residual();
281 double resid_dxdz = 1000. * dt13->global_resslope();
283 if (fabs(resid_x) < 100. && fabs(resid_dxdz) < 100.) {
297 int station = 4 * cscid.endcap() + cscid.station() - 5;
298 int ring = cscid.ring() - 1;
299 if (cscid.station() == 1 && cscid.ring() == 4)
301 int chamber = cscid.chamber() - 1;
303 double resid_x = 10. *
csc->global_residual();
304 double resid_dxdz = 1000. *
csc->global_resslope();
306 if (fabs(resid_x) < 100. && fabs(resid_dxdz) < 100.) {
const int m_minTrackerHits
AlignableNavigator * pNavigator()
const edm::EDGetTokenT< reco::MuonCollection > muonToken_
int trackerNumHits() const
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
const MuonResidualsFromTrack::BuilderToken m_esTokenBuilder
TH2F * book2D(std::string dir, std::string name, std::string title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
const edm::ESGetToken< Propagator, TrackingComponentsRecord > m_esTokenProp
TH2F * th2f_st_ring_chamber[8][3][36][kNumComponents]
const std::string m_propagator
const edm::EDGetTokenT< reco::BeamSpot > bsToken_
TProfile * tprofile_st_ring_chamber[8][3][36][kNumComponents]
AlignmentMonitorMuonVsCurvature(const edm::ParameterSet &cfg, edm::ConsumesCollector iC)
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > m_esTokenMF
TProfile * bookProfile(std::string dir, std::string name, std::string title, int nchX, double lowX, double highX, int nchY=1, double lowY=0., double highY=0., const char *option="s")
TH1F * th1f_trackerRedChi2Diff
std::vector< Muon > MuonCollection
collection of Muon objects
void event(const edm::Event &iEvent, const edm::EventSetup &iSetup, const ConstTrajTrackPairCollection &iTrajTracks) override
Called for each event (by "run()"): may be reimplemented.
double pt() const
track transverse momentum
void processMuonResidualsFromTrack(MuonResidualsFromTrack &mrft, const Trajectory *traj=nullptr)
int charge() const
track electric charge
const edm::ESGetToken< GlobalTrackingGeometry, GlobalTrackingGeometryRecord > m_esTokenGBTGeom
const edm::InputTag m_muonCollectionTag
const reco::Track * getTrack()
double normalizedChi2() const
void book() override
Book or retrieve histograms; MUST be reimplemented.
std::vector< ConstTrajTrackPair > ConstTrajTrackPairCollection
TProfile * tprofile_wheel_st_sector[5][4][14][kNumComponents]
TH1F * book1D(std::string dir, std::string name, std::string title, int nchX, double lowX, double highX)
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
const bool m_minNCrossedChambers
const edm::ESGetToken< DetIdAssociator, DetIdAssociatorRecord > m_esTokenDetId
const std::vector< DetId > chamberIds() const
double pz() const
z coordinate of momentum vector
double normalizedChi2() const
chi-squared divided by n.d.o.f. (or chi-squared * 1e6 if n.d.o.f. is zero)
TH1F * th1f_trackerRedChi2
const double m_minTrackPt
~AlignmentMonitorMuonVsCurvature() override
#define DEFINE_EDM_PLUGIN(factory, type, name)
bool contains_TIDTEC() const
TH2F * th2f_wheel_st_sector[5][4][14][kNumComponents]
double trackerRedChi2() const
const double m_maxTrackerRedChi2
MuonChamberResidual * chamberResidual(DetId chamberId, int type)