Fork me on GitHub

Changeset 321 in svn for trunk/src/LHCOConverter.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/LHCOConverter.cc

    r316 r321  
    205205          case lhcoMuonID: {
    206206           cout << "ERROR: LHCOConverter: for muons use LHCOConverter::BranchReaderMuon!\n";
    207                 TRootMuon muon(*((TRootMuon*) branch->At(i)));
    208                 ntrk = muon.Charge;  ratioE = muon.EHoverEE;
    209207          } break;
    210208          case lhcoETmisID: {
    211209           cout << "ERROR: LHCOConverter: for ETmis use LHCOConverter::BranchReaderETmis!\n";
    212                 TRootMuon muon(*((TRootMuon*) branch->At(i)));
    213                 ntrk = muon.Charge;  ratioE = muon.EHoverEE;
    214210          } break;
    215211
     
    284280        } // loop on jets
    285281
     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"); }
    286288        // output
    287289        outfile << fixed << setprecision(3)
     
    293295                << setw(7) << jmass <<" "       // invariant mass
    294296                << 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)
    297301                << setw(7) << 0.0 << setw(7) << 0.0  // dummy/dummy
    298302                << endl;
Note: See TracChangeset for help on using the changeset viewer.