CMS 3D CMS Logo

Public Member Functions | Private Member Functions

MuonOverlapSeedFromRecHits Class Reference

#include <MuonOverlapSeedFromRecHits.h>

Inheritance diagram for MuonOverlapSeedFromRecHits:
MuonSeedFromRecHits

List of all members.

Public Member Functions

bool makeSeed (MuonTransientTrackingRecHit::ConstMuonRecHitPointer barrelHit, MuonTransientTrackingRecHit::ConstMuonRecHitPointer endcapHit, MuonTransientTrackingRecHit::ConstMuonRecHitPointer bestSegment, TrajectorySeed &result) const
 MuonOverlapSeedFromRecHits ()
std::vector< TrajectorySeedseeds () const
virtual ~MuonOverlapSeedFromRecHits ()

Private Member Functions

ConstMuonRecHitPointer bestHit (const MuonRecHitContainer &barrelHits, const MuonRecHitContainer &endcapHits) const

Detailed Description

Definition at line 6 of file MuonOverlapSeedFromRecHits.h.


Constructor & Destructor Documentation

MuonOverlapSeedFromRecHits::MuonOverlapSeedFromRecHits ( )

Definition at line 14 of file MuonOverlapSeedFromRecHits.cc.

virtual MuonOverlapSeedFromRecHits::~MuonOverlapSeedFromRecHits ( ) [inline, virtual]

Definition at line 11 of file MuonOverlapSeedFromRecHits.h.

{}

Member Function Documentation

MuonTransientTrackingRecHit::ConstMuonRecHitPointer MuonOverlapSeedFromRecHits::bestHit ( const MuonRecHitContainer barrelHits,
const MuonRecHitContainer endcapHits 
) const [private]

Definition at line 104 of file MuonOverlapSeedFromRecHits.cc.

References MuonDTSeedFromRecHits::bestBarrelHit(), MuonCSCSeedFromRecHits::bestEndcapHit(), and query::result.

Referenced by seeds().

{
  MuonDTSeedFromRecHits dtSeeder;
  MuonCSCSeedFromRecHits cscSeeder;

  ConstMuonRecHitPointer result;
  if(barrelHits.size() > endcapHits.size()) 
  {
    result = dtSeeder.bestBarrelHit(barrelHits);
    if (result->dimension() == 2) result = cscSeeder.bestEndcapHit(endcapHits);
  }
  else
  {
    result = cscSeeder.bestEndcapHit(endcapHits);
  }
  return result;
}

Definition at line 72 of file MuonOverlapSeedFromRecHits.cc.

References MuonSeedFromRecHits::createSeed(), MuonSeedPtExtractor::pT_extract(), RPCpg::pts, and MuonSeedFromRecHits::thePtExtractor.

Referenced by seeds().

{
  std::vector<double> pts = thePtExtractor->pT_extract(barrelHit, endcapHit);
  double minpt = 3.;
  double pt = pts[0];
  double sigmapt = pts[1];
    // if too small, probably an error.  Keep trying.
  if(pt != 0) {
    if(fabs(pt) > minpt)
    {
      double maxpt = 2000.;
      if(pt > maxpt) {
        pt = maxpt;
        sigmapt = maxpt;
      }
      if(pt < -maxpt) {
        pt = -maxpt;
        sigmapt = maxpt;
      }
    }

    result = createSeed(pt, sigmapt, bestSegment);
    //std::cout << "OVERLAPFITTED PT " << pt << " dphi " << dphi << " eta " << eta << std::endl;
    return true;
  }
  return false;
}
std::vector< TrajectorySeed > MuonOverlapSeedFromRecHits::seeds ( ) const

Definition at line 22 of file MuonOverlapSeedFromRecHits.cc.

References bestHit(), end, makeSeed(), query::result, and MuonSeedFromRecHits::theRhits.

Referenced by MuonSeedFinder::seeds().

{
  std::vector<TrajectorySeed> result;
  //@@ doesn't handle overlap between ME11 and ME12 correctly
  // sort by station
  MuonRecHitContainer barrelHits, endcapHits;
  for ( MuonRecHitContainer::const_iterator iter = theRhits.begin(), end = theRhits.end();
        iter != end; ++iter)
  {
    if((*iter)->isDT())
    {
      DTChamberId dtId((**iter).geographicalId().rawId());
      // try not doing seeds that start in DT station 2, if there'as a good single segment seed
      if(dtId.station() == 1 || (dtId.station()==2 && (*iter)->dimension() == 2))
      {
        barrelHits.push_back(*iter);
      }
    }
    else
    {
      endcapHits.push_back(*iter);
    }
  }

  ConstMuonRecHitPointer bestSegment = bestHit(barrelHits, endcapHits);
  for ( MuonRecHitContainer::const_iterator barrelHitItr = barrelHits.begin(),
        lastBarrelHit = barrelHits.end();
        barrelHitItr != lastBarrelHit; ++barrelHitItr)
  {
    for ( MuonRecHitContainer::const_iterator endcapHitItr = endcapHits.begin(),
      lastEndcapHit = endcapHits.end();
      endcapHitItr != lastEndcapHit; ++endcapHitItr)
    {
      TrajectorySeed seed;
      bool good = makeSeed(*barrelHitItr, *endcapHitItr, bestSegment, seed);
      if(good) result.push_back(seed);
      // try just one seed
      return result;
    }
  }

  //std::cout << "Overlap hits " << barrelHits.size() << " " 
  //                             << endcapHits.size() << std::endl;

  return result;
}