Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:24:55

0001 /*
0002  *  See header file for a description of this class.
0003  *
0004  *  \author M. Maggi -- INFN Bari
0005  */
0006 #include "RecoLocalMuon/GEMRecHit/interface/GEMRecHitBaseAlgo.h"
0007 #include "RecoLocalMuon/GEMRecHit/interface/GEMClusterizer.h"
0008 #include "RecoLocalMuon/GEMRecHit/interface/GEMMaskReClusterizer.h"
0009 
0010 #include "Geometry/GEMGeometry/interface/GEMEtaPartition.h"
0011 #include "DataFormats/GEMDigi/interface/GEMDigiCollection.h"
0012 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0013 
0014 GEMRecHitBaseAlgo::GEMRecHitBaseAlgo(const edm::ParameterSet& config) {}
0015 
0016 GEMRecHitBaseAlgo::~GEMRecHitBaseAlgo() {}
0017 
0018 // Build all hits in the range associated to the layerId, at the 1st step.
0019 edm::OwnVector<GEMRecHit> GEMRecHitBaseAlgo::reconstruct(const GEMEtaPartition& roll,
0020                                                          const GEMDetId& gemId,
0021                                                          const GEMDigiCollection::Range& digiRange,
0022                                                          const EtaPartitionMask& mask) {
0023   edm::OwnVector<GEMRecHit> result;
0024 
0025   GEMClusterizer clizer;
0026   GEMClusterContainer tcls = clizer.doAction(digiRange, mask);
0027   GEMMaskReClusterizer mrclizer;
0028   GEMClusterContainer cls = mrclizer.doAction(gemId, tcls, mask);
0029 
0030   for (GEMClusterContainer::const_iterator cl = cls.begin(); cl != cls.end(); cl++) {
0031     LocalError tmpErr;
0032     LocalPoint point;
0033     // Call the compute method
0034     bool OK = this->compute(roll, *cl, point, tmpErr);
0035     if (!OK)
0036       continue;
0037 
0038     // Build a new pair of 1D rechit
0039     int firstClustStrip = cl->firstStrip();
0040     int clusterSize = cl->clusterSize();
0041     GEMRecHit* recHit = new GEMRecHit(gemId, cl->bx(), firstClustStrip, clusterSize, point, tmpErr);
0042 
0043     result.push_back(recHit);
0044   }
0045   return result;
0046 }