CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
TSGFromL2Muon Class Reference

#include <TSGFromL2Muon.h>

Inheritance diagram for TSGFromL2Muon:
edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

Public Member Functions

virtual void beginRun (edm::Run &run, const edm::EventSetup &es)
 
virtual void produce (edm::Event &ev, const edm::EventSetup &es)
 
 TSGFromL2Muon (const edm::ParameterSet &cfg)
 
virtual ~TSGFromL2Muon ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
boost::function< void(const
BranchDescription &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 

Private Attributes

edm::ParameterSet theConfig
 
edm::InputTag theL2CollectionLabel
 
double thePCut
 
double thePtCut
 
MuonTrackingRegionBuildertheRegionBuilder
 
TrackerSeedCleanertheSeedCleaner
 
MuonServiceProxytheService
 
TrackerSeedGeneratortheTkSeedGenerator
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
typedef WorkerT< EDProducerWorkerType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDProducer
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::ProducerBase
template<class TProducer , class TMethod >
void callWhenNewProductsRegistered (TProducer *iProd, TMethod iMethod)
 

Detailed Description

Definition at line 20 of file TSGFromL2Muon.h.

Constructor & Destructor Documentation

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

Definition at line 23 of file TSGFromL2Muon.cc.

References edm::ParameterSet::empty(), reco::get(), edm::ParameterSet::getParameter(), MuonServiceProxy_cff::MuonServiceProxy, theConfig, theL2CollectionLabel, thePCut, thePtCut, theRegionBuilder, theSeedCleaner, theService, and theTkSeedGenerator.

25 {
26  produces<L3MuonTrajectorySeedCollection>();
27 
28  edm::ParameterSet serviceParameters = cfg.getParameter<edm::ParameterSet>("ServiceParameters");
29  theService = new MuonServiceProxy(serviceParameters);
30 
31  thePtCut = cfg.getParameter<double>("PtCut");
32  thePCut = cfg.getParameter<double>("PCut");
33 
34  theL2CollectionLabel = cfg.getParameter<edm::InputTag>("MuonCollectionLabel");
35 
36  //region builder
37  edm::ParameterSet regionBuilderPSet = theConfig.getParameter<edm::ParameterSet>("MuonTrackingRegionBuilder");
38  //ability to no define a region
39  if (!regionBuilderPSet.empty()){
40  theRegionBuilder = new MuonTrackingRegionBuilder(regionBuilderPSet);
41  }
42 
43  //seed generator
44  //std::string seedGenPSetLabel = theConfig.getParameter<std::string>("tkSeedGenerator");
45  //edm::ParameterSet seedGenPSet = theConfig.getParameter<edm::ParameterSet>(seedGenPSetLabel);
46  edm::ParameterSet seedGenPSet = theConfig.getParameter<edm::ParameterSet>("TkSeedGenerator");
47  std::string seedGenName = seedGenPSet.getParameter<std::string>("ComponentName");
48 
49  theTkSeedGenerator = TrackerSeedGeneratorFactory::get()->create(seedGenName, seedGenPSet);
50 
51  //seed cleaner
52  edm::ParameterSet trackerSeedCleanerPSet = theConfig.getParameter<edm::ParameterSet>("TrackerSeedCleaner");
53  //to activate or not the cleaner
54  if (!trackerSeedCleanerPSet.empty()){
55  theSeedCleaner = new TrackerSeedCleaner(trackerSeedCleanerPSet);
56  }
57 
58 }
T getParameter(std::string const &) const
bool empty() const
Definition: ParameterSet.h:213
MuonTrackingRegionBuilder * theRegionBuilder
Definition: TSGFromL2Muon.h:33
TrackerSeedCleaner * theSeedCleaner
Definition: TSGFromL2Muon.h:35
edm::InputTag theL2CollectionLabel
Definition: TSGFromL2Muon.h:29
MuonServiceProxy * theService
Definition: TSGFromL2Muon.h:31
edm::ParameterSet theConfig
Definition: TSGFromL2Muon.h:28
TrackerSeedGenerator * theTkSeedGenerator
Definition: TSGFromL2Muon.h:34
T get(const Candidate &c)
Definition: component.h:56
TSGFromL2Muon::~TSGFromL2Muon ( )
virtual

Definition at line 60 of file TSGFromL2Muon.cc.

References theRegionBuilder, theSeedCleaner, theService, and theTkSeedGenerator.

61 {
62  delete theService;
63  if (theSeedCleaner) delete theSeedCleaner;
64  delete theTkSeedGenerator;
66 }
MuonTrackingRegionBuilder * theRegionBuilder
Definition: TSGFromL2Muon.h:33
TrackerSeedCleaner * theSeedCleaner
Definition: TSGFromL2Muon.h:35
MuonServiceProxy * theService
Definition: TSGFromL2Muon.h:31
TrackerSeedGenerator * theTkSeedGenerator
Definition: TSGFromL2Muon.h:34

Member Function Documentation

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

Reimplemented from edm::EDProducer.

Definition at line 68 of file TSGFromL2Muon.cc.

References TrackerSeedGenerator::init(), MuonTrackingRegionBuilder::init(), TrackerSeedCleaner::init(), theRegionBuilder, theSeedCleaner, theService, theTkSeedGenerator, and MuonServiceProxy::update().

69 {
70  //update muon proxy service
71  theService->update(es);
72 
76 
77 }
void update(const edm::EventSetup &setup)
update the services each event
MuonTrackingRegionBuilder * theRegionBuilder
Definition: TSGFromL2Muon.h:33
TrackerSeedCleaner * theSeedCleaner
Definition: TSGFromL2Muon.h:35
MuonServiceProxy * theService
Definition: TSGFromL2Muon.h:31
virtual void init(const MuonServiceProxy *service)
void init(const MuonServiceProxy *)
virtual void init(const MuonServiceProxy *service)
intizialization
TrackerSeedGenerator * theTkSeedGenerator
Definition: TSGFromL2Muon.h:34
void TSGFromL2Muon::produce ( edm::Event ev,
const edm::EventSetup es 
)
virtual

Implements edm::EDProducer.

Definition at line 79 of file TSGFromL2Muon.cc.

References TrackerSeedCleaner::clean(), edm::Event::getByLabel(), LogDebug, edm::Event::put(), MuonTrackingRegionBuilder::region(), query::result, TrackerSeedGenerator::setEvent(), MuonTrackingRegionBuilder::setEvent(), TrackerSeedCleaner::setEvent(), theL2CollectionLabel, thePCut, thePtCut, theRegionBuilder, theSeedCleaner, theService, theTkSeedGenerator, TrackerSeedGenerator::trackerSeeds(), and MuonServiceProxy::update().

80 {
81  std::auto_ptr<L3MuonTrajectorySeedCollection> result(new L3MuonTrajectorySeedCollection());
82 
83  //intialize tools
84  theService->update(es);
88 
89  //retrieve L2 track collection
91  ev.getByLabel(theL2CollectionLabel ,l2muonH);
92 
93  // produce trajectoryseed collection
94  unsigned int imu=0;
95  unsigned int imuMax=l2muonH->size();
96  LogDebug("TSGFromL2Muon")<<imuMax<<" l2 tracks.";
97 
98  for (;imu!=imuMax;++imu){
99  //make a ref to l2 muon
100  reco::TrackRef muRef(l2muonH, imu);
101 
102  // cut on muons with low momenta
103  if ( muRef->pt() < thePtCut
104  || muRef->innerMomentum().Rho() < thePtCut
105  || muRef->innerMomentum().R() < thePCut ) continue;
106 
107  //define the region of interest
109  if(theRegionBuilder){
111  region=RectangularEtaPhiTrackingRegion(*region1);
112  delete region1;
113  }
114 
115  //get the seeds
116  std::vector<TrajectorySeed> tkSeeds;
117  //make this stupid TrackCand
118  std::pair<const Trajectory*,reco::TrackRef> staCand((Trajectory*)(0), muRef);
119  theTkSeedGenerator->trackerSeeds(staCand, region, tkSeeds);
120 
121  //Seed Cleaner From Direction
122  //clean them internatly
123  if(theSeedCleaner){
124  theSeedCleaner->clean(muRef,region,tkSeeds);
125  LogDebug("TSGFromL2Muon") << tkSeeds.size() << " seeds for this L2 afther cleaning.";
126  }
127 
128  unsigned int is=0;
129  unsigned int isMax=tkSeeds.size();
130  LogDebug("TSGFromL2Muon")<<isMax<<" seeds for this L2.";
131  for (;is!=isMax;++is){
132  result->push_back( L3MuonTrajectorySeed(tkSeeds[is], muRef));
133  }//tkseed loop
134 
135  }//l2muon loop
136 
137 
138  //ADDME
139  //remove seed duplicate, keeping the ref to L2
140 
141  LogDebug("TSGFromL2Muon")<<result->size()<<" trajectory seeds to the events";
142 
143  //put in the event
144  ev.put(result);
145 }
#define LogDebug(id)
void update(const edm::EventSetup &setup)
update the services each event
RectangularEtaPhiTrackingRegion * region(const reco::TrackRef &) const
define tracking region
MuonTrackingRegionBuilder * theRegionBuilder
Definition: TSGFromL2Muon.h:33
TrackerSeedCleaner * theSeedCleaner
Definition: TSGFromL2Muon.h:35
virtual void setEvent(const edm::Event &)
pass the Event to the algo at each event
std::vector< L3MuonTrajectorySeed > L3MuonTrajectorySeedCollection
virtual void setEvent(const edm::Event &)
setEvent
edm::InputTag theL2CollectionLabel
Definition: TSGFromL2Muon.h:29
MuonServiceProxy * theService
Definition: TSGFromL2Muon.h:31
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:84
tuple result
Definition: query.py:137
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:355
virtual void trackerSeeds(const TrackCand &, const TrackingRegion &, BTSeedCollection &)
TrackerSeedGenerator * theTkSeedGenerator
Definition: TSGFromL2Muon.h:34
virtual void setEvent(const edm::Event &)
virtual void clean(const reco::TrackRef &, const RectangularEtaPhiTrackingRegion &region, tkSeeds &)
the cleaner

Member Data Documentation

edm::ParameterSet TSGFromL2Muon::theConfig
private

Definition at line 28 of file TSGFromL2Muon.h.

Referenced by TSGFromL2Muon().

edm::InputTag TSGFromL2Muon::theL2CollectionLabel
private

Definition at line 29 of file TSGFromL2Muon.h.

Referenced by produce(), and TSGFromL2Muon().

double TSGFromL2Muon::thePCut
private

Definition at line 32 of file TSGFromL2Muon.h.

Referenced by produce(), and TSGFromL2Muon().

double TSGFromL2Muon::thePtCut
private

Definition at line 32 of file TSGFromL2Muon.h.

Referenced by produce(), and TSGFromL2Muon().

MuonTrackingRegionBuilder* TSGFromL2Muon::theRegionBuilder
private

Definition at line 33 of file TSGFromL2Muon.h.

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

TrackerSeedCleaner* TSGFromL2Muon::theSeedCleaner
private

Definition at line 35 of file TSGFromL2Muon.h.

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

MuonServiceProxy* TSGFromL2Muon::theService
private

Definition at line 31 of file TSGFromL2Muon.h.

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

TrackerSeedGenerator* TSGFromL2Muon::theTkSeedGenerator
private

Definition at line 34 of file TSGFromL2Muon.h.

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