CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_2_7_hltpatch1/src/RecoTauTag/HLTProducers/src/L2TauRelaxingIsolationSelector.cc

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