Merge lp:~ma5/madanalysis5/v1.1.7beta into lp:madanalysis5

Proposed by Benjamin Fuks
Status: Merged
Approved by: Benjamin Fuks
Approved revision: 76
Merged at revision: 58
Proposed branch: lp:~ma5/madanalysis5/v1.1.7beta
Merge into: lp:madanalysis5
Diff against target: 4711 lines (+2146/-1099)
64 files modified
README (+2/-2)
bin/ma5 (+2/-2)
madanalysis/IOinterface/job_writer.py (+8/-1)
madanalysis/IOinterface/multiparticle_reader.py (+6/-2)
madanalysis/IOinterface/particle_reader.py (+7/-6)
madanalysis/UpdateNotes.txt (+49/-0)
madanalysis/configuration/beauty_identification.py (+1/-1)
madanalysis/configuration/clustering_configuration.py (+1/-2)
madanalysis/configuration/tau_identification.py (+5/-45)
madanalysis/core/config_checker.py (+27/-2)
madanalysis/core/expert_mode.py (+4/-3)
madanalysis/core/main.py (+40/-7)
madanalysis/input/reco_default.txt (+2/-1)
madanalysis/interpreter/cmd_import.py (+1/-1)
madanalysis/interpreter/cmd_reset.py (+1/-1)
madanalysis/interpreter/interpreter.py (+2/-2)
madanalysis/interpreter/interpreter_base.py (+47/-0)
madanalysis/job/job_execute.py (+26/-0)
madanalysis/job/job_initialize.py (+384/-7)
madanalysis/job/job_plot.py (+6/-0)
madanalysis/layout/histogram.py (+2/-1)
madanalysis/layout/histogram_frequency_core.py (+1/-1)
madanalysis/layout/plotflow.py (+1/-2)
tools/SampleAnalyzer/Analyzer/AnalyzerBase.h (+3/-3)
tools/SampleAnalyzer/Analyzer/MergingPlots.cpp (+2/-0)
tools/SampleAnalyzer/Core/Configuration.cpp (+31/-0)
tools/SampleAnalyzer/Core/Configuration.h (+24/-0)
tools/SampleAnalyzer/Core/ProgressBar.cpp (+44/-16)
tools/SampleAnalyzer/Core/ProgressBar.h (+34/-16)
tools/SampleAnalyzer/Core/SampleAnalyzer.cpp (+11/-8)
tools/SampleAnalyzer/Core/xdr_istream.cpp (+2/-2)
tools/SampleAnalyzer/DataFormat/MCParticleFormat.h (+4/-2)
tools/SampleAnalyzer/DataFormat/RecEventFormat.h (+17/-15)
tools/SampleAnalyzer/DataFormat/RecParticleFormat.h (+2/-2)
tools/SampleAnalyzer/DataFormat/RecTauFormat.h (+12/-0)
tools/SampleAnalyzer/Filter/FilterBase.h (+2/-2)
tools/SampleAnalyzer/JetClustering/JetClustererBase.h (+13/-1)
tools/SampleAnalyzer/JetClustering/JetClusteringFastJet.cpp (+247/-24)
tools/SampleAnalyzer/JetClustering/JetClusteringFastJet.h (+8/-0)
tools/SampleAnalyzer/JetClustering/TaggerBase.cpp (+2/-0)
tools/SampleAnalyzer/JetClustering/TaggerBase.h (+1/-1)
tools/SampleAnalyzer/JetClustering/TauTagger.cpp (+9/-111)
tools/SampleAnalyzer/JetClustering/TauTagger.h (+5/-3)
tools/SampleAnalyzer/JetClustering/bTagger.cpp (+3/-43)
tools/SampleAnalyzer/JetClustering/bTagger.h (+1/-1)
tools/SampleAnalyzer/JetClustering/cTagger.h (+1/-1)
tools/SampleAnalyzer/Makefile (+0/-89)
tools/SampleAnalyzer/Reader/HEPMCReader.cpp (+66/-12)
tools/SampleAnalyzer/Reader/HEPMCReader.h (+1/-1)
tools/SampleAnalyzer/Reader/LHCOReader.cpp (+30/-29)
tools/SampleAnalyzer/Reader/ReaderTextBase.cpp (+2/-0)
tools/SampleAnalyzer/Service/CompilationService.h (+30/-0)
tools/SampleAnalyzer/Service/Physics.h (+10/-2)
tools/SampleAnalyzer/Writer/LHCOParticleFormat.cpp (+98/-0)
tools/SampleAnalyzer/Writer/LHCOParticleFormat.h (+64/-0)
tools/SampleAnalyzer/Writer/LHCOWriter.cpp (+216/-350)
tools/SampleAnalyzer/Writer/LHCOWriter.h (+9/-10)
tools/SampleAnalyzer/Writer/LHEParticleFormat.cpp (+115/-0)
tools/SampleAnalyzer/Writer/LHEParticleFormat.h (+71/-0)
tools/SampleAnalyzer/Writer/LHEWriter.cpp (+284/-257)
tools/SampleAnalyzer/Writer/LHEWriter.h (+9/-6)
tools/SampleAnalyzer/Writer/WriterBase.h (+3/-1)
tools/SampleAnalyzer/Writer/WriterTextBase.cpp (+28/-1)
tools/SampleAnalyzer/Writer/WriterTextBase.h (+7/-1)
To merge this branch: bzr merge lp:~ma5/madanalysis5/v1.1.7beta
Reviewer Review Type Date Requested Status
Eric Conte Approve
Review via email: mp+169179@code.launchpad.net

Commit message

- LHCO output
 - Compatibility with pythia-8 output
 - Improvement of the jet clustering / object identification
 - Few bug fixes
 - Photons added in the reco mode

Description of the change

 - LHCO output
 - Compatibility with pythia-8 output
 - Improvement of the jet clustering / object identification
 - Few bug fixes
 - Photons added in the reco mode

To post a comment you must log in.
Revision history for this message
Eric Conte (eric-conte) wrote :

release validated !

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'README'
--- README 2013-05-17 17:10:55 +0000
+++ README 2013-06-13 12:22:26 +0000
@@ -15,10 +15,10 @@
15# but WITHOUT ANY WARRANTY; without even the implied warranty of15# but WITHOUT ANY WARRANTY; without even the implied warranty of
16# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the16# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17# GNU General Public License for more details.17# GNU General Public License for more details.
18# 18#
19# You should have received a copy of the GNU General Public License19# You should have received a copy of the GNU General Public License
20# along with MadAnalysis 5. If not, see <http://www.gnu.org/licenses/>20# along with MadAnalysis 5. If not, see <http://www.gnu.org/licenses/>
21# 21#
22################################################################################22################################################################################
2323
2424
2525
=== modified file 'bin/ma5' (properties changed: -x to +x)
--- bin/ma5 2013-05-17 16:41:08 +0000
+++ bin/ma5 2013-06-13 12:22:26 +0000
@@ -113,8 +113,8 @@
113113
114# Release version114# Release version
115# Do not touch it !!!!! 115# Do not touch it !!!!!
116main.version = "1.1.6"116main.version = "1.1.25"
117main.date = "2013/05/17"117main.date = "2013/06/13"
118118
119# Checking arguments119# Checking arguments
120import getopt120import getopt
121121
=== modified file 'madanalysis/IOinterface/job_writer.py'
--- madanalysis/IOinterface/job_writer.py 2013-05-17 07:04:14 +0000
+++ madanalysis/IOinterface/job_writer.py 2013-06-13 12:22:26 +0000
@@ -253,7 +253,10 @@
253 if self.output!="":253 if self.output!="":
254 file.write(' //Getting pointer to the writer\n')254 file.write(' //Getting pointer to the writer\n')
255 file.write(' WriterBase* writer1 = \n')255 file.write(' WriterBase* writer1 = \n')
256 file.write(' manager.InitializeWriter("lhe","'+self.output+'");\n')256 if self.output.lower().endswith('lhe') or self.output.lower().endswith('lhe.gz'):
257 file.write(' manager.InitializeWriter("lhe","'+self.output+'");\n')
258 elif self.output.lower().endswith('lhco') or self.output.lower().endswith('lhco.gz'):
259 file.write(' manager.InitializeWriter("lhco","'+self.output+'");\n')
257 file.write(' if (writer1==0) return 1;\n\n')260 file.write(' if (writer1==0) return 1;\n\n')
258 if self.clustering.algorithm!="none":261 if self.clustering.algorithm!="none":
259 file.write(' //Getting pointer to the clusterer\n')262 file.write(' //Getting pointer to the clusterer\n')
@@ -958,11 +961,15 @@
958 if not dataset.weighted_events:961 if not dataset.weighted_events:
959 weighted_events=" --no_event_weight"962 weighted_events=" --no_event_weight"
960963
964 # Release
965 release = ' --ma5_version="' + self.main.version + ';' + self.main.date + '"'
966
961 # Running SampleAnalyzer 967 # Running SampleAnalyzer
962 res=os.system('cd '\968 res=os.system('cd '\
963 +self.path+'/Output/'+name+';'\969 +self.path+'/Output/'+name+';'\
964 +' ../../Build/'\970 +' ../../Build/'\
965 +'MadAnalysis5Job '+weighted_events +\971 +'MadAnalysis5Job '+weighted_events +\
972 release +\
966 ' ../../Input/'+name+'.list')973 ' ../../Input/'+name+'.list')
967974
968 return True975 return True
969976
=== modified file 'madanalysis/IOinterface/multiparticle_reader.py'
--- madanalysis/IOinterface/multiparticle_reader.py 2013-05-17 06:19:22 +0000
+++ madanalysis/IOinterface/multiparticle_reader.py 2013-06-13 12:22:26 +0000
@@ -29,12 +29,13 @@
2929
30class MultiparticleReader():30class MultiparticleReader():
3131
32 def __init__(self,path,cmd_define,level=MA5RunningType.PARTON):32 def __init__(self,path,cmd_define,level=MA5RunningType.PARTON,forced=False):
33 self.cmd_define = cmd_define33 self.cmd_define = cmd_define
34 self.npart = 034 self.npart = 0
35 self.path = path35 self.path = path
36 self.isopen = False36 self.isopen = False
37 self.level = level37 self.level = level
38 self.forced = forced
3839
39 def Load(self):40 def Load(self):
40 if self.level==MA5RunningType.PARTON:41 if self.level==MA5RunningType.PARTON:
@@ -54,6 +55,8 @@
54 return False55 return False
55 self.Read()56 self.Read()
56 self.Close()57 self.Close()
58 self.AddSpecialMultiparticles()
59 self.Close()
57 60
58 def OpenPartonLevel(self): 61 def OpenPartonLevel(self):
5962
@@ -160,7 +163,7 @@
160 logging.debug("Extracting a multiparticle labelled by ["+split[0]+"] with a PDG-id : "+str(split[2:]))163 logging.debug("Extracting a multiparticle labelled by ["+split[0]+"] with a PDG-id : "+str(split[2:]))
161 164
162 #feed multiparticle165 #feed multiparticle
163 self.cmd_define.fill(split[0],split[2:])166 self.cmd_define.fill(split[0],split[2:],self.forced)
164 self.npart += 1167 self.npart += 1
165168
166169
@@ -172,6 +175,7 @@
172 text += item + " "175 text += item + " "
173 logging.error(text) 176 logging.error(text)
174177
178
175 def AddSpecialMultiparticles(self):179 def AddSpecialMultiparticles(self):
176 # Creating invisible and hadronic multiparticles (mandatory in parton and hadron level)180 # Creating invisible and hadronic multiparticles (mandatory in parton and hadron level)
177 if self.level==MA5RunningType.RECO:181 if self.level==MA5RunningType.RECO:
178182
=== modified file 'madanalysis/IOinterface/particle_reader.py'
--- madanalysis/IOinterface/particle_reader.py 2013-05-17 06:19:22 +0000
+++ madanalysis/IOinterface/particle_reader.py 2013-06-13 12:22:26 +0000
@@ -29,12 +29,13 @@
2929
30class ParticleReader():30class ParticleReader():
3131
32 def __init__(self,path,cmd_define,level=MA5RunningType.PARTON):32 def __init__(self,path,cmd_define,level=MA5RunningType.PARTON,forced=False):
33 self.cmd_define = cmd_define33 self.cmd_define = cmd_define
34 self.npart = 034 self.npart = 0
35 self.path = path35 self.path = path
36 self.level = level36 self.level = level
37 self.isopen = False37 self.isopen = False
38 self.forced = forced
3839
39 def Load(self):40 def Load(self):
40 if self.level==MA5RunningType.PARTON:41 if self.level==MA5RunningType.PARTON:
@@ -162,7 +163,7 @@
162 logging.debug("Extracting a particle labelled by ["+split[1]+"] with a PDG-id : "+split[0])163 logging.debug("Extracting a particle labelled by ["+split[1]+"] with a PDG-id : "+split[0])
163 164
164 #feed particle165 #feed particle
165 self.cmd_define.fill(split[1],[split[0]])166 self.cmd_define.fill(split[1],[split[0]],self.forced)
166 self.npart += 1167 self.npart += 1
167168
168 @staticmethod 169 @staticmethod
169170
=== modified file 'madanalysis/UpdateNotes.txt'
--- madanalysis/UpdateNotes.txt 2013-05-17 16:41:08 +0000
+++ madanalysis/UpdateNotes.txt 2013-06-13 12:22:26 +0000
@@ -1,5 +1,54 @@
1Update notes for MadAnalysis 5 (in reverse time order)1Update notes for MadAnalysis 5 (in reverse time order)
22
376 1.1.25 (2013/06/13) econte: fixing one bug related to progress bar occuring on some plateforms
4
575 1.1.24 (2013/06/12) econte: adding compilation service + remove warnings
6
774 1.1.23 (2013/06/12) econte: adding MA5/SampleAnalyzer version and date to LHE and LHCO output
8
973 1.1.22 (2013/06/12) econte: change operation order in ma5commit
10
1172 1.1.21 (2013/06/12) econte: fixing bugs with label definition in RECO mode + adding version
12 number to SampleAnalyzer
13
1471 1.1.20 (2013/06/12) econte: fix bug with usage of zlib from tools folder + release/date stamp
15 inside SampleAnalyzer
16
1770 1.1.19 (2013/06/12) econte: small fix related to the progress bar display
18
1969 1.1.18 (2013/06/12) econte: fixing bugs (zlib + numpy) + display progress bar
20
2170 1.1.19 (2013/06/12) econte: fixing bugs (numpy, zlib) + progress bar display
22
2369 1.1.18 (2013/06/12) econte: fixing bugs with numpy + fixing bugs with gzip + fixing bugs with
24 Progress bar [to validate]
25
2668 1.1.17 (2013/06/10) bfuks: Bug fixes: progress bar on macosx + empty histogram display
27
2867 1.1.16 (2013/06/01) econte: 2 files missed in the previous commit
29
3066 1.1.15 (2013/05/31) econte: finalizing jet-clustering with exclusiveId option and full
31 compatibility with Pythia8
32
3365 1.1.14 (2013/05/26) econte: validation LHCO format
34
3564 1.1.13 (2013/05/24) econte: improving jetclustering + adding photons in NPID plot + nb of read
36 events + surprise
37
3863 1.1.12 (2013/05/21) econte: first implementation of the exclusive id
39
4062 1.1.11 (2013/05/21) econte: adding changes to LHCOWriter + fixing warning appearing in Adam's
41 computer
42
4361 1.1.10 (2013/05/19) econte: fixing bug with LHCO reader + implementing LHCO output (only
44 kinematics part is validated) + beautiful headers for LHCO + LHE
45
4660 1.1.9 (2013/05/18) econte: test
47
4859 1.1.8 (2013/05/17) bfuks: test
49
5058 1.1.7 (2013/05/17) bfuks: initializating 1.1.7
51
354 1.1.6 (2013/05/17) ma5team: - Many bug fixes (special thanks to Adam Alloul and Jose Ruiz).5254 1.1.6 (2013/05/17) ma5team: - Many bug fixes (special thanks to Adam Alloul and Jose Ruiz).
4 - Simplified LHE output added, LHCO writer at the beta level.53 - Simplified LHE output added, LHCO writer at the beta level.
5 - Clustering and b, c and tau (mis)ident. improved.54 - Clustering and b, c and tau (mis)ident. improved.
655
=== modified file 'madanalysis/configuration/beauty_identification.py'
--- madanalysis/configuration/beauty_identification.py 2013-05-17 06:19:22 +0000
+++ madanalysis/configuration/beauty_identification.py 2013-06-13 12:22:26 +0000
@@ -26,7 +26,7 @@
26class BeautyIdentification():26class BeautyIdentification():
2727
28 default_matching_dr = 0.528 default_matching_dr = 0.5
29 default_exclusive = False29 default_exclusive = True
30 default_efficiency = 1.30 default_efficiency = 1.
31 default_misid_cjet = 0.31 default_misid_cjet = 0.
32 default_misid_ljet = 0.32 default_misid_ljet = 0.
3333
=== modified file 'madanalysis/configuration/clustering_configuration.py'
--- madanalysis/configuration/clustering_configuration.py 2013-05-17 06:19:22 +0000
+++ madanalysis/configuration/clustering_configuration.py 2013-06-13 12:22:26 +0000
@@ -50,7 +50,7 @@
50 self.algorithm = "none"50 self.algorithm = "none"
51 self.beauty = BeautyIdentification()51 self.beauty = BeautyIdentification()
52 self.tau = TauIdentification()52 self.tau = TauIdentification()
53 self.exclusive_id = False53 self.exclusive_id = True
5454
55 55
56 def Display(self):56 def Display(self):
@@ -189,7 +189,6 @@
189 if parameter=="exclusive_id":189 if parameter=="exclusive_id":
190 if value=="true":190 if value=="true":
191 self.exclusive_id=True191 self.exclusive_id=True
192 logging.warning("This functionnality is not available yet.")
193 elif value=="false":192 elif value=="false":
194 self.exclusive_id=False193 self.exclusive_id=False
195 else:194 else:
196195
=== modified file 'madanalysis/configuration/tau_identification.py'
--- madanalysis/configuration/tau_identification.py 2013-05-17 06:19:22 +0000
+++ madanalysis/configuration/tau_identification.py 2013-06-13 12:22:26 +0000
@@ -26,41 +26,28 @@
26class TauIdentification():26class TauIdentification():
2727
28 default_matching_dr = 0.528 default_matching_dr = 0.5
29 default_exclusive = False29 default_exclusive = True
30 default_efficiency = 1.30 default_efficiency = 1.
31 default_misid_ljet = 0.31 default_misid_ljet = 0.
32
3332
34 userVariables = { "tau_id.matching_dr" : [str(default_matching_dr)],\33 userVariables = { "tau_id.efficiency" : [str(default_efficiency)],\
35 "tau_id.exclusive" : [str(default_exclusive)],\
36 "tau_id.efficiency" : [str(default_efficiency)],\
37 "tau_id.misid_ljet" : [str(default_misid_ljet)]\34 "tau_id.misid_ljet" : [str(default_misid_ljet)]\
38 }35 }
3936
37
40 def __init__(self):38 def __init__(self):
41 self.matching_dr = TauIdentification.default_matching_dr
42 self.exclusive = TauIdentification.default_exclusive
43 self.efficiency = TauIdentification.default_efficiency39 self.efficiency = TauIdentification.default_efficiency
44 self.misid_ljet = TauIdentification.default_misid_ljet40 self.misid_ljet = TauIdentification.default_misid_ljet
4541
46 42
47 def Display(self):43 def Display(self):
48 logging.info(" + hadronic-tau identification:")44 logging.info(" + hadronic-tau identification:")
49 self.user_DisplayParameter("tau_id.matching_dr")
50 self.user_DisplayParameter("tau_id.exclusive")
51 self.user_DisplayParameter("tau_id.efficiency")45 self.user_DisplayParameter("tau_id.efficiency")
52 self.user_DisplayParameter("tau_id.misid_ljet")46 self.user_DisplayParameter("tau_id.misid_ljet")
5347
5448
55 def user_DisplayParameter(self,parameter):49 def user_DisplayParameter(self,parameter):
56 if parameter=="tau_id.matching_dr":50 if parameter=="tau_id.efficiency":
57 logging.info(" + DeltaR matching = "+str(self.matching_dr))
58 elif parameter=="tau_id.exclusive":
59 msg="false"
60 if self.exclusive:
61 msg="true"
62 logging.info(" + exclusive algo = "+msg)
63 elif parameter=="tau_id.efficiency":
64 logging.info(" + id efficiency = "+str(self.efficiency))51 logging.info(" + id efficiency = "+str(self.efficiency))
65 elif parameter=="tau_id.misid_ljet":52 elif parameter=="tau_id.misid_ljet":
66 logging.info(" + mis-id efficiency (light quarks) = "+str(self.misid_ljet))53 logging.info(" + mis-id efficiency (light quarks) = "+str(self.misid_ljet))
@@ -70,12 +57,7 @@
7057
71 def SampleAnalyzerConfigString(self):58 def SampleAnalyzerConfigString(self):
72 mydict = {}59 mydict = {}
73 mydict['tau_id.matching_dr'] = str(self.matching_dr)
74 mydict['tau_id.efficiency'] = str(self.efficiency)60 mydict['tau_id.efficiency'] = str(self.efficiency)
75 if self.exclusive:
76 mydict['tau_id.exclusive'] = '1'
77 else:
78 mydict['tau_id.exclusive'] = '0'
79 mydict['tau_id.misid_ljet'] = str(self.misid_ljet)61 mydict['tau_id.misid_ljet'] = str(self.misid_ljet)
80 return mydict62 return mydict
8163
@@ -92,30 +74,8 @@
9274
9375
94 def user_SetParameter(self,parameter,value):76 def user_SetParameter(self,parameter,value):
95 # matching deltar
96 if parameter=="tau_id.matching_dr":
97 try:
98 number = float(value)
99 except:
100 logging.error("the 'matching deltaR' must be a float value.")
101 return False
102 if number<=0:
103 logging.error("the 'matching deltaR' cannot be negative or null.")
104 return False
105 self.matching_dr=number
106
107 # exclusive
108 elif parameter=="tau_id.exclusive":
109 if value == "true":
110 self.exclusive=True
111 elif value == "false":
112 self.exclusive=False
113 else:
114 logging.error("'exclusive' possible values are : 'true', 'false'")
115 return False
116
117 # efficiency77 # efficiency
118 elif parameter=="tau_id.efficiency":78 if parameter=="tau_id.efficiency":
119 try:79 try:
120 number = float(value)80 number = float(value)
121 except:81 except:
12282
=== modified file 'madanalysis/core/config_checker.py'
--- madanalysis/core/config_checker.py 2013-05-17 06:19:22 +0000
+++ madanalysis/core/config_checker.py 2013-06-13 12:22:26 +0000
@@ -314,6 +314,23 @@
314 os.environ['LIBRARY_PATH'] = os.environ['LIBRARY_PATH'] + \314 os.environ['LIBRARY_PATH'] = os.environ['LIBRARY_PATH'] + \
315 ":" + item315 ":" + item
316 break316 break
317
318 # If not, test if it is there locally
319 if not find:
320 item = self.ma5dir+'/tools/zlib/lib/'
321 files=glob.glob(item+"/libz.so")
322 files.extend(glob.glob(item+"/libz.a"))
323 files.extend(glob.glob(item+"/libz.dylib"))
324 if len(files)!=0:
325 self.configLinux.libraries['ZLib']=files[0]+":"+str(os.stat(files[0]).st_mtime)
326 find=True
327 os.environ['LD_LIBRARY_PATH'] = os.environ['LD_LIBRARY_PATH'] + \
328 ":" + item
329 os.environ['DYLD_LIBRARY_PATH'] = os.environ['DYLD_LIBRARY_PATH'] + \
330 ":" + item
331 os.environ['LIBRARY_PATH'] = os.environ['LIBRARY_PATH'] + \
332 ":" + item
333 # Not fail -> Warning
317 if not find:334 if not find:
318 self.PrintFAIL(warning=True)335 self.PrintFAIL(warning=True)
319 logging.warning("Library called 'libz' not found. Gzip format will be disabled.")336 logging.warning("Library called 'libz' not found. Gzip format will be disabled.")
@@ -327,9 +344,16 @@
327 if len(files)!=0:344 if len(files)!=0:
328 self.configLinux.headers['ZLib']=files[0]+":"+str(os.stat(files[0]).st_mtime)345 self.configLinux.headers['ZLib']=files[0]+":"+str(os.stat(files[0]).st_mtime)
329 find=True346 find=True
330 os.environ['CPLUS_INCLUDE_PATH'] = os.environ['CPLUS_INCLUDE_PATH'] + \347 os.environ['CPLUS_INCLUDE_PATH'] = os.environ['CPLUS_INCLUDE_PATH'] + ":" + item
331 ":" + item
332 break348 break
349
350 # If not, test if it is there locally
351 if not find:
352 find=os.path.isfile(self.ma5dir+'/tools/zlib/include/zlib.h')
353 if find:
354 os.environ['CPLUS_INCLUDE_PATH'] = os.environ['CPLUS_INCLUDE_PATH'] + ":" + \
355 self.ma5dir+'/tools/zlib/include/'
356
333 if not find:357 if not find:
334 self.PrintFAIL(warning=True)358 self.PrintFAIL(warning=True)
335 logging.warning("Header file called 'zlib.h' not found. Gzip format will be disabled.")359 logging.warning("Header file called 'zlib.h' not found. Gzip format will be disabled.")
@@ -369,6 +393,7 @@
369 if(len(files))!=0:393 if(len(files))!=0:
370 find = True394 find = True
371 self.configLinux.fastjet_version = commands.getstatusoutput('fastjet-config --version')[1]395 self.configLinux.fastjet_version = commands.getstatusoutput('fastjet-config --version')[1]
396
372 # If not, test if it is there locally 397 # If not, test if it is there locally
373 if not find: 398 if not find:
374 find=os.path.isfile(self.ma5dir+'/tools/fastjet/bin/fastjet-config')399 find=os.path.isfile(self.ma5dir+'/tools/fastjet/bin/fastjet-config')
375400
=== modified file 'madanalysis/core/expert_mode.py'
--- madanalysis/core/expert_mode.py 2013-05-17 06:19:22 +0000
+++ madanalysis/core/expert_mode.py 2013-06-13 12:22:26 +0000
@@ -35,7 +35,6 @@
35 def __init__(self,main):35 def __init__(self,main):
36 self.main=main36 self.main=main
37 self.path=""37 self.path=""
38 self.dir=""
39 self.forbiddenpaths=[]38 self.forbiddenpaths=[]
40 self.forbiddenpaths.append(os.path.normpath(self.main.ma5dir+'/lib'))39 self.forbiddenpaths.append(os.path.normpath(self.main.ma5dir+'/lib'))
41 self.forbiddenpaths.append(os.path.normpath(self.main.ma5dir+'/bin'))40 self.forbiddenpaths.append(os.path.normpath(self.main.ma5dir+'/bin'))
@@ -45,8 +44,10 @@
45 logging.info("\nWelcome to the expert mode of MadAnalysis")44 logging.info("\nWelcome to the expert mode of MadAnalysis")
46 logging.info("Please enter a folder for creating an empty SampleAnalyzer job")45 logging.info("Please enter a folder for creating an empty SampleAnalyzer job")
47 answer=raw_input("Answer: ")46 answer=raw_input("Answer: ")
48 self.dir = answer47 self.path = os.path.expanduser(answer)
49 self.path = os.path.normpath(self.main.currentdir+'/'+answer)48 if not self.path.startswith('/'):
49 self.path = self.main.currentdir+'/'+self.path
50 self.path = os.path.normpath(self.path)
5051
51 # Checking folder52 # Checking folder
52 if self.path in self.forbiddenpaths:53 if self.path in self.forbiddenpaths:
5354
=== modified file 'madanalysis/core/main.py'
--- madanalysis/core/main.py 2013-05-17 06:19:22 +0000
+++ madanalysis/core/main.py 2013-06-13 12:22:26 +0000
@@ -50,10 +50,13 @@
50 userVariables = { "currentdir" : [], \50 userVariables = { "currentdir" : [], \
51 "normalize" : ["none","lumi","lumi_weight"], \51 "normalize" : ["none","lumi","lumi_weight"], \
52 "lumi" : [], \52 "lumi" : [], \
53 "SBratio" : ['"S/B"','"B/S"','"S/(S+B)"','"B/(B+S)"','"S/sqrt(S+B)"','"B/sqrt(B+S)"'], \53 "SBratio" : ['"S/B"','"B/S"',\
54 '"S/(S+B)"','"B/(B+S)"',\
55 '"S/sqrt(S+B)"','"B/sqrt(B+S)"'], \
54 "SBerror" : [], \56 "SBerror" : [], \
55 "stacking_method" : ["stack","superimpose","normalize2one"], \57 "stacking_method" : ["stack","superimpose","normalize2one"], \
56 "outputfile" : ['"output.lhe.gz"'] }58 "outputfile" : ['"output.lhe.gz"','"output.lhco.gz"'] \
59 }
5760
58 SBformula = { 'S/B' : '1./(B**2)*sqrt(B**2*ES**2+S**2*EB**2)', \61 SBformula = { 'S/B' : '1./(B**2)*sqrt(B**2*ES**2+S**2*EB**2)', \
59 'S/(S+B)' : '1./(S+B)**2*sqrt(B**2*ES**2+S**2*EB**2)', \62 'S/(S+B)' : '1./(S+B)**2*sqrt(B**2*ES**2+S**2*EB**2)', \
@@ -291,11 +294,41 @@
291 quoteTag=True294 quoteTag=True
292 if quoteTag:295 if quoteTag:
293 value=value[1:-1]296 value=value[1:-1]
294 if not value.lower().endswith(".lhe") and not value.lower().endswith(".lhe.gz"):297 valuemin = value.lower()
295 logging.error("LHE format (*.lhe) and compressed LHE format (*.lhe.gz) are the only possible formats for output.")298
296 return False299 # Compressed file
297 self.output = value300 if valuemin.endswith(".gz") and not self.libZIP:
298 return301 logging.error("Compressed formats (*.gz) are not available. "\
302 + "Please install zlib with the command line:")
303 logging.error(" install zlib")
304 return False
305
306 # LHE
307 if valuemin.endswith(".lhe") or valuemin.endswith(".lhe.gz"):
308 self.output = value
309 return
310
311 # LHCO
312 elif valuemin.endswith(".lhco") or valuemin.endswith(".lhco.gz"):
313 if self.mode == MA5RunningType.RECO:
314 self.output = value
315 return
316 elif self.mode == MA5RunningType.PARTON:
317 logging.error("LHCO format is not available in PARTON mode.")
318 return False
319 elif self.mode == MA5RunningType.HADRON:
320 if self.clustering.algorithm == "none":
321 logging.error("Please select a jet-clustering algorithm before requesting a LHCO file output.")
322 logging.error("Command: set main.merging.algorithm = ")
323 return False
324 else:
325 self.output = value
326 return
327
328 else:
329 logging.error("Output format is not available. Extension allowed: " +\
330 ".lhe .lhe.gz .lhco .lhco.gz")
331 return False
299332
300 # other 333 # other
301 else:334 else:
302335
=== modified file 'madanalysis/input/reco_default.txt'
--- madanalysis/input/reco_default.txt 2013-04-14 20:56:15 +0000
+++ madanalysis/input/reco_default.txt 2013-06-13 12:22:26 +0000
@@ -7,7 +7,8 @@
7 15 ta-7 15 ta-
8-15 ta+8-15 ta+
9 21 j9 21 j
10 22 a
10 5 b11 5 b
11 1 nb12 1 nb
12100 met13100 met
13101 mht
14\ No newline at end of file14\ No newline at end of file
15101 mht
1516
=== modified file 'madanalysis/interpreter/cmd_import.py'
--- madanalysis/interpreter/cmd_import.py 2013-05-17 06:19:22 +0000
+++ madanalysis/interpreter/cmd_import.py 2013-06-13 12:22:26 +0000
@@ -163,7 +163,7 @@
163 # Loading particles163 # Loading particles
164 input = ParticleReader(self.main.ma5dir,cmd_define,self.main.mode)164 input = ParticleReader(self.main.ma5dir,cmd_define,self.main.mode)
165 input.Load()165 input.Load()
166 input = MultiparticleReader(self.main.ma5dir,cmd_define,self.main.mode)166 input = MultiparticleReader(self.main.ma5dir,cmd_define,self.main.mode,self.main.forced)
167 input.Load()167 input.Load()
168168
169 # Reset history169 # Reset history
170170
=== modified file 'madanalysis/interpreter/cmd_reset.py'
--- madanalysis/interpreter/cmd_reset.py 2013-05-17 06:19:22 +0000
+++ madanalysis/interpreter/cmd_reset.py 2013-06-13 12:22:26 +0000
@@ -85,7 +85,7 @@
85 # Loading particles85 # Loading particles
86 input = ParticleReader(self.main.ma5dir,cmd_define,self.main.mode)86 input = ParticleReader(self.main.ma5dir,cmd_define,self.main.mode)
87 input.Load()87 input.Load()
88 input = MultiparticleReader(self.main.ma5dir,cmd_define,self.main.mode)88 input = MultiparticleReader(self.main.ma5dir,cmd_define,self.main.mode,self.main.forced)
89 input.Load()89 input.Load()
90 90
9191
9292
=== modified file 'madanalysis/interpreter/interpreter.py'
--- madanalysis/interpreter/interpreter.py 2013-05-17 06:19:22 +0000
+++ madanalysis/interpreter/interpreter.py 2013-06-13 12:22:26 +0000
@@ -282,7 +282,7 @@
282 input.Load()282 input.Load()
283283
284 def InitializeMultiparticle(self):284 def InitializeMultiparticle(self):
285 input = MultiparticleReader(self.main.ma5dir,self.cmd_define,self.main.mode)285 input = MultiparticleReader(self.main.ma5dir,self.cmd_define,self.main.mode,self.main.forced)
286 input.Load()286 input.Load()
287287
288 # PreLoop288 # PreLoop
@@ -474,5 +474,5 @@
474 if line[-1] in [' ','\t']:474 if line[-1] in [' ','\t']:
475 return '', line, len(line),len(enidx)475 return '', line, len(line),len(enidx)
476 return text, line, begidx, endidx476 return text, line, begidx, endidx
477 477
478 478
479479
=== modified file 'madanalysis/interpreter/interpreter_base.py'
--- madanalysis/interpreter/interpreter_base.py 2013-05-17 06:19:22 +0000
+++ madanalysis/interpreter/interpreter_base.py 2013-06-13 12:22:26 +0000
@@ -103,6 +103,12 @@
103 # --> removing additionnal whitespace characters103 # --> removing additionnal whitespace characters
104 line = line.lstrip()104 line = line.lstrip()
105105
106 # pattern design
107 if len(line)==4 and \
108 line[0]=='m' and line[1]=='u' and line[2]=='f' and line[3]=='!':
109 self.pattern_design()
110 return ''
111
106 # Add the line to the history112 # Add the line to the history
107 # except for useless commands (empty history, help calls and comments)113 # except for useless commands (empty history, help calls and comments)
108 if line != "history" and \114 if line != "history" and \
@@ -334,3 +340,44 @@
334 else:340 else:
335 out.append(data)341 out.append(data)
336 return out342 return out
343
344
345 def pattern_design(self):
346 pattern=[]
347 pattern.append('32-32-32-32-32-32-32-32-95-95-95-95-95-32')
348 pattern.append('32-32-32-32-32-95-45-126-126-32-32-32-32-32-126-126-45-95-47-47-32')
349 pattern.append('32-32-32-47-126-32-32-32-32-32-32-32-32-32-32-32-32-32-126-92-32')
350 pattern.append('32-32-124-32-32-32-32-32-32-32-32-32-32-32-32-32-32-95-32-32-124-95-32')
351 pattern.append('32-124-32-32-32-32-32-32-32-32-32-95-45-45-126-126-126-32-41-126-126-32-41-95-95-95-32')
352 pattern.append('92-124-32-32-32-32-32-32-32-32-47-32-32-32-95-95-95-32-32-32-95-45-126-32-32-32-126-45-39-95-32')
353 pattern.append('92-32-32-32-32-32-32-32-32-32-32-95-45-126-32-32-32-126-45-95-32-32-32-32-32-32-32-32-32-92-32')
354 pattern.append('124-32-32-32-32-32-32-32-32-32-47-32-32-32-32-32-32-32-32-32-92-32-32-32-32-32-32-32-32-32-124-32')
355 pattern.append('124-32-32-32-32-32-32-32-32-124-32-32-32-32-32-32-32-32-32-32-32-124-32-32-32-32-32-40-79-32-32-124-32')
356 pattern.append('32-124-32-32-32-32-32-32-124-32-32-32-32-32-32-32-32-32-32-32-32-32-124-32-32-32-32-32-32-32-32-124-32')
357 pattern.append('32-32-124-32-32-32-32-32-32-124-32-32-32-79-41-32-32-32-32-32-32-32-32-124-32-32-32-32-32-32-32-124-32')
358 pattern.append('32-32-47-124-32-32-32-32-32-32-124-32-32-32-32-32-32-32-32-32-32-32-124-32-32-32-32-32-32-32-47-32')
359 pattern.append('32-32-47-32-92-32-95-45-45-95-32-92-32-32-32-32-32-32-32-32-32-47-45-95-32-32-32-95-45-126-41-32')
360 pattern.append('32-32-32-32-47-126-32-32-32-32-92-32-126-45-95-32-32-32-95-45-126-32-32-32-126-126-126-95-95-47-32')
361 pattern.append('32-32-32-124-32-32-32-124-92-32-32-126-45-95-32-126-126-126-32-95-45-126-126-45-45-45-126-32-32-92-32')
362 pattern.append('32-32-32-124-32-32-32-124-32-124-32-32-32-32-126-45-45-126-126-32-32-47-32-92-32-32-32-32-32-32-126-45-39-95-32')
363 pattern.append('32-32-32-124-32-32-32-92-32-124-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-126-45-39-95-32')
364 pattern.append('32-32-32-32-92-32-32-32-126-45-124-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-126-126-45-45-95-95-32-95-45-126-126-45-44-32')
365 pattern.append('32-32-32-32-32-126-45-95-32-32-32-124-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-47-32-32-32-32-32-124-32')
366 pattern.append('32-32-32-32-32-32-32-32-126-126-45-45-124-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-47-32')
367 pattern.append('32-32-32-32-32-32-32-32-32-32-124-32-32-124-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-47-32')
368 pattern.append('32-32-32-32-32-32-32-32-32-32-124-32-32-32-124-32-32-32-32-32-32-32-32-32-32-32-32-32-32-95-32-32-32-32-32-32-32-32-32-32-32-32-95-45-126-32')
369 pattern.append('32-32-32-32-32-32-32-32-32-32-124-32-32-47-126-126-45-45-95-32-32-32-95-95-45-45-45-126-126-32-32-32-32-32-32-32-32-32-32-95-45-126-32')
370 pattern.append('32-32-32-32-32-32-32-32-32-32-124-32-32-92-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-95-95-45-45-126-126-32')
371 pattern.append('32-32-32-32-32-32-32-32-32-32-124-32-32-124-126-126-45-45-95-95-32-32-32-32-32-95-95-95-45-45-45-126-126-32')
372 pattern.append('32-32-32-32-32-32-32-32-32-32-124-32-32-124-32-32-32-32-32-32-126-126-126-126-126-32')
373 pattern.append('32-32-32-32-32-32-32-32-32-32-124-32-32-124-32')
374
375 for word in pattern:
376 msg=""
377 words = word.split('-')
378 for i in range(len(words)):
379 msg+=chr((int(words[i])))
380 logging.info("\x1b[1m"+"\x1b[32m"+msg+"\x1b[0m")
381 logging.info("")
382
383
337384
=== modified file 'madanalysis/job/job_execute.py'
--- madanalysis/job/job_execute.py 2013-05-17 06:19:22 +0000
+++ madanalysis/job/job_execute.py 2013-06-13 12:22:26 +0000
@@ -162,6 +162,24 @@
162 container+'.push_back(&(event.rec()->electrons()[i]));\n')162 container+'.push_back(&(event.rec()->electrons()[i]));\n')
163163
164164
165def WriteFillWithPhotonContainer(part,file,rank,status):
166
167 # If PTrank, no fill
168 if part.PTrank!=0:
169 return
170
171 # Skipping if already defined
172 if InstanceName.Find('P_'+part.name+rank+status):
173 return
174
175 # Getting container name
176 container=InstanceName.Get('P_'+part.name+rank+status)
177
178 # Put photon
179 if part.particle.Find(22):
180 file.write(' '+container+'.push_back(&(event.rec()->photons()[i]));\n')
181
182
165def WriteFillWithMuonContainer(part,file,rank,status):183def WriteFillWithMuonContainer(part,file,rank,status):
166 184
167 # If PTrank, no fill185 # If PTrank, no fill
@@ -299,6 +317,14 @@
299 file.write(' }\n')317 file.write(' }\n')
300 InstanceName.Clear()318 InstanceName.Clear()
301319
320 # Filling with photons
321 file.write(' for (UInt_t i=0;i<event.rec()->photons().size();i++)\n')
322 file.write(' {\n')
323 for item in part_list:
324 WriteFillWithPhotonContainer(item[0],file,item[1],item[2])
325 file.write(' }\n')
326 InstanceName.Clear()
327
302 # Filling with electrons328 # Filling with electrons
303 file.write(' for (UInt_t i=0;i<event.rec()->electrons().size();i++)\n')329 file.write(' for (UInt_t i=0;i<event.rec()->electrons().size();i++)\n')
304 file.write(' {\n')330 file.write(' {\n')
305331
=== modified file 'madanalysis/job/job_initialize.py'
--- madanalysis/job/job_initialize.py 2013-05-17 06:19:22 +0000
+++ madanalysis/job/job_initialize.py 2013-06-13 12:22:26 +0000
@@ -45,13 +45,390 @@
45 file.write('{\n')45 file.write('{\n')
4646
47 # mcConfig initialization47 # mcConfig initialization
48 #if main.mode!=MA5RunningType.RECO: FOR ALL MODES !!!!48 if main.mode!=MA5RunningType.RECO:
49 file.write(' // Initializing PhysicsService for MC\n') 49 file.write(' // Initializing PhysicsService for MC\n')
50 file.write(' PHYSICS->mcConfig().Reset();\n\n')50 file.write(' PHYSICS->mcConfig().Reset();\n\n')
51 WriteHadronicList(file,main)51 WriteHadronicList(file,main)
52 file.write('\n')52 file.write('\n')
53 WriteInvisibleList(file,main)53 WriteInvisibleList(file,main)
54 file.write('\n')54 file.write('\n')
55 else:
56 file.write(' // Initializing PhysicsService for MC\n')
57 file.write(' PHYSICS->mcConfig().Reset();\n\n')
58 file.write('\n')
59 file.write(' // definition of the multiparticle "hadronic"\n')
60 file.write(' PHYSICS->mcConfig().AddHadronicId(-20543);\n')
61 file.write(' PHYSICS->mcConfig().AddHadronicId(-20533);\n')
62 file.write(' PHYSICS->mcConfig().AddHadronicId(-20523);\n')
63 file.write(' PHYSICS->mcConfig().AddHadronicId(-20513);\n')
64 file.write(' PHYSICS->mcConfig().AddHadronicId(-20433);\n')
65 file.write(' PHYSICS->mcConfig().AddHadronicId(-20423);\n')
66 file.write(' PHYSICS->mcConfig().AddHadronicId(-20413);\n')
67 file.write(' PHYSICS->mcConfig().AddHadronicId(-20323);\n')
68 file.write(' PHYSICS->mcConfig().AddHadronicId(-20313);\n')
69 file.write(' PHYSICS->mcConfig().AddHadronicId(-20213);\n')
70 file.write(' PHYSICS->mcConfig().AddHadronicId(-10543);\n')
71 file.write(' PHYSICS->mcConfig().AddHadronicId(-10541);\n')
72 file.write(' PHYSICS->mcConfig().AddHadronicId(-10533);\n')
73 file.write(' PHYSICS->mcConfig().AddHadronicId(-10531);\n')
74 file.write(' PHYSICS->mcConfig().AddHadronicId(-10523);\n')
75 file.write(' PHYSICS->mcConfig().AddHadronicId(-10521);\n')
76 file.write(' PHYSICS->mcConfig().AddHadronicId(-10513);\n')
77 file.write(' PHYSICS->mcConfig().AddHadronicId(-10511);\n')
78 file.write(' PHYSICS->mcConfig().AddHadronicId(-10433);\n')
79 file.write(' PHYSICS->mcConfig().AddHadronicId(-10431);\n')
80 file.write(' PHYSICS->mcConfig().AddHadronicId(-10423);\n')
81 file.write(' PHYSICS->mcConfig().AddHadronicId(-10421);\n')
82 file.write(' PHYSICS->mcConfig().AddHadronicId(-10413);\n')
83 file.write(' PHYSICS->mcConfig().AddHadronicId(-10411);\n')
84 file.write(' PHYSICS->mcConfig().AddHadronicId(-10323);\n')
85 file.write(' PHYSICS->mcConfig().AddHadronicId(-10321);\n')
86 file.write(' PHYSICS->mcConfig().AddHadronicId(-10313);\n')
87 file.write(' PHYSICS->mcConfig().AddHadronicId(-10311);\n')
88 file.write(' PHYSICS->mcConfig().AddHadronicId(-10213);\n')
89 file.write(' PHYSICS->mcConfig().AddHadronicId(-10211);\n')
90 file.write(' PHYSICS->mcConfig().AddHadronicId(-5554);\n')
91 file.write(' PHYSICS->mcConfig().AddHadronicId(-5544);\n')
92 file.write(' PHYSICS->mcConfig().AddHadronicId(-5542);\n')
93 file.write(' PHYSICS->mcConfig().AddHadronicId(-5534);\n')
94 file.write(' PHYSICS->mcConfig().AddHadronicId(-5532);\n')
95 file.write(' PHYSICS->mcConfig().AddHadronicId(-5524);\n')
96 file.write(' PHYSICS->mcConfig().AddHadronicId(-5522);\n')
97 file.write(' PHYSICS->mcConfig().AddHadronicId(-5514);\n')
98 file.write(' PHYSICS->mcConfig().AddHadronicId(-5512);\n')
99 file.write(' PHYSICS->mcConfig().AddHadronicId(-5503);\n')
100 file.write(' PHYSICS->mcConfig().AddHadronicId(-5444);\n')
101 file.write(' PHYSICS->mcConfig().AddHadronicId(-5442);\n')
102 file.write(' PHYSICS->mcConfig().AddHadronicId(-5434);\n')
103 file.write(' PHYSICS->mcConfig().AddHadronicId(-5432);\n')
104 file.write(' PHYSICS->mcConfig().AddHadronicId(-5424);\n')
105 file.write(' PHYSICS->mcConfig().AddHadronicId(-5422);\n')
106 file.write(' PHYSICS->mcConfig().AddHadronicId(-5414);\n')
107 file.write(' PHYSICS->mcConfig().AddHadronicId(-5412);\n')
108 file.write(' PHYSICS->mcConfig().AddHadronicId(-5403);\n')
109 file.write(' PHYSICS->mcConfig().AddHadronicId(-5401);\n')
110 file.write(' PHYSICS->mcConfig().AddHadronicId(-5342);\n')
111 file.write(' PHYSICS->mcConfig().AddHadronicId(-5334);\n')
112 file.write(' PHYSICS->mcConfig().AddHadronicId(-5332);\n')
113 file.write(' PHYSICS->mcConfig().AddHadronicId(-5324);\n')
114 file.write(' PHYSICS->mcConfig().AddHadronicId(-5322);\n')
115 file.write(' PHYSICS->mcConfig().AddHadronicId(-5314);\n')
116 file.write(' PHYSICS->mcConfig().AddHadronicId(-5312);\n')
117 file.write(' PHYSICS->mcConfig().AddHadronicId(-5303);\n')
118 file.write(' PHYSICS->mcConfig().AddHadronicId(-5301);\n')
119 file.write(' PHYSICS->mcConfig().AddHadronicId(-5242);\n')
120 file.write(' PHYSICS->mcConfig().AddHadronicId(-5232);\n')
121 file.write(' PHYSICS->mcConfig().AddHadronicId(-5224);\n')
122 file.write(' PHYSICS->mcConfig().AddHadronicId(-5222);\n')
123 file.write(' PHYSICS->mcConfig().AddHadronicId(-5214);\n')
124 file.write(' PHYSICS->mcConfig().AddHadronicId(-5212);\n')
125 file.write(' PHYSICS->mcConfig().AddHadronicId(-5203);\n')
126 file.write(' PHYSICS->mcConfig().AddHadronicId(-5201);\n')
127 file.write(' PHYSICS->mcConfig().AddHadronicId(-5142);\n')
128 file.write(' PHYSICS->mcConfig().AddHadronicId(-5132);\n')
129 file.write(' PHYSICS->mcConfig().AddHadronicId(-5122);\n')
130 file.write(' PHYSICS->mcConfig().AddHadronicId(-5114);\n')
131 file.write(' PHYSICS->mcConfig().AddHadronicId(-5112);\n')
132 file.write(' PHYSICS->mcConfig().AddHadronicId(-5103);\n')
133 file.write(' PHYSICS->mcConfig().AddHadronicId(-5101);\n')
134 file.write(' PHYSICS->mcConfig().AddHadronicId(-4444);\n')
135 file.write(' PHYSICS->mcConfig().AddHadronicId(-4434);\n')
136 file.write(' PHYSICS->mcConfig().AddHadronicId(-4432);\n')
137 file.write(' PHYSICS->mcConfig().AddHadronicId(-4424);\n')
138 file.write(' PHYSICS->mcConfig().AddHadronicId(-4422);\n')
139 file.write(' PHYSICS->mcConfig().AddHadronicId(-4414);\n')
140 file.write(' PHYSICS->mcConfig().AddHadronicId(-4412);\n')
141 file.write(' PHYSICS->mcConfig().AddHadronicId(-4403);\n')
142 file.write(' PHYSICS->mcConfig().AddHadronicId(-4334);\n')
143 file.write(' PHYSICS->mcConfig().AddHadronicId(-4332);\n')
144 file.write(' PHYSICS->mcConfig().AddHadronicId(-4324);\n')
145 file.write(' PHYSICS->mcConfig().AddHadronicId(-4322);\n')
146 file.write(' PHYSICS->mcConfig().AddHadronicId(-4314);\n')
147 file.write(' PHYSICS->mcConfig().AddHadronicId(-4312);\n')
148 file.write(' PHYSICS->mcConfig().AddHadronicId(-4303);\n')
149 file.write(' PHYSICS->mcConfig().AddHadronicId(-4301);\n')
150 file.write(' PHYSICS->mcConfig().AddHadronicId(-4232);\n')
151 file.write(' PHYSICS->mcConfig().AddHadronicId(-4224);\n')
152 file.write(' PHYSICS->mcConfig().AddHadronicId(-4222);\n')
153 file.write(' PHYSICS->mcConfig().AddHadronicId(-4214);\n')
154 file.write(' PHYSICS->mcConfig().AddHadronicId(-4212);\n')
155 file.write(' PHYSICS->mcConfig().AddHadronicId(-4203);\n')
156 file.write(' PHYSICS->mcConfig().AddHadronicId(-4201);\n')
157 file.write(' PHYSICS->mcConfig().AddHadronicId(-4132);\n')
158 file.write(' PHYSICS->mcConfig().AddHadronicId(-4122);\n')
159 file.write(' PHYSICS->mcConfig().AddHadronicId(-4114);\n')
160 file.write(' PHYSICS->mcConfig().AddHadronicId(-4112);\n')
161 file.write(' PHYSICS->mcConfig().AddHadronicId(-4103);\n')
162 file.write(' PHYSICS->mcConfig().AddHadronicId(-4101);\n')
163 file.write(' PHYSICS->mcConfig().AddHadronicId(-3334);\n')
164 file.write(' PHYSICS->mcConfig().AddHadronicId(-3324);\n')
165 file.write(' PHYSICS->mcConfig().AddHadronicId(-3322);\n')
166 file.write(' PHYSICS->mcConfig().AddHadronicId(-3314);\n')
167 file.write(' PHYSICS->mcConfig().AddHadronicId(-3312);\n')
168 file.write(' PHYSICS->mcConfig().AddHadronicId(-3303);\n')
169 file.write(' PHYSICS->mcConfig().AddHadronicId(-3224);\n')
170 file.write(' PHYSICS->mcConfig().AddHadronicId(-3222);\n')
171 file.write(' PHYSICS->mcConfig().AddHadronicId(-3214);\n')
172 file.write(' PHYSICS->mcConfig().AddHadronicId(-3212);\n')
173 file.write(' PHYSICS->mcConfig().AddHadronicId(-3203);\n')
174 file.write(' PHYSICS->mcConfig().AddHadronicId(-3201);\n')
175 file.write(' PHYSICS->mcConfig().AddHadronicId(-3122);\n')
176 file.write(' PHYSICS->mcConfig().AddHadronicId(-3114);\n')
177 file.write(' PHYSICS->mcConfig().AddHadronicId(-3112);\n')
178 file.write(' PHYSICS->mcConfig().AddHadronicId(-3103);\n')
179 file.write(' PHYSICS->mcConfig().AddHadronicId(-3101);\n')
180 file.write(' PHYSICS->mcConfig().AddHadronicId(-2224);\n')
181 file.write(' PHYSICS->mcConfig().AddHadronicId(-2214);\n')
182 file.write(' PHYSICS->mcConfig().AddHadronicId(-2212);\n')
183 file.write(' PHYSICS->mcConfig().AddHadronicId(-2203);\n')
184 file.write(' PHYSICS->mcConfig().AddHadronicId(-2114);\n')
185 file.write(' PHYSICS->mcConfig().AddHadronicId(-2112);\n')
186 file.write(' PHYSICS->mcConfig().AddHadronicId(-2103);\n')
187 file.write(' PHYSICS->mcConfig().AddHadronicId(-2101);\n')
188 file.write(' PHYSICS->mcConfig().AddHadronicId(-1114);\n')
189 file.write(' PHYSICS->mcConfig().AddHadronicId(-1103);\n')
190 file.write(' PHYSICS->mcConfig().AddHadronicId(-545);\n')
191 file.write(' PHYSICS->mcConfig().AddHadronicId(-543);\n')
192 file.write(' PHYSICS->mcConfig().AddHadronicId(-541);\n')
193 file.write(' PHYSICS->mcConfig().AddHadronicId(-535);\n')
194 file.write(' PHYSICS->mcConfig().AddHadronicId(-533);\n')
195 file.write(' PHYSICS->mcConfig().AddHadronicId(-531);\n')
196 file.write(' PHYSICS->mcConfig().AddHadronicId(-525);\n')
197 file.write(' PHYSICS->mcConfig().AddHadronicId(-523);\n')
198 file.write(' PHYSICS->mcConfig().AddHadronicId(-521);\n')
199 file.write(' PHYSICS->mcConfig().AddHadronicId(-515);\n')
200 file.write(' PHYSICS->mcConfig().AddHadronicId(-513);\n')
201 file.write(' PHYSICS->mcConfig().AddHadronicId(-511);\n')
202 file.write(' PHYSICS->mcConfig().AddHadronicId(-435);\n')
203 file.write(' PHYSICS->mcConfig().AddHadronicId(-433);\n')
204 file.write(' PHYSICS->mcConfig().AddHadronicId(-431);\n')
205 file.write(' PHYSICS->mcConfig().AddHadronicId(-425);\n')
206 file.write(' PHYSICS->mcConfig().AddHadronicId(-423);\n')
207 file.write(' PHYSICS->mcConfig().AddHadronicId(-421);\n')
208 file.write(' PHYSICS->mcConfig().AddHadronicId(-415);\n')
209 file.write(' PHYSICS->mcConfig().AddHadronicId(-413);\n')
210 file.write(' PHYSICS->mcConfig().AddHadronicId(-411);\n')
211 file.write(' PHYSICS->mcConfig().AddHadronicId(-325);\n')
212 file.write(' PHYSICS->mcConfig().AddHadronicId(-323);\n')
213 file.write(' PHYSICS->mcConfig().AddHadronicId(-321);\n')
214 file.write(' PHYSICS->mcConfig().AddHadronicId(-315);\n')
215 file.write(' PHYSICS->mcConfig().AddHadronicId(-313);\n')
216 file.write(' PHYSICS->mcConfig().AddHadronicId(-311);\n')
217 file.write(' PHYSICS->mcConfig().AddHadronicId(-215);\n')
218 file.write(' PHYSICS->mcConfig().AddHadronicId(-213);\n')
219 file.write(' PHYSICS->mcConfig().AddHadronicId(-211);\n')
220 file.write(' PHYSICS->mcConfig().AddHadronicId(111);\n')
221 file.write(' PHYSICS->mcConfig().AddHadronicId(113);\n')
222 file.write(' PHYSICS->mcConfig().AddHadronicId(115);\n')
223 file.write(' PHYSICS->mcConfig().AddHadronicId(130);\n')
224 file.write(' PHYSICS->mcConfig().AddHadronicId(211);\n')
225 file.write(' PHYSICS->mcConfig().AddHadronicId(213);\n')
226 file.write(' PHYSICS->mcConfig().AddHadronicId(215);\n')
227 file.write(' PHYSICS->mcConfig().AddHadronicId(221);\n')
228 file.write(' PHYSICS->mcConfig().AddHadronicId(223);\n')
229 file.write(' PHYSICS->mcConfig().AddHadronicId(225);\n')
230 file.write(' PHYSICS->mcConfig().AddHadronicId(310);\n')
231 file.write(' PHYSICS->mcConfig().AddHadronicId(311);\n')
232 file.write(' PHYSICS->mcConfig().AddHadronicId(313);\n')
233 file.write(' PHYSICS->mcConfig().AddHadronicId(315);\n')
234 file.write(' PHYSICS->mcConfig().AddHadronicId(321);\n')
235 file.write(' PHYSICS->mcConfig().AddHadronicId(323);\n')
236 file.write(' PHYSICS->mcConfig().AddHadronicId(325);\n')
237 file.write(' PHYSICS->mcConfig().AddHadronicId(331);\n')
238 file.write(' PHYSICS->mcConfig().AddHadronicId(333);\n')
239 file.write(' PHYSICS->mcConfig().AddHadronicId(335);\n')
240 file.write(' PHYSICS->mcConfig().AddHadronicId(411);\n')
241 file.write(' PHYSICS->mcConfig().AddHadronicId(413);\n')
242 file.write(' PHYSICS->mcConfig().AddHadronicId(415);\n')
243 file.write(' PHYSICS->mcConfig().AddHadronicId(421);\n')
244 file.write(' PHYSICS->mcConfig().AddHadronicId(423);\n')
245 file.write(' PHYSICS->mcConfig().AddHadronicId(425);\n')
246 file.write(' PHYSICS->mcConfig().AddHadronicId(431);\n')
247 file.write(' PHYSICS->mcConfig().AddHadronicId(433);\n')
248 file.write(' PHYSICS->mcConfig().AddHadronicId(435);\n')
249 file.write(' PHYSICS->mcConfig().AddHadronicId(441);\n')
250 file.write(' PHYSICS->mcConfig().AddHadronicId(443);\n')
251 file.write(' PHYSICS->mcConfig().AddHadronicId(445);\n')
252 file.write(' PHYSICS->mcConfig().AddHadronicId(511);\n')
253 file.write(' PHYSICS->mcConfig().AddHadronicId(513);\n')
254 file.write(' PHYSICS->mcConfig().AddHadronicId(515);\n')
255 file.write(' PHYSICS->mcConfig().AddHadronicId(521);\n')
256 file.write(' PHYSICS->mcConfig().AddHadronicId(523);\n')
257 file.write(' PHYSICS->mcConfig().AddHadronicId(525);\n')
258 file.write(' PHYSICS->mcConfig().AddHadronicId(531);\n')
259 file.write(' PHYSICS->mcConfig().AddHadronicId(533);\n')
260 file.write(' PHYSICS->mcConfig().AddHadronicId(535);\n')
261 file.write(' PHYSICS->mcConfig().AddHadronicId(541);\n')
262 file.write(' PHYSICS->mcConfig().AddHadronicId(543);\n')
263 file.write(' PHYSICS->mcConfig().AddHadronicId(545);\n')
264 file.write(' PHYSICS->mcConfig().AddHadronicId(551);\n')
265 file.write(' PHYSICS->mcConfig().AddHadronicId(553);\n')
266 file.write(' PHYSICS->mcConfig().AddHadronicId(555);\n')
267 file.write(' PHYSICS->mcConfig().AddHadronicId(1103);\n')
268 file.write(' PHYSICS->mcConfig().AddHadronicId(1114);\n')
269 file.write(' PHYSICS->mcConfig().AddHadronicId(2101);\n')
270 file.write(' PHYSICS->mcConfig().AddHadronicId(2103);\n')
271 file.write(' PHYSICS->mcConfig().AddHadronicId(2112);\n')
272 file.write(' PHYSICS->mcConfig().AddHadronicId(2114);\n')
273 file.write(' PHYSICS->mcConfig().AddHadronicId(2203);\n')
274 file.write(' PHYSICS->mcConfig().AddHadronicId(2212);\n')
275 file.write(' PHYSICS->mcConfig().AddHadronicId(2214);\n')
276 file.write(' PHYSICS->mcConfig().AddHadronicId(2224);\n')
277 file.write(' PHYSICS->mcConfig().AddHadronicId(3101);\n')
278 file.write(' PHYSICS->mcConfig().AddHadronicId(3103);\n')
279 file.write(' PHYSICS->mcConfig().AddHadronicId(3112);\n')
280 file.write(' PHYSICS->mcConfig().AddHadronicId(3114);\n')
281 file.write(' PHYSICS->mcConfig().AddHadronicId(3122);\n')
282 file.write(' PHYSICS->mcConfig().AddHadronicId(3201);\n')
283 file.write(' PHYSICS->mcConfig().AddHadronicId(3203);\n')
284 file.write(' PHYSICS->mcConfig().AddHadronicId(3212);\n')
285 file.write(' PHYSICS->mcConfig().AddHadronicId(3214);\n')
286 file.write(' PHYSICS->mcConfig().AddHadronicId(3222);\n')
287 file.write(' PHYSICS->mcConfig().AddHadronicId(3224);\n')
288 file.write(' PHYSICS->mcConfig().AddHadronicId(3303);\n')
289 file.write(' PHYSICS->mcConfig().AddHadronicId(3312);\n')
290 file.write(' PHYSICS->mcConfig().AddHadronicId(3314);\n')
291 file.write(' PHYSICS->mcConfig().AddHadronicId(3322);\n')
292 file.write(' PHYSICS->mcConfig().AddHadronicId(3324);\n')
293 file.write(' PHYSICS->mcConfig().AddHadronicId(3334);\n')
294 file.write(' PHYSICS->mcConfig().AddHadronicId(4101);\n')
295 file.write(' PHYSICS->mcConfig().AddHadronicId(4103);\n')
296 file.write(' PHYSICS->mcConfig().AddHadronicId(4112);\n')
297 file.write(' PHYSICS->mcConfig().AddHadronicId(4114);\n')
298 file.write(' PHYSICS->mcConfig().AddHadronicId(4122);\n')
299 file.write(' PHYSICS->mcConfig().AddHadronicId(4132);\n')
300 file.write(' PHYSICS->mcConfig().AddHadronicId(4201);\n')
301 file.write(' PHYSICS->mcConfig().AddHadronicId(4203);\n')
302 file.write(' PHYSICS->mcConfig().AddHadronicId(4212);\n')
303 file.write(' PHYSICS->mcConfig().AddHadronicId(4214);\n')
304 file.write(' PHYSICS->mcConfig().AddHadronicId(4222);\n')
305 file.write(' PHYSICS->mcConfig().AddHadronicId(4224);\n')
306 file.write(' PHYSICS->mcConfig().AddHadronicId(4232);\n')
307 file.write(' PHYSICS->mcConfig().AddHadronicId(4301);\n')
308 file.write(' PHYSICS->mcConfig().AddHadronicId(4303);\n')
309 file.write(' PHYSICS->mcConfig().AddHadronicId(4312);\n')
310 file.write(' PHYSICS->mcConfig().AddHadronicId(4314);\n')
311 file.write(' PHYSICS->mcConfig().AddHadronicId(4322);\n')
312 file.write(' PHYSICS->mcConfig().AddHadronicId(4324);\n')
313 file.write(' PHYSICS->mcConfig().AddHadronicId(4332);\n')
314 file.write(' PHYSICS->mcConfig().AddHadronicId(4334);\n')
315 file.write(' PHYSICS->mcConfig().AddHadronicId(4403);\n')
316 file.write(' PHYSICS->mcConfig().AddHadronicId(4412);\n')
317 file.write(' PHYSICS->mcConfig().AddHadronicId(4414);\n')
318 file.write(' PHYSICS->mcConfig().AddHadronicId(4422);\n')
319 file.write(' PHYSICS->mcConfig().AddHadronicId(4424);\n')
320 file.write(' PHYSICS->mcConfig().AddHadronicId(4432);\n')
321 file.write(' PHYSICS->mcConfig().AddHadronicId(4434);\n')
322 file.write(' PHYSICS->mcConfig().AddHadronicId(4444);\n')
323 file.write(' PHYSICS->mcConfig().AddHadronicId(5101);\n')
324 file.write(' PHYSICS->mcConfig().AddHadronicId(5103);\n')
325 file.write(' PHYSICS->mcConfig().AddHadronicId(5112);\n')
326 file.write(' PHYSICS->mcConfig().AddHadronicId(5114);\n')
327 file.write(' PHYSICS->mcConfig().AddHadronicId(5122);\n')
328 file.write(' PHYSICS->mcConfig().AddHadronicId(5132);\n')
329 file.write(' PHYSICS->mcConfig().AddHadronicId(5142);\n')
330 file.write(' PHYSICS->mcConfig().AddHadronicId(5201);\n')
331 file.write(' PHYSICS->mcConfig().AddHadronicId(5203);\n')
332 file.write(' PHYSICS->mcConfig().AddHadronicId(5212);\n')
333 file.write(' PHYSICS->mcConfig().AddHadronicId(5214);\n')
334 file.write(' PHYSICS->mcConfig().AddHadronicId(5222);\n')
335 file.write(' PHYSICS->mcConfig().AddHadronicId(5224);\n')
336 file.write(' PHYSICS->mcConfig().AddHadronicId(5232);\n')
337 file.write(' PHYSICS->mcConfig().AddHadronicId(5242);\n')
338 file.write(' PHYSICS->mcConfig().AddHadronicId(5301);\n')
339 file.write(' PHYSICS->mcConfig().AddHadronicId(5303);\n')
340 file.write(' PHYSICS->mcConfig().AddHadronicId(5312);\n')
341 file.write(' PHYSICS->mcConfig().AddHadronicId(5314);\n')
342 file.write(' PHYSICS->mcConfig().AddHadronicId(5322);\n')
343 file.write(' PHYSICS->mcConfig().AddHadronicId(5324);\n')
344 file.write(' PHYSICS->mcConfig().AddHadronicId(5332);\n')
345 file.write(' PHYSICS->mcConfig().AddHadronicId(5334);\n')
346 file.write(' PHYSICS->mcConfig().AddHadronicId(5342);\n')
347 file.write(' PHYSICS->mcConfig().AddHadronicId(5401);\n')
348 file.write(' PHYSICS->mcConfig().AddHadronicId(5403);\n')
349 file.write(' PHYSICS->mcConfig().AddHadronicId(5412);\n')
350 file.write(' PHYSICS->mcConfig().AddHadronicId(5414);\n')
351 file.write(' PHYSICS->mcConfig().AddHadronicId(5422);\n')
352 file.write(' PHYSICS->mcConfig().AddHadronicId(5424);\n')
353 file.write(' PHYSICS->mcConfig().AddHadronicId(5432);\n')
354 file.write(' PHYSICS->mcConfig().AddHadronicId(5434);\n')
355 file.write(' PHYSICS->mcConfig().AddHadronicId(5442);\n')
356 file.write(' PHYSICS->mcConfig().AddHadronicId(5444);\n')
357 file.write(' PHYSICS->mcConfig().AddHadronicId(5503);\n')
358 file.write(' PHYSICS->mcConfig().AddHadronicId(5512);\n')
359 file.write(' PHYSICS->mcConfig().AddHadronicId(5514);\n')
360 file.write(' PHYSICS->mcConfig().AddHadronicId(5522);\n')
361 file.write(' PHYSICS->mcConfig().AddHadronicId(5524);\n')
362 file.write(' PHYSICS->mcConfig().AddHadronicId(5532);\n')
363 file.write(' PHYSICS->mcConfig().AddHadronicId(5534);\n')
364 file.write(' PHYSICS->mcConfig().AddHadronicId(5542);\n')
365 file.write(' PHYSICS->mcConfig().AddHadronicId(5544);\n')
366 file.write(' PHYSICS->mcConfig().AddHadronicId(5554);\n')
367 file.write(' PHYSICS->mcConfig().AddHadronicId(10111);\n')
368 file.write(' PHYSICS->mcConfig().AddHadronicId(10113);\n')
369 file.write(' PHYSICS->mcConfig().AddHadronicId(10211);\n')
370 file.write(' PHYSICS->mcConfig().AddHadronicId(10213);\n')
371 file.write(' PHYSICS->mcConfig().AddHadronicId(10221);\n')
372 file.write(' PHYSICS->mcConfig().AddHadronicId(10223);\n')
373 file.write(' PHYSICS->mcConfig().AddHadronicId(10311);\n')
374 file.write(' PHYSICS->mcConfig().AddHadronicId(10313);\n')
375 file.write(' PHYSICS->mcConfig().AddHadronicId(10321);\n')
376 file.write(' PHYSICS->mcConfig().AddHadronicId(10323);\n')
377 file.write(' PHYSICS->mcConfig().AddHadronicId(10331);\n')
378 file.write(' PHYSICS->mcConfig().AddHadronicId(10333);\n')
379 file.write(' PHYSICS->mcConfig().AddHadronicId(10411);\n')
380 file.write(' PHYSICS->mcConfig().AddHadronicId(10413);\n')
381 file.write(' PHYSICS->mcConfig().AddHadronicId(10421);\n')
382 file.write(' PHYSICS->mcConfig().AddHadronicId(10423);\n')
383 file.write(' PHYSICS->mcConfig().AddHadronicId(10431);\n')
384 file.write(' PHYSICS->mcConfig().AddHadronicId(10433);\n')
385 file.write(' PHYSICS->mcConfig().AddHadronicId(10441);\n')
386 file.write(' PHYSICS->mcConfig().AddHadronicId(10443);\n')
387 file.write(' PHYSICS->mcConfig().AddHadronicId(10511);\n')
388 file.write(' PHYSICS->mcConfig().AddHadronicId(10513);\n')
389 file.write(' PHYSICS->mcConfig().AddHadronicId(10521);\n')
390 file.write(' PHYSICS->mcConfig().AddHadronicId(10523);\n')
391 file.write(' PHYSICS->mcConfig().AddHadronicId(10531);\n')
392 file.write(' PHYSICS->mcConfig().AddHadronicId(10533);\n')
393 file.write(' PHYSICS->mcConfig().AddHadronicId(10541);\n')
394 file.write(' PHYSICS->mcConfig().AddHadronicId(10543);\n')
395 file.write(' PHYSICS->mcConfig().AddHadronicId(10551);\n')
396 file.write(' PHYSICS->mcConfig().AddHadronicId(10553);\n')
397 file.write(' PHYSICS->mcConfig().AddHadronicId(20113);\n')
398 file.write(' PHYSICS->mcConfig().AddHadronicId(20213);\n')
399 file.write(' PHYSICS->mcConfig().AddHadronicId(20223);\n')
400 file.write(' PHYSICS->mcConfig().AddHadronicId(20313);\n')
401 file.write(' PHYSICS->mcConfig().AddHadronicId(20323);\n')
402 file.write(' PHYSICS->mcConfig().AddHadronicId(20333);\n')
403 file.write(' PHYSICS->mcConfig().AddHadronicId(20413);\n')
404 file.write(' PHYSICS->mcConfig().AddHadronicId(20423);\n')
405 file.write(' PHYSICS->mcConfig().AddHadronicId(20433);\n')
406 file.write(' PHYSICS->mcConfig().AddHadronicId(20443);\n')
407 file.write(' PHYSICS->mcConfig().AddHadronicId(20513);\n')
408 file.write(' PHYSICS->mcConfig().AddHadronicId(20523);\n')
409 file.write(' PHYSICS->mcConfig().AddHadronicId(20533);\n')
410 file.write(' PHYSICS->mcConfig().AddHadronicId(20543);\n')
411 file.write(' PHYSICS->mcConfig().AddHadronicId(20553);\n')
412 file.write(' PHYSICS->mcConfig().AddHadronicId(100443);\n')
413 file.write(' PHYSICS->mcConfig().AddHadronicId(100553);\n')
414 file.write(' PHYSICS->mcConfig().AddHadronicId(9900440);\n')
415 file.write(' PHYSICS->mcConfig().AddHadronicId(9900441);\n')
416 file.write(' PHYSICS->mcConfig().AddHadronicId(9900443);\n')
417 file.write(' PHYSICS->mcConfig().AddHadronicId(9900551);\n')
418 file.write(' PHYSICS->mcConfig().AddHadronicId(9900553);\n')
419 file.write(' PHYSICS->mcConfig().AddHadronicId(9910441);\n')
420 file.write(' PHYSICS->mcConfig().AddHadronicId(9910551);\n')
421 file.write('\n')
422 file.write(' // definition of the multiparticle "invisible"\n')
423 file.write(' PHYSICS->mcConfig().AddInvisibleId(-16);\n')
424 file.write(' PHYSICS->mcConfig().AddInvisibleId(-14);\n')
425 file.write(' PHYSICS->mcConfig().AddInvisibleId(-12);\n')
426 file.write(' PHYSICS->mcConfig().AddInvisibleId(12);\n')
427 file.write(' PHYSICS->mcConfig().AddInvisibleId(14);\n')
428 file.write(' PHYSICS->mcConfig().AddInvisibleId(16);\n')
429 file.write(' PHYSICS->mcConfig().AddInvisibleId(1000022);\n')
430 file.write('\n')
431
55432
56 # recConfig initialization433 # recConfig initialization
57 if main.mode==MA5RunningType.RECO:434 if main.mode==MA5RunningType.RECO:
58435
=== modified file 'madanalysis/job/job_plot.py'
--- madanalysis/job/job_plot.py 2013-05-17 06:19:22 +0000
+++ madanalysis/job/job_plot.py 2013-06-13 12:22:26 +0000
@@ -88,6 +88,12 @@
88 # RECO mode88 # RECO mode
89 else:89 else:
9090
91 # photons
92 file.write(' for (unsigned int i=0;i<event.rec()->photons().size();i++)\n')
93 file.write(' {\n')
94 file.write(' H'+str(ihisto)+'_->Fill(22,__event_weight__);\n')
95 file.write(' }\n')
96
91 # electrons97 # electrons
92 file.write(' for (unsigned int i=0;i<event.rec()->electrons().size();i++)\n')98 file.write(' for (unsigned int i=0;i<event.rec()->electrons().size();i++)\n')
93 file.write(' {\n')99 file.write(' {\n')
94100
=== modified file 'madanalysis/layout/histogram.py'
--- madanalysis/layout/histogram.py 2013-05-17 06:19:22 +0000
+++ madanalysis/layout/histogram.py 2013-06-13 12:22:26 +0000
@@ -24,7 +24,6 @@
2424
25from madanalysis.layout.histogram_core import HistogramCore25from madanalysis.layout.histogram_core import HistogramCore
26import logging26import logging
27import numpy
2827
2928
30class Histogram:29class Histogram:
@@ -49,6 +48,8 @@
4948
50 def FinalizeReading(self,main,dataset):49 def FinalizeReading(self,main,dataset):
5150
51 import numpy
52
52 # Statistics53 # Statistics
53 self.summary.nevents = self.positive.nevents + self.negative.nevents54 self.summary.nevents = self.positive.nevents + self.negative.nevents
54 self.summary.nentries = self.positive.nentries + self.negative.nentries55 self.summary.nentries = self.positive.nentries + self.negative.nentries
5556
=== modified file 'madanalysis/layout/histogram_frequency_core.py'
--- madanalysis/layout/histogram_frequency_core.py 2013-05-17 06:19:22 +0000
+++ madanalysis/layout/histogram_frequency_core.py 2013-06-13 12:22:26 +0000
@@ -23,11 +23,11 @@
2323
2424
25import logging25import logging
26import numpy
2726
28class HistogramFrequencyCore:27class HistogramFrequencyCore:
2928
30 def __init__(self):29 def __init__(self):
30 import numpy
31 self.integral = 031 self.integral = 0
32 self.nevents = 032 self.nevents = 0
33 self.entries = 033 self.entries = 0
3434
=== modified file 'madanalysis/layout/plotflow.py'
--- madanalysis/layout/plotflow.py 2013-05-17 06:19:22 +0000
+++ madanalysis/layout/plotflow.py 2013-06-13 12:22:26 +0000
@@ -164,7 +164,6 @@
164164
165 # Loop over datasets and histos165 # Loop over datasets and histos
166 for ind in range(0,len(histos)):166 for ind in range(0,len(histos)):
167
168 # Scaling 167 # Scaling
169 histos[ind].Scale(scales[ind])168 histos[ind].Scale(scales[ind])
170 169
@@ -396,7 +395,7 @@
396 stack = THStack("mystack","")395 stack = THStack("mystack","")
397 ntot = 0396 ntot = 0
398 for item in histos:397 for item in histos:
399 ntot+=item.GetEntries()398 ntot+=item.Integral()
400 stack.Add(item)399 stack.Add(item)
401400
402 # Drawing401 # Drawing
403402
=== modified file 'tools/SampleAnalyzer/Analyzer/AnalyzerBase.h'
--- tools/SampleAnalyzer/Analyzer/AnalyzerBase.h 2013-05-17 06:19:22 +0000
+++ tools/SampleAnalyzer/Analyzer/AnalyzerBase.h 2013-06-13 12:22:26 +0000
@@ -94,10 +94,10 @@
9494
95 /// Initialize (common part to all analyses)95 /// Initialize (common part to all analyses)
96 bool PreInitialize(const std::string& outputName, 96 bool PreInitialize(const std::string& outputName,
97 bool weighted_events=false)97 const Configuration* cfg)
98 {98 {
99 weighted_events_ = weighted_events;99 weighted_events_ = cfg->IsNoEventWeight();
100 out_.Initialize(outputName.c_str());100 out_.Initialize(cfg,outputName.c_str());
101 return true;101 return true;
102 }102 }
103103
104104
=== modified file 'tools/SampleAnalyzer/Analyzer/MergingPlots.cpp'
--- tools/SampleAnalyzer/Analyzer/MergingPlots.cpp 2013-05-17 06:19:22 +0000
+++ tools/SampleAnalyzer/Analyzer/MergingPlots.cpp 2013-06-13 12:22:26 +0000
@@ -27,6 +27,7 @@
27#include "SampleAnalyzer/Analyzer/MergingPlots.h"27#include "SampleAnalyzer/Analyzer/MergingPlots.h"
28#include "SampleAnalyzer/Core/Configuration.h"28#include "SampleAnalyzer/Core/Configuration.h"
29#include "SampleAnalyzer/Service/Physics.h"29#include "SampleAnalyzer/Service/Physics.h"
30#include "SampleAnalyzer/Service/CompilationService.h"
3031
31//STL headers32//STL headers
32#include <sstream>33#include <sstream>
@@ -201,6 +202,7 @@
201void MergingPlots::ExtractDJRwithFortran(const std::vector<fastjet::PseudoJet>& inputs,std::vector<Double_t>& DJRvalues)202void MergingPlots::ExtractDJRwithFortran(const std::vector<fastjet::PseudoJet>& inputs,std::vector<Double_t>& DJRvalues)
202{203{
203 double PP[512][4];204 double PP[512][4];
205 UNUSED(PP);
204 for (unsigned int i=0;i<inputs.size();i++)206 for (unsigned int i=0;i<inputs.size();i++)
205 {207 {
206 PP[i][0]=inputs[i].px();208 PP[i][0]=inputs[i].px();
207209
=== modified file 'tools/SampleAnalyzer/Core/Configuration.cpp'
--- tools/SampleAnalyzer/Core/Configuration.cpp 2013-05-17 06:19:22 +0000
+++ tools/SampleAnalyzer/Core/Configuration.cpp 2013-06-13 12:22:26 +0000
@@ -36,6 +36,14 @@
3636
3737
38// -----------------------------------------------------------------------------38// -----------------------------------------------------------------------------
39// Initializing static data members
40// -----------------------------------------------------------------------------
41// DO NOT TOUCH THESE LINES
42const std::string Configuration::sampleanalyzer_version_ = "1.1.25";
43const std::string Configuration::sampleanalyzer_date_ = "2013/06/13";
44// DO NOT TOUCH THESE LINES
45
46// -----------------------------------------------------------------------------
39// PrintSyntax47// PrintSyntax
40// -----------------------------------------------------------------------------48// -----------------------------------------------------------------------------
41void Configuration::PrintSyntax()49void Configuration::PrintSyntax()
@@ -94,6 +102,22 @@
94 // weighted event102 // weighted event
95 else if (option=="--no_event_weight") no_event_weight_ = true;103 else if (option=="--no_event_weight") no_event_weight_ = true;
96104
105 // version
106 else if (option.find("--ma5_version=")==0)
107 {
108 std::string stamp = option.substr(14,std::string::npos);
109 std::size_t result = stamp.find(";");
110 if (result==std::string::npos)
111 {
112 WARNING << "MA5 version '" << stamp << "' is not valid." << std::endl;
113 }
114 else
115 {
116 pythoninterface_version_ = stamp.substr(0,result);
117 pythoninterface_date_ = stamp.substr(result+1,std::string::npos);
118 }
119 }
120
97 // unknown option121 // unknown option
98 else122 else
99 {123 {
@@ -116,6 +140,13 @@
116// -----------------------------------------------------------------------------140// -----------------------------------------------------------------------------
117void Configuration::Display()141void Configuration::Display()
118{142{
143 INFO << " - version: " << sampleanalyzer_version_ << " (" << sampleanalyzer_date_ << ") ";
144 if ((sampleanalyzer_version_!=pythoninterface_version_ && pythoninterface_version_!="") ||
145 (sampleanalyzer_date_!=pythoninterface_date_ && pythoninterface_version_!=""))
146 INFO << "[ python interface version: " << pythoninterface_version_
147 << " (" << pythoninterface_date_ << ") ]";
148 INFO << endmsg;
149
119 INFO << " - general: ";150 INFO << " - general: ";
120151
121 // Is there option ?152 // Is there option ?
122153
=== modified file 'tools/SampleAnalyzer/Core/Configuration.h'
--- tools/SampleAnalyzer/Core/Configuration.h 2013-05-17 06:19:22 +0000
+++ tools/SampleAnalyzer/Core/Configuration.h 2013-06-13 12:22:26 +0000
@@ -44,6 +44,14 @@
44 // -------------------------------------------------------------44 // -------------------------------------------------------------
45 private:45 private:
4646
47 /// SampleAnalyzer version
48 static const std::string sampleanalyzer_version_;
49 static const std::string sampleanalyzer_date_;
50
51 /// Python interface version
52 std::string pythoninterface_version_;
53 std::string pythoninterface_date_;
54
47 /// option : check event mode55 /// option : check event mode
48 Bool_t check_event_;56 Bool_t check_event_;
4957
@@ -76,6 +84,22 @@
76 /// Help message84 /// Help message
77 void PrintSyntax();85 void PrintSyntax();
7886
87 /// Accessor to the sampleanalyzer date
88 const std::string& GetSampleAnalyzerDate() const
89 {return sampleanalyzer_date_;}
90
91 /// Accessor to the sampleanalyzer version
92 const std::string& GetSampleAnalyzerVersion() const
93 {return sampleanalyzer_version_;}
94
95 /// Accessor to the python interface date
96 const std::string& GetPythonInterfaceDate() const
97 {return sampleanalyzer_date_;}
98
99 /// Accessor to the python interface version
100 const std::string& GetPythonInterfaceVersion() const
101 {return sampleanalyzer_version_;}
102
79 /// Accessor to the input name103 /// Accessor to the input name
80 const std::string& GetInputFileName() const104 const std::string& GetInputFileName() const
81 {return input_list_name_;}105 {return input_list_name_;}
82106
=== modified file 'tools/SampleAnalyzer/Core/ProgressBar.cpp'
--- tools/SampleAnalyzer/Core/ProgressBar.cpp 2013-05-17 06:19:22 +0000
+++ tools/SampleAnalyzer/Core/ProgressBar.cpp 2013-06-13 12:22:26 +0000
@@ -23,6 +23,8 @@
2323
2424
25// STL headers25// STL headers
26#include <cstdlib>
27
26// SampleAnalyzer headers28// SampleAnalyzer headers
27#include "SampleAnalyzer/Core/ProgressBar.h"29#include "SampleAnalyzer/Core/ProgressBar.h"
28#include "SampleAnalyzer/Service/LogStream.h"30#include "SampleAnalyzer/Service/LogStream.h"
@@ -30,7 +32,7 @@
30using namespace MA5;32using namespace MA5;
3133
3234
33const std::string ProgressBar::header(" => progress ");35const std::string ProgressBar::header(" => progress: ");
3436
3537
36// -----------------------------------------------------------------------------38// -----------------------------------------------------------------------------
@@ -63,14 +65,22 @@
63 // std::cout << "eric Indicator_=" << Indicator_ << std::endl;65 // std::cout << "eric Indicator_=" << Indicator_ << std::endl;
6466
65 /// Saving previous stream buffer related to std::cout67 /// Saving previous stream buffer related to std::cout
66 oldstreambuf_ = std::cout.rdbuf();68 oldstreambuf_cout_ = std::cout.rdbuf();
67 std::cout.flush();69 std::cout.flush();
70 oldstreambuf_cerr_ = std::cerr.rdbuf();
71 std::cerr.flush();
72 oldstreambuf_clog_ = std::clog.rdbuf();
73 std::clog.flush();
6874
69 /// Assigning a new stream buffer with spy75 /// Assigning a new stream buffer with spy
70 newstreambuf_ = new SpyStreamBuffer(oldstreambuf_);76 newstreambuf_cout_ = new SpyStreamBuffer(oldstreambuf_cout_);
71 std::cout.rdbuf(newstreambuf_);77 std::cout.rdbuf(newstreambuf_cout_);
7278
73 // std::cout << "muf Indicator_=" << Indicator_ << std::endl;79 newstreambuf_cerr_ = new SpyStreamBuffer(oldstreambuf_cerr_);
80 std::cout.rdbuf(newstreambuf_cerr_);
81
82 newstreambuf_clog_ = new SpyStreamBuffer(oldstreambuf_clog_);
83 std::cout.rdbuf(newstreambuf_clog_);
7484
75}85}
7686
@@ -120,22 +130,30 @@
120 todisplay[ind+1]='>';130 todisplay[ind+1]='>';
121 todisplay[Nstep_+1]=']'; // overwrite the character '>' if ind=Nstep_131 todisplay[Nstep_+1]=']'; // overwrite the character '>' if ind=Nstep_
122132
133 bool newline=false;
123 // Go back to the line ? 134 // Go back to the line ?
124 if (ind!=0 && !FirstTime_)135 if (ind!=0 && !FirstTime_)
125 {136 {
126 std::vector<char> last_chars = newstreambuf_->get_last_chars();137 if (!newstreambuf_cout_->GetProgressBarMode()) newline=true;
127 if (last_chars[0] != '\n') std::cout << std::endl;138 if (!newstreambuf_cerr_->GetProgressBarMode()) newline=true;
128 else if (last_chars[5] == 93 && last_chars[4] == 27 && 139 if (!newstreambuf_clog_->GetProgressBarMode()) newline=true;
129 last_chars[3] == 91 && last_chars[2] == 48 &&
130 last_chars[1] == 109) std::cout << "\b\r";
131 }140 }
132 FirstTime_=false;
133141
134 // Adding header142 // Adding header
143 unsigned int toremove = (header+todisplay).size();
135 todisplay = header + "\x1b[34m"+ todisplay + "\x1b[0m";144 todisplay = header + "\x1b[34m"+ todisplay + "\x1b[0m";
136145
137 // Displaying146 // Displaying
138 std::cout << todisplay << std::endl;147 newstreambuf_cout_->SetProgressBarMode(false);
148 newstreambuf_cerr_->SetProgressBarMode(false);
149 newstreambuf_clog_->SetProgressBarMode(false);
150 if (newline) std::cout << std::endl;
151 else if (!FirstTime_) std::cout << std::string(toremove,'\b');
152 std::cout << todisplay;
153 newstreambuf_cout_->SetProgressBarMode(true);
154 newstreambuf_cerr_->SetProgressBarMode(true);
155 newstreambuf_clog_->SetProgressBarMode(true);
156 FirstTime_=false;
139}157}
140158
141159
@@ -149,11 +167,21 @@
149167
150 // Display the indicator with a status of 100% ?168 // Display the indicator with a status of 100% ?
151 if (!MuteEnd_) Display(Nstep_);169 if (!MuteEnd_) Display(Nstep_);
170 newstreambuf_cout_->SetProgressBarMode(false);
171 newstreambuf_cerr_->SetProgressBarMode(false);
172 newstreambuf_clog_->SetProgressBarMode(false);
173 std::cout << std::endl;
152174
153 // Restoring the initial stream buffer175 // Restoring the initial stream buffer
154 std::cout.rdbuf(oldstreambuf_);176 std::cout.rdbuf(oldstreambuf_cout_);
155 oldstreambuf_=0;177 std::cerr.rdbuf(oldstreambuf_cerr_);
156 if (newstreambuf_!=0) delete newstreambuf_;178 std::clog.rdbuf(oldstreambuf_clog_);
179 oldstreambuf_cout_=0;
180 oldstreambuf_cerr_=0;
181 oldstreambuf_clog_=0;
182 if (newstreambuf_cout_!=0) delete newstreambuf_cout_;
183 if (newstreambuf_cerr_!=0) delete newstreambuf_cerr_;
184 if (newstreambuf_clog_!=0) delete newstreambuf_clog_;
157185
158 // Reset the progress bar186 // Reset the progress bar
159 Reset();187 Reset();
160188
=== modified file 'tools/SampleAnalyzer/Core/ProgressBar.h'
--- tools/SampleAnalyzer/Core/ProgressBar.h 2013-05-17 06:19:22 +0000
+++ tools/SampleAnalyzer/Core/ProgressBar.h 2013-06-13 12:22:26 +0000
@@ -56,30 +56,36 @@
56 public:56 public:
5757
58 /// Constructor58 /// Constructor
59 SpyStreamBuffer(std::streambuf* buf) : buf(buf)59 SpyStreamBuffer(std::streambuf* buf) : buf_(buf)
60 {60 {
61 last_chars.resize(7,traits_type::eof());61 add_endl_=false;
62 // no buffering, overflow on every char62 // no buffering, overflow on every char
63 setp(0, 0);63 setp(0, 0);
64 }64 }
6565
66 /// Getting last character66 /// Set ProgressBar mode
67 const std::vector<char>& get_last_chars() const 67 void SetProgressBarMode(bool status=true)
68 { return last_chars; }68 { add_endl_=status; }
69
70 /// Accessor to ProgressBar mode status
71 bool GetProgressBarMode() const
72 { return add_endl_; }
6973
70 /// Overflow method74 /// Overflow method
71 virtual int_type overflow(int_type c)75 virtual int_type overflow(int_type c)
72 {76 {
73 buf->sputc(c);77 if (add_endl_)
74 for (unsigned int i=(last_chars.size()-1);i>0;i--) 78 {
75 last_chars[i]=last_chars[i-1];79 buf_->sputc('\n');
76 last_chars[0] = c;80 add_endl_=false;
81 }
82 buf_->sputc(c);
77 return c;83 return c;
78 }84 }
79 private:85 private:
8086
81 std::streambuf* buf;87 std::streambuf* buf_;
82 std::vector<char> last_chars;88 bool add_endl_;
83 };89 };
8490
85 // -------------------------------------------------------------91 // -------------------------------------------------------------
@@ -112,10 +118,14 @@
112 std::vector<Long64_t> Thresholds_;118 std::vector<Long64_t> Thresholds_;
113119
114 /// Pointer to the new stream buffer120 /// Pointer to the new stream buffer
115 SpyStreamBuffer* newstreambuf_;121 SpyStreamBuffer* newstreambuf_cout_;
122 SpyStreamBuffer* newstreambuf_cerr_;
123 SpyStreamBuffer* newstreambuf_clog_;
116124
117 /// Pointer to the old stream buffer125 /// Pointer to the old stream buffer
118 std::streambuf* oldstreambuf_;126 std::streambuf* oldstreambuf_cout_;
127 std::streambuf* oldstreambuf_cerr_;
128 std::streambuf* oldstreambuf_clog_;
119129
120 static const std::string header;130 static const std::string header;
121131
@@ -127,14 +137,22 @@
127 /// Constructor without argument137 /// Constructor without argument
128 ProgressBar()138 ProgressBar()
129 {139 {
130 newstreambuf_=0;140 newstreambuf_cout_=0;
131 oldstreambuf_=0;141 newstreambuf_cerr_=0;
142 newstreambuf_clog_=0;
143 oldstreambuf_cout_=0;
144 oldstreambuf_cerr_=0;
145 oldstreambuf_clog_=0;
132 Reset(); 146 Reset();
133 }147 }
134148
135 /// Destructor 149 /// Destructor
136 ~ProgressBar() 150 ~ProgressBar()
137 { if (newstreambuf_!=0) delete newstreambuf_; }151 {
152 if (newstreambuf_cout_!=0) delete newstreambuf_cout_;
153 if (newstreambuf_cerr_!=0) delete newstreambuf_cerr_;
154 if (newstreambuf_clog_!=0) delete newstreambuf_clog_;
155 }
138156
139 /// Reset157 /// Reset
140 void Reset()158 void Reset()
141159
=== modified file 'tools/SampleAnalyzer/Core/SampleAnalyzer.cpp'
--- tools/SampleAnalyzer/Core/SampleAnalyzer.cpp 2013-05-17 06:19:22 +0000
+++ tools/SampleAnalyzer/Core/SampleAnalyzer.cpp 2013-06-13 12:22:26 +0000
@@ -27,15 +27,14 @@
27#include "SampleAnalyzer/Writer/SAFWriter.h"27#include "SampleAnalyzer/Writer/SAFWriter.h"
28#include "SampleAnalyzer/Service/ExceptionService.h"28#include "SampleAnalyzer/Service/ExceptionService.h"
29#include "SampleAnalyzer/Service/TimeService.h"29#include "SampleAnalyzer/Service/TimeService.h"
30#include "SampleAnalyzer/Service/Terminate.h"
31#include "SampleAnalyzer/Service/PDGService.h"30#include "SampleAnalyzer/Service/PDGService.h"
32#include "SampleAnalyzer/Service/Terminate.h"31#include "SampleAnalyzer/Service/Terminate.h"
32#include "SampleAnalyzer/Service/CompilationService.h"
3333
3434
35using namespace MA5;35using namespace MA5;
3636
3737/// Constructor without arguments
38/// Constructor withtout arguments
39SampleAnalyzer::SampleAnalyzer() 38SampleAnalyzer::SampleAnalyzer()
40{39{
41 // Initializing service40 // Initializing service
@@ -49,7 +48,7 @@
49 progressBar_=0;48 progressBar_=0;
5049
51 // Header50 // Header
52 INFO << " * SampleAnalyzer 2.0 for MadAnalysis 5 - Welcome.";51 INFO << " * SampleAnalyzer for MadAnalysis 5 - Welcome.";
53 INFO << endmsg;52 INFO << endmsg;
54 53
55}54}
@@ -74,7 +73,7 @@
74 std::string filename = cfg_.GetInputListName();73 std::string filename = cfg_.GetInputListName();
7574
76 // Checks if a file has been provided75 // Checks if a file has been provided
77 INFO << " - extracting event samples..." << endmsg;76 INFO << " - extracting the list of event samples..." << endmsg;
78 std::ifstream input(filename.c_str());77 std::ifstream input(filename.c_str());
79 if (!input)78 if (!input)
80 {79 {
@@ -151,7 +150,7 @@
151150
152 // Initialize (common part to all analyses)151 // Initialize (common part to all analyses)
153 if (!myAnalysis->PreInitialize(outputname,152 if (!myAnalysis->PreInitialize(outputname,
154 cfg_.IsNoEventWeight()))153 &cfg_))
155 {154 {
156 ERROR << "problem during the pre-initialization of the analysis called '" 155 ERROR << "problem during the pre-initialization of the analysis called '"
157 << name << "'" << endmsg;156 << name << "'" << endmsg;
@@ -195,7 +194,7 @@
195194
196 // Initialize (common part to all filters)195 // Initialize (common part to all filters)
197 if (!myFilter->PreInitialize(outputname,196 if (!myFilter->PreInitialize(outputname,
198 cfg_.IsNoEventWeight()))197 &cfg_))
199 {198 {
200 ERROR << "problem during the pre-initialization of the filter called '" 199 ERROR << "problem during the pre-initialization of the filter called '"
201 << name << "'" << endmsg;200 << name << "'" << endmsg;
@@ -237,7 +236,7 @@
237 writers_.push_back(myWriter);236 writers_.push_back(myWriter);
238237
239 // Initializing238 // Initializing
240 if (!myWriter->Initialize(outputname))239 if (!myWriter->Initialize(&cfg_,outputname))
241 {240 {
242 ERROR << "problem during the initialization of the writer called '" 241 ERROR << "problem during the initialization of the writer called '"
243 << name << "'" << endmsg;242 << name << "'" << endmsg;
@@ -302,6 +301,10 @@
302 if (progressBar_!=0)301 if (progressBar_!=0)
303 {302 {
304 progressBar_->Finalize();303 progressBar_->Finalize();
304 INFO << " => total number of events: " << counter_read_[file_index_-1]
305 << " ( analyzed: " << counter_passed_[file_index_-1]
306 << " ; skipped: " << counter_read_[file_index_-1] - counter_passed_[file_index_-1]
307 << " ) " << endmsg;
305 }308 }
306309
307 // Next file310 // Next file
308311
=== modified file 'tools/SampleAnalyzer/Core/xdr_istream.cpp'
--- tools/SampleAnalyzer/Core/xdr_istream.cpp 2013-05-17 06:19:22 +0000
+++ tools/SampleAnalyzer/Core/xdr_istream.cpp 2013-06-13 12:22:26 +0000
@@ -115,7 +115,7 @@
115{115{
116 if (eof()) return (*this);116 if (eof()) return (*this);
117117
118 UInt_t n;118 UInt_t n=0;
119 (*this)>>n;119 (*this)>>n;
120 Float_t* vp = reinterpret_cast<Float_t*>(&n);120 Float_t* vp = reinterpret_cast<Float_t*>(&n);
121 v=*vp;121 v=*vp;
@@ -130,7 +130,7 @@
130{130{
131 if (eof()) return (*this);131 if (eof()) return (*this);
132132
133 ULong64_t n;133 ULong64_t n=0;
134 (*this)>>n;134 (*this)>>n;
135 Double_t* vp = reinterpret_cast<Double_t*>(&n);135 Double_t* vp = reinterpret_cast<Double_t*>(&n);
136 v=*vp;136 v=*vp;
137137
=== modified file 'tools/SampleAnalyzer/DataFormat/MCParticleFormat.h'
--- tools/SampleAnalyzer/DataFormat/MCParticleFormat.h 2013-05-17 06:19:22 +0000
+++ tools/SampleAnalyzer/DataFormat/MCParticleFormat.h 2013-06-13 12:22:26 +0000
@@ -70,7 +70,8 @@
70 /// 2 intermediate state, 1 final state)70 /// 2 intermediate state, 1 final state)
71 UInt_t mothup1_; /// first mother index71 UInt_t mothup1_; /// first mother index
72 UInt_t mothup2_; /// second mother index72 UInt_t mothup2_; /// second mother index
73 Int_t extra_;73 Int_t extra1_;
74 Int_t extra2_;
7475
75 std::vector<MCParticleFormat*> Daughters_;76 std::vector<MCParticleFormat*> Daughters_;
7677
@@ -96,7 +97,8 @@
96 {97 {
97 momentum_.SetPxPyPzE(0.,0.,0.,0.);98 momentum_.SetPxPyPzE(0.,0.,0.,0.);
98 ctau_=0.; spin_=0.; pdgid_=0; 99 ctau_=0.; spin_=0.; pdgid_=0;
99 statuscode_=0; mothup1_=0; mothup2_=0; mother1_=0; mother2_=0; extra_=0;100 statuscode_=0; mothup1_=0; mothup2_=0; mother1_=0; mother2_=0;
101 extra1_=0; extra2_=0;
100 }102 }
101103
102 /// Print particle informations104 /// Print particle informations
103105
=== modified file 'tools/SampleAnalyzer/DataFormat/RecEventFormat.h'
--- tools/SampleAnalyzer/DataFormat/RecEventFormat.h 2013-05-17 06:19:22 +0000
+++ tools/SampleAnalyzer/DataFormat/RecEventFormat.h 2013-06-13 12:22:26 +0000
@@ -48,6 +48,7 @@
48class ROOTReader;48class ROOTReader;
49class TauTagger;49class TauTagger;
50class bTagger;50class bTagger;
51class JetClusteringFastJet;
5152
52class RecEventFormat53class RecEventFormat
53{54{
@@ -56,6 +57,7 @@
56 friend class ROOTReader;57 friend class ROOTReader;
57 friend class TauTagger;58 friend class TauTagger;
58 friend class bTagger;59 friend class bTagger;
60 friend class JetClusteringFastJet;
5961
60 // -------------------------------------------------------------62 // -------------------------------------------------------------
61 // data members63 // data members
@@ -90,19 +92,19 @@
90 Double_t THT_;92 Double_t THT_;
9193
92 /// Monte Carlo taus decaying hadronically94 /// Monte Carlo taus decaying hadronically
93 std::vector<MCParticleFormat*> MCHadronicTaus_;95 std::vector<const MCParticleFormat*> MCHadronicTaus_;
9496
95 /// Monte Carlo taus decaying into muon97 /// Monte Carlo taus decaying into muon
96 std::vector<MCParticleFormat*> MCMuonicTaus_;98 std::vector<const MCParticleFormat*> MCMuonicTaus_;
9799
98 /// Monte Carlo taus decaying into electron100 /// Monte Carlo taus decaying into electron
99 std::vector<MCParticleFormat*> MCElectronicTaus_;101 std::vector<const MCParticleFormat*> MCElectronicTaus_;
100102
101 /// Monte Carlo b-quarks103 /// Monte Carlo b-quarks
102 std::vector<MCParticleFormat*> MCBquarks_;104 std::vector<const MCParticleFormat*> MCBquarks_;
103105
104 /// Monte Carlo c-quarks106 /// Monte Carlo c-quarks
105 std::vector<MCParticleFormat*> MCCquarks_;107 std::vector<const MCParticleFormat*> MCCquarks_;
106108
107109
108 // -------------------------------------------------------------110 // -------------------------------------------------------------
@@ -146,23 +148,23 @@
146 const Double_t& THT() const {return THT_;}148 const Double_t& THT() const {return THT_;}
147149
148 /// Accessor to the Monte Carlo taus decaying hadronically150 /// Accessor to the Monte Carlo taus decaying hadronically
149 const std::vector<MCParticleFormat*>& MCHadronicTaus() const151 const std::vector<const MCParticleFormat*>& MCHadronicTaus() const
150 {return MCHadronicTaus_;}152 {return MCHadronicTaus_;}
151153
152 /// Accessor to Monte Carlo taus decaying into muon154 /// Accessor to Monte Carlo taus decaying into muon
153 const std::vector<MCParticleFormat*>& MCMuonicTaus() const155 const std::vector<const MCParticleFormat*>& MCMuonicTaus() const
154 {return MCMuonicTaus_;}156 {return MCMuonicTaus_;}
155157
156 /// Accessor to Monte Carlo taus decaying into electron158 /// Accessor to Monte Carlo taus decaying into electron
157 const std::vector<MCParticleFormat*>& MCElectronicTaus() const159 const std::vector<const MCParticleFormat*>& MCElectronicTaus() const
158 {return MCElectronicTaus_;}160 {return MCElectronicTaus_;}
159161
160 /// Accessor to Monte Carlo b-quarks162 /// Accessor to Monte Carlo b-quarks
161 const std::vector<MCParticleFormat*>& MCBquarks() const163 const std::vector<const MCParticleFormat*>& MCBquarks() const
162 {return MCBquarks_;}164 {return MCBquarks_;}
163165
164 /// Accessor to Monte Carlo c-quarks166 /// Accessor to Monte Carlo c-quarks
165 const std::vector<MCParticleFormat*>& MCCquarks() const167 const std::vector<const MCParticleFormat*>& MCCquarks() const
166 {return MCCquarks_;}168 {return MCCquarks_;}
167169
168 /// Accessor to the electron collection170 /// Accessor to the electron collection
@@ -193,23 +195,23 @@
193 Double_t& THT() {return THT_;}195 Double_t& THT() {return THT_;}
194196
195 /// Accessor to the Monte Carlo taus decaying hadronically197 /// Accessor to the Monte Carlo taus decaying hadronically
196 std::vector<MCParticleFormat*>& MCHadronicTaus()198 std::vector<const MCParticleFormat*>& MCHadronicTaus()
197 {return MCHadronicTaus_;}199 {return MCHadronicTaus_;}
198200
199 /// Accessor to Monte Carlo taus decaying into muon201 /// Accessor to Monte Carlo taus decaying into muon
200 std::vector<MCParticleFormat*>& MCMuonicTaus()202 std::vector<const MCParticleFormat*>& MCMuonicTaus()
201 {return MCMuonicTaus_;}203 {return MCMuonicTaus_;}
202204
203 /// Accessor to Monte Carlo taus decaying into electron205 /// Accessor to Monte Carlo taus decaying into electron
204 std::vector<MCParticleFormat*>& MCElectronicTaus()206 std::vector<const MCParticleFormat*>& MCElectronicTaus()
205 {return MCElectronicTaus_;}207 {return MCElectronicTaus_;}
206208
207 /// Accessor to Monte Carlo b-quarks209 /// Accessor to Monte Carlo b-quarks
208 std::vector<MCParticleFormat*>& MCBquarks()210 std::vector<const MCParticleFormat*>& MCBquarks()
209 {return MCBquarks_;}211 {return MCBquarks_;}
210212
211 /// Accessor to Monte Carlo c-quarks213 /// Accessor to Monte Carlo c-quarks
212 std::vector<MCParticleFormat*>& MCCquarks()214 std::vector<const MCParticleFormat*>& MCCquarks()
213 {return MCCquarks_;}215 {return MCCquarks_;}
214216
215 /// Clearing all information217 /// Clearing all information
216218
=== modified file 'tools/SampleAnalyzer/DataFormat/RecParticleFormat.h'
--- tools/SampleAnalyzer/DataFormat/RecParticleFormat.h 2013-05-17 06:19:22 +0000
+++ tools/SampleAnalyzer/DataFormat/RecParticleFormat.h 2013-06-13 12:22:26 +0000
@@ -53,7 +53,7 @@
53 protected:53 protected:
54 54
55 Float_t HEoverEE_; /// hadronic energy over electromagnetic energy55 Float_t HEoverEE_; /// hadronic energy over electromagnetic energy
56 MCParticleFormat* mc_ ; /// mother generated particle56 const MCParticleFormat* mc_ ; /// mother generated particle
5757
58 // -------------------------------------------------------------58 // -------------------------------------------------------------
59 // method members59 // method members
@@ -94,7 +94,7 @@
94 const MCParticleFormat* mc() const {return mc_;}94 const MCParticleFormat* mc() const {return mc_;}
9595
96 /// Mutator relatied to matched Monte Carlo particle96 /// Mutator relatied to matched Monte Carlo particle
97 void setMc(MCParticleFormat* mc) {mc_=mc;}97 void setMc(const MCParticleFormat* mc) {mc_=mc;}
9898
99 /// Accessor to hadronic energy / electromagnetic energy ratio99 /// Accessor to hadronic energy / electromagnetic energy ratio
100 const Float_t& HEoverEE() const {return HEoverEE_;}100 const Float_t& HEoverEE() const {return HEoverEE_;}
101101
=== modified file 'tools/SampleAnalyzer/DataFormat/RecTauFormat.h'
--- tools/SampleAnalyzer/DataFormat/RecTauFormat.h 2013-05-17 06:19:22 +0000
+++ tools/SampleAnalyzer/DataFormat/RecTauFormat.h 2013-06-13 12:22:26 +0000
@@ -98,13 +98,25 @@
98 const Float_t charge() const 98 const Float_t charge() const
99 { if (charge_) return +1.; else return -1.; }99 { if (charge_) return +1.; else return -1.; }
100100
101 /// Mutator to the electric charge
102 void setCharge(Float_t charge )
103 { if (charge>0) charge_=true; else charge_=false; }
104
101 /// Accessor to the number of tracks105 /// Accessor to the number of tracks
102 const UShort_t ntracks() const 106 const UShort_t ntracks() const
103 { return ntracks_; }107 { return ntracks_; }
104108
109 /// Mutator to the number of tracks
110 void setNtracks(UShort_t ntracks)
111 { ntracks_=ntracks; }
112
105 /// Accessor to the decay mode113 /// Accessor to the decay mode
106 const Int_t DecayMode() const114 const Int_t DecayMode() const
107 { return DecayMode_; }115 { return DecayMode_; }
116
117 /// Mutator to the decay mode
118 void setDecayMode(Int_t mode)
119 { DecayMode_=mode; }
108};120};
109121
110}122}
111123
=== modified file 'tools/SampleAnalyzer/Filter/FilterBase.h'
--- tools/SampleAnalyzer/Filter/FilterBase.h 2013-05-17 06:19:22 +0000
+++ tools/SampleAnalyzer/Filter/FilterBase.h 2013-06-13 12:22:26 +0000
@@ -93,10 +93,10 @@
9393
94 /// Initialize (common part to all analyses)94 /// Initialize (common part to all analyses)
95 bool PreInitialize(const std::string& outputName, 95 bool PreInitialize(const std::string& outputName,
96 bool weighted_events=false)96 const Configuration* cfg)
97 { 97 {
98 outputName_ = outputName;98 outputName_ = outputName;
99 weighted_events_ = weighted_events;99 weighted_events_ = cfg->IsNoEventWeight();
100 return true;100 return true;
101 }101 }
102102
103103
=== modified file 'tools/SampleAnalyzer/JetClustering/JetClustererBase.h'
--- tools/SampleAnalyzer/JetClustering/JetClustererBase.h 2013-05-17 06:19:22 +0000
+++ tools/SampleAnalyzer/JetClustering/JetClustererBase.h 2013-06-13 12:22:26 +0000
@@ -55,7 +55,7 @@
55 /// Is the jet clustering exclusive ?55 /// Is the jet clustering exclusive ?
56 Bool_t Exclusive_;56 Bool_t Exclusive_;
5757
58 /// Exclusive id for tau-elec-jet58 /// Exclusive id for tau-elec-photon-jet
59 Bool_t ExclusiveId_;59 Bool_t ExclusiveId_;
6060
61 /// Tagger61 /// Tagger
@@ -63,6 +63,12 @@
63 cTagger* myCtagger_;63 cTagger* myCtagger_;
64 TauTagger* myTAUtagger_;64 TauTagger* myTAUtagger_;
6565
66 UInt_t muon;
67 UInt_t electron;
68 UInt_t tauH;
69 UInt_t tauM;
70 UInt_t tauE;
71 UInt_t photon;
6672
67 //--------------------------------------------------------------------------73 //--------------------------------------------------------------------------
68 // method members74 // method members
@@ -81,6 +87,12 @@
81 myBtagger_ = 0;87 myBtagger_ = 0;
82 myCtagger_ = 0;88 myCtagger_ = 0;
83 myTAUtagger_ = 0;89 myTAUtagger_ = 0;
90 muon=0;
91 electron=0;
92 tauH=0;
93 tauM=0;
94 tauE=0;
95 photon=0;
84 }96 }
8597
86 /// Destructor98 /// Destructor
8799
=== modified file 'tools/SampleAnalyzer/JetClustering/JetClusteringFastJet.cpp'
--- tools/SampleAnalyzer/JetClustering/JetClusteringFastJet.cpp 2013-05-17 06:19:22 +0000
+++ tools/SampleAnalyzer/JetClustering/JetClusteringFastJet.cpp 2013-06-13 12:22:26 +0000
@@ -27,13 +27,230 @@
2727
28using namespace MA5;28using namespace MA5;
2929
30
31void JetClusteringFastJet::GetFinalState(const MCParticleFormat* part, std::set<const MCParticleFormat*>& finalstates)
32{
33 for (unsigned int i=0; i<part->Daughters().size(); i++)
34 {
35 if (PHYSICS->IsFinalState(part->Daughters()[i])) finalstates.insert(part->Daughters()[i]);
36 else return GetFinalState(part->Daughters()[i],finalstates);
37 }
38}
39
40Bool_t JetClusteringFastJet::IsLast(const MCParticleFormat* part, EventFormat& myEvent)
41{
42 for (unsigned int i=0; i<part->Daughters().size(); i++)
43 {
44 if (part->Daughters()[i]->pdgid()==part->pdgid()) return false;
45 }
46 return true;
47}
48
49
50Bool_t JetClusteringFastJet::IrrelevantPhoton(const MCParticleFormat* part)
51{
52 if (part->mother1()==0) return false;
53
54 // Checking mother
55 UInt_t absid = std::abs(part->mother1()->pdgid());
56
57 if (absid==15) return true;
58 else return IrrelevantPhoton(part->mother1());
59}
60
61Bool_t JetClusteringFastJet::ComingFromHadronDecay(const MCParticleFormat* part)
62{
63 // Weird case ? Safety: removing this case
64 if (part->mother1()==0) return true;
65 // std::cout << "part " << part->pdgid() << " <- " << part->mother1()->pdgid() << std::endl;
66 // Checking mother
67 Bool_t had = PHYSICS->IsHadronic(part->mother1()->pdgid()) && part->mother1()->pdgid()!=21;
68 if (had && part->mother1()->mother1()==0) return false;
69 else if (had) return true;
70 else return ComingFromHadronDecay(part->mother1());
71}
72
73
30bool JetClusteringFastJet::Execute(SampleFormat& mySample, EventFormat& myEvent)74bool JetClusteringFastJet::Execute(SampleFormat& mySample, EventFormat& myEvent)
31{75{
32 if (mySample.mc()==0 || myEvent.mc()==0) return false;76 if (mySample.mc()==0 || myEvent.mc()==0) return false;
33 if (mySample.rec()==0) mySample.InitializeRec();77 if (mySample.rec()==0) mySample.InitializeRec();
34 if (myEvent.rec() ==0) myEvent.InitializeRec();78 if (myEvent.rec() ==0) myEvent.InitializeRec();
79
80 // Reseting the reconstructed event
35 myEvent.rec()->Reset();81 myEvent.rec()->Reset();
3682
83 // Veto
84 std::vector<bool> vetos(myEvent.mc()->particles().size(),false);
85 std::set<const MCParticleFormat*> vetos2;
86
87 // Filling the dataformat with electron/muon
88 for (unsigned int i=0;i<myEvent.mc()->particles().size();i++)
89 {
90 const MCParticleFormat& part = myEvent.mc()->particles()[i];
91 UInt_t absid = std::abs(part.pdgid());
92
93 // Rejecting particle with a null pt (initial state ?)
94 if (part.pt()<1e-10) continue;
95
96 // Treating intermediate particles
97 if (PHYSICS->IsInterState(part))
98 {
99 // rejecting not interesting particles
100 if (absid!=5 && absid!=4 && absid!=15) continue;
101
102 // keeping the last particle with the same id in the decay chain
103 if (!IsLast(&part, myEvent)) continue;
104
105 // looking for b quarks
106 if (absid==5)
107 {
108 bool found=false;
109 for (unsigned int j=0;j<myEvent.rec()->MCBquarks_.size();j++)
110 {
111 if (myEvent.rec()->MCBquarks_[j]==&(part))
112 {found=true; break;}
113 }
114 if (!found) myEvent.rec()->MCBquarks_.push_back(&(part));
115 }
116
117 // looking for c quarks
118 else if (absid==4)
119 {
120 bool found=false;
121 for (unsigned int j=0;j<myEvent.rec()->MCCquarks_.size();j++)
122 {
123 if (myEvent.rec()->MCCquarks_[j]==&(part))
124 {found=true; break;}
125 }
126 if (!found) myEvent.rec()->MCCquarks_.push_back(&(part));
127 }
128
129 // looking for taus
130 else if (absid==15)
131 {
132 // rejecting particle if coming from hadronization
133 if (ComingFromHadronDecay(&part)) continue;
134
135 // Looking taus daughters id
136 bool leptonic = true;
137 bool muonic = false;
138 bool electronic = false;
139 for (unsigned int j=0;j<part.Daughters().size();j++)
140 {
141 UInt_t pdgid = std::abs(part.Daughters()[j]->pdgid());
142 if (pdgid==13) muonic=true;
143 else if (pdgid==11) electronic=true;
144 else if (pdgid!=22 /*photons*/ &&
145 !(pdgid>=11 && pdgid<=16) /*neutrinos*/)
146 leptonic=false;
147 }
148 if (!leptonic) {muonic=false; electronic=false;}
149
150 // Saving taus decaying into muons (only one copy)
151 if (muonic)
152 {
153 bool found=false;
154 for (unsigned int j=0;j<myEvent.rec()->MCMuonicTaus_.size();j++)
155 {
156 if (myEvent.rec()->MCMuonicTaus_[j]==&(part))
157 {found=true; break;}
158 }
159 if (!found) myEvent.rec()->MCMuonicTaus_.push_back(&(part));
160 }
161
162 // Saving taus decaying into electrons (only one copy)
163 else if (electronic)
164 {
165 bool found=false;
166 for (unsigned int j=0;j<myEvent.rec()->MCElectronicTaus_.size();j++)
167 {
168 if (myEvent.rec()->MCElectronicTaus_[j]==&(part))
169 {found=true; break;}
170 }
171 if (!found) myEvent.rec()->MCElectronicTaus_.push_back(&(part));
172 }
173
174 // Saving taus decaying into hadrons (only copy)
175 else
176 {
177 bool found=false;
178 for (unsigned int j=0;j<myEvent.rec()->MCHadronicTaus_.size();j++)
179 {
180 if (myEvent.rec()->MCHadronicTaus_[j]==&(part))
181 {found=true; break;}
182 }
183 if (!found)
184 {
185 // Saving the hadrons in MC container
186 myEvent.rec()->MCHadronicTaus_.push_back(&(part));
187
188 // Applying efficiency
189 if (!myTAUtagger_->IsIdentified()) continue;
190
191 // Creating reco hadronic taus
192 RecTauFormat* myTau = myEvent.rec()->GetNewTau();
193 if (part.pdgid()>0) myTau->setCharge(-1.);
194 else myTau->setCharge(+1.);
195 myTau->setMomentum(part.momentum());
196 myTau->setMc(&part);
197 myTau->setDecayMode(PHYSICS->GetTauDecayMode(myTau->mc()));
198 if (myTau->DecayMode()<=0) myTau->setNtracks(0); // ERROR case
199 else if (myTau->DecayMode()==7 ||
200 myTau->DecayMode()==9) myTau->setNtracks(3); // 3-Prong
201 else myTau->setNtracks(1); // 1-Prong
202
203 // Searching final state
204 GetFinalState(&part,vetos2);
205 }
206 }
207 }
208 }
209
210 // Keeping only final states
211 else if (PHYSICS->IsFinalState(part))
212 {
213 // rejecting not interesting particles
214 if (absid!=22 && absid!=11 && absid!=13) continue;
215
216 // rejecting particle if coming from hadronization
217 if (ExclusiveId_ && ComingFromHadronDecay(&part)) continue;
218
219 // Muons
220 if (absid==13)
221 {
222 vetos[i]=true;
223 RecLeptonFormat * muon = myEvent.rec()->GetNewMuon();
224 muon->setMomentum(part.momentum());
225 muon->setMc(&(part));
226 if (part.pdgid()==13) muon->SetCharge(-1);
227 else muon->SetCharge(+1);
228 }
229
230 // Electrons
231 else if (absid==11)
232 {
233 vetos[i]=true;
234 RecLeptonFormat * elec = myEvent.rec()->GetNewElectron();
235 elec->setMomentum(part.momentum());
236 elec->setMc(&(part));
237 if (part.pdgid()==11) elec->SetCharge(-1);
238 else elec->SetCharge(+1);
239 }
240
241 // Photons
242 else if (absid==22)
243 {
244 if (IrrelevantPhoton(&part)) continue;
245 vetos[i]=true;
246 RecPhotonFormat * photon = myEvent.rec()->GetNewPhoton();
247 photon->setMomentum(part.momentum());
248 photon->setMc(&(part));
249 }
250 }
251
252 }
253
37 double & TET = myEvent.rec()->TET();254 double & TET = myEvent.rec()->TET();
38 double & THT = myEvent.rec()->THT();255 double & THT = myEvent.rec()->THT();
39256
@@ -41,10 +258,21 @@
41 std::vector<fastjet::PseudoJet> inputs;258 std::vector<fastjet::PseudoJet> inputs;
42 for (unsigned int i=0;i<myEvent.mc()->particles().size();i++)259 for (unsigned int i=0;i<myEvent.mc()->particles().size();i++)
43 {260 {
261 const MCParticleFormat& part = myEvent.mc()->particles()[i];
262
44 // Selecting input for jet clustering263 // Selecting input for jet clustering
45 if (myEvent.mc()->particles()[i].statuscode()!=1) continue;264 if (myEvent.mc()->particles()[i].statuscode()!=1) continue;
46 if (PHYSICS->IsInvisible(myEvent.mc()->particles()[i])) continue;265 if (PHYSICS->IsInvisible(myEvent.mc()->particles()[i])) continue;
47 if (fabs(myEvent.mc()->particles()[i].pdgid())==13) continue;266
267 // ExclusiveId mode
268 if (ExclusiveId_)
269 {
270 if (vetos[i]) continue;
271 if (vetos2.find(&part)!=vetos2.end()) continue;
272 }
273
274 // NonExclusive Id mode
275 else if (std::abs(myEvent.mc()->particles()[i].pdgid())==13) continue;
48276
49 // Filling good particle for clustering277 // Filling good particle for clustering
50 inputs.push_back(278 inputs.push_back(
@@ -90,40 +318,35 @@
90 for (unsigned int j=0;j<constituents.size();j++)318 for (unsigned int j=0;j<constituents.size();j++)
91 {319 {
92 jet->AddConstituent(constituents[j].user_index());320 jet->AddConstituent(constituents[j].user_index());
93 // if (fabs(myEvent.mc()->particles()[constituents[j].user_index()].pdgid())==11) continue;321 // if (std::abs(myEvent.mc()->particles()[constituents[j].user_index()].pdgid())==11) continue;
94 if (PDG->IsCharged(myEvent.mc()->particles()[constituents[j].user_index()].pdgid())) tracks++;322 if (PDG->IsCharged(myEvent.mc()->particles()[constituents[j].user_index()].pdgid())) tracks++;
95 }323 }
96 jet->ntracks_ = tracks;324 jet->ntracks_ = tracks;
97 }325 }
98326
99 // Filling the dataformat with electron/muon327
100 for (unsigned int i=0;i<myEvent.mc()->particles().size();i++)328 if (ExclusiveId_)
101 {329 {
102 if (myEvent.mc()->particles()[i].statuscode()!=1) continue;330 for (unsigned int i=0;i<myEvent.rec()->electrons().size();i++)
103 if (fabs(myEvent.mc()->particles()[i].pdgid())==13)331 {
104 {332 (*MET) -= myEvent.rec()->electrons()[i].momentum();
105 RecLeptonFormat * muon = myEvent.rec()->GetNewMuon();333 TET += myEvent.rec()->electrons()[i].pt();
106 muon->setMomentum(myEvent.mc()->particles()[i].momentum());334 }
107 muon->setMc(&(myEvent.mc()->particles()[i]));335 for (unsigned int i=0;i<myEvent.rec()->photons().size();i++)
108 if (myEvent.mc()->particles()[i].pdgid()==13) muon->SetCharge(-1);336 {
109 else muon->SetCharge(+1);337 (*MET) -= myEvent.rec()->photons()[i].momentum();
110 }338 TET += myEvent.rec()->photons()[i].pt();
111 else if (fabs(myEvent.mc()->particles()[i].pdgid())==11)339 }
112 {340 for (unsigned int i=0;i<myEvent.rec()->taus().size();i++)
113 RecLeptonFormat * elec = myEvent.rec()->GetNewElectron();341 {
114 elec->setMomentum(myEvent.mc()->particles()[i].momentum());342 (*MET) -= myEvent.rec()->taus()[i].momentum();
115 elec->setMc(&(myEvent.mc()->particles()[i]));343 TET += myEvent.rec()->taus()[i].pt();
116 if (myEvent.mc()->particles()[i].pdgid()==11) elec->SetCharge(-1);
117 else elec->SetCharge(+1);
118 }344 }
119 }345 }
120346
121
122 for (unsigned int i=0;i<myEvent.rec()->muons().size();i++)347 for (unsigned int i=0;i<myEvent.rec()->muons().size();i++)
123 {348 {
124 (*MET) -= myEvent.rec()->muons()[i].momentum();349 (*MET) -= myEvent.rec()->muons()[i].momentum();
125 // MET->momentum().SetPx(MET->momentum().Px() - myEvent.rec()->muons()[i].px());
126 // MET->momentum().SetPy(MET->momentum().Py() - myEvent.rec()->muons()[i].py());
127 TET += myEvent.rec()->muons()[i].pt();350 TET += myEvent.rec()->muons()[i].pt();
128 }351 }
129352
130353
=== modified file 'tools/SampleAnalyzer/JetClustering/JetClusteringFastJet.h'
--- tools/SampleAnalyzer/JetClustering/JetClusteringFastJet.h 2013-05-17 06:19:22 +0000
+++ tools/SampleAnalyzer/JetClustering/JetClusteringFastJet.h 2013-06-13 12:22:26 +0000
@@ -55,6 +55,7 @@
55 /// Jet definition55 /// Jet definition
56 fastjet::JetDefinition JetDefinition_;56 fastjet::JetDefinition JetDefinition_;
5757
58
58//---------------------------------------------------------------------------------59//---------------------------------------------------------------------------------
59// method members60// method members
60//---------------------------------------------------------------------------------61//---------------------------------------------------------------------------------
@@ -74,6 +75,13 @@
74 /// Initialization75 /// Initialization
75 virtual bool Initialize(const std::map<std::string,std::string>& options)=0;76 virtual bool Initialize(const std::map<std::string,std::string>& options)=0;
7677
78 private:
79 Bool_t IsLast(const MCParticleFormat* part, EventFormat& myEvent);
80 Bool_t ComingFromHadronDecay(const MCParticleFormat* part);
81 Bool_t IrrelevantPhoton(const MCParticleFormat* part);
82 void GetFinalState(const MCParticleFormat* part, std::set<const MCParticleFormat*>& finalstates);
83
84
77};85};
7886
79}87}
8088
=== modified file 'tools/SampleAnalyzer/JetClustering/TaggerBase.cpp'
--- tools/SampleAnalyzer/JetClustering/TaggerBase.cpp 2013-05-17 06:19:22 +0000
+++ tools/SampleAnalyzer/JetClustering/TaggerBase.cpp 2013-06-13 12:22:26 +0000
@@ -35,6 +35,8 @@
35}35}
3636
3737
38
39
38void TaggerBase::SetParameter(const std::string& key, 40void TaggerBase::SetParameter(const std::string& key,
39 const std::string& value,41 const std::string& value,
40 std::string header)42 std::string header)
4143
=== modified file 'tools/SampleAnalyzer/JetClustering/TaggerBase.h'
--- tools/SampleAnalyzer/JetClustering/TaggerBase.h 2013-05-17 06:19:22 +0000
+++ tools/SampleAnalyzer/JetClustering/TaggerBase.h 2013-06-13 12:22:26 +0000
@@ -79,7 +79,7 @@
79 }79 }
8080
81 /// Destructor81 /// Destructor
82 ~TaggerBase()82 virtual ~TaggerBase()
83 {}83 {}
8484
85 /// Matching using dr85 /// Matching using dr
8686
=== modified file 'tools/SampleAnalyzer/JetClustering/TauTagger.cpp'
--- tools/SampleAnalyzer/JetClustering/TauTagger.cpp 2013-05-17 06:19:22 +0000
+++ tools/SampleAnalyzer/JetClustering/TauTagger.cpp 2013-06-13 12:22:26 +0000
@@ -28,116 +28,10 @@
2828
29void TauTagger::Method1 (SampleFormat& mySample, EventFormat& myEvent)29void TauTagger::Method1 (SampleFormat& mySample, EventFormat& myEvent)
30{30{
31 // loop on the particles searching for tau
32 for (unsigned int i=0;i<myEvent.mc()->particles().size();i++)
33 {
34 // Keeping only taus
35 if (fabs(myEvent.mc()->particles()[i].pdgid())!=15) continue;
36
37 // Removing initial states
38 if (PHYSICS->IsInitialState(myEvent.mc()->particles()[i])) continue;
39
40 // Removing final states
41 if (PHYSICS->IsFinalState(myEvent.mc()->particles()[i])) continue;
42
43 // Keeping the last taus in the decay chain
44 if (!IsLast(&myEvent.mc()->particles()[i], myEvent)) continue;
45
46 // Removing taus decaying to leptons
47 bool leptonic=true;
48 bool muonic=false;
49 bool electronic=false;
50 for (unsigned int j=0;j<myEvent.mc()->particles()[i].Daughters().size();j++)
51 {
52 unsigned int pdgid =
53 std::abs(myEvent.mc()->particles()[i].Daughters()[j]->pdgid());
54 if (pdgid==13) muonic=true;
55 else if (pdgid==11) electronic=true;
56 if (pdgid!=22 && !(pdgid>=11 && pdgid<=18)) {leptonic=false;}
57 }
58 if (leptonic && muonic)
59 {
60 bool found=false;
61 for (unsigned int j=0;j<myEvent.rec()->MCMuonicTaus_.size();j++)
62 {
63 if (myEvent.rec()->MCMuonicTaus_[j]==&(myEvent.mc()->particles()[i]))
64 {found=true; break;}
65 }
66 if (!found)
67 myEvent.rec()->MCMuonicTaus_.push_back(&(myEvent.mc()->particles()[i]));
68 }
69 else if (leptonic && electronic)
70 {
71 bool found=false;
72 for (unsigned int j=0;j<myEvent.rec()->MCElectronicTaus_.size();j++)
73 {
74 if (myEvent.rec()->MCElectronicTaus_[j]==&(myEvent.mc()->particles()[i]))
75 {found=true; break;}
76 }
77 if (!found)
78 myEvent.rec()->MCElectronicTaus_.push_back(&(myEvent.mc()->particles()[i]));
79 }
80 else if (!leptonic)
81 {
82 bool found=false;
83 for (unsigned int j=0;j<myEvent.rec()->MCHadronicTaus_.size();j++)
84 {
85 if (myEvent.rec()->MCHadronicTaus_[j]==&(myEvent.mc()->particles()[i]))
86 {found=true; break;}
87 }
88 if (!found)
89 myEvent.rec()->MCHadronicTaus_.push_back(&(myEvent.mc()->particles()[i]));
90
91 }
92 }
93
94 // Matching MCtaus and RECtaus
95 std::vector<std::pair<RecJetFormat*,MCParticleFormat*> > Candidates;
96 for (unsigned int i=0;i<myEvent.rec()->MCHadronicTaus_.size();i++)
97 {
98 RecJetFormat* tag = 0;
99 Double_t DeltaRmax = DeltaRmax_;
100
101 // loop on the jets
102 for (unsigned int j=0;j<myEvent.rec()->jets().size();j++)
103 {
104 // if (myEvent.rec()->jets()[j].ntracks()!=1 &&
105 // myEvent.rec()->jets()[j].ntracks()!=3) continue;
106
107 // Calculating Delta R
108 Float_t DeltaR =
109 myEvent.rec()->MCHadronicTaus_[i]->dr(myEvent.rec()->jets()[j]);
110
111 if (DeltaR <= DeltaRmax)
112 {
113 if(Exclusive_)
114 {
115 tag = &(myEvent.rec()->jets()[j]);
116 DeltaRmax = DeltaR;
117 }
118 else Candidates.push_back(
119 std::make_pair(& myEvent.rec()->jets()[j],
120 myEvent.rec()->MCHadronicTaus_[i]) );
121 }
122 }
123 if (Exclusive_ && tag!=0)
124 Candidates.push_back(std::make_pair(tag,
125 myEvent.rec()->MCHadronicTaus_[i]));
126 }
127
128 // Performing efficiency
129 for (unsigned int i=0;i<Candidates.size();i++)
130 {
131 if (!IsIdentified()) continue;
132 Candidates[i].first->mc_ = Candidates[i].second;
133 RecTauFormat* myTau = myEvent.rec()->GetNewTau();
134 Jet2Tau(Candidates[i].first, myTau, myEvent);
135 // myEvent.rec()->jets().erase((std::vector<RecJetFormat>::iterator) Candidates[j-1]);
136 }
137
138 // Performing mis-id31 // Performing mis-id
139 if (doMisefficiency_)32 if (doMisefficiency_)
140 {33 {
34 std::vector<unsigned int> toRemove;
141 for (unsigned int i=0;i<myEvent.rec()->jets().size();i++)35 for (unsigned int i=0;i<myEvent.rec()->jets().size();i++)
142 {36 {
143 // keeping only light jets37 // keeping only light jets
@@ -149,8 +43,14 @@
149 {43 {
150 RecTauFormat* myTau = myEvent.rec()->GetNewTau();44 RecTauFormat* myTau = myEvent.rec()->GetNewTau();
151 Jet2Tau(&myEvent.rec()->jets()[i], myTau, myEvent);45 Jet2Tau(&myEvent.rec()->jets()[i], myTau, myEvent);
46 toRemove.push_back(i);
152 }47 }
153 }48 }
49 for (unsigned int i =0;i<toRemove.size();i++)
50 {
51 myEvent.rec()->jets().erase(myEvent.rec()->jets().begin()
52 + toRemove[i]);
53 }
154 }54 }
15555
156}56}
@@ -338,8 +238,8 @@
338 charge += PDG->GetCharge(myEvent.mc()->particles()[myJet->Constituents_[i]].pdgid());238 charge += PDG->GetCharge(myEvent.mc()->particles()[myJet->Constituents_[i]].pdgid());
339 }239 }
340240
341 if (charge == 3) myTau->charge_ = true;241 if (charge>0) myTau->charge_ = true;
342 else if (charge == -3) myTau->charge_ = false;242 else if (charge<=0) myTau->charge_ = false;
343}243}
344244
345245
@@ -378,8 +278,6 @@
378std::string TauTagger::GetParameters()278std::string TauTagger::GetParameters()
379{279{
380 std::stringstream str;280 std::stringstream str;
381 str << "dR=" << DeltaRmax_ << " ; ";
382 if (Exclusive_) str << "Exclusive ; "; else str << "Inclusive ; ";
383 str << "IDeff=" << Efficiency_;281 str << "IDeff=" << Efficiency_;
384 str << " ; MisID(q)=" << misid_ljet_;282 str << " ; MisID(q)=" << misid_ljet_;
385 return str.str();283 return str.str();
386284
=== modified file 'tools/SampleAnalyzer/JetClustering/TauTagger.h'
--- tools/SampleAnalyzer/JetClustering/TauTagger.h 2013-05-17 06:19:22 +0000
+++ tools/SampleAnalyzer/JetClustering/TauTagger.h 2013-06-13 12:22:26 +0000
@@ -27,7 +27,7 @@
2727
28//SampleAnalyser headers28//SampleAnalyser headers
29#include "SampleAnalyzer/JetClustering/TaggerBase.h"29#include "SampleAnalyzer/JetClustering/TaggerBase.h"
3030#include <TH1F.h>
3131
32namespace MA532namespace MA5
33{33{
@@ -44,7 +44,7 @@
4444
45 /// Apply misefficiency45 /// Apply misefficiency
46 Bool_t doMisefficiency_;46 Bool_t doMisefficiency_;
4747 // TH1F* htest;
4848
49//---------------------------------------------------------------------------------49//---------------------------------------------------------------------------------
50// method members50// method members
@@ -56,10 +56,12 @@
56 {56 {
57 misid_ljet_=0.0;57 misid_ljet_=0.0;
58 doMisefficiency_=false;58 doMisefficiency_=false;
59 // htest = new TH1F("eric","eric",10,0,10);
59 }60 }
6061
61 /// Destructor62 /// Destructor
62 ~TauTagger () { }63 virtual ~TauTagger ()
64 { /*htest->SaveAs("Alloul.root");*/ }
6365
64 /// Matching using dr66 /// Matching using dr
65 virtual void Method1 (SampleFormat& mySample, EventFormat& myEvent);67 virtual void Method1 (SampleFormat& mySample, EventFormat& myEvent);
6668
=== modified file 'tools/SampleAnalyzer/JetClustering/bTagger.cpp'
--- tools/SampleAnalyzer/JetClustering/bTagger.cpp 2013-05-17 06:19:22 +0000
+++ tools/SampleAnalyzer/JetClustering/bTagger.cpp 2013-06-13 12:22:26 +0000
@@ -29,49 +29,6 @@
29{29{
30 std::vector<RecJetFormat*> Candidates;30 std::vector<RecJetFormat*> Candidates;
3131
32 // loop on the particles searching for b
33 for (unsigned int i=0;i<myEvent.mc()->particles().size();i++)
34 {
35 // Keeping only b-quark
36 if (std::abs(myEvent.mc()->particles()[i].pdgid())!=5 &&
37 std::abs(myEvent.mc()->particles()[i].pdgid())!=4) continue;
38
39 // Removing initial states
40 if (PHYSICS->IsInitialState(myEvent.mc()->particles()[i])) continue;
41
42 // Removing final states
43 if (PHYSICS->IsFinalState(myEvent.mc()->particles()[i])) continue;
44
45 // Keeping the last taus in the decay chain
46 if (!IsLast(&myEvent.mc()->particles()[i], myEvent)) continue;
47
48 // b-quark already defined ?
49 if (std::abs(myEvent.mc()->particles()[i].pdgid())==5)
50 {
51 bool found=false;
52 for (unsigned int j=0;j<myEvent.rec()->MCBquarks_.size();j++)
53 {
54 if (myEvent.rec()->MCBquarks_[j]==&(myEvent.mc()->particles()[i]))
55 {found=true; break;}
56 }
57 if (!found)
58 myEvent.rec()->MCBquarks_.push_back(&(myEvent.mc()->particles()[i]));
59 }
60
61 // c-quark already defined ?
62 else if (std::abs(myEvent.mc()->particles()[i].pdgid())==4)
63 {
64 bool found=false;
65 for (unsigned int j=0;j<myEvent.rec()->MCCquarks_.size();j++)
66 {
67 if (myEvent.rec()->MCCquarks_[j]==&(myEvent.mc()->particles()[i]))
68 {found=true; break;}
69 }
70 if (!found)
71 myEvent.rec()->MCCquarks_.push_back(&(myEvent.mc()->particles()[i]));
72 }
73 }
74
75 // Matching b-quarks to jets32 // Matching b-quarks to jets
76 for (unsigned int i=0;i<myEvent.rec()->MCBquarks_.size();i++)33 for (unsigned int i=0;i<myEvent.rec()->MCBquarks_.size();i++)
77 {34 {
@@ -81,6 +38,7 @@
81 // loop on the jets38 // loop on the jets
82 for (unsigned int j=0;j<myEvent.rec()->jets().size();j++)39 for (unsigned int j=0;j<myEvent.rec()->jets().size();j++)
83 {40 {
41 if (myEvent.rec()->jets()[j].pt()<1e-10) continue;
84 Float_t DeltaR = myEvent.rec()->MCBquarks_[i]->dr(myEvent.rec()->jets()[j]);42 Float_t DeltaR = myEvent.rec()->MCBquarks_[i]->dr(myEvent.rec()->jets()[j]);
8543
86 if (DeltaR <= DeltaRmax) 44 if (DeltaR <= DeltaRmax)
@@ -112,6 +70,8 @@
112 // loop on the jets70 // loop on the jets
113 for (unsigned int j=0;j<myEvent.rec()->jets().size();j++)71 for (unsigned int j=0;j<myEvent.rec()->jets().size();j++)
114 {72 {
73 if (myEvent.rec()->jets()[j].pt()<1e-10) continue;
74
115 Float_t DeltaR = 75 Float_t DeltaR =
116 myEvent.rec()->MCCquarks_[i]->dr(myEvent.rec()->jets()[j]);76 myEvent.rec()->MCCquarks_[i]->dr(myEvent.rec()->jets()[j]);
11777
11878
=== modified file 'tools/SampleAnalyzer/JetClustering/bTagger.h'
--- tools/SampleAnalyzer/JetClustering/bTagger.h 2013-05-17 06:19:22 +0000
+++ tools/SampleAnalyzer/JetClustering/bTagger.h 2013-06-13 12:22:26 +0000
@@ -62,7 +62,7 @@
62 }62 }
6363
64 /// Destructor64 /// Destructor
65 ~bTagger() {}65 virtual ~bTagger() {}
6666
67 /// Matching using dr67 /// Matching using dr
68 virtual void Method1 (SampleFormat& mySample, EventFormat& myEvent);68 virtual void Method1 (SampleFormat& mySample, EventFormat& myEvent);
6969
=== modified file 'tools/SampleAnalyzer/JetClustering/cTagger.h'
--- tools/SampleAnalyzer/JetClustering/cTagger.h 2013-05-17 06:19:22 +0000
+++ tools/SampleAnalyzer/JetClustering/cTagger.h 2013-06-13 12:22:26 +0000
@@ -45,7 +45,7 @@
45 cTagger() {}45 cTagger() {}
4646
47 /// Destructor47 /// Destructor
48 ~cTagger () {}48 virtual ~cTagger () {}
4949
50 /// Matching using dr50 /// Matching using dr
51 virtual void Method1 (SampleFormat& mySample, EventFormat& myEvent);51 virtual void Method1 (SampleFormat& mySample, EventFormat& myEvent);
5252
=== removed file 'tools/SampleAnalyzer/Makefile'
--- tools/SampleAnalyzer/Makefile 2013-04-19 17:21:55 +0000
+++ tools/SampleAnalyzer/Makefile 1970-01-01 00:00:00 +0000
@@ -1,89 +0,0 @@
1################################################################################
2# MAKEFILE DEVOTED TO SAMPLE ANALYZER LIBRARY #
3################################################################################
4
5# Compilators
6GCC = g++
7
8# Options for compilation
9CXXFASTJET = $(shell fastjet-config --cxxflags --plugins)
10CXXFLAGS = -Wall -O3 $(shell root-config --cflags) -I./../ -DZIP_USE -DFASTJET_USE $(CXXFASTJET)
11
12# Files
13SRCS = $(wildcard */*.cpp)
14HDRS = $(wildcard */*.h)
15OBJS = $(SRCS:.cpp=.o)
16
17# Name of the library
18PROGRAM = SampleAnalyzer
19
20# Defining colours
21GREEN = "\\033[1;32m"
22RED = "\\033[1;31m"
23PINK = "\\033[1;35m"
24BLUE = "\\033[1;34m"
25YELLOW = "\\033[1;33m"
26CYAN = "\\033[1;36m"
27NORMAL = "\\033[0;39m"
28
29# All target
30all: header compile_header compile link_header link
31
32# Header target
33header:
34 @echo -e $(YELLOW)"--------------------------------------------------"
35 @echo -e " Building SampleAnalyzer library "
36 @echo -e "--------------------------------------------------"$(NORMAL)
37
38# Compile_header target
39compile_header:
40 @echo -e $(YELLOW)"--------------------------------------------------"
41 @echo -e " Compilation "
42 @echo -e "--------------------------------------------------"$(NORMAL)
43
44# Link_header target
45link_header:
46 @echo -e $(YELLOW)"--------------------------------------------------"
47 @echo -e " Final linking "
48 @echo -e "--------------------------------------------------"$(NORMAL)
49
50# clean_header target
51clean_header:
52 @echo -e $(YELLOW)"--------------------------------------------------"
53 @echo -e " Removing intermediate files from building "
54 @echo -e "--------------------------------------------------"$(NORMAL)
55
56# mrproper_header target
57mrproper_header:
58 @echo -e $(YELLOW)"--------------------------------------------------"
59 @echo -e " Cleaning all the project "
60 @echo -e "--------------------------------------------------"$(NORMAL)
61
62# Precompile target
63precompile:
64
65# Compile target
66compile: precompile $(OBJS)
67
68# Link target
69link: $(OBJS)
70 ar -ruc Lib/lib$(PROGRAM).a $(OBJS)
71
72# Phony target
73.PHONY: do_clean header compile_header link_header
74
75# Clean target
76clean: clean_header do_clean
77
78# Do clean target
79do_clean:
80 @rm -f $(OBJS) Reader/FACdict.*
81
82# Mr Proper target
83mrproper: mrproper_header do_mrproper
84
85# Do Mr Proper target
86do_mrproper: do_clean
87 @rm -f Lib/lib$(PROGRAM).a
88 @rm -f compilation.log linking.log cleanup.log *~ */*~
89
900
=== modified file 'tools/SampleAnalyzer/Reader/HEPMCReader.cpp'
--- tools/SampleAnalyzer/Reader/HEPMCReader.cpp 2013-05-17 06:19:22 +0000
+++ tools/SampleAnalyzer/Reader/HEPMCReader.cpp 2013-06-13 12:22:26 +0000
@@ -133,6 +133,7 @@
133}133}
134134
135135
136
136// -----------------------------------------------------------------------------137// -----------------------------------------------------------------------------
137// FinalizeEvent138// FinalizeEvent
138// -----------------------------------------------------------------------------139// -----------------------------------------------------------------------------
@@ -150,11 +151,39 @@
150 mySample.mc()->set_xsection(value);151 mySample.mc()->set_xsection(value);
151 mySample.mc()->set_xsection_error(err_value);152 mySample.mc()->set_xsection_error(err_value);
152153
153 // Mother pointer assignment154 // Computing met, mht, ...
154 for (unsigned int i=0; i<myEvent.mc()->particles_.size();i++)155 for (unsigned int i=0; i<myEvent.mc()->particles_.size();i++)
155 {156 {
156 MCParticleFormat& part = myEvent.mc()->particles_[i];157 MCParticleFormat& part = myEvent.mc()->particles_[i];
157158
159 // Setting mother
160 if (part.extra1_!=part.extra2_)
161 {
162 unsigned int nmother=0;
163 for (unsigned int j=0; j < myEvent.mc()->particles_.size();j++)
164 {
165 if (i==j) continue;
166 if (part.extra1_ == myEvent.mc()->particles_[j].extra2_)
167 {
168 // set daughter
169 myEvent.mc()->particles_[j].Daughters_.push_back(&part);
170
171 // set mother
172 nmother++;
173 if (nmother==1) part.mother1_=&(myEvent.mc()->particles()[j]);
174 else if (nmother==2) part.mother2_=&(myEvent.mc()->particles()[j]);
175 else
176 {
177 if (warnmother_)
178 {
179 WARNING << "Number of mothers greather than 2 : " << nmother << endmsg;
180 warnmother_=false;
181 }
182 }
183 }
184 }
185 }
186
158 // MET, MHT, TET, THT187 // MET, MHT, TET, THT
159 if (part.statuscode()==1 && !PHYSICS->IsInvisible(part))188 if (part.statuscode()==1 && !PHYSICS->IsInvisible(part))
160 {189 {
@@ -410,12 +439,12 @@
410// FillEventParticleLine439// FillEventParticleLine
411// -----------------------------------------------------------------------------440// -----------------------------------------------------------------------------
412void HEPMCReader::FillEventParticleLine(const std::string& line,441void HEPMCReader::FillEventParticleLine(const std::string& line,
413 EventFormat& myEvent)442 EventFormat& myEvent)
414{443{
415 std::stringstream str;444 std::stringstream str;
416 str << line;445 str << line;
417446
418 double tmp; // temporary variable to fill in LorentzVector447 double tmp; // temporary variable to fill in LorentzVector
419448
420 // Get a new particle449 // Get a new particle
421 MCParticleFormat * part = myEvent.mc()->GetNewParticle();450 MCParticleFormat * part = myEvent.mc()->GetNewParticle();
@@ -432,9 +461,8 @@
432 str >> part->statuscode_;461 str >> part->statuscode_;
433 str >> tmp; 462 str >> tmp;
434 str >> tmp; 463 str >> tmp;
435 str >> part->extra_;464 str >> part->extra2_;
436465 part->extra1_=current_vertex_.barcode_;
437 SetMother(part, myEvent);
438}466}
439467
440// -----------------------------------------------------------------------------468// -----------------------------------------------------------------------------
@@ -460,19 +488,45 @@
460//--------------------------------------------------------------------------488//--------------------------------------------------------------------------
461// SetMother489// SetMother
462//--------------------------------------------------------------------------490//--------------------------------------------------------------------------
463void HEPMCReader::SetMother(MCParticleFormat* part, EventFormat& myEvent)491void HEPMCReader::SetMother(MCParticleFormat* const part, EventFormat& myEvent)
464{492{
493 /* std::cout << current_vertex_.barcode_ << std::endl;
494
495 // No history
465 if (myEvent.mc()->particles().size()==0) return;496 if (myEvent.mc()->particles().size()==0) return;
466 497
498 //ERIC orphan special treatment
499 if (part->extra_==current_vertex_.barcode_) return;
500
501 std::cout << "---------------------------------------------" << std::endl;
502 for (unsigned int i=0;i<myEvent.mc()->particles().size();i++)
503 {
504 std::cout << "i=" << i << "\t" << myEvent.mc()->particles()[i].pdgid() << " from ";
505 if (myEvent.mc()->particles()[i].mother1()!=0) std::cout << myEvent.mc()->particles()[i].mother1()->pdgid();
506 std::cout << " extra=" << myEvent.mc()->particles()[i].extra_ << " current=" << current_vertex_.barcode_ << std::endl;
507 std::cout << std::endl;
508 }
509
510
467 unsigned int nmother=0;511 unsigned int nmother=0;
468 for (unsigned int i =0; i<(myEvent.mc()->particles().size()-1);i++)512 for (unsigned int i=0;i<(myEvent.mc()->particles().size()-1);i++)
469 {513 {
470 if(myEvent.mc()->particles()[i].extra_==current_vertex_.barcode_)514 if(myEvent.mc()->particles()[i].extra_==current_vertex_.barcode_)
471 {515 {
472 nmother++;516 nmother++;
473 if(nmother==1) part->mother1_=&(myEvent.mc()->particles()[i]);517 if (nmother==1) part->mother1_=&(myEvent.mc()->particles()[i]);
474 else if(nmother==2) part->mother2_=&(myEvent.mc()->particles()[i]);518 else if (nmother==2) part->mother2_=&(myEvent.mc()->particles()[i]);
475 else { if (warnmother_) {WARNING << "Number of mothers greather than 2 : " << nmother << endmsg; warnmother_=false;} }519 else
520 {
521 if (warnmother_)
522 {
523 WARNING << "Number of mothers greather than 2 : " << nmother << endmsg;
524 warnmother_=false;
525 }
526 }
476 }527 }
477 }528 }
529
530 if (part->pdgid()==-24) {std::cout << "MMMMHHH" << std::endl; ComingFromHadronDecay(part); }
531 */
478}532}
479533
=== modified file 'tools/SampleAnalyzer/Reader/HEPMCReader.h'
--- tools/SampleAnalyzer/Reader/HEPMCReader.h 2013-05-17 06:19:22 +0000
+++ tools/SampleAnalyzer/Reader/HEPMCReader.h 2013-06-13 12:22:26 +0000
@@ -96,7 +96,7 @@
96 void FillEventPDFInfo(const std::string& line, SampleFormat& mySample, EventFormat& myEvent);96 void FillEventPDFInfo(const std::string& line, SampleFormat& mySample, EventFormat& myEvent);
97 void FillEventParticleLine(const std::string& line, EventFormat& myEvent);97 void FillEventParticleLine(const std::string& line, EventFormat& myEvent);
98 void FillEventVertexLine(const std::string& line, EventFormat& myEvent);98 void FillEventVertexLine(const std::string& line, EventFormat& myEvent);
99 void SetMother(MCParticleFormat* part, EventFormat& myEvent);99 void SetMother(MCParticleFormat* const part, EventFormat& myEvent);
100 Bool_t FillWeightNames(const std::string& line);100 Bool_t FillWeightNames(const std::string& line);
101 Bool_t FillHeavyIons(const std::string& line);101 Bool_t FillHeavyIons(const std::string& line);
102102
103103
=== modified file 'tools/SampleAnalyzer/Reader/LHCOReader.cpp'
--- tools/SampleAnalyzer/Reader/LHCOReader.cpp 2013-05-17 07:13:44 +0000
+++ tools/SampleAnalyzer/Reader/LHCOReader.cpp 2013-06-13 12:22:26 +0000
@@ -65,49 +65,49 @@
6565
66 bool EndOfLoop = false;66 bool EndOfLoop = false;
67 67
68// Declarging a new string for line68 // Declarging a new string for line
69 std::string line;69 std::string line;
70 std::string tmp;70 std::string tmp;
71 71
72 do72 do
73 {73 {
74 std::stringstream str;74 std::stringstream str;
75 str.str("");75 str.str("");
76 76
77 77 if (!ReadLine(line))
78 if (!ReadLine(line))78 {
79 {79 EndOfFile_=true;
80 EndOfFile_=true;80 return StatusCode::KEEP;
81 return StatusCode::KEEP;81 }
82 }82 str << line;
83 str << line;83 str >> tmp;
84 str >> tmp;84
8585 if (saved_)
86 if (saved_)86 {
87 {87 FillEventInitLine(savedline_,myEvent);
88 FillEventInitLine(savedline_,myEvent);88 saved_=false;
89 saved_=false;89 }
90 }90
9191 if(tmp=="0")
92 if(tmp=="0")92 {
93 {93 if(firstevent_ )
94 if(firstevent_ )
95 {94 {
96 FillEventInitLine(line,myEvent);95 FillEventInitLine(line,myEvent);
96 firstevent_=false;
97 continue;
97 }98 }
98 else 99 else
99 {100 {
100 EndOfLoop = true;101 EndOfLoop = true;
101 savedline_=line;102 savedline_=line;
102 saved_=true;103 saved_=true;
103 continue;104 continue;
104 }105 }
105 }106 }
106107
107 FillEventParticleLine(line,myEvent);108 FillEventParticleLine(line,myEvent);
108 109
109 firstevent_=false;110 }
110 }
111 while(!EndOfLoop);111 while(!EndOfLoop);
112 112
113 // Normal end113 // Normal end
@@ -280,6 +280,7 @@
280 // 9th column : isolation280 // 9th column : isolation
281 str >> tmp;281 str >> tmp;
282 muon->sumPT_isol_=std::floor(tmp);282 muon->sumPT_isol_=std::floor(tmp);
283
283 Float_t ET_PT=tmp-muon->sumPT_isol_;284 Float_t ET_PT=tmp-muon->sumPT_isol_;
284 Bool_t test=false;285 Bool_t test=false;
285 for (unsigned int j=0;j<5;j++)286 for (unsigned int j=0;j<5;j++)
@@ -291,7 +292,7 @@
291 break;292 break;
292 }293 }
293 }294 }
294 if (test) muon->sumET_isol_=std::floor(ET_PT)*muon->sumPT_isol_;295 if (test) muon->sumET_isol_=std::floor(ET_PT)*muon->pt();
295 else muon->sumET_isol_=0;296 else muon->sumET_isol_=0;
296 }297 }
297298
298299
=== modified file 'tools/SampleAnalyzer/Reader/ReaderTextBase.cpp'
--- tools/SampleAnalyzer/Reader/ReaderTextBase.cpp 2013-05-17 06:19:22 +0000
+++ tools/SampleAnalyzer/Reader/ReaderTextBase.cpp 2013-06-13 12:22:26 +0000
@@ -233,6 +233,8 @@
233Long64_t ReaderTextBase::GetPosition()233Long64_t ReaderTextBase::GetPosition()
234{234{
235 if (input_==0) return 0;235 if (input_==0) return 0;
236#ifdef ZIP_USE
236 if (compress_) return gzinput_->tellg();237 if (compress_) return gzinput_->tellg();
238#endif
237 else return input_->tellg();239 else return input_->tellg();
238}240}
239241
=== added file 'tools/SampleAnalyzer/Service/CompilationService.h'
--- tools/SampleAnalyzer/Service/CompilationService.h 1970-01-01 00:00:00 +0000
+++ tools/SampleAnalyzer/Service/CompilationService.h 2013-06-13 12:22:26 +0000
@@ -0,0 +1,30 @@
1////////////////////////////////////////////////////////////////////////////////
2//
3// Copyright (C) 2012-2013 Eric Conte, Benjamin Fuks
4// The MadAnalysis development team, email: <ma5team@iphc.cnrs.fr>
5//
6// This file is part of MadAnalysis 5.
7// Official website: <https://launchpad.net/madanalysis5>
8//
9// MadAnalysis 5 is free software: you can redistribute it and/or modify
10// it under the terms of the GNU General Public License as published by
11// the Free Software Foundation, either version 3 of the License, or
12// (at your option) any later version.
13//
14// MadAnalysis 5 is distributed in the hope that it will be useful,
15// but WITHOUT ANY WARRANTY; without even the implied warranty of
16// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17// GNU General Public License for more details.
18//
19// You should have received a copy of the GNU General Public License
20// along with MadAnalysis 5. If not, see <http://www.gnu.org/licenses/>
21//
22////////////////////////////////////////////////////////////////////////////////
23
24
25#ifndef TIMER_SERVICE_H
26#define TIMER_SERVICE_H
27
28#define UNUSED(expr) do {(void)(expr);} while(0);
29
30#endif
031
=== modified file 'tools/SampleAnalyzer/Service/Physics.h'
--- tools/SampleAnalyzer/Service/Physics.h 2013-05-17 06:19:22 +0000
+++ tools/SampleAnalyzer/Service/Physics.h 2013-06-13 12:22:26 +0000
@@ -132,7 +132,8 @@
132 /// Is Initial State132 /// Is Initial State
133 Bool_t IsInitialState(const MCParticleFormat& part) const133 Bool_t IsInitialState(const MCParticleFormat& part) const
134 {134 {
135 return (part.statuscode()==initialstate_);135 // return (part.statuscode()==initialstate_);
136 return (part.statuscode()==-1 || (part.statuscode()>=11 && part.statuscode()<=19));
136 }137 }
137138
138 /// Is Final State139 /// Is Final State
@@ -144,7 +145,7 @@
144 /// Is Inter State145 /// Is Inter State
145 Bool_t IsInterState(const MCParticleFormat& part) const146 Bool_t IsInterState(const MCParticleFormat& part) const
146 {147 {
147 return (part.statuscode()!=finalstate_ && part.statuscode()!=initialstate_);148 return (!IsInitialState(part) && !IsFinalState(part));
148 }149 }
149150
150 /// Is Initial State151 /// Is Initial State
@@ -225,6 +226,13 @@
225 if (found==mcConfig_.hadronic_ids_.end()) return false; else return true;226 if (found==mcConfig_.hadronic_ids_.end()) return false; else return true;
226 }227 }
227228
229 /// Is hadronic ?
230 inline bool IsHadronic(Int_t pdgid) const
231 {
232 std::set<Int_t>::iterator found = mcConfig_.hadronic_ids_.find(pdgid);
233 if (found==mcConfig_.hadronic_ids_.end()) return false; else return true;
234 }
235
228 /// Is invisible ?236 /// Is invisible ?
229 inline bool IsInvisible(const MCParticleFormat& part) const237 inline bool IsInvisible(const MCParticleFormat& part) const
230 {238 {
231239
=== added file 'tools/SampleAnalyzer/Writer/LHCOParticleFormat.cpp'
--- tools/SampleAnalyzer/Writer/LHCOParticleFormat.cpp 1970-01-01 00:00:00 +0000
+++ tools/SampleAnalyzer/Writer/LHCOParticleFormat.cpp 2013-06-13 12:22:26 +0000
@@ -0,0 +1,98 @@
1////////////////////////////////////////////////////////////////////////////////
2//
3// Copyright (C) 2012-2013 Eric Conte, Benjamin Fuks
4// The MadAnalysis development team, email: <ma5team@iphc.cnrs.fr>
5//
6// This file is part of MadAnalysis 5.
7// Official website: <https://launchpad.net/madanalysis5>
8//
9// MadAnalysis 5 is free software: you can redistribute it and/or modify
10// it under the terms of the GNU General Public License as published by
11// the Free Software Foundation, either version 3 of the License, or
12// (at your option) any later version.
13//
14// MadAnalysis 5 is distributed in the hope that it will be useful,
15// but WITHOUT ANY WARRANTY; without even the implied warranty of
16// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17// GNU General Public License for more details.
18//
19// You should have received a copy of the GNU General Public License
20// along with MadAnalysis 5. If not, see <http://www.gnu.org/licenses/>
21//
22////////////////////////////////////////////////////////////////////////////////
23
24
25// STL headers
26#include <sstream>
27#include <iomanip>
28
29// SampleAnalyzer headers
30#include "SampleAnalyzer/Writer/LHCOParticleFormat.h"
31
32using namespace MA5;
33
34// -----------------------------------------------------------------------------
35// Header
36// -----------------------------------------------------------------------------
37const std::string LHCOParticleFormat::header = " # typ eta phi pt jmas ntrk btag had/em dum1 dum2";
38
39
40// -----------------------------------------------------------------------------
41// Print a particle line
42// -----------------------------------------------------------------------------
43void LHCOParticleFormat::Print(UInt_t num, std::ostream* out)
44{
45 *out << std::setw(3) << std::right << num;
46 *out << " ";
47 *out << std::setw(2) << std::right << id;
48 *out << " ";
49 *out << std::fixed;
50 unsigned int pres = out->precision();
51 out->precision(3);
52 double myeta = eta;
53 if (myeta>9) myeta=9.999;
54 else if (myeta<-9) myeta=-9.999;
55 *out << std::setw(6) << std::right << myeta; // -X.YYY
56 *out << " ";
57 *out << std::setw(6) << std::right << phi; // -X.YYY
58 *out << " ";
59 *out << std::setw(8) << std::right << pt; // XXXX.YYY
60 *out << " ";
61 *out << std::setw(6) << std::right << jmass; // -X.YYY
62 *out << " ";
63 double myntrk = ntrk;
64 if (myntrk>9) myntrk=9.999;
65 else if (myntrk<-9) myntrk=-9.999;
66 *out << std::setw(6) << std::right << myntrk; // -X.YYY
67 *out << " ";
68 *out << std::setw(5) << std::right << btag; // X.YYY
69 *out << " ";
70 out->precision(2);
71 *out << std::setw(5) << std::right << hadem; // XX.YY
72 *out << " ";
73 *out << std::setw(5) << std::right << 0.; // -X.YY
74 *out << " ";
75 *out << std::setw(5) << std::right << 0.; // -X.YY
76 out->precision(pres);
77 *out << std::endl;
78}
79
80
81// -----------------------------------------------------------------------------
82// Print the event header
83// -----------------------------------------------------------------------------
84void LHCOParticleFormat::WriteEventHeader(unsigned int numEvent,
85 std::ostream* out)
86{
87 // Particle number
88 *out << std::setw(3) << std::right << 0;
89 *out << " ";
90
91 // Event number
92 *out << std::setw(10) << std::right << numEvent+1;
93 *out << " ";
94
95 // Trigger word
96 *out << std::setw(6) << std::right << 0;
97 *out << std::endl;
98}
099
=== added file 'tools/SampleAnalyzer/Writer/LHCOParticleFormat.h'
--- tools/SampleAnalyzer/Writer/LHCOParticleFormat.h 1970-01-01 00:00:00 +0000
+++ tools/SampleAnalyzer/Writer/LHCOParticleFormat.h 2013-06-13 12:22:26 +0000
@@ -0,0 +1,64 @@
1////////////////////////////////////////////////////////////////////////////////
2//
3// Copyright (C) 2012-2013 Eric Conte, Benjamin Fuks
4// The MadAnalysis development team, email: <ma5team@iphc.cnrs.fr>
5//
6// This file is part of MadAnalysis 5.
7// Official website: <https://launchpad.net/madanalysis5>
8//
9// MadAnalysis 5 is free software: you can redistribute it and/or modify
10// it under the terms of the GNU General Public License as published by
11// the Free Software Foundation, either version 3 of the License, or
12// (at your option) any later version.
13//
14// MadAnalysis 5 is distributed in the hope that it will be useful,
15// but WITHOUT ANY WARRANTY; without even the implied warranty of
16// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17// GNU General Public License for more details.
18//
19// You should have received a copy of the GNU General Public License
20// along with MadAnalysis 5. If not, see <http://www.gnu.org/licenses/>
21//
22////////////////////////////////////////////////////////////////////////////////
23
24
25#ifndef LHCO_PARTICLE_FORMAT_h
26#define LHCO_PARTICLE_FORMAT_h
27
28// STL headers
29#include <iostream>
30#include <string>
31
32// ROOT headers
33#include <Rtypes.h>
34
35namespace MA5
36{
37
38class LHCOParticleFormat
39{
40
41 // -------------------------------------------------------------
42 // data members
43 // -------------------------------------------------------------
44 public:
45
46 UInt_t id;
47 Float_t eta;
48 Float_t phi;
49 Float_t pt;
50 Float_t jmass;
51 Float_t ntrk;
52 Float_t btag;
53 Float_t hadem;
54
55 static const std::string header;
56
57 void Print(UInt_t num, std::ostream* out);
58 static void WriteEventHeader(unsigned int numEvent,std::ostream* out);
59};
60
61
62}
63
64#endif
065
=== modified file 'tools/SampleAnalyzer/Writer/LHCOWriter.cpp'
--- tools/SampleAnalyzer/Writer/LHCOWriter.cpp 2013-05-17 06:19:22 +0000
+++ tools/SampleAnalyzer/Writer/LHCOWriter.cpp 2013-06-13 12:22:26 +0000
@@ -31,105 +31,93 @@
3131
32using namespace MA5;32using namespace MA5;
3333
34std::string LHCOWriter::FortranFormat_SimplePrecision(Float_t value,UInt_t precision)
35{
36 std::stringstream str;
37 str.precision(precision);
38 std::string word;
39
40 Bool_t negative=false;
41 if (value<0) {negative=true; value*=-1;}
42
43 Int_t exponent = 0;
44 if (value!=0)
45 {
46 for (; value > 1.0; exponent++) value/=10.;
47 for (; value < 0.0; exponent--) value*=10.;
48 }
49
50 str << std::uppercase << std::fixed << value << "E";
51 if (exponent>=0) str << "+"; else str << "-";
52 if (abs(exponent)<10) str << "0";
53 str << abs(exponent);
54 str >> word;
55 if (!negative) return word;
56 else return "-"+word;
57}
58
59
60std::string LHCOWriter::FortranFormat_DoublePrecision(Double_t value,UInt_t precision)
61{
62 std::stringstream str;
63 str.precision(precision);
64 std::string word;
65
66 Bool_t negative=false;
67 if (value<0) {negative=true; value*=-1;}
68
69 Int_t exponent = 0;
70 if (value!=0)
71 {
72 for (; value > 1.0; exponent++) value/=10.;
73 for (; value < 0.0; exponent--) value*=10.;
74 }
75
76 str << std::uppercase << std::fixed << value << "E";
77 if (exponent>=0) str << "+"; else str << "-";
78 if (abs(exponent)<10) str << "0";
79 str << abs(exponent);
80 str >> word;
81 if (!negative) return word;
82 else return "-"+word;
83}
84
8534
86/// Read the sample35/// Read the sample
87bool LHCOWriter::WriteHeader(const SampleFormat& mySample)36bool LHCOWriter::WriteHeader(const SampleFormat& mySample)
88{37{
89 // Opening tag38 // MA5 logo
90 *output_ << "<LesHouchesEvents version=""1.0"">" << std::endl;39 WriteMA5header();
9140
92 // Header block41 // LHCO format tag
93 *output_ << "<header>" << std::endl;42 *output_ << "#<MA5Format> LHCO format </MA5Format>" << std::endl;
94 *output_ << "<!--" << std::endl;43
95 *output_ << "#*********************************************************************" << std::endl;44 // Python interface version
96 *output_ << "# *" << std::endl;45 *output_ << "#<MadAnalysis5Version> " << cfg_->GetPythonInterfaceVersion()
97 *output_ << "# This file has been produced by MadAnalysis 5 *" << std::endl;46 << " " << cfg_->GetPythonInterfaceDate()
98 *output_ << "# *" << std::endl;47 << "</MadAnalysis5Version>" << std::endl;
99 *output_ << "#....................................................................*" << std::endl;48
100 *output_ << "" << std::endl;49 // SampleAnalyzer version
50 *output_ << "#<SampleAnalyzerVersion> "<< cfg_->GetSampleAnalyzerVersion()
51 << " " << cfg_->GetSampleAnalyzerVersion()
52 << " </SampleAnalyzerVersion>" << std::endl;
53
54 // Explanation about the LHCO
55 *output_ << "#<FormatDescription>" << std::endl;
56 *output_ << "#################################################################################" << std::endl;
57 *output_ << "# Each event begins with a header row. Meaning of the different columns: #" << std::endl;
58 *output_ << "# the following: #" << std::endl;
59 *output_ << "# - column 1: label '0' indicating the beginning a new event. #" << std::endl;
60 *output_ << "# - column 2: event number. #" << std::endl;
61 *output_ << "# - column 3: triggering information. For files produced by MadAnalysis, this #" << std::endl;
62 *output_ << "# value is set to 0. #" << std::endl;
63 *output_ << "# #" << std::endl;
64 *output_ << "# The rest of the rows are the physics objects in the events. Meaning of the #" << std::endl;
65 *output_ << "# different columns: #" << std::endl;
66 *output_ << "# - column 1: row number #" << std::endl;
67 *output_ << "# - column 2: type of physics object. The possible values are: #" << std::endl;
68 *output_ << "# 0 = photon, 1 = electron, 2 = muon, #" << std::endl;
69 *output_ << "# 3 = hadronically-decaying tau, 4 = jet, 6 = MET #" << std::endl;
70 *output_ << "# - column 3: pseudorapidity (eta) of the physics object #" << std::endl;
71 *output_ << "# - column 4: azimuthal angle (phi) of the physics object #" << std::endl;
72 *output_ << "# - column 5: transverse momentum (pt) of the physics object #" << std::endl;
73 *output_ << "# - column 6: mass of the physics object. Required information to #" << std::endl;
74 *output_ << "# reconstruct the four-vector momentum of jets. #" << std::endl;
75 *output_ << "# - column 7: #" << std::endl;
76 *output_ << "# + case of a jet: number of tracks associated with the object. #" << std::endl;
77 *output_ << "# + case of an electron/muon: electric charge. #" << std::endl;
78 *output_ << "# + case of an hadronically-decaying tau: electric charge times the number of #" << std::endl;
79 *output_ << "# tracks associated with the object. #" << std::endl;
80 *output_ << "# Usual values: +/-1 , +/-3. #" << std::endl;
81 *output_ << "# + other cases: 0. #" << std::endl;
82 *output_ << "# - column 8: #" << std::endl;
83 *output_ << "# + case of a jet: b-jet tag. Allowed values are: #" << std::endl;
84 *output_ << "# 0 = no identified b-jet, #" << std::endl;
85 *output_ << "# 1 = b-jet identified by a loose tagger algorithm, #" << std::endl;
86 *output_ << "# 2 = b-jet identified by a tight tagger algorithm #" << std::endl;
87 *output_ << "# (the value 2 is not used by MadAnalysis 5). #" << std::endl;
88 *output_ << "# + case of a muon: the value indicates the row number of the closest jet #" << std::endl;
89 *output_ << "# in DeltaR. #" << std::endl;
90 *output_ << "# + other cases: 0. #" << std::endl;
91 *output_ << "# - column 9: #" << std::endl;
92 *output_ << "# + case of jet/electron/photon: ratio of the hadronic versus #" << std::endl;
93 *output_ << "# electromagnetic energy deposited in the #" << std::endl;
94 *output_ << "# calorimeters cells associated to the object. #" << std::endl;
95 *output_ << "# It is typically > 1 for a jet and < 1 for an #" << std::endl;
96 *output_ << "# electron or a photon. #" << std::endl;
97 *output_ << "# + case of muon: value related to muon isolation. The format of this value #" << std::endl;
98 *output_ << "# is XXX.YYY. The integer part (XXX) is the summed transverse #" << std::endl;
99 *output_ << "# momentum of tracks in a DeltaR-cone (typically DeltaR=0.4), #" << std::endl;
100 *output_ << "# excluding the muon track. The decimal part (YYY) is the #" << std::endl;
101 *output_ << "# ratio of the transverse energy in the same DeltaR-cone to #" << std::endl;
102 *output_ << "# the transverse momentum of the muon. #" << std::endl;
103 *output_ << "# + in other cases: 0. #" << std::endl;
104 *output_ << "# - column 10: empty column, added for possible use. #" << std::endl;
105 *output_ << "# - column 11: empty column, added for possible use. #" << std::endl;
106 *output_ << "#################################################################################" << std::endl;
107 *output_ << "#</FormatDescription>" << std::endl;
101108
102 if (mySample.mc()!=0)109 if (mySample.mc()!=0)
103 {110 {
104 *output_ << "Original header:" << std::endl;111 *output_ << "#Original header:" << std::endl;
105 *output_ << "" << std::endl;112 *output_ << "" << std::endl;
106113
107 for (unsigned int i=0;i<mySample.mc()->header().size();i++)114 for (unsigned int i=0;i<mySample.mc()->header().size();i++)
108 *output_ << mySample.mc()->header()[i] << std::endl;115 *output_ << "#" << mySample.mc()->header()[i] << std::endl;
109 }116 }
110117
118 // One line to remind the meaning of each line
111 *output_ << " #" << std::endl;119 *output_ << " #" << std::endl;
112 // *output_ << " ## More info on LHCO files: "120 *output_ << LHCOParticleFormat::header << std::endl;
113 // << "http://cp3wks05.fynu.ucl.ac.be/Manual/lhco.html" << std::endl;
114 *output_ << " # eventNum triggerWord" << std::endl;
115 *output_ << " # typ ";
116 *output_ << std::setw(18) << std::right << "eta";
117 *output_ << " ";
118 *output_ << std::setw(18) << std::right << "phi";
119 *output_ << " ";
120 *output_ << std::setw(18) << std::right << "pt";
121 *output_ << " ";
122 *output_ << std::setw(18) << std::right << "jmass";
123 *output_ << " ";
124 *output_ << std::setw(5) << std::right << "ntracks";
125 *output_ << " ";
126 *output_ << std::setw(4) << std::right << "btag";
127 *output_ << " ";
128 *output_ << std::setw(7) << std::right << "had/em";
129 *output_ << " ";
130 *output_ << std::setw(4) << std::right << "dum1";
131 *output_ << " ";
132 *output_ << std::setw(4) << std::right << "dum2" << std::endl;
133121
134 return true;122 return true;
135}123}
@@ -138,67 +126,78 @@
138bool LHCOWriter::WriteEvent(const EventFormat& myEvent, 126bool LHCOWriter::WriteEvent(const EventFormat& myEvent,
139 const SampleFormat& mySample)127 const SampleFormat& mySample)
140{128{
141 // Event header129 // FirstEvent
142 *output_ << "0" << std::endl;130 if (counter_==0)
131 {
132 WriteHeader(mySample);
133 }
143134
144 // Skipping event if no reconstructed object135 // Skipping event if no reconstructed object
145 if (myEvent.rec()==0) return true;136 if (myEvent.rec()==0) return true;
146137
147 // Counter of particles138 // Event header
148 unsigned int npart=0;139 LHCOParticleFormat::WriteEventHeader(counter_,output_);
149140
150 // Writing electrons141 // Particle container in LHCO format
142 std::vector<LHCOParticleFormat> PartTable;
143 PartTable.reserve( myEvent.rec()->photons().size() +
144 myEvent.rec()->electrons().size() +
145 myEvent.rec()->muons().size() +
146 myEvent.rec()->taus().size() +
147 myEvent.rec()->jets().size() + 1 /*MET*/);
148
149 // Writing photons (=0)
150 for (unsigned int i=0;i<myEvent.rec()->photons().size();i++)
151 {
152 PartTable.push_back(LHCOParticleFormat());
153 WritePhoton(myEvent.rec()->photons()[i],&PartTable.back());
154 }
155
156 // Writing electrons (=1)
151 for (unsigned int i=0;i<myEvent.rec()->electrons().size();i++)157 for (unsigned int i=0;i<myEvent.rec()->electrons().size();i++)
152 {158 {
153 npart++;159 PartTable.push_back(LHCOParticleFormat());
154 WriteElectron(myEvent.rec()->electrons()[i],npart);160 WriteElectron(myEvent.rec()->electrons()[i],&PartTable.back());
155 } 161 }
156162
157 // Writing muons163 // Writing muons (=2)
158 for (unsigned int i=0;i<myEvent.rec()->muons().size();i++)164 for (unsigned int i=0;i<myEvent.rec()->muons().size();i++)
159 {165 {
160 npart++;166 PartTable.push_back(LHCOParticleFormat());
161 WriteMuon(myEvent.rec()->muons()[i],npart);167 WriteMuon(myEvent.rec()->muons()[i],&PartTable.back(),myEvent.rec(),
168 myEvent.rec()->photons().size()+
169 myEvent.rec()->electrons().size()+
170 myEvent.rec()->muons().size());
162 }171 }
163172
164 // Writing taus173 // Writing taus (=3)
165 for (unsigned int i=0;i<myEvent.rec()->taus().size();i++)174 for (unsigned int i=0;i<myEvent.rec()->taus().size();i++)
166 {175 {
167 npart++;176 PartTable.push_back(LHCOParticleFormat());
168 WriteTau(myEvent.rec()->taus()[i],npart);177 WriteTau(myEvent.rec()->taus()[i],&PartTable.back());
169 }178 }
170 179
171 // Writing jets180 // Writing jets (=4)
172 for (unsigned int i=0;i<myEvent.rec()->jets().size();i++)181 for (unsigned int i=0;i<myEvent.rec()->jets().size();i++)
173 {182 {
174 npart++;183 PartTable.push_back(LHCOParticleFormat());
175 WriteJet(myEvent.rec()->jets()[i],npart);184 WriteJet(myEvent.rec()->jets()[i],&PartTable.back());
176 }185 }
177186
178 // Writing MET187 // Writing MET (=6)
179 npart++;188 PartTable.push_back(LHCOParticleFormat());
180 WriteMET(myEvent.rec()->MET(),npart);189 WriteMET(myEvent.rec()->MET(),&PartTable.back());
181190
182 return true;191 // Printing the table
183}192 for (UInt_t i=0;i<PartTable.size();i++) PartTable[i].Print(i+1,output_);
184193
185194 // Incremeting event counter
186/// Finalize the event195 counter_++;
187bool LHCOWriter::WriteEventHeader(const SampleFormat& mySample,unsigned int numEvent)196
188{197 return true;
189 // Particle number198}
190 *output_ << std::setw(3) << std::right << 0;199
191 *output_ << " ";200
192
193 // Event number
194 *output_ << std::setw(18) << std::right << numEvent;
195 *output_ << " ";
196
197 // Trigger word
198 *output_ << std::setw(18) << std::right << 0;
199
200 return true;
201}
202201
203202
204/// Finalize the event203/// Finalize the event
@@ -208,93 +207,48 @@
208}207}
209208
210209
211void LHCOWriter::WriteJet(const RecJetFormat& jet,unsigned int partNum)210void LHCOWriter::WriteJet(const RecJetFormat& jet,
211 LHCOParticleFormat* lhco)
212{212{
213 // Particle number213 lhco->id = 4;
214 *output_ << std::setw(3) << std::right << partNum;214 lhco->eta = jet.momentum().Eta();
215 *output_ << " ";215 lhco->phi = jet.momentum().Phi();
216216 lhco->pt = jet.momentum().Pt();
217 // Particle type217 lhco->jmass = jet.momentum().M();
218 *output_ << std::setw(3) << std::right << 4;218 lhco->ntrk = jet.ntracks();
219 *output_ << " ";219 if (jet.btag()) lhco->btag = 1.0; else lhco->btag = 0.0;
220220 lhco->hadem = jet.HEoverEE();
221 // eta
222 *output_ << std::setw(18) << std::right
223 << LHCOWriter::FortranFormat_DoublePrecision(jet.momentum().Eta())
224 << " ";
225
226 // phi
227 *output_ << std::setw(18) << std::right
228 << LHCOWriter::FortranFormat_DoublePrecision(jet.momentum().Phi())
229 << " ";
230
231 // pt
232 *output_ << std::setw(18) << std::right
233 << LHCOWriter::FortranFormat_DoublePrecision(jet.momentum().Pt())
234 << " ";
235
236 // mass
237 *output_ << std::setw(18) << std::right
238 << LHCOWriter::FortranFormat_DoublePrecision(jet.momentum().M())
239 << " ";
240
241 // ntracks
242 *output_ << std::setw(5) << std::right
243 << LHCOWriter::FortranFormat_DoublePrecision(jet.ntracks())
244 << " ";
245
246 // b tagging
247 if (jet.btag()) *output_ << " 1.0 ";
248 else *output_ << " 0.0 ";
249
250 // HE/EE
251 *output_ << std::setw(7) << std::right
252 << LHCOWriter::FortranFormat_DoublePrecision(jet.HEoverEE())
253 << " ";
254
255 // dummy1 & dummy2
256 *output_ << "0.00 0.00";
257
258 // end
259 *output_ << std::endl;
260}221}
261222
262void LHCOWriter::WriteMuon(const RecLeptonFormat& muon,unsigned int partNum)223void LHCOWriter::WriteMuon(const RecLeptonFormat& muon,
224 LHCOParticleFormat* lhco,
225 const RecEventFormat* myEvent,
226 unsigned int npart)
263{227{
264 // Particle number228 lhco->id = 2;
265 *output_ << std::setw(3) << std::right << partNum;229 lhco->eta = muon.momentum().Eta();
266 *output_ << " ";230 lhco->phi = muon.momentum().Phi();
267231 lhco->pt = muon.momentum().Pt();
268 // Particle type232 lhco->jmass = muon.momentum().M();
269 *output_ << std::setw(3) << std::right << 2;233 if (muon.charge()>0) lhco->ntrk=+1.; else lhco->ntrk=-1.;
270 *output_ << " ";234
271235 //------------- the closest jet ---------------
272 // eta236 unsigned int theClosestJet=0;
273 *output_ << std::setw(18) << std::right 237 Double_t minDeltaR=-1;
274 << LHCOWriter::FortranFormat_DoublePrecision(muon.momentum().Eta())238 for (unsigned int i=0;i<myEvent->jets().size();i++)
275 << " ";239 {
276240 if (myEvent->jets()[i].pt()==0) continue;
277 // phi241 Double_t DeltaR=muon.dr(myEvent->jets()[i]);
278 *output_ << std::setw(18) << std::right 242 if (i==0 || DeltaR<minDeltaR)
279 << LHCOWriter::FortranFormat_DoublePrecision(muon.momentum().Phi())243 {
280 << " ";244 theClosestJet=i;
281245 minDeltaR=DeltaR;
282 // pt246 }
283 *output_ << std::setw(18) << std::right 247 }
284 << LHCOWriter::FortranFormat_DoublePrecision(muon.momentum().Pt())248 if (minDeltaR<0) lhco->btag = 0.;
285 << " ";249 else lhco->btag = theClosestJet+npart+1;
286250
287 // mass251 //---------------- isolation ------------------
288 *output_ << std::setw(18) << std::right
289 << LHCOWriter::FortranFormat_DoublePrecision(muon.momentum().M())
290 << " ";
291
292 // electric charge
293 if (muon.charge()>0) *output_ << " +1.0 ";
294 else *output_ << " -1.0 ";
295
296 // null
297 *output_ << "0.0 ";
298252
299 // isolation : sumPT_isol253 // isolation : sumPT_isol
300 double isolation = 0;254 double isolation = 0;
@@ -302,147 +256,59 @@
302256
303 // isolation : sumET_isol257 // isolation : sumET_isol
304 double ET_PT = 0;258 double ET_PT = 0;
305 if (muon.sumPT_isol()!=0) ET_PT=muon.sumET_isol()/muon.sumPT_isol();259 if (muon.pt()!=0) ET_PT=muon.sumET_isol()/muon.pt();
306 ET_PT=std::floor(ET_PT);
307260
308 // gathering isolation variables261 // gathering isolation variables
309 bool test=false;262 if (ET_PT>100) ET_PT=0.99; else ET_PT=ET_PT/100.;
310 for (unsigned int j=0;j<5;j++)263
311 {
312 ET_PT/=10;
313 if (ET_PT<1.)
314 {
315 test=true;
316 break;
317 }
318 }
319 if (!test) ET_PT=0;
320 isolation+=ET_PT;264 isolation+=ET_PT;
321 *output_ << std::setw(7) << std::right 265 lhco->hadem = isolation;
322 << LHCOWriter::FortranFormat_DoublePrecision(isolation) 266}
323 << " ";267
324268void LHCOWriter::WriteElectron(const RecLeptonFormat& electron,
325 // dummy1 & dummy2269 LHCOParticleFormat* lhco)
326 *output_ << "0.00 0.00";270{
327271 lhco->id = 1;
328 // end272 lhco->eta = electron.momentum().Eta();
329 *output_ << std::endl;273 lhco->phi = electron.momentum().Phi();
330}274 lhco->pt = electron.momentum().Pt();
331275 lhco->jmass = electron.momentum().M();
332void LHCOWriter::WriteElectron(const RecLeptonFormat& electron, unsigned int partNum)276 if (electron.charge()>0) lhco->ntrk=+1.; else lhco->ntrk=-1.;
333{277 lhco->btag = 0.;
334 // Particle number278 lhco->hadem = electron.HEoverEE();
335 *output_ << std::setw(3) << std::right << partNum;279}
336 *output_ << " ";280
337281void LHCOWriter::WritePhoton(const RecPhotonFormat& photon,
338 // Particle type282 LHCOParticleFormat* lhco)
339 *output_ << std::setw(3) << std::right << 1;283{
340 *output_ << " ";284 lhco->id = 0;
341285 lhco->eta = photon.momentum().Eta();
342 // eta286 lhco->phi = photon.momentum().Phi();
343 *output_ << std::setw(18) << std::right 287 lhco->pt = photon.momentum().Pt();
344 << LHCOWriter::FortranFormat_DoublePrecision(electron.momentum().Eta()) << " ";288 lhco->jmass = photon.momentum().M();
345289 lhco->ntrk = 0.;
346 // phi290 lhco->btag = 0.;
347 *output_ << std::setw(18) << std::right 291 lhco->hadem = photon.HEoverEE();
348 << LHCOWriter::FortranFormat_DoublePrecision(electron.momentum().Phi()) << " ";292}
349293
350 // pt294void LHCOWriter::WriteTau(const RecTauFormat& tau,
351 *output_ << std::setw(18) << std::right 295 LHCOParticleFormat* lhco)
352 << LHCOWriter::FortranFormat_DoublePrecision(electron.momentum().Pt()) << " ";296{
353297 lhco->id = 3;
354 // mass298 lhco->eta = tau.momentum().Eta();
355 *output_ << std::setw(18) << std::right 299 lhco->phi = tau.momentum().Phi();
356 << LHCOWriter::FortranFormat_DoublePrecision(electron.momentum().M()) << " ";300 lhco->pt = tau.momentum().Pt();
357301 lhco->jmass = tau.momentum().M();
358 // electric charge302 if (tau.charge()>0) lhco->ntrk=tau.ntracks(); else lhco->ntrk=-tau.ntracks();
359 if (electron.charge()>0) *output_ << " +1.0 ";303 lhco->btag = 0.;
360 else *output_ << " -1.0 ";304 lhco->hadem = tau.HEoverEE();
361305}
362 // null306
363 *output_ << "0.0 ";307void LHCOWriter::WriteMET(const ParticleBaseFormat& met,
364308 LHCOParticleFormat* lhco)
365 // HE/EE309{
366 *output_ << std::setw(18) << std::right 310 lhco->id = 6;
367 << LHCOWriter::FortranFormat_DoublePrecision(electron.HEoverEE()) 311 lhco->eta = 0.;
368 << " ";312 lhco->phi = met.phi();
369313 lhco->pt = met.pt();
370 // dummy1 & dummy2
371 *output_ << "0.00 0.00";
372
373 // end
374 *output_ << std::endl;
375}
376
377void LHCOWriter::WriteTau(const RecTauFormat& tau, unsigned int partNum)
378{
379 // Particle number
380 *output_ << std::setw(3) << std::right << partNum;
381 *output_ << " ";
382
383 // Particle type
384 *output_ << std::setw(3) << std::right << 3;
385 *output_ << " ";
386
387 // eta
388 *output_ << std::setw(18) << std::right
389 << LHCOWriter::FortranFormat_DoublePrecision(tau.momentum().Eta()) << " ";
390
391 // phi
392 *output_ << std::setw(18) << std::right
393 << LHCOWriter::FortranFormat_DoublePrecision(tau.momentum().Phi()) << " ";
394
395 // pt
396 *output_ << std::setw(18) << std::right
397 << LHCOWriter::FortranFormat_DoublePrecision(tau.momentum().Pt()) << " ";
398
399 // mass
400 *output_ << std::setw(18) << std::right
401 << LHCOWriter::FortranFormat_DoublePrecision(tau.momentum().M()) << " ";
402
403 // electric charge
404 if (tau.charge()>0) *output_ << " +1.0 ";
405 else *output_ << " -1.0 ";
406
407 // HE/EE
408 *output_ << std::setw(18) << std::right
409 << LHCOWriter::FortranFormat_DoublePrecision(tau.HEoverEE()) << " ";
410
411 // dummy1 & dummy2
412 *output_ << "0.00 0.00";
413
414 // end
415 *output_ << std::endl;
416}
417
418void LHCOWriter::WriteMET(const ParticleBaseFormat& met, unsigned int partNum)
419{
420 // Particle number
421 *output_ << std::setw(3) << std::right << partNum;
422 *output_ << " ";
423
424 // Particle type
425 *output_ << std::setw(3) << std::right << 6;
426 *output_ << " ";
427
428 // no eta for met
429 *output_ << std::setw(18) << std::right
430 << LHCOWriter::FortranFormat_DoublePrecision(0)
431 << " ";
432
433 // phi
434 *output_ << std::setw(18) << std::right
435 << LHCOWriter::FortranFormat_DoublePrecision(met.phi())
436 << " ";
437
438 // et
439 *output_ << std::setw(18) << std::right
440 << LHCOWriter::FortranFormat_DoublePrecision(met.et())
441 << " ";
442
443 // dummy1 & dummy2
444 *output_ << "0.00 0.00";
445
446 // end
447 *output_ << std::endl;
448}314}
449315
=== modified file 'tools/SampleAnalyzer/Writer/LHCOWriter.h'
--- tools/SampleAnalyzer/Writer/LHCOWriter.h 2013-05-17 06:19:22 +0000
+++ tools/SampleAnalyzer/Writer/LHCOWriter.h 2013-06-13 12:22:26 +0000
@@ -32,6 +32,7 @@
3232
33// SampleAnalyzer headers33// SampleAnalyzer headers
34#include "SampleAnalyzer/Writer/WriterTextBase.h"34#include "SampleAnalyzer/Writer/WriterTextBase.h"
35#include "SampleAnalyzer/Writer/LHCOParticleFormat.h"
3536
36namespace MA537namespace MA5
37{38{
@@ -44,7 +45,7 @@
44 // -------------------------------------------------------------45 // -------------------------------------------------------------
45 protected:46 protected:
4647
4748 UInt_t counter_;
4849
49 // -------------------------------------------------------------50 // -------------------------------------------------------------
50 // method members51 // method members
@@ -53,7 +54,7 @@
5354
54 /// Constructor without argument55 /// Constructor without argument
55 LHCOWriter() : WriterTextBase()56 LHCOWriter() : WriterTextBase()
56 {}57 { counter_=0; }
5758
58 /// Destructor59 /// Destructor
59 virtual ~LHCOWriter()60 virtual ~LHCOWriter()
@@ -71,17 +72,15 @@
71 72
72 private:73 private:
7374
74 static std::string FortranFormat_SimplePrecision(Float_t value,UInt_t precision=7);
75 static std::string FortranFormat_DoublePrecision(Double_t value,UInt_t precision=11);
7675
77 // Writing a reconstructed jet76 // Writing a reconstructed jet
7877
79 bool WriteEventHeader(const SampleFormat& mySample,unsigned int);78 void WriteJet(const RecJetFormat& jet, LHCOParticleFormat* lhco);
80 void WriteJet(const RecJetFormat& jet,unsigned int);79 void WriteMuon(const RecLeptonFormat& muon, LHCOParticleFormat* lhco, const RecEventFormat* myEvent, unsigned int npart);
81 void WriteMuon(const RecLeptonFormat& muon,unsigned int);80 void WriteElectron(const RecLeptonFormat& electron, LHCOParticleFormat* lhco);
82 void WriteElectron(const RecLeptonFormat& electron,unsigned int);81 void WritePhoton(const RecPhotonFormat& photon, LHCOParticleFormat* lhco);
83 void WriteTau(const RecTauFormat& tau,unsigned int);82 void WriteTau(const RecTauFormat& tau, LHCOParticleFormat* lhco);
84 void WriteMET(const ParticleBaseFormat& met,unsigned int);83 void WriteMET(const ParticleBaseFormat& met, LHCOParticleFormat* lhco);
8584
8685
87};86};
8887
=== added file 'tools/SampleAnalyzer/Writer/LHEParticleFormat.cpp'
--- tools/SampleAnalyzer/Writer/LHEParticleFormat.cpp 1970-01-01 00:00:00 +0000
+++ tools/SampleAnalyzer/Writer/LHEParticleFormat.cpp 2013-06-13 12:22:26 +0000
@@ -0,0 +1,115 @@
1////////////////////////////////////////////////////////////////////////////////
2//
3// Copyright (C) 2012-2013 Eric Conte, Benjamin Fuks
4// The MadAnalysis development team, email: <ma5team@iphc.cnrs.fr>
5//
6// This file is part of MadAnalysis 5.
7// Official website: <https://launchpad.net/madanalysis5>
8//
9// MadAnalysis 5 is free software: you can redistribute it and/or modify
10// it under the terms of the GNU General Public License as published by
11// the Free Software Foundation, either version 3 of the License, or
12// (at your option) any later version.
13//
14// MadAnalysis 5 is distributed in the hope that it will be useful,
15// but WITHOUT ANY WARRANTY; without even the implied warranty of
16// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17// GNU General Public License for more details.
18//
19// You should have received a copy of the GNU General Public License
20// along with MadAnalysis 5. If not, see <http://www.gnu.org/licenses/>
21//
22////////////////////////////////////////////////////////////////////////////////
23
24
25// STL headers
26#include <sstream>
27#include <iomanip>
28#include <cstdlib>
29
30// SampleAnalyzer headers
31#include "SampleAnalyzer/Writer/LHEParticleFormat.h"
32
33using namespace MA5;
34
35
36// -----------------------------------------------------------------------------
37// FortranFormat_SimplePrecision
38// -----------------------------------------------------------------------------
39std::string LHEParticleFormat::FortranFormat_SimplePrecision(Float_t value,UInt_t precision)
40{
41 std::stringstream str;
42 str.precision(precision);
43 std::string word;
44
45 Bool_t negative=false;
46 if (value<0) {negative=true; value*=-1;}
47
48 Int_t exponent = 0;
49 if (value!=0)
50 {
51 for (; value > 1.0; exponent++) value/=10.;
52 for (; value < 0.0; exponent--) value*=10.;
53 }
54
55 str << std::uppercase << std::fixed << value << "E";
56 if (exponent>=0) str << "+"; else str << "-";
57 if (std::abs(exponent)<10) str << "0";
58 str << std::abs(exponent);
59 str >> word;
60 if (!negative) return word;
61 else return "-"+word;
62}
63
64
65// -----------------------------------------------------------------------------
66// FortranFormat_DoublePrecision
67// -----------------------------------------------------------------------------
68std::string LHEParticleFormat::FortranFormat_DoublePrecision(Double_t value,UInt_t precision)
69{
70 std::stringstream str;
71 str.precision(precision);
72 std::string word;
73
74 Bool_t negative=false;
75 if (value<0) {negative=true; value*=-1;}
76
77 Int_t exponent = 0;
78 if (value!=0)
79 {
80 for (; value > 1.0; exponent++) value/=10.;
81 for (; value < 0.0; exponent--) value*=10.;
82 }
83
84 str << std::uppercase << std::fixed << value << "E";
85 if (exponent>=0) str << "+"; else str << "-";
86 if (std::abs(exponent)<10) str << "0";
87 str << std::abs(exponent);
88 str >> word;
89 if (!negative) return word;
90 else return "-"+word;
91}
92
93
94// -----------------------------------------------------------------------------
95// Print a particle line
96// -----------------------------------------------------------------------------
97void LHEParticleFormat::Print(UInt_t num, std::ostream* out)
98{
99 *out << std::setw(9) << std::right << id << " ";
100 *out << std::setw(4) << std::right << status << " ";
101 *out << std::setw(4) << std::right << mother1 << " ";
102 *out << std::setw(4) << std::right << mother2 << " ";
103 *out << std::setw(4) << std::right << color1 << " ";
104 *out << std::setw(4) << std::right << color2 << " ";
105 *out << std::setw(18) << std::right << FortranFormat_DoublePrecision(px) << " ";
106 *out << std::setw(18) << std::right << FortranFormat_DoublePrecision(py) << " ";
107 *out << std::setw(18) << std::right << FortranFormat_DoublePrecision(pz) << " ";
108 *out << std::setw(18) << std::right << FortranFormat_DoublePrecision(e) << " ";
109 *out << std::setw(18) << std::right << FortranFormat_DoublePrecision(m) << " ";
110 *out << std::setw(2) << std::right << std::showpoint << ctau << " ";
111 *out << std::setw(3) << std::right << std::showpoint << spin;
112 *out << std::endl;
113}
114
115
0116
=== added file 'tools/SampleAnalyzer/Writer/LHEParticleFormat.h'
--- tools/SampleAnalyzer/Writer/LHEParticleFormat.h 1970-01-01 00:00:00 +0000
+++ tools/SampleAnalyzer/Writer/LHEParticleFormat.h 2013-06-13 12:22:26 +0000
@@ -0,0 +1,71 @@
1////////////////////////////////////////////////////////////////////////////////
2//
3// Copyright (C) 2012-2013 Eric Conte, Benjamin Fuks
4// The MadAnalysis development team, email: <ma5team@iphc.cnrs.fr>
5//
6// This file is part of MadAnalysis 5.
7// Official website: <https://launchpad.net/madanalysis5>
8//
9// MadAnalysis 5 is free software: you can redistribute it and/or modify
10// it under the terms of the GNU General Public License as published by
11// the Free Software Foundation, either version 3 of the License, or
12// (at your option) any later version.
13//
14// MadAnalysis 5 is distributed in the hope that it will be useful,
15// but WITHOUT ANY WARRANTY; without even the implied warranty of
16// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17// GNU General Public License for more details.
18//
19// You should have received a copy of the GNU General Public License
20// along with MadAnalysis 5. If not, see <http://www.gnu.org/licenses/>
21//
22////////////////////////////////////////////////////////////////////////////////
23
24
25#ifndef LHE_PARTICLE_FORMAT_h
26#define LHE_PARTICLE_FORMAT_h
27
28// STL headers
29#include <iostream>
30#include <string>
31
32// ROOT headers
33#include <Rtypes.h>
34
35namespace MA5
36{
37
38class LHEParticleFormat
39{
40
41 // -------------------------------------------------------------
42 // data members
43 // -------------------------------------------------------------
44 public:
45
46 Int_t id;
47 Int_t status;
48 UInt_t mother1;
49 UInt_t mother2;
50 UInt_t color1;
51 UInt_t color2;
52 Float_t px;
53 Float_t py;
54 Float_t pz;
55 Float_t e;
56 Float_t m;
57 Float_t ctau;
58 Float_t spin;
59
60 static std::string FortranFormat_SimplePrecision(Float_t value,
61 UInt_t precision=7);
62 static std::string FortranFormat_DoublePrecision(Double_t value,
63 UInt_t precision=11);
64
65 void Print(UInt_t num, std::ostream* out);
66};
67
68
69}
70
71#endif
072
=== modified file 'tools/SampleAnalyzer/Writer/LHEWriter.cpp'
--- tools/SampleAnalyzer/Writer/LHEWriter.cpp 2013-05-17 06:19:22 +0000
+++ tools/SampleAnalyzer/Writer/LHEWriter.cpp 2013-06-13 12:22:26 +0000
@@ -88,16 +88,14 @@
88 // Opening tag88 // Opening tag
89 *output_ << "<LesHouchesEvents version=""1.0"">" << std::endl;89 *output_ << "<LesHouchesEvents version=""1.0"">" << std::endl;
9090
91 // Header block91 // Header tag
92 *output_ << "<header>" << std::endl;92 *output_ << "<header>" << std::endl;
93 *output_ << "<!--" << std::endl;93 *output_ << "<!--" << std::endl;
94 *output_ << "#*********************************************************************" << std::endl;94
95 *output_ << "# *" << std::endl;95 // MA5 logo
96 *output_ << "# This file has been produced by MadAnalysis 5 *" << std::endl;96 WriteMA5header();
97 *output_ << "# *" << std::endl;97
98 *output_ << "#....................................................................*" << std::endl;98 // LHE format
99 *output_ << "" << std::endl;
100 // Explanation about the Simplified LHE
101 if (mySample.rec()!=0)99 if (mySample.rec()!=0)
102 {100 {
103 *output_ << "<MA5Format> Simplified LHE format </MA5Format>" << std::endl;101 *output_ << "<MA5Format> Simplified LHE format </MA5Format>" << std::endl;
@@ -106,79 +104,106 @@
106 {104 {
107 *output_ << "<MA5Format> LHE format </MA5Format>" << std::endl;105 *output_ << "<MA5Format> LHE format </MA5Format>" << std::endl;
108 }106 }
107
108 // Python interface version
109 *output_ << "<MadAnalysis5Version> " << cfg_->GetPythonInterfaceVersion()
110 << " " << cfg_->GetPythonInterfaceDate()
111 << "</MadAnalysis5Version>" << std::endl;
112
113 // SampleAnalyzer version
114 *output_ << "<SampleAnalyzerVersion> "<< cfg_->GetSampleAnalyzerVersion()
115 << " " << cfg_->GetSampleAnalyzerVersion()
116 << " </SampleAnalyzerVersion>" << std::endl;
117
118 // Explanation about the LHE
109 *output_ << "<FormatDescription>" << std::endl;119 *output_ << "<FormatDescription>" << std::endl;
110 *output_ << "The original Les Houches Event (LHE) format is defined in hep-ph/0609017" << std::endl;120 *output_ << "#################################################################################" << std::endl;
111 *output_ << "" << std::endl;121 *output_ << "# The original Les Houches Event (LHE) format is defined in hep-ph/0609017 #" << std::endl;
112 *output_ << "The <init> ... </init> block contains global information about the samples given as a single line:" << std::endl;122 *output_ << "#################################################################################" << std::endl;
113 *output_ << " IDBMUP1 IDBMUP2 EBMUP1 EBMUP2 PDFGUP1 PDFGUP2 PDFSUP1 PDFSUP1 PDFSUP2 IDWTUP NPRUP" << std::endl;123 *output_ << "# The <init> ... </init> block contains global information about the samples #" << std::endl;
114 *output_ << "with:" << std::endl;124 *output_ << "# given as a single line: #" << std::endl;
115 *output_ << " - IDBMUP1: PDG code of the first beam" << std::endl;125 *output_ << "# IDBM1 IDBM2 EBM1 EBM2 PDFG1 PDFG2 PDFS1 PDFS1 PDFS2 IDWT NPR #" << std::endl;
116 *output_ << " - IDBMUP2: PDG code of the second beam" << std::endl;126 *output_ << "# with: #" << std::endl;
117 *output_ << " - EBMUP1: energy of the first beam" << std::endl;127 *output_ << "# - IDBM1: PDG code of the first beam. #" << std::endl;
118 *output_ << " - EBMUP2: energy of the second beam" << std::endl;128 *output_ << "# - IDBM2: PDG code of the second beam. #" << std::endl;
119 *output_ << " - PDFGUP1: author group of the PDF employed for the first beam" << std::endl;129 *output_ << "# - EBM1: energy of the first beam. #" << std::endl;
120 *output_ << " - PDFGUP2: author group of the PDF employed for the second beam" << std::endl;130 *output_ << "# - EBM2: energy of the second beam. #" << std::endl;
121 *output_ << " - PDFSUP1: id of the PDF set employed for the first beam" << std::endl;131 *output_ << "# - PDFG1: author group of the PDF employed for the first beam. #" << std::endl;
122 *output_ << " - PDFSUP2: id of the PDF set employed for the second beam" << std::endl;132 *output_ << "# - PDFG2: author group of the PDF employed for the second beam. #" << std::endl;
123 *output_ << " - IDWTUP: weighting strategy" << std::endl;133 *output_ << "# - PDFS1: id of the PDF set employed for the first beam. #" << std::endl;
124 *output_ << " - NPRUP: number of physics processes involved during the generation of the sample" << std::endl;134 *output_ << "# - PDFS2: id of the PDF set employed for the second beam. #" << std::endl;
125 *output_ << "; the following lines give detailed process information (one line for each process):" << std::endl;135 *output_ << "# - IDWT: weighting strategy. #" << std::endl;
126 *output_ << " XSECUP XERRUP XMAXUP LPRUP" << std::endl;136 *output_ << "# - NPR: number of physics processes involved during the generation of #" << std::endl;
127 *output_<< "with:" << std::endl;137 *output_ << "# the sample. #" << std::endl;
128 *output_ << " - XSECUP: cross section" << std::endl;138 *output_ << "# The following lines give detailed process information (one line for each #" << std::endl;
129 *output_ << " - XERRUP: cross section error" << std::endl;139 *output_ << "# process): #" << std::endl;
130 *output_ << " - XMAXUP: maximum event weight" << std::endl;140 *output_ << "# XSEC XERR XMAX LPR #" << std::endl;
131 *output_ << " - LPRUP: process id" << std::endl;141 *output_ << "# with: #" << std::endl;
132 *output_ << "" << std::endl;142 *output_ << "# - XSEC: cross section #" << std::endl;
133 *output_ << "Each event is described by an <event> ... </event> block. This block always starts by a single line containing general information on the event:" << std::endl;143 *output_ << "# - XERR: cross section error #" << std::endl;
134 *output_ << " NUP IDPRUP XWGTUP SCALUP AQEDUP AQCDUP" << std::endl;144 *output_ << "# - XMAX: maximum event weight #" << std::endl;
135 *output_ << "with:" << std::endl;145 *output_ << "# - LPR: process id #" << std::endl;
136 *output_ << " - NUP: number of particles" << std::endl;146 *output_ << "#################################################################################" << std::endl;
137 *output_ << " - IDPRUP: process id" << std::endl;147 *output_ << "# Each event is described by an <event> ... </event> block. This block always #" << std::endl;
138 *output_ << " - XWGTUP: event weight" << std::endl;148 *output_ << "# starts by a single line containing general information on the event: #" << std::endl;
139 *output_ << " - SCALUP: scale" << std::endl;149 *output_ << "# N IDPR XWGT SCAL AQED AQCD #" << std::endl;
140 *output_ << " - AQEDUP: alpha QED" << std::endl;150 *output_ << "# with: #" << std::endl;
141 *output_ << " - AQCDUP: alpha QCD" << std::endl;151 *output_ << "# - N: number of particles #" << std::endl;
142 *output_ << "This line is then followed by one line for each particle in the event:" << std::endl;152 *output_ << "# - IDPR: process id #" << std::endl;
143 *output_ << " IDUP ISTUP MOTHUP1 MOTHUP2 ICOLUP1 ICOLUP2 PUP1 PUP2 PUP3 PUP4 PUP5 VTIMUP SPINUP" << std::endl;153 *output_ << "# - XWGT: event weight #" << std::endl;
144 *output_ << "with:" << std::endl;154 *output_ << "# - SCAL: scale #" << std::endl;
145 *output_ << " - IDUP: PDG code" << std::endl;155 *output_ << "# - AQED: alpha QED #" << std::endl;
146 *output_ << " - ISTUP: status code" << std::endl;156 *output_ << "# - AQCD: alpha QCD #" << std::endl;
147 *output_ << " - MOTHUP1: index of the first mother particle" << std::endl;157 *output_ << "# This line is then followed by one line for each particle in the event: #" << std::endl;
148 *output_ << " - MOTHUP2: index of the second mother particle" << std::endl;158 *output_ << "# ID IST MOTH1 MOTH2 ICOL1 ICOL2 P1 P2 P3 P4 P5 VTIM SPIN #" << std::endl;
149 *output_ << " - ICOLUP1: first color tag" << std::endl;159 *output_ << "# with: #" << std::endl;
150 *output_ << " - ICOLUP2: second color tag" << std::endl;160 *output_ << "# - ID: PDG code #" << std::endl;
151 *output_ << " - PUP1: PX [GeV/c]" << std::endl;161 *output_ << "# - IST: status code #" << std::endl;
152 *output_ << " - PUP2: PY [GeV/c]" << std::endl;162 *output_ << "# - MOTH1: row number corresponding to the first mother particle #" << std::endl;
153 *output_ << " - PUP3: PZ [GeV/c]" << std::endl;163 *output_ << "# - MOTH2: row number corresponding to the second mother particle #" << std::endl;
154 *output_ << " - PUP4: E [GeV]" << std::endl;164 *output_ << "# - ICOL1: first color tag #" << std::endl;
155 *output_ << " - PUP5: M [GeV/c^2] (a space-like virtuality is denoted by a negative mass)" << std::endl;165 *output_ << "# - ICOL2: second color tag #" << std::endl;
156 *output_ << " - VTIMUP: c tau" << std::endl;166 *output_ << "# - P1: PX #" << std::endl;
157 *output_ << " - SPINUP: cosine of the angle between the spin vector of the particle and its three-momentum" << std::endl;167 *output_ << "# - P2: PY #" << std::endl;
168 *output_ << "# - P3: PZ #" << std::endl;
169 *output_ << "# - P4: E #" << std::endl;
170 *output_ << "# - P5: M (a space-like virtuality is denoted by a negative mass) #" << std::endl;
171 *output_ << "# - VTIM: c tau #" << std::endl;
172 *output_ << "# - SPIN: cosine of the angle between the spin vector of the particle and #" << std::endl;
173 *output_ << "# its three-momentum #" << std::endl;
174 *output_ << "#################################################################################" << std::endl;
158175
159 // Explanation about the Simplified LHE176 // Explanation about the Simplified LHE
160 if (mySample.rec()!=0)177 if (mySample.rec()!=0)
161 {178 {
162 *output_ << "" << std::endl;179 *output_ << "# In the 'simplified LHE' format, there are three types of objects classified #" << std::endl;
163 *output_ << "In the 'simplified LHE' format, there are three types of objects classified according to their statuscode:" << std::endl;180 *output_ << "# according to their statuscode: #" << std::endl;
164 *output_ << " - Objects with StatusCode = -1: initial interacting partons" << std::endl;181 *output_ << "# - objects with StatusCode = -1: initial interacting partons. #" << std::endl;
165 *output_ << " - Objects with StatusCode = +3: particles produced during the hard process" << std::endl;182 *output_ << "# - objects with StatusCode = +3: particles produced during the hard process. #" << std::endl;
166 *output_ << " - Objects with StatusCode = +1: reconstructed objects (after applying a fast simulation of a (possibly perfect) detector and a jet-clustering algorithm" << std::endl;183 *output_ << "# - objects with StatusCode = +1: physics objects reconstructed by a fast #" << std::endl;
167 *output_ << "When MadAnalysis is in charge of the reconstruction (i.e., applying the jet-clustering algorithm), the particle codes follow the conventions:" << std::endl;184 *output_ << "# detector simulation (or perfect detector). #" << std::endl;
168 *output_ << " - particle with a PDG code = +11 or -11: electrons and positrons." <<std::endl;185 *output_ << "# When MadAnalysis is in charge of the reconstruction (i.e., applying the #" << std::endl;
169 *output_ << " They can be isolated or not as well aspossibly issued from the hadronization process." << std::endl;186 *output_ << "# jet-clustering algorithm), the particle codes follow the conventions: #" << std::endl;
170 *output_ << " - particle with a PDG code = +13 or -13: muons and antimuons." << std::endl;187 *output_ << "# - particle with a PDG code = +11 or -11: electrons and positrons. #" << std::endl;
171 *output_ << " They can be isolated or not as well aspossibly issued from the hadronization process." << std::endl;188 *output_ << "# They can be isolated or not as well as possibly issued from the #" << std::endl;
172 *output_ << " - particle with a PDG code = +15 or -15: hadronically decaying (anti)taus." << std::endl;189 *output_ << "# hadronization process. #" << std::endl;
173 *output_ << " These consist of jets matching a hadronically decaying tau when inspecting the Monte Carlo history." << std::endl;190 *output_ << "# - particle with a PDG code = +13 or -13: muons and antimuons. #" << std::endl;
174 *output_ << " (Mis)Identification efficiency can be possibly included." << std::endl;191 *output_ << "# They can be isolated or not as well as possibly issued from the #" << std::endl;
175 *output_ << " - particle with a PDG code = 5: b-jets." << std::endl;192 *output_ << "# hadronization process. #" << std::endl;
176 *output_ << " These consist of jets matching a b-quark when inspecting the Monte Carlo history." << std::endl;193 *output_ << "# - particle with a PDG code = +15 or -15: hadronically decaying (anti)taus. #" << std::endl;
177 *output_ << " (Mis)Identification efficiency can be possibly included." << std::endl;194 *output_ << "# These consist of jets matching a hadronically-decaying tau when #" << std::endl;
178 *output_ << " - particle with a PDG code = 21: jets which are not b-tagged and taus which are not tau-tagged." << std::endl;195 *output_ << "# inspecting the Monte Carlo history. (Mis)Identification efficiency can be #" << std::endl;
179 *output_ << " the jet collection includes also electrons collection and hadronic taus collection" << std::endl;196 *output_ << "# possibly included. #" << std::endl;
180 *output_ << " - particle with a PDG code = 12: the missing transverse energy." << std::endl;197 *output_ << "# - particle with a PDG code = 5: b-jets. #" << std::endl;
181 *output_ << " The missing transverse energy is computed as opposite to the sum of the four-momenta of all jets, electrons, muons and hadronic taus." << std::endl;198 *output_ << "# These consist of jets matching a b-quark when inspecting the Monte Carlo #" << std::endl;
199 *output_ << "# history. (Mis)Identification efficiency can be possibly included. #" << std::endl;
200 *output_ << "# - particle with a PDG code = 21: jets which are not b-tagged and taus which #" << std::endl;
201 *output_ << "# are not tau-tagged. The jet collection includes also electrons collection #" << std::endl;
202 *output_ << "# and hadronic taus collection #" << std::endl;
203 *output_ << "# - particle with a PDG code = 12: the missing transverse energy. #" << std::endl;
204 *output_ << "# The missing transverse energy is computed as opposite to the sum of the #" << std::endl;
205 *output_ << "# four-momenta of all jets, electrons, muons and hadronic taus. #" << std::endl;
206 *output_ << "#################################################################################" << std::endl;
182 }207 }
183 *output_ << "</FormatDescription>" << std::endl;208 *output_ << "</FormatDescription>" << std::endl;
184 if (mySample.mc()!=0)209 if (mySample.mc()!=0)
@@ -279,59 +304,43 @@
279 // Event header304 // Event header
280 *output_ << "<event>" << std::endl;305 *output_ << "<event>" << std::endl;
281306
282 unsigned int counter = 0;307 // Container for particles
308 std::vector<LHEParticleFormat> particles;
309 UInt_t counter=0;
283310
284 // Writing MC particles : only MC info case311 // Writing MC particles : only MC info case
285 // -> hypothesis : input = LHE312 // -> hypothesis : input = LHE
286 if (myEvent.mc()!=0 && myEvent.rec()==0)313 if (myEvent.mc()!=0 && myEvent.rec()==0)
287 {314 {
288 for (unsigned int i=0;i<myEvent.mc()->particles().size();i++) counter ++;315 counter += myEvent.mc()->particles().size();
289 }316 }
290317
291 // Writing MC particles : MC+REC info case318 // Writing MC particles : MC+REC info case
292 // -> hypothesis : input = HEP319 // -> hypothesis : input = HEP
293 if (myEvent.mc()!=0 && myEvent.rec()!=0)320 else if (myEvent.mc()!=0 && myEvent.rec()!=0)
294 {321 {
295 for (unsigned int i=4;i<myEvent.mc()->particles().size();i++)322 for (unsigned int i=0;i<myEvent.mc()->particles().size();i++)
323 {
296 if (myEvent.mc()->particles()[i].statuscode()==3 || 324 if (myEvent.mc()->particles()[i].statuscode()==3 ||
297 ( myEvent.mc()->particles()[i].statuscode()>=21 &&325 ( myEvent.mc()->particles()[i].statuscode()>=21 &&
298 myEvent.mc()->particles()[i].statuscode()<=29)326 myEvent.mc()->particles()[i].statuscode()<=29)
299 ) counter++;327 ) counter++;
328 }
329
300 }330 }
301331
302 // Writing REC particles332 // Writing REC particles
303 if (myEvent.rec()!=0)333 if (myEvent.rec()!=0)
304 {334 {
305 if (myEvent.mc()==0)335 counter += myEvent.rec()->muons().size() +
306 {336 myEvent.rec()->electrons().size() +
307 for (unsigned int i=0;i<myEvent.rec()->muons().size();i++)337 myEvent.rec()->taus().size() +
308 counter++;338 myEvent.rec()->photons().size() +
309 for (unsigned int i=0;i<myEvent.rec()->electrons().size();i++)339 myEvent.rec()->jets().size() + 1 /*MET*/;
310 counter++;
311 for (unsigned int i=0;i<myEvent.rec()->taus().size();i++)
312 counter++;
313 }
314 else
315 {
316 for (unsigned int i=6;i<myEvent.mc()->particles().size();i++)
317 {
318 if ( (myEvent.mc()->particles()[i].statuscode()==3 ||
319 ( myEvent.mc()->particles()[i].statuscode()>=21 &&
320 myEvent.mc()->particles()[i].statuscode()<=29))&& (
321 fabs(myEvent.mc()->particles()[i].pdgid())==11 ||
322 fabs(myEvent.mc()->particles()[i].pdgid())==13 ||
323 fabs(myEvent.mc()->particles()[i].pdgid())==15 ))
324 {
325 counter++;
326 }
327 }
328 }
329 for (unsigned int i=0;i<myEvent.rec()->jets().size();i++)
330 counter++;
331 counter++;
332 }340 }
333341
334 // Writing event global information342 // Writing event global information
343 particles.reserve(counter);
335 WriteEventHeader(myEvent,counter);344 WriteEventHeader(myEvent,counter);
336345
337 // Writing MC particles : only MC info case346 // Writing MC particles : only MC info case
@@ -339,9 +348,14 @@
339 if (myEvent.mc()!=0 && myEvent.rec()==0)348 if (myEvent.mc()!=0 && myEvent.rec()==0)
340 {349 {
341 for (unsigned int i=0;i<myEvent.mc()->particles().size();i++)350 for (unsigned int i=0;i<myEvent.mc()->particles().size();i++)
351 {
352 particles.push_back(LHEParticleFormat());
342 WriteParticle(myEvent.mc()->particles()[i],353 WriteParticle(myEvent.mc()->particles()[i],
343 myEvent.mc()->particles()[i].mothup1_,354 myEvent.mc()->particles()[i].mothup1_,
344 myEvent.mc()->particles()[i].mothup2_);355 myEvent.mc()->particles()[i].mothup2_,
356 0,
357 particles.back());
358 }
345 }359 }
346360
347 // Writing MC particles : MC+REC info case361 // Writing MC particles : MC+REC info case
@@ -350,20 +364,22 @@
350 {364 {
351 for (unsigned int i=0;i<myEvent.mc()->particles().size();i++)365 for (unsigned int i=0;i<myEvent.mc()->particles().size();i++)
352 {366 {
353 if ( myEvent.mc()->particles()[i].statuscode()>=11 &&367 if ( myEvent.mc()->particles()[i].statuscode()==-1 ||
354 myEvent.mc()->particles()[i].statuscode()<=19 )368 ( myEvent.mc()->particles()[i].statuscode()>=11 &&
355 WriteParticle(myEvent.mc()->particles()[i],0,0,-1);369 myEvent.mc()->particles()[i].statuscode()<=19 ))
356370 {
357 else if (i>3 && i<6 && myEvent.mc()->particles()[i].statuscode()==3)371 particles.push_back(LHEParticleFormat());
358 WriteParticle(myEvent.mc()->particles()[i],0,0,-1);372 WriteParticle(myEvent.mc()->particles()[i],0,0,-1, particles.back());
373 }
359374
360 else if (myEvent.mc()->particles()[i].statuscode()==3 || 375 else if (myEvent.mc()->particles()[i].statuscode()==3 ||
361 ( myEvent.mc()->particles()[i].statuscode()>=21 &&376 ( myEvent.mc()->particles()[i].statuscode()>=21 &&
362 myEvent.mc()->particles()[i].statuscode()<=29))377 myEvent.mc()->particles()[i].statuscode()<=29))
363 {378 {
379 particles.push_back(LHEParticleFormat());
364 Int_t moth1 = GetMotherIndex(myEvent.mc()->particles()[i].mothup1_);380 Int_t moth1 = GetMotherIndex(myEvent.mc()->particles()[i].mothup1_);
365 Int_t moth2 = GetMotherIndex(myEvent.mc()->particles()[i].mothup2_);381 Int_t moth2 = GetMotherIndex(myEvent.mc()->particles()[i].mothup2_);
366 WriteParticle(myEvent.mc()->particles()[i],moth1,moth2,3);382 WriteParticle(myEvent.mc()->particles()[i],moth1,moth2,3, particles.back());
367 }383 }
368 } 384 }
369 }385 }
@@ -371,40 +387,39 @@
371 // Writing REC particles387 // Writing REC particles
372 if (myEvent.rec()!=0)388 if (myEvent.rec()!=0)
373 {389 {
374 // if (myEvent.mc()==0)390 for (unsigned int i=0;i<myEvent.rec()->muons().size();i++)
375 {391 {
376 for (unsigned int i=0;i<myEvent.rec()->muons().size();i++)392 particles.push_back(LHEParticleFormat());
377 WriteMuon(myEvent.rec()->muons()[i]);393 WriteMuon(myEvent.rec()->muons()[i],particles.back());
378 for (unsigned int i=0;i<myEvent.rec()->electrons().size();i++)394 }
379 WriteElectron(myEvent.rec()->electrons()[i]);395 for (unsigned int i=0;i<myEvent.rec()->electrons().size();i++)
380 for (unsigned int i=0;i<myEvent.rec()->taus().size();i++)396 {
381 WriteTau(myEvent.rec()->taus()[i]);397 particles.push_back(LHEParticleFormat());
382 }398 WriteElectron(myEvent.rec()->electrons()[i],particles.back());
383 /*399 }
384 else400 for (unsigned int i=0;i<myEvent.rec()->taus().size();i++)
385 {401 {
386 for (unsigned int i=6;i<myEvent.mc()->particles().size();i++)402 particles.push_back(LHEParticleFormat());
387 {403 WriteTau(myEvent.rec()->taus()[i],particles.back());
388 if ((myEvent.mc()->particles()[i].statuscode()==3 || 404 }
389 ( myEvent.mc()->particles()[i].statuscode()>=21 &&
390 myEvent.mc()->particles()[i].statuscode()<=29)) && (
391 fabs(myEvent.mc()->particles()[i].pdgid())==11 ||
392 fabs(myEvent.mc()->particles()[i].pdgid())==13 ||
393 fabs(myEvent.mc()->particles()[i].pdgid())==15 ))
394 {
395 WriteParticle(myEvent.mc()->particles()[i],0,0,1);
396 }
397 }
398 }*/
399
400 for (unsigned int i=0;i<myEvent.rec()->jets().size();i++)405 for (unsigned int i=0;i<myEvent.rec()->jets().size();i++)
401 WriteJet(myEvent.rec()->jets()[i]);406 {
402 WriteMET(myEvent.rec()->MET());407 particles.push_back(LHEParticleFormat());
408 WriteJet(myEvent.rec()->jets()[i],particles.back());
409 }
410 for (unsigned int i=0;i<myEvent.rec()->photons().size();i++)
411 {
412 particles.push_back(LHEParticleFormat());
413 WritePhoton(myEvent.rec()->photons()[i],particles.back());
414 }
415 particles.push_back(LHEParticleFormat());
416 WriteMET(myEvent.rec()->MET(),particles.back());
403 }417 }
404418
405 // Event foot419 // Event foot
420 for (unsigned int i=0;i<particles.size();i++) particles[i].Print(i+1, output_);
406 *output_ << "</event>" << std::endl;421 *output_ << "</event>" << std::endl;
407 return true;422 return true;
408}423}
409424
410425
@@ -447,117 +462,129 @@
447462
448463
449/// Writing a particle464/// Writing a particle
450bool LHEWriter::WriteParticle(const MCParticleFormat& myPart, Int_t mother1, Int_t mother2, Int_t statuscode )465void LHEWriter::WriteParticle(const MCParticleFormat& myPart,
451{466 Int_t mother1, Int_t mother2,
452 *output_ << std::setw(9) << std::right << myPart.pdgid_ << " ";467 Int_t statuscode, LHEParticleFormat& lhe)
453 if (statuscode!=0) *output_ << std::setw(4) << std::right << statuscode << " ";468{
454 else *output_ << std::setw(4) << std::right << myPart.statuscode_ << " ";469 if (statuscode!=0) lhe.status = statuscode;
455 *output_ << std::setw(4) << std::right << mother1 /*myPart.mothup1_*/ << " ";470 else lhe.status = myPart.statuscode_;
456 *output_ << std::setw(4) << std::right << mother2 /*myPart.mothup2_*/ << " ";471 lhe.id = myPart.pdgid_;
457 *output_ << std::setw(4) << std::right << 0 << " ";472 lhe.mother1 = mother1;
458 *output_ << std::setw(4) << std::right << 0 << " ";473 lhe.mother2 = mother2;
459 *output_ << std::setw(18) << std::right << LHEWriter::FortranFormat_DoublePrecision(myPart.momentum_.Px()) << " ";474 lhe.color1 = 0;
460 *output_ << std::setw(18) << std::right << LHEWriter::FortranFormat_DoublePrecision(myPart.momentum_.Py()) << " ";475 lhe.color2 = 0;
461 *output_ << std::setw(18) << std::right << LHEWriter::FortranFormat_DoublePrecision(myPart.momentum_.Pz()) << " ";476 lhe.px = myPart.momentum().Px();
462 *output_ << std::setw(18) << std::right << LHEWriter::FortranFormat_DoublePrecision(myPart.momentum_.E()) << " ";477 lhe.py = myPart.momentum().Py();
463 *output_ << std::setw(18) << std::right << LHEWriter::FortranFormat_DoublePrecision(myPart.momentum_.M()) << " "; 478 lhe.pz = myPart.momentum().Pz();
464 *output_ << std::setw(2) << std::right << std::showpoint << myPart.ctau_ << " ";479 lhe.e = myPart.momentum().E();
465 *output_ << std::setw(3) << std::right << std::showpoint << myPart.spin_;480 lhe.m = myPart.momentum().M();
466 *output_ << std::endl;481 lhe.ctau = myPart.ctau_;
467 return true;482 lhe.spin = myPart.spin_;
468}483}
469484
470485
471void LHEWriter::WriteJet(const RecJetFormat& jet)486void LHEWriter::WriteJet(const RecJetFormat& jet, LHEParticleFormat& lhe)
472{487{
473 if (jet.btag()) *output_ << std::setw(9) << std::right << 5 << " ";488 if (jet.btag()) lhe.id = 5; else lhe.id = 21;
474 else *output_ << std::setw(9) << std::right << 21 << " ";489 lhe.status = 1;
475 *output_ << std::setw(4) << std::right << 1 << " ";490 lhe.mother1 = 0;
476 *output_ << std::setw(4) << std::right << 0 << " ";491 lhe.mother2 = 0;
477 *output_ << std::setw(4) << std::right << 0 << " ";492 lhe.color1 = 0;
478 *output_ << std::setw(4) << std::right << 0 << " ";493 lhe.color2 = 0;
479 *output_ << std::setw(4) << std::right << 0 << " ";494 lhe.px = jet.momentum().Px();
480 *output_ << std::setw(18) << std::right << LHEWriter::FortranFormat_DoublePrecision(jet.momentum().Px()) << " ";495 lhe.py = jet.momentum().Py();
481 *output_ << std::setw(18) << std::right << LHEWriter::FortranFormat_DoublePrecision(jet.momentum().Py()) << " ";496 lhe.pz = jet.momentum().Pz();
482 *output_ << std::setw(18) << std::right << LHEWriter::FortranFormat_DoublePrecision(jet.momentum().Pz()) << " ";497 lhe.e = jet.momentum().E();
483 *output_ << std::setw(18) << std::right << LHEWriter::FortranFormat_DoublePrecision(jet.momentum().E()) << " ";498 lhe.m = jet.momentum().M();
484 *output_ << std::setw(18) << std::right << LHEWriter::FortranFormat_DoublePrecision(jet.momentum().M()) << " "; 499 lhe.ctau = 0.;
485 *output_ << std::setw(2) << std::right << std::showpoint << 0. << " ";500 lhe.spin = 0.;
486 *output_ << std::setw(3) << std::right << std::showpoint << 0.;501}
487 *output_ << std::endl;502
488}503
489504void LHEWriter::WriteMuon(const RecLeptonFormat& muon, LHEParticleFormat& lhe)
490void LHEWriter::WriteMuon(const RecLeptonFormat& muon)505{
491{506 if (muon.charge()>0) lhe.id = -13; else lhe.id = +13;
492 if (muon.charge()>0) *output_ << std::setw(9) << std::right << -13 << " ";507 lhe.status = 1;
493 else *output_ << std::setw(9) << std::right << +13 << " ";508 lhe.mother1 = 0;
494 *output_ << std::setw(4) << std::right << 1 << " ";509 lhe.mother2 = 0;
495 *output_ << std::setw(4) << std::right << 0 << " ";510 lhe.color1 = 0;
496 *output_ << std::setw(4) << std::right << 0 << " ";511 lhe.color2 = 0;
497 *output_ << std::setw(4) << std::right << 0 << " ";512 lhe.px = muon.momentum().Px();
498 *output_ << std::setw(4) << std::right << 0 << " ";513 lhe.py = muon.momentum().Py();
499 *output_ << std::setw(18) << std::right << LHEWriter::FortranFormat_DoublePrecision(muon.momentum().Px()) << " ";514 lhe.pz = muon.momentum().Pz();
500 *output_ << std::setw(18) << std::right << LHEWriter::FortranFormat_DoublePrecision(muon.momentum().Py()) << " ";515 lhe.e = muon.momentum().E();
501 *output_ << std::setw(18) << std::right << LHEWriter::FortranFormat_DoublePrecision(muon.momentum().Pz()) << " ";516 lhe.m = muon.momentum().M();
502 *output_ << std::setw(18) << std::right << LHEWriter::FortranFormat_DoublePrecision(muon.momentum().E()) << " ";517 lhe.ctau = 0.;
503 *output_ << std::setw(18) << std::right << LHEWriter::FortranFormat_DoublePrecision(muon.momentum().M()) << " "; 518 lhe.spin = 0.;
504 *output_ << std::setw(2) << std::right << std::showpoint << 0. << " ";519}
505 *output_ << std::setw(3) << std::right << std::showpoint << 0.;520
506 *output_ << std::endl;521void LHEWriter::WriteElectron(const RecLeptonFormat& electron, LHEParticleFormat& lhe)
507}522{
508523 if (electron.charge()>0) lhe.id = -11; else lhe.id = +11;
509void LHEWriter::WriteElectron(const RecLeptonFormat& electron)524 lhe.status = 1;
510{525 lhe.mother1 = 0;
511 if (electron.charge()>0) *output_ << std::setw(9) << std::right << -11 << " ";526 lhe.mother2 = 0;
512 else *output_ << std::setw(9) << std::right << +11 << " ";527 lhe.color1 = 0;
513 *output_ << std::setw(4) << std::right << 1 << " ";528 lhe.color2 = 0;
514 *output_ << std::setw(4) << std::right << 0 << " ";529 lhe.px = electron.momentum().Px();
515 *output_ << std::setw(4) << std::right << 0 << " ";530 lhe.py = electron.momentum().Py();
516 *output_ << std::setw(4) << std::right << 0 << " ";531 lhe.pz = electron.momentum().Pz();
517 *output_ << std::setw(4) << std::right << 0 << " ";532 lhe.e = electron.momentum().E();
518 *output_ << std::setw(18) << std::right << LHEWriter::FortranFormat_DoublePrecision(electron.momentum().Px()) << " ";533 lhe.m = electron.momentum().M();
519 *output_ << std::setw(18) << std::right << LHEWriter::FortranFormat_DoublePrecision(electron.momentum().Py()) << " ";534 lhe.ctau = 0.;
520 *output_ << std::setw(18) << std::right << LHEWriter::FortranFormat_DoublePrecision(electron.momentum().Pz()) << " ";535 lhe.spin = 0.;
521 *output_ << std::setw(18) << std::right << LHEWriter::FortranFormat_DoublePrecision(electron.momentum().E()) << " ";536}
522 *output_ << std::setw(18) << std::right << LHEWriter::FortranFormat_DoublePrecision(electron.momentum().M()) << " "; 537
523 *output_ << std::setw(2) << std::right << std::showpoint << 0. << " ";538
524 *output_ << std::setw(3) << std::right << std::showpoint << 0.;539void LHEWriter::WritePhoton(const RecPhotonFormat& photon, LHEParticleFormat& lhe)
525 *output_ << std::endl;540{
526}541 lhe.id = 22;
527542 lhe.status = 1;
528void LHEWriter::WriteTau(const RecTauFormat& tau)543 lhe.mother1 = 0;
529{544 lhe.mother2 = 0;
530 if (tau.charge()>0) *output_ << std::setw(9) << std::right << -15 << " ";545 lhe.color1 = 0;
531 else *output_ << std::setw(9) << std::right << +15 << " ";546 lhe.color2 = 0;
532 *output_ << std::setw(4) << std::right << 1 << " ";547 lhe.px = photon.momentum().Px();
533 *output_ << std::setw(4) << std::right << 0 << " ";548 lhe.py = photon.momentum().Py();
534 *output_ << std::setw(4) << std::right << 0 << " ";549 lhe.pz = photon.momentum().Pz();
535 *output_ << std::setw(4) << std::right << 0 << " ";550 lhe.e = photon.momentum().E();
536 *output_ << std::setw(4) << std::right << 0 << " ";551 lhe.m = photon.momentum().M();
537 *output_ << std::setw(18) << std::right << LHEWriter::FortranFormat_DoublePrecision(tau.momentum().Px()) << " ";552 lhe.ctau = 0.;
538 *output_ << std::setw(18) << std::right << LHEWriter::FortranFormat_DoublePrecision(tau.momentum().Py()) << " ";553 lhe.spin = 0.;
539 *output_ << std::setw(18) << std::right << LHEWriter::FortranFormat_DoublePrecision(tau.momentum().Pz()) << " ";554}
540 *output_ << std::setw(18) << std::right << LHEWriter::FortranFormat_DoublePrecision(tau.momentum().E()) << " ";555
541 *output_ << std::setw(18) << std::right << LHEWriter::FortranFormat_DoublePrecision(tau.momentum().M()) << " "; 556
542 *output_ << std::setw(2) << std::right << std::showpoint << 0. << " ";557void LHEWriter::WriteTau(const RecTauFormat& tau, LHEParticleFormat& lhe)
543 *output_ << std::setw(3) << std::right << std::showpoint << 0.;558{
544 *output_ << std::endl;559 if (tau.charge()>0) lhe.id = -15; else lhe.id = +15;
545}560 lhe.status = 1;
546561 lhe.mother1 = 0;
547void LHEWriter::WriteMET(const ParticleBaseFormat& met)562 lhe.mother2 = 0;
548{563 lhe.color1 = 0;
549 *output_ << std::setw(9) << std::right << 12 << " ";564 lhe.color2 = 0;
550 *output_ << std::setw(4) << std::right << 1 << " ";565 lhe.px = tau.momentum().Px();
551 *output_ << std::setw(4) << std::right << 0 << " ";566 lhe.py = tau.momentum().Py();
552 *output_ << std::setw(4) << std::right << 0 << " ";567 lhe.pz = tau.momentum().Pz();
553 *output_ << std::setw(4) << std::right << 0 << " ";568 lhe.e = tau.momentum().E();
554 *output_ << std::setw(4) << std::right << 0 << " ";569 lhe.m = tau.momentum().M();
555 *output_ << std::setw(18) << std::right << LHEWriter::FortranFormat_DoublePrecision(met.px()) << " ";570 lhe.ctau = 0.;
556 *output_ << std::setw(18) << std::right << LHEWriter::FortranFormat_DoublePrecision(met.py()) << " ";571 lhe.spin = 0.;
557 *output_ << std::setw(18) << std::right << LHEWriter::FortranFormat_DoublePrecision(0.) << " ";572}
558 *output_ << std::setw(18) << std::right << LHEWriter::FortranFormat_DoublePrecision(met.pt()) << " ";573
559 *output_ << std::setw(18) << std::right << LHEWriter::FortranFormat_DoublePrecision(0.) << " "; 574
560 *output_ << std::setw(2) << std::right << std::showpoint << 0. << " ";575void LHEWriter::WriteMET(const ParticleBaseFormat& met, LHEParticleFormat& lhe)
561 *output_ << std::setw(3) << std::right << std::showpoint << 0.;576{
562 *output_ << std::endl;577 lhe.id = 12;
578 lhe.status = 1;
579 lhe.mother1 = 0;
580 lhe.mother2 = 0;
581 lhe.color1 = 0;
582 lhe.color2 = 0;
583 lhe.px = met.px();
584 lhe.py = met.py();
585 lhe.pz = 0.;
586 lhe.e = met.pt();
587 lhe.m = 0.;
588 lhe.ctau = 0.;
589 lhe.spin = 0.;
563}590}
564591
=== modified file 'tools/SampleAnalyzer/Writer/LHEWriter.h'
--- tools/SampleAnalyzer/Writer/LHEWriter.h 2013-05-17 06:19:22 +0000
+++ tools/SampleAnalyzer/Writer/LHEWriter.h 2013-06-13 12:22:26 +0000
@@ -32,6 +32,7 @@
3232
33// SampleAnalyzer headers33// SampleAnalyzer headers
34#include "SampleAnalyzer/Writer/WriterTextBase.h"34#include "SampleAnalyzer/Writer/WriterTextBase.h"
35#include "SampleAnalyzer/Writer/LHEParticleFormat.h"
3536
36namespace MA537namespace MA5
37{38{
@@ -76,17 +77,19 @@
76 unsigned int nevents);77 unsigned int nevents);
7778
78 /// Writing a particle79 /// Writing a particle
79 bool WriteParticle(const MCParticleFormat& myPart, Int_t mother1, Int_t mother2, Int_t statuscode=0);80 void WriteParticle(const MCParticleFormat& myPart, Int_t mother1, Int_t mother2,
81 Int_t statuscode, LHEParticleFormat& lhe);
8082
81 static std::string FortranFormat_SimplePrecision(Float_t value,UInt_t precision=7); 83 static std::string FortranFormat_SimplePrecision(Float_t value,UInt_t precision=7);
82 static std::string FortranFormat_DoublePrecision(Double_t value,UInt_t precision=11); 84 static std::string FortranFormat_DoublePrecision(Double_t value,UInt_t precision=11);
8385
84 // Writing a reconstructed jet86 // Writing a reconstructed jet
85 void WriteJet(const RecJetFormat& jet);87 void WriteJet(const RecJetFormat& jet, LHEParticleFormat& lhe);
86 void WriteMuon(const RecLeptonFormat& muon);88 void WriteMuon(const RecLeptonFormat& muon, LHEParticleFormat& lhe);
87 void WriteElectron(const RecLeptonFormat& electron);89 void WriteElectron(const RecLeptonFormat& electron, LHEParticleFormat& lhe);
88 void WriteTau(const RecTauFormat& tau);90 void WritePhoton(const RecPhotonFormat& photon, LHEParticleFormat& lhe);
89 void WriteMET(const ParticleBaseFormat& met);91 void WriteTau(const RecTauFormat& tau, LHEParticleFormat& lhe);
92 void WriteMET(const ParticleBaseFormat& met, LHEParticleFormat& lhe);
9093
9194
92};95};
9396
=== modified file 'tools/SampleAnalyzer/Writer/WriterBase.h'
--- tools/SampleAnalyzer/Writer/WriterBase.h 2013-05-17 06:19:22 +0000
+++ tools/SampleAnalyzer/Writer/WriterBase.h 2013-06-13 12:22:26 +0000
@@ -36,6 +36,7 @@
36#include "SampleAnalyzer/DataFormat/EventFormat.h"36#include "SampleAnalyzer/DataFormat/EventFormat.h"
37#include "SampleAnalyzer/DataFormat/SampleFormat.h"37#include "SampleAnalyzer/DataFormat/SampleFormat.h"
38#include "SampleAnalyzer/Service/Physics.h"38#include "SampleAnalyzer/Service/Physics.h"
39#include "SampleAnalyzer/Core/Configuration.h"
3940
40// ROOT headers41// ROOT headers
41#include <TVector.h>42#include <TVector.h>
@@ -77,7 +78,8 @@
77 }78 }
7879
79 /// Initialize (virtual pure)80 /// Initialize (virtual pure)
80 virtual bool Initialize(const std::string& filename) = 0;81 virtual bool Initialize(const Configuration* cfg,
82 const std::string& filename) = 0;
8183
82 /// Read the sample (virtual pure)84 /// Read the sample (virtual pure)
83 virtual bool WriteHeader(const SampleFormat& mySample) = 0;85 virtual bool WriteHeader(const SampleFormat& mySample) = 0;
8486
=== modified file 'tools/SampleAnalyzer/Writer/WriterTextBase.cpp'
--- tools/SampleAnalyzer/Writer/WriterTextBase.cpp 2013-05-17 06:19:22 +0000
+++ tools/SampleAnalyzer/Writer/WriterTextBase.cpp 2013-06-13 12:22:26 +0000
@@ -37,8 +37,12 @@
37// -----------------------------------------------------------------------------37// -----------------------------------------------------------------------------
38// Initialize38// Initialize
39// -----------------------------------------------------------------------------39// -----------------------------------------------------------------------------
40bool WriterTextBase::Initialize(const std::string& rawfilename)40bool WriterTextBase::Initialize(const Configuration* cfg,
41 const std::string& rawfilename)
41{42{
43 // Saving configuration file
44 cfg_ = cfg;
45
42 // Is the file stored in Rfio46 // Is the file stored in Rfio
43 rfio_ = ReaderBase::IsRfioMode(rawfilename);47 rfio_ = ReaderBase::IsRfioMode(rawfilename);
4448
@@ -147,3 +151,26 @@
147 return true;151 return true;
148}152}
149153
154
155// -----------------------------------------------------------------------------
156// Header
157// -----------------------------------------------------------------------------
158void WriterTextBase::WriteMA5header()
159{
160 *output_ << "#################################################################################" << std::endl;
161 *output_ << "# THIS FILE HAS BEEN PRODUCED BY MADANALYSIS 5 #" << std::endl;
162 *output_ << "# ______ ______ #" << std::endl;
163 *output_ << "# /'\\_/`\\/\\ __ \\/\\ ___\\ #" << std::endl;
164 *output_ << "# /\\ \\ \\ \\_\\ \\ \\ \\__/ #" << std::endl;
165 *output_ << "# \\ \\ \\__\\ \\ \\ __ \\ \\___``\\ #" << std::endl;
166 *output_ << "# \\ \\ \\_/\\ \\ \\ \\/\\ \\/\\ \\_\\ \\ #" << std::endl;
167 *output_ << "# \\ \\_\\\\ \\_\\ \\_\\ \\_\\ \\____/ #" << std::endl;
168 *output_ << "# \\/_/ \\/_/\\/_/\\/_/\\/___/ #" << std::endl;
169 *output_ << "# #" << std::endl;
170 // *output_ << "# MA5 release : " + "%-24s" % main.version + "%+15s" % main.date + " #" << std::endl;
171 // *output_ << "# #" << std::endl;
172 *output_ << "# Comput. Phys. Commun. 184 (2013) 222-256 #" << std::endl;
173 *output_ << "# The MadAnalysis Development Team - Please visit us at #" << std::endl;
174 *output_ << "# https://launchpad.net/madanalysis5 #" << std::endl;
175 *output_ << "#################################################################################" << std::endl;
176}
150177
=== modified file 'tools/SampleAnalyzer/Writer/WriterTextBase.h'
--- tools/SampleAnalyzer/Writer/WriterTextBase.h 2013-05-17 06:19:22 +0000
+++ tools/SampleAnalyzer/Writer/WriterTextBase.h 2013-06-13 12:22:26 +0000
@@ -52,6 +52,8 @@
52 /// Streaming for reading input52 /// Streaming for reading input
53 std::ostream* output_;53 std::ostream* output_;
5454
55 /// Configuration
56 const Configuration* cfg_;
5557
56 // -------------------------------------------------------------58 // -------------------------------------------------------------
57 // method members59 // method members
@@ -71,7 +73,8 @@
71 }73 }
7274
73 /// Initialize75 /// Initialize
74 virtual bool Initialize(const std::string& filename);76 virtual bool Initialize(const Configuration* cfg,
77 const std::string& filename);
7578
76 /// Read the sample (virtual pure)79 /// Read the sample (virtual pure)
77 virtual bool WriteHeader(const SampleFormat& mySample) = 0;80 virtual bool WriteHeader(const SampleFormat& mySample) = 0;
@@ -85,6 +88,9 @@
8588
86 /// Finalize89 /// Finalize
87 virtual bool Finalize();90 virtual bool Finalize();
91
92 /// MA5 logo
93 void WriteMA5header();
88 94
89};95};
9096

Subscribers

People subscribed via source and target branches

to all changes: