Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef DATAFORMATS_METRECO_CSCHALODATA_H
0002 #define DATAFORMATS_METRECO_CSCHALODATA_H
0003 #include "TMath.h"
0004 #include <vector>
0005 
0006 #include "DataFormats/TrackReco/interface/TrackFwd.h"
0007 #include "DataFormats/TrackReco/interface/Track.h"
0008 #include "DataFormats/GeometryVector/interface/GlobalPoint.h"
0009 
0010 #include "DataFormats/METReco/interface/HaloData.h"
0011 
0012 #include "DataFormats/Common/interface/RefVector.h"
0013 #include <vector>
0014 
0015 /*
0016   [class]:  CSCHaloData
0017   [authors]: R. Remington, The University of Florida
0018   [description]: Container class to store beam halo data specific to the CSC subdetector
0019   [date]: October 15, 2009
0020 */
0021 
0022 namespace reco {
0023 
0024   class CSCHaloData {
0025   public:
0026     // Default constructor
0027     CSCHaloData();
0028 
0029     virtual ~CSCHaloData() {}
0030 
0031     // Number of HaloTriggers in +/- endcap
0032     int NumberOfHaloTriggers(HaloData::Endcap z = HaloData::both) const;
0033     int NumberOfHaloTriggers_TrkMuUnVeto(HaloData::Endcap z = HaloData::both) const;
0034     int NHaloTriggers(HaloData::Endcap z = HaloData::both) const { return NumberOfHaloTriggers(z); }
0035 
0036     // Number of Halo Tracks in +/-  endcap
0037     int NumberOfHaloTracks(HaloData::Endcap z = HaloData::both) const;
0038     int NHaloTracks(HaloData::Endcap z = HaloData::both) const { return NumberOfHaloTracks(z); }
0039 
0040     // Halo trigger bit from the HLT
0041     bool CSCHaloHLTAccept() const { return HLTAccept; }
0042 
0043     // Number of chamber-level triggers with non-collision timing
0044     short int NumberOfOutOfTimeTriggers(HaloData::Endcap z = HaloData::both) const;
0045     short int NOutOfTimeTriggers(HaloData::Endcap z = HaloData::both) const { return NumberOfOutOfTimeTriggers(z); }
0046     // Number of CSCRecHits with non-collision timing
0047     short int NumberOfOutTimeHits() const { return nOutOfTimeHits; }
0048     short int NOutOfTimeHits() const { return nOutOfTimeHits; }
0049     // Look at number of muons with timing consistent with incoming particles
0050     short int NTracksSmalldT() const { return nTracks_Small_dT; }
0051     short int NTracksSmallBeta() const { return nTracks_Small_beta; }
0052     short int NTracksSmallBetaAndSmalldT() const { return nTracks_Small_dT_Small_beta; }
0053 
0054     // MLR
0055     short int NFlatHaloSegments() const { return nFlatHaloSegments; }
0056     bool GetSegmentsInBothEndcaps() const { return segments_in_both_endcaps; }
0057     bool GetSegmentIsCaloMatched() const { return segmentiscalomatched; }
0058     bool GetSegmentIsHCaloMatched() const { return segmentisHcalomatched; }
0059     bool GetSegmentIsEBCaloMatched() const { return segmentisEBcalomatched; }
0060     bool GetSegmentIsEECaloMatched() const { return segmentisEEcalomatched; }
0061     // End MLR
0062     short int NFlatHaloSegments_TrkMuUnVeto() const { return nFlatHaloSegments_TrkMuUnVeto; }
0063     bool GetSegmentsInBothEndcaps_Loose_TrkMuUnVeto() const { return segments_in_both_endcaps_loose_TrkMuUnVeto; }
0064     bool GetSegmentsInBothEndcaps_Loose_dTcut_TrkMuUnVeto() const {
0065       return segments_in_both_endcaps_loose_dtcut_TrkMuUnVeto;
0066     }
0067 
0068     // Get Reference to the Tracks
0069     edm::RefVector<reco::TrackCollection>& GetTracks() { return TheTrackRefs; }
0070     const edm::RefVector<reco::TrackCollection>& GetTracks() const { return TheTrackRefs; }
0071 
0072     // Set Number of Halo Triggers
0073     void SetNumberOfHaloTriggers(int PlusZ, int MinusZ) {
0074       nTriggers_PlusZ = PlusZ;
0075       nTriggers_MinusZ = MinusZ;
0076     }
0077     void SetNumberOfHaloTriggers_TrkMuUnVeto(int PlusZ, int MinusZ) {
0078       nTriggers_PlusZ_TrkMuUnVeto = PlusZ;
0079       nTriggers_MinusZ_TrkMuUnVeto = MinusZ;
0080     }
0081     // Set number of chamber-level triggers with non-collision timing
0082     void SetNOutOfTimeTriggers(short int PlusZ, short int MinusZ) {
0083       nOutOfTimeTriggers_PlusZ = PlusZ;
0084       nOutOfTimeTriggers_MinusZ = MinusZ;
0085     }
0086     // Set number of CSCRecHits with non-collision timing
0087     void SetNOutOfTimeHits(short int num) { nOutOfTimeHits = num; }
0088     // Set number of tracks with timing consistent with incoming particles
0089     void SetNIncomingTracks(short int n_small_dT, short int n_small_beta, short int n_small_both) {
0090       nTracks_Small_dT = n_small_dT;
0091       nTracks_Small_beta = n_small_beta;
0092       nTracks_Small_dT_Small_beta = n_small_both;
0093     }
0094 
0095     // Set HLT Bit
0096     void SetHLTBit(bool status) { HLTAccept = status; }
0097 
0098     // Get GlobalPoints of CSC tracking rechits nearest to the calorimeters
0099     //std::vector<const GlobalPoint>& GetCSCTrackImpactPositions() const {return TheGlobalPositions;}
0100     const std::vector<GlobalPoint>& GetCSCTrackImpactPositions() const { return TheGlobalPositions; }
0101     std::vector<GlobalPoint>& GetCSCTrackImpactPositions() { return TheGlobalPositions; }
0102 
0103     // MLR
0104     // Set # of CSCSegments that appear to be part of a halo muon
0105     // If there is more than 1 muon, this is the number of segments in the halo muon
0106     // with the largest number of segments that pass the cut.
0107     void SetNFlatHaloSegments(short int nSegments) { nFlatHaloSegments = nSegments; }
0108     void SetSegmentsBothEndcaps(bool b) { segments_in_both_endcaps = b; }
0109     // End MLR
0110     void SetNFlatHaloSegments_TrkMuUnVeto(short int nSegments) { nFlatHaloSegments_TrkMuUnVeto = nSegments; }
0111     void SetSegmentsBothEndcaps_Loose_TrkMuUnVeto(bool b) { segments_in_both_endcaps_loose_TrkMuUnVeto = b; }
0112     void SetSegmentsBothEndcaps_Loose_dTcut_TrkMuUnVeto(bool b) {
0113       segments_in_both_endcaps_loose_dtcut_TrkMuUnVeto = b;
0114     }
0115     void SetSegmentIsCaloMatched(bool b) { segmentiscalomatched = b; }
0116     void SetSegmentIsHCaloMatched(bool b) { segmentisHcalomatched = b; }
0117     void SetSegmentIsEBCaloMatched(bool b) { segmentisEBcalomatched = b; }
0118     void SetSegmentIsEECaloMatched(bool b) { segmentisEEcalomatched = b; }
0119 
0120   private:
0121     edm::RefVector<reco::TrackCollection> TheTrackRefs;
0122 
0123     // The GlobalPoints from constituent rechits nearest to the calorimeter of CSC tracks
0124     std::vector<GlobalPoint> TheGlobalPositions;
0125     int nTriggers_PlusZ;
0126     int nTriggers_MinusZ;
0127     int nTriggers_PlusZ_TrkMuUnVeto;
0128     int nTriggers_MinusZ_TrkMuUnVeto;
0129     // CSC halo trigger reported by the HLT
0130     bool HLTAccept;
0131 
0132     int nTracks_PlusZ;
0133     int nTracks_MinusZ;
0134 
0135     // number of  out-of-time chamber-level triggers (assumes the event triggered at the bx of the beam crossing)
0136     short int nOutOfTimeTriggers_PlusZ;
0137     short int nOutOfTimeTriggers_MinusZ;
0138     // number of out-of-time CSCRecHit2Ds (assumes the event triggered at the bx of the beam crossing)
0139     short int nOutOfTimeHits;
0140     // number of cosmic muon outer (CSC) tracks with (T_segment_outer - T_segment_inner) < max_dt_muon_segment
0141     short int nTracks_Small_dT;
0142     // number of cosmic muon outer (CSC) tracks with free inverse beta < max_free_inverse_beta
0143     short int nTracks_Small_beta;
0144     // number of cosmic muon outer (CSC) tracks with both
0145     // (T_segment_outer - T_segment_inner) <  max_dt_muon_segment and free inverse beta < max_free_inverse_beta
0146     short int nTracks_Small_dT_Small_beta;
0147 
0148     // MLR
0149     // number of CSCSegments that are flat and have the same (r,phi)
0150     short int nFlatHaloSegments;
0151     bool segments_in_both_endcaps;
0152     // end MLR
0153     short int nFlatHaloSegments_TrkMuUnVeto;
0154     bool segments_in_both_endcaps_loose_TrkMuUnVeto;
0155     bool segments_in_both_endcaps_loose_dtcut_TrkMuUnVeto;
0156     bool segmentiscalomatched;
0157     bool segmentisHcalomatched;
0158     bool segmentisEBcalomatched;
0159     bool segmentisEEcalomatched;
0160   };
0161 
0162 }  // namespace reco
0163 
0164 #endif