93 m_muonCollectionTag(cfg.getParameter<edm::
InputTag>(
"muonCollectionTag")),
94 m_minTrackPt(cfg.getParameter<double>(
"minTrackPt")),
95 m_minTrackP(cfg.getParameter<double>(
"minTrackP")),
96 m_minTrackerHits(cfg.getParameter<int>(
"minTrackerHits")),
97 m_maxTrackerRedChi2(cfg.getParameter<double>(
"maxTrackerRedChi2")),
98 m_allowTIDTEC(cfg.getParameter<bool>(
"allowTIDTEC")),
99 m_minNCrossedChambers(cfg.getParameter<int>(
"minNCrossedChambers")),
100 m_maxDxy(cfg.getParameter<double>(
"maxDxy")),
101 m_minDT13Hits(cfg.getParameter<int>(
"minDT13Hits")),
102 m_minDT2Hits(cfg.getParameter<int>(
"minDT2Hits")),
103 m_minCSCHits(cfg.getParameter<int>(
"minCSCHits")),
104 m_layer(cfg.getParameter<int>(
"layer")),
105 m_propagator(cfg.getParameter<std::
string>(
"propagator")),
106 m_doDT(cfg.getParameter<bool>(
"doDT")),
107 m_doCSC(cfg.getParameter<bool>(
"doCSC")) {}
111 std::string wheelname[5] = {
"wheelm2_",
"wheelm1_",
"wheelz_",
"wheelp1_",
"wheelp2_"};
113 for (
int wheel = -2; wheel <= 2; wheel++)
115 for (
int sector = 1; sector <= 14; sector++) {
116 if (
station != 4 && sector > 12)
119 char stationname[20];
120 sprintf(stationname,
"st%d_",
station);
123 sprintf(sectorname,
"sector%02d_", sector);
125 for (
int component = 0; component <
kNumComponents; component++) {
126 std::stringstream th2f_name, tprofile_name;
127 th2f_name <<
"th2f_" << wheelname[wheel + 2] << stationname << sectorname;
128 tprofile_name <<
"tprofile_" << wheelname[wheel + 2] << stationname << sectorname;
130 double yminmax = 50., xminmax = 0.05;
135 th2f_name <<
"deltax";
136 tprofile_name <<
"deltax";
138 th2f_name <<
"deltadxdz";
139 tprofile_name <<
"deltadxdz";
143 book2D(
"/iterN/", th2f_name.str(),
"", 30, -xminmax, xminmax, ynbins, -yminmax, yminmax);
145 bookProfile(
"/iterN/", tprofile_name.str(),
"", 30, -xminmax, xminmax);
150 std::string stname[8] = {
"Ep_S1_",
"Ep_S2_",
"Ep_S3_",
"Ep_S4_",
"Em_S1_",
"Em_S2_",
"Em_S3_",
"Em_S4_"};
154 for (
int chamber = 1; chamber <= 36; chamber++) {
156 if (st > 1 &&
ring > 2)
158 if (st > 1 &&
ring == 1 && chamber > 18)
162 sprintf(ringname,
"R%d_",
ring);
165 sprintf(chname,
"C%02d_", chamber);
167 for (
int component = 0; component <
kNumComponents; component++) {
168 std::stringstream componentname;
169 double yminmax = 50., xminmax = 0.05;
175 componentname <<
"deltax";
177 componentname <<
"deltadxdz";
180 std::stringstream th2f_name, tprofile_name;
181 th2f_name <<
"th2f_" << stname[
station] << ringname << chname << componentname.str();
182 tprofile_name <<
"tprofile_" << stname[
station] << ringname << chname << componentname.str();
185 book2D(
"/iterN/", th2f_name.str(),
"", 30, -xminmax, xminmax, 100, -yminmax, yminmax);
187 bookProfile(
"/iterN/", tprofile_name.str(),
"", 30, -xminmax, xminmax);
193 book1D(
"/iterN/",
"trackerRedChi2Diff",
"Fit-minus-refit tracker reduced chi^2", 100, -5., 5.);
210 for (ConstTrajTrackPairCollection::const_iterator trajtrack = trajtracks.begin(); trajtrack != trajtracks.end();
217 builder, magneticField, globalGeometry, muonDetIdAssociator_, prop, traj, track,
pNavigator(), 1000.);
225 for (reco::MuonCollection::const_iterator
muon = muons->begin();
muon != muons->end(); ++
muon) {
226 if (!(
muon->isTrackerMuon() &&
muon->innerTrack().isNonnull()))
230 fabs(
muon->innerTrack()->dxy(beamSpot->position())) <
m_maxDxy) {
246 std::vector<DetId> chamberIds = mrft.
chamberIds();
247 for (
unsigned ch = 0; ch < chamberIds.size(); ch++)
264 for (std::vector<DetId>::const_iterator chamberId = chamberIds.begin(); chamberId != chamberIds.end(); ++chamberId) {
273 int wheel = dtid.wheel() + 2;
274 int station = dtid.station() - 1;
275 int sector = dtid.sector() - 1;
277 double resid_x = 10. * dt13->global_residual();
278 double resid_dxdz = 1000. * dt13->global_resslope();
280 if (fabs(resid_x) < 100. && fabs(resid_dxdz) < 100.) {
294 int station = 4 * cscid.endcap() + cscid.station() - 5;
295 int ring = cscid.ring() - 1;
296 if (cscid.station() == 1 && cscid.ring() == 4)
298 int chamber = cscid.chamber() - 1;
300 double resid_x = 10. * csc->global_residual();
301 double resid_dxdz = 1000. * csc->global_resslope();
303 if (fabs(resid_x) < 100. && fabs(resid_dxdz) < 100.) {
double p() const
momentum vector magnitude
AlignableNavigator * pNavigator()
bool m_minNCrossedChambers
double normalizedChi2() const
chi-squared divided by n.d.o.f. (or chi-squared * 1e6 if n.d.o.f. is zero)
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
double m_maxTrackerRedChi2
TH2F * th2f_st_ring_chamber[8][3][36][kNumComponents]
int trackerNumHits() const
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
const std::vector< DetId > chamberIds() const
void event(const edm::Event &iEvent, const edm::EventSetup &iSetup, const ConstTrajTrackPairCollection &iTrajTracks) override
Called for each event (by "run()"): may be reimplemented.
bool getData(T &iHolder) const
void processMuonResidualsFromTrack(MuonResidualsFromTrack &mrft, const Trajectory *traj=nullptr)
const edm::ESGetToken< GlobalTrackingGeometry, GlobalTrackingGeometryRecord > m_esTokenGBTGeom
double pt() const
track transverse momentum
const reco::Track * getTrack()
void book() override
Book or retrieve histograms; MUST be reimplemented.
std::vector< ConstTrajTrackPair > ConstTrajTrackPairCollection
const edm::InputTag m_beamSpotTag
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)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
double pz() const
z coordinate of momentum vector
double normalizedChi2() const
const edm::ESGetToken< DetIdAssociator, DetIdAssociatorRecord > m_esTokenDetId
double trackerRedChi2() const
TH1F * th1f_trackerRedChi2
~AlignmentMonitorMuonVsCurvature() override
int charge() const
track electric charge
#define DEFINE_EDM_PLUGIN(factory, type, name)
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
TH2F * th2f_wheel_st_sector[5][4][14][kNumComponents]
double dxy() const
dxy parameter. (This is the transverse impact parameter w.r.t. to (0,0,0) ONLY if refPoint is close t...
edm::InputTag m_muonCollectionTag
bool contains_TIDTEC() const
MuonChamberResidual * chamberResidual(DetId chamberId, int type)