CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_5/src/Geometry/TrackerNumberingBuilder/plugins/DDDCmsTrackerContruction.cc

Go to the documentation of this file.
00001 #include "Geometry/TrackerNumberingBuilder/plugins/DDDCmsTrackerContruction.h"
00002 #include "DetectorDescription/Core/interface/DDFilteredView.h"
00003 #include "DetectorDescription/Core/interface/DDCompactView.h"
00004 #include "Geometry/TrackerNumberingBuilder/interface/GeometricDet.h"
00005 #include "Geometry/TrackerNumberingBuilder/plugins/ExtractStringFromDDD.h"
00006 #include "Geometry/TrackerNumberingBuilder/plugins/CmsTrackerBuilder.h"
00007 #include "Geometry/TrackerNumberingBuilder/plugins/CmsTrackerDetIdBuilder.h"
00008 
00009 using namespace cms;
00010 
00011 DDDCmsTrackerContruction::DDDCmsTrackerContruction( void )
00012 {}
00013 
00014 const GeometricDet*
00015 DDDCmsTrackerContruction::construct( const DDCompactView* cpv, unsigned int layerNumberPXB, unsigned int totalBlade )
00016 {
00017   attribute = "TkDDDStructure"; // could come from .orcarc
00018   std::string value = "any";
00019   DDSpecificsFilter filter;
00020   DDValue ddv( attribute, value, 0 );
00021   filter.setCriteria( ddv, DDSpecificsFilter::not_equals );
00022   
00023   DDFilteredView fv( *cpv ); 
00024   fv.addFilter( filter );
00025   if( theCmsTrackerStringToEnum.type( ExtractStringFromDDD::getString(attribute,&fv)) != GeometricDet::Tracker )
00026   {
00027     fv.firstChild();
00028     if( theCmsTrackerStringToEnum.type( ExtractStringFromDDD::getString(attribute,&fv)) != GeometricDet::Tracker )
00029     {  
00030       throw cms::Exception( "Configuration" ) << " The first child of the DDFilteredView is not what is expected \n"
00031                                               << ExtractStringFromDDD::getString( attribute, &fv ) << "\n";
00032     }
00033   }
00034   
00035   GeometricDet* tracker = new GeometricDet( &fv, GeometricDet::Tracker );
00036   CmsTrackerBuilder theCmsTrackerBuilder( totalBlade );
00037   theCmsTrackerBuilder.build( fv, tracker, attribute );
00038   
00039   CmsTrackerDetIdBuilder theCmsTrackerDetIdBuilder( layerNumberPXB );
00040   
00041   tracker = theCmsTrackerDetIdBuilder.buildId( tracker );
00042   fv.parent();
00043   //
00044   // set the Tracker
00045   //
00046   //TrackerMapDDDtoID::instance().setTracker(tracker);
00047   //NOTE: If it is decided that the TrackerMapDDDtoID should be
00048   // constructed here, then we should return from this
00049   // function so that the EventSetup can manage it
00050 
00051   return tracker;
00052 }
00053