Changeset 321 in svn
- Timestamp:
- Mar 11, 2009, 12:53:50 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Delphes.cpp
r319 r321 571 571 // sorts the vector and smears duplicates 572 572 list_of_towers_with_photon.mergeDuplicates(); 573 574 for(unsigned int i=0; i<list_of_towers_with_photon.size(); i++) 575 { 573 for(unsigned int i=0; i<list_of_towers_with_photon.size(); i++) { 576 574 float eta = list_of_towers_with_photon[i].getEta(); 577 575 float phi = list_of_towers_with_photon[i].getPhi(); … … 588 586 // 2.2.1 ********************* sorting collections by decreasing pt 589 587 DET->SortedVector(electron); 590 float iPhiEl=0,iEtaEl=0 ;588 float iPhiEl=0,iEtaEl=0,ptisoEl=0; 591 589 for(unsigned int i=0; i < electron.size(); i++) 592 590 { … … 596 594 elementElec->PhiCalo = electron[i].PhiCalo(); 597 595 elementElec->Charge = sign(electron[i].PID()); 598 elementElec->IsolFlag = DET->Isolation(electron[i].Phi(),electron[i].Eta(),TrackCentral,DET->ISOL_PT,DET->ISOL_Cone); 596 elementElec->IsolFlag = DET->Isolation(electron[i],TrackCentral,DET->ISOL_PT,DET->ISOL_Cone,ptisoEl); 597 elementElec->IsolPt = ptisoEl; 599 598 DET->BinEtaPhi(elementElec->PhiCalo,elementElec->EtaCalo,iPhiEl,iEtaEl); 600 599 D_CaloTower calElec(list_of_active_towers.getElement(iEtaEl,iPhiEl)); … … 603 602 604 603 DET->SortedVector(muon); 605 float iPhiMu=0,iEtaMu=0 ;604 float iPhiMu=0,iEtaMu=0,ptisoMu=0; 606 605 for(unsigned int i=0; i < muon.size(); i++) 607 606 { … … 611 610 elementMu->EtaCalo = muon[i].EtaCalo(); 612 611 elementMu->PhiCalo = muon[i].PhiCalo(); 613 elementMu->IsolFlag = DET->Isolation(muon[i].Phi(),muon[i].Eta(),TrackCentral,DET->ISOL_PT,DET->ISOL_Cone); 614 DET->BinEtaPhi(elementMu->PhiCalo,elementMu->EtaCalo,iPhiMu,iEtaMu); 612 elementMu->IsolFlag = DET->Isolation(muon[i],TrackCentral,DET->ISOL_PT,DET->ISOL_Cone,ptisoMu); 613 elementMu->IsolPt = ptisoMu; 614 DET->BinEtaPhi(elementMu->PhiCalo,elementMu->EtaCalo,iPhiMu,iEtaMu); 615 615 D_CaloTower calMuon(list_of_active_towers.getElement(iEtaMu,iPhiMu)); 616 elementMu->EHoverEE = calMuon.getEhad()/calMuon.getEem(); 616 if( calMuon.getEem() !=0 ) elementMu->EHoverEE = calMuon.getEhad()/calMuon.getEem(); 617 else elementMu->EHoverEE = UNDEFINED; 618 elementMu->EtRatio = DET->CaloIsolation(muon[i], list_of_active_towers); 617 619 } 618 620 -
trunk/interface/SmearUtil.h
r319 r321 155 155 float ISOL_PT; //minimal pt of tracks for isolation criteria 156 156 float ISOL_Cone; //Cone for isolation criteria 157 float ISOL_Calo_ET; //minimal tower energy for isolation criteria 158 float ISOL_Calo_Cone;//Cone for calorimetric isolation 159 unsigned int ISOL_Calo_Grid; //Grid size (N x N) for calorimetric isolation 157 160 158 161 //General jet variable … … 230 233 bool Btaggedjet(const TLorentzVector &JET, const TSimpleArray<GenParticle> &subarray); 231 234 232 /// Lepton isolation 233 bool Isolation(const float phi, const float eta,const vector<TRootTracks> &tracks, const float& pt_second_track, const float& isolCone); 235 /// Lepton isolation based on tracking 236 bool Isolation(const D_Particle& part, const vector<TRootTracks> &tracks, const float& pt_second_track, const float& isolCone, float& ptiso); 237 238 /// Lepton isolation based on calorimetry (optional. Default: off) 239 float CaloIsolation(const D_Particle& part, const D_CaloTowerList & towers); 234 240 235 241 //********************* returns a segmented value for eta and phi, for calo towers ***** -
trunk/src/LHCOConverter.cc
r316 r321 205 205 case lhcoMuonID: { 206 206 cout << "ERROR: LHCOConverter: for muons use LHCOConverter::BranchReaderMuon!\n"; 207 TRootMuon muon(*((TRootMuon*) branch->At(i)));208 ntrk = muon.Charge; ratioE = muon.EHoverEE;209 207 } break; 210 208 case lhcoETmisID: { 211 209 cout << "ERROR: LHCOConverter: for ETmis use LHCOConverter::BranchReaderETmis!\n"; 212 TRootMuon muon(*((TRootMuon*) branch->At(i)));213 ntrk = muon.Charge; ratioE = muon.EHoverEE;214 210 } break; 215 211 … … 284 280 } // loop on jets 285 281 282 int ratio = 0; char ratio_string[3]; 283 if(muon->EtRatio != UNDEFINED) ratio = static_cast<int>(muon->EtRatio); 284 if(ratio<0) sprintf(ratio_string,"00"); 285 else if(ratio<10) sprintf(ratio_string,"0%d",ratio); 286 else if(ratio<100)sprintf(ratio_string,"%d",ratio); 287 else { cout << "Error: muon EtRatio > 99" << endl; sprintf(ratio_string,"99"); } 286 288 // output 287 289 outfile << fixed << setprecision(3) … … 293 295 << setw(7) << jmass <<" " // invariant mass 294 296 << setw(7) << (float)muon->Charge <<" " // -1 for mu-, +1 for mu+ 295 << setw(7) << (float)closest_jet_ID << " " 296 << setw(7) << muon->EHoverEE <<" " // E_had/E_em 297 << setw(7) << (float)closest_jet_ID << " "; 298 outfile << fixed << setprecision(0) 299 << setw(4) << floor(muon->IsolPt) << "." << ratio_string<<" "; // E_had/E_em 300 outfile << fixed << setprecision(3) 297 301 << setw(7) << 0.0 << setw(7) << 0.0 // dummy/dummy 298 302 << endl; -
trunk/src/SmearUtil.cc
r319 r321 102 102 PTCUT_taujet = 10.0; 103 103 104 // Isolation 104 105 ISOL_PT = 2.0; //minimal pt of tracks for isolation criteria 105 106 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 107 110 108 111 // General jet variable … … 228 231 PTCUT_taujet = DET.PTCUT_taujet; 229 232 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; 232 239 233 240 … … 347 354 PTCUT_taujet = DET.PTCUT_taujet; 348 355 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; 352 362 353 363 // General jet variable … … 497 507 else if(strstr(temp_string.c_str(),"PTCUT_taujet")) {curstring >> varname >> value; PTCUT_taujet = value;} 498 508 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;} 502 514 503 515 else if(strstr(temp_string.c_str(),"JET_coneradius")) {curstring >> varname >> value; JET_coneradius = value;} … … 787 799 f_out << left << setw(40) <<"* Cone for isolation criteria: "<<"" 788 800 << 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 789 813 f_out<<"* *"<<"\n"; 790 814 f_out<<"#*************** *"<<"\n"; … … 1072 1096 //***********************Isolation criteria*********************** 1073 1097 //**************************************************************** 1074 bool RESOLution::Isolation(const float phi, const float eta,const vector<TRootTracks> &tracks, const float& pt_second_track, const float& isolCone)1098 bool RESOLution::Isolation(const D_Particle& part, const vector<TRootTracks> &tracks, const float& pt_second_track, const float& isolCone, float& ptiso ) 1075 1099 { 1076 1100 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); 1083 1108 if( 1084 1109 (genDeltaR > deltar) || 1085 (genDeltaR==0) 1110 (genDeltaR==0) // rejets the track of the particle itself 1086 1111 ) 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 1088 1116 } 1089 1117 if(deltar > isolCone) isolated = true; 1090 1118 return isolated; 1119 } 1120 1121 // ******* Calorimetric isolation 1122 float 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; 1091 1142 } 1092 1143
Note:
See TracChangeset
for help on using the changeset viewer.