80 , m_muonCollectionTag(cfg.getParameter<edm::InputTag>(
"muonCollectionTag"))
81 , m_minTrackPt(cfg.getParameter<double>(
"minTrackPt"))
82 , m_minTrackP(cfg.getParameter<double>(
"minTrackP"))
83 , m_minTrackerHits(cfg.getParameter<int>(
"minTrackerHits"))
84 , m_maxTrackerRedChi2(cfg.getParameter<double>(
"maxTrackerRedChi2"))
85 , m_allowTIDTEC(cfg.getParameter<bool>(
"allowTIDTEC"))
86 , m_minNCrossedChambers(cfg.getParameter<int>(
"minNCrossedChambers"))
87 , m_maxDxy(cfg.getParameter<double>(
"maxDxy"))
88 , m_minDT13Hits(cfg.getParameter<int>(
"minDT13Hits"))
89 , m_minDT2Hits(cfg.getParameter<int>(
"minDT2Hits"))
90 , m_minCSCHits(cfg.getParameter<int>(
"minCSCHits"))
91 , m_layer(cfg.getParameter<int>(
"layer"))
92 , m_propagator(cfg.getParameter<std::
string>(
"propagator"))
93 , m_doDT(cfg.getParameter<bool>(
"doDT"))
94 , m_doCSC(cfg.getParameter<bool>(
"doCSC"))
101 std::string wheelname[5] = {
"wheelm2_",
"wheelm1_",
"wheelz_",
"wheelp1_",
"wheelp2_"};
103 for (
int wheel = -2; wheel <=2 ; wheel++)
105 for (
int sector = 1; sector <= 14; sector++)
107 if (
station != 4 && sector > 12)
continue;
109 char stationname[20];
110 sprintf(stationname,
"st%d_",
station);
113 sprintf(sectorname,
"sector%02d_", sector);
117 std::stringstream th2f_name, tprofile_name;
118 th2f_name <<
"th2f_" << wheelname[wheel+2] <<stationname<< sectorname;
119 tprofile_name <<
"tprofile_" << wheelname[wheel+2] <<stationname<< sectorname;
121 double yminmax = 50., xminmax = 0.05;
125 th2f_name <<
"deltax";
126 tprofile_name <<
"deltax";
129 th2f_name <<
"deltadxdz";
130 tprofile_name <<
"deltadxdz";
134 book2D(
"/iterN/", th2f_name.str().c_str(),
"", 30, -xminmax, xminmax, ynbins, -yminmax, yminmax);
136 bookProfile(
"/iterN/", tprofile_name.str().c_str(),
"", 30, -xminmax, xminmax);
141 std::string stname[8] = {
"Ep_S1_",
"Ep_S2_",
"Ep_S3_",
"Ep_S4_",
"Em_S1_",
"Em_S2_",
"Em_S3_",
"Em_S4_"};
145 for (
int chamber = 1; chamber <= 36; chamber++)
148 if (st > 1 &&
ring > 2)
continue;
149 if (st > 1 &&
ring == 1 && chamber > 18)
continue;
152 sprintf(ringname,
"R%d_",
ring);
155 sprintf(chname,
"C%02d_", chamber);
159 std::stringstream componentname;
160 double yminmax = 50., xminmax = 0.05;
162 if (
ring == 1) xminmax *= 0.5;
164 componentname <<
"deltax";
167 componentname <<
"deltadxdz";
170 std::stringstream th2f_name, tprofile_name;
171 th2f_name <<
"th2f_" << stname[
station] << ringname << chname << componentname.str();
172 tprofile_name <<
"tprofile_" << stname[
station] << ringname << chname << componentname.str();
175 book2D(
"/iterN/", th2f_name.str().c_str(),
"", 30, -xminmax, xminmax, 100, -yminmax, yminmax);
177 bookProfile(
"/iterN/", tprofile_name.str().c_str(),
"", 30, -xminmax, xminmax);
196 for (ConstTrajTrackPairCollection::const_iterator trajtrack = trajtracks.begin(); trajtrack != trajtracks.end(); ++trajtrack)
213 for (reco::MuonCollection::const_iterator
muon = muons->begin();
muon != muons->end(); ++
muon)
215 if ( !(
muon->isTrackerMuon() &&
muon->innerTrack().isNonnull() ) )
continue;
233 std::vector<DetId> chamberIds = mrft.
chamberIds();
234 for (
unsigned ch=0; ch < chamberIds.size(); ch++)
if (chamberIds[ch].det() ==
DetId::Muon) nMuChambers++;
246 for (std::vector<DetId>::const_iterator chamberId = chamberIds.begin(); chamberId != chamberIds.end(); ++chamberId)
257 int wheel = dtid.wheel() + 2;
258 int station = dtid.station() -1;
259 int sector = dtid.sector() - 1;
261 double resid_x = 10. * dt13->global_residual();
262 double resid_dxdz = 1000. * dt13->global_resslope();
264 if (fabs(resid_x) < 100. && fabs(resid_dxdz) < 100.)
281 int station = 4*cscid.endcap() + cscid.station() - 5;
282 int ring = cscid.ring() - 1;
283 if (cscid.station()==1 && cscid.ring()==4) ring = 0;
284 int chamber = cscid.chamber() - 1;
286 double resid_x = 10. * csc->global_residual();
287 double resid_dxdz = 1000. * csc->global_resslope();
289 if (fabs(resid_x) < 100. && fabs(resid_dxdz) < 100.)
double p() const
momentum vector magnitude
AlignableNavigator * pNavigator()
void book()
Book or retrieve histograms; MUST be reimplemented.
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)
TH2F * book2D(std::string dir, std::string name, std::string title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
double m_maxTrackerRedChi2
TH2F * th2f_st_ring_chamber[8][3][36][kNumComponents]
int trackerNumHits() const
TProfile * tprofile_st_ring_chamber[8][3][36][kNumComponents]
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
void event(const edm::Event &iEvent, const edm::EventSetup &iSetup, const ConstTrajTrackPairCollection &iTrajTracks)
Called for each event (by "run()"): may be reimplemented.
AlignmentMonitorMuonVsCurvature(const edm::ParameterSet &cfg)
const std::vector< DetId > chamberIds() const
double pt() const
track transverse momentum
const reco::Track * getTrack()
virtual ~AlignmentMonitorMuonVsCurvature()
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
double trackerRedChi2() const
TH1F * th1f_trackerRedChi2
void afterAlignment(const edm::EventSetup &iSetup)
void processMuonResidualsFromTrack(MuonResidualsFromTrack &mrft, const Trajectory *traj=NULL)
int charge() const
track electric charge
#define DEFINE_EDM_PLUGIN(factory, type, name)
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)