CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
FTSLuminosityFromPixelClusters.cc
Go to the documentation of this file.
1 // C++ headers
2 #include <string>
3 #include <cstring>
4 
5 // CMSSW headers
18 
20 public:
23 
24  static void fillDescriptions(edm::ConfigurationDescriptions & descriptions);
25 
26 private:
28  unsigned int m_lumi_id;
29 
30  void analyze(edm::StreamID sid, edm::Event const & event, const edm::EventSetup & setup) const override;
31 };
32 
34  m_token(consumes<SiPixelClusterCollectionNew>(config.getParameter<edm::InputTag>("source"))),
35  m_lumi_id((unsigned int) -1)
36 {
37  if (not edm::Service<FastTimerService>().isAvailable())
38  return;
39 
40  std::string const & name = config.getParameter<std::string>("name");
41  std::string const & title = config.getParameter<std::string>("title");
42  std::string const & label = config.getParameter<std::string>("label");
43  double range = config.getParameter<double>("range");
44  double resolution = config.getParameter<double>("resolution");
45 
46  m_lumi_id = edm::Service<FastTimerService>()->reserveLuminosityPlots(name, title, label, range, resolution);
47 }
48 
50 {
51 }
52 
53 void
55 {
56  if (not edm::Service<FastTimerService>().isAvailable())
57  return;
58 
59  double value = 0.;
61  if (event.getByToken(m_token, h_clusters))
62  value = h_clusters->dataSize();
63 
64  edm::Service<FastTimerService>()->setLuminosity(sid, m_lumi_id, value);
65 }
66 
67 void
70  desc.add<edm::InputTag>("source", edm::InputTag("siPixelClusters"));
71  desc.add<std::string>("name", "clusters");
72  desc.add<std::string>("title", "pixel clusters");
73  desc.add<std::string>("label", "pixel clusters");
74  desc.add<double>("range", 20000);
75  desc.add<double>("resolution", 500);
76  descriptions.add("ftsLuminosityFromPixelClusters", desc);
77 }
78 
79 //define this as a plug-in
T getParameter(std::string const &) const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:446
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
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
edm::EDGetTokenT< SiPixelClusterCollectionNew > m_token
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void analyze(edm::StreamID sid, edm::Event const &event, const edm::EventSetup &setup) const override
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")
FTSLuminosityFromPixelClusters(edm::ParameterSet const &)