Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 /******* \class DTSegmentExtendedCand *******
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 "RecoLocalMuon/DTSegment/src/DTSegmentExtendedCand.h"
0015 
0016 /* Collaborating Class Header */
0017 
0018 /* C++ Headers */
0019 #include <iostream>
0020 using namespace std;
0021 
0022 /* ====================================================================== */
0023 
0024 /* Constructor */
0025 
0026 /* Destructor */
0027 
0028 /* Operations */
0029 bool DTSegmentExtendedCand::isCompatible(const DTSegmentExtendedCand::DTSLRecClusterForFit& clus) {
0030   LocalPoint posAtSL = position() + direction() * (clus.pos.z() - position().z()) / cos(direction().theta());
0031   // cout << "pos :" << clus.pos << " posAtSL " << posAtSL << endl;
0032   static constexpr float errScaleFact = 10.;
0033   static constexpr float minError = 25.;  // (cm)
0034   // cout << "clus.err.xx() " << clus.err << endl;
0035   return std::abs((posAtSL - clus.pos).x()) < max(errScaleFact * sqrt(clus.err.xx()), minError);
0036 }
0037 
0038 unsigned int DTSegmentExtendedCand::nHits() const { return DTSegmentCand::nHits() + theClus.size(); }
0039 
0040 bool DTSegmentExtendedCand::good() const {
0041   if (superLayer()->id().superLayer() == 2)
0042     return DTSegmentCand::nHits() >= nHitsMin && chi2() / NDOF() < chi2max * 2.;
0043   return DTSegmentCand::nHits() >= nHitsMin && chi2() / NDOF() < chi2max;
0044 }