CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes
FTSLuminosityFromScalers Class Reference
Inheritance diagram for FTSLuminosityFromScalers:
edm::global::EDAnalyzer<> edm::global::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

 FTSLuminosityFromScalers (edm::ParameterSet const &)
 
 ~FTSLuminosityFromScalers ()
 
- Public Member Functions inherited from edm::global::EDAnalyzer<>
 EDAnalyzer ()=default
 
- Public Member Functions inherited from edm::global::EDAnalyzerBase
 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 & itemsToGetFromEvent () 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)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::global::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Types

enum  Type { Type::InstantaneousLuminosity, Type::Pileup, Type::Invalid = -1 }
 

Private Member Functions

void analyze (edm::StreamID sid, edm::Event const &event, const edm::EventSetup &setup) const override
 

Static Private Member Functions

static Type parse (std::string const &type)
 

Private Attributes

unsigned int m_lumi_id
 
edm::EDGetTokenT< LumiScalersCollectionm_token
 
Type m_type
 

Additional Inherited Members

- Public Types inherited from edm::global::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- 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

Definition at line 19 of file FTSLuminosityFromScalers.cc.

Member Enumeration Documentation

enum FTSLuminosityFromScalers::Type
strongprivate
Enumerator
InstantaneousLuminosity 
Pileup 
Invalid 

Definition at line 27 of file FTSLuminosityFromScalers.cc.

27  {
28  InstantaneousLuminosity,
29  Pileup,
30  Invalid = -1
31  };

Constructor & Destructor Documentation

FTSLuminosityFromScalers::FTSLuminosityFromScalers ( edm::ParameterSet const &  config)
explicit

Definition at line 49 of file FTSLuminosityFromScalers.cc.

References edm::ParameterSet::getParameter(), diffTwoXMLs::label, m_lumi_id, dataset::name, fftjetproducer_cfi::resolution, AlCaHLTBitMon_QueryRunRegistry::string, and fftjetcommon_cfi::title.

49  :
50  m_token(consumes<LumiScalersCollection>(config.getParameter<edm::InputTag>("source"))),
51  m_type(parse(config.getParameter<std::string>("type"))),
52  m_lumi_id((unsigned int) -1)
53 {
54  if (not edm::Service<FastTimerService>().isAvailable())
55  return;
56 
57  std::string const & name = config.getParameter<std::string>("name");
58  std::string const & title = config.getParameter<std::string>("title");
59  std::string const & label = config.getParameter<std::string>("label");
60  double range = config.getParameter<double>("range");
61  double resolution = config.getParameter<double>("resolution");
62 
63  m_lumi_id = edm::Service<FastTimerService>()->reserveLuminosityPlots(name, title, label, range, resolution);
64 }
Definition: config.py:1
static Type parse(std::string const &type)
edm::EDGetTokenT< LumiScalersCollection > m_token
FTSLuminosityFromScalers::~FTSLuminosityFromScalers ( )

Definition at line 66 of file FTSLuminosityFromScalers.cc.

67 {
68 }

Member Function Documentation

void FTSLuminosityFromScalers::analyze ( edm::StreamID  sid,
edm::Event const &  event,
const edm::EventSetup setup 
) const
overrideprivate

Definition at line 71 of file FTSLuminosityFromScalers.cc.

References edm::Event::getByToken(), InstantaneousLuminosity, Invalid, m_lumi_id, m_token, m_type, and Pileup.

72 {
73  if (not edm::Service<FastTimerService>().isAvailable())
74  return;
75 
76  double value = 0.;
78  if (event.getByToken(m_token, h_luminosity) and not h_luminosity->empty()) {
79  switch (m_type) {
81  value = h_luminosity->front().instantLumi() * 1.e30;
82  break;
83  case Type::Pileup:
84  value = h_luminosity->front().pileup();
85  break;
86  case Type::Invalid:
87  value = 0.;
88  break;
89  }
90  }
91 
92  edm::Service<FastTimerService>()->setLuminosity(sid, m_lumi_id, value);
93 }
edm::EDGetTokenT< LumiScalersCollection > m_token
Definition: value.py:1
Definition: event.py:1
void FTSLuminosityFromScalers::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 96 of file FTSLuminosityFromScalers.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), DEFINE_FWK_MODULE, and AlCaHLTBitMon_QueryRunRegistry::string.

96  {
97  // instantaneous luminosity
98  {
100  desc.add<edm::InputTag>("source", edm::InputTag("scalersRawToDigi"));
101  desc.add<std::string>("type", "InstantaneousLuminosity");
102  desc.add<std::string>("name", "luminosity");
103  desc.add<std::string>("title", "instantaneous luminosity");
104  desc.add<std::string>("label", "instantaneous luminosity [cm^{-2}s^{-1}]");
105  desc.add<double>("range", 8.e33);
106  desc.add<double>("resolution", 1.e31);
107  descriptions.add("ftsLuminosityFromScalers", desc);
108  }
109  // pileup
110  {
112  desc.add<edm::InputTag>("source", edm::InputTag("scalersRawToDigi"));
113  desc.add<std::string>("type", "Pileup");
114  desc.add<std::string>("name", "pileup");
115  desc.add<std::string>("title", "pileup");
116  desc.add<std::string>("label", "pileup");
117  desc.add<double>("range", 40);
118  desc.add<double>("resolution", 1);
119  descriptions.add("ftsPileupFromScalers", desc);
120  }
121 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
static Type FTSLuminosityFromScalers::parse ( std::string const &  type)
inlinestaticprivate

Definition at line 33 of file FTSLuminosityFromScalers.cc.

References InstantaneousLuminosity, Invalid, and Pileup.

33  {
34  if (type == "InstantaneousLuminosity")
36  else if (type == "Pileup")
37  return Type::Pileup;
38  else
39  return Type::Invalid;
40  }
type
Definition: HCALResponse.h:21

Member Data Documentation

unsigned int FTSLuminosityFromScalers::m_lumi_id
private

Definition at line 44 of file FTSLuminosityFromScalers.cc.

Referenced by analyze(), and FTSLuminosityFromScalers().

edm::EDGetTokenT<LumiScalersCollection> FTSLuminosityFromScalers::m_token
private

Definition at line 42 of file FTSLuminosityFromScalers.cc.

Referenced by analyze().

Type FTSLuminosityFromScalers::m_type
private

Definition at line 43 of file FTSLuminosityFromScalers.cc.

Referenced by analyze().