Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

L1 tracking update #47067

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

L1 tracking update #47067

wants to merge 5 commits into from

Conversation

tschuh
Copy link
Contributor

@tschuh tschuh commented Jan 9, 2025

This PR updates mainly the modules

  • L1Trigger/TrackFindingTracklet
  • L1Trigger/TrackFindingTMTT
  • L1Trigger/TrackTrigger
  • L1Trigger/TrackerDTC
  • L1Trigger/TrackerTFP
  • DataFormats/L1TrackTrigger
  • SimTracker/TrackTriggerAssociation

in order to sync s/w emulation of L1 tracking with current f/w. Some name changes have also been propagated to additional modules.

The code changes of this PR did pass review of L1 tracking community checking for L1 tracking performance, code formats, etc.

@cmsbuild
Copy link
Contributor

cmsbuild commented Jan 9, 2025

cms-bot internal usage

@cmsbuild
Copy link
Contributor

cmsbuild commented Jan 9, 2025

-code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-47067/43234

@cmsbuild
Copy link
Contributor

cmsbuild commented Jan 9, 2025

-code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-47067/43235

@cmsbuild
Copy link
Contributor

cmsbuild commented Jan 9, 2025

-code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-47067/43238

ci workflow deleted from pr.

data folder deleted.
@Moanwar
Copy link
Contributor

Moanwar commented Jan 12, 2025

+Upgrade

Copy link
Contributor

@makortel makortel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The core part itself (DataFormats/WrappedStdDictionaries/src/classes_def.xml) is fine, but I took a very cursory look to the other code.

I noticed two widespread patterns that should be improved:

  • holding copies of edm::ParameterSet and parsing them during event processing
    • ParameterSet copies take memory (they are not lightweight)
    • parsing ParameterSet is not fast (it's not super-slow either, but not intended to be done during data processing)
  • function-statics (even if const) that are initialized based on the state of some object
    • It was not straightforward to figure out whether those static constants are effectively build-time-defined constants, or depend on some runtime-dependent value(s) such as coming from the EventSetup. In the latter case this pattern effectively prevents these values changing between IOVs (or testing two payloads with different values in the same job), but in the way the situation can only be discovered from the physics results.
    • There was one non-const function static that is a thread-safety issue

Comment on lines +37 to +40
// increment of Process
inline constexpr Process operator++(Process p) { return Process(+p + 1); }
// increment of Variable
inline constexpr Variable operator++(Variable v) { return Variable(+v + 1); }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could imagine prefix increment of ++a not incrementing a to lead to a confusion by a future reader of the code.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Comment on lines 10 to 13
typedef edm::mpl::Vector<ChannelAssignmentRcd> RcdsDataFormats;

// record of trklet::DataFormats
class DataFormatsRcd : public edm::eventsetup::DependentRecordImplementation<DataFormatsRcd, RcdsDataFormats> {};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could ChannelAssignmentRcd be used directly, since DataFormatsRcd doesn't depend on anything else? Or is DataFormatsRcd foreseen to depend on additional Records?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No it only depends on ChannelAssignmentRcd. How does one use a Rcd directly?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can just replace all uses of DataFormatsRcd with ChannelAssignmentRcd.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

// number of bits used to represent layer id [barrel: 0-5, discs: 6-10]
int widthLayerId_;
// TM parameter
edm::ParameterSet pSetTM_;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be great if copying edm::ParameterSet could be avoided.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

int iPhiSec,
int iEtaReg)
: settings_(settings),
stubs_(stubs),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
stubs_(stubs),
stubs_(std::move(stubs)),

to avoid a copy.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Comment on lines 87 to 88
stubsConst_(std::vector<const Stub*>()),
bestStubs_(std::unordered_set<const Stub*>()),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These have the same effect as default constructor, and are thus not needed.

Suggested change
stubsConst_(std::vector<const Stub*>()),
bestStubs_(std::unordered_set<const Stub*>()),

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Comment on lines 279 to 280
static const DataFormat& dfInv2R = dataFormats_->format(Variable::inv2R, Process::ht);
static const DataFormat& dfPhiT = dataFormats_->format(Variable::phiT, Process::ht);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function-statics

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

void produce(StreamID, Event&, const EventSetup&) const override;
void beginRun(const Run&, const EventSetup&) override;
void produce(Event&, const EventSetup&) override;
void endJob() {}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
void endJob() {}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@@ -50,25 +54,70 @@ namespace tt {
EDPutTokenT<StubAssociation> putTokenSelection_;
// Setup token
ESGetToken<Setup, SetupRcd> esGetTokenSetup_;
//
ParameterSet pSet_;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be great to avoid holding a copy of the edm::ParameterSet.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

static constexpr bool intimeOnly = true;
static constexpr bool chargedOnly = true;
static constexpr bool stableOnly = false;
static const double maxEta = asinh((maxZT_ + maxZ0_) / setup_->chosenRofZ());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function-static

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Comment on lines 139 to 140
StubAssociation reconstructable(pSet_, setup_);
StubAssociation selection(pSet_, setup_);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Parsing edm::ParameterSet within event processing is slow

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@artlbv
Copy link
Contributor

artlbv commented Jan 17, 2025

I saw there are 3 workflows with trigger differences, so here is the only with >1 trigger differing:

      Events    Accepted      Gained        Lost       Other  Trigger
          10           2          +1           -           -  pDoublePuppiTau52_52
          10           5          +1           -           -  pPuppiHT400
          10           0          +1           -           -  pPuppiMET200
          10           0           -           -          ~1  HLT_PFPuppiMETTypeOne140_PFPuppiMHT140
          10           1           -           -          ~1  HLT_PFHT330PT30_QuadPFPuppiJet_75_60_45_40_TriplePFPuppiBTagDeepCSV_2p4
          10           1           -           -          ~1  HLT_PFHT200PT30_QuadPFPuppiJet_70_40_30_30_TriplePFPuppiBTagDeepCSV_2p4
          10           1           -           -          ~1  HLT_PFHT330PT30_QuadPFPuppiJet_75_60_45_40_TriplePFPuppiBTagDeepFlavour_2p4
          10           1           -           -          ~1  HLT_PFHT200PT30_QuadPFPuppiJet_70_40_30_30_TriplePFPuppiBTagDeepFlavour_2p4
          10           1           -           -          ~1  HLT_DoubleMediumChargedIsoPFTauHPS40_eta2p1
          10           2           -           -          ~1  HLT_DoubleMediumDeepTauPFTauHPS35_eta2p1
Created the following JSON files:
 /data/cmsbld/jenkins/workspace/compare-root-files-short-matrix/upload/triggerResults/29834.999_TTbar_14TeV+Run4D110PU_PMXS1S2PR/HLT.json

Though the stats are very low (@aloeliger @Moanwar can we have e.g. this wf with 100 events in future) there are more accepted events in three hadronic seeds. This is a bit suspicious for pure sw/fw syncing imo.
@tschuh or @BenjaminRS can you link the physics performance evaluation that was shown within L1TT as you mention?

@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-47067/43470

@cmsbuild
Copy link
Contributor

@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-47067/43488

@cmsbuild
Copy link
Contributor

@aloeliger
Copy link
Contributor

@tschuh have you looked at @artlbv 's comments?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants