File indexing completed on 2024-04-06 12:04:45
0001 #include "DataFormats/METReco/interface/CSCHaloData.h"
0002
0003
0004
0005
0006
0007
0008
0009
0010 using namespace reco;
0011 CSCHaloData::CSCHaloData() {
0012 nTriggers_PlusZ = 0;
0013 nTriggers_MinusZ = 0;
0014 nTracks_PlusZ = 0;
0015 nTracks_MinusZ = 0;
0016 HLTAccept = false;
0017
0018 nOutOfTimeTriggers_PlusZ = 0;
0019 nOutOfTimeTriggers_MinusZ = 0;
0020 nOutOfTimeHits = 0;
0021
0022 nTracks_Small_dT = 0;
0023 nTracks_Small_beta = 0;
0024 nTracks_Small_dT_Small_beta = 0;
0025
0026
0027 nFlatHaloSegments = 0;
0028
0029
0030 nTriggers_PlusZ_TrkMuUnVeto = 0;
0031 nTriggers_MinusZ_TrkMuUnVeto = 0;
0032 HLTAccept = false;
0033
0034 segments_in_both_endcaps = false;
0035 nFlatHaloSegments_TrkMuUnVeto = 0;
0036 segments_in_both_endcaps_loose_TrkMuUnVeto = false;
0037 segments_in_both_endcaps_loose_dtcut_TrkMuUnVeto = false;
0038 segmentiscalomatched = false;
0039 segmentisHcalomatched = false;
0040 segmentisEBcalomatched = false;
0041 segmentisEEcalomatched = false;
0042 }
0043
0044 int CSCHaloData::NumberOfHaloTriggers(HaloData::Endcap z) const {
0045 if (z == HaloData::plus)
0046 return nTriggers_PlusZ;
0047 else if (z == HaloData::minus)
0048 return nTriggers_MinusZ;
0049 else
0050 return nTriggers_MinusZ + nTriggers_PlusZ;
0051 }
0052
0053 int CSCHaloData::NumberOfHaloTriggers_TrkMuUnVeto(HaloData::Endcap z) const {
0054 if (z == HaloData::plus)
0055 return nTriggers_PlusZ_TrkMuUnVeto;
0056 else if (z == HaloData::minus)
0057 return nTriggers_MinusZ_TrkMuUnVeto;
0058 else
0059 return nTriggers_MinusZ_TrkMuUnVeto + nTriggers_PlusZ_TrkMuUnVeto;
0060 }
0061
0062 short int CSCHaloData::NumberOfOutOfTimeTriggers(HaloData::Endcap z) const {
0063 if (z == HaloData::plus)
0064 return nOutOfTimeTriggers_PlusZ;
0065 else if (z == HaloData::minus)
0066 return nOutOfTimeTriggers_MinusZ;
0067 else
0068 return nOutOfTimeTriggers_PlusZ + nOutOfTimeTriggers_MinusZ;
0069 }
0070
0071 int CSCHaloData::NumberOfHaloTracks(HaloData::Endcap z) const {
0072 int n = 0;
0073 for (unsigned int i = 0; i < TheTrackRefs.size(); i++) {
0074 edm::Ref<reco::TrackCollection> iTrack(TheTrackRefs[i]);
0075
0076 bool Traversing = (iTrack->outerPosition().z() > 0 && iTrack->innerPosition().z() < 0) ||
0077 (iTrack->outerPosition().z() < 0 && iTrack->innerPosition().z() > 0);
0078
0079 bool PlusZ = (iTrack->outerPosition().z() > 0 && iTrack->innerPosition().z() > 0);
0080
0081 bool MinusZ = (iTrack->outerPosition().z() < 0 && iTrack->innerPosition().z() < 0);
0082
0083 if ((z == HaloData::plus) && (PlusZ || Traversing))
0084 n++;
0085 else if ((z == HaloData::minus) && (MinusZ || Traversing))
0086 n++;
0087 else if ((z == HaloData::both) && (PlusZ || MinusZ || Traversing))
0088 n++;
0089 }
0090 return n;
0091 }