Skip to content

Commit

Permalink
Use a single templated class for Phase 1 and Phase 2 SeedToTrackProducer
Browse files Browse the repository at this point in the history
  • Loading branch information
Parsifal-2045 committed Dec 5, 2024
1 parent 762219f commit 6f69340
Show file tree
Hide file tree
Showing 6 changed files with 119 additions and 299 deletions.
62 changes: 7 additions & 55 deletions SimMuon/MCTruth/plugins/Phase2SeedToTrackProducer.h
Original file line number Diff line number Diff line change
@@ -1,65 +1,17 @@
#ifndef SimMuon_MCTruth_Phase2SeedToTrackProducer_h
#define SimMuon_MCTruth_Phase2SeedToTrackProducer_h

/** \class Phase2SeedToTrackProducer
/** \class SeedToTrackProducer
*
* SeedToTrackProducerBase class specialized for Phase 2
* Muon seeds
*
* Phase-2 implementation of the SeedToTrackProducerModule.
* Baseline behaviour is the same, with the difference that
* a collection of L2MuonTrajectorySeeds is expected as input
*
* \author Luca Ferragina (INFN BO), Carlo Battilana (INFN BO), 2024
* \author Luca Ferragina (INFN BO), 2024
*/

// system include files
#include <memory>

// user include files
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/Framework/interface/MakerMacros.h"
#include "FWCore/Framework/interface/global/EDProducer.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"

#include "MagneticField/Engine/interface/MagneticField.h"
#include "MagneticField/Records/interface/IdealMagneticFieldRecord.h"

#include "Geometry/CommonDetUnit/interface/GeomDet.h"
#include "Geometry/CommonDetUnit/interface/GlobalTrackingGeometry.h"
#include "Geometry/Records/interface/GlobalTrackingGeometryRecord.h"

#include "TrackingTools/Records/interface/TransientRecHitRecord.h"
#include "TrackingTools/TrajectoryState/interface/TrajectoryStateTransform.h"
#include "TrackingTools/TransientTrack/interface/TransientTrack.h"
#include "TrackingTools/TransientTrackingRecHit/interface/TransientTrackingRecHitBuilder.h"

#include "DataFormats/TrackReco/interface/Track.h"
#include "DataFormats/TrackReco/interface/TrackFwd.h"
#include "DataFormats/TrajectorySeed/interface/TrajectorySeedCollection.h"
#include "SimMuon/MCTruth/plugins/SeedToTrackProducerBase.h"
#include "DataFormats/MuonSeed/interface/L2MuonTrajectorySeedCollection.h"

//
// class declaration
//

typedef math::Error<5>::type CovarianceMatrix;

class Phase2SeedToTrackProducer : public edm::global::EDProducer<> {
public:
explicit Phase2SeedToTrackProducer(const edm::ParameterSet &);

private:
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const final;
TrajectoryStateOnSurface seedTransientState(const L2MuonTrajectorySeed &,
const MagneticField &,
const GlobalTrackingGeometry &) const;
// ----------member data ---------------------------

edm::EDGetTokenT<L2MuonTrajectorySeedCollection> L2seedsTagT_;
edm::EDGetTokenT<edm::View<TrajectorySeed>> L2seedsTagS_;

const edm::ESGetToken<MagneticField, IdealMagneticFieldRecord> theMGFieldToken;
const edm::ESGetToken<GlobalTrackingGeometry, GlobalTrackingGeometryRecord> theTrackingGeometryToken;
const edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> theTopoToken;
};
typedef SeedToTrackProducerBase<L2MuonTrajectorySeedCollection> Phase2SeedToTrackProducer;

#endif
4 changes: 4 additions & 0 deletions SimMuon/MCTruth/plugins/SealModule.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
#include "FWCore/PluginManager/interface/ModuleDef.h"
#include "SimMuon/MCTruth/interface/CSCTruthTest.h"
#include "SimMuon/MCTruth/plugins/MuonAssociatorEDProducer.h"
#include "SimMuon/MCTruth/plugins/SeedToTrackProducer.h"
#include "SimMuon/MCTruth/plugins/Phase2SeedToTrackProducer.h"

DEFINE_FWK_MODULE(MuonAssociatorEDProducer);
DEFINE_FWK_MODULE(CSCTruthTest);
DEFINE_FWK_MODULE(SeedToTrackProducer);
DEFINE_FWK_MODULE(Phase2SeedToTrackProducer);
160 changes: 0 additions & 160 deletions SimMuon/MCTruth/plugins/SeedToTrackProducer.cc

This file was deleted.

72 changes: 9 additions & 63 deletions SimMuon/MCTruth/plugins/SeedToTrackProducer.h
Original file line number Diff line number Diff line change
@@ -1,71 +1,17 @@
#ifndef SimMuon_MCTruth_SeedToTrackProducer_h
#define SimMuon_MCTruth_SeedToTrackProducer_h
// -*- C++ -*-
//
// Package: SeedToTrackProducer
// Class: SeedToTrackProducer
//
/**\class SeedToTrackProducer SeedToTrackProducer.cc
hugues/SeedToTrackProducer/plugins/SeedToTrackProducer.cc

Description:
/** \class SeedToTrackProducer
*
* SeedToTrackProducerBase class specialized for Phase 1
* Muon seeds
*
* \author Luca Ferragina (INFN BO), 2024
*/

*/
//
// Original Author: Hugues Brun
// Created: Tue, 05 Nov 2013 13:42:04 GMT
// $Id$
//
//
// system include files
#include <memory>

// user include files
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/Framework/interface/MakerMacros.h"
#include "FWCore/Framework/interface/global/EDProducer.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"

#include "MagneticField/Engine/interface/MagneticField.h"
#include "MagneticField/Records/interface/IdealMagneticFieldRecord.h"

#include "Geometry/CommonDetUnit/interface/GeomDet.h"
#include "Geometry/CommonDetUnit/interface/GlobalTrackingGeometry.h"
#include "Geometry/Records/interface/GlobalTrackingGeometryRecord.h"

#include "TrackingTools/Records/interface/TransientRecHitRecord.h"
#include "TrackingTools/TrajectoryState/interface/TrajectoryStateTransform.h"
#include "TrackingTools/TransientTrack/interface/TransientTrack.h"
#include "TrackingTools/TransientTrackingRecHit/interface/TransientTrackingRecHitBuilder.h"

#include "DataFormats/TrackReco/interface/Track.h"
#include "DataFormats/TrackReco/interface/TrackFwd.h"
#include "SimMuon/MCTruth/plugins/SeedToTrackProducerBase.h"
#include "DataFormats/TrajectorySeed/interface/TrajectorySeedCollection.h"

//
// class declaration
//

typedef math::Error<5>::type CovarianceMatrix;

class SeedToTrackProducer : public edm::global::EDProducer<> {
public:
explicit SeedToTrackProducer(const edm::ParameterSet &);

private:
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const final;
TrajectoryStateOnSurface seedTransientState(const TrajectorySeed &,
const MagneticField &,
const GlobalTrackingGeometry &) const;
// ----------member data ---------------------------

edm::EDGetTokenT<TrajectorySeedCollection> L2seedsTagT_;
edm::EDGetTokenT<edm::View<TrajectorySeed>> L2seedsTagS_;

const edm::ESGetToken<MagneticField, IdealMagneticFieldRecord> theMGFieldToken;
const edm::ESGetToken<GlobalTrackingGeometry, GlobalTrackingGeometryRecord> theTrackingGeometryToken;
const edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> theTopoToken;
};
typedef SeedToTrackProducerBase<TrajectorySeedCollection> SeedToTrackProducer;

#endif
Loading

0 comments on commit 6f69340

Please sign in to comment.