126 m_muonCollectionTag(
cfg.getParameter<
edm::
InputTag>(
"muonCollectionTag")),
127 m_minTrackPt(
cfg.getParameter<double>(
"minTrackPt")),
128 m_minTrackP(
cfg.getParameter<double>(
"minTrackP")),
129 m_maxDxy(
cfg.getParameter<double>(
"maxDxy")),
130 m_minTrackerHits(
cfg.getParameter<
int>(
"minTrackerHits")),
131 m_maxTrackerRedChi2(
cfg.getParameter<double>(
"maxTrackerRedChi2")),
132 m_allowTIDTEC(
cfg.getParameter<
bool>(
"allowTIDTEC")),
133 m_minNCrossedChambers(
cfg.getParameter<
int>(
"minNCrossedChambers")),
134 m_minDT13Hits(
cfg.getParameter<
int>(
"minDT13Hits")),
135 m_minDT2Hits(
cfg.getParameter<
int>(
"minDT2Hits")),
136 m_minCSCHits(
cfg.getParameter<
int>(
"minCSCHits")),
137 m_doDT(
cfg.getParameter<
bool>(
"doDT")),
138 m_doCSC(
cfg.getParameter<
bool>(
"doCSC")) {}
141 char name[225],
pos[228], neg[228];
147 char wheel_label[][2] = {
"A",
"B",
"C",
"D",
"E"};
148 for (
int sector = 1; sector <= 12; sector++) {
149 char wheel_sector[50];
150 sprintf(wheel_sector,
"%s_%02d", wheel_label[
wheel + 2], sector);
155 sprintf(
name,
"dt13_resid_%s_12", wheel_sector);
157 sprintf(neg,
"neg%s",
name);
163 sprintf(
name,
"dt13_resid_%s_23", wheel_sector);
165 sprintf(neg,
"neg%s",
name);
171 sprintf(
name,
"dt13_resid_%s_34", wheel_sector);
173 sprintf(neg,
"neg%s",
name);
179 sprintf(
name,
"dt2_resid_%s_12", wheel_sector);
181 sprintf(neg,
"neg%s",
name);
187 sprintf(
name,
"dt2_resid_%s_23", wheel_sector);
189 sprintf(neg,
"neg%s",
name);
195 sprintf(
name,
"dt13_slope_%s_12", wheel_sector);
197 sprintf(neg,
"neg%s",
name);
203 sprintf(
name,
"dt13_slope_%s_23", wheel_sector);
205 sprintf(neg,
"neg%s",
name);
211 sprintf(
name,
"dt13_slope_%s_34", wheel_sector);
213 sprintf(neg,
"neg%s",
name);
219 sprintf(
name,
"dt2_slope_%s_12", wheel_sector);
221 sprintf(neg,
"neg%s",
name);
227 sprintf(
name,
"dt2_slope_%s_23", wheel_sector);
229 sprintf(neg,
"neg%s",
name);
247 sprintf(ec_chamber,
"%s_%02d", endcapletter.c_str(),
chamber);
252 sprintf(
name,
"cscouter_resid_%s_12", ec_chamber);
254 sprintf(neg,
"neg%s",
name);
260 sprintf(
name,
"cscouter_resid_%s_23", ec_chamber);
262 sprintf(neg,
"neg%s",
name);
268 sprintf(
name,
"cscouter_slope_%s_12", ec_chamber);
270 sprintf(neg,
"neg%s",
name);
276 sprintf(
name,
"cscouter_slope_%s_23", ec_chamber);
278 sprintf(neg,
"neg%s",
name);
287 sprintf(ec_chamber,
"%s_%02d", endcapletter.c_str(),
chamber);
292 sprintf(
name,
"cscinner_resid_%s_12", ec_chamber);
294 sprintf(neg,
"neg%s",
name);
300 sprintf(
name,
"cscinner_resid_%s_23", ec_chamber);
302 sprintf(neg,
"neg%s",
name);
308 sprintf(
name,
"cscinner_resid_%s_34", ec_chamber);
310 sprintf(neg,
"neg%s",
name);
316 sprintf(
name,
"cscinner_slope_%s_12", ec_chamber);
318 sprintf(neg,
"neg%s",
name);
324 sprintf(
name,
"cscinner_slope_%s_23", ec_chamber);
326 sprintf(neg,
"neg%s",
name);
332 sprintf(
name,
"cscinner_slope_%s_34", ec_chamber);
334 sprintf(neg,
"neg%s",
name);
343 for (
int e = 1;
e <= 2;
e++)
344 for (
int s = 1;
s <= 12;
s++) {
345 char endcap_sector[50];
347 sprintf(endcap_sector,
"Wp2S%02d",
s);
349 sprintf(endcap_sector,
"Wm2S%02d",
s);
354 sprintf(
pos,
"pos_x_dt1_csc1_%s", endcap_sector);
355 sprintf(neg,
"neg_x_dt1_csc1_%s", endcap_sector);
359 sprintf(
pos,
"pos_x_dt1_csc2_%s", endcap_sector);
360 sprintf(neg,
"neg_x_dt1_csc2_%s", endcap_sector);
364 sprintf(
pos,
"pos_x_dt2_csc1_%s", endcap_sector);
365 sprintf(neg,
"neg_x_dt2_csc1_%s", endcap_sector);
385 for (ConstTrajTrackPairCollection::const_iterator trajtrack = trajtracks.begin(); trajtrack != trajtracks.end();
401 if (!(
muon->isTrackerMuon() &&
muon->innerTrack().isNonnull()))
422 std::vector<DetId> chamberIds = mrft.
chamberIds();
423 for (
unsigned ch = 0; ch < chamberIds.size(); ch++)
434 for (std::vector<DetId>::const_iterator chamberId = chamberIds.begin(); chamberId != chamberIds.end(); ++chamberId) {
445 for (std::vector<DetId>::const_iterator otherId = chamberIds.begin(); otherId != chamberIds.end(); ++otherId) {
448 if (thisid.rawId() != thatid.rawId() && thisid.wheel() == thatid.wheel() &&
449 thisid.sector() == thatid.sector()) {
459 if (thatid.station() - thisid.station() == 1)
460 st = thisid.station();
462 m_dt13_resid[thisid.wheel() + 2][thisid.sector() - 1][st - 1]->Fill(qoverpt, residdiff);
463 m_dt13_slope[thisid.wheel() + 2][thisid.sector() - 1][st - 1]->Fill(qoverpt, slopediff);
465 m_posdt13_resid[thisid.wheel() + 2][thisid.sector() - 1][st - 1]->Fill(residdiff);
466 m_posdt13_slope[thisid.wheel() + 2][thisid.sector() - 1][st - 1]->Fill(slopediff);
468 m_negdt13_resid[thisid.wheel() + 2][thisid.sector() - 1][st - 1]->Fill(residdiff);
469 m_negdt13_slope[thisid.wheel() + 2][thisid.sector() - 1][st - 1]->Fill(slopediff);
478 if (!(
abs(thisid.wheel()) == 2 && (thisid.station() == 1 || thisid.station() == 2)))
483 if (!((thatid.station() == 1 && thatid.ring() == 3) || (thatid.station() == 2 && thatid.ring() == 2)))
498 if (thisid.station() == 1 && thatid.station() == 1) {
503 }
else if (thisid.station() == 1 && thatid.station() == 2) {
508 }
else if (thisid.station() == 2 && thatid.station() == 1) {
522 for (std::vector<DetId>::const_iterator otherId = chamberIds.begin(); otherId != chamberIds.end(); ++otherId) {
525 if (thisid.rawId() != thatid.rawId() && thisid.wheel() == thatid.wheel() &&
526 thisid.sector() == thatid.sector()) {
536 if (thatid.station() - thisid.station() == 1)
537 st = thisid.station();
539 m_dt2_resid[thisid.wheel() + 2][thisid.sector() - 1][st - 1]->Fill(qoverpt, residdiff);
540 m_dt2_slope[thisid.wheel() + 2][thisid.sector() - 1][st - 1]->Fill(qoverpt, slopediff);
542 m_posdt2_resid[thisid.wheel() + 2][thisid.sector() - 1][st - 1]->Fill(residdiff);
543 m_posdt2_slope[thisid.wheel() + 2][thisid.sector() - 1][st - 1]->Fill(slopediff);
545 m_negdt2_resid[thisid.wheel() + 2][thisid.sector() - 1][st - 1]->Fill(residdiff);
546 m_negdt2_slope[thisid.wheel() + 2][thisid.sector() - 1][st - 1]->Fill(slopediff);
560 CSCDetId thisid(chamberId->rawId());
561 for (std::vector<DetId>::const_iterator otherId = chamberIds.begin(); otherId != chamberIds.end(); ++otherId) {
564 if (thisid.rawId() != thatid.rawId() && thisid.endcap() == thatid.endcap()) {
573 int thischamber = thisid.chamber();
574 int thisring = thisid.ring();
575 if (thisid.station() == 1 && (thisring == 1 || thisring == 4)) {
576 thischamber = (thischamber - 1) / 2 + 1;
580 if (thisring == thatid.ring() && thischamber == thatid.chamber()) {
581 bool inner = (thisring == 1);
582 bool outer = (thisring == 2);
584 if (thatid.station() - thisid.station() == 1 && (
inner || thisid.station() < 3))
585 st = thisid.station();
587 if (
outer && st > 0) {
588 m_cscouter_resid[thisid.endcap() - 1][thischamber - 1][st - 1]->Fill(qoverpz, residdiff);
589 m_cscouter_slope[thisid.endcap() - 1][thischamber - 1][st - 1]->Fill(qoverpz, slopediff);
598 if (
inner && st > 0) {
599 m_cscinner_resid[thisid.endcap() - 1][thischamber - 1][st - 1]->Fill(qoverpz, residdiff);
600 m_cscinner_slope[thisid.endcap() - 1][thischamber - 1][st - 1]->Fill(qoverpz, slopediff);
623 "AlignmentMonitorSegmentDifferences");
align::GlobalPoints toGlobal(const align::LocalPoints &) const
Return in global coord given a set of local points.
AlignableNavigator * pNavigator()
TH1F * m_poscscouter_resid[2][36][2]
TH1F * m_negdt13_resid[5][12][3]
int trackerNumHits() const
TH1F * m_posdt2_slope[5][12][2]
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]
double m_maxTrackerRedChi2
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]
bool m_minNCrossedChambers
TProfile * m_cscinner_resid[2][18][3]
TH1F * m_negcscouter_slope[2][36][2]
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 * 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]
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
bool getData(T &iHolder) const
std::vector< ConstTrajTrackPair > ConstTrajTrackPairCollection
const edm::InputTag m_beamSpotTag
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]
void processMuonResidualsFromTrack(MuonResidualsFromTrack &mrft)
double global_residual() const
const std::vector< DetId > chamberIds() const
TH1F * m_x_neg_dt1_csc2_resid[2][12]
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::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