CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
List of all members | Public Member Functions | Private Types | Private Attributes
TotemRPClusterProducerAlgorithm Class Reference

#include <TotemRPClusterProducerAlgorithm.h>

Public Member Functions

int buildClusters (unsigned int detId, const std::vector< TotemRPDigi > &digi, std::vector< TotemRPCluster > &clusters)
 
 TotemRPClusterProducerAlgorithm (const edm::ParameterSet &param)
 
 ~TotemRPClusterProducerAlgorithm ()
 

Private Types

typedef std::set< TotemRPDigiTotemRPDigiSet
 

Private Attributes

TotemRPDigiSet strip_digi_set_
 input digi set, strip by strip More...
 
int verbosity_
 

Detailed Description

Definition at line 22 of file TotemRPClusterProducerAlgorithm.h.

Member Typedef Documentation

◆ TotemRPDigiSet

Definition at line 31 of file TotemRPClusterProducerAlgorithm.h.

Constructor & Destructor Documentation

◆ TotemRPClusterProducerAlgorithm()

TotemRPClusterProducerAlgorithm::TotemRPClusterProducerAlgorithm ( const edm::ParameterSet param)

Definition at line 16 of file TotemRPClusterProducerAlgorithm.cc.

References edm::ParameterSet::getParameter(), and verbosity_.

16  {
17  verbosity_ = param.getParameter<int>("verbosity");
18 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:307

◆ ~TotemRPClusterProducerAlgorithm()

TotemRPClusterProducerAlgorithm::~TotemRPClusterProducerAlgorithm ( )

Definition at line 22 of file TotemRPClusterProducerAlgorithm.cc.

22 {}

Member Function Documentation

◆ buildClusters()

int TotemRPClusterProducerAlgorithm::buildClusters ( unsigned int  detId,
const std::vector< TotemRPDigi > &  digi,
std::vector< TotemRPCluster > &  clusters 
)

Definition at line 26 of file TotemRPClusterProducerAlgorithm.cc.

References bsc_activity_cfg::clusters, mps_fire::i, and strip_digi_set_.

Referenced by TotemRPClusterProducer::run().

28  {
29  clusters.clear();
30 
31  strip_digi_set_.clear();
32  strip_digi_set_.insert(digi.begin(), digi.end());
33 
34  if (strip_digi_set_.empty())
35  return 0;
36 
37  bool iter_beg = true;
38  int cluster_beg = -16;
39  int cluster_end;
40  int prev_strip = -16;
41  int cur_strip;
42 
43  for (TotemRPDigiSet::const_iterator i = strip_digi_set_.begin(); i != strip_digi_set_.end(); ++i) {
44  cur_strip = i->stripNumber();
45  bool non_continuity = (cur_strip != prev_strip + 1);
46 
47  if (iter_beg) {
48  cluster_beg = cur_strip;
49  iter_beg = false;
50  } else if (non_continuity) {
51  cluster_end = prev_strip;
52  clusters.emplace_back((uint16_t)cluster_beg, (uint16_t)cluster_end);
53 
54  cluster_beg = cur_strip;
55  }
56 
57  prev_strip = cur_strip;
58  }
59 
60  if (!iter_beg) {
61  cluster_end = prev_strip;
62  clusters.emplace_back((uint16_t)cluster_beg, (uint16_t)cluster_end);
63  }
64 
65  return clusters.size();
66 }
TotemRPDigiSet strip_digi_set_
input digi set, strip by strip

Member Data Documentation

◆ strip_digi_set_

TotemRPDigiSet TotemRPClusterProducerAlgorithm::strip_digi_set_
private

input digi set, strip by strip

Definition at line 33 of file TotemRPClusterProducerAlgorithm.h.

Referenced by buildClusters().

◆ verbosity_

int TotemRPClusterProducerAlgorithm::verbosity_
private

Definition at line 35 of file TotemRPClusterProducerAlgorithm.h.

Referenced by TotemRPClusterProducerAlgorithm().