Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #include <iostream>
00017 #include <memory>
00018 #include <string>
00019
00020 #include "RoadSearchSeedFinder.h"
00021
00022 #include "DataFormats/TrackerRecHit2D/interface/SiStripMatchedRecHit2DCollection.h"
00023 #include "DataFormats/TrackerRecHit2D/interface/SiStripRecHit2DCollection.h"
00024 #include "DataFormats/TrackerRecHit2D/interface/SiPixelRecHitCollection.h"
00025
00026 #include "DataFormats/RoadSearchSeed/interface/RoadSearchSeedCollection.h"
00027
00028 #include "DataFormats/Common/interface/Handle.h"
00029 #include "FWCore/Framework/interface/ESHandle.h"
00030 #include "FWCore/Framework/interface/EventSetup.h"
00031
00032 #include "FWCore/Utilities/interface/InputTag.h"
00033 #include "RecoTracker/SpecialSeedGenerators/interface/ClusterChecker.h"
00034
00035 RoadSearchSeedFinder::RoadSearchSeedFinder(edm::ParameterSet const& conf) :
00036 roadSearchSeedFinderAlgorithm_(conf) ,
00037 conf_(conf)
00038 {
00039 produces<RoadSearchSeedCollection>();
00040
00041 }
00042
00043
00044
00045 RoadSearchSeedFinder::~RoadSearchSeedFinder() { }
00046
00047
00048 void RoadSearchSeedFinder::produce(edm::Event& e, const edm::EventSetup& es)
00049 {
00050
00051
00052 edm::InputTag matchedStripRecHitsInputTag = conf_.getParameter<edm::InputTag>("matchedStripRecHits");
00053 edm::InputTag rphiStripRecHitsInputTag = conf_.getParameter<edm::InputTag>("rphiStripRecHits");
00054 edm::InputTag stereoStripRecHitsInputTag = conf_.getParameter<edm::InputTag>("stereoStripRecHits");
00055 edm::InputTag clusterCollectionInputTag = conf_.getParameter<edm::InputTag>("ClusterCollectionLabel");
00056
00057
00058 edm::Handle<SiStripMatchedRecHit2DCollection> matchedRecHits;
00059 e.getByLabel(matchedStripRecHitsInputTag ,matchedRecHits);
00060 edm::Handle<SiStripRecHit2DCollection> rphiRecHits;
00061 e.getByLabel(rphiStripRecHitsInputTag ,rphiRecHits);
00062 edm::Handle<SiStripRecHit2DCollection> stereoRecHits;
00063 e.getByLabel(stereoStripRecHitsInputTag ,stereoRecHits);
00064
00065
00066 edm::InputTag pixelRecHitsInputTag = conf_.getParameter<edm::InputTag>("pixelRecHits");
00067
00068
00069
00070
00071 static const SiPixelRecHitCollection s_empty;
00072 const SiPixelRecHitCollection *pixelRecHitCollection = &s_empty;
00073 edm::Handle<SiPixelRecHitCollection> pixelRecHits;
00074 if( e.getByLabel(pixelRecHitsInputTag, pixelRecHits)) {
00075 pixelRecHitCollection = pixelRecHits.product();
00076 } else {
00077 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.";
00078 }
00079
00080
00081 std::auto_ptr<RoadSearchSeedCollection> output(new RoadSearchSeedCollection);
00082
00083 ClusterChecker check(conf_);
00084
00085
00086 size_t clustsOrZero = check.tooManyClusters(e);
00087 if (!clustsOrZero) {
00088
00089 roadSearchSeedFinderAlgorithm_.run(rphiRecHits.product(),
00090 stereoRecHits.product(),
00091 matchedRecHits.product(),
00092 pixelRecHitCollection,
00093 es,
00094 *output);
00095 } else {
00096 edm::LogError("TooManyClusters") << "Found too many clusters (" << clustsOrZero << "), bailing out.\n";
00097 }
00098
00099
00100 e.put(output);
00101
00102 }