CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
StatisticsFilter Class Reference

#include <MyFilter/StatisticsFilter/src/StatisticsFilter.cc>

Inheritance diagram for StatisticsFilter:
edm::EDFilter edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 StatisticsFilter (const edm::ParameterSet &)
 
 ~StatisticsFilter ()
 
- Public Member Functions inherited from edm::EDFilter
 EDFilter ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDFilter ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Member Functions

virtual void beginJob () override
 
virtual void endJob () override
 
virtual bool filter (edm::Event &, const edm::EventSetup &) override
 

Private Attributes

std::string dirpath
 
DQMStoredqmStore_
 
std::string filename
 
int MinNumberOfEvents
 
int TotNumberOfEvents
 

Additional Inherited Members

- Public Types inherited from edm::EDFilter
typedef EDFilter ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::EDFilter
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- 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)
 

Detailed Description

Description: [one line class summary]

Implementation: [Notes on implementation]

Definition at line 42 of file StatisticsFilter.cc.

Constructor & Destructor Documentation

StatisticsFilter::StatisticsFilter ( const edm::ParameterSet iConfig)
explicit

Definition at line 73 of file StatisticsFilter.cc.

References dqmStore_, filename, DQMStore::open(), and cppFunctionSkipper::operator.

73  : filename(iConfig.getUntrackedParameter<std::string>("rootFilename","")),
74  dirpath(iConfig.getUntrackedParameter<std::string>("histoDirPath","")),
75  MinNumberOfEvents(iConfig.getUntrackedParameter<int>("minNumberOfEvents"))
76 {
77  //now do what ever initialization is needed
78 
80  dqmStore_->open(filename.c_str(), false);
81 }
T getUntrackedParameter(std::string const &, T const &) const
std::string filename
bool open(const std::string &filename, bool overwrite=false, const std::string &path="", const std::string &prepend="", OpenRunDirs stripdirs=KeepRunDirs, bool fileMustExist=true)
Definition: DQMStore.cc:2959
StatisticsFilter::~StatisticsFilter ( )

Definition at line 84 of file StatisticsFilter.cc.

85 {
86 
87  // do anything here that needs to be done at desctruction time
88  // (e.g. close files, deallocate resources etc.)
89 
90 }

Member Function Documentation

void StatisticsFilter::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDFilter.

Definition at line 132 of file StatisticsFilter.cc.

133 {
134 }
void StatisticsFilter::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDFilter.

Definition at line 138 of file StatisticsFilter.cc.

138  {
139 }
bool StatisticsFilter::filter ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Implements edm::EDFilter.

Definition at line 99 of file StatisticsFilter.cc.

References dirpath, dqmStore_, DQMStore::getAllContents(), MinNumberOfEvents, NULL, AlCaHLTBitMon_QueryRunRegistry::string, and TotNumberOfEvents.

Referenced by Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::filter(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::find(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::setDataAccessor(), and Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::switchCenterView().

100 {
101  TotNumberOfEvents = 0;
102 
103  std::vector<MonitorElement*> MEs = dqmStore_->getAllContents(dirpath);
104 
105  std::vector<MonitorElement*>::const_iterator iter=MEs.begin();
106  std::vector<MonitorElement*>::const_iterator iterEnd=MEs.end();
107 
108  for (; iter!=iterEnd;++iter)
109  {
110  std::string me_name = (*iter)->getName();
111 
112  if ( strstr(me_name.c_str(),"TotalNumberOfCluster__T")!=NULL && strstr(me_name.c_str(),"Profile")==NULL )
113  {
114  TotNumberOfEvents = ((TH1F*)(*iter)->getTH1F())->GetEntries();
115 
116  break;
117  }
118  }
119 
121  {
122  edm::LogInfo("StatisticsFilter") << "Only " << TotNumberOfEvents << " events in the run. Run will not be analyzed!";
123 
124  return false;
125  }
126 
127  return true;
128 }
#define NULL
Definition: scimark2.h:8
std::vector< MonitorElement * > getAllContents(const std::string &path, uint32_t runNumber=0, uint32_t lumi=0) const
Definition: DQMStore.cc:1961

Member Data Documentation

std::string StatisticsFilter::dirpath
private

Definition at line 56 of file StatisticsFilter.cc.

Referenced by filter().

DQMStore* StatisticsFilter::dqmStore_
private

Definition at line 54 of file StatisticsFilter.cc.

Referenced by filter(), and StatisticsFilter().

std::string StatisticsFilter::filename
private
int StatisticsFilter::MinNumberOfEvents
private

Definition at line 58 of file StatisticsFilter.cc.

Referenced by filter().

int StatisticsFilter::TotNumberOfEvents
private

Definition at line 57 of file StatisticsFilter.cc.

Referenced by filter().