CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Private Member Functions | Private Attributes
AlignmentMonitorMuonSystemMap1D Class Reference
Inheritance diagram for AlignmentMonitorMuonSystemMap1D:
AlignmentMonitorBase

Classes

class  MuonSystemMapPlot1D
 
struct  MyCSCDetId
 
struct  MyResidual
 
struct  MyTrack
 

Public Member Functions

void afterAlignment () override
 
 AlignmentMonitorMuonSystemMap1D (const edm::ParameterSet &cfg)
 
void book () override
 Book or retrieve histograms; MUST be reimplemented. More...
 
void event (const edm::Event &iEvent, const edm::EventSetup &iSetup, const ConstTrajTrackPairCollection &iTrajTracks) override
 Called for each event (by "run()"): may be reimplemented. More...
 
void processMuonResidualsFromTrack (MuonResidualsFromTrack &mrft, const edm::Event &iEvent)
 
 ~AlignmentMonitorMuonSystemMap1D () override
 
- Public Member Functions inherited from AlignmentMonitorBase
 AlignmentMonitorBase (const edm::ParameterSet &cfg, std::string name)
 Constructor. More...
 
void beginOfJob (AlignableTracker *pTracker, AlignableMuon *pMuon, AlignmentParameterStore *pStore)
 Called at beginning of job: don't reimplement. More...
 
void duringLoop (const edm::Event &iEvent, const edm::EventSetup &iSetup, const ConstTrajTrackPairCollection &iTrajTracks)
 Called for each event: don't reimplement. More...
 
void endOfJob ()
 Called at end of processing: don't implement. More...
 
void endOfLoop ()
 Called at end of loop: don't reimplement. More...
 
void startingNewLoop ()
 Called at beginning of loop: don't reimplement. More...
 
virtual ~AlignmentMonitorBase ()
 Destructor. More...
 

Private Member Functions

std::string num02d (int num)
 

Private Attributes

bool m_allowTIDTEC
 
long m_counter_13numhits
 
long m_counter_2numhits
 
long m_counter_csc
 
long m_counter_cscnumhits
 
long m_counter_dt
 
long m_counter_event
 
long m_counter_track
 
long m_counter_trackdxy
 
long m_counter_trackmoment
 
long m_counter_trackokay
 
bool m_createNtuple
 
TTree * m_cscnt
 
MuonSystemMapPlot1Dm_CSCvsphi_me [2][4][3]
 
MuonSystemMapPlot1Dm_CSCvsr_me [2][4][36]
 
bool m_doCSC
 
bool m_doDT
 
MuonSystemMapPlot1Dm_DTvsphi_station [4][5]
 
MuonSystemMapPlot1Dm_DTvsz_station [4][14]
 
MyCSCDetId m_id
 
double m_maxDxy
 
double m_maxTrackerRedChi2
 
double m_maxTrackP
 
double m_maxTrackPt
 
int m_minCSCHits
 
int m_minDT13Hits
 
int m_minDT2Hits
 
int m_minNCrossedChambers
 
int m_minTrackerHits
 
double m_minTrackP
 
double m_minTrackPt
 
edm::InputTag m_muonCollectionTag
 
std::vector< MuonSystemMapPlot1D * > m_plots
 
MyResidual m_re
 
UInt_t m_run
 
MyTrack m_tr
 
bool m_useStubPosition
 

Additional Inherited Members

- Public Types inherited from AlignmentMonitorBase
typedef std::pair< const Trajectory *, const reco::Track * > ConstTrajTrackPair
 
typedef std::vector< ConstTrajTrackPairConstTrajTrackPairCollection
 
- Protected Member Functions inherited from AlignmentMonitorBase
TH1F * book1D (std::string dir, std::string name, std::string title, int nchX, double lowX, double highX)
 
TH2F * book2D (std::string dir, std::string name, std::string title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
 
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")
 
TFileDirectorydirectory (std::string dir)
 
int iteration ()
 
AlignableMuonpMuon ()
 
AlignableNavigatorpNavigator ()
 
AlignmentParameterStorepStore ()
 
AlignableTrackerpTracker ()
 
- Protected Attributes inherited from AlignmentMonitorBase
const edm::InputTag m_beamSpotTag
 

Detailed Description

Definition at line 34 of file AlignmentMonitorMuonSystemMap1D.cc.

Constructor & Destructor Documentation

AlignmentMonitorMuonSystemMap1D::AlignmentMonitorMuonSystemMap1D ( const edm::ParameterSet cfg)

Definition at line 145 of file AlignmentMonitorMuonSystemMap1D.cc.

References AlignmentMonitorMuonSystemMap1D::MyCSCDetId::e, m_createNtuple, m_cscnt, m_id, m_re, m_run, m_tr, TFileService::make(), AlignmentMonitorMuonSystemMap1D::MyTrack::q, and AlignmentMonitorMuonSystemMap1D::MyResidual::res.

146  : AlignmentMonitorBase(cfg, "AlignmentMonitorMuonSystemMap1D"),
147  m_muonCollectionTag(cfg.getParameter<edm::InputTag>("muonCollectionTag")),
148  m_minTrackPt(cfg.getParameter<double>("minTrackPt")),
149  m_maxTrackPt(cfg.getParameter<double>("maxTrackPt")),
150  m_minTrackP(cfg.getParameter<double>("minTrackP")),
151  m_maxTrackP(cfg.getParameter<double>("maxTrackP")),
152  m_maxDxy(cfg.getParameter<double>("maxDxy")),
153  m_minTrackerHits(cfg.getParameter<int>("minTrackerHits")),
154  m_maxTrackerRedChi2(cfg.getParameter<double>("maxTrackerRedChi2")),
155  m_allowTIDTEC(cfg.getParameter<bool>("allowTIDTEC")),
156  m_minNCrossedChambers(cfg.getParameter<int>("minNCrossedChambers")),
157  m_minDT13Hits(cfg.getParameter<int>("minDT13Hits")),
158  m_minDT2Hits(cfg.getParameter<int>("minDT2Hits")),
159  m_minCSCHits(cfg.getParameter<int>("minCSCHits")),
160  m_doDT(cfg.getParameter<bool>("doDT")),
161  m_doCSC(cfg.getParameter<bool>("doCSC")),
162  m_useStubPosition(cfg.getParameter<bool>("useStubPosition")),
163  m_createNtuple(cfg.getParameter<bool>("createNtuple")) {
164  if (m_createNtuple) {
166  m_cscnt = fs->make<TTree>("mualNtuple", "mualNtuple");
167  m_cscnt->Branch("id", &m_id.e, "e/S:s:r:c:t");
168  m_cscnt->Branch("tr", &m_tr.q, "q/I:pt/F:pz");
169  m_cscnt->Branch("re", &m_re.res, "res/F:slope:rho:phi:z");
170  m_cscnt->Branch("run", &m_run, "run/i");
171  }
172 }
T getParameter(std::string const &) const
AlignmentMonitorBase(const edm::ParameterSet &cfg, std::string name)
Constructor.
T * make(const Args &...args) const
make new ROOT object
Definition: TFileService.h:64
AlignmentMonitorMuonSystemMap1D::~AlignmentMonitorMuonSystemMap1D ( )
inlineoverride

Member Function Documentation

void AlignmentMonitorMuonSystemMap1D::afterAlignment ( )
overridevirtual

Called after updating AlignableTracker and AlignableMuon (by "endOfLoop()"): may be reimplemented

Reimplemented from AlignmentMonitorBase.

Definition at line 484 of file AlignmentMonitorMuonSystemMap1D.cc.

References gather_cfg::cout, m_counter_13numhits, m_counter_2numhits, m_counter_csc, m_counter_cscnumhits, m_counter_dt, m_counter_event, m_counter_track, m_counter_trackdxy, m_counter_trackmoment, and m_counter_trackokay.

Referenced by ~AlignmentMonitorMuonSystemMap1D().

484  {
485  std::cout << "AlignmentMonitorMuonSystemMap1D counters:" << std::endl;
486  std::cout << " monitor m_counter_event = " << m_counter_event << std::endl;
487  std::cout << " monitor m_counter_track = " << m_counter_track << std::endl;
488  std::cout << " monitor m_counter_trackppt = " << m_counter_trackmoment << std::endl;
489  std::cout << " monitor m_counter_trackdxy = " << m_counter_trackdxy << std::endl;
490  std::cout << " monitor m_counter_trackokay = " << m_counter_trackokay << std::endl;
491  std::cout << " monitor m_counter_dt = " << m_counter_dt << std::endl;
492  std::cout << " monitor m_counter_13numhits = " << m_counter_13numhits << std::endl;
493  std::cout << " monitor m_counter_2numhits = " << m_counter_2numhits << std::endl;
494  std::cout << " monitor m_counter_csc = " << m_counter_csc << std::endl;
495  std::cout << " monitor m_counter_cscnumhits = " << m_counter_cscnumhits << std::endl;
496 }
void AlignmentMonitorMuonSystemMap1D::book ( )
overridevirtual

Book or retrieve histograms; MUST be reimplemented.

Implements AlignmentMonitorBase.

Definition at line 181 of file AlignmentMonitorMuonSystemMap1D.cc.

References relativeConstraints::chamber, makeMuonMisalignmentScenario::endcap, m_counter_13numhits, m_counter_2numhits, m_counter_csc, m_counter_cscnumhits, m_counter_dt, m_counter_event, m_counter_track, m_counter_trackdxy, m_counter_trackmoment, m_counter_trackokay, m_CSCvsphi_me, m_CSCvsr_me, m_doCSC, m_doDT, m_DTvsphi_station, m_DTvsz_station, M_PI, m_plots, num02d(), relativeConstraints::ring, relativeConstraints::station, AlCaHLTBitMon_QueryRunRegistry::string, and makeMuonMisalignmentScenario::wheel.

Referenced by ~AlignmentMonitorMuonSystemMap1D().

181  {
182  std::string wheel_label[5] = {"A", "B", "C", "D", "E"};
183 
184  for (unsigned char station = 1; station <= 4; station++) {
185  std::string s_station = std::to_string(station);
186 
187  bool do_y = true;
188  if (station == 4)
189  do_y = false;
190 
191  // *** DT ***
192  if (m_doDT)
193  for (int sector = 1; sector <= 14; sector++) {
194  if ((station < 4 && sector <= 12) || station == 4) {
195  m_DTvsz_station[station - 1][sector - 1] = new MuonSystemMapPlot1D(
196  "DTvsz_st" + s_station + "sec" + num02d(sector), this, 60, -660., 660., do_y, false);
197  m_plots.push_back(m_DTvsz_station[station - 1][sector - 1]);
198  }
199  }
200 
201  if (m_doDT)
202  for (int wheel = -2; wheel <= 2; wheel++) {
203  m_DTvsphi_station[station - 1][wheel + 2] = new MuonSystemMapPlot1D(
204  "DTvsphi_st" + s_station + "wh" + wheel_label[wheel + 2], this, 180, -M_PI, M_PI, do_y, false);
205  m_plots.push_back(m_DTvsphi_station[station - 1][wheel + 2]);
206  }
207 
208  // *** CSC ***
209  if (m_doCSC)
210  for (int endcap = 1; endcap <= 2; endcap++) {
211  std::string s_endcap("m");
212  if (endcap == 1)
213  s_endcap = "p";
214 
215  for (int chamber = 1; chamber <= 36; chamber++) {
216  m_CSCvsr_me[endcap - 1][station - 1][chamber - 1] = new MuonSystemMapPlot1D(
217  "CSCvsr_me" + s_endcap + s_station + "ch" + num02d(chamber), this, 60, 100., 700., false, false);
218  m_plots.push_back(m_CSCvsr_me[endcap - 1][station - 1][chamber - 1]);
219  }
220 
221  for (int ring = 1; ring <= 3; ring++) // the ME1/a (ring4) is not independent from ME1/b (ring1)
222  {
223  std::string s_ring = std::to_string(ring);
224  if ((station > 1 && ring <= 2) || station == 1) {
225  m_CSCvsphi_me[endcap - 1][station - 1][ring - 1] =
226  new MuonSystemMapPlot1D("CSCvsphi_me" + s_endcap + s_station + s_ring,
227  this,
228  180,
229  -M_PI / 180. * 5.,
230  M_PI * (2. - 5. / 180.),
231  false,
232  true);
233  m_plots.push_back(m_CSCvsphi_me[endcap - 1][station - 1][ring - 1]);
234  }
235  }
236  } // endcaps
237  } // stations
238 
239  m_counter_event = 0;
240  m_counter_track = 0;
242  m_counter_trackdxy = 0;
244  m_counter_dt = 0;
246  m_counter_2numhits = 0;
247  m_counter_csc = 0;
249 }
MuonSystemMapPlot1D * m_CSCvsr_me[2][4][36]
MuonSystemMapPlot1D * m_CSCvsphi_me[2][4][3]
#define M_PI
std::vector< MuonSystemMapPlot1D * > m_plots
void AlignmentMonitorMuonSystemMap1D::event ( const edm::Event iEvent,
const edm::EventSetup iSetup,
const ConstTrajTrackPairCollection iTrajTracks 
)
overridevirtual

Called for each event (by "run()"): may be reimplemented.

Reimplemented from AlignmentMonitorBase.

Definition at line 251 of file AlignmentMonitorMuonSystemMap1D.cc.

References pwdgSkimBPark_cfi::beamSpot, reco::TrackBase::dxy(), edm::EventSetup::get(), edm::Event::getByLabel(), edm::InputTag::label(), AlignmentMonitorBase::m_beamSpotTag, m_counter_event, m_counter_track, m_counter_trackdxy, m_counter_trackmoment, m_maxDxy, m_maxTrackP, m_maxTrackPt, m_minTrackP, m_muonCollectionTag, HLT_2018_cff::magneticField, HLT_2018_cff::muon, PDWG_BPHSkim_cff::muons, reco::TrackBase::p(), AlignmentMonitorBase::pNavigator(), reco::BeamSpot::position(), processMuonResidualsFromTrack(), DiDispStaMuonMonitor_cfi::pt, reco::TrackBase::pt(), and HLT_2018_cff::track.

Referenced by Types.EventID::cppID(), and ~AlignmentMonitorMuonSystemMap1D().

253  {
254  m_counter_event++;
255 
257  iSetup.get<GlobalTrackingGeometryRecord>().get(globalGeometry);
258 
260  iEvent.getByLabel(m_beamSpotTag, beamSpot);
261 
262  edm::ESHandle<DetIdAssociator> muonDetIdAssociator_;
263  iSetup.get<DetIdAssociatorRecord>().get("MuonDetIdAssociator", muonDetIdAssociator_);
264 
266  iSetup.get<TrackingComponentsRecord>().get("SteppingHelixPropagatorAny", prop);
267 
269  iSetup.get<IdealMagneticFieldRecord>().get(magneticField);
270 
271  if (m_muonCollectionTag.label().empty()) // use trajectories
272  {
273  for (ConstTrajTrackPairCollection::const_iterator trajtrack = trajtracks.begin(); trajtrack != trajtracks.end();
274  ++trajtrack) {
275  m_counter_track++;
276  const Trajectory *traj = (*trajtrack).first;
277  const reco::Track *track = (*trajtrack).second;
278 
279  if (m_minTrackPt < track->pt() && track->pt() < m_maxTrackPt && m_minTrackP < track->p() &&
280  track->p() < m_maxTrackP) {
282  if (fabs(track->dxy(beamSpot->position())) < m_maxDxy) {
284 
285  MuonResidualsFromTrack muonResidualsFromTrack(
286  iSetup, magneticField, globalGeometry, muonDetIdAssociator_, prop, traj, track, pNavigator(), 1000.);
287  processMuonResidualsFromTrack(muonResidualsFromTrack, iEvent);
288  }
289  } // end if track has acceptable momentum
290  } // end loop over tracks
291  } else {
293  iEvent.getByLabel(m_muonCollectionTag, muons);
294 
295  for (reco::MuonCollection::const_iterator muon = muons->begin(); muon != muons->end(); ++muon) {
296  if (!(muon->isTrackerMuon() && muon->innerTrack().isNonnull()))
297  continue;
298 
299  m_counter_track++;
300 
301  if (m_minTrackPt < muon->pt() && muon->pt() < m_maxTrackPt && m_minTrackP < muon->p() &&
302  muon->p() < m_maxTrackP) {
304  if (fabs(muon->innerTrack()->dxy(beamSpot->position())) < m_maxDxy) {
306 
307  MuonResidualsFromTrack muonResidualsFromTrack(globalGeometry, &(*muon), pNavigator(), 100.);
308  processMuonResidualsFromTrack(muonResidualsFromTrack, iEvent);
309  }
310  }
311  }
312  }
313 }
double p() const
momentum vector magnitude
Definition: TrackBase.h:599
AlignableNavigator * pNavigator()
double pt() const
track transverse momentum
Definition: TrackBase.h:602
const edm::InputTag m_beamSpotTag
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:488
std::string const & label() const
Definition: InputTag.h:36
T get() const
Definition: EventSetup.h:73
const Point & position() const
position
Definition: BeamSpot.h:59
void processMuonResidualsFromTrack(MuonResidualsFromTrack &mrft, const edm::Event &iEvent)
double dxy() const
dxy parameter. (This is the transverse impact parameter w.r.t. to (0,0,0) ONLY if refPoint is close t...
Definition: TrackBase.h:587
std::string AlignmentMonitorMuonSystemMap1D::num02d ( int  num)
private

Definition at line 174 of file AlignmentMonitorMuonSystemMap1D.cc.

References AlCaHLTBitMon_QueryRunRegistry::string, and createJobs::tmp.

Referenced by book().

174  {
175  assert(num >= 0 && num < 100);
176  char tmp[4];
177  sprintf(tmp, "%02d", num);
178  return std::string(tmp);
179 }
tmp
align.sh
Definition: createJobs.py:716
void AlignmentMonitorMuonSystemMap1D::processMuonResidualsFromTrack ( MuonResidualsFromTrack mrft,
const edm::Event iEvent 
)

Definition at line 315 of file AlignmentMonitorMuonSystemMap1D.cc.

References relativeConstraints::chamber, MuonResidualsFromTrack::chamberIds(), MuonResidualsFromTrack::chamberResidual(), ALCARECOTkAlJpsiMuMu_cff::charge, reco::TrackBase::charge(), hltPixelTracks_cff::chi2, MuonChamberResidual::chi2(), MuonResidualsFromTrack::contains_TIDTEC(), MuonSubdetId::CSC, MuonSubdetId::DT, makeMuonMisalignmentScenario::endcap, AlignmentMonitorMuonSystemMap1D::MuonSystemMapPlot1D::fill_dxdz(), AlignmentMonitorMuonSystemMap1D::MuonSystemMapPlot1D::fill_dydz(), AlignmentMonitorMuonSystemMap1D::MuonSystemMapPlot1D::fill_x(), AlignmentMonitorMuonSystemMap1D::MuonSystemMapPlot1D::fill_x_1d(), AlignmentMonitorMuonSystemMap1D::MuonSystemMapPlot1D::fill_y(), MuonResidualsFromTrack::getTrack(), MuonChamberResidual::global_residual(), MuonChamberResidual::global_resslope(), MuonChamberResidual::global_stubpos(), MuonChamberResidual::global_trackpos(), triggerObjects_cff::id, edm::EventBase::id(), AlignmentMonitorMuonSystemMap1D::MyCSCDetId::init(), MuonChamberResidual::kCSC, MuonChamberResidual::kDT13, MuonChamberResidual::kDT2, m_allowTIDTEC, m_counter_13numhits, m_counter_2numhits, m_counter_csc, m_counter_cscnumhits, m_counter_dt, m_counter_trackokay, m_createNtuple, m_cscnt, m_CSCvsphi_me, m_CSCvsr_me, m_doCSC, m_doDT, m_DTvsphi_station, m_DTvsz_station, m_id, m_maxTrackerRedChi2, m_minCSCHits, m_minDT13Hits, m_minDT2Hits, m_minNCrossedChambers, m_minTrackerHits, M_PI, m_re, m_run, m_tr, m_useStubPosition, DetId::Muon, MuonChamberResidual::ndof(), MuonResidualsFromTrack::normalizedChi2(), MuonChamberResidual::numHits(), phi, AlignmentMonitorMuonSystemMap1D::MyResidual::phi, funct::pow(), AlignmentMonitorMuonSystemMap1D::MyTrack::pt, reco::TrackBase::pt(), AlignmentMonitorMuonSystemMap1D::MyTrack::pz, reco::TrackBase::pz(), AlignmentMonitorMuonSystemMap1D::MyTrack::q, dttmaxenums::R, AlignmentMonitorMuonSystemMap1D::MyResidual::res, AlignmentMonitorMuonSystemMap1D::MyResidual::rho, relativeConstraints::ring, edm::EventID::run(), AlignmentMonitorMuonSystemMap1D::MyResidual::slope, mathSSE::sqrt(), relativeConstraints::station, MuonResidualsFromTrack::trackerNumHits(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), z, PV3DBase< T, PVType, FrameType >::z(), and AlignmentMonitorMuonSystemMap1D::MyResidual::z.

Referenced by event(), and ~AlignmentMonitorMuonSystemMap1D().

316  {
317  if (mrft.trackerNumHits() < m_minTrackerHits)
318  return;
319  if (!m_allowTIDTEC && mrft.contains_TIDTEC())
320  return;
321  if (mrft.normalizedChi2() > m_maxTrackerRedChi2)
322  return;
323 
324  int nMuChambers = 0;
325  std::vector<DetId> chamberIds = mrft.chamberIds();
326  for (unsigned ch = 0; ch < chamberIds.size(); ch++)
327  if (chamberIds[ch].det() == DetId::Muon)
328  nMuChambers++;
329  if (nMuChambers < m_minNCrossedChambers)
330  return;
331 
332  char charge = (mrft.getTrack()->charge() > 0 ? 1 : -1);
333  // double qoverpt = track->charge() / track->pt();
334  // double qoverpz = track->charge() / track->pz();
335 
337 
338  for (std::vector<DetId>::const_iterator chamberId = chamberIds.begin(); chamberId != chamberIds.end(); ++chamberId) {
339  if (chamberId->det() != DetId::Muon)
340  continue;
341 
342  if (m_doDT && chamberId->subdetId() == MuonSubdetId::DT) {
345  DTChamberId id(chamberId->rawId());
346 
347  m_counter_dt++;
348 
349  if (id.station() < 4 && dt13 != nullptr && dt13->numHits() >= m_minDT13Hits && dt2 != nullptr &&
350  dt2->numHits() >= m_minDT2Hits && (dt2->chi2() / double(dt2->ndof())) < 2.0) {
352 
353  double residual = dt13->global_residual();
354  double resslope = dt13->global_resslope();
355  double chi2 = dt13->chi2();
356  int dof = dt13->ndof();
357 
358  align::GlobalPoint gpos;
359  if (m_useStubPosition)
360  gpos = dt13->global_stubpos();
361  else
362  gpos = dt13->global_trackpos();
363  double phi = atan2(gpos.y(), gpos.x());
364  double z = gpos.z();
365 
366  assert(1 <= id.sector() && id.sector() <= 14);
367 
368  m_DTvsz_station[id.station() - 1][id.sector() - 1]->fill_x(charge, z, residual, chi2, dof);
369  m_DTvsz_station[id.station() - 1][id.sector() - 1]->fill_dxdz(charge, z, resslope, chi2, dof);
370  m_DTvsphi_station[id.station() - 1][id.wheel() + 2]->fill_x(charge, phi, residual, chi2, dof);
371  m_DTvsphi_station[id.station() - 1][id.wheel() + 2]->fill_dxdz(charge, phi, resslope, chi2, dof);
372 
374 
375  residual = dt2->global_residual();
376  resslope = dt2->global_resslope();
377  chi2 = dt2->chi2();
378  dof = dt2->ndof();
379 
380  if (m_useStubPosition)
381  gpos = dt2->global_stubpos();
382  else
383  gpos = dt2->global_trackpos();
384  phi = atan2(gpos.y(), gpos.x());
385  z = gpos.z();
386 
387  assert(1 <= id.sector() && id.sector() <= 14);
388 
389  m_DTvsz_station[id.station() - 1][id.sector() - 1]->fill_y(charge, z, residual, chi2, dof);
390  m_DTvsz_station[id.station() - 1][id.sector() - 1]->fill_dydz(charge, z, resslope, chi2, dof);
391  m_DTvsphi_station[id.station() - 1][id.wheel() + 2]->fill_y(charge, phi, residual, chi2, dof);
392  m_DTvsphi_station[id.station() - 1][id.wheel() + 2]->fill_dydz(charge, phi, resslope, chi2, dof);
393  }
394 
395  if (id.station() == 4 && dt13 != nullptr && dt13->numHits() >= m_minDT13Hits) {
397 
398  double residual = dt13->global_residual();
399  double resslope = dt13->global_resslope();
400  double chi2 = dt13->chi2();
401  int dof = dt13->ndof();
402 
403  align::GlobalPoint gpos;
404  if (m_useStubPosition)
405  gpos = dt13->global_stubpos();
406  else
407  gpos = dt13->global_trackpos();
408  double phi = atan2(gpos.y(), gpos.x());
409  double z = gpos.z();
410 
411  assert(1 <= id.sector() && id.sector() <= 14);
412 
413  m_DTvsz_station[id.station() - 1][id.sector() - 1]->fill_x(charge, z, residual, chi2, dof);
414  m_DTvsz_station[id.station() - 1][id.sector() - 1]->fill_dxdz(charge, z, resslope, chi2, dof);
415  m_DTvsphi_station[id.station() - 1][id.wheel() + 2]->fill_x(charge, phi, residual, chi2, dof);
416  m_DTvsphi_station[id.station() - 1][id.wheel() + 2]->fill_dxdz(charge, phi, resslope, chi2, dof);
417  }
418  }
419 
420  else if (m_doCSC && chamberId->subdetId() == MuonSubdetId::CSC) {
422  CSCDetId id(chamberId->rawId());
423 
424  int ring = id.ring();
425  if (id.ring() == 4)
426  ring = 1; // combine ME1/a + ME1/b
427 
428  m_counter_csc++;
429 
430  if (csc != nullptr && csc->numHits() >= m_minCSCHits) {
432 
433  double residual = csc->global_residual();
434  double resslope = csc->global_resslope();
435  double chi2 = csc->chi2();
436  int dof = csc->ndof();
437 
438  align::GlobalPoint gpos;
439  if (m_useStubPosition)
440  gpos = csc->global_stubpos();
441  else
442  gpos = csc->global_trackpos();
443  double phi = atan2(gpos.y(), gpos.x());
444  // start phi from -5deg
445  if (phi < -M_PI / 180. * 5.)
446  phi += 2. * M_PI;
447  double R = sqrt(pow(gpos.x(), 2) + pow(gpos.y(), 2));
448 
449  int chamber = id.chamber() - 1;
450  if (id.station() > 1 && ring == 1)
451  chamber *= 2;
452 
453  assert(1 <= id.endcap() && id.endcap() <= 2 && 0 <= chamber && chamber <= 35);
454 
455  if (R > 0.)
456  m_CSCvsphi_me[id.endcap() - 1][id.station() - 1][ring - 1]->fill_x_1d(residual / R, chi2, dof);
457 
458  m_CSCvsr_me[id.endcap() - 1][id.station() - 1][chamber]->fill_x(charge, R, residual, chi2, dof);
459  m_CSCvsr_me[id.endcap() - 1][id.station() - 1][chamber]->fill_dxdz(charge, R, resslope, chi2, dof);
460  m_CSCvsphi_me[id.endcap() - 1][id.station() - 1][ring - 1]->fill_x(charge, phi, residual, chi2, dof);
461  m_CSCvsphi_me[id.endcap() - 1][id.station() - 1][ring - 1]->fill_dxdz(charge, phi, resslope, chi2, dof);
462 
463  if (m_createNtuple && chi2 > 0.) // && TMath::Prob(chi2, dof) < 0.95)
464  {
465  m_id.init(id);
466  m_tr.q = charge;
467  m_tr.pt = mrft.getTrack()->pt();
468  m_tr.pz = mrft.getTrack()->pz();
469  m_re.res = residual;
470  m_re.slope = resslope;
471  m_re.rho = R;
472  m_re.phi = phi;
473  m_re.z = gpos.z();
474  m_run = iEvent.id().run();
475  m_cscnt->Fill();
476  }
477  }
478  }
479 
480  //else { assert(false); }
481  } // end loop over chambers
482 }
RunNumber_t run() const
Definition: EventID.h:38
void fill_x(char charge, double abscissa, double residx, double chi2, int dof)
void fill_dydz(char charge, double abscissa, double slopey, double chi2, int dof)
void fill_y(char charge, double abscissa, double residy, double chi2, int dof)
align::GlobalPoint global_trackpos()
T y() const
Definition: PV3DBase.h:60
MuonSystemMapPlot1D * m_CSCvsr_me[2][4][36]
MuonSystemMapPlot1D * m_CSCvsphi_me[2][4][3]
double global_residual() const
const std::vector< DetId > chamberIds() const
T sqrt(T t)
Definition: SSEVec.h:19
double pt() const
track transverse momentum
Definition: TrackBase.h:602
T z() const
Definition: PV3DBase.h:61
const reco::Track * getTrack()
Definition: L1Track.h:19
#define M_PI
double pz() const
z coordinate of momentum vector
Definition: TrackBase.h:611
void fill_dxdz(char charge, double abscissa, double slopex, double chi2, int dof)
align::GlobalPoint global_stubpos()
edm::EventID id() const
Definition: EventBase.h:59
double global_resslope() const
int charge() const
track electric charge
Definition: TrackBase.h:575
static constexpr int DT
Definition: MuonSubdetId.h:11
static constexpr int CSC
Definition: MuonSubdetId.h:12
T x() const
Definition: PV3DBase.h:59
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:30
MuonChamberResidual * chamberResidual(DetId chamberId, int type)

Member Data Documentation

bool AlignmentMonitorMuonSystemMap1D::m_allowTIDTEC
private

Definition at line 58 of file AlignmentMonitorMuonSystemMap1D.cc.

Referenced by processMuonResidualsFromTrack().

long AlignmentMonitorMuonSystemMap1D::m_counter_13numhits
private
long AlignmentMonitorMuonSystemMap1D::m_counter_2numhits
private
long AlignmentMonitorMuonSystemMap1D::m_counter_csc
private
long AlignmentMonitorMuonSystemMap1D::m_counter_cscnumhits
private
long AlignmentMonitorMuonSystemMap1D::m_counter_dt
private
long AlignmentMonitorMuonSystemMap1D::m_counter_event
private

Definition at line 69 of file AlignmentMonitorMuonSystemMap1D.cc.

Referenced by afterAlignment(), book(), and event().

long AlignmentMonitorMuonSystemMap1D::m_counter_track
private

Definition at line 70 of file AlignmentMonitorMuonSystemMap1D.cc.

Referenced by afterAlignment(), book(), and event().

long AlignmentMonitorMuonSystemMap1D::m_counter_trackdxy
private

Definition at line 72 of file AlignmentMonitorMuonSystemMap1D.cc.

Referenced by afterAlignment(), book(), and event().

long AlignmentMonitorMuonSystemMap1D::m_counter_trackmoment
private

Definition at line 71 of file AlignmentMonitorMuonSystemMap1D.cc.

Referenced by afterAlignment(), book(), and event().

long AlignmentMonitorMuonSystemMap1D::m_counter_trackokay
private
bool AlignmentMonitorMuonSystemMap1D::m_createNtuple
private
TTree* AlignmentMonitorMuonSystemMap1D::m_cscnt
private
MuonSystemMapPlot1D* AlignmentMonitorMuonSystemMap1D::m_CSCvsphi_me[2][4][3]
private

Definition at line 109 of file AlignmentMonitorMuonSystemMap1D.cc.

Referenced by book(), and processMuonResidualsFromTrack().

MuonSystemMapPlot1D* AlignmentMonitorMuonSystemMap1D::m_CSCvsr_me[2][4][36]
private

Definition at line 107 of file AlignmentMonitorMuonSystemMap1D.cc.

Referenced by book(), and processMuonResidualsFromTrack().

bool AlignmentMonitorMuonSystemMap1D::m_doCSC
private

Definition at line 64 of file AlignmentMonitorMuonSystemMap1D.cc.

Referenced by book(), and processMuonResidualsFromTrack().

bool AlignmentMonitorMuonSystemMap1D::m_doDT
private

Definition at line 63 of file AlignmentMonitorMuonSystemMap1D.cc.

Referenced by book(), and processMuonResidualsFromTrack().

MuonSystemMapPlot1D* AlignmentMonitorMuonSystemMap1D::m_DTvsphi_station[4][5]
private

Definition at line 108 of file AlignmentMonitorMuonSystemMap1D.cc.

Referenced by book(), and processMuonResidualsFromTrack().

MuonSystemMapPlot1D* AlignmentMonitorMuonSystemMap1D::m_DTvsz_station[4][14]
private

Definition at line 106 of file AlignmentMonitorMuonSystemMap1D.cc.

Referenced by book(), and processMuonResidualsFromTrack().

MyCSCDetId AlignmentMonitorMuonSystemMap1D::m_id
private
double AlignmentMonitorMuonSystemMap1D::m_maxDxy
private

Definition at line 55 of file AlignmentMonitorMuonSystemMap1D.cc.

Referenced by event().

double AlignmentMonitorMuonSystemMap1D::m_maxTrackerRedChi2
private

Definition at line 57 of file AlignmentMonitorMuonSystemMap1D.cc.

Referenced by processMuonResidualsFromTrack().

double AlignmentMonitorMuonSystemMap1D::m_maxTrackP
private

Definition at line 54 of file AlignmentMonitorMuonSystemMap1D.cc.

Referenced by event().

double AlignmentMonitorMuonSystemMap1D::m_maxTrackPt
private

Definition at line 52 of file AlignmentMonitorMuonSystemMap1D.cc.

Referenced by event().

int AlignmentMonitorMuonSystemMap1D::m_minCSCHits
private

Definition at line 62 of file AlignmentMonitorMuonSystemMap1D.cc.

Referenced by processMuonResidualsFromTrack().

int AlignmentMonitorMuonSystemMap1D::m_minDT13Hits
private

Definition at line 60 of file AlignmentMonitorMuonSystemMap1D.cc.

Referenced by processMuonResidualsFromTrack().

int AlignmentMonitorMuonSystemMap1D::m_minDT2Hits
private

Definition at line 61 of file AlignmentMonitorMuonSystemMap1D.cc.

Referenced by processMuonResidualsFromTrack().

int AlignmentMonitorMuonSystemMap1D::m_minNCrossedChambers
private

Definition at line 59 of file AlignmentMonitorMuonSystemMap1D.cc.

Referenced by processMuonResidualsFromTrack().

int AlignmentMonitorMuonSystemMap1D::m_minTrackerHits
private

Definition at line 56 of file AlignmentMonitorMuonSystemMap1D.cc.

Referenced by processMuonResidualsFromTrack().

double AlignmentMonitorMuonSystemMap1D::m_minTrackP
private

Definition at line 53 of file AlignmentMonitorMuonSystemMap1D.cc.

Referenced by event().

double AlignmentMonitorMuonSystemMap1D::m_minTrackPt
private

Definition at line 51 of file AlignmentMonitorMuonSystemMap1D.cc.

edm::InputTag AlignmentMonitorMuonSystemMap1D::m_muonCollectionTag
private

Definition at line 50 of file AlignmentMonitorMuonSystemMap1D.cc.

Referenced by event().

std::vector<MuonSystemMapPlot1D *> AlignmentMonitorMuonSystemMap1D::m_plots
private

Definition at line 111 of file AlignmentMonitorMuonSystemMap1D.cc.

Referenced by book().

MyResidual AlignmentMonitorMuonSystemMap1D::m_re
private
UInt_t AlignmentMonitorMuonSystemMap1D::m_run
private
MyTrack AlignmentMonitorMuonSystemMap1D::m_tr
private
bool AlignmentMonitorMuonSystemMap1D::m_useStubPosition
private

Definition at line 65 of file AlignmentMonitorMuonSystemMap1D.cc.

Referenced by processMuonResidualsFromTrack().