CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
DiMuonHistograms Class Reference

#include <DiMuonHistograms.h>

Inheritance diagram for DiMuonHistograms:
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

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
 DiMuonHistograms (const edm::ParameterSet &pset)
 
 ~DiMuonHistograms () override
 
- Public Member Functions inherited from DQMEDAnalyzer
void accumulate (edm::Event const &event, edm::EventSetup const &setup) final
 
virtual void analyze (edm::Event const &, edm::EventSetup const &)
 
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)
 

Private Attributes

int etaBBin
 
int etaBin
 
double etaBMax
 
double etaBMin
 
double EtaCutMax
 
double EtaCutMin
 
int etaEBin
 
double etaECMax
 
double etaECMin
 
std::string EtaName [3]
 
int etaOvlpBin
 
std::vector< MonitorElement * > GlbGlbMuon_HM
 
std::vector< MonitorElement * > GlbGlbMuon_LM
 
double HighMassMax
 
double HighMassMin
 
std::vector< MonitorElement * > LooseLooseMuon
 
std::vector< MonitorElement * > LooseLooseMuonBadFrac
 
double LowMassMax
 
double LowMassMin
 
std::vector< MonitorElement * > MediumMediumMuon
 
std::vector< MonitorElement * > MediumMediumMuonBadFrac
 
std::string metname
 
int nGlbGlb
 
int nLooseLoose
 
int nMediumMedium
 
int nTightTight
 
edm::ParameterSet parameters
 
std::vector< MonitorElement * > SoftSoftMuon
 
std::vector< MonitorElement * > SoftSoftMuonBadFrac
 
std::vector< MonitorElement * > StaTrkMuon_HM
 
std::vector< MonitorElement * > StaTrkMuon_LM
 
MonitorElementtest
 
edm::EDGetTokenT< reco::BeamSpottheBeamSpotLabel_
 
std::string theFolder
 
edm::EDGetTokenT< edm::View< reco::Muon > > theMuonCollectionLabel_
 
MuonServiceProxytheService
 
edm::EDGetTokenT< reco::VertexCollectiontheVertexLabel_
 
std::vector< MonitorElement * > TightTightMuon
 
std::vector< MonitorElement * > TightTightMuonBadFrac
 
std::vector< MonitorElement * > TrkTrkMuon_HM
 
std::vector< MonitorElement * > TrkTrkMuon_LM
 

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
 
- 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 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)
 
- Protected Attributes inherited from DQMEDAnalyzer
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 

Detailed Description

Class DiMuonHistograms

DQM monitoring for dimuon mass

Author: S.Folgueras, U. Oviedo

Definition at line 31 of file DiMuonHistograms.h.

Constructor & Destructor Documentation

DiMuonHistograms::DiMuonHistograms ( const edm::ParameterSet pset)

Definition at line 31 of file DiMuonHistograms.cc.

References DQMOfflineHeavyIons_cff::etaBBin, muonRecoAnalyzer_cfi::etaBin, diMuonHistograms_cfi::etaBMax, diMuonHistograms_cfi::etaBMin, DQMOfflineHeavyIons_cff::etaEBin, diMuonHistograms_cfi::etaECMax, diMuonHistograms_cfi::etaECMin, DQMOfflineHeavyIons_cff::HighMassMax, DQMOfflineHeavyIons_cff::HighMassMin, DQMOfflineHeavyIons_cff::LowMassMax, and DQMOfflineHeavyIons_cff::LowMassMin.

31  {
32  // initialise parameters:
33  parameters = pSet;
34 
35  // counter
36  nTightTight = 0;
37  nMediumMedium = 0;
38  nLooseLoose = 0;
39  nGlbGlb = 0;
40 
41  // declare consumes:
42  theMuonCollectionLabel_ = consumes<edm::View<reco::Muon> >(parameters.getParameter<edm::InputTag>("MuonCollection"));
43  theVertexLabel_ = consumes<reco::VertexCollection>(parameters.getParameter<edm::InputTag>("VertexLabel"));
44 
45  theBeamSpotLabel_ = mayConsume<reco::BeamSpot>(parameters.getParameter<edm::InputTag>("BeamSpotLabel"));
46 
47  etaBin = parameters.getParameter<int>("etaBin");
48  etaBBin = parameters.getParameter<int>("etaBBin");
49  etaEBin = parameters.getParameter<int>("etaEBin");
50 
51  etaBMin = parameters.getParameter<double>("etaBMin");
52  etaBMax = parameters.getParameter<double>("etaBMax");
53  etaECMin = parameters.getParameter<double>("etaECMin");
54  etaECMax = parameters.getParameter<double>("etaECMax");
55 
56  LowMassMin = parameters.getParameter<double>("LowMassMin");
57  LowMassMax = parameters.getParameter<double>("LowMassMax");
58  HighMassMin = parameters.getParameter<double>("HighMassMin");
59  HighMassMax = parameters.getParameter<double>("HighMassMax");
60 
61  theFolder = parameters.getParameter<string>("folder");
62 }
edm::EDGetTokenT< edm::View< reco::Muon > > theMuonCollectionLabel_
edm::EDGetTokenT< reco::BeamSpot > theBeamSpotLabel_
edm::EDGetTokenT< reco::VertexCollection > theVertexLabel_
std::string theFolder
DiMuonHistograms::~DiMuonHistograms ( )
override

Definition at line 64 of file DiMuonHistograms.cc.

64 {}

Member Function Documentation

void DiMuonHistograms::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
override

Definition at line 142 of file DiMuonHistograms.cc.

References reco::BeamSpot::BeamWidthX(), reco::BeamSpot::BeamWidthY(), ALCARECOTkAlJpsiMuMu_cff::charge, relativeConstraints::error, diMuonHistograms_cfi::etaBMax, diMuonHistograms_cfi::etaBMin, diMuonHistograms_cfi::etaECMax, diMuonHistograms_cfi::etaECMin, edm::Event::getByToken(), DQMOfflineHeavyIons_cff::HighMassMin, muon::isLooseMuon(), muon::isMediumMuon(), muon::isSoftMuon(), muon::isTightMuon(), edm::HandleBase::isValid(), LogTrace, DQMOfflineHeavyIons_cff::LowMassMax, metname, PDWG_BPHSkim_cff::muons, reco::BeamSpot::position(), position, reco::BeamSpot::sigmaZ(), bphysicsOniaDQM_cfi::vertex, and badGlobalMuonTaggersAOD_cff::vtx.

142  {
143  LogTrace(metname) << "[DiMuonHistograms] Analyze the mu in different eta regions";
145  iEvent.getByToken(theMuonCollectionLabel_, muons);
146 
147  // =================================================================================
148  // Look for the Primary Vertex (and use the BeamSpot instead, if you can't find it):
149  reco::Vertex::Point posVtx;
150  reco::Vertex::Error errVtx;
151  unsigned int theIndexOfThePrimaryVertex = 999.;
152 
154  iEvent.getByToken(theVertexLabel_, vertex);
155  if (vertex.isValid()) {
156  for (unsigned int ind = 0; ind < vertex->size(); ++ind) {
157  if ((*vertex)[ind].isValid() && !((*vertex)[ind].isFake())) {
158  theIndexOfThePrimaryVertex = ind;
159  break;
160  }
161  }
162  }
163 
164  if (theIndexOfThePrimaryVertex < 100) {
165  posVtx = ((*vertex)[theIndexOfThePrimaryVertex]).position();
166  errVtx = ((*vertex)[theIndexOfThePrimaryVertex]).error();
167  } else {
168  LogInfo("RecoMuonValidator") << "reco::PrimaryVertex not found, use BeamSpot position instead\n";
169 
170  edm::Handle<reco::BeamSpot> recoBeamSpotHandle;
171  iEvent.getByToken(theBeamSpotLabel_, recoBeamSpotHandle);
172  reco::BeamSpot bs = *recoBeamSpotHandle;
173 
174  posVtx = bs.position();
175  errVtx(0, 0) = bs.BeamWidthX();
176  errVtx(1, 1) = bs.BeamWidthY();
177  errVtx(2, 2) = bs.sigmaZ();
178  }
179 
180  const reco::Vertex vtx(posVtx, errVtx);
181 
182  if (!muons.isValid())
183  return;
184 
185  // Loop on muon collection
186  TLorentzVector Mu1, Mu2;
187  float charge = 99.;
188  float InvMass = -99.;
189 
190  //Eta regions
191  double EtaCutMin[] = {0, etaBMin, etaECMin};
192  double EtaCutMax[] = {2.4, etaBMax, etaECMax};
193 
194  for (edm::View<reco::Muon>::const_iterator muon1 = muons->begin(); muon1 != muons->end(); ++muon1) {
195  LogTrace(metname) << "[DiMuonHistograms] loop over 1st muon" << endl;
196 
197  // Loop on second muons to fill invariant mass plots
198  for (edm::View<reco::Muon>::const_iterator muon2 = muon1; muon2 != muons->end(); ++muon2) {
199  LogTrace(metname) << "[DiMuonHistograms] loop over 2nd muon" << endl;
200  if (muon1 == muon2)
201  continue;
202 
203  // Global-Global Muon
204  if (muon1->isGlobalMuon() && muon2->isGlobalMuon()) {
205  LogTrace(metname) << "[DiMuonHistograms] Glb-Glb pair" << endl;
206  reco::TrackRef recoCombinedGlbTrack1 = muon1->combinedMuon();
207  reco::TrackRef recoCombinedGlbTrack2 = muon2->combinedMuon();
208  Mu1.SetPxPyPzE(recoCombinedGlbTrack1->px(),
209  recoCombinedGlbTrack1->py(),
210  recoCombinedGlbTrack1->pz(),
211  recoCombinedGlbTrack1->p());
212  Mu2.SetPxPyPzE(recoCombinedGlbTrack2->px(),
213  recoCombinedGlbTrack2->py(),
214  recoCombinedGlbTrack2->pz(),
215  recoCombinedGlbTrack2->p());
216 
217  charge = recoCombinedGlbTrack1->charge() * recoCombinedGlbTrack2->charge();
218  if (charge < 0) {
219  InvMass = (Mu1 + Mu2).M();
220  for (unsigned int iEtaRegion = 0; iEtaRegion < 3; iEtaRegion++) {
221  if (fabs(recoCombinedGlbTrack1->eta()) > EtaCutMin[iEtaRegion] &&
222  fabs(recoCombinedGlbTrack1->eta()) < EtaCutMax[iEtaRegion] &&
223  fabs(recoCombinedGlbTrack2->eta()) > EtaCutMin[iEtaRegion] &&
224  fabs(recoCombinedGlbTrack2->eta()) < EtaCutMax[iEtaRegion]) {
225  if (InvMass < LowMassMax)
226  GlbGlbMuon_LM[iEtaRegion]->Fill(InvMass);
227  if (InvMass > HighMassMin)
228  GlbGlbMuon_HM[iEtaRegion]->Fill(InvMass);
229  }
230  }
231  }
232  // Also Tight-Tight Muon Selection
233  if (muon::isTightMuon(*muon1, vtx) && muon::isTightMuon(*muon2, vtx)) {
234  test->Fill(InvMass);
235  LogTrace(metname) << "[DiMuonHistograms] Tight-Tight pair" << endl;
236  if (charge < 0) {
237  for (unsigned int iEtaRegion = 0; iEtaRegion < 3; iEtaRegion++) {
238  if (fabs(recoCombinedGlbTrack1->eta()) > EtaCutMin[iEtaRegion] &&
239  fabs(recoCombinedGlbTrack1->eta()) < EtaCutMax[iEtaRegion] &&
240  fabs(recoCombinedGlbTrack2->eta()) > EtaCutMin[iEtaRegion] &&
241  fabs(recoCombinedGlbTrack2->eta()) < EtaCutMax[iEtaRegion]) {
242  if (InvMass > 55. && InvMass < 125.) {
243  TightTightMuon[iEtaRegion]->Fill(InvMass);
244  TightTightMuonBadFrac[iEtaRegion]->Fill(muon1->innerTrack()->lost() / muon1->innerTrack()->found());
245  }
246  }
247  }
248  }
249  }
250  // Also Medium-Medium Muon Selection
251  if (muon::isMediumMuon(*muon1) && muon::isMediumMuon(*muon2)) {
252  test->Fill(InvMass);
253  LogTrace(metname) << "[DiMuonHistograms] Medium-Medium pair" << endl;
254  if (charge < 0) {
255  for (unsigned int iEtaRegion = 0; iEtaRegion < 3; iEtaRegion++) {
256  if (fabs(recoCombinedGlbTrack1->eta()) > EtaCutMin[iEtaRegion] &&
257  fabs(recoCombinedGlbTrack1->eta()) < EtaCutMax[iEtaRegion] &&
258  fabs(recoCombinedGlbTrack2->eta()) > EtaCutMin[iEtaRegion] &&
259  fabs(recoCombinedGlbTrack2->eta()) < EtaCutMax[iEtaRegion]) {
260  if (InvMass > 55. && InvMass < 125.) {
261  MediumMediumMuon[iEtaRegion]->Fill(InvMass);
262  MediumMediumMuonBadFrac[iEtaRegion]->Fill(muon1->innerTrack()->lost() / muon1->innerTrack()->found());
263  }
264  }
265  }
266  }
267  }
268  // Also Loose-Loose Muon Selection
269  if (muon::isLooseMuon(*muon1) && muon::isLooseMuon(*muon2)) {
270  test->Fill(InvMass);
271  LogTrace(metname) << "[DiMuonHistograms] Loose-Loose pair" << endl;
272  if (charge < 0) {
273  for (unsigned int iEtaRegion = 0; iEtaRegion < 3; iEtaRegion++) {
274  if (fabs(recoCombinedGlbTrack1->eta()) > EtaCutMin[iEtaRegion] &&
275  fabs(recoCombinedGlbTrack1->eta()) < EtaCutMax[iEtaRegion] &&
276  fabs(recoCombinedGlbTrack2->eta()) > EtaCutMin[iEtaRegion] &&
277  fabs(recoCombinedGlbTrack2->eta()) < EtaCutMax[iEtaRegion]) {
278  if (InvMass > 55. && InvMass < 125.) {
279  LooseLooseMuon[iEtaRegion]->Fill(InvMass);
280  LooseLooseMuonBadFrac[iEtaRegion]->Fill(muon1->innerTrack()->lost() / muon1->innerTrack()->found());
281  }
282  }
283  }
284  }
285  }
286  }
287 
288  // Now check for STA-TRK
289  if (muon2->isStandAloneMuon() && muon1->isTrackerMuon()) {
290  LogTrace(metname) << "[DiMuonHistograms] STA-Trk pair" << endl;
291  reco::TrackRef recoStaTrack = muon2->standAloneMuon();
292  reco::TrackRef recoTrack = muon1->track();
293  Mu2.SetPxPyPzE(recoStaTrack->px(), recoStaTrack->py(), recoStaTrack->pz(), recoStaTrack->p());
294  Mu1.SetPxPyPzE(recoTrack->px(), recoTrack->py(), recoTrack->pz(), recoTrack->p());
295 
296  charge = recoStaTrack->charge() * recoTrack->charge();
297  if (charge < 0) {
298  InvMass = (Mu1 + Mu2).M();
299  for (unsigned int iEtaRegion = 0; iEtaRegion < 3; iEtaRegion++) {
300  if (fabs(recoStaTrack->eta()) > EtaCutMin[iEtaRegion] &&
301  fabs(recoStaTrack->eta()) < EtaCutMax[iEtaRegion] && fabs(recoTrack->eta()) > EtaCutMin[iEtaRegion] &&
302  fabs(recoTrack->eta()) < EtaCutMax[iEtaRegion]) {
303  if (InvMass < LowMassMax)
304  StaTrkMuon_LM[iEtaRegion]->Fill(InvMass);
305  if (InvMass > HighMassMin)
306  StaTrkMuon_HM[iEtaRegion]->Fill(InvMass);
307  }
308  }
309  }
310  }
311  if (muon1->isStandAloneMuon() && muon2->isTrackerMuon()) {
312  LogTrace(metname) << "[DiMuonHistograms] STA-Trk pair" << endl;
313  reco::TrackRef recoStaTrack = muon1->standAloneMuon();
314  reco::TrackRef recoTrack = muon2->track();
315  Mu1.SetPxPyPzE(recoStaTrack->px(), recoStaTrack->py(), recoStaTrack->pz(), recoStaTrack->p());
316  Mu2.SetPxPyPzE(recoTrack->px(), recoTrack->py(), recoTrack->pz(), recoTrack->p());
317 
318  charge = recoStaTrack->charge() * recoTrack->charge();
319  if (charge < 0) {
320  InvMass = (Mu1 + Mu2).M();
321  for (unsigned int iEtaRegion = 0; iEtaRegion < 3; iEtaRegion++) {
322  if (fabs(recoStaTrack->eta()) > EtaCutMin[iEtaRegion] &&
323  fabs(recoStaTrack->eta()) < EtaCutMax[iEtaRegion] && fabs(recoTrack->eta()) > EtaCutMin[iEtaRegion] &&
324  fabs(recoTrack->eta()) < EtaCutMax[iEtaRegion]) {
325  if (InvMass < LowMassMax)
326  StaTrkMuon_LM[iEtaRegion]->Fill(InvMass);
327  if (InvMass > HighMassMin)
328  StaTrkMuon_HM[iEtaRegion]->Fill(InvMass);
329  }
330  }
331  }
332  }
333 
334  // TRK-TRK dimuon
335  if (muon1->isTrackerMuon() && muon2->isTrackerMuon()) {
336  LogTrace(metname) << "[DiMuonHistograms] Trk-Trk dimuon pair" << endl;
337  reco::TrackRef recoTrack2 = muon2->track();
338  reco::TrackRef recoTrack1 = muon1->track();
339  Mu2.SetPxPyPzE(recoTrack2->px(), recoTrack2->py(), recoTrack2->pz(), recoTrack2->p());
340  Mu1.SetPxPyPzE(recoTrack1->px(), recoTrack1->py(), recoTrack1->pz(), recoTrack1->p());
341 
342  charge = recoTrack1->charge() * recoTrack2->charge();
343  if (charge < 0) {
344  InvMass = (Mu1 + Mu2).M();
345  for (unsigned int iEtaRegion = 0; iEtaRegion < 3; iEtaRegion++) {
346  if (fabs(recoTrack1->eta()) > EtaCutMin[iEtaRegion] && fabs(recoTrack1->eta()) < EtaCutMax[iEtaRegion] &&
347  fabs(recoTrack2->eta()) > EtaCutMin[iEtaRegion] && fabs(recoTrack2->eta()) < EtaCutMax[iEtaRegion]) {
348  if (InvMass < LowMassMax)
349  TrkTrkMuon_LM[iEtaRegion]->Fill(InvMass);
350  if (InvMass > HighMassMin)
351  TrkTrkMuon_HM[iEtaRegion]->Fill(InvMass);
352  }
353  }
354  }
355 
356  LogTrace(metname) << "[DiMuonHistograms] Soft-Soft pair" << endl;
357 
358  if (muon::isSoftMuon(*muon1, vtx) && muon::isSoftMuon(*muon2, vtx)) {
359  if (charge < 0) {
360  InvMass = (Mu1 + Mu2).M();
361  for (unsigned int iEtaRegion = 0; iEtaRegion < 3; iEtaRegion++) {
362  if (fabs(recoTrack1->eta()) > EtaCutMin[iEtaRegion] && fabs(recoTrack1->eta()) < EtaCutMax[iEtaRegion] &&
363  fabs(recoTrack2->eta()) > EtaCutMin[iEtaRegion] && fabs(recoTrack2->eta()) < EtaCutMax[iEtaRegion]) {
364  SoftSoftMuon[iEtaRegion]->Fill(InvMass);
365  SoftSoftMuonBadFrac[iEtaRegion]->Fill(muon1->innerTrack()->lost() / muon1->innerTrack()->found());
366  }
367  }
368  }
369  }
370  }
371  } //muon2
372  } //Muon1
373 }
std::string metname
std::vector< MonitorElement * > MediumMediumMuon
bool isMediumMuon(const reco::Muon &, bool run2016_hip_mitigation=false)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:525
std::vector< MonitorElement * > MediumMediumMuonBadFrac
std::vector< MonitorElement * > GlbGlbMuon_LM
std::vector< MonitorElement * > TightTightMuonBadFrac
math::Error< dimension >::type Error
covariance error matrix (3x3)
Definition: Vertex.h:43
bool isLooseMuon(const reco::Muon &)
edm::EDGetTokenT< edm::View< reco::Muon > > theMuonCollectionLabel_
edm::EDGetTokenT< reco::BeamSpot > theBeamSpotLabel_
std::vector< MonitorElement * > LooseLooseMuonBadFrac
std::vector< MonitorElement * > SoftSoftMuon
math::XYZPoint Point
point in the space
Definition: Vertex.h:39
double BeamWidthX() const
beam width X
Definition: BeamSpot.h:82
std::vector< MonitorElement * > TrkTrkMuon_LM
std::vector< MonitorElement * > StaTrkMuon_LM
edm::EDGetTokenT< reco::VertexCollection > theVertexLabel_
bool isSoftMuon(const reco::Muon &, const reco::Vertex &, bool run2016_hip_mitigation=false)
bool isValid() const
Definition: HandleBase.h:70
#define LogTrace(id)
std::vector< MonitorElement * > SoftSoftMuonBadFrac
std::vector< MonitorElement * > TrkTrkMuon_HM
double sigmaZ() const
sigma z
Definition: BeamSpot.h:76
double BeamWidthY() const
beam width Y
Definition: BeamSpot.h:84
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:86
static int position[264][3]
Definition: ReadPGInfo.cc:289
std::vector< MonitorElement * > StaTrkMuon_HM
std::vector< MonitorElement * > GlbGlbMuon_HM
const Point & position() const
position
Definition: BeamSpot.h:59
std::vector< MonitorElement * > TightTightMuon
bool isTightMuon(const reco::Muon &, const reco::Vertex &)
std::vector< MonitorElement * > LooseLooseMuon
void DiMuonHistograms::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  ,
edm::EventSetup const &   
)
overridevirtual

Implements DQMEDAnalyzer.

Definition at line 66 of file DiMuonHistograms.cc.

References dqm::dqmstoreimpl::DQMStore::IBooker::book1D(), dqm::dqmstoreimpl::DQMStore::IBooker::cd(), DQMOfflineHeavyIons_cff::etaBBin, muonRecoAnalyzer_cfi::etaBin, DQMOfflineHeavyIons_cff::etaEBin, DQMOfflineHeavyIons_cff::HighMassMax, DQMOfflineHeavyIons_cff::HighMassMin, DQMOfflineHeavyIons_cff::LowMassMax, DQMOfflineHeavyIons_cff::LowMassMin, PFElectronDQMAnalyzer_cfi::nBin, and dqm::dqmstoreimpl::DQMStore::IBooker::setCurrentFolder().

68  {
69  ibooker.cd();
70  ibooker.setCurrentFolder(theFolder);
71 
72  int nBin[3] = {etaBin, etaBBin, etaEBin};
73  EtaName[0] = "";
74  EtaName[1] = "_Barrel";
75  EtaName[2] = "_EndCap";
76  test = ibooker.book1D("test", "InvMass_{Tight,Tight}", 100, 0., 200.);
77  for (unsigned int iEtaRegion = 0; iEtaRegion < 3; iEtaRegion++) {
78  GlbGlbMuon_LM.push_back(ibooker.book1D("GlbGlbMuon_LM" + EtaName[iEtaRegion],
79  "InvMass_{GLB,GLB}" + EtaName[iEtaRegion],
80  nBin[iEtaRegion],
81  LowMassMin,
82  LowMassMax));
83  TrkTrkMuon_LM.push_back(ibooker.book1D("TrkTrkMuon_LM" + EtaName[iEtaRegion],
84  "InvMass_{TRK,TRK}" + EtaName[iEtaRegion],
85  nBin[iEtaRegion],
86  LowMassMin,
87  LowMassMax));
88  StaTrkMuon_LM.push_back(ibooker.book1D("StaTrkMuon_LM" + EtaName[iEtaRegion],
89  "InvMass_{STA,TRK}" + EtaName[iEtaRegion],
90  nBin[iEtaRegion],
91  LowMassMin,
92  LowMassMax));
93 
94  GlbGlbMuon_HM.push_back(ibooker.book1D("GlbGlbMuon_HM" + EtaName[iEtaRegion],
95  "InvMass_{GLB,GLB}" + EtaName[iEtaRegion],
96  nBin[iEtaRegion],
98  HighMassMax));
99  TrkTrkMuon_HM.push_back(ibooker.book1D("TrkTrkMuon_HM" + EtaName[iEtaRegion],
100  "InvMass_{TRK,TRK}" + EtaName[iEtaRegion],
101  nBin[iEtaRegion],
102  HighMassMin,
103  HighMassMax));
104  StaTrkMuon_HM.push_back(ibooker.book1D("StaTrkMuon_HM" + EtaName[iEtaRegion],
105  "InvMass_{STA,TRK}" + EtaName[iEtaRegion],
106  nBin[iEtaRegion],
107  HighMassMin,
108  HighMassMax));
109 
110  // arround the Z peak
111  TightTightMuon.push_back(ibooker.book1D("TightTightMuon" + EtaName[iEtaRegion],
112  "InvMass_{Tight,Tight}" + EtaName[iEtaRegion],
113  nBin[iEtaRegion],
114  LowMassMin,
115  LowMassMax));
116  MediumMediumMuon.push_back(ibooker.book1D("MediumMediumMuon" + EtaName[iEtaRegion],
117  "InvMass_{Medium,Medium}" + EtaName[iEtaRegion],
118  nBin[iEtaRegion],
119  LowMassMin,
120  LowMassMax));
121  LooseLooseMuon.push_back(ibooker.book1D("LooseLooseMuon" + EtaName[iEtaRegion],
122  "InvMass_{Loose,Loose}" + EtaName[iEtaRegion],
123  nBin[iEtaRegion],
124  LowMassMin,
125  LowMassMax));
126  //Fraction of bad hits in the tracker track to the total
127  TightTightMuonBadFrac.push_back(ibooker.book1D(
128  "TightTightMuonBadFrac" + EtaName[iEtaRegion], "BadFrac_{Tight,Tight}" + EtaName[iEtaRegion], 10, 0, 0.4));
129  MediumMediumMuonBadFrac.push_back(ibooker.book1D(
130  "MediumMediumMuonBadFrac" + EtaName[iEtaRegion], "BadFrac_{Medium,Medium}" + EtaName[iEtaRegion], 10, 0, 0.4));
131  LooseLooseMuonBadFrac.push_back(ibooker.book1D(
132  "LooseLooseMuonBadFrac" + EtaName[iEtaRegion], "BadFrac_{Loose,Loose}" + EtaName[iEtaRegion], 10, 0, 0.4));
133 
134  // low-mass resonances
135  SoftSoftMuon.push_back(ibooker.book1D(
136  "SoftSoftMuon" + EtaName[iEtaRegion], "InvMass_{Soft,Soft}" + EtaName[iEtaRegion], nBin[iEtaRegion], 0.0, 55.0));
137  SoftSoftMuonBadFrac.push_back(ibooker.book1D(
138  "SoftSoftMuonBadFrac" + EtaName[iEtaRegion], "BadFrac_{Soft,Soft}" + EtaName[iEtaRegion], 10, 0, 0.4));
139  }
140 }
std::vector< MonitorElement * > MediumMediumMuon
std::vector< MonitorElement * > MediumMediumMuonBadFrac
std::vector< MonitorElement * > GlbGlbMuon_LM
std::vector< MonitorElement * > TightTightMuonBadFrac
std::string EtaName[3]
std::vector< MonitorElement * > LooseLooseMuonBadFrac
std::vector< MonitorElement * > SoftSoftMuon
std::vector< MonitorElement * > TrkTrkMuon_LM
std::vector< MonitorElement * > StaTrkMuon_LM
std::vector< MonitorElement * > SoftSoftMuonBadFrac
std::vector< MonitorElement * > TrkTrkMuon_HM
std::string theFolder
std::vector< MonitorElement * > StaTrkMuon_HM
std::vector< MonitorElement * > GlbGlbMuon_HM
std::vector< MonitorElement * > TightTightMuon
std::vector< MonitorElement * > LooseLooseMuon

Member Data Documentation

int DiMuonHistograms::etaBBin
private

Definition at line 52 of file DiMuonHistograms.h.

int DiMuonHistograms::etaBin
private

Definition at line 51 of file DiMuonHistograms.h.

double DiMuonHistograms::etaBMax
private

Definition at line 62 of file DiMuonHistograms.h.

double DiMuonHistograms::etaBMin
private

Definition at line 61 of file DiMuonHistograms.h.

double DiMuonHistograms::EtaCutMax
private

Definition at line 60 of file DiMuonHistograms.h.

double DiMuonHistograms::EtaCutMin
private

Definition at line 59 of file DiMuonHistograms.h.

int DiMuonHistograms::etaEBin
private

Definition at line 53 of file DiMuonHistograms.h.

double DiMuonHistograms::etaECMax
private

Definition at line 64 of file DiMuonHistograms.h.

double DiMuonHistograms::etaECMin
private

Definition at line 63 of file DiMuonHistograms.h.

std::string DiMuonHistograms::EtaName[3]
private

Definition at line 57 of file DiMuonHistograms.h.

int DiMuonHistograms::etaOvlpBin
private

Definition at line 54 of file DiMuonHistograms.h.

std::vector<MonitorElement*> DiMuonHistograms::GlbGlbMuon_HM
private

Definition at line 73 of file DiMuonHistograms.h.

std::vector<MonitorElement*> DiMuonHistograms::GlbGlbMuon_LM
private

Definition at line 72 of file DiMuonHistograms.h.

double DiMuonHistograms::HighMassMax
private

Definition at line 70 of file DiMuonHistograms.h.

double DiMuonHistograms::HighMassMin
private

Definition at line 69 of file DiMuonHistograms.h.

std::vector<MonitorElement*> DiMuonHistograms::LooseLooseMuon
private

Definition at line 79 of file DiMuonHistograms.h.

std::vector<MonitorElement*> DiMuonHistograms::LooseLooseMuonBadFrac
private

Definition at line 83 of file DiMuonHistograms.h.

double DiMuonHistograms::LowMassMax
private

Definition at line 68 of file DiMuonHistograms.h.

double DiMuonHistograms::LowMassMin
private

Definition at line 67 of file DiMuonHistograms.h.

std::vector<MonitorElement*> DiMuonHistograms::MediumMediumMuon
private

Definition at line 80 of file DiMuonHistograms.h.

std::vector<MonitorElement*> DiMuonHistograms::MediumMediumMuonBadFrac
private

Definition at line 84 of file DiMuonHistograms.h.

std::string DiMuonHistograms::metname
private

Definition at line 48 of file DiMuonHistograms.h.

int DiMuonHistograms::nGlbGlb
private

Definition at line 100 of file DiMuonHistograms.h.

int DiMuonHistograms::nLooseLoose
private

Definition at line 99 of file DiMuonHistograms.h.

int DiMuonHistograms::nMediumMedium
private

Definition at line 98 of file DiMuonHistograms.h.

int DiMuonHistograms::nTightTight
private

Definition at line 97 of file DiMuonHistograms.h.

edm::ParameterSet DiMuonHistograms::parameters
private
std::vector<MonitorElement*> DiMuonHistograms::SoftSoftMuon
private

Definition at line 82 of file DiMuonHistograms.h.

std::vector<MonitorElement*> DiMuonHistograms::SoftSoftMuonBadFrac
private

Definition at line 86 of file DiMuonHistograms.h.

std::vector<MonitorElement*> DiMuonHistograms::StaTrkMuon_HM
private

Definition at line 75 of file DiMuonHistograms.h.

std::vector<MonitorElement*> DiMuonHistograms::StaTrkMuon_LM
private

Definition at line 74 of file DiMuonHistograms.h.

MonitorElement* DiMuonHistograms::test
private
edm::EDGetTokenT<reco::BeamSpot> DiMuonHistograms::theBeamSpotLabel_
private

Definition at line 93 of file DiMuonHistograms.h.

std::string DiMuonHistograms::theFolder
private

Definition at line 95 of file DiMuonHistograms.h.

edm::EDGetTokenT<edm::View<reco::Muon> > DiMuonHistograms::theMuonCollectionLabel_
private

Definition at line 91 of file DiMuonHistograms.h.

MuonServiceProxy* DiMuonHistograms::theService
private

Definition at line 44 of file DiMuonHistograms.h.

edm::EDGetTokenT<reco::VertexCollection> DiMuonHistograms::theVertexLabel_
private

Definition at line 92 of file DiMuonHistograms.h.

std::vector<MonitorElement*> DiMuonHistograms::TightTightMuon
private

Definition at line 81 of file DiMuonHistograms.h.

std::vector<MonitorElement*> DiMuonHistograms::TightTightMuonBadFrac
private

Definition at line 85 of file DiMuonHistograms.h.

std::vector<MonitorElement*> DiMuonHistograms::TrkTrkMuon_HM
private

Definition at line 77 of file DiMuonHistograms.h.

std::vector<MonitorElement*> DiMuonHistograms::TrkTrkMuon_LM
private

Definition at line 76 of file DiMuonHistograms.h.