1 // dear emacs, this is -*- C++ -*-
4 Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
8 //using namespace CLHEP;
12 //-------------------------------------------------------------------------
14 //-------------------------------------------------------------------------
16 inline const TauPi0Cluster* TauPi0Candidate::pi0Cluster(unsigned int i) const
18 return m_pi0ClusterVector[i];
21 inline const std::vector<TauPi0Cluster*>& TauPi0Candidate::pi0ClusterVec() const
23 return m_pi0ClusterVector ;
26 inline std::vector<TauPi0Cluster*>& TauPi0Candidate::pi0ClusterVec()
28 return m_pi0ClusterVector;
31 inline unsigned int TauPi0Candidate::nPi0Cluster() const
33 return m_pi0ClusterVector.size();
36 inline CLHEP::HepLorentzVector TauPi0Candidate::hlv() const
38 CLHEP::HepLorentzVector cand4Mom(0., 0., 0., 0.);
39 double mPi0 = 134.98*CLHEP::MeV;
40 if(this->nPi0Cluster() == 1){
42 // Cluster E has been measured in Calo. Cluster Pt has been calculated using a 0 mass hypthesis.
43 // Therefore recalculate Cluster Pt using pi0 mass hypothesis
44 double clusterE = this->pi0Cluster( 0 )->cluster()->e();
45 double clusterEta = this->pi0Cluster( 0 )->cluster()->eta();
46 // Make sure clusterE>=mPi0, since sqrt(clusterE*clusterE-mPi0*mPi0) is used
47 if(clusterE<mPi0) clusterE = mPi0;
48 double clusterPt = std::sqrt(clusterE*clusterE-mPi0*mPi0)/std::cosh(clusterEta);
50 // Set hlv. Steps are copied from /atlas/Trigger/TrigAlgorithms/TrigDiMuon/src/TrigDiMuonFast.cxx
51 double clusterPhi = this->pi0Cluster( 0 )->cluster()->phi();
53 double cot=1/std::tan(2*std::atan(std::exp(-clusterEta)));
54 double px=std::cos(clusterPhi)*clusterPt;
55 double py=std::sin(clusterPhi)*clusterPt;
56 double pz=cot*clusterPt;
58 cand4Mom = CLHEP::HepLorentzVector(px,py,pz,clusterE);
60 // TODO: Reconsider how to define the hlv for nPi0Cluster!=1.
61 else if(this->nPi0Cluster() != 0){
62 for(unsigned iCluster=0; iCluster<this->nPi0Cluster();++iCluster){
63 cand4Mom+=this->pi0Cluster( iCluster )->cluster()->hlv();
65 // Recalculate Candidate Pt using pi0 mass hypothesis
66 double candidatePt = std::sqrt(cand4Mom.e()*cand4Mom.e()-mPi0*mPi0)/std::cosh(cand4Mom.eta());
68 // Set hlv. Steps are copied from /atlas/Trigger/TrigAlgorithms/TrigDiMuon/src/TrigDiMuonFast.cxx
69 double cot=1/std::tan(2*std::atan(std::exp(-cand4Mom.eta())));
70 double px=std::cos(cand4Mom.phi())*candidatePt;
71 double py=std::sin(cand4Mom.phi())*candidatePt;
72 double pz=cot*candidatePt;
74 cand4Mom = CLHEP::HepLorentzVector(px,py,pz,cand4Mom.e());
79 inline void TauPi0Candidate ::addPi0Cluster( TauPi0Cluster *pi0Cluster )
81 m_pi0ClusterVector.push_back( pi0Cluster );
83 } //end of namespace analysis