CMS 3D CMS Logo

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

const edm::ParameterSetparam_
 
TotemRPDigiSet strip_digi_set_
 input digi set, strip by strip More...
 
int verbosity_
 

Detailed Description

Definition at line 21 of file TotemRPClusterProducerAlgorithm.h.

Member Typedef Documentation

◆ TotemRPDigiSet

Definition at line 36 of file TotemRPClusterProducerAlgorithm.h.

Constructor & Destructor Documentation

◆ TotemRPClusterProducerAlgorithm()

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

Definition at line 15 of file TotemRPClusterProducerAlgorithm.cc.

16  : param_(param) {
17  verbosity_ = param_.getParameter<int>("verbosity");

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

◆ ~TotemRPClusterProducerAlgorithm()

TotemRPClusterProducerAlgorithm::~TotemRPClusterProducerAlgorithm ( )

Definition at line 21 of file TotemRPClusterProducerAlgorithm.cc.

Member Function Documentation

◆ buildClusters()

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

Definition at line 25 of file TotemRPClusterProducerAlgorithm.cc.

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();

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

Referenced by TotemRPClusterProducer::run().

Member Data Documentation

◆ param_

const edm::ParameterSet& TotemRPClusterProducerAlgorithm::param_
private

Definition at line 40 of file TotemRPClusterProducerAlgorithm.h.

Referenced by TotemRPClusterProducerAlgorithm().

◆ strip_digi_set_

TotemRPDigiSet TotemRPClusterProducerAlgorithm::strip_digi_set_
private

input digi set, strip by strip

Definition at line 38 of file TotemRPClusterProducerAlgorithm.h.

Referenced by buildClusters().

◆ verbosity_

int TotemRPClusterProducerAlgorithm::verbosity_
private

Definition at line 42 of file TotemRPClusterProducerAlgorithm.h.

Referenced by TotemRPClusterProducerAlgorithm().

mps_fire.i
i
Definition: mps_fire.py:428
TotemRPClusterProducerAlgorithm::param_
const edm::ParameterSet & param_
Definition: TotemRPClusterProducerAlgorithm.h:40
bsc_activity_cfg.clusters
clusters
Definition: bsc_activity_cfg.py:36
TotemRPClusterProducerAlgorithm::verbosity_
int verbosity_
Definition: TotemRPClusterProducerAlgorithm.h:42
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
TotemRPClusterProducerAlgorithm::strip_digi_set_
TotemRPDigiSet strip_digi_set_
input digi set, strip by strip
Definition: TotemRPClusterProducerAlgorithm.h:38