CMS 3D CMS Logo

Public Member Functions

edmtest::RunSummaryESAnalyzer Class Reference

Inheritance diagram for edmtest::RunSummaryESAnalyzer:
edm::EDAnalyzer edm::EDConsumerBase

List of all members.

Public Member Functions

virtual void analyze (const edm::Event &e, const edm::EventSetup &c)
 RunSummaryESAnalyzer (int i)
 RunSummaryESAnalyzer (edm::ParameterSet const &p)
virtual ~RunSummaryESAnalyzer ()

Detailed Description

Definition at line 24 of file RunSummaryESAnalyzer.cc.


Constructor & Destructor Documentation

edmtest::RunSummaryESAnalyzer::RunSummaryESAnalyzer ( edm::ParameterSet const &  p) [inline, explicit]

Definition at line 27 of file RunSummaryESAnalyzer.cc.

References gather_cfg::cout.

    { 
      std::cout<<"RunSummaryESAnalyzer"<<std::endl;
    }
edmtest::RunSummaryESAnalyzer::RunSummaryESAnalyzer ( int  i) [inline, explicit]

Definition at line 31 of file RunSummaryESAnalyzer.cc.

References gather_cfg::cout.

    { std::cout<<"RunSummaryESAnalyzer "<<i<<std::endl; }
virtual edmtest::RunSummaryESAnalyzer::~RunSummaryESAnalyzer ( ) [inline, virtual]

Definition at line 33 of file RunSummaryESAnalyzer.cc.

References gather_cfg::cout.

                                    {  
      std::cout<<"~RunSummaryESAnalyzer "<<std::endl;
    }

Member Function Documentation

void edmtest::RunSummaryESAnalyzer::analyze ( const edm::Event e,
const edm::EventSetup c 
) [virtual]

Implements edm::EDAnalyzer.

Definition at line 60 of file RunSummaryESAnalyzer.cc.

References gather_cfg::cout, edm::EventID::event(), edm::eventsetup::heterocontainer::HCTypeTag::findType(), edm::EventSetup::get(), i, edm::EventBase::id(), edm::EventID::run(), edmLumisInFiles::summary, and edm::eventsetup::EventSetupRecordKey::type().

                                                                               {
    using namespace edm::eventsetup;
    std::cout<<"###RunSummaryESAnalyzer::analyze"<<std::endl;
     
    // Context is not used.
    std::cout <<" I AM IN RUN NUMBER "<<e.id().run() <<std::endl;
    std::cout <<" ---EVENT NUMBER "<<e.id().event() <<std::endl;
    edm::eventsetup::EventSetupRecordKey recordKey(edm::eventsetup::EventSetupRecordKey::TypeTag::findType("RunSummaryRcd"));
    if( recordKey.type() == edm::eventsetup::EventSetupRecordKey::TypeTag()) {
      //record not found
      std::cout <<"Record \"RunSummaryRcd"<<"\" does not exist "<<std::endl;
    }
    edm::ESHandle<RunSummary> sum;
    std::cout<<"got eshandle"<<std::endl;
    context.get<RunSummaryRcd>().get(sum);
    std::cout<<"got context"<<std::endl;
    const RunSummary* summary=sum.product();
    std::cout<<"got RunSummary* "<< std::endl;

  
    std::cout<< "print  result" << std::endl;
    summary->printAllValues();
    std::vector<std::string> subdet = summary->getSubdtIn();
    std::cout<<"subdetector in the run "<< std::endl;
    for (size_t i=0; i<subdet.size(); i++){
        std::cout<<"--> " << subdet[i] << std::endl;
    }
  }