CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
TSGFromL2Muon Class Reference

#include <TSGFromL2Muon.h>

Inheritance diagram for TSGFromL2Muon:
edm::stream::EDProducer<>

Public Member Functions

void beginRun (const edm::Run &run, const edm::EventSetup &es) override
 
void produce (edm::Event &ev, const edm::EventSetup &es) override
 
 TSGFromL2Muon (const edm::ParameterSet &cfg)
 
 ~TSGFromL2Muon () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Private Attributes

edm::EDGetTokenT< reco::TrackCollectionl2muonToken
 
edm::InputTag theL2CollectionLabel
 
double thePCut
 
double thePtCut
 
std::unique_ptr< MuonTrackingRegionBuildertheRegionBuilder
 
std::unique_ptr< TrackerSeedCleanertheSeedCleaner
 
std::unique_ptr< MuonServiceProxytheService
 
std::unique_ptr< TrackerSeedGeneratortheTkSeedGenerator
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 

Detailed Description

Definition at line 24 of file TSGFromL2Muon.h.

Constructor & Destructor Documentation

◆ TSGFromL2Muon()

TSGFromL2Muon::TSGFromL2Muon ( const edm::ParameterSet cfg)

Definition at line 10 of file TSGFromL2Muon.cc.

10  {
11  produces<L3MuonTrajectorySeedCollection>();
12 
13  edm::ConsumesCollector iC = consumesCollector();
14 
15  edm::ParameterSet serviceParameters = cfg.getParameter<edm::ParameterSet>("ServiceParameters");
16  theService = std::make_unique<MuonServiceProxy>(
17  serviceParameters, consumesCollector(), MuonServiceProxy::UseEventSetupIn::RunAndEvent);
18 
19  //Pt and P cuts
20  thePtCut = cfg.getParameter<double>("PtCut");
21  thePCut = cfg.getParameter<double>("PCut");
22 
23  //Region builder
24  edm::ParameterSet regionBuilderPSet = cfg.getParameter<edm::ParameterSet>("MuonTrackingRegionBuilder");
25  //ability to no define a region
26  if (!regionBuilderPSet.empty()) {
27  theRegionBuilder = std::make_unique<MuonTrackingRegionBuilder>(regionBuilderPSet, iC);
28  }
29 
30  //Seed generator
31  edm::ParameterSet seedGenPSet = cfg.getParameter<edm::ParameterSet>("TkSeedGenerator");
32  std::string seedGenName = seedGenPSet.getParameter<std::string>("ComponentName");
33  theTkSeedGenerator = TrackerSeedGeneratorFactory::get()->create(seedGenName, seedGenPSet, iC);
34 
35  //Seed cleaner
36  edm::ParameterSet trackerSeedCleanerPSet = cfg.getParameter<edm::ParameterSet>("TrackerSeedCleaner");
37  //To activate or not the cleaner
38  if (!trackerSeedCleanerPSet.empty()) {
39  theSeedCleaner = std::make_unique<TrackerSeedCleaner>(trackerSeedCleanerPSet, iC);
40  }
41 
42  //L2 collection
43  theL2CollectionLabel = cfg.getParameter<edm::InputTag>("MuonCollectionLabel");
44  l2muonToken = consumes<reco::TrackCollection>(theL2CollectionLabel);
45 }

References looper::cfg, edm::ParameterSet::empty(), get, edm::ParameterSet::getParameter(), l2muonToken, MuonServiceProxy::RunAndEvent, AlCaHLTBitMon_QueryRunRegistry::string, theL2CollectionLabel, thePCut, thePtCut, theRegionBuilder, theSeedCleaner, theService, and theTkSeedGenerator.

◆ ~TSGFromL2Muon()

TSGFromL2Muon::~TSGFromL2Muon ( )
overridedefault

Member Function Documentation

◆ beginRun()

void TSGFromL2Muon::beginRun ( const edm::Run run,
const edm::EventSetup es 
)
override

Definition at line 49 of file TSGFromL2Muon.cc.

49  {
50  //update muon proxy service
51  bool duringEvent = false;
52  theService->update(es, duringEvent);
53  theTkSeedGenerator->init(theService.get());
54  if (theSeedCleaner)
55  theSeedCleaner->init(theService.get());
56 }

References theSeedCleaner, theService, and theTkSeedGenerator.

◆ fillDescriptions()

void TSGFromL2Muon::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 123 of file TSGFromL2Muon.cc.

123  {
125  desc.setAllowAnything();
126 }

References submitPVResolutionJobs::desc.

◆ produce()

void TSGFromL2Muon::produce ( edm::Event ev,
const edm::EventSetup es 
)
override

Definition at line 58 of file TSGFromL2Muon.cc.

58  {
59  auto result = std::make_unique<L3MuonTrajectorySeedCollection>();
60 
61  //Retrieve tracker topology from geometry
63  es.get<TrackerTopologyRcd>().get(tTopoHand);
64  const TrackerTopology* tTopo = tTopoHand.product();
65 
66  //intialize tools
67  theService->update(es);
68  theTkSeedGenerator->setEvent(ev);
69  if (theRegionBuilder)
70  theRegionBuilder->setEvent(ev);
71  if (theSeedCleaner)
72  theSeedCleaner->setEvent(ev);
73 
74  //retrieve L2 track collection
76  ev.getByToken(l2muonToken, l2muonH);
77 
78  // produce trajectory seed collection
79  LogDebug("TSGFromL2Muon") << l2muonH->size() << " l2 tracks.";
80 
81  for (unsigned int imu = 0; imu != l2muonH->size(); ++imu) {
82  //make a ref to l2 muon
83  reco::TrackRef muRef(l2muonH, imu);
84 
85  // cut on muons with low momenta
86  if (muRef->pt() < thePtCut || muRef->innerMomentum().Rho() < thePtCut || muRef->innerMomentum().R() < thePCut)
87  continue;
88 
89  //define the region of interest
90  std::unique_ptr<RectangularEtaPhiTrackingRegion> region;
91  if (theRegionBuilder) {
92  region = theRegionBuilder->region(muRef);
93  }
94 
95  //Make seeds container
96  std::vector<TrajectorySeed> tkSeeds;
97 
98  //Make TrackCand
99  std::pair<const Trajectory*, reco::TrackRef> staCand((Trajectory*)nullptr, muRef);
100 
101  //Run seed generator to fill seed container
102  theTkSeedGenerator->trackerSeeds(staCand, *region, tTopo, tkSeeds);
103 
104  //Seed Cleaner From Direction
105  if (theSeedCleaner) {
106  theSeedCleaner->clean(muRef, *region, tkSeeds);
107  }
108 
109  for (unsigned int is = 0; is != tkSeeds.size(); ++is) {
110  result->push_back(L3MuonTrajectorySeed(tkSeeds[is], muRef));
111  }
112  }
113 
114  //ADDME: remove seed duplicate, keeping the ref to L2
115 
116  LogDebug("TSGFromL2Muon") << result->size() << " trajectory seeds to the events";
117 
118  //put in the event
119  ev.put(std::move(result));
120 }

References ev, edm::EventSetup::get(), get, l2muonToken, LogDebug, eostools::move(), edm::ESHandle< T >::product(), HLT_FULL_cff::region, mps_fire::result, thePCut, thePtCut, theRegionBuilder, theSeedCleaner, theService, and theTkSeedGenerator.

Member Data Documentation

◆ l2muonToken

edm::EDGetTokenT<reco::TrackCollection> TSGFromL2Muon::l2muonToken
private

Definition at line 39 of file TSGFromL2Muon.h.

Referenced by produce(), and TSGFromL2Muon().

◆ theL2CollectionLabel

edm::InputTag TSGFromL2Muon::theL2CollectionLabel
private

Definition at line 33 of file TSGFromL2Muon.h.

Referenced by TSGFromL2Muon().

◆ thePCut

double TSGFromL2Muon::thePCut
private

Definition at line 35 of file TSGFromL2Muon.h.

Referenced by produce(), and TSGFromL2Muon().

◆ thePtCut

double TSGFromL2Muon::thePtCut
private

Definition at line 35 of file TSGFromL2Muon.h.

Referenced by produce(), and TSGFromL2Muon().

◆ theRegionBuilder

std::unique_ptr<MuonTrackingRegionBuilder> TSGFromL2Muon::theRegionBuilder
private

Definition at line 36 of file TSGFromL2Muon.h.

Referenced by produce(), and TSGFromL2Muon().

◆ theSeedCleaner

std::unique_ptr<TrackerSeedCleaner> TSGFromL2Muon::theSeedCleaner
private

Definition at line 38 of file TSGFromL2Muon.h.

Referenced by beginRun(), produce(), and TSGFromL2Muon().

◆ theService

std::unique_ptr<MuonServiceProxy> TSGFromL2Muon::theService
private

Definition at line 34 of file TSGFromL2Muon.h.

Referenced by beginRun(), produce(), and TSGFromL2Muon().

◆ theTkSeedGenerator

std::unique_ptr<TrackerSeedGenerator> TSGFromL2Muon::theTkSeedGenerator
private

Definition at line 37 of file TSGFromL2Muon.h.

Referenced by beginRun(), produce(), and TSGFromL2Muon().

edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
TSGFromL2Muon::theSeedCleaner
std::unique_ptr< TrackerSeedCleaner > theSeedCleaner
Definition: TSGFromL2Muon.h:38
TrackerTopology
Definition: TrackerTopology.h:16
TSGFromL2Muon::theService
std::unique_ptr< MuonServiceProxy > theService
Definition: TSGFromL2Muon.h:34
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
edm::Handle< reco::TrackCollection >
edm::Ref< TrackCollection >
TSGFromL2Muon::theRegionBuilder
std::unique_ptr< MuonTrackingRegionBuilder > theRegionBuilder
Definition: TSGFromL2Muon.h:36
edm::EventSetup::get
T get() const
Definition: EventSetup.h:80
MuonServiceProxy::UseEventSetupIn::RunAndEvent
TSGFromL2Muon::thePCut
double thePCut
Definition: TSGFromL2Muon.h:35
edm::ESHandle< TrackerTopology >
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:223
edm::ParameterSet
Definition: ParameterSet.h:47
TSGFromL2Muon::theTkSeedGenerator
std::unique_ptr< TrackerSeedGenerator > theTkSeedGenerator
Definition: TSGFromL2Muon.h:37
HLT_FULL_cff.region
region
Definition: HLT_FULL_cff.py:88338
get
#define get
looper.cfg
cfg
Definition: looper.py:297
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
eostools.move
def move(src, dest)
Definition: eostools.py:511
Trajectory
Definition: Trajectory.h:38
ev
bool ev
Definition: Hydjet2Hadronizer.cc:95
TSGFromL2Muon::theL2CollectionLabel
edm::InputTag theL2CollectionLabel
Definition: TSGFromL2Muon.h:33
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
TSGFromL2Muon::thePtCut
double thePtCut
Definition: TSGFromL2Muon.h:35
mps_fire.result
result
Definition: mps_fire.py:311
TrackerTopologyRcd
Definition: TrackerTopologyRcd.h:10
TSGFromL2Muon::l2muonToken
edm::EDGetTokenT< reco::TrackCollection > l2muonToken
Definition: TSGFromL2Muon.h:39
L3MuonTrajectorySeed
Definition: L3MuonTrajectorySeed.h:16
edm::InputTag
Definition: InputTag.h:15
edm::ConsumesCollector
Definition: ConsumesCollector.h:45
edm::ParameterSet::empty
bool empty() const
Definition: ParameterSet.h:201