CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Attributes
RazorMonitor Class Reference

#include <RazorMonitor.h>

Inheritance diagram for RazorMonitor:
DQMEDAnalyzer edm::one::EDProducer< edm::EndRunProducer, edm::one::WatchRuns, edm::EndLuminosityBlockProducer, edm::one::WatchLuminosityBlocks, edm::Accumulator > edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 RazorMonitor (const edm::ParameterSet &)
 
 ~RazorMonitor () override
 
- Public Member Functions inherited from DQMEDAnalyzer
void accumulate (edm::Event const &event, edm::EventSetup const &setup) final
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
virtual void dqmBeginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer ()
 
virtual void dqmEndLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void dqmEndRun (edm::Run const &, edm::EventSetup const &)
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
void endLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &setup) final
 
void endRun (edm::Run const &, edm::EventSetup const &) final
 
void endRunProduce (edm::Run &run, edm::EventSetup const &setup) final
 
virtual bool getCanSaveByLumi ()
 
- Public Member Functions inherited from edm::one::EDProducer< edm::EndRunProducer, edm::one::WatchRuns, edm::EndLuminosityBlockProducer, edm::one::WatchLuminosityBlocks, edm::Accumulator >
 EDProducer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
- Public Member Functions inherited from edm::one::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
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
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static double CalcMR (const math::XYZTLorentzVector &ja, const math::XYZTLorentzVector &jb)
 
static double CalcR (double MR, const math::XYZTLorentzVector &ja, const math::XYZTLorentzVector &jb, const edm::Handle< std::vector< reco::PFMET > > &met)
 
static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::one::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Protected Member Functions

void analyze (edm::Event const &iEvent, edm::EventSetup const &iSetup) override
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
void bookME (DQMStore::IBooker &, RazorME &me, const std::string &histname, const std::string &histtitle, int nbins, double xmin, double xmax)
 
void bookME (DQMStore::IBooker &, RazorME &me, const std::string &histname, const std::string &histtitle, const std::vector< double > &binningX)
 
void bookME (DQMStore::IBooker &, RazorME &me, const std::string &histname, const std::string &histtitle, int nbinsX, double xmin, double xmax, double ymin, double ymax)
 
void bookME (DQMStore::IBooker &, RazorME &me, const std::string &histname, const std::string &histtitle, int nbinsX, double xmin, double xmax, int nbinsY, double ymin, double ymax)
 
void bookME (DQMStore::IBooker &, RazorME &me, const std::string &histname, const std::string &histtitle, const std::vector< double > &binningX, const std::vector< double > &binningY)
 
void setMETitle (RazorME &me, const std::string &titleX, const std::string &titleY)
 
- Protected Member Functions inherited from edm::ProducerBase
ProducesCollector producesCollector ()
 
- 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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
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 Attributes

std::unique_ptr< GenericTriggerEventFlagden_genTriggerEventFlag_
 
std::vector< double > dphiR_binning_
 
RazorME dPhiR_ME_
 
std::string folderName_
 
std::string histoSuffix_
 
StringCutObjectSelector< reco::PFJet, true > jetSelection_
 
edm::EDGetTokenT< reco::PFJetCollectionjetToken_
 
StringCutObjectSelector< reco::MET, true > metSelection_
 
edm::EDGetTokenT< reco::PFMETCollectionmetToken_
 
std::vector< double > mr_binning_
 
RazorME MR_ME_
 
float mrCut_
 
RazorME MRVsRsq_ME_
 
unsigned int njets_
 
std::unique_ptr< GenericTriggerEventFlagnum_genTriggerEventFlag_
 
std::vector< double > rsq_binning_
 
RazorME Rsq_ME_
 
float rsqCut_
 
edm::EDGetTokenT< std::vector< math::XYZTLorentzVector > > theHemispheres_
 

Additional Inherited Members

- Public Types inherited from DQMEDAnalyzer
typedef dqm::reco::DQMStore DQMStore
 
typedef dqm::reco::MonitorElement MonitorElement
 
- Public Types inherited from edm::one::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Protected Attributes inherited from DQMEDAnalyzer
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 

Detailed Description

Definition at line 57 of file RazorMonitor.h.

Constructor & Destructor Documentation

RazorMonitor::RazorMonitor ( const edm::ParameterSet iConfig)

Definition at line 21 of file RazorMonitor.cc.

References RazorME::denominator, dPhiR_ME_, edm::ParameterSet::getParameter(), MR_ME_, MRVsRsq_ME_, RazorME::numerator, Rsq_ME_, theHemispheres_, and ~RazorMonitor().

22  : folderName_(iConfig.getParameter<std::string>("FolderName")),
23  metToken_(consumes<reco::PFMETCollection>(iConfig.getParameter<edm::InputTag>("met"))),
24  jetToken_(mayConsume<reco::PFJetCollection>(iConfig.getParameter<edm::InputTag>("jets"))),
25  rsq_binning_(iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<std::vector<double> >("rsqBins")),
26  mr_binning_(iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<std::vector<double> >("mrBins")),
28  iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<std::vector<double> >("dphiRBins")),
30  iConfig.getParameter<edm::ParameterSet>("numGenericTriggerEventPSet"), consumesCollector(), *this)),
32  iConfig.getParameter<edm::ParameterSet>("denGenericTriggerEventPSet"), consumesCollector(), *this)),
33  metSelection_(iConfig.getParameter<std::string>("metSelection")),
34  jetSelection_(iConfig.getParameter<std::string>("jetSelection")),
35  njets_(iConfig.getParameter<unsigned int>("njets")),
36  rsqCut_(iConfig.getParameter<double>("rsqCut")),
37  mrCut_(iConfig.getParameter<double>("mrCut")) {
38  theHemispheres_ = consumes<std::vector<math::XYZTLorentzVector> >(iConfig.getParameter<edm::InputTag>("hemispheres"));
39 
40  MR_ME_.numerator = nullptr;
41  MR_ME_.denominator = nullptr;
42  Rsq_ME_.numerator = nullptr;
43  Rsq_ME_.denominator = nullptr;
44  dPhiR_ME_.numerator = nullptr;
45  dPhiR_ME_.denominator = nullptr;
46 
47  MRVsRsq_ME_.numerator = nullptr;
48  MRVsRsq_ME_.denominator = nullptr;
49 }
T getParameter(std::string const &) const
edm::EDGetTokenT< reco::PFJetCollection > jetToken_
Definition: RazorMonitor.h:117
edm::EDGetTokenT< reco::PFMETCollection > metToken_
Definition: RazorMonitor.h:116
std::unique_ptr< GenericTriggerEventFlag > num_genTriggerEventFlag_
Definition: RazorMonitor.h:129
Provides a code based selection for trigger and DCS information in order to have no failing filters i...
StringCutObjectSelector< reco::MET, true > metSelection_
Definition: RazorMonitor.h:132
edm::EDGetTokenT< std::vector< math::XYZTLorentzVector > > theHemispheres_
Definition: RazorMonitor.h:118
unsigned int njets_
Definition: RazorMonitor.h:134
std::vector< double > mr_binning_
Definition: RazorMonitor.h:121
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
std::vector< double > dphiR_binning_
Definition: RazorMonitor.h:122
RazorME Rsq_ME_
Definition: RazorMonitor.h:125
StringCutObjectSelector< reco::PFJet, true > jetSelection_
Definition: RazorMonitor.h:133
RazorME dPhiR_ME_
Definition: RazorMonitor.h:126
std::vector< double > rsq_binning_
Definition: RazorMonitor.h:120
RazorME MR_ME_
Definition: RazorMonitor.h:124
std::unique_ptr< GenericTriggerEventFlag > den_genTriggerEventFlag_
Definition: RazorMonitor.h:130
dqm::reco::MonitorElement * numerator
Definition: RazorMonitor.h:50
RazorME MRVsRsq_ME_
Definition: RazorMonitor.h:127
std::string folderName_
Definition: RazorMonitor.h:113
dqm::reco::MonitorElement * denominator
Definition: RazorMonitor.h:51
RazorMonitor::~RazorMonitor ( )
overridedefault

Referenced by RazorMonitor().

Member Function Documentation

void RazorMonitor::analyze ( edm::Event const &  iEvent,
edm::EventSetup const &  iSetup 
)
overrideprotectedvirtual

Reimplemented from DQMEDAnalyzer.

Definition at line 166 of file RazorMonitor.cc.

References funct::abs(), CalcMR(), CalcR(), SiPixelRawToDigiRegional_cfi::deltaPhi, den_genTriggerEventFlag_, RazorME::denominator, dPhiR_ME_, relativeConstraints::empty, dqm::impl::MonitorElement::Fill(), edm::Event::getByToken(), razorHemispheres_cff::hemispheres, edm::HandleBase::isValid(), dqmiolumiharvest::j, singleTopDQM_cfi::jets, jetSelection_, jetToken_, metSelection_, metToken_, MR_ME_, mrCut_, MRVsRsq_ME_, njets_, num_genTriggerEventFlag_, RazorME::numerator, dttmaxenums::R, Rsq_ME_, rsqCut_, and theHemispheres_.

166  {
167  // Filter out events if Trigger Filtering is requested
168  if (den_genTriggerEventFlag_->on() && !den_genTriggerEventFlag_->accept(iEvent, iSetup))
169  return;
170 
171  //met collection
173  iEvent.getByToken(metToken_, metHandle);
174  reco::PFMET pfmet = metHandle->front();
175  if (!metSelection_(pfmet))
176  return;
177 
178  //jet collection, track # of jets for two working points
180  iEvent.getByToken(jetToken_, jetHandle);
181  std::vector<reco::PFJet> jets;
182  if (jetHandle->size() < njets_)
183  return;
184  for (auto const& j : *jetHandle) {
185  if (jetSelection_(j))
186  jets.push_back(j);
187  }
188  if (jets.size() < njets_)
189  return;
190 
191  //razor hemisphere clustering from previous step
193  iEvent.getByToken(theHemispheres_, hemispheres);
194 
195  if (not hemispheres.isValid()) {
196  return;
197  }
198 
199  if (hemispheres
200  ->empty()) { // the Hemisphere Maker will produce an empty collection of hemispheres if # of jets is too high
201  edm::LogError("DQM_HLT_Razor") << "Cannot calculate M_R and R^2 because there are too many jets! (trigger passed "
202  "automatically without forming the hemispheres)"
203  << endl;
204  return;
205  }
206 
207  // should always have 2 hemispheres -- no muons included (c. 2017), if not return invalid hemisphere collection
208  // retaining check for hemisphere size 5 or 10 which correspond to the one or two muon case for possible future use
209  if (!hemispheres->empty() && hemispheres->size() != 2 && hemispheres->size() != 5 && hemispheres->size() != 10) {
210  edm::LogError("DQM_HLT_Razor") << "Invalid hemisphere collection! hemispheres->size() = " << hemispheres->size()
211  << endl;
212  return;
213  }
214 
215  //calculate razor variables, with hemispheres pT-ordered
216  double MR = 0, R = 0;
217  if (hemispheres->at(1).Pt() > hemispheres->at(0).Pt()) {
218  MR = CalcMR(hemispheres->at(1), hemispheres->at(0));
219  R = CalcR(MR, hemispheres->at(1), hemispheres->at(0), metHandle);
220  } else {
221  MR = CalcMR(hemispheres->at(0), hemispheres->at(1));
222  R = CalcR(MR, hemispheres->at(0), hemispheres->at(1), metHandle);
223  }
224 
225  double Rsq = R * R;
226  double dPhiR = abs(deltaPhi(hemispheres->at(0).Phi(), hemispheres->at(1).Phi()));
227 
228  //apply offline selection cuts
229  if (Rsq < rsqCut_ && MR < mrCut_)
230  return;
231 
232  // applying selection for denominator
233  if (den_genTriggerEventFlag_->on() && !den_genTriggerEventFlag_->accept(iEvent, iSetup))
234  return;
235 
236  // filling histograms (denominator)
237  if (Rsq >= rsqCut_) {
238  MR_ME_.denominator->Fill(MR);
239  }
240 
241  if (MR >= mrCut_) {
242  Rsq_ME_.denominator->Fill(Rsq);
243  }
244 
245  dPhiR_ME_.denominator->Fill(dPhiR);
246 
247  MRVsRsq_ME_.denominator->Fill(MR, Rsq);
248 
249  // applying selection for numerator
250  if (num_genTriggerEventFlag_->on() && !num_genTriggerEventFlag_->accept(iEvent, iSetup))
251  return;
252 
253  // filling histograms (numerator)
254  if (Rsq >= rsqCut_) {
255  MR_ME_.numerator->Fill(MR);
256  }
257 
258  if (MR >= mrCut_) {
259  Rsq_ME_.numerator->Fill(Rsq);
260  }
261 
262  dPhiR_ME_.numerator->Fill(dPhiR);
263 
264  MRVsRsq_ME_.numerator->Fill(MR, Rsq);
265 }
edm::EDGetTokenT< reco::PFJetCollection > jetToken_
Definition: RazorMonitor.h:117
edm::EDGetTokenT< reco::PFMETCollection > metToken_
Definition: RazorMonitor.h:116
std::unique_ptr< GenericTriggerEventFlag > num_genTriggerEventFlag_
Definition: RazorMonitor.h:129
static double CalcMR(const math::XYZTLorentzVector &ja, const math::XYZTLorentzVector &jb)
void Fill(long long x)
StringCutObjectSelector< reco::MET, true > metSelection_
Definition: RazorMonitor.h:132
edm::EDGetTokenT< std::vector< math::XYZTLorentzVector > > theHemispheres_
Definition: RazorMonitor.h:118
unsigned int njets_
Definition: RazorMonitor.h:134
int iEvent
Definition: GenABIO.cc:224
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
bool isValid() const
Definition: HandleBase.h:70
RazorME Rsq_ME_
Definition: RazorMonitor.h:125
StringCutObjectSelector< reco::PFJet, true > jetSelection_
Definition: RazorMonitor.h:133
RazorME dPhiR_ME_
Definition: RazorMonitor.h:126
RazorME MR_ME_
Definition: RazorMonitor.h:124
std::unique_ptr< GenericTriggerEventFlag > den_genTriggerEventFlag_
Definition: RazorMonitor.h:130
dqm::reco::MonitorElement * numerator
Definition: RazorMonitor.h:50
static double CalcR(double MR, const math::XYZTLorentzVector &ja, const math::XYZTLorentzVector &jb, const edm::Handle< std::vector< reco::PFMET > > &met)
RazorME MRVsRsq_ME_
Definition: RazorMonitor.h:127
dqm::reco::MonitorElement * denominator
Definition: RazorMonitor.h:51
void RazorMonitor::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  iRun,
edm::EventSetup const &  iSetup 
)
overrideprotectedvirtual

Implements DQMEDAnalyzer.

Definition at line 127 of file RazorMonitor.cc.

References bookME(), den_genTriggerEventFlag_, dphiR_binning_, dPhiR_ME_, folderName_, mr_binning_, MR_ME_, MRVsRsq_ME_, num_genTriggerEventFlag_, rsq_binning_, Rsq_ME_, dqm::dqmstoreimpl::DQMStore::IBooker::setCurrentFolder(), setMETitle(), and AlCaHLTBitMon_QueryRunRegistry::string.

127  {
128  std::string histname, histtitle;
129 
130  std::string currentFolder = folderName_;
131  ibooker.setCurrentFolder(currentFolder);
132 
133  // 1D hist, MR
134  histname = "MR";
135  histtitle = "PF MR";
136  bookME(ibooker, MR_ME_, histname, histtitle, mr_binning_);
137  setMETitle(MR_ME_, "PF M_{R} [GeV]", "events / [GeV]");
138 
139  // 1D hist, Rsq
140  histname = "Rsq";
141  histtitle = "PF Rsq";
142  bookME(ibooker, Rsq_ME_, histname, histtitle, rsq_binning_);
143  setMETitle(Rsq_ME_, "PF R^{2}", "events");
144 
145  // 1D hist, dPhiR
146  histname = "dPhiR";
147  histtitle = "dPhiR";
148  bookME(ibooker, dPhiR_ME_, histname, histtitle, dphiR_binning_);
149  setMETitle(dPhiR_ME_, "dPhi_{R}", "events");
150 
151  // 2D hist, MR & Rsq
152  histname = "MRVsRsq";
153  histtitle = "PF MR vs PF Rsq";
154  bookME(ibooker, MRVsRsq_ME_, histname, histtitle, mr_binning_, rsq_binning_);
155  setMETitle(MRVsRsq_ME_, "M_{R} [GeV]", "R^{2}");
156 
157  // Initialize the GenericTriggerEventFlag
159  num_genTriggerEventFlag_->initRun(iRun, iSetup);
161  den_genTriggerEventFlag_->initRun(iRun, iSetup);
162 }
void bookME(DQMStore::IBooker &, RazorME &me, const std::string &histname, const std::string &histtitle, int nbins, double xmin, double xmax)
Definition: RazorMonitor.cc:60
std::unique_ptr< GenericTriggerEventFlag > num_genTriggerEventFlag_
Definition: RazorMonitor.h:129
void setMETitle(RazorME &me, const std::string &titleX, const std::string &titleY)
Definition: RazorMonitor.cc:53
std::vector< double > mr_binning_
Definition: RazorMonitor.h:121
std::vector< double > dphiR_binning_
Definition: RazorMonitor.h:122
RazorME Rsq_ME_
Definition: RazorMonitor.h:125
RazorME dPhiR_ME_
Definition: RazorMonitor.h:126
std::vector< double > rsq_binning_
Definition: RazorMonitor.h:120
RazorME MR_ME_
Definition: RazorMonitor.h:124
std::unique_ptr< GenericTriggerEventFlag > den_genTriggerEventFlag_
Definition: RazorMonitor.h:130
RazorME MRVsRsq_ME_
Definition: RazorMonitor.h:127
std::string folderName_
Definition: RazorMonitor.h:113
void RazorMonitor::bookME ( DQMStore::IBooker ibooker,
RazorME me,
const std::string &  histname,
const std::string &  histtitle,
int  nbins,
double  xmin,
double  xmax 
)
protected

Definition at line 60 of file RazorMonitor.cc.

References dqm::dqmstoreimpl::DQMStore::IBooker::book1D(), RazorME::denominator, and RazorME::numerator.

Referenced by bookHistograms().

66  {
67  me.numerator = ibooker.book1D(histname + "_numerator", histtitle + " (numerator)", nbins, min, max);
68  me.denominator = ibooker.book1D(histname + "_denominator", histtitle + " (denominator)", nbins, min, max);
69 }
T min(T a, T b)
Definition: MathUtil.h:58
dqm::reco::MonitorElement * numerator
Definition: RazorMonitor.h:50
dqm::reco::MonitorElement * denominator
Definition: RazorMonitor.h:51
void RazorMonitor::bookME ( DQMStore::IBooker ibooker,
RazorME me,
const std::string &  histname,
const std::string &  histtitle,
const std::vector< double > &  binningX 
)
protected

Definition at line 70 of file RazorMonitor.cc.

References dqm::dqmstoreimpl::DQMStore::IBooker::book1D(), RazorME::denominator, LaserClient_cfi::nbins, and RazorME::numerator.

74  {
75  int nbins = binning.size() - 1;
76  std::vector<float> fbinning(binning.begin(), binning.end());
77  float* arr = &fbinning[0];
78  me.numerator = ibooker.book1D(histname + "_numerator", histtitle + " (numerator)", nbins, arr);
79  me.denominator = ibooker.book1D(histname + "_denominator", histtitle + " (denominator)", nbins, arr);
80 }
dqm::reco::MonitorElement * numerator
Definition: RazorMonitor.h:50
dqm::reco::MonitorElement * denominator
Definition: RazorMonitor.h:51
void RazorMonitor::bookME ( DQMStore::IBooker ibooker,
RazorME me,
const std::string &  histname,
const std::string &  histtitle,
int  nbinsX,
double  xmin,
double  xmax,
double  ymin,
double  ymax 
)
protected

Definition at line 81 of file RazorMonitor.cc.

References dqm::dqmstoreimpl::DQMStore::IBooker::bookProfile(), RazorME::denominator, and RazorME::numerator.

89  {
90  me.numerator =
91  ibooker.bookProfile(histname + "_numerator", histtitle + " (numerator)", nbinsX, xmin, xmax, ymin, ymax);
92  me.denominator =
93  ibooker.bookProfile(histname + "_denominator", histtitle + " (denominator)", nbinsX, xmin, xmax, ymin, ymax);
94 }
dqm::reco::MonitorElement * numerator
Definition: RazorMonitor.h:50
dqm::reco::MonitorElement * denominator
Definition: RazorMonitor.h:51
void RazorMonitor::bookME ( DQMStore::IBooker ibooker,
RazorME me,
const std::string &  histname,
const std::string &  histtitle,
int  nbinsX,
double  xmin,
double  xmax,
int  nbinsY,
double  ymin,
double  ymax 
)
protected

Definition at line 95 of file RazorMonitor.cc.

References dqm::dqmstoreimpl::DQMStore::IBooker::book2D(), RazorME::denominator, and RazorME::numerator.

104  {
105  me.numerator =
106  ibooker.book2D(histname + "_numerator", histtitle + " (numerator)", nbinsX, xmin, xmax, nbinsY, ymin, ymax);
107  me.denominator =
108  ibooker.book2D(histname + "_denominator", histtitle + " (denominator)", nbinsX, xmin, xmax, nbinsY, ymin, ymax);
109 }
dqm::reco::MonitorElement * numerator
Definition: RazorMonitor.h:50
dqm::reco::MonitorElement * denominator
Definition: RazorMonitor.h:51
void RazorMonitor::bookME ( DQMStore::IBooker ibooker,
RazorME me,
const std::string &  histname,
const std::string &  histtitle,
const std::vector< double > &  binningX,
const std::vector< double > &  binningY 
)
protected

Definition at line 110 of file RazorMonitor.cc.

References dqm::dqmstoreimpl::DQMStore::IBooker::book2D(), RazorME::denominator, hlt_dqm_clientPB-live_cfg::nbinsX, hlt_dqm_clientPB-live_cfg::nbinsY, and RazorME::numerator.

115  {
116  int nbinsX = binningX.size() - 1;
117  std::vector<float> fbinningX(binningX.begin(), binningX.end());
118  float* arrX = &fbinningX[0];
119  int nbinsY = binningY.size() - 1;
120  std::vector<float> fbinningY(binningY.begin(), binningY.end());
121  float* arrY = &fbinningY[0];
122 
123  me.numerator = ibooker.book2D(histname + "_numerator", histtitle + " (numerator)", nbinsX, arrX, nbinsY, arrY);
124  me.denominator = ibooker.book2D(histname + "_denominator", histtitle + " (denominator)", nbinsX, arrX, nbinsY, arrY);
125 }
dqm::reco::MonitorElement * numerator
Definition: RazorMonitor.h:50
dqm::reco::MonitorElement * denominator
Definition: RazorMonitor.h:51
double RazorMonitor::CalcMR ( const math::XYZTLorentzVector ja,
const math::XYZTLorentzVector jb 
)
static

Definition at line 317 of file RazorMonitor.cc.

References MaterialEffects_cfi::A, TtFullHadDaughter::B, and mathSSE::sqrt().

Referenced by analyze().

317  {
318  if (ja.Pt() <= 0.1)
319  return -1;
320 
321  double A = ja.P();
322  double B = jb.P();
323  double az = ja.Pz();
324  double bz = jb.Pz();
325  TVector3 jaT, jbT;
326  jaT.SetXYZ(ja.Px(), ja.Py(), 0.0);
327  jbT.SetXYZ(jb.Px(), jb.Py(), 0.0);
328  double ATBT = (jaT + jbT).Mag2();
329 
330  double MR = sqrt((A + B) * (A + B) - (az + bz) * (az + bz) -
331  (jbT.Dot(jbT) - jaT.Dot(jaT)) * (jbT.Dot(jbT) - jaT.Dot(jaT)) / (jaT + jbT).Mag2());
332  double mybeta = (jbT.Dot(jbT) - jaT.Dot(jaT)) / sqrt(ATBT * ((A + B) * (A + B) - (az + bz) * (az + bz)));
333 
334  double mygamma = 1. / sqrt(1. - mybeta * mybeta);
335 
336  //use gamma times MRstar
337  return MR * mygamma;
338 }
T sqrt(T t)
Definition: SSEVec.h:19
static const std::string B
double RazorMonitor::CalcR ( double  MR,
const math::XYZTLorentzVector ja,
const math::XYZTLorentzVector jb,
const edm::Handle< std::vector< reco::PFMET > > &  met 
)
static

Definition at line 340 of file RazorMonitor.cc.

References DEFINE_FWK_MODULE, dqmMemoryStats::float, BTaggingMonitor_cfi::met, and mathSSE::sqrt().

Referenced by analyze().

343  {
344  //now we can calculate MTR
345  const math::XYZVector met = (inputMet->front()).momentum();
346 
347  double MTR = sqrt(0.5 * (met.R() * (ja.Pt() + jb.Pt()) - met.Dot(ja.Vect() + jb.Vect())));
348 
349  //filter events
350  return float(MTR) / float(MR); //R
351 }
T sqrt(T t)
Definition: SSEVec.h:19
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:31
void RazorMonitor::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 267 of file RazorMonitor.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), SiStripSourceConfigTier0_cff::genericTriggerEventPSet, LumiMonitor_cff::histoPSet, HLT_2018_cff::InputTag, and AlCaHLTBitMon_QueryRunRegistry::string.

267  {
269  desc.add<std::string>("FolderName", "HLT/SUSY/Razor");
270 
271  desc.add<edm::InputTag>("met", edm::InputTag("pfMet"));
272  desc.add<edm::InputTag>("jets", edm::InputTag("ak4PFJetsCHS"));
273  desc.add<edm::InputTag>("hemispheres", edm::InputTag("hemispheresDQM"))
274  ->setComment("hemisphere jets used to compute razor variables");
275  desc.add<std::string>("metSelection", "pt > 0");
276 
277  // from 2016 offline selection
278  desc.add<std::string>("jetSelection", "pt > 80");
279  desc.add<unsigned int>("njets", 2);
280  desc.add<double>("mrCut", 300);
281  desc.add<double>("rsqCut", 0.15);
282 
284  genericTriggerEventPSet.add<bool>("andOr");
285  genericTriggerEventPSet.add<edm::InputTag>("dcsInputTag", edm::InputTag("scalersRawToDigi"));
286  genericTriggerEventPSet.add<std::vector<int> >("dcsPartitions", {});
287  genericTriggerEventPSet.add<bool>("andOrDcs", false);
288  genericTriggerEventPSet.add<bool>("errorReplyDcs", true);
289  genericTriggerEventPSet.add<std::string>("dbLabel", "");
290  genericTriggerEventPSet.add<bool>("andOrHlt", true);
291  genericTriggerEventPSet.add<edm::InputTag>("hltInputTag", edm::InputTag("TriggerResults::HLT"));
292  genericTriggerEventPSet.add<std::vector<std::string> >("hltPaths", {});
293  genericTriggerEventPSet.add<std::string>("hltDBKey", "");
294  genericTriggerEventPSet.add<bool>("errorReplyHlt", false);
295  genericTriggerEventPSet.add<unsigned int>("verbosityLevel", 1);
296 
297  desc.add<edm::ParameterSetDescription>("numGenericTriggerEventPSet", genericTriggerEventPSet);
298  desc.add<edm::ParameterSetDescription>("denGenericTriggerEventPSet", genericTriggerEventPSet);
299 
300  //binning from 2016 offline selection
302  std::vector<double> mrbins = {0., 100., 200., 300., 400., 500., 575., 650., 750., 900., 1200., 1600., 2500., 4000.};
303  histoPSet.add<std::vector<double> >("mrBins", mrbins);
304 
305  std::vector<double> rsqbins = {0., 0.05, 0.1, 0.15, 0.2, 0.25, 0.30, 0.41, 0.52, 0.64, 0.8, 1.5};
306  histoPSet.add<std::vector<double> >("rsqBins", rsqbins);
307 
308  std::vector<double> dphirbins = {0., 0.5, 1.0, 1.5, 2.0, 2.5, 2.8, 3.0, 3.2};
309  histoPSet.add<std::vector<double> >("dphiRBins", dphirbins);
310 
311  desc.add<edm::ParameterSetDescription>("histoPSet", histoPSet);
312 
313  descriptions.add("razorMonitoring", desc);
314 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void RazorMonitor::setMETitle ( RazorME me,
const std::string &  titleX,
const std::string &  titleY 
)
protected

Definition at line 53 of file RazorMonitor.cc.

References RazorME::denominator, RazorME::numerator, and dqm::impl::MonitorElement::setAxisTitle().

Referenced by bookHistograms().

53  {
54  me.numerator->setAxisTitle(titleX, 1);
55  me.numerator->setAxisTitle(titleY, 2);
56  me.denominator->setAxisTitle(titleX, 1);
57  me.denominator->setAxisTitle(titleY, 2);
58 }
dqm::reco::MonitorElement * numerator
Definition: RazorMonitor.h:50
dqm::reco::MonitorElement * denominator
Definition: RazorMonitor.h:51
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)

Member Data Documentation

std::unique_ptr<GenericTriggerEventFlag> RazorMonitor::den_genTriggerEventFlag_
private

Definition at line 130 of file RazorMonitor.h.

Referenced by analyze(), and bookHistograms().

std::vector<double> RazorMonitor::dphiR_binning_
private

Definition at line 122 of file RazorMonitor.h.

Referenced by bookHistograms().

RazorME RazorMonitor::dPhiR_ME_
private

Definition at line 126 of file RazorMonitor.h.

Referenced by analyze(), bookHistograms(), and RazorMonitor().

std::string RazorMonitor::folderName_
private

Definition at line 113 of file RazorMonitor.h.

Referenced by bookHistograms().

std::string RazorMonitor::histoSuffix_
private

Definition at line 114 of file RazorMonitor.h.

StringCutObjectSelector<reco::PFJet, true> RazorMonitor::jetSelection_
private

Definition at line 133 of file RazorMonitor.h.

Referenced by analyze().

edm::EDGetTokenT<reco::PFJetCollection> RazorMonitor::jetToken_
private

Definition at line 117 of file RazorMonitor.h.

Referenced by analyze().

StringCutObjectSelector<reco::MET, true> RazorMonitor::metSelection_
private

Definition at line 132 of file RazorMonitor.h.

Referenced by analyze().

edm::EDGetTokenT<reco::PFMETCollection> RazorMonitor::metToken_
private

Definition at line 116 of file RazorMonitor.h.

Referenced by analyze().

std::vector<double> RazorMonitor::mr_binning_
private

Definition at line 121 of file RazorMonitor.h.

Referenced by bookHistograms().

RazorME RazorMonitor::MR_ME_
private

Definition at line 124 of file RazorMonitor.h.

Referenced by analyze(), bookHistograms(), and RazorMonitor().

float RazorMonitor::mrCut_
private

Definition at line 136 of file RazorMonitor.h.

Referenced by analyze().

RazorME RazorMonitor::MRVsRsq_ME_
private

Definition at line 127 of file RazorMonitor.h.

Referenced by analyze(), bookHistograms(), and RazorMonitor().

unsigned int RazorMonitor::njets_
private

Definition at line 134 of file RazorMonitor.h.

Referenced by analyze().

std::unique_ptr<GenericTriggerEventFlag> RazorMonitor::num_genTriggerEventFlag_
private

Definition at line 129 of file RazorMonitor.h.

Referenced by analyze(), and bookHistograms().

std::vector<double> RazorMonitor::rsq_binning_
private

Definition at line 120 of file RazorMonitor.h.

Referenced by bookHistograms().

RazorME RazorMonitor::Rsq_ME_
private

Definition at line 125 of file RazorMonitor.h.

Referenced by analyze(), bookHistograms(), and RazorMonitor().

float RazorMonitor::rsqCut_
private

Definition at line 135 of file RazorMonitor.h.

Referenced by analyze().

edm::EDGetTokenT<std::vector<math::XYZTLorentzVector> > RazorMonitor::theHemispheres_
private

Definition at line 118 of file RazorMonitor.h.

Referenced by analyze(), and RazorMonitor().