Fork me on GitHub

Changeset 31 in svn


Ignore:
Timestamp:
Nov 13, 2008, 5:15:34 PM (16 years ago)
Author:
severine ovyn
Message:

add isolation

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/interface/SmearUtil.h

    r11 r31  
    128128  bool Btaggedjet(const TLorentzVector &JET, const TSimpleArray<TRootGenParticle> &subarray);
    129129
     130  //******************************isolation criteria**************************************
     131  bool Isolation(Float_t phi,Float_t eta,const vector<TLorentzVector> &tracks,float PT_TRACK2);
     132
    130133};
    131134
  • trunk/src/SmearUtil.cc

    r22 r31  
    180180                                         pow(ELG_Sfwd*sqrt(energy),2) ) );
    181181  }
     182float theta=electron.Theta();
     183float phi=electron.Phi();
     184  float px = energyS * sin(theta) * cos(phi);
     185  float py = energyS * sin(theta) * sin(phi);
     186  float pz = energyS * cos(theta);
     187  //cout<<" px "<<px<<" py "<<py<<" pz "<<pz<<endl;
    182188  electron.SetPtEtaPhiE(energyS/cosh(electron.Eta()), electron.Eta(), electron.Phi(), energyS);
    183  
     189  //cout<<"nous "<<electron.Px()<<"  "<<electron.Py()<<"  "<<electron.Pz()<<endl;
    184190  if(electron.E() < 0)electron.SetPxPyPzE(0,0,0,0); // no negative values after smearing !
    185191}
     
    212218  // some of the particles decay mostly in the ecal, some mostly in the hcal
    213219 
    214 float energyS1,energyS2;
     220  float energyS1,energyS2;
    215221  if(fabs(hadron.Eta()) < MAX_CALO_CEN) {
    216222   energyS1 = gRandom->Gaus(energy_hcal, sqrt(
     
    302308}
    303309
     310//***********************Isolation criteria***********************
     311//****************************************************************
     312bool RESOLution::Isolation(Float_t phi,Float_t eta,const vector<TLorentzVector> &tracks,float PT_TRACK2)
     313{
     314   bool isolated = false;
     315   Float_t deltar=5000.; // Initial value; should be high; no further repercussion
     316   // loop on all final charged particles, with p_t >2, close enough from the electron
     317   for(unsigned int i=0; i < tracks.size(); i++)
     318      {
     319       if(tracks[i].Pt() < PT_TRACK2)continue;
     320       Float_t genDeltaR = DeltaR(phi,eta,tracks[i].Phi(),tracks[i].Eta());    // slower to evaluate
     321         if(
     322             (genDeltaR > deltar) ||
     323             (genDeltaR==0)
     324           ) continue ;
     325           deltar=genDeltaR;
     326      }
     327   if(deltar > 0.5)isolated = true; // returns the closest distance
     328   return isolated;
     329}
     330
     331
    304332//**************************** Returns the delta Phi ****************************
    305333float DeltaPhi(const float phi1, const float phi2) {
Note: See TracChangeset for help on using the changeset viewer.