File indexing completed on 2024-04-06 12:04:43
0001 #include "DataFormats/Math/test/ReadMath.h"
0002 #include "DataFormats/Math/interface/Vector3D.h"
0003 #include "DataFormats/Common/interface/Handle.h"
0004 #include "FWCore/Framework/interface/Event.h"
0005 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0006 #include <vector>
0007 #include <iostream>
0008 using namespace std;
0009 using namespace edm;
0010
0011 ReadMath::ReadMath(const ParameterSet& cfg) : src(cfg.getParameter<InputTag>("src")) {}
0012
0013 void ReadMath::analyze(const Event& evt, const EventSetup&) {
0014 typedef math::XYZVector Vector;
0015 Handle<vector<Vector> > v;
0016 evt.getByLabel(src, v);
0017 cout << ">>> v = [ ";
0018 for (size_t i = 0; i < v->size(); ++i)
0019 cout << (*v)[i] << ", ";
0020 cout << " ]" << endl;
0021 }