#include <TrackerDigiGeometryESModule.h>
Public Member Functions | |
boost::shared_ptr < TrackerGeometry > | produce (const TrackerDigiGeometryRecord &) |
TrackerDigiGeometryESModule (const edm::ParameterSet &p) | |
virtual | ~TrackerDigiGeometryESModule () |
Static Public Member Functions | |
static void | fillDescriptions (edm::ConfigurationDescriptions &descriptions) |
Private Attributes | |
boost::shared_ptr < TrackerGeometry > | _tracker |
Called when geometry description changes. | |
const std::string | alignmentsLabel_ |
bool | applyAlignment_ |
bool | fromDDD_ |
const edm::ParameterSet | m_pSet |
const std::string | myLabel_ |
Definition at line 16 of file TrackerDigiGeometryESModule.h.
TrackerDigiGeometryESModule::TrackerDigiGeometryESModule | ( | const edm::ParameterSet & | p | ) |
Definition at line 29 of file TrackerDigiGeometryESModule.cc.
References alignmentsLabel_, applyAlignment_, fromDDD_, edm::ParameterSet::getParameter(), myLabel_, and edm::ESProducer::setWhatProduced().
: alignmentsLabel_(p.getParameter<std::string>("alignmentsLabel")), myLabel_(p.getParameter<std::string>("appendToDataLabel")), m_pSet( p ) { applyAlignment_ = p.getParameter<bool>("applyAlignment"); fromDDD_ = p.getParameter<bool>("fromDDD"); setWhatProduced(this); edm::LogInfo("Geometry") << "@SUB=TrackerDigiGeometryESModule" << "Label '" << myLabel_ << "' " << (applyAlignment_ ? "looking for" : "IGNORING") << " alignment labels '" << alignmentsLabel_ << "'."; }
TrackerDigiGeometryESModule::~TrackerDigiGeometryESModule | ( | ) | [virtual] |
Definition at line 46 of file TrackerDigiGeometryESModule.cc.
{}
void TrackerDigiGeometryESModule::fillDescriptions | ( | edm::ConfigurationDescriptions & | descriptions | ) | [static] |
Definition at line 49 of file TrackerDigiGeometryESModule.cc.
References edm::ParameterSetDescription::add(), edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::addOptional(), funct::false, AlCaHLTBitMon_QueryRunRegistry::string, and funct::true.
{ edm::ParameterSetDescription descTrackerGeometryConstants; descTrackerGeometryConstants.add<bool>( "upgradeGeometry", false ); descTrackerGeometryConstants.add<int>( "ROWS_PER_ROC", 80 ); descTrackerGeometryConstants.add<int>( "COLS_PER_ROC", 52 ); descTrackerGeometryConstants.add<int>( "BIG_PIX_PER_ROC_X", 1 ); descTrackerGeometryConstants.add<int>( "BIG_PIX_PER_ROC_Y", 2 ); descTrackerGeometryConstants.add<int>( "ROCS_X", 0 ); descTrackerGeometryConstants.add<int>( "ROCS_Y", 0 ); edm::ParameterSetDescription descTrackerSLHCGeometryConstants; descTrackerSLHCGeometryConstants.add<bool>( "upgradeGeometry", true ); descTrackerSLHCGeometryConstants.add<int>( "ROWS_PER_ROC", 80 ); descTrackerSLHCGeometryConstants.add<int>( "COLS_PER_ROC", 52 ); descTrackerSLHCGeometryConstants.add<int>( "BIG_PIX_PER_ROC_X", 0 ); descTrackerSLHCGeometryConstants.add<int>( "BIG_PIX_PER_ROC_Y", 0 ); descTrackerSLHCGeometryConstants.add<int>( "ROCS_X", 2 ); descTrackerSLHCGeometryConstants.add<int>( "ROCS_Y", 8 ); edm::ParameterSetDescription descDB; descDB.add<std::string>( "appendToDataLabel", "" ); descDB.add<bool>( "fromDDD", false ); descDB.add<bool>( "applyAlignment", true ); descDB.add<std::string>( "alignmentsLabel", "" ); descDB.addOptional<edm::ParameterSetDescription>( "trackerGeometryConstants", descTrackerGeometryConstants ); descriptions.add( "trackerGeometryDB", descDB ); edm::ParameterSetDescription desc; desc.add<std::string>( "appendToDataLabel", "" ); desc.add<bool>( "fromDDD", true ); desc.add<bool>( "applyAlignment", true ); desc.add<std::string>( "alignmentsLabel", "" ); desc.addOptional<edm::ParameterSetDescription>( "trackerGeometryConstants", descTrackerGeometryConstants ); descriptions.add( "trackerGeometry", desc ); edm::ParameterSetDescription descSLHCDB; descSLHCDB.add<std::string>( "appendToDataLabel", "" ); descSLHCDB.add<bool>( "fromDDD", false ); descSLHCDB.add<bool>( "applyAlignment", true ); descSLHCDB.add<std::string>( "alignmentsLabel", "" ); descSLHCDB.addOptional<edm::ParameterSetDescription>( "trackerGeometryConstants", descTrackerSLHCGeometryConstants ); descriptions.add( "trackerSLHCGeometryDB", descSLHCDB ); edm::ParameterSetDescription descSLHC; descSLHC.add<std::string>( "appendToDataLabel", "" ); descSLHC.add<bool>( "fromDDD", true ); descSLHC.add<bool>( "applyAlignment", true ); descSLHC.add<std::string>( "alignmentsLabel", "" ); descSLHC.addOptional<edm::ParameterSetDescription>( "trackerGeometryConstants", descTrackerSLHCGeometryConstants ); descriptions.add( "trackerSLHCGeometry", descSLHC ); }
boost::shared_ptr< TrackerGeometry > TrackerDigiGeometryESModule::produce | ( | const TrackerDigiGeometryRecord & | iRecord | ) |
Definition at line 104 of file TrackerDigiGeometryESModule.cc.
References _tracker, alignmentsLabel_, applyAlignment_, GeometryAligner::applyAlignments(), GeometryAligner::attachSurfaceDeformations(), TrackerGeomBuilderFromGeometricDet::build(), align::DetectorGlobalPosition(), edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::getRecord(), m_pSet, myLabel_, and DetId::Tracker.
{ // // Called whenever the alignments, alignment errors or global positions change // edm::ESHandle<GeometricDet> gD; iRecord.getRecord<IdealGeometryRecord>().get( gD ); TrackerGeomBuilderFromGeometricDet builder; _tracker = boost::shared_ptr<TrackerGeometry>(builder.build(&(*gD), m_pSet )); if (applyAlignment_) { // Since fake is fully working when checking for 'empty', we should get rid of applyAlignment_! edm::ESHandle<Alignments> globalPosition; iRecord.getRecord<GlobalPositionRcd>().get(alignmentsLabel_, globalPosition); edm::ESHandle<Alignments> alignments; iRecord.getRecord<TrackerAlignmentRcd>().get(alignmentsLabel_, alignments); edm::ESHandle<AlignmentErrors> alignmentErrors; iRecord.getRecord<TrackerAlignmentErrorRcd>().get(alignmentsLabel_, alignmentErrors); // apply if not empty: if (alignments->empty() && alignmentErrors->empty() && globalPosition->empty()) { edm::LogInfo("Config") << "@SUB=TrackerDigiGeometryRecord::produce" << "Alignment(Error)s and global position (label '" << alignmentsLabel_ << "') empty: Geometry producer (label " << "'" << myLabel_ << "') assumes fake and does not apply."; } else { GeometryAligner ali; ali.applyAlignments<TrackerGeometry>(&(*_tracker), &(*alignments), &(*alignmentErrors), align::DetectorGlobalPosition(*globalPosition, DetId(DetId::Tracker))); } edm::ESHandle<AlignmentSurfaceDeformations> surfaceDeformations; iRecord.getRecord<TrackerSurfaceDeformationRcd>().get(alignmentsLabel_, surfaceDeformations); // apply if not empty: if (surfaceDeformations->empty()) { edm::LogInfo("Config") << "@SUB=TrackerDigiGeometryRecord::produce" << "AlignmentSurfaceDeformations (label '" << alignmentsLabel_ << "') empty: Geometry producer (label " << "'" << myLabel_ << "') assumes fake and does not apply."; } else { GeometryAligner ali; ali.attachSurfaceDeformations<TrackerGeometry>(&(*_tracker), &(*surfaceDeformations)); } } return _tracker; }
boost::shared_ptr<TrackerGeometry> TrackerDigiGeometryESModule::_tracker [private] |
Called when geometry description changes.
Definition at line 26 of file TrackerDigiGeometryESModule.h.
Referenced by produce().
const std::string TrackerDigiGeometryESModule::alignmentsLabel_ [private] |
Definition at line 27 of file TrackerDigiGeometryESModule.h.
Referenced by produce(), and TrackerDigiGeometryESModule().
bool TrackerDigiGeometryESModule::applyAlignment_ [private] |
Definition at line 30 of file TrackerDigiGeometryESModule.h.
Referenced by produce(), and TrackerDigiGeometryESModule().
bool TrackerDigiGeometryESModule::fromDDD_ [private] |
Definition at line 31 of file TrackerDigiGeometryESModule.h.
Referenced by TrackerDigiGeometryESModule().
const edm::ParameterSet TrackerDigiGeometryESModule::m_pSet [private] |
Definition at line 29 of file TrackerDigiGeometryESModule.h.
Referenced by produce().
const std::string TrackerDigiGeometryESModule::myLabel_ [private] |
Definition at line 28 of file TrackerDigiGeometryESModule.h.
Referenced by produce(), and TrackerDigiGeometryESModule().