CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_2_SLHC4_patch1/src/L1TriggerConfig/RCTConfigProducers/src/L1RCTChannelMaskTester.cc

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 //
00003 // Package:    RCTConfigTester
00004 // Class:      RCTConfigTester
00005 // 
00013 //
00014 // Original Author:  Sridhara Dasu
00015 //         Created:  Mon Jul 16 23:48:35 CEST 2007
00016 // $Id: L1RCTChannelMaskTester.cc,v 1.5 2010/06/16 19:27:54 ghete Exp $
00017 //
00018 //
00019 // user include files
00020 #include "FWCore/Framework/interface/EDAnalyzer.h"
00021 #include "FWCore/Framework/interface/Event.h"
00022 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00023 
00024 #include "FWCore/Framework/interface/EventSetup.h"
00025 #include "FWCore/Framework/interface/ESHandle.h"
00026 
00027 #include "CondFormats/DataRecord/interface/L1RCTChannelMaskRcd.h"
00028 #include "CondFormats/L1TObjects/interface/L1RCTChannelMask.h"
00029 #include "CondFormats/DataRecord/interface/L1RCTNoisyChannelMaskRcd.h"
00030 #include "CondFormats/L1TObjects/interface/L1RCTNoisyChannelMask.h"
00031 
00032 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00033 #include "FWCore/MessageLogger/interface/MessageDrop.h"
00034 
00035 #include "FWCore/PluginManager/interface/ModuleDef.h"
00036 #include "FWCore/Framework/interface/MakerMacros.h"
00037 
00038 //
00039 // class declaration
00040 //
00041 
00042 class L1RCTChannelMaskTester: public edm::EDAnalyzer {
00043 public:
00044     explicit L1RCTChannelMaskTester(const edm::ParameterSet&) {
00045     }
00046     virtual ~L1RCTChannelMaskTester() {
00047     }
00048     virtual void analyze(const edm::Event&, const edm::EventSetup&);
00049 
00050 };
00051 
00052 void L1RCTChannelMaskTester::analyze(const edm::Event& iEvent,
00053         const edm::EventSetup& evSetup) {
00054 
00055     //
00056     edm::ESHandle<L1RCTChannelMask> rctChanMask;
00057     evSetup.get<L1RCTChannelMaskRcd>().get(rctChanMask);
00058 
00059     rctChanMask->print(std::cout);
00060 
00061     //
00062     edm::eventsetup::EventSetupRecordKey recordKey(
00063             edm::eventsetup::EventSetupRecordKey::TypeTag::findType(
00064                     "L1RCTNoisyChannelMaskRcd"));
00065 
00066     if (evSetup.find(recordKey) == 0) {
00067         //record not found
00068         std::cout << "\nRecord \"" << "L1RCTNoisyChannelMaskRcd"
00069                 << "\" does not exist.\n" << std::endl;
00070     } else {
00071 
00072         edm::ESHandle<L1RCTNoisyChannelMask> rctNoisyChanMask;
00073         evSetup.get<L1RCTNoisyChannelMaskRcd>().get(rctNoisyChanMask);
00074 
00075         rctNoisyChanMask->print(std::cout);
00076 
00077     }
00078 
00079 }
00080 
00081 DEFINE_FWK_MODULE( L1RCTChannelMaskTester);
00082