1 |
|
#!/usr/bin/env python |
2 |
|
|
3 |
|
from DataFormats.FWLite import Events, Handle |
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 |
|
|
17 |
|
def edmObjects() : |
18 |
|
handles = {} |
19 |
+ |
handles['vertices'] = Handle ("std::vector<reco::Vertex>") |
20 |
|
handles['muons'] = Handle ("std::vector<reco::Muon>") |
21 |
+ |
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 |
+ |
handles['pfCandidates'] = Handle ("std::vector<reco::PFCandidate>") |
27 |
+ |
handles['genParticles'] = Handle ("std::vector<reco::GenParticle>") |
28 |
+ |
|
29 |
|
labels = {} |
30 |
+ |
labels['vertices'] = ("offlinePrimaryVertices") |
31 |
|
labels['muons'] = ("muons") |
32 |
+ |
labels['electrons'] = ("gsfElectrons") |
33 |
+ |
labels['photons'] = ("photons") |
34 |
+ |
labels['missingEnergy'] = ("pfMet") |
35 |
+ |
labels['jets'] = ("ak5PFJets") |
36 |
+ |
labels['conversions'] = ("allConversions") |
37 |
+ |
labels['pfCandidates'] = ("particleFlow") |
38 |
+ |
labels['genParticles'] = ("genParticles") |
39 |
+ |
|
40 |
|
return handles, labels |
41 |
|
|
42 |
< |
def getDataset(name='WW', eosPath='/store/user/klute/LEP3/'): |
42 |
> |
def getDataset(eosPath='/store/user/klute/LEP3/ZZ'): |
43 |
|
import subprocess |
44 |
|
inputFilesSet = [] |
45 |
< |
eosFolderContent = subprocess.Popen('cmsLs '+eosPath+name, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) |
45 |
> |
eosFolderContent = subprocess.Popen('cmsLs '+eosPath, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) |
46 |
|
for line in eosFolderContent.stdout.readlines(): |
47 |
|
filename = '' |
48 |
|
if len(line)>1: |
49 |
|
filename = line.split()[4] |
50 |
|
#print filename |
51 |
< |
if filename.find('.root')>-1 and filename.find('aod')>-1: |
51 |
> |
if filename.find('.root')>-1 and filename.find('aod')>-1 and filename.find('aod.root')==-1: |
52 |
|
inputFilesSet.append('root://eoscms.cern.ch//eos/cms/'+filename) |
53 |
|
return inputFilesSet |
54 |
|
|
55 |
|
|
56 |
+ |
#/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 |
+ |
lep3Datasets = {'signal':('/store/cmst3/user/pjanot/LEP3/',220), |
67 |
+ |
'WW':('/store/cmst3/user/pjanot/LEP3/WW/',16000), |
68 |
+ |
'qqbar':('/store/cmst3/user/pjanot/LEP3/QQBAR/',50300), |
69 |
+ |
'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 |
+ |
'Zgamma':('/store/user/klute/LEP3/Zgamma/',1000), # FIXME |
74 |
+ |
'gaga':('/store/cmst3/user/pjanot/LEP3/GAGA/',1000), |
75 |
+ |
} |