Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:53:14

0001 /******* \class DTSLRecCluster *******
0002  *
0003  * Description:
0004  *  
0005  *  detailed description
0006  *
0007  * \author : Stefano Lacaprara - INFN LNL <stefano.lacaprara@pd.infn.it>
0008  *
0009  * Modification:
0010  *
0011  *********************************/
0012 
0013 /* This Class Header */
0014 #include "DataFormats/DTRecHit/interface/DTSLRecCluster.h"
0015 
0016 /* Collaborating Class Header */
0017 
0018 /* C++ Headers */
0019 #include <iostream>
0020 using namespace std;
0021 
0022 /* ====================================================================== */
0023 
0024 /* static member definition */
0025 static AlgebraicMatrix initMatrix() {
0026   AlgebraicMatrix m(2, 5, 0);
0027   m[0][1] = 1;
0028   return m;
0029 }
0030 
0031 const AlgebraicMatrix DTSLRecCluster::theProjectionMatrix = initMatrix();
0032 
0033 /* Constructor */
0034 DTSLRecCluster::DTSLRecCluster(const DTSuperLayerId id, const std::vector<DTRecHit1DPair>& pairs)
0035     : theSlid(id), thePairs(pairs) {}
0036 
0037 DTSLRecCluster::DTSLRecCluster(const DTSuperLayerId id,
0038                                const LocalPoint& pos,
0039                                const LocalError& err,
0040                                const std::vector<DTRecHit1DPair>& pairs)
0041     : theSlid(id), thePos(pos), thePosError(err), thePairs(pairs) {}
0042 
0043 /* Destructor */
0044 
0045 /* Operations */
0046 vector<const TrackingRecHit*> DTSLRecCluster::recHits() const {
0047   std::vector<const TrackingRecHit*> pointersOfRecHits;
0048 
0049   for (std::vector<DTRecHit1DPair>::const_iterator rechit = thePairs.begin(); rechit != thePairs.end(); rechit++)
0050     pointersOfRecHits.push_back(&(*rechit));
0051 
0052   return pointersOfRecHits;
0053 }
0054 
0055 vector<TrackingRecHit*> DTSLRecCluster::recHits() {
0056   std::vector<TrackingRecHit*> pointersOfRecHits;
0057 
0058   for (std::vector<DTRecHit1DPair>::iterator rechit = thePairs.begin(); rechit != thePairs.end(); rechit++)
0059     pointersOfRecHits.push_back(&(*rechit));
0060 
0061   return pointersOfRecHits;
0062 }
0063 
0064 ostream& operator<<(ostream& os, const DTSLRecCluster& clus) {
0065   os << "Pos " << clus.localPosition() << " err " << clus.localPositionError() << " nHits: " << clus.nHits();
0066   return os;
0067 }