Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
yaml --- r: 55797 b: "refs/heads/CMSSW_7_0_X" c: ef7848e h: "refs/heads/CMSSW_7_0_X" i: 55795: f5dcd30 v: v3
- Loading branch information
Alessio Ghezzi
committed
Oct 14, 2008
1 parent
c420ef8
commit 1786140
Showing
8 changed files
with
572 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
trunk/HLTrigger/Egamma/interface/HLTEgammaCaloIsolFilterPairs.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
#ifndef HLTEgammaCaloIsolFilterPairs_h | ||
#define HLTEgammaCaloIsolFilterPairs_h | ||
|
||
/** \class HLTEgammaCaloIsolFilterPairs | ||
* | ||
* \author Alessio Ghezzi | ||
* | ||
*/ | ||
|
||
#include "HLTrigger/HLTcore/interface/HLTFilter.h" | ||
|
||
#include "DataFormats/RecoCandidate/interface/RecoEcalCandidate.h" | ||
#include "DataFormats/RecoCandidate/interface/RecoEcalCandidateFwd.h" | ||
#include "DataFormats/RecoCandidate/interface/RecoEcalCandidateIsolation.h" | ||
|
||
|
||
|
||
// | ||
// class decleration | ||
// | ||
|
||
class HLTEgammaCaloIsolFilterPairs : public HLTFilter { | ||
|
||
public: | ||
explicit HLTEgammaCaloIsolFilterPairs(const edm::ParameterSet&); | ||
~HLTEgammaCaloIsolFilterPairs(); | ||
virtual bool filter(edm::Event&, const edm::EventSetup&); | ||
|
||
private: | ||
edm::InputTag candTag_; // input tag identifying product contains filtered egammas | ||
edm::InputTag isoTag_; // input tag identifying product contains ecal isolation map | ||
edm::InputTag nonIsoTag_; // input tag identifying product contains ecal isolation map | ||
|
||
double isolcut_EB1; | ||
double FracCut_EB1; | ||
double IsoloEt2_EB1; | ||
double isolcut_EE1; | ||
double FracCut_EE1; | ||
double IsoloEt2_EE1; | ||
|
||
double isolcut_EB2; | ||
double FracCut_EB2; | ||
double IsoloEt2_EB2; | ||
double isolcut_EE2; | ||
double FracCut_EE2; | ||
double IsoloEt2_EE2; | ||
|
||
|
||
bool AlsoNonIso_1,AlsoNonIso_2; | ||
bool PassCaloIsolation(edm::Ref<reco::RecoEcalCandidateCollection> ref,reco::RecoEcalCandidateIsolationMap IsoMap,reco::RecoEcalCandidateIsolationMap NonIsoMap, int which, bool ChekAlsoNonIso); | ||
}; | ||
|
||
#endif //HLTEgammaCaloIsolFilterPairs_h | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#ifndef HLTEgammaEtFilterPairs_h | ||
#define HLTEgammaEtFilterPairs_h | ||
|
||
/** \class HLTEgammaEtFilterPairs | ||
* | ||
* \author Alessio Ghezzi | ||
* | ||
*/ | ||
|
||
#include "HLTrigger/HLTcore/interface/HLTFilter.h" | ||
|
||
// | ||
// class decleration | ||
// | ||
|
||
class HLTEgammaEtFilterPairs : public HLTFilter { | ||
|
||
public: | ||
explicit HLTEgammaEtFilterPairs(const edm::ParameterSet&); | ||
~HLTEgammaEtFilterPairs(); | ||
virtual bool filter(edm::Event&, const edm::EventSetup&); | ||
|
||
private: | ||
edm::InputTag inputTag_; // input tag identifying product contains egammas | ||
double etcut1_; // Et threshold in GeV | ||
double etcut2_; // Et threshold in GeV | ||
bool store_; | ||
bool relaxed_; | ||
edm::InputTag L1IsoCollTag_; | ||
edm::InputTag L1NonIsoCollTag_; | ||
}; | ||
|
||
#endif //HLTEgammaEtFilterPairs_h |
46 changes: 46 additions & 0 deletions
46
trunk/HLTrigger/Egamma/interface/HLTEgammaL1MatchFilterPairs.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#ifndef HLTEgammaL1MatchFilterPairs_h | ||
#define HLTEgammaL1MatchFilterPairs_h | ||
|
||
/** \class HLTEgammaL1MatchFilterPairs | ||
* | ||
* \author Monica Vazquez Acosta (CERN) | ||
* | ||
*/ | ||
|
||
#include "HLTrigger/HLTcore/interface/HLTFilter.h" | ||
|
||
#include "DataFormats/RecoCandidate/interface/RecoEcalCandidate.h" | ||
#include "DataFormats/RecoCandidate/interface/RecoEcalCandidateFwd.h" | ||
|
||
#include "DataFormats/L1Trigger/interface/L1EmParticle.h" | ||
#include "DataFormats/L1Trigger/interface/L1EmParticleFwd.h" | ||
// | ||
// class decleration | ||
// | ||
|
||
class HLTEgammaL1MatchFilterPairs : public HLTFilter { | ||
|
||
public: | ||
explicit HLTEgammaL1MatchFilterPairs(const edm::ParameterSet&); | ||
~HLTEgammaL1MatchFilterPairs(); | ||
virtual bool filter(edm::Event&, const edm::EventSetup&); | ||
|
||
private: | ||
bool CheckL1Matching(edm::Ref<reco::RecoEcalCandidateCollection>ref,std::vector<l1extra::L1EmParticleRef >& l1EGIso,std::vector<l1extra::L1EmParticleRef >& l1EGNonIso); | ||
edm::InputTag candIsolatedTag_; // input tag identifying product contains egammas | ||
edm::InputTag l1IsolatedTag_; // input tag identifying product contains egammas | ||
edm::InputTag candNonIsolatedTag_; // input tag identifying product contains egammas | ||
edm::InputTag l1NonIsolatedTag_; // input tag identifying product contains egammas | ||
|
||
edm::InputTag L1SeedFilterTag_; | ||
bool AlsoNonIsolatedFirst_, AlsoNonIsolatedSecond_; | ||
|
||
// L1 matching cuts | ||
double region_eta_size_; | ||
double region_eta_size_ecap_; | ||
double region_phi_size_; | ||
double barrel_end_; | ||
double endcap_end_; | ||
}; | ||
|
||
#endif //HLTEgammaL1MatchFilterPairs_h |
150 changes: 150 additions & 0 deletions
150
trunk/HLTrigger/Egamma/src/HLTEgammaCaloIsolFilterPairs.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,150 @@ | ||
/** \class EgammaHLTCaloIsolFilterPairs | ||
* | ||
* $Id: HLTEgammaCaloIsolFilterPairs.cc,v 1.8 2008/04/24 12:53:42 ghezzi Exp $ | ||
* | ||
* \author Alessio Ghezzi | ||
* | ||
*/ | ||
|
||
#include "HLTrigger/Egamma/interface/HLTEgammaCaloIsolFilterPairs.h" | ||
|
||
#include "DataFormats/Common/interface/Handle.h" | ||
|
||
#include "DataFormats/HLTReco/interface/TriggerFilterObjectWithRefs.h" | ||
|
||
#include "FWCore/MessageLogger/interface/MessageLogger.h" | ||
|
||
// | ||
// constructors and destructor | ||
// | ||
HLTEgammaCaloIsolFilterPairs::HLTEgammaCaloIsolFilterPairs(const edm::ParameterSet& iConfig) | ||
{ | ||
candTag_ = iConfig.getParameter< edm::InputTag > ("candTag"); | ||
isoTag_ = iConfig.getParameter< edm::InputTag > ("isoTag"); | ||
nonIsoTag_ = iConfig.getParameter< edm::InputTag > ("nonIsoTag"); | ||
|
||
isolcut_EB1 = iConfig.getParameter<double> ("isolcutEB1"); | ||
FracCut_EB1 = iConfig.getParameter<double> ("IsoOverEtCutEB1"); | ||
IsoloEt2_EB1 = iConfig.getParameter<double> ("IsoOverEt2CutEB1"); | ||
isolcut_EE1 = iConfig.getParameter<double> ("isolcutEE1"); | ||
FracCut_EE1 = iConfig.getParameter<double> ("IsoOverEtCutEE1"); | ||
IsoloEt2_EE1 = iConfig.getParameter<double> ("IsoOverEt2CutEE1"); | ||
|
||
isolcut_EB2 = iConfig.getParameter<double> ("isolcutEB2"); | ||
FracCut_EB2 = iConfig.getParameter<double> ("IsoOverEtCutEB2"); | ||
IsoloEt2_EB2 = iConfig.getParameter<double> ("IsoOverEt2CutEB2"); | ||
isolcut_EE2 = iConfig.getParameter<double> ("isolcutEE2"); | ||
FracCut_EE2 = iConfig.getParameter<double> ("IsoOverEtCutEE2"); | ||
IsoloEt2_EE2 = iConfig.getParameter<double> ("IsoOverEt2CutEE2"); | ||
|
||
|
||
AlsoNonIso_1 = iConfig.getParameter<bool> ("AlsoNonIso1"); | ||
AlsoNonIso_2 = iConfig.getParameter<bool> ("AlsoNonIso2"); | ||
|
||
//register your products | ||
produces<trigger::TriggerFilterObjectWithRefs>(); | ||
|
||
} | ||
|
||
HLTEgammaCaloIsolFilterPairs::~HLTEgammaCaloIsolFilterPairs(){} | ||
|
||
|
||
// ------------ method called to produce the data ------------ | ||
bool | ||
HLTEgammaCaloIsolFilterPairs::filter(edm::Event& iEvent, const edm::EventSetup& iSetup) | ||
{ | ||
|
||
// The filter object | ||
using namespace trigger; | ||
std::auto_ptr<trigger::TriggerFilterObjectWithRefs> filterproduct (new trigger::TriggerFilterObjectWithRefs(path(),module())); | ||
|
||
edm::Handle<trigger::TriggerFilterObjectWithRefs> PrevFilterOutput; | ||
|
||
iEvent.getByLabel (candTag_,PrevFilterOutput); | ||
|
||
std::vector<edm::Ref<reco::RecoEcalCandidateCollection> > recoecalcands; | ||
PrevFilterOutput->getObjects(TriggerCluster, recoecalcands); | ||
|
||
//get hold of ecal isolation association map | ||
edm::Handle<reco::RecoEcalCandidateIsolationMap> depMap; | ||
iEvent.getByLabel (isoTag_,depMap); | ||
|
||
//get hold of ecal isolation association map | ||
edm::Handle<reco::RecoEcalCandidateIsolationMap> depNonIsoMap; | ||
if(AlsoNonIso_1 || AlsoNonIso_2) iEvent.getByLabel (nonIsoTag_,depNonIsoMap); | ||
|
||
|
||
int n = 0; | ||
// the list should be interpreted as pairs: | ||
// <recoecalcands[0],recoecalcands[1]> | ||
// <recoecalcands[2],recoecalcands[3]> | ||
// <recoecalcands[4],recoecalcands[5]> | ||
// ....... | ||
|
||
// Should I check that the size of recoecalcands is even ? | ||
for (unsigned int i=0; i<recoecalcands.size(); i=i+2) { | ||
|
||
edm::Ref<reco::RecoEcalCandidateCollection> r1 = recoecalcands[i]; | ||
edm::Ref<reco::RecoEcalCandidateCollection> r2 = recoecalcands[i+1]; | ||
// std::cout<<"CaloIsol 1) Et Eta phi: "<<r1->et()<<" "<<r1->eta()<<" "<<r1->phi()<<" 2) Et eta phi: "<<r2->et()<<" "<<r2->eta()<<" "<<r2->phi()<<std::endl; | ||
|
||
if( PassCaloIsolation(r1,*depMap,*depNonIsoMap,1,AlsoNonIso_1) && PassCaloIsolation(r2,*depMap,*depNonIsoMap,2,AlsoNonIso_2) ) | ||
{ | ||
n++; | ||
filterproduct->addObject(TriggerCluster, r1); | ||
filterproduct->addObject(TriggerCluster, r2); | ||
} | ||
} | ||
|
||
// filter decision | ||
bool accept(n>=1); | ||
|
||
// put filter object into the Event | ||
iEvent.put(filterproduct); | ||
|
||
return accept; | ||
} | ||
|
||
bool HLTEgammaCaloIsolFilterPairs::PassCaloIsolation(edm::Ref<reco::RecoEcalCandidateCollection> ref,reco::RecoEcalCandidateIsolationMap IsoMap,reco::RecoEcalCandidateIsolationMap NonIsoMap, int which, bool ChekAlsoNonIso){ | ||
|
||
|
||
reco::RecoEcalCandidateIsolationMap::const_iterator mapi = IsoMap.find( ref ); | ||
|
||
if(mapi==IsoMap.end()) { | ||
if(ChekAlsoNonIso) mapi = NonIsoMap.find( ref ); | ||
} | ||
|
||
float vali = mapi->val; | ||
float IsoOE= vali/ref->et(); | ||
float IsoOE2= IsoOE/ref->et(); | ||
double isolcut=0,FracCut=0,IsoloEt2=0; | ||
if( fabs(ref->eta()) < 1.479){ | ||
if(which==1){ | ||
isolcut = isolcut_EB1; | ||
FracCut = FracCut_EB1; | ||
IsoloEt2 = IsoloEt2_EB1; | ||
} | ||
else if(which==2){ | ||
isolcut = isolcut_EB2; | ||
FracCut = FracCut_EB2; | ||
IsoloEt2 = IsoloEt2_EB2; | ||
} | ||
else {return false;} | ||
} | ||
else { | ||
if(which==1){ | ||
isolcut = isolcut_EE1; | ||
FracCut = FracCut_EE1; | ||
IsoloEt2 = IsoloEt2_EE1; | ||
} | ||
else if(which==2){ | ||
isolcut = isolcut_EE2; | ||
FracCut = FracCut_EE2; | ||
IsoloEt2 = IsoloEt2_EE2; | ||
} | ||
else {return false;} | ||
} | ||
|
||
if ( vali < isolcut || IsoOE < FracCut || IsoOE2 < IsoloEt2 ) { return true;} | ||
return false; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
/** \class HLTEgammaEtFilterPairs | ||
* | ||
* $Id: HLTEgammaEtFilterPairs.cc,v 1.8 2008/04/22 17:01:17 ghezzi Exp $ | ||
* | ||
* \author Alessio Ghezzi | ||
* | ||
*/ | ||
|
||
#include "HLTrigger/Egamma/interface/HLTEgammaEtFilterPairs.h" | ||
|
||
#include "DataFormats/Common/interface/Handle.h" | ||
|
||
#include "DataFormats/HLTReco/interface/TriggerFilterObjectWithRefs.h" | ||
|
||
#include "FWCore/MessageLogger/interface/MessageLogger.h" | ||
|
||
#include "DataFormats/RecoCandidate/interface/RecoEcalCandidate.h" | ||
|
||
// | ||
// constructors and destructor | ||
// | ||
HLTEgammaEtFilterPairs::HLTEgammaEtFilterPairs(const edm::ParameterSet& iConfig) | ||
{ | ||
inputTag_ = iConfig.getParameter< edm::InputTag > ("inputTag"); | ||
etcut1_ = iConfig.getParameter<double> ("etcut1"); | ||
etcut2_ = iConfig.getParameter<double> ("etcut2"); | ||
store_ = iConfig.getUntrackedParameter<bool> ("SaveTag",false) ; | ||
relaxed_ = iConfig.getUntrackedParameter<bool> ("relaxed",true) ; | ||
L1IsoCollTag_= iConfig.getParameter< edm::InputTag > ("L1IsoCand"); | ||
L1NonIsoCollTag_= iConfig.getParameter< edm::InputTag > ("L1NonIsoCand"); | ||
|
||
//register your products | ||
produces<trigger::TriggerFilterObjectWithRefs>(); | ||
} | ||
|
||
HLTEgammaEtFilterPairs::~HLTEgammaEtFilterPairs(){} | ||
|
||
|
||
// ------------ method called to produce the data ------------ | ||
bool | ||
HLTEgammaEtFilterPairs::filter(edm::Event& iEvent, const edm::EventSetup& iSetup) | ||
{ | ||
using namespace trigger; | ||
// The filter object | ||
std::auto_ptr<trigger::TriggerFilterObjectWithRefs> filterproduct (new trigger::TriggerFilterObjectWithRefs(path(),module())); | ||
if( store_ ){filterproduct->addCollectionTag(L1IsoCollTag_);} | ||
if( store_ && relaxed_){filterproduct->addCollectionTag(L1NonIsoCollTag_);} | ||
|
||
edm::Handle<trigger::TriggerFilterObjectWithRefs> PrevFilterOutput; | ||
iEvent.getByLabel (inputTag_,PrevFilterOutput); | ||
|
||
std::vector<edm::Ref<reco::RecoEcalCandidateCollection> > recoecalcands; // vref with your specific C++ collection type | ||
PrevFilterOutput->getObjects(TriggerCluster, recoecalcands); | ||
// they list should be interpreted as pairs: | ||
// <recoecalcands[0],recoecalcands[1]> | ||
// <recoecalcands[2],recoecalcands[3]> | ||
// <recoecalcands[4],recoecalcands[5]> | ||
// ....... | ||
|
||
// Should I check that the size of recoecalcands is even ? | ||
int n(0); | ||
|
||
for (unsigned int i=0; i<recoecalcands.size(); i=i+2) { | ||
|
||
edm::Ref<reco::RecoEcalCandidateCollection> r1 = recoecalcands[i]; | ||
edm::Ref<reco::RecoEcalCandidateCollection> r2 = recoecalcands[i+1]; | ||
// std::cout<<"EtFilter: 1) Et Eta phi: "<<r1->et()<<" "<<r1->eta()<<" "<<r1->phi()<<" 2) Et eta phi: "<<r2->et()<<" "<<r2->eta()<<" "<<r2->phi()<<std::endl; | ||
if ( recoecalcands[i]->et() >= etcut1_ && recoecalcands[i+1]->et() >= etcut2_) { | ||
n++; | ||
filterproduct->addObject(TriggerCluster,recoecalcands[i] ); | ||
filterproduct->addObject(TriggerCluster,recoecalcands[i+1] ); | ||
} | ||
} | ||
|
||
|
||
// filter decision | ||
bool accept(n>=1); | ||
|
||
// put filter object into the Event | ||
iEvent.put(filterproduct); | ||
|
||
return accept; | ||
} |
Oops, something went wrong.