CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

RPCClusterizer Class Reference

#include <RPCClusterizer.h>

List of all members.

Public Member Functions

RPCClusterContainer doAction (const RPCDigiCollection::Range &digiRange)
 RPCClusterizer ()
 ~RPCClusterizer ()

Private Member Functions

RPCClusterContainer doActualAction (RPCClusterContainer &initialclusters)

Private Attributes

RPCClusterContainer cls

Detailed Description

Date:
2006/07/16 07:25:39
Revision:
1.5
Author:
M. Maggi -- INFN Bari

Definition at line 13 of file RPCClusterizer.h.


Constructor & Destructor Documentation

RPCClusterizer::RPCClusterizer ( )

Definition at line 6 of file RPCClusterizer.cc.

{
}
RPCClusterizer::~RPCClusterizer ( )

Definition at line 10 of file RPCClusterizer.cc.

{
}

Member Function Documentation

RPCClusterContainer RPCClusterizer::doAction ( const RPCDigiCollection::Range digiRange)

Definition at line 15 of file RPCClusterizer.cc.

References cl, cls, and doActualAction().

Referenced by RPCRecHitBaseAlgo::reconstruct().

                                                               {
  RPCClusterContainer cls;
  for (RPCDigiCollection::const_iterator digi = digiRange.first;
       digi != digiRange.second;
       digi++) {
    RPCCluster cl(digi->strip(),digi->strip(),digi->bx());
    cls.insert(cl);
  }
  RPCClusterContainer clsNew =this->doActualAction(cls);
  return clsNew;
}
RPCClusterContainer RPCClusterizer::doActualAction ( RPCClusterContainer initialclusters) [private]

Definition at line 28 of file RPCClusterizer.cc.

References cl, i, RPCCluster::isAdjacent(), j, and RPCCluster::merge().

Referenced by doAction().

                                                                  {
  
  RPCClusterContainer finalCluster;
  RPCCluster prev;

  unsigned int j = 0;
  for(RPCClusterContainer::const_iterator i=initialclusters.begin();
      i != initialclusters.end(); i++){
    RPCCluster cl = *i;

    if(i==initialclusters.begin()){
      prev = cl;
      j++;
      if(j == initialclusters.size()){
        finalCluster.insert(prev);
      }
      else if(j < initialclusters.size()){
        continue;
      }
    }

    if(prev.isAdjacent(cl)) {
      prev.merge(cl);
      j++;
      if(j == initialclusters.size()){
        finalCluster.insert(prev);
      }
    }
    else {
      j++;
      if(j < initialclusters.size()){
        finalCluster.insert(prev);
        prev = cl;
      }
      if(j == initialclusters.size()){
        finalCluster.insert(prev);
        finalCluster.insert(cl);
      }
    }
  }

  return finalCluster;
} 

Member Data Documentation

Definition at line 23 of file RPCClusterizer.h.

Referenced by doAction().