CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_0/src/RecoTauTag/HLTProducers/src/L2TauModularIsolationSelector.cc

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