Skip to content

Commit

Permalink
Merge pull request #19949 from davidlange6/for926patch1
Browse files Browse the repository at this point in the history
Fix in TSGForOI muons
  • Loading branch information
davidlange6 committed Jul 28, 2017
2 parents 82c77dc + ce1d5cb commit 27bb512
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 15 deletions.
28 changes: 22 additions & 6 deletions RecoMuon/TrackerSeedGenerator/plugins/TSGForOI.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ using namespace std;

TSGForOI::TSGForOI(const edm::ParameterSet & iConfig) :
src_(consumes<reco::TrackCollection>(iConfig.getParameter<edm::InputTag>("src"))),
numOfMaxSeedsParam_(iConfig.getParameter<uint32_t>("maxSeeds")),
numOfLayersToTry_(iConfig.getParameter<int32_t>("layersToTry")),
numOfHitsToTry_(iConfig.getParameter<int32_t>("hitsToTry")),
fixedErrorRescalingForHits_(iConfig.getParameter<double>("fixedErrorRescaleFactorForHits")),
Expand All @@ -25,7 +26,6 @@ TSGForOI::TSGForOI(const edm::ParameterSet & iConfig) :
maxEtaForTOB_(iConfig.getParameter<double>("maxEtaForTOB")),
useHitLessSeeds_(iConfig.getParameter<bool>("UseHitLessSeeds")),
useStereoLayersInTEC_(iConfig.getParameter<bool>("UseStereoLayersInTEC")),
dummyPlane_(Plane::build(Plane::PositionType(), Plane::RotationType())),
updator_(new KFUpdator()),
measurementTrackerTag_(consumes<MeasurementTrackerEvent>(iConfig.getParameter<edm::InputTag>("MeasurementTrackerEvent"))),
pT1_(iConfig.getParameter<double>("pT1")),
Expand All @@ -38,12 +38,10 @@ TSGForOI::TSGForOI(const edm::ParameterSet & iConfig) :
SF3_(iConfig.getParameter<double>("SF3")),
SF4_(iConfig.getParameter<double>("SF4")),
SF5_(iConfig.getParameter<double>("SF5")),
tsosDiff_(iConfig.getParameter<double>("tsosDiff"))
tsosDiff_(iConfig.getParameter<double>("tsosDiff")),
theCategory(string("Muon|RecoMuon|TSGForOI"))
{
numOfMaxSeeds_=iConfig.getParameter<uint32_t>("maxSeeds");
produces<std::vector<TrajectorySeed> >();
numSeedsMade_=0;
theCategory = "Muon|RecoMuon|TSGForOI";
}


Expand All @@ -52,13 +50,31 @@ TSGForOI::~TSGForOI(){


void TSGForOI::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) {
/// Init variables
numOfMaxSeeds_ = numOfMaxSeedsParam_;
numSeedsMade_=0;
analysedL2_ = false;
foundHitlessSeed_ = false;
layerCount_ = 0;

/// Surface used to make a TSOS at the PCA to the beamline
Plane::PlanePointer dummyPlane_ = Plane::build(Plane::PositionType(), Plane::RotationType());

/// Read ESHandles
edm::ESHandle<MagneticField> magfield_;
edm::ESHandle<Propagator> propagatorAlong_;
edm::ESHandle<Propagator> propagatorOpposite_;
edm::ESHandle<GlobalTrackingGeometry> geometry_;

iSetup.get<IdealMagneticFieldRecord>().get(magfield_);
iSetup.get<TrackingComponentsRecord>().get("PropagatorWithMaterial", propagatorOpposite_);
iSetup.get<TrackingComponentsRecord>().get("PropagatorWithMaterial", propagatorAlong_);
iSetup.get<GlobalTrackingGeometryRecord>().get(geometry_);
iSetup.get<TrackingComponentsRecord>().get(estimatorName_,estimator_);
iEvent.getByToken(measurementTrackerTag_, measurementTracker_);
edm::Handle<reco::TrackCollection> l2TrackCol;

/// Read L2 track collection
edm::Handle<reco::TrackCollection> l2TrackCol;
iEvent.getByToken(src_, l2TrackCol);

// The product:
Expand Down
14 changes: 5 additions & 9 deletions RecoMuon/TrackerSeedGenerator/plugins/TSGForOI.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class TSGForOI : public edm::stream::EDProducer<> {
const edm::EDGetTokenT<reco::TrackCollection> src_;

/// Maximum number of seeds for each L2
const unsigned int numOfMaxSeedsParam_;
unsigned int numOfMaxSeeds_;

/// How many layers to try
Expand Down Expand Up @@ -73,11 +74,8 @@ class TSGForOI : public edm::stream::EDProducer<> {
/// Switch ON to use Stereo layers instead of using every layer in TEC.
const bool useStereoLayersInTEC_;

/// Surface used to make a TSOS at the PCA to the beamline
Plane::PlanePointer dummyPlane_;

/// KFUpdator defined in constructor
std::unique_ptr<TrajectoryStateUpdator> updator_;
const std::unique_ptr<TrajectoryStateUpdator> updator_;

const edm::EDGetTokenT<MeasurementTrackerEvent> measurementTrackerTag_;

Expand All @@ -90,16 +88,14 @@ class TSGForOI : public edm::stream::EDProducer<> {
const double tsosDiff_;

/// Counters and flags for the implementation
const std::string theCategory;

bool analysedL2_;
bool foundHitlessSeed_;
unsigned int numSeedsMade_;
unsigned int layerCount_;

std::string theCategory;
edm::ESHandle<MagneticField> magfield_;
edm::ESHandle<Propagator> propagatorAlong_;
edm::ESHandle<Propagator> propagatorOpposite_;
edm::ESHandle<GlobalTrackingGeometry> geometry_;

edm::Handle<MeasurementTrackerEvent> measurementTracker_;
edm::ESHandle<Chi2MeasurementEstimatorBase> estimator_;

Expand Down

0 comments on commit 27bb512

Please sign in to comment.