00001 /* 00002 L2 Tau Trigger Isolation Producer 00003 00004 Author: Michail Bachtis 00005 University of Wisconsin-Madison 00006 e-mail: bachtis@hep.wisc.edu 00007 */ 00008 00009 00010 // system include files 00011 #include <memory> 00012 00013 // user include files 00014 #include "FWCore/Framework/interface/Frameworkfwd.h" 00015 #include "FWCore/Framework/interface/EDProducer.h" 00016 #include "FWCore/Framework/interface/Event.h" 00017 #include "FWCore/Framework/interface/EventSetup.h" 00018 #include "FWCore/Framework/interface/MakerMacros.h" 00019 #include "FWCore/ParameterSet/interface/ParameterSet.h" 00020 #include "FWCore/Framework/interface/ESHandle.h" 00021 00022 #include "DataFormats/Math/interface/LorentzVector.h" 00023 #include "DataFormats/Math/interface/LorentzVectorFwd.h" 00024 #include "DataFormats/JetReco/interface/CaloJet.h" 00025 #include "DataFormats/TauReco/interface/L2TauInfoAssociation.h" 00026 00027 00028 //Calorimeter!! 00029 #include "DataFormats/CaloTowers/interface/CaloTowerCollection.h" 00030 #include "DataFormats/DetId/interface/DetId.h" 00031 #include "DataFormats/EgammaReco/interface/BasicCluster.h" 00032 #include "DataFormats/EcalDetId/interface/EcalSubdetector.h" 00033 00034 #include "DataFormats/CaloTowers/interface/CaloTowerDetId.h" 00035 #include "DataFormats/EcalDetId/interface/EBDetId.h" 00036 #include "DataFormats/EcalDetId/interface/EEDetId.h" 00037 #include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h" 00038 00039 #include "DataFormats/GeometryVector/interface/GlobalPoint.h" 00040 #include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h" 00041 #include "Geometry/CaloGeometry/interface/CaloGeometry.h" 00042 #include "Geometry/CaloGeometry/interface/CaloCellGeometry.h" 00043 00044 // Math 00045 #include "Math/GenVector/VectorUtil.h" 00046 #include "Math/GenVector/PxPyPzE4D.h" 00047 00048 00049 using namespace reco; 00050 using namespace edm; 00051 00052 00053 class L2TauNarrowConeIsolationProducer : public edm::EDProducer { 00054 public: 00055 explicit L2TauNarrowConeIsolationProducer(const edm::ParameterSet&); 00056 ~L2TauNarrowConeIsolationProducer(); 00057 00058 private: 00059 virtual void beginJob(const edm::EventSetup&) ; 00060 virtual void produce(edm::Event&, const edm::EventSetup&); 00061 virtual void endJob() ; 00062 00063 00064 //retrieve towers and crystals around the jet 00065 math::PtEtaPhiELorentzVectorCollection getECALHits(const CaloJet&,const edm::Event&,const edm::EventSetup& iSetup); 00066 math::PtEtaPhiELorentzVectorCollection getHCALHits(const CaloJet&,const edm::Event&); 00067 00068 edm::InputTag l2CaloJets_;//label for the readout Collection 00069 edm::InputTag EBRecHits_;//Label for ECAL Barrel Hits 00070 edm::InputTag EERecHits_;//Label for ECAL EndCAP Hits 00071 edm::InputTag CaloTowers_;//Label for ECAL EndCAP Hits 00072 00073 double associationRadius_; //Association Distance for a tower/crystal 00074 00075 //Thresholding 00076 double crystalThresholdE_; 00077 double crystalThresholdB_; 00078 double towerThreshold_; 00079 00080 //Sub Algorithm Configuration Variables 00081 00082 //ECALIsolation 00083 bool ECALIsolation_run_; 00084 00085 double ECALIsolation_innerCone_; 00086 double ECALIsolation_outerCone_; 00087 00088 //TowerIsolation 00089 bool TowerIsolation_run_; 00090 00091 double TowerIsolation_innerCone_; 00092 double TowerIsolation_outerCone_; 00093 00094 //ECALClustering 00095 bool ECALClustering_run_; 00096 double ECALClustering_clusterRadius_; 00097 00098 struct CrystalPtComparator 00099 { 00100 bool operator()( const math::PtEtaPhiELorentzVector v1, const math::PtEtaPhiELorentzVector v2) const 00101 { 00102 return v1.pt() > v2.pt(); 00103 } 00104 }; 00105 00106 CrystalPtComparator comparePt; 00107 00108 }; 00109