CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_3/src/DataFormats/HcalIsolatedTrack/src/IsolatedPixelTrackCandidate.cc

Go to the documentation of this file.
00001 #include "DataFormats/HcalIsolatedTrack/interface/IsolatedPixelTrackCandidate.h"
00002 
00003 using namespace reco;
00004 
00005 IsolatedPixelTrackCandidate::~IsolatedPixelTrackCandidate() { }
00006 
00007 IsolatedPixelTrackCandidate * IsolatedPixelTrackCandidate::clone() const { 
00008   return new IsolatedPixelTrackCandidate( * this ); 
00009 }
00010 
00011 TrackRef IsolatedPixelTrackCandidate::track() const {
00012   return track_;
00013 }
00014 
00015 l1extra::L1JetParticleRef IsolatedPixelTrackCandidate::l1tau() const {
00016   return l1tauJet_;
00017 }
00018 
00019 bool IsolatedPixelTrackCandidate::overlap( const Candidate & c ) const {
00020   const RecoCandidate * o = dynamic_cast<const RecoCandidate *>( & c );
00021   return ( o != 0 &&  checkOverlap( track(), o->track() ) );
00022 }
00023 
00024 std::pair<int,int> IsolatedPixelTrackCandidate::towerIndex() const
00025 {
00026   int ieta=0, iphi=0;
00027   for (int i=1; i<21; i++)
00028     {
00029       if (fabs(track_->eta())<(i*0.087)&&fabs(track_->eta())>(i-1)*0.087) ieta=int(fabs(track_->eta())/track_->eta())*i;
00030     }
00031   if (fabs(track_->eta())>1.740&&fabs(track_->eta())<1.830) ieta=int(fabs(track_->eta())/track_->eta())*21;
00032   if (fabs(track_->eta())>1.830&&fabs(track_->eta())<1.930) ieta=int(fabs(track_->eta())/track_->eta())*22;
00033   if (fabs(track_->eta())>1.930&&fabs(track_->eta())<2.043) ieta=int(fabs(track_->eta())/track_->eta())*23;
00034 
00035   double delta=track_->phi()+0.174532925;
00036   if (delta<0) delta=delta+2*acos(-1);
00037   if (fabs(track_->eta())<1.740) 
00038     {
00039       for (int i=0; i<72; i++)
00040         {
00041           if (delta<(i+1)*0.087266462&&delta>i*0.087266462) iphi=i;
00042         }
00043     }
00044   else 
00045     {
00046       for (int i=0; i<36; i++)
00047         {
00048           if (delta<2*(i+1)*0.087266462&&delta>2*i*0.087266462) iphi=2*i;
00049         }
00050     }
00051 
00052   return std::pair<int,int>(ieta,iphi);
00053 
00054 }