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 //Calorimeter!! 00028 #include "DataFormats/CaloTowers/interface/CaloTowerCollection.h" 00029 #include "DataFormats/DetId/interface/DetId.h" 00030 #include "DataFormats/EgammaReco/interface/BasicCluster.h" 00031 #include "DataFormats/EcalDetId/interface/EcalSubdetector.h" 00032 00033 #include "DataFormats/CaloTowers/interface/CaloTowerDetId.h" 00034 #include "DataFormats/EcalDetId/interface/EBDetId.h" 00035 #include "DataFormats/EcalDetId/interface/EEDetId.h" 00036 #include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h" 00037 00038 #include "DataFormats/GeometryVector/interface/GlobalPoint.h" 00039 #include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h" 00040 #include "Geometry/CaloGeometry/interface/CaloGeometry.h" 00041 #include "Geometry/CaloGeometry/interface/CaloCellGeometry.h" 00042 00043 // Math 00044 #include "Math/GenVector/VectorUtil.h" 00045 #include "Math/GenVector/PxPyPzE4D.h" 00046 00047 00048 00049 00050 00051 00052 class L2TauNarrowConeIsolationProducer : public edm::EDProducer { 00053 public: 00054 typedef reco::CaloJet CaloJet; 00055 typedef reco::CaloJetCollection CaloJetCollection; 00056 explicit L2TauNarrowConeIsolationProducer(const edm::ParameterSet&); 00057 ~L2TauNarrowConeIsolationProducer(); 00058 00059 private: 00060 virtual void beginJob() ; 00061 virtual void produce(edm::Event&, const edm::EventSetup&); 00062 virtual void endJob() ; 00063 00064 00065 //retrieve towers and crystals around the jet 00066 math::PtEtaPhiELorentzVectorCollection getECALHits(const CaloJet&,const edm::Event&,const edm::EventSetup& iSetup); 00067 math::PtEtaPhiELorentzVectorCollection getHCALHits(const CaloJet&,const edm::Event&); 00068 00069 edm::InputTag l2CaloJets_;//label for the readout Collection 00070 edm::InputTag EBRecHits_;//Label for ECAL Barrel Hits 00071 edm::InputTag EERecHits_;//Label for ECAL EndCAP Hits 00072 edm::InputTag CaloTowers_;//Label for ECAL EndCAP Hits 00073 00074 double associationRadius_; //Association Distance for a tower/crystal 00075 00076 //Thresholding 00077 double crystalThresholdE_; 00078 double crystalThresholdB_; 00079 double towerThreshold_; 00080 00081 //Sub Algorithm Configuration Variables 00082 00083 //ECALIsolation 00084 bool ECALIsolation_run_; 00085 00086 double ECALIsolation_innerCone_; 00087 double ECALIsolation_outerCone_; 00088 00089 //TowerIsolation 00090 bool TowerIsolation_run_; 00091 00092 double TowerIsolation_innerCone_; 00093 double TowerIsolation_outerCone_; 00094 00095 //ECALClustering 00096 bool ECALClustering_run_; 00097 double ECALClustering_clusterRadius_; 00098 00099 struct CrystalPtComparator 00100 { 00101 bool operator()( const math::PtEtaPhiELorentzVector v1, const math::PtEtaPhiELorentzVector v2) const 00102 { 00103 return v1.pt() > v2.pt(); 00104 } 00105 }; 00106 00107 CrystalPtComparator comparePt; 00108 00109 }; 00110