Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:19:33

0001 #include "L1Trigger/CSCTrackFinder/test/src/RefTrack.h"
0002 #include <iostream>
0003 namespace csctf_analysis
0004 {
0005   RefTrack::RefTrack():Track() {}
0006   RefTrack::RefTrack(const SimTrack& track):Track()
0007   {
0008     mom.SetPxPyPzE(track.momentum().x(), 
0009         track.momentum().y(), 
0010         track.momentum().z(), 
0011         track.momentum().t());
0012     Quality=-1;
0013     type = track.type();
0014   }
0015   RefTrack::RefTrack(const reco::Muon& muon):Track()
0016   {
0017     mom.SetPxPyPzE(muon.p4().x(),
0018         muon.p4().y(),
0019         muon.p4().z(),
0020         muon.p4().t());
0021     Quality=-1;
0022     type = 13;
0023   }
0024   double RefTrack::distanceTo(const TFTrack* tftrack) const
0025   {
0026     double newR;
0027     double dEta =getEta()-tftrack->getEta();
0028     double dPhi =getPhi()-tftrack->getPhi();
0029 
0030     newR = sqrt( dEta*dEta + dPhi*dPhi ); //Changed to do distance style metric by Daniel 07/02
0031 
0032     return newR;
0033   }
0034   void RefTrack::matchedTo(int i, double newR,int newQ, double newTFPt)
0035   {
0036     if(matched==false || newR<R){
0037         matched=true;
0038         R=newR;
0039         matchedIndex=i;}
0040     Quality=newQ;
0041     TFPt=newTFPt;
0042   }
0043   void RefTrack::ghostMatchedTo(const TFTrack& track,int i, double newR)
0044   {
0045     ghostMatchedToIndex->push_back(i);
0046     ghostR->push_back(newR);
0047     ghostQ->push_back(track.getQuality());  
0048     if (ghostMatchedToIndex->size() > 1)
0049         ghost=true;
0050   }
0051   void RefTrack::print()
0052   {
0053     std::cout << "RefTrack Info" << std::endl;
0054     std::cout << "  Pt: "<< getPt() << std::endl;
0055     std::cout << "  Phi: "<< getPhi() << std::endl;
0056     std::cout << "  Eta: "<< getEta() << std::endl;
0057     std::cout << "  P: "<< getP() << std::endl;
0058     std::cout << "  Pz: "<< getPz() << std::endl;
0059     std::cout << "  Type: "<< getType() << std::endl;
0060   }
0061   
0062         
0063   void RefTrack::setMatch(TFTrack& trackToMatch)
0064   {
0065     matchedTrack = &trackToMatch;
0066   }
0067 
0068 }