CMS 3D CMS Logo

Public Member Functions | Private Attributes

GlobalHitsTester Class Reference

#include <GlobalHitsTester.h>

Inheritance diagram for GlobalHitsTester:
edm::EDAnalyzer

List of all members.

Public Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
virtual void beginJob (void)
virtual void beginRun (const edm::Run &, const edm::EventSetup &)
virtual void endJob ()
virtual void endRun (const edm::Run &, const edm::EventSetup &)
 GlobalHitsTester (const edm::ParameterSet &)
virtual ~GlobalHitsTester ()

Private Attributes

unsigned int count
DQMStoredbe
bool doOutput
std::string fName
int frequency
bool getAllProvenances
std::string label
MonitorElementmeTestFloat
MonitorElementmeTestInt
MonitorElementmeTestProfile1
MonitorElementmeTestProfile2
MonitorElementmeTestString
MonitorElementmeTestTH1F
MonitorElementmeTestTH2F
MonitorElementmeTestTH3F
std::string outputfile
bool printProvenanceInfo
TRandom * Random
double RandomVal1
double RandomVal2
double RandomVal3
int verbosity
int vtxunit

Detailed Description

Definition at line 78 of file GlobalHitsTester.h.


Constructor & Destructor Documentation

GlobalHitsTester::GlobalHitsTester ( const edm::ParameterSet iPSet) [explicit]

Definition at line 4 of file GlobalHitsTester.cc.

References DQMStore::book1D(), DQMStore::book2D(), DQMStore::book3D(), DQMStore::bookFloat(), DQMStore::bookInt(), DQMStore::bookProfile(), DQMStore::bookProfile2D(), DQMStore::bookString(), dbe, doOutput, fName, frequency, getAllProvenances, MonitorElement::getFullname(), edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), meTestFloat, meTestInt, meTestProfile1, meTestProfile2, meTestString, meTestTH1F, meTestTH2F, meTestTH3F, cmsCodeRules::cppFunctionSkipper::operator, outputfile, printProvenanceInfo, DQMStore::setCurrentFolder(), DQMStore::tag(), verbosity, and vtxunit.

                                                               :
  fName(""), verbosity(0), frequency(0), vtxunit(0), label(""), 
  getAllProvenances(false), printProvenanceInfo(false), count(0)
{
  std::string MsgLoggerCat = "GlobalHitsTester_GlobalHitsTester";

  fName = iPSet.getUntrackedParameter<std::string>("Name");
  verbosity = iPSet.getUntrackedParameter<int>("Verbosity");
  frequency = iPSet.getUntrackedParameter<int>("Frequency");
  vtxunit = iPSet.getUntrackedParameter<int>("VtxUnit");
  outputfile = iPSet.getParameter<std::string>("OutputFile");
  doOutput = iPSet.getParameter<bool>("DoOutput");
  edm::ParameterSet m_Prov =
    iPSet.getParameter<edm::ParameterSet>("ProvenanceLookup");
  getAllProvenances = 
    m_Prov.getUntrackedParameter<bool>("GetAllProvenances");
  printProvenanceInfo = 
    m_Prov.getUntrackedParameter<bool>("PrintProvenanceInfo");
 
  if (verbosity >= 0) {
    edm::LogInfo(MsgLoggerCat) 
      << "\n===============================\n"
      << "Initialized as EDAnalyzer with parameter values:\n"
      << "    Name          = " << fName << "\n"
      << "    Verbosity     = " << verbosity << "\n"
      << "    Frequency     = " << frequency << "\n"
      << "    VtxUnit       = " << vtxunit << "\n"
      << "    OutputFile    = " << outputfile << "\n"
      << "    DoOutput      = " << doOutput << "\n"
      << "    GetProv       = " << getAllProvenances << "\n"
      << "    PrintProv     = " << printProvenanceInfo << "\n"
      << "===============================\n";
  }
 
  dbe = 0;
  dbe = edm::Service<DQMStore>().operator->();
  
  if(dbe){
    meTestString = 0;
    meTestInt = 0;
    meTestFloat = 0;
    meTestTH1F = 0;
    meTestTH2F = 0;
    meTestTH3F = 0;
    meTestProfile1 = 0;
    meTestProfile2 = 0;
    Random = new TRandom3();
    
    dbe->setCurrentFolder("GlobalTestV/String");
    meTestString = dbe->bookString("TestString","Hello World" );

    dbe->setCurrentFolder("GlobalTestV/Int");
    meTestInt = dbe->bookInt("TestInt");

    dbe->setCurrentFolder("GlobalTestV/Float");
    meTestFloat = dbe->bookFloat("TestFloat");

    dbe->setCurrentFolder("GlobalTestV/TH1F");
    meTestTH1F = dbe->book1D("Random1D", "Random1D", 100, -10., 10.);

    dbe->setCurrentFolder("GlobalTestV/TH2F");
    meTestTH2F = dbe->book2D("Random2D", "Random2D", 100, -10, 10., 100, -10., 
                             10.);

    dbe->setCurrentFolder("GlobalTestV/TH3F");
    meTestTH3F = dbe->book3D("Random3D", "Random3D", 100, -10., 10., 100, 
                             -10., 10., 100, -10., 10.);

    dbe->setCurrentFolder("GlobalTestV/TProfile");
    meTestProfile1 = dbe->bookProfile("Profile1", "Profile1", 100, -10., 10., 
                                      100, -10., 10.);

    dbe->setCurrentFolder("GlobalTestV/TProfile2D");
    meTestProfile2 = dbe->bookProfile2D("Profile2", "Profile2", 100, -10., 
                                        10., 100, -10, 10., 100, -10., 10.);

    dbe->tag(meTestTH1F->getFullname(),1);
    dbe->tag(meTestTH2F->getFullname(),2);
    dbe->tag(meTestTH3F->getFullname(),3);
    dbe->tag(meTestProfile1->getFullname(),4);
    dbe->tag(meTestProfile2->getFullname(),5);
    dbe->tag(meTestString->getFullname(),6);
    dbe->tag(meTestInt->getFullname(),7);
    dbe->tag(meTestFloat->getFullname(),8);
  }
}
GlobalHitsTester::~GlobalHitsTester ( ) [virtual]

Definition at line 91 of file GlobalHitsTester.cc.

References dbe, doOutput, outputfile, and DQMStore::save().

{
  if (doOutput)
    if (outputfile.size() != 0 && dbe) dbe->save(outputfile);
}

Member Function Documentation

void GlobalHitsTester::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
) [virtual]
void GlobalHitsTester::beginJob ( void  ) [virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 97 of file GlobalHitsTester.cc.

{
  return;
}
void GlobalHitsTester::beginRun ( const edm::Run iRun,
const edm::EventSetup iSetup 
) [virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 111 of file GlobalHitsTester.cc.

{
  return;
}
void GlobalHitsTester::endJob ( void  ) [virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 102 of file GlobalHitsTester.cc.

References count, and verbosity.

{
  std::string MsgLoggerCat = "GlobalHitsTester_endJob";
  if (verbosity >= 0)
    edm::LogInfo(MsgLoggerCat) 
      << "Terminating having processed " << count << " events.";
  return;
}
void GlobalHitsTester::endRun ( const edm::Run iRun,
const edm::EventSetup iSetup 
) [virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 117 of file GlobalHitsTester.cc.

References MonitorElement::Fill(), meTestFloat, and meTestInt.

{
  meTestInt->Fill(100);
  meTestFloat->Fill(3.141592);

  return;
}

Member Data Documentation

unsigned int GlobalHitsTester::count [private]

Definition at line 119 of file GlobalHitsTester.h.

Referenced by endJob().

Definition at line 100 of file GlobalHitsTester.h.

Referenced by GlobalHitsTester(), and ~GlobalHitsTester().

Definition at line 102 of file GlobalHitsTester.h.

Referenced by GlobalHitsTester(), and ~GlobalHitsTester().

std::string GlobalHitsTester::fName [private]

Definition at line 93 of file GlobalHitsTester.h.

Referenced by GlobalHitsTester().

Definition at line 95 of file GlobalHitsTester.h.

Referenced by GlobalHitsTester().

Definition at line 98 of file GlobalHitsTester.h.

Referenced by GlobalHitsTester().

std::string GlobalHitsTester::label [private]

Definition at line 97 of file GlobalHitsTester.h.

Definition at line 106 of file GlobalHitsTester.h.

Referenced by endRun(), and GlobalHitsTester().

Definition at line 105 of file GlobalHitsTester.h.

Referenced by endRun(), and GlobalHitsTester().

Definition at line 110 of file GlobalHitsTester.h.

Referenced by analyze(), and GlobalHitsTester().

Definition at line 111 of file GlobalHitsTester.h.

Referenced by analyze(), and GlobalHitsTester().

Definition at line 104 of file GlobalHitsTester.h.

Referenced by GlobalHitsTester().

Definition at line 107 of file GlobalHitsTester.h.

Referenced by analyze(), and GlobalHitsTester().

Definition at line 108 of file GlobalHitsTester.h.

Referenced by analyze(), and GlobalHitsTester().

Definition at line 109 of file GlobalHitsTester.h.

Referenced by analyze(), and GlobalHitsTester().

std::string GlobalHitsTester::outputfile [private]

Definition at line 101 of file GlobalHitsTester.h.

Referenced by GlobalHitsTester(), and ~GlobalHitsTester().

Definition at line 99 of file GlobalHitsTester.h.

Referenced by GlobalHitsTester().

TRandom* GlobalHitsTester::Random [private]

Definition at line 113 of file GlobalHitsTester.h.

double GlobalHitsTester::RandomVal1 [private]

Definition at line 114 of file GlobalHitsTester.h.

Referenced by analyze().

double GlobalHitsTester::RandomVal2 [private]

Definition at line 115 of file GlobalHitsTester.h.

Referenced by analyze().

double GlobalHitsTester::RandomVal3 [private]

Definition at line 116 of file GlobalHitsTester.h.

Referenced by analyze().

Definition at line 94 of file GlobalHitsTester.h.

Referenced by endJob(), and GlobalHitsTester().

Definition at line 96 of file GlobalHitsTester.h.

Referenced by GlobalHitsTester().