CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
IsolatedPixelTrackCandidate.cc
Go to the documentation of this file.
2 
3 using namespace reco;
4 
6 
8  return new IsolatedPixelTrackCandidate( * this );
9 }
10 
12  return track_;
13 }
14 
16  return l1tauJet_;
17 }
18 
20  const RecoCandidate * o = dynamic_cast<const RecoCandidate *>( & c );
21  return ( o != 0 && checkOverlap( track(), o->track() ) );
22 }
23 
24 std::pair<int,int> IsolatedPixelTrackCandidate::towerIndex() const
25 {
26  int ieta=0, iphi=0;
27  for (int i=1; i<21; i++)
28  {
29  if (fabs(track_->eta())<(i*0.087)&&fabs(track_->eta())>(i-1)*0.087) ieta=int(fabs(track_->eta())/track_->eta())*i;
30  }
31  if (fabs(track_->eta())>1.740&&fabs(track_->eta())<1.830) ieta=int(fabs(track_->eta())/track_->eta())*21;
32  if (fabs(track_->eta())>1.830&&fabs(track_->eta())<1.930) ieta=int(fabs(track_->eta())/track_->eta())*22;
33  if (fabs(track_->eta())>1.930&&fabs(track_->eta())<2.043) ieta=int(fabs(track_->eta())/track_->eta())*23;
34 
35  double delta=track_->phi()+0.174532925;
36  if (delta<0) delta=delta+2*acos(-1);
37  if (fabs(track_->eta())<1.740)
38  {
39  for (int i=0; i<72; i++)
40  {
41  if (delta<(i+1)*0.087266462&&delta>i*0.087266462) iphi=i;
42  }
43  }
44  else
45  {
46  for (int i=0; i<36; i++)
47  {
48  if (delta<2*(i+1)*0.087266462&&delta>2*i*0.087266462) iphi=2*i;
49  }
50  }
51 
52  return std::pair<int,int>(ieta,iphi);
53 
54 }
dbl * delta
Definition: mlp_gen.cc:36
bool checkOverlap(const R &r1, const R &r2) const
check if two components overlap
Definition: RecoCandidate.h:63
int i
Definition: DBlmapReader.cc:9
virtual reco::TrackRef track() const
refrence to a Track
reco::TrackRef track_
reference to a Track
virtual reco::TrackRef track() const
reference to a Track
virtual IsolatedPixelTrackCandidate * clone() const
returns a clone of the candidate
virtual bool overlap(const Candidate &) const
check overlap with another candidate
virtual l1extra::L1JetParticleRef l1tau() const
get reference to L1 tau jet
l1extra::L1JetParticleRef l1tauJet_
reference to a L1 tau jet
std::pair< int, int > towerIndex() const
get index of tower which track is hitting