Fork me on GitHub

Changeset 287 in svn


Ignore:
Timestamp:
Mar 3, 2009, 12:44:54 AM (16 years ago)
Author:
Xavier Rouby
Message:

charge added in Taujets and tracks

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/interface/SmearUtil.h

    r270 r287  
    217217
    218218  /// Number of tracks in tau jet algo
    219   unsigned int NumTracks(const vector<TLorentzVector> &tracks, const float pt_track, const float eta, const float phi);
     219  //unsigned int NumTracks(float& charge, const vector<TLorentzVector> &tracks, const float pt_track, const float eta, const float phi);
     220  unsigned int NumTracks(float& charge, const vector<TRootTracks> &tracks, const float pt_track, const float eta, const float phi);
    220221
    221222  /// b-jets
     
    226227
    227228  /// Lepton isolation
    228   bool Isolation(const float phi, const float eta,const vector<TLorentzVector> &tracks,float PT_TRACK2);
     229  //bool Isolation(const float phi, const float eta,const vector<TLorentzVector> &tracks,float PT_TRACK2);
     230  bool Isolation(const float phi, const float eta,const vector<TRootTracks> &tracks, const float PT_TRACK2);
    229231
    230232  //********************* returns a segmented value for eta and phi, for calo towers *****
  • trunk/src/SmearUtil.cc

    r270 r287  
    985985//      2) be inside a cone with a radius R and the axis defined by (eta,phi)
    986986// IMPORTANT REMARK !!!!!
    987 // previously, the argument 'phi' was before the argument 'eta'
    988 // this has been changed for consistency with the other functions
    989 // double check your running code that uses NumTracks !
    990 unsigned int RESOLution::NumTracks(const vector<TLorentzVector> &tracks, const float pt_track, const float eta, const float phi) {
    991   unsigned int numtrack=0;
     987// NEW : "charge" will contain the sum of all charged tracks in the cone TAU_track_scone
     988unsigned int RESOLution::NumTracks(float& charge, const vector<TRootTracks> &tracks, const float pt_track, const float eta, const float phi) {
     989  unsigned int numbtrack=0; // number of track in the tau-jet cone, which is smaller than R;
     990  charge=0;
    992991  for(unsigned int i=0; i < tracks.size(); i++) {
    993       if((tracks[i].Pt() < pt_track )||
    994          (DeltaR(phi,eta,tracks[i].Phi(),tracks[i].Eta()) > TAU_track_scone)
    995         )continue;
    996       numtrack++;
    997   }
    998   return numtrack;
    999 }
     992      if(tracks[i].PT < pt_track ) continue;
     993      float dr = DeltaR(phi,eta,tracks[i].Phi,tracks[i].Eta);
     994      if (dr > TAU_track_scone) continue;
     995        numbtrack++;
     996        charge += tracks[i].Charge; // total charge in the cone for Tau-jet
     997  }
     998  return numbtrack;
     999}
     1000/*
     1001unsigned int RESOLution::NumTracks(unsigned int& NumTracksR, float& charge, const vector<TRootTracks> &tracks, const float pt_track, const float eta, const float phi, const float R) {
     1002  unsigned int numbtrack=0; // number of track in the tau-jet cone, which is smaller than R;
     1003  charge=0;      NumTracksR=0; // total number of tracks
     1004  if (R<TAU_track_scone) cout << "Warning: jet radius smaller than tau-jet radius in RESOLution::NumTracks\n";
     1005  for(unsigned int i=0; i < tracks.size(); i++) {
     1006      if(tracks[i].PT < pt_track ) continue;
     1007      float dr = DeltaR(phi,eta,tracks[i].Phi,tracks[i].Eta);
     1008      if (dr > R) continue;
     1009
     1010      NumTracksR++;
     1011      if(dr < TAU_track_scone) {// previously R==TAU_track_scone, for tau-jets only
     1012        numbtrack++;
     1013        charge += tracks[i].Charge; // total charge in the cone for Tau-jet
     1014      }
     1015
     1016  }
     1017  return numbtrack;
     1018}
     1019*/
    10001020
    10011021
     
    10291049//***********************Isolation criteria***********************
    10301050//****************************************************************
    1031 bool RESOLution::Isolation(const float phi, const float eta,const vector<TLorentzVector> &tracks, const float pt_second_track)
     1051//bool RESOLution::Isolation(const float phi, const float eta,const vector<TLorentzVector> &tracks, const float pt_second_track)
     1052bool RESOLution::Isolation(const float phi, const float eta,const vector<TRootTracks> &tracks, const float pt_second_track)
    10321053{
    10331054   bool isolated = false;
     
    10361057   for(unsigned int i=0; i < tracks.size(); i++)
    10371058      {
    1038        if(tracks[i].Pt() < pt_second_track)continue;
    1039        float genDeltaR = DeltaR(phi,eta,tracks[i].Phi(),tracks[i].Eta());
     1059       if(tracks[i].PT < pt_second_track)continue;
     1060       float genDeltaR = DeltaR(phi,eta,tracks[i].Phi,tracks[i].Eta);
    10401061         if(
    10411062             (genDeltaR > deltar) ||
Note: See TracChangeset for help on using the changeset viewer.