Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 75679
b: "refs/heads/CMSSW_7_1_X"
c: e1c0c42
h: "refs/heads/CMSSW_7_1_X"
i:
  75677: 414f280
  75675: 1f90ca2
  75671: dcf748b
  75663: 6305ecb
  75647: d3dbd95
v: v3
  • Loading branch information
Sebastian Mirko Naumann-Emme committed Oct 19, 2009
1 parent 07e347f commit 1f4333e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 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": d774bc9adf6abfda7d9f984ee62e60edf472a601
"refs/heads/CMSSW_7_1_X": e1c0c423a96b6b94304c770c6ac0ac4ce2d3bed8
Original file line number Diff line number Diff line change
Expand Up @@ -127,16 +127,18 @@ void TtSemiLepKinFitProducer<LeptonCollection>::produce(edm::Event& evt, const e

unsigned int nPartons = 4;

edm::Handle<std::vector<int> > match;
bool unvalidMatch = false;
std::vector<int> match;
bool invalidMatch = false;
if(useOnlyMatch_) {
evt.getByLabel(match_, match);
edm::Handle<std::vector<std::vector<int> > > matchHandle;
evt.getByLabel(match_, matchHandle);
match = *(matchHandle->begin());
// check if match is valid
if(match->size()!=nPartons) unvalidMatch=true;
if(match.size()!=nPartons) invalidMatch=true;
else {
for(unsigned int idx=0; idx<jets->size(); ++idx) {
if(idx<0 || idx>=jets->size()) {
unvalidMatch=true;
for(unsigned int idx=0; idx<match.size(); ++idx) {
if(match[idx]<0 || match[idx]>=(int)jets->size()) {
invalidMatch=true;
break;
}
}
Expand All @@ -145,10 +147,10 @@ void TtSemiLepKinFitProducer<LeptonCollection>::produce(edm::Event& evt, const e

// -----------------------------------------------------
// skip events with no appropriate lepton candidate in
// or empty MET or less jets than partons or unvalid match
// or empty MET or less jets than partons or invalid match
// -----------------------------------------------------

if( leps->empty() || mets->empty() || jets->size()<nPartons || unvalidMatch ) {
if( leps->empty() || mets->empty() || jets->size()<nPartons || invalidMatch ) {
// the kinFit getters return empty objects here
pPartonsHadP->push_back( fitter->fittedHadP() );
pPartonsHadQ->push_back( fitter->fittedHadQ() );
Expand Down Expand Up @@ -196,7 +198,7 @@ void TtSemiLepKinFitProducer<LeptonCollection>::produce(edm::Event& evt, const e

std::vector<int> combi;
for(unsigned int i=0; i<nPartons; ++i) {
if(useOnlyMatch_) combi.push_back( (*match)[i] );
if(useOnlyMatch_) combi.push_back( match[i] );
else combi.push_back(i);
}

Expand Down

0 comments on commit 1f4333e

Please sign in to comment.