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];
146 for (
int wheel = -2; wheel <= +2; wheel++) {
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);
156 sprintf(pos,
"pos%s", name);
157 sprintf(neg,
"neg%s", name);
159 bookProfile(
"/iterN/", name, name, 20, -max_curv, max_curv, 1, -100., 100.,
" ");
163 sprintf(name,
"dt13_resid_%s_23", wheel_sector);
164 sprintf(pos,
"pos%s", name);
165 sprintf(neg,
"neg%s", name);
167 bookProfile(
"/iterN/", name, name, 20, -max_curv, max_curv, 1, -100., 100.,
" ");
171 sprintf(name,
"dt13_resid_%s_34", wheel_sector);
172 sprintf(pos,
"pos%s", name);
173 sprintf(neg,
"neg%s", name);
175 bookProfile(
"/iterN/", name, name, 20, -max_curv, max_curv, 1, -100., 100.,
" ");
179 sprintf(name,
"dt2_resid_%s_12", wheel_sector);
180 sprintf(pos,
"pos%s", name);
181 sprintf(neg,
"neg%s", name);
183 bookProfile(
"/iterN/", name, name, 20, -max_curv, max_curv, 1, -200., 200.,
" ");
187 sprintf(name,
"dt2_resid_%s_23", wheel_sector);
188 sprintf(pos,
"pos%s", name);
189 sprintf(neg,
"neg%s", name);
191 bookProfile(
"/iterN/", name, name, 20, -max_curv, max_curv, 1, -200., 200.,
" ");
195 sprintf(name,
"dt13_slope_%s_12", wheel_sector);
196 sprintf(pos,
"pos%s", name);
197 sprintf(neg,
"neg%s", name);
199 bookProfile(
"/iterN/", name, name, 20, -max_curv, max_curv, 1, -100., 100.,
" ");
203 sprintf(name,
"dt13_slope_%s_23", wheel_sector);
204 sprintf(pos,
"pos%s", name);
205 sprintf(neg,
"neg%s", name);
207 bookProfile(
"/iterN/", name, name, 20, -max_curv, max_curv, 1, -100., 100.,
" ");
211 sprintf(name,
"dt13_slope_%s_34", wheel_sector);
212 sprintf(pos,
"pos%s", name);
213 sprintf(neg,
"neg%s", name);
215 bookProfile(
"/iterN/", name, name, 20, -max_curv, max_curv, 1, -100., 100.,
" ");
219 sprintf(name,
"dt2_slope_%s_12", wheel_sector);
220 sprintf(pos,
"pos%s", name);
221 sprintf(neg,
"neg%s", name);
223 bookProfile(
"/iterN/", name, name, 20, -max_curv, max_curv, 1, -1000., 1000.,
" ");
227 sprintf(name,
"dt2_slope_%s_23", wheel_sector);
228 sprintf(pos,
"pos%s", name);
229 sprintf(neg,
"neg%s", name);
231 bookProfile(
"/iterN/", name, name, 20, -max_curv, max_curv, 1, -1000., 1000.,
" ");
245 for (
int chamber = 1; chamber <= 36; chamber++) {
247 sprintf(ec_chamber,
"%s_%02d", endcapletter.c_str(), chamber);
252 sprintf(name,
"cscouter_resid_%s_12", ec_chamber);
253 sprintf(pos,
"pos%s", name);
254 sprintf(neg,
"neg%s", name);
256 bookProfile(
"/iterN/", name, name, 20, -max_curv, max_curv, 1, -100., 100.,
" ");
260 sprintf(name,
"cscouter_resid_%s_23", ec_chamber);
261 sprintf(pos,
"pos%s", name);
262 sprintf(neg,
"neg%s", name);
264 bookProfile(
"/iterN/", name, name, 20, -max_curv, max_curv, 1, -100., 100.,
" ");
268 sprintf(name,
"cscouter_slope_%s_12", ec_chamber);
269 sprintf(pos,
"pos%s", name);
270 sprintf(neg,
"neg%s", name);
272 bookProfile(
"/iterN/", name, name, 20, -max_curv, max_curv, 1, -100., 100.,
" ");
276 sprintf(name,
"cscouter_slope_%s_23", ec_chamber);
277 sprintf(pos,
"pos%s", name);
278 sprintf(neg,
"neg%s", name);
280 bookProfile(
"/iterN/", name, name, 20, -max_curv, max_curv, 1, -100., 100.,
" ");
285 for (
int chamber = 1; chamber <= 18; chamber++) {
287 sprintf(ec_chamber,
"%s_%02d", endcapletter.c_str(), chamber);
292 sprintf(name,
"cscinner_resid_%s_12", ec_chamber);
293 sprintf(pos,
"pos%s", name);
294 sprintf(neg,
"neg%s", name);
296 bookProfile(
"/iterN/", name, name, 20, -max_curv, max_curv, 1, -100., 100.,
" ");
300 sprintf(name,
"cscinner_resid_%s_23", ec_chamber);
301 sprintf(pos,
"pos%s", name);
302 sprintf(neg,
"neg%s", name);
304 bookProfile(
"/iterN/", name, name, 20, -max_curv, max_curv, 1, -100., 100.,
" ");
308 sprintf(name,
"cscinner_resid_%s_34", ec_chamber);
309 sprintf(pos,
"pos%s", name);
310 sprintf(neg,
"neg%s", name);
312 bookProfile(
"/iterN/", name, name, 20, -max_curv, max_curv, 1, -100., 100.,
" ");
316 sprintf(name,
"cscinner_slope_%s_12", ec_chamber);
317 sprintf(pos,
"pos%s", name);
318 sprintf(neg,
"neg%s", name);
320 bookProfile(
"/iterN/", name, name, 20, -max_curv, max_curv, 1, -100., 100.,
" ");
324 sprintf(name,
"cscinner_slope_%s_23", ec_chamber);
325 sprintf(pos,
"pos%s", name);
326 sprintf(neg,
"neg%s", name);
328 bookProfile(
"/iterN/", name, name, 20, -max_curv, max_curv, 1, -100., 100.,
" ");
332 sprintf(name,
"cscinner_slope_%s_34", ec_chamber);
333 sprintf(pos,
"pos%s", name);
334 sprintf(neg,
"neg%s", name);
336 bookProfile(
"/iterN/", name, name, 20, -max_curv, max_curv, 1, -100., 100.,
" ");
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();
392 builder, magneticField, globalGeometry, muonDetIdAssociator_, prop, traj, track,
pNavigator(), 1000.);
400 for (reco::MuonCollection::const_iterator
muon = muons->begin();
muon != muons->end(); ++
muon) {
401 if (!(
muon->isTrackerMuon() &&
muon->innerTrack().isNonnull()))
405 fabs(
muon->innerTrack()->dxy(beamSpot->position())) <
m_maxDxy) {
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");
double p() const
momentum vector magnitude
AlignableNavigator * pNavigator()
TH1F * m_poscscouter_resid[2][36][2]
TH1F * m_negdt13_resid[5][12][3]
TH1F * m_posdt2_slope[5][12][2]
edm::InputTag m_muonCollectionTag
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]
int trackerNumHits() const
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")
double global_residual() const
TH1F * m_negcscinner_slope[2][18][3]
AlignmentMonitorSegmentDifferences(const edm::ParameterSet &cfg, edm::ConsumesCollector iC)
const std::vector< DetId > chamberIds() const
void book() override
Book or retrieve histograms; MUST be reimplemented.
bool getData(T &iHolder) const
TH1F * m_negcscinner_resid[2][18][3]
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]
double pt() const
track transverse momentum
const reco::Track * getTrack()
AlignableDetOrUnitPtr chamberAlignable() const
TH1F * m_poscscouter_slope[2][36][2]
TH1F * m_posdt13_resid[5][12][3]
Abs< T >::type abs(const T &t)
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)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
const AlignableSurface & surface() const
Return the Surface (global position and orientation) of the object.
double pz() const
z coordinate of momentum vector
double normalizedChi2() const
TH1F * m_poscscinner_resid[2][18][3]
void processMuonResidualsFromTrack(MuonResidualsFromTrack &mrft)
TH1F * m_x_neg_dt1_csc2_resid[2][12]
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
align::GlobalPoints toGlobal(const align::LocalPoints &) const
Return in global coord given a set of local points.
TProfile * m_dt13_resid[5][12][3]
double global_resslope() const
int charge() const
track electric charge
#define DEFINE_EDM_PLUGIN(factory, type, name)
TH1F * m_x_pos_dt1_csc1_resid[2][12]
TH1F * m_negdt2_resid[5][12][2]
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > m_esTokenMF
double dxy() const
dxy parameter. (This is the transverse impact parameter w.r.t. to (0,0,0) ONLY if refPoint is close t...
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]
bool contains_TIDTEC() const
MuonChamberResidual * chamberResidual(DetId chamberId, int type)