Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-08-21 04:02:43

0001 /*
0002  *  See header file for a description of this class.
0003  *
0004  *  \author M. Maggi -- INFN Bari
0005  */
0006 
0007 #include "RPCRecHitBaseAlgo.h"
0008 #include "RPCClusterContainer.h"
0009 #include "RPCCluster.h"
0010 #include "RPCClusterizer.h"
0011 #include "RPCMaskReClusterizer.h"
0012 
0013 RPCRecHitBaseAlgo::RPCRecHitBaseAlgo(const edm::ParameterSet& config) {
0014   //  theSync = RPCTTrigSyncFactory::get()->create(config.getParameter<string>("tTrigMode"),
0015   //config.getParameter<ParameterSet>("tTrigModeConfig"));
0016 }
0017 
0018 // Build all hits in the range associated to the layerId, at the 1st step.
0019 edm::OwnVector<RPCRecHit> RPCRecHitBaseAlgo::reconstruct(const RPCRoll& roll,
0020                                                          const RPCDetId& rpcId,
0021                                                          const RPCDigiCollection::Range& digiRange,
0022                                                          const RollMask& mask) {
0023   edm::OwnVector<RPCRecHit> result;
0024 
0025   RPCClusterizer clizer;
0026   RPCClusterContainer tcls = clizer.doAction(digiRange);
0027   RPCMaskReClusterizer mrclizer;
0028   RPCClusterContainer cls = mrclizer.doAction(rpcId, tcls, mask);
0029 
0030   for (const auto& cl : cls) {
0031     LocalError tmpErr;
0032     LocalPoint point;
0033     float time = 0, timeErr = -1;
0034 
0035     // Call the compute method
0036     const bool OK = this->compute(roll, cl, point, tmpErr, time, timeErr);
0037     if (!OK)
0038       continue;
0039 
0040     // Build a new pair of 1D rechit
0041     const int firstClustStrip = cl.firstStrip();
0042     const int clusterSize = cl.clusterSize();
0043     RPCRecHit* recHit = new RPCRecHit(rpcId, cl.bx(), firstClustStrip, clusterSize, point, tmpErr);
0044     recHit->setTimeAndError(time, timeErr);
0045 
0046     result.push_back(recHit);
0047   }
0048 
0049   return result;
0050 }