source: huonglan/ANA2011/JetID_v2.0.cpp

Last change on this file was 6, checked in by huonglan, 13 years ago

first full version of 2011 analysis

File size: 2.5 KB
Line 
1/**
2  Authors
3  Nikola Makovec <makovec@cern.ch>
4  Nils Ruthmann <nils.ruthmann@cern.ch>
5  Justin Keung <jkeung@cern.ch>
6   
7  Purpose: define the jet identification criteria
8
9  - Version 2.0
10     implements the rel 16 cleaning at three working points.
11
12  Usage:
13  bool isbad_medium = JetID::isBad(JetID::MediumBad,emf,HECf,LArQ,HECq,time,SumPtTrk,eta,pt,fmax,negE);
14  bool isbad_loose  = JetID::isBad(JetID:: LooseBad,emf,HECf,LArQ,HECq,time,SumPtTrk,eta,pt,fmax,negE);
15**/
16
17
18#include "JetID_v2.0.hpp"
19#include <cmath>
20namespace JetID
21{
22  bool isBadJet(BadJetCategory criteria,
23                double emf,
24                double hecf,
25                double larq,
26                double hecq,
27                double time,     //in ns
28                double sumpttrk, //in GeV, same as sumpttrk
29                double eta,      //emscale Eta 
30                double pt,       //in GeV, same as sumpttrk
31                double fmax,
32                double negE      //in MeV
33                )
34  { 
35    double chf=sumpttrk/pt;
36
37    //Non-collision background & cosmics
38    if(fabs(time)>25)                                  return true;
39    if(criteria==MediumBad || criteria==TightBad){
40      if(fabs(time)>10)                                return true;
41    }
42    if(emf<0.05 && chf<0.05 && fabs(eta)<2)            return true;
43    if(emf<0.05 && fabs(eta)>=2)                       return true;
44    if(fmax>0.99 && fabs(eta)<2)                       return true;
45    if(criteria==MediumBad || criteria==TightBad){
46      if(emf<0.05 && chf<0.1  && fabs(eta)<2)          return true; 
47      if(emf>0.95 && chf<0.05 && fabs(eta)<2)          return true;
48    }
49    if(criteria==TightBad){
50      if(emf<0.1 && chf<0.2  && fabs(eta)<2)           return true; 
51      if(emf<0.1 && fabs(eta)>=2 )                     return true;   
52      if(emf>0.9 && chf<0.02 && fabs(eta)<2)           return true;
53    }
54
55    //HEC spikes
56    if(fabs(negE/1000.)>60)                            return true;
57    if(hecf>0.5 && fabs(hecq)>0.5)                     return true; 
58    if(criteria==MediumBad || criteria==TightBad){
59      if(hecf>1-fabs(hecq))                            return true;
60    }
61
62    //EM coherent noise
63    if(emf>0.95 && fabs(larq)>0.8 && fabs(eta)<2.8)    return true;
64    if( criteria==MediumBad || criteria==TightBad){
65      if(emf>0.9 && fabs(larq)>0.8 && fabs(eta)<2.8)   return true;
66    }
67    if(criteria==TightBad){
68      if(fabs(larq)>0.95)                              return true;
69      if(emf>0.98 && fabs(larq)>0.05)                  return true;
70    } 
71
72    return false;
73  }
74}
Note: See TracBrowser for help on using the repository browser.