CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
ticl::PatternRecognitionbyRecovery< TILES > Class Template Referencefinal

#include <PatternRecognitionbyRecovery.h>

Inheritance diagram for ticl::PatternRecognitionbyRecovery< TILES >:
ticl::PatternRecognitionAlgoBaseT< TILES >

Public Member Functions

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
 
void makeTracksters (const typename PatternRecognitionAlgoBaseT< TILES >::Inputs &input, std::vector< Trackster > &result, std::unordered_map< int, std::vector< int >> &seedToTracksterAssociation) override
 
 PatternRecognitionbyRecovery (const edm::ParameterSet &conf, edm::ConsumesCollector)
 
 ~PatternRecognitionbyRecovery () override=default
 
- Public Member Functions inherited from ticl::PatternRecognitionAlgoBaseT< TILES >
virtual void filter (std::vector< Trackster > &output, const std::vector< Trackster > &inTracksters, const Inputs &input, std::unordered_map< int, std::vector< int >> &seedToTracksterAssociation)=0
 
virtual void makeTracksters (const Inputs &input, std::vector< Trackster > &result, std::unordered_map< int, std::vector< int >> &seedToTracksterAssociation)=0
 
 PatternRecognitionAlgoBaseT (const edm::ParameterSet &conf, edm::ConsumesCollector)
 
virtual ~PatternRecognitionAlgoBaseT ()
 

Static Public Member Functions

static void fillPSetDescription (edm::ParameterSetDescription &iDesc)
 

Private Attributes

edm::ESGetToken< CaloGeometry, CaloGeometryRecordcaloGeomToken_
 
hgcal::RecHitTools rhtools_
 

Additional Inherited Members

- Protected Attributes inherited from ticl::PatternRecognitionAlgoBaseT< TILES >
int algo_verbosity_
 

Detailed Description

template<typename TILES>
class ticl::PatternRecognitionbyRecovery< TILES >

Definition at line 12 of file PatternRecognitionbyRecovery.h.

Constructor & Destructor Documentation

◆ PatternRecognitionbyRecovery()

template<typename TILES >
PatternRecognitionbyRecovery::PatternRecognitionbyRecovery ( const edm::ParameterSet conf,
edm::ConsumesCollector  iC 
)

◆ ~PatternRecognitionbyRecovery()

template<typename TILES >
ticl::PatternRecognitionbyRecovery< TILES >::~PatternRecognitionbyRecovery ( )
overridedefault

Member Function Documentation

◆ fillPSetDescription()

template<typename TILES >
void PatternRecognitionbyRecovery::fillPSetDescription ( edm::ParameterSetDescription iDesc)
static

Definition at line 77 of file PatternRecognitionbyRecovery.cc.

References edm::ParameterSetDescription::add().

77  {
78  iDesc.add<int>("algo_verbosity", 0);
79 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)

◆ filter()

template<typename TILES >
void PatternRecognitionbyRecovery::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

Definition at line 69 of file PatternRecognitionbyRecovery.cc.

72  {
73  output = inTracksters;
74 }
Definition: output.py:1

◆ makeTracksters()

template<typename TILES >
void PatternRecognitionbyRecovery::makeTracksters ( const typename PatternRecognitionAlgoBaseT< TILES >::Inputs input,
std::vector< Trackster > &  result,
std::unordered_map< int, std::vector< int >> &  seedToTracksterAssociation 
)
override

Definition at line 24 of file PatternRecognitionbyRecovery.cc.

References funct::abs(), ticl::Advanced, ALCARECOEcalPhiSym_cff::float, relativeConstraints::geom, edm::EventSetup::getData(), mps_fire::i, input, mps_fire::result, ticl::Trackster::setBarycenter(), ticl::Trackster::setRawEmEnergy(), ticl::Trackster::setRawEmPt(), ticl::Trackster::setRawEnergy(), ticl::Trackster::setRawPt(), ticl::Trackster::setTimeAndError(), ticl::Trackster::vertex_multiplicity(), and ticl::Trackster::vertices().

27  {
28  // Get the geometry setup
29  edm::EventSetup const &es = input.es;
32  const auto z_limit_em = rhtools_.getPositionLayer(rhtools_.lastLayerEE(false), false).z();
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.f) {
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  const auto &lc = input.layerClusters[i];
47  trackster.setTimeAndError(input.layerClustersTime.get(i).first, input.layerClustersTime.get(i).second);
48  trackster.setRawEnergy(lc.energy());
49  trackster.setBarycenter({float(lc.x()), float(lc.y()), float(lc.z())});
50  float invcosh = 1.f / std::cosh(lc.position().eta());
51  trackster.setRawPt(lc.energy() * invcosh);
52 
53  if (std::abs(lc.z()) <= z_limit_em) {
54  trackster.setRawEmEnergy(lc.energy());
55  trackster.setRawEmPt(lc.energy() * invcosh);
56  }
57 
58  // Add the trackster to the result vector
59  result.push_back(trackster);
60  }
61 
62  // Log the number of tracksters created
64  edm::LogVerbatim("PatternRecognitionbyRecovery") << "Created " << result.size() << " tracksters";
65  }
66 }
Log< level::Info, true > LogVerbatim
void setRawPt(float value)
Definition: Trackster.h:73
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
void setRawEnergy(float value)
Definition: Trackster.h:69
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > caloGeomToken_
static std::string const input
Definition: EdmProvDump.cc:50
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
std::vector< unsigned int > & vertices()
Definition: Trackster.h:57
void setRawEmPt(float value)
Definition: Trackster.h:74
std::vector< float > & vertex_multiplicity()
Definition: Trackster.h:58
GlobalPoint getPositionLayer(int layer, bool nose=false) const
Definition: RecHitTools.cc:152
void setRawEmEnergy(float value)
Definition: Trackster.h:71
void setGeometry(CaloGeometry const &)
Definition: RecHitTools.cc:79
void setTimeAndError(float t, float tError)
Definition: Trackster.h:64
unsigned int lastLayerEE(bool nose=false) const
Definition: RecHitTools.h:76
void setBarycenter(Vector value)
Definition: Trackster.h:75

Member Data Documentation

◆ caloGeomToken_

template<typename TILES >
edm::ESGetToken<CaloGeometry, CaloGeometryRecord> ticl::PatternRecognitionbyRecovery< TILES >::caloGeomToken_
private

Definition at line 29 of file PatternRecognitionbyRecovery.h.

◆ rhtools_

template<typename TILES >
hgcal::RecHitTools ticl::PatternRecognitionbyRecovery< TILES >::rhtools_
private

Definition at line 30 of file PatternRecognitionbyRecovery.h.