Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:46:23

0001 // -*- C++ -*-
0002 //
0003 // Package:     AnalysisDataFormats/TopObjects
0004 // Class  :     printParticle
0005 //
0006 // Implementation:
0007 //     [Notes on implementation]
0008 //
0009 // Original Author:  Christopher Jones
0010 //         Created:  Fri, 16 Oct 2020 13:25:54 GMT
0011 //
0012 
0013 // system include files
0014 
0015 // user include files
0016 #include "AnalysisDataFormats/TopObjects/src/printParticle.h"
0017 
0018 namespace ttevent {
0019   // print pt, eta, phi, mass of a given candidate into an existing LogInfo
0020   void printParticle(edm::LogInfo& log, const char* name, const reco::Candidate* cand) {
0021     if (!cand) {
0022       log << std::setw(15) << name << ": not available!\n";
0023       return;
0024     }
0025     log << std::setprecision(3) << setiosflags(std::ios::fixed | std::ios::showpoint);
0026     log << std::setw(15) << name << ": " << std::setw(7) << cand->pt() << "; " << std::setw(7) << cand->eta() << "; "
0027         << std::setw(7) << cand->phi() << "; " << resetiosflags(std::ios::fixed | std::ios::showpoint)
0028         << setiosflags(std::ios::scientific) << std::setw(10) << cand->mass() << "\n";
0029     log << resetiosflags(std::ios::scientific);
0030   }
0031 
0032 }  // namespace ttevent