Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:25:26

0001 #ifndef RECOMET_METALGORITHMS_ECALHALOALGO_H
0002 #define RECOMET_METALGORITHMS_ECALHALOALGO_H
0003 /*
0004   [class]:  EcalHaloAlgo
0005   [authors]: R. Remington, The University of Florida
0006   [description]: Algorithm to calculate quantities relevant to EcalHaloData object
0007   [date]: October 15, 2009
0008 */
0009 #include "DataFormats/METReco/interface/EcalHaloData.h"
0010 
0011 #include "Geometry/CommonDetUnit/interface/GeomDet.h"
0012 #include "DataFormats/GeometrySurface/interface/BoundPlane.h"
0013 #include "DataFormats/GeometryVector/interface/GlobalPoint.h"
0014 #include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h"
0015 #include "Geometry/CaloGeometry/interface/CaloGeometry.h"
0016 #include "Geometry/CaloGeometry/interface/CaloCellGeometry.h"
0017 #include "Geometry/Records/interface/CaloGeometryRecord.h"
0018 
0019 #include "DataFormats/DetId/interface/DetId.h"
0020 #include "DataFormats/CaloRecHit/interface/CaloRecHit.h"
0021 
0022 #include "Geometry/CaloTopology/interface/EcalBarrelTopology.h"
0023 #include "Geometry/CaloTopology/interface/EcalEndcapTopology.h"
0024 #include "DataFormats/CaloRecHit/interface/CaloID.h"
0025 #include "DataFormats/EcalDetId/interface/EBDetId.h"
0026 #include "DataFormats/EcalDetId/interface/EEDetId.h"
0027 #include "DataFormats/EcalDetId/interface/ESDetId.h"
0028 #include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h"
0029 #include "DataFormats/EcalRecHit/interface/EcalRecHit.h"
0030 #include "DataFormats/EgammaReco/interface/SuperCluster.h"
0031 #include "DataFormats/EgammaReco/interface/BasicCluster.h"
0032 //#include "RecoEcal/EgammaCoreTools/interface/EcalClusterLazyTools.h"
0033 #include "RecoEcal/EgammaCoreTools/interface/EcalClusterTools.h"
0034 #include "DataFormats/EgammaReco/interface/SuperCluster.h"
0035 #include "DataFormats/EgammaReco/interface/SuperClusterFwd.h"
0036 #include "DataFormats/EgammaReco/interface/BasicCluster.h"
0037 #include "DataFormats/EgammaCandidates/interface/Conversion.h"
0038 #include "DataFormats/EgammaCandidates/interface/ConversionFwd.h"
0039 #include "DataFormats/EgammaCandidates/interface/Photon.h"
0040 #include "DataFormats/EgammaCandidates/interface/PhotonFwd.h"
0041 #include "DataFormats/HcalRecHit/interface/HcalRecHitDefs.h"
0042 #include "DataFormats/METReco/interface/HaloClusterCandidateECAL.h"
0043 
0044 class EcalHaloAlgo {
0045 public:
0046   // constructor
0047   explicit EcalHaloAlgo(edm::ConsumesCollector iC);
0048   // destructor
0049   ~EcalHaloAlgo() {}
0050 
0051   // Run algorithm
0052   reco::EcalHaloData Calculate(const CaloGeometry& TheCaloGeometry,
0053                                edm::Handle<reco::PhotonCollection>& ThePhotons,
0054                                edm::Handle<reco::SuperClusterCollection>& TheSuperClusters,
0055                                edm::Handle<EBRecHitCollection>& TheEBRecHits,
0056                                edm::Handle<EERecHitCollection>& TheEERecHits,
0057                                edm::Handle<ESRecHitCollection>& TheESRecHits,
0058                                edm::Handle<HBHERecHitCollection>& TheHBHERecHits,
0059                                const edm::EventSetup& TheSetup);
0060   // Set Roundness cuts
0061   void SetRoundnessCut(float r = 100.) { RoundnessCut = r; }
0062   // Set Angle cuts
0063   void SetAngleCut(float a = 4.) { AngleCut = a; }
0064 
0065   // Set RecHit Energy Thresholds
0066   void SetRecHitEnergyThresholds(float EB, float EE, float ES) {
0067     EBRecHitEnergyThreshold = EB;
0068     EERecHitEnergyThreshold = EE;
0069     ESRecHitEnergyThreshold = ES;
0070   }
0071   // Set Phi Wedge Thresholds
0072   void SetPhiWedgeEnergyThreshold(float SumE) { SumEnergyThreshold = SumE; }
0073   void SetPhiWedgeNHitsThreshold(int nhits) { NHitsThreshold = nhits; }
0074   void SetPhiWedgeThresholds(float SumE, int nhits) {
0075     SumEnergyThreshold = SumE;
0076     NHitsThreshold = nhits;
0077   }
0078 
0079   std::vector<reco::HaloClusterCandidateECAL> GetHaloClusterCandidateEB(
0080       edm::Handle<EcalRecHitCollection>& ecalrechitcoll,
0081       edm::Handle<HBHERecHitCollection>& hbherechitcoll,
0082       float et_thresh_seedrh);
0083   std::vector<reco::HaloClusterCandidateECAL> GetHaloClusterCandidateEE(
0084       edm::Handle<EcalRecHitCollection>& ecalrechitcoll,
0085       edm::Handle<HBHERecHitCollection>& hbherechitcoll,
0086       float et_thresh_seedrh);
0087   bool EBClusterShapeandTimeStudy(reco::HaloClusterCandidateECAL hcand, bool ishlt);
0088   bool EEClusterShapeandTimeStudy_ITBH(reco::HaloClusterCandidateECAL hcand, bool ishlt);
0089   bool EEClusterShapeandTimeStudy_OTBH(reco::HaloClusterCandidateECAL hcand, bool ishlt);
0090 
0091   // Get Roundness cut
0092   float GetRoundnessCut() { return RoundnessCut; }
0093   // Get Angle cut
0094   float GetAngleCut() { return AngleCut; }
0095 
0096   // Get RecHit Energy Threshold
0097   float GetEBRecHitEnergyThreshold() { return EBRecHitEnergyThreshold; }
0098   float GetEERecHitEnergyThreshold() { return EERecHitEnergyThreshold; }
0099   float GetESRecHitEnergyThreshold() { return ESRecHitEnergyThreshold; }
0100 
0101   // Get Phi Wedge Threhsolds
0102   float GetPhiWedgeEnergyThreshold() { return SumEnergyThreshold; }
0103   int GetPhiWedgeNHitsThreshold() { return NHitsThreshold; }
0104 
0105 private:
0106   // Cut Value for Supercluster "roundness" variable
0107   float RoundnessCut;
0108   // Cut Value for Supercluster "angle" variable
0109   float AngleCut;
0110 
0111   // Invidiual RecHit Threhsolds
0112   float EBRecHitEnergyThreshold;
0113   float EERecHitEnergyThreshold;
0114   float ESRecHitEnergyThreshold;
0115 
0116   // Phi Wedge Thresholds
0117   float SumEnergyThreshold;
0118   int NHitsThreshold;
0119 
0120   edm::ESGetToken<CaloGeometry, CaloGeometryRecord> geoToken_;
0121   const CaloGeometry* geo;
0122   math::XYZPoint getPosition(const DetId& id, reco::Vertex::Point vtx);
0123 };
0124 
0125 #endif