Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-02-24 02:12:59

0001 #ifndef PhotonConversionFinderFromTracks_H
0002 #define PhotonConversionFinderFromTracks_H
0003 
0004 #include "FWCore/Framework/interface/Frameworkfwd.h"
0005 #include "FWCore/Framework/interface/Event.h"
0006 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0007 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0008 #include "FWCore/Utilities/interface/Visibility.h"
0009 
0010 #include "SeedForPhotonConversion1Leg.h"
0011 #include "RecoTracker/TkSeedGenerator/interface/FastHelix.h"
0012 
0013 #include "IdealHelixParameters.h"
0014 
0015 #include "PrintRecoObjects.h"
0016 
0017 #include "DataFormats/VertexReco/interface/Vertex.h"
0018 #include "DataFormats/VertexReco/interface/VertexFwd.h"
0019 #include "DataFormats/BeamSpot/interface/BeamSpot.h"
0020 #include "DataFormats/TrackReco/interface/TrackFwd.h"
0021 
0022 #include "CombinedHitPairGeneratorForPhotonConversion.h"
0023 
0024 #include "RecoTracker/TkSeedGenerator/interface/ClusterChecker.h"
0025 #include "RecoTracker/TkTrackingRegions/interface/GlobalTrackingRegionProducerFromBeamSpot.h"
0026 #include "FWCore/Framework/interface/ConsumesCollector.h"
0027 
0028 #include <sstream>
0029 
0030 inline bool lt_(std::pair<double, short> a, std::pair<double, short> b) { return a.first < b.first; }
0031 
0032 class dso_hidden PhotonConversionTrajectorySeedProducerFromSingleLegAlgo {
0033 public:
0034   PhotonConversionTrajectorySeedProducerFromSingleLegAlgo(const edm::ParameterSet&, edm::ConsumesCollector&& iC);
0035   ~PhotonConversionTrajectorySeedProducerFromSingleLegAlgo();
0036 
0037   void find(const edm::Event& event, const edm::EventSetup& setup, TrajectorySeedCollection& output);
0038 
0039   IdealHelixParameters* getIdealHelixParameters() { return &_IdealHelixParameters; }
0040 
0041 private:
0042   void loopOnTracks();
0043   bool inspectTrack(const reco::Track* track, const TrackingRegion& region, math::XYZPoint& primaryVertexPoint);
0044 
0045   bool rejectTrack(const reco::Track& track);
0046 
0047   bool selectPriVtxCompatibleWithTrack(const reco::Track& tk,
0048                                        std::vector<reco::Vertex>& selectedPriVtxCompatibleWithTrack);
0049   void loopOnPriVtx(const reco::Track& tk, const std::vector<reco::Vertex>& selectedPriVtxCompatibleWithTrack);
0050 
0051   //Data Members
0052 
0053   TrajectorySeedCollection* seedCollection = nullptr;
0054 
0055   std::unique_ptr<CombinedHitPairGeneratorForPhotonConversion> theHitsGenerator;
0056   std::unique_ptr<SeedForPhotonConversion1Leg> theSeedCreator;
0057   std::unique_ptr<GlobalTrackingRegionProducerFromBeamSpot> theRegionProducer;
0058 
0059   ClusterChecker theClusterCheck;
0060   bool theSilentOnClusterCheck;
0061 
0062   double _vtxMinDoF, _maxDZSigmas;
0063   size_t _maxNumSelVtx;
0064   bool _applyTkVtxConstraint;
0065   size_t _countSeedTracks;
0066   edm::InputTag _primaryVtxInputTag, _beamSpotInputTag;
0067   edm::EDGetTokenT<reco::VertexCollection> token_vertex;
0068   edm::EDGetTokenT<reco::BeamSpot> token_bs;
0069   edm::EDGetTokenT<reco::TrackCollection> token_refitter;
0070   edm::ESGetToken<MagneticField, IdealMagneticFieldRecord> token_magField;
0071 
0072   typedef std::vector<std::unique_ptr<TrackingRegion> > Regions;
0073   typedef Regions::const_iterator IR;
0074   Regions regions;
0075 
0076   edm::Handle<reco::TrackCollection> trackCollectionH;
0077 
0078   const edm::EventSetup* myEsetup;
0079   const edm::Event* myEvent;
0080 
0081   const MagneticField* magField;
0082   edm::Handle<reco::BeamSpot> recoBeamSpotHandle;
0083   const reco::BeamSpot* theBeamSpot;
0084 
0085   IdealHelixParameters _IdealHelixParameters;
0086 
0087   edm::Handle<reco::VertexCollection> vertexHandle;
0088   reco::Vertex primaryVertex;
0089 
0090   PrintRecoObjects po;
0091 
0092   std::stringstream ss;
0093 };
0094 #endif