Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:28:02

0001 #ifndef SeedForPhotonConversionFromQuadruplets_H
0002 #define SeedForPhotonConversionFromQuadruplets_H
0003 
0004 #include "RecoTracker/TkTrackingRegions/interface/GlobalTrackingRegion.h"
0005 #include "RecoTracker/TkSeedingLayers/interface/SeedingHitSet.h"
0006 #include "FWCore/Framework/interface/FrameworkfwdMostUsed.h"
0007 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0008 #include "DataFormats/TrajectorySeed/interface/TrajectorySeedCollection.h"
0009 
0010 #include "PrintRecoObjects.h"
0011 #include "Quad.h"
0012 
0013 #include "RecoTracker/TransientTrackingRecHit/interface/TkTransientTrackingRecHitBuilder.h"
0014 
0015 class FreeTrajectoryState;
0016 class SeedComparitor;
0017 class IdealMagneticFieldRecord;
0018 class TransientRecHitRecord;
0019 class TrackerDigiGeometryRecord;
0020 class TrackingComponentsRecord;
0021 
0022 class SeedForPhotonConversionFromQuadruplets {
0023 public:
0024   static const int cotTheta_Max = 99999;
0025 
0026   SeedForPhotonConversionFromQuadruplets(const edm::ParameterSet& cfg,
0027                                          edm::ConsumesCollector& iC,
0028                                          const edm::ParameterSet& SeedComparitorPSet);
0029 
0030   SeedForPhotonConversionFromQuadruplets(edm::ConsumesCollector& iC,
0031                                          const edm::ParameterSet& SeedComparitorPSet,
0032                                          const std::string& propagator = "PropagatorWithMaterial",
0033                                          double seedMomentumForBOFF = -5.0);
0034 
0035   //dtor
0036   ~SeedForPhotonConversionFromQuadruplets();
0037 
0038   const TrajectorySeed* trajectorySeed(TrajectorySeedCollection& seedCollection,
0039                                        const SeedingHitSet& phits,
0040                                        const SeedingHitSet& mhits,
0041                                        const TrackingRegion& region,
0042                                        const edm::Event& ev,
0043                                        const edm::EventSetup& es,
0044                                        std::stringstream& ss,
0045                                        std::vector<Quad>& quadV,
0046                                        edm::ParameterSet& QuadCutPSet);
0047 
0048   double simpleGetSlope(const SeedingHitSet::ConstRecHitPointer& ohit,
0049                         const SeedingHitSet::ConstRecHitPointer& nohit,
0050                         const SeedingHitSet::ConstRecHitPointer& ihit,
0051                         const SeedingHitSet::ConstRecHitPointer& nihit,
0052                         const TrackingRegion& region,
0053                         double& cotTheta,
0054                         double& z0);
0055   double verySimpleFit(int size, double* ax, double* ay, double* e2y, double& p0, double& e2p0, double& p1);
0056   double getSqrEffectiveErrorOnZ(const SeedingHitSet::ConstRecHitPointer& hit, const TrackingRegion& region);
0057 
0058   //
0059   // Some utility methods added by sguazz
0060   void stupidPrint(std::string s, float* d);
0061   void stupidPrint(std::string s, double* d);
0062   void stupidPrint(const char* s, GlobalPoint* d);
0063   void stupidPrint(const char* s, GlobalPoint* d, int n);
0064   void bubbleSortVsPhi(GlobalPoint arr[], int n, GlobalPoint vtx);
0065   void bubbleReverseSortVsPhi(GlobalPoint arr[], int n, GlobalPoint vtx);
0066   //
0067   //
0068 
0069 protected:
0070   bool checkHit(const TrajectoryStateOnSurface&,
0071                 const SeedingHitSet::ConstRecHitPointer& hit,
0072                 const edm::EventSetup& es) const {
0073     return true;
0074   }
0075 
0076   GlobalTrajectoryParameters initialKinematic(const SeedingHitSet& hits,
0077                                               const GlobalPoint& vertexPos,
0078                                               const edm::EventSetup& es,
0079                                               const float cotTheta) const;
0080 
0081   CurvilinearTrajectoryError initialError(const GlobalVector& vertexBounds, float ptMin, float sinTheta) const;
0082 
0083   const TrajectorySeed* buildSeed(TrajectorySeedCollection& seedCollection,
0084                                   const SeedingHitSet& hits,
0085                                   const FreeTrajectoryState& fts,
0086                                   const edm::EventSetup& es,
0087                                   bool apply_dzCut,
0088                                   const TrackingRegion& region) const;
0089 
0090   bool buildSeedBool(TrajectorySeedCollection& seedCollection,
0091                      const SeedingHitSet& hits,
0092                      const FreeTrajectoryState& fts,
0093                      const edm::EventSetup& es,
0094                      bool apply_dzCut,
0095                      const TrackingRegion& region,
0096                      double dzcut) const;
0097 
0098   SeedingHitSet::RecHitPointer refitHit(SeedingHitSet::ConstRecHitPointer hit,
0099                                         const TrajectoryStateOnSurface& state) const;
0100 
0101   bool similarQuadExist(Quad& thisQuad, std::vector<Quad>& quadV);
0102 
0103   double DeltaPhiManual(const math::XYZVector& v1, const math::XYZVector& v2);
0104 
0105 protected:
0106   edm::ESGetToken<MagneticField, IdealMagneticFieldRecord> theBfieldToken;
0107   edm::ESGetToken<TransientTrackingRecHitBuilder, TransientRecHitRecord> theTTRHBuilderToken;
0108   edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> theTrackerToken;
0109   edm::ESGetToken<Propagator, TrackingComponentsRecord> thePropagatorToken;
0110   double theBOFFMomentum;
0111   double kPI_;
0112 
0113   // FIXME (well the whole class needs to be fixed!)
0114   TkClonerImpl cloner;
0115 
0116   std::stringstream* pss;
0117   PrintRecoObjects po;
0118   std::unique_ptr<SeedComparitor> theComparitor;
0119 };
0120 #endif