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

Fix in TSGForOI muons #19949

Merged
merged 2 commits into from
Jul 28, 2017
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
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