114 ,
m_minTrackP(cfg.getParameter<double>(
"minTrackP"))
115 ,
m_maxDxy(cfg.getParameter<double>(
"maxDxy"))
123 ,
m_doDT(cfg.getParameter<bool>(
"doDT"))
124 ,
m_doCSC(cfg.getParameter<bool>(
"doCSC"))
130 char name[222],
pos[222], neg[222];
136 char wheel_label[][2]={
"A",
"B",
"C",
"D",
"E"};
137 for (
int sector = 1; sector <= 12; sector++)
139 char wheel_sector[50];
140 sprintf(wheel_sector,
"%s_%02d", wheel_label[
wheel+2], sector );
145 sprintf(name,
"dt13_resid_%s_12", wheel_sector);
146 sprintf(pos,
"pos%s", name);
147 sprintf(neg,
"neg%s", name);
152 sprintf(name,
"dt13_resid_%s_23", wheel_sector);
153 sprintf(pos,
"pos%s", name);
154 sprintf(neg,
"neg%s", name);
159 sprintf(name,
"dt13_resid_%s_34", wheel_sector);
160 sprintf(pos,
"pos%s", name);
161 sprintf(neg,
"neg%s", name);
166 sprintf(name,
"dt2_resid_%s_12", wheel_sector);
167 sprintf(pos,
"pos%s", name);
168 sprintf(neg,
"neg%s", name);
173 sprintf(name,
"dt2_resid_%s_23", wheel_sector);
174 sprintf(pos,
"pos%s", name);
175 sprintf(neg,
"neg%s", name);
180 sprintf(name,
"dt13_slope_%s_12", wheel_sector);
181 sprintf(pos,
"pos%s", name);
182 sprintf(neg,
"neg%s", name);
187 sprintf(name,
"dt13_slope_%s_23", wheel_sector);
188 sprintf(pos,
"pos%s", name);
189 sprintf(neg,
"neg%s", name);
194 sprintf(name,
"dt13_slope_%s_34", wheel_sector);
195 sprintf(pos,
"pos%s", name);
196 sprintf(neg,
"neg%s", name);
201 sprintf(name,
"dt2_slope_%s_12", wheel_sector);
202 sprintf(pos,
"pos%s", name);
203 sprintf(neg,
"neg%s", name);
208 sprintf(name,
"dt2_slope_%s_23", wheel_sector);
209 sprintf(pos,
"pos%s", name);
210 sprintf(neg,
"neg%s", name);
220 if (
endcap == 1) endcapletter =
"p";
221 else if (
endcap == 2) endcapletter =
"m";
226 sprintf(ec_chamber,
"%s_%02d", endcapletter.c_str(),
chamber );
231 sprintf(name,
"cscouter_resid_%s_12",ec_chamber);
232 sprintf(pos,
"pos%s", name);
233 sprintf(neg,
"neg%s", name);
238 sprintf(name,
"cscouter_resid_%s_23",ec_chamber);
239 sprintf(pos,
"pos%s", name);
240 sprintf(neg,
"neg%s", name);
245 sprintf(name,
"cscouter_slope_%s_12",ec_chamber);
246 sprintf(pos,
"pos%s", name);
247 sprintf(neg,
"neg%s", name);
252 sprintf(name,
"cscouter_slope_%s_23",ec_chamber);
253 sprintf(pos,
"pos%s", name);
254 sprintf(neg,
"neg%s", name);
263 sprintf(ec_chamber,
"%s_%02d", endcapletter.c_str(),
chamber );
268 sprintf(name,
"cscinner_resid_%s_12",ec_chamber);
269 sprintf(pos,
"pos%s", name);
270 sprintf(neg,
"neg%s", name);
275 sprintf(name,
"cscinner_resid_%s_23",ec_chamber);
276 sprintf(pos,
"pos%s", name);
277 sprintf(neg,
"neg%s", name);
282 sprintf(name,
"cscinner_resid_%s_34",ec_chamber);
283 sprintf(pos,
"pos%s", name);
284 sprintf(neg,
"neg%s", name);
289 sprintf(name,
"cscinner_slope_%s_12",ec_chamber);
290 sprintf(pos,
"pos%s", name);
291 sprintf(neg,
"neg%s", name);
296 sprintf(name,
"cscinner_slope_%s_23",ec_chamber);
297 sprintf(pos,
"pos%s", name);
298 sprintf(neg,
"neg%s", name);
303 sprintf(name,
"cscinner_slope_%s_34",ec_chamber);
304 sprintf(pos,
"pos%s", name);
305 sprintf(neg,
"neg%s", name);
313 for (
int e = 1;
e<=2;
e++)
314 for (
int s = 1;
s <= 12;
s++)
316 char endcap_sector[50];
317 if (
e == 1) sprintf(endcap_sector,
"Wp2S%02d",
s);
318 if (
e == 2) sprintf(endcap_sector,
"Wm2S%02d",
s);
323 sprintf(pos,
"pos_x_dt1_csc1_%s", endcap_sector);
324 sprintf(neg,
"neg_x_dt1_csc1_%s", endcap_sector);
328 sprintf(pos,
"pos_x_dt1_csc2_%s", endcap_sector);
329 sprintf(neg,
"neg_x_dt1_csc2_%s", endcap_sector);
333 sprintf(pos,
"pos_x_dt2_csc1_%s", endcap_sector);
334 sprintf(neg,
"neg_x_dt2_csc1_%s", endcap_sector);
362 for (ConstTrajTrackPairCollection::const_iterator trajtrack = trajtracks.begin(); trajtrack != trajtracks.end(); ++trajtrack)
379 for (reco::MuonCollection::const_iterator
muon = muons->begin();
muon != muons->end(); ++
muon)
381 if ( !(
muon->isTrackerMuon() &&
muon->innerTrack().isNonnull() ) )
continue;
400 std::vector<DetId> chamberIds = mrft.
chamberIds();
401 for (
unsigned ch=0; ch < chamberIds.size(); ch++)
if (chamberIds[ch].det() ==
DetId::Muon) nMuChambers++;
408 for (std::vector<DetId>::const_iterator chamberId = chamberIds.begin(); chamberId != chamberIds.end(); ++chamberId)
421 for (std::vector<DetId>::const_iterator otherId = chamberIds.begin(); otherId != chamberIds.end(); ++otherId)
426 if (thisid.rawId() != thatid.rawId() && thisid.wheel() == thatid.wheel() && thisid.sector() == thatid.sector())
438 if (thatid.station() - thisid.station() == 1) st = thisid.station();
441 m_dt13_resid[thisid.wheel()+2][thisid.sector()-1][st-1]->Fill(qoverpt, residdiff);
442 m_dt13_slope[thisid.wheel()+2][thisid.sector()-1][st-1]->Fill(qoverpt, slopediff);
445 m_posdt13_resid[thisid.wheel()+2][thisid.sector()-1][st-1]->Fill(residdiff);
446 m_posdt13_slope[thisid.wheel()+2][thisid.sector()-1][st-1]->Fill(slopediff);
450 m_negdt13_resid[thisid.wheel()+2][thisid.sector()-1][st-1]->Fill(residdiff);
451 m_negdt13_slope[thisid.wheel()+2][thisid.sector()-1][st-1]->Fill(slopediff);
460 if ( !(
abs(thisid.wheel()) == 2 && (thisid.station() == 1 || thisid.station() == 2)) )
continue;
465 if ( !( (thatid.station()==1 && thatid.ring()==3) || (thatid.station()==2 && thatid.ring()==2) ) )
continue;
474 if (thisid.station() == 1 && thatid.station()==1)
479 else if (thisid.station() == 1 && thatid.station()==2)
484 else if (thisid.station() == 2 && thatid.station()==1)
498 for (std::vector<DetId>::const_iterator otherId = chamberIds.begin(); otherId != chamberIds.end(); ++otherId)
503 if (thisid.rawId() != thatid.rawId() && thisid.wheel() == thatid.wheel() && thisid.sector() == thatid.sector())
515 if (thatid.station() - thisid.station() == 1) st = thisid.station();
518 m_dt2_resid[thisid.wheel()+2][thisid.sector()-1][st-1]->Fill(qoverpt, residdiff);
519 m_dt2_slope[thisid.wheel()+2][thisid.sector()-1][st-1]->Fill(qoverpt, slopediff);
522 m_posdt2_resid[thisid.wheel()+2][thisid.sector()-1][st-1]->Fill(residdiff);
523 m_posdt2_slope[thisid.wheel()+2][thisid.sector()-1][st-1]->Fill(slopediff);
527 m_negdt2_resid[thisid.wheel()+2][thisid.sector()-1][st-1]->Fill(residdiff);
528 m_negdt2_slope[thisid.wheel()+2][thisid.sector()-1][st-1]->Fill(slopediff);
544 CSCDetId thisid(chamberId->rawId());
545 for (std::vector<DetId>::const_iterator otherId = chamberIds.begin(); otherId != chamberIds.end(); ++otherId)
550 if (thisid.rawId() != thatid.rawId() && thisid.endcap() == thatid.endcap())
561 int thischamber = thisid.chamber();
562 int thisring = thisid.ring();
563 if (thisid.station() == 1 && (thisring == 1 || thisring == 4))
565 thischamber = (thischamber - 1) / 2 + 1;
569 if (thisring == thatid.ring() && thischamber == thatid.chamber())
571 bool inner = (thisring == 1);
572 bool outer = (thisring == 2);
574 if (thatid.station() - thisid.station() == 1 && (inner || thisid.station()<3) ) st = thisid.station();
578 m_cscouter_resid[thisid.endcap()-1][thischamber-1][st-1]->Fill(qoverpz, residdiff);
579 m_cscouter_slope[thisid.endcap()-1][thischamber-1][st-1]->Fill(qoverpz, slopediff);
593 m_cscinner_resid[thisid.endcap()-1][thischamber-1][st-1]->Fill(qoverpz, residdiff);
594 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]
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)