Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-06-22 02:23:59

0001 #ifndef RecoHGCal_TICL_LinkingAlgoByDirectionGeometric_H__
0002 #define RecoHGCal_TICL_LinkingAlgoByDirectionGeometric_H__
0003 
0004 #include <memory>
0005 #include <array>
0006 #include "RecoHGCal/TICL/plugins/LinkingAlgoBase.h"
0007 #include "DataFormats/HGCalReco/interface/Common.h"
0008 
0009 #include "FWCore/Framework/interface/Frameworkfwd.h"
0010 #include "FWCore/Framework/interface/ESHandle.h"
0011 #include "FWCore/Framework/interface/MakerMacros.h"
0012 #include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h"
0013 
0014 #include "DataFormats/Math/interface/Vector3D.h"
0015 #include "DataFormats/GeometrySurface/interface/BoundDisk.h"
0016 #include "DataFormats/HGCalReco/interface/TICLLayerTile.h"
0017 
0018 #include "TrackingTools/Records/interface/TrackingComponentsRecord.h"
0019 
0020 #include "CommonTools/Utils/interface/StringCutObjectSelector.h"
0021 
0022 #include "MagneticField/Records/interface/IdealMagneticFieldRecord.h"
0023 #include "DataFormats/HGCalReco/interface/Trackster.h"
0024 
0025 namespace ticl {
0026   class LinkingAlgoByDirectionGeometric final : public LinkingAlgoBase {
0027   public:
0028     LinkingAlgoByDirectionGeometric(const edm::ParameterSet &conf);
0029     ~LinkingAlgoByDirectionGeometric() override;
0030 
0031     void initialize(const HGCalDDDConstants *hgcons,
0032                     const hgcal::RecHitTools rhtools,
0033                     const edm::ESHandle<MagneticField> bfieldH,
0034                     const edm::ESHandle<Propagator> propH) override;
0035 
0036     void linkTracksters(const edm::Handle<std::vector<reco::Track>>,
0037                         const edm::Handle<edm::ValueMap<float>>,
0038                         const edm::Handle<edm::ValueMap<float>>,
0039                         const edm::Handle<edm::ValueMap<float>>,
0040                         const std::vector<reco::Muon> &,
0041                         const edm::Handle<std::vector<Trackster>>,
0042                         const bool useMTDTiming,
0043                         std::vector<TICLCandidate> &,
0044                         std::vector<TICLCandidate> &) override;
0045 
0046     static void fillPSetDescription(edm::ParameterSetDescription &desc);
0047 
0048   private:
0049     using Vector = ticl::Trackster::Vector;
0050 
0051     void buildLayers();
0052 
0053     Vector propagateTrackster(const Trackster &t,
0054                               const unsigned idx,
0055                               float zVal,
0056                               std::array<TICLLayerTile, 2> &tracksterTiles);
0057 
0058     void findTrackstersInWindow(const std::vector<std::pair<Vector, unsigned>> &seedingCollection,
0059                                 const std::array<TICLLayerTile, 2> &tracksterTiles,
0060                                 const std::vector<Vector> &tracksterPropPoints,
0061                                 float delta,
0062                                 unsigned trackstersSize,
0063                                 std::vector<std::vector<unsigned>> &resultCollection,
0064                                 bool useMask);
0065 
0066     bool timeAndEnergyCompatible(float &total_raw_energy,
0067                                  const reco::Track &track,
0068                                  const Trackster &trackster,
0069                                  const float &tkTime,
0070                                  const float &tkTimeErr,
0071                                  const float &tkTimeQual,
0072                                  bool useMTDTiming);
0073 
0074     void recordTrackster(const unsigned ts,  // trackster index
0075                          const std::vector<Trackster> &tracksters,
0076                          const edm::Handle<std::vector<Trackster>> tsH,
0077                          std::vector<unsigned> &ts_mask,
0078                          float &energy_in_candidate,
0079                          TICLCandidate &candidate);
0080 
0081     void dumpLinksFound(std::vector<std::vector<unsigned>> &resultCollection, const char *label) const;
0082 
0083     const float tkEnergyCut_ = 2.0f;
0084     const float maxDeltaT_ = 3.0f;
0085     const float del_tk_ts_layer1_;
0086     const float del_tk_ts_int_;
0087     const float del_ts_em_had_;
0088     const float del_ts_had_had_;
0089 
0090     const float timing_quality_threshold_;
0091 
0092     const StringCutObjectSelector<reco::Track> cutTk_;
0093     std::once_flag initializeGeometry_;
0094 
0095     const HGCalDDDConstants *hgcons_;
0096 
0097     std::unique_ptr<GeomDet> firstDisk_[2];
0098     std::unique_ptr<GeomDet> interfaceDisk_[2];
0099 
0100     hgcal::RecHitTools rhtools_;
0101 
0102     edm::ESHandle<MagneticField> bfield_;
0103     edm::ESHandle<Propagator> propagator_;
0104   };
0105 }  // namespace ticl
0106 #endif