CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_1/src/DataFormats/METReco/src/CSCHaloData.cc

Go to the documentation of this file.
00001 #include "DataFormats/METReco/interface/CSCHaloData.h"
00002 
00003 /*
00004   [class]:  CSCHaloData
00005   [authors]: R. Remington, The University of Florida
00006   [description]: See CSCHaloData.h 
00007   [date]: October 15, 2009
00008 */
00009 
00010 using namespace reco;
00011 CSCHaloData::CSCHaloData()
00012 {
00013   nTriggers_PlusZ = 0;
00014   nTriggers_MinusZ = 0 ;
00015   nTracks_PlusZ = 0 ;
00016   nTracks_MinusZ = 0;
00017   HLTAccept=false;
00018 
00019   nOutOfTimeTriggers_PlusZ=0;
00020   nOutOfTimeTriggers_MinusZ=0;
00021   nOutOfTimeHits = 0 ;
00022 
00023   nTracks_Small_dT = 0;
00024   nTracks_Small_beta =0;
00025   nTracks_Small_dT_Small_beta = 0;
00026 
00027   // MLR
00028   nFlatHaloSegments = 0;
00029   // End MLR
00030 }
00031 
00032 int CSCHaloData::NumberOfHaloTriggers(HaloData::Endcap z) const
00033 {
00034   if( z == HaloData::plus )
00035     return nTriggers_PlusZ;
00036   else if( z == HaloData::minus )
00037     return nTriggers_MinusZ;
00038   else 
00039     return nTriggers_MinusZ + nTriggers_PlusZ;
00040 }
00041 
00042 short int CSCHaloData::NumberOfOutOfTimeTriggers(HaloData::Endcap z ) const
00043 {
00044   if( z == HaloData::plus  ) 
00045     return nOutOfTimeTriggers_PlusZ;
00046   else if( z == HaloData::minus ) 
00047     return nOutOfTimeTriggers_MinusZ;
00048   else
00049     return nOutOfTimeTriggers_PlusZ+nOutOfTimeTriggers_MinusZ;
00050 }
00051 
00052 int CSCHaloData::NumberOfHaloTracks(HaloData::Endcap z) const 
00053 {
00054   int n = 0 ;
00055   for(unsigned int i = 0 ; i < TheTrackRefs.size() ; i++ )
00056     {
00057       edm::Ref<reco::TrackCollection> iTrack( TheTrackRefs, i ) ;
00058       // Does the track go through both endcaps ? 
00059       bool Traversing =  (iTrack->outerPosition().z() > 0 &&  iTrack->innerPosition().z() < 0) ||  (iTrack->outerPosition().z() < 0 &&  iTrack->innerPosition().z() > 0);
00060       // Does the track go through only +Z endcap ?
00061       bool PlusZ =  (iTrack->outerPosition().z() > 0 && iTrack->innerPosition().z() > 0 ) ;
00062       // Does the track go through only -Z endcap ? 
00063       bool MinusZ = (iTrack->outerPosition().z()< 0 && iTrack->innerPosition().z() < 0) ;
00064 
00065       if( (z == HaloData::plus) && ( PlusZ || Traversing) ) 
00066         n++;
00067       else if( (z == HaloData::minus) && ( MinusZ || Traversing ) )
00068         n++;
00069       else if( (z == HaloData::both) && (PlusZ || MinusZ || Traversing) ) 
00070         n++ ;
00071     }
00072   return n;
00073 }