CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_10/src/RecoLocalMuon/DTRecHit/src/DTRecHitBaseAlgo.cc

Go to the documentation of this file.
00001 /*
00002  *  See header file for a description of this class.
00003  *
00004  *  $Date: 2007/02/19 11:43:57 $
00005  *  $Revision: 1.5 $
00006  *  \author N. Amapane & G. Cerminara - INFN Torino
00007  */
00008 
00009 
00010 
00011 #include "RecoLocalMuon/DTRecHit/interface/DTRecHitBaseAlgo.h"
00012 
00013 #include "Geometry/DTGeometry/interface/DTLayer.h"
00014 #include "CalibMuon/DTDigiSync/interface/DTTTrigSyncFactory.h"
00015 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00016 
00017 using namespace std;
00018 using namespace edm;
00019 
00020 
00021 DTRecHitBaseAlgo::DTRecHitBaseAlgo(const ParameterSet& config) {
00022   theSync = DTTTrigSyncFactory::get()->create(config.getParameter<string>("tTrigMode"),
00023                                               config.getParameter<ParameterSet>("tTrigModeConfig"));
00024 }
00025 
00026 DTRecHitBaseAlgo::~DTRecHitBaseAlgo(){}
00027 
00028 
00029 // Build all hits in the range associated to the layerId, at the 1st step.
00030 OwnVector<DTRecHit1DPair> DTRecHitBaseAlgo::reconstruct(const DTLayer* layer,
00031                                                         const DTLayerId& layerId,
00032                                                         const DTDigiCollection::Range& digiRange) {
00033   OwnVector<DTRecHit1DPair> result; 
00034 
00035   // Loop over all digis in the given range
00036   for (DTDigiCollection::const_iterator digi = digiRange.first;
00037        digi != digiRange.second;
00038        digi++) {
00039     // Get the wireId
00040     DTWireId wireId(layerId, (*digi).wire());
00041     
00042     LocalError tmpErr;
00043     LocalPoint lpoint, rpoint;
00044     // Call the compute method
00045     bool OK = compute(layer, *digi, lpoint, rpoint, tmpErr);
00046     if (!OK) continue;
00047 
00048     // Build a new pair of 1D rechit    
00049     DTRecHit1DPair*  recHitPair = new DTRecHit1DPair(wireId, *digi);
00050 
00051     // Set the position and the error of the 1D rechits
00052     recHitPair->setPositionAndError(DTEnums::Left, lpoint, tmpErr);
00053     recHitPair->setPositionAndError(DTEnums::Right, rpoint, tmpErr);        
00054 
00055     result.push_back(recHitPair);
00056   }
00057   return result;
00058 }
00059 
00060 
00061