CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch9/src/TrackingTools/DetLayers/src/ForwardDetRingOneZ.cc

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