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::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > > edm::stream::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

 RazorMonitor (const edm::ParameterSet &)
 
 ~RazorMonitor () override
 
- Public Member Functions inherited from DQMEDAnalyzer
virtual void beginRun (edm::Run const &, edm::EventSetup const &) final
 
virtual void beginStream (edm::StreamID id) final
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer (void)
 
virtual void endLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
virtual void endRunSummary (edm::Run const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
uint32_t streamId () const
 
- Public Member Functions inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
 EDAnalyzer ()=default
 
- Public Member Functions inherited from edm::stream::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDAnalyzerBase ()
 
- 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
 
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
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
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 DQMEDAnalyzer
static std::shared_ptr< dqmDetails::NoCacheglobalBeginLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *)
 
static std::shared_ptr< dqmDetails::NoCacheglobalBeginRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *)
 
static void globalEndLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *, dqmDetails::NoCache *)
 
static void globalEndRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *, dqmDetails::NoCache *)
 
- Static Public Member Functions inherited from edm::stream::EDAnalyzerBase
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::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)
 

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 edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDAnalyzerBase
typedef EDAnalyzerAdaptorBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 

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().

21  :
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") )
27  , dphiR_binning_ ( iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<std::vector<double> > ("dphiRBins") )
28  , num_genTriggerEventFlag_(new GenericTriggerEventFlag(iConfig.getParameter<edm::ParameterSet>("numGenericTriggerEventPSet"),consumesCollector(), *this))
29  , den_genTriggerEventFlag_(new GenericTriggerEventFlag(iConfig.getParameter<edm::ParameterSet>("denGenericTriggerEventPSet"),consumesCollector(), *this))
30  , metSelection_ ( iConfig.getParameter<std::string>("metSelection") )
31  , jetSelection_ ( iConfig.getParameter<std::string>("jetSelection") )
32  , njets_ ( iConfig.getParameter<unsigned int>("njets" ) )
33  , rsqCut_ ( iConfig.getParameter<double>("rsqCut" ) )
34  , mrCut_ ( iConfig.getParameter<double>("mrCut" ) )
35 {
36 
37  theHemispheres_ = consumes<std::vector<math::XYZTLorentzVector> >(iConfig.getParameter<edm::InputTag>("hemispheres"));
38 
39  MR_ME_.numerator = nullptr;
40  MR_ME_.denominator = nullptr;
41  Rsq_ME_.numerator = nullptr;
42  Rsq_ME_.denominator = nullptr;
43  dPhiR_ME_.numerator = nullptr;
44  dPhiR_ME_.denominator = nullptr;
45 
46  MRVsRsq_ME_.numerator = nullptr;
47  MRVsRsq_ME_.denominator = nullptr;
48 
49 }
T getParameter(std::string const &) const
edm::EDGetTokenT< reco::PFJetCollection > jetToken_
Definition: RazorMonitor.h:85
edm::EDGetTokenT< reco::PFMETCollection > metToken_
Definition: RazorMonitor.h:84
std::unique_ptr< GenericTriggerEventFlag > num_genTriggerEventFlag_
Definition: RazorMonitor.h:97
Provides a code based selection for trigger and DCS information in order to have no failing filters i...
MonitorElement * numerator
Definition: RazorMonitor.h:50
edm::EDGetTokenT< std::vector< math::XYZTLorentzVector > > theHemispheres_
Definition: RazorMonitor.h:86
unsigned int njets_
Definition: RazorMonitor.h:102
std::vector< double > mr_binning_
Definition: RazorMonitor.h:89
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
std::vector< double > dphiR_binning_
Definition: RazorMonitor.h:90
RazorME Rsq_ME_
Definition: RazorMonitor.h:93
RazorME dPhiR_ME_
Definition: RazorMonitor.h:94
std::vector< double > rsq_binning_
Definition: RazorMonitor.h:88
StringCutObjectSelector< reco::MET, true > metSelection_
Definition: RazorMonitor.h:100
RazorME MR_ME_
Definition: RazorMonitor.h:92
std::unique_ptr< GenericTriggerEventFlag > den_genTriggerEventFlag_
Definition: RazorMonitor.h:98
MonitorElement * denominator
Definition: RazorMonitor.h:51
RazorME MRVsRsq_ME_
Definition: RazorMonitor.h:95
std::string folderName_
Definition: RazorMonitor.h:81
StringCutObjectSelector< reco::PFJet, true > jetSelection_
Definition: RazorMonitor.h:101
RazorMonitor::~RazorMonitor ( )
overridedefault

Referenced by RazorMonitor().

Member Function Documentation

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

Implements edm::stream::EDAnalyzerBase.

Definition at line 136 of file RazorMonitor.cc.

References funct::abs(), CalcMR(), CalcR(), hiPixelPairStep_cff::deltaPhi, den_genTriggerEventFlag_, RazorME::denominator, dPhiR_ME_, HcalObjRepresent::Fill(), edm::Event::getByToken(), edm::HandleBase::isValid(), fwrapper::jets, jetSelection_, jetToken_, metSelection_, metToken_, MR_ME_, mrCut_, MRVsRsq_ME_, njets_, num_genTriggerEventFlag_, RazorME::numerator, dttmaxenums::R, Rsq_ME_, rsqCut_, and theHemispheres_.

136  {
137 
138  // Filter out events if Trigger Filtering is requested
139  if (den_genTriggerEventFlag_->on() && ! den_genTriggerEventFlag_->accept( iEvent, iSetup) ) return;
140 
141  //met collection
143  iEvent.getByToken( metToken_, metHandle );
144  reco::PFMET pfmet = metHandle->front();
145  if ( ! metSelection_( pfmet ) ) return;
146 
147  //jet collection, track # of jets for two working points
149  iEvent.getByToken( jetToken_, jetHandle );
150  std::vector<reco::PFJet> jets;
151  if ( jetHandle->size() < njets_ ) return;
152  for ( auto const & j : *jetHandle ) {
153  if ( jetSelection_( j ) ) jets.push_back(j);
154  }
155  if ( jets.size() < njets_ ) return;
156 
157  //razor hemisphere clustering from previous step
159  iEvent.getByToken (theHemispheres_,hemispheres);
160 
161  if (not hemispheres.isValid()){
162  return;
163  }
164 
165  if(hemispheres->size() ==0){ // the Hemisphere Maker will produce an empty collection of hemispheres if # of jets is too high
166  edm::LogError("DQM_HLT_Razor") << "Cannot calculate M_R and R^2 because there are too many jets! (trigger passed automatically without forming the hemispheres)" << endl;
167  return;
168  }
169 
170  // should always have 2 hemispheres -- no muons included (c. 2017), if not return invalid hemisphere collection
171  // retaining check for hemisphere size 5 or 10 which correspond to the one or two muon case for possible future use
172  if(hemispheres->size() != 0 && hemispheres->size() != 2 && hemispheres->size() != 5 && hemispheres->size() != 10){
173  edm::LogError("DQM_HLT_Razor") << "Invalid hemisphere collection! hemispheres->size() = " << hemispheres->size() << endl;
174  return;
175  }
176 
177  //calculate razor variables, with hemispheres pT-ordered
178  double MR = 0, R = 0;
179  if (hemispheres->at(1).Pt() > hemispheres->at(0).Pt()) {
180  MR = CalcMR(hemispheres->at(1),hemispheres->at(0));
181  R = CalcR(MR,hemispheres->at(1),hemispheres->at(0),metHandle);
182  }
183  else {
184  MR = CalcMR(hemispheres->at(0),hemispheres->at(1));
185  R = CalcR(MR,hemispheres->at(0),hemispheres->at(1),metHandle);
186  }
187 
188  double Rsq = R*R;
189  double dPhiR = abs(deltaPhi(hemispheres->at(0).Phi(), hemispheres->at(1).Phi()));
190 
191  //apply offline selection cuts
192  if (Rsq<rsqCut_ && MR<mrCut_) return;
193 
194  // applying selection for denominator
195  if (den_genTriggerEventFlag_->on() && ! den_genTriggerEventFlag_->accept( iEvent, iSetup) ) return;
196 
197  // filling histograms (denominator)
198  if (Rsq>=rsqCut_) {
199  MR_ME_.denominator -> Fill(MR);
200  }
201 
202  if (MR>=mrCut_) {
203  Rsq_ME_.denominator -> Fill(Rsq);
204  }
205 
206  dPhiR_ME_.denominator -> Fill(dPhiR);
207 
208  MRVsRsq_ME_.denominator -> Fill(MR, Rsq);
209 
210  // applying selection for numerator
211  if (num_genTriggerEventFlag_->on() && ! num_genTriggerEventFlag_->accept( iEvent, iSetup) ) return;
212 
213  // filling histograms (numerator)
214  if (Rsq>=rsqCut_) {
215  MR_ME_.numerator -> Fill(MR);
216  }
217 
218  if (MR>=mrCut_) {
219  Rsq_ME_.numerator -> Fill(Rsq);
220  }
221 
222  dPhiR_ME_.numerator -> Fill(dPhiR);
223 
224  MRVsRsq_ME_.numerator -> Fill(MR, Rsq);
225 
226 }
edm::EDGetTokenT< reco::PFJetCollection > jetToken_
Definition: RazorMonitor.h:85
edm::EDGetTokenT< reco::PFMETCollection > metToken_
Definition: RazorMonitor.h:84
std::unique_ptr< GenericTriggerEventFlag > num_genTriggerEventFlag_
Definition: RazorMonitor.h:97
static double CalcMR(const math::XYZTLorentzVector &ja, const math::XYZTLorentzVector &jb)
MonitorElement * numerator
Definition: RazorMonitor.h:50
edm::EDGetTokenT< std::vector< math::XYZTLorentzVector > > theHemispheres_
Definition: RazorMonitor.h:86
unsigned int njets_
Definition: RazorMonitor.h:102
int iEvent
Definition: GenABIO.cc:230
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
vector< PseudoJet > jets
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
bool isValid() const
Definition: HandleBase.h:74
RazorME Rsq_ME_
Definition: RazorMonitor.h:93
RazorME dPhiR_ME_
Definition: RazorMonitor.h:94
StringCutObjectSelector< reco::MET, true > metSelection_
Definition: RazorMonitor.h:100
RazorME MR_ME_
Definition: RazorMonitor.h:92
std::unique_ptr< GenericTriggerEventFlag > den_genTriggerEventFlag_
Definition: RazorMonitor.h:98
MonitorElement * denominator
Definition: RazorMonitor.h:51
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:95
StringCutObjectSelector< reco::PFJet, true > jetSelection_
Definition: RazorMonitor.h:101
void RazorMonitor::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  iRun,
edm::EventSetup const &  iSetup 
)
overrideprotectedvirtual

Implements DQMEDAnalyzer.

Definition at line 98 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_, DQMStore::IBooker::setCurrentFolder(), setMETitle(), and AlCaHLTBitMon_QueryRunRegistry::string.

101 {
102 
103  std::string histname, histtitle;
104 
105  std::string currentFolder = folderName_ ;
106  ibooker.setCurrentFolder(currentFolder.c_str());
107 
108  // 1D hist, MR
109  histname = "MR"; histtitle = "PF MR";
110  bookME(ibooker,MR_ME_,histname,histtitle,mr_binning_);
111  setMETitle(MR_ME_,"PF M_{R} [GeV]","events / [GeV]");
112 
113  // 1D hist, Rsq
114  histname = "Rsq"; histtitle = "PF Rsq";
115  bookME(ibooker,Rsq_ME_,histname,histtitle,rsq_binning_);
116  setMETitle(Rsq_ME_,"PF R^{2}","events");
117 
118  // 1D hist, dPhiR
119  histname = "dPhiR"; histtitle = "dPhiR";
120  bookME(ibooker,dPhiR_ME_,histname,histtitle,dphiR_binning_);
121  setMETitle(dPhiR_ME_,"dPhi_{R}","events");
122 
123  // 2D hist, MR & Rsq
124  histname = "MRVsRsq"; histtitle = "PF MR vs PF Rsq";
125  bookME(ibooker,MRVsRsq_ME_,histname,histtitle,mr_binning_, rsq_binning_);
126  setMETitle(MRVsRsq_ME_,"M_{R} [GeV]","R^{2}");
127 
128  // Initialize the GenericTriggerEventFlag
129  if ( num_genTriggerEventFlag_ && num_genTriggerEventFlag_->on() ) num_genTriggerEventFlag_->initRun( iRun, iSetup );
130  if ( den_genTriggerEventFlag_ && den_genTriggerEventFlag_->on() ) den_genTriggerEventFlag_->initRun( iRun, iSetup );
131 
132 }
void bookME(DQMStore::IBooker &, RazorME &me, const std::string &histname, const std::string &histtitle, int nbins, double xmin, double xmax)
Definition: RazorMonitor.cc:62
std::unique_ptr< GenericTriggerEventFlag > num_genTriggerEventFlag_
Definition: RazorMonitor.h:97
void setMETitle(RazorME &me, const std::string &titleX, const std::string &titleY)
Definition: RazorMonitor.cc:53
std::vector< double > mr_binning_
Definition: RazorMonitor.h:89
std::vector< double > dphiR_binning_
Definition: RazorMonitor.h:90
RazorME Rsq_ME_
Definition: RazorMonitor.h:93
RazorME dPhiR_ME_
Definition: RazorMonitor.h:94
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:277
std::vector< double > rsq_binning_
Definition: RazorMonitor.h:88
RazorME MR_ME_
Definition: RazorMonitor.h:92
std::unique_ptr< GenericTriggerEventFlag > den_genTriggerEventFlag_
Definition: RazorMonitor.h:98
RazorME MRVsRsq_ME_
Definition: RazorMonitor.h:95
std::string folderName_
Definition: RazorMonitor.h:81
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 62 of file RazorMonitor.cc.

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

Referenced by bookHistograms().

63 {
64  me.numerator = ibooker.book1D(histname+"_numerator", histtitle+" (numerator)", nbins, min, max);
65  me.denominator = ibooker.book1D(histname+"_denominator", histtitle+" (denominator)", nbins, min, max);
66 }
MonitorElement * numerator
Definition: RazorMonitor.h:50
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
T min(T a, T b)
Definition: MathUtil.h:58
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 67 of file RazorMonitor.cc.

References DQMStore::IBooker::book1D(), RazorME::denominator, pileupCalc::nbins, and RazorME::numerator.

68 {
69  int nbins = binning.size()-1;
70  std::vector<float> fbinning(binning.begin(),binning.end());
71  float* arr = &fbinning[0];
72  me.numerator = ibooker.book1D(histname+"_numerator", histtitle+" (numerator)", nbins, arr);
73  me.denominator = ibooker.book1D(histname+"_denominator", histtitle+" (denominator)", nbins, arr);
74 }
MonitorElement * numerator
Definition: RazorMonitor.h:50
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
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 75 of file RazorMonitor.cc.

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

76 {
77  me.numerator = ibooker.bookProfile(histname+"_numerator", histtitle+" (numerator)", nbinsX, xmin, xmax, ymin, ymax);
78  me.denominator = ibooker.bookProfile(histname+"_denominator", histtitle+" (denominator)", nbinsX, xmin, xmax, ymin, ymax);
79 }
MonitorElement * bookProfile(Args &&...args)
Definition: DQMStore.h:157
MonitorElement * numerator
Definition: RazorMonitor.h:50
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 80 of file RazorMonitor.cc.

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

81 {
82  me.numerator = ibooker.book2D(histname+"_numerator", histtitle+" (numerator)", nbinsX, xmin, xmax, nbinsY, ymin, ymax);
83  me.denominator = ibooker.book2D(histname+"_denominator", histtitle+" (denominator)", nbinsX, xmin, xmax, nbinsY, ymin, ymax);
84 }
MonitorElement * numerator
Definition: RazorMonitor.h:50
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:133
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 85 of file RazorMonitor.cc.

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

86 {
87  int nbinsX = binningX.size()-1;
88  std::vector<float> fbinningX(binningX.begin(),binningX.end());
89  float* arrX = &fbinningX[0];
90  int nbinsY = binningY.size()-1;
91  std::vector<float> fbinningY(binningY.begin(),binningY.end());
92  float* arrY = &fbinningY[0];
93 
94  me.numerator = ibooker.book2D(histname+"_numerator", histtitle+" (numerator)", nbinsX, arrX, nbinsY, arrY);
95  me.denominator = ibooker.book2D(histname+"_denominator", histtitle+" (denominator)", nbinsX, arrX, nbinsY, arrY);
96 }
MonitorElement * numerator
Definition: RazorMonitor.h:50
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:133
MonitorElement * denominator
Definition: RazorMonitor.h:51
double RazorMonitor::CalcMR ( const math::XYZTLorentzVector ja,
const math::XYZTLorentzVector jb 
)
static

Definition at line 278 of file RazorMonitor.cc.

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

Referenced by analyze().

278  {
279  if(ja.Pt()<=0.1) return -1;
280 
281  double A = ja.P();
282  double B = jb.P();
283  double az = ja.Pz();
284  double bz = jb.Pz();
285  TVector3 jaT, jbT;
286  jaT.SetXYZ(ja.Px(),ja.Py(),0.0);
287  jbT.SetXYZ(jb.Px(),jb.Py(),0.0);
288  double ATBT = (jaT+jbT).Mag2();
289 
290  double MR = sqrt((A+B)*(A+B)-(az+bz)*(az+bz)-
291  (jbT.Dot(jbT)-jaT.Dot(jaT))*(jbT.Dot(jbT)-jaT.Dot(jaT))/(jaT+jbT).Mag2());
292  double mybeta = (jbT.Dot(jbT)-jaT.Dot(jaT))/
293  sqrt(ATBT*((A+B)*(A+B)-(az+bz)*(az+bz)));
294 
295  double mygamma = 1./sqrt(1.-mybeta*mybeta);
296 
297  //use gamma times MRstar
298  return MR*mygamma;
299 }
T sqrt(T t)
Definition: SSEVec.h:18
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 301 of file RazorMonitor.cc.

References DEFINE_FWK_MODULE, objects.autophobj::float, RazorAnalyzer::met, and mathSSE::sqrt().

Referenced by analyze().

301  {
302 
303  //now we can calculate MTR
304  const math::XYZVector met = (inputMet->front()).momentum();
305 
306  double MTR = sqrt(0.5*(met.R()*(ja.Pt()+jb.Pt()) - met.Dot(ja.Vect()+jb.Vect())));
307 
308  //filter events
309  return float(MTR)/float(MR); //R
310 }
T sqrt(T t)
Definition: SSEVec.h:18
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:30
void RazorMonitor::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 228 of file RazorMonitor.cc.

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

229 {
231  desc.add<std::string> ( "FolderName", "HLT/SUSY/Razor" );
232 
233  desc.add<edm::InputTag>( "met", edm::InputTag("pfMet") );
234  desc.add<edm::InputTag>( "jets", edm::InputTag("ak4PFJetsCHS") );
235  desc.add<edm::InputTag>("hemispheres",edm::InputTag("hemispheresDQM"))->setComment("hemisphere jets used to compute razor variables");
236  desc.add<std::string>("metSelection", "pt > 0");
237 
238  // from 2016 offline selection
239  desc.add<std::string>("jetSelection", "pt > 80");
240  desc.add<unsigned int>("njets", 2);
241  desc.add<double>("mrCut", 300);
242  desc.add<double>("rsqCut", 0.15);
243 
244  edm::ParameterSetDescription genericTriggerEventPSet;
245  genericTriggerEventPSet.add<bool>("andOr");
246  genericTriggerEventPSet.add<edm::InputTag>("dcsInputTag", edm::InputTag("scalersRawToDigi") );
247  genericTriggerEventPSet.add<std::vector<int> >("dcsPartitions",{});
248  genericTriggerEventPSet.add<bool>("andOrDcs", false);
249  genericTriggerEventPSet.add<bool>("errorReplyDcs", true);
250  genericTriggerEventPSet.add<std::string>("dbLabel","");
251  genericTriggerEventPSet.add<bool>("andOrHlt", true);
252  genericTriggerEventPSet.add<edm::InputTag>("hltInputTag", edm::InputTag("TriggerResults::HLT") );
253  genericTriggerEventPSet.add<std::vector<std::string> >("hltPaths",{});
254  genericTriggerEventPSet.add<std::string>("hltDBKey","");
255  genericTriggerEventPSet.add<bool>("errorReplyHlt",false);
256  genericTriggerEventPSet.add<unsigned int>("verbosityLevel",1);
257 
258  desc.add<edm::ParameterSetDescription>("numGenericTriggerEventPSet", genericTriggerEventPSet);
259  desc.add<edm::ParameterSetDescription>("denGenericTriggerEventPSet", genericTriggerEventPSet);
260 
261  //binning from 2016 offline selection
263  std::vector<double> mrbins = {0., 100., 200., 300., 400., 500., 575., 650., 750., 900., 1200., 1600., 2500., 4000.};
264  histoPSet.add<std::vector<double> >("mrBins", mrbins);
265 
266  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};
267  histoPSet.add<std::vector<double> >("rsqBins", rsqbins);
268 
269  std::vector<double> dphirbins = {0., 0.5, 1.0, 1.5, 2.0, 2.5, 2.8, 3.0, 3.2};
270  histoPSet.add<std::vector<double> >("dphiRBins", dphirbins);
271 
272  desc.add<edm::ParameterSetDescription>("histoPSet",histoPSet);
273 
274  descriptions.add("razorMonitoring", desc);
275 }
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 MonitorElement::setAxisTitle().

Referenced by bookHistograms().

54 {
55  me.numerator->setAxisTitle(titleX,1);
56  me.numerator->setAxisTitle(titleY,2);
57  me.denominator->setAxisTitle(titleX,1);
58  me.denominator->setAxisTitle(titleY,2);
59 
60 }
MonitorElement * numerator
Definition: RazorMonitor.h:50
MonitorElement * denominator
Definition: RazorMonitor.h:51
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 98 of file RazorMonitor.h.

Referenced by analyze(), and bookHistograms().

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

Definition at line 90 of file RazorMonitor.h.

Referenced by bookHistograms().

RazorME RazorMonitor::dPhiR_ME_
private

Definition at line 94 of file RazorMonitor.h.

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

std::string RazorMonitor::folderName_
private

Definition at line 81 of file RazorMonitor.h.

Referenced by bookHistograms().

std::string RazorMonitor::histoSuffix_
private

Definition at line 82 of file RazorMonitor.h.

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

Definition at line 101 of file RazorMonitor.h.

Referenced by analyze().

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

Definition at line 85 of file RazorMonitor.h.

Referenced by analyze().

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

Definition at line 100 of file RazorMonitor.h.

Referenced by analyze().

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

Definition at line 84 of file RazorMonitor.h.

Referenced by analyze().

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

Definition at line 89 of file RazorMonitor.h.

Referenced by bookHistograms().

RazorME RazorMonitor::MR_ME_
private

Definition at line 92 of file RazorMonitor.h.

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

float RazorMonitor::mrCut_
private

Definition at line 104 of file RazorMonitor.h.

Referenced by analyze().

RazorME RazorMonitor::MRVsRsq_ME_
private

Definition at line 95 of file RazorMonitor.h.

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

unsigned int RazorMonitor::njets_
private

Definition at line 102 of file RazorMonitor.h.

Referenced by analyze().

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

Definition at line 97 of file RazorMonitor.h.

Referenced by analyze(), and bookHistograms().

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

Definition at line 88 of file RazorMonitor.h.

Referenced by bookHistograms().

RazorME RazorMonitor::Rsq_ME_
private

Definition at line 93 of file RazorMonitor.h.

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

float RazorMonitor::rsqCut_
private

Definition at line 103 of file RazorMonitor.h.

Referenced by analyze().

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

Definition at line 86 of file RazorMonitor.h.

Referenced by analyze(), and RazorMonitor().