CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
PlotCombiner Class Reference
Inheritance diagram for PlotCombiner:
DQMEDHarvester edm::one::EDAnalyzer< edm::one::WatchRuns, edm::one::WatchLuminosityBlocks, edm::one::SharedResources > edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

 PlotCombiner (const edm::ParameterSet &pset)
 
virtual ~PlotCombiner ()
 
- Public Member Functions inherited from DQMEDHarvester
virtual void analyze (edm::Event const &, edm::EventSetup const &) final
 
virtual void beginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
virtual void beginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDHarvester (void)
 
virtual void dqmEndLuminosityBlock (DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void endJob () final
 
virtual void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
virtual void endRun (edm::Run const &, edm::EventSetup const &)
 
- Public Member Functions inherited from edm::one::EDAnalyzer< edm::one::WatchRuns, edm::one::WatchLuminosityBlocks, edm::one::SharedResources >
 EDAnalyzer ()=default
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDAnalyzerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Protected Member Functions

void dqmEndJob (DQMStore::IBooker &, DQMStore::IGetter &) override
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Private Member Functions

void makePlot (const ParameterSet &pset, DQMStore::IBooker &, DQMStore::IGetter &)
 

Private Attributes

string myDQMrootFolder
 
const VParameterSet plots
 

Additional Inherited Members

- Public Types inherited from edm::one::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Detailed Description

Definition at line 19 of file PlotCombiner.cc.

Constructor & Destructor Documentation

PlotCombiner::PlotCombiner ( const edm::ParameterSet pset)

Definition at line 33 of file PlotCombiner.cc.

33  :
34  myDQMrootFolder( pset.getUntrackedParameter<string>("MyDQMrootFolder") ),
35  plots( pset.getUntrackedParameter<VParameterSet>("Plots") )
36 {
37 }
T getUntrackedParameter(std::string const &, T const &) const
string myDQMrootFolder
Definition: PlotCombiner.cc:26
std::vector< ParameterSet > VParameterSet
Definition: ParameterSet.h:33
const VParameterSet plots
Definition: PlotCombiner.cc:27
PlotCombiner::~PlotCombiner ( )
virtual

Definition at line 99 of file PlotCombiner.cc.

References DEFINE_FWK_MODULE.

99  {
100 }

Member Function Documentation

void PlotCombiner::dqmEndJob ( DQMStore::IBooker ibooker_,
DQMStore::IGetter igetter_ 
)
overrideprotectedvirtual

Implements DQMEDHarvester.

Definition at line 39 of file PlotCombiner.cc.

References makePlot(), plots, and muonDTDigis_cfi::pset.

39  {
40  for(VParameterSet::const_iterator pset = plots.begin(); pset!=plots.end(); pset++){
41  makePlot(*pset, ibooker_, igetter_);
42  }
43 }
const VParameterSet plots
Definition: PlotCombiner.cc:27
void makePlot(const ParameterSet &pset, DQMStore::IBooker &, DQMStore::IGetter &)
Definition: PlotCombiner.cc:45
void PlotCombiner::makePlot ( const ParameterSet pset,
DQMStore::IBooker ibooker_,
DQMStore::IGetter igetter_ 
)
private

Definition at line 45 of file PlotCombiner.cc.

References DQMStore::IBooker::book2D(), DQMStore::IGetter::get(), MonitorElement::getTH1(), edm::ParameterSet::getUntrackedParameter(), plotFactory::histos, mps_fire::i, tablePrinter::labels, LogDebug, myDQMrootFolder, convertSQLitetoXML_cfg::output, indexGen::outputDir, and DQMStore::IBooker::setCurrentFolder().

Referenced by dqmEndJob().

45  {
46 //get hold of MEs
47  vector<string> inputMEnames = pset.getUntrackedParameter<vector<string> >("InputMEnames");
48  vector<string> inputLabels = pset.getUntrackedParameter<vector<string> >("InputLabels");
49  if( inputMEnames.size() != inputLabels.size() ){
50  LogDebug("HLTriggerOfflineHeavyFlavor") << "Number of labels must match the histos[0]ber of InputMEnames"<<endl;
51  return;
52  }
53  vector<TH1*> histos;
54  vector<TString> labels;
55  for(size_t i=0; i<inputMEnames.size(); i++){
56  string MEname = myDQMrootFolder+"/"+inputMEnames[i];
57  MonitorElement *ME = igetter_.get(MEname);
58  if(ME==0){
59  LogDebug("HLTriggerOfflineHeavyFlavor") << "Could not find ME: "<<MEname<<endl;
60  continue;
61  }
62  histos.push_back( ME->getTH1() );
63  labels.push_back( inputLabels[i] );
64  }
65  if(histos.size()==0){
66  return;
67  }
68  //figure out the output directory name
69  string outputMEname = pset.getUntrackedParameter<string>("OutputMEname");;
70  string outputDir = myDQMrootFolder;
71  string::size_type slashPos = outputMEname.rfind('/');
72  if ( string::npos != slashPos ) {
73  outputDir += "/"+outputMEname.substr(0, slashPos);
74  outputMEname.erase(0, slashPos+1);
75  }
76  ibooker_.setCurrentFolder(outputDir);
77  //create output ME
78  TH2F * output;
79  if(histos[0]->GetXaxis()->GetXbins()->GetSize()==0){
80  output = new TH2F(outputMEname.c_str(),outputMEname.c_str(),histos[0]->GetXaxis()->GetNbins(),histos[0]->GetXaxis()->GetXmin(),histos[0]->GetXaxis()->GetXmax(),histos.size(),0,histos.size());
81  }else{
82  output = new TH2F(outputMEname.c_str(),outputMEname.c_str(),histos[0]->GetXaxis()->GetNbins(),histos[0]->GetXaxis()->GetXbins()->GetArray(),histos.size(),0,histos.size());
83  }
84  output->SetTitle(outputMEname.c_str());
85  output->SetXTitle( histos[0]->GetXaxis()->GetTitle() );
86  output->SetStats(kFALSE);
87  output->SetOption("colztexte");
88  for(size_t i=0; i<histos.size(); i++){
89  for(int j=1; j<=histos[0]->GetNbinsX(); j++){
90  output->SetBinContent(j,i+1,histos[i]->GetBinContent(j));
91  output->SetBinError(j,i+1,histos[i]->GetBinError(j));
92  }
93  output->GetYaxis()->SetBinLabel(i+1,labels[i]);
94  }
95  ibooker_.book2D(outputMEname,output);
96  delete output;
97 }
#define LogDebug(id)
T getUntrackedParameter(std::string const &, T const &) const
string myDQMrootFolder
Definition: PlotCombiner.cc:26
MonitorElement * get(const std::string &path)
Definition: DQMStore.cc:305
uint16_t size_type
Definition: ME.h:11
TH1 * getTH1(void) const
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:277
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:133

Member Data Documentation

string PlotCombiner::myDQMrootFolder
private

Definition at line 26 of file PlotCombiner.cc.

Referenced by makePlot().

const VParameterSet PlotCombiner::plots
private

Definition at line 27 of file PlotCombiner.cc.

Referenced by dqmEndJob().