00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #include <memory>
00017 #include <string>
00018
00019 #include "RecoTracker/RoadSearchCloudMaker/interface/RoadSearchCloudMaker.h"
00020
00021 #include "DataFormats/RoadSearchSeed/interface/RoadSearchSeedCollection.h"
00022 #include "DataFormats/RoadSearchCloud/interface/RoadSearchCloudCollection.h"
00023 #include "DataFormats/TrackerRecHit2D/interface/SiStripMatchedRecHit2DCollection.h"
00024 #include "DataFormats/TrackerRecHit2D/interface/SiStripRecHit2DCollection.h"
00025
00026 #include "DataFormats/Common/interface/Handle.h"
00027 #include "FWCore/Framework/interface/ESHandle.h"
00028 #include "FWCore/Framework/interface/EventSetup.h"
00029
00030 RoadSearchCloudMaker::RoadSearchCloudMaker(edm::ParameterSet const& conf) :
00031 roadSearchCloudMakerAlgorithm_(conf) ,
00032 conf_(conf)
00033 {
00034 produces<RoadSearchCloudCollection>();
00035
00036
00037 matchedStripRecHitsInputTag_ = conf_.getParameter<edm::InputTag>("matchedStripRecHits");
00038 rphiStripRecHitsInputTag_ = conf_.getParameter<edm::InputTag>("rphiStripRecHits");
00039 stereoStripRecHitsInputTag_ = conf_.getParameter<edm::InputTag>("stereoStripRecHits");
00040 pixelRecHitsInputTag_ = conf_.getParameter<edm::InputTag>("pixelRecHits");
00041
00042
00043 seedProducer_ = conf_.getParameter<edm::InputTag>("SeedProducer");
00044
00045 }
00046
00047
00048
00049 RoadSearchCloudMaker::~RoadSearchCloudMaker() { }
00050
00051
00052 void RoadSearchCloudMaker::produce(edm::Event& e, const edm::EventSetup& es)
00053 {
00054
00055
00056 edm::Handle<RoadSearchSeedCollection> seedHandle;
00057 e.getByLabel(seedProducer_, seedHandle);
00058
00059
00060 edm::Handle<SiStripRecHit2DCollection> rphirecHitHandle;
00061 e.getByLabel(rphiStripRecHitsInputTag_ ,rphirecHitHandle);
00062 const SiStripRecHit2DCollection *rphiRecHitCollection = rphirecHitHandle.product();
00063 edm::Handle<SiStripRecHit2DCollection> stereorecHitHandle;
00064 e.getByLabel(stereoStripRecHitsInputTag_ ,stereorecHitHandle);
00065 const SiStripRecHit2DCollection *stereoRecHitCollection = stereorecHitHandle.product();
00066
00067
00068
00069
00070 static const SiStripMatchedRecHit2DCollection s_empty0;
00071 const SiStripMatchedRecHit2DCollection *matchedRecHitCollection = &s_empty0;
00072 edm::Handle<SiStripMatchedRecHit2DCollection> matchedRecHits;
00073 if( e.getByLabel(matchedStripRecHitsInputTag_, matchedRecHits)) {
00074 matchedRecHitCollection = matchedRecHits.product();
00075 } else {
00076 LogDebug("RoadSearch") << "Collection SiStripMatchedRecHit2DCollection with InputTag " << matchedStripRecHitsInputTag_ << " cannot be found, using empty collection of same type. The RoadSearch algorithm is also fully functional without matched RecHits.";
00077 }
00078
00079
00080
00081
00082 static const SiPixelRecHitCollection s_empty1;
00083 const SiPixelRecHitCollection *pixelRecHitCollection = &s_empty1;
00084 edm::Handle<SiPixelRecHitCollection> pixelRecHits;
00085 if( e.getByLabel(pixelRecHitsInputTag_, pixelRecHits)) {
00086 pixelRecHitCollection = pixelRecHits.product();
00087 } else {
00088 LogDebug("RoadSearch") << "Collection SiPixelRecHitCollection with InputTag " << pixelRecHitsInputTag_ << " cannot be found, using empty collection of same type. The RoadSearch algorithm is also fully functional without Pixel RecHits.";
00089 }
00090
00091
00092
00093 std::auto_ptr<RoadSearchCloudCollection> output(new RoadSearchCloudCollection);
00094
00095
00096 roadSearchCloudMakerAlgorithm_.run(seedHandle,
00097 rphiRecHitCollection,
00098 stereoRecHitCollection,
00099 matchedRecHitCollection,
00100 pixelRecHitCollection,
00101 es,
00102 *output);
00103
00104
00105 e.put(output);
00106
00107 }