198 : dttpgSource_( ps.getParameter<
edm::InputTag >(
"dttpgSource") ),
199 gmtSource_( ps.getParameter<
edm::InputTag >(
"gmtSource") ),
200 muonCollectionLabel_( ps.getParameter<
edm::InputTag>(
"MuonCollection") ),
201 l1tsubsystemfolder_( ps.getUntrackedParameter<
std::
string>(
"l1tSystemFolder",
203 online_( ps.getUntrackedParameter<
bool>(
"online",
true) ),
204 verbose_( ps.getUntrackedParameter<
bool>(
"verbose",
false) )
225 <<
"L1T Monitoring histograms will be saved to " <<
outputFile_;
285 char c_whn[6][3] = {
"N2",
"N1",
"N0",
"P0",
"P1",
"P2" };
289 for (
int iwh = 0; iwh < 6; ++iwh ) {
291 bookEta( iwh, nbins, start, stop );
296 std::string dttf_trk_folder_wheel = dttf_trk_folder + wheelpath[iwh];
300 sprintf(hname,
"dttf_01_nTracksPerEvent_wh%s", c_whn[iwh]);
301 sprintf(htitle,
"Wheel %s - Number Tracks Per Event", c_whn[iwh]);
307 sprintf(hname,
"dttf_07_phi_vs_etaFine_wh%s", c_whn[iwh]);
308 sprintf(htitle,
"Wheel %s - #eta-#phi DTTF Tracks occupancy (fine #eta only, unpacked values)", c_whn[iwh]);
310 nbins, start-0.5, stop-0.5,
318 sprintf(hname,
"dttf_08_phi_vs_etaCoarse_wh%s", c_whn[iwh]);
319 sprintf(htitle,
"Wheel %s - #eta-#phi DTTF Tracks occupancy (coarse #eta only, unpacked values)", c_whn[iwh]);
321 nbins, start-0.5, stop-0.5,
330 dttf_trk_folder_wheel +
"/2ND_TRACK_ONLY";
335 sprintf(hname,
"dttf_04_quality_wh%s_2ndTrack", c_whn[iwh]);
336 sprintf(htitle,
"Wheel %s - 2nd Tracks Quality distribution", c_whn[iwh]);
341 sprintf(hname,
"dttf_05_quality_summary_wh%s_2ndTrack", c_whn[iwh]);
342 sprintf(htitle,
"Wheel %s - 2nd Tracks - Quality", c_whn[iwh]);
344 12, 1, 13, 7, 1, 8 );
350 sprintf(hname,
"dttf_06_phi_vs_eta_wh%s_2ndTrack", c_whn[iwh]);
351 sprintf(htitle,
"Wheel %s - #eta-#phi Distribution of DTTF 2nd Tracks",
355 nbins, start-0.5,stop-0.5,
364 sprintf(hname,
"dttf_07_eta_wh%s_2ndTrack", c_whn[iwh]);
365 sprintf(htitle,
"Wheel %s - DTTF 2nd Tracks #eta distribution (Packed values)",
371 sprintf(hname,
"dttf_08_phi_wh%s_2ndTrack", c_whn[iwh]);
372 sprintf(htitle,
"Wheel %s - DTTF 2nd Tracks Phi distribution (Packed values)",
378 sprintf(hname,
"dttf_09_pt_wh%s_2ndTrack", c_whn[iwh]);
379 sprintf(htitle,
"Wheel %s - DTTF 2nd Tracks p_{T} distribution (Packed values)",
385 sprintf(hname,
"dttf_10_charge_wh%s_2ndTrack", c_whn[iwh]);
386 sprintf(htitle,
"Wheel %s - DTTF 2nd Tracks Charge distribution", c_whn[iwh]);
398 std::string dttf_trk_folder_nTracksPerEvent = dttf_trk_folder_wheel +
"/TracksPerEvent";
401 for(
int ise = 0; ise < 12; ++ise) {
402 sprintf(hname,
"dttf_nTracksPerEvent_wh%s_se%d", c_whn[iwh], ise+1);
403 sprintf(htitle,
"Wheel %s Sector %d - Number of Tracks Per Event",
412 dttf_trk_folder_wheel +
"/BX_BySector";
415 for(
int ise = 0; ise < 12; ++ise ) {
416 sprintf(hname,
"dttf_bx_wh%s_se%d", c_whn[iwh], ise+1);
417 sprintf(htitle,
"Wheel %s Sector %d - BX Distribution",
419 dttf_bx[iwh][ise] = ibooker.
book1D(hname, htitle, 3, -1.5, 1.5);
424 dttf_trk_folder_wheel +
"/BX_BySector/2ND_TRACK_ONLY";
427 for(
int ise = 0; ise < 12; ++ise ) {
428 sprintf(hname,
"dttf_bx_2ndTrack_wh%s_se%d", c_whn[iwh], ise+1);
429 sprintf(htitle,
"Wheel %s Sector %d - BX 2nd Tracks only",
436 std::string dttf_trk_folder_charge = dttf_trk_folder_wheel +
"/Charge";
439 for(
int ise = 0; ise < 12; ++ise) {
440 sprintf(hname,
"dttf_charge_wh%s_se%d", c_whn[iwh], ise+1);
441 sprintf(htitle,
"Wheel %s Sector %d - Packed Charge", c_whn[iwh], ise+1);
442 dttf_q[iwh][ise] = ibooker.
book1D(hname, htitle, 2, -0.5, 1.5);
447 std::string dttf_trk_folder_pt = dttf_trk_folder_wheel +
"/PT";
450 for(
int ise = 0; ise < 12; ++ise ) {
451 sprintf(hname,
"dttf_pt_wh%s_se%d", c_whn[iwh], ise+1);
452 sprintf(htitle,
"Wheel %s Sector %d - Packed p_{T}",
453 c_whn[iwh], ise + 1 );
454 dttf_pt[iwh][ise]= ibooker.
book1D(hname, htitle, 32, -0.5, 31.5);
459 std::string dttf_trk_folder_phi = dttf_trk_folder_wheel +
"/Phi";
462 for(
int ise = 0; ise < 12; ++ise ) {
463 sprintf(hname,
"dttf_phi_wh%s_se%d", c_whn[iwh], ise+1);
464 sprintf(htitle,
"Wheel %s Sector %d - Packed Phi", c_whn[iwh], ise+1);
471 std::string dttf_trk_folder_quality = dttf_trk_folder_wheel +
"/Quality";
474 for(
int ise = 0; ise < 12; ++ise){
475 sprintf(hname,
"dttf_qual_wh%s_se%d", c_whn[iwh], ise+1);
476 sprintf(htitle,
"Wheel %s Sector %d - Packed Quality",
484 std::string dttf_trk_folder_eta = dttf_trk_folder_wheel +
"/Eta";
487 for (
int ise = 0; ise < 12; ++ise ) {
489 sprintf(hname,
"dttf_eta_wh%s_se%d", c_whn[iwh], ise+1);
490 sprintf(htitle,
"Wheel %s Sector %d - Packed #eta",
492 dttf_eta[iwh][ise] = ibooker.
book1D(hname, htitle, 64, -0.5, 63.5);
498 dttf_trk_folder_eta = dttf_trk_folder_wheel +
"/EtaFineFraction";
501 for (
int ise = 0; ise < 12; ++ise ) {
503 sprintf(hname,
"dttf_etaFine_fraction_wh%s_se%d", c_whn[iwh], ise+1);
504 sprintf(htitle,
"Wheel %s Sector %d - Eta Fine Fraction",
517 std::string dttf_trk_folder_inclusive = dttf_trk_folder +
"/01-INCLUSIVE";
521 sprintf(hname,
"dttf_01_nTracksPerEvent_integ");
522 sprintf(htitle,
"Number of DTTF Tracks Per Event");
534 sprintf(hname,
"dttf_04_tracks_occupancy_by_lumi");
535 sprintf(htitle,
"DTTF Tracks in the last LumiSections");
542 sprintf(hname,
"dttf_04_global_muons_request");
543 sprintf(htitle,
"Tracks compatible with a Global Muon in the Barrel");
553 dttf_trk_folder +
"/08-GMT_MATCH";
556 sprintf(hname,
"dttf_tracks_with_gmt_match");
557 sprintf(htitle,
"DTTF Tracks With a Match in GMT");
561 sprintf(hname,
"dttf_tracks_without_gmt_match");
562 sprintf(htitle,
"DTTF Tracks Without a Match in GMT");
566 sprintf(hname,
"dttf_missing_tracks_in_gmt");
567 sprintf(htitle,
"GMT Tracks Without a Corresponding Track in DTTF");
590 edm::LogInfo(
"L1TDTTF::Analyze::start") <<
"#################### START";
594 memset(
numTracks, 0, 72 *
sizeof(
int) );
602 <<
"can't getByToken L1MuDTTrackContainer with label " 607 if ( !myL1MuDTTrackContainer.
isValid() ) {
609 <<
"can't find L1MuDTTrackContainer with label " 618 if ( !trackContainer->empty() ) {
635 for (reco::MuonCollection::const_iterator recoMu = muons->begin();
636 recoMu!=muons->end(); ++recoMu ) {
637 if ( fabs( recoMu->eta() ) < 1.4 ) {
639 edm::LogInfo(
"L1TDTTFClient::Analyze:GM") <<
"Found a global muon!";
653 <<
"No global muons in this event!";
664 <<
"Invalid MuonCollection with label " 672 edm::LogError(
"DataNotFound") <<
"Unable to getByToken MuonCollection with label " 680 std::vector<L1MuRegionalCand> gmtBx0DttfCandidates;
687 if ( !pCollection.
isValid() ) {
688 edm::LogError(
"DataNotFound") <<
"can't find L1MuGMTReadoutCollection with label " 694 std::vector<L1MuGMTReadoutRecord> gmt_records = gmtrc->
getRecords();
696 std::vector<L1MuGMTReadoutRecord>::const_iterator RRItr;
698 for ( RRItr = gmt_records.begin(); RRItr != gmt_records.end(); ++RRItr ) {
700 std::vector<L1MuRegionalCand> dttfCands = RRItr->getDTBXCands();
701 std::vector<L1MuRegionalCand>::iterator dttfCand;
703 for( dttfCand = dttfCands.begin(); dttfCand != dttfCands.end();
706 if(dttfCand->empty())
continue;
708 if ( RRItr->getBxInEvent() )
continue;
712 gmtBx0DttfCandidates.push_back( *dttfCand );
718 edm::LogError(
"DataNotFound") <<
"Unable to getByToken L1MuGMTReadoutCollection with label " 724 if ( accept )
fillMEs( trackContainer, gmtBx0DttfCandidates );
727 std::vector<L1MuRegionalCand>::iterator dttfCand;
728 for( dttfCand = gmtBx0DttfCandidates.begin();
729 dttfCand != gmtBx0DttfCandidates.end(); ++dttfCand ) {
730 if( dttfCand->empty() )
continue;
735 int phi= dttfCand->phi_packed();
736 int sector = 1 + (phi + 6)/12;
737 if (sector > 12 ) sector -= 12;
738 double eta = dttfCand->etaValue();
743 }
else if ( eta < -0.3 ) {
746 }
else if ( eta < 0.3 ) {
749 }
else if ( eta < 0.74 ) {
762 int numTracksInt = 0;
764 for (
int w = 0;
w < 6; ++
w ) {
766 int numTracks_wh = 0;
767 for (
int s = 0;
s < 12; ++
s ) {
775 numTracksInt += numTracks_wh;
791 std::vector<L1MuRegionalCand>& gmtDttfCands )
794 L1MuDTTrackContainer::TrackContainer::const_iterator
track 795 = trackContainer->begin();
796 L1MuDTTrackContainer::TrackContainer::const_iterator trackEnd
797 = trackContainer->end();
799 for ( ; track != trackEnd; ++
track ) {
802 edm::LogInfo(
"L1TDTTF::Analyze") <<
"bx = " << track->bx();
803 edm::LogInfo(
"L1TDTTF::Analyze") <<
"quality (packed) = " 804 << track->quality_packed();
806 << track->pt_packed()
807 <<
" , pt (GeV) = " << track->ptValue();
809 << track->phi_packed()
810 <<
" , phi (rad) = " << track->phiValue();
811 edm::LogInfo(
"L1TDTTF::Analyze") <<
"charge (packed) = " 812 << track->charge_packed();
817 if ( ( track->whNum() == -1 ) && ! track->eta_packed() ) {
818 edm::LogInfo(
"L1TDTTF::Analyze") <<
"Skipping N0 with zero eta value";
824 int bxindex = track->bx() + 1;
825 int se = track->scNum();
827 int whindex = track->whNum();
829 whindex = ( whindex < 0 ) ? whindex + 3 : whindex + 2;
831 if ( whindex < 0 || whindex > 5 ) {
832 edm::LogError(
"L1TDTTF::Analyze::WHEEL_ERROR") << track->whNum()
833 <<
"(" << whindex <<
")";
837 if ( se < 0 || se > 11 ) {
854 int phi_global = track->phi_packed();
855 phi_global = (phi_global > 15 ? phi_global - 32 : phi_global ) + se * 12;
856 if ( phi_global < -6 ) phi_global += 144;
857 if ( phi_global > 137 ) phi_global -= 144;
872 if( track->TrkTag() == 1 ) {
884 if ( bxindex == 1 ) {
899 dttf_q[whindex][se]->
Fill(track->charge_packed());
905 if( track->isFineHalo() ) {
929 if ( track->TrkTag() == 1 ) {
956 std::vector<L1MuRegionalCand>::iterator dttfCand;
958 unsigned int gmt_phi = ( phi_global < 0 ? phi_global + 144 : phi_global );
960 for ( dttfCand = gmtDttfCands.begin(); dttfCand != gmtDttfCands.end();
964 if ( dttfCand->empty() )
continue;
965 if ( ( dttfCand->phi_packed() == gmt_phi ) &&
966 dttfCand->quality_packed() == track->quality_packed() ) {
1022 case 0 : start = 0; stop = 18; nbins = 18;
break;
1023 case 1 : start = 8; stop = 28; nbins = 20;
break;
1024 case 2 : start = 22; stop = 32; nbins = 10;
break;
1025 case 3 : start = 22; stop = 42; nbins = 20;
break;
1026 case 4 : start = 36; stop = 56; nbins = 20;
break;
1027 case 5 : start = 46; stop = 64; nbins = 18;
break;
1028 default : start = 0; stop = 0; nbins = 0;
break;
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)
MonitorElement * dttf_nTracksPerEvent_wheel[6]
MonitorElement * dttf_phi_eta_fine_wheel[6]
void beginLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) override
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)
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]
MonitorElement * book1D(Args &&...args)
edm::EDGetTokenT< L1MuDTTrackContainer > trackInputToken_
void fillMEs(std::vector< L1MuDTTrackCand > const *trackContainer, std::vector< L1MuRegionalCand > &gmtDttfCands)
MonitorElement * dttf_gmt_missed
MonitorElement * dttf_quality_summary_wheel_2ndTrack[6]
MonitorElement * dttf_eta_fine_fraction[6][12]
MonitorElement * dttf_bx[6][12]
void setCurrentFolder(const std::string &fullpath)
T const * product() const
MonitorElement * book2D(Args &&...args)
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
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
TH2F * getTH2F(void) const
MonitorElement * dttf_q[6][12]
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void setQualLabel(MonitorElement *me, int axis)
TrackContainer const * getContainer() const
L1TDTTF(const edm::ParameterSet &ps)
base services