#include <TSGFromL2Muon.h>
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 () |
Private Attributes | |
edm::ParameterSet | theConfig |
edm::InputTag | theL2CollectionLabel |
double | thePCut |
double | thePtCut |
MuonTrackingRegionBuilder * | theRegionBuilder |
TrackerSeedCleaner * | theSeedCleaner |
MuonServiceProxy * | theService |
TrackerSeedGenerator * | theTkSeedGenerator |
Definition at line 20 of file TSGFromL2Muon.h.
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, ExpressReco_HICollisions_FallBack::MuonTrackingRegionBuilder, theConfig, theL2CollectionLabel, thePCut, thePtCut, theRegionBuilder, theSeedCleaner, theService, and theTkSeedGenerator.
: theConfig(cfg), theService(0), theRegionBuilder(0), theTkSeedGenerator(0), theSeedCleaner(0) { produces<L3MuonTrajectorySeedCollection>(); edm::ParameterSet serviceParameters = cfg.getParameter<edm::ParameterSet>("ServiceParameters"); theService = new MuonServiceProxy(serviceParameters); thePtCut = cfg.getParameter<double>("PtCut"); thePCut = cfg.getParameter<double>("PCut"); theL2CollectionLabel = cfg.getParameter<edm::InputTag>("MuonCollectionLabel"); //region builder edm::ParameterSet regionBuilderPSet = theConfig.getParameter<edm::ParameterSet>("MuonTrackingRegionBuilder"); //ability to no define a region if (!regionBuilderPSet.empty()){ theRegionBuilder = new MuonTrackingRegionBuilder(regionBuilderPSet); } //seed generator //std::string seedGenPSetLabel = theConfig.getParameter<std::string>("tkSeedGenerator"); //edm::ParameterSet seedGenPSet = theConfig.getParameter<edm::ParameterSet>(seedGenPSetLabel); edm::ParameterSet seedGenPSet = theConfig.getParameter<edm::ParameterSet>("TkSeedGenerator"); std::string seedGenName = seedGenPSet.getParameter<std::string>("ComponentName"); theTkSeedGenerator = TrackerSeedGeneratorFactory::get()->create(seedGenName, seedGenPSet); //seed cleaner edm::ParameterSet trackerSeedCleanerPSet = theConfig.getParameter<edm::ParameterSet>("TrackerSeedCleaner"); //to activate or not the cleaner if (!trackerSeedCleanerPSet.empty()){ theSeedCleaner = new TrackerSeedCleaner(trackerSeedCleanerPSet); } }
TSGFromL2Muon::~TSGFromL2Muon | ( | ) | [virtual] |
Definition at line 60 of file TSGFromL2Muon.cc.
References theRegionBuilder, theSeedCleaner, theService, and theTkSeedGenerator.
{ delete theService; if (theSeedCleaner) delete theSeedCleaner; delete theTkSeedGenerator; if (theRegionBuilder) delete theRegionBuilder; }
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().
{ //update muon proxy service theService->update(es); if (theRegionBuilder) theRegionBuilder->init(theService); theTkSeedGenerator->init(theService); if (theSeedCleaner) theSeedCleaner->init(theService); }
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, MuonTrackingRegionBuilder::setEvent(), TrackerSeedGenerator::setEvent(), TrackerSeedCleaner::setEvent(), theL2CollectionLabel, thePCut, thePtCut, theRegionBuilder, theSeedCleaner, theService, theTkSeedGenerator, TrackerSeedGenerator::trackerSeeds(), and MuonServiceProxy::update().
{ std::auto_ptr<L3MuonTrajectorySeedCollection> result(new L3MuonTrajectorySeedCollection()); //intialize tools theService->update(es); theTkSeedGenerator->setEvent(ev); if (theRegionBuilder) theRegionBuilder->setEvent(ev); if (theSeedCleaner) theSeedCleaner->setEvent(ev); //retrieve L2 track collection edm::Handle<reco::TrackCollection> l2muonH; ev.getByLabel(theL2CollectionLabel ,l2muonH); // produce trajectoryseed collection unsigned int imu=0; unsigned int imuMax=l2muonH->size(); LogDebug("TSGFromL2Muon")<<imuMax<<" l2 tracks."; for (;imu!=imuMax;++imu){ //make a ref to l2 muon reco::TrackRef muRef(l2muonH, imu); // cut on muons with low momenta if ( muRef->pt() < thePtCut || muRef->innerMomentum().Rho() < thePtCut || muRef->innerMomentum().R() < thePCut ) continue; //define the region of interest RectangularEtaPhiTrackingRegion region; if(theRegionBuilder){ RectangularEtaPhiTrackingRegion * region1 = theRegionBuilder->region(muRef); region=RectangularEtaPhiTrackingRegion(*region1); delete region1; } //get the seeds std::vector<TrajectorySeed> tkSeeds; //make this stupid TrackCand std::pair<const Trajectory*,reco::TrackRef> staCand((Trajectory*)(0), muRef); theTkSeedGenerator->trackerSeeds(staCand, region, tkSeeds); //Seed Cleaner From Direction //clean them internatly if(theSeedCleaner){ theSeedCleaner->clean(muRef,region,tkSeeds); LogDebug("TSGFromL2Muon") << tkSeeds.size() << " seeds for this L2 afther cleaning."; } unsigned int is=0; unsigned int isMax=tkSeeds.size(); LogDebug("TSGFromL2Muon")<<isMax<<" seeds for this L2."; for (;is!=isMax;++is){ result->push_back( L3MuonTrajectorySeed(tkSeeds[is], muRef)); }//tkseed loop }//l2muon loop //ADDME //remove seed duplicate, keeping the ref to L2 LogDebug("TSGFromL2Muon")<<result->size()<<" trajectory seeds to the events"; //put in the event ev.put(result); }
edm::ParameterSet TSGFromL2Muon::theConfig [private] |
Definition at line 28 of file TSGFromL2Muon.h.
Referenced by TSGFromL2Muon().
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().
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().
Definition at line 34 of file TSGFromL2Muon.h.
Referenced by beginRun(), produce(), TSGFromL2Muon(), and ~TSGFromL2Muon().