CMS 3D CMS Logo

Public Member Functions | Private Types | Private Member Functions | Private Attributes

PixelTripletLowPtGenerator Class Reference

#include <PixelTripletLowPtGenerator.h>

Inheritance diagram for PixelTripletLowPtGenerator:
HitTripletGeneratorFromPairAndLayers HitTripletGenerator OrderedHitsGenerator

List of all members.

Public Member Functions

virtual void hitTriplets (const TrackingRegion &region, OrderedHitTriplets &trs, const edm::Event &ev, const edm::EventSetup &es)
virtual void init (const HitPairGenerator &pairs, const std::vector< ctfseeding::SeedingLayer > &layers, LayerCacheType *layerCache)
const HitPairGeneratorpairGenerator () const
 PixelTripletLowPtGenerator (const edm::ParameterSet &cfg)
const std::vector
< ctfseeding::SeedingLayer > & 
thirdLayers () const
virtual ~PixelTripletLowPtGenerator ()

Private Types

typedef
CombinedHitTripletGenerator::LayerCacheType 
LayerCacheType

Private Member Functions

GlobalPoint getGlobalPosition (const TrackingRecHit *recHit)
void getTracker (const edm::EventSetup &es)

Private Attributes

std::string builderName
bool checkClusterShape
bool checkMultipleScattering
double maxAngleRatio
double nSigMultipleScattering
edm::ParameterSet ps
double rzTolerance
TripletFiltertheFilter
LayerCacheTypetheLayerCache
std::vector
< ctfseeding::SeedingLayer
theLayers
HitPairGeneratorthePairGenerator
const TrackerGeometrytheTracker

Detailed Description

Definition at line 25 of file PixelTripletLowPtGenerator.h.


Member Typedef Documentation

Reimplemented from HitTripletGeneratorFromPairAndLayers.

Definition at line 28 of file PixelTripletLowPtGenerator.h.


Constructor & Destructor Documentation

PixelTripletLowPtGenerator::PixelTripletLowPtGenerator ( const edm::ParameterSet cfg) [inline]

Definition at line 31 of file PixelTripletLowPtGenerator.h.

References theFilter, and theTracker.

    : ps(cfg), thePairGenerator(0), theLayerCache(0)
   { theTracker = 0; theFilter = 0; }
virtual PixelTripletLowPtGenerator::~PixelTripletLowPtGenerator ( ) [inline, virtual]

Definition at line 35 of file PixelTripletLowPtGenerator.h.

References theFilter, and thePairGenerator.

{ delete thePairGenerator; delete theFilter; }

Member Function Documentation

GlobalPoint PixelTripletLowPtGenerator::getGlobalPosition ( const TrackingRecHit recHit) [private]

Definition at line 58 of file PixelTripletLowPtGenerator.cc.

References TrackingRecHit::geographicalId(), and TrackingRecHit::localPosition().

{
  DetId detId = recHit->geographicalId();

  return
    theTracker->idToDet(detId)->toGlobal(recHit->localPosition());
}
void PixelTripletLowPtGenerator::getTracker ( const edm::EventSetup es) [private]
void PixelTripletLowPtGenerator::hitTriplets ( const TrackingRegion region,
OrderedHitTriplets trs,
const edm::Event ev,
const edm::EventSetup es 
) [virtual]

Implements HitTripletGenerator.

Definition at line 67 of file PixelTripletLowPtGenerator.cc.

References benchmark_cfg::cerr, ctfseeding::SeedingLayer::detLayer(), HitInfo::getInfo(), ThirdHitPrediction::getRanges(), RecHitsSortedInPhi::hits(), i, ThirdHitPrediction::isCompatibleWithMultipleScattering(), DetLayer::location(), PixelRecoRange< T >::max(), PixelRecoRange< T >::min(), phi, findQualityFiles::size, OrderedHitPairs::size(), and DetLayer::subDetector().

{
  // Generate pairs
  OrderedHitPairs pairs; pairs.reserve(30000);
  thePairGenerator->hitPairs(region,pairs,ev,es);

  if (pairs.size() == 0) return;

  int size = theLayers.size(); 

  // Set aliases
  const RecHitsSortedInPhi **thirdHitMap = new const RecHitsSortedInPhi*[size]; 
  for(int il=0; il<size; il++)
    thirdHitMap[il] = &(*theLayerCache)(&theLayers[il], region, ev, es);

  // Get tracker
  getTracker(es);

  // Look at all generated pairs
  for(OrderedHitPairs::const_iterator ip = pairs.begin();
                                      ip!= pairs.end(); ip++)
  {
    // Fill rechits and points
    vector<const TrackingRecHit*> recHits(3);
    vector<GlobalPoint> points(3);

    recHits[0] = (*ip).inner()->hit();
    recHits[1] = (*ip).outer()->hit();

#ifdef Debug
    cerr << " RecHits " + HitInfo::getInfo(*recHits[0]) +
                          HitInfo::getInfo(*recHits[1]) << endl;
#endif

    for(int i=0; i<2; i++)
      points[i] = getGlobalPosition(recHits[i]);

    // Initialize helix prediction
    ThirdHitPrediction
      thePrediction(region,
                    points[0],points[1], es,
                    nSigMultipleScattering,maxAngleRatio,builderName);

    // Look at all layers
    for(int il=0; il<size; il++)
    {
      const SeedingLayer & layerwithhits = theLayers[il];
      const DetLayer * layer = layerwithhits.detLayer();

#ifdef Debug
      cerr << "  check layer " << layer->subDetector()
                        << " " << layer->location() << endl;
#endif

      // Get ranges for the third hit
      float phi[2],rz[2];
      thePrediction.getRanges(layer, phi,rz);

      PixelRecoRange<float> phiRange(phi[0]              , phi[1]             );
      PixelRecoRange<float>  rzRange( rz[0] - rzTolerance, rz[1] + rzTolerance);

      // Get third hit candidates from cache
      typedef RecHitsSortedInPhi::Hit Hit;
      vector<Hit> thirdHits = thirdHitMap[il]->hits(phiRange.min(),phiRange.max());
      typedef vector<Hit>::const_iterator IH;

      for (IH th=thirdHits.begin(), eh=thirdHits.end(); th < eh; ++th) 
      {
        // Fill rechit and point
        recHits[2] = (*th)->hit();
        points[2]  = getGlobalPosition(recHits[2]);

#ifdef Debug
        cerr << "  third hit " + HitInfo::getInfo(*recHits[2]) << endl;
#endif

        // Check if third hit is compatible with multiple scattering
        vector<GlobalVector> globalDirs;
        if(thePrediction.isCompatibleWithMultipleScattering
             (points[2], recHits, globalDirs, es) == false)
        {
#ifdef Debug
          cerr << "  not compatible: multiple scattering" << endl;
#endif
          if(checkMultipleScattering) continue;
        }

        // Convert to localDirs
/*
        vector<LocalVector> localDirs;
        vector<GlobalVector>::const_iterator globalDir = globalDirs.begin();
        for(vector<const TrackingRecHit *>::const_iterator
                                            recHit  = recHits.begin();
                                            recHit != recHits.end(); recHit++)
        {
          localDirs.push_back(theTracker->idToDet(
                             (*recHit)->geographicalId())->toLocal(*globalDir));
          globalDir++;
        }
*/

        // Check if the cluster shapes are compatible with thrusts
        if(checkClusterShape)
        {
          if(! theFilter->checkTrack(recHits,globalDirs))
          {
#ifdef Debug
            cerr << "  not compatible: cluster shape" << endl;
#endif
            continue;
          }
        }

        // All checks passed, put triplet back
        result.push_back(OrderedHitTriplet((*ip).inner(),(*ip).outer(),*th));
      }
    }
  } 
  delete [] thirdHitMap;

  return;
}
virtual void PixelTripletLowPtGenerator::init ( const HitPairGenerator pairs,
const std::vector< ctfseeding::SeedingLayer > &  layers,
LayerCacheType layerCache 
) [virtual]
const HitPairGenerator& PixelTripletLowPtGenerator::pairGenerator ( ) const [inline]

Definition at line 42 of file PixelTripletLowPtGenerator.h.

References thePairGenerator.

{ return *thePairGenerator; }
const std::vector<ctfseeding::SeedingLayer>& PixelTripletLowPtGenerator::thirdLayers ( ) const [inline]

Definition at line 43 of file PixelTripletLowPtGenerator.h.

References theLayers.

{ return theLayers; }

Member Data Documentation

Definition at line 63 of file PixelTripletLowPtGenerator.h.

Definition at line 59 of file PixelTripletLowPtGenerator.h.

Definition at line 57 of file PixelTripletLowPtGenerator.h.

Definition at line 61 of file PixelTripletLowPtGenerator.h.

Definition at line 58 of file PixelTripletLowPtGenerator.h.

Definition at line 52 of file PixelTripletLowPtGenerator.h.

Definition at line 60 of file PixelTripletLowPtGenerator.h.

Definition at line 55 of file PixelTripletLowPtGenerator.h.

Definition at line 54 of file PixelTripletLowPtGenerator.h.

Referenced by thirdLayers().

Definition at line 53 of file PixelTripletLowPtGenerator.h.

Referenced by pairGenerator(), and ~PixelTripletLowPtGenerator().

Definition at line 49 of file PixelTripletLowPtGenerator.h.

Referenced by PixelTripletLowPtGenerator().