Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 75615
b: "refs/heads/CMSSW_7_1_X"
c: bf8e032
h: "refs/heads/CMSSW_7_1_X"
i:
  75613: 528e057
  75611: 1dc7ae7
  75607: fc6c3e0
  75599: cdf6eb4
  75583: 1175526
v: v3
  • Loading branch information
Adam Everett committed Oct 16, 2009
1 parent 98ed705 commit b70ab59
Show file tree
Hide file tree
Showing 6 changed files with 100 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
---
refs/heads/gh-pages: 09c786f70121f131b3715aaf3464996502bbeb7e
"refs/heads/CMSSW_7_1_X": 2dd3b9f54b4df8be2e894274c5ef6aca86f24d27
"refs/heads/CMSSW_7_1_X": bf8e0325add4b80dc5f604e7a6fa5b9cea513d91
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include "DataFormats/TrajectorySeed/interface/TrajectorySeedCollection.h"
#include "DataFormats/TrackReco/interface/Track.h"
#include "DataFormats/TrackReco/interface/TrackFwd.h"

class Trajectory;
class TrackingRegion;
class MuonServiceProxy;
Expand All @@ -32,11 +33,13 @@ class TrackerSeedGenerator {

virtual void setEvent(const edm::Event&);

virtual const edm::Event *getEvent() const { return theEvent;}

private:

virtual void run(TrajectorySeedCollection &seeds,
const edm::Event &ev, const edm::EventSetup &es, const TrackingRegion& region) {}

protected:
const edm::Event * theEvent;
const MuonServiceProxy * theProxyService;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,6 @@ void CompositeTSG::init(const MuonServiceProxy* service){
void CompositeTSG::setEvent(const edm::Event &event){
for (uint iTSG=0; iTSG!=theTSGs.size();iTSG++){
if(theTSGs[iTSG]) theTSGs[iTSG]->setEvent(event);
theEvent = &event;
}
}
48 changes: 48 additions & 0 deletions trunk/RecoMuon/TrackerSeedGenerator/plugins/DualByL2TSG.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#include "RecoMuon/TrackerSeedGenerator/plugins/DualByL2TSG.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "FWCore/Framework/interface/Event.h"
#include "DataFormats/Common/interface/Handle.h"

#include "DataFormats/TrackReco/interface/Track.h"
#include "DataFormats/TrackReco/interface/TrackFwd.h"
#include "DataFormats/MuonSeed/interface/L3MuonTrajectorySeed.h"
#include "DataFormats/MuonSeed/interface/L3MuonTrajectorySeedCollection.h"
#include "RecoMuon/TrackerSeedGenerator/interface/TrackerSeedGenerator.h"

DualByL2TSG::DualByL2TSG(const edm::ParameterSet &pset) : SeparatingTSG(pset){ theCategory ="DualByL2TSG";
theL3CollectionLabelA = pset.getParameter<edm::InputTag>("L3TkCollectionA");
if (nTSGs()!=2)
{edm::LogError(theCategory)<<"not two seed generators provided";}
}

uint DualByL2TSG::selectTSG(const TrackCand & muonTrackCand, const TrackingRegion& region)
{
LogDebug(theCategory)<<"|eta|=|"<<muonTrackCand.second->eta()<<"|";

bool re_do_this_L2 = true;
//LogDebug("TrackerSeedGenerator")<<theEvent;
//getEvent();

//retrieve L3 track collection
edm::Handle<reco::TrackCollection> l3muonH;
getEvent()->getByLabel(theL3CollectionLabelA ,l3muonH);
if(l3muonH.failedToGet()) return 0;

uint maxI = l3muonH->size();

LogDebug(theCategory) << "TheCollectionA size " << maxI;

// Loop through all tracks, if the track was seeded from this L2, then skip
for (uint i=0;i!=maxI;++i){
reco::TrackRef tk(l3muonH,i);
edm::Ref<L3MuonTrajectorySeedCollection> l3seedRef = tk->seedRef().castTo<edm::Ref<L3MuonTrajectorySeedCollection> >();
reco::TrackRef staTrack = l3seedRef->l2Track();

if(staTrack == (muonTrackCand.second) ) re_do_this_L2 = false;
//LogDebug(theCategory) << "The DualByL2TSG selectTSG loop " << re_do_this_L2 << " staCand " << muonTrackCand.second->eta() << " " << muonTrackCand.second->pt() << " alreadyMadeRefToL3 " << staTrack->eta() << " " << staTrack->pt();
}

LogDebug(theCategory) << "The DualByL2TSG to use " << re_do_this_L2 ;

return re_do_this_L2 ? 1 : 0;
}
31 changes: 31 additions & 0 deletions trunk/RecoMuon/TrackerSeedGenerator/plugins/DualByL2TSG.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@

#ifndef RecoMuon_TrackerSeedGenerator_DualByL2TSG_H
#define RecoMuon_TrackerSeedGenerator_DualByL2TSG_H

/** \class DualByL2TSG
* Description:
* SeparatingTSG (TrackerSeedGenerator) which makes a check to see if a previous seed lead to a L3 track
*
* \author Jean-Roch vlimant, Adam Everett
*/

#include "RecoMuon/TrackerSeedGenerator/plugins/SeparatingTSG.h"
#include "DataFormats/Common/interface/Handle.h"
#include "DataFormats/TrackReco/interface/Track.h"
#include "DataFormats/TrackReco/interface/TrackFwd.h"

class DualByL2TSG : public SeparatingTSG{
public:
DualByL2TSG(const edm::ParameterSet &pset);

/// decide the TSG depending on the existence of a L3 track seeded from the L2. Return value is 0 or 1.
uint selectTSG(const TrackCand&, const TrackingRegion&);

private:
std::string theCategory;
edm::InputTag theL3CollectionLabelA;
edm::Handle<reco::TrackCollection> l3muonH;
const edm::Event *theEvent;
};

#endif
15 changes: 15 additions & 0 deletions trunk/RecoMuon/TrackerSeedGenerator/plugins/SealModule.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include "TSGForRoadSearch.h"
#include "TSGFromPropagation.h"
#include "DualByEtaTSG.h"
#include "DualByL2TSG.h"
#include "CombinedTSG.h"


Expand All @@ -14,6 +15,7 @@ DEFINE_EDM_PLUGIN(TrackerSeedGeneratorFactory, TSGFromOrderedHits, "TSGFromOrder
DEFINE_EDM_PLUGIN(TrackerSeedGeneratorFactory, TSGForRoadSearch, "TSGForRoadSearch");
DEFINE_EDM_PLUGIN(TrackerSeedGeneratorFactory, TSGFromPropagation, "TSGFromPropagation");
DEFINE_EDM_PLUGIN(TrackerSeedGeneratorFactory, DualByEtaTSG, "DualByEtaTSG");
DEFINE_EDM_PLUGIN(TrackerSeedGeneratorFactory, DualByL2TSG, "DualByL2TSG");
DEFINE_EDM_PLUGIN(TrackerSeedGeneratorFactory, CombinedTSG, "CombinedTSG");

#include "RecoPixelVertexing/PixelTrackFitting/interface/PixelFitter.h"
Expand All @@ -40,8 +42,21 @@ DEFINE_ANOTHER_FWK_MODULE(TSGFromL2Muon);

#include "TrackingTools/PatternTools/interface/Trajectory.h"
#include "DataFormats/MuonSeed/interface/L3MuonTrajectorySeedCollection.h"
#include "DataFormats/TrackReco/interface/TrackFwd.h"
#include "DataFormats/TrackCandidate/interface/TrackCandidateCollection.h"
#include "DataFormats/MuonReco/interface/MuonTrackLinks.h"
#include "DataFormats/MuonReco/interface/MuonFwd.h"


typedef CollectionCombiner<std::vector< Trajectory> > TrajectoryCombiner;
typedef CollectionCombiner<L3MuonTrajectorySeedCollection> L3MuonTrajectorySeedCombiner;
typedef CollectionCombiner<reco::TrackCollection> L3TrackCombiner;
typedef CollectionCombiner<TrackCandidateCollection> L3TrackCandCombiner;
typedef CollectionCombiner<reco::MuonTrackLinksCollection> L3TrackLinksCombiner;

DEFINE_ANOTHER_FWK_MODULE(TrajectoryCombiner);
DEFINE_ANOTHER_FWK_MODULE(L3MuonTrajectorySeedCombiner);
DEFINE_ANOTHER_FWK_MODULE(L3TrackCombiner);
DEFINE_ANOTHER_FWK_MODULE(L3TrackCandCombiner);
DEFINE_ANOTHER_FWK_MODULE(L3TrackLinksCombiner);

0 comments on commit b70ab59

Please sign in to comment.