Fork me on GitHub

Changeset 313 in svn for trunk/src/LHCOConverter.cc


Ignore:
Timestamp:
Mar 10, 2009, 12:57:20 PM (15 years ago)
Author:
severine ovyn
Message:

OK etmis and plus joli

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/LHCOConverter.cc

    r310 r313  
    6363        const unsigned int r_find = outputfilename_.rfind(".root");
    6464        if(r_find > outputfilename_.size()) {
    65            cout << "ERROR: the extension of the input file is not '.root'. Exiting...\n"; valid_=false;
     65           cerr << "ERROR: the extension of the input file is not '.root'. Exiting...\n"; valid_=false;
    6666        }
    6767        else {
     
    6969                ofstream outfile( outputfilename_.c_str());
    7070                outfile.close();
    71                 cout << "INFO: " << outputfilename_ << " has been created\n";
     71                cout << left  << setw(20) <<"**        INFO: "<<""
     72                              << left  << setw(29) << outputfilename_ <<""
     73                              << right << setw(20) <<"created          **"<<endl;
     74
    7275        }
    7376    }
     
    127130
    128131  Long64_t Nevents = analysisTree->GetEntries();
    129   cout << "** TTree 'Analysis' contains " << Nevents << " events" << endl;
    130132  Nevents = min(Nevents,triggerTree->GetEntries());
    131133  if (Nevents != analysisTree->GetEntries())
     
    155157
    156158    // 6 MET
    157     BranchReader(branchETmis,line,lhcoETmisID);
     159    BranchReaderETmis(branchETmis,line);
    158160
    159161  } // event loop
     
    173175    for (unsigned int i=0; i< branch_size; i++) {
    174176        particle = (TRootParticle*) branch->At(i);
    175         double temp =  sqrt(particle->PT*particle->PT + particle->Pz * particle->Pz);
    176177        TLorentzVector pmu;
    177178        pmu.SetPtEtaPhiE(particle->PT, particle->Eta, particle->Phi, particle->E);
     
    217218    // return outfile;
    218219}
     220
     221//ostringstream LHCOConverter::BranchReader(const TClonesArray* branch, unsigned int& line, unsigned short int lhcoID) const {
     222void LHCOConverter::BranchReaderETmis(const TClonesArray* branch, unsigned int& line) const {
     223    //ostringstream outfile;
     224    ofstream outfile( outputfilename_.c_str(),ios_base::app);
     225    TRootETmis * particle = 0;
     226    particle = (TRootETmis*) branch->At(0);
     227    outfile << fixed << setprecision(3)
     228            << setw(3) << line++    // line counter
     229            << setw(4) << 6 << " "   // object ID in lhco format
     230            << setw(7) << 0.000 <<" "
     231            << setw(7) << particle->Phi <<" "
     232            << setw(7) << particle->ET  <<" "
     233            << setw(7) << 0. <<" "       // invariant mass
     234            << setw(7) << 0  <<" "       // number of tracks
     235            << setw(7) << 0.  <<" "
     236            << setw(7) << 0. <<" "      // E_had/E_em
     237            << setw(7) << 0.0 << setw(7) << 0.0  // dummy/dummy
     238            << endl;
     239
     240    outfile.close();
     241    // return outfile;
     242}
     243
     244
Note: See TracChangeset for help on using the changeset viewer.