Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:26:39

0001 #ifndef RECOMET_METALGORITHMS_CSCHALOALGO_H
0002 #define RECOMET_METALGORITHMS_CSCHALOALGO_H
0003 #include "DataFormats/METReco/interface/CSCHaloData.h"
0004 
0005 /*
0006   [class]:  CSCHaloAlgo
0007   [authors]: R. Remington, The University of Florida
0008   [description]: Algorithm to calculate quantities relevant to CSCHaloData object
0009   [date]: October 15, 2009
0010 */
0011 
0012 #include "CondFormats/CSCObjects/interface/CSCDBCrosstalk.h"
0013 #include "CondFormats/CSCObjects/interface/CSCDBGains.h"
0014 #include "CondFormats/CSCObjects/interface/CSCDBNoiseMatrix.h"
0015 #include "CondFormats/CSCObjects/interface/CSCDBPedestals.h"
0016 #include "CondFormats/DataRecord/interface/CSCDBCrosstalkRcd.h"
0017 #include "CondFormats/DataRecord/interface/CSCDBGainsRcd.h"
0018 #include "CondFormats/DataRecord/interface/CSCDBNoiseMatrixRcd.h"
0019 #include "CondFormats/DataRecord/interface/CSCDBPedestalsRcd.h"
0020 #include "DataFormats/CSCDigi/interface/CSCCorrelatedLCTDigiCollection.h"
0021 #include "DataFormats/CSCDigi/interface/CSCWireDigi.h"
0022 #include "DataFormats/CSCDigi/interface/CSCWireDigiCollection.h"
0023 #include "DataFormats/CSCDigi/interface/CSCStripDigi.h"
0024 #include "DataFormats/CSCDigi/interface/CSCStripDigiCollection.h"
0025 #include "DataFormats/CSCDigi/interface/CSCComparatorDigi.h"
0026 #include "DataFormats/CSCDigi/interface/CSCComparatorDigiCollection.h"
0027 #include "DataFormats/CSCDigi/interface/CSCALCTDigi.h"
0028 #include "DataFormats/CSCDigi/interface/CSCALCTDigiCollection.h"
0029 #include "DataFormats/CSCRecHit/interface/CSCRecHit2D.h"
0030 #include "DataFormats/CSCRecHit/interface/CSCSegmentCollection.h"
0031 #include "DataFormats/CSCRecHit/interface/CSCRecHit2DCollection.h"
0032 #include "DataFormats/CSCRecHit/interface/CSCSegment.h"
0033 #include "DataFormats/GeometrySurface/interface/Cylinder.h"
0034 #include "DataFormats/GeometrySurface/interface/Plane.h"
0035 #include "DataFormats/GeometrySurface/interface/Cone.h"
0036 #include "DataFormats/GeometryVector/interface/GlobalPoint.h"
0037 #include "DataFormats/GeometryVector/interface/GlobalVector.h"
0038 #include "DataFormats/GeometryVector/interface/LocalPoint.h"
0039 #include "DataFormats/GeometryVector/interface/LocalVector.h"
0040 #include "DataFormats/HcalRecHit/interface/HcalRecHitCollections.h"
0041 #include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h"
0042 #include "DataFormats/L1CSCTrackFinder/interface/L1CSCTrackCollection.h"
0043 #include "DataFormats/L1CSCTrackFinder/interface/L1CSCStatusDigiCollection.h"
0044 #include "DataFormats/L1GlobalMuonTrigger/interface/L1MuRegionalCand.h"
0045 #include "DataFormats/L1GlobalMuonTrigger/interface/L1MuGMTReadoutRecord.h"
0046 #include "DataFormats/L1GlobalMuonTrigger/interface/L1MuGMTReadoutCollection.h"
0047 #include "DataFormats/Math/interface/deltaPhi.h"
0048 #include "DataFormats/MuonDetId/interface/CSCIndexer.h"
0049 #include "DataFormats/MuonDetId/interface/CSCDetId.h"
0050 #include "DataFormats/MuonDetId/interface/RPCDetId.h"
0051 #include "DataFormats/MuonDetId/interface/DTWireId.h"
0052 #include "DataFormats/MuonReco/interface/MuonFwd.h"
0053 #include "DataFormats/MuonReco/interface/Muon.h"
0054 #include "DataFormats/MuonReco/interface/MuonTimeExtra.h"
0055 #include "DataFormats/MuonReco/interface/MuonTimeExtraMap.h"
0056 #include "DataFormats/TrackingRecHit/interface/RecSegment.h"
0057 #include "DataFormats/TrackerRecHit2D/interface/SiPixelRecHitCollection.h"
0058 #include "DataFormats/TrackerRecHit2D/interface/SiStripRecHit2DCollection.h"
0059 #include "DataFormats/TrackerRecHit2D/interface/SiStripMatchedRecHit2DCollection.h"
0060 #include "DataFormats/TrackReco/interface/TrackFwd.h"
0061 #include "DataFormats/TrackReco/interface/Track.h"
0062 #include "DataFormats/VertexReco/interface/Vertex.h"
0063 #include "DataFormats/TrajectorySeed/interface/TrajectorySeedCollection.h"
0064 #include "Geometry/CaloGeometry/interface/CaloGeometry.h"
0065 #include "Geometry/HcalTowerAlgo/interface/HcalGeometry.h"
0066 #include "Geometry/CSCGeometry/interface/CSCGeometry.h"
0067 #include "Geometry/CSCGeometry/interface/CSCChamber.h"
0068 #include "Geometry/CSCGeometry/interface/CSCLayer.h"
0069 #include "Geometry/CSCGeometry/interface/CSCLayerGeometry.h"
0070 #include "Geometry/Records/interface/CaloGeometryRecord.h"
0071 #include "L1Trigger/CSCTrackFinder/interface/CSCSectorReceiverLUT.h"
0072 #include "MagneticField/Records/interface/IdealMagneticFieldRecord.h"
0073 #include "MagneticField/Engine/interface/MagneticField.h"
0074 #include "RecoMuon/TrackingTools/interface/MuonServiceProxy.h"
0075 #include "RecoMuon/TrackingTools/interface/MuonPatternRecoDumper.h"
0076 #include "RecoMuon/TrackingTools/interface/MuonSegmentMatcher.h"
0077 #include "RecoMuon/TransientTrackingRecHit/interface/MuonTransientTrackingRecHitBuilder.h"
0078 #include "RecoMuon/TransientTrackingRecHit/interface/MuonTransientTrackingRecHit.h"
0079 #include "TrackingTools/GeomPropagators/interface/Propagator.h"
0080 #include "TrackingTools/GeomPropagators/interface/AnalyticalPropagator.h"
0081 #include "TrackPropagation/SteppingHelixPropagator/interface/SteppingHelixPropagator.h"
0082 #include "TrackingTools/TransientTrack/interface/TransientTrack.h"
0083 #include "DataFormats/Common/interface/TriggerResults.h"
0084 #include "FWCore/Framework/interface/Event.h"
0085 
0086 namespace edm {
0087   class TriggerNames;
0088 }
0089 
0090 class CSCHaloAlgo {
0091 public:
0092   CSCHaloAlgo(edm::ConsumesCollector iC);
0093   ~CSCHaloAlgo() {}
0094   reco::CSCHaloData Calculate(const CSCGeometry& TheCSCGeometry,
0095                               edm::Handle<reco::MuonCollection>& TheCosmicMuons,
0096                               const edm::Handle<reco::MuonTimeExtraMap> TheCSCTimeMap,
0097                               edm::Handle<reco::MuonCollection>& TheMuons,
0098                               edm::Handle<CSCSegmentCollection>& TheCSCSegments,
0099                               edm::Handle<CSCRecHit2DCollection>& TheCSCRecHits,
0100                               edm::Handle<L1MuGMTReadoutCollection>& TheL1GMTReadout,
0101                               edm::Handle<HBHERecHitCollection>& hbhehits,
0102                               edm::Handle<EcalRecHitCollection>& ecalebhits,
0103                               edm::Handle<EcalRecHitCollection>& ecaleehits,
0104                               edm::Handle<edm::TriggerResults>& TheHLTResults,
0105                               const edm::TriggerNames* triggerNames,
0106                               const edm::Handle<CSCALCTDigiCollection>& TheALCTs,
0107                               MuonSegmentMatcher* TheMatcher,
0108                               const edm::Event& TheEvent,
0109                               const edm::EventSetup& TheEventSetup);
0110 
0111   std::vector<edm::InputTag> vIT_HLTBit;
0112 
0113   void SetDetaThreshold(float x) { deta_threshold = x; }
0114   void SetMinMaxInnerRadius(float min, float max) {
0115     min_inner_radius = min;
0116     max_inner_radius = max;
0117   }
0118   void SetMinMaxOuterRadius(float min, float max) {
0119     min_outer_radius = min;
0120     max_outer_radius = max;
0121   }
0122   void SetDphiThreshold(float x) { dphi_threshold = x; }
0123   void SetNormChi2Threshold(float x) { norm_chi2_threshold = x; }
0124   void SetRecHitTime0(float x) { recHit_t0 = x; }
0125   void SetRecHitTimeWindow(float x) { recHit_twindow = x; }
0126   void SetExpectedBX(int x) { expected_BX = x; }
0127   void SetMinMaxOuterMomentumTheta(float min, float max) {
0128     min_outer_theta = min;
0129     max_outer_theta = max;
0130   }
0131   void SetMatchingDPhiThreshold(float x) { matching_dphi_threshold = x; }
0132   void SetMatchingDEtaThreshold(float x) { matching_deta_threshold = x; }
0133   void SetMatchingDWireThreshold(int x) { matching_dwire_threshold = x; }
0134   void SetMaxDtMuonSegment(float x) { max_dt_muon_segment = x; }
0135   void SetMaxFreeInverseBeta(float x) { max_free_inverse_beta = x; }
0136 
0137   // MLR
0138   void SetMaxSegmentRDiff(float x) { max_segment_r_diff = x; }
0139   void SetMaxSegmentPhiDiff(float x) { max_segment_phi_diff = x; }
0140   void SetMaxSegmentTheta(float x) { max_segment_theta = x; }
0141   // End MLR
0142 
0143 private:
0144   float deta_threshold;
0145   float max_outer_theta;
0146   float min_outer_theta;
0147   float min_inner_radius;
0148   float max_inner_radius;
0149   float min_outer_radius;
0150   float max_outer_radius;
0151   float dphi_threshold;
0152   float norm_chi2_threshold;
0153   float recHit_t0;
0154   float recHit_twindow;
0155   int expected_BX;
0156   float matching_dphi_threshold;
0157   float matching_deta_threshold;
0158   int matching_dwire_threshold;
0159   float max_dt_muon_segment;
0160   float max_free_inverse_beta;
0161   // MLR
0162   float max_segment_r_diff;
0163   float max_segment_phi_diff;
0164   float max_segment_theta;
0165   // End MLR
0166   float et_thresh_rh_hbhe, dphi_thresh_segvsrh_hbhe, dr_lowthresh_segvsrh_hbhe, dr_highthresh_segvsrh_hbhe,
0167       dt_lowthresh_segvsrh_hbhe, dt_highthresh_segvsrh_hbhe;
0168   float et_thresh_rh_eb, dphi_thresh_segvsrh_eb, dr_lowthresh_segvsrh_eb, dr_highthresh_segvsrh_eb,
0169       dt_lowthresh_segvsrh_eb, dt_highthresh_segvsrh_eb;
0170   float et_thresh_rh_ee, dphi_thresh_segvsrh_ee, dr_lowthresh_segvsrh_ee, dr_highthresh_segvsrh_ee,
0171       dt_lowthresh_segvsrh_ee, dt_highthresh_segvsrh_ee;
0172 
0173   edm::ESGetToken<CaloGeometry, CaloGeometryRecord> geoToken_;
0174   const CaloGeometry* geo_;
0175   const HcalGeometry* hgeo_;
0176   math::XYZPoint getPosition(const DetId& id, reco::Vertex::Point vtx);
0177   bool HCALSegmentMatching(edm::Handle<HBHERecHitCollection>& rechitcoll,
0178                            float et_thresh_rh,
0179                            float dphi_thresh_segvsrh,
0180                            float dr_lowthresh_segvsrh,
0181                            float dr_highthresh_segvsrh,
0182                            float dt_lowthresh_segvsrh,
0183                            float dt_highthresh_segvsrh,
0184                            float iZ,
0185                            float iR,
0186                            float iT,
0187                            float iPhi);
0188   bool ECALSegmentMatching(edm::Handle<EcalRecHitCollection>& rechitcoll,
0189                            float et_thresh_rh,
0190                            float dphi_thresh_segvsrh,
0191                            float dr_lowthresh_segvsrh,
0192                            float dr_highthresh_segvsrh,
0193                            float dt_lowthresh_segvsrh,
0194                            float dt_highthresh_segvsrh,
0195                            float iZ,
0196                            float iR,
0197                            float iT,
0198                            float iPhi);
0199 };
0200 
0201 #endif