- Timestamp:
- Mar 10, 2009, 12:57:20 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/LHCOConverter.cc
r310 r313 63 63 const unsigned int r_find = outputfilename_.rfind(".root"); 64 64 if(r_find > outputfilename_.size()) { 65 c out<< "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; 66 66 } 67 67 else { … … 69 69 ofstream outfile( outputfilename_.c_str()); 70 70 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 72 75 } 73 76 } … … 127 130 128 131 Long64_t Nevents = analysisTree->GetEntries(); 129 cout << "** TTree 'Analysis' contains " << Nevents << " events" << endl;130 132 Nevents = min(Nevents,triggerTree->GetEntries()); 131 133 if (Nevents != analysisTree->GetEntries()) … … 155 157 156 158 // 6 MET 157 BranchReader (branchETmis,line,lhcoETmisID);159 BranchReaderETmis(branchETmis,line); 158 160 159 161 } // event loop … … 173 175 for (unsigned int i=0; i< branch_size; i++) { 174 176 particle = (TRootParticle*) branch->At(i); 175 double temp = sqrt(particle->PT*particle->PT + particle->Pz * particle->Pz);176 177 TLorentzVector pmu; 177 178 pmu.SetPtEtaPhiE(particle->PT, particle->Eta, particle->Phi, particle->E); … … 217 218 // return outfile; 218 219 } 220 221 //ostringstream LHCOConverter::BranchReader(const TClonesArray* branch, unsigned int& line, unsigned short int lhcoID) const { 222 void 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.