Go to the documentation of this file.00001
00002
00003
00004 #include "FWCore/Utilities/interface/InputTag.h"
00005 #include "DataFormats/Common/interface/Handle.h"
00006 #include "DataFormats/JetReco/interface/CaloJet.h"
00007
00008 #include "PhysicsTools/FWLite/interface/EventContainer.h"
00009 #include "PhysicsTools/FWLite/interface/CommandLineParser.h"
00010
00011
00012 #include "TString.h"
00013 #include "TROOT.h"
00014
00015 using namespace std;
00016
00018
00019
00020
00022
00023 int main (int argc, char* argv[])
00024 {
00026
00027
00028
00030
00031
00032
00033 optutl::CommandLineParser parser ("");
00034
00036
00037
00039
00040
00041 parser.parseArguments (argc, argv);
00042
00044
00045
00046
00048
00049
00050
00051 fwlite::EventContainer eventCont (parser);
00052
00054
00055
00056
00057
00059
00060
00061 gROOT->SetStyle ("Plain");
00062
00063
00064
00066
00067
00068
00070
00071 edm::Handle< std::vector< reco::CaloJet> > jetHandle;
00072 edm::InputTag jetLabel ("sisCone5CaloJets");
00073
00074 for (eventCont.toBegin(); ! eventCont.atEnd(); ++eventCont)
00075 {
00076
00077 cout << "run " << eventCont.eventAuxiliary().run() << " event "
00078 << eventCont.eventAuxiliary().event() << endl;
00079 cout << " index Et eta phi" << endl;
00080
00081
00083
00085 eventCont.getByLabel (jetLabel, jetHandle);
00086 assert (jetHandle.isValid());
00087 const std::vector< reco::CaloJet > &jetVec( *jetHandle.product() );
00088 int index = 0;
00089 for (std::vector< reco::CaloJet >::const_iterator iter = jetVec.begin();
00090 jetVec.end() != iter;
00091 ++iter, ++index)
00092 {
00093 cout << " " << setw(2) << index << ") ";
00094 cout << setw(8) << Form ("%8.4f", iter->et() ) << " "
00095 << setw(8) << Form ("%8.4f", iter->eta()) << " "
00096 << setw(8) << Form ("%8.4f", iter->phi()) << " " << endl;
00097 }
00098
00099 }
00100
00101
00103
00104
00105
00107
00108
00109
00110
00111
00112 return 0;
00113 }