CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
ZMuMuAnalyzer_cynematics Class Reference
Inheritance diagram for ZMuMuAnalyzer_cynematics:
edm::EDAnalyzer

Public Member Functions

 ZMuMuAnalyzer_cynematics (const edm::ParameterSet &pset)
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 

Private Member Functions

virtual void analyze (const edm::Event &event, const edm::EventSetup &setup)
 
virtual void endJob ()
 
bool isContained (const Candidate &, const Candidate &)
 

Private Attributes

double binEta
 
double binPhi
 
double binPt
 
double etacut_
 
double etamax
 
double etamin
 
TH2D * h_OneSta_mass
 
TH1D * h_zMuMu_mass_
 
TH1D * h_zMuMu_numberOfCand
 
TH1D * h_zMuMu_numberOfCand_etapassed
 
TH1D * h_zMuMu_numberOfCand_isopassed
 
TH1D * h_zMuMu_numberOfCand_masspassed
 
TH1D * h_zMuMu_numberOfCand_passed
 
TH1D * h_zMuMu_numberOfCand_ptetamasspassed
 
TH1D * h_zMuMu_numberOfCand_ptetapassed
 
TH1D * h_zMuMu_numberOfCand_ptpassed
 
TH1D * h_zMuMuMatched_mass_
 
TH1D * h_zMuSingleStandAlone_mass_
 
TH1D * h_zMuSingleStandAloneMatched_mass_
 
TH1D * h_zMuSingleStandAloneOverlap_mass_
 
TH1D * h_zMuSingleStandAloneOverlapMatched_mass_
 
TH1D * h_zMuSingleTrack_mass_
 
TH1D * h_zMuSingleTrackMatched_mass_
 
TH1D * h_zMuSta_MCmatched_numberOfCand_passed
 
TH1D * h_zMuSta_numberOfCand
 
TH1D * h_zMuSta_numberOfCand_notcontained
 
TH1D * h_zMuSta_numberOfCand_passed
 
TH1D * h_zMuTrack_MCmatched_numberOfCand_passed
 
TH1D * h_zMuTrack_numberOfCand
 
TH1D * h_zMuTrack_numberOfCand_notcontained
 
TH1D * h_zMuTrack_numberOfCand_passed
 
vector< TH1D * > hmumu_eta
 
vector< TH1D * > hmumu_phi
 
vector< TH1D * > hmumu_pt
 
vector< TH1D * > hmusta_eta
 
vector< TH1D * > hmusta_phi
 
vector< TH1D * > hmusta_pt
 
vector< TH1D * > hmutrack_eta
 
vector< TH1D * > hmutrack_phi
 
vector< TH1D * > hmutrack_pt
 
double isocut_
 
double maxZmass_
 
double minZmass_
 
InputTag muIso_
 
int numberOfIntervals
 
OverlapChecker overlap_
 
double phimax
 
double phimin
 
double ptcut_
 
double ptmax
 
double ptmin
 
double ptSTAcut_
 
InputTag standAloneIso_
 
InputTag trackIso_
 
InputTag zMuMu_
 
InputTag zMuMuMap_
 
InputTag zMuStandAlone_
 
InputTag zMuStandAloneMap_
 
InputTag zMuTrack_
 
InputTag zMuTrackMap_
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
typedef WorkerT< EDAnalyzerWorkerType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from edm::EDAnalyzer
CurrentProcessingContext const * currentContext () const
 

Detailed Description

Definition at line 50 of file ZMuMuAnalyzer_cynematics.cc.

Constructor & Destructor Documentation

ZMuMuAnalyzer_cynematics::ZMuMuAnalyzer_cynematics ( const edm::ParameterSet pset)

Definition at line 87 of file ZMuMuAnalyzer_cynematics.cc.

References a, b, binEta, binPhi, binPt, etacut_, etamax, etamin, h_OneSta_mass, h_zMuMu_mass_, h_zMuMu_numberOfCand, h_zMuMu_numberOfCand_etapassed, h_zMuMu_numberOfCand_isopassed, h_zMuMu_numberOfCand_masspassed, h_zMuMu_numberOfCand_passed, h_zMuMu_numberOfCand_ptetamasspassed, h_zMuMu_numberOfCand_ptetapassed, h_zMuMu_numberOfCand_ptpassed, h_zMuMuMatched_mass_, h_zMuSingleStandAlone_mass_, h_zMuSingleStandAloneMatched_mass_, h_zMuSingleStandAloneOverlap_mass_, h_zMuSingleStandAloneOverlapMatched_mass_, h_zMuSingleTrack_mass_, h_zMuSingleTrackMatched_mass_, h_zMuSta_MCmatched_numberOfCand_passed, h_zMuSta_numberOfCand, h_zMuSta_numberOfCand_notcontained, h_zMuSta_numberOfCand_passed, h_zMuTrack_MCmatched_numberOfCand_passed, h_zMuTrack_numberOfCand, h_zMuTrack_numberOfCand_notcontained, h_zMuTrack_numberOfCand_passed, hmumu_eta, hmumu_phi, hmumu_pt, hmusta_eta, hmusta_phi, hmusta_pt, hmutrack_eta, hmutrack_phi, hmutrack_pt, i, TFileDirectory::make(), TFileDirectory::mkdir(), numberOfIntervals, phimax, phimin, ptcut_, ptmax, and ptmin.

87  :
88  zMuMu_( pset.getParameter<InputTag>( "zMuMu" ) ),
89  zMuTrack_( pset.getParameter<InputTag>( "zMuTrack" ) ),
90  zMuStandAlone_( pset.getParameter<InputTag>( "zMuStandAlone" ) ),
91  muIso_( pset.getParameter<InputTag>( "muIso" ) ),
92  trackIso_( pset.getParameter<InputTag>( "trackIso" ) ),
93  standAloneIso_( pset.getParameter<InputTag>( "standAloneIso" ) ),
94  zMuMuMap_( pset.getParameter<InputTag>( "zMuMuMap" ) ),
95  zMuTrackMap_( pset.getParameter<InputTag>( "zMuTrackMap" ) ),
96  zMuStandAloneMap_( pset.getParameter<InputTag>( "zMuStandAloneMap" ) ),
97  isocut_( pset.getParameter<double>( "isocut" ) ),
98  etacut_( pset.getParameter<double>( "etacut" ) ),
99  ptcut_( pset.getParameter<double>( "ptcut" ) ),
100  ptSTAcut_( pset.getParameter<double>( "ptSTAcut" ) ),
101  minZmass_( pset.getParameter<double>( "minZmass" )),
102  maxZmass_( pset.getParameter<double>( "maxZmass" )) {
103 
105  h_zMuMu_numberOfCand = fs->make<TH1D>("ZMuMunumberOfCand","number of ZMuMu cand",10, -.5, 9.5);
106  h_zMuMu_numberOfCand_passed = fs->make<TH1D>("ZMuMunumberOfCandpassed","number of ZMuMu cand selected",10, -.5, 9.5);
107  h_zMuMu_numberOfCand_ptpassed = fs->make<TH1D>("ZMuMunumberOfCandptpassed","number of ZMuMu cand after pt cut selected",10, -.5, 9.5);
108  h_zMuMu_numberOfCand_etapassed = fs->make<TH1D>("ZMuMunumberOfCandetapassed","number of ZMuMu cand after eta cut selected",10, -.5, 9.5);
109  h_zMuMu_numberOfCand_masspassed = fs->make<TH1D>("ZMuMunumberOfCandmasspassed","number of ZMuMu cand after mass cut selected",10, -.5, 9.5);
110  h_zMuMu_numberOfCand_isopassed = fs->make<TH1D>("ZMuMunumberOfCandisopassed","number of ZMuMu cand after iso cut selected",10, -.5, 9.5);
111  h_zMuMu_numberOfCand_ptetapassed = fs->make<TH1D>("ZMuMunumberOfCandptetapassed","number of ZMuMu cand after pt & eta cut selected",10, -.5, 9.5);
112  h_zMuMu_numberOfCand_ptetamasspassed = fs->make<TH1D>("ZMuMunumberOfCandptetamaspassed","number of ZMuMu cand after pt & eta & mass cut selected",10, -.5, 9.5);
113 
114 
115  h_zMuMu_mass_ = fs->make<TH1D>( "ZMuMumass", "ZMuMu mass(GeV)", 200, 0., 200. );
116  h_zMuSingleTrack_mass_ = fs->make<TH1D>( "ZMuSingleTrackmass", "ZMuSingleTrack mass(GeV)", 100, 0., 200. );
117  h_zMuSingleStandAlone_mass_ = fs->make<TH1D>( "ZMuSingleStandAlonemass", "ZMuSingleStandAlone mass(GeV)", 50, 0., 200. );
118  h_zMuSingleStandAloneOverlap_mass_ = fs->make<TH1D>( "ZMuSingleStandAloneOverlapmass", "ZMuSingleStandAloneOverlap mass(GeV)", 50, 0., 200. );
119 
120 
121  h_zMuMuMatched_mass_ = fs->make<TH1D>( "ZMuMuMatchedmass", "ZMuMu Matched mass(GeV)", 200, 0., 200. );
122  h_zMuSingleTrackMatched_mass_ = fs->make<TH1D>( "ZMuSingleTrackmassMatched", "ZMuSingleTrackMatched mass(GeV)", 100, 0., 200. );
123  h_zMuSingleStandAloneMatched_mass_ = fs->make<TH1D>( "ZMuSingleStandAlonemassMatched", "ZMuSingleStandAloneMatched mass(GeV)", 50, 0., 200. );
124  h_zMuSingleStandAloneOverlapMatched_mass_ = fs->make<TH1D>( "ZMuSingleStandAloneOverlapmassMatched", "ZMuSingleStandAloneMatched Overlap mass(GeV)", 50, 0., 200. );
125 
126  h_zMuSta_numberOfCand = fs->make<TH1D>("ZMuStanumberOfCand","number of ZMuSta cand (if ZMuMu not selected)",10, -.5, 9.5);
127  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.);
128  h_zMuSta_numberOfCand_notcontained = fs->make<TH1D>("ZMuStanumberOfCandnotcontained","number of independent ZMuSta cand (if ZMuMu not selected)",10, -.5, 9.5);
129  h_zMuSta_numberOfCand_passed = fs->make<TH1D>("ZMuStanumberOfCandpassed","number of ZMuSta cand selected (if ZMuMu not selected)",10, -.5, 9.5);
130  h_zMuSta_MCmatched_numberOfCand_passed = fs->make<TH1D>("ZMuStaMCmatchedNumberOfCandpassed","number of ZMuSta MC matched cand selected (if ZMuMu not selected)",10, -.5, 9.5);
131  h_zMuTrack_numberOfCand = fs->make<TH1D>("ZMuTranumberOfCand","number of ZMuTrack cand (if ZMuMu and ZMuSTa not selected)",10, -.5, 9.5);
132  h_zMuTrack_numberOfCand_notcontained = fs->make<TH1D>("ZMuTranumberOfCandnotcontaind","number of indeendent ZMuTrack cand (if ZMuMu and ZMuSTa not selected)",10, -.5, 9.5);
133  h_zMuTrack_numberOfCand_passed = fs->make<TH1D>("ZMuTranumberOfCandpassed","number of ZMuTrack cand selected (if ZMuMu and ZMuSta not selected)",10, -.5, 9.5);
134  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);
135 
136 
137  // creating histograms for each Pt, eta, phi interval
138 
139  etamin = -etacut_;
140  etamax = etacut_;
141  phimin = -3.1415;
142  phimax = 3.1415;
143  ptmin = ptcut_;
144  ptmax = 100;
145  numberOfIntervals = 8; // number of intervals in which to divide cynematic variables
149  TFileDirectory etaDirectory = fs->mkdir("etaIntervals"); // in this directory will be saved all the histos of different eta intervals
150  TFileDirectory phiDirectory = fs->mkdir("phiIntervals"); // in this directory will be saved all the histos of different phi intervals
151  TFileDirectory ptDirectory = fs->mkdir("ptIntervals"); // in this directory will be saved all the histos of different pt intervals
152 
153  // eta histograms creation
154 
155  for (int i=0;i<numberOfIntervals;i++) {
156  double range0 = etamin + i*binEta;
157  double range1= range0 + binEta;
158  char a[30], b[50];
159  sprintf(a,"zmumu_etaRange%d",i);
160  sprintf(b,"zmumu mass eta Range %f to %f",range0,range1);
161  hmumu_eta.push_back(etaDirectory.make<TH1D>(a,b,200,0.,200.));
162  char asta[30], bsta[50];
163  sprintf(asta,"zmusta_etaRange%d",i);
164  sprintf(bsta,"zmusta mass eta Range %f to %f",range0,range1);
165  hmusta_eta.push_back(etaDirectory.make<TH1D>(asta,bsta,50,0.,200.));
166  char atk[30], btk[50];
167  sprintf(atk,"zmutrack_etaRange%d",i);
168  sprintf(btk,"zmutrack mass eta Range %f to %f",range0,range1);
169  hmutrack_eta.push_back(etaDirectory.make<TH1D>(atk,btk,100,0.,200.));
170  }
171 
172  // phi histograms creation
173 
174  for (int i=0;i<numberOfIntervals;i++) {
175  double range0 = phimin + i*binPhi;
176  double range1= range0 + binPhi;
177  char a[30], b[50];
178  sprintf(a,"zmumu_phiRange%d",i);
179  sprintf(b,"zmumu mass phi Range %f to %f",range0,range1);
180  hmumu_phi.push_back(phiDirectory.make<TH1D>(a,b,200,0.,200.));
181  char asta[30], bsta[50];
182  sprintf(asta,"zmusta_phiRange%d",i);
183  sprintf(bsta,"zmusta mass phi Range %f to %f",range0,range1);
184  hmusta_phi.push_back(phiDirectory.make<TH1D>(asta,bsta,50,0.,200.));
185  char atk[30], btk[50];
186  sprintf(atk,"zmutrack_phiRange%d",i);
187  sprintf(btk,"zmutrack mass phi Range %f to %f",range0,range1);
188  hmutrack_phi.push_back(phiDirectory.make<TH1D>(atk,btk,100,0.,200.));
189  }
190 
191  // pt histograms creation
192 
193  for (int i=0;i<numberOfIntervals;i++) {
194  double range0 = ptmin + i*binPt;
195  double range1= range0 + binPt;
196  char a[30], b[50];
197  sprintf(a,"zmumu_ptRange%d",i);
198  sprintf(b,"zmumu mass pt Range %f to %f",range0,range1);
199  hmumu_pt.push_back(ptDirectory.make<TH1D>(a,b,200,0.,200.));
200  char asta[30], bsta[50];
201  sprintf(asta,"zmusta_ptRange%d",i);
202  sprintf(bsta,"zmusta mass pt Range %f to %f",range0,range1);
203  hmusta_pt.push_back(ptDirectory.make<TH1D>(asta,bsta,50,0.,200.));
204  char atk[30], btk[50];
205  sprintf(atk,"zmutrack_ptRange%d",i);
206  sprintf(btk,"zmutrack mass pt Range %f to %f",range0,range1);
207  hmutrack_pt.push_back(ptDirectory.make<TH1D>(atk,btk,100,0.,200.));
208  }
209  }
T getParameter(std::string const &) const
int i
Definition: DBlmapReader.cc:9
TFileDirectory mkdir(const std::string &dir, const std::string &descr="")
create a new subdirectory
double b
Definition: hdecay.h:120
double a
Definition: hdecay.h:121
T * make() const
make new ROOT object

Member Function Documentation

void ZMuMuAnalyzer_cynematics::analyze ( const edm::Event event,
const edm::EventSetup setup 
)
privatevirtual

Implements edm::EDAnalyzer.

Definition at line 211 of file ZMuMuAnalyzer_cynematics.cc.

References binEta, binPhi, binPt, edm::RefToBase< T >::castTo(), gather_cfg::cout, reco::Candidate::daughter(), etacut_, etamin, HcalObjRepresent::Fill(), edm::Ref< C, T, F >::get(), h_zMuMu_mass_, h_zMuMu_numberOfCand, h_zMuMu_numberOfCand_etapassed, h_zMuMu_numberOfCand_isopassed, h_zMuMu_numberOfCand_masspassed, h_zMuMu_numberOfCand_passed, h_zMuMu_numberOfCand_ptetamasspassed, h_zMuMu_numberOfCand_ptetapassed, h_zMuMu_numberOfCand_ptpassed, h_zMuMuMatched_mass_, h_zMuSingleStandAlone_mass_, h_zMuSingleStandAloneMatched_mass_, h_zMuSingleTrack_mass_, h_zMuSingleTrackMatched_mass_, h_zMuSta_MCmatched_numberOfCand_passed, h_zMuSta_numberOfCand, h_zMuSta_numberOfCand_notcontained, h_zMuSta_numberOfCand_passed, h_zMuTrack_MCmatched_numberOfCand_passed, h_zMuTrack_numberOfCand, h_zMuTrack_numberOfCand_notcontained, h_zMuTrack_numberOfCand_passed, hmumu_eta, hmumu_phi, hmumu_pt, hmusta_eta, hmusta_phi, hmusta_pt, hmutrack_eta, hmutrack_phi, hmutrack_pt, i, edm::ProductID::id(), edm::HandleBase::id(), edm::Ref< C, T, F >::id(), isContained(), isocut_, j, edm::Ref< C, T, F >::key(), m, reco::Candidate::mass(), reco::Candidate::masterClone(), maxZmass_, minZmass_, muIso_, numberOfIntervals, phimin, ptcut_, ptmin, ptSTAcut_, standAloneIso_, trackIso_, ZMuMuAnalysisNtupler_cff::zMuMu, zMuMu_, zMuMuMap_, zMuStandAlone_, zMuStandAloneMap_, zMuTrack_, and zMuTrackMap_.

211  {
213  event.getByLabel(zMuMu_, zMuMu);
215  event.getByLabel( zMuTrack_, zMuTrack );
216  Handle<CandidateCollection> zMuStandAlone;
217  event.getByLabel( zMuStandAlone_, zMuStandAlone );
218 
219  unsigned int nZMuMu = zMuMu->size();
220  unsigned int nZTrackMu = zMuTrack->size();
221  unsigned int nZStandAloneMu = zMuStandAlone->size();
222  // static const double zMass = 91.1876; // PDG Z mass
223 
224  cout << "++++++++++++++++++++++++++" << endl;
225  cout << "nZMuMu = " << nZMuMu << endl;
226  cout << "nZTrackMu = " << nZTrackMu << endl;
227  cout << "nZStandAloneMu = " << nZStandAloneMu << endl;
228  cout << "++++++++++++++++++++++++++" << endl;
229 
230  // ZMuMu counters
231 
232  int ZMuMu_passed = 0;
233  int ZMuMu_ptcut_counter = 0;
234  int ZMuMu_etacut_counter = 0;
235  int ZMuMu_masscut_counter = 0;
236  int ZMuMu_isocut_counter = 0;
237  int ZMuMu_ptetacut_counter = 0;
238  int ZMuMu_ptetamasscut_counter = 0;
239  int ZMuMu_allcut_counter = 0;
240 
241  // ZMuTrack counters
242 
243  int ZMuTrack_passed = 0;
244  int ZMuTrack_notcontained = 0;
245  int ZMuTrack_MCmatched_passed = 0;
246 
247  // ZMuStandalone counters
248  int ZMuStandalone_notcontained = 0;
249  int ZMuStandalone_passed = 0;
250  int ZMuStandalone_MCmatched_passed = 0;
251 
252  Handle<CandMatchMap> zMuMuMap;
253  if( nZMuMu > 0 ) {
254  event.getByLabel(zMuMuMap_, zMuMuMap);
255  }
256 
257  Handle<CandMatchMap> zMuTrackMap;
258  if( nZTrackMu > 0 ) {
259  event.getByLabel( zMuTrackMap_, zMuTrackMap );
260  }
261 
262  Handle<CandMatchMap> zMuStandAloneMap;
263  if( nZStandAloneMu > 0 ) {
264  event.getByLabel( zMuStandAloneMap_, zMuStandAloneMap );
265  }
266 
268  event.getByLabel(muIso_, muIso);
269  ProductID muIsoId = muIso->keyProduct().id();
271  event.getByLabel(trackIso_, trackIso);
272  ProductID trackIsoId = trackIso->keyProduct().id();
273 
274  Handle<IsolationCollection> standAloneIso;
275  event.getByLabel(standAloneIso_, standAloneIso);
276  ProductID standAloneIsoId = standAloneIso->keyProduct().id();
277 
278  if (nZMuMu > 0) {
279  // double mass = 1000000.;
280  for( unsigned int i = 0; i < nZMuMu; i++ ) {
281  bool ptcutAccept = false;
282  bool etacutAccept = false;
283  bool masscutAccept = false;
284  bool isocutAccept = false;
285  const Candidate & zmmCand = (*zMuMu)[ i ];
286  CandidateRef CandRef(zMuMu,i);
287  CandidateRef lep1 = zmmCand.daughter( 0 )->masterClone().castTo<CandidateRef>();
288  CandidateRef lep2 = zmmCand.daughter( 1 )->masterClone().castTo<CandidateRef>();
289 
290  const double iso1 = muIso->value( lep1.key() );
291  const double iso2 = muIso->value( lep2.key() );
292 
293  double m = zmmCand.mass();
294  // check single cuts
295 
296  if (lep1->pt()>ptcut_ && lep2->pt()>ptcut_) ptcutAccept = true;
297  if (fabs(lep1->eta())<etacut_ && fabs(lep2->eta())<etacut_) etacutAccept = true;
298  if (m>minZmass_ && m<maxZmass_) masscutAccept = true;
299  if (iso1 < isocut_ && iso2 <isocut_) isocutAccept = true;
300 
301 
302  if (ptcutAccept) ZMuMu_ptcut_counter++;
303  if (etacutAccept) ZMuMu_etacut_counter++;
304  if (masscutAccept) ZMuMu_masscut_counter++;
305  if (isocutAccept) ZMuMu_isocut_counter++;
306 
307  // check sequencial cuts
308 
309  if (ptcutAccept && etacutAccept) {
310  ZMuMu_ptetacut_counter++;
311  if (masscutAccept) {
312  ZMuMu_ptetamasscut_counter++;
313  if (isocutAccept) {
314  ZMuMu_passed++;}
315  }
316  }
317 
318  if (ptcutAccept && etacutAccept && masscutAccept && isocutAccept) {
319  ZMuMu_allcut_counter++;
320  h_zMuMu_mass_->Fill( m );
321 
322  // check the cynematics to fill correct histograms
323  for (int j=0;j<numberOfIntervals;j++) {
324  bool statusBinEta = false;
325  bool statusBinPhi = false;
326  bool statusBinPt = false;
327  double range0 = etamin + j*binEta;
328  double range1= range0 + binEta;
329  double range0phi = phimin + j*binPhi;
330  double range1phi= range0phi + binPhi;
331  double range0pt = ptmin + j*binPt;
332  double range1pt = range0pt + binPt;
333  // eta histograms
334  if (lep1->eta()>=range0 && lep1->eta()<range1)
335  {
336  hmumu_eta[j]->Fill(m);
337  statusBinEta = true;
338  }
339  if (lep2->eta()>=range0 && lep2->eta()<range1 && !statusBinEta){
340  hmumu_eta[j]->Fill(m); // If eta1 is in the same bin of eta2 fill just once
341  }
342  // phi histograms
343  if (lep1->phi()>=range0phi && lep1->phi()<range1phi)
344  {
345  hmumu_phi[j]->Fill(m);
346  statusBinPhi = true;
347  }
348  if (lep2->phi()>=range0phi && lep2->phi()<range1phi && !statusBinPhi){
349  hmumu_phi[j]->Fill(m); // If phi1 is in the same bin of phi2 fill just once
350  }
351  // pt histograms
352  if (lep1->pt()>=range0pt && lep1->pt()<range1pt)
353  {
354  hmumu_pt[j]->Fill(m);
355  statusBinPt = true;
356  }
357  if (lep2->pt()>=range0pt && lep2->pt()<range1pt && !statusBinPt){
358  hmumu_pt[j]->Fill(m); // If pt1 is in the same bin of pt2 fill just once
359  }
360  }
361 
362  CandMatchMap::const_iterator m0 = zMuMuMap->find(CandRef);
363  if( m0 != zMuMuMap->end()) { // the Z is matched to MC thruth
364  h_zMuMuMatched_mass_->Fill( m );
365  }
366  }
367  }
368  }
369 
370  h_zMuMu_numberOfCand->Fill(nZMuMu); // number of Z cand found per event
371  h_zMuMu_numberOfCand_passed->Fill(ZMuMu_allcut_counter); // number of Z cand after all cuts found per event
372  h_zMuMu_numberOfCand_ptpassed->Fill(ZMuMu_ptcut_counter); // number of Z cand afer pt cut found per event
373  h_zMuMu_numberOfCand_etapassed->Fill(ZMuMu_etacut_counter); // number of Z cand afer eta cut found per event
374  h_zMuMu_numberOfCand_masspassed->Fill(ZMuMu_masscut_counter); // number of Z cand afer mass cut found per event
375  h_zMuMu_numberOfCand_isopassed->Fill(ZMuMu_isocut_counter); // number of Z cand afer iso cut found per event
376  h_zMuMu_numberOfCand_ptetapassed->Fill(ZMuMu_ptetacut_counter); // number of Z cand afer pt&eta cut found per event
377  h_zMuMu_numberOfCand_ptetamasspassed->Fill(ZMuMu_ptetamasscut_counter); // number of Z cand afer pt&eta&mass cut found per event
378 
379 
380  //ZmuSingleStandAlone (check MuStandalone if MuMu has not been selected by cuts)
381  // cout << "ZMuMuanalyzer : n of zMuMu " << nZMuMu << " passed " << ZMuMu_passed << " n. of zStaMu " << nZStandAloneMu << endl;
382 
383  if (ZMuMu_passed == 0 && nZStandAloneMu>0 ) {
384  // unsigned int index = 1000;
385  for( unsigned int j = 0; j < nZStandAloneMu; j++ ) {
386  const Candidate & zsmCand = (*zMuStandAlone)[ j ];
387  bool skipZ = false;
388  for( unsigned int i = 0; i < nZMuMu; i++ ) { // chek if the ZMuSTandalone is contained in a ZMuMu
389  const Candidate & zmmCand = (*zMuMu)[ i ]; // if yes .. the event has to be skipped
390  if (isContained(zmmCand,zsmCand)) skipZ=true;
391  }
392  if (!skipZ) { // ZSMuSTandalone not contained in a ZMuMu
393  ZMuStandalone_notcontained++;
394  CandidateRef CandRef(zMuStandAlone,j);
395  CandidateRef lep1 = zsmCand.daughter( 0 )->masterClone().castTo<CandidateRef>();
396  CandidateRef lep2 = zsmCand.daughter( 1 )->masterClone().castTo<CandidateRef>();
397 
398  ProductID id1 = lep1.id();
399  ProductID id2 = lep2.id();
400  double iso1 = -1;
401  double iso2 = -1;
402 
403  if( id1 == muIsoId )
404  iso1 = muIso->value( lep1.key() );
405  else if ( id1 == standAloneIsoId )
406  iso1 = standAloneIso->value( lep1.key() );
407 
408  if( id2 == muIsoId )
409  iso2 = muIso->value( lep2.key() );
410  else if ( id2 == standAloneIsoId )
411  iso2 = standAloneIso->value( lep2.key() );
412 
413  double ms = zsmCand.mass();
414  if (lep1->pt()>ptSTAcut_ && lep2->pt()>ptSTAcut_ &&
415  fabs(lep1->eta())<etacut_ && fabs(lep2->eta())<etacut_ &&
416  ms>minZmass_ && ms<maxZmass_ && iso1<isocut_ && iso2 <isocut_) {
417  h_zMuSingleStandAlone_mass_->Fill( ms );
418  ZMuStandalone_passed++;
419  // check the cynematics to fill correct histograms
420  for (int j=0;j<numberOfIntervals;j++) {
421  double range0 = etamin + j*binEta;
422  double range1= range0 + binEta;
423  double range0phi = phimin + j*binPhi;
424  double range1phi= range0phi + binPhi;
425  double range0pt = ptmin + j*binPt;
426  double range1pt = range0pt + binPt;
427 
428  // check which muon is a standalone (standalone means that there is a reference missing.)
429  if ((lep1->get<TrackRef,reco::StandAloneMuonTag>()).isNull())
430  {
431  if (lep1->eta()>=range0 && lep1->eta()<range1) hmusta_eta[j]->Fill(ms);
432  if (lep1->phi()>=range0phi && lep1->phi()<range1phi) hmusta_phi[j]->Fill(ms);
433  if (lep1->pt()>=range0pt && lep1->pt()<range1pt) hmusta_pt[j]->Fill(ms);
434  }
435  if ((lep2->get<TrackRef,reco::StandAloneMuonTag>()).isNull())
436  {
437  if (lep2->eta()>=range0 && lep2->eta()<range1) hmusta_eta[j]->Fill(ms);
438  if (lep2->phi()>=range0phi && lep2->phi()<range1phi) hmusta_phi[j]->Fill(ms);
439  if (lep2->pt()>=range0pt && lep2->pt()<range1pt) hmusta_pt[j]->Fill(ms);
440  }
441 
442  }
443  CandMatchMap::const_iterator m0 = zMuStandAloneMap->find(CandRef);
444  if( m0 != zMuStandAloneMap->end()) {
445  ZMuStandalone_MCmatched_passed++;
447  }
448  }
449  }
450  }
451  h_zMuSta_numberOfCand->Fill(nZStandAloneMu); // number of ZMuStandalone cand found per event (no higher priority Z selected)
452  h_zMuSta_numberOfCand_notcontained->Fill(ZMuStandalone_notcontained);
453  h_zMuSta_numberOfCand_passed->Fill(ZMuStandalone_passed); // number of ZMuSTa cand after all cuts found per event (no higher prioriy Z selected)
454  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)
455 
456  }
457 
458  //ZmuSingleTRack (check MuTrack if MuMu has not been selected)
459  if (ZMuMu_passed == 0 && ZMuStandalone_passed == 0 && nZTrackMu>0) {
460  for( unsigned int j = 0; j < nZTrackMu; j++ ) {
461  const Candidate & ztmCand = (*zMuTrack)[ j ];
462  bool skipZ = false;
463  for( unsigned int i = 0; i < nZMuMu; i++ ) { // chek if the ZMuTrack is contained in a ZMuMu
464  const Candidate & zmmCand = (*zMuMu)[ i ]; // if yes .. the event has to be skipped
465  if (isContained(zmmCand,ztmCand)) skipZ=true;
466  }
467  if (!skipZ) {
468  ZMuTrack_notcontained++;
469  CandidateRef CandRef(zMuTrack,j);
470  CandidateRef lep1 = ztmCand.daughter( 0 )->masterClone().castTo<CandidateRef>();
471  CandidateRef lep2 = ztmCand.daughter( 1 )->masterClone().castTo<CandidateRef>();
472 
473  ProductID id1 = lep1.id();
474  ProductID id2 = lep2.id();
475  double iso1 = -1;
476  double iso2 = -1;
477 
478  if( id1 == muIsoId )
479  iso1 = muIso->value( lep1.key() );
480  else if ( id1 == trackIsoId )
481  iso1 = trackIso->value( lep1.key() );
482 
483  if( id2 == muIsoId )
484  iso2 = muIso->value( lep2.key() );
485  else if ( id2 == trackIsoId )
486  iso2 = trackIso->value( lep2.key() );
487 
488  double mt = ztmCand.mass();
489  if (lep1->pt()>ptcut_ && lep2->pt()>ptcut_ &&
490  fabs(lep1->eta())<etacut_ && fabs(lep2->eta())<etacut_ &&
491  mt>minZmass_ && mt<maxZmass_ && iso1<isocut_ && iso2 <isocut_) {
492  h_zMuSingleTrack_mass_->Fill( mt );
493  ZMuTrack_passed++;
494 
495  // check the cynematics to fill correct histograms
496  for (int j=0;j<numberOfIntervals;j++) {
497  double range0 = etamin + j*binEta;
498  double range1= range0 + binEta;
499  double range0phi = phimin + j*binPhi;
500  double range1phi= range0phi + binPhi;
501  double range0pt = ptmin + j*binPt;
502  double range1pt = range0pt + binPt;
503 
504  // check which muon is a track only (track only means that there is a reference missing.)
505  if ((lep1->get<TrackRef,reco::StandAloneMuonTag>()).isNull())
506  {
507  if (lep1->eta()>=range0 && lep1->eta()<range1) hmutrack_eta[j]->Fill(mt);
508  if (lep1->phi()>=range0phi && lep1->phi()<range1phi) hmutrack_phi[j]->Fill(mt);
509  if (lep1->pt()>=range0pt && lep1->pt()<range1pt) hmutrack_pt[j]->Fill(mt);
510  }
511  if ((lep2->get<TrackRef,reco::StandAloneMuonTag>()).isNull())
512  {
513  if (lep2->eta()>=range0 && lep2->eta()<range1) hmutrack_eta[j]->Fill(mt);
514  if (lep2->phi()>=range0phi && lep2->phi()<range1phi) hmutrack_phi[j]->Fill(mt);
515  if (lep2->pt()>=range0pt && lep2->pt()<range1pt) hmutrack_pt[j]->Fill(mt);
516  }
517  }
518  CandMatchMap::const_iterator m0 = zMuTrackMap->find(CandRef);
519  if( m0 != zMuTrackMap->end()) {
520  ZMuTrack_MCmatched_passed++;
521  h_zMuSingleTrackMatched_mass_->Fill( mt );
522  }
523  }
524  }
525  }
526  h_zMuTrack_numberOfCand->Fill(nZTrackMu); // number of ZMuTrack cand found per event (no higher priority Z selected)
527  h_zMuTrack_numberOfCand_notcontained->Fill(ZMuTrack_notcontained); // number of ZMuTrack cand not cntained in ZMuMu (no higher priority Z selected)
528 
529  h_zMuTrack_numberOfCand_passed->Fill(ZMuTrack_passed); // number of ZMuTrack cand after all cuts found per event (no higher priority Z selected)
530 
531  h_zMuTrack_MCmatched_numberOfCand_passed->Fill(ZMuTrack_MCmatched_passed);
532 
533  }
534 }
int i
Definition: DBlmapReader.cc:9
virtual const Candidate * daughter(size_type i) const =0
return daughter at a given position, i = 0, ... numberOfDaughters() - 1 (read only mode) ...
ProductID id() const
Definition: HandleBase.cc:15
virtual double mass() const =0
mass
stand alone muon component tag
Definition: RecoCandidate.h:76
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
int j
Definition: DBlmapReader.cc:9
bool isContained(const Candidate &, const Candidate &)
REF castTo() const
cast to a concrete type
Definition: RefToBase.h:241
key_type key() const
Accessor for product key.
Definition: Ref.h:266
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
tuple zMuMu
zMuMu vector of PSet is common to all categories except zMuTrk category
virtual const CandidateBaseRef & masterClone() const =0
void ZMuMuAnalyzer_cynematics::endJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 636 of file ZMuMuAnalyzer_cynematics.cc.

References gather_cfg::cout, h_zMuMu_mass_, h_zMuMu_numberOfCand, h_zMuMu_numberOfCand_etapassed, h_zMuMu_numberOfCand_isopassed, h_zMuMu_numberOfCand_masspassed, h_zMuMu_numberOfCand_passed, h_zMuMu_numberOfCand_ptetamasspassed, h_zMuMu_numberOfCand_ptetapassed, h_zMuMu_numberOfCand_ptpassed, h_zMuMuMatched_mass_, h_zMuSingleStandAlone_mass_, h_zMuSingleStandAloneMatched_mass_, h_zMuSingleStandAloneOverlap_mass_, h_zMuSingleStandAloneOverlapMatched_mass_, h_zMuSingleTrack_mass_, h_zMuSingleTrackMatched_mass_, h_zMuSta_MCmatched_numberOfCand_passed, h_zMuSta_numberOfCand, h_zMuSta_numberOfCand_notcontained, h_zMuSta_numberOfCand_passed, h_zMuTrack_MCmatched_numberOfCand_passed, h_zMuTrack_numberOfCand, h_zMuTrack_numberOfCand_notcontained, and h_zMuTrack_numberOfCand_passed.

636  {
637 
638  // candidate analysis
639  // ZMuMu
640  double Nzmmc = h_zMuMu_numberOfCand->GetEntries();
641  double Nzmmc_0Z = h_zMuMu_numberOfCand->GetBinContent(1);
642  double Nzmmc_1Z = h_zMuMu_numberOfCand->GetBinContent(2);
643  double Nzmmc_moreZ = Nzmmc-Nzmmc_0Z-Nzmmc_1Z;
644  double Nzmmc_passed_0Z = h_zMuMu_numberOfCand_passed->GetBinContent(1);
645  double Nzmmc_passed_1Z = h_zMuMu_numberOfCand_passed->GetBinContent(2);
646  double Nzmmc_passed_moreZ = Nzmmc-Nzmmc_passed_0Z-Nzmmc_passed_1Z;
647  double Nzmmc_ptpassed_0Z = h_zMuMu_numberOfCand_ptpassed->GetBinContent(1);
648  double Nzmmc_ptpassed_1Z = h_zMuMu_numberOfCand_ptpassed->GetBinContent(2);
649  double Nzmmc_etapassed_0Z = h_zMuMu_numberOfCand_etapassed->GetBinContent(1);
650  double Nzmmc_etapassed_1Z = h_zMuMu_numberOfCand_etapassed->GetBinContent(2);
651  double Nzmmc_masspassed_0Z = h_zMuMu_numberOfCand_masspassed->GetBinContent(1);
652  double Nzmmc_masspassed_1Z = h_zMuMu_numberOfCand_masspassed->GetBinContent(2);
653  double Nzmmc_isopassed_0Z = h_zMuMu_numberOfCand_isopassed->GetBinContent(1);
654  double Nzmmc_isopassed_1Z = h_zMuMu_numberOfCand_isopassed->GetBinContent(2);
655  double Nzmmc_ptetapassed_0Z = h_zMuMu_numberOfCand_ptetapassed->GetBinContent(1);
656  double Nzmmc_ptetapassed_1Z = h_zMuMu_numberOfCand_ptetapassed->GetBinContent(2);
657  double Nzmmc_ptetamasspassed_0Z = h_zMuMu_numberOfCand_ptetamasspassed->GetBinContent(1);
658  double Nzmmc_ptetamasspassed_1Z = h_zMuMu_numberOfCand_ptetamasspassed->GetBinContent(2);
659  double Nzmmc_ptpassed_moreZ = Nzmmc-Nzmmc_ptpassed_0Z-Nzmmc_ptpassed_1Z;
660  double Nzmmc_etapassed_moreZ = Nzmmc-Nzmmc_etapassed_0Z-Nzmmc_etapassed_1Z;
661  double Nzmmc_masspassed_moreZ = Nzmmc-Nzmmc_masspassed_0Z-Nzmmc_masspassed_1Z;
662  double Nzmmc_isopassed_moreZ = Nzmmc-Nzmmc_isopassed_0Z-Nzmmc_isopassed_1Z;
663  double Nzmmc_ptetapassed_moreZ = Nzmmc-Nzmmc_ptetapassed_0Z-Nzmmc_ptetapassed_1Z;
664  double Nzmmc_ptetamasspassed_moreZ = Nzmmc-Nzmmc_ptetamasspassed_0Z-Nzmmc_ptetamasspassed_1Z;
665  double Nzmsc = h_zMuSta_numberOfCand->GetEntries();
666  double Nzmsc_0Z = h_zMuSta_numberOfCand->GetBinContent(1);
667  double Nzmsc_1Z = h_zMuSta_numberOfCand->GetBinContent(2);
668  double Nzmsc_moreZ = Nzmsc - Nzmsc_0Z - Nzmsc_1Z;
669  double Nzmsc_notcontained_0Z = h_zMuSta_numberOfCand_notcontained->GetBinContent(1);
670  double Nzmsc_notcontained_1Z = h_zMuSta_numberOfCand_notcontained->GetBinContent(2);
671  double Nzmsc_notcontained_moreZ = Nzmsc-Nzmsc_notcontained_0Z-Nzmsc_notcontained_1Z;
672  double Nzmsc_passed_0Z = h_zMuSta_numberOfCand_passed->GetBinContent(1);
673  double Nzmsc_passed_1Z = h_zMuSta_numberOfCand_passed->GetBinContent(2);
674  double Nzmsc_passed_moreZ = Nzmsc - Nzmsc_passed_0Z - Nzmsc_passed_1Z;
675  double Nzmsc_MCmatched_passed_0Z = h_zMuSta_MCmatched_numberOfCand_passed->GetBinContent(1);
676  double Nzmsc_MCmatched_passed_1Z = h_zMuSta_MCmatched_numberOfCand_passed->GetBinContent(2);
677  double Nzmsc_MCmatched_passed_moreZ = Nzmsc - Nzmsc_MCmatched_passed_0Z - Nzmsc_MCmatched_passed_1Z;
678  double Nzmtc = h_zMuTrack_numberOfCand->GetEntries();
679  double Nzmtc_0Z = h_zMuTrack_numberOfCand->GetBinContent(1);
680  double Nzmtc_1Z = h_zMuTrack_numberOfCand->GetBinContent(2);
681  double Nzmtc_moreZ = Nzmtc - Nzmtc_0Z - Nzmtc_1Z;
682  double Nzmtc_notcontained_0Z = h_zMuTrack_numberOfCand_notcontained->GetBinContent(1);
683  double Nzmtc_notcontained_1Z = h_zMuTrack_numberOfCand_notcontained->GetBinContent(2);
684  double Nzmtc_notcontained_moreZ = Nzmtc-Nzmtc_notcontained_0Z-Nzmtc_notcontained_1Z;
685  double Nzmtc_passed_0Z = h_zMuTrack_numberOfCand_passed->GetBinContent(1);
686  double Nzmtc_passed_1Z = h_zMuTrack_numberOfCand_passed->GetBinContent(2);
687  double Nzmtc_passed_moreZ = Nzmtc - Nzmtc_passed_0Z - Nzmtc_passed_1Z;
688  double Nzmtc_MCmatched_passed_0Z = h_zMuTrack_MCmatched_numberOfCand_passed->GetBinContent(1);
689  double Nzmtc_MCmatched_passed_1Z = h_zMuTrack_MCmatched_numberOfCand_passed->GetBinContent(2);
690  double Nzmtc_MCmatched_passed_moreZ = Nzmtc - Nzmtc_MCmatched_passed_0Z - Nzmtc_MCmatched_passed_1Z;
691 
692  cout << "--------------- Statistics ----------------------------------------------------------" << endl;
693  cout << "n of ZMuMu entries ...................................................... " << Nzmmc << endl;
694  cout << "n of ZMuMu events with 0 cand ............................................. " << Nzmmc_0Z << endl;
695  cout << "n of ZMuMu events with 1 cand ............................................. " << Nzmmc_1Z << endl;
696  cout << "n of ZMuMu events with 2 or more cand ..................................... " << Nzmmc_moreZ << endl << endl ;
697 
698  cout << "n of ZMuMu events not selected by cuts .................................... " << Nzmmc_passed_0Z << endl;
699  cout << "n of ZMuMu events with 1 cand selected by cuts ............................ " << Nzmmc_passed_1Z << endl;
700  cout << "n of ZMuMu events with 2 or more cand elected by cuts ..................... " << Nzmmc_passed_moreZ << endl<< endl ;
701 
702  cout << "n of ZMuMu events not selected by pt cut .................................. " << Nzmmc_ptpassed_0Z << endl;
703  cout << "n of ZMuMu events with 1 cand selected by pt cut .......................... " << Nzmmc_ptpassed_1Z << endl;
704  cout << "n of ZMuMu events with 2 or more cand elected by pt cut ................... " << Nzmmc_ptpassed_moreZ << endl<< endl ;
705 
706  cout << "n of ZMuMu events not selected by eta cut ................................. " << Nzmmc_etapassed_0Z << endl;
707  cout << "n of ZMuMu events with 1 cand selected by eta cut ......................... " << Nzmmc_etapassed_1Z << endl;
708  cout << "n of ZMuMu events with 2 or more cand elected by eta cut .................. " << Nzmmc_etapassed_moreZ << endl<< endl ;
709 
710  cout << "n of ZMuMu events not selected by mass cut ................................ " << Nzmmc_masspassed_0Z << endl;
711  cout << "n of ZMuMu events with 1 cand selected by mass cut ........................ " << Nzmmc_masspassed_1Z << endl;
712  cout << "n of ZMuMu events with 2 or more cand elected by mass cut ................. " << Nzmmc_masspassed_moreZ << endl<< endl ;
713 
714  cout << "n of ZMuMu events not selected by iso cut ................................. " << Nzmmc_isopassed_0Z << endl;
715  cout << "n of ZMuMu events with 1 cand selected iso cut ............................ " << Nzmmc_isopassed_1Z << endl;
716  cout << "n of ZMuMu events with 2 or more cand elected iso cut ..................... " << Nzmmc_isopassed_moreZ << endl<< endl ;
717 
718  cout << "n of ZMuMu events not selected by pt and eta cut .......................... " << Nzmmc_ptetapassed_0Z << endl;
719  cout << "n of ZMuMu events with 1 cand selected by pt and eta cut .................. " << Nzmmc_ptetapassed_1Z << endl;
720  cout << "n of ZMuMu events with 2 or more cand elected by pt and eta cut ........... " << Nzmmc_ptetapassed_moreZ << endl<< endl ;
721 
722  cout << "n of ZMuMu events not selected by pt and eta and mass cut ................. " << Nzmmc_ptetamasspassed_0Z << endl;
723  cout << "n of ZMuMu events with 1 cand selected by pt and eta and mass cut ......... " << Nzmmc_ptetamasspassed_1Z << endl;
724  cout << "n of ZMuMu events with 2 or more cand elected by pt and eta and mass cut .. " << Nzmmc_ptetamasspassed_moreZ << endl<< endl ;
725 
726  cout << "................When No ZMuMu are selected.................................." << endl;
727  cout << "n of ZMuSta entries ....................................................... " << Nzmsc << endl;
728  cout << "n of ZMuSta events with 0 cand ............................................ " << Nzmsc_0Z << endl;
729  cout << "n of ZMuSta events with 1 cand ............................................ " << Nzmsc_1Z << endl;
730  cout << "n of ZMuSta events with 2 or more cand .................................... " << Nzmsc_moreZ << endl<< endl ;
731 
732  cout << "n of ZMuSta not contained events with 0 cand .............................. " << Nzmsc_notcontained_0Z << endl;
733  cout << "n of ZMuSta events not contained with 1 cand .............................. " << Nzmsc_notcontained_1Z << endl;
734  cout << "n of ZMuSta events no contained with 2 or more cand ....................... " << Nzmsc_notcontained_moreZ << endl<< endl ;
735 
736  cout << "n of ZMuSta cand not selectd by cuts ...................................... " << Nzmsc_passed_0Z << endl;
737  cout << "n of ZMuSta events with 1 cand selected by cuts ........................... " << Nzmsc_passed_1Z << endl;
738  cout << "n of ZMuSta events with 2 or more cand selected by cuts ................... " << Nzmsc_passed_moreZ << endl<< endl ;
739 
740  cout << "n of ZMuSta MCmatched cand not selectd by cuts ............................ " << Nzmsc_MCmatched_passed_0Z << endl;
741  cout << "n of ZMuSta MCmatched events with 1 cand selected by cuts ................. " << Nzmsc_MCmatched_passed_1Z << endl;
742  cout << "n of ZMuSta MCmatched events with 2 or more cand selected by cuts ......... " << Nzmsc_MCmatched_passed_moreZ << endl<< endl ;
743 
744  cout << "...............When no ZMuMu and ZMuSta are selcted........................." << endl;
745  cout << "n of ZMuTrack entries ................................................... " << Nzmtc << endl;
746  cout << "n of ZMuTrack events with 0 cand ..........................................." << Nzmtc_0Z << endl;
747  cout << "n of ZMuTrack events with 1 cand ..........................................." << Nzmtc_1Z << endl;
748  cout << "n of ZMuTrack events with 2 or more cand ..................................." << Nzmtc_moreZ << endl<< endl ;
749 
750  cout << "n of ZMuTrack not contained events with 0 cand ............................ " << Nzmtc_notcontained_0Z << endl;
751  cout << "n of ZMuTrack events not contained with 1 cand ............................ " << Nzmtc_notcontained_1Z << endl;
752  cout << "n of ZMuTrack events no contained with 2 or more cand ..................... " << Nzmtc_notcontained_moreZ << endl<< endl ;
753 
754  cout << "n of ZMuTrack cand not selectd by cuts ....................................." << Nzmtc_passed_0Z << endl;
755  cout << "n of ZMuTrack events with 1 cand selected by cuts .........................." << Nzmtc_passed_1Z << endl;
756  cout << "n of ZMuTrack events with 2 or more cand selected by cuts .................." << Nzmtc_passed_moreZ << endl<< endl ;
757 
758  cout << "n of ZMuTrack MCmatched cand not selectd by cuts .......................... " << Nzmtc_MCmatched_passed_0Z << endl;
759  cout << "n of ZMuTrcak MCmatched events with 1 cand selected by cuts ............... " << Nzmtc_MCmatched_passed_1Z << endl;
760  cout << "n of ZMuTrack MCmatched events with 2 or more cand selected by cuts ....... " << Nzmtc_MCmatched_passed_moreZ << endl;
761 
762  cout << "------------------------------------------------------------------------------------------" << endl;
763 
764  double Nzmm = h_zMuMu_mass_->GetEntries() ;
765  double Nzsm = h_zMuSingleStandAlone_mass_->GetEntries() ;
766  double Nzsnom = h_zMuSingleStandAloneOverlap_mass_->GetEntries() ;
767  double Nztm = h_zMuSingleTrack_mass_->GetEntries();
768 
769  double NzmmMatch = h_zMuMuMatched_mass_->GetEntries() ;
770  double NzsmMatch = h_zMuSingleStandAloneMatched_mass_->GetEntries() ;
771  double NzsnomMatch = h_zMuSingleStandAloneOverlapMatched_mass_->GetEntries() ;
772  double NztmMatch = h_zMuSingleTrackMatched_mass_->GetEntries();
773 
774  cout<<"-- N SingleTrackMu = "<<Nztm<<endl;
775  cout<<"-----N SinglStandAloneMu = "<<Nzsm<<endl;
776  cout<<"-----N SingleStandAloneOverlapMu = "<<Nzsnom<<endl;
777  cout<<"------- N MuMu = "<<Nzmm<<endl;
778 
779  cout<<"-- N SingleTrackMuMatched = "<<NztmMatch<<endl;
780  cout<<"-----N SinglStandAloneMuMatched = "<<NzsmMatch<<endl;
781  cout<<"-----N SingleStandAloneOverlapMuMatched = "<<NzsnomMatch<<endl;
782  cout<<"------- N MuMu Matched = "<<NzmmMatch<<endl;
783 }
tuple cout
Definition: gather_cfg.py:121
bool ZMuMuAnalyzer_cynematics::isContained ( const Candidate obj1,
const Candidate obj2 
)
private

Definition at line 536 of file ZMuMuAnalyzer_cynematics.cc.

References gather_cfg::cout, reco::Candidate::daughter(), reco::Candidate::get(), i, edm::Ref< C, T, F >::id(), j, combine::key, edm::Ref< C, T, F >::key(), and reco::Candidate::numberOfDaughters().

Referenced by analyze().

537 {
538  // check if a candidate obj2 is different from obj1 (assume that obj1 is a ZMuMu and obj2 is any other type)
539  // (for example a Z can be done with two global muons, or with a global muon plus a standalone muon.
540  // if the standalone muon is part of the second global muon in fact this is the same Z)
541 
542  const int maxd = 10;
543  const Candidate * daughters1[maxd];
544  const Candidate * daughters2[maxd];
545  TrackRef trackerTrack1[maxd];
546  TrackRef stAloneTrack1[maxd];
547  TrackRef globalTrack1[maxd];
548  TrackRef trackerTrack2[maxd];
549  TrackRef stAloneTrack2[maxd];
550  TrackRef globalTrack2[maxd];
551  bool flag;
552  unsigned int nd1 = obj1.numberOfDaughters();
553  unsigned int nd2 = obj2.numberOfDaughters();
554  unsigned int matched=0;
555 
556  for( unsigned int i = 0; i < nd1; ++ i ) {
557  daughters1[i] = obj1.daughter( i );
558  trackerTrack1[i] = daughters1[i]->get<TrackRef>();
559  stAloneTrack1[i] = daughters1[i]->get<TrackRef,reco::StandAloneMuonTag>();
560  globalTrack1[i] = daughters1[i]->get<TrackRef,reco::CombinedMuonTag>();
561 
562  /*********************************************** just used for debug ********************
563  if (trackerTrack1[i].isNull())
564  cout << "in ZMuMu daughter " << i << " tracker ref non found " << endl;
565  else
566  cout << "in ZMuMu daughter " << i << " tracker ref FOUND"
567  << " id: " << trackerTrack1[i].id() << ", index: " << trackerTrack1[i].key()
568  << endl;
569  if (stAloneTrack1[i].isNull())
570  cout << "in ZMuMu daughter " << i << " stalone ref non found " << endl;
571  else
572  cout << "in ZMuMu daughter " << i << " stalone ref FOUND"
573  << " id: " << stAloneTrack1[i].id() << ", index: " << stAloneTrack1[i].key()
574  << endl;
575 
576  if (globalTrack1[i].isNull())
577  cout << "in ZMuMu daughter " << i << " global ref non found " << endl;
578  else
579  cout << "in ZMuMu daughter " << i << " global ref FOUND"
580  << " id: " << globalTrack1[i].id() << ", index: " << globalTrack1[i].key()
581  << endl;
582  */
583  }
584  for( unsigned int i = 0; i < nd2; ++ i ) {
585  daughters2[i] = obj2.daughter( i );
586  trackerTrack2[i] = daughters2[i]->get<TrackRef>();
587  stAloneTrack2[i] = daughters2[i]->get<TrackRef,reco::StandAloneMuonTag>();
588  globalTrack2[i] = daughters2[i]->get<TrackRef,reco::CombinedMuonTag>();
589 
590  /******************************************** just used for debug ************
591  if (trackerTrack2[i].isNull())
592  cout << "in ZMuSta daughter " << i << " tracker ref non found " << endl;
593  else
594  cout << "in ZMuSta daughter " << i << " tracker ref FOUND"
595  << " id: " << trackerTrack2[i].id() << ", index: " << trackerTrack2[i].key()
596  << endl;
597  if (stAloneTrack2[i].isNull())
598  cout << "in ZMuSta daughter " << i << " standalone ref non found " << endl;
599  else
600  cout << "in ZMuSta daughter " << i << " standalone ref FOUND"
601  << " id: " << stAloneTrack2[i].id() << ", index: " << stAloneTrack2[i].key()
602  << endl;
603 
604  if (globalTrack2[i].isNull())
605  cout << "in ZMuSta daughter " << i << " global ref non found " << endl;
606  else
607  cout << "in ZMuSta daughter " << i << " global ref FOUND"
608  << " id: " << globalTrack2[i].id() << ", index: " << globalTrack2[i].key()
609  << endl;
610 
611  */
612  }
613  if (nd1 != nd2)
614  {
615  cout << "ZMuMuAnalyzer::isContained WARNING n.of daughters different " << nd1 << " " << nd2 << endl;
616  }
617  else
618  {
619  for (unsigned int i = 0; i < nd1; i++) {
620  flag = false;
621  for (unsigned int j = 0; j < nd2; j++) { // if the obj2 is a standalone the trackref is alwais in the trackerTRack position
622  if ( ((trackerTrack2[i].id()==trackerTrack1[j].id()) && (trackerTrack2[i].key()==trackerTrack1[j].key())) ||
623  ((trackerTrack2[i].id()==stAloneTrack1[j].id()) && (trackerTrack2[i].key()==stAloneTrack1[j].key())) ) {
624  flag = true;
625  }
626  }
627  if (flag) matched++;
628  }
629  }
630  if (matched==nd1) // return true if all the childrens of the ZMuMu have a children matched in ZMuXX
631  return true;
632  else
633  return false;
634 }
int i
Definition: DBlmapReader.cc:9
long int flag
Definition: mlp_lapack.h:47
virtual const Candidate * daughter(size_type i) const =0
return daughter at a given position, i = 0, ... numberOfDaughters() - 1 (read only mode) ...
stand alone muon component tag
Definition: RecoCandidate.h:76
virtual size_type numberOfDaughters() const =0
number of daughters
int j
Definition: DBlmapReader.cc:9
conbined muon component tag
Definition: RecoCandidate.h:78
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
list key
Definition: combine.py:13
T get() const
get a component
Definition: Candidate.h:216
tuple cout
Definition: gather_cfg.py:121
ProductID id() const
Accessor for product ID.
Definition: Ref.h:256

Member Data Documentation

double ZMuMuAnalyzer_cynematics::binEta
private

Definition at line 80 of file ZMuMuAnalyzer_cynematics.cc.

Referenced by analyze(), and ZMuMuAnalyzer_cynematics().

double ZMuMuAnalyzer_cynematics::binPhi
private

Definition at line 80 of file ZMuMuAnalyzer_cynematics.cc.

Referenced by analyze(), and ZMuMuAnalyzer_cynematics().

double ZMuMuAnalyzer_cynematics::binPt
private

Definition at line 80 of file ZMuMuAnalyzer_cynematics.cc.

Referenced by analyze(), and ZMuMuAnalyzer_cynematics().

double ZMuMuAnalyzer_cynematics::etacut_
private

Definition at line 64 of file ZMuMuAnalyzer_cynematics.cc.

Referenced by analyze(), and ZMuMuAnalyzer_cynematics().

double ZMuMuAnalyzer_cynematics::etamax
private

Definition at line 78 of file ZMuMuAnalyzer_cynematics.cc.

Referenced by ZMuMuAnalyzer_cynematics().

double ZMuMuAnalyzer_cynematics::etamin
private

Definition at line 78 of file ZMuMuAnalyzer_cynematics.cc.

Referenced by analyze(), and ZMuMuAnalyzer_cynematics().

TH2D* ZMuMuAnalyzer_cynematics::h_OneSta_mass
private

Definition at line 76 of file ZMuMuAnalyzer_cynematics.cc.

Referenced by ZMuMuAnalyzer_cynematics().

TH1D * ZMuMuAnalyzer_cynematics::h_zMuMu_mass_
private

Definition at line 65 of file ZMuMuAnalyzer_cynematics.cc.

Referenced by analyze(), endJob(), and ZMuMuAnalyzer_cynematics().

TH1D* ZMuMuAnalyzer_cynematics::h_zMuMu_numberOfCand
private

Definition at line 65 of file ZMuMuAnalyzer_cynematics.cc.

Referenced by analyze(), endJob(), and ZMuMuAnalyzer_cynematics().

TH1D * ZMuMuAnalyzer_cynematics::h_zMuMu_numberOfCand_etapassed
private

Definition at line 65 of file ZMuMuAnalyzer_cynematics.cc.

Referenced by analyze(), endJob(), and ZMuMuAnalyzer_cynematics().

TH1D * ZMuMuAnalyzer_cynematics::h_zMuMu_numberOfCand_isopassed
private

Definition at line 65 of file ZMuMuAnalyzer_cynematics.cc.

Referenced by analyze(), endJob(), and ZMuMuAnalyzer_cynematics().

TH1D * ZMuMuAnalyzer_cynematics::h_zMuMu_numberOfCand_masspassed
private

Definition at line 65 of file ZMuMuAnalyzer_cynematics.cc.

Referenced by analyze(), endJob(), and ZMuMuAnalyzer_cynematics().

TH1D * ZMuMuAnalyzer_cynematics::h_zMuMu_numberOfCand_passed
private

Definition at line 65 of file ZMuMuAnalyzer_cynematics.cc.

Referenced by analyze(), endJob(), and ZMuMuAnalyzer_cynematics().

TH1D * ZMuMuAnalyzer_cynematics::h_zMuMu_numberOfCand_ptetamasspassed
private

Definition at line 65 of file ZMuMuAnalyzer_cynematics.cc.

Referenced by analyze(), endJob(), and ZMuMuAnalyzer_cynematics().

TH1D * ZMuMuAnalyzer_cynematics::h_zMuMu_numberOfCand_ptetapassed
private

Definition at line 65 of file ZMuMuAnalyzer_cynematics.cc.

Referenced by analyze(), endJob(), and ZMuMuAnalyzer_cynematics().

TH1D * ZMuMuAnalyzer_cynematics::h_zMuMu_numberOfCand_ptpassed
private

Definition at line 65 of file ZMuMuAnalyzer_cynematics.cc.

Referenced by analyze(), endJob(), and ZMuMuAnalyzer_cynematics().

TH1D * ZMuMuAnalyzer_cynematics::h_zMuMuMatched_mass_
private

Definition at line 65 of file ZMuMuAnalyzer_cynematics.cc.

Referenced by analyze(), endJob(), and ZMuMuAnalyzer_cynematics().

TH1D * ZMuMuAnalyzer_cynematics::h_zMuSingleStandAlone_mass_
private

Definition at line 65 of file ZMuMuAnalyzer_cynematics.cc.

Referenced by analyze(), endJob(), and ZMuMuAnalyzer_cynematics().

TH1D * ZMuMuAnalyzer_cynematics::h_zMuSingleStandAloneMatched_mass_
private

Definition at line 65 of file ZMuMuAnalyzer_cynematics.cc.

Referenced by analyze(), endJob(), and ZMuMuAnalyzer_cynematics().

TH1D * ZMuMuAnalyzer_cynematics::h_zMuSingleStandAloneOverlap_mass_
private

Definition at line 65 of file ZMuMuAnalyzer_cynematics.cc.

Referenced by endJob(), and ZMuMuAnalyzer_cynematics().

TH1D * ZMuMuAnalyzer_cynematics::h_zMuSingleStandAloneOverlapMatched_mass_
private

Definition at line 65 of file ZMuMuAnalyzer_cynematics.cc.

Referenced by endJob(), and ZMuMuAnalyzer_cynematics().

TH1D * ZMuMuAnalyzer_cynematics::h_zMuSingleTrack_mass_
private

Definition at line 65 of file ZMuMuAnalyzer_cynematics.cc.

Referenced by analyze(), endJob(), and ZMuMuAnalyzer_cynematics().

TH1D * ZMuMuAnalyzer_cynematics::h_zMuSingleTrackMatched_mass_
private

Definition at line 65 of file ZMuMuAnalyzer_cynematics.cc.

Referenced by analyze(), endJob(), and ZMuMuAnalyzer_cynematics().

TH1D * ZMuMuAnalyzer_cynematics::h_zMuSta_MCmatched_numberOfCand_passed
private

Definition at line 72 of file ZMuMuAnalyzer_cynematics.cc.

Referenced by analyze(), endJob(), and ZMuMuAnalyzer_cynematics().

TH1D* ZMuMuAnalyzer_cynematics::h_zMuSta_numberOfCand
private

Definition at line 72 of file ZMuMuAnalyzer_cynematics.cc.

Referenced by analyze(), endJob(), and ZMuMuAnalyzer_cynematics().

TH1D * ZMuMuAnalyzer_cynematics::h_zMuSta_numberOfCand_notcontained
private

Definition at line 72 of file ZMuMuAnalyzer_cynematics.cc.

Referenced by analyze(), endJob(), and ZMuMuAnalyzer_cynematics().

TH1D * ZMuMuAnalyzer_cynematics::h_zMuSta_numberOfCand_passed
private

Definition at line 72 of file ZMuMuAnalyzer_cynematics.cc.

Referenced by analyze(), endJob(), and ZMuMuAnalyzer_cynematics().

TH1D * ZMuMuAnalyzer_cynematics::h_zMuTrack_MCmatched_numberOfCand_passed
private

Definition at line 72 of file ZMuMuAnalyzer_cynematics.cc.

Referenced by analyze(), endJob(), and ZMuMuAnalyzer_cynematics().

TH1D * ZMuMuAnalyzer_cynematics::h_zMuTrack_numberOfCand
private

Definition at line 72 of file ZMuMuAnalyzer_cynematics.cc.

Referenced by analyze(), endJob(), and ZMuMuAnalyzer_cynematics().

TH1D * ZMuMuAnalyzer_cynematics::h_zMuTrack_numberOfCand_notcontained
private

Definition at line 72 of file ZMuMuAnalyzer_cynematics.cc.

Referenced by analyze(), endJob(), and ZMuMuAnalyzer_cynematics().

TH1D * ZMuMuAnalyzer_cynematics::h_zMuTrack_numberOfCand_passed
private

Definition at line 72 of file ZMuMuAnalyzer_cynematics.cc.

Referenced by analyze(), endJob(), and ZMuMuAnalyzer_cynematics().

vector<TH1D *> ZMuMuAnalyzer_cynematics::hmumu_eta
private

Definition at line 81 of file ZMuMuAnalyzer_cynematics.cc.

Referenced by analyze(), and ZMuMuAnalyzer_cynematics().

vector<TH1D *> ZMuMuAnalyzer_cynematics::hmumu_phi
private

Definition at line 82 of file ZMuMuAnalyzer_cynematics.cc.

Referenced by analyze(), and ZMuMuAnalyzer_cynematics().

vector<TH1D *> ZMuMuAnalyzer_cynematics::hmumu_pt
private

Definition at line 83 of file ZMuMuAnalyzer_cynematics.cc.

Referenced by analyze(), and ZMuMuAnalyzer_cynematics().

vector<TH1D *> ZMuMuAnalyzer_cynematics::hmusta_eta
private

Definition at line 81 of file ZMuMuAnalyzer_cynematics.cc.

Referenced by analyze(), and ZMuMuAnalyzer_cynematics().

vector<TH1D *> ZMuMuAnalyzer_cynematics::hmusta_phi
private

Definition at line 82 of file ZMuMuAnalyzer_cynematics.cc.

Referenced by analyze(), and ZMuMuAnalyzer_cynematics().

vector<TH1D *> ZMuMuAnalyzer_cynematics::hmusta_pt
private

Definition at line 83 of file ZMuMuAnalyzer_cynematics.cc.

Referenced by analyze(), and ZMuMuAnalyzer_cynematics().

vector<TH1D *> ZMuMuAnalyzer_cynematics::hmutrack_eta
private

Definition at line 81 of file ZMuMuAnalyzer_cynematics.cc.

Referenced by analyze(), and ZMuMuAnalyzer_cynematics().

vector<TH1D *> ZMuMuAnalyzer_cynematics::hmutrack_phi
private

Definition at line 82 of file ZMuMuAnalyzer_cynematics.cc.

Referenced by analyze(), and ZMuMuAnalyzer_cynematics().

vector<TH1D *> ZMuMuAnalyzer_cynematics::hmutrack_pt
private

Definition at line 83 of file ZMuMuAnalyzer_cynematics.cc.

Referenced by analyze(), and ZMuMuAnalyzer_cynematics().

double ZMuMuAnalyzer_cynematics::isocut_
private

Definition at line 64 of file ZMuMuAnalyzer_cynematics.cc.

Referenced by analyze().

double ZMuMuAnalyzer_cynematics::maxZmass_
private

Definition at line 64 of file ZMuMuAnalyzer_cynematics.cc.

Referenced by analyze().

double ZMuMuAnalyzer_cynematics::minZmass_
private

Definition at line 64 of file ZMuMuAnalyzer_cynematics.cc.

Referenced by analyze().

InputTag ZMuMuAnalyzer_cynematics::muIso_
private

Definition at line 62 of file ZMuMuAnalyzer_cynematics.cc.

Referenced by analyze().

int ZMuMuAnalyzer_cynematics::numberOfIntervals
private

Definition at line 79 of file ZMuMuAnalyzer_cynematics.cc.

Referenced by analyze(), and ZMuMuAnalyzer_cynematics().

OverlapChecker ZMuMuAnalyzer_cynematics::overlap_
private

Definition at line 58 of file ZMuMuAnalyzer_cynematics.cc.

double ZMuMuAnalyzer_cynematics::phimax
private

Definition at line 78 of file ZMuMuAnalyzer_cynematics.cc.

Referenced by ZMuMuAnalyzer_cynematics().

double ZMuMuAnalyzer_cynematics::phimin
private

Definition at line 78 of file ZMuMuAnalyzer_cynematics.cc.

Referenced by analyze(), and ZMuMuAnalyzer_cynematics().

double ZMuMuAnalyzer_cynematics::ptcut_
private

Definition at line 64 of file ZMuMuAnalyzer_cynematics.cc.

Referenced by analyze(), and ZMuMuAnalyzer_cynematics().

double ZMuMuAnalyzer_cynematics::ptmax
private

Definition at line 78 of file ZMuMuAnalyzer_cynematics.cc.

Referenced by ZMuMuAnalyzer_cynematics().

double ZMuMuAnalyzer_cynematics::ptmin
private

Definition at line 78 of file ZMuMuAnalyzer_cynematics.cc.

Referenced by analyze(), and ZMuMuAnalyzer_cynematics().

double ZMuMuAnalyzer_cynematics::ptSTAcut_
private

Definition at line 64 of file ZMuMuAnalyzer_cynematics.cc.

Referenced by analyze().

InputTag ZMuMuAnalyzer_cynematics::standAloneIso_
private

Definition at line 62 of file ZMuMuAnalyzer_cynematics.cc.

Referenced by analyze().

InputTag ZMuMuAnalyzer_cynematics::trackIso_
private

Definition at line 62 of file ZMuMuAnalyzer_cynematics.cc.

Referenced by analyze().

InputTag ZMuMuAnalyzer_cynematics::zMuMu_
private

Definition at line 59 of file ZMuMuAnalyzer_cynematics.cc.

Referenced by analyze().

InputTag ZMuMuAnalyzer_cynematics::zMuMuMap_
private

Definition at line 63 of file ZMuMuAnalyzer_cynematics.cc.

Referenced by analyze().

InputTag ZMuMuAnalyzer_cynematics::zMuStandAlone_
private

Definition at line 61 of file ZMuMuAnalyzer_cynematics.cc.

Referenced by analyze().

InputTag ZMuMuAnalyzer_cynematics::zMuStandAloneMap_
private

Definition at line 63 of file ZMuMuAnalyzer_cynematics.cc.

Referenced by analyze().

InputTag ZMuMuAnalyzer_cynematics::zMuTrack_
private

Definition at line 60 of file ZMuMuAnalyzer_cynematics.cc.

Referenced by analyze().

InputTag ZMuMuAnalyzer_cynematics::zMuTrackMap_
private

Definition at line 63 of file ZMuMuAnalyzer_cynematics.cc.

Referenced by analyze().