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_;
287 char c_whn[6][3] = {
"N2",
"N1",
"N0",
"P0",
"P1",
"P2" };
291 for (
int iwh = 0; iwh < 6; ++iwh ) {
293 bookEta( iwh, nbins, start, stop );
298 std::string dttf_trk_folder_wheel = dttf_trk_folder + wheelpath[iwh];
302 sprintf(hname,
"dttf_01_nTracksPerEvent_wh%s", c_whn[iwh]);
303 sprintf(htitle,
"Wheel %s - Number Tracks Per Event", c_whn[iwh]);
309 sprintf(hname,
"dttf_07_phi_vs_etaFine_wh%s", c_whn[iwh]);
310 sprintf(htitle,
"Wheel %s - #eta-#phi DTTF Tracks occupancy (fine #eta only, unpacked values)", c_whn[iwh]);
312 nbins, start-0.5, stop-0.5,
320 sprintf(hname,
"dttf_08_phi_vs_etaCoarse_wh%s", c_whn[iwh]);
321 sprintf(htitle,
"Wheel %s - #eta-#phi DTTF Tracks occupancy (coarse #eta only, unpacked values)", c_whn[iwh]);
323 nbins, start-0.5, stop-0.5,
332 dttf_trk_folder_wheel +
"/2ND_TRACK_ONLY";
337 sprintf(hname,
"dttf_04_quality_wh%s_2ndTrack", c_whn[iwh]);
338 sprintf(htitle,
"Wheel %s - 2nd Tracks Quality distribution", c_whn[iwh]);
343 sprintf(hname,
"dttf_05_quality_summary_wh%s_2ndTrack", c_whn[iwh]);
344 sprintf(htitle,
"Wheel %s - 2nd Tracks - Quality", c_whn[iwh]);
346 12, 1, 13, 7, 1, 8 );
352 sprintf(hname,
"dttf_06_phi_vs_eta_wh%s_2ndTrack", c_whn[iwh]);
353 sprintf(htitle,
"Wheel %s - #eta-#phi Distribution of DTTF 2nd Tracks",
357 nbins, start-0.5,stop-0.5,
366 sprintf(hname,
"dttf_07_eta_wh%s_2ndTrack", c_whn[iwh]);
367 sprintf(htitle,
"Wheel %s - DTTF 2nd Tracks #eta distribution (Packed values)",
373 sprintf(hname,
"dttf_08_phi_wh%s_2ndTrack", c_whn[iwh]);
374 sprintf(htitle,
"Wheel %s - DTTF 2nd Tracks Phi distribution (Packed values)",
380 sprintf(hname,
"dttf_09_pt_wh%s_2ndTrack", c_whn[iwh]);
381 sprintf(htitle,
"Wheel %s - DTTF 2nd Tracks p_{T} distribution (Packed values)",
387 sprintf(hname,
"dttf_10_charge_wh%s_2ndTrack", c_whn[iwh]);
388 sprintf(htitle,
"Wheel %s - DTTF 2nd Tracks Charge distribution", c_whn[iwh]);
400 std::string dttf_trk_folder_nTracksPerEvent = dttf_trk_folder_wheel +
"/TracksPerEvent";
403 for(
int ise = 0; ise < 12; ++ise) {
404 sprintf(hname,
"dttf_nTracksPerEvent_wh%s_se%d", c_whn[iwh], ise+1);
405 sprintf(htitle,
"Wheel %s Sector %d - Number of Tracks Per Event",
414 dttf_trk_folder_wheel +
"/BX_BySector";
417 for(
int ise = 0; ise < 12; ++ise ) {
418 sprintf(hname,
"dttf_bx_wh%s_se%d", c_whn[iwh], ise+1);
419 sprintf(htitle,
"Wheel %s Sector %d - BX Distribution",
421 dttf_bx[iwh][ise] = ibooker.
book1D(hname, htitle, 3, -1.5, 1.5);
426 dttf_trk_folder_wheel +
"/BX_BySector/2ND_TRACK_ONLY";
429 for(
int ise = 0; ise < 12; ++ise ) {
430 sprintf(hname,
"dttf_bx_2ndTrack_wh%s_se%d", c_whn[iwh], ise+1);
431 sprintf(htitle,
"Wheel %s Sector %d - BX 2nd Tracks only",
438 std::string dttf_trk_folder_charge = dttf_trk_folder_wheel +
"/Charge";
441 for(
int ise = 0; ise < 12; ++ise) {
442 sprintf(hname,
"dttf_charge_wh%s_se%d", c_whn[iwh], ise+1);
443 sprintf(htitle,
"Wheel %s Sector %d - Packed Charge", c_whn[iwh], ise+1);
444 dttf_q[iwh][ise] = ibooker.
book1D(hname, htitle, 2, -0.5, 1.5);
449 std::string dttf_trk_folder_pt = dttf_trk_folder_wheel +
"/PT";
452 for(
int ise = 0; ise < 12; ++ise ) {
453 sprintf(hname,
"dttf_pt_wh%s_se%d", c_whn[iwh], ise+1);
454 sprintf(htitle,
"Wheel %s Sector %d - Packed p_{T}",
455 c_whn[iwh], ise + 1 );
456 dttf_pt[iwh][ise]= ibooker.
book1D(hname, htitle, 32, -0.5, 31.5);
461 std::string dttf_trk_folder_phi = dttf_trk_folder_wheel +
"/Phi";
464 for(
int ise = 0; ise < 12; ++ise ) {
465 sprintf(hname,
"dttf_phi_wh%s_se%d", c_whn[iwh], ise+1);
466 sprintf(htitle,
"Wheel %s Sector %d - Packed Phi", c_whn[iwh], ise+1);
473 std::string dttf_trk_folder_quality = dttf_trk_folder_wheel +
"/Quality";
476 for(
int ise = 0; ise < 12; ++ise){
477 sprintf(hname,
"dttf_qual_wh%s_se%d", c_whn[iwh], ise+1);
478 sprintf(htitle,
"Wheel %s Sector %d - Packed Quality",
486 std::string dttf_trk_folder_eta = dttf_trk_folder_wheel +
"/Eta";
489 for (
int ise = 0; ise < 12; ++ise ) {
491 sprintf(hname,
"dttf_eta_wh%s_se%d", c_whn[iwh], ise+1);
492 sprintf(htitle,
"Wheel %s Sector %d - Packed #eta",
494 dttf_eta[iwh][ise] = ibooker.
book1D(hname, htitle, 64, -0.5, 63.5);
500 dttf_trk_folder_eta = dttf_trk_folder_wheel +
"/EtaFineFraction";
503 for (
int ise = 0; ise < 12; ++ise ) {
505 sprintf(hname,
"dttf_etaFine_fraction_wh%s_se%d", c_whn[iwh], ise+1);
506 sprintf(htitle,
"Wheel %s Sector %d - Eta Fine Fraction",
519 std::string dttf_trk_folder_inclusive = dttf_trk_folder +
"/01-INCLUSIVE";
523 sprintf(hname,
"dttf_01_nTracksPerEvent_integ");
524 sprintf(htitle,
"Number of DTTF Tracks Per Event");
536 sprintf(hname,
"dttf_04_tracks_occupancy_by_lumi");
537 sprintf(htitle,
"DTTF Tracks in the last LumiSections");
544 sprintf(hname,
"dttf_04_global_muons_request");
545 sprintf(htitle,
"Tracks compatible with a Global Muon in the Barrel");
555 dttf_trk_folder +
"/08-GMT_MATCH";
558 sprintf(hname,
"dttf_tracks_with_gmt_match");
559 sprintf(htitle,
"DTTF Tracks With a Match in GMT");
563 sprintf(hname,
"dttf_tracks_without_gmt_match");
564 sprintf(htitle,
"DTTF Tracks Without a Match in GMT");
568 sprintf(hname,
"dttf_missing_tracks_in_gmt");
569 sprintf(htitle,
"GMT Tracks Without a Corresponding Track in DTTF");
592 edm::LogInfo(
"L1TDTTF::Analyze::start") <<
"#################### START";
596 memset(
numTracks, 0, 72 *
sizeof(
int) );
604 <<
"can't getByToken L1MuDTTrackContainer with label "
609 if ( !myL1MuDTTrackContainer.
isValid() ) {
611 <<
"can't find L1MuDTTrackContainer with label "
617 myL1MuDTTrackContainer->getContainer();
620 if ( trackContainer->size() > 0 ) {
637 for (reco::MuonCollection::const_iterator recoMu = muons->begin();
638 recoMu!=muons->end(); ++recoMu ) {
639 if ( fabs( recoMu->eta() ) < 1.4 ) {
641 edm::LogInfo(
"L1TDTTFClient::Analyze:GM") <<
"Found a global muon!";
655 <<
"No global muons in this event!";
666 <<
"Invalid MuonCollection with label "
674 edm::LogError(
"DataNotFound") <<
"Unable to getByToken MuonCollection with label "
682 std::vector<L1MuRegionalCand> gmtBx0DttfCandidates;
689 if ( !pCollection.
isValid() ) {
690 edm::LogError(
"DataNotFound") <<
"can't find L1MuGMTReadoutCollection with label "
696 std::vector<L1MuGMTReadoutRecord> gmt_records = gmtrc->
getRecords();
698 std::vector<L1MuGMTReadoutRecord>::const_iterator RRItr;
700 for ( RRItr = gmt_records.begin(); RRItr != gmt_records.end(); ++RRItr ) {
702 std::vector<L1MuRegionalCand> dttfCands = RRItr->getDTBXCands();
703 std::vector<L1MuRegionalCand>::iterator dttfCand;
705 for( dttfCand = dttfCands.begin(); dttfCand != dttfCands.end();
708 if(dttfCand->empty())
continue;
710 if ( RRItr->getBxInEvent() )
continue;
714 gmtBx0DttfCandidates.push_back( *dttfCand );
720 edm::LogError(
"DataNotFound") <<
"Unable to getByToken L1MuGMTReadoutCollection with label "
726 if ( accept )
fillMEs( trackContainer, gmtBx0DttfCandidates );
729 std::vector<L1MuRegionalCand>::iterator dttfCand;
730 for( dttfCand = gmtBx0DttfCandidates.begin();
731 dttfCand != gmtBx0DttfCandidates.end(); ++dttfCand ) {
732 if( dttfCand->empty() )
continue;
737 int phi= dttfCand->phi_packed();
738 int sector = 1 + (phi + 6)/12;
739 if (sector > 12 ) sector -= 12;
740 double eta = dttfCand->etaValue();
745 }
else if ( eta < -0.3 ) {
748 }
else if ( eta < 0.3 ) {
751 }
else if ( eta < 0.74 ) {
764 int numTracksInt = 0;
766 for (
int w = 0;
w < 6; ++
w ) {
768 int numTracks_wh = 0;
769 for (
int s = 0;
s < 12; ++
s ) {
777 numTracksInt += numTracks_wh;
793 std::vector<L1MuRegionalCand>& gmtDttfCands )
796 L1MuDTTrackContainer::TrackContainer::const_iterator track
797 = trackContainer->begin();
798 L1MuDTTrackContainer::TrackContainer::const_iterator trackEnd
799 = trackContainer->end();
801 for ( ; track != trackEnd; ++track ) {
804 edm::LogInfo(
"L1TDTTF::Analyze") <<
"bx = " << track->bx();
805 edm::LogInfo(
"L1TDTTF::Analyze") <<
"quality (packed) = "
806 << track->quality_packed();
808 << track->pt_packed()
809 <<
" , pt (GeV) = " << track->ptValue();
811 << track->phi_packed()
812 <<
" , phi (rad) = " << track->phiValue();
813 edm::LogInfo(
"L1TDTTF::Analyze") <<
"charge (packed) = "
814 << track->charge_packed();
819 if ( ( track->whNum() == -1 ) && ! track->eta_packed() ) {
820 edm::LogInfo(
"L1TDTTF::Analyze") <<
"Skipping N0 with zero eta value";
826 int bxindex = track->bx() + 1;
827 int se = track->scNum();
829 int whindex = track->whNum();
831 whindex = ( whindex < 0 ) ? whindex + 3 : whindex + 2;
833 if ( whindex < 0 || whindex > 5 ) {
834 edm::LogError(
"L1TDTTF::Analyze::WHEEL_ERROR") << track->whNum()
835 <<
"(" << whindex <<
")";
839 if ( se < 0 || se > 11 ) {
856 int phi_global = track->phi_packed();
857 phi_global = (phi_global > 15 ? phi_global - 32 : phi_global ) + se * 12;
858 if ( phi_global < -6 ) phi_global += 144;
859 if ( phi_global > 137 ) phi_global -= 144;
874 if( track->TrkTag() == 1 ) {
886 if ( bxindex == 1 ) {
901 dttf_q[whindex][se]->
Fill(track->charge_packed());
907 if( track->isFineHalo() ) {
931 if ( track->TrkTag() == 1 ) {
958 std::vector<L1MuRegionalCand>::iterator dttfCand;
960 unsigned int gmt_phi = ( phi_global < 0 ? phi_global + 144 : phi_global );
962 for ( dttfCand = gmtDttfCands.begin(); dttfCand != gmtDttfCands.end();
966 if ( dttfCand->empty() )
continue;
967 if ( ( dttfCand->phi_packed() == gmt_phi ) &&
968 dttfCand->quality_packed() == track->quality_packed() ) {
1024 case 0 : start = 0; stop = 18; nbins = 18;
break;
1025 case 1 : start = 8; stop = 28; nbins = 20;
break;
1026 case 2 : start = 22; stop = 32; nbins = 10;
break;
1027 case 3 : start = 22; stop = 42; nbins = 20;
break;
1028 case 4 : start = 36; stop = 56; nbins = 20;
break;
1029 case 5 : start = 46; stop = 64; nbins = 18;
break;
1030 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_
tuple start
Check for commandline option errors.
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]
MonitorElement * bookInt(Args &&...args)
MonitorElement * lumisecId_
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
MonitorElement * dttf_pt_wheel_2ndTrack[6]
MonitorElement * dttf_eta_wheel_2ndTrack[6]
edm::EDGetTokenT< L1MuGMTReadoutCollection > gmtSourceToken_
MonitorElement * dttf_qual[6][12]
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)
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
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]
virtual void dqmBeginRun(edm::Run const &, edm::EventSetup const &)
virtual void beginLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &)
MonitorElement * dttf_q_wheel_2ndTrack[6]
MonitorElement * dttf_eta[6][12]
virtual void bookHistograms(DQMStore::IBooker &i, edm::Run const &, edm::EventSetup const &) override
std::vector< L1MuGMTReadoutRecord > const & getRecords() const
MonitorElement * dttf_nTracksPerEv[6][12]
void analyze(const edm::Event &e, const edm::EventSetup &c)
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
volatile std::atomic< bool > shutdown_flag false
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)
L1TDTTF(const edm::ParameterSet &ps)
base services