CMS 3D CMS Logo

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

#include <GEMClusterizer.h>

Public Member Functions

GEMClusterContainer doAction (const GEMDigiCollection::Range &digiRange)
 
 GEMClusterizer ()
 
 ~GEMClusterizer ()
 

Private Member Functions

GEMClusterContainer doActualAction (GEMClusterContainer &initialclusters)
 

Private Attributes

GEMClusterContainer cls
 

Detailed Description

Date:
2013/04/24 17:16:34
Revision:
1.1
Author
M. Maggi – INFN Bari

Definition at line 13 of file GEMClusterizer.h.

Constructor & Destructor Documentation

GEMClusterizer::GEMClusterizer ( )

Definition at line 6 of file GEMClusterizer.cc.

7 {
8 }
GEMClusterizer::~GEMClusterizer ( )

Definition at line 10 of file GEMClusterizer.cc.

11 {
12 }

Member Function Documentation

GEMClusterContainer GEMClusterizer::doAction ( const GEMDigiCollection::Range digiRange)

Definition at line 15 of file GEMClusterizer.cc.

References cls, and doActualAction().

Referenced by GEMRecHitBaseAlgo::reconstruct().

15  {
17  for (GEMDigiCollection::const_iterator digi = digiRange.first;
18  digi != digiRange.second;
19  digi++) {
20  GEMCluster cl(digi->strip(),digi->strip(),digi->bx());
21  cls.insert(cl);
22  }
23  GEMClusterContainer clsNew =this->doActualAction(cls);
24  return clsNew;
25 }
GEMClusterContainer doActualAction(GEMClusterContainer &initialclusters)
std::set< GEMCluster > GEMClusterContainer
std::vector< DigiType >::const_iterator const_iterator
GEMClusterContainer cls
GEMClusterContainer GEMClusterizer::doActualAction ( GEMClusterContainer initialclusters)
private

Definition at line 28 of file GEMClusterizer.cc.

References i, GEMCluster::isAdjacent(), j, and GEMCluster::merge().

Referenced by doAction().

28  {
29 
30  GEMClusterContainer finalCluster;
31  GEMCluster prev;
32 
33  unsigned int j = 0;
34  for(GEMClusterContainer::const_iterator i=initialclusters.begin();
35  i != initialclusters.end(); i++){
36  GEMCluster cl = *i;
37 
38  if(i==initialclusters.begin()){
39  prev = cl;
40  j++;
41  if(j == initialclusters.size()){
42  finalCluster.insert(prev);
43  }
44  else if(j < initialclusters.size()){
45  continue;
46  }
47  }
48 
49  if(prev.isAdjacent(cl)) {
50  prev.merge(cl);
51  j++;
52  if(j == initialclusters.size()){
53  finalCluster.insert(prev);
54  }
55  }
56  else {
57  j++;
58  if(j < initialclusters.size()){
59  finalCluster.insert(prev);
60  prev = cl;
61  }
62  if(j == initialclusters.size()){
63  finalCluster.insert(prev);
64  finalCluster.insert(cl);
65  }
66  }
67  }
68 
69  return finalCluster;
70 }
int i
Definition: DBlmapReader.cc:9
std::set< GEMCluster > GEMClusterContainer
void merge(const GEMCluster &cl)
Definition: GEMCluster.cc:50
int j
Definition: DBlmapReader.cc:9
bool isAdjacent(const GEMCluster &cl) const
Definition: GEMCluster.cc:44

Member Data Documentation

GEMClusterContainer GEMClusterizer::cls
private

Definition at line 23 of file GEMClusterizer.h.

Referenced by doAction().