CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch12/src/RecoLocalMuon/DTSegment/src/DTSegmentExtendedCand.cc

Go to the documentation of this file.
00001 /******* \class DTSegmentExtendedCand *******
00002  *
00003  * Description:
00004  *  
00005  *  detailed description
00006  *
00007  * \author : Stefano Lacaprara - INFN LNL <stefano.lacaprara@pd.infn.it>
00008  * $date   : 15/05/2008 17:50:32 CEST $
00009  *
00010  * Modification:
00011  *
00012  *********************************/
00013 
00014 /* This Class Header */
00015 #include "RecoLocalMuon/DTSegment/src/DTSegmentExtendedCand.h"
00016 
00017 /* Collaborating Class Header */
00018 
00019 /* C++ Headers */
00020 #include <iostream>
00021 using namespace std;
00022 
00023 /* ====================================================================== */
00024 
00025 /* Constructor */ 
00026 
00027 /* Destructor */ 
00028 
00029 /* Operations */ 
00030 bool DTSegmentExtendedCand::isCompatible(const DTSegmentExtendedCand::DTSLRecClusterForFit& clus) {
00031   LocalPoint posAtSL =
00032     position()+direction()*(clus.pos.z()-position().z())/cos(direction().theta());
00033   // cout << "pos :" << clus.pos << " posAtSL " << posAtSL << endl;
00034   static float errScaleFact=10.;
00035   static float minError=25.; // (cm)
00036   // cout << "clus.err.xx() " << clus.err << endl;
00037   return fabs((posAtSL-clus.pos).x())<max(errScaleFact*sqrt(clus.err.xx()), minError);
00038 }
00039 
00040 unsigned int DTSegmentExtendedCand::nHits() const {
00041   return DTSegmentCand::nHits()+theClus.size();
00042 }
00043 
00044 bool DTSegmentExtendedCand::good() const {
00045   if (superLayer()->id().superLayer()==2) 
00046      return DTSegmentCand::nHits()>=nHitsMin && chi2()/NDOF() < chi2max*2.;
00047   return DTSegmentCand::nHits()>=nHitsMin && chi2()/NDOF() < chi2max ;
00048 }