Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef RECOMET_METALGORITHMS_GLOBALHALOALGO_H
0002 #define RECOMET_METALGORITHMS_GLOBALHALOALGO_H
0003 
0004 /*
0005   [class]:  GlobalHaloAlgo
0006   [authors]: R. Remington, The University of Florida
0007   [description]: Algorithm to calculate quantities relevant to GlobalHaloData object
0008   [date]: October 15, 2009
0009 */
0010 
0011 #include "DataFormats/METReco/interface/EcalHaloData.h"
0012 #include "DataFormats/METReco/interface/HcalHaloData.h"
0013 #include "DataFormats/METReco/interface/CSCHaloData.h"
0014 #include "DataFormats/METReco/interface/GlobalHaloData.h"
0015 #include "DataFormats/Math/interface/LorentzVector.h"
0016 #include "DataFormats/METReco/interface/CaloMET.h"
0017 #include "DataFormats/METReco/interface/CaloMETFwd.h"
0018 #include "DataFormats/METReco/interface/MET.h"
0019 #include "DataFormats/METReco/interface/METFwd.h"
0020 #include "DataFormats/CSCRecHit/interface/CSCRecHit2D.h"
0021 #include "DataFormats/CSCRecHit/interface/CSCRecHit2DCollection.h"
0022 #include "DataFormats/CSCRecHit/interface/CSCSegment.h"
0023 #include "DataFormats/CSCRecHit/interface/CSCSegmentCollection.h"
0024 #include "DataFormats/EcalDetId/interface/EcalSubdetector.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/EcalDigi/interface/ESDataFrame.h"
0029 #include "DataFormats/EcalDigi/interface/EEDataFrame.h"
0030 #include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h"
0031 #include "DataFormats/EcalRecHit/interface/EcalRecHit.h"
0032 #include "DataFormats/HcalDetId/interface/HcalDetId.h"
0033 #include "DataFormats/HcalDetId/interface/HcalSubdetector.h"
0034 #include "DataFormats/HcalRecHit/interface/HBHERecHit.h"
0035 #include "DataFormats/HcalRecHit/interface/HFRecHit.h"
0036 #include "DataFormats/HcalRecHit/interface/HORecHit.h"
0037 #include "DataFormats/HcalRecHit/interface/HcalRecHitCollections.h"
0038 #include "DataFormats/EgammaCandidates/interface/Photon.h"
0039 #include "DataFormats/EgammaCandidates/interface/PhotonFwd.h"
0040 #include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h"
0041 #include "Geometry/CaloGeometry/interface/CaloGeometry.h"
0042 #include "Geometry/CaloGeometry/interface/CaloCellGeometry.h"
0043 #include "Geometry/Records/interface/CaloGeometryRecord.h"
0044 #include "Geometry/CSCGeometry/interface/CSCGeometry.h"
0045 #include "Geometry/CSCGeometry/interface/CSCChamber.h"
0046 #include "Geometry/CSCGeometry/interface/CSCLayer.h"
0047 #include "Geometry/CSCGeometry/interface/CSCLayerGeometry.h"
0048 #include "DataFormats/CaloTowers/interface/CaloTowerDetId.h"
0049 #include "DataFormats/CaloTowers/interface/CaloTowerDefs.h"
0050 #include "DataFormats/CaloTowers/interface/CaloTower.h"
0051 
0052 #include "DataFormats/GeometryVector/interface/GlobalPoint.h"
0053 #include "DataFormats/GeometryVector/interface/GlobalVector.h"
0054 #include "DataFormats/GeometryVector/interface/LocalPoint.h"
0055 #include "DataFormats/GeometryVector/interface/LocalVector.h"
0056 
0057 #include "DataFormats/MuonReco/interface/MuonFwd.h"
0058 #include "DataFormats/MuonReco/interface/Muon.h"
0059 
0060 class GlobalHaloAlgo {
0061 public:
0062   // Constructor
0063   GlobalHaloAlgo();
0064   // Destructor
0065   ~GlobalHaloAlgo() {}
0066 
0067   // run algorithm
0068   reco::GlobalHaloData Calculate(const CaloGeometry& TheCaloGeometry,
0069                                  const CSCGeometry& TheCSCGeometry,
0070                                  const reco::CaloMET& TheCaloMET,
0071                                  edm::Handle<edm::View<reco::Candidate> >& TheCaloTowers,
0072                                  edm::Handle<CSCSegmentCollection>& TheCSCSegments,
0073                                  edm::Handle<CSCRecHit2DCollection>& TheCSCRecHits,
0074                                  edm::Handle<reco::MuonCollection>& TheMuons,
0075                                  const reco::CSCHaloData& TheCSCHaloData,
0076                                  const reco::EcalHaloData& TheEcalHaloData,
0077                                  const reco::HcalHaloData& TheHcalHaloData,
0078                                  bool ishlt = false);
0079 
0080   // Set min & max radius to associate CSC Rechits with Ecal Phi Wedges
0081   void SetEcalMatchingRadius(float min, float max) {
0082     Ecal_R_Min = min;
0083     Ecal_R_Max = max;
0084   }
0085   // Set min & max radius to associate CSC Rechits with Hcal Phi Wedges
0086   void SetHcalMatchingRadius(float min, float max) {
0087     Hcal_R_Min = min;
0088     Hcal_R_Max = max;
0089   }
0090   // Set CaloTowerEtTheshold
0091   void SetCaloTowerEtThreshold(float EtMin) { TowerEtThreshold = EtMin; }
0092   // run algorithm
0093 
0094   //CSC-Calo matching parameters:
0095   void SetMaxSegmentTheta(float x) { max_segment_theta = x; }
0096   //EB
0097   void setEtThresholdforCSCCaloMatchingEB(float x) { et_thresh_rh_eb = x; }
0098   void setRcaloMinRsegmLowThresholdforCSCCaloMatchingEB(float x) { dr_lowthresh_segvsrh_eb = x; }
0099   void setRcaloMinRsegmHighThresholdforCSCCaloMatchingEB(float x) { dr_highthresh_segvsrh_eb = x; }
0100   void setDtcalosegmThresholdforCSCCaloMatchingEB(float x) { dt_segvsrh_eb = x; }
0101   void setDPhicalosegmThresholdforCSCCaloMatchingEB(float x) { dphi_thresh_segvsrh_eb = x; }
0102   //EE
0103   void setEtThresholdforCSCCaloMatchingEE(float x) { et_thresh_rh_ee = x; }
0104   void setRcaloMinRsegmLowThresholdforCSCCaloMatchingEE(float x) { dr_lowthresh_segvsrh_ee = x; }
0105   void setRcaloMinRsegmHighThresholdforCSCCaloMatchingEE(float x) { dr_highthresh_segvsrh_ee = x; }
0106   void setDtcalosegmThresholdforCSCCaloMatchingEE(float x) { dt_segvsrh_ee = x; }
0107   void setDPhicalosegmThresholdforCSCCaloMatchingEE(float x) { dphi_thresh_segvsrh_ee = x; }
0108   //HB
0109   void setEtThresholdforCSCCaloMatchingHB(float x) { et_thresh_rh_hb = x; }
0110   void setRcaloMinRsegmLowThresholdforCSCCaloMatchingHB(float x) { dr_lowthresh_segvsrh_hb = x; }
0111   void setRcaloMinRsegmHighThresholdforCSCCaloMatchingHB(float x) { dr_highthresh_segvsrh_hb = x; }
0112   void setDtcalosegmThresholdforCSCCaloMatchingHB(float x) { dt_segvsrh_hb = x; }
0113   void setDPhicalosegmThresholdforCSCCaloMatchingHB(float x) { dphi_thresh_segvsrh_hb = x; }
0114   //HE
0115   void setEtThresholdforCSCCaloMatchingHE(float x) { et_thresh_rh_he = x; }
0116   void setRcaloMinRsegmLowThresholdforCSCCaloMatchingHE(float x) { dr_lowthresh_segvsrh_he = x; }
0117   void setRcaloMinRsegmHighThresholdforCSCCaloMatchingHE(float x) { dr_highthresh_segvsrh_he = x; }
0118   void setDtcalosegmThresholdforCSCCaloMatchingHE(float x) { dt_segvsrh_he = x; }
0119   void setDPhicalosegmThresholdforCSCCaloMatchingHE(float x) { dphi_thresh_segvsrh_he = x; }
0120 
0121 private:
0122   float Ecal_R_Min;
0123   float Ecal_R_Max;
0124   float Hcal_R_Min;
0125   float Hcal_R_Max;
0126   float TowerEtThreshold;
0127 
0128   //Parameters for CSC-calo matching
0129   float max_segment_theta;
0130 
0131   float et_thresh_rh_eb;
0132   float dphi_thresh_segvsrh_eb;
0133   float dr_lowthresh_segvsrh_eb;
0134   float dr_highthresh_segvsrh_eb;
0135   float dt_segvsrh_eb;
0136 
0137   float et_thresh_rh_ee;
0138   float dphi_thresh_segvsrh_ee;
0139   float dr_lowthresh_segvsrh_ee;
0140   float dr_highthresh_segvsrh_ee;
0141   float dt_segvsrh_ee;
0142 
0143   float et_thresh_rh_hb;
0144   float dphi_thresh_segvsrh_hb;
0145   float dr_lowthresh_segvsrh_hb;
0146   float dr_highthresh_segvsrh_hb;
0147   float dt_segvsrh_hb;
0148 
0149   float et_thresh_rh_he;
0150   float dphi_thresh_segvsrh_he;
0151   float dr_lowthresh_segvsrh_he;
0152   float dr_highthresh_segvsrh_he;
0153   float dt_segvsrh_he;
0154 
0155   void AddtoBeamHaloEBEERechits(edm::RefVector<EcalRecHitCollection>& bhtaggedrechits,
0156                                 reco::GlobalHaloData& thehalodata,
0157                                 bool isbarrel);
0158   void AddtoBeamHaloHBHERechits(edm::RefVector<HBHERecHitCollection>& bhtaggedrechits,
0159                                 reco::GlobalHaloData& thehalodata);
0160   bool SegmentMatchingEB(reco::GlobalHaloData& thehalodata,
0161                          const std::vector<reco::HaloClusterCandidateECAL>& haloclustercands,
0162                          float iZ,
0163                          float iR,
0164                          float iT,
0165                          float iPhi,
0166                          bool ishlt);
0167   bool SegmentMatchingEE(reco::GlobalHaloData& thehalodata,
0168                          const std::vector<reco::HaloClusterCandidateECAL>& haloclustercands,
0169                          float iZ,
0170                          float iR,
0171                          float iT,
0172                          float iPhi,
0173                          bool ishlt);
0174   bool SegmentMatchingHB(reco::GlobalHaloData& thehalodata,
0175                          const std::vector<reco::HaloClusterCandidateHCAL>& haloclustercands,
0176                          float iZ,
0177                          float iR,
0178                          float iT,
0179                          float iPhi,
0180                          bool ishlt);
0181   bool SegmentMatchingHE(reco::GlobalHaloData& thehalodata,
0182                          const std::vector<reco::HaloClusterCandidateHCAL>& haloclustercands,
0183                          float iZ,
0184                          float iR,
0185                          float iT,
0186                          float iPhi,
0187                          bool ishlt);
0188   bool ApplyMatchingCuts(int subdet,
0189                          bool ishlt,
0190                          double rhet,
0191                          double segZ,
0192                          double rhZ,
0193                          double segR,
0194                          double rhR,
0195                          double segT,
0196                          double rhT,
0197                          double segPhi,
0198                          double rhPhi);
0199 };
0200 
0201 #endif