CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch9/src/Alignment/CommonAlignmentProducer/plugins/FakeAlignmentProducer.cc

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 //
00003 // Package:    FakeAlignmentProducer
00004 // Class:      FakeAlignmentProducer
00005 // 
00015 //
00016 // Original Author:  Frederic Ronga
00017 //         Created:  Fri Feb  9 19:24:38 CET 2007
00018 // $Id: FakeAlignmentProducer.cc,v 1.7 2008/06/26 17:52:29 flucke Exp $
00019 //
00020 //
00021 
00022 
00023 // System
00024 #include <memory>
00025 
00026 // Framework
00027 #include "FWCore/Framework/interface/ModuleFactory.h"
00028 #include "FWCore/Framework/interface/ESProducer.h"
00029 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00030 
00031 
00032 
00033 // Alignment
00034 #include "CondFormats/Alignment/interface/Alignments.h"
00035 #include "CondFormats/Alignment/interface/AlignmentErrors.h"
00036 #include "CondFormats/AlignmentRecord/interface/TrackerAlignmentRcd.h"
00037 #include "CondFormats/AlignmentRecord/interface/DTAlignmentRcd.h"
00038 #include "CondFormats/AlignmentRecord/interface/CSCAlignmentRcd.h"
00039 #include "CondFormats/AlignmentRecord/interface/TrackerAlignmentErrorRcd.h"
00040 #include "CondFormats/AlignmentRecord/interface/DTAlignmentErrorRcd.h"
00041 #include "CondFormats/AlignmentRecord/interface/CSCAlignmentErrorRcd.h"
00042 #include "CondFormats/AlignmentRecord/interface/GlobalPositionRcd.h"
00043 
00044 class FakeAlignmentProducer : public edm::ESProducer {
00045 public:
00046   FakeAlignmentProducer(const edm::ParameterSet&);
00047   ~FakeAlignmentProducer() {}
00048 
00049   std::auto_ptr<Alignments>
00050   produceTkAli(const TrackerAlignmentRcd&) { return std::auto_ptr<Alignments>(new Alignments);}
00051   std::auto_ptr<Alignments> 
00052   produceDTAli(const DTAlignmentRcd&) { return std::auto_ptr<Alignments>(new Alignments);}
00053   std::auto_ptr<Alignments>
00054   produceCSCAli(const CSCAlignmentRcd&)  { return std::auto_ptr<Alignments>(new Alignments);}
00055   std::auto_ptr<Alignments>
00056   produceGlobals(const GlobalPositionRcd&) {return std::auto_ptr<Alignments>(new Alignments);}
00057 
00058   std::auto_ptr<AlignmentErrors> produceTkAliErr(const TrackerAlignmentErrorRcd&) {
00059     return std::auto_ptr<AlignmentErrors>(new AlignmentErrors);
00060   }
00061   std::auto_ptr<AlignmentErrors> produceDTAliErr(const DTAlignmentErrorRcd&) {
00062     return std::auto_ptr<AlignmentErrors>(new AlignmentErrors);
00063   }
00064   std::auto_ptr<AlignmentErrors> produceCSCAliErr(const CSCAlignmentErrorRcd&) {
00065     return std::auto_ptr<AlignmentErrors>(new AlignmentErrors);
00066   }
00067 
00068 };
00069 
00070 FakeAlignmentProducer::FakeAlignmentProducer(const edm::ParameterSet& iConfig) 
00071 {
00072   // This 'appendToDataLabel' is used by the framework to distinguish providers
00073   // with different settings and to request a special one by e.g.
00074   // iSetup.get<TrackerDigiGeometryRecord>().get("theLabel", tkGeomHandle);
00075   edm::LogInfo("Alignments") 
00076     << "@SUB=FakeAlignmentProducer" << "Providing data with label '" 
00077     << iConfig.getParameter<std::string>("appendToDataLabel") << "'.";
00078 
00079   setWhatProduced( this, &FakeAlignmentProducer::produceTkAli );
00080   setWhatProduced( this, &FakeAlignmentProducer::produceTkAliErr );
00081   setWhatProduced( this, &FakeAlignmentProducer::produceDTAli );
00082   setWhatProduced( this, &FakeAlignmentProducer::produceDTAliErr );
00083   setWhatProduced( this, &FakeAlignmentProducer::produceCSCAli );
00084   setWhatProduced( this, &FakeAlignmentProducer::produceCSCAliErr );
00085   setWhatProduced( this, &FakeAlignmentProducer::produceGlobals );
00086 
00087 }
00088 
00089 
00090 //define this as a plug-in
00091 DEFINE_FWK_EVENTSETUP_MODULE(FakeAlignmentProducer);