CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_5_3_13_patch3/src/TrackingTools/DetLayers/src/DetRodOneR.cc

Go to the documentation of this file.
00001 #include "TrackingTools/DetLayers/interface/DetRodOneR.h"
00002 #include "TrackingTools/TrajectoryState/interface/TrajectoryStateOnSurface.h" 
00003 #include "TrackingTools/DetLayers/interface/RodPlaneBuilderFromDet.h"
00004 
00005 #include <Utilities/General/interface/precomputed_value_sort.h>
00006 #include <Geometry/CommonDetUnit/interface/DetSorting.h>
00007 
00008 #include <algorithm>
00009 #include <cmath>
00010 
00011 using namespace std;
00012 
00013 DetRodOneR::~DetRodOneR(){}
00014 
00015 DetRodOneR::DetRodOneR(vector<const GeomDet*>::const_iterator first,
00016                        vector<const GeomDet*>::const_iterator last)
00017   : theDets(first,last)
00018 {
00019   initialize();
00020 }
00021 
00022 DetRodOneR::DetRodOneR( const vector<const GeomDet*>& dets)
00023   : theDets(dets) 
00024 {
00025   initialize();
00026 }
00027 
00028 
00029 void DetRodOneR::initialize()
00030 {
00031   // assume the dets ARE in a rod;
00032   // sort them in Z
00033 
00034   precomputed_value_sort( theDets.begin(), theDets.end(), geomsort::DetZ());
00035   
00036   setPlane( RodPlaneBuilderFromDet()( theDets));
00037   
00038 }
00039 
00040 
00041 // It needs that the basic component to have the compatible() method
00042 bool DetRodOneR::add( int idet, vector<DetWithState>& result,
00043                       const TrajectoryStateOnSurface& startingState,
00044                       const Propagator& prop, 
00045                       const MeasurementEstimator& est) const
00046 {
00047   pair<bool,TrajectoryStateOnSurface> compat = 
00048     theCompatibilityChecker.isCompatible(theDets[idet],startingState, prop, est);
00049   
00050   if (compat.first) {
00051     result.push_back( DetWithState( theDets[idet], compat.second));
00052   }
00053 
00054   return compat.first;
00055 }