test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 ()
 
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 (std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &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 ()
 

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
< LumiScalersCollection
m_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, mergeVDriftHistosByStation::name, dtDQMClient_cfg::resolution, AlCaHLTBitMon_QueryRunRegistry::string, and indexGen::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 }
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
overrideprivatevirtual

Implements edm::global::EDAnalyzerBase.

Definition at line 71 of file FTSLuminosityFromScalers.cc.

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

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
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
void FTSLuminosityFromScalers::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 96 of file FTSLuminosityFromScalers.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), HLT_25ns10e33_v2_cff::InputTag, 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().