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

Phase2 MuonHLTSeed MVA Classifier CMSSW_13_3_X #42745

Merged
merged 1 commit into from
Sep 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
doSeedingRegionRebuilding = cms.bool(False),
maxNSeeds = cms.uint32(100000),
maxSeedsBeforeCleaning = cms.uint32(1000),
src = cms.InputTag("hltIter2Phase2L3FromL1TkMuonPixelSeeds"),
src = cms.InputTag("hltIter2Phase2L3FromL1TkMuonPixelSeedsFiltered"),
useHitsSplitting = cms.bool(False)
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import FWCore.ParameterSet.Config as cms

hltIter2Phase2L3FromL1TkMuonPixelSeedsFiltered = cms.EDProducer("MuonHLTSeedMVAClassifierPhase2",
src = cms.InputTag("hltIter2Phase2L3FromL1TkMuonPixelSeeds"),
L1TkMu = cms.InputTag("l1tTkMuonsGmt"),
mvaFile_B_0 = cms.FileInPath("RecoMuon/TrackerSeedGenerator/data/xgb_Phase2_Iter2FromL1_barrel_v0.xml"),
mvaFile_E_0 = cms.FileInPath("RecoMuon/TrackerSeedGenerator/data/xgb_Phase2_Iter2FromL1_endcap_v0.xml"),
mvaScaleMean_B = cms.vdouble(0.00033113700731766336, 1.6825601468762878e-06, 1.790932122524803e-06, 0.010534608406382916, 0.005969459957330139, 0.0009605022254971113, 0.04384189672781466, 7.846741237608237e-05, 0.40725050850004824, 0.41125151617410227, 0.39815551065544846),
rappoccio marked this conversation as resolved.
Show resolved Hide resolved
mvaScaleStd_B = cms.vdouble(0.0006042948363798624, 2.445644111872427e-06, 3.454992543447134e-06, 0.09401581628887255, 0.7978806947573766, 0.4932933044535928, 0.04180518265631776, 0.058296511682094855, 0.4071857009373577, 0.41337782307392973, 0.4101160349549534),
mvaScaleMean_E = cms.vdouble(0.00022658482374555603, 5.358921973784045e-07, 1.010003713549798e-06, 0.0007886873612224615, 0.001197730548842408, -0.0030252353426003594, 0.07151944804171254, -0.0006940626775109026, 0.20535152195939896, 0.2966816533783824, 0.28798220230180455),
mvaScaleStd_E = cms.vdouble(0.0003857726789049956, 1.4853721474087994e-06, 6.982997036736564e-06, 0.04071340757666084, 0.5897606560095399, 0.33052121398064654, 0.05589386786541949, 0.08806273533388546, 0.3254586902665612, 0.3293354496231377, 0.3179899794578072),
doSort = cms.bool(True),
nSeedsMax_B = cms.int32(20),
nSeedsMax_E = cms.int32(20),
etaEdge = cms.double(1.2),
mvaCut_B = cms.double(0.),
mvaCut_E = cms.double(0.),
baseScore = cms.double(0.5)
)
rappoccio marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
from ..modules.hltIter2Phase2L3FromL1TkMuonPixelHitTriplets_cfi import *
from ..modules.hltIter2Phase2L3FromL1TkMuonPixelLayerTriplets_cfi import *
from ..modules.hltIter2Phase2L3FromL1TkMuonPixelSeeds_cfi import *
from ..modules.hltIter2Phase2L3FromL1TkMuonPixelSeedsFiltered_cfi import *
from ..modules.hltIter2Phase2L3FromL1TkMuonTrackCutClassifier_cfi import *
from ..modules.hltIter2Phase2L3FromL1TkMuonTrackSelectionHighPurity_cfi import *
from ..modules.hltL2MuonFromL1TkMuonCandidates_cfi import *
Expand Down Expand Up @@ -172,6 +173,7 @@
hltIter2Phase2L3FromL1TkMuonPixelHitTriplets,
hltIter2Phase2L3FromL1TkMuonPixelLayerTriplets,
hltIter2Phase2L3FromL1TkMuonPixelSeeds,
hltIter2Phase2L3FromL1TkMuonPixelSeedsFiltered,
hltIter2Phase2L3FromL1TkMuonTrackCutClassifier,
hltIter2Phase2L3FromL1TkMuonTrackSelectionHighPurity,
hltL2MuonFromL1TkMuonCandidates,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
from ..modules.hltIter2Phase2L3FromL1TkMuonPixelHitTriplets_cfi import *
from ..modules.hltIter2Phase2L3FromL1TkMuonPixelLayerTriplets_cfi import *
from ..modules.hltIter2Phase2L3FromL1TkMuonPixelSeeds_cfi import *
from ..modules.hltIter2Phase2L3FromL1TkMuonPixelSeedsFiltered_cfi import *
from ..modules.hltIter2Phase2L3FromL1TkMuonTrackCutClassifier_cfi import *
from ..modules.hltIter2Phase2L3FromL1TkMuonTrackSelectionHighPurity_cfi import *
from ..modules.hltL2MuonFromL1TkMuonCandidates_cfi import *
Expand Down Expand Up @@ -127,6 +128,7 @@
hltIter2Phase2L3FromL1TkMuonPixelHitTriplets,
hltIter2Phase2L3FromL1TkMuonPixelLayerTriplets,
hltIter2Phase2L3FromL1TkMuonPixelSeeds,
hltIter2Phase2L3FromL1TkMuonPixelSeedsFiltered,
hltIter2Phase2L3FromL1TkMuonTrackCutClassifier,
hltIter2Phase2L3FromL1TkMuonTrackSelectionHighPurity,
hltL2MuonFromL1TkMuonCandidates,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
from ..modules.hltIter2Phase2L3FromL1TkMuonPixelHitTriplets_cfi import *
from ..modules.hltIter2Phase2L3FromL1TkMuonPixelLayerTriplets_cfi import *
from ..modules.hltIter2Phase2L3FromL1TkMuonPixelSeeds_cfi import *
from ..modules.hltIter2Phase2L3FromL1TkMuonPixelSeedsFiltered_cfi import *
from ..modules.hltIter2Phase2L3FromL1TkMuonTrackCutClassifier_cfi import *
from ..modules.hltIter2Phase2L3FromL1TkMuonTrackSelectionHighPurity_cfi import *
from ..modules.hltL2MuonFromL1TkMuonCandidates_cfi import *
Expand Down Expand Up @@ -99,6 +100,7 @@
hltIter2Phase2L3FromL1TkMuonPixelHitTriplets,
hltIter2Phase2L3FromL1TkMuonPixelLayerTriplets,
hltIter2Phase2L3FromL1TkMuonPixelSeeds,
hltIter2Phase2L3FromL1TkMuonPixelSeedsFiltered,
hltIter2Phase2L3FromL1TkMuonTrackCutClassifier,
hltIter2Phase2L3FromL1TkMuonTrackSelectionHighPurity,
hltL2MuonFromL1TkMuonCandidates,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
from ..modules.hltIter2Phase2L3FromL1TkMuonPixelHitTriplets_cfi import *
from ..modules.hltIter2Phase2L3FromL1TkMuonPixelLayerTriplets_cfi import *
from ..modules.hltIter2Phase2L3FromL1TkMuonPixelSeeds_cfi import *
from ..modules.hltIter2Phase2L3FromL1TkMuonPixelSeedsFiltered_cfi import *
from ..modules.hltIter2Phase2L3FromL1TkMuonTrackCutClassifier_cfi import *
from ..modules.hltIter2Phase2L3FromL1TkMuonTrackSelectionHighPurity_cfi import *
from ..modules.hltL2MuonFromL1TkMuonCandidates_cfi import *
Expand Down Expand Up @@ -93,6 +94,7 @@
hltIter2Phase2L3FromL1TkMuonPixelHitTriplets,
hltIter2Phase2L3FromL1TkMuonPixelLayerTriplets,
hltIter2Phase2L3FromL1TkMuonPixelSeeds,
hltIter2Phase2L3FromL1TkMuonPixelSeedsFiltered,
hltIter2Phase2L3FromL1TkMuonTrackCutClassifier,
hltIter2Phase2L3FromL1TkMuonTrackSelectionHighPurity,
hltL2MuonFromL1TkMuonCandidates,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
from ..modules.hltIter2Phase2L3FromL1TkMuonPixelHitTriplets_cfi import *
from ..modules.hltIter2Phase2L3FromL1TkMuonPixelLayerTriplets_cfi import *
from ..modules.hltIter2Phase2L3FromL1TkMuonPixelSeeds_cfi import *
from ..modules.hltIter2Phase2L3FromL1TkMuonPixelSeedsFiltered_cfi import *
from ..modules.hltIter2Phase2L3FromL1TkMuonTrackCutClassifier_cfi import *
from ..modules.hltIter2Phase2L3FromL1TkMuonTrackSelectionHighPurity_cfi import *
from ..modules.hltL2MuonFromL1TkMuonCandidates_cfi import *
Expand Down Expand Up @@ -103,6 +104,7 @@
hltIter2Phase2L3FromL1TkMuonPixelHitTriplets,
hltIter2Phase2L3FromL1TkMuonPixelLayerTriplets,
hltIter2Phase2L3FromL1TkMuonPixelSeeds,
hltIter2Phase2L3FromL1TkMuonPixelSeedsFiltered,
hltIter2Phase2L3FromL1TkMuonTrackCutClassifier,
hltIter2Phase2L3FromL1TkMuonTrackSelectionHighPurity,
hltL2MuonFromL1TkMuonCandidates,
Expand Down
28 changes: 28 additions & 0 deletions RecoMuon/TrackerSeedGenerator/BuildFile.xml
Original file line number Diff line number Diff line change
@@ -1,32 +1,60 @@
<use name="CommonTools/MVAUtils"/>
<use name="CommonTools/Utils"/>
<use name="CommonTools/UtilAlgos"/>
<use name="DataFormats/BeamSpot"/>
<use name="DataFormats/Common"/>
<use name="DataFormats/GeometryCommonDetAlgo"/>
<use name="DataFormats/GeometryVector"/>
<use name="DataFormats/L1Trigger"/>
<use name="DataFormats/L1GlobalMuonTrigger"/>
<use name="DataFormats/MuonReco"/>
<use name="DataFormats/TrackReco"/>
<use name="DataFormats/TrackerRecHit2D"/>
<use name="DataFormats/TrackingRecHit"/>
<use name="DataFormats/TrajectorySeed"/>
<use name="DataFormats/TrajectoryState"/>
<use name="DataFormats/TrackerCommon"/>
<use name="DataFormats/RecoCandidate"/>
<use name="DataFormats/SiPixelDetId"/>
<use name="DataFormats/Phase2TrackerDigi"/>
<use name="DataFormats/L1TrackTrigger"/>
<use name="DataFormats/L1TCorrelator"/>
<use name="DataFormats/L1TMuonPhase2"/>
<use name="FWCore/Framework"/>
<use name="FWCore/Utilities"/>
<use name="FWCore/MessageLogger"/>
<use name="FWCore/ParameterSet"/>
<use name="FWCore/PluginManager"/>
<use name="Geometry/Records"/>
<use name="Geometry/TrackerGeometryBuilder"/>
<use name="Geometry/TrackerNumberingBuilder"/>
<use name="Geometry/CommonDetUnit"/>
<use name="Geometry/CommonTopologies"/>
<use name="MagneticField/Engine"/>
<use name="MagneticField/Records"/>
<use name="RecoMuon/DetLayers"/>
<use name="RecoMuon/TrackingTools"/>
<use name="RecoMuon/Records"/>
<use name="RecoTracker/PixelTrackFitting"/>
<use name="RecoTracker/TkMSParametrization"/>
<use name="RecoTracker/TkDetLayers"/>
<use name="RecoTracker/TkSeedingLayers"/>
<use name="RecoTracker/TkTrackingRegions"/>
<use name="RecoTracker/TransientTrackingRecHit"/>
<use name="SimTracker/Common"/>
<use name="SimTracker/TrackAssociation"/>
<use name="SimTracker/TrackerHitAssociation"/>
<use name="SimTracker/TrackTriggerAssociation"/>
<use name="SimDataFormats/Associations"/>
<use name="SimDataFormats/TrackingAnalysis"/>
<use name="SimGeneral/TrackingAnalysis"/>
<use name="TrackingTools/GeomPropagators"/>
<use name="TrackingTools/PatternTools"/>
<use name="TrackingTools/Records"/>
<use name="TrackingTools/TrajectoryState"/>
<use name="TrackingTools/TransientTrackingRecHit"/>
<use name="TrackingTools/TrackAssociator"/>
<use name="TrackPropagation/SteppingHelixPropagator"/>
<export>
<lib name="1"/>
</export>
88 changes: 88 additions & 0 deletions RecoMuon/TrackerSeedGenerator/interface/SeedMvaEstimatorPhase2.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
#ifndef RecoMuon_TrackerSeedGenerator_SeedMvaEstimatorPhase2_h
#define RecoMuon_TrackerSeedGenerator_SeedMvaEstimatorPhase2_h

#include "FWCore/Framework/interface/ConsumesCollector.h"
#include "FWCore/Framework/interface/ESHandle.h"
#include "FWCore/Framework/interface/EventSetup.h"
#include "FWCore/Utilities/interface/ESGetToken.h"
#include "FWCore/Utilities/interface/ESInputTag.h"
#include "DataFormats/Common/interface/Handle.h"
#include "DataFormats/TrackerCommon/interface/TrackerTopology.h"
#include "DataFormats/TrajectorySeed/interface/TrajectorySeed.h"
#include "DataFormats/TrajectorySeed/interface/TrajectorySeedCollection.h"
#include "DataFormats/TrajectorySeed/interface/PropagationDirection.h"
#include "DataFormats/TrajectoryState/interface/PTrajectoryStateOnDet.h"
#include "DataFormats/TrajectoryState/interface/LocalTrajectoryParameters.h"
#include "DataFormats/RecoCandidate/interface/RecoChargedCandidate.h"
#include "DataFormats/RecoCandidate/interface/RecoChargedCandidateFwd.h"
#include "DataFormats/L1TCorrelator/interface/TkMuon.h"
#include "DataFormats/L1TCorrelator/interface/TkMuonFwd.h"
#include "DataFormats/L1TMuonPhase2/interface/TrackerMuon.h"
#include "TrackingTools/GeomPropagators/interface/Propagator.h"
#include "TrackingTools/Records/interface/TrackingComponentsRecord.h"
#include "TrackingTools/TrajectoryState/interface/FreeTrajectoryState.h"
#include "RecoTracker/TkDetLayers/interface/GeometricSearchTracker.h"
#include "RecoTracker/TkDetLayers/interface/GeometricSearchTrackerBuilder.h"
#include "Geometry/TrackerNumberingBuilder/interface/GeometricDet.h"
#include "Geometry/Records/interface/IdealGeometryRecord.h"
#include "Geometry/Records/interface/TrackerTopologyRcd.h"

#include <memory>
#include <string>

typedef pair<const DetLayer*, TrajectoryStateOnSurface> LayerTSOS;
typedef pair<const DetLayer*, const TrackingRecHit*> LayerHit;

class GBRForest;

namespace edm {
class FileInPath;
}

class SeedMvaEstimatorPhase2 {
public:
SeedMvaEstimatorPhase2(const edm::FileInPath& weightsfile,
const std::vector<double>& scale_mean,
const std::vector<double>& scale_std);
~SeedMvaEstimatorPhase2();
rappoccio marked this conversation as resolved.
Show resolved Hide resolved

double computeMva(const TrajectorySeed&,
const GlobalVector&,
const GlobalPoint&,
const edm::Handle<l1t::TrackerMuonCollection>&,
const edm::ESHandle<MagneticField>&,
const Propagator&,
const GeometricSearchTracker&) const;

private:
std::unique_ptr<const GBRForest> gbrForest_;
const std::vector<double> scale_mean_;
const std::vector<double> scale_std_;

vector<LayerTSOS> getTsosOnPixels(const TTTrack<Ref_Phase2TrackerDigi_>&,
const edm::ESHandle<MagneticField>&,
const Propagator&,
const GeometricSearchTracker&) const;

vector<pair<LayerHit, LayerTSOS> > getHitTsosPairs(const TrajectorySeed&,
const edm::Handle<l1t::TrackerMuonCollection>&,
const edm::ESHandle<MagneticField>&,
const Propagator&,
const GeometricSearchTracker&) const;

void getL1TTVariables(const TrajectorySeed&,
const GlobalVector&,
const GlobalPoint&,
const edm::Handle<l1t::TrackerMuonCollection>&,
float&,
float&) const;
void getHitL1TkVariables(const TrajectorySeed&,
const edm::Handle<l1t::TrackerMuonCollection>&,
const edm::ESHandle<MagneticField>&,
const Propagator&,
const GeometricSearchTracker&,
float&,
float&,
float&) const;
};
#endif
28 changes: 25 additions & 3 deletions RecoMuon/TrackerSeedGenerator/plugins/BuildFile.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
<library name="RecoMuonTrackerSeedGeneratorPlugins" file="*.cc">
<use name="CommonTools/MVAUtils"/>
<use name="CommonTools/Utils"/>
<use name="CommonTools/UtilAlgos"/>
<use name="DataFormats/Common"/>
<use name="DataFormats/L1TCorrelator"/>
<use name="DataFormats/L1TrackTrigger"/>
<use name="DataFormats/L1Trigger"/>
<use name="DataFormats/MuonSeed"/>
<use name="DataFormats/MuonReco"/>
<use name="DataFormats/Phase2TrackerDigi"/>
<use name="DataFormats/RecoCandidate"/>
<use name="DataFormats/SiPixelDetId"/>
<use name="DataFormats/TrackerCommon"/>
<use name="DataFormats/TrackReco"/>
<use name="DataFormats/TrackingRecHit"/>
<use name="DataFormats/TrajectorySeed"/>
Expand All @@ -10,30 +20,42 @@
<use name="FWCore/MessageLogger"/>
<use name="FWCore/ParameterSet"/>
<use name="FWCore/PluginManager"/>
<use name="Geometry/CommonDetUnit" source_only="1"/>
<use name="FWCore/Utilities"/>
<use name="Geometry/CommonDetUnit" source_only="1"/>
<use name="Geometry/CommonTopologies"/>
<use name="Geometry/Records"/>
<use name="Geometry/TrackerGeometryBuilder"/>
<use name="Geometry/TrackerNumberingBuilder"/>
<use name="MagneticField/Engine"/>
<use name="MagneticField/Records"/>
<use name="RecoMuon/DetLayers"/>
<use name="RecoMuon/GlobalTrackingTools"/>
<use name="RecoMuon/Records"/>
<use name="RecoMuon/TrackerSeedGenerator"/>
<use name="RecoMuon/TrackingTools"/>
<use name="RecoTracker/PixelTrackFitting"/>
<use name="RecoTracker/MeasurementDet"/>
<use name="RecoTracker/PixelTrackFitting"/>
<use name="RecoTracker/Record"/>
<use name="RecoTracker/TkDetLayers"/>
<use name="RecoTracker/TkSeedGenerator"/>
<use name="RecoTracker/TkTrackingRegions"/>
<use name="TrackPropagation/SteppingHelixPropagator"/>
<use name="SimDataFormats/Associations"/>
<use name="SimDataFormats/TrackingAnalysis"/>
<use name="SimGeneral/TrackingAnalysis"/>
<use name="SimTracker/Common"/>
<use name="SimTracker/TrackAssociation"/>
<use name="SimTracker/TrackerHitAssociation"/>
<use name="SimTracker/TrackTriggerAssociation"/>
<use name="TrackingTools/DetLayers"/>
<use name="TrackingTools/GeomPropagators"/>
<use name="TrackingTools/KalmanUpdators"/>
<use name="TrackingTools/MeasurementDet"/>
<use name="TrackingTools/PatternTools"/>
<use name="TrackingTools/Records"/>
<use name="TrackingTools/TrackAssociator"/>
<use name="TrackingTools/TrajectoryState"/>
<use name="TrackingTools/TransientTrack"/>
<use name="TrackPropagation/SteppingHelixPropagator"/>
<use name="PhysicsTools/TensorFlow" />
<use name="roothistmatrix"/>
<flags EDM_PLUGIN="1"/>
Expand Down
Loading