Skip to content

Commit

Permalink
made CmsTrackerDetIdBuilder fully configurable and remove layerNumber…
Browse files Browse the repository at this point in the history
…BPX. Clean up of some customizations
  • Loading branch information
venturia committed Oct 31, 2014
1 parent 2dbb014 commit b899e0a
Show file tree
Hide file tree
Showing 12 changed files with 156 additions and 329 deletions.
384 changes: 73 additions & 311 deletions Geometry/TrackerNumberingBuilder/plugins/CmsTrackerDetIdBuilder.cc

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

# include "FWCore/ParameterSet/interface/types.h"
# include <ostream>
#include <vector>
#include <array>

class GeometricDet;

Expand All @@ -13,15 +15,19 @@ class GeometricDet;
class CmsTrackerDetIdBuilder
{
public:
CmsTrackerDetIdBuilder( unsigned int layerNumberPXB );
CmsTrackerDetIdBuilder(std::vector<int> detidShifts );
GeometricDet* buildId( GeometricDet *det );
protected:
void iterate( GeometricDet const *det, int level, unsigned int ID );

private:

static const unsigned int nSubDet=6;
static const int maxLevels=6;

// This is the map between detid and navtype to restore backward compatibility between 12* and 13* series
std::map< std::string , uint32_t > m_mapNavTypeToDetId;
unsigned int m_layerNumberPXB;
std::array<int,nSubDet*maxLevels> m_detidshifts;
};

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ DDDCmsTrackerContruction::DDDCmsTrackerContruction( void )
{}

const GeometricDet*
DDDCmsTrackerContruction::construct( const DDCompactView* cpv, unsigned int layerNumberPXB)
DDDCmsTrackerContruction::construct( const DDCompactView* cpv, std::vector<int> detidShifts)
{
attribute = "TkDDDStructure"; // could come from .orcarc
std::string value = "any";
Expand All @@ -36,7 +36,7 @@ DDDCmsTrackerContruction::construct( const DDCompactView* cpv, unsigned int laye
CmsTrackerBuilder theCmsTrackerBuilder;
theCmsTrackerBuilder.build( fv, tracker, attribute );

CmsTrackerDetIdBuilder theCmsTrackerDetIdBuilder( layerNumberPXB );
CmsTrackerDetIdBuilder theCmsTrackerDetIdBuilder( detidShifts );

tracker = theCmsTrackerDetIdBuilder.buildId( tracker );
fv.parent();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include "Geometry/TrackerNumberingBuilder/interface/CmsTrackerStringToEnum.h"
#include "FWCore/ParameterSet/interface/types.h"
#include <string>
#include <vector>

class GeometricDet;
class DDCompactView;
Expand All @@ -17,7 +18,7 @@ class DDDCmsTrackerContruction
{
public:
DDDCmsTrackerContruction( void );
const GeometricDet* construct( const DDCompactView* cpv, unsigned int layerNumberPXB);
const GeometricDet* construct( const DDCompactView* cpv, std::vector<int> detidShifts);

protected:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,30 @@ using namespace edm;

TrackerGeometricDetESModule::TrackerGeometricDetESModule( const edm::ParameterSet & p )
: fromDDD_( p.getParameter<bool>( "fromDDD" )),
layerNumberPXB_( p.exists( "layerNumberPXB" ) ? p.getParameter<unsigned int>( "layerNumberPXB" ) : 16U )// 16 for current, 18 for SLHC
detidShifts_( p.exists( "detidShifts" ) ? p.getParameter<std::vector<int> >( "detidShifts" ) : std::vector<int>() )
{
// if the vector of detid shifts in not configured, fill it with the default values
if(detidShifts_.size()==0) {
// level 0
detidShifts_.push_back(-1); detidShifts_.push_back(23); detidShifts_.push_back(-1);
detidShifts_.push_back(13); detidShifts_.push_back(-1); detidShifts_.push_back(18);
// level 1
detidShifts_.push_back(16); detidShifts_.push_back(16); detidShifts_.push_back(14);
detidShifts_.push_back(11); detidShifts_.push_back(14); detidShifts_.push_back(14);
// level 2
detidShifts_.push_back(8) ; detidShifts_.push_back(8) ; detidShifts_.push_back(4);
detidShifts_.push_back(9) ; detidShifts_.push_back(5) ; detidShifts_.push_back(8);
// level 3
detidShifts_.push_back(2) ; detidShifts_.push_back(2) ; detidShifts_.push_back(2);
detidShifts_.push_back(2) ; detidShifts_.push_back(2) ; detidShifts_.push_back(5);
// level 4
detidShifts_.push_back(0) ; detidShifts_.push_back(0) ; detidShifts_.push_back(0);
detidShifts_.push_back(0) ; detidShifts_.push_back(0) ; detidShifts_.push_back(2);
// level 5
detidShifts_.push_back(-1); detidShifts_.push_back(-1); detidShifts_.push_back(-1);
detidShifts_.push_back(-1); detidShifts_.push_back(-1); detidShifts_.push_back(0);
}

setWhatProduced( this );
}

Expand All @@ -34,24 +56,64 @@ TrackerGeometricDetESModule::~TrackerGeometricDetESModule( void ) {}
void
TrackerGeometricDetESModule::fillDescriptions( edm::ConfigurationDescriptions & descriptions )
{
std::vector<int> presentDet;
// level 0
presentDet.push_back(-1); presentDet.push_back(23); presentDet.push_back(-1);
presentDet.push_back(13); presentDet.push_back(-1); presentDet.push_back(18);
// level 1
presentDet.push_back(16); presentDet.push_back(16); presentDet.push_back(14);
presentDet.push_back(11); presentDet.push_back(14); presentDet.push_back(14);
// level 2
presentDet.push_back(8) ; presentDet.push_back(8) ; presentDet.push_back(4);
presentDet.push_back(9) ; presentDet.push_back(5) ; presentDet.push_back(8);
// level 3
presentDet.push_back(2) ; presentDet.push_back(2) ; presentDet.push_back(2);
presentDet.push_back(2) ; presentDet.push_back(2) ; presentDet.push_back(5);
// level 4
presentDet.push_back(0) ; presentDet.push_back(0) ; presentDet.push_back(0);
presentDet.push_back(0) ; presentDet.push_back(0) ; presentDet.push_back(2);
// level 5
presentDet.push_back(-1); presentDet.push_back(-1); presentDet.push_back(-1);
presentDet.push_back(-1); presentDet.push_back(-1); presentDet.push_back(0);

std::vector<int> slhcDet;
// level 0
slhcDet.push_back(-1); slhcDet.push_back(23); slhcDet.push_back(-1);
slhcDet.push_back(13); slhcDet.push_back(-1); slhcDet.push_back(18);
// level 1
slhcDet.push_back(20); slhcDet.push_back(18); slhcDet.push_back(14);
slhcDet.push_back(11); slhcDet.push_back(14); slhcDet.push_back(14);
// level 2
slhcDet.push_back(12); slhcDet.push_back(10); slhcDet.push_back(4);
slhcDet.push_back(9) ; slhcDet.push_back(5) ; slhcDet.push_back(8);
// level 3
slhcDet.push_back(2) ; slhcDet.push_back(2) ; slhcDet.push_back(2);
slhcDet.push_back(2) ; slhcDet.push_back(2) ; slhcDet.push_back(5);
// level 4
slhcDet.push_back(0) ; slhcDet.push_back(0) ; slhcDet.push_back(0);
slhcDet.push_back(0) ; slhcDet.push_back(0) ; slhcDet.push_back(2);
// level 5
slhcDet.push_back(-1); slhcDet.push_back(-1); slhcDet.push_back(-1);
slhcDet.push_back(-1); slhcDet.push_back(-1); slhcDet.push_back(0);

edm::ParameterSetDescription descDB;
descDB.add<bool>( "fromDDD", false );
descDB.addOptional<unsigned int>( "layerNumberPXB", 16U );
descDB.addOptional<std::vector<int> >( "detidShifts", presentDet );
descriptions.add( "trackerNumberingGeometryDB", descDB );

edm::ParameterSetDescription descSLHCDB;
descSLHCDB.add<bool>( "fromDDD", false );
descSLHCDB.addOptional<unsigned int>( "layerNumberPXB", 18U );
descSLHCDB.addOptional<std::vector<int> >( "detidShifts", slhcDet );
descriptions.add( "trackerNumberingSLHCGeometryDB", descSLHCDB );

edm::ParameterSetDescription desc;
desc.add<bool>( "fromDDD", true );
desc.addOptional<unsigned int>( "layerNumberPXB", 16U );
desc.addOptional<std::vector<int> >( "detidShifts", presentDet );
descriptions.add( "trackerNumberingGeometry", desc );

edm::ParameterSetDescription descSLHC;
descSLHC.add<bool>( "fromDDD", true );
descSLHC.addOptional<unsigned int>( "layerNumberPXB", 18U );
descSLHC.addOptional<std::vector<int> >( "detidShifts", slhcDet );
descriptions.add( "trackerNumberingSLHCGeometry", descSLHC );
}

Expand All @@ -64,7 +126,7 @@ TrackerGeometricDetESModule::produce( const IdealGeometryRecord & iRecord )
iRecord.get( cpv );

DDDCmsTrackerContruction theDDDCmsTrackerContruction;
return std::auto_ptr<GeometricDet> (const_cast<GeometricDet*>( theDDDCmsTrackerContruction.construct(&(*cpv), layerNumberPXB_)));
return std::auto_ptr<GeometricDet> (const_cast<GeometricDet*>( theDDDCmsTrackerContruction.construct(&(*cpv), detidShifts_)));
}
else
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
#include "Geometry/TrackerNumberingBuilder/interface/GeometricDet.h"
#include "Geometry/TrackerNumberingBuilder/interface/GeometricDetExtra.h"

#include <vector>

namespace edm {
class ConfigurationDescriptions;
}
Expand All @@ -22,7 +24,7 @@ class TrackerGeometricDetESModule: public edm::ESProducer

private:
bool fromDDD_;
unsigned int layerNumberPXB_; // default 16; 18 for SLHC
std::vector<int> detidShifts_; // default 16; 18 for SLHC
};


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ def customiseDefault(process):
process.validation_step.remove(process.HLTSusyExoValFastSim)
process.validation_step.remove(process.hltHiggsValidator)

process.trackerNumberingSLHCGeometry.layerNumberPXB = cms.uint32(20)
process.trackerTopologyConstants.pxb_layerStartBit = cms.uint32(20)
process.trackerTopologyConstants.pxb_ladderStartBit = cms.uint32(12)
process.trackerTopologyConstants.pxb_moduleStartBit = cms.uint32(2)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,6 @@ def customise_Reco(process,pileup):

def customise_condOverRides(process):
process.load('SLHCUpgradeSimulations.Geometry.fakeConditions_BarrelEndcap_cff')
process.trackerNumberingSLHCGeometry.layerNumberPXB = cms.uint32(20)
process.trackerTopologyConstants.pxb_layerStartBit = cms.uint32(20)
process.trackerTopologyConstants.pxb_ladderStartBit = cms.uint32(12)
process.trackerTopologyConstants.pxb_moduleStartBit = cms.uint32(2)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,6 @@ def customise_Reco(process,pileup):

def customise_condOverRides(process):
process.load('SLHCUpgradeSimulations.Geometry.fakeConditions_BarrelEndcap5D_cff')
process.trackerNumberingSLHCGeometry.layerNumberPXB = cms.uint32(20)
process.trackerTopologyConstants.pxb_layerStartBit = cms.uint32(20)
process.trackerTopologyConstants.pxb_ladderStartBit = cms.uint32(12)
process.trackerTopologyConstants.pxb_moduleStartBit = cms.uint32(2)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,6 @@ def customise_Reco(process,pileup):

def customise_condOverRides(process):
process.load('SLHCUpgradeSimulations.Geometry.fakeConditions_BarrelEndcap5DPixel10D_cff')
process.trackerNumberingSLHCGeometry.layerNumberPXB = cms.uint32(20)
process.trackerTopologyConstants.pxb_layerStartBit = cms.uint32(20)
process.trackerTopologyConstants.pxb_ladderStartBit = cms.uint32(12)
process.trackerTopologyConstants.pxb_moduleStartBit = cms.uint32(2)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,6 @@ def customise_Reco(process):

def customise_condOverRides(process):
process.load('SLHCUpgradeSimulations.Geometry.fakeConditions_LongBarrel4LPS_2L2S_cff')
process.trackerNumberingSLHCGeometry.layerNumberPXB = cms.uint32(20)
process.trackerTopologyConstants.pxb_layerStartBit = cms.uint32(20)
process.trackerTopologyConstants.pxb_ladderStartBit = cms.uint32(12)
process.trackerTopologyConstants.pxb_moduleStartBit = cms.uint32(2)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,6 @@ def customise_Reco(process):

def customise_condOverRides(process):
process.load('SLHCUpgradeSimulations.Geometry.fakeConditions_LongBarrel6PS_cff')
process.trackerNumberingSLHCGeometry.layerNumberPXB = cms.uint32(20)
process.trackerTopologyConstants.pxb_layerStartBit = cms.uint32(20)
process.trackerTopologyConstants.pxb_ladderStartBit = cms.uint32(12)
process.trackerTopologyConstants.pxb_moduleStartBit = cms.uint32(2)
Expand Down

0 comments on commit b899e0a

Please sign in to comment.