Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:54:07

0001 #ifndef DATAFORMATS_METRECO_PHIWEDGE_H
0002 #define DATAFORMATS_METRECO_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 #include "TMath.h"
0010 #include <vector>
0011 namespace reco {
0012 
0013   class PhiWedge {
0014   public:
0015     // Constructors
0016     PhiWedge();
0017     PhiWedge(float E, int iphi, int constituents);
0018     PhiWedge(float E, int iphi, int constituents, float min_time, float max_time);
0019     PhiWedge(const PhiWedge&);
0020     // Destructors
0021 
0022     ~PhiWedge() {}
0023 
0024     // Energy sum of all rechits above threshold in this 5-degree window
0025     float Energy() const { return energy_; }
0026 
0027     // Number of rechits above threshold in this 5-degree window
0028     int NumberOfConstituents() const { return constituents_; }
0029 
0030     // iPhi value of this 5-degree window
0031     int iPhi() const { return iphi_; }
0032 
0033     // Global phi lower bound of this 5-degree window (between 0 and 2Pi)
0034     float PhiLow() const { return 2. * TMath::Pi() * (float)((iphi_ * 5) - (5.)); }
0035 
0036     // Global phi upper bound of this 5-degree window (between 0 and 2Pi
0037     float PhiHigh() const { return 2. * TMath::Pi() * (float)((iphi_ * 5)); }
0038 
0039     // Get Min/Max Time
0040     float MinTime() const { return min_time_; }
0041     float MaxTime() const { return max_time_; }
0042 
0043     // Get halo direction confidence based on time ordering of the rechits ( must be within range of -1 to + 1 )
0044     // 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
0045     // 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.
0046     float ZDirectionConfidence() const { return (1. - PlusZOriginConfidence_) * 2. - 1.; }
0047     float PlusZDirectionConfidence() const { return 1. - PlusZOriginConfidence_; }
0048     float MinusZDirectionConfidence() const { return PlusZOriginConfidence_; }
0049 
0050     // Get halo origin confidence based on time ordering of the rechits
0051     float PlusZOriginConfidence() const { return PlusZOriginConfidence_; }
0052     float MinusZOriginConfidence() const { return 1. - PlusZOriginConfidence_; }
0053 
0054     // To be filled later or removed
0055     int OverlappingCSCTracks() const { return OverlappingCSCTracks_; }
0056     int OverlappingCSCSegments() const { return OverlappingCSCSegments_; }
0057     int OverlappingCSCRecHits() const { return OverlappingCSCRecHits_; }
0058     int OverlappingCSCHaloTriggers() const { return OverlappingCSCHaloTriggers_; }
0059 
0060     // Setters
0061     void SetOverlappingCSCTracks(int x) { OverlappingCSCTracks_ = x; }
0062     void SetOverlappingCSCSegments(int x) { OverlappingCSCSegments_ = x; }
0063     void SetOverlappingCSCRecHits(int x) { OverlappingCSCRecHits_ = x; }
0064     void SetOverlappingCSCHaloTriggers(int x) { OverlappingCSCHaloTriggers_ = x; }
0065     void SetMinMaxTime(float min, float max) {
0066       min_time_ = min;
0067       max_time_ = max;
0068     }
0069     void SetPlusZOriginConfidence(float x) { PlusZOriginConfidence_ = x; }
0070 
0071   private:
0072     float energy_;
0073     int iphi_;
0074     int constituents_;
0075     float min_time_;
0076     float max_time_;
0077     float PlusZOriginConfidence_;
0078     int OverlappingCSCTracks_;
0079     int OverlappingCSCSegments_;
0080     int OverlappingCSCRecHits_;
0081     int OverlappingCSCHaloTriggers_;
0082   };
0083   typedef std::vector<PhiWedge> PhiWedgeCollection;
0084 }  // namespace reco
0085 #endif