1 |
mzanetti |
1.1 |
#!/usr/bin/env python
|
2 |
|
|
|
3 |
|
|
from DataFormats.FWLite import Events, Handle
|
4 |
mzanetti |
1.4 |
import math
|
5 |
|
|
|
6 |
|
|
def deltaPhi(phi1, phi2):
|
7 |
|
|
result = phi1 - phi2
|
8 |
|
|
while (result > math.pi): result -= 2*math.pi
|
9 |
|
|
while (result <= -math.pi): result += 2*math.pi
|
10 |
|
|
return result
|
11 |
|
|
|
12 |
|
|
def deltaR(eta1, phi1, eta2, phi2):
|
13 |
|
|
deta = eta1 - eta2
|
14 |
|
|
dphi = deltaPhi(phi1, phi2)
|
15 |
|
|
return math.sqrt(deta*deta + dphi*dphi)
|
16 |
mzanetti |
1.1 |
|
17 |
|
|
def edmObjects() :
|
18 |
|
|
handles = {}
|
19 |
mzanetti |
1.5 |
handles['vertices'] = Handle ("std::vector<reco::Vertex>")
|
20 |
mzanetti |
1.1 |
handles['muons'] = Handle ("std::vector<reco::Muon>")
|
21 |
mzanetti |
1.2 |
handles['electrons'] = Handle ("std::vector<reco::GsfElectron>")
|
22 |
|
|
handles['photons'] = Handle ("std::vector<reco::Photon>")
|
23 |
|
|
handles['missingEnergy'] = Handle("std::vector<reco::PFMET>")
|
24 |
|
|
handles['jets'] = Handle("std::vector<reco::PFJet>")
|
25 |
|
|
handles['conversions'] = Handle ("std::vector<reco::Conversion>")
|
26 |
mzanetti |
1.4 |
handles['pfCandidates'] = Handle ("std::vector<reco::PFCandidate>")
|
27 |
mzanetti |
1.6 |
handles['genParticles'] = Handle ("std::vector<reco::GenParticle>")
|
28 |
mzanetti |
1.2 |
|
29 |
mzanetti |
1.1 |
labels = {}
|
30 |
mzanetti |
1.5 |
labels['vertices'] = ("offlinePrimaryVertices")
|
31 |
mzanetti |
1.1 |
labels['muons'] = ("muons")
|
32 |
mzanetti |
1.2 |
labels['electrons'] = ("gsfElectrons")
|
33 |
|
|
labels['photons'] = ("photons")
|
34 |
|
|
labels['missingEnergy'] = ("pfMet")
|
35 |
|
|
labels['jets'] = ("ak5PFJets")
|
36 |
|
|
labels['conversions'] = ("allConversions")
|
37 |
mzanetti |
1.4 |
labels['pfCandidates'] = ("particleFlow")
|
38 |
mzanetti |
1.6 |
labels['genParticles'] = ("genParticles")
|
39 |
mzanetti |
1.4 |
|
40 |
mzanetti |
1.1 |
return handles, labels
|
41 |
|
|
|
42 |
mzanetti |
1.2 |
def getDataset(eosPath='/store/user/klute/LEP3/ZZ'):
|
43 |
mzanetti |
1.1 |
import subprocess
|
44 |
|
|
inputFilesSet = []
|
45 |
mzanetti |
1.2 |
eosFolderContent = subprocess.Popen('cmsLs '+eosPath, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
46 |
mzanetti |
1.1 |
for line in eosFolderContent.stdout.readlines():
|
47 |
|
|
filename = ''
|
48 |
|
|
if len(line)>1:
|
49 |
|
|
filename = line.split()[4]
|
50 |
|
|
#print filename
|
51 |
mzanetti |
1.2 |
if filename.find('.root')>-1 and filename.find('aod')>-1 and filename.find('aod.root')==-1:
|
52 |
mzanetti |
1.1 |
inputFilesSet.append('root://eoscms.cern.ch//eos/cms/'+filename)
|
53 |
|
|
return inputFilesSet
|
54 |
|
|
|
55 |
|
|
|
56 |
mzanetti |
1.4 |
#/store/cmst3/user/pjanot/LEP3/MUMU
|
57 |
|
|
#/store/cmst3/user/pjanot/LEP3/QQBAR
|
58 |
|
|
#/store/cmst3/user/pjanot/LEP3/TAUTAU
|
59 |
|
|
#/store/cmst3/user/pjanot/LEP3/WENU
|
60 |
|
|
#/store/cmst3/user/pjanot/LEP3/WW
|
61 |
|
|
#/store/cmst3/user/pjanot/LEP3/ZEE
|
62 |
|
|
#/store/cmst3/user/pjanot/LEP3/ZNNB
|
63 |
|
|
#/store/cmst3/user/pjanot/LEP3/ZZ
|
64 |
|
|
|
65 |
|
|
|
66 |
mzanetti |
1.5 |
lep3Datasets = {'signal':('/store/cmst3/user/pjanot/LEP3/',220),
|
67 |
|
|
'WW':('/store/cmst3/user/pjanot/LEP3/WW/',16000),
|
68 |
mzanetti |
1.2 |
'qqbar':('/store/cmst3/user/pjanot/LEP3/QQBAR/',50300),
|
69 |
mzanetti |
1.5 |
'ZZ':('/store/user/klute/LEP3/ZZ/',1300),
|
70 |
|
|
'Zee':('/store/user/klute/LEP3/Zee/',12500), # FIXME
|
71 |
|
|
'Zmm':('/store/user/klute/LEP3/Zmm/',12500), # FIXME
|
72 |
|
|
'Ztt':('/store/user/klute/LEP3/Ztt/',12500), # FIXME
|
73 |
mzanetti |
1.3 |
'Zgamma':('/store/user/klute/LEP3/Zgamma/',1000), # FIXME
|
74 |
mzanetti |
1.5 |
'gaga':('/store/cmst3/user/pjanot/LEP3/GAGA/',1000),
|
75 |
mzanetti |
1.2 |
}
|