Merge lp:~ma5/madanalysis5/v1.1.10beta into lp:madanalysis5
- v1.1.10beta
- Merge into madanalysis-development
Proposed by
Eric Conte
Status: | Merged |
---|---|
Approved by: | Eric Conte |
Approved revision: | 157 |
Merged at revision: | 72 |
Proposed branch: | lp:~ma5/madanalysis5/v1.1.10beta |
Merge into: | lp:madanalysis5 |
Diff against target: |
22817 lines (+13099/-5975) 148 files modified
bin/ma5 (+204/-179) madanalysis/IOinterface/delphes_migration.py (+81/-0) madanalysis/IOinterface/job_reader.py (+3/-3) madanalysis/IOinterface/job_writer.py (+349/-277) madanalysis/IOinterface/library_writer.py (+609/-50) madanalysis/IOinterface/shell_command.py (+82/-0) madanalysis/UpdateNotes.txt (+84/-0) madanalysis/configuration/delfes_configuration.py (+156/-0) madanalysis/configuration/delphes_configuration.py (+15/-0) madanalysis/configuration/fastsim_configuration.py (+44/-6) madanalysis/core/config_checker.py (+489/-223) madanalysis/core/expert_mode.py (+12/-7) madanalysis/core/library_builder.py (+24/-6) madanalysis/core/linux_architecture.py (+145/-2) madanalysis/core/main.py (+227/-57) madanalysis/enumeration/observable_type.py (+4/-4) madanalysis/input/installation_options.dat (+35/-0) madanalysis/input/particles_name_default.txt (+2/-3) madanalysis/interpreter/cmd_base.py (+1/-1) madanalysis/interpreter/cmd_install.py (+91/-11) madanalysis/interpreter/cmd_plot.py (+6/-2) madanalysis/interpreter/cmd_set.py (+1/-1) madanalysis/interpreter/cmd_submit.py (+11/-11) madanalysis/interpreter/interpreter.py (+38/-1) madanalysis/interpreter/interpreter_base.py (+1/-1) madanalysis/job/job_candidate_cut.py (+16/-4) madanalysis/job/job_event_cut.py (+14/-2) madanalysis/job/job_execute.py (+3/-3) madanalysis/job/job_header.py (+3/-3) madanalysis/job/job_initialize.py (+9/-1) madanalysis/job/job_plot.py (+52/-10) madanalysis/layout/cutflow.py (+0/-18) madanalysis/observable/observable_list.py (+49/-16) madanalysis/selection/histogram.py (+1/-1) tools/SampleAnalyzer/Analyzer/AnalyzerBase.h (+22/-5) tools/SampleAnalyzer/Analyzer/AnalyzerManager.cpp (+5/-3) tools/SampleAnalyzer/Analyzer/AnalyzerManager.h (+0/-3) tools/SampleAnalyzer/Core/Configuration.cpp (+6/-3) tools/SampleAnalyzer/Core/Configuration.h (+8/-2) tools/SampleAnalyzer/Core/SampleAnalyzer.cpp (+184/-71) tools/SampleAnalyzer/Core/SampleAnalyzer.h (+24/-8) tools/SampleAnalyzer/Core/castorstream.cpp (+0/-160) tools/SampleAnalyzer/Counter/CounterManager.cpp (+8/-4) tools/SampleAnalyzer/Counter/CounterManager.h (+9/-1) tools/SampleAnalyzer/Counter/MultiRegionCounter.h (+85/-0) tools/SampleAnalyzer/Counter/MultiRegionCounterManager.h (+89/-0) tools/SampleAnalyzer/DataFormat/EventFormat.h (+0/-35) tools/SampleAnalyzer/DataFormat/GeneratorInfo.h (+3/-2) tools/SampleAnalyzer/DataFormat/IsolationConeType.h (+118/-0) tools/SampleAnalyzer/DataFormat/MCEventFormat.h (+4/-2) tools/SampleAnalyzer/DataFormat/MCParticleFormat.h (+24/-6) tools/SampleAnalyzer/DataFormat/ParticleBaseFormat.h (+36/-3) tools/SampleAnalyzer/DataFormat/RecEventFormat.h (+4/-2) tools/SampleAnalyzer/DataFormat/RecJetFormat.h (+17/-1) tools/SampleAnalyzer/DataFormat/RecLeptonFormat.h (+18/-2) tools/SampleAnalyzer/DataFormat/RecMETFormat.h (+4/-2) tools/SampleAnalyzer/DataFormat/RecParticleFormat.h (+6/-2) tools/SampleAnalyzer/DataFormat/RecPhotonFormat.h (+16/-2) tools/SampleAnalyzer/DataFormat/RecTauFormat.h (+6/-2) tools/SampleAnalyzer/DataFormat/RecTrackFormat.h (+19/-1) tools/SampleAnalyzer/DataFormat/SampleFormat.h (+4/-1) tools/SampleAnalyzer/Detector/DetectorManager.cpp (+7/-1) tools/SampleAnalyzer/Detector/delfes_card_ATLAS.tcl (+596/-0) tools/SampleAnalyzer/Detector/delfes_card_ATLAS_PileUp.tcl (+713/-0) tools/SampleAnalyzer/Detector/delfes_card_CMS.tcl (+609/-0) tools/SampleAnalyzer/Detector/delfes_card_CMS_PileUp.tcl (+750/-0) tools/SampleAnalyzer/Detector/delphes_card_ATLAS.tcl (+547/-0) tools/SampleAnalyzer/Detector/delphes_card_ATLAS_PileUp.tcl (+665/-0) tools/SampleAnalyzer/Detector/delphes_card_CMS.tcl (+559/-0) tools/SampleAnalyzer/Detector/delphes_card_CMS_PileUp.tcl (+702/-0) tools/SampleAnalyzer/Filter/FilterBase.h (+0/-143) tools/SampleAnalyzer/Filter/FilterManager.cpp (+0/-49) tools/SampleAnalyzer/Filter/FilterManager.h (+0/-63) tools/SampleAnalyzer/Interfaces/delfes/DelfesTreeReader.cpp (+429/-0) tools/SampleAnalyzer/Interfaces/delfes/DelfesTreeReader.h (+136/-0) tools/SampleAnalyzer/Interfaces/delfes/DetectorDelfes.cpp (+357/-0) tools/SampleAnalyzer/Interfaces/delfes/DetectorDelfes.h (+116/-0) tools/SampleAnalyzer/Interfaces/delphes/DelphesTreeReader.cpp (+331/-0) tools/SampleAnalyzer/Interfaces/delphes/DelphesTreeReader.h (+135/-0) tools/SampleAnalyzer/Interfaces/delphes/DetectorDelphes.cpp (+1/-3) tools/SampleAnalyzer/Interfaces/delphes/DetectorDelphes.h (+0/-2) tools/SampleAnalyzer/Interfaces/fastjet/JetClusteringCDFJetClu.cpp (+11/-5) tools/SampleAnalyzer/Interfaces/fastjet/JetClusteringCDFJetClu.h (+1/-5) tools/SampleAnalyzer/Interfaces/fastjet/JetClusteringCDFMidpoint.cpp (+11/-6) tools/SampleAnalyzer/Interfaces/fastjet/JetClusteringCDFMidpoint.h (+1/-6) tools/SampleAnalyzer/Interfaces/fastjet/JetClusteringFastJet.cpp (+27/-16) tools/SampleAnalyzer/Interfaces/fastjet/JetClusteringFastJet.h (+8/-11) tools/SampleAnalyzer/Interfaces/fastjet/JetClusteringGridJet.cpp (+12/-5) tools/SampleAnalyzer/Interfaces/fastjet/JetClusteringGridJet.h (+2/-5) tools/SampleAnalyzer/Interfaces/fastjet/JetClusteringPlugin.h (+6/-8) tools/SampleAnalyzer/Interfaces/fastjet/JetClusteringSISCone.cpp (+12/-5) tools/SampleAnalyzer/Interfaces/fastjet/JetClusteringSISCone.h (+1/-6) tools/SampleAnalyzer/Interfaces/fastjet/JetClusteringStandard.cpp (+37/-14) tools/SampleAnalyzer/Interfaces/fastjet/JetClusteringStandard.h (+3/-5) tools/SampleAnalyzer/Interfaces/fastjet/MergingPlots.cpp (+10/-5) tools/SampleAnalyzer/Interfaces/fastjet/MergingPlots.h (+7/-8) tools/SampleAnalyzer/Interfaces/zlib/gz_file.h (+62/-0) tools/SampleAnalyzer/Interfaces/zlib/gz_istream.h (+1/-1) tools/SampleAnalyzer/Interfaces/zlib/gz_ostream.h (+1/-1) tools/SampleAnalyzer/Interfaces/zlib/gz_streambase.cpp (+32/-8) tools/SampleAnalyzer/Interfaces/zlib/gz_streambase.h (+12/-14) tools/SampleAnalyzer/JetClustering/JetClustererManager.cpp (+11/-11) tools/SampleAnalyzer/JetClustering/TaggerBase.cpp (+2/-2) tools/SampleAnalyzer/JetClustering/TauTagger.cpp (+22/-2) tools/SampleAnalyzer/JetClustering/bTagger.cpp (+3/-3) tools/SampleAnalyzer/JetClustering/cTagger.cpp (+4/-4) tools/SampleAnalyzer/Plot/Histo.cpp (+18/-1) tools/SampleAnalyzer/Plot/Histo.h (+23/-0) tools/SampleAnalyzer/Plot/PlotBase.h (+4/-0) tools/SampleAnalyzer/Plot/PlotManager.h (+22/-4) tools/SampleAnalyzer/Reader/DelphesReader.cpp (+0/-410) tools/SampleAnalyzer/Reader/DelphesReader.h (+0/-163) tools/SampleAnalyzer/Reader/FACdataformat.cpp (+0/-39) tools/SampleAnalyzer/Reader/HEPMCReader.cpp (+3/-3) tools/SampleAnalyzer/Reader/LHEReader.cpp (+11/-5) tools/SampleAnalyzer/Reader/ROOTReader.cpp (+92/-177) tools/SampleAnalyzer/Reader/ROOTReader.h (+65/-23) tools/SampleAnalyzer/Reader/ReaderManager.cpp (+2/-15) tools/SampleAnalyzer/Reader/ReaderTextBase.cpp (+1/-13) tools/SampleAnalyzer/Reader/ReaderTextBase.h (+1/-11) tools/SampleAnalyzer/Reader/STDHEPreader.cpp (+99/-35) tools/SampleAnalyzer/Reader/TreeReaderBase.h (+100/-0) tools/SampleAnalyzer/RegionSelection/RegionSelection.cpp (+36/-0) tools/SampleAnalyzer/RegionSelection/RegionSelection.h (+115/-0) tools/SampleAnalyzer/RegionSelection/RegionSelectionManager.cpp (+127/-0) tools/SampleAnalyzer/RegionSelection/RegionSelectionManager.h (+273/-0) tools/SampleAnalyzer/Service/Identification.h (+270/-0) tools/SampleAnalyzer/Service/LoopService.cpp (+1/-1) tools/SampleAnalyzer/Service/LoopService.h (+2/-2) tools/SampleAnalyzer/Service/MCconfig.h (+2/-1) tools/SampleAnalyzer/Service/Physics.cpp (+9/-7) tools/SampleAnalyzer/Service/Physics.h (+23/-668) tools/SampleAnalyzer/Service/RECconfig.h (+1/-1) tools/SampleAnalyzer/Service/SortingService.cpp (+27/-0) tools/SampleAnalyzer/Service/SortingService.h (+279/-0) tools/SampleAnalyzer/Service/TransverseVariables.cpp (+601/-0) tools/SampleAnalyzer/Service/TransverseVariables.h (+216/-0) tools/SampleAnalyzer/Test/test.cpp (+66/-0) tools/SampleAnalyzer/Writer/SAFWriter.cpp (+18/-2) tools/SampleAnalyzer/Writer/SAFWriter.h (+2/-5) tools/SampleAnalyzer/Writer/WriterTextBase.cpp (+8/-3) tools/SampleAnalyzer/Writer/WriterTextBase.h (+0/-6) tools/SampleAnalyzer/delphes_card_ATLAS.tcl (+0/-536) tools/SampleAnalyzer/delphes_card_ATLAS_PileUp.tcl (+0/-617) tools/SampleAnalyzer/delphes_card_CMS.tcl (+0/-544) tools/SampleAnalyzer/delphes_card_CMS_PileUp.tcl (+0/-626) tools/SampleAnalyzer/newAnalyzer.py (+50/-15) tools/SampleAnalyzer/newFilter.py (+0/-399) |
To merge this branch: | bzr merge lp:~ma5/madanalysis5/v1.1.10beta |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Eric Conte | Pending | ||
Review via email: mp+219948@code.launchpad.net |
Commit message
Description of the change
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'bin/ma5' | |||
2 | --- bin/ma5 2013-10-29 09:21:58 +0000 | |||
3 | +++ bin/ma5 2014-05-17 19:51:11 +0000 | |||
4 | @@ -24,6 +24,194 @@ | |||
5 | 24 | ################################################################################ | 24 | ################################################################################ |
6 | 25 | 25 | ||
7 | 26 | 26 | ||
8 | 27 | def MainSession(): | ||
9 | 28 | |||
10 | 29 | # Importing MadAnalysis main class | ||
11 | 30 | from madanalysis.core.main import Main | ||
12 | 31 | main = Main() | ||
13 | 32 | main.ma5dir = ma5dir | ||
14 | 33 | |||
15 | 34 | # Release version | ||
16 | 35 | # Do not touch it !!!!! | ||
17 | 36 | main.version = "1.1.10.35" | ||
18 | 37 | main.date = "2014/05/09" | ||
19 | 38 | |||
20 | 39 | # Checking arguments | ||
21 | 40 | import getopt | ||
22 | 41 | try: | ||
23 | 42 | optlist, arglist = getopt.getopt(sys.argv[1:], \ | ||
24 | 43 | "PHReEvhfmsb", \ | ||
25 | 44 | ["partonlevel","hadronlevel","recolevel",\ | ||
26 | 45 | "expert","version","release","help",\ | ||
27 | 46 | "forced","script","mg5","autocheck","build"]) | ||
28 | 47 | except getopt.GetoptError, err: | ||
29 | 48 | logging.error(str(err)) | ||
30 | 49 | usage() | ||
31 | 50 | sys.exit() | ||
32 | 51 | |||
33 | 52 | # Reading aguments | ||
34 | 53 | partonlevel = False | ||
35 | 54 | hadronlevel = False | ||
36 | 55 | recolevel = False | ||
37 | 56 | expertmode = False | ||
38 | 57 | forcedmode = False | ||
39 | 58 | mg5mode = False | ||
40 | 59 | scriptmode = False | ||
41 | 60 | autocheck = False | ||
42 | 61 | build = False | ||
43 | 62 | for o,a in optlist: | ||
44 | 63 | if o in ("-P","--partonlevel"): | ||
45 | 64 | partonlevel=True | ||
46 | 65 | elif o in ("-H","--hadronlevel"): | ||
47 | 66 | hadronlevel=True | ||
48 | 67 | elif o in ("-R","--recolevel"): | ||
49 | 68 | recolevel=True | ||
50 | 69 | elif o in ("-E","-e","--expert"): | ||
51 | 70 | expertmode=True | ||
52 | 71 | elif o in ("-f","--forced"): | ||
53 | 72 | forcedmode=True | ||
54 | 73 | elif o in ("-m","--mg5"): | ||
55 | 74 | mg5mode=True | ||
56 | 75 | elif o in ("-s","--script"): | ||
57 | 76 | scriptmode=True | ||
58 | 77 | elif o in ("-v","--version","--release"): | ||
59 | 78 | logging.info("MA5 release : " + main.version + " " + main.date + "\n") | ||
60 | 79 | sys.exit() | ||
61 | 80 | elif o in ("--autocheck"): | ||
62 | 81 | autocheck = True | ||
63 | 82 | elif o in ("-b","--build"): | ||
64 | 83 | build = True | ||
65 | 84 | elif o in ("-h","--help"): | ||
66 | 85 | usage() | ||
67 | 86 | sys.exit() | ||
68 | 87 | |||
69 | 88 | # Checking compatibility between arguments | ||
70 | 89 | if partonlevel and hadronlevel: | ||
71 | 90 | logging.error("Parton mode and hadron mode cannot be set in a same time.\n" | ||
72 | 91 | "Please choose only one of these modes.") | ||
73 | 92 | sys.exit() | ||
74 | 93 | elif partonlevel and recolevel: | ||
75 | 94 | logging.error("Parton mode and reco mode cannot be set in a same time.\n" | ||
76 | 95 | "Please choose only one of these modes.") | ||
77 | 96 | sys.exit() | ||
78 | 97 | |||
79 | 98 | elif hadronlevel and recolevel: | ||
80 | 99 | logging.error("Hadron mode and reco mode cannot be set in a same time.\n" | ||
81 | 100 | "Please choose only one of these modes.") | ||
82 | 101 | sys.exit() | ||
83 | 102 | if scriptmode: | ||
84 | 103 | forcedmode=True | ||
85 | 104 | |||
86 | 105 | # Setting argument in the main program | ||
87 | 106 | from madanalysis.enumeration.ma5_running_type import MA5RunningType | ||
88 | 107 | if partonlevel: | ||
89 | 108 | main.mode=MA5RunningType.PARTON | ||
90 | 109 | elif hadronlevel: | ||
91 | 110 | main.mode=MA5RunningType.HADRON | ||
92 | 111 | elif recolevel: | ||
93 | 112 | main.mode=MA5RunningType.RECO | ||
94 | 113 | from madanalysis.enumeration.normalize_type import NormalizeType | ||
95 | 114 | main.normalize=NormalizeType.NONE | ||
96 | 115 | |||
97 | 116 | # Re-initializing the list of observables (hadron-level or reco-level) | ||
98 | 117 | if hadronlevel or recolevel: | ||
99 | 118 | main.InitObservables(main.mode) | ||
100 | 119 | |||
101 | 120 | main.forced = forcedmode | ||
102 | 121 | Main.forced = forcedmode | ||
103 | 122 | main.script = scriptmode | ||
104 | 123 | main.mg5 = mg5mode | ||
105 | 124 | |||
106 | 125 | # Setting batch mode for ROOT | ||
107 | 126 | #sys.argv.append('-b-') | ||
108 | 127 | |||
109 | 128 | # Displaying header | ||
110 | 129 | logging.info("") | ||
111 | 130 | logging.info(\ | ||
112 | 131 | "*************************************************************\n" + \ | ||
113 | 132 | "* *\n" + \ | ||
114 | 133 | "* W E L C O M E to M A D A N A L Y S I S 5 *\n" + \ | ||
115 | 134 | "* ______ ______ *\n" + \ | ||
116 | 135 | "* /'\_/`\/\ __ \/\ ___\ *\n" + \ | ||
117 | 136 | "* /\ \ \ \_\ \ \ \__/ *\n" + \ | ||
118 | 137 | "* \ \ \__\ \ \ __ \ \___``\ *\n" + \ | ||
119 | 138 | "* \ \ \_/\ \ \ \/\ \/\ \_\ \ *\n" + \ | ||
120 | 139 | "* \ \_\\\ \_\ \_\ \_\ \____/ *\n" + \ | ||
121 | 140 | "* \/_/ \/_/\/_/\/_/\/___/ *\n" + \ | ||
122 | 141 | "* *\n" + \ | ||
123 | 142 | "* MA5 release : " + \ | ||
124 | 143 | "%-24s" % main.version + "%+15s" % main.date + " *\n" + \ | ||
125 | 144 | "* *\n" + \ | ||
126 | 145 | "* Comput. Phys. Commun. 184 (2013) 222-256 *\n" + \ | ||
127 | 146 | "* *\n" + \ | ||
128 | 147 | "* The MadAnalysis Development Team - Please visit us at *\n" + \ | ||
129 | 148 | "* https://launchpad.net/madanalysis5 *\n" + \ | ||
130 | 149 | "* *\n" + \ | ||
131 | 150 | "* Type 'help' for in-line help. *\n" + \ | ||
132 | 151 | "* *\n" + \ | ||
133 | 152 | "*************************************************************") | ||
134 | 153 | |||
135 | 154 | # Displaying special banner if auto-check mode is activated | ||
136 | 155 | if autocheck: | ||
137 | 156 | logging.info("") | ||
138 | 157 | logging.info(" AUTO-CHECK MODE") | ||
139 | 158 | logging.info("") | ||
140 | 159 | |||
141 | 160 | # Checking the present linux configuration | ||
142 | 161 | if not main.CheckLinuxConfig(detail=autocheck): | ||
143 | 162 | sys.exit() | ||
144 | 163 | |||
145 | 164 | # Building (if necesserary) the SampleAnalyzer library | ||
146 | 165 | if not main.BuildLibrary(forced=build): | ||
147 | 166 | sys.exit() | ||
148 | 167 | |||
149 | 168 | logging.info("*************************************************************") | ||
150 | 169 | |||
151 | 170 | |||
152 | 171 | # Auto-check mode | ||
153 | 172 | if autocheck: | ||
154 | 173 | pass | ||
155 | 174 | |||
156 | 175 | # Expert mode | ||
157 | 176 | elif expertmode: | ||
158 | 177 | from madanalysis.core.expert_mode import ExpertMode | ||
159 | 178 | main.expertmode = True | ||
160 | 179 | expert = ExpertMode(main) | ||
161 | 180 | if not expert.CreateDirectory(): | ||
162 | 181 | sys.exit() | ||
163 | 182 | if not expert.Copy(): | ||
164 | 183 | sys.exit() | ||
165 | 184 | expert.GiveAdvice() | ||
166 | 185 | return False | ||
167 | 186 | |||
168 | 187 | # Normal mode | ||
169 | 188 | else: | ||
170 | 189 | |||
171 | 190 | # Launching the interpreter | ||
172 | 191 | from madanalysis.interpreter.interpreter import Interpreter | ||
173 | 192 | interpreter = Interpreter(main) | ||
174 | 193 | |||
175 | 194 | # Looking for script | ||
176 | 195 | for arg in arglist: | ||
177 | 196 | filename=os.path.expanduser(arg) | ||
178 | 197 | filename=os.path.abspath(filename) | ||
179 | 198 | interpreter.load(filename) | ||
180 | 199 | |||
181 | 200 | # Exit if script mode activated | ||
182 | 201 | if len(arglist)!=0 and main.script: | ||
183 | 202 | interpreter.run_cmd("quit") | ||
184 | 203 | return False | ||
185 | 204 | |||
186 | 205 | # Interpreter loop | ||
187 | 206 | else: | ||
188 | 207 | interpreter.cmdloop() | ||
189 | 208 | if main.repeatSession==True: | ||
190 | 209 | return True | ||
191 | 210 | else: | ||
192 | 211 | return False | ||
193 | 212 | |||
194 | 213 | |||
195 | 214 | |||
196 | 27 | def usage(): | 215 | def usage(): |
197 | 28 | logging.info("\nUsage of MadAnalysis 5") | 216 | logging.info("\nUsage of MadAnalysis 5") |
198 | 29 | logging.info("------------------------") | 217 | logging.info("------------------------") |
199 | @@ -50,6 +238,9 @@ | |||
200 | 50 | logging.info("This optional argument is a list of filenames containing a "+\ | 238 | logging.info("This optional argument is a list of filenames containing a "+\ |
201 | 51 | "set of MadAnalysis 5 commands. The file name are handled as "+\ | 239 | "set of MadAnalysis 5 commands. The file name are handled as "+\ |
202 | 52 | "concatenated, and the commands are applied sequentially.\n") | 240 | "concatenated, and the commands are applied sequentially.\n") |
203 | 241 | |||
204 | 242 | |||
205 | 243 | |||
206 | 53 | 244 | ||
207 | 54 | """This is the main executable, a simple frontend to set up the PYTHONPATH | 245 | """This is the main executable, a simple frontend to set up the PYTHONPATH |
208 | 55 | and call immediately the command line interface scripts""" | 246 | and call immediately the command line interface scripts""" |
209 | @@ -105,182 +296,16 @@ | |||
210 | 105 | readline.__doc__ = 'GNU' | 296 | readline.__doc__ = 'GNU' |
211 | 106 | readline.parse_and_bind("tab: complete") | 297 | readline.parse_and_bind("tab: complete") |
212 | 107 | 298 | ||
392 | 108 | 299 | # Loop over MA5 sessions | |
393 | 109 | # Importing MadAnalysis main class | 300 | # Goal: allowing to restart |
394 | 110 | from madanalysis.core.main import Main | 301 | while True: |
395 | 111 | main = Main() | 302 | repeat = MainSession() |
396 | 112 | main.ma5dir = ma5dir | 303 | if not repeat: |
397 | 113 | 304 | # Normal end | |
398 | 114 | # Release version | 305 | break |
399 | 115 | # Do not touch it !!!!! | 306 | from madanalysis.core.string_tools import StringTools |
400 | 116 | main.version = "1.1.9" | 307 | logging.info("") |
401 | 117 | main.date = "2013/10/29" | 308 | logging.info(StringTools.Fill('-',40)) |
402 | 118 | 309 | logging.info(StringTools.Center('RESTART THE MADANALYSIS 5 SESSION',40)) | |
403 | 119 | # Checking arguments | 310 | logging.info(StringTools.Fill('-',40)) |
404 | 120 | import getopt | 311 | logging.info("") |
226 | 121 | try: | ||
227 | 122 | optlist, arglist = getopt.getopt(sys.argv[1:], \ | ||
228 | 123 | "PHReEvhfmsb", \ | ||
229 | 124 | ["partonlevel","hadronlevel","recolevel",\ | ||
230 | 125 | "expert","version","release","help",\ | ||
231 | 126 | "forced","script","mg5","autocheck","build"]) | ||
232 | 127 | except getopt.GetoptError, err: | ||
233 | 128 | logging.error(str(err)) | ||
234 | 129 | usage() | ||
235 | 130 | sys.exit() | ||
236 | 131 | |||
237 | 132 | # Reading aguments | ||
238 | 133 | partonlevel = False | ||
239 | 134 | hadronlevel = False | ||
240 | 135 | recolevel = False | ||
241 | 136 | expertmode = False | ||
242 | 137 | forcedmode = False | ||
243 | 138 | mg5mode = False | ||
244 | 139 | scriptmode = False | ||
245 | 140 | autocheck = False | ||
246 | 141 | build = False | ||
247 | 142 | for o,a in optlist: | ||
248 | 143 | if o in ("-P","--partonlevel"): | ||
249 | 144 | partonlevel=True | ||
250 | 145 | elif o in ("-H","--hadronlevel"): | ||
251 | 146 | hadronlevel=True | ||
252 | 147 | elif o in ("-R","--recolevel"): | ||
253 | 148 | recolevel=True | ||
254 | 149 | elif o in ("-E","-e","--expert"): | ||
255 | 150 | expertmode=True | ||
256 | 151 | elif o in ("-f","--forced"): | ||
257 | 152 | forcedmode=True | ||
258 | 153 | elif o in ("-m","--mg5"): | ||
259 | 154 | mg5mode=True | ||
260 | 155 | elif o in ("-s","--script"): | ||
261 | 156 | scriptmode=True | ||
262 | 157 | elif o in ("-v","--version","--release"): | ||
263 | 158 | logging.info("MA5 release : " + main.version + " " + main.date + "\n") | ||
264 | 159 | sys.exit() | ||
265 | 160 | elif o in ("--autocheck"): | ||
266 | 161 | autocheck = True | ||
267 | 162 | elif o in ("-b","--build"): | ||
268 | 163 | build = True | ||
269 | 164 | elif o in ("-h","--help"): | ||
270 | 165 | usage() | ||
271 | 166 | sys.exit() | ||
272 | 167 | |||
273 | 168 | # Checking compatibility between arguments | ||
274 | 169 | if partonlevel and hadronlevel: | ||
275 | 170 | logging.error("Parton mode and hadron mode cannot be set in a same time.\n" | ||
276 | 171 | "Please choose only one of these modes.") | ||
277 | 172 | sys.exit() | ||
278 | 173 | elif partonlevel and recolevel: | ||
279 | 174 | logging.error("Parton mode and reco mode cannot be set in a same time.\n" | ||
280 | 175 | "Please choose only one of these modes.") | ||
281 | 176 | sys.exit() | ||
282 | 177 | |||
283 | 178 | elif hadronlevel and recolevel: | ||
284 | 179 | logging.error("Hadron mode and reco mode cannot be set in a same time.\n" | ||
285 | 180 | "Please choose only one of these modes.") | ||
286 | 181 | sys.exit() | ||
287 | 182 | if scriptmode: | ||
288 | 183 | forcedmode=True | ||
289 | 184 | |||
290 | 185 | # Setting argument in the main program | ||
291 | 186 | from madanalysis.enumeration.ma5_running_type import MA5RunningType | ||
292 | 187 | if partonlevel: | ||
293 | 188 | main.mode=MA5RunningType.PARTON | ||
294 | 189 | elif hadronlevel: | ||
295 | 190 | main.mode=MA5RunningType.HADRON | ||
296 | 191 | elif recolevel: | ||
297 | 192 | main.mode=MA5RunningType.RECO | ||
298 | 193 | from madanalysis.enumeration.normalize_type import NormalizeType | ||
299 | 194 | main.normalize=NormalizeType.NONE | ||
300 | 195 | |||
301 | 196 | # Re-initializing the list of observables (hadron-level or reco-level) | ||
302 | 197 | if hadronlevel or recolevel: | ||
303 | 198 | main.InitObservables(main.mode) | ||
304 | 199 | |||
305 | 200 | |||
306 | 201 | main.forced = forcedmode | ||
307 | 202 | Main.forced = forcedmode | ||
308 | 203 | main.script = scriptmode | ||
309 | 204 | main.mg5 = mg5mode | ||
310 | 205 | |||
311 | 206 | # Setting batch mode for ROOT | ||
312 | 207 | #sys.argv.append('-b-') | ||
313 | 208 | |||
314 | 209 | # Displaying header | ||
315 | 210 | logging.info("") | ||
316 | 211 | logging.info(\ | ||
317 | 212 | "*************************************************************\n" + \ | ||
318 | 213 | "* *\n" + \ | ||
319 | 214 | "* W E L C O M E to M A D A N A L Y S I S 5 *\n" + \ | ||
320 | 215 | "* ______ ______ *\n" + \ | ||
321 | 216 | "* /'\_/`\/\ __ \/\ ___\ *\n" + \ | ||
322 | 217 | "* /\ \ \ \_\ \ \ \__/ *\n" + \ | ||
323 | 218 | "* \ \ \__\ \ \ __ \ \___``\ *\n" + \ | ||
324 | 219 | "* \ \ \_/\ \ \ \/\ \/\ \_\ \ *\n" + \ | ||
325 | 220 | "* \ \_\\\ \_\ \_\ \_\ \____/ *\n" + \ | ||
326 | 221 | "* \/_/ \/_/\/_/\/_/\/___/ *\n" + \ | ||
327 | 222 | "* *\n" + \ | ||
328 | 223 | "* MA5 release : " + \ | ||
329 | 224 | "%-24s" % main.version + "%+15s" % main.date + " *\n" + \ | ||
330 | 225 | "* *\n" + \ | ||
331 | 226 | "* Comput. Phys. Commun. 184 (2013) 222-256 *\n" + \ | ||
332 | 227 | "* *\n" + \ | ||
333 | 228 | "* The MadAnalysis Development Team - Please visit us at *\n" + \ | ||
334 | 229 | "* https://launchpad.net/madanalysis5 *\n" + \ | ||
335 | 230 | "* *\n" + \ | ||
336 | 231 | "* Type 'help' for in-line help. *\n" + \ | ||
337 | 232 | "* *\n" + \ | ||
338 | 233 | "*************************************************************") | ||
339 | 234 | |||
340 | 235 | # Displaying special banner if auto-check mode is activated | ||
341 | 236 | if autocheck: | ||
342 | 237 | logging.info("") | ||
343 | 238 | logging.info(" AUTO-CHECK MODE") | ||
344 | 239 | logging.info("") | ||
345 | 240 | |||
346 | 241 | |||
347 | 242 | # Checking the present linux configuration | ||
348 | 243 | if not main.CheckLinuxConfig(detail=autocheck): | ||
349 | 244 | sys.exit() | ||
350 | 245 | |||
351 | 246 | # Building (if necesserary) the SampleAnalyzer library | ||
352 | 247 | if not main.BuildLibrary(forced=build): | ||
353 | 248 | sys.exit() | ||
354 | 249 | |||
355 | 250 | logging.info("*************************************************************") | ||
356 | 251 | |||
357 | 252 | |||
358 | 253 | # Auto-check mode | ||
359 | 254 | if autocheck: | ||
360 | 255 | pass | ||
361 | 256 | |||
362 | 257 | # Expert mode | ||
363 | 258 | elif expertmode: | ||
364 | 259 | from madanalysis.core.expert_mode import ExpertMode | ||
365 | 260 | expert = ExpertMode(main) | ||
366 | 261 | if not expert.CreateDirectory(): | ||
367 | 262 | sys.exit() | ||
368 | 263 | if not expert.Copy(): | ||
369 | 264 | sys.exit() | ||
370 | 265 | expert.GiveAdvice() | ||
371 | 266 | |||
372 | 267 | # Normal mode | ||
373 | 268 | else: | ||
374 | 269 | |||
375 | 270 | # Launching the interpreter | ||
376 | 271 | from madanalysis.interpreter.interpreter import Interpreter | ||
377 | 272 | interpreter = Interpreter(main) | ||
378 | 273 | |||
379 | 274 | # Looking for script | ||
380 | 275 | for arg in arglist: | ||
381 | 276 | filename=os.path.expanduser(arg) | ||
382 | 277 | filename=os.path.abspath(filename) | ||
383 | 278 | interpreter.load(filename) | ||
384 | 279 | |||
385 | 280 | # Exit if script mode activated | ||
386 | 281 | if len(arglist)!=0 and main.script: | ||
387 | 282 | interpreter.run_cmd("quit") | ||
388 | 283 | |||
389 | 284 | # Interpreter loop | ||
390 | 285 | else: | ||
391 | 286 | interpreter.cmdloop() | ||
405 | 287 | 312 | ||
406 | === added file 'madanalysis/IOinterface/delphes_migration.py' | |||
407 | --- madanalysis/IOinterface/delphes_migration.py 1970-01-01 00:00:00 +0000 | |||
408 | +++ madanalysis/IOinterface/delphes_migration.py 2014-05-17 19:51:11 +0000 | |||
409 | @@ -0,0 +1,81 @@ | |||
410 | 1 | ################################################################################ | ||
411 | 2 | # | ||
412 | 3 | # Copyright (C) 2012-2013 Eric Conte, Benjamin Fuks | ||
413 | 4 | # The MadAnalysis development team, email: <ma5team@iphc.cnrs.fr> | ||
414 | 5 | # | ||
415 | 6 | # This file is part of MadAnalysis 5. | ||
416 | 7 | # Official website: <https://launchpad.net/madanalysis5> | ||
417 | 8 | # | ||
418 | 9 | # MadAnalysis 5 is free software: you can redistribute it and/or modify | ||
419 | 10 | # it under the terms of the GNU General Public License as published by | ||
420 | 11 | # the Free Software Foundation, either version 3 of the License, or | ||
421 | 12 | # (at your option) any later version. | ||
422 | 13 | # | ||
423 | 14 | # MadAnalysis 5 is distributed in the hope that it will be useful, | ||
424 | 15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
425 | 16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
426 | 17 | # GNU General Public License for more details. | ||
427 | 18 | # | ||
428 | 19 | # You should have received a copy of the GNU General Public License | ||
429 | 20 | # along with MadAnalysis 5. If not, see <http://www.gnu.org/licenses/> | ||
430 | 21 | # | ||
431 | 22 | ################################################################################ | ||
432 | 23 | |||
433 | 24 | |||
434 | 25 | from madanalysis.selection.instance_name import InstanceName | ||
435 | 26 | from madanalysis.IOinterface.folder_writer import FolderWriter | ||
436 | 27 | from madanalysis.enumeration.ma5_running_type import MA5RunningType | ||
437 | 28 | from madanalysis.core.string_tools import StringTools | ||
438 | 29 | import logging | ||
439 | 30 | import shutil | ||
440 | 31 | import os | ||
441 | 32 | import commands | ||
442 | 33 | import glob | ||
443 | 34 | |||
444 | 35 | class DelphesMigration(): | ||
445 | 36 | |||
446 | 37 | def __init__(self,main): | ||
447 | 38 | self.main = main | ||
448 | 39 | |||
449 | 40 | def Migrate(self): | ||
450 | 41 | self.ChangeTreeNames() | ||
451 | 42 | self.ApplyPatch() | ||
452 | 43 | |||
453 | 44 | def ApplyPatch(self): | ||
454 | 45 | os.system('cp '+self.main.ma5dir+'/tools/SampleAnalyzer/Detector/patch_delfes.tgz '+\ | ||
455 | 46 | self.main.ma5dir+'/tools/delfes/') | ||
456 | 47 | os.system('cd '+ self.main.ma5dir + '/tools/delfes/; tar xzf patch_delfes.tgz') | ||
457 | 48 | |||
458 | 49 | |||
459 | 50 | def ChangeTreeNames(self): | ||
460 | 51 | myfiles = glob.glob(self.main.ma5dir+'/tools/delfes/readers/Delphes*.cpp') | ||
461 | 52 | for myfile in myfiles: | ||
462 | 53 | self.ChangeTreeName(myfile) | ||
463 | 54 | |||
464 | 55 | def ChangeTreeName(self,filename): | ||
465 | 56 | |||
466 | 57 | try: | ||
467 | 58 | input = open(filename) | ||
468 | 59 | except: | ||
469 | 60 | return False | ||
470 | 61 | |||
471 | 62 | try: | ||
472 | 63 | output = open(filename+"~","w") | ||
473 | 64 | except: | ||
474 | 65 | return False | ||
475 | 66 | |||
476 | 67 | for line in input: | ||
477 | 68 | if line.find("treeWriter")!=-1 and line.find("ExRootTreeWriter")!=1: | ||
478 | 69 | line = line.replace('"Delphes"','"Delfes"') | ||
479 | 70 | output.write(line) | ||
480 | 71 | |||
481 | 72 | output.close() | ||
482 | 73 | input.close() | ||
483 | 74 | os.system("mv "+filename+"~ "+filename) | ||
484 | 75 | return True | ||
485 | 76 | |||
486 | 77 | |||
487 | 78 | |||
488 | 79 | |||
489 | 80 | |||
490 | 81 | |||
491 | 0 | 82 | ||
492 | === modified file 'madanalysis/IOinterface/job_reader.py' | |||
493 | --- madanalysis/IOinterface/job_reader.py 2013-07-28 14:10:33 +0000 | |||
494 | +++ madanalysis/IOinterface/job_reader.py 2014-05-17 19:51:11 +0000 | |||
495 | @@ -293,9 +293,9 @@ | |||
496 | 293 | beginTag.activate() | 293 | beginTag.activate() |
497 | 294 | elif words[0].lower()=='</safheader>': | 294 | elif words[0].lower()=='</safheader>': |
498 | 295 | beginTag.desactivate() | 295 | beginTag.desactivate() |
500 | 296 | if words[0].lower()=='<saffoot>': | 296 | if words[0].lower()=='<saffooter>': |
501 | 297 | endTag.activate() | 297 | endTag.activate() |
503 | 298 | elif words[0].lower()=='</saffoot>': | 298 | elif words[0].lower()=='</saffooter>': |
504 | 299 | endTag.desactivate() | 299 | endTag.desactivate() |
505 | 300 | if words[0].lower()=='<sampleglobalinfo>': | 300 | if words[0].lower()=='<sampleglobalinfo>': |
506 | 301 | globalTag.activate() | 301 | globalTag.activate() |
507 | @@ -573,7 +573,7 @@ | |||
508 | 573 | logging.error("SAF header <SAFheader> and </SAFheader> is not "+\ | 573 | logging.error("SAF header <SAFheader> and </SAFheader> is not "+\ |
509 | 574 | "found.") | 574 | "found.") |
510 | 575 | if endTag.Nactivated==0 or endTag.activated: | 575 | if endTag.Nactivated==0 or endTag.activated: |
512 | 576 | logging.error("SAF foot <SAFfoot> and </SAFfoot> is not "+\ | 576 | logging.error("SAF footer <SAFfooter> and </SAFfooter> is not "+\ |
513 | 577 | "found.") | 577 | "found.") |
514 | 578 | if globalTag.Nactivated==0 or globalTag.activated: | 578 | if globalTag.Nactivated==0 or globalTag.activated: |
515 | 579 | logging.error("Information corresponding to the block "+\ | 579 | logging.error("Information corresponding to the block "+\ |
516 | 580 | 580 | ||
517 | === modified file 'madanalysis/IOinterface/job_writer.py' | |||
518 | --- madanalysis/IOinterface/job_writer.py 2013-10-29 09:21:58 +0000 | |||
519 | +++ madanalysis/IOinterface/job_writer.py 2014-05-17 19:51:11 +0000 | |||
520 | @@ -26,6 +26,7 @@ | |||
521 | 26 | from madanalysis.IOinterface.folder_writer import FolderWriter | 26 | from madanalysis.IOinterface.folder_writer import FolderWriter |
522 | 27 | from madanalysis.enumeration.ma5_running_type import MA5RunningType | 27 | from madanalysis.enumeration.ma5_running_type import MA5RunningType |
523 | 28 | from madanalysis.core.string_tools import StringTools | 28 | from madanalysis.core.string_tools import StringTools |
524 | 29 | from madanalysis.IOinterface.shell_command import ShellCommand | ||
525 | 29 | import logging | 30 | import logging |
526 | 30 | import shutil | 31 | import shutil |
527 | 31 | import os | 32 | import os |
528 | @@ -40,6 +41,7 @@ | |||
529 | 40 | self.resubmit = resubmit | 41 | self.resubmit = resubmit |
530 | 41 | self.libZIP = self.main.libZIP | 42 | self.libZIP = self.main.libZIP |
531 | 42 | self.libDelphes = self.main.libDelphes | 43 | self.libDelphes = self.main.libDelphes |
532 | 44 | self.libDelfes = self.main.libDelfes | ||
533 | 43 | self.output = self.main.output | 45 | self.output = self.main.output |
534 | 44 | self.libFastjet = self.main.libFastJet | 46 | self.libFastjet = self.main.libFastJet |
535 | 45 | self.fastsim = self.main.fastsim | 47 | self.fastsim = self.main.fastsim |
536 | @@ -60,8 +62,6 @@ | |||
537 | 60 | return False | 62 | return False |
538 | 61 | elif not os.path.isdir(path+"/Build/SampleAnalyzer/Analyzer"): | 63 | elif not os.path.isdir(path+"/Build/SampleAnalyzer/Analyzer"): |
539 | 62 | return False | 64 | return False |
540 | 63 | elif not os.path.isdir(path+"/Build/SampleAnalyzer/Filter"): | ||
541 | 64 | return False | ||
542 | 65 | elif not os.path.isdir(path+"/Build/Main"): | 65 | elif not os.path.isdir(path+"/Build/Main"): |
543 | 66 | return False | 66 | return False |
544 | 67 | elif not os.path.isdir(path+"/Output"): | 67 | elif not os.path.isdir(path+"/Output"): |
545 | @@ -99,11 +99,6 @@ | |||
546 | 99 | logging.error("Impossible to create the folder 'Build/SampleAnalyzer/Analyzer'") | 99 | logging.error("Impossible to create the folder 'Build/SampleAnalyzer/Analyzer'") |
547 | 100 | return False | 100 | return False |
548 | 101 | try: | 101 | try: |
549 | 102 | os.mkdir(path+"/Build/SampleAnalyzer/Filter") | ||
550 | 103 | except: | ||
551 | 104 | logging.error("Impossible to create the folder 'Build/SampleAnalyzer/Filter'") | ||
552 | 105 | return False | ||
553 | 106 | try: | ||
554 | 107 | os.mkdir(path+"/Build/Log") | 102 | os.mkdir(path+"/Build/Log") |
555 | 108 | except: | 103 | except: |
556 | 109 | logging.error("Impossible to create the folder 'Build/Log'") | 104 | logging.error("Impossible to create the folder 'Build/Log'") |
557 | @@ -143,9 +138,6 @@ | |||
558 | 143 | elif not os.path.isdir(self.path+"/Build/SampleAnalyzer/Analyzer"): | 138 | elif not os.path.isdir(self.path+"/Build/SampleAnalyzer/Analyzer"): |
559 | 144 | logging.error("folder '"+self.path+"/Build/SampleAnalyzer/Analyzer' is not found") | 139 | logging.error("folder '"+self.path+"/Build/SampleAnalyzer/Analyzer' is not found") |
560 | 145 | return False | 140 | return False |
561 | 146 | elif not os.path.isdir(self.path+"/Build/SampleAnalyzer/Filter"): | ||
562 | 147 | logging.error("folder '"+self.path+"/Build/SampleAnalyzer/Filter' is not found") | ||
563 | 148 | return False | ||
564 | 149 | elif not os.path.isdir(self.path+"/Build/Main"): | 141 | elif not os.path.isdir(self.path+"/Build/Main"): |
565 | 150 | logging.error("folder '"+self.path+"/Build/Main' is not found") | 142 | logging.error("folder '"+self.path+"/Build/Main' is not found") |
566 | 151 | return False | 143 | return False |
567 | @@ -170,19 +162,18 @@ | |||
568 | 170 | 162 | ||
569 | 171 | def CreateDelphesCard(self): | 163 | def CreateDelphesCard(self): |
570 | 172 | 164 | ||
576 | 173 | if self.fastsim.delphes.pileup=="": | 165 | if self.main.fastsim.package=="delphes": |
577 | 174 | if self.fastsim.delphes.detector=='cms': | 166 | cardname = self.main.fastsim.delphes.card |
578 | 175 | cardname = 'delphes_card_CMS.tcl' | 167 | elif self.main.fastsim.package=="delfes": |
579 | 176 | elif self.fastsim.delphes.detector=='atlas': | 168 | cardname = self.main.fastsim.delfes.card |
580 | 177 | cardname ='delphes_card_ATLAS.tcl' | 169 | |
581 | 170 | if self.main.fastsim.package=="delfes": | ||
582 | 171 | cfg=self.main.fastsim.delfes | ||
583 | 178 | else: | 172 | else: |
588 | 179 | if self.fastsim.delphes.detector=='cms': | 173 | cfg=self.main.fastsim.delphes |
585 | 180 | cardname = 'delphes_card_CMS_PileUp.tcl' | ||
586 | 181 | elif self.fastsim.delphes.detector=='atlas': | ||
587 | 182 | cardname ='delphes_card_ATLAS_PileUp.tcl' | ||
589 | 183 | 174 | ||
590 | 184 | try: | 175 | try: |
592 | 185 | input = open(self.ma5dir+"/tools/SampleAnalyzer/"+cardname,'r') | 176 | input = open(self.ma5dir+"/tools/SampleAnalyzer/Detector/"+cardname,'r') |
593 | 186 | except: | 177 | except: |
594 | 187 | pass | 178 | pass |
595 | 188 | 179 | ||
596 | @@ -191,18 +182,18 @@ | |||
597 | 191 | except: | 182 | except: |
598 | 192 | pass | 183 | pass |
599 | 193 | 184 | ||
601 | 194 | if self.main.fastsim.delphes.pileup!="": | 185 | if cfg.pileup!="": |
602 | 195 | # Getting current dir | 186 | # Getting current dir |
603 | 196 | theDir = os.getcwd() | 187 | theDir = os.getcwd() |
604 | 197 | 188 | ||
605 | 198 | # Adding file | 189 | # Adding file |
608 | 199 | if self.main.fastsim.delphes.pileup.startswith('/'): | 190 | if cfg.pileup.startswith('/'): |
609 | 200 | theFile = self.main.fastsim.delphes.pileup | 191 | theFile = cfg.pileup |
610 | 201 | else: | 192 | else: |
612 | 202 | theFile = os.path.normpath(theDir+"/"+self.main.fastsim.delphes.pileup) | 193 | theFile = os.path.normpath(theDir+"/"+cfg.pileup) |
613 | 203 | 194 | ||
614 | 204 | for line in input: | 195 | for line in input: |
616 | 205 | if self.main.fastsim.delphes.pileup!="": | 196 | if cfg.pileup!="": |
617 | 206 | line=line.replace('MinBias.pileup',theFile) | 197 | line=line.replace('MinBias.pileup',theFile) |
618 | 207 | output.write(line) | 198 | output.write(line) |
619 | 208 | 199 | ||
620 | @@ -234,22 +225,8 @@ | |||
621 | 234 | except: | 225 | except: |
622 | 235 | logging.error('Impossible to make executable the file "newAnalyzer"') | 226 | logging.error('Impossible to make executable the file "newAnalyzer"') |
623 | 236 | return False | 227 | return False |
624 | 237 | try: | ||
625 | 238 | shutil.copyfile\ | ||
626 | 239 | (\ | ||
627 | 240 | self.ma5dir+"/tools/SampleAnalyzer/newFilter.py",\ | ||
628 | 241 | self.path+"/Build/SampleAnalyzer/newFilter.py"\ | ||
629 | 242 | ) | ||
630 | 243 | except: | ||
631 | 244 | logging.error('Impossible to copy the file "newFilter"') | ||
632 | 245 | return False | ||
633 | 246 | try: | ||
634 | 247 | os.chmod(self.path+"/Build/SampleAnalyzer/newFilter.py",0755) | ||
635 | 248 | except: | ||
636 | 249 | logging.error('Impossible to make executable the file "newFilter.py"') | ||
637 | 250 | return False | ||
638 | 251 | 228 | ||
640 | 252 | if self.main.fastsim.package=="delphes": | 229 | if self.main.fastsim.package in ["delphes","delfes"]: |
641 | 253 | self.CreateDelphesCard() | 230 | self.CreateDelphesCard() |
642 | 254 | 231 | ||
643 | 255 | return True | 232 | return True |
644 | @@ -267,7 +244,8 @@ | |||
645 | 267 | 244 | ||
646 | 268 | def PrintIncludes(self,file): | 245 | def PrintIncludes(self,file): |
647 | 269 | file.write('// SampleHeader header\n') | 246 | file.write('// SampleHeader header\n') |
649 | 270 | file.write('#include \"SampleAnalyzer/Core/SampleAnalyzer.h\"\n') | 247 | file.write('#include "SampleAnalyzer/Core/SampleAnalyzer.h"\n') |
650 | 248 | file.write('#include "SampleAnalyzer/Analyzer/analysisList.h"\n') | ||
651 | 271 | file.write('using namespace MA5;\n\n') | 249 | file.write('using namespace MA5;\n\n') |
652 | 272 | return | 250 | return |
653 | 273 | 251 | ||
654 | @@ -278,7 +256,9 @@ | |||
655 | 278 | file.write('int main(int argc, char *argv[])\n') | 256 | file.write('int main(int argc, char *argv[])\n') |
656 | 279 | file.write('{\n') | 257 | file.write('{\n') |
657 | 280 | file.write(' // Creating a manager\n') | 258 | file.write(' // Creating a manager\n') |
659 | 281 | file.write(' SampleAnalyzer manager;\n\n') | 259 | file.write(' SampleAnalyzer manager;\n') |
660 | 260 | file.write(' BuildUserTable(manager.AnalyzerList());\n') | ||
661 | 261 | file.write('\n') | ||
662 | 282 | 262 | ||
663 | 283 | # Initializing | 263 | # Initializing |
664 | 284 | file.write(' // ---------------------------------------------------\n') | 264 | file.write(' // ---------------------------------------------------\n') |
665 | @@ -286,7 +266,11 @@ | |||
666 | 286 | file.write(' // ---------------------------------------------------\n') | 266 | file.write(' // ---------------------------------------------------\n') |
667 | 287 | file.write(' INFO << " * Initializing all components" << endmsg;\n\n') | 267 | file.write(' INFO << " * Initializing all components" << endmsg;\n\n') |
668 | 288 | file.write(' // Initializing the manager\n') | 268 | file.write(' // Initializing the manager\n') |
670 | 289 | file.write(' if (!manager.Initialize(argc,argv,"pdg.ma5")) '+\ | 269 | if self.main.expertmode: |
671 | 270 | file.write(' if (!manager.Initialize(argc,argv,"pdg.ma5",true)) '+\ | ||
672 | 271 | 'return 1;\n\n') | ||
673 | 272 | else: | ||
674 | 273 | file.write(' if (!manager.Initialize(argc,argv,"pdg.ma5")) '+\ | ||
675 | 290 | 'return 1;\n\n') | 274 | 'return 1;\n\n') |
676 | 291 | file.write(' // Creating data format for storing data\n') | 275 | file.write(' // Creating data format for storing data\n') |
677 | 292 | file.write(' EventFormat myEvent;\n') | 276 | file.write(' EventFormat myEvent;\n') |
678 | @@ -314,39 +298,48 @@ | |||
679 | 314 | 298 | ||
680 | 315 | # Fast-Simulation detector | 299 | # Fast-Simulation detector |
681 | 316 | # + Case Fastsim | 300 | # + Case Fastsim |
683 | 317 | if self.fastsim.package=="fastjet": | 301 | if self.main.fastsim.package=="fastjet": |
684 | 318 | file.write(' //Getting pointer to the clusterer\n') | 302 | file.write(' //Getting pointer to the clusterer\n') |
685 | 319 | file.write(' std::map<std::string, std::string> parametersC1;\n') | 303 | file.write(' std::map<std::string, std::string> parametersC1;\n') |
687 | 320 | parameters = self.fastsim.SampleAnalyzerConfigString() | 304 | parameters = self.main.fastsim.SampleAnalyzerConfigString() |
688 | 321 | for k,v in sorted(parameters.iteritems(),\ | 305 | for k,v in sorted(parameters.iteritems(),\ |
689 | 322 | key=lambda (k,v): (k,v)): | 306 | key=lambda (k,v): (k,v)): |
690 | 323 | file.write(' parametersC1["'+k+'"]="'+v+'";\n') | 307 | file.write(' parametersC1["'+k+'"]="'+v+'";\n') |
691 | 324 | file.write(' JetClustererBase* cluster1 = \n') | 308 | file.write(' JetClustererBase* cluster1 = \n') |
693 | 325 | file.write(' manager.InitializeJetClusterer("'+self.fastsim.clustering.algorithm+'",parametersC1);\n') | 309 | file.write(' manager.InitializeJetClusterer("'+self.main.fastsim.clustering.algorithm+'",parametersC1);\n') |
694 | 326 | file.write(' if (cluster1==0) return 1;\n\n') | 310 | file.write(' if (cluster1==0) return 1;\n\n') |
695 | 327 | 311 | ||
696 | 328 | # + Case Delphes | 312 | # + Case Delphes |
698 | 329 | if self.fastsim.package=="delphes": | 313 | if self.main.fastsim.package in ["delphes","delfes"]: |
699 | 330 | file.write(' //Getting pointer to fast-simulation package\n') | 314 | file.write(' //Getting pointer to fast-simulation package\n') |
700 | 331 | file.write(' std::map<std::string, std::string> parametersD1;\n') | 315 | file.write(' std::map<std::string, std::string> parametersD1;\n') |
702 | 332 | parameters = self.fastsim.SampleAnalyzerConfigString() | 316 | if self.fastsim.package=="delfes": |
703 | 317 | cfg=self.main.fastsim.delfes | ||
704 | 318 | else: | ||
705 | 319 | cfg=self.main.fastsim.delphes | ||
706 | 320 | parameters = self.main.fastsim.SampleAnalyzerConfigString() | ||
707 | 333 | for k,v in sorted(parameters.iteritems(),\ | 321 | for k,v in sorted(parameters.iteritems(),\ |
708 | 334 | key=lambda (k,v): (k,v)): | 322 | key=lambda (k,v): (k,v)): |
709 | 335 | file.write(' parametersD1["'+k+'"]="'+v+'";\n') | 323 | file.write(' parametersD1["'+k+'"]="'+v+'";\n') |
710 | 336 | file.write(' DetectorBase* fastsim1 = \n') | 324 | file.write(' DetectorBase* fastsim1 = \n') |
716 | 337 | if self.fastsim.delphes.pileup=="": | 325 | |
717 | 338 | if self.fastsim.delphes.detector=='cms': | 326 | if self.main.fastsim.package=="delphes": |
718 | 339 | cardname = 'delphes_card_CMS.tcl' | 327 | cardname = self.main.fastsim.delphes.card |
719 | 340 | elif self.fastsim.delphes.detector=='atlas': | 328 | elif self.main.fastsim.package=="delfes": |
720 | 341 | cardname ='delphes_card_ATLAS.tcl' | 329 | cardname = self.main.fastsim.delfes.card |
721 | 330 | |||
722 | 331 | if self.main.fastsim.package=="delphes": | ||
723 | 332 | file.write(' manager.InitializeDetector("delphes","../../Input/'+cardname+'",parametersD1);\n') | ||
724 | 342 | else: | 333 | else: |
730 | 343 | if self.fastsim.delphes.detector=='cms': | 334 | file.write(' manager.InitializeDetector("delfes","../../Input/'+cardname+'",parametersD1);\n') |
731 | 344 | cardname = 'delphes_card_CMS_PileUp.tcl' | 335 | |
727 | 345 | elif self.fastsim.delphes.detector=='atlas': | ||
728 | 346 | cardname ='delphes_card_ATLAS_PileUp.tcl' | ||
729 | 347 | file.write(' manager.InitializeDetector("delphes","../../Input/'+cardname+'",parametersD1);\n') | ||
732 | 348 | file.write(' if (fastsim1==0) return 1;\n\n') | 336 | file.write(' if (fastsim1==0) return 1;\n\n') |
733 | 349 | 337 | ||
734 | 338 | # Post intialization (crating the output directory structure) | ||
735 | 339 | file.write(' // Post initialization (creates the new output directory structure)\n') | ||
736 | 340 | file.write(' if(!manager.PostInitialize()) return 1;\n\n') | ||
737 | 341 | |||
738 | 342 | |||
739 | 350 | # Loop | 343 | # Loop |
740 | 351 | file.write(' // ---------------------------------------------------\n') | 344 | file.write(' // ---------------------------------------------------\n') |
741 | 352 | file.write(' // EXECUTION\n') | 345 | file.write(' // EXECUTION\n') |
742 | @@ -377,9 +370,11 @@ | |||
743 | 377 | file.write(' manager.UpdateProgressBar();\n') | 370 | file.write(' manager.UpdateProgressBar();\n') |
744 | 378 | if self.merging.enable: | 371 | if self.merging.enable: |
745 | 379 | file.write(' analyzer2->Execute(mySample,myEvent);\n') | 372 | file.write(' analyzer2->Execute(mySample,myEvent);\n') |
747 | 380 | if self.fastsim.package=="fastjet": | 373 | if self.main.fastsim.package=="fastjet": |
748 | 381 | file.write(' cluster1->Execute(mySample,myEvent);\n') | 374 | file.write(' cluster1->Execute(mySample,myEvent);\n') |
750 | 382 | elif self.fastsim.package=="delphes": | 375 | elif self.main.fastsim.package=="delphes": |
751 | 376 | file.write(' fastsim1->Execute(mySample,myEvent);\n') | ||
752 | 377 | elif self.main.fastsim.package=="delfes": | ||
753 | 383 | file.write(' fastsim1->Execute(mySample,myEvent);\n') | 378 | file.write(' fastsim1->Execute(mySample,myEvent);\n') |
754 | 384 | file.write(' analyzer1->Execute(mySample,myEvent);\n') | 379 | file.write(' analyzer1->Execute(mySample,myEvent);\n') |
755 | 385 | if self.output!="": | 380 | if self.output!="": |
756 | @@ -394,15 +389,6 @@ | |||
757 | 394 | file.write(' INFO << " * Finalizing all components ..." << endmsg;\n\n') | 389 | file.write(' INFO << " * Finalizing all components ..." << endmsg;\n\n') |
758 | 395 | file.write(' // Finalizing all components\n') | 390 | file.write(' // Finalizing all components\n') |
759 | 396 | file.write(' manager.Finalize(mySamples,myEvent);\n') | 391 | file.write(' manager.Finalize(mySamples,myEvent);\n') |
760 | 397 | |||
761 | 398 | # file.write(' PHYSICS->mcConfig().AddInvisibleId(12);\n') | ||
762 | 399 | # file.write(' PHYSICS->mcConfig().AddInvisibleId(-12);\n') | ||
763 | 400 | # file.write(' PHYSICS->mcConfig().AddInvisibleId(14);\n') | ||
764 | 401 | # file.write(' PHYSICS->mcConfig().AddInvisibleId(-14);\n') | ||
765 | 402 | # file.write(' PHYSICS->mcConfig().AddInvisibleId(16);\n') | ||
766 | 403 | # file.write(' PHYSICS->mcConfig().AddInvisibleId(-16);\n') | ||
767 | 404 | # file.write(' PHYSICS->mcConfig().AddInvisibleId(1000022);\n\n') | ||
768 | 405 | |||
769 | 406 | file.write(' return 0;\n') | 392 | file.write(' return 0;\n') |
770 | 407 | file.write('}\n') | 393 | file.write('}\n') |
771 | 408 | return | 394 | return |
772 | @@ -425,23 +411,6 @@ | |||
773 | 425 | file.close() | 411 | file.close() |
774 | 426 | return True | 412 | return True |
775 | 427 | 413 | ||
776 | 428 | def WriteEmptyFilterSource(self,main): | ||
777 | 429 | file = open(self.path+"/Build/SampleAnalyzer/Filter/filterList.cpp","w") | ||
778 | 430 | file.write('#include "SampleAnalyzer/Filter/FilterManager.h"\n') | ||
779 | 431 | file.write('using namespace MA5;\n') | ||
780 | 432 | file.write('#include <stdlib.h>\n\n') | ||
781 | 433 | file.write('// ------------------------------------------' +\ | ||
782 | 434 | '-----------------------------------\n') | ||
783 | 435 | file.write('// BuildUserTable\n') | ||
784 | 436 | file.write('// ------------------------------------------' +\ | ||
785 | 437 | '-----------------------------------\n') | ||
786 | 438 | file.write('void FilterManager::BuildUserTable()\n') | ||
787 | 439 | file.write('{\n') | ||
788 | 440 | file.write('}\n') | ||
789 | 441 | file.close() | ||
790 | 442 | |||
791 | 443 | return True | ||
792 | 444 | |||
793 | 445 | def WriteSelectionSource(self,main): | 414 | def WriteSelectionSource(self,main): |
794 | 446 | main.selection.RefreshStat(); | 415 | main.selection.RefreshStat(); |
795 | 447 | file = open(self.path+"/Build/SampleAnalyzer/Analyzer/user.cpp","w") | 416 | file = open(self.path+"/Build/SampleAnalyzer/Analyzer/user.cpp","w") |
796 | @@ -450,23 +419,22 @@ | |||
797 | 450 | job.WriteSource() | 419 | job.WriteSource() |
798 | 451 | file.close() | 420 | file.close() |
799 | 452 | 421 | ||
801 | 453 | file = open(self.path+"/Build/SampleAnalyzer/Analyzer/analysisList.cpp","w") | 422 | file = open(self.path+"/Build/SampleAnalyzer/Analyzer/analysisList.h","w") |
802 | 454 | file.write('#include "SampleAnalyzer/Analyzer/AnalyzerManager.h"\n') | 423 | file.write('#include "SampleAnalyzer/Analyzer/AnalyzerManager.h"\n') |
803 | 455 | file.write('#include "SampleAnalyzer/Analyzer/user.h"\n') | 424 | file.write('#include "SampleAnalyzer/Analyzer/user.h"\n') |
804 | 456 | file.write('#include "SampleAnalyzer/Service/LogStream.h"\n') | 425 | file.write('#include "SampleAnalyzer/Service/LogStream.h"\n') |
807 | 457 | file.write('using namespace MA5;\n') | 426 | file.write('\n') |
806 | 458 | file.write('#include <stdlib.h>\n\n') | ||
808 | 459 | file.write('// ------------------------------------------' +\ | 427 | file.write('// ------------------------------------------' +\ |
809 | 460 | '-----------------------------------\n') | 428 | '-----------------------------------\n') |
810 | 461 | file.write('// BuildUserTable\n') | 429 | file.write('// BuildUserTable\n') |
811 | 462 | file.write('// ------------------------------------------' +\ | 430 | file.write('// ------------------------------------------' +\ |
812 | 463 | '-----------------------------------\n') | 431 | '-----------------------------------\n') |
814 | 464 | file.write('void AnalyzerManager::BuildUserTable()\n') | 432 | file.write('void BuildUserTable(MA5::AnalyzerManager& manager)\n') |
815 | 465 | file.write('{\n') | 433 | file.write('{\n') |
817 | 466 | file.write(' Add("MadAnalysis5job", new user);\n') | 434 | file.write(' using namespace MA5;\n') |
818 | 435 | file.write(' manager.Add("MadAnalysis5job", new user);\n') | ||
819 | 467 | file.write('}\n') | 436 | file.write('}\n') |
820 | 468 | file.close() | 437 | file.close() |
821 | 469 | self.WriteEmptyFilterSource(main) | ||
822 | 470 | return True | 438 | return True |
823 | 471 | 439 | ||
824 | 472 | def CreateShowerDir(self,mode): | 440 | def CreateShowerDir(self,mode): |
825 | @@ -505,18 +473,20 @@ | |||
826 | 505 | 473 | ||
827 | 506 | # Compilators | 474 | # Compilators |
828 | 507 | file.write('# Compilators\n') | 475 | file.write('# Compilators\n') |
830 | 508 | file.write('GCC = g++\n') | 476 | file.write('CXX = g++\n') |
831 | 509 | file.write('\n') | 477 | file.write('\n') |
832 | 510 | 478 | ||
833 | 511 | # Options for compilation | 479 | # Options for compilation |
834 | 512 | file.write('# Options for compilation\n') | 480 | file.write('# Options for compilation\n') |
835 | 513 | if self.libFastjet: | 481 | if self.libFastjet: |
836 | 514 | file.write('CXXFASTJET = $(shell fastjet-config --cxxflags --plugins)\n') | 482 | file.write('CXXFASTJET = $(shell fastjet-config --cxxflags --plugins)\n') |
838 | 515 | file.write('CXXFLAGS = -Wall -O3 -I./ -I./../ -I' + '$(MA5_BASE)/tools/') | 483 | file.write('CXXFLAGS = -Wall -O3 -fPIC -I./ -I./../ -I' + '$(MA5_BASE)/tools/') |
839 | 516 | if self.libZIP: | 484 | if self.libZIP: |
840 | 517 | file.write(' -DZIP_USE') | 485 | file.write(' -DZIP_USE') |
841 | 518 | if self.libDelphes: | 486 | if self.libDelphes: |
843 | 519 | file.write(' -DDELPHES_USE') | 487 | file.write(' -DROOT_USE -DDELPHES_USE') |
844 | 488 | if self.libDelfes: | ||
845 | 489 | file.write(' -DROOT_USE -DDELFES_USE') | ||
846 | 520 | if self.libFastjet: | 490 | if self.libFastjet: |
847 | 521 | file.write(' -DFASTJET_USE') | 491 | file.write(' -DFASTJET_USE') |
848 | 522 | file.write(' $(CXXFASTJET)') | 492 | file.write(' $(CXXFASTJET)') |
849 | @@ -530,16 +500,9 @@ | |||
850 | 530 | file.write('OBJS = $(SRCS:.cpp=.o)\n') | 500 | file.write('OBJS = $(SRCS:.cpp=.o)\n') |
851 | 531 | file.write('\n') | 501 | file.write('\n') |
852 | 532 | 502 | ||
853 | 533 | # Files for filters | ||
854 | 534 | file.write('# Files for filters\n') | ||
855 | 535 | file.write('SRCS2 = $(wildcard Filter/*.cpp)\n') | ||
856 | 536 | file.write('HDRS2 = $(wildcard Filter/*.h)\n') | ||
857 | 537 | file.write('OBJS2 = $(SRCS2:.cpp=.o)\n') | ||
858 | 538 | file.write('\n') | ||
859 | 539 | |||
860 | 540 | # Name of the library | 503 | # Name of the library |
861 | 541 | file.write('# Name of the library\n') | 504 | file.write('# Name of the library\n') |
863 | 542 | file.write('PROGRAM = SampleAnalyzerBld\n') | 505 | file.write('PROGRAM = UserPackage_for_ma5\n') |
864 | 543 | file.write('\n') | 506 | file.write('\n') |
865 | 544 | 507 | ||
866 | 545 | # All | 508 | # All |
867 | @@ -549,21 +512,19 @@ | |||
868 | 549 | 512 | ||
869 | 550 | # Compilation | 513 | # Compilation |
870 | 551 | file.write('# Compile target\n') | 514 | file.write('# Compile target\n') |
872 | 552 | file.write('compile: $(OBJS) $(OBJS2)\n') | 515 | file.write('compile: $(OBJS)\n') |
873 | 553 | file.write('\n') | 516 | file.write('\n') |
874 | 554 | file.write('# Object file target\n') | 517 | file.write('# Object file target\n') |
875 | 555 | file.write('$(OBJS): $(HDRS)\n') | 518 | file.write('$(OBJS): $(HDRS)\n') |
876 | 556 | file.write('$(OBJS2): $(HDRS2)\n') | ||
877 | 557 | file.write('\n') | 519 | file.write('\n') |
878 | 558 | 520 | ||
879 | 559 | # Linking | 521 | # Linking |
880 | 560 | file.write('# Link target\n') | 522 | file.write('# Link target\n') |
887 | 561 | file.write('link: $(OBJS) $(OBJS2)\n') | 523 | file.write('link: $(OBJS)\n') |
888 | 562 | file.write('\tcp ' +\ | 524 | if self.main.isMAC: |
889 | 563 | '$(MA5_BASE)/tools/SampleAnalyzer/Lib/libSampleAnalyzer.a ' +\ | 525 | file.write('\t$(CXX) -shared -flat_namespace -dynamiclib -undefined suppress -o ../../Build/Lib/lib$(PROGRAM).so $(OBJS)\n') |
890 | 564 | '../../Build/Lib/lib$(PROGRAM).a\n') | 526 | else: |
891 | 565 | file.write('\tar -ruc ../../Build/Lib/lib$(PROGRAM).a $(OBJS) $(OBJS2)\n') | 527 | file.write('\t$(CXX) -shared -o ../../Build/Lib/lib$(PROGRAM).so $(OBJS)\n') |
886 | 566 | file.write('\tranlib ../../Build/Lib/lib$(PROGRAM).a\n') | ||
892 | 567 | file.write('\n') | 528 | file.write('\n') |
893 | 568 | 529 | ||
894 | 569 | # Phony target | 530 | # Phony target |
895 | @@ -577,7 +538,7 @@ | |||
896 | 577 | file.write('\n') | 538 | file.write('\n') |
897 | 578 | file.write('# Do clean target\n') | 539 | file.write('# Do clean target\n') |
898 | 579 | file.write('do_clean:\n') | 540 | file.write('do_clean:\n') |
900 | 580 | file.write('\t@rm -f $(OBJS) $(OBJS2)\n') | 541 | file.write('\t@rm -f $(OBJS)\n') |
901 | 581 | file.write('\n') | 542 | file.write('\n') |
902 | 582 | 543 | ||
903 | 583 | # Mr Proper | 544 | # Mr Proper |
904 | @@ -586,7 +547,7 @@ | |||
905 | 586 | file.write('\n') | 547 | file.write('\n') |
906 | 587 | file.write('# Do clean target\n') | 548 | file.write('# Do clean target\n') |
907 | 588 | file.write('do_mrproper: do_clean\n') | 549 | file.write('do_mrproper: do_clean\n') |
909 | 589 | file.write('\t@rm -f ../../Build/Lib/lib$(PROGRAM).a\n') | 550 | file.write('\t@rm -f ../../Build/Lib/lib$(PROGRAM).so\n') |
910 | 590 | file.write('\t@rm -f *~ */*~ \n') | 551 | file.write('\t@rm -f *~ */*~ \n') |
911 | 591 | file.write('\n') | 552 | file.write('\n') |
912 | 592 | 553 | ||
913 | @@ -615,9 +576,9 @@ | |||
914 | 615 | def WriteMakefiles(self,option=""): | 576 | def WriteMakefiles(self,option=""): |
915 | 616 | 577 | ||
916 | 617 | # Writing sub-Makefiles | 578 | # Writing sub-Makefiles |
920 | 618 | self.WriteSampleAnalyzerMakefile(option) | 579 | #self.WriteSampleAnalyzerMakefile(option) |
921 | 619 | if self.shwrmode!='': | 580 | #if self.shwrmode!='': |
922 | 620 | self.WriteShoweringMakefile(option) | 581 | # self.WriteShoweringMakefile(option) |
923 | 621 | 582 | ||
924 | 622 | # Opening the main Makefile | 583 | # Opening the main Makefile |
925 | 623 | file = open(self.path+"/Build/Makefile","w") | 584 | file = open(self.path+"/Build/Makefile","w") |
926 | @@ -630,61 +591,79 @@ | |||
927 | 630 | 591 | ||
928 | 631 | # Compilators | 592 | # Compilators |
929 | 632 | file.write('# Compilators\n') | 593 | file.write('# Compilators\n') |
931 | 633 | file.write('GCC = g++\n') | 594 | file.write('CXX = g++\n') |
932 | 634 | file.write('\n') | 595 | file.write('\n') |
933 | 635 | 596 | ||
935 | 636 | # Options for compilation | 597 | # Options for compilation : CXXFLAGS |
936 | 637 | file.write('# Options for compilation\n') | 598 | file.write('# Options for compilation\n') |
945 | 638 | if self.libFastjet: | 599 | options = [] |
946 | 639 | file.write('CXXFASTJET = $(shell fastjet-config --cxxflags --plugins)\n') | 600 | options.extend(['-Wall','-O3','-I./','-I./SampleAnalyzer/','-I$(MA5_BASE)/tools/','-I'+self.main.configLinux.root_inc_path]) |
939 | 640 | |||
940 | 641 | file.write('FASTJETLIB = $(shell fastjet-config --libs --plugins)\n') | ||
941 | 642 | file.write('CXXFLAGS = -Wall -O3 -I./ -I$(MA5_BASE)/tools/') | ||
942 | 643 | if self.shwrmode!='': | ||
943 | 644 | file.write(' -I$(MA5_BASE)' + \ | ||
944 | 645 | '/tools/MCatNLO-utilities/MCatNLO/include') | ||
947 | 646 | if self.libZIP: | 601 | if self.libZIP: |
949 | 647 | file.write(' -DZIP_USE') | 602 | options.extend(['-DZIP_USE']) |
950 | 648 | if self.libDelphes: | 603 | if self.libDelphes: |
952 | 649 | file.write(' -DDELPHES_USE') | 604 | options.extend(['-DROOT_USE','-DDELPHES_USE']) |
953 | 605 | if self.libDelfes: | ||
954 | 606 | options.extend(['-DROOT_USE','-DDELFES_USE']) | ||
955 | 650 | if self.libFastjet: | 607 | if self.libFastjet: |
958 | 651 | file.write(' -DFASTJET_USE') | 608 | options.extend(['-DROOT_USE','-DFASTJET_USE'])#,'$(shell fastjet-config --cxxflags --plugins)']) |
959 | 652 | file.write(' $(CXXFASTJET)') | 609 | file.write('CXXFLAGS = '+' '.join(options)) |
960 | 653 | file.write('\n') | 610 | file.write('\n') |
966 | 654 | file.write('LIBFLAGS = -LLib -lSampleAnalyzerBld -lGpad -lHist ' + | 611 | |
967 | 655 | '-lGraf -lGraf3d ' +\ | 612 | # Options for compilation : LIBFLAGS |
968 | 656 | '-lTree -lRint -lPostscript -lMatrix -lPhysics -lMathCore -lEG ' +\ | 613 | |
969 | 657 | '-lRIO -lNet -lThread -lCore -lCint -pthread -lm -ldl '+\ | 614 | # - Root |
970 | 658 | '-rdynamic') | 615 | libs=[] |
971 | 616 | libs.extend(['-L'+self.main.configLinux.root_lib_path, \ | ||
972 | 617 | '-lGpad','-lHist','-lGraf','-lGraf3d','-lTree', \ | ||
973 | 618 | '-lRint','-lPostscript','-lMatrix','-lPhysics', \ | ||
974 | 619 | '-lMathCore','-lEG', '-lRIO','-lNet','-lThread', \ | ||
975 | 620 | '-lCore','-lCint','-pthread','-lm','-ldl','-rdynamic']) | ||
976 | 621 | |||
977 | 622 | # - SampleAnalyzer | ||
978 | 623 | libs.extend(['-L$(MA5_BASE)/tools/SampleAnalyzer/Lib/','-lSampleAnalyzer']) | ||
979 | 659 | if self.libZIP: | 624 | if self.libZIP: |
981 | 660 | file.write(' -lz') | 625 | libs.extend(['-L'+self.main.configLinux.zlib_lib_path,'-lz','-lzlib_for_ma5']) |
982 | 661 | if self.libDelphes: | 626 | if self.libDelphes: |
984 | 662 | file.write(' -lDelphes') | 627 | libs.extend(['-L'+self.main.configLinux.delphes_lib_paths[0],'-lDelphes','-ldelphes_for_ma5']) |
985 | 628 | if self.libDelfes: | ||
986 | 629 | libs.extend(['-L'+self.main.configLinux.delfes_lib_paths[0],'-lDelphes','-ldelfes_for_ma5']) | ||
987 | 663 | if self.fortran: | 630 | if self.fortran: |
1012 | 664 | file.write(' -lgfortran') | 631 | libs.extend(['-lgfortran']) |
1013 | 665 | if self.libFastjet: | 632 | if self.libFastjet: |
1014 | 666 | file.write(' $(FASTJETLIB)') | 633 | libs.extend(['$(shell fastjet-config --libs --plugins --rpath=no)','-lfastjet_for_ma5']) |
1015 | 667 | if self.shwrmode!='': | 634 | file.write('LIBFLAGS = '+' '.join(libs)+'\n') |
1016 | 668 | file.write(' -lShowering -lstdhep -lFmcfio') | 635 | file.write('\n') |
1017 | 669 | file.write('\n\n') | 636 | |
1018 | 670 | 637 | # Files to process | |
1019 | 671 | # Files | 638 | file.write('# Files to process\n') |
1020 | 672 | file.write('# Files\n') | 639 | file.write('SRCS = $(wildcard Main/*.cpp)\n') |
1021 | 673 | file.write('SRCS = $(wildcard Main/*.cpp)\n') | 640 | file.write('SRCS += $(wildcard SampleAnalyzer/Analyzer/*.cpp)\n') |
1022 | 674 | file.write('HDRS = $(wildcard Main/*.h)\n') | 641 | file.write('HDRS = $(wildcard Main/*.h)\n') |
1023 | 675 | file.write('OBJS = $(SRCS:.cpp=.o)\n') | 642 | file.write('HDRS += $(wildcard SampleAnalyzer/Analyzer/*.h)\n') |
1024 | 676 | file.write('LIBS = Lib/libSampleAnalyzerBld.a') | 643 | file.write('\n') |
1025 | 677 | if self.shwrmode!='': | 644 | |
1026 | 678 | file.write(' Lib/libShowering.a') | 645 | # Files to generate |
1027 | 679 | file.write('\n') | 646 | file.write('# Files to generate\n') |
1028 | 680 | file.write('PRES = $(MA5_BASE)/tools/' +\ | 647 | file.write('OBJS = $(SRCS:.cpp=.o)\n') |
1029 | 681 | 'SampleAnalyzer/Lib/libSampleAnalyzer.a') | 648 | file.write('PROGRAM = MadAnalysis5job\n') |
1030 | 682 | file.write('\n') | 649 | file.write('\n') |
1031 | 683 | 650 | ||
1032 | 684 | # Name of the executable | 651 | # Lib to check |
1033 | 685 | file.write('#Name of the executable\n') | 652 | file.write('# Requirements to check before building\n') |
1034 | 686 | file.write('PROGRAM = MadAnalysis5Job\n') | 653 | libs=[] |
1035 | 687 | file.write('\n') | 654 | libs.append('$(MA5_BASE)/tools/SampleAnalyzer/Lib/libSampleAnalyzer.so') |
1036 | 655 | if self.libZIP: | ||
1037 | 656 | libs.append('$(MA5_BASE)/tools/SampleAnalyzer/Lib/libzlib_for_ma5.so') | ||
1038 | 657 | if self.libDelphes: | ||
1039 | 658 | libs.append('$(MA5_BASE)/tools/SampleAnalyzer/Lib/libdelphes_for_ma5.so') | ||
1040 | 659 | if self.libDelfes: | ||
1041 | 660 | libs.append('$(MA5_BASE)/tools/SampleAnalyzer/Lib/libdelfes_for_ma5.so') | ||
1042 | 661 | if self.libFastjet: | ||
1043 | 662 | libs.append('$(MA5_BASE)/tools/SampleAnalyzer/Lib/libfastjet_for_ma5.so') | ||
1044 | 663 | for ind in range(0,len(libs)): | ||
1045 | 664 | file.write('REQUIRED'+str(ind+1)+' = '+libs[ind]+'\n') | ||
1046 | 665 | file.write('\n') | ||
1047 | 666 | |||
1048 | 688 | 667 | ||
1049 | 689 | # Defining colours for shell | 668 | # Defining colours for shell |
1050 | 690 | file.write('# Defining colours\n') | 669 | file.write('# Defining colours\n') |
1051 | @@ -703,16 +682,18 @@ | |||
1052 | 703 | file.write('\n') | 682 | file.write('\n') |
1053 | 704 | 683 | ||
1054 | 705 | # Check library | 684 | # Check library |
1065 | 706 | file.write('# Check library\n') | 685 | if len(libs)!=0: |
1066 | 707 | file.write('library_check:\n') | 686 | file.write('# Check library\n') |
1067 | 708 | file.write('ifeq ($(wildcard $(PRES)),)\n') | 687 | file.write('library_check:\n') |
1068 | 709 | file.write('\t@echo -e $(RED)"The static library "$(PRES)" is not found"\n') | 688 | for ind in range(0,len(libs)): |
1069 | 710 | file.write('\t@echo -e $(RED)" 1) Please check that MadAnalysis 5 is installed in the folder : "$(MA5_BASE)\n') | 689 | file.write('ifeq ($(wildcard $(REQUIRED'+str(ind+1)+')),)\n') |
1070 | 711 | file.write('\t@echo -e $(RED)" 2) Launch MadAnalysis 5 in normal mode in order to build this library."\n') | 690 | file.write('\t@echo -e $(RED)"The shared library "$(REQUIRED'+str(ind+1)+')" is not found"\n') |
1071 | 712 | file.write('\t@echo -e $(NORMAL)\n') | 691 | file.write('\t@echo -e $(RED)" 1) Please check that MadAnalysis 5 is installed in the folder : "$(MA5_BASE)\n') |
1072 | 713 | file.write('\t@false\n') | 692 | file.write('\t@echo -e $(RED)" 2) Launch MadAnalysis 5 in normal mode in order to build this library."\n') |
1073 | 714 | file.write('endif\n') | 693 | file.write('\t@echo -e $(NORMAL)\n') |
1074 | 715 | file.write('\n') | 694 | file.write('\t@false\n') |
1075 | 695 | file.write('endif\n') | ||
1076 | 696 | file.write('\n') | ||
1077 | 716 | 697 | ||
1078 | 717 | # Header target | 698 | # Header target |
1079 | 718 | file.write('# Header target\n') | 699 | file.write('# Header target\n') |
1080 | @@ -756,7 +737,7 @@ | |||
1081 | 756 | 737 | ||
1082 | 757 | # Compile target | 738 | # Compile target |
1083 | 758 | file.write('# Compile target\n') | 739 | file.write('# Compile target\n') |
1085 | 759 | file.write('compile: $(LIBS) $(OBJS)\n') | 740 | file.write('compile: $(OBJS)\n') |
1086 | 760 | file.write('\n') | 741 | file.write('\n') |
1087 | 761 | 742 | ||
1088 | 762 | # Object file target | 743 | # Object file target |
1089 | @@ -766,34 +747,18 @@ | |||
1090 | 766 | 747 | ||
1091 | 767 | # Link target | 748 | # Link target |
1092 | 768 | file.write('# Link target\n') | 749 | file.write('# Link target\n') |
1095 | 769 | file.write('link: $(OBJS) $(LIBS)\n') | 750 | file.write('link: $(OBJS)\n') |
1096 | 770 | file.write('\t$(GCC) $(CXXFLAGS) $(OBJS) ') | 751 | file.write('\t$(CXX) $(CXXFLAGS) $(OBJS) ') |
1097 | 771 | file.write('$(LIBFLAGS) -o $(PROGRAM)\n') | 752 | file.write('$(LIBFLAGS) -o $(PROGRAM)\n') |
1098 | 772 | file.write('\n') | 753 | file.write('\n') |
1099 | 773 | 754 | ||
1100 | 774 | # Library to build | ||
1101 | 775 | file.write('# SampleAnalyzer library target\n') | ||
1102 | 776 | file.write('$(LIBS):\n') | ||
1103 | 777 | file.write('\t@(cd SampleAnalyzer/ && $(MAKE))\n') | ||
1104 | 778 | file.write('\n') | ||
1105 | 779 | |||
1106 | 780 | # Library to build | ||
1107 | 781 | if self.shwrmode!='': | ||
1108 | 782 | file.write('# Showering library target\n') | ||
1109 | 783 | file.write('Lib/libShowering.a:\n') | ||
1110 | 784 | file.write('\t@(cd Showering/ && $(MAKE))\n') | ||
1111 | 785 | file.write('\n') | ||
1112 | 786 | |||
1113 | 787 | # Clean target | 755 | # Clean target |
1114 | 788 | file.write('# Clean target\n') | 756 | file.write('# Clean target\n') |
1115 | 789 | file.write('clean: clean_header do_clean\n') | 757 | file.write('clean: clean_header do_clean\n') |
1116 | 790 | file.write('\n') | 758 | file.write('\n') |
1117 | 791 | file.write('# Do clean target\n') | 759 | file.write('# Do clean target\n') |
1118 | 792 | file.write('do_clean: \n') | 760 | file.write('do_clean: \n') |
1123 | 793 | file.write('\t@(cd SampleAnalyzer/ && $(MAKE) $@)\n') | 761 | file.write('\t@rm -f $(OBJS)\n') |
1120 | 794 | if self.shwrmode!='': | ||
1121 | 795 | file.write('\t@(cd Showering/ && $(MAKE) $@)\n') | ||
1122 | 796 | file.write('\t@rm -f $(OBJS) $(LIBS)\n') | ||
1124 | 797 | file.write('\n') | 762 | file.write('\n') |
1125 | 798 | 763 | ||
1126 | 799 | # Mr Proper target | 764 | # Mr Proper target |
1127 | @@ -802,24 +767,21 @@ | |||
1128 | 802 | file.write('\n') | 767 | file.write('\n') |
1129 | 803 | file.write('# Do Mr Proper target \n') | 768 | file.write('# Do Mr Proper target \n') |
1130 | 804 | file.write('do_mrproper: do_clean\n') | 769 | file.write('do_mrproper: do_clean\n') |
1131 | 805 | file.write('\t@(cd SampleAnalyzer/ && $(MAKE) $@)\n') | ||
1132 | 806 | if self.shwrmode!='': | ||
1133 | 807 | file.write('\t@(cd Showering/ && $(MAKE) $@)\n') | ||
1134 | 808 | file.write('\t@rm -f $(PROGRAM) Log/compilation.log' + \ | 770 | file.write('\t@rm -f $(PROGRAM) Log/compilation.log' + \ |
1136 | 809 | ' linking.log *~ */*~ \n') | 771 | ' Log/linking.log Log/cleanup.log Log/mrproper.log *~ */*~ */*~ \n') |
1137 | 810 | file.write('\n') | 772 | file.write('\n') |
1138 | 811 | 773 | ||
1139 | 812 | # Phony target | 774 | # Phony target |
1140 | 813 | file.write('# Phony target\n') | 775 | file.write('# Phony target\n') |
1142 | 814 | file.write('.PHONY: do_clean header link_header compile_header $(LIBS)\n') | 776 | file.write('.PHONY: do_clean header link_header compile_header\n') |
1143 | 815 | file.write('\n') | 777 | file.write('\n') |
1144 | 816 | 778 | ||
1145 | 817 | # Closing the file | 779 | # Closing the file |
1146 | 818 | file.close() | 780 | file.close() |
1147 | 819 | 781 | ||
1149 | 820 | if not JobWriter.WriteSetupFile(True,self.path+'/Build/',self.ma5dir): | 782 | if not JobWriter.WriteSetupFile(True,self.path+'/Build/',self.ma5dir,True,self.main.configLinux,self.main.isMAC): |
1150 | 821 | return False | 783 | return False |
1152 | 822 | if not JobWriter.WriteSetupFile(False,self.path+'/Build/',self.ma5dir): | 784 | if not JobWriter.WriteSetupFile(False,self.path+'/Build/',self.ma5dir,True,self.main.configLinux,self.main.isMAC): |
1153 | 823 | return False | 785 | return False |
1154 | 824 | 786 | ||
1155 | 825 | return True | 787 | return True |
1156 | @@ -855,7 +817,10 @@ | |||
1157 | 855 | 817 | ||
1158 | 856 | 818 | ||
1159 | 857 | @staticmethod | 819 | @staticmethod |
1161 | 858 | def WriteSetupFile(bash,path,ma5dir,MA5BASE=True): | 820 | def WriteSetupFile(bash,path,ma5dir,MA5BASE,configLinux,isMAC): |
1162 | 821 | |||
1163 | 822 | # Variable to check at the end | ||
1164 | 823 | toCheck=[] | ||
1165 | 859 | 824 | ||
1166 | 860 | # Opening file in write-only mode | 825 | # Opening file in write-only mode |
1167 | 861 | if bash: | 826 | if bash: |
1168 | @@ -904,59 +869,101 @@ | |||
1169 | 904 | if bash: | 869 | if bash: |
1170 | 905 | file.write('export MA5_BASE=' + JobWriter.CleanPath(ma5dir)+'\n') | 870 | file.write('export MA5_BASE=' + JobWriter.CleanPath(ma5dir)+'\n') |
1171 | 906 | else: | 871 | else: |
1173 | 907 | file.write('setenv MA5_BASE=' + JobWriter.CleanPath(ma5dir)+'\n') | 872 | file.write('setenv MA5_BASE ' + JobWriter.CleanPath(ma5dir)+'\n') |
1174 | 873 | toCheck.append('MA5_BASE') | ||
1175 | 908 | file.write('\n') | 874 | file.write('\n') |
1176 | 909 | 875 | ||
1177 | 910 | # Configuring PATH environment variable | 876 | # Configuring PATH environment variable |
1216 | 911 | file.write('# Configuring PATH environment variable\n') | 877 | if len(configLinux.toPATH)!=0: |
1217 | 912 | if bash: | 878 | file.write('# Configuring PATH environment variable\n') |
1218 | 913 | file.write('export PATH=' + JobWriter.CleanPath(os.environ['PATH'])+'\n') | 879 | if bash: |
1219 | 914 | else: | 880 | file.write('if [ $PATH ]; then\n') |
1220 | 915 | file.write('setenv PATH ' + JobWriter.CleanPath(os.environ['PATH'])+'\n') | 881 | file.write('export PATH=$PATH:' + JobWriter.CleanPath(':'.join(configLinux.toPATH))+'\n') |
1221 | 916 | file.write('\n') | 882 | file.write('else\n') |
1222 | 917 | 883 | file.write('export PATH=' + JobWriter.CleanPath(':'.join(configLinux.toPATH))+'\n') | |
1223 | 918 | # Configuring LD_LIBRARY_PATH environment variable | 884 | file.write('fi\n') |
1224 | 919 | file.write('# Configuring LD_LIBRARY_PATH environment variable\n') | 885 | else: |
1225 | 920 | if bash: | 886 | file.write('if ( $?PATH ) then\n') |
1226 | 921 | file.write('export LD_LIBRARY_PATH=' + JobWriter.CleanPath(os.environ['LD_LIBRARY_PATH'])+'\n') | 887 | file.write('setenv PATH "$PATH":' + JobWriter.CleanPath(':'.join(configLinux.toPATH))+'\n') |
1227 | 922 | else: | 888 | file.write('else\n') |
1228 | 923 | file.write('setenv LD_LIBRARY_PATH ' + JobWriter.CleanPath(os.environ['LD_LIBRARY_PATH'])+'\n') | 889 | file.write('setenv PATH ' + JobWriter.CleanPath(':'.join(configLinux.toPATH))+'\n') |
1229 | 924 | file.write('\n') | 890 | file.write('endif\n') |
1230 | 925 | 891 | toCheck.append('PATH') | |
1231 | 926 | # Configuring LIBRARY_PATH environment variable | 892 | file.write('\n') |
1232 | 927 | file.write('# Configuring LIBRARY_PATH environment variable\n') | 893 | |
1233 | 928 | if bash: | 894 | if len(configLinux.toLDPATH)!=0: |
1234 | 929 | file.write('export LIBRARY_PATH=' + JobWriter.CleanPath(os.environ['LD_LIBRARY_PATH'])+'\n') | 895 | |
1235 | 930 | else: | 896 | # Configuring LD_LIBRARY_PATH environment variable |
1236 | 931 | file.write('setenv LIBRARY_PATH ' + JobWriter.CleanPath(os.environ['LD_LIBRARY_PATH'])+'\n') | 897 | file.write('# Configuring LD_LIBRARY_PATH environment variable\n') |
1237 | 932 | file.write('\n') | 898 | if bash: |
1238 | 933 | 899 | file.write('if [ $LD_LIBRARY_PATH ]; then\n') | |
1239 | 934 | # Configuring DYLD_LIBRARY_PATH environment variable | 900 | file.write('export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:' + JobWriter.CleanPath(':'.join(configLinux.toLDPATH))+'\n') |
1240 | 935 | file.write('# Configuring DYLD_LIBRARY_PATH environment variable\n') | 901 | file.write('else\n') |
1241 | 936 | if bash: | 902 | file.write('export LD_LIBRARY_PATH=' + JobWriter.CleanPath(':'.join(configLinux.toLDPATH))+'\n') |
1242 | 937 | file.write('export DYLD_LIBRARY_PATH=' + JobWriter.CleanPath(os.environ['DYLD_LIBRARY_PATH'])+'\n') | 903 | file.write('fi\n') |
1243 | 938 | else: | 904 | else: |
1244 | 939 | file.write('setenv DYLD_LIBRARY_PATH ' + JobWriter.CleanPath(os.environ['DYLD_LIBRARY_PATH'])+'\n') | 905 | file.write('if ( $?LD_LIBRARY_PATH ) then\n') |
1245 | 940 | file.write('\n') | 906 | file.write('setenv LD_LIBRARY_PATH "$LD_LIBRARY_PATH":' + JobWriter.CleanPath(':'.join(configLinux.toLDPATH))+'\n') |
1246 | 941 | 907 | file.write('else\n') | |
1247 | 942 | # Configuring CPLUS_INCLUDE_PATH environment variable | 908 | file.write('setenv LD_LIBRARY_PATH ' + JobWriter.CleanPath(':'.join(configLinux.toLDPATH))+'\n') |
1248 | 943 | file.write('# Configuring CPLUS_INCLUDE_PATH environment variable\n') | 909 | file.write('endif\n') |
1249 | 944 | if bash: | 910 | toCheck.append('LD_LIBRARY_PATH') |
1250 | 945 | file.write('export CPLUS_INCLUDE_PATH=' + JobWriter.CleanPath(os.environ['CPLUS_INCLUDE_PATH'])+'\n') | 911 | file.write('\n') |
1251 | 946 | else: | 912 | |
1252 | 947 | file.write('setenv CPLUS_INCLUDE_PATH ' + JobWriter.CleanPath(os.environ['CPLUS_INCLUDE_PATH'])+'\n') | 913 | # Configuring LIBRARY_PATH environment variable |
1253 | 948 | file.write('\n') | 914 | #file.write('# Configuring LIBRARY_PATH environment variable\n') |
1254 | 915 | #if bash: | ||
1255 | 916 | # file.write('export LIBRARY_PATH=' + JobWriter.CleanPath(os.environ['LD_LIBRARY_PATH'])+'\n') | ||
1256 | 917 | #else: | ||
1257 | 918 | # file.write('setenv LIBRARY_PATH ' + JobWriter.CleanPath(os.environ['LD_LIBRARY_PATH'])+'\n') | ||
1258 | 919 | #file.write('\n') | ||
1259 | 920 | |||
1260 | 921 | # Configuring DYLD_LIBRARY_PATH environment variable | ||
1261 | 922 | if isMAC: | ||
1262 | 923 | file.write('# Configuring DYLD_LIBRARY_PATH environment variable\n') | ||
1263 | 924 | if bash: | ||
1264 | 925 | file.write('if [ $DYLD_LIBRARY_PATH ]; then\n') | ||
1265 | 926 | file.write('export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:' + JobWriter.CleanPath(':'.join(configLinux.toLDPATH))+'\n') | ||
1266 | 927 | file.write('else\n') | ||
1267 | 928 | file.write('export DYLD_LIBRARY_PATH=' + JobWriter.CleanPath(':'.join(configLinux.toLDPATH))+'\n') | ||
1268 | 929 | file.write('fi\n') | ||
1269 | 930 | else: | ||
1270 | 931 | file.write('if ( $?DYLD_LIBRARY_PATH ) then\n') | ||
1271 | 932 | file.write('setenv DYLD_LIBRARY_PATH "$DYLD_LIBRARY_PATH":' + JobWriter.CleanPath(':'.join(configLinux.toLDPATH))+'\n') | ||
1272 | 933 | file.write('else\n') | ||
1273 | 934 | file.write('setenv DYLD_LIBRARY_PATH ' + JobWriter.CleanPath(':'.join(configLinux.toLDPATH))+'\n') | ||
1274 | 935 | file.write('endif\n') | ||
1275 | 936 | toCheck.append('DYLD_LIBRARY_PATH') | ||
1276 | 937 | file.write('\n') | ||
1277 | 938 | |||
1278 | 939 | # Configuring CPLUS_INCLUDE_PATH environment variable | ||
1279 | 940 | #file.write('# Configuring CPLUS_INCLUDE_PATH environment variable\n') | ||
1280 | 941 | #if bash: | ||
1281 | 942 | # file.write('export CPLUS_INCLUDE_PATH=' + JobWriter.CleanPath(os.environ['CPLUS_INCLUDE_PATH'])+'\n') | ||
1282 | 943 | #else: | ||
1283 | 944 | # file.write('setenv CPLUS_INCLUDE_PATH ' + JobWriter.CleanPath(os.environ['CPLUS_INCLUDE_PATH'])+'\n') | ||
1284 | 945 | #file.write('\n') | ||
1285 | 949 | 946 | ||
1286 | 950 | # Checking that all environment variables are defined | 947 | # Checking that all environment variables are defined |
1287 | 951 | file.write('# Checking that all environment variables are defined\n') | 948 | file.write('# Checking that all environment variables are defined\n') |
1288 | 952 | if bash: | 949 | if bash: |
1290 | 953 | file.write('if [[ $PATH && $LD_LIBRARY_PATH && $LIBRARY_PATH && $DYLD_LIBRARY_PATH && $CPLUS_INCLUDE_PATH ]]; then\n') | 950 | file.write('if [[ ') |
1291 | 951 | for ind in range(0,len(toCheck)): | ||
1292 | 952 | if ind!=0: | ||
1293 | 953 | file.write(' && ') | ||
1294 | 954 | file.write('$'+toCheck[ind]) | ||
1295 | 955 | file.write(' ]]; then\n') | ||
1296 | 954 | file.write('echo -e $YELLOW"'+StringTools.Fill('-',56)+'"\n') | 956 | file.write('echo -e $YELLOW"'+StringTools.Fill('-',56)+'"\n') |
1297 | 955 | file.write('echo -e "'+StringTools.Center('Your environment is properly configured for MA5',56)+'"\n') | 957 | file.write('echo -e "'+StringTools.Center('Your environment is properly configured for MA5',56)+'"\n') |
1298 | 956 | file.write('echo -e "'+StringTools.Fill('-',56)+'"$NORMAL\n') | 958 | file.write('echo -e "'+StringTools.Fill('-',56)+'"$NORMAL\n') |
1299 | 957 | file.write('fi\n') | 959 | file.write('fi\n') |
1300 | 958 | else: | 960 | else: |
1302 | 959 | file.write('if ( $?PATH && $?LD_LIBRARY_PATH && $?LIBRARY_PATH && $?DYLD_LIBRARY_PATH && $?CPLUS_INCLUDE_PATH) then\n') | 961 | file.write('if ( \n') |
1303 | 962 | for ind in range(0,len(toCheck)): | ||
1304 | 963 | if ind!=0: | ||
1305 | 964 | file.write(' && ') | ||
1306 | 965 | file.write('$?'+toCheck[ind]) | ||
1307 | 966 | file.write(' ) then\n') | ||
1308 | 960 | file.write('echo $YELLOW"'+StringTools.Fill('-',56)+'"\n') | 967 | file.write('echo $YELLOW"'+StringTools.Fill('-',56)+'"\n') |
1309 | 961 | file.write('echo "'+StringTools.Center('Your environment is properly configured for MA5',56)+'"\n') | 968 | file.write('echo "'+StringTools.Center('Your environment is properly configured for MA5',56)+'"\n') |
1310 | 962 | file.write('echo "'+StringTools.Fill('-',56)+'"$NORMAL\n') | 969 | file.write('echo "'+StringTools.Fill('-',56)+'"$NORMAL\n') |
1311 | @@ -972,33 +979,94 @@ | |||
1312 | 972 | 979 | ||
1313 | 973 | return True | 980 | return True |
1314 | 974 | 981 | ||
1315 | 982 | |||
1316 | 975 | def CompileJob(self): | 983 | def CompileJob(self): |
1332 | 976 | if self.resubmit: | 984 | |
1333 | 977 | res=commands.getstatusoutput("cd "\ | 985 | # folder |
1334 | 978 | +self.path+"/Build/;"\ | 986 | folder = self.path+'/Build' |
1335 | 979 | +" make mrproper") | 987 | |
1336 | 980 | 988 | # log file name | |
1337 | 981 | res=commands.getstatusoutput("cd "\ | 989 | logfile = folder+'/Log/compilation.log' |
1338 | 982 | +self.path+"/Build/;"\ | 990 | |
1339 | 983 | +" make compile > Log/compilation.log 2>&1") | 991 | # shell command |
1340 | 984 | if res[0]==0: | 992 | commands = ['make','compile'] |
1341 | 985 | return True | 993 | |
1342 | 986 | else: | 994 | # call |
1343 | 987 | logging.error("errors occured during compilation. " +\ | 995 | result, out = ShellCommand.ExecuteWithLog(commands,logfile,folder) |
1344 | 988 | "For more details, see the file :") | 996 | |
1345 | 989 | logging.error(" "+self.path+"/Build/Log/compilation.log") | 997 | # return result |
1346 | 990 | return False | 998 | if not result: |
1347 | 999 | logging.error('impossible to compile the project. For more details, see the log file:') | ||
1348 | 1000 | logging.error(logfile) | ||
1349 | 1001 | |||
1350 | 1002 | return result | ||
1351 | 1003 | |||
1352 | 1004 | |||
1353 | 1005 | def MrproperJob(self): | ||
1354 | 1006 | |||
1355 | 1007 | # folder | ||
1356 | 1008 | folder = self.path+'/Build' | ||
1357 | 1009 | |||
1358 | 1010 | # log file name | ||
1359 | 1011 | logfile = folder+'/Log/mrproper.log' | ||
1360 | 1012 | |||
1361 | 1013 | # shell command | ||
1362 | 1014 | commands = ['make','mrproper'] | ||
1363 | 1015 | |||
1364 | 1016 | # call | ||
1365 | 1017 | result, out = ShellCommand.ExecuteWithLog(commands,logfile,folder) | ||
1366 | 1018 | |||
1367 | 1019 | # return result | ||
1368 | 1020 | if not result: | ||
1369 | 1021 | logging.error('impossible to clean the project. For more details, see the log file:') | ||
1370 | 1022 | logging.error(logfile) | ||
1371 | 1023 | |||
1372 | 1024 | return result | ||
1373 | 1025 | |||
1374 | 1026 | |||
1375 | 1027 | def MrproperJob(self): | ||
1376 | 1028 | |||
1377 | 1029 | # folder | ||
1378 | 1030 | folder = self.path+'/Build' | ||
1379 | 1031 | |||
1380 | 1032 | # log file name | ||
1381 | 1033 | logfile = folder+'/Log/mrproper.log' | ||
1382 | 1034 | |||
1383 | 1035 | # shell command | ||
1384 | 1036 | commands = ['make','mrproper'] | ||
1385 | 1037 | |||
1386 | 1038 | # call | ||
1387 | 1039 | result, out = ShellCommand.ExecuteWithLog(commands,logfile,folder) | ||
1388 | 1040 | |||
1389 | 1041 | # return result | ||
1390 | 1042 | if not result: | ||
1391 | 1043 | logging.error('impossible to clean the project. For more details, see the log file:') | ||
1392 | 1044 | logging.error(logfile) | ||
1393 | 1045 | |||
1394 | 1046 | return result | ||
1395 | 1047 | |||
1396 | 991 | 1048 | ||
1397 | 992 | def LinkJob(self): | 1049 | def LinkJob(self): |
1407 | 993 | res=commands.getstatusoutput("cd "\ | 1050 | |
1408 | 994 | +self.path+"/Build/;"\ | 1051 | # folder |
1409 | 995 | +" make link > Log/linking.log 2>&1") | 1052 | folder = self.path+'/Build' |
1410 | 996 | if res[0]==0: | 1053 | |
1411 | 997 | return True | 1054 | # log file name |
1412 | 998 | else: | 1055 | logfile = folder+'/Log/linking.log' |
1413 | 999 | logging.error("errors occured during compilation. For more details, see the file :") | 1056 | |
1414 | 1000 | logging.error(" "+self.path+"/Build/Log/linking.log") | 1057 | # shell command |
1415 | 1001 | return False | 1058 | commands = ['make','link'] |
1416 | 1059 | |||
1417 | 1060 | # call | ||
1418 | 1061 | result, out = ShellCommand.ExecuteWithLog(commands,logfile,folder) | ||
1419 | 1062 | |||
1420 | 1063 | # return result | ||
1421 | 1064 | if not result: | ||
1422 | 1065 | logging.error('impossible to link the project. For more details, see the log file:') | ||
1423 | 1066 | logging.error(logfile) | ||
1424 | 1067 | |||
1425 | 1068 | return result | ||
1426 | 1069 | |||
1427 | 1002 | 1070 | ||
1428 | 1003 | def WriteHistory(self,history,firstdir): | 1071 | def WriteHistory(self,history,firstdir): |
1429 | 1004 | file = open(self.path+"/history.ma5","w") | 1072 | file = open(self.path+"/history.ma5","w") |
1430 | @@ -1029,6 +1097,7 @@ | |||
1431 | 1029 | file.write("\n") | 1097 | file.write("\n") |
1432 | 1030 | file.close() | 1098 | file.close() |
1433 | 1031 | 1099 | ||
1434 | 1100 | |||
1435 | 1032 | def RunJob(self,dataset): | 1101 | def RunJob(self,dataset): |
1436 | 1033 | 1102 | ||
1437 | 1034 | # Getting the dataset name | 1103 | # Getting the dataset name |
1438 | @@ -1038,23 +1107,26 @@ | |||
1439 | 1038 | if not os.path.isdir(self.path+"/Output/"+name): | 1107 | if not os.path.isdir(self.path+"/Output/"+name): |
1440 | 1039 | os.mkdir(self.path+"/Output/"+name) | 1108 | os.mkdir(self.path+"/Output/"+name) |
1441 | 1040 | 1109 | ||
1442 | 1110 | # folder where the program is launched | ||
1443 | 1111 | folder = self.path+'/Output/'+name | ||
1444 | 1112 | |||
1445 | 1113 | # shell command | ||
1446 | 1114 | commands = ['../../Build/MadAnalysis5job'] | ||
1447 | 1115 | |||
1448 | 1041 | # Weighted events | 1116 | # Weighted events |
1449 | 1042 | weighted_events="" | ||
1450 | 1043 | if not dataset.weighted_events: | 1117 | if not dataset.weighted_events: |
1452 | 1044 | weighted_events=" --no_event_weight" | 1118 | commands.append('--no_event_weight') |
1453 | 1045 | 1119 | ||
1454 | 1046 | # Release | 1120 | # Release |
1466 | 1047 | release = ' --ma5_version="' + self.main.version + ';' + self.main.date + '"' | 1121 | commands.append('--ma5_version="'+self.main.version+';'+self.main.date+'"') |
1467 | 1048 | 1122 | ||
1468 | 1049 | # Running SampleAnalyzer | 1123 | # Inputs |
1469 | 1050 | res=os.system('cd '\ | 1124 | commands.append('../../Input/'+name+'.list') |
1470 | 1051 | +self.path+'/Output/'+name+';'\ | 1125 | |
1471 | 1052 | +' ../../Build/'\ | 1126 | # Running SampleAnalyzer |
1472 | 1053 | +'MadAnalysis5Job '+weighted_events +\ | 1127 | result = ShellCommand.Execute(commands,folder) |
1473 | 1054 | release +\ | 1128 | |
1474 | 1055 | ' ../../Input/'+name+'.list') | 1129 | return result |
1464 | 1056 | |||
1465 | 1057 | return True | ||
1475 | 1058 | 1130 | ||
1476 | 1059 | 1131 | ||
1477 | 1060 | 1132 | ||
1478 | 1061 | 1133 | ||
1479 | === modified file 'madanalysis/IOinterface/library_writer.py' | |||
1480 | --- madanalysis/IOinterface/library_writer.py 2013-06-14 15:26:04 +0000 | |||
1481 | +++ madanalysis/IOinterface/library_writer.py 2014-05-17 19:51:11 +0000 | |||
1482 | @@ -26,22 +26,27 @@ | |||
1483 | 26 | from madanalysis.IOinterface.folder_writer import FolderWriter | 26 | from madanalysis.IOinterface.folder_writer import FolderWriter |
1484 | 27 | from madanalysis.IOinterface.job_writer import JobWriter | 27 | from madanalysis.IOinterface.job_writer import JobWriter |
1485 | 28 | from madanalysis.core.string_tools import StringTools | 28 | from madanalysis.core.string_tools import StringTools |
1486 | 29 | from madanalysis.IOinterface.shell_command import ShellCommand | ||
1487 | 29 | import logging | 30 | import logging |
1488 | 30 | import shutil | 31 | import shutil |
1489 | 31 | import os | 32 | import os |
1490 | 32 | import commands | 33 | import commands |
1491 | 34 | import subprocess | ||
1492 | 35 | |||
1493 | 33 | 36 | ||
1494 | 34 | class LibraryWriter(): | 37 | class LibraryWriter(): |
1495 | 35 | 38 | ||
1497 | 36 | def __init__(self,ma5dir,jobdir,libZIP,libFASTJET,forced,fortran,delphes): | 39 | def __init__(self,ma5dir,jobdir,libZIP,libFastJet,forced,fortran,delphes,delfes,main): |
1498 | 37 | self.ma5dir = ma5dir | 40 | self.ma5dir = ma5dir |
1499 | 38 | self.jobdir = jobdir | 41 | self.jobdir = jobdir |
1500 | 39 | self.path = os.path.normpath(ma5dir+"/tools/") | 42 | self.path = os.path.normpath(ma5dir+"/tools/") |
1501 | 40 | self.libZIP = libZIP | 43 | self.libZIP = libZIP |
1503 | 41 | self.libFASTJET = libFASTJET | 44 | self.libFastJet = libFastJet |
1504 | 42 | self.forced = forced | 45 | self.forced = forced |
1505 | 43 | self.fortran = fortran | 46 | self.fortran = fortran |
1506 | 44 | self.libDelphes = delphes | 47 | self.libDelphes = delphes |
1507 | 48 | self.libDelfes = delfes | ||
1508 | 49 | self.main = main | ||
1509 | 45 | 50 | ||
1510 | 46 | def get_ncores(self): | 51 | def get_ncores(self): |
1511 | 47 | # Number of cores | 52 | # Number of cores |
1512 | @@ -72,9 +77,211 @@ | |||
1513 | 72 | str(ncores)) | 77 | str(ncores)) |
1514 | 73 | return ncores | 78 | return ncores |
1515 | 74 | 79 | ||
1516 | 80 | def get_ncores2(self): | ||
1517 | 81 | # Number of cores | ||
1518 | 82 | import multiprocessing | ||
1519 | 83 | nmaxcores=multiprocessing.cpu_count() | ||
1520 | 84 | logging.info(" How many cores for the compiling? default = max = " +\ | ||
1521 | 85 | str(nmaxcores)+"") | ||
1522 | 86 | |||
1523 | 87 | if not self.forced: | ||
1524 | 88 | test=False | ||
1525 | 89 | while(not test): | ||
1526 | 90 | answer=raw_input(" Answer: ") | ||
1527 | 91 | if answer=="": | ||
1528 | 92 | test=True | ||
1529 | 93 | ncores=nmaxcores | ||
1530 | 94 | break | ||
1531 | 95 | try: | ||
1532 | 96 | ncores=int(answer) | ||
1533 | 97 | except: | ||
1534 | 98 | test=False | ||
1535 | 99 | continue | ||
1536 | 100 | if ncores<=nmaxcores and ncores>0: | ||
1537 | 101 | test=True | ||
1538 | 102 | |||
1539 | 103 | else: | ||
1540 | 104 | ncores=nmaxcores | ||
1541 | 105 | logging.info(" => Number of cores used for the compilation = " +\ | ||
1542 | 106 | str(ncores)) | ||
1543 | 107 | return ncores | ||
1544 | 108 | |||
1545 | 109 | |||
1546 | 75 | def Open(self): | 110 | def Open(self): |
1547 | 76 | return FolderWriter.CreateDirectory(self.path,overwrite=True) | 111 | return FolderWriter.CreateDirectory(self.path,overwrite=True) |
1548 | 77 | 112 | ||
1549 | 113 | def WriteMakefileForInterfaces(self,package): | ||
1550 | 114 | |||
1551 | 115 | # Open the file | ||
1552 | 116 | try: | ||
1553 | 117 | file = open(self.path + "/SampleAnalyzer/Interfaces/Makefile_" + package,"w") | ||
1554 | 118 | except: | ||
1555 | 119 | logging.error('impossible to write the file '+ self.path + "/SampleAnalyzer/Makefile_" + package) | ||
1556 | 120 | return False | ||
1557 | 121 | |||
1558 | 122 | # Header | ||
1559 | 123 | file.write(StringTools.Fill('#',80)+'\n') | ||
1560 | 124 | file.write('#'+StringTools.Center('MAKEFILE DEVOTED TO THE INTERFACE TO '+package.upper(),78)+'#\n') | ||
1561 | 125 | file.write(StringTools.Fill('#',80)+'\n') | ||
1562 | 126 | file.write('\n') | ||
1563 | 127 | |||
1564 | 128 | # Options for C++ compilation | ||
1565 | 129 | file.write('# Options for C++ compilation\n') | ||
1566 | 130 | file.write('CXX = g++\n') | ||
1567 | 131 | if package=='fastjet': | ||
1568 | 132 | file.write('CXXFASTJET = $(shell fastjet-config --cxxflags --plugins)\n') | ||
1569 | 133 | file.write('CXXFLAGS = -Wall -O3 -DROOT_USE -fPIC -I'+self.main.configLinux.root_inc_path+' -I./../../') | ||
1570 | 134 | if package=='zlib': | ||
1571 | 135 | file.write(' -I'+self.main.configLinux.zlib_inc_path) | ||
1572 | 136 | if package=='delphes': | ||
1573 | 137 | for header in self.main.configLinux.delphes_inc_paths: | ||
1574 | 138 | file.write(' -I'+header) | ||
1575 | 139 | if package=='delfes': | ||
1576 | 140 | for header in self.main.configLinux.delfes_inc_paths: | ||
1577 | 141 | file.write(' -I'+header) | ||
1578 | 142 | if package=='fastjet': | ||
1579 | 143 | file.write(' $(CXXFASTJET)') | ||
1580 | 144 | file.write('\n') | ||
1581 | 145 | |||
1582 | 146 | # Options for C++ compilation | ||
1583 | 147 | if self.fortran: | ||
1584 | 148 | file.write('# Options for Fortran compilation\n') | ||
1585 | 149 | file.write('FC = gfortran\n') | ||
1586 | 150 | file.write('FCFLAGS = -Wall -O3 -fPIC\n') | ||
1587 | 151 | file.write('\n') | ||
1588 | 152 | |||
1589 | 153 | # Files for analyzers | ||
1590 | 154 | file.write('# Files\n') | ||
1591 | 155 | file.write('SRCS = $(wildcard '+package+'/*.cpp)\n') | ||
1592 | 156 | file.write('HDRS = $(wildcard '+package+'/*.h)\n') | ||
1593 | 157 | file.write('OBJS = $(SRCS:.cpp=.o)\n') | ||
1594 | 158 | if self.fortran: | ||
1595 | 159 | file.write('FORTRAN_SRCS = $(wildcard '+package+'/*.f)\n') | ||
1596 | 160 | file.write('FORTRAN_OBJS = $(FORTRAN_SRCS:.f=.o)\n') | ||
1597 | 161 | file.write('\n') | ||
1598 | 162 | |||
1599 | 163 | # Name of the library | ||
1600 | 164 | file.write('# Name of the library\n') | ||
1601 | 165 | file.write('PROGRAM = '+package+'_for_ma5\n') | ||
1602 | 166 | file.write('\n') | ||
1603 | 167 | |||
1604 | 168 | # Defining colours for shell | ||
1605 | 169 | file.write('# Defining colours\n') | ||
1606 | 170 | file.write('GREEN = "\\\\033[1;32m"\n') | ||
1607 | 171 | file.write('RED = "\\\\033[1;31m"\n') | ||
1608 | 172 | file.write('PINK = "\\\\033[1;35m"\n') | ||
1609 | 173 | file.write('BLUE = "\\\\033[1;34m"\n') | ||
1610 | 174 | file.write('YELLOW = "\\\\033[1;33m"\n') | ||
1611 | 175 | file.write('CYAN = "\\\\033[1;36m"\n') | ||
1612 | 176 | file.write('NORMAL = "\\\\033[0;39m"\n') | ||
1613 | 177 | file.write('\n') | ||
1614 | 178 | |||
1615 | 179 | # All | ||
1616 | 180 | file.write('# All target\n') | ||
1617 | 181 | file.write('all: header compile_header compile link_header link\n') | ||
1618 | 182 | file.write('\n') | ||
1619 | 183 | |||
1620 | 184 | # Header target | ||
1621 | 185 | file.write('# Header target\n') | ||
1622 | 186 | file.write('header:\n') | ||
1623 | 187 | file.write('\t@echo -e $(YELLOW)"'+StringTools.Fill('-',50)+'"\n') | ||
1624 | 188 | file.write('\t@echo -e "'+StringTools.Center('Building SampleAnalyzer library',50)+'"\n') | ||
1625 | 189 | file.write('\t@echo -e "'+StringTools.Fill('-',50)+'"$(NORMAL)\n') | ||
1626 | 190 | file.write('\n') | ||
1627 | 191 | |||
1628 | 192 | # Compile_header target | ||
1629 | 193 | file.write('# Compile_header target\n') | ||
1630 | 194 | file.write('compile_header:\n') | ||
1631 | 195 | file.write('\t@echo -e $(YELLOW)"'+StringTools.Fill('-',50)+'"\n') | ||
1632 | 196 | file.write('\t@echo -e "'+StringTools.Center('Compilation',50)+'"\n') | ||
1633 | 197 | file.write('\t@echo -e "'+StringTools.Fill('-',50)+'"$(NORMAL)\n') | ||
1634 | 198 | file.write('\n') | ||
1635 | 199 | |||
1636 | 200 | # Linking_header target | ||
1637 | 201 | file.write('# Link_header target\n') | ||
1638 | 202 | file.write('link_header:\n') | ||
1639 | 203 | file.write('\t@echo -e $(YELLOW)"'+StringTools.Fill('-',50)+'"\n') | ||
1640 | 204 | file.write('\t@echo -e "'+StringTools.Center('Final linking',50)+'"\n') | ||
1641 | 205 | file.write('\t@echo -e "'+StringTools.Fill('-',50)+'"$(NORMAL)\n') | ||
1642 | 206 | file.write('\n') | ||
1643 | 207 | |||
1644 | 208 | # Clean_header target | ||
1645 | 209 | file.write('# clean_header target\n') | ||
1646 | 210 | file.write('clean_header:\n') | ||
1647 | 211 | file.write('\t@echo -e $(YELLOW)"'+StringTools.Fill('-',50)+'"\n') | ||
1648 | 212 | file.write('\t@echo -e "'+StringTools.Center('Removing intermediate files from building',50)+'"\n') | ||
1649 | 213 | file.write('\t@echo -e "'+StringTools.Fill('-',50)+'"$(NORMAL)\n') | ||
1650 | 214 | file.write('\n') | ||
1651 | 215 | |||
1652 | 216 | # Mrproper_header target | ||
1653 | 217 | file.write('# mrproper_header target\n') | ||
1654 | 218 | file.write('mrproper_header:\n') | ||
1655 | 219 | file.write('\t@echo -e $(YELLOW)"'+StringTools.Fill('-',50)+'"\n') | ||
1656 | 220 | file.write('\t@echo -e "'+StringTools.Center('Cleaning all the project',50)+'"\n') | ||
1657 | 221 | file.write('\t@echo -e "'+StringTools.Fill('-',50)+'"$(NORMAL)\n') | ||
1658 | 222 | file.write('\n') | ||
1659 | 223 | |||
1660 | 224 | # Precompile | ||
1661 | 225 | file.write('# Precompile target\n') | ||
1662 | 226 | file.write('precompile:\n') | ||
1663 | 227 | file.write('\n') | ||
1664 | 228 | |||
1665 | 229 | # Precompile | ||
1666 | 230 | file.write('# Compile target\n') | ||
1667 | 231 | if self.fortran: | ||
1668 | 232 | file.write('compile: precompile $(OBJS) $(FORTRAN_OBJS)\n') | ||
1669 | 233 | else: | ||
1670 | 234 | file.write('compile: precompile $(OBJS)\n') | ||
1671 | 235 | file.write('\n') | ||
1672 | 236 | |||
1673 | 237 | # Precompile | ||
1674 | 238 | file.write('# Link target\n') | ||
1675 | 239 | if self.fortran: | ||
1676 | 240 | file.write('link: $(OBJS) $(FORTRAN_OBJS)\n') | ||
1677 | 241 | if self.main.isMAC: | ||
1678 | 242 | file.write('\t$(CXX) -shared -flat_namespace -dynamiclib -undefined suppress -o ../Lib/lib$(PROGRAM).so $(OBJS) $(FORTRAN_OBJS)\n') | ||
1679 | 243 | else: | ||
1680 | 244 | file.write('\t$(CXX) -shared -o ../Lib/lib$(PROGRAM).so $(OBJS) $(FORTRAN_OBJS)\n') | ||
1681 | 245 | else: | ||
1682 | 246 | file.write('link: $(OBJS)\n') | ||
1683 | 247 | if self.main.isMAC: | ||
1684 | 248 | file.write('\t$(CXX) -shared -flat_namespace -dynamiclib -undefined suppress -o ../Lib/lib$(PROGRAM).so $(OBJS)\n') | ||
1685 | 249 | else: | ||
1686 | 250 | file.write('\t$(CXX) -shared -o ../Lib/lib$(PROGRAM).so $(OBJS)\n') | ||
1687 | 251 | file.write('\n') | ||
1688 | 252 | |||
1689 | 253 | # Phony target | ||
1690 | 254 | file.write('# Phony target\n') | ||
1691 | 255 | file.write('.PHONY: do_clean header compile_header link_header\n') | ||
1692 | 256 | file.write('\n') | ||
1693 | 257 | |||
1694 | 258 | # Cleaning | ||
1695 | 259 | file.write('# Clean target\n') | ||
1696 | 260 | file.write('clean: clean_header do_clean\n') | ||
1697 | 261 | file.write('\n') | ||
1698 | 262 | file.write('# Do clean target\n') | ||
1699 | 263 | file.write('do_clean: \n') | ||
1700 | 264 | file.write('\t@rm -f $(OBJS)\n') | ||
1701 | 265 | if self.fortran: | ||
1702 | 266 | file.write('\t@rm -f $(FORTRAN_OBJS)\n') | ||
1703 | 267 | file.write('\n') | ||
1704 | 268 | |||
1705 | 269 | # Mr Proper | ||
1706 | 270 | file.write('# Mr Proper target \n') | ||
1707 | 271 | file.write('mrproper: mrproper_header do_mrproper\n') | ||
1708 | 272 | file.write('\n') | ||
1709 | 273 | file.write('# Do Mr Proper target \n') | ||
1710 | 274 | file.write('do_mrproper: do_clean\n') | ||
1711 | 275 | file.write('\t@rm -f ../Lib/lib$(PROGRAM).so\n') | ||
1712 | 276 | file.write('\t@rm -f compilation.log linking.log cleanup.log mrproper.log *~ */*~\n') | ||
1713 | 277 | file.write('\n') | ||
1714 | 278 | |||
1715 | 279 | # Closing the file | ||
1716 | 280 | file.close() | ||
1717 | 281 | |||
1718 | 282 | return True | ||
1719 | 283 | |||
1720 | 284 | |||
1721 | 78 | def WriteMakefile(self,option=""): | 285 | def WriteMakefile(self,option=""): |
1722 | 79 | 286 | ||
1723 | 80 | # Open the file | 287 | # Open the file |
1724 | @@ -88,23 +295,26 @@ | |||
1725 | 88 | 295 | ||
1726 | 89 | # Compilators | 296 | # Compilators |
1727 | 90 | file.write('# Compilators\n') | 297 | file.write('# Compilators\n') |
1729 | 91 | file.write('GCC = g++\n') | 298 | file.write('CXX = g++\n') |
1730 | 92 | if self.fortran: | 299 | if self.fortran: |
1731 | 93 | file.write('FC = gfortran\n') | 300 | file.write('FC = gfortran\n') |
1732 | 94 | file.write('\n') | 301 | file.write('\n') |
1733 | 95 | 302 | ||
1734 | 96 | # Options for compilation | 303 | # Options for compilation |
1735 | 97 | file.write('# Options for compilation\n') | 304 | file.write('# Options for compilation\n') |
1739 | 98 | if self.libFASTJET: | 305 | # if self.libFastJet: |
1740 | 99 | file.write('CXXFASTJET = $(shell fastjet-config --cxxflags --plugins)\n') | 306 | # file.write('CXXFASTJET = $(shell fastjet-config --cxxflags --plugins)\n') |
1741 | 100 | file.write('CXXFLAGS = -Wall -O3 $(shell root-config --cflags) -I./../') | 307 | # BENJ FIX file.write('CXXFLAGS = -Wall -O3 -fPIC $(shell root-config --cflags) -I./../') |
1742 | 308 | file.write('CXXFLAGS = -Wall -O3 -DROOT_USE -fPIC -I'+self.main.configLinux.root_inc_path+' -I./../') | ||
1743 | 101 | if self.libZIP: | 309 | if self.libZIP: |
1744 | 102 | file.write(' -DZIP_USE') | 310 | file.write(' -DZIP_USE') |
1745 | 103 | if self.libDelphes: | 311 | if self.libDelphes: |
1746 | 104 | file.write(' -DDELPHES_USE') | 312 | file.write(' -DDELPHES_USE') |
1748 | 105 | if self.libFASTJET: | 313 | if self.libDelfes: |
1749 | 314 | file.write(' -DDELFES_USE') | ||
1750 | 315 | if self.libFastJet: | ||
1751 | 106 | file.write(' -DFASTJET_USE') | 316 | file.write(' -DFASTJET_USE') |
1753 | 107 | file.write(' $(CXXFASTJET)') | 317 | # file.write(' $(CXXFASTJET)') |
1754 | 108 | file.write('\n') | 318 | file.write('\n') |
1755 | 109 | if self.fortran: | 319 | if self.fortran: |
1756 | 110 | file.write('FC = gfortran\n') | 320 | file.write('FC = gfortran\n') |
1757 | @@ -114,6 +324,7 @@ | |||
1758 | 114 | # Files for analyzers | 324 | # Files for analyzers |
1759 | 115 | file.write('# Files\n') | 325 | file.write('# Files\n') |
1760 | 116 | file.write('SRCS = $(wildcard */*.cpp)\n') | 326 | file.write('SRCS = $(wildcard */*.cpp)\n') |
1761 | 327 | # file.write('SRCS += $(wildcard */*/*.cpp)\n') | ||
1762 | 117 | file.write('HDRS = $(wildcard */*.h)\n') | 328 | file.write('HDRS = $(wildcard */*.h)\n') |
1763 | 118 | file.write('OBJS = $(SRCS:.cpp=.o)\n') | 329 | file.write('OBJS = $(SRCS:.cpp=.o)\n') |
1764 | 119 | if self.fortran: | 330 | if self.fortran: |
1765 | @@ -199,10 +410,18 @@ | |||
1766 | 199 | file.write('# Link target\n') | 410 | file.write('# Link target\n') |
1767 | 200 | if self.fortran: | 411 | if self.fortran: |
1768 | 201 | file.write('link: $(OBJS) $(FORTRAN_OBJS)\n') | 412 | file.write('link: $(OBJS) $(FORTRAN_OBJS)\n') |
1770 | 202 | file.write('\tar -ruc Lib/lib$(PROGRAM).a $(OBJS) $(FORTRAN_OBJS)\n') | 413 | if self.main.isMAC: |
1771 | 414 | file.write('\t$(CXX) -shared -flat_namespace -dynamiclib -undefined suppress -o Lib/lib$(PROGRAM).so $(OBJS) $(FORTRAN_OBJS)\n') | ||
1772 | 415 | else: | ||
1773 | 416 | file.write('\t$(CXX) -shared -o Lib/lib$(PROGRAM).so $(OBJS) $(FORTRAN_OBJS)\n') | ||
1774 | 203 | else: | 417 | else: |
1775 | 204 | file.write('link: $(OBJS)\n') | 418 | file.write('link: $(OBJS)\n') |
1777 | 205 | file.write('\tar -ruc Lib/lib$(PROGRAM).a $(OBJS)\n') | 419 | if self.main.isMAC: |
1778 | 420 | file.write('\t$(CXX) -shared -flat_namespace -dynamiclib -undefined suppress -o Lib/lib$(PROGRAM).so $(OBJS)\n') | ||
1779 | 421 | else: | ||
1780 | 422 | file.write('\t$(CXX) -shared -o Lib/lib$(PROGRAM).so $(OBJS)\n') | ||
1781 | 423 | |||
1782 | 424 | # file.write('\tar -ruc Lib/lib$(PROGRAM).a $(OBJS)\n') | ||
1783 | 206 | file.write('\n') | 425 | file.write('\n') |
1784 | 207 | 426 | ||
1785 | 208 | # Phony target | 427 | # Phony target |
1786 | @@ -216,7 +435,7 @@ | |||
1787 | 216 | file.write('\n') | 435 | file.write('\n') |
1788 | 217 | file.write('# Do clean target\n') | 436 | file.write('# Do clean target\n') |
1789 | 218 | file.write('do_clean: \n') | 437 | file.write('do_clean: \n') |
1791 | 219 | file.write('\t@rm -f $(OBJS) Reader/FACdict.*\n') | 438 | file.write('\t@rm -f $(OBJS)\n') |
1792 | 220 | file.write('\n') | 439 | file.write('\n') |
1793 | 221 | 440 | ||
1794 | 222 | # Mr Proper | 441 | # Mr Proper |
1795 | @@ -225,54 +444,394 @@ | |||
1796 | 225 | file.write('\n') | 444 | file.write('\n') |
1797 | 226 | file.write('# Do Mr Proper target \n') | 445 | file.write('# Do Mr Proper target \n') |
1798 | 227 | file.write('do_mrproper: do_clean\n') | 446 | file.write('do_mrproper: do_clean\n') |
1801 | 228 | file.write('\t@rm -f Lib/lib$(PROGRAM).a\n') | 447 | file.write('\t@rm -f Lib/lib$(PROGRAM).so\n') |
1802 | 229 | file.write('\t@rm -f compilation.log linking.log cleanup.log *~ */*~\n') | 448 | file.write('\t@rm -f compilation.log linking.log cleanup.log mrproper.log *~ */*~\n') |
1803 | 230 | file.write('\n') | 449 | file.write('\n') |
1804 | 231 | 450 | ||
1805 | 232 | # Closing the file | 451 | # Closing the file |
1806 | 233 | file.close() | 452 | file.close() |
1807 | 234 | 453 | ||
1810 | 235 | JobWriter.WriteSetupFile(True,self.path+'/SampleAnalyzer',self.ma5dir,False) | 454 | JobWriter.WriteSetupFile(True,self.path+'/SampleAnalyzer',self.ma5dir,False,self.main.configLinux,self.main.isMAC) |
1811 | 236 | JobWriter.WriteSetupFile(False,self.path+'/SampleAnalyzer',self.ma5dir,False) | 455 | JobWriter.WriteSetupFile(False,self.path+'/SampleAnalyzer',self.ma5dir,False,self.main.configLinux,self.main.isMAC) |
1812 | 237 | 456 | ||
1813 | 238 | return True | 457 | return True |
1814 | 239 | 458 | ||
1815 | 240 | 459 | ||
1817 | 241 | def Compile(self): | 460 | def Compile(self,ncores,package,folder): |
1818 | 461 | |||
1819 | 462 | # number of cores | ||
1820 | 242 | strcores='' | 463 | strcores='' |
1821 | 243 | ncores = self.get_ncores() | ||
1822 | 244 | if ncores>1: | 464 | if ncores>1: |
1823 | 245 | strcores='-j'+str(ncores) | 465 | strcores='-j'+str(ncores) |
1857 | 246 | res=commands.getstatusoutput("cd "\ | 466 | |
1858 | 247 | +self.path+"/SampleAnalyzer/;"\ | 467 | # log file name |
1859 | 248 | +" make compile "+strcores+" > compilation.log 2>&1") | 468 | if package == 'SampleAnalyzer': |
1860 | 249 | if res[0]==0: | 469 | logfile = folder+'/compilation.log' |
1861 | 250 | return True | 470 | else: |
1862 | 251 | else: | 471 | logfile = folder+'/compilation_'+package+'.log' |
1863 | 252 | logging.error("errors occured during compilation. For more details, see the file :") | 472 | |
1864 | 253 | logging.error(" "+self.path+"/SampleAnalyzer/compilation.log") | 473 | # makefile |
1865 | 254 | return False | 474 | if package == 'SampleAnalyzer': |
1866 | 255 | 475 | makefile = 'Makefile' | |
1867 | 256 | def Link(self): | 476 | else: |
1868 | 257 | res=commands.getstatusoutput("cd "\ | 477 | makefile = 'Makefile_'+package |
1869 | 258 | +self.path+"/SampleAnalyzer/;"\ | 478 | |
1870 | 259 | +" make link > linking.log 2>&1") | 479 | # shell command |
1871 | 260 | if res[0]==0: | 480 | commands = ['make','compile',strcores,'--file='+makefile] |
1872 | 261 | return True | 481 | |
1873 | 262 | else: | 482 | # call |
1874 | 263 | logging.error("errors occured during compilation. For more details, see the file :") | 483 | result, out = ShellCommand.ExecuteWithLog(commands,logfile,folder) |
1875 | 264 | logging.error(" "+self.path+"/SampleAnalyzer/linking.log") | 484 | |
1876 | 265 | return False | 485 | # return result |
1877 | 266 | 486 | if not result: | |
1878 | 267 | 487 | logging.error('impossible to compile the project. For more details, see the log file:') | |
1879 | 268 | def Clean(self): | 488 | logging.error(logfile) |
1880 | 269 | res=commands.getstatusoutput("cd "\ | 489 | |
1881 | 270 | +self.path+"/SampleAnalyzer/;"\ | 490 | return result |
1882 | 271 | +" make clean > cleanup.log 2>&1") | 491 | |
1883 | 272 | return True | 492 | |
1884 | 273 | 493 | def Link(self,package,folder): | |
1885 | 274 | def MrProper(self): | 494 | |
1886 | 275 | res=commands.getstatusoutput("cd "\ | 495 | # log file name |
1887 | 276 | +self.path+"/SampleAnalyzer/;"\ | 496 | if package == 'SampleAnalyzer': |
1888 | 277 | +" make mrproper > cleanup.log 2>&1") | 497 | logfile = folder+'/linking.log' |
1889 | 278 | return True | 498 | else: |
1890 | 499 | logfile = folder+'/linking_'+package+'.log' | ||
1891 | 500 | |||
1892 | 501 | # makefile | ||
1893 | 502 | if package == 'SampleAnalyzer': | ||
1894 | 503 | makefile = 'Makefile' | ||
1895 | 504 | else: | ||
1896 | 505 | makefile = 'Makefile_'+package | ||
1897 | 506 | |||
1898 | 507 | # shell command | ||
1899 | 508 | commands = ['make','link','--file='+makefile] | ||
1900 | 509 | |||
1901 | 510 | # call | ||
1902 | 511 | result, out = ShellCommand.ExecuteWithLog(commands,logfile,folder) | ||
1903 | 512 | |||
1904 | 513 | # return result | ||
1905 | 514 | if not result: | ||
1906 | 515 | logging.error('impossible to link the project. For more details, see the log file:') | ||
1907 | 516 | logging.error(logfile) | ||
1908 | 517 | |||
1909 | 518 | return result | ||
1910 | 519 | |||
1911 | 520 | |||
1912 | 521 | def Clean(self,package,folder): | ||
1913 | 522 | |||
1914 | 523 | # log file name | ||
1915 | 524 | if package == 'SampleAnalyzer': | ||
1916 | 525 | logfile = folder+'/cleanup.log' | ||
1917 | 526 | else: | ||
1918 | 527 | logfile = folder+'/cleanup_'+package+'.log' | ||
1919 | 528 | |||
1920 | 529 | # makefile | ||
1921 | 530 | if package == 'SampleAnalyzer': | ||
1922 | 531 | makefile = 'Makefile' | ||
1923 | 532 | else: | ||
1924 | 533 | makefile = 'Makefile_'+package | ||
1925 | 534 | |||
1926 | 535 | # shell command | ||
1927 | 536 | commands = ['make','clean','--file='+makefile] | ||
1928 | 537 | |||
1929 | 538 | # call | ||
1930 | 539 | result, out = ShellCommand.ExecuteWithLog(commands,logfile,folder) | ||
1931 | 540 | |||
1932 | 541 | # return result | ||
1933 | 542 | if not result: | ||
1934 | 543 | logging.error('impossible to clean the project. For more details, see the log file:') | ||
1935 | 544 | logging.error(logfile) | ||
1936 | 545 | |||
1937 | 546 | return result | ||
1938 | 547 | |||
1939 | 548 | |||
1940 | 549 | def MrProper(self,package,folder): | ||
1941 | 550 | |||
1942 | 551 | # log file name | ||
1943 | 552 | if package == 'SampleAnalyzer': | ||
1944 | 553 | logfile = folder+'/mrproper.log' | ||
1945 | 554 | else: | ||
1946 | 555 | logfile = folder+'/mrproper_'+package+'.log' | ||
1947 | 556 | |||
1948 | 557 | # makefile | ||
1949 | 558 | if package == 'SampleAnalyzer': | ||
1950 | 559 | makefile = 'Makefile' | ||
1951 | 560 | else: | ||
1952 | 561 | makefile = 'Makefile_'+package | ||
1953 | 562 | |||
1954 | 563 | # shell command | ||
1955 | 564 | commands = ['make','mrproper','--file='+makefile] | ||
1956 | 565 | |||
1957 | 566 | # call | ||
1958 | 567 | result, out = ShellCommand.ExecuteWithLog(commands,logfile,folder) | ||
1959 | 568 | |||
1960 | 569 | # return result | ||
1961 | 570 | if not result: | ||
1962 | 571 | logging.error('impossible to clean the project. For more details, see the log file:') | ||
1963 | 572 | logging.error(logfile) | ||
1964 | 573 | |||
1965 | 574 | return result | ||
1966 | 575 | |||
1967 | 576 | |||
1968 | 577 | def Run(self,program,args,folder,silent=False): | ||
1969 | 578 | |||
1970 | 579 | # shell command | ||
1971 | 580 | commands = ['./'+program] | ||
1972 | 581 | commands.extend(args) | ||
1973 | 582 | |||
1974 | 583 | # logfile | ||
1975 | 584 | logfile = folder+'/'+program+'.log' | ||
1976 | 585 | |||
1977 | 586 | # call | ||
1978 | 587 | result, out = ShellCommand.ExecuteWithLog(commands,logfile,folder,silent) | ||
1979 | 588 | |||
1980 | 589 | # return result | ||
1981 | 590 | if not result and not silent: | ||
1982 | 591 | logging.error('impossible to run the project. For more details, see the log file:') | ||
1983 | 592 | logging.error(logfile) | ||
1984 | 593 | |||
1985 | 594 | return result | ||
1986 | 595 | |||
1987 | 596 | |||
1988 | 597 | def CheckRun(self,logfile,silent=False): | ||
1989 | 598 | |||
1990 | 599 | # Open | ||
1991 | 600 | try: | ||
1992 | 601 | input = open(logfile) | ||
1993 | 602 | except: | ||
1994 | 603 | logging.error('impossible to open the file:'+logfile) | ||
1995 | 604 | return False | ||
1996 | 605 | |||
1997 | 606 | end=False | ||
1998 | 607 | begin=False | ||
1999 | 608 | |||
2000 | 609 | # Loop over the logfile | ||
2001 | 610 | for line in input: | ||
2002 | 611 | line=line.lstrip() | ||
2003 | 612 | line=line.rstrip() | ||
2004 | 613 | if line=='BEGIN-SAMPLEANALYZER-TEST': | ||
2005 | 614 | begin=True | ||
2006 | 615 | elif line=='END-SAMPLEANALYZER-TEST': | ||
2007 | 616 | end=True | ||
2008 | 617 | |||
2009 | 618 | # Close | ||
2010 | 619 | try: | ||
2011 | 620 | input.close() | ||
2012 | 621 | except: | ||
2013 | 622 | logging.error('impossible to close the file:'+logfile) | ||
2014 | 623 | return False | ||
2015 | 624 | |||
2016 | 625 | # CrossCheck | ||
2017 | 626 | if not (begin and end) and not silent: | ||
2018 | 627 | logging.error('expected program output is not found. More details, see the log file:') | ||
2019 | 628 | logging.error(logfile) | ||
2020 | 629 | return False | ||
2021 | 630 | |||
2022 | 631 | return True | ||
2023 | 632 | |||
2024 | 633 | |||
2025 | 634 | def WriteMakefileForTest(self): | ||
2026 | 635 | |||
2027 | 636 | # Open the file | ||
2028 | 637 | filename = self.path + "/SampleAnalyzer/Test/Makefile_test" | ||
2029 | 638 | try: | ||
2030 | 639 | file = open(filename,"w") | ||
2031 | 640 | except: | ||
2032 | 641 | logging.error('impossible to write the file '+filenameself.path) | ||
2033 | 642 | return False | ||
2034 | 643 | |||
2035 | 644 | # Writing header | ||
2036 | 645 | file.write(StringTools.Fill('#',80)+'\n') | ||
2037 | 646 | file.write('#'+StringTools.Center('MAKEFILE FOR SAMPLEANALYZER TEST',78)+'#\n') | ||
2038 | 647 | file.write(StringTools.Fill('#',80)+'\n') | ||
2039 | 648 | file.write('\n') | ||
2040 | 649 | |||
2041 | 650 | # Compilators | ||
2042 | 651 | file.write('# Compilators\n') | ||
2043 | 652 | file.write('CXX = g++\n') | ||
2044 | 653 | file.write('\n') | ||
2045 | 654 | |||
2046 | 655 | # Options for compilation : CXXFLAGS | ||
2047 | 656 | file.write('# Options for compilation\n') | ||
2048 | 657 | options = [] | ||
2049 | 658 | options.extend(['-Wall','-O3','-I$(MA5_BASE)/tools/','-I'+self.main.configLinux.root_inc_path]) | ||
2050 | 659 | if self.libZIP: | ||
2051 | 660 | options.extend(['-DZIP_USE']) | ||
2052 | 661 | if self.libDelphes: | ||
2053 | 662 | options.extend(['-DROOT_USE','-DDELPHES_USE']) | ||
2054 | 663 | if self.libDelfes: | ||
2055 | 664 | options.extend(['-DROOT_USE','-DDELFES_USE']) | ||
2056 | 665 | if self.libFastJet: | ||
2057 | 666 | options.extend(['-DROOT_USE','-DFASTJET_USE']) | ||
2058 | 667 | file.write('CXXFLAGS = '+' '.join(options)) | ||
2059 | 668 | file.write('\n') | ||
2060 | 669 | |||
2061 | 670 | # Options for compilation : LIBFLAGS | ||
2062 | 671 | |||
2063 | 672 | # - Root | ||
2064 | 673 | libs=[] | ||
2065 | 674 | libs.extend(['-L'+self.main.configLinux.root_lib_path, \ | ||
2066 | 675 | '-lGpad','-lHist','-lGraf','-lGraf3d','-lTree', \ | ||
2067 | 676 | '-lRint','-lPostscript','-lMatrix','-lPhysics', \ | ||
2068 | 677 | '-lMathCore','-lEG', '-lRIO','-lNet','-lThread', \ | ||
2069 | 678 | '-lCore','-lCint','-pthread','-lm','-ldl','-rdynamic']) | ||
2070 | 679 | |||
2071 | 680 | # - SampleAnalyzer | ||
2072 | 681 | libs.extend(['-L$(MA5_BASE)/tools/SampleAnalyzer/Lib/','-lSampleAnalyzer']) | ||
2073 | 682 | if self.libZIP: | ||
2074 | 683 | libs.extend(['-L'+self.main.configLinux.zlib_lib_path,'-lz','-lzlib_for_ma5']) | ||
2075 | 684 | if self.libDelphes: | ||
2076 | 685 | libs.extend(['-L'+self.main.configLinux.delphes_lib_paths[0],'-lDelphes','-ldelphes_for_ma5']) | ||
2077 | 686 | if self.libDelfes: | ||
2078 | 687 | libs.extend(['-L'+self.main.configLinux.delfes_lib_paths[0],'-lDelphes','-ldelfes_for_ma5']) | ||
2079 | 688 | if self.fortran: | ||
2080 | 689 | libs.extend(['-lgfortran']) | ||
2081 | 690 | if self.libFastJet: | ||
2082 | 691 | libs.extend(['$(shell fastjet-config --libs --plugins --rpath=no)','-lfastjet_for_ma5']) | ||
2083 | 692 | file.write('LIBFLAGS = '+' '.join(libs)+'\n') | ||
2084 | 693 | file.write('\n') | ||
2085 | 694 | |||
2086 | 695 | # Files to process | ||
2087 | 696 | file.write('# Files to process\n') | ||
2088 | 697 | file.write('SRCS = $(wildcard Test.cpp)\n') | ||
2089 | 698 | file.write('\n') | ||
2090 | 699 | |||
2091 | 700 | # Files to generate | ||
2092 | 701 | file.write('# Files to generate\n') | ||
2093 | 702 | file.write('OBJS = $(SRCS:.cpp=.o)\n') | ||
2094 | 703 | file.write('PROGRAM = SampleAnalyzerTest\n') | ||
2095 | 704 | file.write('\n') | ||
2096 | 705 | |||
2097 | 706 | # Lib to check | ||
2098 | 707 | file.write('# Requirements to check before building\n') | ||
2099 | 708 | libs=[] | ||
2100 | 709 | libs.append('$(MA5_BASE)/tools/SampleAnalyzer/Lib/libSampleAnalyzer.so') | ||
2101 | 710 | if self.libZIP: | ||
2102 | 711 | libs.append('$(MA5_BASE)/tools/SampleAnalyzer/Lib/libzlib_for_ma5.so') | ||
2103 | 712 | if self.libDelphes: | ||
2104 | 713 | libs.append('$(MA5_BASE)/tools/SampleAnalyzer/Lib/libdelphes_for_ma5.so') | ||
2105 | 714 | if self.libDelfes: | ||
2106 | 715 | libs.append('$(MA5_BASE)/tools/SampleAnalyzer/Lib/libdelfes_for_ma5.so') | ||
2107 | 716 | if self.libFastJet: | ||
2108 | 717 | libs.append('$(MA5_BASE)/tools/SampleAnalyzer/Lib/libfastjet_for_ma5.so') | ||
2109 | 718 | for ind in range(0,len(libs)): | ||
2110 | 719 | file.write('REQUIRED'+str(ind+1)+' = '+libs[ind]+'\n') | ||
2111 | 720 | file.write('\n') | ||
2112 | 721 | |||
2113 | 722 | |||
2114 | 723 | # Defining colours for shell | ||
2115 | 724 | file.write('# Defining colours\n') | ||
2116 | 725 | file.write('GREEN = "\\\\033[1;32m"\n') | ||
2117 | 726 | file.write('RED = "\\\\033[1;31m"\n') | ||
2118 | 727 | file.write('PINK = "\\\\033[1;35m"\n') | ||
2119 | 728 | file.write('BLUE = "\\\\033[1;34m"\n') | ||
2120 | 729 | file.write('YELLOW = "\\\\033[1;33m"\n') | ||
2121 | 730 | file.write('CYAN = "\\\\033[1;36m"\n') | ||
2122 | 731 | file.write('NORMAL = "\\\\033[0;39m"\n') | ||
2123 | 732 | file.write('\n') | ||
2124 | 733 | |||
2125 | 734 | # All target | ||
2126 | 735 | file.write('# All target\n') | ||
2127 | 736 | file.write('all: header library_check compile_header compile link_header link\n') | ||
2128 | 737 | file.write('\n') | ||
2129 | 738 | |||
2130 | 739 | # Check library | ||
2131 | 740 | if len(libs)!=0: | ||
2132 | 741 | file.write('# Check library\n') | ||
2133 | 742 | file.write('library_check:\n') | ||
2134 | 743 | for ind in range(0,len(libs)): | ||
2135 | 744 | file.write('ifeq ($(wildcard $(REQUIRED'+str(ind+1)+')),)\n') | ||
2136 | 745 | file.write('\t@echo -e $(RED)"The shared library "$(REQUIRED'+str(ind+1)+')" is not found"\n') | ||
2137 | 746 | file.write('\t@echo -e $(RED)" 1) Please check that MadAnalysis 5 is installed in the folder : "$(MA5_BASE)\n') | ||
2138 | 747 | file.write('\t@echo -e $(RED)" 2) Launch MadAnalysis 5 in normal mode in order to build this library."\n') | ||
2139 | 748 | file.write('\t@echo -e $(NORMAL)\n') | ||
2140 | 749 | file.write('\t@false\n') | ||
2141 | 750 | file.write('endif\n') | ||
2142 | 751 | file.write('\n') | ||
2143 | 752 | |||
2144 | 753 | # Header target | ||
2145 | 754 | file.write('# Header target\n') | ||
2146 | 755 | file.write('header:\n') | ||
2147 | 756 | file.write('\t@echo -e $(YELLOW)"'+StringTools.Fill('-',50)+'"\n') | ||
2148 | 757 | file.write('\t@echo -e "'+StringTools.Center('Building MA5 job',50)+'"\n') | ||
2149 | 758 | file.write('\t@echo -e "'+StringTools.Fill('-',50)+'"$(NORMAL)\n') | ||
2150 | 759 | file.write('\n') | ||
2151 | 760 | |||
2152 | 761 | # Compile_header target | ||
2153 | 762 | file.write('# Compile_header target\n') | ||
2154 | 763 | file.write('compile_header:\n') | ||
2155 | 764 | file.write('\t@echo -e $(YELLOW)"'+StringTools.Fill('-',50)+'"\n') | ||
2156 | 765 | file.write('\t@echo -e "'+StringTools.Center('Compilation',50)+'"\n') | ||
2157 | 766 | file.write('\t@echo -e "'+StringTools.Fill('-',50)+'"$(NORMAL)\n') | ||
2158 | 767 | file.write('\n') | ||
2159 | 768 | |||
2160 | 769 | # Linking_header target | ||
2161 | 770 | file.write('# Link_header target\n') | ||
2162 | 771 | file.write('link_header:\n') | ||
2163 | 772 | file.write('\t@echo -e $(YELLOW)"'+StringTools.Fill('-',50)+'"\n') | ||
2164 | 773 | file.write('\t@echo -e "'+StringTools.Center('Final linking',50)+'"\n') | ||
2165 | 774 | file.write('\t@echo -e "'+StringTools.Fill('-',50)+'"$(NORMAL)\n') | ||
2166 | 775 | file.write('\n') | ||
2167 | 776 | |||
2168 | 777 | # Clean_header target | ||
2169 | 778 | file.write('# clean_header target\n') | ||
2170 | 779 | file.write('clean_header:\n') | ||
2171 | 780 | file.write('\t@echo -e $(YELLOW)"'+StringTools.Fill('-',50)+'"\n') | ||
2172 | 781 | file.write('\t@echo -e "'+StringTools.Center('Removing intermediate files from building',50)+'"\n') | ||
2173 | 782 | file.write('\t@echo -e "'+StringTools.Fill('-',50)+'"$(NORMAL)\n') | ||
2174 | 783 | file.write('\n') | ||
2175 | 784 | |||
2176 | 785 | # Mrproper_header target | ||
2177 | 786 | file.write('# mrproper_header target\n') | ||
2178 | 787 | file.write('mrproper_header:\n') | ||
2179 | 788 | file.write('\t@echo -e $(YELLOW)"'+StringTools.Fill('-',50)+'"\n') | ||
2180 | 789 | file.write('\t@echo -e "'+StringTools.Center('Cleaning all the project',50)+'"\n') | ||
2181 | 790 | file.write('\t@echo -e "'+StringTools.Fill('-',50)+'"$(NORMAL)\n') | ||
2182 | 791 | file.write('\n') | ||
2183 | 792 | |||
2184 | 793 | # Compile target | ||
2185 | 794 | file.write('# Compile target\n') | ||
2186 | 795 | file.write('compile: $(OBJS)\n') | ||
2187 | 796 | file.write('\n') | ||
2188 | 797 | |||
2189 | 798 | # Object file target | ||
2190 | 799 | file.write('# Object file target\n') | ||
2191 | 800 | file.write('$(OBJS): \n') | ||
2192 | 801 | file.write('\n') | ||
2193 | 802 | |||
2194 | 803 | # Link target | ||
2195 | 804 | file.write('# Link target\n') | ||
2196 | 805 | file.write('link: $(OBJS)\n') | ||
2197 | 806 | file.write('\t$(CXX) $(CXXFLAGS) $(OBJS) $(LIBFLAGS) -o $(PROGRAM)\n') | ||
2198 | 807 | file.write('\n') | ||
2199 | 808 | |||
2200 | 809 | # Clean target | ||
2201 | 810 | file.write('# Clean target\n') | ||
2202 | 811 | file.write('clean: clean_header do_clean\n') | ||
2203 | 812 | file.write('\n') | ||
2204 | 813 | file.write('# Do clean target\n') | ||
2205 | 814 | file.write('do_clean: \n') | ||
2206 | 815 | file.write('\t@rm -f $(OBJS)\n') | ||
2207 | 816 | file.write('\n') | ||
2208 | 817 | |||
2209 | 818 | # Mr Proper target | ||
2210 | 819 | file.write('# Mr Proper target \n') | ||
2211 | 820 | file.write('mrproper: mrproper_header do_mrproper\n') | ||
2212 | 821 | file.write('\n') | ||
2213 | 822 | file.write('# Do Mr Proper target \n') | ||
2214 | 823 | file.write('do_mrproper: do_clean\n') | ||
2215 | 824 | file.write('\t@rm -f $(PROGRAM) compilation_test.log' + \ | ||
2216 | 825 | ' linking_test.log cleanup_test.log mrproper_test.log *~ */*~ */*~ \n') | ||
2217 | 826 | file.write('\n') | ||
2218 | 827 | |||
2219 | 828 | # Phony target | ||
2220 | 829 | file.write('# Phony target\n') | ||
2221 | 830 | file.write('.PHONY: do_clean header link_header compile_header\n') | ||
2222 | 831 | file.write('\n') | ||
2223 | 832 | |||
2224 | 833 | # Closing the file | ||
2225 | 834 | file.close() | ||
2226 | 835 | |||
2227 | 836 | return True | ||
2228 | 837 | |||
2229 | 279 | 838 | ||
2230 | === added file 'madanalysis/IOinterface/shell_command.py' | |||
2231 | --- madanalysis/IOinterface/shell_command.py 1970-01-01 00:00:00 +0000 | |||
2232 | +++ madanalysis/IOinterface/shell_command.py 2014-05-17 19:51:11 +0000 | |||
2233 | @@ -0,0 +1,82 @@ | |||
2234 | 1 | ################################################################################ | ||
2235 | 2 | # | ||
2236 | 3 | # Copyright (C) 2012-2013 Eric Conte, Benjamin Fuks | ||
2237 | 4 | # The MadAnalysis development team, email: <ma5team@iphc.cnrs.fr> | ||
2238 | 5 | # | ||
2239 | 6 | # This file is part of MadAnalysis 5. | ||
2240 | 7 | # Official website: <https://launchpad.net/madanalysis5> | ||
2241 | 8 | # | ||
2242 | 9 | # MadAnalysis 5 is free software: you can redistribute it and/or modify | ||
2243 | 10 | # it under the terms of the GNU General Public License as published by | ||
2244 | 11 | # the Free Software Foundation, either version 3 of the License, or | ||
2245 | 12 | # (at your option) any later version. | ||
2246 | 13 | # | ||
2247 | 14 | # MadAnalysis 5 is distributed in the hope that it will be useful, | ||
2248 | 15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
2249 | 16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
2250 | 17 | # GNU General Public License for more details. | ||
2251 | 18 | # | ||
2252 | 19 | # You should have received a copy of the GNU General Public License | ||
2253 | 20 | # along with MadAnalysis 5. If not, see <http://www.gnu.org/licenses/> | ||
2254 | 21 | # | ||
2255 | 22 | ################################################################################ | ||
2256 | 23 | |||
2257 | 24 | |||
2258 | 25 | import logging | ||
2259 | 26 | import shutil | ||
2260 | 27 | import os | ||
2261 | 28 | import commands | ||
2262 | 29 | import subprocess | ||
2263 | 30 | |||
2264 | 31 | |||
2265 | 32 | class ShellCommand(): | ||
2266 | 33 | |||
2267 | 34 | @staticmethod | ||
2268 | 35 | def ExecuteWithLog(theCommands,logfile,path,silent=False): | ||
2269 | 36 | |||
2270 | 37 | # Open the log file | ||
2271 | 38 | try: | ||
2272 | 39 | output = open(logfile,'w') | ||
2273 | 40 | except: | ||
2274 | 41 | if not silent: | ||
2275 | 42 | logging.error('impossible to write the file '+logfile) | ||
2276 | 43 | return False, None | ||
2277 | 44 | |||
2278 | 45 | # Launching the commands | ||
2279 | 46 | try: | ||
2280 | 47 | result=subprocess.Popen(theCommands, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, cwd=path) | ||
2281 | 48 | except: | ||
2282 | 49 | if not silent: | ||
2283 | 50 | logging.error('impossible to execute the commands: '+' '.join(theCommands)) | ||
2284 | 51 | return False, None | ||
2285 | 52 | |||
2286 | 53 | # Getting stdout | ||
2287 | 54 | out, err = result.communicate() | ||
2288 | 55 | if out!=None: | ||
2289 | 56 | for line in out: | ||
2290 | 57 | output.write(line) | ||
2291 | 58 | |||
2292 | 59 | # Close the log file | ||
2293 | 60 | output.close() | ||
2294 | 61 | |||
2295 | 62 | # Return results | ||
2296 | 63 | return (result.returncode==0), out | ||
2297 | 64 | |||
2298 | 65 | |||
2299 | 66 | |||
2300 | 67 | @staticmethod | ||
2301 | 68 | def Execute(theCommands,path): | ||
2302 | 69 | |||
2303 | 70 | # Launching the commands | ||
2304 | 71 | try: | ||
2305 | 72 | result=subprocess.Popen(theCommands, cwd=path) | ||
2306 | 73 | except: | ||
2307 | 74 | logging.error('impossible to execute the commands: '+' '.join(theCommands)) | ||
2308 | 75 | return False, None | ||
2309 | 76 | |||
2310 | 77 | # Getting stdout | ||
2311 | 78 | out, err = result.communicate() | ||
2312 | 79 | |||
2313 | 80 | # Return results | ||
2314 | 81 | return (result.returncode==0) | ||
2315 | 82 | |||
2316 | 0 | 83 | ||
2317 | === modified file 'madanalysis/UpdateNotes.txt' | |||
2318 | --- madanalysis/UpdateNotes.txt 2013-10-29 09:21:58 +0000 | |||
2319 | +++ madanalysis/UpdateNotes.txt 2014-05-17 19:51:11 +0000 | |||
2320 | @@ -1,5 +1,89 @@ | |||
2321 | 1 | Update notes for MadAnalysis 5 (in reverse time order) | 1 | Update notes for MadAnalysis 5 (in reverse time order) |
2322 | 2 | 2 | ||
2323 | 3 | 123 1.1.10.35 (2014/05/09) fuks: Still a missing foot->footer replacement | ||
2324 | 4 | |||
2325 | 5 | 122 1.1.10.34 (2014/05/07) fuks: saffoot -> saffooter | ||
2326 | 6 | |||
2327 | 7 | 116 1.1.10.33 (2014/04/30) fuks: Moving ToRestFrame to the MCParticleFormat class | ||
2328 | 8 | |||
2329 | 9 | 115 1.1.10.32 (2014/04/29) fuks: Splitting the physics services in subcategories | ||
2330 | 10 | |||
2331 | 11 | 114 1.1.10.31 (2014/04/22) fuks: Renaming Daughter into daughter in sampleanalyzer | ||
2332 | 12 | |||
2333 | 13 | 113 1.1.10.30 (2014/03/10) fuks: Fixing bug in the mewanalyzer script | ||
2334 | 14 | |||
2335 | 15 | 112 1.1.10.29 (2014/03/10) fuks: updating the newanalyzer script | ||
2336 | 16 | |||
2337 | 17 | 110 1.1.10.28 (2014/02/11) fuks: Fixing minor bug when providing the wrong number of arguments to an | ||
2338 | 18 | observable (thanks to B.Dumont) | ||
2339 | 19 | |||
2340 | 20 | 109 1.1.10.27 (2014/02/11) fuks: Removing the old filter infrastructure | ||
2341 | 21 | |||
2342 | 22 | 108 1.1.10.26 (2014/02/11) fuks: Updating the expert mode: adding new analyses to an existing | ||
2343 | 23 | template directory | ||
2344 | 24 | |||
2345 | 25 | 107 1.1.10.25 (2014/02/06) fuks: Creation of an analysis template - changes in the file naming | ||
2346 | 26 | |||
2347 | 27 | 106 1.1.10.24 (2014/02/06) fuks: problems with wgetting fastjet on some machines | ||
2348 | 28 | |||
2349 | 29 | 105 1.1.10.23 (2014/02/05) fuks: Few bugs corrected in the mt2w implementation (thanks to Jeremy | ||
2350 | 30 | Bernon and Beranger Dumont) | ||
2351 | 31 | |||
2352 | 32 | 104 1.1.10.22 (2014/01/31) fuks: Implementation of the MT2W variable + sorting functions | ||
2353 | 33 | |||
2354 | 34 | 103 1.1.10.21 (2014/01/29) fuks: new methods :dphi_0_pi and sphi_0_2pi (both at the python and c++ | ||
2355 | 35 | levels) | ||
2356 | 36 | |||
2357 | 37 | 102 1.1.10.20 (2014/01/28) fuks: Cleaning conflicts between delfes and delphes | ||
2358 | 38 | |||
2359 | 39 | 97 1.1.10.19 (2014/01/17) bfuks: Beranger's suggestion for a IsSurviving function to be called from | ||
2360 | 40 | the manager | ||
2361 | 41 | |||
2362 | 42 | 96 1.1.10.18 (2014/01/17) bfuks: Beranger's suggestion for adding cuts/histos with one single RS: | ||
2363 | 43 | added | ||
2364 | 44 | |||
2365 | 45 | 95 1.1.10.17 (2014/01/16) bfuks: Bug with the "AllSurviving" function fixed | ||
2366 | 46 | |||
2367 | 47 | 90 1.1.10.16 (2014/01/09) bfuks: Charge is now a int and not a float anymore. Small related fixes | ||
2368 | 48 | |||
2369 | 49 | 89 1.1.10.15 (2014/01/06) bfuks: small bug fix | ||
2370 | 50 | |||
2371 | 51 | 88 1.1.10.14 (2013/12/12) bfuks: Check added in the case one wants to fill a histo for which some | ||
2372 | 52 | (but not all) SRs fails the cuts applied so far (thanks to Beranger) | ||
2373 | 53 | |||
2374 | 54 | 87 1.1.10.13 (2013/12/12) bfuks: Extended expert mode output: cleaning (cf. discussions with Chris) | ||
2375 | 55 | |||
2376 | 56 | 86 1.1.10.12 (2013/12/11) bfuks: Updating output format for the histo headers (extended expert mode) | ||
2377 | 57 | |||
2378 | 58 | 85 1.1.10.11 (2013/12/05) bfuks: Second Bug fix related to question #233529 | ||
2379 | 59 | |||
2380 | 60 | 84 1.1.10.10 (2013/12/04) bfuks: Bug fix related to question #233529 | ||
2381 | 61 | |||
2382 | 62 | 83 1.1.10.9 (2013/12/03) bfuks: Small bug in the MT2 routine (thanks to J. Bernon) | ||
2383 | 63 | |||
2384 | 64 | 81 1.1.10.8 (2013/12/02) bfuks: New output structure dedicated to multianalyses; few bug fixes | ||
2385 | 65 | |||
2386 | 66 | 80 1.1.10.7 (2013/11/29) bfuks: Bug in jetclustering + allowing for defining invisible particles via | ||
2387 | 67 | the invisible multiparticle in the reco mode | ||
2388 | 68 | |||
2389 | 69 | 79 1.1.10.6 (2013/11/28) bfuks: Problem with the MET in the simplified LHE format used by madgraph | ||
2390 | 70 | (question #239543) | ||
2391 | 71 | |||
2392 | 72 | 78 1.1.10.5 (2013/11/28) bfuks: Fixing clang issue (bug #1250337) | ||
2393 | 73 | |||
2394 | 74 | 76 1.1.10.4 (2013/11/28) bfuks: updating the versioning for the development version | ||
2395 | 75 | |||
2396 | 76 | 75 1.1.10.3 (2013/11/28) bfuks: MT2 variable + macos change of stdc++ library + cleaning of the | ||
2397 | 77 | welcome message | ||
2398 | 78 | |||
2399 | 79 | 74 1.1.10.2 (2013/11/19) bfuks: MultiAnalyses are now possible in the expert mode; output still to | ||
2400 | 80 | be implemented | ||
2401 | 81 | |||
2402 | 82 | 72 1.1.10.1 (2013/11/14) bfuks: small modifications in the view of including the signal region | ||
2403 | 83 | object | ||
2404 | 84 | |||
2405 | 85 | 71 1.1.10.0 (2013/11/04) bfuks: use of names with the counters | ||
2406 | 86 | |||
2407 | 3 | 80 1.1.9 (2013/10/28) ma5team: - adding Delphes interface + CMS/ATLAS cards | 87 | 80 1.1.9 (2013/10/28) ma5team: - adding Delphes interface + CMS/ATLAS cards |
2408 | 4 | - adding Delphes cards including pile-up | 88 | - adding Delphes cards including pile-up |
2409 | 5 | - the electric charge is now an integer at the reco level | 89 | - the electric charge is now an integer at the reco level |
2410 | 6 | 90 | ||
2411 | === added file 'madanalysis/configuration/delfes_configuration.py' | |||
2412 | --- madanalysis/configuration/delfes_configuration.py 1970-01-01 00:00:00 +0000 | |||
2413 | +++ madanalysis/configuration/delfes_configuration.py 2014-05-17 19:51:11 +0000 | |||
2414 | @@ -0,0 +1,156 @@ | |||
2415 | 1 | ################################################################################ | ||
2416 | 2 | # | ||
2417 | 3 | # Copyright (C) 2012-2013 Eric Conte, Benjamin Fuks | ||
2418 | 4 | # The MadAnalysis development team, email: <ma5team@iphc.cnrs.fr> | ||
2419 | 5 | # | ||
2420 | 6 | # This file is part of MadAnalysis 5. | ||
2421 | 7 | # Official website: <https://launchpad.net/madanalysis5> | ||
2422 | 8 | # | ||
2423 | 9 | # MadAnalysis 5 is free software: you can redistribute it and/or modify | ||
2424 | 10 | # it under the terms of the GNU General Public License as published by | ||
2425 | 11 | # the Free Software Foundation, either version 3 of the License, or | ||
2426 | 12 | # (at your option) any later version. | ||
2427 | 13 | # | ||
2428 | 14 | # MadAnalysis 5 is distributed in the hope that it will be useful, | ||
2429 | 15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
2430 | 16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
2431 | 17 | # GNU General Public License for more details. | ||
2432 | 18 | # | ||
2433 | 19 | # You should have received a copy of the GNU General Public License | ||
2434 | 20 | # along with MadAnalysis 5. If not, see <http://www.gnu.org/licenses/> | ||
2435 | 21 | # | ||
2436 | 22 | ################################################################################ | ||
2437 | 23 | |||
2438 | 24 | |||
2439 | 25 | from madanalysis.enumeration.ma5_running_type import MA5RunningType | ||
2440 | 26 | import os | ||
2441 | 27 | import logging | ||
2442 | 28 | |||
2443 | 29 | class DelfesConfiguration: | ||
2444 | 30 | |||
2445 | 31 | userVariables = { "detector" : ["cms","atlas"],\ | ||
2446 | 32 | "output": ["true","false"],\ | ||
2447 | 33 | "pileup": ["none"] } | ||
2448 | 34 | |||
2449 | 35 | def __init__(self): | ||
2450 | 36 | self.detector = "cms" | ||
2451 | 37 | self.output = True | ||
2452 | 38 | self.pileup = "" | ||
2453 | 39 | self.card = "" | ||
2454 | 40 | self.SetCard() | ||
2455 | 41 | |||
2456 | 42 | def SetCard(self): | ||
2457 | 43 | if self.detector=='cms' and self.pileup=="": | ||
2458 | 44 | self.card = "delfes_card_CMS.tcl" | ||
2459 | 45 | elif self.detector=='cms' and self.pileup!="": | ||
2460 | 46 | self.card = "delfes_card_CMS_PileUp.tcl" | ||
2461 | 47 | elif self.detector=='atlas' and self.pileup=="": | ||
2462 | 48 | self.card = "delfes_card_ATLAS.tcl" | ||
2463 | 49 | elif self.detector=='atlas' and self.pileup!="": | ||
2464 | 50 | self.card = "delfes_card_ATLAS_PileUp.tcl" | ||
2465 | 51 | |||
2466 | 52 | def Display(self): | ||
2467 | 53 | self.user_DisplayParameter("detector") | ||
2468 | 54 | self.user_DisplayParameter("output") | ||
2469 | 55 | self.user_DisplayParameter("pileup") | ||
2470 | 56 | |||
2471 | 57 | |||
2472 | 58 | def user_DisplayParameter(self,parameter): | ||
2473 | 59 | if parameter=="detector": | ||
2474 | 60 | logging.info(" detector : "+self.detector) | ||
2475 | 61 | return | ||
2476 | 62 | elif parameter=="output": | ||
2477 | 63 | if self.output: | ||
2478 | 64 | msg="true" | ||
2479 | 65 | else: | ||
2480 | 66 | msg="false" | ||
2481 | 67 | logging.info(" ROOT output : "+msg) | ||
2482 | 68 | return | ||
2483 | 69 | elif parameter=="pileup": | ||
2484 | 70 | if self.pileup=="": | ||
2485 | 71 | msg="none" | ||
2486 | 72 | else: | ||
2487 | 73 | msg='"'+self.pileup+'"' | ||
2488 | 74 | logging.info(" pile-up source = "+msg) | ||
2489 | 75 | |||
2490 | 76 | def SampleAnalyzerConfigString(self): | ||
2491 | 77 | mydict = {} | ||
2492 | 78 | if self.output: | ||
2493 | 79 | mydict['output'] = '1' | ||
2494 | 80 | else: | ||
2495 | 81 | mydict['output'] = '0' | ||
2496 | 82 | return mydict | ||
2497 | 83 | |||
2498 | 84 | def user_SetParameter(self,parameter,value,datasets,level): | ||
2499 | 85 | |||
2500 | 86 | # algorithm | ||
2501 | 87 | if parameter=="detector": | ||
2502 | 88 | |||
2503 | 89 | if value.lower()=="cms": | ||
2504 | 90 | self.detector=value | ||
2505 | 91 | self.SetCard() | ||
2506 | 92 | elif value.lower()=="atlas": | ||
2507 | 93 | self.detector=value | ||
2508 | 94 | self.SetCard() | ||
2509 | 95 | else: | ||
2510 | 96 | logging.error("algorithm called '"+value+"' is not found.") | ||
2511 | 97 | return | ||
2512 | 98 | |||
2513 | 99 | # output | ||
2514 | 100 | elif parameter=="output": | ||
2515 | 101 | |||
2516 | 102 | if value.lower()=="true": | ||
2517 | 103 | self.output = True | ||
2518 | 104 | elif value.lower()=="false": | ||
2519 | 105 | self.output = False | ||
2520 | 106 | else: | ||
2521 | 107 | logging.error("allowed values for output are: true false") | ||
2522 | 108 | return | ||
2523 | 109 | |||
2524 | 110 | # pileup | ||
2525 | 111 | elif parameter=="pileup": | ||
2526 | 112 | quoteTag=False | ||
2527 | 113 | if value.startswith("'") and value.endswith("'"): | ||
2528 | 114 | quoteTag=True | ||
2529 | 115 | if value.startswith('"') and value.endswith('"'): | ||
2530 | 116 | quoteTag=True | ||
2531 | 117 | if quoteTag: | ||
2532 | 118 | value=value[1:-1] | ||
2533 | 119 | valuemin = value.lower() | ||
2534 | 120 | |||
2535 | 121 | # none | ||
2536 | 122 | if valuemin=="none": | ||
2537 | 123 | self.pileup = "" | ||
2538 | 124 | self.SetCard() | ||
2539 | 125 | |||
2540 | 126 | # .pileup | ||
2541 | 127 | elif valuemin.endswith(".pileup"): | ||
2542 | 128 | if not os.path.isfile(value): | ||
2543 | 129 | logging.error('File called "'+value+'" is not found') | ||
2544 | 130 | return | ||
2545 | 131 | self.pileup = value | ||
2546 | 132 | self.SetCard() | ||
2547 | 133 | return | ||
2548 | 134 | |||
2549 | 135 | # other case: error | ||
2550 | 136 | else: | ||
2551 | 137 | logging.error("The file format for the pile-up source is not known. Only files with .pileup extension can be used.") | ||
2552 | 138 | return False | ||
2553 | 139 | |||
2554 | 140 | else: | ||
2555 | 141 | logging.error("parameter called '"+parameter+"' does not exist") | ||
2556 | 142 | return | ||
2557 | 143 | |||
2558 | 144 | |||
2559 | 145 | def user_GetParameters(self): | ||
2560 | 146 | return DelfesConfiguration.userVariables.keys() | ||
2561 | 147 | |||
2562 | 148 | |||
2563 | 149 | def user_GetValues(self,variable): | ||
2564 | 150 | table = [] | ||
2565 | 151 | try: | ||
2566 | 152 | table.extend(DelfesConfiguration.userVariables[variable]) | ||
2567 | 153 | except: | ||
2568 | 154 | pass | ||
2569 | 155 | return table | ||
2570 | 156 | |||
2571 | 0 | 157 | ||
2572 | === modified file 'madanalysis/configuration/delphes_configuration.py' | |||
2573 | --- madanalysis/configuration/delphes_configuration.py 2013-10-27 21:05:18 +0000 | |||
2574 | +++ madanalysis/configuration/delphes_configuration.py 2014-05-17 19:51:11 +0000 | |||
2575 | @@ -36,7 +36,18 @@ | |||
2576 | 36 | self.detector = "cms" | 36 | self.detector = "cms" |
2577 | 37 | self.output = True | 37 | self.output = True |
2578 | 38 | self.pileup = "" | 38 | self.pileup = "" |
2579 | 39 | self.card = "" | ||
2580 | 40 | self.SetCard() | ||
2581 | 39 | 41 | ||
2582 | 42 | def SetCard(self): | ||
2583 | 43 | if self.detector=='cms' and self.pileup=="": | ||
2584 | 44 | self.card = "delphes_card_CMS.tcl" | ||
2585 | 45 | elif self.detector=='cms' and self.pileup!="": | ||
2586 | 46 | self.card = "delphes_card_CMS_PileUp.tcl" | ||
2587 | 47 | elif self.detector=='atlas' and self.pileup=="": | ||
2588 | 48 | self.card = "delphes_card_ATLAS.tcl" | ||
2589 | 49 | elif self.detector=='atlas' and self.pileup!="": | ||
2590 | 50 | self.card = "delphes_card_ATLAS_PileUp.tcl" | ||
2591 | 40 | 51 | ||
2592 | 41 | def Display(self): | 52 | def Display(self): |
2593 | 42 | self.user_DisplayParameter("detector") | 53 | self.user_DisplayParameter("detector") |
2594 | @@ -77,8 +88,10 @@ | |||
2595 | 77 | 88 | ||
2596 | 78 | if value.lower()=="cms": | 89 | if value.lower()=="cms": |
2597 | 79 | self.detector=value | 90 | self.detector=value |
2598 | 91 | self.SetCard() | ||
2599 | 80 | elif value.lower()=="atlas": | 92 | elif value.lower()=="atlas": |
2600 | 81 | self.detector=value | 93 | self.detector=value |
2601 | 94 | self.SetCard() | ||
2602 | 82 | else: | 95 | else: |
2603 | 83 | logging.error("algorithm called '"+value+"' is not found.") | 96 | logging.error("algorithm called '"+value+"' is not found.") |
2604 | 84 | return | 97 | return |
2605 | @@ -108,6 +121,7 @@ | |||
2606 | 108 | # none | 121 | # none |
2607 | 109 | if valuemin=="none": | 122 | if valuemin=="none": |
2608 | 110 | self.pileup = "" | 123 | self.pileup = "" |
2609 | 124 | self.SetCard() | ||
2610 | 111 | 125 | ||
2611 | 112 | # .pileup | 126 | # .pileup |
2612 | 113 | elif valuemin.endswith(".pileup"): | 127 | elif valuemin.endswith(".pileup"): |
2613 | @@ -115,6 +129,7 @@ | |||
2614 | 115 | logging.error('File called "'+value+'" is not found') | 129 | logging.error('File called "'+value+'" is not found') |
2615 | 116 | return | 130 | return |
2616 | 117 | self.pileup = value | 131 | self.pileup = value |
2617 | 132 | self.SetCard() | ||
2618 | 118 | return | 133 | return |
2619 | 119 | 134 | ||
2620 | 120 | # other case: error | 135 | # other case: error |
2621 | 121 | 136 | ||
2622 | === modified file 'madanalysis/configuration/fastsim_configuration.py' | |||
2623 | --- madanalysis/configuration/fastsim_configuration.py 2013-09-29 22:12:23 +0000 | |||
2624 | +++ madanalysis/configuration/fastsim_configuration.py 2014-05-17 19:51:11 +0000 | |||
2625 | @@ -22,18 +22,20 @@ | |||
2626 | 22 | ################################################################################ | 22 | ################################################################################ |
2627 | 23 | 23 | ||
2628 | 24 | 24 | ||
2630 | 25 | from madanalysis.enumeration.ma5_running_type import MA5RunningType | 25 | from madanalysis.enumeration.ma5_running_type import MA5RunningType |
2631 | 26 | from madanalysis.configuration.clustering_configuration import ClusteringConfiguration | 26 | from madanalysis.configuration.clustering_configuration import ClusteringConfiguration |
2633 | 27 | from madanalysis.configuration.delphes_configuration import DelphesConfiguration | 27 | from madanalysis.configuration.delphes_configuration import DelphesConfiguration |
2634 | 28 | from madanalysis.configuration.delfes_configuration import DelfesConfiguration | ||
2635 | 28 | import logging | 29 | import logging |
2636 | 29 | 30 | ||
2637 | 30 | class FastsimConfiguration: | 31 | class FastsimConfiguration: |
2638 | 31 | 32 | ||
2640 | 32 | userVariables = { "package" : ["fastjet","delphes","none"] } | 33 | userVariables = { "package" : ["fastjet","delphes","delfes","none"] } |
2641 | 33 | 34 | ||
2642 | 34 | def __init__(self): | 35 | def __init__(self): |
2643 | 35 | self.clustering = 0 | 36 | self.clustering = 0 |
2644 | 36 | self.delphes = 0 | 37 | self.delphes = 0 |
2645 | 38 | self.delfes = 0 | ||
2646 | 37 | self.package = "none" | 39 | self.package = "none" |
2647 | 38 | 40 | ||
2648 | 39 | 41 | ||
2649 | @@ -43,6 +45,8 @@ | |||
2650 | 43 | self.clustering.Display() | 45 | self.clustering.Display() |
2651 | 44 | elif self.package=="delphes": | 46 | elif self.package=="delphes": |
2652 | 45 | self.delphes.Display() | 47 | self.delphes.Display() |
2653 | 48 | elif self.package=="delfes": | ||
2654 | 49 | self.delfes.Display() | ||
2655 | 46 | 50 | ||
2656 | 47 | 51 | ||
2657 | 48 | def user_DisplayParameter(self,parameter): | 52 | def user_DisplayParameter(self,parameter): |
2658 | @@ -53,6 +57,8 @@ | |||
2659 | 53 | self.clustering.user_DisplayParameter(parameter) | 57 | self.clustering.user_DisplayParameter(parameter) |
2660 | 54 | elif self.package=="delphes": | 58 | elif self.package=="delphes": |
2661 | 55 | self.delphes.user_DisplayParameter(parameter) | 59 | self.delphes.user_DisplayParameter(parameter) |
2662 | 60 | elif self.package=="delfes": | ||
2663 | 61 | self.delfes.user_DisplayParameter(parameter) | ||
2664 | 56 | 62 | ||
2665 | 57 | 63 | ||
2666 | 58 | def SampleAnalyzerConfigString(self): | 64 | def SampleAnalyzerConfigString(self): |
2667 | @@ -64,11 +70,15 @@ | |||
2668 | 64 | mydict = {} | 70 | mydict = {} |
2669 | 65 | mydict.update(self.delphes.SampleAnalyzerConfigString()) | 71 | mydict.update(self.delphes.SampleAnalyzerConfigString()) |
2670 | 66 | return mydict | 72 | return mydict |
2671 | 73 | elif self.package=="delfes": | ||
2672 | 74 | mydict = {} | ||
2673 | 75 | mydict.update(self.delfes.SampleAnalyzerConfigString()) | ||
2674 | 76 | return mydict | ||
2675 | 67 | else: | 77 | else: |
2676 | 68 | return {} | 78 | return {} |
2677 | 69 | 79 | ||
2678 | 70 | 80 | ||
2680 | 71 | def user_SetParameter(self,parameter,value,datasets,level,fastjet,delphes): | 81 | def user_SetParameter(self,parameter,value,datasets,level,fastjet,delphes,delfes): |
2681 | 72 | 82 | ||
2682 | 73 | # algorithm | 83 | # algorithm |
2683 | 74 | if parameter=="package": | 84 | if parameter=="package": |
2684 | @@ -89,11 +99,12 @@ | |||
2685 | 89 | test=False | 99 | test=False |
2686 | 90 | break | 100 | break |
2687 | 91 | if not test: | 101 | if not test: |
2689 | 92 | logging.error("some datasets contain partonic/hadronic file format. Fast-simulation package cannot be switched off.") | 102 | logging.error("some datasets contain partonic/hadronic file format. "+\ |
2690 | 103 | "Fast-simulation package cannot be switched off.") | ||
2691 | 93 | return | 104 | return |
2692 | 94 | 105 | ||
2693 | 95 | # Switch on the clustering | 106 | # Switch on the clustering |
2695 | 96 | elif value in ["fastjet","delphes"]: | 107 | elif value in ["fastjet","delphes","delfes"]: |
2696 | 97 | 108 | ||
2697 | 98 | # Only in reco mode | 109 | # Only in reco mode |
2698 | 99 | if level!=MA5RunningType.RECO: | 110 | if level!=MA5RunningType.RECO: |
2699 | @@ -110,6 +121,11 @@ | |||
2700 | 110 | logging.error("delphes library is not installed. This fast-simulation package is not available.") | 121 | logging.error("delphes library is not installed. This fast-simulation package is not available.") |
2701 | 111 | return | 122 | return |
2702 | 112 | 123 | ||
2703 | 124 | # Delfes ? | ||
2704 | 125 | if value=='delfes' and not delfes: | ||
2705 | 126 | logging.error("delfes library is not installed. This fast-simulation package is not available.") | ||
2706 | 127 | return | ||
2707 | 128 | |||
2708 | 113 | test=True | 129 | test=True |
2709 | 114 | for dataset in datasets: | 130 | for dataset in datasets: |
2710 | 115 | if not test: | 131 | if not test: |
2711 | @@ -128,14 +144,22 @@ | |||
2712 | 128 | self.package="fastjet" | 144 | self.package="fastjet" |
2713 | 129 | self.clustering = ClusteringConfiguration() | 145 | self.clustering = ClusteringConfiguration() |
2714 | 130 | self.delphes = 0 | 146 | self.delphes = 0 |
2715 | 147 | self.delfes = 0 | ||
2716 | 131 | elif value=="delphes": | 148 | elif value=="delphes": |
2717 | 132 | self.package="delphes" | 149 | self.package="delphes" |
2718 | 133 | self.clustering = 0 | 150 | self.clustering = 0 |
2719 | 134 | self.delphes = DelphesConfiguration() | 151 | self.delphes = DelphesConfiguration() |
2720 | 152 | self.delfes = 0 | ||
2721 | 153 | elif value=="delfes": | ||
2722 | 154 | self.package="delfes" | ||
2723 | 155 | self.clustering = 0 | ||
2724 | 156 | self.delphes = 0 | ||
2725 | 157 | self.delfes = DelfesConfiguration() | ||
2726 | 135 | elif value=="none": | 158 | elif value=="none": |
2727 | 136 | self.package="none" | 159 | self.package="none" |
2728 | 137 | self.clustering = 0 | 160 | self.clustering = 0 |
2729 | 138 | self.delphes = 0 | 161 | self.delphes = 0 |
2730 | 162 | self.delfes = 0 | ||
2731 | 139 | else: | 163 | else: |
2732 | 140 | logging.error("parameter called '"+value+"' is not found.") | 164 | logging.error("parameter called '"+value+"' is not found.") |
2733 | 141 | return | 165 | return |
2734 | @@ -150,6 +174,8 @@ | |||
2735 | 150 | return self.clustering.user_SetParameter(parameter,value,datasets,level) | 174 | return self.clustering.user_SetParameter(parameter,value,datasets,level) |
2736 | 151 | elif self.package=="delphes": | 175 | elif self.package=="delphes": |
2737 | 152 | return self.delphes.user_SetParameter(parameter,value,datasets,level) | 176 | return self.delphes.user_SetParameter(parameter,value,datasets,level) |
2738 | 177 | elif self.package=="delfes": | ||
2739 | 178 | return self.delfes.user_SetParameter(parameter,value,datasets,level) | ||
2740 | 153 | 179 | ||
2741 | 154 | 180 | ||
2742 | 155 | def user_GetParameters(self): | 181 | def user_GetParameters(self): |
2743 | @@ -159,6 +185,9 @@ | |||
2744 | 159 | elif self.package=="delphes": | 185 | elif self.package=="delphes": |
2745 | 160 | table = FastsimConfiguration.userVariables.keys() | 186 | table = FastsimConfiguration.userVariables.keys() |
2746 | 161 | table.extend(self.delphes.user_GetParameters()) | 187 | table.extend(self.delphes.user_GetParameters()) |
2747 | 188 | elif self.package=="delfes": | ||
2748 | 189 | table = FastsimConfiguration.userVariables.keys() | ||
2749 | 190 | table.extend(self.delfes.user_GetParameters()) | ||
2750 | 162 | else: | 191 | else: |
2751 | 163 | table = ["package"] | 192 | table = ["package"] |
2752 | 164 | return table | 193 | return table |
2753 | @@ -184,6 +213,15 @@ | |||
2754 | 184 | table.extend(self.delphes.user_GetValues(variable)) | 213 | table.extend(self.delphes.user_GetValues(variable)) |
2755 | 185 | except: | 214 | except: |
2756 | 186 | pass | 215 | pass |
2757 | 216 | elif self.package=="delfes": | ||
2758 | 217 | try: | ||
2759 | 218 | table.extend(FastsimConfiguration.userVariables[variable]) | ||
2760 | 219 | except: | ||
2761 | 220 | pass | ||
2762 | 221 | try: | ||
2763 | 222 | table.extend(self.delfes.user_GetValues(variable)) | ||
2764 | 223 | except: | ||
2765 | 224 | pass | ||
2766 | 187 | else: | 225 | else: |
2767 | 188 | if variable=="package": | 226 | if variable=="package": |
2768 | 189 | table.extend(FastsimConfiguration.userVariables["package"]) | 227 | table.extend(FastsimConfiguration.userVariables["package"]) |
2769 | 190 | 228 | ||
2770 | === modified file 'madanalysis/core/config_checker.py' | |||
2771 | --- madanalysis/core/config_checker.py 2013-10-27 21:36:24 +0000 | |||
2772 | +++ madanalysis/core/config_checker.py 2014-05-17 19:51:11 +0000 | |||
2773 | @@ -39,9 +39,10 @@ | |||
2774 | 39 | container.append(item) | 39 | container.append(item) |
2775 | 40 | 40 | ||
2776 | 41 | 41 | ||
2778 | 42 | def __init__(self,configLinux,ma5dir,script=False): | 42 | def __init__(self,configLinux,ma5dir,script=False,isMAC=False): |
2779 | 43 | 43 | ||
2780 | 44 | # Getting parameter from the main program | 44 | # Getting parameter from the main program |
2781 | 45 | self.isMAC=isMAC | ||
2782 | 45 | self.configLinux=configLinux | 46 | self.configLinux=configLinux |
2783 | 46 | self.ma5dir=ma5dir | 47 | self.ma5dir=ma5dir |
2784 | 47 | self.script=script | 48 | self.script=script |
2785 | @@ -56,6 +57,74 @@ | |||
2786 | 56 | self.fillHeaders() | 57 | self.fillHeaders() |
2787 | 57 | 58 | ||
2788 | 58 | 59 | ||
2789 | 60 | def ReadUserOptions(self): | ||
2790 | 61 | |||
2791 | 62 | # Open the user options | ||
2792 | 63 | filename = self.ma5dir+'/madanalysis/input/installation_options.dat' | ||
2793 | 64 | try: | ||
2794 | 65 | input = open(filename) | ||
2795 | 66 | except: | ||
2796 | 67 | logging.error('impossible to open the file: '+filename) | ||
2797 | 68 | return False | ||
2798 | 69 | |||
2799 | 70 | # Loop over the file | ||
2800 | 71 | for rawline in input: | ||
2801 | 72 | |||
2802 | 73 | if '#' in rawline: | ||
2803 | 74 | line = rawline.split('#')[0] | ||
2804 | 75 | if line=='': | ||
2805 | 76 | continue | ||
2806 | 77 | words=line.split('=') | ||
2807 | 78 | if len(words)!=2: | ||
2808 | 79 | logging.warning(filename+': the following line is incorrect and is skipped:') | ||
2809 | 80 | logging.warning(line) | ||
2810 | 81 | words[0]=words[0].lstrip() | ||
2811 | 82 | words[0]=words[0].rstrip() | ||
2812 | 83 | words[1]=words[1].lstrip() | ||
2813 | 84 | words[1]=words[1].rstrip() | ||
2814 | 85 | |||
2815 | 86 | if words[0]=='root_includes': | ||
2816 | 87 | self.configLinux.useroptions.root_includes==words[1] | ||
2817 | 88 | elif words[0]=='root_libs': | ||
2818 | 89 | self.configLinux.useroptions.root_libs=words[1] | ||
2819 | 90 | elif words[0]=='delphes_veto': | ||
2820 | 91 | self.configLinux.useroptions.delphes_veto=words[1] | ||
2821 | 92 | elif words[0]=='delphes_includes': | ||
2822 | 93 | self.configLinux.useroptions.delphes_includes=words[1] | ||
2823 | 94 | elif words[0]=='delphes_libs': | ||
2824 | 95 | self.configLinux.useroptions.delphes_libs=words[1] | ||
2825 | 96 | elif words[0]=='delfes_veto': | ||
2826 | 97 | self.configLinux.useroptions.delfes_veto=words[1] | ||
2827 | 98 | elif words[0]=='delfes_includes': | ||
2828 | 99 | self.configLinux.useroptions.delfes_includes=words[1] | ||
2829 | 100 | elif words[0]=='delfes_libs': | ||
2830 | 101 | self.configLinux.useroptions.delfes_libs=words[1] | ||
2831 | 102 | elif words[0]=='zlib_veto': | ||
2832 | 103 | self.configLinux.useroptions.zlib_veto=words[1] | ||
2833 | 104 | elif words[0]=='zlib_includes': | ||
2834 | 105 | self.configLinux.useroptions.zlib_includes=words[1] | ||
2835 | 106 | elif words[0]=='zlib_libs': | ||
2836 | 107 | self.configLinux.useroptions.zlib_libs=words[1] | ||
2837 | 108 | elif words[0]=='fastjet_veto': | ||
2838 | 109 | self.configLinux.useroptions.fastjet_veto=words[1] | ||
2839 | 110 | elif words[0]=='fastjet_bin_path': | ||
2840 | 111 | self.configLinux.useroptions.fastjet_bin_path=words[1] | ||
2841 | 112 | elif words[0]=='pdflatex_veto': | ||
2842 | 113 | self.configLinux.useroptions.pdflatex_veto=words[1] | ||
2843 | 114 | elif words[0]=='latex_veto': | ||
2844 | 115 | self.configLinux.useroptions.latex_veto=words[1] | ||
2845 | 116 | elif words[0]=='dvipdf_veto': | ||
2846 | 117 | self.configLinux.useroptions.dvipdf_veto=words[1] | ||
2847 | 118 | else: | ||
2848 | 119 | logging.warning(filename+': the options called "'+words[0]+'" is not found') | ||
2849 | 120 | |||
2850 | 121 | # Close the file | ||
2851 | 122 | input.close() | ||
2852 | 123 | |||
2853 | 124 | # Ok | ||
2854 | 125 | return True | ||
2855 | 126 | |||
2856 | 127 | |||
2857 | 59 | def FillMA5Path(self): | 128 | def FillMA5Path(self): |
2858 | 60 | os.environ['MA5_BASE']=self.ma5dir | 129 | os.environ['MA5_BASE']=self.ma5dir |
2859 | 61 | 130 | ||
2860 | @@ -89,6 +158,7 @@ | |||
2861 | 89 | 158 | ||
2862 | 90 | 159 | ||
2863 | 91 | def fillHeaders(self): | 160 | def fillHeaders(self): |
2864 | 161 | |||
2865 | 92 | # Filling container with paths included in CPLUS_INCLUDE_PATH | 162 | # Filling container with paths included in CPLUS_INCLUDE_PATH |
2866 | 93 | try: | 163 | try: |
2867 | 94 | cplus_include_path = os.environ['CPLUS_INCLUDE_PATH'].split(':') | 164 | cplus_include_path = os.environ['CPLUS_INCLUDE_PATH'].split(':') |
2868 | @@ -146,76 +216,74 @@ | |||
2869 | 146 | # Checking if ROOT is present | 216 | # Checking if ROOT is present |
2870 | 147 | self.PrintLibrary('Root') | 217 | self.PrintLibrary('Root') |
2871 | 148 | 218 | ||
2872 | 219 | # Does the user force the ROOT path | ||
2873 | 220 | force1=False | ||
2874 | 221 | force2=False | ||
2875 | 222 | if self.configLinux.useroptions.root_includes!='0': | ||
2876 | 223 | self.configLinux.root_inc_path=self.configLinux.useroptions.root_includes | ||
2877 | 224 | force1=True | ||
2878 | 225 | if self.configLinux.useroptions.root_libs!='0': | ||
2879 | 226 | self.configLinux.root_lib_path=self.configLinux.useroptions.root_libs | ||
2880 | 227 | force2=True | ||
2881 | 228 | force=force1 and force2 | ||
2882 | 229 | |||
2883 | 149 | # Trying to call root-config | 230 | # Trying to call root-config |
2907 | 150 | rootdirs = commands.getstatusoutput('root-config --libdir --incdir') | 231 | if not force: |
2908 | 151 | if rootdirs[0]>0: | 232 | |
2909 | 152 | self.PrintFAIL(warning=False) | 233 | # Using root-config |
2910 | 153 | logging.error('ROOT module called "root-config" is not detected.\n'\ | 234 | rootdirs = commands.getstatusoutput('root-config --libdir --incdir') |
2911 | 154 | +'Two explanations :n'\ | 235 | if rootdirs[0]>0: |
2912 | 155 | +' - ROOT is not installed. You can download it '\ | 236 | self.PrintFAIL(warning=False) |
2913 | 156 | +'from http://root.cern.ch\n'\ | 237 | logging.error('ROOT module called "root-config" is not detected.\n'\ |
2914 | 157 | +' - ROOT binary folder must be placed in the '\ | 238 | +'Two explanations :n'\ |
2915 | 158 | +'global environment variable $PATH') | 239 | +' - ROOT is not installed. You can download it '\ |
2916 | 159 | return False | 240 | +'from http://root.cern.ch\n'\ |
2917 | 160 | 241 | +' - ROOT binary folder must be placed in the '\ | |
2918 | 161 | # Extracting ROOT library and header path | 242 | +'global environment variable $PATH') |
2919 | 162 | root_tmp = rootdirs[1].split() | 243 | return False |
2920 | 163 | self.includes.append(root_tmp[1]) | 244 | |
2921 | 164 | self.libs.append(root_tmp[0]) | 245 | # Extracting ROOT library and header path |
2922 | 165 | os.environ['LD_LIBRARY_PATH'] = os.environ['LD_LIBRARY_PATH'] + \ | 246 | root_tmp = rootdirs[1].split() |
2923 | 166 | ":" + root_tmp[0] | 247 | self.configLinux.root_inc_path = root_tmp[1] |
2924 | 167 | os.environ['DYLD_LIBRARY_PATH'] = os.environ['DYLD_LIBRARY_PATH'] + \ | 248 | self.configLinux.root_lib_path = root_tmp[0] |
2902 | 168 | ":" + root_tmp[0] | ||
2903 | 169 | os.environ['LIBRARY_PATH'] = os.environ['LIBRARY_PATH'] + \ | ||
2904 | 170 | ":" + root_tmp[0] | ||
2905 | 171 | os.environ['CPLUS_INCLUDE_PATH'] = os.environ['CPLUS_INCLUDE_PATH'] + \ | ||
2906 | 172 | ":" + root_tmp[1] | ||
2925 | 173 | 249 | ||
2926 | 174 | # Adding ROOT library path to Python path | 250 | # Adding ROOT library path to Python path |
2968 | 175 | sys.path.append(root_tmp[0]) | 251 | sys.path.append(self.configLinux.root_lib_path) |
2969 | 176 | 252 | ||
2970 | 177 | # Looking for libPyROOT.so | 253 | # Check: looking for files |
2971 | 178 | find=False | 254 | FilesToFind=[self.configLinux.root_lib_path+'/libPyROOT.so', \ |
2972 | 179 | for item in self.libs: | 255 | self.configLinux.root_inc_path+'/TH1F.h'] |
2973 | 180 | files=glob.glob(item+"/libPyROOT.so") | 256 | for file in FilesToFind: |
2974 | 181 | if len(files)!=0: | 257 | if os.path.isfile(file): |
2975 | 182 | self.configLinux.libraries['PyROOT']=files[0]+":"+str(os.stat(files[0]).st_mtime) | 258 | self.configLinux.libraries[file.split('/')[-1]]=file+":"+str(os.stat(file).st_mtime) |
2976 | 183 | find=True | 259 | else: |
2977 | 184 | break | 260 | self.PrintFAIL(warning=False) |
2978 | 185 | if not find: | 261 | logging.error("ROOT file called '"+file+"' is not found") |
2979 | 186 | self.PrintFAIL(warning=False) | 262 | logging.error("Please check that ROOT is properly installed.") |
2980 | 187 | logging.error("ROOT library called 'libPyROOT.so' not found. Please check that ROOT is properly installed.") | 263 | return False |
2981 | 188 | return False | 264 | |
2982 | 189 | 265 | # Check: looking for files | |
2983 | 190 | # Looking for ROOT.py | 266 | FilesToFind=[self.configLinux.root_lib_path+'/ROOT.py', \ |
2984 | 191 | find=False | 267 | self.configLinux.root_lib_path+'/ROOT.pyc'] |
2985 | 192 | for item in self.libs: | 268 | found=False |
2986 | 193 | files=glob.glob(item+"/ROOT.py") | 269 | for file in FilesToFind: |
2987 | 194 | if len(files)!=0: | 270 | if os.path.isfile(file): |
2988 | 195 | self.configLinux.libraries['ROOT']=files[0]+":"+str(os.stat(files[0]).st_mtime) | 271 | self.configLinux.libraries[file.split('/')[-1]]=file+":"+str(os.stat(file).st_mtime) |
2989 | 196 | find=True | 272 | found=True |
2990 | 197 | break | 273 | break |
2991 | 198 | if not find: | 274 | if not found: |
2992 | 199 | self.PrintFAIL(warning=False) | 275 | self.PrintFAIL(warning=False) |
2993 | 200 | logging.error("ROOT file called 'ROOT.py' not found. Please check that ROOT is properly installed.") | 276 | logging.error("ROOT file called 'ROOT.py' or 'ROOT.pyc' is not found") |
2994 | 201 | return False | 277 | logging.error("Please check that ROOT is properly installed.") |
2995 | 202 | 278 | return False | |
2996 | 203 | # Looking for TH1F.h | 279 | |
2997 | 204 | find=False | 280 | # Root Install |
2957 | 205 | for item in self.includes: | ||
2958 | 206 | files=glob.glob(item+"/TH1F.h") | ||
2959 | 207 | if len(files)!=0: | ||
2960 | 208 | self.configLinux.headers['ROOT']=files[0]+":"+str(os.stat(files[0]).st_mtime) | ||
2961 | 209 | find=True | ||
2962 | 210 | break | ||
2963 | 211 | if not find: | ||
2964 | 212 | self.PrintFAIL(warning=False) | ||
2965 | 213 | logging.error("ROOT headers are not found. " +\ | ||
2966 | 214 | "Please check that ROOT is properly installed.") | ||
2967 | 215 | return False | ||
2998 | 216 | self.PrintOK() | 281 | self.PrintOK() |
3001 | 217 | 282 | return True | |
3002 | 218 | 283 | ||
3003 | 284 | |||
3004 | 285 | def checkPyROOT(self): | ||
3005 | 286 | |||
3006 | 219 | # Loading ROOT library | 287 | # Loading ROOT library |
3007 | 220 | self.PrintLibrary("PyRoot libraries") | 288 | self.PrintLibrary("PyRoot libraries") |
3008 | 221 | try : | 289 | try : |
3009 | @@ -272,6 +340,29 @@ | |||
3010 | 272 | return True | 340 | return True |
3011 | 273 | 341 | ||
3012 | 274 | 342 | ||
3013 | 343 | def checkMake(self): | ||
3014 | 344 | # Checking GNU Make | ||
3015 | 345 | self.PrintLibrary('GNU Make') | ||
3016 | 346 | make_version = commands.getstatusoutput('make --version') | ||
3017 | 347 | if make_version[0]>0: | ||
3018 | 348 | self.PrintFAIL(warning=False) | ||
3019 | 349 | logging.error('GNU Make not found. Please install it before ' + \ | ||
3020 | 350 | 'using MadAnalysis 5') | ||
3021 | 351 | return False | ||
3022 | 352 | else: | ||
3023 | 353 | self.PrintOK() | ||
3024 | 354 | lines=make_version[1].split('\n') | ||
3025 | 355 | if len(lines)==0: | ||
3026 | 356 | logging.error('command "make --version" seems to not give the GNU Make version') | ||
3027 | 357 | return False | ||
3028 | 358 | line=lines[0] | ||
3029 | 359 | line=line.replace(' ','') | ||
3030 | 360 | line=line.lstrip() | ||
3031 | 361 | line=line.rstrip() | ||
3032 | 362 | self.configLinux.make_version = line | ||
3033 | 363 | return True | ||
3034 | 364 | |||
3035 | 365 | |||
3036 | 275 | def checkGF(self): | 366 | def checkGF(self): |
3037 | 276 | self.PrintLibrary("gfortran") | 367 | self.PrintLibrary("gfortran") |
3038 | 277 | gfortran_version = commands.getstatusoutput('gfortran -dumpversion') | 368 | gfortran_version = commands.getstatusoutput('gfortran -dumpversion') |
3039 | @@ -285,14 +376,12 @@ | |||
3040 | 285 | gfortran_version = gfor.group(1) | 376 | gfortran_version = gfor.group(1) |
3041 | 286 | else: | 377 | else: |
3042 | 287 | self.PrintFAIL(warning=True) | 378 | self.PrintFAIL(warning=True) |
3045 | 288 | logging.warning('gfortran compiler not found.' + \ | 379 | logging.warning('gfortran compiler not found.') |
3044 | 289 | ' aMCatNLO cannot be used.') | ||
3046 | 290 | return True | 380 | return True |
3047 | 291 | ver = gfortran_version.split('.') | 381 | ver = gfortran_version.split('.') |
3048 | 292 | if (int(ver[0])<4) or (int(ver[0])==4 and int(ver[1])<4): | 382 | if (int(ver[0])<4) or (int(ver[0])==4 and int(ver[1])<4): |
3049 | 293 | self.PrintFAIL(warning=True) | 383 | self.PrintFAIL(warning=True) |
3052 | 294 | logging.warning('gfortran ' + gfortran_version + ' not recent enough (< 4.4.0).' +\ | 384 | logging.warning('gfortran ' + gfortran_version + ' older than 4.4.0.') |
3051 | 295 | ' aMCatNLO cannot be used.') | ||
3053 | 296 | return True | 385 | return True |
3054 | 297 | 386 | ||
3055 | 298 | self.configLinux.gfortran_version = gfortran_version | 387 | self.configLinux.gfortran_version = gfortran_version |
3056 | @@ -300,73 +389,112 @@ | |||
3057 | 300 | return True | 389 | return True |
3058 | 301 | 390 | ||
3059 | 302 | 391 | ||
3060 | 392 | def FindLibraryWithPattern(self,pattern,files): | ||
3061 | 393 | return self.FindFilesWithPattern(self.libs,pattern,files) | ||
3062 | 394 | |||
3063 | 395 | def FindHeader(self,file): | ||
3064 | 396 | return self.FindFilesWithPattern(self.includes,file,[file]) | ||
3065 | 397 | |||
3066 | 398 | def FindFilesWithPattern(self,paths,pattern,targets): | ||
3067 | 399 | result_files=[] | ||
3068 | 400 | result_paths=[] | ||
3069 | 401 | for path in paths: | ||
3070 | 402 | rawfiles=glob.glob(path+"/"+pattern) | ||
3071 | 403 | |||
3072 | 404 | filtered_files=[] | ||
3073 | 405 | for file in rawfiles: | ||
3074 | 406 | for target in targets: | ||
3075 | 407 | if file.endswith('/'+target): | ||
3076 | 408 | filtered_files.append(file) | ||
3077 | 409 | |||
3078 | 410 | if len(filtered_files)!=0: | ||
3079 | 411 | result_files.extend(filtered_files) | ||
3080 | 412 | for item in filtered_files: | ||
3081 | 413 | result_paths.append(path) | ||
3082 | 414 | |||
3083 | 415 | if len(result_files)==0: | ||
3084 | 416 | return "", "" | ||
3085 | 417 | else: | ||
3086 | 418 | return os.path.normpath(result_paths[0]), os.path.normpath(result_files[0]) | ||
3087 | 419 | |||
3088 | 420 | |||
3089 | 303 | def checkZLIB(self): | 421 | def checkZLIB(self): |
3090 | 304 | 422 | ||
3091 | 305 | self.PrintLibrary("zlib library") | 423 | self.PrintLibrary("zlib library") |
3156 | 306 | 424 | ||
3157 | 307 | # Checking library libz.so | 425 | # Name of the dynamic lib |
3158 | 308 | find=False | 426 | libnames=['libz.so','libz.a'] |
3159 | 309 | for item in self.libs: | 427 | if self.isMAC: |
3160 | 310 | files=glob.glob(item+"/libz.so") | 428 | libnames.append('libz.dylib') |
3161 | 311 | files.extend(glob.glob(item+"/libz.a")) | 429 | |
3162 | 312 | files.extend(glob.glob(item+"/libz.dylib")) | 430 | # User veto |
3163 | 313 | if len(files)!=0: | 431 | if self.configLinux.useroptions.zlib_veto=='1': |
3164 | 314 | self.configLinux.libraries['ZLib']=files[0]+":"+str(os.stat(files[0]).st_mtime) | 432 | self.PrintFAIL(warning=True) |
3165 | 315 | find=True | 433 | logging.warning("Library called 'zlib' disabled. Gzip format will be disabled.") |
3166 | 316 | os.environ['LD_LIBRARY_PATH'] = os.environ['LD_LIBRARY_PATH'] + \ | 434 | return False |
3167 | 317 | ":" + item | 435 | |
3168 | 318 | os.environ['DYLD_LIBRARY_PATH'] = os.environ['DYLD_LIBRARY_PATH'] + \ | 436 | # Does the user force the paths? |
3169 | 319 | ":" + item | 437 | force1=False |
3170 | 320 | os.environ['LIBRARY_PATH'] = os.environ['LIBRARY_PATH'] + \ | 438 | force2=False |
3171 | 321 | ":" + item | 439 | if self.configLinux.useroptions.zlib_includes!="0": |
3172 | 322 | break | 440 | self.configLinux.zlib_inc_path=self.configLinux.useroptions.zlib_includes |
3173 | 323 | 441 | force1=True | |
3174 | 324 | # If not, test if it is there locally | 442 | if self.configLinux.useroptions.zlib_libs!="0": |
3175 | 325 | if not find: | 443 | self.configLinux.zlib_lib_path=self.configLinux.useroptions.zlib_libraries |
3176 | 326 | item = self.ma5dir+'/tools/zlib/lib/' | 444 | force2=True |
3177 | 327 | files=glob.glob(item+"/libz.so") | 445 | force=force1 and force2 |
3178 | 328 | files.extend(glob.glob(item+"/libz.a")) | 446 | |
3179 | 329 | files.extend(glob.glob(item+"/libz.dylib")) | 447 | # Checking if zlib has been installed by MA5 |
3180 | 330 | if len(files)!=0: | 448 | ma5installation = False |
3181 | 331 | self.configLinux.libraries['ZLib']=files[0]+":"+str(os.stat(files[0]).st_mtime) | 449 | if not force: |
3182 | 332 | find=True | 450 | if os.path.isdir(self.ma5dir+'/tools/zlib'): |
3183 | 333 | os.environ['LD_LIBRARY_PATH'] = os.environ['LD_LIBRARY_PATH'] + \ | 451 | self.configLinux.zlib_inc_path=self.ma5dir+'/tools/zlib/include/' |
3184 | 334 | ":" + item | 452 | self.configLinux.zlib_lib_path=self.ma5dir+'/tools/zlib/lib/' |
3185 | 335 | os.environ['DYLD_LIBRARY_PATH'] = os.environ['DYLD_LIBRARY_PATH'] + \ | 453 | ma5installation = True |
3186 | 336 | ":" + item | 454 | |
3187 | 337 | os.environ['LIBRARY_PATH'] = os.environ['LIBRARY_PATH'] + \ | 455 | # Check if the libraries and headers are available |
3188 | 338 | ":" + item | 456 | if force or ma5installation: |
3189 | 339 | # Not fail -> Warning | 457 | |
3190 | 340 | if not find: | 458 | # header |
3191 | 341 | self.PrintFAIL(warning=True) | 459 | if not os.path.isfile(self.configLinux.zlib_inc_path+'/zlib.h'): |
3192 | 342 | logging.warning("Library called 'libz' not found. Gzip format will be disabled.") | 460 | self.PrintFAIL(warning=True) |
3193 | 343 | logging.warning("To enable this format, please type 'install zlib' package.") | 461 | logging.warning("Header file called '"+self.configLinux.zlib_inc_path+"'/zlib.h not found. Gzip format will be disabled.") |
3194 | 344 | return False | 462 | logging.warning("To enable this format, please type 'install zlib' package.") |
3195 | 345 | 463 | return False | |
3196 | 346 | # Checking header file zlib.h | 464 | |
3197 | 347 | find=False | 465 | # lib |
3198 | 348 | for item in self.includes: | 466 | mypath, myfile = self.FindFilesWithPattern([self.configLinux.zlib_lib_path],"libz.*",libnames) |
3199 | 349 | files=glob.glob(item+"/zlib.h") | 467 | self.configLinux.zlib_lib=myfile |
3200 | 350 | if len(files)!=0: | 468 | if self.configLinux.zlib_lib=="": |
3201 | 351 | self.configLinux.headers['ZLib']=files[0]+":"+str(os.stat(files[0]).st_mtime) | 469 | self.PrintFAIL(warning=True) |
3202 | 352 | find=True | 470 | logging.warning("Zlib library not found in "+self.configLinux.zlib_lib_path+" folder. Gzip format will be disabled.") |
3203 | 353 | os.environ['CPLUS_INCLUDE_PATH'] = os.environ['CPLUS_INCLUDE_PATH'] + ":" + item | 471 | logging.warning("To enable this format, please type 'install zlib' package.") |
3204 | 354 | break | 472 | return False |
3205 | 355 | 473 | ||
3206 | 356 | # If not, test if it is there locally | 474 | # Checking zlib can be found in other folders |
3207 | 357 | if not find: | 475 | if not force and not ma5installation: |
3208 | 358 | find=os.path.isfile(self.ma5dir+'/tools/zlib/include/zlib.h') | 476 | |
3209 | 359 | if find: | 477 | # header |
3210 | 360 | os.environ['CPLUS_INCLUDE_PATH'] = os.environ['CPLUS_INCLUDE_PATH'] + ":" + \ | 478 | mypath, myfile = self.FindHeader('zlib.h') |
3211 | 361 | self.ma5dir+'/tools/zlib/include/' | 479 | self.configLinux.zlib_inc_path = mypath |
3212 | 362 | 480 | if self.configLinux.zlib_inc_path=="": | |
3213 | 363 | if not find: | 481 | self.PrintFAIL(warning=True) |
3214 | 364 | self.PrintFAIL(warning=True) | 482 | logging.warning("Header file called 'zlib.h' not found. Gzip format will be disabled.") |
3215 | 365 | logging.warning("Header file called 'zlib.h' not found. Gzip format will be disabled.") | 483 | logging.warning("To enable this format, please type 'install zlib' package.") |
3216 | 366 | logging.warning("To enable this format, please type 'install zlib' package.") | 484 | return False |
3217 | 367 | return False | 485 | |
3218 | 368 | else: | 486 | # lib |
3219 | 369 | self.PrintOK() | 487 | mypath, myfile = self.FindLibraryWithPattern('libz.*',libnames) |
3220 | 488 | self.configLinux.zlib_lib_path = mypath | ||
3221 | 489 | self.configLinux.zlib_lib = myfile | ||
3222 | 490 | if self.configLinux.zlib_lib_path=="": | ||
3223 | 491 | self.PrintFAIL(warning=True) | ||
3224 | 492 | logging.warning("Library called 'zlib' not found. Gzip format will be disabled.") | ||
3225 | 493 | logging.warning("To enable this format, please type 'install zlib' package.") | ||
3226 | 494 | return False | ||
3227 | 495 | |||
3228 | 496 | self.configLinux.libraries['ZLib']=self.configLinux.zlib_lib+":"+str(os.stat(self.configLinux.zlib_lib).st_mtime) | ||
3229 | 497 | self.PrintOK() | ||
3230 | 370 | 498 | ||
3231 | 371 | return True | 499 | return True |
3232 | 372 | 500 | ||
3233 | @@ -374,72 +502,169 @@ | |||
3234 | 374 | def checkDelphes(self): | 502 | def checkDelphes(self): |
3235 | 375 | 503 | ||
3236 | 376 | self.PrintLibrary("delphes library") | 504 | self.PrintLibrary("delphes library") |
3303 | 377 | 505 | ||
3304 | 378 | # Checking library libDelphes.so | 506 | # Name of the dynamic lib |
3305 | 379 | find=False | 507 | libnames=['libDelphes.so','libDelphes.a'] |
3306 | 380 | for item in self.libs: | 508 | if self.isMAC: |
3307 | 381 | files=glob.glob(item+"/libDelphes.so") | 509 | libnames.append('libDelphes.dylib') |
3308 | 382 | files.extend(glob.glob(item+"/libDelphes.a")) | 510 | |
3309 | 383 | files.extend(glob.glob(item+"/libDelphes.dylib")) | 511 | # User veto |
3310 | 384 | if len(files)!=0: | 512 | if self.configLinux.useroptions.delphes_veto=='1': |
3311 | 385 | self.configLinux.libraries['Delphes']=files[0]+":"+str(os.stat(files[0]).st_mtime) | 513 | self.PrintFAIL(warning=True) |
3312 | 386 | find=True | 514 | logging.warning("Library called 'delphes' disabled. Delphes ROOT format will be disabled.") |
3313 | 387 | os.environ['LD_LIBRARY_PATH'] = os.environ['LD_LIBRARY_PATH'] + \ | 515 | return False |
3314 | 388 | ":" + item | 516 | |
3315 | 389 | os.environ['DYLD_LIBRARY_PATH'] = os.environ['DYLD_LIBRARY_PATH'] + \ | 517 | # Does the user force the paths? |
3316 | 390 | ":" + item | 518 | force1=False |
3317 | 391 | os.environ['LIBRARY_PATH'] = os.environ['LIBRARY_PATH'] + \ | 519 | force2=False |
3318 | 392 | ":" + item | 520 | if self.configLinux.useroptions.delphes_includes!="0": |
3319 | 393 | break | 521 | self.configLinux.delphes_inc_paths.append(self.configLinux.useroptions.delphes_includes) |
3320 | 394 | 522 | self.configLinux.delphes_inc_paths.append(self.configLinux.useroptions.delphes_includes+'/external/') | |
3321 | 395 | # If not, test if it is there locally | 523 | force1=True |
3322 | 396 | if not find: | 524 | if self.configLinux.useroptions.delphes_libs!="0": |
3323 | 397 | item = self.ma5dir+'/tools/delphes/' | 525 | self.configLinux.delphes_lib_paths.append(self.configLinux.useroptions.delphes_libraries) |
3324 | 398 | files=glob.glob(item+"/libDelphes.so") | 526 | force2=True |
3325 | 399 | files.extend(glob.glob(item+"/libDelphes.a")) | 527 | force=force1 and force2 |
3326 | 400 | files.extend(glob.glob(item+"/libDelphes.dylib")) | 528 | |
3327 | 401 | if len(files)!=0: | 529 | # Checking if Delphes has been installed by MA5 |
3328 | 402 | self.configLinux.libraries['Delphes']=files[0]+":"+str(os.stat(files[0]).st_mtime) | 530 | ma5installation = False |
3329 | 403 | find=True | 531 | if not force: |
3330 | 404 | os.environ['LD_LIBRARY_PATH'] = os.environ['LD_LIBRARY_PATH'] + \ | 532 | if os.path.isdir(self.ma5dir+'/tools/delphes') and \ |
3331 | 405 | ":" + item | 533 | os.path.isdir(self.ma5dir+'/tools/delphes/external'): |
3332 | 406 | os.environ['DYLD_LIBRARY_PATH'] = os.environ['DYLD_LIBRARY_PATH'] + \ | 534 | self.configLinux.delphes_inc_paths.append(self.ma5dir+'/tools/delphes/') |
3333 | 407 | ":" + item | 535 | self.configLinux.delphes_inc_paths.append(self.ma5dir+'/tools/delphes/external/') |
3334 | 408 | os.environ['LIBRARY_PATH'] = os.environ['LIBRARY_PATH'] + \ | 536 | self.configLinux.delphes_lib_paths.append(self.ma5dir+'/tools/delphes/') |
3335 | 409 | ":" + item | 537 | ma5installation = True |
3336 | 410 | # Not fail -> Warning | 538 | |
3337 | 411 | if not find: | 539 | # Check if the libraries and headers are available |
3338 | 412 | self.PrintFAIL(warning=True) | 540 | if force or ma5installation: |
3339 | 413 | logging.warning("Library called 'delphes' not found. Delphes ROOT format will be disabled.") | 541 | |
3340 | 414 | logging.warning("To enable this format, please type 'install delphes'.") | 542 | # header |
3341 | 415 | return False | 543 | if not os.path.isfile(self.configLinux.delphes_inc_paths[0]+'/modules/ParticlePropagator.h'): |
3342 | 416 | 544 | self.PrintFAIL(warning=True) | |
3343 | 417 | # Checking header file | 545 | logging.warning("Header file called '"+self.configLinux.delphes_inc_paths[0]+"/modules/ParticlePropagator.h' not found." +\ |
3344 | 418 | find=False | 546 | "Delphes ROOT format will be disabled.") |
3345 | 419 | for item in self.includes: | 547 | logging.warning("To enable this format, please type 'install delphes' package.") |
3346 | 420 | files=glob.glob(item+"/modules/ParticlePropagator.h") | 548 | return False |
3347 | 421 | if len(files)!=0: | 549 | |
3348 | 422 | self.configLinux.headers['Delphes']=files[0]+":"+str(os.stat(files[0]).st_mtime) | 550 | # lib |
3349 | 423 | find=True | 551 | mypath, myfile = self.FindFilesWithPattern(self.configLinux.delphes_lib_paths,"libDelphes.*",libnames) |
3350 | 424 | os.environ['CPLUS_INCLUDE_PATH'] = os.environ['CPLUS_INCLUDE_PATH'] + ":" + item | 552 | self.configLinux.delphes_lib=myfile |
3351 | 425 | break | 553 | if self.configLinux.delphes_lib=="": |
3352 | 426 | 554 | self.PrintFAIL(warning=True) | |
3353 | 427 | # If not, test if it is there locally | 555 | logging.warning("Delphes library not found in "+self.configLinux.delphes_lib_paths[0]+" folder. Delphes ROOT format will be disabled.") |
3354 | 428 | if not find: | 556 | logging.warning("To enable this format, please type 'install delphes' package.") |
3355 | 429 | find=os.path.isfile(self.ma5dir+'/tools/delphes/modules/ParticlePropagator.h') | 557 | return False |
3356 | 430 | if find: | 558 | |
3357 | 431 | os.environ['CPLUS_INCLUDE_PATH'] = os.environ['CPLUS_INCLUDE_PATH'] + ":" + \ | 559 | # Checking Delphes can be found in other folders |
3358 | 432 | self.ma5dir+'/tools/delphes/' | 560 | if not force and not ma5installation: |
3359 | 433 | os.environ['CPLUS_INCLUDE_PATH'] = os.environ['CPLUS_INCLUDE_PATH'] + ":" + \ | 561 | |
3360 | 434 | self.ma5dir+'/tools/delphes/external/' | 562 | # header |
3361 | 435 | 563 | mypath, myfile = self.FindHeader('/modules/ParticlePropagator.h') | |
3362 | 436 | if not find: | 564 | self.delphes_inc_path = mypath |
3363 | 437 | self.PrintFAIL(warning=True) | 565 | if self.delphes_inc_path=="": |
3364 | 438 | logging.warning("Header file called 'modules/ParticlePropagator.h' not found. Delphes ROOT format will be disabled.") | 566 | self.PrintFAIL(warning=True) |
3365 | 439 | logging.warning("To enable this format, please type 'install delphes' package.") | 567 | logging.warning("Header file called '/modules/ParticlePropagator.h' not found. Delphes ROOT format will be disabled.") |
3366 | 440 | return False | 568 | logging.warning("To enable this format, please type 'install delphes' package.") |
3367 | 441 | else: | 569 | return False |
3368 | 442 | self.PrintOK() | 570 | |
3369 | 571 | # lib | ||
3370 | 572 | mypath, myfile = self.FindLibraryWithPattern('libDelphes.*',libnames) | ||
3371 | 573 | self.configLinux.delphes_lib_path = mypath | ||
3372 | 574 | self.configLinux.delphes_lib = myfile | ||
3373 | 575 | if self.configLinux.delphes_lib_path=="": | ||
3374 | 576 | self.PrintFAIL(warning=True) | ||
3375 | 577 | logging.warning("Delphes library not found. Delphes format will be disabled.") | ||
3376 | 578 | logging.warning("To enable this format, please type 'install delphes' package.") | ||
3377 | 579 | return False | ||
3378 | 580 | |||
3379 | 581 | self.configLinux.libraries['Delphes']=self.configLinux.delphes_lib+":"+str(os.stat(self.configLinux.delphes_lib).st_mtime) | ||
3380 | 582 | self.PrintOK() | ||
3381 | 583 | |||
3382 | 584 | return True | ||
3383 | 585 | |||
3384 | 586 | |||
3385 | 587 | def checkDelfes(self): | ||
3386 | 588 | |||
3387 | 589 | # self.PrintLibrary("delfes library") | ||
3388 | 590 | |||
3389 | 591 | # Name of the dynamic lib | ||
3390 | 592 | libnames=['libDelphes.so','libDelphes.a'] | ||
3391 | 593 | if self.isMAC: | ||
3392 | 594 | libnames.append('libDelphes.dylib') | ||
3393 | 595 | |||
3394 | 596 | # User veto | ||
3395 | 597 | if self.configLinux.useroptions.delfes_veto=='1': | ||
3396 | 598 | # self.PrintFAIL(warning=True) | ||
3397 | 599 | # logging.warning("Library called 'delfes' disabled. Delfes ROOT format will be disabled.") | ||
3398 | 600 | return False | ||
3399 | 601 | |||
3400 | 602 | # Does the user force the paths? | ||
3401 | 603 | force1=False | ||
3402 | 604 | force2=False | ||
3403 | 605 | if self.configLinux.useroptions.delfes_includes!="0": | ||
3404 | 606 | self.configLinux.delfes_inc_paths.append(self.configLinux.useroptions.delfes_includes) | ||
3405 | 607 | self.configLinux.delfes_inc_paths.append(self.configLinux.useroptions.delfes_includes+'/external/') | ||
3406 | 608 | force1=True | ||
3407 | 609 | if self.configLinux.useroptions.delfes_libs!="0": | ||
3408 | 610 | self.configLinux.delfes_lib_paths.append(self.configLinux.useroptions.delfes_libraries) | ||
3409 | 611 | force2=True | ||
3410 | 612 | force=force1 and force2 | ||
3411 | 613 | |||
3412 | 614 | # Checking if delfes has been installed by MA5 | ||
3413 | 615 | ma5installation = False | ||
3414 | 616 | if not force: | ||
3415 | 617 | if os.path.isdir(self.ma5dir+'/tools/delfes') and \ | ||
3416 | 618 | os.path.isdir(self.ma5dir+'/tools/delfes/external'): | ||
3417 | 619 | self.configLinux.delfes_inc_paths.append(self.ma5dir+'/tools/delfes/') | ||
3418 | 620 | self.configLinux.delfes_inc_paths.append(self.ma5dir+'/tools/delfes/external/') | ||
3419 | 621 | self.configLinux.delfes_lib_paths.append(self.ma5dir+'/tools/delfes/') | ||
3420 | 622 | ma5installation = True | ||
3421 | 623 | |||
3422 | 624 | # Check if the libraries and headers are available | ||
3423 | 625 | if force or ma5installation: | ||
3424 | 626 | |||
3425 | 627 | # header | ||
3426 | 628 | if not os.path.isfile(self.configLinux.delfes_inc_paths[0]+'/modules/ParticlePropagator.h'): | ||
3427 | 629 | # self.PrintFAIL(warning=True) | ||
3428 | 630 | # logging.warning("Header file called '"+self.configLinux.delfes_inc_paths[0]+"/modules/ParticlePropagator.h' not found." +\ | ||
3429 | 631 | # "Delfes ROOT format will be disabled.") | ||
3430 | 632 | # logging.warning("To enable this format, please type 'install delfes' package.") | ||
3431 | 633 | return False | ||
3432 | 634 | |||
3433 | 635 | # lib | ||
3434 | 636 | mypath, myfile = self.FindFilesWithPattern(self.configLinux.delfes_lib_paths,"libDelphes.*",libnames) | ||
3435 | 637 | self.configLinux.delfes_lib=myfile | ||
3436 | 638 | if self.configLinux.delfes_lib=="": | ||
3437 | 639 | # self.PrintFAIL(warning=True) | ||
3438 | 640 | # logging.warning("Delfes library not found in "+self.configLinux.delfes_lib_paths[0]+" folder. Delfes ROOT format will be disabled.") | ||
3439 | 641 | # logging.warning("To enable this format, please type 'install delfes' package.") | ||
3440 | 642 | return False | ||
3441 | 643 | |||
3442 | 644 | # Checking Delfes can be found in other folders | ||
3443 | 645 | if not force and not ma5installation: | ||
3444 | 646 | |||
3445 | 647 | # header | ||
3446 | 648 | mypath, myfile = self.FindHeader('/modules/ParticlePropagator.h') | ||
3447 | 649 | self.delfes_inc_path = mypath | ||
3448 | 650 | if self.delfes_inc_path=="": | ||
3449 | 651 | # self.PrintFAIL(warning=True) | ||
3450 | 652 | # logging.warning("Header file called '/modules/ParticlePropagator.h' not found. Delfes ROOT format will be disabled.") | ||
3451 | 653 | # logging.warning("To enable this format, please type 'install delfes' package.") | ||
3452 | 654 | return False | ||
3453 | 655 | |||
3454 | 656 | # lib | ||
3455 | 657 | mypath, myfile = self.FindLibraryWithPattern('libDelphes.*',libnames) | ||
3456 | 658 | self.configLinux.delfes_lib_path = mypath | ||
3457 | 659 | self.configLinux.delfes_lib = myfile | ||
3458 | 660 | if self.configLinux.delfes_lib_path=="": | ||
3459 | 661 | # self.PrintFAIL(warning=True) | ||
3460 | 662 | # logging.warning("Delfes library not found. Delfes format will be disabled.") | ||
3461 | 663 | # logging.warning("To enable this format, please type 'install delfes' package.") | ||
3462 | 664 | return False | ||
3463 | 665 | |||
3464 | 666 | self.configLinux.libraries['Delfes']=self.configLinux.delfes_lib+":"+str(os.stat(self.configLinux.delfes_lib).st_mtime) | ||
3465 | 667 | # self.PrintOK() | ||
3466 | 443 | 668 | ||
3467 | 444 | return True | 669 | return True |
3468 | 445 | 670 | ||
3469 | @@ -462,32 +687,58 @@ | |||
3470 | 462 | def checkFastJet(self): | 687 | def checkFastJet(self): |
3471 | 463 | 688 | ||
3472 | 464 | self.PrintLibrary("FastJet") | 689 | self.PrintLibrary("FastJet") |
3473 | 465 | |||
3474 | 466 | self.configLinux.fastjet_version = "none" | 690 | self.configLinux.fastjet_version = "none" |
3475 | 467 | 691 | ||
3491 | 468 | # Checking if fastjet is installed on the system | 692 | # User veto |
3492 | 469 | find = False | 693 | if self.configLinux.useroptions.fastjet_veto=='1': |
3478 | 470 | for item in self.paths: | ||
3479 | 471 | files=glob.glob(item+"/fastjet-config") | ||
3480 | 472 | files.extend(glob.glob(item+"/fastjet-config")) | ||
3481 | 473 | if(len(files))!=0: | ||
3482 | 474 | find = True | ||
3483 | 475 | self.configLinux.fastjet_version = commands.getstatusoutput('fastjet-config --version')[1] | ||
3484 | 476 | |||
3485 | 477 | # If not, test if it is there locally | ||
3486 | 478 | if not find: | ||
3487 | 479 | find=os.path.isfile(self.ma5dir+'/tools/fastjet/bin/fastjet-config') | ||
3488 | 480 | |||
3489 | 481 | # If not there, print warning message; if there -> test it | ||
3490 | 482 | if not find: | ||
3493 | 483 | self.PrintFAIL(warning=True) | 694 | self.PrintFAIL(warning=True) |
3496 | 484 | logging.warning("The fastJet package not found. JetClustering algorithms are disabled.") | 695 | logging.warning("The FastJet package is disabled. JetClustering algorithms are disabled.") |
3495 | 485 | logging.warning("To enable this functionnality, please type 'install fastjet'.") | ||
3497 | 486 | return False | 696 | return False |
3502 | 487 | else: | 697 | |
3503 | 488 | self.configLinux.fastjet_version = commands.getstatusoutput(self.ma5dir+'/tools/fastjet/bin/fastjet-config --version')[1] | 698 | # Does the user force the paths? |
3504 | 489 | os.environ['PATH'] = self.ma5dir+'/tools/fastjet/bin/:'+os.environ['PATH'] | 699 | force=False |
3505 | 490 | self.PrintOK() | 700 | if self.configLinux.useroptions.fastjet_bin_path!="0": |
3506 | 701 | self.configLinux.fastjet_bin_path.append(self.configLinux.useroptions.fastjet_bin_path) | ||
3507 | 702 | force=True | ||
3508 | 703 | |||
3509 | 704 | # Checking if FastJet has been installed by MA5 | ||
3510 | 705 | ma5installation = False | ||
3511 | 706 | if not force: | ||
3512 | 707 | if os.path.isdir(self.ma5dir+'/tools/fastjet/bin'): | ||
3513 | 708 | self.configLinux.fastjet_bin_path=self.ma5dir+'/tools/fastjet/bin/' | ||
3514 | 709 | ma5installation = True | ||
3515 | 710 | |||
3516 | 711 | # Check if the libraries and headers are available | ||
3517 | 712 | if force or ma5installation: | ||
3518 | 713 | |||
3519 | 714 | if not os.path.isfile(self.configLinux.fastjet_bin_path+'/fastjet-config'): | ||
3520 | 715 | self.PrintFAIL(warning=True) | ||
3521 | 716 | logging.warning("The FastJet package not found. JetClustering algorithms are disabled.") | ||
3522 | 717 | logging.warning("To enable this functionnality, please type 'install fastjet'.") | ||
3523 | 718 | return False | ||
3524 | 719 | |||
3525 | 720 | # Checking FastJet can be found in other folders | ||
3526 | 721 | if not force and not ma5installation: | ||
3527 | 722 | |||
3528 | 723 | for item in self.paths: | ||
3529 | 724 | files=glob.glob(item+"/fastjet-config") | ||
3530 | 725 | files.extend(glob.glob(item+"/fastjet-config")) | ||
3531 | 726 | if(len(files))!=0: | ||
3532 | 727 | self.configLinux.fastjet_bin_path=item | ||
3533 | 728 | break | ||
3534 | 729 | if self.configLinux.fastjet_bin_path=='': | ||
3535 | 730 | self.PrintFAIL(warning=True) | ||
3536 | 731 | logging.warning("The FastJet package not found. JetClustering algorithms are disabled.") | ||
3537 | 732 | logging.warning("To enable this functionnality, please type 'install fastjet'.") | ||
3538 | 733 | return False | ||
3539 | 734 | |||
3540 | 735 | self.configLinux.fastjet_version = commands.getstatusoutput(self.ma5dir+'/tools/fastjet/bin/fastjet-config --version')[1] | ||
3541 | 736 | tmp = commands.getstatusoutput(self.ma5dir+'/tools/fastjet/bin/fastjet-config --libs --plugins')[1] | ||
3542 | 737 | words = tmp.split() | ||
3543 | 738 | for word in words: | ||
3544 | 739 | if word.startswith('-L'): | ||
3545 | 740 | self.configLinux.fastjet_lib_paths.append(word[2:]) | ||
3546 | 741 | self.PrintOK() | ||
3547 | 491 | 742 | ||
3548 | 492 | return True | 743 | return True |
3549 | 493 | 744 | ||
3550 | @@ -512,6 +763,11 @@ | |||
3551 | 512 | def checkPdfLatex(self): | 763 | def checkPdfLatex(self): |
3552 | 513 | self.PrintLibrary('pdflatex') | 764 | self.PrintLibrary('pdflatex') |
3553 | 514 | 765 | ||
3554 | 766 | if self.configLinux.useroptions.pdflatex_veto=='1': | ||
3555 | 767 | self.PrintFAIL(warning=True) | ||
3556 | 768 | logging.warning("pdflatex disabled. Reports under the pdf format will not be compiled.") | ||
3557 | 769 | return False | ||
3558 | 770 | |||
3559 | 515 | pdflatex_version = commands.getstatusoutput('pdflatex -version') | 771 | pdflatex_version = commands.getstatusoutput('pdflatex -version') |
3560 | 516 | if 'not found' in str(pdflatex_version) or 'no such file' in str(pdflatex_version): | 772 | if 'not found' in str(pdflatex_version) or 'no such file' in str(pdflatex_version): |
3561 | 517 | self.PrintFAIL(warning=True) | 773 | self.PrintFAIL(warning=True) |
3562 | @@ -524,6 +780,11 @@ | |||
3563 | 524 | def checkLatex(self): | 780 | def checkLatex(self): |
3564 | 525 | self.PrintLibrary('latex') | 781 | self.PrintLibrary('latex') |
3565 | 526 | 782 | ||
3566 | 783 | if self.configLinux.useroptions.latex_veto=='1': | ||
3567 | 784 | self.PrintFAIL(warning=True) | ||
3568 | 785 | logging.warning("latex disabled. Reports under the dvi format will not be compiled.") | ||
3569 | 786 | return False | ||
3570 | 787 | |||
3571 | 527 | latex_version = commands.getstatusoutput('latex -version') | 788 | latex_version = commands.getstatusoutput('latex -version') |
3572 | 528 | if 'not found' in str(latex_version) or 'no such file' in str(latex_version): | 789 | if 'not found' in str(latex_version) or 'no such file' in str(latex_version): |
3573 | 529 | self.PrintFAIL(warning=True) | 790 | self.PrintFAIL(warning=True) |
3574 | @@ -536,6 +797,11 @@ | |||
3575 | 536 | def checkdvipdf(self): | 797 | def checkdvipdf(self): |
3576 | 537 | self.PrintLibrary('dvipdf') | 798 | self.PrintLibrary('dvipdf') |
3577 | 538 | 799 | ||
3578 | 800 | if self.configLinux.useroptions.dvipdf_veto=='1': | ||
3579 | 801 | self.PrintFAIL(warning=True) | ||
3580 | 802 | logging.warning("dvipdf disabled. DVI reports will not be converted to pdf files.") | ||
3581 | 803 | return False | ||
3582 | 804 | |||
3583 | 539 | dvipdf_version = commands.getstatusoutput('dvipdf') | 805 | dvipdf_version = commands.getstatusoutput('dvipdf') |
3584 | 540 | if 'not found' in str(dvipdf_version) or 'no such file' in str(dvipdf_version): | 806 | if 'not found' in str(dvipdf_version) or 'no such file' in str(dvipdf_version): |
3585 | 541 | self.PrintFAIL(warning=True) | 807 | self.PrintFAIL(warning=True) |
3586 | 542 | 808 | ||
3587 | === modified file 'madanalysis/core/expert_mode.py' | |||
3588 | --- madanalysis/core/expert_mode.py 2013-05-31 21:57:38 +0000 | |||
3589 | +++ madanalysis/core/expert_mode.py 2014-05-17 19:51:11 +0000 | |||
3590 | @@ -42,8 +42,10 @@ | |||
3591 | 42 | 42 | ||
3592 | 43 | def CreateDirectory(self): | 43 | def CreateDirectory(self): |
3593 | 44 | logging.info("\nWelcome to the expert mode of MadAnalysis") | 44 | logging.info("\nWelcome to the expert mode of MadAnalysis") |
3595 | 45 | logging.info("Please enter a folder for creating an empty SampleAnalyzer job") | 45 | logging.info("Please enter a folder name for creating an empty SampleAnalyzer job") |
3596 | 46 | answer=raw_input("Answer: ") | 46 | answer=raw_input("Answer: ") |
3597 | 47 | answer=answer.replace(' ','_'); | ||
3598 | 48 | answer=answer.replace('-','_'); | ||
3599 | 47 | self.path = os.path.expanduser(answer) | 49 | self.path = os.path.expanduser(answer) |
3600 | 48 | if not self.path.startswith('/'): | 50 | if not self.path.startswith('/'): |
3601 | 49 | self.path = self.main.currentdir+'/'+self.path | 51 | self.path = self.main.currentdir+'/'+self.path |
3602 | @@ -90,12 +92,17 @@ | |||
3603 | 90 | return False | 92 | return False |
3604 | 91 | 93 | ||
3605 | 92 | # Writing an empty analysis | 94 | # Writing an empty analysis |
3606 | 95 | logging.info("Please enter a name for your analysis") | ||
3607 | 96 | title=raw_input("Answer: ") | ||
3608 | 97 | if title=="": | ||
3609 | 98 | title="user" | ||
3610 | 99 | title=title.replace(' ', '_'); | ||
3611 | 100 | title=title.replace('-', '_'); | ||
3612 | 93 | logging.info(" Writing an empty analysis...") | 101 | logging.info(" Writing an empty analysis...") |
3615 | 94 | jobber.WriteEmptyFilterSource(self.main) | 102 | os.system("cd "+self.path+"/Build/SampleAnalyzer; python newAnalyzer.py " + title + " 1") |
3614 | 95 | os.system("cd "+self.path+"/Build/SampleAnalyzer; python newAnalyzer.py user") | ||
3616 | 96 | 103 | ||
3617 | 97 | # Extracting analysis name | 104 | # Extracting analysis name |
3619 | 98 | file = open(self.path+"/Build/SampleAnalyzer/Analyzer/analysisList.cpp") | 105 | file = open(self.path+"/Build/SampleAnalyzer/Analyzer/analysisList.h") |
3620 | 99 | title="" | 106 | title="" |
3621 | 100 | for line in file: | 107 | for line in file: |
3622 | 101 | if "Add" not in line: | 108 | if "Add" not in line: |
3623 | @@ -105,9 +112,7 @@ | |||
3624 | 105 | title=words[1] | 112 | title=words[1] |
3625 | 106 | break | 113 | break |
3626 | 107 | file.close() | 114 | file.close() |
3630 | 108 | if title=="": | 115 | |
3628 | 109 | title="user" | ||
3629 | 110 | |||
3631 | 111 | # Writing a Makefile | 116 | # Writing a Makefile |
3632 | 112 | logging.info(" Writing a 'Makefile'...") | 117 | logging.info(" Writing a 'Makefile'...") |
3633 | 113 | if not jobber.WriteMakefiles(): | 118 | if not jobber.WriteMakefiles(): |
3634 | 114 | 119 | ||
3635 | === modified file 'madanalysis/core/library_builder.py' | |||
3636 | --- madanalysis/core/library_builder.py 2013-05-17 06:19:22 +0000 | |||
3637 | +++ madanalysis/core/library_builder.py 2014-05-17 19:51:11 +0000 | |||
3638 | @@ -31,11 +31,15 @@ | |||
3639 | 31 | 31 | ||
3640 | 32 | class LibraryBuilder: | 32 | class LibraryBuilder: |
3641 | 33 | 33 | ||
3643 | 34 | def __init__(self,configLinux,ma5dir): | 34 | def __init__(self,configLinux,ma5dir,libZIP,libDelphes,libDelfes,libFastJet): |
3644 | 35 | 35 | ||
3645 | 36 | self.configLinux=configLinux | 36 | self.configLinux=configLinux |
3646 | 37 | self.ma5dir=ma5dir | 37 | self.ma5dir=ma5dir |
3647 | 38 | self.configStore = LinuxArchitecture() | 38 | self.configStore = LinuxArchitecture() |
3648 | 39 | self.libZIP=libZIP | ||
3649 | 40 | self.libDelphes=libDelphes | ||
3650 | 41 | self.libDelfes=libDelfes | ||
3651 | 42 | self.libFastJet=libFastJet | ||
3652 | 39 | 43 | ||
3653 | 40 | 44 | ||
3654 | 41 | def checkMA5(self): | 45 | def checkMA5(self): |
3655 | @@ -53,19 +57,33 @@ | |||
3656 | 53 | logging.error(" "+name) | 57 | logging.error(" "+name) |
3657 | 54 | return False | 58 | return False |
3658 | 55 | 59 | ||
3661 | 56 | # Look for shared library 'MadAnalysis' and 'config' file | 60 | # Look for the shared library 'MadAnalysis' and 'config' file |
3662 | 57 | if not os.path.isfile(self.ma5dir+'/tools/SampleAnalyzer/Lib/libSampleAnalyzer.a') \ | 61 | if not os.path.isfile(self.ma5dir+'/tools/SampleAnalyzer/Lib/libSampleAnalyzer.so') \ |
3663 | 58 | or not os.path.isfile(self.ma5dir+'/tools/architecture.ma5'): | 62 | or not os.path.isfile(self.ma5dir+'/tools/architecture.ma5'): |
3664 | 59 | FirstUse=True | 63 | FirstUse=True |
3665 | 64 | return True, False | ||
3666 | 65 | |||
3667 | 66 | # Look for optional library | ||
3668 | 67 | libraries = [] | ||
3669 | 68 | if self.libFastJet: | ||
3670 | 69 | libraries.append(self.ma5dir+'/tools/SampleAnalyzer/Lib/libfastjet_for_ma5.so') | ||
3671 | 70 | if self.libZIP: | ||
3672 | 71 | libraries.append(self.ma5dir+'/tools/SampleAnalyzer/Lib/libzlib_for_ma5.so') | ||
3673 | 72 | if self.libDelphes: | ||
3674 | 73 | libraries.append(self.ma5dir+'/tools/SampleAnalyzer/Lib/libdelphes_for_ma5.so') | ||
3675 | 74 | if self.libDelfes: | ||
3676 | 75 | libraries.append(self.ma5dir+'/tools/SampleAnalyzer/Lib/libdelfes_for_ma5.so') | ||
3677 | 76 | for library in libraries: | ||
3678 | 77 | if not os.path.isfile(library): | ||
3679 | 78 | return False, True | ||
3680 | 60 | 79 | ||
3681 | 61 | # Importing the configuration stored with the library | 80 | # Importing the configuration stored with the library |
3682 | 62 | if not FirstUse: | 81 | if not FirstUse: |
3683 | 63 | if not self.configStore.Import(self.ma5dir+'/tools/architecture.ma5'): | 82 | if not self.configStore.Import(self.ma5dir+'/tools/architecture.ma5'): |
3684 | 64 | FirstUse=True | 83 | FirstUse=True |
3685 | 84 | return True, False | ||
3686 | 65 | 85 | ||
3690 | 66 | if not FirstUse: | 86 | return FirstUse, False |
3688 | 67 | logging.info(' => MadAnalysis library found.') | ||
3689 | 68 | return FirstUse | ||
3691 | 69 | 87 | ||
3692 | 70 | 88 | ||
3693 | 71 | def compare(self): | 89 | def compare(self): |
3694 | 72 | 90 | ||
3695 | === modified file 'madanalysis/core/linux_architecture.py' | |||
3696 | --- madanalysis/core/linux_architecture.py 2013-10-27 21:36:24 +0000 | |||
3697 | +++ madanalysis/core/linux_architecture.py 2014-05-17 19:51:11 +0000 | |||
3698 | @@ -23,14 +23,121 @@ | |||
3699 | 23 | 23 | ||
3700 | 24 | 24 | ||
3701 | 25 | import logging | 25 | import logging |
3702 | 26 | |||
3703 | 27 | class UserOptions: | ||
3704 | 28 | |||
3705 | 29 | def __init__(self): | ||
3706 | 30 | self.root_includes = '0' | ||
3707 | 31 | self.root_libs = '0' | ||
3708 | 32 | self.delphes_veto = '0' | ||
3709 | 33 | self.delphes_includes = '0' | ||
3710 | 34 | self.delphes_libs = '0' | ||
3711 | 35 | self.delfes_veto = '0' | ||
3712 | 36 | self.delfes_includes = '0' | ||
3713 | 37 | self.delfes_libs = '0' | ||
3714 | 38 | self.zlib_veto = '0' | ||
3715 | 39 | self.zlib_includes = '0' | ||
3716 | 40 | self.zlib_libs = '0' | ||
3717 | 41 | self.fastjet_veto = '0' | ||
3718 | 42 | self.fastjet_bin_path = '0' | ||
3719 | 43 | self.pdflatex_veto = '0' | ||
3720 | 44 | self.latex_veto = '0' | ||
3721 | 45 | self.dvipdf_veto = '0' | ||
3722 | 46 | |||
3723 | 47 | def Dump(self): | ||
3724 | 48 | logging.info(" ROOT header path = " + str(self.root_includes)) | ||
3725 | 49 | logging.info(" ROOT library path = " + str(self.root_libs)) | ||
3726 | 50 | logging.info(" DELPHES veto = " + str(self.delphes_veto)) | ||
3727 | 51 | logging.info(" DELPHES header path = " + str(self.delphes_includes)) | ||
3728 | 52 | logging.info(" DELPHES library path = " + str(self.delphes_libs)) | ||
3729 | 53 | logging.info(" DELFES veto = " + str(self.delfes_veto)) | ||
3730 | 54 | logging.info(" DELFES header path = " + str(self.delfes_includes)) | ||
3731 | 55 | logging.info(" DELFES library path = " + str(self.delfes_libs)) | ||
3732 | 56 | logging.info(" ZLIB veto = " + str(self.zlib_veto)) | ||
3733 | 57 | logging.info(" ZLIB header path = " + str(self.zlib_includes)) | ||
3734 | 58 | logging.info(" ZLIB library path = " + str(self.zlib_libs)) | ||
3735 | 59 | logging.info(" FASTJET veto = " + str(self.fastjet_veto)) | ||
3736 | 60 | logging.info(" FASTJET bin path = " + str(self.fastjet_bin_path)) | ||
3737 | 61 | logging.info(" PDFLATEX veto = " + str(self.pdflatex_veto)) | ||
3738 | 62 | logging.info(" LATEX veto = " + str(self.latex_veto)) | ||
3739 | 63 | logging.info(" DVIPDF veto = " + str(self.dvipdf_veto)) | ||
3740 | 64 | |||
3741 | 65 | def Export(self,file): | ||
3742 | 66 | file.write(self.root_includes+"\n") | ||
3743 | 67 | file.write(self.root_libs+"\n") | ||
3744 | 68 | file.write(self.delphes_veto+"\n") | ||
3745 | 69 | file.write(self.delphes_includes+"\n") | ||
3746 | 70 | file.write(self.delphes_libs+"\n") | ||
3747 | 71 | file.write(self.delfes_veto+"\n") | ||
3748 | 72 | file.write(self.delfes_includes+"\n") | ||
3749 | 73 | file.write(self.delfes_libs+"\n") | ||
3750 | 74 | file.write(self.zlib_veto+"\n") | ||
3751 | 75 | file.write(self.zlib_includes+"\n") | ||
3752 | 76 | file.write(self.zlib_libs+"\n") | ||
3753 | 77 | file.write(self.fastjet_veto+"\n") | ||
3754 | 78 | file.write(self.fastjet_bin_path+"\n") | ||
3755 | 79 | file.write(self.pdflatex_veto+"\n") | ||
3756 | 80 | file.write(self.latex_veto+"\n") | ||
3757 | 81 | file.write(self.dvipdf_veto+"\n") | ||
3758 | 82 | |||
3759 | 83 | def Import(self,file): | ||
3760 | 84 | self.root_includes = file.readline().replace('\n','') | ||
3761 | 85 | self.root_libs = file.readline().replace('\n','') | ||
3762 | 86 | self.delphes_veto = file.readline().replace('\n','') | ||
3763 | 87 | self.delphes_includes = file.readline().replace('\n','') | ||
3764 | 88 | self.delphes_libs = file.readline().replace('\n','') | ||
3765 | 89 | self.delfes_veto = file.readline().replace('\n','') | ||
3766 | 90 | self.delfes_includes = file.readline().replace('\n','') | ||
3767 | 91 | self.delfes_libs = file.readline().replace('\n','') | ||
3768 | 92 | self.zlib_veto = file.readline().replace('\n','') | ||
3769 | 93 | self.zlib_includes = file.readline().replace('\n','') | ||
3770 | 94 | self.zlib_libs = file.readline().replace('\n','') | ||
3771 | 95 | self.fastjet_veto = file.readline().replace('\n','') | ||
3772 | 96 | self.fastjet_bin_path = file.readline().replace('\n','') | ||
3773 | 97 | self.pdflatex_veto = file.readline().replace('\n','') | ||
3774 | 98 | self.latex_veto = file.readline().replace('\n','') | ||
3775 | 99 | self.dvipdf_veto = file.readline().replace('\n','') | ||
3776 | 100 | |||
3777 | 101 | def Compare(self,other): | ||
3778 | 102 | if self.root_includes != other.root_includes: | ||
3779 | 103 | return False | ||
3780 | 104 | if self.root_libs != other.root_libs: | ||
3781 | 105 | return False | ||
3782 | 106 | if self.delphes_veto != other.delphes_veto: | ||
3783 | 107 | return False | ||
3784 | 108 | if self.delphes_includes != other.delphes_includes: | ||
3785 | 109 | return False | ||
3786 | 110 | if self.delphes_libs != other.delphes_libs: | ||
3787 | 111 | return False | ||
3788 | 112 | if self.delfes_veto != other.delfes_veto: | ||
3789 | 113 | return False | ||
3790 | 114 | if self.delfes_includes != other.delfes_includes: | ||
3791 | 115 | return False | ||
3792 | 116 | if self.delfes_libs != other.delfes_libs: | ||
3793 | 117 | return False | ||
3794 | 118 | if self.zlib_veto != other.zlib_veto: | ||
3795 | 119 | return False | ||
3796 | 120 | if self.zlib_includes != other.zlib_includes: | ||
3797 | 121 | return False | ||
3798 | 122 | if self.zlib_libs != other.zlib_libs: | ||
3799 | 123 | return False | ||
3800 | 124 | if self.fastjet_veto != other.fastjet_veto: | ||
3801 | 125 | return False | ||
3802 | 126 | if self.fastjet_bin_path != other.fastjet_bin_path: | ||
3803 | 127 | return False | ||
3804 | 128 | return True | ||
3805 | 129 | |||
3806 | 26 | class LinuxArchitecture: | 130 | class LinuxArchitecture: |
3807 | 27 | 131 | ||
3808 | 28 | def __init__(self): | 132 | def __init__(self): |
3809 | 133 | self.useroptions = UserOptions() | ||
3810 | 29 | self.platform = "" | 134 | self.platform = "" |
3811 | 135 | self.release = "" | ||
3812 | 30 | self.ma5_version = "" | 136 | self.ma5_version = "" |
3813 | 31 | self.ma5_date = "" | 137 | self.ma5_date = "" |
3814 | 32 | self.python_version = "" | 138 | self.python_version = "" |
3815 | 33 | self.gcc_version = "" | 139 | self.gcc_version = "" |
3816 | 140 | self.make_version = "" | ||
3817 | 34 | self.gfortran_version = "" | 141 | self.gfortran_version = "" |
3818 | 35 | self.root_version = "" | 142 | self.root_version = "" |
3819 | 36 | self.fastjet_version = "" | 143 | self.fastjet_version = "" |
3820 | @@ -38,13 +145,35 @@ | |||
3821 | 38 | self.headers = {} | 145 | self.headers = {} |
3822 | 39 | self.editor = "" | 146 | self.editor = "" |
3823 | 40 | 147 | ||
3824 | 148 | self.root_inc_path="" | ||
3825 | 149 | self.root_lib_path="" | ||
3826 | 150 | self.zlib_inc_path="" | ||
3827 | 151 | self.zlib_lib_path="" | ||
3828 | 152 | self.zlib_lib="" | ||
3829 | 153 | self.delphes_inc_paths=[] | ||
3830 | 154 | self.delphes_lib_paths=[] | ||
3831 | 155 | self.delphes_lib="" | ||
3832 | 156 | self.delfes_inc_paths=[] | ||
3833 | 157 | self.delfes_lib_paths=[] | ||
3834 | 158 | self.delfes_lib="" | ||
3835 | 159 | self.fastjet_bin_path="" | ||
3836 | 160 | self.fastjet_lib_paths=[] | ||
3837 | 41 | 161 | ||
3838 | 42 | def Dump(self): | 162 | def Dump(self): |
3840 | 43 | logging.info(" Linux distrib = " + self.platform) | 163 | logging.info(" User options") |
3841 | 164 | logging.info(" ------------") | ||
3842 | 165 | self.useroptions.Dump() | ||
3843 | 166 | logging.info("") | ||
3844 | 167 | |||
3845 | 168 | logging.info(" Architecture") | ||
3846 | 169 | logging.info(" ------------") | ||
3847 | 170 | logging.info(" Platform = " + self.platform) | ||
3848 | 171 | logging.info(" Release platform = " + self.release) | ||
3849 | 44 | logging.info(" MA5 version = " + self.ma5_version) | 172 | logging.info(" MA5 version = " + self.ma5_version) |
3850 | 45 | logging.info(" MA5 date = " + self.ma5_date) | 173 | logging.info(" MA5 date = " + self.ma5_date) |
3851 | 46 | logging.info(" Python version = " + self.python_version) | 174 | logging.info(" Python version = " + self.python_version) |
3852 | 47 | logging.info(" gcc version = " + self.gcc_version) | 175 | logging.info(" gcc version = " + self.gcc_version) |
3853 | 176 | logging.info(" GNU Make version = " + self.make_version) | ||
3854 | 48 | logging.info(" gfortran version = " + self.gfortran_version) | 177 | logging.info(" gfortran version = " + self.gfortran_version) |
3855 | 49 | logging.info(" ROOT version = " + self.root_version) | 178 | logging.info(" ROOT version = " + self.root_version) |
3856 | 50 | logging.info(" FastJet version = " + self.fastjet_version) | 179 | logging.info(" FastJet version = " + self.fastjet_version) |
3857 | @@ -57,7 +186,6 @@ | |||
3858 | 57 | logging.info( " Header '" + key + "' = " + \ | 186 | logging.info( " Header '" + key + "' = " + \ |
3859 | 58 | value ) | 187 | value ) |
3860 | 59 | 188 | ||
3861 | 60 | |||
3862 | 61 | def Export(self,filename): | 189 | def Export(self,filename): |
3863 | 62 | try: | 190 | try: |
3864 | 63 | file = open(filename,"w") | 191 | file = open(filename,"w") |
3865 | @@ -65,11 +193,15 @@ | |||
3866 | 65 | logging.error("impossible to write the configuration file '" + \ | 193 | logging.error("impossible to write the configuration file '" + \ |
3867 | 66 | filename + "'") | 194 | filename + "'") |
3868 | 67 | return False | 195 | return False |
3869 | 196 | |||
3870 | 197 | self.useroptions.Export(file) | ||
3871 | 68 | file.write(self.platform+"\n") | 198 | file.write(self.platform+"\n") |
3872 | 199 | file.write(self.release+"\n") | ||
3873 | 69 | file.write(self.ma5_version+"\n") | 200 | file.write(self.ma5_version+"\n") |
3874 | 70 | file.write(self.ma5_date+"\n") | 201 | file.write(self.ma5_date+"\n") |
3875 | 71 | file.write(self.python_version+"\n") | 202 | file.write(self.python_version+"\n") |
3876 | 72 | file.write(self.gcc_version+"\n") | 203 | file.write(self.gcc_version+"\n") |
3877 | 204 | file.write(self.make_version+"\n") | ||
3878 | 73 | file.write(self.gfortran_version+"\n") | 205 | file.write(self.gfortran_version+"\n") |
3879 | 74 | file.write(self.root_version+"\n") | 206 | file.write(self.root_version+"\n") |
3880 | 75 | file.write(self.fastjet_version+"\n") | 207 | file.write(self.fastjet_version+"\n") |
3881 | @@ -92,12 +224,16 @@ | |||
3882 | 92 | logging.error("impossible to read the configuration file '" + \ | 224 | logging.error("impossible to read the configuration file '" + \ |
3883 | 93 | filename + "'") | 225 | filename + "'") |
3884 | 94 | return False | 226 | return False |
3885 | 227 | |||
3886 | 95 | try: | 228 | try: |
3887 | 229 | self.useroptions.Import(file) | ||
3888 | 96 | self.platform = file.readline().replace('\n','') | 230 | self.platform = file.readline().replace('\n','') |
3889 | 231 | self.release = file.readline().replace('\n','') | ||
3890 | 97 | self.ma5_version = file.readline().replace('\n','') | 232 | self.ma5_version = file.readline().replace('\n','') |
3891 | 98 | self.ma5_date = file.readline().replace('\n','') | 233 | self.ma5_date = file.readline().replace('\n','') |
3892 | 99 | self.python_version = file.readline().replace('\n','') | 234 | self.python_version = file.readline().replace('\n','') |
3893 | 100 | self.gcc_version = file.readline().replace('\n','') | 235 | self.gcc_version = file.readline().replace('\n','') |
3894 | 236 | self.make_version = file.readline().replace('\n','') | ||
3895 | 101 | self.gfortran_version = file.readline().replace('\n','') | 237 | self.gfortran_version = file.readline().replace('\n','') |
3896 | 102 | self.root_version = file.readline().replace('\n','') | 238 | self.root_version = file.readline().replace('\n','') |
3897 | 103 | self.fastjet_version = file.readline().replace('\n','') | 239 | self.fastjet_version = file.readline().replace('\n','') |
3898 | @@ -135,8 +271,13 @@ | |||
3899 | 135 | 271 | ||
3900 | 136 | 272 | ||
3901 | 137 | def Compare(self, other): | 273 | def Compare(self, other): |
3902 | 274 | if not self.useroptions.Compare(other.useroptions): | ||
3903 | 275 | return False | ||
3904 | 276 | |||
3905 | 138 | if self.platform != other.platform: | 277 | if self.platform != other.platform: |
3906 | 139 | return False | 278 | return False |
3907 | 279 | if self.release != other.release: | ||
3908 | 280 | return False | ||
3909 | 140 | if self.ma5_version != other.ma5_version: | 281 | if self.ma5_version != other.ma5_version: |
3910 | 141 | return False | 282 | return False |
3911 | 142 | if self.ma5_date != other.ma5_date: | 283 | if self.ma5_date != other.ma5_date: |
3912 | @@ -145,6 +286,8 @@ | |||
3913 | 145 | return False | 286 | return False |
3914 | 146 | if self.gcc_version != other.gcc_version: | 287 | if self.gcc_version != other.gcc_version: |
3915 | 147 | return False | 288 | return False |
3916 | 289 | if self.make_version != other.make_version: | ||
3917 | 290 | return False | ||
3918 | 148 | if self.gfortran_version != other.gfortran_version: | 291 | if self.gfortran_version != other.gfortran_version: |
3919 | 149 | return False | 292 | return False |
3920 | 150 | if self.root_version != other.root_version: | 293 | if self.root_version != other.root_version: |
3921 | 151 | 294 | ||
3922 | === modified file 'madanalysis/core/main.py' | |||
3923 | --- madanalysis/core/main.py 2013-10-27 21:36:24 +0000 | |||
3924 | +++ madanalysis/core/main.py 2014-05-17 19:51:11 +0000 | |||
3925 | @@ -43,7 +43,7 @@ | |||
3926 | 43 | import logging | 43 | import logging |
3927 | 44 | import os | 44 | import os |
3928 | 45 | import sys | 45 | import sys |
3930 | 46 | 46 | import platform | |
3931 | 47 | 47 | ||
3932 | 48 | class Main(): | 48 | class Main(): |
3933 | 49 | 49 | ||
3934 | @@ -79,6 +79,7 @@ | |||
3935 | 79 | self.mg5 = False | 79 | self.mg5 = False |
3936 | 80 | self.libZIP = False | 80 | self.libZIP = False |
3937 | 81 | self.libDelphes = False | 81 | self.libDelphes = False |
3938 | 82 | self.libDelfes = False | ||
3939 | 82 | self.pdflatex = False | 83 | self.pdflatex = False |
3940 | 83 | self.latex = False | 84 | self.latex = False |
3941 | 84 | self.dvipdf = False | 85 | self.dvipdf = False |
3942 | @@ -86,9 +87,11 @@ | |||
3943 | 86 | self.fortran = False | 87 | self.fortran = False |
3944 | 87 | self.observables = ObservableManager(self.mode) | 88 | self.observables = ObservableManager(self.mode) |
3945 | 88 | self.mcatnloutils = False | 89 | self.mcatnloutils = False |
3946 | 90 | self.expertmode = False | ||
3947 | 91 | self.isMAC = False | ||
3948 | 92 | self.repeatSession = False | ||
3949 | 89 | self.ResetParameters() | 93 | self.ResetParameters() |
3950 | 90 | 94 | ||
3951 | 91 | |||
3952 | 92 | def ResetParameters(self): | 95 | def ResetParameters(self): |
3953 | 93 | self.merging = MergingConfiguration() | 96 | self.merging = MergingConfiguration() |
3954 | 94 | self.fastsim = FastsimConfiguration() | 97 | self.fastsim = FastsimConfiguration() |
3955 | @@ -128,7 +131,7 @@ | |||
3956 | 128 | else: | 131 | else: |
3957 | 129 | if self.fastsim.package=="none": | 132 | if self.fastsim.package=="none": |
3958 | 130 | samples.append('.lhco') | 133 | samples.append('.lhco') |
3960 | 131 | if self.libDelphes: | 134 | if self.libDelphes or self.libDelfes: |
3961 | 132 | samples.append('.root') | 135 | samples.append('.root') |
3962 | 133 | else: | 136 | else: |
3963 | 134 | samples.append('.lhe') | 137 | samples.append('.lhe') |
3964 | @@ -405,8 +408,22 @@ | |||
3965 | 405 | self.configLinux.ma5_version = self.version | 408 | self.configLinux.ma5_version = self.version |
3966 | 406 | self.configLinux.ma5_date = self.date | 409 | self.configLinux.ma5_date = self.date |
3967 | 407 | self.configLinux.python_version = sys.version.replace('\n','') | 410 | self.configLinux.python_version = sys.version.replace('\n','') |
3970 | 408 | self.configLinux.platform = sys.platform | 411 | self.configLinux.platform = platform.system() |
3971 | 409 | 412 | self.configLinux.release = platform.release() | |
3972 | 413 | |||
3973 | 414 | # Is Mac | ||
3974 | 415 | sys.stdout.write("Platform: "+self.configLinux.platform+" "+self.configLinux.release+" ") | ||
3975 | 416 | sys.stdout.flush() | ||
3976 | 417 | if self.configLinux.platform.lower() in ['darwin','mac','macosx']: | ||
3977 | 418 | self.isMAC = True | ||
3978 | 419 | sys.stdout.write('\x1b[32m'+'[MAC/OSX mode]'+'\x1b[0m'+'\n') | ||
3979 | 420 | sys.stdout.flush() | ||
3980 | 421 | else: | ||
3981 | 422 | self.isMAC = False | ||
3982 | 423 | sys.stdout.write('\x1b[32m'+'[Linux mode]'+'\x1b[0m'+'\n') | ||
3983 | 424 | sys.stdout.flush() | ||
3984 | 425 | |||
3985 | 426 | |||
3986 | 410 | if detail: | 427 | if detail: |
3987 | 411 | logging.info("General Platform identifier : " + str(self.configLinux.platform)) | 428 | logging.info("General Platform identifier : " + str(self.configLinux.platform)) |
3988 | 412 | import multiprocessing | 429 | import multiprocessing |
3989 | @@ -426,9 +443,13 @@ | |||
3990 | 426 | logging.info("") | 443 | logging.info("") |
3991 | 427 | 444 | ||
3992 | 428 | # Initializing the config checker | 445 | # Initializing the config checker |
3994 | 429 | checker = ConfigChecker(self.configLinux,self.ma5dir,self.script) | 446 | checker = ConfigChecker(self.configLinux,self.ma5dir,self.script,self.isMAC) |
3995 | 430 | checker.checkTextEditor() | 447 | checker.checkTextEditor() |
3996 | 431 | 448 | ||
3997 | 449 | # Reading user options | ||
3998 | 450 | if not checker.ReadUserOptions(): | ||
3999 | 451 | return False | ||
4000 | 452 | |||
4001 | 432 | # Mandatory packages | 453 | # Mandatory packages |
4002 | 433 | logging.info("Checking mandatory packages:") | 454 | logging.info("Checking mandatory packages:") |
4003 | 434 | checker.PrintLibrary("python") | 455 | checker.PrintLibrary("python") |
4004 | @@ -437,90 +458,239 @@ | |||
4005 | 437 | return False | 458 | return False |
4006 | 438 | if not checker.checkGPP(): | 459 | if not checker.checkGPP(): |
4007 | 439 | return False | 460 | return False |
4008 | 461 | if not checker.checkMake(): | ||
4009 | 462 | return False | ||
4010 | 440 | if not checker.checkROOT(): | 463 | if not checker.checkROOT(): |
4011 | 441 | return False | 464 | return False |
4012 | 465 | if not checker.checkPyROOT(): | ||
4013 | 466 | return False | ||
4014 | 442 | 467 | ||
4015 | 443 | # Optional packages | 468 | # Optional packages |
4016 | 444 | logging.info("Checking optional packages:") | 469 | logging.info("Checking optional packages:") |
4020 | 445 | if not checker.checkGF(): | 470 | self.libGF = checker.checkGF() |
4021 | 446 | return False | 471 | self.libZIP = checker.checkZLIB() |
4019 | 447 | self.libZIP = checker.checkZLIB() | ||
4022 | 448 | self.libDelphes = checker.checkDelphes() | 472 | self.libDelphes = checker.checkDelphes() |
4023 | 473 | self.libDelfes = checker.checkDelfes() | ||
4024 | 449 | self.libFastJet = checker.checkFastJet() | 474 | self.libFastJet = checker.checkFastJet() |
4027 | 450 | self.pdflatex = checker.checkPdfLatex() | 475 | self.pdflatex = checker.checkPdfLatex() |
4028 | 451 | self.latex = checker.checkLatex() | 476 | self.latex = checker.checkLatex() |
4029 | 452 | if self.latex: | 477 | if self.latex: |
4030 | 453 | self.dvipdf = checker.checkdvipdf() | 478 | self.dvipdf = checker.checkdvipdf() |
4033 | 454 | self.mcatnloutils = checker.checkMCatNLOUtils() | 479 | |
4034 | 455 | 480 | # Set PATH variable | |
4035 | 481 | self.configLinux.toPATH=[] | ||
4036 | 482 | self.configLinux.toLDPATH=[] | ||
4037 | 483 | self.configLinux.toLDPATH.append(self.ma5dir+'/tools/SampleAnalyzer/Lib/') | ||
4038 | 484 | self.configLinux.toLDPATH.append(self.configLinux.root_lib_path) | ||
4039 | 485 | if self.libFastJet: | ||
4040 | 486 | self.configLinux.toPATH.append(self.configLinux.fastjet_bin_path) | ||
4041 | 487 | for path in self.configLinux.fastjet_lib_paths: | ||
4042 | 488 | self.configLinux.toLDPATH.append(path) | ||
4043 | 489 | if self.libZIP: | ||
4044 | 490 | self.configLinux.toLDPATH.append(self.configLinux.zlib_lib_path) | ||
4045 | 491 | if self.libDelphes: | ||
4046 | 492 | for path in self.configLinux.delphes_lib_paths: | ||
4047 | 493 | self.configLinux.toLDPATH.append(path) | ||
4048 | 494 | if self.libDelfes: | ||
4049 | 495 | for path in self.configLinux.delfes_lib_paths: | ||
4050 | 496 | self.configLinux.toLDPATH.append(path) | ||
4051 | 497 | |||
4052 | 498 | os.environ['PATH'] = os.environ['PATH'] + \ | ||
4053 | 499 | ":" + ':'.join(self.configLinux.toPATH) | ||
4054 | 456 | os.environ['LD_LIBRARY_PATH'] = os.environ['LD_LIBRARY_PATH'] + \ | 500 | os.environ['LD_LIBRARY_PATH'] = os.environ['LD_LIBRARY_PATH'] + \ |
4058 | 457 | ":" + self.ma5dir+'/tools/SampleAnalyzer/Lib/' | 501 | ":" + ':'.join(self.configLinux.toLDPATH) |
4059 | 458 | os.environ['LIBRARY_PATH'] = os.environ['LIBRARY_PATH'] + \ | 502 | if self.isMAC: |
4060 | 459 | ":" + self.ma5dir+'/tools/SampleAnalyzer/Lib/' | 503 | os.environ['DYLD_LIBRARY_PATH'] = os.environ['DYLD_LIBRARY_PATH'] + \ |
4061 | 504 | ":" + ':'.join(self.configLinux.toLDPATH) | ||
4062 | 460 | 505 | ||
4063 | 461 | if self.mcatnloutils: | ||
4064 | 462 | os.environ['LD_LIBRARY_PATH'] = os.environ['LD_LIBRARY_PATH'] + \ | ||
4065 | 463 | ":" + self.ma5dir+'/tools/MCatNLO-utilities/MCatNLO/lib/' | ||
4066 | 464 | os.environ['LIBRARY_PATH'] = os.environ['LIBRARY_PATH'] + \ | ||
4067 | 465 | ":" + self.ma5dir+'/tools/MCatNLO-utilities/MCatNLO/lib/' | ||
4068 | 466 | |||
4069 | 467 | return True | 506 | return True |
4070 | 468 | 507 | ||
4071 | 508 | def PrintOK(self): | ||
4072 | 509 | sys.stdout.write('\x1b[32m'+'[OK]'+'\x1b[0m'+'\n') | ||
4073 | 510 | sys.stdout.flush() | ||
4074 | 511 | |||
4075 | 469 | def BuildLibrary(self,forced=False): | 512 | def BuildLibrary(self,forced=False): |
4077 | 470 | builder = LibraryBuilder(self.configLinux,self.ma5dir) | 513 | builder = LibraryBuilder(self.configLinux,self.ma5dir,self.libZIP,self.libDelphes,self.libDelfes,self.libFastJet) |
4078 | 514 | |||
4079 | 471 | UpdateNeed=False | 515 | UpdateNeed=False |
4083 | 472 | 516 | FirstUse, Missing = builder.checkMA5() | |
4084 | 473 | FirstUse = builder.checkMA5() | 517 | if not FirstUse and not Missing: |
4082 | 474 | if not FirstUse: | ||
4085 | 475 | UpdateNeed = not builder.compare() | 518 | UpdateNeed = not builder.compare() |
4086 | 476 | 519 | ||
4089 | 477 | rebuild = forced or FirstUse or UpdateNeed | 520 | rebuild = forced or FirstUse or UpdateNeed or Missing |
4090 | 478 | if not rebuild: | 521 | |
4091 | 522 | if not rebuild: | ||
4092 | 523 | if not os.path.isfile(self.ma5dir+'/tools/SampleAnalyzer/Lib/libSampleAnalyzer.so'): | ||
4093 | 524 | FirstUse=True | ||
4094 | 525 | rebuild = forced or FirstUse or UpdateNeed or Missing | ||
4095 | 526 | |||
4096 | 527 | if not rebuild: | ||
4097 | 528 | logging.info(' => MadAnalysis libraries found.') | ||
4098 | 529 | |||
4099 | 530 | # Test the program | ||
4100 | 531 | if not os.path.isfile(self.ma5dir+'/tools/SampleAnalyzer/Test/SampleAnalyzerTest'): | ||
4101 | 532 | FirstUse=True | ||
4102 | 533 | |||
4103 | 534 | precompiler = LibraryWriter(self.ma5dir,'lib',self.libZIP,self.libFastJet,self.forced,self.fortran,self.libDelphes,self.libDelfes,self) | ||
4104 | 535 | if not precompiler.Run('SampleAnalyzerTest',[],self.ma5dir+'/tools/SampleAnalyzer/Test',silent=True): | ||
4105 | 536 | UpdateNeed=True | ||
4106 | 537 | |||
4107 | 538 | if not precompiler.CheckRun(self.ma5dir+'/tools/SampleAnalyzer/Test/SampleAnalyzerTest.log',silent=True): | ||
4108 | 539 | UpdateNeed=True | ||
4109 | 540 | rebuild = forced or FirstUse or UpdateNeed or Missing | ||
4110 | 541 | |||
4111 | 542 | if not rebuild: | ||
4112 | 543 | logging.info(' => MadAnalysis test program works.') | ||
4113 | 479 | return True | 544 | return True |
4114 | 480 | 545 | ||
4115 | 481 | # Compile library | 546 | # Compile library |
4116 | 482 | if FirstUse: | 547 | if FirstUse: |
4117 | 483 | logging.info(" => First use of MadAnalysis (or the library is missing).") | 548 | logging.info(" => First use of MadAnalysis (or the library is missing).") |
4118 | 549 | elif Missing: | ||
4119 | 550 | logging.info(" => Libraries are missing or system configuration has changed. Need to rebuild the library.") | ||
4120 | 484 | elif UpdateNeed: | 551 | elif UpdateNeed: |
4121 | 485 | logging.info(" => System configuration has changed since the last use. Need to rebuild the library.") | 552 | logging.info(" => System configuration has changed since the last use. Need to rebuild the library.") |
4122 | 486 | elif forced: | 553 | elif forced: |
4123 | 487 | logging.info(" => The user forces to rebuild the library.") | 554 | logging.info(" => The user forces to rebuild the library.") |
4124 | 488 | 555 | ||
4125 | 489 | # Initializing the JobWriter | 556 | # Initializing the JobWriter |
4127 | 490 | compiler = LibraryWriter(self.ma5dir,'lib',self.libZIP,self.libFastJet,self.forced,self.fortran,self.libDelphes) | 557 | compiler = LibraryWriter(self.ma5dir,'lib',self.libZIP,self.libFastJet,self.forced,self.fortran,self.libDelphes,self.libDelfes,self) |
4128 | 491 | 558 | ||
4129 | 492 | # Dumping architecture | 559 | # Dumping architecture |
4130 | 493 | if not self.configLinux.Export(self.ma5dir+'/tools/architecture.ma5'): | 560 | if not self.configLinux.Export(self.ma5dir+'/tools/architecture.ma5'): |
4131 | 494 | sys.exit() | 561 | sys.exit() |
4132 | 495 | 562 | ||
4161 | 496 | logging.info(" Creating a 'Makefile'...") | 563 | # Library to compiles |
4162 | 497 | if not compiler.WriteMakefile('shared'): | 564 | libraries = [] |
4163 | 498 | logging.error("library building aborted.") | 565 | if self.libFastJet: |
4164 | 499 | sys.exit() | 566 | libraries.append(['FastJet', 'interface to FastJet', 'fastjet', self.ma5dir+'/tools/SampleAnalyzer/Lib/libfastjet_for_ma5.so',self.ma5dir+'/tools/SampleAnalyzer/Interfaces']) |
4165 | 500 | 567 | if self.libZIP: | |
4166 | 501 | if not compiler.MrProper(): | 568 | libraries.append(['zlib', 'interface to zlib', 'zlib', self.ma5dir+'/tools/SampleAnalyzer/Lib/libzlib_for_ma5.so',self.ma5dir+'/tools/SampleAnalyzer/Interfaces']) |
4167 | 502 | logging.error("impossible to remove temporary files created during the building.") | 569 | if self.libDelphes: |
4168 | 503 | sys.exit() | 570 | libraries.append(['Delphes', 'interface to Delphes', 'delphes', self.ma5dir+'/tools/SampleAnalyzer/Lib/libdelphes_for_ma5.so',self.ma5dir+'/tools/SampleAnalyzer/Interfaces']) |
4169 | 504 | 571 | if self.libDelfes: | |
4170 | 505 | logging.info(" Compiling the MadAnalysis library...") | 572 | libraries.append(['Delfes', 'interface to Delfes', 'delfes', self.ma5dir+'/tools/SampleAnalyzer/Lib/libdelfes_for_ma5.so',self.ma5dir+'/tools/SampleAnalyzer/Interfaces']) |
4171 | 506 | if not compiler.Compile(): | 573 | libraries.append(['SampleAnalyzer', 'general SampleAnalyzer component', 'SampleAnalyzer', self.ma5dir+'/tools/SampleAnalyzer/Lib/libSampleAnalyzer.so',self.ma5dir+'/tools/SampleAnalyzer']) |
4172 | 507 | logging.error("library building aborted.") | 574 | |
4173 | 508 | sys.exit() | 575 | # Writing the Makefiles |
4174 | 509 | 576 | logging.info("") | |
4175 | 510 | logging.info(" Linking the MadAnalysis library...") | 577 | logging.info(" **********************************************************") |
4176 | 511 | if not compiler.Link(): | 578 | logging.info(" Building SampleAnalyzer libraries ") |
4177 | 512 | logging.error("library building aborted.") | 579 | logging.info(" **********************************************************") |
4178 | 513 | sys.exit() | 580 | |
4179 | 514 | 581 | ||
4180 | 515 | logging.info(" Checking the MadAnalysis library...") | 582 | # Getting number of cores |
4181 | 516 | 583 | ncores = compiler.get_ncores2() | |
4182 | 517 | if not os.path.isfile(self.ma5dir+'/tools/SampleAnalyzer/Lib/libSampleAnalyzer.a'): | 584 | |
4183 | 518 | logging.error("the library 'libSampleAnalyzer.a' is not produced.") | 585 | # Compiling the libraries |
4184 | 519 | sys.exit() | 586 | for ind in range(0,len(libraries)): |
4185 | 520 | 587 | ||
4186 | 521 | if not compiler.Clean(): | 588 | logging.info(" **********************************************************") |
4187 | 522 | logging.error("impossible to remove temporary files created during the building.") | 589 | logging.info(" Library "+str(ind+1)+"/"+str(len(libraries))+" - "+libraries[ind][1]) |
4188 | 523 | sys.exit() | 590 | |
4189 | 591 | # Writing a Makefile | ||
4190 | 592 | logging.info(" - Writing a Makefile ...") | ||
4191 | 593 | if libraries[ind][0]=='SampleAnalyzer': | ||
4192 | 594 | if not compiler.WriteMakefile(): | ||
4193 | 595 | logging.error("library building aborted.") | ||
4194 | 596 | sys.exit() | ||
4195 | 597 | else: | ||
4196 | 598 | if not compiler.WriteMakefileForInterfaces(libraries[ind][2]): | ||
4197 | 599 | logging.error("library building aborted.") | ||
4198 | 600 | sys.exit() | ||
4199 | 601 | |||
4200 | 602 | # Cleaning the project | ||
4201 | 603 | logging.info(" - Cleaning the project before building the library ...") | ||
4202 | 604 | if not compiler.MrProper(libraries[ind][2],libraries[ind][4]): | ||
4203 | 605 | logging.error("library building aborted.") | ||
4204 | 606 | sys.exit() | ||
4205 | 607 | |||
4206 | 608 | # Compiling | ||
4207 | 609 | logging.info(" - Compiling the source files ...") | ||
4208 | 610 | if not compiler.Compile(ncores,libraries[ind][2],libraries[ind][4]): | ||
4209 | 611 | logging.error("library building aborted.") | ||
4210 | 612 | sys.exit() | ||
4211 | 613 | |||
4212 | 614 | # Linking | ||
4213 | 615 | logging.info(" - Linking the library ...") | ||
4214 | 616 | if not compiler.Link(libraries[ind][2],libraries[ind][4]): | ||
4215 | 617 | logging.error("library building aborted.") | ||
4216 | 618 | sys.exit() | ||
4217 | 619 | |||
4218 | 620 | # Checking | ||
4219 | 621 | logging.info(" - Checking that the library is properly built ...") | ||
4220 | 622 | if not os.path.isfile(libraries[ind][3]): | ||
4221 | 623 | logging.error("the library '"+libraries[ind][3]+"' is not produced.") | ||
4222 | 624 | sys.exit() | ||
4223 | 625 | |||
4224 | 626 | # Cleaning the project | ||
4225 | 627 | logging.info(" - Cleaning the project after building the library ...") | ||
4226 | 628 | if not compiler.Clean(libraries[ind][2],libraries[ind][4]): | ||
4227 | 629 | logging.error("library building aborted.") | ||
4228 | 630 | sys.exit() | ||
4229 | 631 | |||
4230 | 632 | # Print Ok | ||
4231 | 633 | sys.stdout.write(" => Status: ") | ||
4232 | 634 | self.PrintOK() | ||
4233 | 635 | |||
4234 | 636 | logging.info(" **********************************************************") | ||
4235 | 637 | logging.info(" Test program ") | ||
4236 | 638 | |||
4237 | 639 | # Writing a Makefile | ||
4238 | 640 | logging.info(" - Writing a Makefile ...") | ||
4239 | 641 | if not compiler.WriteMakefileForTest(): | ||
4240 | 642 | logging.error("test program building aborted.") | ||
4241 | 643 | sys.exit() | ||
4242 | 644 | |||
4243 | 645 | # Cleaning the project | ||
4244 | 646 | logging.info(" - Cleaning the project before building the program ...") | ||
4245 | 647 | if not compiler.MrProper('test',self.ma5dir+'/tools/SampleAnalyzer/Test'): | ||
4246 | 648 | logging.error("test program building aborted.") | ||
4247 | 649 | sys.exit() | ||
4248 | 650 | |||
4249 | 651 | # Compiling | ||
4250 | 652 | logging.info(" - Compiling the source files ...") | ||
4251 | 653 | if not compiler.Compile(ncores,'test',self.ma5dir+'/tools/SampleAnalyzer/Test'): | ||
4252 | 654 | logging.error("test program building aborted.") | ||
4253 | 655 | sys.exit() | ||
4254 | 656 | |||
4255 | 657 | # Linking | ||
4256 | 658 | logging.info(" - Linking the program ...") | ||
4257 | 659 | if not compiler.Link('test',self.ma5dir+'/tools/SampleAnalyzer/Test'): | ||
4258 | 660 | logging.error("test program building aborted.") | ||
4259 | 661 | sys.exit() | ||
4260 | 662 | |||
4261 | 663 | # Checking | ||
4262 | 664 | logging.info(" - Checking that the program is properly built ...") | ||
4263 | 665 | filename=self.ma5dir+'/tools/SampleAnalyzer/Test/SampleAnalyzerTest' | ||
4264 | 666 | if not os.path.isfile(filename): | ||
4265 | 667 | logging.error("the test program '"+filename+"' is not produced.") | ||
4266 | 668 | sys.exit() | ||
4267 | 669 | |||
4268 | 670 | # Cleaning the project | ||
4269 | 671 | logging.info(" - Cleaning the project after building the program ...") | ||
4270 | 672 | if not compiler.Clean('test',self.ma5dir+'/tools/SampleAnalyzer/Test'): | ||
4271 | 673 | logging.error("test program building aborted.") | ||
4272 | 674 | sys.exit() | ||
4273 | 675 | |||
4274 | 676 | # Running the program test | ||
4275 | 677 | logging.info(" - Running the test program ...") | ||
4276 | 678 | if not compiler.Run('SampleAnalyzerTest',[],self.ma5dir+'/tools/SampleAnalyzer/Test'): | ||
4277 | 679 | logging.error("the test is failed.") | ||
4278 | 680 | sys.exit() | ||
4279 | 681 | |||
4280 | 682 | # Checking the program output | ||
4281 | 683 | logging.info(" - Checking the program output...") | ||
4282 | 684 | if not compiler.CheckRun(self.ma5dir+'/tools/SampleAnalyzer/Test/SampleAnalyzerTest.log'): | ||
4283 | 685 | logging.error("the test is failed.") | ||
4284 | 686 | sys.exit() | ||
4285 | 687 | |||
4286 | 688 | # Print Ok | ||
4287 | 689 | sys.stdout.write(" => Status: ") | ||
4288 | 690 | self.PrintOK() | ||
4289 | 691 | |||
4290 | 692 | |||
4291 | 693 | logging.info("") | ||
4292 | 524 | 694 | ||
4293 | 525 | return True | 695 | return True |
4294 | 526 | 696 | ||
4295 | 527 | 697 | ||
4296 | === modified file 'madanalysis/enumeration/observable_type.py' | |||
4297 | --- madanalysis/enumeration/observable_type.py 2013-05-17 06:19:22 +0000 | |||
4298 | +++ madanalysis/enumeration/observable_type.py 2014-05-17 19:51:11 +0000 | |||
4299 | @@ -30,10 +30,10 @@ | |||
4300 | 30 | # name : accept_particles | 30 | # name : accept_particles |
4301 | 31 | values = { 'UNKNOWN' : [False,'','','','',0,0,0,False,False],\ | 31 | values = { 'UNKNOWN' : [False,'','','','',0,0,0,False,False],\ |
4302 | 32 | 'SQRTS' : [False,'PHYSICS->SqrtS(event.mc())','PHYSICS->SqrtS(event.mc())','','GeV',100,0.,1000., True, False],\ | 32 | 'SQRTS' : [False,'PHYSICS->SqrtS(event.mc())','PHYSICS->SqrtS(event.mc())','','GeV',100,0.,1000., True, False],\ |
4307 | 33 | 'TET' : [False,'PHYSICS->EventTET(event.mc())','PHYSICS->EventTET(event.mc())','PHYSICS->EventTET(event.rec())','GeV',100,0.,1000., True,False],\ | 33 | 'TET' : [False,'PHYSICS->Transverse->EventTET(event.mc())','PHYSICS->Transverse->EventTET(event.mc())','PHYSICS->Transverse->EventTET(event.rec())','GeV',100,0.,1000., True,False],\ |
4308 | 34 | 'MET' : [False,'PHYSICS->EventMET(event.mc())','PHYSICS->EventMET(event.mc())','PHYSICS->EventMET(event.rec())','GeV',100,0.,1000., True,False],\ | 34 | 'MET' : [False,'PHYSICS->Transverse->EventMET(event.mc())','PHYSICS->Transverse->EventMET(event.mc())','PHYSICS->Transverse->EventMET(event.rec())','GeV',100,0.,1000., True,False],\ |
4309 | 35 | 'THT' : [False,'PHYSICS->EventTHT(event.mc())','PHYSICS->EventTHT(event.mc())','PHYSICS->EventTHT(event.rec())','GeV',100,0.,1000., True,False],\ | 35 | 'THT' : [False,'PHYSICS->Transverse->EventTHT(event.mc())','PHYSICS->Transverse->EventTHT(event.mc())','PHYSICS->Transverse->EventTHT(event.rec())','GeV',100,0.,1000., True,False],\ |
4310 | 36 | 'MHT' : [False,'PHYSICS->EventMHT(event.mc())','PHYSICS->EventMHT(event.mc())','PHYSICS->EventMHT(event.rec())','GeV',100,0.,1000.,True,False],\ | 36 | 'MHT' : [False,'PHYSICS->Transverse->EventMHT(event.mc())','PHYSICS->Transverse->EventMHT(event.mc())','PHYSICS->Transverse->EventMHT(event.rec())','GeV',100,0.,1000.,True,False],\ |
4311 | 37 | 'NPID': [False,'NPID','NPID','NPID','',100,0.,100.,False,False],\ | 37 | 'NPID': [False,'NPID','NPID','NPID','',100,0.,100.,False,False],\ |
4312 | 38 | 'NAPID': [False,'NAPID','NAPID','NAPID','',100,0.,100.,False,False],\ | 38 | 'NAPID': [False,'NAPID','NAPID','NAPID','',100,0.,100.,False,False],\ |
4313 | 39 | 'E' : [True,'e()','e()','e()','GeV',100,0.,1000.,True,True],\ | 39 | 'E' : [True,'e()','e()','e()','GeV',100,0.,1000.,True,True],\ |
4314 | 40 | 40 | ||
4315 | === added file 'madanalysis/input/installation_options.dat' | |||
4316 | --- madanalysis/input/installation_options.dat 1970-01-01 00:00:00 +0000 | |||
4317 | +++ madanalysis/input/installation_options.dat 2014-05-17 19:51:11 +0000 | |||
4318 | @@ -0,0 +1,35 @@ | |||
4319 | 1 | # WARNING MA5 SHOULD DETECT AUTOMATICALLY YOUR CONFIGURATION | ||
4320 | 2 | # IF THIS AUTOMATED MODE FAILS, YOU CAN FORCE SOME | ||
4321 | 3 | # OPTIONS THROUGH THIS FILE | ||
4322 | 4 | |||
4323 | 5 | # -----ROOT----- | ||
4324 | 6 | # root_includes = /home/toto/root/include | ||
4325 | 7 | # root_libs = /home/toto/root/lib | ||
4326 | 8 | |||
4327 | 9 | # -----DELPHES----- | ||
4328 | 10 | # delphes_veto = 0 # 0=No, 1=Yes | ||
4329 | 11 | # delphes_includes = /home/toto/delphes/include | ||
4330 | 12 | # delphes_libs = /home/toto/delphes/lib | ||
4331 | 13 | |||
4332 | 14 | # -----DELFES----- | ||
4333 | 15 | # delfes_veto = 0 # 0=No, 1=Yes | ||
4334 | 16 | # delfes_includes = /home/toto/delfes/include | ||
4335 | 17 | # delfes_libs = /home/toto/delfes/lib | ||
4336 | 18 | |||
4337 | 19 | # -----ZLIB----- | ||
4338 | 20 | # zlib_veto = 0 # 0=No, 1=Yes | ||
4339 | 21 | # zlib_includes = /home/toto/zlib/include | ||
4340 | 22 | # zlib_libs = /home/toto/zlib/lib | ||
4341 | 23 | |||
4342 | 24 | # -----FASTJET----- | ||
4343 | 25 | # fastjet_veto = 0 # 0=No, 1=Yes | ||
4344 | 26 | # fastjet_bin_path = /home/toto/fastjet/include | ||
4345 | 27 | |||
4346 | 28 | # -----PDFLATEX----- | ||
4347 | 29 | # pdflatex_veto = 0 # 0=No, 1=Yes | ||
4348 | 30 | |||
4349 | 31 | # -----LATEX----- | ||
4350 | 32 | # latex_veto = 0 # 0=No, 1=Yes | ||
4351 | 33 | |||
4352 | 34 | # -----DVIPDF----- | ||
4353 | 35 | # dvipdf_veto = 0 # 0=No, 1=Yes | ||
4354 | 0 | 36 | ||
4355 | === modified file 'madanalysis/input/particles_name_default.txt' | |||
4356 | --- madanalysis/input/particles_name_default.txt 2013-07-12 13:09:17 +0000 | |||
4357 | +++ madanalysis/input/particles_name_default.txt 2014-05-17 19:51:11 +0000 | |||
4358 | @@ -50,9 +50,8 @@ | |||
4359 | 50 | 23 z | 50 | 23 z |
4360 | 51 | 24 w+ | 51 | 24 w+ |
4361 | 52 | -24 w- | 52 | -24 w- |
4365 | 53 | # Note that we can't give a name to 25 here, | 53 | # The Higgs boson is called h1 |
4366 | 54 | # since it is different in SM and MSSM. | 54 | 25 h1 |
4364 | 55 | # MSSM Higgs | ||
4367 | 56 | 35 h2 | 55 | 35 h2 |
4368 | 57 | 36 h3 | 56 | 36 h3 |
4369 | 58 | 37 h+ | 57 | 37 h+ |
4370 | 59 | 58 | ||
4371 | === modified file 'madanalysis/interpreter/cmd_base.py' | |||
4372 | --- madanalysis/interpreter/cmd_base.py 2013-05-17 06:19:22 +0000 | |||
4373 | +++ madanalysis/interpreter/cmd_base.py 2014-05-17 19:51:11 +0000 | |||
4374 | @@ -29,7 +29,7 @@ | |||
4375 | 29 | class CmdBase(): | 29 | class CmdBase(): |
4376 | 30 | """Command CMDBase""" | 30 | """Command CMDBase""" |
4377 | 31 | 31 | ||
4379 | 32 | reserved_words=["exit","quit","eof","history","shell","from","as","all","or","and"] | 32 | reserved_words=["exit","quit","eof","history","shell","from","as","all","or","and","main"] |
4380 | 33 | 33 | ||
4381 | 34 | def __init__(self,main,cmd_name): | 34 | def __init__(self,main,cmd_name): |
4382 | 35 | self.reserved_words.append(cmd_name) | 35 | self.reserved_words.append(cmd_name) |
4383 | 36 | 36 | ||
4384 | === modified file 'madanalysis/interpreter/cmd_install.py' | |||
4385 | --- madanalysis/interpreter/cmd_install.py 2013-10-27 21:05:18 +0000 | |||
4386 | +++ madanalysis/interpreter/cmd_install.py 2014-05-17 19:51:11 +0000 | |||
4387 | @@ -23,6 +23,7 @@ | |||
4388 | 23 | 23 | ||
4389 | 24 | 24 | ||
4390 | 25 | from madanalysis.interpreter.cmd_base import CmdBase | 25 | from madanalysis.interpreter.cmd_base import CmdBase |
4391 | 26 | from madanalysis.IOinterface.delphes_migration import DelphesMigration | ||
4392 | 26 | import logging | 27 | import logging |
4393 | 27 | import os | 28 | import os |
4394 | 28 | import sys | 29 | import sys |
4395 | @@ -86,6 +87,8 @@ | |||
4396 | 86 | return self.install_zlib() | 87 | return self.install_zlib() |
4397 | 87 | elif args[0]=='delphes': | 88 | elif args[0]=='delphes': |
4398 | 88 | return self.install_delphes() | 89 | return self.install_delphes() |
4399 | 90 | elif args[0]=='delfes': | ||
4400 | 91 | return self.install_delfes() | ||
4401 | 89 | elif args[0]=='fastjet': | 92 | elif args[0]=='fastjet': |
4402 | 90 | return self.install_fastjet() | 93 | return self.install_fastjet() |
4403 | 91 | elif args[0]=='MCatNLO-for-ma5': | 94 | elif args[0]=='MCatNLO-for-ma5': |
4404 | @@ -99,7 +102,7 @@ | |||
4405 | 99 | def help(self): | 102 | def help(self): |
4406 | 100 | logging.info(" Syntax: install <component>") | 103 | logging.info(" Syntax: install <component>") |
4407 | 101 | logging.info(" Download and install a MadAnalysis component from the official site.") | 104 | logging.info(" Download and install a MadAnalysis component from the official site.") |
4409 | 102 | logging.info(" List of available components : samples zlib fastjet MCatNLO-for-ma5 delphes") | 105 | logging.info(" List of available components : samples zlib fastjet MCatNLO-for-ma5 delphes delfes") |
4410 | 103 | 106 | ||
4411 | 104 | 107 | ||
4412 | 105 | def get_ncores(self): | 108 | def get_ncores(self): |
4413 | @@ -219,8 +222,7 @@ | |||
4414 | 219 | # End | 222 | # End |
4415 | 220 | logging.info("Installation complete.") | 223 | logging.info("Installation complete.") |
4416 | 221 | 224 | ||
4419 | 222 | 225 | return 'restart' | |
4418 | 223 | return True | ||
4420 | 224 | 226 | ||
4421 | 225 | 227 | ||
4422 | 226 | def install_delphes(self): | 228 | def install_delphes(self): |
4423 | @@ -244,9 +246,11 @@ | |||
4424 | 244 | installdir = self.main.ma5dir + '/tools/delphes/' | 246 | installdir = self.main.ma5dir + '/tools/delphes/' |
4425 | 245 | 247 | ||
4426 | 246 | # List of files | 248 | # List of files |
4428 | 247 | files = { "delphes.tar.gz" : "http://cp3.irmp.ucl.ac.be/downloads/Delphes-3.0.10.tar.gz" } | 249 | #files = { "delphes.tar.gz" : "http://cp3.irmp.ucl.ac.be/downloads/Delphes-3.0.12.tar.gz" } |
4429 | 250 | files = { "delphes.tar.gz" : "http://cp3.irmp.ucl.ac.be/downloads/Delphes-3.1.1.tar.gz"} | ||
4430 | 248 | 251 | ||
4431 | 249 | # Launching wget | 252 | # Launching wget |
4432 | 253 | logging.info("Configuring the package ...") | ||
4433 | 250 | if not self.wget(files,'delphes',installdir): | 254 | if not self.wget(files,'delphes',installdir): |
4434 | 251 | return False | 255 | return False |
4435 | 252 | 256 | ||
4436 | @@ -287,8 +291,85 @@ | |||
4437 | 287 | # End | 291 | # End |
4438 | 288 | logging.info("Installation complete.") | 292 | logging.info("Installation complete.") |
4439 | 289 | 293 | ||
4442 | 290 | 294 | return 'restart' | |
4443 | 291 | return True | 295 | |
4444 | 296 | |||
4445 | 297 | def install_delfes(self): | ||
4446 | 298 | |||
4447 | 299 | # Asking for number of cores | ||
4448 | 300 | ncores = self.get_ncores() | ||
4449 | 301 | |||
4450 | 302 | # Checking connection with MA5 web site | ||
4451 | 303 | if not self.check_ma5site(): | ||
4452 | 304 | return False | ||
4453 | 305 | |||
4454 | 306 | # Creating tools folder | ||
4455 | 307 | if not self.create_tools_folder(): | ||
4456 | 308 | return False | ||
4457 | 309 | |||
4458 | 310 | # Creating package folder | ||
4459 | 311 | if not self.create_package_folder('delfes'): | ||
4460 | 312 | return False | ||
4461 | 313 | |||
4462 | 314 | # Directory to install | ||
4463 | 315 | installdir = self.main.ma5dir + '/tools/delfes/' | ||
4464 | 316 | |||
4465 | 317 | # List of files | ||
4466 | 318 | # files = { "delfes.tar.gz" : "http://cp3.irmp.ucl.ac.be/downloads/Delphes-3.0.12.tar.gz" } | ||
4467 | 319 | files = { "delfes.tar.gz" : "http://cp3.irmp.ucl.ac.be/downloads/Delphes-3.1.1.tar.gz"} | ||
4468 | 320 | |||
4469 | 321 | # Launching wget | ||
4470 | 322 | if not self.wget(files,'delfes',installdir): | ||
4471 | 323 | return False | ||
4472 | 324 | |||
4473 | 325 | # Detarring package | ||
4474 | 326 | packagedir = self.untar(installdir,'delfes.tar.gz','delfes') | ||
4475 | 327 | if packagedir == "": | ||
4476 | 328 | return False | ||
4477 | 329 | |||
4478 | 330 | # Changing the name of the directory | ||
4479 | 331 | os.system("mv "+packagedir+"/* "+self.main.ma5dir+"/tools/delfes/") | ||
4480 | 332 | packagedir = self.main.ma5dir+"/tools/delfes/" | ||
4481 | 333 | |||
4482 | 334 | # Migration | ||
4483 | 335 | logging.info("Applying the MadAnalysis 5 patch to the package ...") | ||
4484 | 336 | migrator = DelphesMigration(self.main) | ||
4485 | 337 | migrator.Migrate() | ||
4486 | 338 | |||
4487 | 339 | # Configuring | ||
4488 | 340 | logging.info("Configuring the package ...") | ||
4489 | 341 | os.system("cd "+packagedir+" ; ./configure > "+self.main.ma5dir+"/tools/delfes/"+"configuration.log 2>&1") | ||
4490 | 342 | |||
4491 | 343 | # Compiling | ||
4492 | 344 | logging.info("Compiling the package ...") | ||
4493 | 345 | os.system("cd "+packagedir+" ; make -j"+str(ncores)+" > "+self.main.ma5dir+"/tools/delfes/"+"compilation.log 2>&1") | ||
4494 | 346 | |||
4495 | 347 | # Final check | ||
4496 | 348 | logging.info("Checking installation ...") | ||
4497 | 349 | if (not os.path.isdir(self.main.ma5dir+"/tools/delfes/modules")): | ||
4498 | 350 | logging.error('package modules are missing.') | ||
4499 | 351 | self.display_log('delfes') | ||
4500 | 352 | return False | ||
4501 | 353 | |||
4502 | 354 | if not os.path.isfile(self.main.ma5dir+'/tools/delfes/modules/ParticlePropagator.h'): | ||
4503 | 355 | logging.error("header labeled 'modules/ParticlePropagator.h' is missing.") | ||
4504 | 356 | self.display_log('delfes') | ||
4505 | 357 | return False | ||
4506 | 358 | |||
4507 | 359 | if not os.path.isfile(self.main.ma5dir+'/tools/delfes/libDelphes.so'): | ||
4508 | 360 | logging.error("library labeled 'libdelphes.so' is missing.") | ||
4509 | 361 | self.display_log('delfes') | ||
4510 | 362 | return False | ||
4511 | 363 | |||
4512 | 364 | if not os.path.isfile(self.main.ma5dir+'/tools/delfes/DelphesSTDHEP'): | ||
4513 | 365 | logging.error("library labeled 'DelphesSTDHEP' is missing.") | ||
4514 | 366 | self.display_log('delfes') | ||
4515 | 367 | return False | ||
4516 | 368 | |||
4517 | 369 | # End | ||
4518 | 370 | logging.info("Installation complete.") | ||
4519 | 371 | |||
4520 | 372 | return 'restart' | ||
4521 | 292 | 373 | ||
4522 | 293 | 374 | ||
4523 | 294 | def install_mcatnlo(self): | 375 | def install_mcatnlo(self): |
4524 | @@ -423,7 +504,7 @@ | |||
4525 | 423 | for file,url in files.items(): | 504 | for file,url in files.items(): |
4526 | 424 | ind+=1 | 505 | ind+=1 |
4527 | 425 | result="OK" | 506 | result="OK" |
4529 | 426 | logging.info(' * ' + str(ind)+"/"+str(len(files.keys()))+" Downloading the file '"+file+"' ...") | 507 | logging.info(' * ' + str(ind)+"/"+str(len(files.keys()))+" Downloading the file "+url+" ...") |
4530 | 427 | 508 | ||
4531 | 428 | try: | 509 | try: |
4532 | 429 | urllib.urlretrieve(url,installdir+'/'+file,CmdInstall.reporthook) | 510 | urllib.urlretrieve(url,installdir+'/'+file,CmdInstall.reporthook) |
4533 | @@ -473,7 +554,7 @@ | |||
4534 | 473 | return False | 554 | return False |
4535 | 474 | 555 | ||
4536 | 475 | # List of files | 556 | # List of files |
4538 | 476 | files = { "fastjet.tar.gz" : "https://madanalysis.irmp.ucl.ac.be/raw-attachment/wiki/WikiStart/fastjet-3.0.3.tar.gz" } | 557 | files = { "fastjet.tar.gz" : "http://madanalysis.irmp.ucl.ac.be/raw-attachment/wiki/WikiStart/fastjet-3.0.6.tar.gz" } |
4539 | 477 | 558 | ||
4540 | 478 | # Launching wget | 559 | # Launching wget |
4541 | 479 | if not self.wget(files,'fastjet',installdir): | 560 | if not self.wget(files,'fastjet',installdir): |
4542 | @@ -521,11 +602,10 @@ | |||
4543 | 521 | self.display_log('fastjet') | 602 | self.display_log('fastjet') |
4544 | 522 | return False | 603 | return False |
4545 | 523 | 604 | ||
4546 | 524 | |||
4547 | 525 | # End | 605 | # End |
4548 | 526 | logging.info("Installation complete.") | 606 | logging.info("Installation complete.") |
4549 | 527 | 607 | ||
4551 | 528 | return True | 608 | return 'restart' |
4552 | 529 | 609 | ||
4553 | 530 | 610 | ||
4554 | 531 | def install_samples(self): | 611 | def install_samples(self): |
4555 | @@ -593,7 +673,7 @@ | |||
4556 | 593 | if nargs>2: | 673 | if nargs>2: |
4557 | 594 | return [] | 674 | return [] |
4558 | 595 | else: | 675 | else: |
4560 | 596 | output = ["samples","zlib","fastjet", "MCatNLO-for-ma5", "delphes" ] | 676 | output = ["samples","zlib","fastjet", "MCatNLO-for-ma5", "delphes", "delfes" ] |
4561 | 597 | return self.finalize_complete(text,output) | 677 | return self.finalize_complete(text,output) |
4562 | 598 | 678 | ||
4563 | 599 | 679 | ||
4564 | 600 | 680 | ||
4565 | === modified file 'madanalysis/interpreter/cmd_plot.py' | |||
4566 | --- madanalysis/interpreter/cmd_plot.py 2013-05-17 06:19:22 +0000 | |||
4567 | +++ madanalysis/interpreter/cmd_plot.py 2014-05-17 19:51:11 +0000 | |||
4568 | @@ -54,7 +54,6 @@ | |||
4569 | 54 | 54 | ||
4570 | 55 | # Getting reference to observable | 55 | # Getting reference to observable |
4571 | 56 | obsRef=self.main.observables.get(obsName) | 56 | obsRef=self.main.observables.get(obsName) |
4572 | 57 | |||
4573 | 58 | foundArguments = False | 57 | foundArguments = False |
4574 | 59 | foundOptions = False | 58 | foundOptions = False |
4575 | 60 | foundBinning = False | 59 | foundBinning = False |
4576 | @@ -80,7 +79,7 @@ | |||
4577 | 80 | Nbracket2-=1 | 79 | Nbracket2-=1 |
4578 | 81 | if i==(len(args)-1): | 80 | if i==(len(args)-1): |
4579 | 82 | foundOptions=True | 81 | foundOptions=True |
4581 | 83 | 82 | ||
4582 | 84 | if Nbracket1!=0: | 83 | if Nbracket1!=0: |
4583 | 85 | logging.error("number of opening-bracket '(' and number of " +\ | 84 | logging.error("number of opening-bracket '(' and number of " +\ |
4584 | 86 | "closing-braket ')' does not match.") | 85 | "closing-braket ')' does not match.") |
4585 | @@ -168,6 +167,11 @@ | |||
4586 | 168 | arguments=self.extract_arguments(args[2:endArguments],obsName,obsRef) | 167 | arguments=self.extract_arguments(args[2:endArguments],obsName,obsRef) |
4587 | 169 | if arguments==None: | 168 | if arguments==None: |
4588 | 170 | return | 169 | return |
4589 | 170 | elif len(obsRef.args) !=0: # checks whether arguments should have been provided | ||
4590 | 171 | logging.error("the observable '"+obsName+"' requires "+ | ||
4591 | 172 | str(len(obsRef.args))+" arguments whereas no arguments have been specified.") | ||
4592 | 173 | return | ||
4593 | 174 | |||
4594 | 171 | 175 | ||
4595 | 172 | # Creating histo | 176 | # Creating histo |
4596 | 173 | histo = Histogram(obsRef,arguments,nbins,xmin,xmax) | 177 | histo = Histogram(obsRef,arguments,nbins,xmin,xmax) |
4597 | 174 | 178 | ||
4598 | === modified file 'madanalysis/interpreter/cmd_set.py' | |||
4599 | --- madanalysis/interpreter/cmd_set.py 2013-09-26 12:30:50 +0000 | |||
4600 | +++ madanalysis/interpreter/cmd_set.py 2014-05-17 19:51:11 +0000 | |||
4601 | @@ -102,7 +102,7 @@ | |||
4602 | 102 | elif len(objs)==3 and objs[0].lower()=='main' and objs[1].lower()=='merging': | 102 | elif len(objs)==3 and objs[0].lower()=='main' and objs[1].lower()=='merging': |
4603 | 103 | self.main.merging.user_SetParameter(objs[2],args[2],self.main.mode,self.main.libFastJet) | 103 | self.main.merging.user_SetParameter(objs[2],args[2],self.main.mode,self.main.libFastJet) |
4604 | 104 | elif len(objs)==3 and objs[0].lower()=='main' and objs[1].lower()=='fastsim': | 104 | elif len(objs)==3 and objs[0].lower()=='main' and objs[1].lower()=='fastsim': |
4606 | 105 | self.main.fastsim.user_SetParameter(objs[2],args[2],self.main.datasets,self.main.mode,self.main.libFastJet,self.main.libDelphes) | 105 | self.main.fastsim.user_SetParameter(objs[2],args[2],self.main.datasets,self.main.mode,self.main.libFastJet,self.main.libDelphes,self.main.libDelfes) |
4607 | 106 | elif len(objs)==3 and objs[0].lower()=='main' and objs[1].lower()=='shower': | 106 | elif len(objs)==3 and objs[0].lower()=='main' and objs[1].lower()=='shower': |
4608 | 107 | self.main.shower.user_SetParameter(objs[2],args[2],self.main.mode,self.main.mcatnloutils) | 107 | self.main.shower.user_SetParameter(objs[2],args[2],self.main.mode,self.main.mcatnloutils) |
4609 | 108 | else: | 108 | else: |
4610 | 109 | 109 | ||
4611 | === modified file 'madanalysis/interpreter/cmd_submit.py' | |||
4612 | --- madanalysis/interpreter/cmd_submit.py 2013-10-27 21:36:24 +0000 | |||
4613 | +++ madanalysis/interpreter/cmd_submit.py 2014-05-17 19:51:11 +0000 | |||
4614 | @@ -335,16 +335,10 @@ | |||
4615 | 335 | if answer=="no" or answer=="n": | 335 | if answer=="no" or answer=="n": |
4616 | 336 | return | 336 | return |
4617 | 337 | else: | 337 | else: |
4628 | 338 | if self.main.fastsim.delphes.pileup=="": | 338 | if self.main.fastsim.package=="delphes": |
4629 | 339 | if self.main.fastsim.delphes.detector=='cms': | 339 | cardname = self.main.fastsim.delphes.card |
4630 | 340 | cardname = 'delphes_card_CMS.tcl' | 340 | elif self.main.fastsim.package=="delfes": |
4631 | 341 | elif self.main.fastsim.delphes.detector=='atlas': | 341 | cardname = self.main.fastsim.delfes.card |
4622 | 342 | cardname ='delphes_card_ATLAS.tcl' | ||
4623 | 343 | else: | ||
4624 | 344 | if self.main.fastsim.delphes.detector=='cms': | ||
4625 | 345 | cardname = 'delphes_card_CMS_PileUp.tcl' | ||
4626 | 346 | elif self.main.fastsim.delphes.detector=='atlas': | ||
4627 | 347 | cardname ='delphes_card_ATLAS_PileUp.tcl' | ||
4632 | 348 | os.system(self.main.configLinux.editor+" "+dirname+"/Input/"+cardname) | 342 | os.system(self.main.configLinux.editor+" "+dirname+"/Input/"+cardname) |
4633 | 349 | 343 | ||
4634 | 350 | 344 | ||
4635 | @@ -408,9 +402,15 @@ | |||
4636 | 408 | return False | 402 | return False |
4637 | 409 | 403 | ||
4638 | 410 | #edit the delphes cards | 404 | #edit the delphes cards |
4640 | 411 | if self.main.fastsim.package=="delphes": | 405 | if self.main.fastsim.package in ["delphes","delfes"]: |
4641 | 412 | self.editDelphesCard(dirname) | 406 | self.editDelphesCard(dirname) |
4642 | 413 | 407 | ||
4643 | 408 | if self.resubmit: | ||
4644 | 409 | logging.info(" Cleaning 'SampleAnalyzer'...") | ||
4645 | 410 | if not jobber.MrproperJob(): | ||
4646 | 411 | logging.error("job submission aborted.") | ||
4647 | 412 | return False | ||
4648 | 413 | |||
4649 | 414 | logging.info(" Compiling 'SampleAnalyzer'...") | 414 | logging.info(" Compiling 'SampleAnalyzer'...") |
4650 | 415 | if not jobber.CompileJob(): | 415 | if not jobber.CompileJob(): |
4651 | 416 | logging.error("job submission aborted.") | 416 | logging.error("job submission aborted.") |
4652 | 417 | 417 | ||
4653 | === modified file 'madanalysis/interpreter/interpreter.py' | |||
4654 | --- madanalysis/interpreter/interpreter.py 2013-05-31 21:57:38 +0000 | |||
4655 | +++ madanalysis/interpreter/interpreter.py 2014-05-17 19:51:11 +0000 | |||
4656 | @@ -26,6 +26,7 @@ | |||
4657 | 26 | Uses the cmd package for command interpretation and tab completion. | 26 | Uses the cmd package for command interpretation and tab completion. |
4658 | 27 | """ | 27 | """ |
4659 | 28 | 28 | ||
4660 | 29 | import logging | ||
4661 | 29 | import readline | 30 | import readline |
4662 | 30 | import os | 31 | import os |
4663 | 31 | 32 | ||
4664 | @@ -174,6 +175,38 @@ | |||
4665 | 174 | def complete_import(self,text,line,begidx,endidx): | 175 | def complete_import(self,text,line,begidx,endidx): |
4666 | 175 | return self.cmd_import.complete(text,line,begidx,endidx) | 176 | return self.cmd_import.complete(text,line,begidx,endidx) |
4667 | 176 | 177 | ||
4668 | 178 | # Restart | ||
4669 | 179 | def do_restart(self, line): | ||
4670 | 180 | """ sending a signal allowing to restart the interpreter """ | ||
4671 | 181 | if self.main.script: | ||
4672 | 182 | logging.warning("'restart' command is not allowed in script mode.") | ||
4673 | 183 | else: | ||
4674 | 184 | YES=False | ||
4675 | 185 | # Asking the safety question | ||
4676 | 186 | if not Main.forced: | ||
4677 | 187 | logging.warning("Are you sure to restart the MadAnalysis 5 session? (Y/N)") | ||
4678 | 188 | allowed_answers=['n','no','y','yes'] | ||
4679 | 189 | answer="" | ||
4680 | 190 | while answer not in allowed_answers: | ||
4681 | 191 | answer=raw_input("Answer: ") | ||
4682 | 192 | answer=answer.lower() | ||
4683 | 193 | if answer=="no" or answer=="n": | ||
4684 | 194 | YES=False | ||
4685 | 195 | break | ||
4686 | 196 | elif answer=='yes' or answer=='y': | ||
4687 | 197 | YES=True | ||
4688 | 198 | break | ||
4689 | 199 | if YES: | ||
4690 | 200 | self.main.repeatSession=True | ||
4691 | 201 | return True | ||
4692 | 202 | else: | ||
4693 | 203 | pass | ||
4694 | 204 | |||
4695 | 205 | def help_restart(self): | ||
4696 | 206 | logging.info(" Syntax: restart ") | ||
4697 | 207 | logging.info(" Quit the current MadAnalysis sessiona and open a new one.") | ||
4698 | 208 | logging.info(" All the information will be discarded.") | ||
4699 | 209 | |||
4700 | 177 | def do_remove(self,line): | 210 | def do_remove(self,line): |
4701 | 178 | self.cmd_remove.do(self.split_arg(line)) | 211 | self.cmd_remove.do(self.split_arg(line)) |
4702 | 179 | 212 | ||
4703 | @@ -193,7 +226,11 @@ | |||
4704 | 193 | return self.cmd_swap.complete(text,line,begidx,endidx) | 226 | return self.cmd_swap.complete(text,line,begidx,endidx) |
4705 | 194 | 227 | ||
4706 | 195 | def do_install(self,line): | 228 | def do_install(self,line): |
4708 | 196 | self.cmd_install.do(self.split_arg(line)) | 229 | result = self.cmd_install.do(self.split_arg(line)) |
4709 | 230 | if result=='restart': | ||
4710 | 231 | logging.info(" ") | ||
4711 | 232 | logging.info("MadAnalysis 5 must be restarted for taking into account the present installation.") | ||
4712 | 233 | return self.do_restart('restart') | ||
4713 | 197 | 234 | ||
4714 | 198 | def help_install(self): | 235 | def help_install(self): |
4715 | 199 | self.cmd_install.help() | 236 | self.cmd_install.help() |
4716 | 200 | 237 | ||
4717 | === modified file 'madanalysis/interpreter/interpreter_base.py' | |||
4718 | --- madanalysis/interpreter/interpreter_base.py 2013-05-24 13:05:09 +0000 | |||
4719 | +++ madanalysis/interpreter/interpreter_base.py 2014-05-17 19:51:11 +0000 | |||
4720 | @@ -190,7 +190,7 @@ | |||
4721 | 190 | """ exit the mainloop() """ | 190 | """ exit the mainloop() """ |
4722 | 191 | logging.info("") | 191 | logging.info("") |
4723 | 192 | return True | 192 | return True |
4725 | 193 | 193 | ||
4726 | 194 | # Aliases | 194 | # Aliases |
4727 | 195 | do_EOF = do_quit | 195 | do_EOF = do_quit |
4728 | 196 | do_exit = do_quit | 196 | do_exit = do_quit |
4729 | 197 | 197 | ||
4730 | === modified file 'madanalysis/job/job_candidate_cut.py' | |||
4731 | --- madanalysis/job/job_candidate_cut.py 2013-05-17 06:19:22 +0000 | |||
4732 | +++ madanalysis/job/job_candidate_cut.py 2014-05-17 19:51:11 +0000 | |||
4733 | @@ -212,7 +212,7 @@ | |||
4734 | 212 | # Bracket for begin | 212 | # Bracket for begin |
4735 | 213 | file.write(' {\n') | 213 | file.write(' {\n') |
4736 | 214 | 214 | ||
4738 | 215 | file.write(' '+container2+'=PHYSICS->rankFilter('+\ | 215 | file.write(' '+container2+'=SORTER->rankFilter('+\ |
4739 | 216 | newcontainer2+','+str(other_part[0].PTrank)+','+\ | 216 | newcontainer2+','+str(other_part[0].PTrank)+','+\ |
4740 | 217 | 'PTordering'+');\n\n') | 217 | 'PTordering'+');\n\n') |
4741 | 218 | 218 | ||
4742 | @@ -305,8 +305,14 @@ | |||
4743 | 305 | # Case of one particle/multiparticle | 305 | # Case of one particle/multiparticle |
4744 | 306 | if len(combi1)==1: | 306 | if len(combi1)==1: |
4745 | 307 | file.write(' if (') | 307 | file.write(' if (') |
4746 | 308 | if main.mode == MA5RunningType.PARTON: | ||
4747 | 309 | TheObs=obs.code_parton[:-2] | ||
4748 | 310 | elif main.mode == MA5RunningType.HADRON: | ||
4749 | 311 | TheObs=obs.code_hadron[:-2] | ||
4750 | 312 | else: | ||
4751 | 313 | TheObs=obs.code_reco[:-2] | ||
4752 | 308 | file.write(containers1[0]+'[a]->' +\ | 314 | file.write(containers1[0]+'[a]->' +\ |
4754 | 309 | 'dr('+container+'[muf])' +\ | 315 | TheObs+'('+container+'[muf])' +\ |
4755 | 310 | OperatorType.convert2cpp(condition.operator) +\ | 316 | OperatorType.convert2cpp(condition.operator) +\ |
4756 | 311 | str(condition.threshold) +\ | 317 | str(condition.threshold) +\ |
4757 | 312 | ') {'+tagName+'['+str(tagIndex)+']=true; break;}\n') | 318 | ') {'+tagName+'['+str(tagIndex)+']=true; break;}\n') |
4758 | @@ -338,8 +344,14 @@ | |||
4759 | 338 | 344 | ||
4760 | 339 | # Result | 345 | # Result |
4761 | 340 | file.write(' if (q1.') | 346 | file.write(' if (q1.') |
4764 | 341 | if obs.name in ['DELTAR','vDELTAR']: | 347 | if obs.name in ['DELTAR','vDELTAR','DPHI_0_PI','DPHI_0_2PI']: |
4765 | 342 | file.write('dr('+container+'[muf])'+ OperatorType.convert2cpp(condition.operator) + \ | 348 | if main.mode == MA5RunningType.PARTON: |
4766 | 349 | TheObs=obs.code_parton[:-2] | ||
4767 | 350 | elif main.mode == MA5RunningType.HADRON: | ||
4768 | 351 | TheObs=obs.code_hadron[:-2] | ||
4769 | 352 | else: | ||
4770 | 353 | TheObs=obs.code_reco[:-2] | ||
4771 | 354 | file.write(TheObs+'('+container+'[muf])'+ OperatorType.convert2cpp(condition.operator) + \ | ||
4772 | 343 | str(condition.threshold) + \ | 355 | str(condition.threshold) + \ |
4773 | 344 | ') {'+tagName+'['+str(tagIndex)+']=true; break;}\n') | 356 | ') {'+tagName+'['+str(tagIndex)+']=true; break;}\n') |
4774 | 345 | else: | 357 | else: |
4775 | 346 | 358 | ||
4776 | === modified file 'madanalysis/job/job_event_cut.py' | |||
4777 | --- madanalysis/job/job_event_cut.py 2013-05-17 06:19:22 +0000 | |||
4778 | +++ madanalysis/job/job_event_cut.py 2014-05-17 19:51:11 +0000 | |||
4779 | @@ -243,9 +243,15 @@ | |||
4780 | 243 | 243 | ||
4781 | 244 | # Case of one particle/multiparticle | 244 | # Case of one particle/multiparticle |
4782 | 245 | if len(combi1)==1 and len(combi2)==1: | 245 | if len(combi1)==1 and len(combi2)==1: |
4783 | 246 | if main.mode == MA5RunningType.PARTON: | ||
4784 | 247 | TheObs=obs.code_parton[:-2] | ||
4785 | 248 | elif main.mode == MA5RunningType.HADRON: | ||
4786 | 249 | TheObs=obs.code_hadron[:-2] | ||
4787 | 250 | else: | ||
4788 | 251 | TheObs=obs.code_reco[:-2] | ||
4789 | 246 | file.write(' if (') | 252 | file.write(' if (') |
4790 | 247 | file.write(containers1[0]+'['+iterator1+'[0]]->' +\ | 253 | file.write(containers1[0]+'['+iterator1+'[0]]->' +\ |
4792 | 248 | 'dr('+containers2[0]+'['+iterator2+'[0]])' +\ | 254 | TheObs+'('+containers2[0]+'['+iterator2+'[0]])' +\ |
4793 | 249 | OperatorType.convert2cpp(condition.operator) +\ | 255 | OperatorType.convert2cpp(condition.operator) +\ |
4794 | 250 | str(condition.threshold) +\ | 256 | str(condition.threshold) +\ |
4795 | 251 | ') {'+tagName+'['+str(tagIndex)+']=true; break;}\n') | 257 | ') {'+tagName+'['+str(tagIndex)+']=true; break;}\n') |
4796 | @@ -279,7 +285,13 @@ | |||
4797 | 279 | 'momentum();\n') | 285 | 'momentum();\n') |
4798 | 280 | 286 | ||
4799 | 281 | # Result | 287 | # Result |
4801 | 282 | file.write(' if (q1.dr(q2)'+\ | 288 | if main.mode == MA5RunningType.PARTON: |
4802 | 289 | TheObs=obs.code_parton[:-2] | ||
4803 | 290 | elif main.mode == MA5RunningType.HADRON: | ||
4804 | 291 | TheObs=obs.code_hadron[:-2] | ||
4805 | 292 | else: | ||
4806 | 293 | TheObs=obs.code_reco[:-2] | ||
4807 | 294 | file.write(' if (q1.'+TheObs+'(q2)'+\ | ||
4808 | 283 | ''+ OperatorType.convert2cpp(condition.operator) + \ | 295 | ''+ OperatorType.convert2cpp(condition.operator) + \ |
4809 | 284 | str(condition.threshold) + \ | 296 | str(condition.threshold) + \ |
4810 | 285 | ') {'+tagName+'['+str(tagIndex)+']=true; break;}\n') | 297 | ') {'+tagName+'['+str(tagIndex)+']=true; break;}\n') |
4811 | 286 | 298 | ||
4812 | === modified file 'madanalysis/job/job_execute.py' | |||
4813 | --- madanalysis/job/job_execute.py 2013-10-03 16:02:40 +0000 | |||
4814 | +++ madanalysis/job/job_execute.py 2014-05-17 19:51:11 +0000 | |||
4815 | @@ -69,7 +69,7 @@ | |||
4816 | 69 | 69 | ||
4817 | 70 | file.write(' // Sorting particle collection according to '+rank+'\n') | 70 | file.write(' // Sorting particle collection according to '+rank+'\n') |
4818 | 71 | file.write(' // for getting '+str(part.PTrank)+'th particle\n') | 71 | file.write(' // for getting '+str(part.PTrank)+'th particle\n') |
4820 | 72 | file.write(' '+container+'=PHYSICS->rankFilter('+\ | 72 | file.write(' '+container+'=SORTER->rankFilter('+\ |
4821 | 73 | newcontainer+','+str(part.PTrank)+','+rank+');\n\n') | 73 | newcontainer+','+str(part.PTrank)+','+rank+');\n\n') |
4822 | 74 | 74 | ||
4823 | 75 | 75 | ||
4824 | @@ -206,13 +206,13 @@ | |||
4825 | 206 | # Put isolated negative muon | 206 | # Put isolated negative muon |
4826 | 207 | if part.particle.Find(130): | 207 | if part.particle.Find(130): |
4827 | 208 | file.write(' if ( (event.rec()->muons()[i].charge()<0) &&'+\ | 208 | file.write(' if ( (event.rec()->muons()[i].charge()<0) &&'+\ |
4829 | 209 | ' PHYSICS->IsIsolatedMuon(event.rec()->muons()[i],event.rec()) ) '+\ | 209 | ' PHYSICS->Id->IsIsolatedMuon(event.rec()->muons()[i],event.rec()) ) '+\ |
4830 | 210 | container+'.push_back(&(event.rec()->muons()[i]));\n') | 210 | container+'.push_back(&(event.rec()->muons()[i]));\n') |
4831 | 211 | 211 | ||
4832 | 212 | # Put isolated positive muon | 212 | # Put isolated positive muon |
4833 | 213 | if part.particle.Find(-130): | 213 | if part.particle.Find(-130): |
4834 | 214 | file.write(' if ( (event.rec()->muons()[i].charge()>0) &&'+\ | 214 | file.write(' if ( (event.rec()->muons()[i].charge()>0) &&'+\ |
4836 | 215 | ' PHYSICS->IsIsolatedMuon(event.rec()->muons()[i],event.rec()) ) '+\ | 215 | ' PHYSICS->Id->IsIsolatedMuon(event.rec()->muons()[i],event.rec()) ) '+\ |
4837 | 216 | container+'.push_back(&(event.rec()->muons()[i]));\n') | 216 | container+'.push_back(&(event.rec()->muons()[i]));\n') |
4838 | 217 | 217 | ||
4839 | 218 | 218 | ||
4840 | 219 | 219 | ||
4841 | === modified file 'madanalysis/job/job_header.py' | |||
4842 | --- madanalysis/job/job_header.py 2013-05-17 06:19:22 +0000 | |||
4843 | +++ madanalysis/job/job_header.py 2014-05-17 19:51:11 +0000 | |||
4844 | @@ -139,11 +139,11 @@ | |||
4845 | 139 | 139 | ||
4846 | 140 | # FinalSate | 140 | # FinalSate |
4847 | 141 | if status=="finalstate": | 141 | if status=="finalstate": |
4849 | 142 | file.write(" if ( !PHYSICS->IsFinalState(part) ) return false;\n") | 142 | file.write(" if ( !PHYSICS->Id->IsFinalState(part) ) return false;\n") |
4850 | 143 | elif status=="initialstate": | 143 | elif status=="initialstate": |
4852 | 144 | file.write(" if ( !PHYSICS->IsInitialState(part) ) return false;\n") | 144 | file.write(" if ( !PHYSICS->Id->IsInitialState(part) ) return false;\n") |
4853 | 145 | elif status=="interstate": | 145 | elif status=="interstate": |
4855 | 146 | file.write(" if ( !PHYSICS->IsInterState(part) ) return false;\n") | 146 | file.write(" if ( !PHYSICS->Id->IsInterState(part) ) return false;\n") |
4856 | 147 | 147 | ||
4857 | 148 | # Id | 148 | # Id |
4858 | 149 | file.write(' if ( ') | 149 | file.write(' if ( ') |
4859 | 150 | 150 | ||
4860 | === modified file 'madanalysis/job/job_initialize.py' | |||
4861 | --- madanalysis/job/job_initialize.py 2013-07-12 13:09:17 +0000 | |||
4862 | +++ madanalysis/job/job_initialize.py 2014-05-17 19:51:11 +0000 | |||
4863 | @@ -428,6 +428,9 @@ | |||
4864 | 428 | file.write(' PHYSICS->mcConfig().AddInvisibleId(16);\n') | 428 | file.write(' PHYSICS->mcConfig().AddInvisibleId(16);\n') |
4865 | 429 | file.write(' PHYSICS->mcConfig().AddInvisibleId(1000022);\n') | 429 | file.write(' PHYSICS->mcConfig().AddInvisibleId(1000022);\n') |
4866 | 430 | file.write(' PHYSICS->mcConfig().AddInvisibleId(1000039);\n') | 430 | file.write(' PHYSICS->mcConfig().AddInvisibleId(1000039);\n') |
4867 | 431 | for item in main.multiparticles.Get("invisible"): | ||
4868 | 432 | if item not in [-16,-14,-12,12,14,16,1000022,1000039]: | ||
4869 | 433 | file.write(' PHYSICS->mcConfig().AddInvisibleId('+str(item)+');\n') | ||
4870 | 431 | file.write('\n') | 434 | file.write('\n') |
4871 | 432 | 435 | ||
4872 | 433 | 436 | ||
4873 | @@ -456,7 +459,12 @@ | |||
4874 | 456 | # Initializing array of cuts | 459 | # Initializing array of cuts |
4875 | 457 | if Ncuts!=0: | 460 | if Ncuts!=0: |
4876 | 458 | file.write(' // Initializing cut array\n') | 461 | file.write(' // Initializing cut array\n') |
4878 | 459 | file.write(' cuts_.Initialize('+str(Ncuts)+');\n') | 462 | icut=1 |
4879 | 463 | for item in main.selection.table: | ||
4880 | 464 | if item.__class__.__name__=="Cut": | ||
4881 | 465 | file.write(" cuts_.InitCut(\""+item.conditions.GetStringDisplay()+"\");\n") | ||
4882 | 466 | if Ncuts!=0: | ||
4883 | 467 | file.write('\n') | ||
4884 | 460 | 468 | ||
4885 | 461 | # Initializing each item | 469 | # Initializing each item |
4886 | 462 | ihisto = 0 | 470 | ihisto = 0 |
4887 | 463 | 471 | ||
4888 | === modified file 'madanalysis/job/job_plot.py' | |||
4889 | --- madanalysis/job/job_plot.py 2013-10-29 05:48:23 +0000 | |||
4890 | +++ madanalysis/job/job_plot.py 2014-05-17 19:51:11 +0000 | |||
4891 | @@ -72,11 +72,11 @@ | |||
4892 | 72 | file.write(' for (unsigned int i=0;i<event.mc()->particles().size();i++)\n') | 72 | file.write(' for (unsigned int i=0;i<event.mc()->particles().size();i++)\n') |
4893 | 73 | file.write(' {\n') | 73 | file.write(' {\n') |
4894 | 74 | if main.selection[iabs].statuscode=="finalstate": | 74 | if main.selection[iabs].statuscode=="finalstate": |
4896 | 75 | file.write(' if (!PHYSICS->IsFinalState(event.mc()->particles()[i])) continue;\n') | 75 | file.write(' if (!PHYSICS->Id->IsFinalState(event.mc()->particles()[i])) continue;\n') |
4897 | 76 | elif main.selection[iabs].statuscode=="initialstate": | 76 | elif main.selection[iabs].statuscode=="initialstate": |
4899 | 77 | file.write(' if (!PHYSICS->IsInitialState(event.mc()->particles()[i])) continue;\n') | 77 | file.write(' if (!PHYSICS->Id->IsInitialState(event.mc()->particles()[i])) continue;\n') |
4900 | 78 | elif main.selection[iabs].statuscode=="interstate": | 78 | elif main.selection[iabs].statuscode=="interstate": |
4902 | 79 | file.write(' if (!PHYSICS->IsInterState(event.mc()->particles()[i])) continue;\n') | 79 | file.write(' if (!PHYSICS->Id->IsInterState(event.mc()->particles()[i])) continue;\n') |
4903 | 80 | if npid: | 80 | if npid: |
4904 | 81 | file.write(' H'+str(ihisto)+'_' +\ | 81 | file.write(' H'+str(ihisto)+'_' +\ |
4905 | 82 | '->Fill(event.mc()->particles()[i].pdgid(),__event_weight__);\n') | 82 | '->Fill(event.mc()->particles()[i].pdgid(),__event_weight__);\n') |
4906 | @@ -245,8 +245,14 @@ | |||
4907 | 245 | 245 | ||
4908 | 246 | # Case of one particle/multiparticle | 246 | # Case of one particle/multiparticle |
4909 | 247 | if len(combi2)==1: | 247 | if len(combi2)==1: |
4910 | 248 | if main.mode == MA5RunningType.PARTON: | ||
4911 | 249 | TheObs=obs.code_parton[:-2] | ||
4912 | 250 | elif main.mode == MA5RunningType.HADRON: | ||
4913 | 251 | TheObs=obs.code_hadron[:-2] | ||
4914 | 252 | else: | ||
4915 | 253 | TheObs=obs.code_reco[:-2] | ||
4916 | 248 | file.write(' H'+str(ihisto)+'_->Fill('\ | 254 | file.write(' H'+str(ihisto)+'_->Fill('\ |
4918 | 249 | 'q1.dr('+containers2[0]+\ | 255 | 'q1.'+TheObs+'('+containers2[0]+\ |
4919 | 250 | '[b[0]]),__event_weight__);\n') | 256 | '[b[0]]),__event_weight__);\n') |
4920 | 251 | 257 | ||
4921 | 252 | # Operation : sum or diff | 258 | # Operation : sum or diff |
4922 | @@ -275,8 +281,14 @@ | |||
4923 | 275 | 'momentum();\n') | 281 | 'momentum();\n') |
4924 | 276 | 282 | ||
4925 | 277 | # Result | 283 | # Result |
4926 | 284 | if main.mode == MA5RunningType.PARTON: | ||
4927 | 285 | TheObs=obs.code_parton[:-2] | ||
4928 | 286 | elif main.mode == MA5RunningType.HADRON: | ||
4929 | 287 | TheObs=obs.code_hadron[:-2] | ||
4930 | 288 | else: | ||
4931 | 289 | TheObs=obs.code_reco[:-2] | ||
4932 | 278 | file.write(' H'+str(ihisto)+'_->Fill('+\ | 290 | file.write(' H'+str(ihisto)+'_->Fill('+\ |
4934 | 279 | 'q1.dr(q2),__event_weight__);\n') | 291 | 'q1.'+TheObs+'(q2),__event_weight__);\n') |
4935 | 280 | 292 | ||
4936 | 281 | # End Loop | 293 | # End Loop |
4937 | 282 | WriteEndLoop(file,iabs,ihisto,combi2,main) | 294 | WriteEndLoop(file,iabs,ihisto,combi2,main) |
4938 | @@ -317,8 +329,14 @@ | |||
4939 | 317 | 329 | ||
4940 | 318 | # Case of one particle/multiparticle | 330 | # Case of one particle/multiparticle |
4941 | 319 | if len(combi1)==1: | 331 | if len(combi1)==1: |
4942 | 332 | if main.mode == MA5RunningType.PARTON: | ||
4943 | 333 | TheObs=obs.code_parton[:-2] | ||
4944 | 334 | elif main.mode == MA5RunningType.HADRON: | ||
4945 | 335 | TheObs=obs.code_hadron[:-2] | ||
4946 | 336 | else: | ||
4947 | 337 | TheObs=obs.code_reco[:-2] | ||
4948 | 320 | file.write(' H'+str(ihisto)+'_->Fill('\ | 338 | file.write(' H'+str(ihisto)+'_->Fill('\ |
4950 | 321 | 'q2.dr('+containers1[0]+\ | 339 | 'q2.'+TheObs+'('+containers1[0]+\ |
4951 | 322 | '[a[0]]),__event_weight__);\n') | 340 | '[a[0]]),__event_weight__);\n') |
4952 | 323 | 341 | ||
4953 | 324 | # Operation : sum or diff | 342 | # Operation : sum or diff |
4954 | @@ -347,8 +365,14 @@ | |||
4955 | 347 | 'momentum();\n') | 365 | 'momentum();\n') |
4956 | 348 | 366 | ||
4957 | 349 | # Result | 367 | # Result |
4958 | 368 | if main.mode == MA5RunningType.PARTON: | ||
4959 | 369 | TheObs=obs.code_parton[:-2] | ||
4960 | 370 | elif main.mode == MA5RunningType.HADRON: | ||
4961 | 371 | TheObs=obs.code_hadron[:-2] | ||
4962 | 372 | else: | ||
4963 | 373 | TheObs=obs.code_reco[:-2] | ||
4964 | 350 | file.write(' H'+str(ihisto)+'_->Fill('+\ | 374 | file.write(' H'+str(ihisto)+'_->Fill('+\ |
4966 | 351 | 'q1.dr(q2),__event_weight__);\n') | 375 | 'q1.'+TheObs+'(q2),__event_weight__);\n') |
4967 | 352 | 376 | ||
4968 | 353 | # End Loop | 377 | # End Loop |
4969 | 354 | WriteEndLoop(file,iabs,ihisto,combi1,main) | 378 | WriteEndLoop(file,iabs,ihisto,combi1,main) |
4970 | @@ -389,7 +413,13 @@ | |||
4971 | 389 | WriteEndLoop(file,ihisto,iabs,combi2,main) | 413 | WriteEndLoop(file,ihisto,iabs,combi2,main) |
4972 | 390 | 414 | ||
4973 | 391 | # After the two loops | 415 | # After the two loops |
4975 | 392 | file.write(' H'+str(ihisto)+'_->Fill(q1.dr(q2),__event_weight__);\n') | 416 | if main.mode == MA5RunningType.PARTON: |
4976 | 417 | TheObs=obs.code_parton[:-2] | ||
4977 | 418 | elif main.mode == MA5RunningType.HADRON: | ||
4978 | 419 | TheObs=obs.code_hadron[:-2] | ||
4979 | 420 | else: | ||
4980 | 421 | TheObs=obs.code_reco[:-2] | ||
4981 | 422 | file.write(' H'+str(ihisto)+'_->Fill(q1.'+TheObs+'(q2),__event_weight__);\n') | ||
4982 | 393 | 423 | ||
4983 | 394 | 424 | ||
4984 | 395 | def WriteBeforeLoop(file,iabs,ihisto,combination,main,value='value',q='q'): | 425 | def WriteBeforeLoop(file,iabs,ihisto,combination,main,value='value',q='q'): |
4985 | @@ -567,9 +597,15 @@ | |||
4986 | 567 | 597 | ||
4987 | 568 | # Case of one particle/multiparticle | 598 | # Case of one particle/multiparticle |
4988 | 569 | if len(combi1)==1 and len(combi2)==1: | 599 | if len(combi1)==1 and len(combi2)==1: |
4989 | 600 | if main.mode == MA5RunningType.PARTON: | ||
4990 | 601 | TheObs=obs.code_parton[:-2] | ||
4991 | 602 | elif main.mode == MA5RunningType.HADRON: | ||
4992 | 603 | TheObs=obs.code_hadron[:-2] | ||
4993 | 604 | else: | ||
4994 | 605 | TheObs=obs.code_reco[:-2] | ||
4995 | 570 | file.write(' H'+str(ihisto)+'_->Fill('+\ | 606 | file.write(' H'+str(ihisto)+'_->Fill('+\ |
4996 | 571 | containers1[0]+'['+iterator1+'[0]]->'+\ | 607 | containers1[0]+'['+iterator1+'[0]]->'+\ |
4998 | 572 | 'dr('+containers2[0]+'['+iterator2+'[0]]),__event_weight__);\n') | 608 | TheObs+'('+containers2[0]+'['+iterator2+'[0]]),__event_weight__);\n') |
4999 | 573 | return | 609 | return |
5000 | 574 | 610 |
The diff has been truncated for viewing.