CMS 3D CMS Logo

Public Member Functions | Private Attributes

PixelMatchNextLayers Class Reference

#include <PixelMatchNextLayers.h>

List of all members.

Public Member Functions

std::vector
< TrajectoryMeasurement
badMeasurementsInNextLayers () const
TransientTrackingRecHit::RecHitContainer hitsInNextLayers () const
std::vector
< TrajectoryMeasurement
measurementsInNextLayers () const
 PixelMatchNextLayers (const LayerMeasurements *theLayerMeasurements, const DetLayer *ilayer, FreeTrajectoryState &aFTS, const PropagatorWithMaterial *aProp, const BarrelMeasurementEstimator *aBarrelMeas, const ForwardMeasurementEstimator *aForwardMeas, const TrackerTopology *tTopo, bool searchInTIDTEC)
std::vector< CLHEP::Hep3Vector > predictionInNextLayers () const

Private Attributes

std::vector
< TrajectoryMeasurement
badMeasurementsHere
TransientTrackingRecHit::RecHitContainer hitsHere
std::vector
< TrajectoryMeasurement
measurementsHere
std::vector< CLHEP::Hep3Vector > predictionHere

Detailed Description

Description: class to find the compatible hits in the next layer

Implementation: <Notes on="" implementation>="">

Definition at line 33 of file PixelMatchNextLayers.h.


Constructor & Destructor Documentation

PixelMatchNextLayers::PixelMatchNextLayers ( const LayerMeasurements theLayerMeasurements,
const DetLayer ilayer,
FreeTrajectoryState aFTS,
const PropagatorWithMaterial aProp,
const BarrelMeasurementEstimator aBarrelMeas,
const ForwardMeasurementEstimator aForwardMeas,
const TrackerTopology tTopo,
bool  searchInTIDTEC 
)

Definition at line 32 of file PixelMatchNextLayers.cc.

References alongMomentum, badMeasurementsHere, GeomDetEnumerators::endcap, hitsHere, DetLayer::location(), m, LayerMeasurements::measurements(), measurementsHere, DetLayer::nextLayers(), GeomDetEnumerators::PixelBarrel, GeomDetEnumerators::PixelEndcap, predictionHere, GeometricSearchDet::surface(), GeomDetEnumerators::TEC, TrackerTopology::tecRing(), TrackerTopology::tecWheel(), GeomDetEnumerators::TID, and TrackerTopology::tidRing().

 {

  typedef std::vector<TrajectoryMeasurement>::const_iterator aMeas;
  std::vector<const DetLayer*> allayers;
  std::vector<const DetLayer*> nl = ilayer->nextLayers( aFTS, alongMomentum);
  for (std::vector<const DetLayer*>::const_iterator il = nl.begin(); il != nl.end(); il++) {
    allayers.push_back(*il);
    std::vector<const DetLayer*> n2l = (*il)->nextLayers( aFTS, alongMomentum);
    for (std::vector<const DetLayer*>::const_iterator i2l = n2l.begin(); i2l != n2l.end(); i2l++) {
      allayers.push_back(*i2l);
    }
  }

  const TrajectoryStateOnSurface tsos(aFTS,ilayer->surface());
  
  if (tsos.isValid()) 
    {    
      for (std::vector<const DetLayer*>::const_iterator il = allayers.begin(); il != allayers.end(); il++) 
        {
          if ( (*il)->subDetector()==GeomDetEnumerators::PixelBarrel || (*il)->subDetector()==GeomDetEnumerators::PixelEndcap ) {
            
            std::vector<TrajectoryMeasurement> pixelMeasurements;
            if ((*il)->subDetector()==GeomDetEnumerators::PixelBarrel) {
              pixelMeasurements = theLayerMeasurements->measurements( **il, tsos , *aProp, *aBarrelMeas); 
            } else {
              pixelMeasurements = theLayerMeasurements->measurements( **il, tsos, *aProp, *aForwardMeas);
            }
            for (aMeas m=pixelMeasurements.begin(); m!=pixelMeasurements.end(); m++){
              if (m == pixelMeasurements.begin()){
                CLHEP::Hep3Vector prediction(m->forwardPredictedState().globalPosition().x(),
                                      m->forwardPredictedState().globalPosition().y(),
                                      m->forwardPredictedState().globalPosition().z());
                predictionHere.push_back( prediction);
              }
              if (m->recHit()->isValid()) {
                measurementsHere.push_back( *m);
                hitsHere.push_back( m->recHit());

                //std::cout<<"\n SH B-D "<<std::endl;

              } else {
                badMeasurementsHere.push_back( *m);
              }
            }
          }
          if (searchInTIDTEC) {   
          //additional search in the TID layers
          if ( ((*il)->subDetector())==GeomDetEnumerators::TID && (ilayer->location()) == GeomDetEnumerators::endcap)
            {
              std::vector<TrajectoryMeasurement> pixelMeasurements;
              pixelMeasurements = theLayerMeasurements->measurements( (**il), tsos , *aProp, *aForwardMeas); 
              
              for (aMeas m=pixelMeasurements.begin(); m!=pixelMeasurements.end(); m++)
                {
                  // limit search in first ring
                  if (tTopo->tidRing(m->recHit()->geographicalId()) > 1) continue;
                  if (m == pixelMeasurements.begin())
                    {
                      CLHEP::Hep3Vector prediction(m->forwardPredictedState().globalPosition().x(),
                                            m->forwardPredictedState().globalPosition().y(),
                                            m->forwardPredictedState().globalPosition().z());
                      predictionHere.push_back( prediction);
                    }
                  if (m->recHit()->isValid()) 
                    {
                      measurementsHere.push_back( *m);
                      hitsHere.push_back(m->recHit());
                    }
                  // else{ std::cout<<" 2H not valid "<<std::endl;}
                }
            } //end of TID search
          
          //additional search in the TEC layers
          if ( ((*il)->subDetector())==GeomDetEnumerators::TEC && (ilayer->location()) == GeomDetEnumerators::endcap)
            {
              std::vector<TrajectoryMeasurement> pixelMeasurements;
              pixelMeasurements = theLayerMeasurements->measurements( (**il), tsos , *aProp, *aForwardMeas); 
                      
              for (aMeas m=pixelMeasurements.begin(); m!=pixelMeasurements.end(); m++)
                {
                  // limit search in first ring and first third wheels
                  if (tTopo->tecRing(m->recHit()->geographicalId()) > 1) continue;
                  if (tTopo->tecWheel(m->recHit()->geographicalId()) > 3) continue;
                  if (m == pixelMeasurements.begin())
                    {
                      CLHEP::Hep3Vector prediction(m->forwardPredictedState().globalPosition().x(),
                                            m->forwardPredictedState().globalPosition().y(),
                                            m->forwardPredictedState().globalPosition().z());
                      predictionHere.push_back( prediction);
                    }
                  if (m->recHit()->isValid()) 
                    {
                      measurementsHere.push_back( *m);
                      hitsHere.push_back(m->recHit());

                      //std::cout<<"\n SH TEC "<<std::endl;

                    }
                  // else{ std::cout<<" 2H not valid "<<std::endl;}
                }
            } //end of TEC search
          }
        }
    } 
}

Member Function Documentation

std::vector< TrajectoryMeasurement > PixelMatchNextLayers::badMeasurementsInNextLayers ( ) const

Definition at line 151 of file PixelMatchNextLayers.cc.

References badMeasurementsHere.

                                                                                         {

  return badMeasurementsHere;
}
TransientTrackingRecHit::RecHitContainer PixelMatchNextLayers::hitsInNextLayers ( ) const

Definition at line 156 of file PixelMatchNextLayers.cc.

References hitsHere.

                                                                                    {

  return hitsHere;
}
std::vector< TrajectoryMeasurement > PixelMatchNextLayers::measurementsInNextLayers ( ) const

Definition at line 146 of file PixelMatchNextLayers.cc.

References measurementsHere.

Referenced by PixelHitMatcher::compatibleHits().

                                                                                      {

  return measurementsHere;
}
std::vector< CLHEP::Hep3Vector > PixelMatchNextLayers::predictionInNextLayers ( ) const

Definition at line 161 of file PixelMatchNextLayers.cc.

References predictionHere.

Referenced by PixelHitMatcher::compatibleHits().

                                                                              {

  return predictionHere;
}

Member Data Documentation

Definition at line 53 of file PixelMatchNextLayers.h.

Referenced by badMeasurementsInNextLayers(), and PixelMatchNextLayers().

Definition at line 54 of file PixelMatchNextLayers.h.

Referenced by hitsInNextLayers(), and PixelMatchNextLayers().

Definition at line 52 of file PixelMatchNextLayers.h.

Referenced by measurementsInNextLayers(), and PixelMatchNextLayers().

std::vector<CLHEP::Hep3Vector> PixelMatchNextLayers::predictionHere [private]

Definition at line 55 of file PixelMatchNextLayers.h.

Referenced by PixelMatchNextLayers(), and predictionInNextLayers().