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), nphi(72), kphi(1);
40  double etas[24]={0.000,0.087,0.174,0.261,0.348,0.435,0.522,0.609,0.696,
41  0.783,0.870,0.957,1.044,1.131,1.218,1.305,1.392,1.479,
42  1.566,1.653,1.740,1.830,1.930,2.043};
43  for (int i=1; i<24; i++) {
44  if (fabs(track_->eta())<=etas[i]) {
45  ieta = (track_->eta() > 0) ? i : -i;
46  if (i > 20) {
47  kphi = 2; nphi = 36;
48  }
49  break;
50  }
51  }
52 
53  const double dphi=M_PI/36.; //0.087266462;
54  double phi = track_->phi();
55  if (phi < 0) phi += (2*M_PI);
56  double delta = phi+(kphi*dphi);
57  for (int i=0; i<nphi; i++) {
58  if (delta<=(kphi*(i+1)*dphi)) {
59  iphi = kphi*i + 1;
60  break;
61  }
62  }
63 
64  return std::pair<int,int>(ieta,iphi);
65 
66 }
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:69
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
#define M_PI
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
virtual double phi() const
momentum azimuthal angle
std::pair< int, int > towerIndex() const
get index of tower which track is hitting