File indexing completed on 2024-04-06 12:28:44
0001 #ifndef SimpleCosmicBONSeeder_h
0002 #define SimpleCosmicBONSeeder_h
0003
0004 #include "FWCore/Framework/interface/stream/EDProducer.h"
0005 #include "FWCore/Framework/interface/Event.h"
0006 #include "DataFormats/Common/interface/Handle.h"
0007 #include "FWCore/Framework/interface/EventSetup.h"
0008 #include "FWCore/Framework/interface/ESHandle.h"
0009 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0010 #include "FWCore/Utilities/interface/InputTag.h"
0011 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0012 #include "FWCore/Utilities/interface/EDGetToken.h"
0013
0014 #include "DataFormats/GeometryCommonDetAlgo/interface/GlobalError.h"
0015 #include "DataFormats/TrackerRecHit2D/interface/SiStripMatchedRecHit2DCollection.h"
0016 #include "DataFormats/TrackerRecHit2D/interface/SiStripRecHit2DCollection.h"
0017 #include "DataFormats/TrajectorySeed/interface/TrajectorySeedCollection.h"
0018 #include "DataFormats/SiStripDetId/interface/StripSubdetector.h"
0019
0020 #include "Geometry/Records/interface/TrackerDigiGeometryRecord.h"
0021 #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h"
0022 #include "MagneticField/Engine/interface/MagneticField.h"
0023 #include "MagneticField/Records/interface/IdealMagneticFieldRecord.h"
0024
0025 #include "RecoTracker/PixelSeeding/interface/OrderedHitTriplets.h"
0026 #include "RecoTracker/TkTrackingRegions/interface/GlobalTrackingRegion.h"
0027 #include "RecoTracker/TkSeedGenerator/interface/FastCircle.h"
0028 #include "RecoTracker/TkSeedGenerator/interface/FastHelix.h"
0029 #include "RecoTracker/SpecialSeedGenerators/interface/ClusterChecker.h"
0030
0031 #include "TrackingTools/KalmanUpdators/interface/KFUpdator.h"
0032 #include "TrackingTools/MaterialEffects/interface/PropagatorWithMaterial.h"
0033 #include "TrackingTools/TrajectoryState/interface/TrajectoryStateTransform.h"
0034 #include "TrackingTools/TransientTrackingRecHit/interface/TransientTrackingRecHit.h"
0035 #include "TrackingTools/TransientTrackingRecHit/interface/TransientTrackingRecHitBuilder.h"
0036 #include "TrackingTools/Records/interface/TransientRecHitRecord.h"
0037 #include "RecoTracker/TransientTrackingRecHit/interface/TkTransientTrackingRecHitBuilder.h"
0038
0039 class SeedingLayerSetsHits;
0040
0041 class SimpleCosmicBONSeeder : public edm::stream::EDProducer<> {
0042 public:
0043 explicit SimpleCosmicBONSeeder(const edm::ParameterSet &conf);
0044
0045 ~SimpleCosmicBONSeeder() override {}
0046
0047 void produce(edm::Event &e, const edm::EventSetup &c) override;
0048
0049 void init(const edm::EventSetup &c);
0050 bool triplets(const edm::Event &e);
0051 bool seeds(TrajectorySeedCollection &output);
0052 void done();
0053
0054 bool goodTriplet(const GlobalPoint &inner,
0055 const GlobalPoint &middle,
0056 const GlobalPoint &outer,
0057 const double &minRho) const;
0058
0059 std::pair<GlobalVector, int> pqFromHelixFit(const GlobalPoint &inner,
0060 const GlobalPoint &middle,
0061 const GlobalPoint &outer) const;
0062
0063 private:
0064 const edm::EDGetTokenT<SeedingLayerSetsHits> seedingLayerToken_;
0065 const edm::ESGetToken<MagneticField, IdealMagneticFieldRecord> magfieldToken_;
0066 const edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> trackerToken_;
0067 const edm::ESGetToken<TransientTrackingRecHitBuilder, TransientRecHitRecord> ttrhBuilderToken_;
0068 GlobalTrackingRegion region_;
0069 double pMin_;
0070 bool writeTriplets_;
0071
0072 bool seedOnMiddle_;
0073 double rescaleError_;
0074
0075 uint32_t tripletsVerbosity_, seedVerbosity_, helixVerbosity_;
0076
0077 const MagneticField *magfield;
0078 const TrackerGeometry *tracker;
0079 TkClonerImpl cloner;
0080 KFUpdator *theUpdator;
0081 PropagatorWithMaterial *thePropagatorAl;
0082 PropagatorWithMaterial *thePropagatorOp;
0083
0084 ClusterChecker check_;
0085 int32_t maxTriplets_, maxSeeds_;
0086
0087 OrderedHitTriplets hitTriplets;
0088
0089 int goodHitsPerSeed_;
0090 bool checkCharge_;
0091 bool matchedRecHitUsesAnd_;
0092 std::vector<int32_t> chargeThresholds_;
0093 bool checkMaxHitsPerModule_;
0094 std::vector<int32_t> maxHitsPerModule_;
0095 bool checkCharge(const TrackingRecHit *hit) const;
0096 bool checkCharge(const SiStripRecHit2D &hit, int subdetid) const;
0097 void checkNoisyModules(const std::vector<SeedingHitSet::ConstRecHitPointer> &hits, std::vector<bool> &oks) const;
0098
0099
0100 bool positiveYOnly;
0101 bool negativeYOnly;
0102
0103 };
0104
0105 #endif