116 ,
m_minTrackP(cfg.getParameter<double>(
"minTrackP"))
117 ,
m_maxDxy(cfg.getParameter<double>(
"maxDxy"))
125 ,
m_doDT(cfg.getParameter<bool>(
"doDT"))
126 ,
m_doCSC(cfg.getParameter<bool>(
"doCSC"))
132 char name[222],
pos[222], neg[222];
138 char wheel_label[][2]={
"A",
"B",
"C",
"D",
"E"};
139 for (
int sector = 1; sector <= 12; sector++)
141 char wheel_sector[50];
142 sprintf(wheel_sector,
"%s_%02d", wheel_label[
wheel+2], sector );
147 sprintf(name,
"dt13_resid_%s_12", wheel_sector);
148 sprintf(pos,
"pos%s", name);
149 sprintf(neg,
"neg%s", name);
154 sprintf(name,
"dt13_resid_%s_23", wheel_sector);
155 sprintf(pos,
"pos%s", name);
156 sprintf(neg,
"neg%s", name);
161 sprintf(name,
"dt13_resid_%s_34", wheel_sector);
162 sprintf(pos,
"pos%s", name);
163 sprintf(neg,
"neg%s", name);
168 sprintf(name,
"dt2_resid_%s_12", wheel_sector);
169 sprintf(pos,
"pos%s", name);
170 sprintf(neg,
"neg%s", name);
175 sprintf(name,
"dt2_resid_%s_23", wheel_sector);
176 sprintf(pos,
"pos%s", name);
177 sprintf(neg,
"neg%s", name);
182 sprintf(name,
"dt13_slope_%s_12", wheel_sector);
183 sprintf(pos,
"pos%s", name);
184 sprintf(neg,
"neg%s", name);
189 sprintf(name,
"dt13_slope_%s_23", wheel_sector);
190 sprintf(pos,
"pos%s", name);
191 sprintf(neg,
"neg%s", name);
196 sprintf(name,
"dt13_slope_%s_34", wheel_sector);
197 sprintf(pos,
"pos%s", name);
198 sprintf(neg,
"neg%s", name);
203 sprintf(name,
"dt2_slope_%s_12", wheel_sector);
204 sprintf(pos,
"pos%s", name);
205 sprintf(neg,
"neg%s", name);
210 sprintf(name,
"dt2_slope_%s_23", wheel_sector);
211 sprintf(pos,
"pos%s", name);
212 sprintf(neg,
"neg%s", name);
222 if (
endcap == 1) endcapletter =
"p";
223 else if (
endcap == 2) endcapletter =
"m";
228 sprintf(ec_chamber,
"%s_%02d", endcapletter.c_str(),
chamber );
233 sprintf(name,
"cscouter_resid_%s_12",ec_chamber);
234 sprintf(pos,
"pos%s", name);
235 sprintf(neg,
"neg%s", name);
240 sprintf(name,
"cscouter_resid_%s_23",ec_chamber);
241 sprintf(pos,
"pos%s", name);
242 sprintf(neg,
"neg%s", name);
247 sprintf(name,
"cscouter_slope_%s_12",ec_chamber);
248 sprintf(pos,
"pos%s", name);
249 sprintf(neg,
"neg%s", name);
254 sprintf(name,
"cscouter_slope_%s_23",ec_chamber);
255 sprintf(pos,
"pos%s", name);
256 sprintf(neg,
"neg%s", name);
265 sprintf(ec_chamber,
"%s_%02d", endcapletter.c_str(),
chamber );
270 sprintf(name,
"cscinner_resid_%s_12",ec_chamber);
271 sprintf(pos,
"pos%s", name);
272 sprintf(neg,
"neg%s", name);
277 sprintf(name,
"cscinner_resid_%s_23",ec_chamber);
278 sprintf(pos,
"pos%s", name);
279 sprintf(neg,
"neg%s", name);
284 sprintf(name,
"cscinner_resid_%s_34",ec_chamber);
285 sprintf(pos,
"pos%s", name);
286 sprintf(neg,
"neg%s", name);
291 sprintf(name,
"cscinner_slope_%s_12",ec_chamber);
292 sprintf(pos,
"pos%s", name);
293 sprintf(neg,
"neg%s", name);
298 sprintf(name,
"cscinner_slope_%s_23",ec_chamber);
299 sprintf(pos,
"pos%s", name);
300 sprintf(neg,
"neg%s", name);
305 sprintf(name,
"cscinner_slope_%s_34",ec_chamber);
306 sprintf(pos,
"pos%s", name);
307 sprintf(neg,
"neg%s", name);
315 for (
int e = 1;
e<=2;
e++)
316 for (
int s = 1;
s <= 12;
s++)
318 char endcap_sector[50];
319 if (
e == 1) sprintf(endcap_sector,
"Wp2S%02d",
s);
320 if (
e == 2) sprintf(endcap_sector,
"Wm2S%02d",
s);
325 sprintf(pos,
"pos_x_dt1_csc1_%s", endcap_sector);
326 sprintf(neg,
"neg_x_dt1_csc1_%s", endcap_sector);
330 sprintf(pos,
"pos_x_dt1_csc2_%s", endcap_sector);
331 sprintf(neg,
"neg_x_dt1_csc2_%s", endcap_sector);
335 sprintf(pos,
"pos_x_dt2_csc1_%s", endcap_sector);
336 sprintf(neg,
"neg_x_dt2_csc1_%s", endcap_sector);
364 for (ConstTrajTrackPairCollection::const_iterator trajtrack = trajtracks.begin(); trajtrack != trajtracks.end(); ++trajtrack)
381 for (reco::MuonCollection::const_iterator
muon = muons->begin();
muon != muons->end(); ++
muon)
383 if ( !(
muon->isTrackerMuon() &&
muon->innerTrack().isNonnull() ) )
continue;
402 std::vector<DetId> chamberIds = mrft.
chamberIds();
403 for (
unsigned ch=0; ch < chamberIds.size(); ch++)
if (chamberIds[ch].det() ==
DetId::Muon) nMuChambers++;
410 for (std::vector<DetId>::const_iterator chamberId = chamberIds.begin(); chamberId != chamberIds.end(); ++chamberId)
423 for (std::vector<DetId>::const_iterator otherId = chamberIds.begin(); otherId != chamberIds.end(); ++otherId)
428 if (thisid.rawId() != thatid.rawId() && thisid.wheel() == thatid.wheel() && thisid.sector() == thatid.sector())
440 if (thatid.station() - thisid.station() == 1) st = thisid.station();
443 m_dt13_resid[thisid.wheel()+2][thisid.sector()-1][st-1]->Fill(qoverpt, residdiff);
444 m_dt13_slope[thisid.wheel()+2][thisid.sector()-1][st-1]->Fill(qoverpt, slopediff);
447 m_posdt13_resid[thisid.wheel()+2][thisid.sector()-1][st-1]->Fill(residdiff);
448 m_posdt13_slope[thisid.wheel()+2][thisid.sector()-1][st-1]->Fill(slopediff);
452 m_negdt13_resid[thisid.wheel()+2][thisid.sector()-1][st-1]->Fill(residdiff);
453 m_negdt13_slope[thisid.wheel()+2][thisid.sector()-1][st-1]->Fill(slopediff);
462 if ( !(
abs(thisid.wheel()) == 2 && (thisid.station() == 1 || thisid.station() == 2)) )
continue;
467 if ( !( (thatid.station()==1 && thatid.ring()==3) || (thatid.station()==2 && thatid.ring()==2) ) )
continue;
476 if (thisid.station() == 1 && thatid.station()==1)
481 else if (thisid.station() == 1 && thatid.station()==2)
486 else if (thisid.station() == 2 && thatid.station()==1)
500 for (std::vector<DetId>::const_iterator otherId = chamberIds.begin(); otherId != chamberIds.end(); ++otherId)
505 if (thisid.rawId() != thatid.rawId() && thisid.wheel() == thatid.wheel() && thisid.sector() == thatid.sector())
517 if (thatid.station() - thisid.station() == 1) st = thisid.station();
520 m_dt2_resid[thisid.wheel()+2][thisid.sector()-1][st-1]->Fill(qoverpt, residdiff);
521 m_dt2_slope[thisid.wheel()+2][thisid.sector()-1][st-1]->Fill(qoverpt, slopediff);
524 m_posdt2_resid[thisid.wheel()+2][thisid.sector()-1][st-1]->Fill(residdiff);
525 m_posdt2_slope[thisid.wheel()+2][thisid.sector()-1][st-1]->Fill(slopediff);
529 m_negdt2_resid[thisid.wheel()+2][thisid.sector()-1][st-1]->Fill(residdiff);
530 m_negdt2_slope[thisid.wheel()+2][thisid.sector()-1][st-1]->Fill(slopediff);
546 CSCDetId thisid(chamberId->rawId());
547 for (std::vector<DetId>::const_iterator otherId = chamberIds.begin(); otherId != chamberIds.end(); ++otherId)
552 if (thisid.rawId() != thatid.rawId() && thisid.endcap() == thatid.endcap())
563 int thischamber = thisid.chamber();
564 int thisring = thisid.ring();
565 if (thisid.station() == 1 && (thisring == 1 || thisring == 4))
567 thischamber = (thischamber - 1) / 2 + 1;
571 if (thisring == thatid.ring() && thischamber == thatid.chamber())
573 bool inner = (thisring == 1);
574 bool outer = (thisring == 2);
576 if (thatid.station() - thisid.station() == 1 && (inner || thisid.station()<3) ) st = thisid.station();
580 m_cscouter_resid[thisid.endcap()-1][thischamber-1][st-1]->Fill(qoverpz, residdiff);
581 m_cscouter_slope[thisid.endcap()-1][thischamber-1][st-1]->Fill(qoverpz, slopediff);
595 m_cscinner_resid[thisid.endcap()-1][thischamber-1][st-1]->Fill(qoverpz, residdiff);
596 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]
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
void event(const edm::Event &iEvent, const edm::EventSetup &iSetup, const ConstTrajTrackPairCollection &iTrajTracks) override
Called for each event (by "run()"): may be reimplemented.
TH1F * m_negdt13_slope[5][12][3]
bool m_minNCrossedChambers
TProfile * m_cscinner_resid[2][18][3]
TH1F * m_negcscouter_slope[2][36][2]
void afterAlignment(const edm::EventSetup &iSetup) override
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
~AlignmentMonitorSegmentDifferences()
TH1F * m_negcscinner_slope[2][18][3]
const std::vector< DetId > chamberIds() const
void book() override
Book or retrieve histograms; MUST be reimplemented.
TH1F * m_negcscinner_resid[2][18][3]
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]
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]
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)
const Point & position() const
position
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)