CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ZMuMuAnalyzer_cynematics.cc
Go to the documentation of this file.
1 /* \class ZMuMuAnalyzer_cynematics
2  *
3  * Z->mu+m- standard analysis for cross section
4  * measurements. Take as input the output of the
5  * standard EWK skim: zToMuMu
6  *
7  * Produces mass spectra and other histograms for
8  * the samples in input:
9  *
10  * + Z -> mu+mu-, both muons are "global" muons
11  * + Z -> mu+mu-, one muons is "global" muons, one unmatched tracks
12  * + Z -> mu+mu-, one muons is "global" muons, one unmatched stand-alone muon
13  *
14  *
15  * \author Michele de Gruttola,
16  * \modified by Davide Piccolo, INFN Naples to include gerarchyc selection of Z and histos as a finction of eta pt phi
17  *
18  *
19  *
20  */
37 #include "TFile.h"
38 #include "TH1.h"
39 #include "TH2.h"
40 #include <iostream>
41 #include <iterator>
42 #include <sstream>
43 using namespace edm;
44 using namespace std;
45 using namespace reco;
46 
48 
50 public:
52 private:
53  virtual void analyze(const edm::Event& event, const edm::EventSetup& setup) override;
54  bool isContained(const Candidate &, const Candidate &);
55  virtual void endJob() override;
56 
61  InputTag muIso_, trackIso_, standAloneIso_;
62  InputTag zMuMuMap_ ,zMuTrackMap_, zMuStandAloneMap_;
63  double isocut_, etacut_, ptcut_,ptSTAcut_, minZmass_, maxZmass_;
64  TH1D * h_zMuMu_numberOfCand, * h_zMuMu_numberOfCand_passed, * h_zMuMu_numberOfCand_ptpassed,* h_zMuMu_numberOfCand_etapassed,
65  * h_zMuMu_numberOfCand_masspassed, * h_zMuMu_numberOfCand_isopassed, * h_zMuMu_numberOfCand_ptetapassed,
66  * h_zMuMu_numberOfCand_ptetamasspassed, * h_zMuMu_mass_, * h_zMuSingleTrack_mass_, * h_zMuSingleStandAlone_mass_,
67  * h_zMuSingleStandAloneOverlap_mass_, * h_zMuMuMatched_mass_, * h_zMuSingleTrackMatched_mass_,
68  * h_zMuSingleStandAloneMatched_mass_,
69  * h_zMuSingleStandAloneOverlapMatched_mass_;
70 
71  TH1D * h_zMuSta_numberOfCand,* h_zMuSta_numberOfCand_passed,* h_zMuSta_MCmatched_numberOfCand_passed,
72  * h_zMuSta_numberOfCand_notcontained,
73  * h_zMuTrack_numberOfCand, * h_zMuTrack_numberOfCand_notcontained, * h_zMuTrack_numberOfCand_passed,
74  * h_zMuTrack_MCmatched_numberOfCand_passed;
75  TH2D * h_OneSta_mass;
76 
77  double etamin, etamax, phimin, phimax, ptmin, ptmax;
78  int numberOfIntervals; // number of intervals in which to divide cynematic variables
79  double binEta,binPhi, binPt;
80  vector<TH1D *> hmumu_eta, hmusta_eta, hmutrack_eta;
81  vector<TH1D *> hmumu_phi, hmusta_phi, hmutrack_phi;
82  vector<TH1D *> hmumu_pt, hmusta_pt, hmutrack_pt;
83 
84 };
85 
87  zMuMu_( pset.getParameter<InputTag>( "zMuMu" ) ),
88  zMuTrack_( pset.getParameter<InputTag>( "zMuTrack" ) ),
89  zMuStandAlone_( pset.getParameter<InputTag>( "zMuStandAlone" ) ),
90  muIso_( pset.getParameter<InputTag>( "muIso" ) ),
91  trackIso_( pset.getParameter<InputTag>( "trackIso" ) ),
92  standAloneIso_( pset.getParameter<InputTag>( "standAloneIso" ) ),
93  zMuMuMap_( pset.getParameter<InputTag>( "zMuMuMap" ) ),
94  zMuTrackMap_( pset.getParameter<InputTag>( "zMuTrackMap" ) ),
95  zMuStandAloneMap_( pset.getParameter<InputTag>( "zMuStandAloneMap" ) ),
96  isocut_( pset.getParameter<double>( "isocut" ) ),
97  etacut_( pset.getParameter<double>( "etacut" ) ),
98  ptcut_( pset.getParameter<double>( "ptcut" ) ),
99  ptSTAcut_( pset.getParameter<double>( "ptSTAcut" ) ),
100  minZmass_( pset.getParameter<double>( "minZmass" )),
101  maxZmass_( pset.getParameter<double>( "maxZmass" )) {
102 
104  h_zMuMu_numberOfCand = fs->make<TH1D>("ZMuMunumberOfCand","number of ZMuMu cand",10, -.5, 9.5);
105  h_zMuMu_numberOfCand_passed = fs->make<TH1D>("ZMuMunumberOfCandpassed","number of ZMuMu cand selected",10, -.5, 9.5);
106  h_zMuMu_numberOfCand_ptpassed = fs->make<TH1D>("ZMuMunumberOfCandptpassed","number of ZMuMu cand after pt cut selected",10, -.5, 9.5);
107  h_zMuMu_numberOfCand_etapassed = fs->make<TH1D>("ZMuMunumberOfCandetapassed","number of ZMuMu cand after eta cut selected",10, -.5, 9.5);
108  h_zMuMu_numberOfCand_masspassed = fs->make<TH1D>("ZMuMunumberOfCandmasspassed","number of ZMuMu cand after mass cut selected",10, -.5, 9.5);
109  h_zMuMu_numberOfCand_isopassed = fs->make<TH1D>("ZMuMunumberOfCandisopassed","number of ZMuMu cand after iso cut selected",10, -.5, 9.5);
110  h_zMuMu_numberOfCand_ptetapassed = fs->make<TH1D>("ZMuMunumberOfCandptetapassed","number of ZMuMu cand after pt & eta cut selected",10, -.5, 9.5);
111  h_zMuMu_numberOfCand_ptetamasspassed = fs->make<TH1D>("ZMuMunumberOfCandptetamaspassed","number of ZMuMu cand after pt & eta & mass cut selected",10, -.5, 9.5);
112 
113 
114  h_zMuMu_mass_ = fs->make<TH1D>( "ZMuMumass", "ZMuMu mass(GeV)", 200, 0., 200. );
115  h_zMuSingleTrack_mass_ = fs->make<TH1D>( "ZMuSingleTrackmass", "ZMuSingleTrack mass(GeV)", 100, 0., 200. );
116  h_zMuSingleStandAlone_mass_ = fs->make<TH1D>( "ZMuSingleStandAlonemass", "ZMuSingleStandAlone mass(GeV)", 50, 0., 200. );
117  h_zMuSingleStandAloneOverlap_mass_ = fs->make<TH1D>( "ZMuSingleStandAloneOverlapmass", "ZMuSingleStandAloneOverlap mass(GeV)", 50, 0., 200. );
118 
119 
120  h_zMuMuMatched_mass_ = fs->make<TH1D>( "ZMuMuMatchedmass", "ZMuMu Matched mass(GeV)", 200, 0., 200. );
121  h_zMuSingleTrackMatched_mass_ = fs->make<TH1D>( "ZMuSingleTrackmassMatched", "ZMuSingleTrackMatched mass(GeV)", 100, 0., 200. );
122  h_zMuSingleStandAloneMatched_mass_ = fs->make<TH1D>( "ZMuSingleStandAlonemassMatched", "ZMuSingleStandAloneMatched mass(GeV)", 50, 0., 200. );
123  h_zMuSingleStandAloneOverlapMatched_mass_ = fs->make<TH1D>( "ZMuSingleStandAloneOverlapmassMatched", "ZMuSingleStandAloneMatched Overlap mass(GeV)", 50, 0., 200. );
124 
125  h_zMuSta_numberOfCand = fs->make<TH1D>("ZMuStanumberOfCand","number of ZMuSta cand (if ZMuMu not selected)",10, -.5, 9.5);
126  h_OneSta_mass = fs->make<TH2D>("ZOneMuStaMass","inv. mass of ZMuSta1 vs ZMuSta2 when one ZMuSta has been found (if ZMuMu not selected)",100, 0., 400, 100, 0., 400.);
127  h_zMuSta_numberOfCand_notcontained = fs->make<TH1D>("ZMuStanumberOfCandnotcontained","number of independent ZMuSta cand (if ZMuMu not selected)",10, -.5, 9.5);
128  h_zMuSta_numberOfCand_passed = fs->make<TH1D>("ZMuStanumberOfCandpassed","number of ZMuSta cand selected (if ZMuMu not selected)",10, -.5, 9.5);
129  h_zMuSta_MCmatched_numberOfCand_passed = fs->make<TH1D>("ZMuStaMCmatchedNumberOfCandpassed","number of ZMuSta MC matched cand selected (if ZMuMu not selected)",10, -.5, 9.5);
130  h_zMuTrack_numberOfCand = fs->make<TH1D>("ZMuTranumberOfCand","number of ZMuTrack cand (if ZMuMu and ZMuSTa not selected)",10, -.5, 9.5);
131  h_zMuTrack_numberOfCand_notcontained = fs->make<TH1D>("ZMuTranumberOfCandnotcontaind","number of indeendent ZMuTrack cand (if ZMuMu and ZMuSTa not selected)",10, -.5, 9.5);
132  h_zMuTrack_numberOfCand_passed = fs->make<TH1D>("ZMuTranumberOfCandpassed","number of ZMuTrack cand selected (if ZMuMu and ZMuSta not selected)",10, -.5, 9.5);
133  h_zMuTrack_MCmatched_numberOfCand_passed = fs->make<TH1D>("ZMuTraMCmacthedNumberOfCandpassed","number of ZMuTrack MC matched cand selected (if ZMuMu and ZMuSta not selected)",10, -.5, 9.5);
134 
135 
136  // creating histograms for each Pt, eta, phi interval
137 
138  etamin = -etacut_;
139  etamax = etacut_;
140  phimin = -3.1415;
141  phimax = 3.1415;
142  ptmin = ptcut_;
143  ptmax = 100;
144  numberOfIntervals = 8; // number of intervals in which to divide cynematic variables
148  TFileDirectory etaDirectory = fs->mkdir("etaIntervals"); // in this directory will be saved all the histos of different eta intervals
149  TFileDirectory phiDirectory = fs->mkdir("phiIntervals"); // in this directory will be saved all the histos of different phi intervals
150  TFileDirectory ptDirectory = fs->mkdir("ptIntervals"); // in this directory will be saved all the histos of different pt intervals
151 
152  // eta histograms creation
153 
154  for (int i=0;i<numberOfIntervals;i++) {
155  double range0 = etamin + i*binEta;
156  double range1= range0 + binEta;
157  char a[30], b[50];
158  sprintf(a,"zmumu_etaRange%d",i);
159  sprintf(b,"zmumu mass eta Range %f to %f",range0,range1);
160  hmumu_eta.push_back(etaDirectory.make<TH1D>(a,b,200,0.,200.));
161  char asta[30], bsta[50];
162  sprintf(asta,"zmusta_etaRange%d",i);
163  sprintf(bsta,"zmusta mass eta Range %f to %f",range0,range1);
164  hmusta_eta.push_back(etaDirectory.make<TH1D>(asta,bsta,50,0.,200.));
165  char atk[30], btk[50];
166  sprintf(atk,"zmutrack_etaRange%d",i);
167  sprintf(btk,"zmutrack mass eta Range %f to %f",range0,range1);
168  hmutrack_eta.push_back(etaDirectory.make<TH1D>(atk,btk,100,0.,200.));
169  }
170 
171  // phi histograms creation
172 
173  for (int i=0;i<numberOfIntervals;i++) {
174  double range0 = phimin + i*binPhi;
175  double range1= range0 + binPhi;
176  char a[30], b[50];
177  sprintf(a,"zmumu_phiRange%d",i);
178  sprintf(b,"zmumu mass phi Range %f to %f",range0,range1);
179  hmumu_phi.push_back(phiDirectory.make<TH1D>(a,b,200,0.,200.));
180  char asta[30], bsta[50];
181  sprintf(asta,"zmusta_phiRange%d",i);
182  sprintf(bsta,"zmusta mass phi Range %f to %f",range0,range1);
183  hmusta_phi.push_back(phiDirectory.make<TH1D>(asta,bsta,50,0.,200.));
184  char atk[30], btk[50];
185  sprintf(atk,"zmutrack_phiRange%d",i);
186  sprintf(btk,"zmutrack mass phi Range %f to %f",range0,range1);
187  hmutrack_phi.push_back(phiDirectory.make<TH1D>(atk,btk,100,0.,200.));
188  }
189 
190  // pt histograms creation
191 
192  for (int i=0;i<numberOfIntervals;i++) {
193  double range0 = ptmin + i*binPt;
194  double range1= range0 + binPt;
195  char a[30], b[50];
196  sprintf(a,"zmumu_ptRange%d",i);
197  sprintf(b,"zmumu mass pt Range %f to %f",range0,range1);
198  hmumu_pt.push_back(ptDirectory.make<TH1D>(a,b,200,0.,200.));
199  char asta[30], bsta[50];
200  sprintf(asta,"zmusta_ptRange%d",i);
201  sprintf(bsta,"zmusta mass pt Range %f to %f",range0,range1);
202  hmusta_pt.push_back(ptDirectory.make<TH1D>(asta,bsta,50,0.,200.));
203  char atk[30], btk[50];
204  sprintf(atk,"zmutrack_ptRange%d",i);
205  sprintf(btk,"zmutrack mass pt Range %f to %f",range0,range1);
206  hmutrack_pt.push_back(ptDirectory.make<TH1D>(atk,btk,100,0.,200.));
207  }
208  }
209 
212  event.getByLabel(zMuMu_, zMuMu);
214  event.getByLabel( zMuTrack_, zMuTrack );
215  Handle<CandidateCollection> zMuStandAlone;
216  event.getByLabel( zMuStandAlone_, zMuStandAlone );
217 
218  unsigned int nZMuMu = zMuMu->size();
219  unsigned int nZTrackMu = zMuTrack->size();
220  unsigned int nZStandAloneMu = zMuStandAlone->size();
221  // static const double zMass = 91.1876; // PDG Z mass
222 
223  cout << "++++++++++++++++++++++++++" << endl;
224  cout << "nZMuMu = " << nZMuMu << endl;
225  cout << "nZTrackMu = " << nZTrackMu << endl;
226  cout << "nZStandAloneMu = " << nZStandAloneMu << endl;
227  cout << "++++++++++++++++++++++++++" << endl;
228 
229  // ZMuMu counters
230 
231  int ZMuMu_passed = 0;
232  int ZMuMu_ptcut_counter = 0;
233  int ZMuMu_etacut_counter = 0;
234  int ZMuMu_masscut_counter = 0;
235  int ZMuMu_isocut_counter = 0;
236  int ZMuMu_ptetacut_counter = 0;
237  int ZMuMu_ptetamasscut_counter = 0;
238  int ZMuMu_allcut_counter = 0;
239 
240  // ZMuTrack counters
241 
242  int ZMuTrack_passed = 0;
243  int ZMuTrack_notcontained = 0;
244  int ZMuTrack_MCmatched_passed = 0;
245 
246  // ZMuStandalone counters
247  int ZMuStandalone_notcontained = 0;
248  int ZMuStandalone_passed = 0;
249  int ZMuStandalone_MCmatched_passed = 0;
250 
251  Handle<CandMatchMap> zMuMuMap;
252  if( nZMuMu > 0 ) {
253  event.getByLabel(zMuMuMap_, zMuMuMap);
254  }
255 
256  Handle<CandMatchMap> zMuTrackMap;
257  if( nZTrackMu > 0 ) {
258  event.getByLabel( zMuTrackMap_, zMuTrackMap );
259  }
260 
261  Handle<CandMatchMap> zMuStandAloneMap;
262  if( nZStandAloneMu > 0 ) {
263  event.getByLabel( zMuStandAloneMap_, zMuStandAloneMap );
264  }
265 
267  event.getByLabel(muIso_, muIso);
268  ProductID muIsoId = muIso->keyProduct().id();
270  event.getByLabel(trackIso_, trackIso);
271  ProductID trackIsoId = trackIso->keyProduct().id();
272 
273  Handle<IsolationCollection> standAloneIso;
274  event.getByLabel(standAloneIso_, standAloneIso);
275  ProductID standAloneIsoId = standAloneIso->keyProduct().id();
276 
277  if (nZMuMu > 0) {
278  // double mass = 1000000.;
279  for( unsigned int i = 0; i < nZMuMu; i++ ) {
280  bool ptcutAccept = false;
281  bool etacutAccept = false;
282  bool masscutAccept = false;
283  bool isocutAccept = false;
284  const Candidate & zmmCand = (*zMuMu)[ i ];
285  CandidateRef CandRef(zMuMu,i);
286  CandidateRef lep1 = zmmCand.daughter( 0 )->masterClone().castTo<CandidateRef>();
287  CandidateRef lep2 = zmmCand.daughter( 1 )->masterClone().castTo<CandidateRef>();
288 
289  const double iso1 = muIso->value( lep1.key() );
290  const double iso2 = muIso->value( lep2.key() );
291 
292  double m = zmmCand.mass();
293  // check single cuts
294 
295  if (lep1->pt()>ptcut_ && lep2->pt()>ptcut_) ptcutAccept = true;
296  if (fabs(lep1->eta())<etacut_ && fabs(lep2->eta())<etacut_) etacutAccept = true;
297  if (m>minZmass_ && m<maxZmass_) masscutAccept = true;
298  if (iso1 < isocut_ && iso2 <isocut_) isocutAccept = true;
299 
300 
301  if (ptcutAccept) ZMuMu_ptcut_counter++;
302  if (etacutAccept) ZMuMu_etacut_counter++;
303  if (masscutAccept) ZMuMu_masscut_counter++;
304  if (isocutAccept) ZMuMu_isocut_counter++;
305 
306  // check sequencial cuts
307 
308  if (ptcutAccept && etacutAccept) {
309  ZMuMu_ptetacut_counter++;
310  if (masscutAccept) {
311  ZMuMu_ptetamasscut_counter++;
312  if (isocutAccept) {
313  ZMuMu_passed++;}
314  }
315  }
316 
317  if (ptcutAccept && etacutAccept && masscutAccept && isocutAccept) {
318  ZMuMu_allcut_counter++;
319  h_zMuMu_mass_->Fill( m );
320 
321  // check the cynematics to fill correct histograms
322  for (int j=0;j<numberOfIntervals;j++) {
323  bool statusBinEta = false;
324  bool statusBinPhi = false;
325  bool statusBinPt = false;
326  double range0 = etamin + j*binEta;
327  double range1= range0 + binEta;
328  double range0phi = phimin + j*binPhi;
329  double range1phi= range0phi + binPhi;
330  double range0pt = ptmin + j*binPt;
331  double range1pt = range0pt + binPt;
332  // eta histograms
333  if (lep1->eta()>=range0 && lep1->eta()<range1)
334  {
335  hmumu_eta[j]->Fill(m);
336  statusBinEta = true;
337  }
338  if (lep2->eta()>=range0 && lep2->eta()<range1 && !statusBinEta){
339  hmumu_eta[j]->Fill(m); // If eta1 is in the same bin of eta2 fill just once
340  }
341  // phi histograms
342  if (lep1->phi()>=range0phi && lep1->phi()<range1phi)
343  {
344  hmumu_phi[j]->Fill(m);
345  statusBinPhi = true;
346  }
347  if (lep2->phi()>=range0phi && lep2->phi()<range1phi && !statusBinPhi){
348  hmumu_phi[j]->Fill(m); // If phi1 is in the same bin of phi2 fill just once
349  }
350  // pt histograms
351  if (lep1->pt()>=range0pt && lep1->pt()<range1pt)
352  {
353  hmumu_pt[j]->Fill(m);
354  statusBinPt = true;
355  }
356  if (lep2->pt()>=range0pt && lep2->pt()<range1pt && !statusBinPt){
357  hmumu_pt[j]->Fill(m); // If pt1 is in the same bin of pt2 fill just once
358  }
359  }
360 
361  CandMatchMap::const_iterator m0 = zMuMuMap->find(CandRef);
362  if( m0 != zMuMuMap->end()) { // the Z is matched to MC thruth
363  h_zMuMuMatched_mass_->Fill( m );
364  }
365  }
366  }
367  }
368 
369  h_zMuMu_numberOfCand->Fill(nZMuMu); // number of Z cand found per event
370  h_zMuMu_numberOfCand_passed->Fill(ZMuMu_allcut_counter); // number of Z cand after all cuts found per event
371  h_zMuMu_numberOfCand_ptpassed->Fill(ZMuMu_ptcut_counter); // number of Z cand afer pt cut found per event
372  h_zMuMu_numberOfCand_etapassed->Fill(ZMuMu_etacut_counter); // number of Z cand afer eta cut found per event
373  h_zMuMu_numberOfCand_masspassed->Fill(ZMuMu_masscut_counter); // number of Z cand afer mass cut found per event
374  h_zMuMu_numberOfCand_isopassed->Fill(ZMuMu_isocut_counter); // number of Z cand afer iso cut found per event
375  h_zMuMu_numberOfCand_ptetapassed->Fill(ZMuMu_ptetacut_counter); // number of Z cand afer pt&eta cut found per event
376  h_zMuMu_numberOfCand_ptetamasspassed->Fill(ZMuMu_ptetamasscut_counter); // number of Z cand afer pt&eta&mass cut found per event
377 
378 
379  //ZmuSingleStandAlone (check MuStandalone if MuMu has not been selected by cuts)
380  // cout << "ZMuMuanalyzer : n of zMuMu " << nZMuMu << " passed " << ZMuMu_passed << " n. of zStaMu " << nZStandAloneMu << endl;
381 
382  if (ZMuMu_passed == 0 && nZStandAloneMu>0 ) {
383  // unsigned int index = 1000;
384  for( unsigned int j = 0; j < nZStandAloneMu; j++ ) {
385  const Candidate & zsmCand = (*zMuStandAlone)[ j ];
386  bool skipZ = false;
387  for( unsigned int i = 0; i < nZMuMu; i++ ) { // chek if the ZMuSTandalone is contained in a ZMuMu
388  const Candidate & zmmCand = (*zMuMu)[ i ]; // if yes .. the event has to be skipped
389  if (isContained(zmmCand,zsmCand)) skipZ=true;
390  }
391  if (!skipZ) { // ZSMuSTandalone not contained in a ZMuMu
392  ZMuStandalone_notcontained++;
393  CandidateRef CandRef(zMuStandAlone,j);
394  CandidateRef lep1 = zsmCand.daughter( 0 )->masterClone().castTo<CandidateRef>();
395  CandidateRef lep2 = zsmCand.daughter( 1 )->masterClone().castTo<CandidateRef>();
396 
397  ProductID id1 = lep1.id();
398  ProductID id2 = lep2.id();
399  double iso1 = -1;
400  double iso2 = -1;
401 
402  if( id1 == muIsoId )
403  iso1 = muIso->value( lep1.key() );
404  else if ( id1 == standAloneIsoId )
405  iso1 = standAloneIso->value( lep1.key() );
406 
407  if( id2 == muIsoId )
408  iso2 = muIso->value( lep2.key() );
409  else if ( id2 == standAloneIsoId )
410  iso2 = standAloneIso->value( lep2.key() );
411 
412  double ms = zsmCand.mass();
413  if (lep1->pt()>ptSTAcut_ && lep2->pt()>ptSTAcut_ &&
414  fabs(lep1->eta())<etacut_ && fabs(lep2->eta())<etacut_ &&
415  ms>minZmass_ && ms<maxZmass_ && iso1<isocut_ && iso2 <isocut_) {
416  h_zMuSingleStandAlone_mass_->Fill( ms );
417  ZMuStandalone_passed++;
418  // check the cynematics to fill correct histograms
419  for (int j=0;j<numberOfIntervals;j++) {
420  double range0 = etamin + j*binEta;
421  double range1= range0 + binEta;
422  double range0phi = phimin + j*binPhi;
423  double range1phi= range0phi + binPhi;
424  double range0pt = ptmin + j*binPt;
425  double range1pt = range0pt + binPt;
426 
427  // check which muon is a standalone (standalone means that there is a reference missing.)
428  if ((lep1->get<TrackRef,reco::StandAloneMuonTag>()).isNull())
429  {
430  if (lep1->eta()>=range0 && lep1->eta()<range1) hmusta_eta[j]->Fill(ms);
431  if (lep1->phi()>=range0phi && lep1->phi()<range1phi) hmusta_phi[j]->Fill(ms);
432  if (lep1->pt()>=range0pt && lep1->pt()<range1pt) hmusta_pt[j]->Fill(ms);
433  }
434  if ((lep2->get<TrackRef,reco::StandAloneMuonTag>()).isNull())
435  {
436  if (lep2->eta()>=range0 && lep2->eta()<range1) hmusta_eta[j]->Fill(ms);
437  if (lep2->phi()>=range0phi && lep2->phi()<range1phi) hmusta_phi[j]->Fill(ms);
438  if (lep2->pt()>=range0pt && lep2->pt()<range1pt) hmusta_pt[j]->Fill(ms);
439  }
440 
441  }
442  CandMatchMap::const_iterator m0 = zMuStandAloneMap->find(CandRef);
443  if( m0 != zMuStandAloneMap->end()) {
444  ZMuStandalone_MCmatched_passed++;
446  }
447  }
448  }
449  }
450  h_zMuSta_numberOfCand->Fill(nZStandAloneMu); // number of ZMuStandalone cand found per event (no higher priority Z selected)
451  h_zMuSta_numberOfCand_notcontained->Fill(ZMuStandalone_notcontained);
452  h_zMuSta_numberOfCand_passed->Fill(ZMuStandalone_passed); // number of ZMuSTa cand after all cuts found per event (no higher prioriy Z selected)
453  h_zMuSta_MCmatched_numberOfCand_passed->Fill(ZMuStandalone_MCmatched_passed); // number of ZMuSTa MC matched cand after all cuts found per event (no higher prioriy Z selected)
454 
455  }
456 
457  //ZmuSingleTRack (check MuTrack if MuMu has not been selected)
458  if (ZMuMu_passed == 0 && ZMuStandalone_passed == 0 && nZTrackMu>0) {
459  for( unsigned int j = 0; j < nZTrackMu; j++ ) {
460  const Candidate & ztmCand = (*zMuTrack)[ j ];
461  bool skipZ = false;
462  for( unsigned int i = 0; i < nZMuMu; i++ ) { // chek if the ZMuTrack is contained in a ZMuMu
463  const Candidate & zmmCand = (*zMuMu)[ i ]; // if yes .. the event has to be skipped
464  if (isContained(zmmCand,ztmCand)) skipZ=true;
465  }
466  if (!skipZ) {
467  ZMuTrack_notcontained++;
468  CandidateRef CandRef(zMuTrack,j);
469  CandidateRef lep1 = ztmCand.daughter( 0 )->masterClone().castTo<CandidateRef>();
470  CandidateRef lep2 = ztmCand.daughter( 1 )->masterClone().castTo<CandidateRef>();
471 
472  ProductID id1 = lep1.id();
473  ProductID id2 = lep2.id();
474  double iso1 = -1;
475  double iso2 = -1;
476 
477  if( id1 == muIsoId )
478  iso1 = muIso->value( lep1.key() );
479  else if ( id1 == trackIsoId )
480  iso1 = trackIso->value( lep1.key() );
481 
482  if( id2 == muIsoId )
483  iso2 = muIso->value( lep2.key() );
484  else if ( id2 == trackIsoId )
485  iso2 = trackIso->value( lep2.key() );
486 
487  double mt = ztmCand.mass();
488  if (lep1->pt()>ptcut_ && lep2->pt()>ptcut_ &&
489  fabs(lep1->eta())<etacut_ && fabs(lep2->eta())<etacut_ &&
490  mt>minZmass_ && mt<maxZmass_ && iso1<isocut_ && iso2 <isocut_) {
491  h_zMuSingleTrack_mass_->Fill( mt );
492  ZMuTrack_passed++;
493 
494  // check the cynematics to fill correct histograms
495  for (int j=0;j<numberOfIntervals;j++) {
496  double range0 = etamin + j*binEta;
497  double range1= range0 + binEta;
498  double range0phi = phimin + j*binPhi;
499  double range1phi= range0phi + binPhi;
500  double range0pt = ptmin + j*binPt;
501  double range1pt = range0pt + binPt;
502 
503  // check which muon is a track only (track only means that there is a reference missing.)
504  if ((lep1->get<TrackRef,reco::StandAloneMuonTag>()).isNull())
505  {
506  if (lep1->eta()>=range0 && lep1->eta()<range1) hmutrack_eta[j]->Fill(mt);
507  if (lep1->phi()>=range0phi && lep1->phi()<range1phi) hmutrack_phi[j]->Fill(mt);
508  if (lep1->pt()>=range0pt && lep1->pt()<range1pt) hmutrack_pt[j]->Fill(mt);
509  }
510  if ((lep2->get<TrackRef,reco::StandAloneMuonTag>()).isNull())
511  {
512  if (lep2->eta()>=range0 && lep2->eta()<range1) hmutrack_eta[j]->Fill(mt);
513  if (lep2->phi()>=range0phi && lep2->phi()<range1phi) hmutrack_phi[j]->Fill(mt);
514  if (lep2->pt()>=range0pt && lep2->pt()<range1pt) hmutrack_pt[j]->Fill(mt);
515  }
516  }
517  CandMatchMap::const_iterator m0 = zMuTrackMap->find(CandRef);
518  if( m0 != zMuTrackMap->end()) {
519  ZMuTrack_MCmatched_passed++;
520  h_zMuSingleTrackMatched_mass_->Fill( mt );
521  }
522  }
523  }
524  }
525  h_zMuTrack_numberOfCand->Fill(nZTrackMu); // number of ZMuTrack cand found per event (no higher priority Z selected)
526  h_zMuTrack_numberOfCand_notcontained->Fill(ZMuTrack_notcontained); // number of ZMuTrack cand not cntained in ZMuMu (no higher priority Z selected)
527 
528  h_zMuTrack_numberOfCand_passed->Fill(ZMuTrack_passed); // number of ZMuTrack cand after all cuts found per event (no higher priority Z selected)
529 
530  h_zMuTrack_MCmatched_numberOfCand_passed->Fill(ZMuTrack_MCmatched_passed);
531 
532  }
533 }
534 
536 {
537  // check if a candidate obj2 is different from obj1 (assume that obj1 is a ZMuMu and obj2 is any other type)
538  // (for example a Z can be done with two global muons, or with a global muon plus a standalone muon.
539  // if the standalone muon is part of the second global muon in fact this is the same Z)
540 
541  const int maxd = 10;
542  const Candidate * daughters1[maxd];
543  const Candidate * daughters2[maxd];
544  TrackRef trackerTrack1[maxd];
545  TrackRef stAloneTrack1[maxd];
546  TrackRef globalTrack1[maxd];
547  TrackRef trackerTrack2[maxd];
548  TrackRef stAloneTrack2[maxd];
549  TrackRef globalTrack2[maxd];
550  bool flag;
551  unsigned int nd1 = obj1.numberOfDaughters();
552  unsigned int nd2 = obj2.numberOfDaughters();
553  unsigned int matched=0;
554 
555  for( unsigned int i = 0; i < nd1; ++ i ) {
556  daughters1[i] = obj1.daughter( i );
557  trackerTrack1[i] = daughters1[i]->get<TrackRef>();
558  stAloneTrack1[i] = daughters1[i]->get<TrackRef,reco::StandAloneMuonTag>();
559  globalTrack1[i] = daughters1[i]->get<TrackRef,reco::CombinedMuonTag>();
560 
561  /*********************************************** just used for debug ********************
562  if (trackerTrack1[i].isNull())
563  cout << "in ZMuMu daughter " << i << " tracker ref non found " << endl;
564  else
565  cout << "in ZMuMu daughter " << i << " tracker ref FOUND"
566  << " id: " << trackerTrack1[i].id() << ", index: " << trackerTrack1[i].key()
567  << endl;
568  if (stAloneTrack1[i].isNull())
569  cout << "in ZMuMu daughter " << i << " stalone ref non found " << endl;
570  else
571  cout << "in ZMuMu daughter " << i << " stalone ref FOUND"
572  << " id: " << stAloneTrack1[i].id() << ", index: " << stAloneTrack1[i].key()
573  << endl;
574 
575  if (globalTrack1[i].isNull())
576  cout << "in ZMuMu daughter " << i << " global ref non found " << endl;
577  else
578  cout << "in ZMuMu daughter " << i << " global ref FOUND"
579  << " id: " << globalTrack1[i].id() << ", index: " << globalTrack1[i].key()
580  << endl;
581  */
582  }
583  for( unsigned int i = 0; i < nd2; ++ i ) {
584  daughters2[i] = obj2.daughter( i );
585  trackerTrack2[i] = daughters2[i]->get<TrackRef>();
586  stAloneTrack2[i] = daughters2[i]->get<TrackRef,reco::StandAloneMuonTag>();
587  globalTrack2[i] = daughters2[i]->get<TrackRef,reco::CombinedMuonTag>();
588 
589  /******************************************** just used for debug ************
590  if (trackerTrack2[i].isNull())
591  cout << "in ZMuSta daughter " << i << " tracker ref non found " << endl;
592  else
593  cout << "in ZMuSta daughter " << i << " tracker ref FOUND"
594  << " id: " << trackerTrack2[i].id() << ", index: " << trackerTrack2[i].key()
595  << endl;
596  if (stAloneTrack2[i].isNull())
597  cout << "in ZMuSta daughter " << i << " standalone ref non found " << endl;
598  else
599  cout << "in ZMuSta daughter " << i << " standalone ref FOUND"
600  << " id: " << stAloneTrack2[i].id() << ", index: " << stAloneTrack2[i].key()
601  << endl;
602 
603  if (globalTrack2[i].isNull())
604  cout << "in ZMuSta daughter " << i << " global ref non found " << endl;
605  else
606  cout << "in ZMuSta daughter " << i << " global ref FOUND"
607  << " id: " << globalTrack2[i].id() << ", index: " << globalTrack2[i].key()
608  << endl;
609 
610  */
611  }
612  if (nd1 != nd2)
613  {
614  cout << "ZMuMuAnalyzer::isContained WARNING n.of daughters different " << nd1 << " " << nd2 << endl;
615  }
616  else
617  {
618  for (unsigned int i = 0; i < nd1; i++) {
619  flag = false;
620  for (unsigned int j = 0; j < nd2; j++) { // if the obj2 is a standalone the trackref is alwais in the trackerTRack position
621  if ( ((trackerTrack2[i].id()==trackerTrack1[j].id()) && (trackerTrack2[i].key()==trackerTrack1[j].key())) ||
622  ((trackerTrack2[i].id()==stAloneTrack1[j].id()) && (trackerTrack2[i].key()==stAloneTrack1[j].key())) ) {
623  flag = true;
624  }
625  }
626  if (flag) matched++;
627  }
628  }
629  if (matched==nd1) // return true if all the childrens of the ZMuMu have a children matched in ZMuXX
630  return true;
631  else
632  return false;
633 }
634 
636 
637  // candidate analysis
638  // ZMuMu
639  double Nzmmc = h_zMuMu_numberOfCand->GetEntries();
640  double Nzmmc_0Z = h_zMuMu_numberOfCand->GetBinContent(1);
641  double Nzmmc_1Z = h_zMuMu_numberOfCand->GetBinContent(2);
642  double Nzmmc_moreZ = Nzmmc-Nzmmc_0Z-Nzmmc_1Z;
643  double Nzmmc_passed_0Z = h_zMuMu_numberOfCand_passed->GetBinContent(1);
644  double Nzmmc_passed_1Z = h_zMuMu_numberOfCand_passed->GetBinContent(2);
645  double Nzmmc_passed_moreZ = Nzmmc-Nzmmc_passed_0Z-Nzmmc_passed_1Z;
646  double Nzmmc_ptpassed_0Z = h_zMuMu_numberOfCand_ptpassed->GetBinContent(1);
647  double Nzmmc_ptpassed_1Z = h_zMuMu_numberOfCand_ptpassed->GetBinContent(2);
648  double Nzmmc_etapassed_0Z = h_zMuMu_numberOfCand_etapassed->GetBinContent(1);
649  double Nzmmc_etapassed_1Z = h_zMuMu_numberOfCand_etapassed->GetBinContent(2);
650  double Nzmmc_masspassed_0Z = h_zMuMu_numberOfCand_masspassed->GetBinContent(1);
651  double Nzmmc_masspassed_1Z = h_zMuMu_numberOfCand_masspassed->GetBinContent(2);
652  double Nzmmc_isopassed_0Z = h_zMuMu_numberOfCand_isopassed->GetBinContent(1);
653  double Nzmmc_isopassed_1Z = h_zMuMu_numberOfCand_isopassed->GetBinContent(2);
654  double Nzmmc_ptetapassed_0Z = h_zMuMu_numberOfCand_ptetapassed->GetBinContent(1);
655  double Nzmmc_ptetapassed_1Z = h_zMuMu_numberOfCand_ptetapassed->GetBinContent(2);
656  double Nzmmc_ptetamasspassed_0Z = h_zMuMu_numberOfCand_ptetamasspassed->GetBinContent(1);
657  double Nzmmc_ptetamasspassed_1Z = h_zMuMu_numberOfCand_ptetamasspassed->GetBinContent(2);
658  double Nzmmc_ptpassed_moreZ = Nzmmc-Nzmmc_ptpassed_0Z-Nzmmc_ptpassed_1Z;
659  double Nzmmc_etapassed_moreZ = Nzmmc-Nzmmc_etapassed_0Z-Nzmmc_etapassed_1Z;
660  double Nzmmc_masspassed_moreZ = Nzmmc-Nzmmc_masspassed_0Z-Nzmmc_masspassed_1Z;
661  double Nzmmc_isopassed_moreZ = Nzmmc-Nzmmc_isopassed_0Z-Nzmmc_isopassed_1Z;
662  double Nzmmc_ptetapassed_moreZ = Nzmmc-Nzmmc_ptetapassed_0Z-Nzmmc_ptetapassed_1Z;
663  double Nzmmc_ptetamasspassed_moreZ = Nzmmc-Nzmmc_ptetamasspassed_0Z-Nzmmc_ptetamasspassed_1Z;
664  double Nzmsc = h_zMuSta_numberOfCand->GetEntries();
665  double Nzmsc_0Z = h_zMuSta_numberOfCand->GetBinContent(1);
666  double Nzmsc_1Z = h_zMuSta_numberOfCand->GetBinContent(2);
667  double Nzmsc_moreZ = Nzmsc - Nzmsc_0Z - Nzmsc_1Z;
668  double Nzmsc_notcontained_0Z = h_zMuSta_numberOfCand_notcontained->GetBinContent(1);
669  double Nzmsc_notcontained_1Z = h_zMuSta_numberOfCand_notcontained->GetBinContent(2);
670  double Nzmsc_notcontained_moreZ = Nzmsc-Nzmsc_notcontained_0Z-Nzmsc_notcontained_1Z;
671  double Nzmsc_passed_0Z = h_zMuSta_numberOfCand_passed->GetBinContent(1);
672  double Nzmsc_passed_1Z = h_zMuSta_numberOfCand_passed->GetBinContent(2);
673  double Nzmsc_passed_moreZ = Nzmsc - Nzmsc_passed_0Z - Nzmsc_passed_1Z;
674  double Nzmsc_MCmatched_passed_0Z = h_zMuSta_MCmatched_numberOfCand_passed->GetBinContent(1);
675  double Nzmsc_MCmatched_passed_1Z = h_zMuSta_MCmatched_numberOfCand_passed->GetBinContent(2);
676  double Nzmsc_MCmatched_passed_moreZ = Nzmsc - Nzmsc_MCmatched_passed_0Z - Nzmsc_MCmatched_passed_1Z;
677  double Nzmtc = h_zMuTrack_numberOfCand->GetEntries();
678  double Nzmtc_0Z = h_zMuTrack_numberOfCand->GetBinContent(1);
679  double Nzmtc_1Z = h_zMuTrack_numberOfCand->GetBinContent(2);
680  double Nzmtc_moreZ = Nzmtc - Nzmtc_0Z - Nzmtc_1Z;
681  double Nzmtc_notcontained_0Z = h_zMuTrack_numberOfCand_notcontained->GetBinContent(1);
682  double Nzmtc_notcontained_1Z = h_zMuTrack_numberOfCand_notcontained->GetBinContent(2);
683  double Nzmtc_notcontained_moreZ = Nzmtc-Nzmtc_notcontained_0Z-Nzmtc_notcontained_1Z;
684  double Nzmtc_passed_0Z = h_zMuTrack_numberOfCand_passed->GetBinContent(1);
685  double Nzmtc_passed_1Z = h_zMuTrack_numberOfCand_passed->GetBinContent(2);
686  double Nzmtc_passed_moreZ = Nzmtc - Nzmtc_passed_0Z - Nzmtc_passed_1Z;
687  double Nzmtc_MCmatched_passed_0Z = h_zMuTrack_MCmatched_numberOfCand_passed->GetBinContent(1);
688  double Nzmtc_MCmatched_passed_1Z = h_zMuTrack_MCmatched_numberOfCand_passed->GetBinContent(2);
689  double Nzmtc_MCmatched_passed_moreZ = Nzmtc - Nzmtc_MCmatched_passed_0Z - Nzmtc_MCmatched_passed_1Z;
690 
691  cout << "--------------- Statistics ----------------------------------------------------------" << endl;
692  cout << "n of ZMuMu entries ...................................................... " << Nzmmc << endl;
693  cout << "n of ZMuMu events with 0 cand ............................................. " << Nzmmc_0Z << endl;
694  cout << "n of ZMuMu events with 1 cand ............................................. " << Nzmmc_1Z << endl;
695  cout << "n of ZMuMu events with 2 or more cand ..................................... " << Nzmmc_moreZ << endl << endl ;
696 
697  cout << "n of ZMuMu events not selected by cuts .................................... " << Nzmmc_passed_0Z << endl;
698  cout << "n of ZMuMu events with 1 cand selected by cuts ............................ " << Nzmmc_passed_1Z << endl;
699  cout << "n of ZMuMu events with 2 or more cand elected by cuts ..................... " << Nzmmc_passed_moreZ << endl<< endl ;
700 
701  cout << "n of ZMuMu events not selected by pt cut .................................. " << Nzmmc_ptpassed_0Z << endl;
702  cout << "n of ZMuMu events with 1 cand selected by pt cut .......................... " << Nzmmc_ptpassed_1Z << endl;
703  cout << "n of ZMuMu events with 2 or more cand elected by pt cut ................... " << Nzmmc_ptpassed_moreZ << endl<< endl ;
704 
705  cout << "n of ZMuMu events not selected by eta cut ................................. " << Nzmmc_etapassed_0Z << endl;
706  cout << "n of ZMuMu events with 1 cand selected by eta cut ......................... " << Nzmmc_etapassed_1Z << endl;
707  cout << "n of ZMuMu events with 2 or more cand elected by eta cut .................. " << Nzmmc_etapassed_moreZ << endl<< endl ;
708 
709  cout << "n of ZMuMu events not selected by mass cut ................................ " << Nzmmc_masspassed_0Z << endl;
710  cout << "n of ZMuMu events with 1 cand selected by mass cut ........................ " << Nzmmc_masspassed_1Z << endl;
711  cout << "n of ZMuMu events with 2 or more cand elected by mass cut ................. " << Nzmmc_masspassed_moreZ << endl<< endl ;
712 
713  cout << "n of ZMuMu events not selected by iso cut ................................. " << Nzmmc_isopassed_0Z << endl;
714  cout << "n of ZMuMu events with 1 cand selected iso cut ............................ " << Nzmmc_isopassed_1Z << endl;
715  cout << "n of ZMuMu events with 2 or more cand elected iso cut ..................... " << Nzmmc_isopassed_moreZ << endl<< endl ;
716 
717  cout << "n of ZMuMu events not selected by pt and eta cut .......................... " << Nzmmc_ptetapassed_0Z << endl;
718  cout << "n of ZMuMu events with 1 cand selected by pt and eta cut .................. " << Nzmmc_ptetapassed_1Z << endl;
719  cout << "n of ZMuMu events with 2 or more cand elected by pt and eta cut ........... " << Nzmmc_ptetapassed_moreZ << endl<< endl ;
720 
721  cout << "n of ZMuMu events not selected by pt and eta and mass cut ................. " << Nzmmc_ptetamasspassed_0Z << endl;
722  cout << "n of ZMuMu events with 1 cand selected by pt and eta and mass cut ......... " << Nzmmc_ptetamasspassed_1Z << endl;
723  cout << "n of ZMuMu events with 2 or more cand elected by pt and eta and mass cut .. " << Nzmmc_ptetamasspassed_moreZ << endl<< endl ;
724 
725  cout << "................When No ZMuMu are selected.................................." << endl;
726  cout << "n of ZMuSta entries ....................................................... " << Nzmsc << endl;
727  cout << "n of ZMuSta events with 0 cand ............................................ " << Nzmsc_0Z << endl;
728  cout << "n of ZMuSta events with 1 cand ............................................ " << Nzmsc_1Z << endl;
729  cout << "n of ZMuSta events with 2 or more cand .................................... " << Nzmsc_moreZ << endl<< endl ;
730 
731  cout << "n of ZMuSta not contained events with 0 cand .............................. " << Nzmsc_notcontained_0Z << endl;
732  cout << "n of ZMuSta events not contained with 1 cand .............................. " << Nzmsc_notcontained_1Z << endl;
733  cout << "n of ZMuSta events no contained with 2 or more cand ....................... " << Nzmsc_notcontained_moreZ << endl<< endl ;
734 
735  cout << "n of ZMuSta cand not selectd by cuts ...................................... " << Nzmsc_passed_0Z << endl;
736  cout << "n of ZMuSta events with 1 cand selected by cuts ........................... " << Nzmsc_passed_1Z << endl;
737  cout << "n of ZMuSta events with 2 or more cand selected by cuts ................... " << Nzmsc_passed_moreZ << endl<< endl ;
738 
739  cout << "n of ZMuSta MCmatched cand not selectd by cuts ............................ " << Nzmsc_MCmatched_passed_0Z << endl;
740  cout << "n of ZMuSta MCmatched events with 1 cand selected by cuts ................. " << Nzmsc_MCmatched_passed_1Z << endl;
741  cout << "n of ZMuSta MCmatched events with 2 or more cand selected by cuts ......... " << Nzmsc_MCmatched_passed_moreZ << endl<< endl ;
742 
743  cout << "...............When no ZMuMu and ZMuSta are selcted........................." << endl;
744  cout << "n of ZMuTrack entries ................................................... " << Nzmtc << endl;
745  cout << "n of ZMuTrack events with 0 cand ..........................................." << Nzmtc_0Z << endl;
746  cout << "n of ZMuTrack events with 1 cand ..........................................." << Nzmtc_1Z << endl;
747  cout << "n of ZMuTrack events with 2 or more cand ..................................." << Nzmtc_moreZ << endl<< endl ;
748 
749  cout << "n of ZMuTrack not contained events with 0 cand ............................ " << Nzmtc_notcontained_0Z << endl;
750  cout << "n of ZMuTrack events not contained with 1 cand ............................ " << Nzmtc_notcontained_1Z << endl;
751  cout << "n of ZMuTrack events no contained with 2 or more cand ..................... " << Nzmtc_notcontained_moreZ << endl<< endl ;
752 
753  cout << "n of ZMuTrack cand not selectd by cuts ....................................." << Nzmtc_passed_0Z << endl;
754  cout << "n of ZMuTrack events with 1 cand selected by cuts .........................." << Nzmtc_passed_1Z << endl;
755  cout << "n of ZMuTrack events with 2 or more cand selected by cuts .................." << Nzmtc_passed_moreZ << endl<< endl ;
756 
757  cout << "n of ZMuTrack MCmatched cand not selectd by cuts .......................... " << Nzmtc_MCmatched_passed_0Z << endl;
758  cout << "n of ZMuTrcak MCmatched events with 1 cand selected by cuts ............... " << Nzmtc_MCmatched_passed_1Z << endl;
759  cout << "n of ZMuTrack MCmatched events with 2 or more cand selected by cuts ....... " << Nzmtc_MCmatched_passed_moreZ << endl;
760 
761  cout << "------------------------------------------------------------------------------------------" << endl;
762 
763  double Nzmm = h_zMuMu_mass_->GetEntries() ;
764  double Nzsm = h_zMuSingleStandAlone_mass_->GetEntries() ;
765  double Nzsnom = h_zMuSingleStandAloneOverlap_mass_->GetEntries() ;
766  double Nztm = h_zMuSingleTrack_mass_->GetEntries();
767 
768  double NzmmMatch = h_zMuMuMatched_mass_->GetEntries() ;
769  double NzsmMatch = h_zMuSingleStandAloneMatched_mass_->GetEntries() ;
770  double NzsnomMatch = h_zMuSingleStandAloneOverlapMatched_mass_->GetEntries() ;
771  double NztmMatch = h_zMuSingleTrackMatched_mass_->GetEntries();
772 
773  cout<<"-- N SingleTrackMu = "<<Nztm<<endl;
774  cout<<"-----N SinglStandAloneMu = "<<Nzsm<<endl;
775  cout<<"-----N SingleStandAloneOverlapMu = "<<Nzsnom<<endl;
776  cout<<"------- N MuMu = "<<Nzmm<<endl;
777 
778  cout<<"-- N SingleTrackMuMatched = "<<NztmMatch<<endl;
779  cout<<"-----N SinglStandAloneMuMatched = "<<NzsmMatch<<endl;
780  cout<<"-----N SingleStandAloneOverlapMuMatched = "<<NzsnomMatch<<endl;
781  cout<<"------- N MuMu Matched = "<<NzmmMatch<<endl;
782 }
783 
785 
787 
int i
Definition: DBlmapReader.cc:9
static bool isContained(const std::vector< unsigned int > &list, int id)
Definition: JetInput.cc:89
virtual const Candidate * daughter(size_type i) const =0
return daughter at a given position, i = 0, ... numberOfDaughters() - 1 (read only mode) ...
virtual float mass() const =0
mass
ProductID id() const
Definition: HandleBase.cc:15
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
stand alone muon component tag
Definition: RecoCandidate.h:72
T * make(const Args &...args) const
make new ROOT object
Definition: TFileService.h:64
virtual void analyze(const edm::Event &event, const edm::EventSetup &setup) override
virtual void endJob() override
ZMuMuAnalyzer_cynematics(const edm::ParameterSet &pset)
virtual size_type numberOfDaughters() const =0
number of daughters
edm::ValueMap< float > IsolationCollection
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
int j
Definition: DBlmapReader.cc:9
T * make(const Args &...args) const
make new ROOT object
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
bool isContained(const Candidate &, const Candidate &)
TFileDirectory mkdir(const std::string &dir, const std::string &descr="")
create a new subdirectory
Definition: TFileService.h:69
conbined muon component tag
Definition: RecoCandidate.h:74
REF castTo() const
cast to a concrete type
Definition: RefToBase.h:241
edm::Ref< TrackCollection > TrackRef
persistent reference to a Track
Definition: TrackFwd.h:14
key_type key() const
Accessor for product key.
Definition: Ref.h:266
double b
Definition: hdecay.h:120
susybsm::MuonSegment ms
Definition: classes.h:31
list key
Definition: combine.py:13
double a
Definition: hdecay.h:121
T get() const
get a component
Definition: Candidate.h:219
tuple cout
Definition: gather_cfg.py:121
ProductID id() const
Accessor for product ID.
Definition: Ref.h:256
ProductIndex id() const
Definition: ProductID.h:38
T const * get() const
Returns C++ pointer to the item.
Definition: Ref.h:242
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")
tuple zMuMu
zMuMu vector of PSet is common to all categories except zMuTrk category
virtual const CandidateBaseRef & masterClone() const =0