File indexing completed on 2024-04-06 12:33:40
0001
0002
0003
0004 #include "FWCore/Utilities/interface/InputTag.h"
0005 #include "DataFormats/Common/interface/Handle.h"
0006 #include "DataFormats/JetReco/interface/CaloJet.h"
0007
0008 #include "PhysicsTools/FWLite/interface/EventContainer.h"
0009 #include "PhysicsTools/FWLite/interface/CommandLineParser.h"
0010
0011
0012 #include "TString.h"
0013 #include "TROOT.h"
0014
0015 using namespace std;
0016
0017
0018
0019
0020
0021
0022
0023 int main (int argc, char* argv[])
0024 {
0025
0026
0027
0028
0029
0030
0031
0032
0033 optutl::CommandLineParser parser ("");
0034
0035
0036
0037
0038
0039
0040
0041 parser.parseArguments (argc, argv);
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051 fwlite::EventContainer eventCont (parser);
0052
0053
0054
0055
0056
0057
0058
0059
0060
0061 gROOT->SetStyle ("Plain");
0062
0063
0064
0065
0066
0067
0068
0069
0070
0071 edm::Handle< std::vector< reco::CaloJet> > jetHandle;
0072 edm::InputTag jetLabel ("sisCone5CaloJets");
0073
0074 for (eventCont.toBegin(); ! eventCont.atEnd(); ++eventCont)
0075 {
0076
0077 cout << "run " << eventCont.eventAuxiliary().run() << " event "
0078 << eventCont.eventAuxiliary().event() << endl;
0079 cout << " index Et eta phi" << endl;
0080
0081
0082
0083
0084
0085 eventCont.getByLabel (jetLabel, jetHandle);
0086 assert (jetHandle.isValid());
0087 const std::vector< reco::CaloJet > &jetVec( *jetHandle.product() );
0088 int index = 0;
0089 for (std::vector< reco::CaloJet >::const_iterator iter = jetVec.begin();
0090 jetVec.end() != iter;
0091 ++iter, ++index)
0092 {
0093 cout << " " << setw(2) << index << ") ";
0094 cout << setw(8) << Form ("%8.4f", iter->et() ) << " "
0095 << setw(8) << Form ("%8.4f", iter->eta()) << " "
0096 << setw(8) << Form ("%8.4f", iter->phi()) << " " << endl;
0097 }
0098
0099 }
0100
0101
0102
0103
0104
0105
0106
0107
0108
0109
0110
0111
0112 return 0;
0113 }