CMS 3D CMS Logo

L2TauIsolationSelector.cc

Go to the documentation of this file.
00001 #include "RecoTauTag/HLTProducers/interface/L2TauIsolationSelector.h"
00002 #include "DataFormats/TauReco/interface/L2TauInfoAssociation.h"
00003 
00004 using namespace reco; 
00005 
00006 L2TauIsolationSelector::L2TauIsolationSelector(const edm::ParameterSet& iConfig):
00007   associationInput_(iConfig.getParameter<edm::InputTag>("L2InfoAssociation")),
00008   ECALIsolEt_(iConfig.getParameter<double>("ECALIsolEt")),
00009   TowerIsolEt_(iConfig.getParameter<double>("TowerIsolEt")),
00010   Cluster_etaRMS_(iConfig.getParameter<double>("ClusterEtaRMS")),
00011   Cluster_phiRMS_(iConfig.getParameter<double>("ClusterPhiRMS")),
00012   Cluster_drRMS_(iConfig.getParameter<double>("ClusterDRRMS")),
00013   Cluster_nClusters_(iConfig.getParameter<int>("ClusterNClusters")),
00014   JetEt_(iConfig.getParameter<double>("MinJetEt")),
00015   SeedTowerEt_(iConfig.getParameter<double>("SeedTowerEt"))
00016 
00017 {
00018 
00019   produces<CaloJetCollection>("Isolated");
00020 }
00021 
00022 
00023 L2TauIsolationSelector::~L2TauIsolationSelector()
00024 {
00025  
00026 
00027 }
00028 
00029 
00030 //
00031 // member functions
00032 //
00033 
00034 // ------------ method called to produce the data  ------------
00035 void
00036 L2TauIsolationSelector::produce(edm::Event& iEvent, const edm::EventSetup& iSetup)
00037 {
00038    using namespace edm;
00039    Handle<L2TauInfoAssociation> Imap;
00040 
00041    iEvent.getByLabel(associationInput_ ,Imap);
00042    std::auto_ptr<CaloJetCollection> l2IsolCaloJets( new CaloJetCollection );
00043 
00044    if(Imap->size()>0)
00045          for(L2TauInfoAssociation::const_iterator p = Imap->begin();p!=Imap->end();++p)
00046            {
00047              //Retrieve The L2TauIsolationInfo Class from the AssociationMap
00048              const L2TauIsolationInfo l2info = p->val;
00049              //Retrieve the Jet
00050              const CaloJet jet =*(p->key);
00051              
00052              //If The Cuts are Satisfied
00053            if(jet.et()>JetEt_) 
00054              if(l2info.ECALIsolConeCut< ECALIsolEt_)
00055                if(l2info.SeedTowerEt>SeedTowerEt_)
00056                 if(l2info.ECALClusterNClusters <Cluster_nClusters_)
00057                     if(l2info.ECALClusterEtaRMS <Cluster_etaRMS_)
00058                        if(l2info.ECALClusterPhiRMS <Cluster_phiRMS_)
00059                          if(l2info.ECALClusterDRRMS <Cluster_drRMS_)
00060                            if(l2info.TowerIsolConeCut<TowerIsolEt_)
00061                              {
00062                                  //Retrieve the Jet From the AssociationMap
00063                                l2IsolCaloJets->push_back(jet);
00064                              }
00065 
00066            }
00067  
00068         iEvent.put(l2IsolCaloJets, "Isolated");
00069 }
00070 
00071 // ------------ method called once each job just before starting event loop  ------------
00072 void 
00073 L2TauIsolationSelector::beginJob(const edm::EventSetup&)
00074 {
00075 }
00076 
00077 // ------------ method called once each job just after ending the event loop  ------------
00078 void 
00079 L2TauIsolationSelector::endJob() {
00080 }
00081 
00082 
00083 

Generated on Tue Jun 9 17:44:59 2009 for CMSSW by  doxygen 1.5.4