CMS 3D CMS Logo

PatternRecognitionbyPassthrough.cc
Go to the documentation of this file.
1 // Author: Felice Pantaleo - felice.pantaleo@cern.ch
2 // Date: 05/2024
3 
4 #include <vector>
14 #include "TrackstersPCA.h"
15 
16 using namespace ticl;
17 
18 template <typename TILES>
21  : PatternRecognitionAlgoBaseT<TILES>(conf, iC), caloGeomToken_(iC.esConsumes<CaloGeometry, CaloGeometryRecord>()) {}
22 
23 template <typename TILES>
26  std::vector<Trackster> &result,
27  std::unordered_map<int, std::vector<int>> &seedToTracksterAssociation) {
28  // Get the geometry setup
29  edm::EventSetup const &es = input.es;
30  const CaloGeometry &geom = es.getData(caloGeomToken_);
31  rhtools_.setGeometry(geom);
32 
33  // Clear the result vector
34  result.clear();
35 
36  // Iterate over all layer clusters
37  for (size_t i = 0; i < input.layerClusters.size(); ++i) {
38  if (input.mask[i] == 0.) {
39  continue; // Skip masked clusters
40  }
41 
42  // Create a new trackster for each layer cluster
43  Trackster trackster;
44  trackster.vertices().push_back(i);
45  trackster.vertex_multiplicity().push_back(1);
46 
47  // Add the trackster to the result vector
48  result.push_back(trackster);
49  }
50 
51  // Assign PCA to tracksters
53  input.layerClusters,
54  input.layerClustersTime,
55  rhtools_.getPositionLayer(rhtools_.lastLayerEE(false), false).z(),
56  rhtools_,
57  false);
58 
59  // Log the number of tracksters created
61  edm::LogVerbatim("PatternRecognitionbyPassthrough") << "Created " << result.size() << " tracksters";
62  }
63 }
64 
65 template <typename TILES>
67  std::vector<Trackster> &output,
68  const std::vector<Trackster> &inTracksters,
70  std::unordered_map<int, std::vector<int>> &seedToTracksterAssociation) {
71  output = inTracksters;
72 }
73 
74 template <typename TILES>
76  iDesc.add<int>("algo_verbosity", 0);
77 }
78 
79 // Explicitly instantiate the templates
Log< level::Info, true > LogVerbatim
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
void assignPCAtoTracksters(std::vector< Trackster > &tracksters, const std::vector< reco::CaloCluster > &layerClusters, const edm::ValueMap< std::pair< float, float >> &layerClustersTime, double z_limit_em, hgcal::RecHitTools const &rhTools, bool computeLocalTime=false, bool energyWeight=true, bool clean=false, int minLayer=10, int maxLayer=10)
void makeTracksters(const typename PatternRecognitionAlgoBaseT< TILES >::Inputs &input, std::vector< Trackster > &result, std::unordered_map< int, std::vector< int >> &seedToTracksterAssociation) override
static std::string const input
Definition: EdmProvDump.cc:50
static void fillPSetDescription(edm::ParameterSetDescription &iDesc)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
std::vector< unsigned int > & vertices()
Definition: Trackster.h:57
std::vector< float > & vertex_multiplicity()
Definition: Trackster.h:58
void filter(std::vector< Trackster > &output, const std::vector< Trackster > &inTracksters, const typename PatternRecognitionAlgoBaseT< TILES >::Inputs &input, std::unordered_map< int, std::vector< int >> &seedToTracksterAssociation) override
PatternRecognitionbyPassthrough(const edm::ParameterSet &conf, edm::ConsumesCollector)
Definition: Common.h:10
Definition: output.py:1