129 m_muonCollectionTag(
cfg.getParameter<
edm::
InputTag>(
"muonCollectionTag")),
130 m_minTrackPt(
cfg.getParameter<double>(
"minTrackPt")),
131 m_minTrackP(
cfg.getParameter<double>(
"minTrackP")),
132 m_maxDxy(
cfg.getParameter<double>(
"maxDxy")),
133 m_minTrackerHits(
cfg.getParameter<
int>(
"minTrackerHits")),
134 m_maxTrackerRedChi2(
cfg.getParameter<double>(
"maxTrackerRedChi2")),
135 m_allowTIDTEC(
cfg.getParameter<
bool>(
"allowTIDTEC")),
136 m_minNCrossedChambers(
cfg.getParameter<
int>(
"minNCrossedChambers")),
137 m_minDT13Hits(
cfg.getParameter<
int>(
"minDT13Hits")),
138 m_minDT2Hits(
cfg.getParameter<
int>(
"minDT2Hits")),
139 m_minCSCHits(
cfg.getParameter<
int>(
"minCSCHits")),
140 m_doDT(
cfg.getParameter<
bool>(
"doDT")),
141 m_doCSC(
cfg.getParameter<
bool>(
"doCSC")),
146 char name[225],
pos[228], neg[228];
152 char wheel_label[][2] = {
"A",
"B",
"C",
"D",
"E"};
154 char wheel_sector[50];
155 sprintf(wheel_sector,
"%s_%02d", wheel_label[
wheel + 2],
sector);
160 sprintf(
name,
"dt13_resid_%s_12", wheel_sector);
162 sprintf(neg,
"neg%s",
name);
168 sprintf(
name,
"dt13_resid_%s_23", wheel_sector);
170 sprintf(neg,
"neg%s",
name);
176 sprintf(
name,
"dt13_resid_%s_34", wheel_sector);
178 sprintf(neg,
"neg%s",
name);
184 sprintf(
name,
"dt2_resid_%s_12", wheel_sector);
186 sprintf(neg,
"neg%s",
name);
192 sprintf(
name,
"dt2_resid_%s_23", wheel_sector);
194 sprintf(neg,
"neg%s",
name);
200 sprintf(
name,
"dt13_slope_%s_12", wheel_sector);
202 sprintf(neg,
"neg%s",
name);
208 sprintf(
name,
"dt13_slope_%s_23", wheel_sector);
210 sprintf(neg,
"neg%s",
name);
216 sprintf(
name,
"dt13_slope_%s_34", wheel_sector);
218 sprintf(neg,
"neg%s",
name);
224 sprintf(
name,
"dt2_slope_%s_12", wheel_sector);
226 sprintf(neg,
"neg%s",
name);
232 sprintf(
name,
"dt2_slope_%s_23", wheel_sector);
234 sprintf(neg,
"neg%s",
name);
252 sprintf(ec_chamber,
"%s_%02d", endcapletter.c_str(),
chamber);
257 sprintf(
name,
"cscouter_resid_%s_12", ec_chamber);
259 sprintf(neg,
"neg%s",
name);
265 sprintf(
name,
"cscouter_resid_%s_23", ec_chamber);
267 sprintf(neg,
"neg%s",
name);
273 sprintf(
name,
"cscouter_slope_%s_12", ec_chamber);
275 sprintf(neg,
"neg%s",
name);
281 sprintf(
name,
"cscouter_slope_%s_23", ec_chamber);
283 sprintf(neg,
"neg%s",
name);
292 sprintf(ec_chamber,
"%s_%02d", endcapletter.c_str(),
chamber);
297 sprintf(
name,
"cscinner_resid_%s_12", ec_chamber);
299 sprintf(neg,
"neg%s",
name);
305 sprintf(
name,
"cscinner_resid_%s_23", ec_chamber);
307 sprintf(neg,
"neg%s",
name);
313 sprintf(
name,
"cscinner_resid_%s_34", ec_chamber);
315 sprintf(neg,
"neg%s",
name);
321 sprintf(
name,
"cscinner_slope_%s_12", ec_chamber);
323 sprintf(neg,
"neg%s",
name);
329 sprintf(
name,
"cscinner_slope_%s_23", ec_chamber);
331 sprintf(neg,
"neg%s",
name);
337 sprintf(
name,
"cscinner_slope_%s_34", ec_chamber);
339 sprintf(neg,
"neg%s",
name);
348 for (
int e = 1;
e <= 2;
e++)
349 for (
int s = 1;
s <= 12;
s++) {
350 char endcap_sector[50];
352 sprintf(endcap_sector,
"Wp2S%02d",
s);
354 sprintf(endcap_sector,
"Wm2S%02d",
s);
359 sprintf(
pos,
"pos_x_dt1_csc1_%s", endcap_sector);
360 sprintf(neg,
"neg_x_dt1_csc1_%s", endcap_sector);
364 sprintf(
pos,
"pos_x_dt1_csc2_%s", endcap_sector);
365 sprintf(neg,
"neg_x_dt1_csc2_%s", endcap_sector);
369 sprintf(
pos,
"pos_x_dt2_csc1_%s", endcap_sector);
370 sprintf(neg,
"neg_x_dt2_csc1_%s", endcap_sector);
389 for (ConstTrajTrackPairCollection::const_iterator trajtrack = trajtracks.begin(); trajtrack != trajtracks.end();
404 if (!(
muon->isTrackerMuon() &&
muon->innerTrack().isNonnull()))
425 std::vector<DetId> chamberIds = mrft.
chamberIds();
426 for (
unsigned ch = 0; ch < chamberIds.size(); ch++)
437 for (std::vector<DetId>::const_iterator chamberId = chamberIds.begin(); chamberId != chamberIds.end(); ++chamberId) {
448 for (std::vector<DetId>::const_iterator otherId = chamberIds.begin(); otherId != chamberIds.end(); ++otherId) {
451 if (thisid.rawId() != thatid.rawId() && thisid.wheel() == thatid.wheel() &&
452 thisid.sector() == thatid.sector()) {
462 if (thatid.station() - thisid.station() == 1)
463 st = thisid.station();
465 m_dt13_resid[thisid.wheel() + 2][thisid.sector() - 1][st - 1]->Fill(qoverpt, residdiff);
466 m_dt13_slope[thisid.wheel() + 2][thisid.sector() - 1][st - 1]->Fill(qoverpt, slopediff);
468 m_posdt13_resid[thisid.wheel() + 2][thisid.sector() - 1][st - 1]->Fill(residdiff);
469 m_posdt13_slope[thisid.wheel() + 2][thisid.sector() - 1][st - 1]->Fill(slopediff);
471 m_negdt13_resid[thisid.wheel() + 2][thisid.sector() - 1][st - 1]->Fill(residdiff);
472 m_negdt13_slope[thisid.wheel() + 2][thisid.sector() - 1][st - 1]->Fill(slopediff);
481 if (!(
abs(thisid.wheel()) == 2 && (thisid.station() == 1 || thisid.station() == 2)))
486 if (!((thatid.station() == 1 && thatid.ring() == 3) || (thatid.station() == 2 && thatid.ring() == 2)))
501 if (thisid.station() == 1 && thatid.station() == 1) {
506 }
else if (thisid.station() == 1 && thatid.station() == 2) {
511 }
else if (thisid.station() == 2 && thatid.station() == 1) {
525 for (std::vector<DetId>::const_iterator otherId = chamberIds.begin(); otherId != chamberIds.end(); ++otherId) {
528 if (thisid.rawId() != thatid.rawId() && thisid.wheel() == thatid.wheel() &&
529 thisid.sector() == thatid.sector()) {
539 if (thatid.station() - thisid.station() == 1)
540 st = thisid.station();
542 m_dt2_resid[thisid.wheel() + 2][thisid.sector() - 1][st - 1]->Fill(qoverpt, residdiff);
543 m_dt2_slope[thisid.wheel() + 2][thisid.sector() - 1][st - 1]->Fill(qoverpt, slopediff);
545 m_posdt2_resid[thisid.wheel() + 2][thisid.sector() - 1][st - 1]->Fill(residdiff);
546 m_posdt2_slope[thisid.wheel() + 2][thisid.sector() - 1][st - 1]->Fill(slopediff);
548 m_negdt2_resid[thisid.wheel() + 2][thisid.sector() - 1][st - 1]->Fill(residdiff);
549 m_negdt2_slope[thisid.wheel() + 2][thisid.sector() - 1][st - 1]->Fill(slopediff);
563 CSCDetId thisid(chamberId->rawId());
564 for (std::vector<DetId>::const_iterator otherId = chamberIds.begin(); otherId != chamberIds.end(); ++otherId) {
567 if (thisid.rawId() != thatid.rawId() && thisid.endcap() == thatid.endcap()) {
576 int thischamber = thisid.chamber();
577 int thisring = thisid.ring();
578 if (thisid.station() == 1 && (thisring == 1 || thisring == 4)) {
579 thischamber = (thischamber - 1) / 2 + 1;
583 if (thisring == thatid.ring() && thischamber == thatid.chamber()) {
584 bool inner = (thisring == 1);
585 bool outer = (thisring == 2);
587 if (thatid.station() - thisid.station() == 1 && (
inner || thisid.station() < 3))
588 st = thisid.station();
590 if (
outer && st > 0) {
591 m_cscouter_resid[thisid.endcap() - 1][thischamber - 1][st - 1]->Fill(qoverpz, residdiff);
592 m_cscouter_slope[thisid.endcap() - 1][thischamber - 1][st - 1]->Fill(qoverpz, slopediff);
601 if (
inner && st > 0) {
602 m_cscinner_resid[thisid.endcap() - 1][thischamber - 1][st - 1]->Fill(qoverpz, residdiff);
603 m_cscinner_slope[thisid.endcap() - 1][thischamber - 1][st - 1]->Fill(qoverpz, slopediff);
626 "AlignmentMonitorSegmentDifferences");
align::GlobalPoints toGlobal(const align::LocalPoints &) const
Return in global coord given a set of local points.
const edm::EDGetTokenT< reco::BeamSpot > bsToken_
AlignableNavigator * pNavigator()
TH1F * m_poscscouter_resid[2][36][2]
const int m_minTrackerHits
TH1F * m_negdt13_resid[5][12][3]
int trackerNumHits() const
TH1F * m_posdt2_slope[5][12][2]
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
const edm::InputTag m_muonCollectionTag
const AlignableSurface & surface() const
Return the Surface (global position and orientation) of the object.
TH1F * m_x_pos_dt2_csc1_resid[2][12]
TProfile * m_dt2_slope[5][12][2]
TH1F * m_x_pos_dt1_csc2_resid[2][12]
void event(const edm::Event &iEvent, const edm::EventSetup &iSetup, const ConstTrajTrackPairCollection &iTrajTracks) override
Called for each event (by "run()"): may be reimplemented.
const edm::ESGetToken< Propagator, TrackingComponentsRecord > m_esTokenProp
TH1F * m_negdt13_slope[5][12][3]
TProfile * m_cscinner_resid[2][18][3]
TH1F * m_negcscouter_slope[2][36][2]
muons
the two sets of parameters below are mutually exclusive, depending if RECO or ALCARECO is used the us...
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")
std::vector< Muon > MuonCollection
collection of Muon objects
TH1F * m_negcscinner_slope[2][18][3]
AlignmentMonitorSegmentDifferences(const edm::ParameterSet &cfg, edm::ConsumesCollector iC)
void book() override
Book or retrieve histograms; MUST be reimplemented.
double pt() const
track transverse momentum
TH1F * m_negcscinner_resid[2][18][3]
int charge() const
track electric charge
TH1F * m_posdt2_resid[5][12][2]
const MuonResidualsFromTrack::BuilderToken m_esTokenBuilder
TProfile * m_dt2_resid[5][12][2]
const double m_maxTrackerRedChi2
TH1F * m_negcscouter_resid[2][36][2]
const reco::Track * getTrack()
TH1F * m_poscscouter_slope[2][36][2]
TH1F * m_posdt13_resid[5][12][3]
Abs< T >::type abs(const T &t)
double normalizedChi2() const
std::vector< ConstTrajTrackPair > ConstTrajTrackPairCollection
TProfile * m_cscouter_slope[2][36][2]
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
TH1F * m_poscscinner_resid[2][18][3]
const bool m_minNCrossedChambers
void processMuonResidualsFromTrack(MuonResidualsFromTrack &mrft)
double global_residual() const
const std::vector< DetId > chamberIds() const
TH1F * m_x_neg_dt1_csc2_resid[2][12]
const double m_minTrackPt
double pz() const
z coordinate of momentum vector
TH1F * m_negdt2_slope[5][12][2]
~AlignmentMonitorSegmentDifferences() override
const edm::ESGetToken< DetIdAssociator, DetIdAssociatorRecord > m_esTokenDetId
TProfile * m_cscouter_resid[2][36][2]
TH1F * m_posdt13_slope[5][12][3]
const edm::EDGetTokenT< reco::MuonCollection > muonToken_
const edm::ESGetToken< GlobalTrackingGeometry, GlobalTrackingGeometryRecord > m_esTokenGBTGeom
AlignableDetOrUnitPtr chamberAlignable() const
TProfile * m_dt13_resid[5][12][3]
#define DEFINE_EDM_PLUGIN(factory, type, name)
TH1F * m_x_pos_dt1_csc1_resid[2][12]
bool contains_TIDTEC() const
TH1F * m_negdt2_resid[5][12][2]
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > m_esTokenMF
TProfile * m_cscinner_slope[2][18][3]
TH1F * m_x_neg_dt2_csc1_resid[2][12]
TH1F * m_poscscinner_slope[2][18][3]
TH1F * m_x_neg_dt1_csc1_resid[2][12]
TProfile * m_dt13_slope[5][12][3]
MuonChamberResidual * chamberResidual(DetId chamberId, int type)
double global_resslope() const