CMS 3D CMS Logo

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/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 
00011 
00012 
00013 using namespace reco;
00014 CSCHaloData::CSCHaloData()
00015 {
00016   nTriggers_PlusZ = 0;
00017   nTriggers_MinusZ = 0 ;
00018   nTracks_PlusZ = 0 ;
00019   nTracks_MinusZ = 0;
00020   HLTAccept=false;
00021 
00022   nOutOfTimeTriggers_PlusZ=0;
00023   nOutOfTimeTriggers_MinusZ=0;
00024   nOutOfTimeHits = 0 ;
00025 }
00026 
00027 int CSCHaloData::NumberOfHaloTriggers(HaloData::Endcap z) const
00028 {
00029   if( z == HaloData::plus )
00030     return nTriggers_PlusZ;
00031   else if( z == HaloData::minus )
00032     return nTriggers_MinusZ;
00033   else 
00034     return nTriggers_MinusZ + nTriggers_PlusZ;
00035 }
00036 
00037 short int CSCHaloData::NumberOfOutOfTimeTriggers(HaloData::Endcap z ) const
00038 {
00039   if( z == HaloData::plus  ) 
00040     return nOutOfTimeTriggers_PlusZ;
00041   else if( z == HaloData::minus ) 
00042     return nOutOfTimeTriggers_MinusZ;
00043   else
00044     return nOutOfTimeTriggers_PlusZ+nOutOfTimeTriggers_MinusZ;
00045 }
00046 
00047 int CSCHaloData::NumberOfHaloTracks(HaloData::Endcap z) const 
00048 {
00049   int n = 0 ;
00050   for(unsigned int i = 0 ; i < TheTrackRefs.size() ; i++ )
00051     {
00052       edm::Ref<reco::TrackCollection> iTrack( TheTrackRefs, i ) ;
00053       // Does the track go through both endcaps ? 
00054       bool Traversing =  (iTrack->outerPosition().z() > 0 &&  iTrack->innerPosition().z() < 0) ||  (iTrack->outerPosition().z() < 0 &&  iTrack->innerPosition().z() > 0);
00055       // Does the track go through only +Z endcap ?
00056       bool PlusZ =  (iTrack->outerPosition().z() > 0 && iTrack->innerPosition().z() > 0 ) ;
00057       // Does the track go through only -Z endcap ? 
00058       bool MinusZ = (iTrack->outerPosition().z()< 0 && iTrack->innerPosition().z() < 0) ;
00059 
00060       if( (z == HaloData::plus) && ( PlusZ || Traversing) ) 
00061         n++;
00062       else if( (z == HaloData::minus) && ( MinusZ || Traversing ) )
00063         n++;
00064       else if( (z == HaloData::both) && (PlusZ || MinusZ || Traversing) ) 
00065         n++ ;
00066     }
00067   return n;
00068 }