Go to the documentation of this file.00001
00002
00003
00004
00005
00007 #include <memory>
00008 #include <string>
00009 #include "FWCore/Framework/interface/Frameworkfwd.h"
00010 #include "FWCore/Framework/interface/EDProducer.h"
00011 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00012 #include "FWCore/Framework/interface/Event.h"
00013 #include "FWCore/Framework/interface/MakerMacros.h"
00014 #include "FWCore/Framework/interface/EventSetup.h"
00015 #include "FWCore/Framework/interface/ESHandle.h"
00016
00017 #include "RecoRomanPot/RecoFP420/interface/TrackerizerFP420.h"
00018 #include "DataFormats/FP420Cluster/interface/ClusterCollectionFP420.h"
00019 #include "DataFormats/FP420Cluster/interface/TrackCollectionFP420.h"
00020
00021 #include <iostream>
00022 using namespace std;
00023
00024
00025 namespace cms
00026 {
00027 TrackerizerFP420::TrackerizerFP420(const edm::ParameterSet& conf):conf_(conf) {
00028
00029 std::string alias ( conf.getParameter<std::string>("@module_label") );
00030
00031 produces<TrackCollectionFP420>().setBranchAlias( alias );
00032
00033 trackerContainers.clear();
00034 trackerContainers = conf.getParameter<std::vector<std::string> >("ROUList");
00035
00036 verbosity = conf_.getUntrackedParameter<int>("VerbosityLevel");
00037 if (verbosity > 0) {
00038 std::cout << "Creating a TrackerizerFP420" << std::endl;
00039 }
00040
00041
00042 sFP420TrackMain_ = new FP420TrackMain(conf_);
00043
00044 }
00045
00046
00047 TrackerizerFP420::~TrackerizerFP420() {
00048 delete sFP420TrackMain_;
00049 }
00050
00051
00052 void TrackerizerFP420::beginJob() {
00053 if (verbosity > 0) {
00054 std::cout << "BeginJob method " << std::endl;
00055 }
00056 }
00057
00058
00059 void TrackerizerFP420::produce(edm::Event& iEvent, const edm::EventSetup& iSetup)
00060 {
00061
00062
00063 using namespace edm;
00064 using namespace std;
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080 Handle<ClusterCollectionFP420> input;
00081 iEvent.getByLabel( trackerContainers[0] , input);
00082
00083
00084
00085
00086
00087 std::auto_ptr<TrackCollectionFP420> toutput(new TrackCollectionFP420);
00088
00089
00090
00091
00092
00093
00094 std::vector<TrackFP420> collector;
00095 collector.clear();
00096 TrackCollectionFP420::Range inputRange;
00097 inputRange.first = collector.begin();
00098 inputRange.second = collector.end();
00099
00100 unsigned int detID = 0;
00101 toutput->putclear(inputRange,detID);
00102
00103 unsigned int StID = 1111;
00104 toutput->putclear(inputRange,StID);
00105 StID = 2222;
00106 toutput->putclear(inputRange,StID);
00107
00108
00109
00110
00111 toutput->clear();
00112
00113
00114
00115 sFP420TrackMain_->run(input, toutput);
00116
00117
00118
00119 iEvent.put(toutput);
00120 }
00121
00122 }
00123
00124