Fork me on GitHub

Changeset 321 in svn for trunk/src/SmearUtil.cc


Ignore:
Timestamp:
Mar 11, 2009, 12:53:50 PM (16 years ago)
Author:
Xavier Rouby
Message:

Isolation updated. ptiso implemented. etrat prepared but not finished

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/SmearUtil.cc

    r319 r321  
    102102  PTCUT_taujet    = 10.0;
    103103
     104  // Isolation
    104105  ISOL_PT         = 2.0;      //minimal pt of tracks for isolation criteria
    105106  ISOL_Cone       = 0.5;      //Cone  for isolation criteria
    106 
     107  ISOL_Calo_ET    = 1E99;     //minimal tower energy for isolation criteria. Default off = 1E99
     108  ISOL_Calo_Cone  = 0.5;      //Cone for calorimetric isolation
     109  ISOL_Calo_Grid  = 3;        //Grid size (N x N) for calorimetric isolation
    107110
    108111  // General jet variable
     
    228231  PTCUT_taujet    = DET.PTCUT_taujet;
    229232
    230   ISOL_PT         = DET.ISOL_PT;      //minimal pt of tracks for isolation criteria
    231   ISOL_Cone       = DET.ISOL_Cone;      //Cone  for isolation criteria
     233  // Isolation
     234  ISOL_PT         = DET.ISOL_PT;     // tracking isolation
     235  ISOL_Cone       = DET.ISOL_Cone; 
     236  ISOL_Calo_ET    = DET.ISOL_Calo_ET;  // calorimeter isolation, defaut off
     237  ISOL_Calo_Cone  = DET.ISOL_Calo_Cone;
     238  ISOL_Calo_Grid  = DET.ISOL_Calo_Grid;
    232239
    233240
     
    347354  PTCUT_taujet    = DET.PTCUT_taujet;
    348355
    349   ISOL_PT         = DET.ISOL_PT;      //minimal pt of tracks for isolation criteria
    350   ISOL_Cone       = DET.ISOL_Cone;      //Cone  for isolation criteria
    351 
     356  // Isolation
     357  ISOL_PT         = DET.ISOL_PT;       // tracking isolation
     358  ISOL_Cone       = DET.ISOL_Cone;   
     359  ISOL_Calo_ET    = DET.ISOL_Calo_ET;  // calorimeter isolation, defaut off
     360  ISOL_Calo_Cone  = DET.ISOL_Calo_Cone;
     361  ISOL_Calo_Grid  = DET.ISOL_Calo_Grid;
    352362
    353363  // General jet variable
     
    497507    else if(strstr(temp_string.c_str(),"PTCUT_taujet"))     {curstring >> varname >> value; PTCUT_taujet      = value;}
    498508
    499     else if(strstr(temp_string.c_str(),"ISOL_PT"))          {curstring >> varname >> value; ISOL_PT        = value;}
    500     else if(strstr(temp_string.c_str(),"ISOL_Cone"))        {curstring >> varname >> value; ISOL_Cone        = value;}
    501 
     509    else if(strstr(temp_string.c_str(),"ISOL_PT"))          {curstring >> varname >> value; ISOL_PT           = value;}
     510    else if(strstr(temp_string.c_str(),"ISOL_Cone"))        {curstring >> varname >> value; ISOL_Cone         = value;}
     511    else if(strstr(temp_string.c_str(),"ISOL_Calo_ET"))     {curstring >> varname >> value; ISOL_Calo_ET      = value;}
     512    else if(strstr(temp_string.c_str(),"ISOL_Calo_Cone"))   {curstring >> varname >> value; ISOL_Calo_Cone    = value;}
     513    else if(strstr(temp_string.c_str(),"ISOL_Calo_Grid"))   {curstring >> varname >> ivalue; ISOL_Calo_Grid    = ivalue;}
    502514
    503515    else if(strstr(temp_string.c_str(),"JET_coneradius"))   {curstring >> varname >> value; JET_coneradius    = value;}
     
    787799  f_out << left << setw(40) <<"* Cone for isolation criteria: "<<""
    788800        << left << setw(20) <<ISOL_Cone             <<""<< right << setw(10)<<"*"<<"\n";
     801
     802  if(ISOL_Calo_ET > 1E98) f_out<<"# No Calorimetric isolation applied                                  *"<<"\n";
     803  else {
     804   f_out << left << setw(40) <<"* Minimum ET for towers [GeV]: "<<""
     805         << left << setw(20) <<ISOL_Calo_ET               <<""<< right << setw(10)<<"*"<<"\n";
     806   f_out << left << setw(40) <<"* Cone for calorimetric isolation: "<<""
     807         << left << setw(20) <<ISOL_Calo_Cone             <<""<< right << setw(10)<<"*"<<"\n";
     808   f_out << left << setw(40) <<"* Grid size (NxN) for calorimetric isolation: "<<""
     809         << left << setw(20) <<ISOL_Calo_Grid             <<""<< right << setw(10)<<"*"<<"\n";
     810  }
     811
     812
    789813  f_out<<"*                                                                    *"<<"\n";
    790814  f_out<<"#***************                                                     *"<<"\n";
     
    10721096//***********************Isolation criteria***********************
    10731097//****************************************************************
    1074 bool RESOLution::Isolation(const float phi, const float eta,const vector<TRootTracks> &tracks, const float& pt_second_track, const float& isolCone)
     1098bool RESOLution::Isolation(const D_Particle& part, const vector<TRootTracks> &tracks, const float& pt_second_track, const float& isolCone, float& ptiso )
    10751099{
    10761100   bool isolated = false;
    1077    float deltar=5000.; // Initial value; should be high; no further repercussion
    1078    // loop on all final charged particles, with p_t >2, close enough from the electron
    1079    for(unsigned int i=0; i < tracks.size(); i++)
    1080       {
    1081        if(tracks[i].PT < pt_second_track)continue;
    1082        float genDeltaR = DeltaR(phi,eta,tracks[i].Phi,tracks[i].Eta);
     1101   ptiso = 0; // sum of all track pt in isolation cone
     1102   float deltar=1E99; // Initial value; should be high; no further repercussion
     1103
     1104   // loop on all tracks, with p_t above threshold, close enough from the charged lepton
     1105   for(unsigned int i=0; i < tracks.size(); i++) {
     1106       if(tracks[i].PT < pt_second_track) continue; // ptcut on tracks
     1107       float genDeltaR = DeltaR(part.Phi(),part.Eta(),tracks[i].Phi,tracks[i].Eta);
    10831108         if(
    10841109             (genDeltaR > deltar) ||
    1085              (genDeltaR==0)
     1110             (genDeltaR==0)  // rejets the track of the particle itself
    10861111           ) continue ;
    1087            deltar=genDeltaR;
     1112           deltar=genDeltaR;    // finds the closest track
     1113
     1114         // as long as (genDeltaR==0) is put above, the particle itself is not taken into account
     1115         if( genDeltaR < ISOL_Cone) ptiso += tracks[i].PT; // dR cut on tracks
    10881116      }
    10891117   if(deltar > isolCone) isolated = true;
    10901118   return isolated;
     1119}
     1120
     1121// ******* Calorimetric isolation
     1122float RESOLution::CaloIsolation(const D_Particle& part,  const D_CaloTowerList & towers) {
     1123 // etrat, which is a percentage between 00 and 99. It is the ratio of the transverse energy
     1124 // in a 3×3 grid surrounding the muon to the pT of the muon. For well-isolated muons, both ptiso and etrat will be small.
     1125   if(ISOL_Calo_ET>1E10) return UNDEFINED; // avoid doing anything unreasonable...
     1126   float etrat=0;
     1127   // available parameters: ISOL_Calo_ET , ISOL_Calo_Cone ,
     1128/*   for(unsigned int i=0; i < towers.size(); i++) {
     1129     if(towers[i].E > ISOL_Calo_ET) {
     1130        float genDeltaR = DeltaR(part.Phi(),part.Eta(),towers[i].getPhi(),towers[i].getEta());
     1131        if(genDeltaR < ISOL_Calo_Cone) {
     1132           ptiso += towers[i].getET();
     1133        }           
     1134     }
     1135   } // loop on towers
     1136   ptiso -=
     1137*/
     1138  etrat = 100*etrat/part.Pt();
     1139  if(etrat<0) cout << "Error: negative etrat in CaloIsolation (" << etrat <<")\n";
     1140  else if(etrat>99) cout << "Error: etrat shoud be in [0;99] in CaloIsolation (" << etrat <<")\n";
     1141  return etrat;
    10911142}
    10921143
Note: See TracChangeset for help on using the changeset viewer.