Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-09-27 04:04:52

0001 #ifndef CtfSpecialSeedGenerator_H
0002 #define CtfSpecialSeedGenerator_H
0003 
0004 /** \class CombinatorialSeedGeneratorForCOsmics
0005  *  A concrete seed generator providing seeds constructed 
0006  *  from combinations of hits in pairs of strip layers 
0007  */
0008 //FWK
0009 #include "FWCore/Framework/interface/stream/EDProducer.h"
0010 #include "FWCore/Framework/interface/Event.h"
0011 #include "FWCore/Framework/interface/EventSetup.h"
0012 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0013 #include "FWCore/Framework/interface/ESHandle.h"
0014 //DataFormats
0015 #include "DataFormats/Common/interface/Handle.h"
0016 #include "DataFormats/TrajectorySeed/interface/TrajectorySeedCollection.h"
0017 #include "DataFormats/GeometrySurface/interface/BoundPlane.h"
0018 //RecoTracker
0019 #include "RecoTracker/TransientTrackingRecHit/interface/TkTransientTrackingRecHitBuilder.h"
0020 #include "RecoTracker/Record/interface/CkfComponentsRecord.h"
0021 #include "RecoTracker/TkSeedingLayers/interface/SeedingLayerSetsBuilder.h"
0022 #include "RecoTracker/TkSeedingLayers/interface/SeedingHitSet.h"
0023 #include "RecoTracker/TkTrackingRegions/interface/OrderedHitsGenerator.h"
0024 #include "RecoTracker/TkTrackingRegions/interface/TrackingRegionProducer.h"
0025 #include "RecoTracker/SpecialSeedGenerators/interface/SeedFromGenericPairOrTriplet.h"
0026 //#include "RecoTracker/SpecialSeedGenerators/interface/GenericPairOrTripletGenerator.h"
0027 //#include "RecoTracker/SpecialSeedGenerators/interface/SeedCleaner.h"
0028 //MagneticField
0029 #include "MagneticField/Engine/interface/MagneticField.h"
0030 //TrackingTools
0031 #include "TrackingTools/TrajectoryState/interface/TrajectoryStateTransform.h"
0032 #include "TrackingTools/Records/interface/TrackingComponentsRecord.h"
0033 #include "TrackingTools/DetLayers/interface/NavigationDirection.h"
0034 //Geometry
0035 #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h"
0036 #include "RecoTracker/SpecialSeedGenerators/interface/ClusterChecker.h"
0037 
0038 #include <map>
0039 
0040 class CtfSpecialSeedGenerator : public edm::stream::EDProducer<> {
0041 public:
0042   typedef TrajectoryStateOnSurface TSOS;
0043 
0044   CtfSpecialSeedGenerator(const edm::ParameterSet& conf);
0045 
0046   ~CtfSpecialSeedGenerator() override;  //{};
0047 
0048   void beginRun(edm::Run const&, edm::EventSetup const&) override;
0049   void endRun(edm::Run const&, edm::EventSetup const&) override;
0050 
0051   void produce(edm::Event& e, const edm::EventSetup& c) override;
0052 
0053 private:
0054   bool run(const edm::EventSetup& c, const edm::Event& e, TrajectorySeedCollection& output);
0055 
0056   bool buildSeeds(const edm::EventSetup& iSetup,
0057                   const edm::Event& e,
0058                   const OrderedSeedingHits& osh,
0059                   const NavigationDirection& navdir,
0060                   const PropagationDirection& dir,
0061                   TrajectorySeedCollection& output);
0062   //checks that the hits used are at positive y and are on different layers
0063   bool preliminaryCheck(const SeedingHitSet& shs, const edm::EventSetup& es);
0064   //We can check if the seed  points in a region covered by scintillators. To be used only in noB case
0065   //because it uses StraightLinePropagation
0066   bool postCheck(const TrajectorySeed& seed);
0067 
0068 private:
0069   edm::ParameterSet conf_;
0070 
0071   const edm::ESGetToken<MagneticField, IdealMagneticFieldRecord> theMFToken;
0072   const edm::ESGetToken<TransientTrackingRecHitBuilder, TransientRecHitRecord> theBuilderToken;
0073   const edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> theTrackerToken;
0074   const edm::ESGetToken<Propagator, TrackingComponentsRecord> thePropAlongToken;
0075   const edm::ESGetToken<Propagator, TrackingComponentsRecord> thePropOppositeToken;
0076   const edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> theTopoToken;
0077 
0078   edm::ESHandle<MagneticField> theMagfield;
0079   edm::ESHandle<TrackerGeometry> theTracker;
0080   edm::ESHandle<TransientTrackingRecHitBuilder> theBuilder;
0081   //edm::ESHandle<SeedCleaner> theCleaner;
0082   //OrderedHitsGenerator*  hitsGeneratorOutIn;
0083   //OrderedHitsGenerator*  hitsGeneratorInOut;
0084   //PropagationDirection inOutPropagationDirection;
0085   //PropagationDirection outInPropagationDirection;
0086   //GenericPairOrTripletGenerator* hitsGeneratorOutIn;
0087   //GenericPairOrTripletGenerator* hitsGeneratorInOut;
0088   std::vector<std::unique_ptr<OrderedHitsGenerator> > theGenerators;
0089   std::vector<PropagationDirection> thePropDirs;
0090   std::vector<NavigationDirection> theNavDirs;
0091   std::unique_ptr<TrackingRegionProducer> theRegionProducer;
0092   //TrajectoryStateTransform theTransformer;
0093   std::unique_ptr<SeedFromGenericPairOrTriplet> theSeedBuilder;
0094   bool useScintillatorsConstraint;
0095   BoundPlane::BoundPlanePointer upperScintillator;
0096   BoundPlane::BoundPlanePointer lowerScintillator;
0097   bool requireBOFF;
0098   int32_t theMaxSeeds;
0099   ClusterChecker check;
0100 };
0101 #endif