Skip to content

Commit

Permalink
Adapt to changes in namespaces and LCDD --> Detector
Browse files Browse the repository at this point in the history
  • Loading branch information
andresailer authored and gaede committed Jun 20, 2017
1 parent 1612c70 commit 7d3f468
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 21 deletions.
10 changes: 5 additions & 5 deletions src/Analysis/TrueTrackCritAnalyser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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::DDRec::ZDiskPetalsData>() ;
dd4hep::Detector& theDetector = dd4hep::Detector::getInstance();
dd4hep::DetElement ftdDE = theDetector.detector("FTD") ;
dd4hep::rec::ZDiskPetalsData* ftd = ftdDE.extension<dd4hep::rec::ZDiskPetalsData>() ;

int nLayers = ftd->layers.size() + 1; // we add one layer for the IP

Expand All @@ -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() ; i<n; ++i){

const DD4hep::DDRec::ZDiskPetalsData::LayerLayout& l = ftd->layers[i] ;
const dd4hep::rec::ZDiskPetalsData::LayerLayout& l = ftd->layers[i] ;

if( l.petalNumber > nModules ) nModules = l.petalNumber ;
if( l.sensorsPerPetal > nSensors ) nSensors = l.sensorsPerPetal ;
Expand Down
8 changes: 4 additions & 4 deletions src/FTDNoise/FTDBackgroundProcessor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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<DD4hep::DDRec::ZDiskPetalsData>() ;
int nLayers = ftd->layers.size() ;

Expand All @@ -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" ) ;


Expand Down
10 changes: 5 additions & 5 deletions src/ForwardTracking/ForwardTracking.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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::DDRec::ZDiskPetalsData>() ;
dd4hep::Detector& lcdd = dd4hep::Detector::getInstance();
dd4hep::DetElement ftdDE = lcdd.detector("FTD") ;
dd4hep::rec::ZDiskPetalsData* ftd = ftdDE.extension<dd4hep::rec::ZDiskPetalsData>() ;

int nLayers = ftd->layers.size() + 1; // we add one layer for the IP

Expand All @@ -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() ; i<n; ++i){

const DD4hep::DDRec::ZDiskPetalsData::LayerLayout& l = ftd->layers[i] ;
const dd4hep::rec::ZDiskPetalsData::LayerLayout& l = ftd->layers[i] ;

if( l.petalNumber > nModules ) nModules = l.petalNumber ;
if( l.sensorsPerPetal > nSensors ) nSensors = l.sensorsPerPetal ;
Expand Down
8 changes: 4 additions & 4 deletions src/ForwardTracking/SiliconEndcapTracking.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#include "MarlinCED.h"

//----From DD4Hep-----------------------------
#include "DD4hep/LCDD.h"
#include "DD4hep/Detector.h"
#include "DD4hep/DD4hepUnits.h"


Expand Down Expand Up @@ -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";
Expand Down Expand Up @@ -1521,7 +1521,7 @@ void SiliconEndcapTracking::getCellID0AndPositionInfo(LCCollection*& col ){
for (int i=0; i<col->getNumberOfElements(); i++){
TrackerHitPlane* trackerHit = dynamic_cast<TrackerHitPlane*>( col->getElementAt(i) ) ;

DD4hep::long64 id = trackerHit->getCellID0() ;
dd4hep::long64 id = trackerHit->getCellID0();
cellid_decoder.setValue( id ) ;

int layer = cellid_decoder["layer"].value();
Expand Down
6 changes: 3 additions & 3 deletions src/TrackingFeedback/TrackingFeedbackProcessor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include "MarlinCED.h"

//----From DD4Hep-----------------------------
#include "DD4hep/LCDD.h"
#include "DD4hep/Detector.h"
#include "DD4hep/DD4hepUnits.h"


Expand Down Expand Up @@ -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) ;
Expand Down

0 comments on commit 7d3f468

Please sign in to comment.