108 , m_muonCollectionTag(cfg.getParameter<edm::InputTag>(
"muonCollectionTag"))
109 , m_minTrackPt(cfg.getParameter<double>(
"minTrackPt"))
110 , m_minTrackP(cfg.getParameter<double>(
"minTrackP"))
111 , m_maxDxy(cfg.getParameter<double>(
"maxDxy"))
112 , m_minTrackerHits(cfg.getParameter<int>(
"minTrackerHits"))
113 , m_maxTrackerRedChi2(cfg.getParameter<double>(
"maxTrackerRedChi2"))
114 , m_allowTIDTEC(cfg.getParameter<bool>(
"allowTIDTEC"))
115 , m_minNCrossedChambers(cfg.getParameter<int>(
"minNCrossedChambers"))
116 , m_minDT13Hits(cfg.getParameter<int>(
"minDT13Hits"))
117 , m_minDT2Hits(cfg.getParameter<int>(
"minDT2Hits"))
118 , m_minCSCHits(cfg.getParameter<int>(
"minCSCHits"))
119 , m_doDT(cfg.getParameter<bool>(
"doDT"))
120 , m_doCSC(cfg.getParameter<bool>(
"doCSC"))
130 if (
m_doDT)
for (
int wheel = -2; wheel <= +2; wheel++)
132 char wheel_label[][2]={
"A",
"B",
"C",
"D",
"E"};
133 for (
int sector = 1; sector <= 12; sector++)
135 char wheel_sector[50];
136 sprintf(wheel_sector,
"%s_%02d", wheel_label[wheel+2], sector );
141 sprintf(name,
"dt13_resid_%s_12", wheel_sector);
142 sprintf(pos,
"pos%s", name);
143 sprintf(neg,
"neg%s", name);
144 m_dt13_resid[wheel+2][sector-1][0] =
bookProfile(
"/iterN/", name, name, 20, -max_curv, max_curv, 1, -100., 100.,
" ");
148 sprintf(name,
"dt13_resid_%s_23", wheel_sector);
149 sprintf(pos,
"pos%s", name);
150 sprintf(neg,
"neg%s", name);
151 m_dt13_resid[wheel+2][sector-1][1] =
bookProfile(
"/iterN/", name, name, 20, -max_curv, max_curv, 1, -100., 100.,
" ");
155 sprintf(name,
"dt13_resid_%s_34", wheel_sector);
156 sprintf(pos,
"pos%s", name);
157 sprintf(neg,
"neg%s", name);
158 m_dt13_resid[wheel+2][sector-1][2] =
bookProfile(
"/iterN/", name, name, 20, -max_curv, max_curv, 1, -100., 100.,
" ");
162 sprintf(name,
"dt2_resid_%s_12", wheel_sector);
163 sprintf(pos,
"pos%s", name);
164 sprintf(neg,
"neg%s", name);
165 m_dt2_resid[wheel+2][sector-1][0] =
bookProfile(
"/iterN/", name, name, 20, -max_curv, max_curv, 1, -200., 200.,
" ");
169 sprintf(name,
"dt2_resid_%s_23", wheel_sector);
170 sprintf(pos,
"pos%s", name);
171 sprintf(neg,
"neg%s", name);
172 m_dt2_resid[wheel+2][sector-1][1] =
bookProfile(
"/iterN/", name, name, 20, -max_curv, max_curv, 1, -200., 200.,
" ");
176 sprintf(name,
"dt13_slope_%s_12", wheel_sector);
177 sprintf(pos,
"pos%s", name);
178 sprintf(neg,
"neg%s", name);
179 m_dt13_slope[wheel+2][sector-1][0] =
bookProfile(
"/iterN/", name, name, 20, -max_curv, max_curv, 1, -100., 100.,
" ");
183 sprintf(name,
"dt13_slope_%s_23", wheel_sector);
184 sprintf(pos,
"pos%s", name);
185 sprintf(neg,
"neg%s", name);
186 m_dt13_slope[wheel+2][sector-1][1] =
bookProfile(
"/iterN/", name, name, 20, -max_curv, max_curv, 1, -100., 100.,
" ");
190 sprintf(name,
"dt13_slope_%s_34", wheel_sector);
191 sprintf(pos,
"pos%s", name);
192 sprintf(neg,
"neg%s", name);
193 m_dt13_slope[wheel+2][sector-1][2] =
bookProfile(
"/iterN/", name, name, 20, -max_curv, max_curv, 1, -100., 100.,
" ");
197 sprintf(name,
"dt2_slope_%s_12", wheel_sector);
198 sprintf(pos,
"pos%s", name);
199 sprintf(neg,
"neg%s", name);
200 m_dt2_slope[wheel+2][sector-1][0] =
bookProfile(
"/iterN/", name, name, 20, -max_curv, max_curv, 1, -1000., 1000.,
" ");
204 sprintf(name,
"dt2_slope_%s_23", wheel_sector);
205 sprintf(pos,
"pos%s", name);
206 sprintf(neg,
"neg%s", name);
207 m_dt2_slope[wheel+2][sector-1][1] =
bookProfile(
"/iterN/", name, name, 20, -max_curv, max_curv, 1, -1000., 1000.,
" ");
216 if (
endcap == 1) endcapletter =
"p";
217 else if (
endcap == 2) endcapletter =
"m";
219 for (
int chamber = 1; chamber <= 36; chamber++)
222 sprintf(ec_chamber,
"%s_%02d", endcapletter.c_str(), chamber );
227 sprintf(name,
"cscouter_resid_%s_12",ec_chamber);
228 sprintf(pos,
"pos%s", name);
229 sprintf(neg,
"neg%s", name);
234 sprintf(name,
"cscouter_resid_%s_23",ec_chamber);
235 sprintf(pos,
"pos%s", name);
236 sprintf(neg,
"neg%s", name);
241 sprintf(name,
"cscouter_slope_%s_12",ec_chamber);
242 sprintf(pos,
"pos%s", name);
243 sprintf(neg,
"neg%s", name);
248 sprintf(name,
"cscouter_slope_%s_23",ec_chamber);
249 sprintf(pos,
"pos%s", name);
250 sprintf(neg,
"neg%s", name);
256 for (
int chamber = 1; chamber <= 18; chamber++)
259 sprintf(ec_chamber,
"%s_%02d", endcapletter.c_str(), chamber );
264 sprintf(name,
"cscinner_resid_%s_12",ec_chamber);
265 sprintf(pos,
"pos%s", name);
266 sprintf(neg,
"neg%s", name);
271 sprintf(name,
"cscinner_resid_%s_23",ec_chamber);
272 sprintf(pos,
"pos%s", name);
273 sprintf(neg,
"neg%s", name);
278 sprintf(name,
"cscinner_resid_%s_34",ec_chamber);
279 sprintf(pos,
"pos%s", name);
280 sprintf(neg,
"neg%s", name);
285 sprintf(name,
"cscinner_slope_%s_12",ec_chamber);
286 sprintf(pos,
"pos%s", name);
287 sprintf(neg,
"neg%s", name);
292 sprintf(name,
"cscinner_slope_%s_23",ec_chamber);
293 sprintf(pos,
"pos%s", name);
294 sprintf(neg,
"neg%s", name);
299 sprintf(name,
"cscinner_slope_%s_34",ec_chamber);
300 sprintf(pos,
"pos%s", name);
301 sprintf(neg,
"neg%s", name);
309 for (
int e = 1;
e<=2;
e++)
310 for (
int s = 1;
s <= 12;
s++)
312 char endcap_sector[50];
313 if (
e == 1) sprintf(endcap_sector,
"Wp2S%02d",
s);
314 if (
e == 2) sprintf(endcap_sector,
"Wm2S%02d",
s);
319 sprintf(pos,
"pos_x_dt1_csc1_%s", endcap_sector);
320 sprintf(neg,
"neg_x_dt1_csc1_%s", endcap_sector);
324 sprintf(pos,
"pos_x_dt1_csc2_%s", endcap_sector);
325 sprintf(neg,
"neg_x_dt1_csc2_%s", endcap_sector);
329 sprintf(pos,
"pos_x_dt2_csc1_%s", endcap_sector);
330 sprintf(neg,
"neg_x_dt2_csc1_%s", endcap_sector);
348 for (ConstTrajTrackPairCollection::const_iterator trajtrack = trajtracks.begin(); trajtrack != trajtracks.end(); ++trajtrack)
365 for (reco::MuonCollection::const_iterator
muon = muons->begin();
muon != muons->end(); ++
muon)
367 if ( !(
muon->isTrackerMuon() &&
muon->innerTrack().isNonnull() ) )
continue;
386 std::vector<DetId> chamberIds = mrft.
chamberIds();
387 for (
unsigned ch=0; ch < chamberIds.size(); ch++)
if (chamberIds[ch].det() ==
DetId::Muon) nMuChambers++;
394 for (std::vector<DetId>::const_iterator chamberId = chamberIds.begin(); chamberId != chamberIds.end(); ++chamberId)
407 for (std::vector<DetId>::const_iterator otherId = chamberIds.begin(); otherId != chamberIds.end(); ++otherId)
412 if (thisid.rawId() != thatid.rawId() && thisid.wheel() == thatid.wheel() && thisid.sector() == thatid.sector())
424 if (thatid.station() - thisid.station() == 1) st = thisid.station();
427 m_dt13_resid[thisid.wheel()+2][thisid.sector()-1][st-1]->Fill(qoverpt, residdiff);
428 m_dt13_slope[thisid.wheel()+2][thisid.sector()-1][st-1]->Fill(qoverpt, slopediff);
431 m_posdt13_resid[thisid.wheel()+2][thisid.sector()-1][st-1]->Fill(residdiff);
432 m_posdt13_slope[thisid.wheel()+2][thisid.sector()-1][st-1]->Fill(slopediff);
436 m_negdt13_resid[thisid.wheel()+2][thisid.sector()-1][st-1]->Fill(residdiff);
437 m_negdt13_slope[thisid.wheel()+2][thisid.sector()-1][st-1]->Fill(slopediff);
446 if ( !(
abs(thisid.wheel()) == 2 && (thisid.station() == 1 || thisid.station() == 2)) )
continue;
451 if ( !( (thatid.station()==1 && thatid.ring()==3) || (thatid.station()==2 && thatid.ring()==2) ) )
continue;
460 if (thisid.station() == 1 && thatid.station()==1)
465 else if (thisid.station() == 1 && thatid.station()==2)
470 else if (thisid.station() == 2 && thatid.station()==1)
484 for (std::vector<DetId>::const_iterator otherId = chamberIds.begin(); otherId != chamberIds.end(); ++otherId)
489 if (thisid.rawId() != thatid.rawId() && thisid.wheel() == thatid.wheel() && thisid.sector() == thatid.sector())
501 if (thatid.station() - thisid.station() == 1) st = thisid.station();
504 m_dt2_resid[thisid.wheel()+2][thisid.sector()-1][st-1]->Fill(qoverpt, residdiff);
505 m_dt2_slope[thisid.wheel()+2][thisid.sector()-1][st-1]->Fill(qoverpt, slopediff);
508 m_posdt2_resid[thisid.wheel()+2][thisid.sector()-1][st-1]->Fill(residdiff);
509 m_posdt2_slope[thisid.wheel()+2][thisid.sector()-1][st-1]->Fill(slopediff);
513 m_negdt2_resid[thisid.wheel()+2][thisid.sector()-1][st-1]->Fill(residdiff);
514 m_negdt2_slope[thisid.wheel()+2][thisid.sector()-1][st-1]->Fill(slopediff);
530 CSCDetId thisid(chamberId->rawId());
531 for (std::vector<DetId>::const_iterator otherId = chamberIds.begin(); otherId != chamberIds.end(); ++otherId)
536 if (thisid.rawId() != thatid.rawId() && thisid.endcap() == thatid.endcap())
547 int thischamber = thisid.chamber();
548 int thisring = thisid.ring();
549 if (thisid.station() == 1 && (thisring == 1 || thisring == 4))
551 thischamber = (thischamber - 1) / 2 + 1;
555 if (thisring == thatid.ring() && thischamber == thatid.chamber())
557 bool inner = (thisring == 1);
558 bool outer = (thisring == 2);
560 if (thatid.station() - thisid.station() == 1 && (inner || thisid.station()<3) ) st = thisid.station();
564 m_cscouter_resid[thisid.endcap()-1][thischamber-1][st-1]->Fill(qoverpz, residdiff);
565 m_cscouter_slope[thisid.endcap()-1][thischamber-1][st-1]->Fill(qoverpz, slopediff);
579 m_cscinner_resid[thisid.endcap()-1][thischamber-1][st-1]->Fill(qoverpz, residdiff);
580 m_cscinner_slope[thisid.endcap()-1][thischamber-1][st-1]->Fill(qoverpz, slopediff);
double p() const
momentum vector magnitude
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]
edm::InputTag m_muonCollectionTag
TH1F * m_x_pos_dt2_csc1_resid[2][12]
double m_maxTrackerRedChi2
AlignmentMonitorSegmentDifferences(const edm::ParameterSet &cfg)
TProfile * m_dt2_slope[5][12][2]
TH1F * m_x_pos_dt1_csc2_resid[2][12]
int trackerNumHits() const
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
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
const reco::Track * getTrack()
AlignableDetOrUnitPtr chamberAlignable() const
TH1F * m_poscscouter_slope[2][36][2]
TH1F * m_posdt13_resid[5][12][3]
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]
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_x_pos_dt1_csc1_resid[2][12]
TH1F * m_negdt2_resid[5][12][2]
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)