File indexing completed on 2024-09-11 04:32:38
0001 #ifndef SiStripCommissioningSource_SiStripFineDelayHit_h
0002 #define SiStripCommissioningSource_SiStripFineDelayHit_h
0003
0004
0005 #include <memory>
0006 #include <utility>
0007
0008
0009 #include "CondFormats/DataRecord/interface/SiStripFedCablingRcd.h"
0010 #include "CondFormats/DataRecord/interface/SiStripNoisesRcd.h"
0011 #include "CondFormats/SiStripObjects/interface/SiStripFedCabling.h"
0012 #include "CondFormats/SiStripObjects/interface/SiStripNoises.h"
0013 #include "DQM/SiStripCommissioningSources/plugins/tracking/SiStripFineDelayTLA.h"
0014 #include "DataFormats/Common/interface/DetSetVector.h"
0015 #include "DataFormats/Common/interface/DetSetVectorNew.h"
0016 #include "DataFormats/Common/interface/Ref.h"
0017 #include "DataFormats/SiStripCluster/interface/SiStripCluster.h"
0018 #include "DataFormats/SiStripCluster/interface/SiStripCluster.h"
0019 #include "DataFormats/SiStripCluster/interface/SiStripClusterCollection.h"
0020 #include "DataFormats/SiStripCluster/interface/SiStripClusterCollection.h"
0021 #include "DataFormats/SiStripCommon/interface/SiStripEventSummary.h"
0022 #include "DataFormats/SiStripDigi/interface/SiStripDigi.h"
0023 #include "DataFormats/SiStripDigi/interface/SiStripRawDigi.h"
0024 #include "DataFormats/TrackReco/interface/TrackFwd.h"
0025 #include "DataFormats/TrackerCommon/interface/TrackerTopology.h"
0026 #include "DataFormats/TrajectorySeed/interface/TrajectorySeedCollection.h"
0027 #include "FWCore/Framework/interface/one/EDProducer.h"
0028 #include "FWCore/Framework/interface/Event.h"
0029 #include "FWCore/Framework/interface/Frameworkfwd.h"
0030 #include "FWCore/Framework/interface/MakerMacros.h"
0031 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0032 #include "FWCore/Utilities/interface/EDGetToken.h"
0033 #include "FWCore/Utilities/interface/InputTag.h"
0034 #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h"
0035 #include "TrackingTools/PatternTools/interface/Trajectory.h"
0036
0037
0038
0039
0040
0041 class SiStripFineDelayHit : public edm::one::EDProducer<edm::one::WatchRuns> {
0042 public:
0043 explicit SiStripFineDelayHit(const edm::ParameterSet&);
0044 ~SiStripFineDelayHit() override;
0045
0046 private:
0047 void beginRun(const edm::Run&, const edm::EventSetup&) override;
0048 void produce(edm::Event&, const edm::EventSetup&) override;
0049 void endRun(const edm::Run&, const edm::EventSetup&) override {}
0050 virtual void produceNoTracking(edm::Event&, const edm::EventSetup&);
0051 using DeviceMask = std::pair<uint32_t, uint32_t>;
0052 DeviceMask deviceMask(const StripSubdetector::SubDetector subdet,
0053 const int substructure,
0054 const TrackerTopology* tkrTopo);
0055 std::vector<std::pair<uint32_t, std::pair<double, double> > > detId(
0056 const TrackerGeometry& tracker,
0057 const TrackerTopology* tkrTopo,
0058 const reco::Track* tk,
0059 const std::vector<Trajectory>& trajVec,
0060 const StripSubdetector::SubDetector subdet = StripSubdetector::TIB,
0061 const int substructure = 0xff);
0062 std::vector<std::pair<uint32_t, std::pair<double, double> > > detId(const TrackerGeometry& tracker,
0063 const TrackerTopology* tkrTopo,
0064 const reco::Track* tk,
0065 const std::vector<Trajectory>& trajVec,
0066 const uint32_t& maskDetId,
0067 const uint32_t& rootDetId);
0068 std::pair<const SiStripCluster*, double> closestCluster(const TrackerGeometry& tracker,
0069 const reco::Track* tk,
0070 const uint32_t& detId,
0071 const edmNew::DetSetVector<SiStripCluster>& clusters,
0072 const edm::DetSetVector<SiStripDigi>& hits);
0073 bool rechit(reco::Track* tk, uint32_t detId);
0074
0075
0076 SiStripFineDelayTLA* anglefinder_;
0077 const edm::Event* event_;
0078 bool cosmic_, field_, homeMadeClusters_, noTracking_;
0079 double maxAngle_, minTrackP2_, maxClusterDistance_;
0080 int mode_;
0081 int explorationWindow_;
0082
0083 edm::EDGetTokenT<TrajectorySeedCollection> seedcollToken_;
0084 edm::EDGetTokenT<SiStripEventSummary> inputModuleToken_;
0085 edm::EDGetTokenT<reco::TrackCollection> trackCollectionToken_;
0086 edm::EDGetTokenT<edm::DetSetVector<SiStripDigi> > digiToken_;
0087 edm::EDGetTokenT<edmNew::DetSetVector<SiStripCluster> > clustersToken_;
0088 edm::EDGetTokenT<std::vector<Trajectory> > trackToken_;
0089 std::map<uint32_t, uint32_t> connectionMap_;
0090
0091 edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> tkGeomToken_;
0092 edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> tTopoToken_;
0093 edm::ESGetToken<SiStripFedCabling, SiStripFedCablingRcd> fedCablingToken_;
0094 edm::ESGetToken<SiStripNoises, SiStripNoisesRcd> noiseToken_;
0095 };
0096
0097 #endif