Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 11:56:14

0001 // -*- C++ -*-
0002 //
0003 // Package:    FakeAlignmentProducer
0004 // Class:      FakeAlignmentProducer
0005 //
0006 /**\class FakeAlignmentProducer FakeAlignmentProducer.h Alignment/FakeAlignmentProducer/interface/FakeAlignmentProducer.h
0007 
0008 Description: Producer of fake alignment data for all geometries (currently: Tracker, DT and CSC)
0009              (but will not provide IOV as the FakeAlignmentSource)
0010 
0011 Implementation: 
0012 The alignment objects are filled with dummy/empty data, 
0013 reconstruction Geometry should notice that and not pass to GeometryAligner.
0014 */
0015 //
0016 // Original Author:  Frederic Ronga
0017 //         Created:  Fri Feb  9 19:24:38 CET 2007
0018 // $Id: FakeAlignmentProducer.cc,v 1.6 2008/06/26 10:00:35 flucke Exp $
0019 //
0020 //
0021 
0022 // System
0023 #include <memory>
0024 
0025 // Framework
0026 #include "FWCore/Framework/interface/ModuleFactory.h"
0027 #include "FWCore/Framework/interface/ESProducer.h"
0028 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0029 
0030 // Alignment
0031 #include "CondFormats/Alignment/interface/Alignments.h"
0032 #include "CondFormats/Alignment/interface/AlignmentErrorsExtended.h"
0033 #include "CondFormats/AlignmentRecord/interface/TrackerAlignmentRcd.h"
0034 #include "CondFormats/AlignmentRecord/interface/DTAlignmentRcd.h"
0035 #include "CondFormats/AlignmentRecord/interface/CSCAlignmentRcd.h"
0036 #include "CondFormats/AlignmentRecord/interface/TrackerAlignmentErrorExtendedRcd.h"
0037 #include "CondFormats/AlignmentRecord/interface/DTAlignmentErrorExtendedRcd.h"
0038 #include "CondFormats/AlignmentRecord/interface/CSCAlignmentErrorExtendedRcd.h"
0039 #include "CondFormats/AlignmentRecord/interface/GlobalPositionRcd.h"
0040 
0041 class FakeAlignmentProducer : public edm::ESProducer {
0042 public:
0043   FakeAlignmentProducer(const edm::ParameterSet&);
0044   ~FakeAlignmentProducer() override {}
0045 
0046   std::unique_ptr<Alignments> produceTkAli(const TrackerAlignmentRcd&) { return std::make_unique<Alignments>(); }
0047   std::unique_ptr<Alignments> produceDTAli(const DTAlignmentRcd&) { return std::make_unique<Alignments>(); }
0048   std::unique_ptr<Alignments> produceCSCAli(const CSCAlignmentRcd&) { return std::make_unique<Alignments>(); }
0049   std::unique_ptr<Alignments> produceGlobals(const GlobalPositionRcd&) { return std::make_unique<Alignments>(); }
0050 
0051   std::unique_ptr<AlignmentErrorsExtended> produceTkAliErr(const TrackerAlignmentErrorExtendedRcd&) {
0052     return std::make_unique<AlignmentErrorsExtended>();
0053   }
0054   std::unique_ptr<AlignmentErrorsExtended> produceDTAliErr(const DTAlignmentErrorExtendedRcd&) {
0055     return std::make_unique<AlignmentErrorsExtended>();
0056   }
0057   std::unique_ptr<AlignmentErrorsExtended> produceCSCAliErr(const CSCAlignmentErrorExtendedRcd&) {
0058     return std::make_unique<AlignmentErrorsExtended>();
0059   }
0060 };
0061 
0062 FakeAlignmentProducer::FakeAlignmentProducer(const edm::ParameterSet& iConfig) {
0063   // This 'appendToDataLabel' is used by the framework to distinguish providers
0064   // with different settings and to request a special one by e.g.
0065   // iSetup.get<TrackerDigiGeometryRecord>().get("theLabel", tkGeomHandle);
0066   edm::LogInfo("Alignments") << "@SUB=FakeAlignmentProducer"
0067                              << "Providing data with label '" << iConfig.getParameter<std::string>("appendToDataLabel")
0068                              << "'.";
0069 
0070   setWhatProduced(this, &FakeAlignmentProducer::produceTkAli);
0071   setWhatProduced(this, &FakeAlignmentProducer::produceTkAliErr);
0072   setWhatProduced(this, &FakeAlignmentProducer::produceDTAli);
0073   setWhatProduced(this, &FakeAlignmentProducer::produceDTAliErr);
0074   setWhatProduced(this, &FakeAlignmentProducer::produceCSCAli);
0075   setWhatProduced(this, &FakeAlignmentProducer::produceCSCAliErr);
0076   setWhatProduced(this, &FakeAlignmentProducer::produceGlobals);
0077 }
0078 
0079 //define this as a plug-in
0080 DEFINE_FWK_EVENTSETUP_MODULE(FakeAlignmentProducer);