From 7d3f46894a59f296c7bc1289eb139c5a720dccd5 Mon Sep 17 00:00:00 2001 From: Andre Sailer Date: Tue, 20 Jun 2017 11:39:06 +0200 Subject: [PATCH] Adapt to changes in namespaces and LCDD --> Detector --- src/Analysis/TrueTrackCritAnalyser.cc | 10 +++++----- src/FTDNoise/FTDBackgroundProcessor.cc | 8 ++++---- src/ForwardTracking/ForwardTracking.cc | 10 +++++----- src/ForwardTracking/SiliconEndcapTracking.cc | 8 ++++---- src/TrackingFeedback/TrackingFeedbackProcessor.cc | 6 +++--- 5 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/Analysis/TrueTrackCritAnalyser.cc b/src/Analysis/TrueTrackCritAnalyser.cc index 9c882dd..36569e3 100644 --- a/src/Analysis/TrueTrackCritAnalyser.cc +++ b/src/Analysis/TrueTrackCritAnalyser.cc @@ -10,7 +10,7 @@ #include "marlin/Global.h" //----From DD4Hep----------------------------- -#include "DD4hep/LCDD.h" +#include "DD4hep/Detector.h" #include "DD4hep/DD4hepUnits.h" #include "DDRec/DetectorData.h" @@ -119,9 +119,9 @@ void TrueTrackCritAnalyser::init() { // usually a good idea to printParameters() ; - DD4hep::Geometry::LCDD& lcdd = DD4hep::Geometry::LCDD::getInstance(); - DD4hep::Geometry::DetElement ftdDE = lcdd.detector("FTD") ; - DD4hep::DDRec::ZDiskPetalsData* ftd = ftdDE.extension() ; + dd4hep::Detector& theDetector = dd4hep::Detector::getInstance(); + dd4hep::DetElement ftdDE = theDetector.detector("FTD") ; + dd4hep::rec::ZDiskPetalsData* ftd = ftdDE.extension() ; int nLayers = ftd->layers.size() + 1; // we add one layer for the IP @@ -130,7 +130,7 @@ void TrueTrackCritAnalyser::init() { // make sure we take the highest number of modules / sensors available for(unsigned i=0,n=ftd->layers.size() ; ilayers[i] ; + const dd4hep::rec::ZDiskPetalsData::LayerLayout& l = ftd->layers[i] ; if( l.petalNumber > nModules ) nModules = l.petalNumber ; if( l.sensorsPerPetal > nSensors ) nSensors = l.sensorsPerPetal ; diff --git a/src/FTDNoise/FTDBackgroundProcessor.cc b/src/FTDNoise/FTDBackgroundProcessor.cc index da0be3a..0bef0f5 100644 --- a/src/FTDNoise/FTDBackgroundProcessor.cc +++ b/src/FTDNoise/FTDBackgroundProcessor.cc @@ -16,7 +16,7 @@ #include "marlin/VerbosityLevels.h" //----From DD4Hep----------------------------- -#include "DD4hep/LCDD.h" +#include "DD4hep/Detector.h" #include "DD4hep/DD4hepUnits.h" #include "DDRec/DetectorData.h" #include "DDRec/Surface.h" @@ -188,8 +188,8 @@ void FTDBackgroundProcessor::processEvent( LCEvent * evt ) { /* Get geometry parameters and seed */ /**********************************************************************************************/ - DD4hep::Geometry::LCDD& lcdd = DD4hep::Geometry::LCDD::getInstance(); - DD4hep::Geometry::DetElement ftdDE = lcdd.detector("FTD") ; + dd4hep::Detector& theDetector = dd4hep::Detector::getInstance(); + dd4hep::DetElement ftdDE = theDetector.detector("FTD") ; DD4hep::DDRec::ZDiskPetalsData* ftd = ftdDE.extension() ; int nLayers = ftd->layers.size() ; @@ -199,7 +199,7 @@ void FTDBackgroundProcessor::processEvent( LCEvent * evt ) { // map with tracking surfaces - DD4hep::DDRec::SurfaceManager& surfMan = *lcdd.extension< DD4hep::DDRec::SurfaceManager >() ; + DD4hep::DDRec::SurfaceManager& surfMan = *theDetector.extension< DD4hep::DDRec::SurfaceManager >() ; const DD4hep::DDRec::SurfaceMap& surfMap = *surfMan.map( "world" ) ; diff --git a/src/ForwardTracking/ForwardTracking.cc b/src/ForwardTracking/ForwardTracking.cc index 78d9a81..5202a47 100644 --- a/src/ForwardTracking/ForwardTracking.cc +++ b/src/ForwardTracking/ForwardTracking.cc @@ -16,7 +16,7 @@ #include "MarlinCED.h" //----From DD4Hep----------------------------- -#include "DD4hep/LCDD.h" +#include "DD4hep/Detector.h" #include "DD4hep/DD4hepUnits.h" #include "DDRec/DetectorData.h" @@ -231,9 +231,9 @@ void ForwardTracking::init() { /**********************************************************************************************/ // The SectorSystemFTD is the object translating the sectors of the hits into layers, modules etc. and vice versa - DD4hep::Geometry::LCDD& lcdd = DD4hep::Geometry::LCDD::getInstance(); - DD4hep::Geometry::DetElement ftdDE = lcdd.detector("FTD") ; - DD4hep::DDRec::ZDiskPetalsData* ftd = ftdDE.extension() ; + dd4hep::Detector& lcdd = dd4hep::Detector::getInstance(); + dd4hep::DetElement ftdDE = lcdd.detector("FTD") ; + dd4hep::rec::ZDiskPetalsData* ftd = ftdDE.extension() ; int nLayers = ftd->layers.size() + 1; // we add one layer for the IP @@ -242,7 +242,7 @@ void ForwardTracking::init() { // make sure we take the highest number of modules / sensors available for(unsigned i=0,n=ftd->layers.size() ; ilayers[i] ; + const dd4hep::rec::ZDiskPetalsData::LayerLayout& l = ftd->layers[i] ; if( l.petalNumber > nModules ) nModules = l.petalNumber ; if( l.sensorsPerPetal > nSensors ) nSensors = l.sensorsPerPetal ; diff --git a/src/ForwardTracking/SiliconEndcapTracking.cc b/src/ForwardTracking/SiliconEndcapTracking.cc index 9539818..416c27d 100644 --- a/src/ForwardTracking/SiliconEndcapTracking.cc +++ b/src/ForwardTracking/SiliconEndcapTracking.cc @@ -16,7 +16,7 @@ #include "MarlinCED.h" //----From DD4Hep----------------------------- -#include "DD4hep/LCDD.h" +#include "DD4hep/Detector.h" #include "DD4hep/DD4hepUnits.h" @@ -284,10 +284,10 @@ void SiliconEndcapTracking::init() { // Get the B Field in z direction //---------DD4Hep------------- - DD4hep::Geometry::LCDD& lcdd = DD4hep::Geometry::LCDD::getInstance(); + dd4hep::Detector& theDetector = dd4hep::Detector::getInstance(); const double pos[3]={0,0,0}; double magneticFieldVector[3]={0,0,0}; - lcdd.field().magneticField(pos,magneticFieldVector); // get the magnetic field vector from DD4hep + theDetector.field().magneticField(pos,magneticFieldVector); // get the magnetic field vector from DD4hep _Bz = magneticFieldVector[2]/dd4hep::tesla; streamlog_out( DEBUG2 ) << " Bz = " << _Bz << " \n"; @@ -1521,7 +1521,7 @@ void SiliconEndcapTracking::getCellID0AndPositionInfo(LCCollection*& col ){ for (int i=0; igetNumberOfElements(); i++){ TrackerHitPlane* trackerHit = dynamic_cast( col->getElementAt(i) ) ; - DD4hep::long64 id = trackerHit->getCellID0() ; + dd4hep::long64 id = trackerHit->getCellID0(); cellid_decoder.setValue( id ) ; int layer = cellid_decoder["layer"].value(); diff --git a/src/TrackingFeedback/TrackingFeedbackProcessor.cc b/src/TrackingFeedback/TrackingFeedbackProcessor.cc index bad603d..c2d1c0d 100644 --- a/src/TrackingFeedback/TrackingFeedbackProcessor.cc +++ b/src/TrackingFeedback/TrackingFeedbackProcessor.cc @@ -11,7 +11,7 @@ #include "MarlinCED.h" //----From DD4Hep----------------------------- -#include "DD4hep/LCDD.h" +#include "DD4hep/Detector.h" #include "DD4hep/DD4hepUnits.h" @@ -165,9 +165,9 @@ void TrackingFeedbackProcessor::init() { _nEvt = 0 ; - DD4hep::Geometry::LCDD& lcdd = DD4hep::Geometry::LCDD::getInstance(); + dd4hep::Detector& theDetector = dd4hep::Detector::getInstance(); double bfieldV[3] ; - lcdd.field().magneticField( { 0., 0., 0. } , bfieldV ) ; + theDetector.field().magneticField( { 0., 0., 0. } , bfieldV ) ; _Bz = bfieldV[2]/dd4hep::tesla ; //The B field in z direction if ( _drawMCPTracks ) MarlinCED::init(this) ;