Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2025-02-20 03:45:20

0001 #ifndef DataFormats_METReco_interface_PhiWedge_h
0002 #define DataFormats_METReco_interface_PhiWedge_h
0003 /*
0004   [class]:  PhiWedge
0005   [authors]: R. Remington, The University of Florida
0006   [description]: Simple class analogous to CaloTower but in z-direction.  Stores basic information related to Hcal and Ecal rechits within constant 5-degree phi windows.  The idea will be to match these reconstructed phi-wedges with csc tracks for BeamHalo identification.
0007   [date]: October 15, 2009
0008 */
0009 
0010 #include <vector>
0011 
0012 #include "TMath.h"
0013 
0014 namespace reco {
0015 
0016   class PhiWedge {
0017   public:
0018     // Constructors
0019     constexpr PhiWedge()
0020         : energy_{0.f},
0021           iphi_{0},
0022           constituents_{0},
0023           min_time_{0.f},
0024           max_time_{0.f},
0025           PlusZOriginConfidence_{0.f},
0026           OverlappingCSCTracks_{0},
0027           OverlappingCSCSegments_{0},
0028           OverlappingCSCRecHits_{0},
0029           OverlappingCSCHaloTriggers_{0} {}
0030 
0031     constexpr PhiWedge(float E, int iphi, int constituents)
0032         : energy_{E},
0033           iphi_{iphi},
0034           constituents_{constituents},
0035           min_time_{0.f},
0036           max_time_{0.f},
0037           PlusZOriginConfidence_{0.f},
0038           OverlappingCSCTracks_{0},
0039           OverlappingCSCSegments_{0},
0040           OverlappingCSCRecHits_{0},
0041           OverlappingCSCHaloTriggers_{0} {}
0042 
0043     constexpr PhiWedge(float E, int iphi, int constituents, float min_time, float max_time)
0044         : energy_{E},
0045           iphi_{iphi},
0046           constituents_{constituents},
0047           min_time_{min_time},
0048           max_time_{max_time},
0049           PlusZOriginConfidence_{0.f},
0050           OverlappingCSCTracks_{0},
0051           OverlappingCSCSegments_{0},
0052           OverlappingCSCRecHits_{0},
0053           OverlappingCSCHaloTriggers_{0} {}
0054 
0055     constexpr PhiWedge(PhiWedge const &) = default;
0056     constexpr PhiWedge(PhiWedge &&) = default;
0057 
0058     constexpr PhiWedge &operator=(PhiWedge const &) = default;
0059     constexpr PhiWedge &operator=(PhiWedge &&) = default;
0060 
0061     // Destructor
0062     constexpr ~PhiWedge() = default;
0063 
0064     // Energy sum of all rechits above threshold in this 5-degree window
0065     float Energy() const { return energy_; }
0066 
0067     // Number of rechits above threshold in this 5-degree window
0068     int NumberOfConstituents() const { return constituents_; }
0069 
0070     // iPhi value of this 5-degree window
0071     int iPhi() const { return iphi_; }
0072 
0073     // Global phi lower bound of this 5-degree window (between 0 and 2Pi)
0074     float PhiLow() const { return 2. * TMath::Pi() * (float)((iphi_ * 5) - (5.)); }
0075 
0076     // Global phi upper bound of this 5-degree window (between 0 and 2Pi
0077     float PhiHigh() const { return 2. * TMath::Pi() * (float)((iphi_ * 5)); }
0078 
0079     // Get Min/Max Time
0080     float MinTime() const { return min_time_; }
0081     float MaxTime() const { return max_time_; }
0082 
0083     // Get halo direction confidence based on time ordering of the rechits ( must be within range of -1 to + 1 )
0084     // Direction is calculated by counting the number of pair-wise time-ascending rechits from -Z to +Z and then normalizing this count by number of pair-wise combinations
0085     // If all pair-wise combinations are consistent with a common z-direction, then this value will be plus or minus 1 exactly.  Otherwise it will be somewhere in between.
0086     float ZDirectionConfidence() const { return (1. - PlusZOriginConfidence_) * 2. - 1.; }
0087     float PlusZDirectionConfidence() const { return 1. - PlusZOriginConfidence_; }
0088     float MinusZDirectionConfidence() const { return PlusZOriginConfidence_; }
0089 
0090     // Get halo origin confidence based on time ordering of the rechits
0091     float PlusZOriginConfidence() const { return PlusZOriginConfidence_; }
0092     float MinusZOriginConfidence() const { return 1. - PlusZOriginConfidence_; }
0093 
0094     // To be filled later or removed
0095     int OverlappingCSCTracks() const { return OverlappingCSCTracks_; }
0096     int OverlappingCSCSegments() const { return OverlappingCSCSegments_; }
0097     int OverlappingCSCRecHits() const { return OverlappingCSCRecHits_; }
0098     int OverlappingCSCHaloTriggers() const { return OverlappingCSCHaloTriggers_; }
0099 
0100     // Setters
0101     void SetOverlappingCSCTracks(int x) { OverlappingCSCTracks_ = x; }
0102     void SetOverlappingCSCSegments(int x) { OverlappingCSCSegments_ = x; }
0103     void SetOverlappingCSCRecHits(int x) { OverlappingCSCRecHits_ = x; }
0104     void SetOverlappingCSCHaloTriggers(int x) { OverlappingCSCHaloTriggers_ = x; }
0105     void SetMinMaxTime(float min, float max) {
0106       min_time_ = min;
0107       max_time_ = max;
0108     }
0109     void SetPlusZOriginConfidence(float x) { PlusZOriginConfidence_ = x; }
0110 
0111   private:
0112     float energy_;
0113     int iphi_;
0114     int constituents_;
0115     float min_time_;
0116     float max_time_;
0117     float PlusZOriginConfidence_;
0118     int OverlappingCSCTracks_;
0119     int OverlappingCSCSegments_;
0120     int OverlappingCSCRecHits_;
0121     int OverlappingCSCHaloTriggers_;
0122   };
0123 
0124   using PhiWedgeCollection = std::vector<PhiWedge>;
0125 
0126 }  // namespace reco
0127 
0128 #endif  // DataFormats_METReco_interface_PhiWedge_h