Public Member Functions | |
MisalignedTrackerESProducer (const edm::ParameterSet &p) | |
Constructor. | |
boost::shared_ptr < TrackerGeometry > | produce (const TrackerDigiGeometryRecord &iRecord) |
Produce the misaligned tracker geometry and store it. | |
virtual | ~MisalignedTrackerESProducer () |
Destructor. | |
Private Attributes | |
const std::string | theAlignRecordName |
misalignment scenario | |
const std::string | theErrorRecordName |
const bool | theSaveToDB |
const edm::ParameterSet | theScenario |
whether or not writing to DB | |
boost::shared_ptr < TrackerGeometry > | theTracker |
An ESProducer that fills the TrackerDigiGeometryRcd with a misaligned tracker
This should replace the standard TrackerDigiGeometryESModule when producing Misalignment scenarios.
Definition at line 37 of file MisalignedTrackerESProducer.cc.
MisalignedTrackerESProducer::MisalignedTrackerESProducer | ( | const edm::ParameterSet & | p | ) |
Constructor.
Definition at line 67 of file MisalignedTrackerESProducer.cc.
References edm::ESProducer::setWhatProduced().
: theSaveToDB(p.getUntrackedParameter<bool>("saveToDbase")), theScenario(p.getParameter<edm::ParameterSet>("scenario")), theAlignRecordName("TrackerAlignmentRcd"), theErrorRecordName("TrackerAlignmentErrorRcd") { setWhatProduced(this); }
MisalignedTrackerESProducer::~MisalignedTrackerESProducer | ( | ) | [virtual] |
boost::shared_ptr< TrackerGeometry > MisalignedTrackerESProducer::produce | ( | const TrackerDigiGeometryRecord & | iRecord | ) |
Produce the misaligned tracker geometry and store it.
Definition at line 85 of file MisalignedTrackerESProducer.cc.
References GeometryAligner::applyAlignments(), TrackerScenarioBuilder::applyScenario(), TrackerGeomBuilderFromGeometricDet::build(), edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::getRecord(), edm::Service< T >::isAvailable(), theAlignRecordName, theErrorRecordName, theSaveToDB, theScenario, and theTracker.
{ edm::LogInfo("MisalignedTracker") << "Producer called"; // Create the tracker geometry from ideal geometry edm::ESHandle<GeometricDet> gD; iRecord.getRecord<IdealGeometryRecord>().get( gD ); TrackerGeomBuilderFromGeometricDet trackerBuilder; theTracker = boost::shared_ptr<TrackerGeometry>( trackerBuilder.build(&(*gD)) ); // Create the alignable hierarchy std::auto_ptr<AlignableTracker> theAlignableTracker(new AlignableTracker( &(*theTracker) ) ); // Create misalignment scenario, apply to geometry TrackerScenarioBuilder scenarioBuilder( &(*theAlignableTracker) ); scenarioBuilder.applyScenario( theScenario ); Alignments* alignments = theAlignableTracker->alignments(); AlignmentErrors* alignmentErrors = theAlignableTracker->alignmentErrors(); // Store result to EventSetup GeometryAligner aligner; aligner.applyAlignments<TrackerGeometry>( &(*theTracker), alignments, alignmentErrors, AlignTransform()); // dummy global position // Write alignments to DB: have to sort beforhand! if (theSaveToDB) { // Call service edm::Service<cond::service::PoolDBOutputService> poolDbService; if( !poolDbService.isAvailable() ) // Die if not available throw cms::Exception("NotAvailable") << "PoolDBOutputService not available"; poolDbService->writeOne<Alignments>(alignments, poolDbService->currentTime(), theAlignRecordName); poolDbService->writeOne<AlignmentErrors>(alignmentErrors, poolDbService->currentTime(), theErrorRecordName); } edm::LogInfo("MisalignedTracker") << "Producer done"; return theTracker; }
const std::string MisalignedTrackerESProducer::theAlignRecordName [private] |
misalignment scenario
Definition at line 54 of file MisalignedTrackerESProducer.cc.
Referenced by produce().
const std::string MisalignedTrackerESProducer::theErrorRecordName [private] |
Definition at line 54 of file MisalignedTrackerESProducer.cc.
Referenced by produce().
const bool MisalignedTrackerESProducer::theSaveToDB [private] |
Definition at line 51 of file MisalignedTrackerESProducer.cc.
Referenced by produce().
const edm::ParameterSet MisalignedTrackerESProducer::theScenario [private] |
whether or not writing to DB
Definition at line 52 of file MisalignedTrackerESProducer.cc.
Referenced by produce().
boost::shared_ptr<TrackerGeometry> MisalignedTrackerESProducer::theTracker [private] |
Definition at line 56 of file MisalignedTrackerESProducer.cc.
Referenced by produce().