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 
5 IsolatedPixelTrackCandidate::IsolatedPixelTrackCandidate(const IsolatedPixelTrackCandidate& right) : RecoCandidate(right), track_(right.track_), l1tauJet_(right.l1tauJet_) {
6  maxPtPxl_ = right.maxPtPxl_;
7  sumPtPxl_ = right.sumPtPxl_;
8  enIn_ = right.enIn_;
9  enOut_ = right.enOut_;
10  nhitIn_ = right.nhitIn_;
11  nhitOut_ = right.nhitOut_;
12  etaPhiEcal_= right.etaPhiEcal_;
13  etaEcal_ = right.etaEcal_;
14  phiEcal_ = right.phiEcal_;
15 }
16 
18 
19 
21  return new IsolatedPixelTrackCandidate( * this );
22 }
23 
25  return track_;
26 }
27 
29  return l1tauJet_;
30 }
31 
33  const RecoCandidate * o = dynamic_cast<const RecoCandidate *>( & c );
34  return ( o != 0 && checkOverlap( track(), o->track() ) );
35 }
36 
37 std::pair<int,int> IsolatedPixelTrackCandidate::towerIndex() const
38 {
39  int ieta=0, iphi=0;
40  for (int i=1; i<21; i++)
41  {
42  if (fabs(track_->eta())<(i*0.087)&&fabs(track_->eta())>(i-1)*0.087) ieta=int(fabs(track_->eta())/track_->eta())*i;
43  }
44  if (fabs(track_->eta())>1.740&&fabs(track_->eta())<1.830) ieta=int(fabs(track_->eta())/track_->eta())*21;
45  if (fabs(track_->eta())>1.830&&fabs(track_->eta())<1.930) ieta=int(fabs(track_->eta())/track_->eta())*22;
46  if (fabs(track_->eta())>1.930&&fabs(track_->eta())<2.043) ieta=int(fabs(track_->eta())/track_->eta())*23;
47 
48  double delta=track_->phi()+0.174532925;
49  if (delta<0) delta=delta+2*acos(-1);
50  if (fabs(track_->eta())<1.740)
51  {
52  for (int i=0; i<72; i++)
53  {
54  if (delta<(i+1)*0.087266462&&delta>i*0.087266462) iphi=i;
55  }
56  }
57  else
58  {
59  for (int i=0; i<36; i++)
60  {
61  if (delta<2*(i+1)*0.087266462&&delta>2*i*0.087266462) iphi=2*i;
62  }
63  }
64 
65  return std::pair<int,int>(ieta,iphi);
66 
67 }
dbl * delta
Definition: mlp_gen.cc:36
double enOut_
energy in outer cone around L1 tau jet
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
double sumPtPxl_
Pt sum of other pixel tracks in the cone around the candidate.
virtual IsolatedPixelTrackCandidate * clone() const
returns a clone of the candidate
double maxPtPxl_
highest Pt of other pixel tracks in the cone around the candidate
int nhitIn_
number of hits in inner cone
virtual bool overlap(const Candidate &) const
check overlap with another candidate
virtual l1extra::L1JetParticleRef l1tau() const
get reference to L1 tau jet
int nhitOut_
number of hits in inner cone
double enIn_
energy in inner cone around 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