CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch12/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 #include "DataFormats/CSCDigi/interface/CSCCorrelatedLCTDigiCollection.h"
00011 #include "DataFormats/CSCDigi/interface/CSCWireDigi.h"
00012 #include "DataFormats/CSCDigi/interface/CSCWireDigiCollection.h"
00013 #include "DataFormats/CSCDigi/interface/CSCStripDigi.h"
00014 #include "DataFormats/CSCDigi/interface/CSCStripDigiCollection.h"
00015 #include "DataFormats/CSCDigi/interface/CSCComparatorDigi.h"
00016 #include "DataFormats/CSCDigi/interface/CSCComparatorDigiCollection.h"
00017 #include "DataFormats/CSCRecHit/interface/CSCRecHit2D.h"
00018 #include "DataFormats/CSCRecHit/interface/CSCSegmentCollection.h"
00019 #include "DataFormats/CSCRecHit/interface/CSCRecHit2DCollection.h"
00020 #include "DataFormats/CSCRecHit/interface/CSCSegment.h"
00021 #include "DataFormats/GeometrySurface/interface/Cylinder.h"
00022 #include "DataFormats/GeometrySurface/interface/Plane.h"
00023 #include "DataFormats/GeometrySurface/interface/Cone.h"
00024 #include "DataFormats/GeometryVector/interface/GlobalPoint.h"
00025 #include "DataFormats/GeometryVector/interface/GlobalVector.h"
00026 #include "DataFormats/GeometryVector/interface/LocalPoint.h"
00027 #include "DataFormats/GeometryVector/interface/LocalVector.h"
00028 #include "DataFormats/L1CSCTrackFinder/interface/L1CSCTrackCollection.h"
00029 #include "DataFormats/L1CSCTrackFinder/interface/L1CSCStatusDigiCollection.h"
00030 #include "DataFormats/L1GlobalMuonTrigger/interface/L1MuRegionalCand.h"
00031 #include "DataFormats/L1GlobalMuonTrigger/interface/L1MuGMTReadoutRecord.h"
00032 #include "DataFormats/L1GlobalMuonTrigger/interface/L1MuGMTReadoutCollection.h"
00033 #include "DataFormats/MuonDetId/interface/CSCIndexer.h"
00034 #include "DataFormats/MuonDetId/interface/CSCDetId.h"
00035 #include "DataFormats/MuonDetId/interface/RPCDetId.h"
00036 #include "DataFormats/MuonDetId/interface/DTWireId.h"
00037 #include "DataFormats/MuonReco/interface/MuonFwd.h"
00038 #include "DataFormats/MuonReco/interface/Muon.h"
00039 #include "DataFormats/TrackingRecHit/interface/RecSegment.h"
00040 #include "DataFormats/TrackerRecHit2D/interface/SiPixelRecHitCollection.h"
00041 #include "DataFormats/TrackerRecHit2D/interface/SiStripRecHit2DCollection.h"
00042 #include "DataFormats/TrackerRecHit2D/interface/SiStripMatchedRecHit2DCollection.h"
00043 #include "DataFormats/TrackReco/interface/TrackFwd.h"
00044 #include "DataFormats/TrackReco/interface/Track.h"
00045 
00046 #include "DataFormats/TrajectorySeed/interface/TrajectorySeedCollection.h"
00047 
00048 
00049 using namespace reco;
00050 CSCHaloData::CSCHaloData()
00051 {
00052   nTriggers_PlusZ = 0;
00053   nTriggers_MinusZ = 0 ;
00054   nTracks_PlusZ = 0 ;
00055   nTracks_MinusZ = 0;
00056   HLTAccept=false;
00057 
00058   nOutOfTimeTriggers_PlusZ=0;
00059   nOutOfTimeTriggers_MinusZ=0;
00060   nOutOfTimeHits = 0 ;
00061 }
00062 
00063 int CSCHaloData::NumberOfHaloTriggers(HaloData::Endcap z) const
00064 {
00065   if( z == HaloData::plus )
00066     return nTriggers_PlusZ;
00067   else if( z == HaloData::minus )
00068     return nTriggers_MinusZ;
00069   else 
00070     return nTriggers_MinusZ + nTriggers_PlusZ;
00071 }
00072 
00073 short int CSCHaloData::NumberOfOutOfTimeTriggers(HaloData::Endcap z ) const
00074 {
00075   if( z == HaloData::plus  ) 
00076     return nOutOfTimeTriggers_PlusZ;
00077   else if( z == HaloData::minus ) 
00078     return nOutOfTimeTriggers_MinusZ;
00079   else
00080     return nOutOfTimeTriggers_PlusZ+nOutOfTimeTriggers_MinusZ;
00081 }
00082 
00083 int CSCHaloData::NumberOfHaloTracks(HaloData::Endcap z) const 
00084 {
00085   int n = 0 ;
00086   for(unsigned int i = 0 ; i < TheTrackRefs.size() ; i++ )
00087     {
00088       edm::Ref<reco::TrackCollection> iTrack( TheTrackRefs, i ) ;
00089       // Does the track go through both endcaps ? 
00090       bool Traversing =  (iTrack->outerPosition().z() > 0 &&  iTrack->innerPosition().z() < 0) ||  (iTrack->outerPosition().z() < 0 &&  iTrack->innerPosition().z() > 0);
00091       // Does the track go through only +Z endcap ?
00092       bool PlusZ =  (iTrack->outerPosition().z() > 0 && iTrack->innerPosition().z() > 0 ) ;
00093       // Does the track go through only -Z endcap ? 
00094       bool MinusZ = (iTrack->outerPosition().z()< 0 && iTrack->innerPosition().z() < 0) ;
00095 
00096       if( (z == HaloData::plus) && ( PlusZ || Traversing) ) 
00097         n++;
00098       else if( (z == HaloData::minus) && ( MinusZ || Traversing ) )
00099         n++;
00100       else if( (z == HaloData::both) && (PlusZ || MinusZ || Traversing) ) 
00101         n++ ;
00102     }
00103   return n;
00104 }