Fork me on GitHub

Changeset 313 in svn


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

OK etmis and plus joli

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Delphes.cpp

    r312 r313  
    158158 
    159159  srand (time (NULL));         /* Initialisation du générateur */
    160   TStopwatch globalwatch, loopwatch, triggerwatch, frogwatch;
     160  TStopwatch globalwatch, loopwatch, triggerwatch, frogwatch, lhcowatch;
    161161  globalwatch.Start();
    162162 
     
    716716    FROG->BuildGeom();
    717717    delete FROG;
     718    cout <<"**                  Exiting FROG preparation...                    **"<< endl;
    718719  }
    719720  frogwatch.Stop();
    720721 
    721722  // 3.3 *************** LHCO output
     723  lhcowatch.Start();
    722724  if(DET->FLAG_lhco == 1){
    723725    cout <<"**                                                                 **"<<endl;
    724726    cout <<"**        ############ Start LHCO convertion ############          **"<< endl;
    725     /*
    726     //create output log-file name
    727     string forLogLHCO = outputfilename;
    728     string LogNameLHCO = forLogLHCO.erase(forLogLHCO.find(".root"));
    729     LogNameLHCO = LogNameLHCO+"_events.lhco";
    730     */
    731727   
    732728    //LHCOConverter *LHCO = new LHCOConverter(outputfilename,LogNameLHCO);
     
    735731    LHCO->ConvertExRootAnalysisToLHCO();
    736732    delete LHCO;
     733    cout <<"**                  Exiting LHCO converstion...                    **"<< endl;
    737734  }
     735  lhcowatch.Stop();
    738736 
    739737 
     
    778776           << right << setw(15) <<frogwatch.RealTime()<<""
    779777           << right << setw(14)  <<"**"<<endl;
    780      
    781     }
     778    }
     779  if(DET->FLAG_lhco == 1)
     780    {
     781      cout << left  << setw(10) <<"**"<<""
     782           << left  << setw(15) <<" +  LHCO:"<<""
     783           << right << setw(15) <<lhcowatch.CpuTime()<<""
     784           << right << setw(15) <<lhcowatch.RealTime()<<""
     785           << right << setw(14)  <<"**"<<endl;
     786    }
     787
    782788 
    783789  cout <<"**                                                                 **"<< endl;
  • trunk/interface/LHCOConverter.h

    r288 r313  
    5555  //ostringstream BranchReader(const TClonesArray*, unsigned int&, unsigned short int ) const; // put it as a operator<<
    5656  void BranchReader(const TClonesArray*, unsigned int&, unsigned short int ) const;
     57  void BranchReaderETmis(const TClonesArray* branch, unsigned int& line) const; 
    5758  const string inputfilename_;
    5859  string inputlogname_;
  • 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.