-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Modernized HLTMuonPointingFilter #30987
Modernized HLTMuonPointingFilter #30987
Conversation
The code-checks are being triggered in jenkins. |
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-30987/17438
|
A new Pull Request was created by @Dr15Jones (Chris Jones) for master. It involves the following packages: HLTrigger/special @cmsbuild, @Martin-Grunewald, @fwyzard can you please review it and eventually sign? Thanks. cms-bot commands are listed here |
please test |
The tests are being triggered in jenkins.
|
@Dr15Jones thanks for taking care of this. If I'm not mistaken, after your changes the only non- |
+1 The following merge commits were also included on top of IB + this PR after doing git cms-merge-topic:
You can see more details here: |
Comparison job queued. |
@fwyzard thanks for the suggestion. My ownly worry is are we actually sure that all the classes inheriting from Propagator are actually thread-safe? For example, looks problematic to me as it has non-const pointers as member data. |
Ultimately I'm not the person who has to maintain the code so I'll happily convert it to global if you want. |
@Martin-Grunewald what do you prefer ? |
@makortel is of the opinion that Propagator is const thread safe and the clone is used to allowing calling the non-const interface. |
Comparison is ready Comparison Summary:
|
So... does the fact that the module compiles with a diff --git a/HLTrigger/special/plugins/HLTMuonPointingFilter.cc b/HLTrigger/special/plugins/HLTMuonPointingFilter.cc
index edb68ca4336..b70aecbb737 100644
--- a/HLTrigger/special/plugins/HLTMuonPointingFilter.cc
+++ b/HLTrigger/special/plugins/HLTMuonPointingFilter.cc
@@ -44,9 +44,7 @@ HLTMuonPointingFilter::HLTMuonPointingFilter(const edm::ParameterSet& pset)
// Get a surface (here a cylinder of radius 1290mm) ECAL
theCyl(Cylinder::build(theRadius, Cylinder::PositionType{}, Cylinder::RotationType{})),
thePosPlane(Plane::build(Plane::PositionType{0, 0, static_cast<float>(theMaxZ)}, Plane::RotationType{})),
- theNegPlane(Plane::build(Plane::PositionType{0, 0, static_cast<float>(-theMaxZ)}, Plane::RotationType{})),
- thePropagator(nullptr),
- m_cacheRecordId(0) {
+ theNegPlane(Plane::build(Plane::PositionType{0, 0, static_cast<float>(-theMaxZ)}, Plane::RotationType{})) {
LogDebug("HLTMuonPointing") << " SALabel : " << pset.getParameter<edm::InputTag>("SALabel")
<< " Radius : " << theRadius << " Half lenght : " << theMaxZ
<< " Min pixel hits : " << thePixHits << " Min tk layers measurements : " << theTkLayers
@@ -61,15 +59,12 @@ bool HLTMuonPointingFilter::filter(edm::Event& event, const edm::EventSetup& eve
bool accept = false;
const TrackingComponentsRecord& tkRec = eventSetup.get<TrackingComponentsRecord>();
- if (not thePropagator or tkRec.cacheIdentifier() != m_cacheRecordId) {
- // get the new propagator from the EventSetup and clone it (for thread safety)
- ESHandle<Propagator> propagatorHandle = tkRec.getHandle(thePropagatorToken);
- thePropagator.reset(propagatorHandle.product()->clone());
- if (thePropagator->propagationDirection() != anyDirection)
- throw cms::Exception("Configuration")
- << "the propagator " << thePropagatorName
- << " should be configured with PropagationDirection = \"anyDirection\"" << std::endl;
- m_cacheRecordId = tkRec.cacheIdentifier();
+ ESHandle<Propagator> propagatorHandle = tkRec.getHandle(thePropagatorToken);
+ Propagator const& propagator = *propagatorHandle.product();
+ if (propagator.propagationDirection() != anyDirection) {
+ throw cms::Exception("Configuration")
+ << "the propagator " << thePropagatorName
+ << " should be configured with PropagationDirection = \"anyDirection\"" << std::endl;
}
ESHandle<MagneticField> theMGField = eventSetup.getHandle(theMGFieldToken);
@@ -95,7 +90,7 @@ bool HLTMuonPointingFilter::filter(edm::Event& event, const edm::EventSetup& eve
LogDebug("HLTMuonPointing") << " InnerTSOS " << innerTSOS;
- TrajectoryStateOnSurface tsosAtCyl = thePropagator->propagate(*innerTSOS.freeState(), *theCyl);
+ TrajectoryStateOnSurface tsosAtCyl = propagator.propagate(*innerTSOS.freeState(), *theCyl);
if (tsosAtCyl.isValid()) {
LogDebug("HLTMuonPointing") << " extrap TSOS " << tsosAtCyl << " number of pixel hits " << pixelHits
@@ -117,9 +112,9 @@ bool HLTMuonPointingFilter::filter(edm::Event& event, const edm::EventSetup& eve
<< " number of muon hits " << nMuonHits;
TrajectoryStateOnSurface tsosAtPlane;
if (tsosAtCyl.globalPosition().z() > 0)
- tsosAtPlane = thePropagator->propagate(*innerTSOS.freeState(), *thePosPlane);
+ tsosAtPlane = propagator.propagate(*innerTSOS.freeState(), *thePosPlane);
else
- tsosAtPlane = thePropagator->propagate(*innerTSOS.freeState(), *theNegPlane);
+ tsosAtPlane = propagator.propagate(*innerTSOS.freeState(), *theNegPlane);
if (tsosAtPlane.isValid()) {
if (tsosAtPlane.globalPosition().perp() < theRadius) {
diff --git a/HLTrigger/special/plugins/HLTMuonPointingFilter.h b/HLTrigger/special/plugins/HLTMuonPointingFilter.h
index 5c9ab21997d..ab8d54a2c27 100644
--- a/HLTrigger/special/plugins/HLTMuonPointingFilter.h
+++ b/HLTrigger/special/plugins/HLTMuonPointingFilter.h
@@ -67,8 +67,5 @@ private:
const Cylinder::CylinderPointer theCyl;
const Plane::PlanePointer thePosPlane;
const Plane::PlanePointer theNegPlane;
-
- std::unique_ptr<Propagator> thePropagator;
- unsigned long long m_cacheRecordId;
};
#endif // Muon_HLTMuonPointingFilter_h |
That is the thought. |
The code-checks are being triggered in jenkins. |
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-30987/17484
|
Pull request #30987 was updated. @cmsbuild, @Martin-Grunewald, @fwyzard can you please check and sign again. |
please test |
The tests are being triggered in jenkins.
|
+1 |
Comparison job queued. |
Comparison is ready Comparison Summary:
|
+1 |
This pull request is fully signed and it will be integrated in one of the next master IBs (tests are also fine). This pull request will now be reviewed by the release team before it's merged. @silviodonato, @dpiparo, @qliphy (and backports should be raised in the release meeting by the corresponding L2) |
+1 |
PR description:
This is part of #25090
PR validation:
The code compiles.