Skip to content

Commit

Permalink
fix hard coding about Pt and eta.
Browse files Browse the repository at this point in the history
  • Loading branch information
geonmo committed Nov 7, 2013
1 parent 8a4c3e0 commit 6edf62d
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 9 deletions.
4 changes: 3 additions & 1 deletion Validation/MuonGEMDigis/interface/GEMTrackMatch.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
class GEMTrackMatch
{
public:
GEMTrackMatch(DQMStore* , std::string , edm::ParameterSet );
GEMTrackMatch(DQMStore* , std::string , edm::ParameterSet, double, double, double );
~GEMTrackMatch();
void analyze(const edm::Event& e, const edm::EventSetup&);

Expand Down Expand Up @@ -89,6 +89,8 @@ class GEMTrackMatch
edm::Handle<edm::SimVertexContainer> sim_vertices;

float minPt_;
float minEta_;
float maxEta_;
float radiusCenter_, chamberHeight_;


Expand Down
2 changes: 1 addition & 1 deletion Validation/MuonGEMDigis/interface/MuonGEMDigis.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class MuonGEMDigis : public edm::EDAnalyzer


//edm::ParameterSet cfg_;
float minPt_;
//float minPt_;
float radiusCenter_, chamberHeight_;


Expand Down
6 changes: 3 additions & 3 deletions Validation/MuonGEMDigis/plugins/MuonGEMDigis.cc
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,6 @@ MuonGEMDigis::MuonGEMDigis(const edm::ParameterSet& ps)
{
dbe_ = edm::Service<DQMStore>().operator->();
dbe_->setCurrentFolder("MuonGEMDigisV/GEMDigiTask");
minPt_= ps.getUntrackedParameter<double>("minPt", 5.);
//cfg_= ps.getParameterSet("simTrackMatching");
outputFile_ = ps.getParameter<std::string>("outputFile");

//now do what ever initialization is needed
Expand All @@ -98,7 +96,9 @@ MuonGEMDigis::MuonGEMDigis(const edm::ParameterSet& ps)
theGEMStripDigiValidation = new GEMStripDigiValidation(dbe_, ps.getParameter<edm::InputTag>("stripLabel"));
theGEMCSCPadDigiValidation = new GEMCSCPadDigiValidation(dbe_, ps.getParameter<edm::InputTag>("cscPadLabel"));
theGEMCSCCoPadDigiValidation = new GEMCSCCoPadDigiValidation(dbe_, ps.getParameter<edm::InputTag>("cscCopadLabel"));
theGEMTrackMatch = new GEMTrackMatch(dbe_, ps.getUntrackedParameter<std::string>("simInputLabel", "g4SimHits") ,ps.getParameterSet("simTrackMatching"));
theGEMTrackMatch = new GEMTrackMatch(dbe_, ps.getUntrackedParameter<std::string>("simInputLabel", "g4SimHits"),
ps.getParameterSet("simTrackMatching"),ps.getUntrackedParameter<double>("minPt",5.),
ps.getUntrackedParameter<double>("minEta",1.55), ps.getUntrackedParameter<double>("maxPt",2.18) );



Expand Down
3 changes: 3 additions & 0 deletions Validation/MuonGEMDigis/python/MuonGEMDigis_cfi.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,8 @@
cscPadLabel = cms.InputTag('simMuonGEMCSCPadDigis'),
cscCopadLabel = cms.InputTag('simMuonGEMCSCPadDigis','Coincidence') ,
simInputLabel = cms.untracked.string('g4SimHits'),
minPt = cms.untracked.double(5.),
maxEta = cms.untracked.double(2.18),
minEta = cms.untracked.double(1.55),
simTrackMatching = SimTrackMatching
)
9 changes: 5 additions & 4 deletions Validation/MuonGEMDigis/src/GEMTrackMatch.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,16 @@ struct MySimTrack



GEMTrackMatch::GEMTrackMatch(DQMStore* dbe, std::string simInputLabel , edm::ParameterSet cfg )
GEMTrackMatch::GEMTrackMatch(DQMStore* dbe, std::string simInputLabel , edm::ParameterSet cfg , double minPt, double minEta, double maxEta)
{
//theEff_eta_dg[0] = dbe_->book1D("eff_eta_track_dg_gem_l1", "Eff. for a SimTrack to have an associated GEM Digi in l2;SimTrack |#eta|;Eff.", 140,1.5,2.2);


cfg_= cfg;
simInputLabel_= simInputLabel;
dbe_= dbe;

minPt_ = minPt;
minEta_ = minEta;
maxEta_ = maxEta;


buildLUT();
Expand Down Expand Up @@ -96,7 +97,7 @@ bool GEMTrackMatch::isSimTrackGood(const SimTrack &t)
if (std::abs(t.type()) != 13) return false; // only interested in direct muon simtracks
if (t.momentum().pt() < 5 ) return false;
float eta = fabs(t.momentum().eta());
if (eta > 2.18 || eta < 1.55) return false; // no GEMs could be in such eta
if (eta > maxEta_ || eta < minEta_ ) return false; // no GEMs could be in such eta
return true;
}

Expand Down

0 comments on commit 6edf62d

Please sign in to comment.