CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_2_9/src/RecoLocalMuon/RPCRecHit/src/RPCRecHitBaseAlgo.cc

Go to the documentation of this file.
00001 /*
00002  *  See header file for a description of this class.
00003  *
00004  *  $Date: 2008/12/04 16:13:16 $
00005  *  $Revision: 1.8 $
00006  *  \author M. Maggi -- INFN Bari
00007  */
00008 
00009 
00010 
00011 #include "RecoLocalMuon/RPCRecHit/interface/RPCRecHitBaseAlgo.h"
00012 #include "RecoLocalMuon/RPCRecHit/src/RPCClusterContainer.h"
00013 #include "RecoLocalMuon/RPCRecHit/src/RPCCluster.h"
00014 #include "RecoLocalMuon/RPCRecHit/src/RPCClusterizer.h"
00015 #include "RecoLocalMuon/RPCRecHit/src/RPCMaskReClusterizer.h"
00016 
00017 #include "Geometry/RPCGeometry/interface/RPCRoll.h"
00018 #include "Geometry/RPCGeometry/interface/RPCGeomServ.h"
00019 #include "DataFormats/RPCDigi/interface/RPCDigiCollection.h"
00020 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00021 
00022 
00023 RPCRecHitBaseAlgo::RPCRecHitBaseAlgo(const edm::ParameterSet& config) {
00024   //  theSync = RPCTTrigSyncFactory::get()->create(config.getParameter<string>("tTrigMode"),
00025   //config.getParameter<ParameterSet>("tTrigModeConfig"));
00026 }
00027 
00028 RPCRecHitBaseAlgo::~RPCRecHitBaseAlgo(){}
00029 
00030 
00031 // Build all hits in the range associated to the layerId, at the 1st step.
00032 edm::OwnVector<RPCRecHit> RPCRecHitBaseAlgo::reconstruct(const RPCRoll& roll,
00033                                                          const RPCDetId& rpcId,
00034                                                          const RPCDigiCollection::Range& digiRange,
00035                                                          const RollMask& mask) {
00036   edm::OwnVector<RPCRecHit> result; 
00037 
00038 
00039   RPCClusterizer clizer;
00040   RPCClusterContainer tcls = clizer.doAction(digiRange);
00041   RPCMaskReClusterizer mrclizer;
00042   RPCClusterContainer cls = mrclizer.doAction(rpcId,tcls,mask);
00043 
00044 
00045   for (RPCClusterContainer::const_iterator cl = cls.begin();
00046        cl != cls.end(); cl++){
00047     
00048     LocalError tmpErr;
00049     LocalPoint point;
00050     // Call the compute method
00051     bool OK = this->compute(roll, *cl, point, tmpErr);
00052     if (!OK) continue;
00053 
00054     // Build a new pair of 1D rechit 
00055     int firstClustStrip= cl->firstStrip();
00056     int clusterSize=cl->clusterSize(); 
00057     RPCRecHit*  recHit = new RPCRecHit(rpcId,cl->bx(),firstClustStrip,clusterSize,point,tmpErr);
00058 
00059 
00060     result.push_back(recHit);
00061   }
00062   return result;
00063 }