CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_5/src/RecoLocalMuon/GEMRecHit/src/GEMRecHitBaseAlgo.cc

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