Skip to content

Commit

Permalink
Switch tag/probe loops
Browse files Browse the repository at this point in the history
  • Loading branch information
fruboes committed Sep 25, 2014
1 parent e1f57a1 commit 9e90a07
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions HLTrigger/JetMET/src/HLTDiJetAveEtaFilter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -90,41 +90,41 @@ HLTDiJetAveEtaFilter<T>::hltFilter(edm::Event& iEvent, const edm::EventSetup& iS
int n(0);

if(objects->size() > 1){ // events with two or more jets
typename TCollection::const_iterator iTag ( objects->begin() );
typename TCollection::const_iterator iProbe ( objects->begin() );
typename TCollection::const_iterator iEnd ( objects->end() );
for (; iTag!=iEnd; ++iTag) {
if (iTag->pt() < minPtJet_) continue;
for (; iProbe!=iEnd; ++iProbe) {
if (iProbe->pt() < minPtJet_) continue;

// for easier trigger efficiency evaluation save all tag/probe
// for easier trigger efficiency evaluation save all probe/tag
// objects passing the minPT/eta criteria (outer loop)
float eta = std::abs(iTag->eta());
bool isGood = false; // tag or probe
bool isTag = false;
if ( eta > tagEtaMin_ && eta < tagEtaMax_ ){
float eta = std::abs(iProbe->eta());
bool isGood = false; // probe or tag
bool isProbe = false;
if ( eta > probeEtaMin_ && eta < probeEtaMax_ ){
isGood = true;
isTag = true;
isProbe = true;
}
if ( eta > probeEtaMin_ && eta < probeEtaMax_ ){
if ( eta > tagEtaMin_ && eta < tagEtaMax_ ){
isGood = true;
}
if (isGood){
filterproduct.addObject(triggerType_, TRef(objects,distance(objects->begin(),iTag)));
filterproduct.addObject(triggerType_, TRef(objects,distance(objects->begin(),iProbe)));
}

if (!isTag) continue;
if (!isProbe) continue;

typename TCollection::const_iterator iProbe ( objects->begin() );
for (;iProbe != iEnd; ++iProbe){
if (iProbe==iTag) continue;
if (iProbe->pt() < minPtJet_) continue;
float eta2 = std::abs(iProbe->eta());
if ( eta2 < probeEtaMin_ || eta2 > probeEtaMax_ ) continue;
double dphi = std::abs(deltaPhi(iTag->phi(),iProbe->phi() ));
typename TCollection::const_iterator iTag ( objects->begin() );
for (;iTag != iEnd; ++iTag){
if (iTag==iProbe) continue;
if (iTag->pt() < minPtJet_) continue;
float eta2 = std::abs(iTag->eta());
if ( eta2 < tagEtaMin_ || eta2 > tagEtaMax_ ) continue;
double dphi = std::abs(deltaPhi(iProbe->phi(),iTag->phi() ));
if (dphi<minDphi_) {
continue;
}

double ptAve = (iTag->pt() + iProbe->pt())/2;
double ptAve = (iProbe->pt() + iTag->pt())/2;
if (ptAve<minPtAve_ ) {
continue;
}
Expand Down

0 comments on commit 9e90a07

Please sign in to comment.