00001 #ifndef SimpleCosmicBONSeeder_h
00002 #define SimpleCosmicBONSeeder_h
00003
00004 #include "FWCore/Framework/interface/EDProducer.h"
00005 #include "FWCore/Framework/interface/Event.h"
00006 #include "DataFormats/Common/interface/Handle.h"
00007 #include "FWCore/Framework/interface/EventSetup.h"
00008 #include "FWCore/Framework/interface/ESHandle.h"
00009 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00010 #include "FWCore/ParameterSet/interface/InputTag.h"
00011 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00012
00013 #include "DataFormats/GeometryCommonDetAlgo/interface/GlobalError.h"
00014 #include "DataFormats/TrackerRecHit2D/interface/SiStripMatchedRecHit2DCollection.h"
00015 #include "DataFormats/TrackerRecHit2D/interface/SiStripRecHit2DCollection.h"
00016 #include "DataFormats/TrajectorySeed/interface/TrajectorySeedCollection.h"
00017 #include "DataFormats/SiStripDetId/interface/StripSubdetector.h"
00018
00019 #include "Geometry/Records/interface/TrackerDigiGeometryRecord.h"
00020 #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h"
00021 #include "MagneticField/Engine/interface/MagneticField.h"
00022 #include "MagneticField/Records/interface/IdealMagneticFieldRecord.h"
00023
00024 #include "RecoPixelVertexing/PixelTriplets/interface/OrderedHitTriplets.h"
00025 #include "RecoTracker/TkTrackingRegions/interface/GlobalTrackingRegion.h"
00026 #include "RecoTracker/TkSeedGenerator/interface/FastCircle.h"
00027 #include "RecoTracker/TkSeedGenerator/interface/FastHelix.h"
00028 #include "RecoTracker/SpecialSeedGenerators/interface/ClusterChecker.h"
00029 #include "RecoTracker/TkSeedingLayers/interface/SeedingLayerSetsBuilder.h"
00030
00031 #include "TrackingTools/KalmanUpdators/interface/KFUpdator.h"
00032 #include "TrackingTools/MaterialEffects/interface/PropagatorWithMaterial.h"
00033 #include "TrackingTools/TrajectoryState/interface/TrajectoryStateTransform.h"
00034 #include "TrackingTools/TransientTrackingRecHit/interface/TransientTrackingRecHit.h"
00035 #include "TrackingTools/TransientTrackingRecHit/interface/TransientTrackingRecHitBuilder.h"
00036 #include "TrackingTools/Records/interface/TransientRecHitRecord.h"
00037
00038 class SimpleCosmicBONSeeder : public edm::EDProducer
00039 {
00040 public:
00041
00042 explicit SimpleCosmicBONSeeder(const edm::ParameterSet& conf);
00043
00044 virtual ~SimpleCosmicBONSeeder() {}
00045
00046 virtual void produce(edm::Event& e, const edm::EventSetup& c);
00047
00048 void init(const edm::EventSetup& c);
00049 bool triplets(const edm::Event &e , const edm::EventSetup& c);
00050 bool seeds(TrajectorySeedCollection &output, const edm::EventSetup& iSetup);
00051 void done();
00052
00053 bool goodTriplet(const GlobalPoint &inner, const GlobalPoint & middle, const GlobalPoint & outer, const double & minRho) const ;
00054
00055 std::pair<GlobalVector,int>
00056 pqFromHelixFit(const GlobalPoint &inner, const GlobalPoint & middle, const GlobalPoint & outer, const edm::EventSetup& iSetup) const ;
00057
00058 private:
00059 edm::ParameterSet conf_;
00060 std::string builderName;
00061
00062 SeedingLayerSetsBuilder theLsb;
00063 GlobalTrackingRegion region_;
00064 double pMin_;
00065 bool writeTriplets_;
00066
00067 bool seedOnMiddle_;
00068 double rescaleError_;
00069
00070 uint32_t tripletsVerbosity_,seedVerbosity_, helixVerbosity_;
00071 std::vector<std::string> layerTripletNames_;
00072
00073 edm::ESHandle<MagneticField> magfield;
00074 edm::ESHandle<TrackerGeometry> tracker;
00075 edm::ESHandle<TransientTrackingRecHitBuilder> TTTRHBuilder;
00076 KFUpdator *theUpdator;
00077 PropagatorWithMaterial *thePropagatorAl;
00078 PropagatorWithMaterial *thePropagatorOp;
00079 TrajectoryStateTransform transformer;
00080
00081 ClusterChecker check_;
00082 int32_t maxTriplets_, maxSeeds_;
00083
00084 OrderedHitTriplets hitTriplets;
00085
00086 int goodHitsPerSeed_;
00087 bool checkCharge_;
00088 bool matchedRecHitUsesAnd_;
00089 std::vector<int32_t> chargeThresholds_;
00090 bool checkMaxHitsPerModule_;
00091 std::vector<int32_t> maxHitsPerModule_;
00092 bool checkCharge(const TrackingRecHit *hit) const ;
00093 bool checkCharge(const SiStripRecHit2D &hit, int subdetid) const ;
00094 void checkNoisyModules(const std::vector<TransientTrackingRecHit::RecHitPointer> &hits, std::vector<bool> &oks) const ;
00095
00096
00097 bool positiveYOnly;
00098 bool negativeYOnly;
00099
00100 };
00101
00102 #endif