96 , m_minTrackPt(cfg.getParameter<double>(
"minTrackPt"))
97 , m_minTrackerHits(cfg.getParameter<int>(
"minTrackerHits"))
98 , m_maxTrackerRedChi2(cfg.getParameter<double>(
"maxTrackerRedChi2"))
99 , m_allowTIDTEC(cfg.getParameter<bool>(
"allowTIDTEC"))
100 , m_minDT13Hits(cfg.getParameter<int>(
"minDT13Hits"))
101 , m_minDT2Hits(cfg.getParameter<int>(
"minDT2Hits"))
102 , m_minCSCHits(cfg.getParameter<int>(
"minCSCHits"))
107 for (
int wheel = -2; wheel <= +2; wheel++) {
108 for (
int sector = 1; sector <= 12; sector++) {
110 num[0] = (
'0' + (sector / 10));
111 num[1] = (
'0' + (sector % 10));
114 std::string wheelletter;
115 if (wheel == -2) wheelletter =
"A";
116 else if (wheel == -1) wheelletter =
"B";
117 else if (wheel == 0) wheelletter =
"C";
118 else if (wheel == +1) wheelletter =
"D";
119 else if (wheel == +2) wheelletter =
"E";
123 name = (std::string(
"dt13_resid_") + wheelletter + std::string(
"_") + std::string(num) + std::string(
"_12"));
125 pos = std::string(
"pos") +
name;
127 neg = std::string(
"neg") +
name;
130 name = (std::string(
"dt13_resid_") + wheelletter + std::string(
"_") + std::string(num) + std::string(
"_23"));
132 pos = std::string(
"pos") +
name;
134 neg = std::string(
"neg") +
name;
137 name = (std::string(
"dt13_resid_") + wheelletter + std::string(
"_") + std::string(num) + std::string(
"_34"));
139 pos = std::string(
"pos") +
name;
141 neg = std::string(
"neg") +
name;
144 name = (std::string(
"dt2_resid_") + wheelletter + std::string(
"_") + std::string(num) + std::string(
"_12"));
146 pos = std::string(
"pos") +
name;
147 m_posdt2_resid[wheel+2][sector-1][0] =
book1D(
"/iterN/", pos.c_str(), pos.c_str(), 100, -20., 20.);
148 neg = std::string(
"neg") +
name;
149 m_negdt2_resid[wheel+2][sector-1][0] =
book1D(
"/iterN/", neg.c_str(), neg.c_str(), 100, -20., 20.);
151 name = (std::string(
"dt2_resid_") + wheelletter + std::string(
"_") + std::string(num) + std::string(
"_23"));
153 pos = std::string(
"pos") +
name;
154 m_posdt2_resid[wheel+2][sector-1][1] =
book1D(
"/iterN/", pos.c_str(), pos.c_str(), 100, -20., 20.);
155 neg = std::string(
"neg") +
name;
156 m_negdt2_resid[wheel+2][sector-1][1] =
book1D(
"/iterN/", neg.c_str(), neg.c_str(), 100, -20., 20.);
158 name = (std::string(
"dt13_slope_") + wheelletter + std::string(
"_") + std::string(num) + std::string(
"_12"));
160 pos = std::string(
"pos") +
name;
162 neg = std::string(
"neg") +
name;
165 name = (std::string(
"dt13_slope_") + wheelletter + std::string(
"_") + std::string(num) + std::string(
"_23"));
167 pos = std::string(
"pos") +
name;
169 neg = std::string(
"neg") +
name;
172 name = (std::string(
"dt13_slope_") + wheelletter + std::string(
"_") + std::string(num) + std::string(
"_34"));
174 pos = std::string(
"pos") +
name;
176 neg = std::string(
"neg") +
name;
179 name = (std::string(
"dt2_slope_") + wheelletter + std::string(
"_") + std::string(num) + std::string(
"_12"));
181 pos = std::string(
"pos") +
name;
182 m_posdt2_slope[wheel+2][sector-1][0] =
book1D(
"/iterN/", pos.c_str(), pos.c_str(), 100, -100., 100.);
183 neg = std::string(
"neg") +
name;
184 m_negdt2_slope[wheel+2][sector-1][0] =
book1D(
"/iterN/", neg.c_str(), neg.c_str(), 100, -100., 100.);
186 name = (std::string(
"dt2_slope_") + wheelletter + std::string(
"_") + std::string(num) + std::string(
"_23"));
188 pos = std::string(
"pos") +
name;
189 m_posdt2_slope[wheel+2][sector-1][1] =
book1D(
"/iterN/", pos.c_str(), pos.c_str(), 100, -100., 100.);
190 neg = std::string(
"neg") +
name;
191 m_negdt2_slope[wheel+2][sector-1][1] =
book1D(
"/iterN/", neg.c_str(), neg.c_str(), 100, -100., 100.);
196 for (
int chamber = 1; chamber <= 36; chamber++) {
198 num[0] = (
'0' + (chamber / 10));
199 num[1] = (
'0' + (chamber % 10));
202 std::string endcapletter;
203 if (
endcap == 1) endcapletter =
"p";
204 else if (
endcap == 2) endcapletter =
"m";
208 name = (std::string(
"cscouter_resid_") + endcapletter + std::string(
"_") + std::string(num) + std::string(
"_12"));
210 pos = std::string(
"pos") +
name;
212 neg = std::string(
"neg") +
name;
215 name = (std::string(
"cscouter_resid_") + endcapletter + std::string(
"_") + std::string(num) + std::string(
"_23"));
217 pos = std::string(
"pos") +
name;
219 neg = std::string(
"neg") +
name;
222 name = (std::string(
"cscouter_slope_") + endcapletter + std::string(
"_") + std::string(num) + std::string(
"_12"));
224 pos = std::string(
"pos") +
name;
226 neg = std::string(
"neg") +
name;
229 name = (std::string(
"cscouter_slope_") + endcapletter + std::string(
"_") + std::string(num) + std::string(
"_23"));
231 pos = std::string(
"pos") +
name;
233 neg = std::string(
"neg") +
name;
237 for (
int chamber = 1; chamber <= 18; chamber++) {
239 num[0] = (
'0' + (chamber / 10));
240 num[1] = (
'0' + (chamber % 10));
243 std::string endcapletter;
244 if (
endcap == 1) endcapletter =
"p";
245 else if (
endcap == 2) endcapletter =
"m";
249 name = (std::string(
"cscinner_resid_") + endcapletter + std::string(
"_") + std::string(num) + std::string(
"_12"));
251 pos = std::string(
"pos") +
name;
253 neg = std::string(
"neg") +
name;
256 name = (std::string(
"cscinner_resid_") + endcapletter + std::string(
"_") + std::string(num) + std::string(
"_23"));
258 pos = std::string(
"pos") +
name;
260 neg = std::string(
"neg") +
name;
263 name = (std::string(
"cscinner_resid_") + endcapletter + std::string(
"_") + std::string(num) + std::string(
"_34"));
265 pos = std::string(
"pos") +
name;
267 neg = std::string(
"neg") +
name;
270 name = (std::string(
"cscinner_slope_") + endcapletter + std::string(
"_") + std::string(num) + std::string(
"_12"));
272 pos = std::string(
"pos") +
name;
274 neg = std::string(
"neg") +
name;
277 name = (std::string(
"cscinner_slope_") + endcapletter + std::string(
"_") + std::string(num) + std::string(
"_23"));
279 pos = std::string(
"pos") +
name;
281 neg = std::string(
"neg") +
name;
284 name = (std::string(
"cscinner_slope_") + endcapletter + std::string(
"_") + std::string(num) + std::string(
"_34"));
286 pos = std::string(
"pos") +
name;
288 neg = std::string(
"neg") +
name;
298 for (ConstTrajTrackPairCollection::const_iterator trajtrack = trajtracks.begin(); trajtrack != trajtracks.end(); ++trajtrack) {
303 double qoverpt = (track->
charge() > 0 ? 1. : -1.) / track->
pt();
307 std::vector<DetId> chamberIds = muonResidualsFromTrack.
chamberIds();
309 for (std::vector<DetId>::const_iterator chamberId = chamberIds.begin(); chamberId != chamberIds.end(); ++chamberId) {
317 for (std::vector<DetId>::const_iterator otherId = chamberIds.begin(); otherId != chamberIds.end(); ++otherId) {
320 if (thisid.rawId() != thatid.rawId() && thisid.wheel() == thatid.wheel() && thisid.sector() == thatid.sector()) {
328 if (thisid.station() == 1 && thatid.station() == 2) {
329 m_dt13_resid[thisid.wheel()+2][thisid.sector()-1][0]->Fill(qoverpt, residdiff);
330 m_dt13_slope[thisid.wheel()+2][thisid.sector()-1][0]->Fill(qoverpt, slopediff);
332 m_posdt13_resid[thisid.wheel()+2][thisid.sector()-1][0]->Fill(residdiff);
333 m_posdt13_slope[thisid.wheel()+2][thisid.sector()-1][0]->Fill(slopediff);
336 m_negdt13_resid[thisid.wheel()+2][thisid.sector()-1][0]->Fill(residdiff);
337 m_negdt13_slope[thisid.wheel()+2][thisid.sector()-1][0]->Fill(slopediff);
340 else if (thisid.station() == 2 && thatid.station() == 3) {
341 m_dt13_resid[thisid.wheel()+2][thisid.sector()-1][1]->Fill(qoverpt, residdiff);
342 m_dt13_slope[thisid.wheel()+2][thisid.sector()-1][1]->Fill(qoverpt, slopediff);
344 m_posdt13_resid[thisid.wheel()+2][thisid.sector()-1][1]->Fill(residdiff);
345 m_posdt13_slope[thisid.wheel()+2][thisid.sector()-1][1]->Fill(slopediff);
348 m_negdt13_resid[thisid.wheel()+2][thisid.sector()-1][1]->Fill(residdiff);
349 m_negdt13_slope[thisid.wheel()+2][thisid.sector()-1][1]->Fill(slopediff);
352 else if (thisid.station() == 3 && thatid.station() == 4) {
353 m_dt13_resid[thisid.wheel()+2][thisid.sector()-1][2]->Fill(qoverpt, residdiff);
354 m_dt13_slope[thisid.wheel()+2][thisid.sector()-1][2]->Fill(qoverpt, slopediff);
356 m_posdt13_resid[thisid.wheel()+2][thisid.sector()-1][2]->Fill(residdiff);
357 m_posdt13_slope[thisid.wheel()+2][thisid.sector()-1][2]->Fill(slopediff);
360 m_negdt13_resid[thisid.wheel()+2][thisid.sector()-1][2]->Fill(residdiff);
361 m_negdt13_slope[thisid.wheel()+2][thisid.sector()-1][2]->Fill(slopediff);
375 for (std::vector<DetId>::const_iterator otherId = chamberIds.begin(); otherId != chamberIds.end(); ++otherId) {
378 if (thisid.rawId() != thatid.rawId() && thisid.wheel() == thatid.wheel() && thisid.sector() == thatid.sector()) {
386 if (thisid.station() == 1 && thatid.station() == 2) {
387 m_dt2_resid[thisid.wheel()+2][thisid.sector()-1][0]->Fill(qoverpt, residdiff);
388 m_dt2_slope[thisid.wheel()+2][thisid.sector()-1][0]->Fill(qoverpt, slopediff);
390 m_posdt2_resid[thisid.wheel()+2][thisid.sector()-1][0]->Fill(residdiff);
391 m_posdt2_slope[thisid.wheel()+2][thisid.sector()-1][0]->Fill(slopediff);
394 m_negdt2_resid[thisid.wheel()+2][thisid.sector()-1][0]->Fill(residdiff);
395 m_negdt2_slope[thisid.wheel()+2][thisid.sector()-1][0]->Fill(slopediff);
398 else if (thisid.station() == 2 && thatid.station() == 3) {
399 m_dt2_resid[thisid.wheel()+2][thisid.sector()-1][1]->Fill(qoverpt, residdiff);
400 m_dt2_slope[thisid.wheel()+2][thisid.sector()-1][1]->Fill(qoverpt, slopediff);
402 m_posdt2_resid[thisid.wheel()+2][thisid.sector()-1][1]->Fill(residdiff);
403 m_posdt2_slope[thisid.wheel()+2][thisid.sector()-1][1]->Fill(slopediff);
406 m_negdt2_resid[thisid.wheel()+2][thisid.sector()-1][1]->Fill(residdiff);
407 m_negdt2_slope[thisid.wheel()+2][thisid.sector()-1][1]->Fill(slopediff);
410 else if (thisid.station() == 3 && thatid.station() == 4) {
411 m_dt2_resid[thisid.wheel()+2][thisid.sector()-1][2]->Fill(qoverpt, residdiff);
412 m_dt2_slope[thisid.wheel()+2][thisid.sector()-1][2]->Fill(qoverpt, slopediff);
414 m_posdt2_resid[thisid.wheel()+2][thisid.sector()-1][2]->Fill(residdiff);
415 m_posdt2_slope[thisid.wheel()+2][thisid.sector()-1][2]->Fill(slopediff);
418 m_negdt2_resid[thisid.wheel()+2][thisid.sector()-1][2]->Fill(residdiff);
419 m_negdt2_slope[thisid.wheel()+2][thisid.sector()-1][2]->Fill(slopediff);
435 CSCDetId thisid(chamberId->rawId());
437 for (std::vector<DetId>::const_iterator otherId = chamberIds.begin(); otherId != chamberIds.end(); ++otherId) {
440 if (thisid.rawId() != thatid.rawId() && thisid.endcap() == thatid.endcap()) {
448 int thischamber = thisid.chamber();
449 int thisring = thisid.ring();
450 if (thisid.station() == 1 && (thisring == 1 || thisring == 4)) {
451 thischamber = (thischamber - 1) / 2 + 1;
455 if (thisring == thatid.ring() && thischamber == thatid.chamber()) {
456 if (thisring == 2 && thisid.station() == 1 && thatid.station() == 2) {
457 m_cscouter_resid[thisid.endcap()-1][thischamber-1][0]->Fill(qoverpt, residdiff);
458 m_cscouter_slope[thisid.endcap()-1][thischamber-1][0]->Fill(qoverpt, slopediff);
468 else if (thisring == 2 && thisid.station() == 2 && thatid.station() == 3) {
469 m_cscouter_resid[thisid.endcap()-1][thischamber-1][1]->Fill(qoverpt, residdiff);
470 m_cscouter_slope[thisid.endcap()-1][thischamber-1][1]->Fill(qoverpt, slopediff);
480 else if (thisring == 1 && thisid.station() == 1 && thatid.station() == 2) {
481 m_cscinner_resid[thisid.endcap()-1][thischamber-1][0]->Fill(qoverpt, residdiff);
482 m_cscinner_slope[thisid.endcap()-1][thischamber-1][0]->Fill(qoverpt, slopediff);
492 else if (thisring == 1 && thisid.station() == 2 && thatid.station() == 3) {
493 m_cscinner_resid[thisid.endcap()-1][thischamber-1][1]->Fill(qoverpt, residdiff);
494 m_cscinner_slope[thisid.endcap()-1][thischamber-1][1]->Fill(qoverpt, slopediff);
504 else if (thisring == 1 && thisid.station() == 3 && thatid.station() == 4) {
505 m_cscinner_resid[thisid.endcap()-1][thischamber-1][2]->Fill(qoverpt, residdiff);
506 m_cscinner_slope[thisid.endcap()-1][thischamber-1][2]->Fill(qoverpt, slopediff);
AlignableNavigator * pNavigator()
TH1F * m_poscscouter_resid[2][36][2]
void book()
Book or retrieve histograms; MUST be reimplemented.
TH1F * m_negdt13_resid[5][12][3]
TH1F * m_posdt2_slope[5][12][2]
double m_maxTrackerRedChi2
AlignmentMonitorSegmentDifferences(const edm::ParameterSet &cfg)
TProfile * m_dt2_slope[5][12][2]
int trackerNumHits() const
TH1F * m_negdt13_slope[5][12][3]
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
void event(const edm::Event &iEvent, const edm::EventSetup &iSetup, const ConstTrajTrackPairCollection &iTrajTracks)
Called for each event (by "run()"): may be reimplemented.
~AlignmentMonitorSegmentDifferences()
TH1F * m_negcscinner_slope[2][18][3]
const std::vector< DetId > chamberIds() const
TH1F * m_negcscinner_resid[2][18][3]
void afterAlignment(const edm::EventSetup &iSetup)
TH1F * m_posdt2_resid[5][12][2]
TProfile * m_dt2_resid[5][12][2]
TH1F * m_negcscouter_resid[2][36][2]
double pt() const
track transverse momentum
AlignableDetOrUnitPtr chamberAlignable() const
TH1F * m_poscscouter_slope[2][36][2]
TH1F * m_posdt13_resid[5][12][3]
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)
const AlignableSurface & surface() const
Return the Surface (global position and orientation) of the object.
TH1F * m_poscscinner_resid[2][18][3]
double trackerRedChi2() const
TH1F * m_negdt2_slope[5][12][2]
TProfile * m_cscouter_resid[2][36][2]
TH1F * m_posdt13_slope[5][12][3]
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_negdt2_resid[5][12][2]
TProfile * m_cscinner_slope[2][18][3]
MuonChamberResidual * chamberResidual(DetId chamberId, int type)
TH1F * m_poscscinner_slope[2][18][3]
TProfile * m_dt13_slope[5][12][3]
bool contains_TIDTEC() const