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

L2muon changes: L2MuonSeedGenerator, L2MuonProducer #1864

Merged
merged 5 commits into from Jan 15, 2014
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions RecoMuon/L2MuonProducer/python/L2Muons_cfi.py
Expand Up @@ -7,6 +7,7 @@
MuonTrackLoaderForSTA,
MuonServiceProxy,
InputObjects = cms.InputTag("L2MuonSeeds"),
MuonTrajectoryBuilder = cms.string("StandAloneMuonTrajectoryBuilder"),
DoSeedRefit = cms.bool(False),
SeedTransformerParameters = cms.PSet(
Fitter = cms.string("hltESPKFFittingSmootherForL2Muon"),
Expand Down
17 changes: 15 additions & 2 deletions RecoMuon/L2MuonProducer/src/L2MuonProducer.cc
Expand Up @@ -24,6 +24,7 @@

// TrackFinder and Specific STA/L2 Trajectory Builder
#include "RecoMuon/StandAloneTrackFinder/interface/StandAloneTrajectoryBuilder.h"
#include "RecoMuon/StandAloneTrackFinder/interface/ExhaustiveMuonTrajectoryBuilder.h"
#include "RecoMuon/TrackingTools/interface/MuonTrackFinder.h"
#include "RecoMuon/TrackingTools/interface/MuonTrackLoader.h"
#include "RecoMuon/TrackingTools/interface/MuonTrajectoryCleaner.h"
Expand Down Expand Up @@ -62,10 +63,22 @@ L2MuonProducer::L2MuonProducer(const ParameterSet& parameterSet){
// the services
theService = new MuonServiceProxy(serviceParameters);

MuonTrajectoryBuilder * trajectoryBuilder = 0;
// instantiate the concrete trajectory builder in the Track Finder
edm::ConsumesCollector iC = consumesCollector();
theTrackFinder = new MuonTrackFinder(new StandAloneMuonTrajectoryBuilder(trajectoryBuilderParameters, theService,iC),
new MuonTrackLoader(trackLoaderParameters,iC, theService),
string typeOfBuilder = parameterSet.existsAs<string>("MuonTrajectoryBuilder") ?
parameterSet.getParameter<string>("MuonTrajectoryBuilder") : "StandAloneMuonTrajectoryBuilder";
if(typeOfBuilder == "StandAloneMuonTrajectoryBuilder" || typeOfBuilder == "")
trajectoryBuilder = new StandAloneMuonTrajectoryBuilder(trajectoryBuilderParameters,theService,iC);
else if(typeOfBuilder == "Exhaustive")
trajectoryBuilder = new ExhaustiveMuonTrajectoryBuilder(trajectoryBuilderParameters,theService,iC);
else{
LogWarning("Muon|RecoMuon|StandAloneMuonProducer") << "No Trajectory builder associated with "<<typeOfBuilder
<< ". Falling down to the default (StandAloneMuonTrajectoryBuilder)";
trajectoryBuilder = new StandAloneMuonTrajectoryBuilder(trajectoryBuilderParameters,theService,iC);
}
theTrackFinder = new MuonTrackFinder(trajectoryBuilder,
new MuonTrackLoader(trackLoaderParameters, iC, theService),
new MuonTrajectoryCleaner(true));

produces<reco::TrackCollection>();
Expand Down
1 change: 1 addition & 0 deletions RecoMuon/L2MuonSeedGenerator/python/L2MuonSeeds_cfi.py
Expand Up @@ -11,6 +11,7 @@
GMTReadoutCollection = cms.InputTag("gmtDigis"),
Propagator = cms.string('SteppingHelixPropagatorAny'),
UseOfflineSeed = cms.untracked.bool(True),
UseUnassociatedL1 = cms.bool( True ),
OfflineSeedLabel = cms.untracked.InputTag("L2OfflineMuonSeeds")
)

Expand Down
15 changes: 10 additions & 5 deletions RecoMuon/L2MuonSeedGenerator/src/L2MuonSeedGenerator.cc
Expand Up @@ -48,10 +48,13 @@ L2MuonSeedGenerator::L2MuonSeedGenerator(const edm::ParameterSet& iConfig) :
theL1MinPt(iConfig.getParameter<double>("L1MinPt")),
theL1MaxEta(iConfig.getParameter<double>("L1MaxEta")),
theL1MinQuality(iConfig.getParameter<unsigned int>("L1MinQuality")),
useOfflineSeed(iConfig.getUntrackedParameter<bool>("UseOfflineSeed", false)){
useOfflineSeed(iConfig.getUntrackedParameter<bool>("UseOfflineSeed", false)),
useUnassociatedL1(iConfig.existsAs<bool>("UseUnassociatedL1") ?
iConfig.getParameter<bool>("UseUnassociatedL1") : true){

gmtToken_ = consumes<L1MuGMTReadoutCollection>(theL1GMTReadoutCollection);
muCollToken_ = consumes<L1MuonParticleCollection>(theSource);

if(useOfflineSeed) {
theOfflineSeedLabel = iConfig.getUntrackedParameter<InputTag>("OfflineSeedLabel");
offlineSeedToken_ = consumes<edm::View<TrajectorySeed> >(theOfflineSeedLabel);
Expand Down Expand Up @@ -293,10 +296,12 @@ void L2MuonSeedGenerator::produce(edm::Event& iEvent, const edm::EventSetup& iSe
L1MuonParticleRef(muColl,l1ParticleIndex)));
}
else {
// convert the TSOS into a PTSOD
PTrajectoryStateOnDet const & seedTSOS = trajectoryStateTransform::persistentState( newTSOS,newTSOSDet->geographicalId().rawId());
output->push_back(L2MuonTrajectorySeed(seedTSOS,container,alongMomentum,
L1MuonParticleRef(muColl,l1ParticleIndex)));
if(useUnassociatedL1) {
// convert the TSOS into a PTSOD
PTrajectoryStateOnDet const & seedTSOS = trajectoryStateTransform::persistentState( newTSOS,newTSOSDet->geographicalId().rawId());
output->push_back(L2MuonTrajectorySeed(seedTSOS,container,alongMomentum,
L1MuonParticleRef(muColl,l1ParticleIndex)));
}
}
}
else {
Expand Down
1 change: 1 addition & 0 deletions RecoMuon/L2MuonSeedGenerator/src/L2MuonSeedGenerator.h
Expand Up @@ -74,6 +74,7 @@ class L2MuonSeedGenerator : public edm::EDProducer {
const double theL1MaxEta;
const unsigned theL1MinQuality;
const bool useOfflineSeed;
const bool useUnassociatedL1;

/// the event setup proxy, it takes care the services update
MuonServiceProxy *theService;
Expand Down