194 : dttpgSource_(ps.getParameter<
edm::
InputTag>(
"dttpgSource")),
195 gmtSource_(ps.getParameter<
edm::
InputTag>(
"gmtSource")),
196 muonCollectionLabel_(ps.getParameter<
edm::
InputTag>(
"MuonCollection")),
197 l1tsubsystemfolder_(ps.getUntrackedParameter<
std::
string>(
"l1tSystemFolder",
"L1T/L1TDTTF")),
198 online_(ps.getUntrackedParameter<
bool>(
"online",
true)),
199 verbose_(ps.getUntrackedParameter<
bool>(
"verbose",
false))
207 edm::LogInfo(
"L1TDTTF: constructor") <<
"Verbose enabled";
260 "/02-WHEEL_N2",
"/03-WHEEL_N1",
"/04-WHEEL_N0",
"/05-WHEEL_P0",
"/06-WHEEL_P1",
"/07-WHEEL_P2"};
262 char c_whn[6][3] = {
"N2",
"N1",
"N0",
"P0",
"P1",
"P2"};
266 for (
int iwh = 0; iwh < 6; ++iwh) {
267 bookEta(iwh, nbins, start, stop);
272 std::string dttf_trk_folder_wheel = dttf_trk_folder + wheelpath[iwh];
276 sprintf(hname,
"dttf_01_nTracksPerEvent_wh%s", c_whn[iwh]);
277 sprintf(htitle,
"Wheel %s - Number Tracks Per Event", c_whn[iwh]);
282 sprintf(hname,
"dttf_07_phi_vs_etaFine_wh%s", c_whn[iwh]);
283 sprintf(htitle,
"Wheel %s - #eta-#phi DTTF Tracks occupancy (fine #eta only, unpacked values)", c_whn[iwh]);
291 sprintf(hname,
"dttf_08_phi_vs_etaCoarse_wh%s", c_whn[iwh]);
292 sprintf(htitle,
"Wheel %s - #eta-#phi DTTF Tracks occupancy (coarse #eta only, unpacked values)", c_whn[iwh]);
300 std::string dttf_trk_folder_wheel_2ndtrack = dttf_trk_folder_wheel +
"/2ND_TRACK_ONLY";
304 sprintf(hname,
"dttf_04_quality_wh%s_2ndTrack", c_whn[iwh]);
305 sprintf(htitle,
"Wheel %s - 2nd Tracks Quality distribution", c_whn[iwh]);
310 sprintf(hname,
"dttf_05_quality_summary_wh%s_2ndTrack", c_whn[iwh]);
311 sprintf(htitle,
"Wheel %s - 2nd Tracks - Quality", c_whn[iwh]);
318 sprintf(hname,
"dttf_06_phi_vs_eta_wh%s_2ndTrack", c_whn[iwh]);
319 sprintf(htitle,
"Wheel %s - #eta-#phi Distribution of DTTF 2nd Tracks", c_whn[iwh]);
327 sprintf(hname,
"dttf_07_eta_wh%s_2ndTrack", c_whn[iwh]);
328 sprintf(htitle,
"Wheel %s - DTTF 2nd Tracks #eta distribution (Packed values)", c_whn[iwh]);
333 sprintf(hname,
"dttf_08_phi_wh%s_2ndTrack", c_whn[iwh]);
334 sprintf(htitle,
"Wheel %s - DTTF 2nd Tracks Phi distribution (Packed values)", c_whn[iwh]);
339 sprintf(hname,
"dttf_09_pt_wh%s_2ndTrack", c_whn[iwh]);
340 sprintf(htitle,
"Wheel %s - DTTF 2nd Tracks p_{T} distribution (Packed values)", c_whn[iwh]);
345 sprintf(hname,
"dttf_10_charge_wh%s_2ndTrack", c_whn[iwh]);
346 sprintf(htitle,
"Wheel %s - DTTF 2nd Tracks Charge distribution", c_whn[iwh]);
355 std::string dttf_trk_folder_nTracksPerEvent = dttf_trk_folder_wheel +
"/TracksPerEvent";
358 for (
int ise = 0; ise < 12; ++ise) {
359 sprintf(hname,
"dttf_nTracksPerEvent_wh%s_se%d", c_whn[iwh], ise + 1);
360 sprintf(htitle,
"Wheel %s Sector %d - Number of Tracks Per Event", c_whn[iwh], ise + 1);
366 std::string dttf_trk_folder_wh_bxsec_all = dttf_trk_folder_wheel +
"/BX_BySector";
369 for (
int ise = 0; ise < 12; ++ise) {
370 sprintf(hname,
"dttf_bx_wh%s_se%d", c_whn[iwh], ise + 1);
371 sprintf(htitle,
"Wheel %s Sector %d - BX Distribution", c_whn[iwh], ise + 1);
372 dttf_bx[iwh][ise] = ibooker.
book1D(hname, htitle, 3, -1.5, 1.5);
376 std::string dttf_trk_folder_wh_bxsec_trk2 = dttf_trk_folder_wheel +
"/BX_BySector/2ND_TRACK_ONLY";
379 for (
int ise = 0; ise < 12; ++ise) {
380 sprintf(hname,
"dttf_bx_2ndTrack_wh%s_se%d", c_whn[iwh], ise + 1);
381 sprintf(htitle,
"Wheel %s Sector %d - BX 2nd Tracks only", c_whn[iwh], ise + 1);
387 std::string dttf_trk_folder_charge = dttf_trk_folder_wheel +
"/Charge";
390 for (
int ise = 0; ise < 12; ++ise) {
391 sprintf(hname,
"dttf_charge_wh%s_se%d", c_whn[iwh], ise + 1);
392 sprintf(htitle,
"Wheel %s Sector %d - Packed Charge", c_whn[iwh], ise + 1);
393 dttf_q[iwh][ise] = ibooker.
book1D(hname, htitle, 2, -0.5, 1.5);
398 std::string dttf_trk_folder_pt = dttf_trk_folder_wheel +
"/PT";
401 for (
int ise = 0; ise < 12; ++ise) {
402 sprintf(hname,
"dttf_pt_wh%s_se%d", c_whn[iwh], ise + 1);
403 sprintf(htitle,
"Wheel %s Sector %d - Packed p_{T}", c_whn[iwh], ise + 1);
404 dttf_pt[iwh][ise] = ibooker.
book1D(hname, htitle, 32, -0.5, 31.5);
409 std::string dttf_trk_folder_phi = dttf_trk_folder_wheel +
"/Phi";
412 for (
int ise = 0; ise < 12; ++ise) {
413 sprintf(hname,
"dttf_phi_wh%s_se%d", c_whn[iwh], ise + 1);
414 sprintf(htitle,
"Wheel %s Sector %d - Packed Phi", c_whn[iwh], ise + 1);
421 std::string dttf_trk_folder_quality = dttf_trk_folder_wheel +
"/Quality";
424 for (
int ise = 0; ise < 12; ++ise) {
425 sprintf(hname,
"dttf_qual_wh%s_se%d", c_whn[iwh], ise + 1);
426 sprintf(htitle,
"Wheel %s Sector %d - Packed Quality", c_whn[iwh], ise + 1);
433 std::string dttf_trk_folder_eta = dttf_trk_folder_wheel +
"/Eta";
436 for (
int ise = 0; ise < 12; ++ise) {
437 sprintf(hname,
"dttf_eta_wh%s_se%d", c_whn[iwh], ise + 1);
438 sprintf(htitle,
"Wheel %s Sector %d - Packed #eta", c_whn[iwh], ise + 1);
439 dttf_eta[iwh][ise] = ibooker.
book1D(hname, htitle, 64, -0.5, 63.5);
444 dttf_trk_folder_eta = dttf_trk_folder_wheel +
"/EtaFineFraction";
447 for (
int ise = 0; ise < 12; ++ise) {
448 sprintf(hname,
"dttf_etaFine_fraction_wh%s_se%d", c_whn[iwh], ise + 1);
449 sprintf(htitle,
"Wheel %s Sector %d - Eta Fine Fraction", c_whn[iwh], ise + 1);
460 std::string dttf_trk_folder_inclusive = dttf_trk_folder +
"/01-INCLUSIVE";
463 sprintf(hname,
"dttf_01_nTracksPerEvent_integ");
464 sprintf(htitle,
"Number of DTTF Tracks Per Event");
476 sprintf(hname,
"dttf_04_tracks_occupancy_by_lumi");
477 sprintf(htitle,
"DTTF Tracks in the last LumiSections");
483 sprintf(hname,
"dttf_04_global_muons_request");
484 sprintf(htitle,
"Tracks compatible with a Global Muon in the Barrel");
492 std::string dttf_trk_folder_integrated_gmt = dttf_trk_folder +
"/08-GMT_MATCH";
495 sprintf(hname,
"dttf_tracks_with_gmt_match");
496 sprintf(htitle,
"DTTF Tracks With a Match in GMT");
500 sprintf(hname,
"dttf_tracks_without_gmt_match");
501 sprintf(htitle,
"DTTF Tracks Without a Match in GMT");
505 sprintf(hname,
"dttf_missing_tracks_in_gmt");
506 sprintf(htitle,
"GMT Tracks Without a Corresponding Track in DTTF");
523 edm::LogInfo(
"L1TDTTF::Analyze::start") <<
"#################### START";
534 edm::LogError(
"L1TDTTF::analyze::DataNotFound") <<
"can't getByToken L1MuDTTrackContainer with label " 539 if (!myL1MuDTTrackContainer.
isValid()) {
548 if (!trackContainer->empty()) {
550 if (trackContainer->size() > 1)
564 for (reco::MuonCollection::const_iterator recoMu = muons->begin(); recoMu != muons->end(); ++recoMu) {
565 if (fabs(recoMu->eta()) < 1.4) {
567 edm::LogInfo(
"L1TDTTFClient::Analyze:GM") <<
"Found a global muon!";
579 edm::LogInfo(
"L1TDTTFClient::Analyze:GM") <<
"No global muons in this event!";
596 edm::LogError(
"DataNotFound") <<
"Unable to getByToken MuonCollection with label " 602 std::vector<L1MuRegionalCand> gmtBx0DttfCandidates;
614 std::vector<L1MuGMTReadoutRecord> gmt_records = gmtrc->
getRecords();
616 std::vector<L1MuGMTReadoutRecord>::const_iterator RRItr;
618 for (RRItr = gmt_records.begin(); RRItr != gmt_records.end(); ++RRItr) {
619 std::vector<L1MuRegionalCand> dttfCands = RRItr->getDTBXCands();
620 std::vector<L1MuRegionalCand>::iterator dttfCand;
622 for (dttfCand = dttfCands.begin(); dttfCand != dttfCands.end(); ++dttfCand) {
623 if (dttfCand->empty())
626 if (RRItr->getBxInEvent())
631 gmtBx0DttfCandidates.push_back(*dttfCand);
641 fillMEs(trackContainer, gmtBx0DttfCandidates);
644 std::vector<L1MuRegionalCand>::iterator dttfCand;
645 for (dttfCand = gmtBx0DttfCandidates.begin(); dttfCand != gmtBx0DttfCandidates.end(); ++dttfCand) {
646 if (dttfCand->empty())
652 int phi = dttfCand->phi_packed();
653 int sector = 1 + (phi + 6) / 12;
656 double eta = dttfCand->etaValue();
661 }
else if (eta < -0.3) {
664 }
else if (eta < 0.3) {
667 }
else if (eta < 0.74) {
679 int numTracksInt = 0;
681 for (
int w = 0;
w < 6; ++
w) {
682 int numTracks_wh = 0;
683 for (
int s = 0;
s < 12; ++
s) {
689 numTracksInt += numTracks_wh;
697 void L1TDTTF::fillMEs(std::vector<L1MuDTTrackCand>
const* trackContainer, std::vector<L1MuRegionalCand>& gmtDttfCands) {
698 L1MuDTTrackContainer::TrackContainer::const_iterator
track = trackContainer->begin();
699 L1MuDTTrackContainer::TrackContainer::const_iterator trackEnd = trackContainer->end();
701 for (; track != trackEnd; ++
track) {
703 edm::LogInfo(
"L1TDTTF::Analyze") <<
"bx = " << track->bx();
704 edm::LogInfo(
"L1TDTTF::Analyze") <<
"quality (packed) = " << track->quality_packed();
705 edm::LogInfo(
"L1TDTTF::Analyze") <<
"pt (packed) = " << track->pt_packed()
706 <<
" , pt (GeV) = " << track->ptValue();
707 edm::LogInfo(
"L1TDTTF::Analyze") <<
"phi (packed) = " << track->phi_packed()
708 <<
" , phi (rad) = " << track->phiValue();
709 edm::LogInfo(
"L1TDTTF::Analyze") <<
"charge (packed) = " << track->charge_packed();
713 if ((track->whNum() == -1) && !track->eta_packed()) {
714 edm::LogInfo(
"L1TDTTF::Analyze") <<
"Skipping N0 with zero eta value";
719 int bxindex = track->bx() + 1;
720 int se = track->scNum();
722 int whindex = track->whNum();
724 whindex = (whindex < 0) ? whindex + 3 : whindex + 2;
726 if (whindex < 0 || whindex > 5) {
727 edm::LogError(
"L1TDTTF::Analyze::WHEEL_ERROR") << track->whNum() <<
"(" << whindex <<
")";
731 if (se < 0 || se > 11) {
748 int phi_global = track->phi_packed();
749 phi_global = (phi_global > 15 ? phi_global - 32 : phi_global) + se * 12;
752 if (phi_global > 137)
768 if (track->TrkTag() == 1) {
791 dttf_q[whindex][se]->
Fill(track->charge_packed());
796 if (track->isFineHalo()) {
818 if (track->TrkTag() == 1) {
843 std::vector<L1MuRegionalCand>::iterator dttfCand;
845 unsigned int gmt_phi = (phi_global < 0 ? phi_global + 144 : phi_global);
847 for (dttfCand = gmtDttfCands.begin(); dttfCand != gmtDttfCands.end(); ++dttfCand) {
849 if (dttfCand->empty())
851 if ((dttfCand->phi_packed() == gmt_phi) && dttfCand->quality_packed() == track->quality_packed()) {
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX)
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
std::string l1tsubsystemfolder_
edm::InputTag trackInputTag_
MonitorElement * dttf_phi_eta_coarse_wheel[6]
edm::InputTag muonCollectionLabel_
void bookEta(int wh, int &nbins, float &start, float &stop)
void setCurrentFolder(std::string const &fullpath)
MonitorElement * dttf_nTracksPerEvent_wheel[6]
MonitorElement * dttf_phi_eta_fine_wheel[6]
void setWheelLabel(MonitorElement *me)
MonitorElement * dttf_gmt_match
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
MonitorElement * dttf_phi_wheel_2ndTrack[6]
MonitorElement * dttf_nTracksPerEvent_integ
void analyze(const edm::Event &e, const edm::EventSetup &c) override
MonitorElement * dttf_pt_wheel_2ndTrack[6]
MonitorElement * dttf_eta_wheel_2ndTrack[6]
edm::EDGetTokenT< L1MuGMTReadoutCollection > gmtSourceToken_
MonitorElement * dttf_qual[6][12]
void dqmBeginRun(edm::Run const &, edm::EventSetup const &) override
edm::InputTag dttpgSource_
MonitorElement * dttf_quality_wheel_2ndTrack[6]
std::vector< L1MuDTTrackCand > TrackContainer
MonitorElement * dttf_phi[6][12]
edm::EDGetTokenT< L1MuDTTrackContainer > trackInputToken_
void fillMEs(std::vector< L1MuDTTrackCand > const *trackContainer, std::vector< L1MuRegionalCand > &gmtDttfCands)
MonitorElement * dttf_gmt_missed
virtual void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
MonitorElement * dttf_quality_summary_wheel_2ndTrack[6]
MonitorElement * dttf_eta_fine_fraction[6][12]
MonitorElement * dttf_bx[6][12]
T const * product() const
MonitorElement * dttf_gmt_ghost
edm::EDGetTokenT< reco::MuonCollection > muonCollectionToken_
MonitorElement * dttf_bx_2ndTrack[6][12]
MonitorElement * dttf_q_wheel_2ndTrack[6]
MonitorElement * dttf_eta[6][12]
void bookHistograms(DQMStore::IBooker &i, edm::Run const &, edm::EventSetup const &) override
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
std::vector< L1MuGMTReadoutRecord > const & getRecords() const
MonitorElement * dttf_nTracksPerEv[6][12]
MonitorElement * dttf_pt[6][12]
MonitorElement * dttf_phi_eta_wheel_2ndTrack[6]
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
MonitorElement * dttf_spare
MonitorElement * dttf_q[6][12]
void setQualLabel(MonitorElement *me, int axis)
TrackContainer const * getContainer() const
L1TDTTF(const edm::ParameterSet &ps)
base services
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)