CMS 3D CMS Logo

Static Public Member Functions

MuonTransientTrackingRecHitBreaker Class Reference

#include <MuonTransientTrackingRecHitBreaker.h>

List of all members.

Static Public Member Functions

static
TransientTrackingRecHit::ConstRecHitContainer 
breakInSubRecHits (TransientTrackingRecHit::ConstRecHitPointer, int granularity)
 takes a muon rechit and returns its sub-rechits given a certain granularity

Detailed Description

No description available.

Date:
2008/04/24 18:14:07
Revision:
1.1
Author:
R. Bellan - INFN Torino <riccardo.bellan@cern.ch>

Definition at line 14 of file MuonTransientTrackingRecHitBreaker.h.


Member Function Documentation

TransientTrackingRecHit::ConstRecHitContainer MuonTransientTrackingRecHitBreaker::breakInSubRecHits ( TransientTrackingRecHit::ConstRecHitPointer  muonRecHit,
int  granularity 
) [static]

takes a muon rechit and returns its sub-rechits given a certain granularity

Definition at line 6 of file MuonTransientTrackingRecHitBreaker.cc.

References filterCSVwithJSON::copy, MuonSubdetId::CSC, MuonSubdetId::DT, Exception, metname, and MuonSubdetId::RPC.

Referenced by MuonTrajectoryCleaner::clean(), MuonShowerInformationFiller::hitsFromSegments(), SeedTransformer::seedTransform(), and MuonTrajectoryUpdator::update().

                                                                                                                          {

  const std::string metname = "Muon|RecoMuon|MuonTransientTrackingRecHitBreaker";

  TransientTrackingRecHit::ConstRecHitContainer recHitsForFit;
  
  int subDet = muonRecHit->geographicalId().subdetId();

  switch(granularity){
  case 0:
    {
      // Asking for 4D segments for the CSC/DT and a point for the RPC
      recHitsForFit.push_back( muonRecHit );
      break;
    }
  case 1:
    {
      if (subDet == MuonSubdetId::DT ||
          subDet == MuonSubdetId::CSC) 
        // measurement->recHit() returns a 4D segment, then
        // DT case: asking for 2D segments.
        // CSC case: asking for 2D points.
        recHitsForFit = muonRecHit->transientHits();
      
      else if(subDet == MuonSubdetId::RPC)
        recHitsForFit.push_back( muonRecHit);   
      
      break;
    }
    
  case 2:
    {
      if (subDet == MuonSubdetId::DT ) {

        // Asking for 2D segments. measurement->recHit() returns a 4D segment
        TransientTrackingRecHit::ConstRecHitContainer segments2D = muonRecHit->transientHits();
        
        // loop over segment
        for (TransientTrackingRecHit::ConstRecHitContainer::const_iterator segment = segments2D.begin(); 
             segment != segments2D.end();++segment ){

          // asking for 1D Rec Hit
          TransientTrackingRecHit::ConstRecHitContainer rechit1D = (**segment).transientHits();
          
          // load them into the recHitsForFit container
          copy(rechit1D.begin(),rechit1D.end(),back_inserter(recHitsForFit));
        }
      }

      else if(subDet == MuonSubdetId::RPC)
        recHitsForFit.push_back(muonRecHit);
      
      else if(subDet == MuonSubdetId::CSC)      
        // Asking for 2D points. measurement->recHit() returns a 4D segment
        recHitsForFit = (*muonRecHit).transientHits();
      
      break;
    }
    
  default:
    {
      throw cms::Exception(metname) <<"Wrong granularity chosen!"
                                    <<"it will be set to 0";
      break;
    }
  }

  return recHitsForFit;
}