Merge lp:~ma5/madanalysis5/v1.1.7beta into lp:madanalysis5
- v1.1.7beta
- Merge into madanalysis-development
Proposed by
Benjamin Fuks
Status: | Merged |
---|---|
Approved by: | Benjamin Fuks |
Approved revision: | 76 |
Merged at revision: | 58 |
Proposed branch: | lp:~ma5/madanalysis5/v1.1.7beta |
Merge into: | lp:madanalysis5 |
Diff against target: |
4711 lines (+2146/-1099) 64 files modified
README (+2/-2) bin/ma5 (+2/-2) madanalysis/IOinterface/job_writer.py (+8/-1) madanalysis/IOinterface/multiparticle_reader.py (+6/-2) madanalysis/IOinterface/particle_reader.py (+7/-6) madanalysis/UpdateNotes.txt (+49/-0) madanalysis/configuration/beauty_identification.py (+1/-1) madanalysis/configuration/clustering_configuration.py (+1/-2) madanalysis/configuration/tau_identification.py (+5/-45) madanalysis/core/config_checker.py (+27/-2) madanalysis/core/expert_mode.py (+4/-3) madanalysis/core/main.py (+40/-7) madanalysis/input/reco_default.txt (+2/-1) madanalysis/interpreter/cmd_import.py (+1/-1) madanalysis/interpreter/cmd_reset.py (+1/-1) madanalysis/interpreter/interpreter.py (+2/-2) madanalysis/interpreter/interpreter_base.py (+47/-0) madanalysis/job/job_execute.py (+26/-0) madanalysis/job/job_initialize.py (+384/-7) madanalysis/job/job_plot.py (+6/-0) madanalysis/layout/histogram.py (+2/-1) madanalysis/layout/histogram_frequency_core.py (+1/-1) madanalysis/layout/plotflow.py (+1/-2) tools/SampleAnalyzer/Analyzer/AnalyzerBase.h (+3/-3) tools/SampleAnalyzer/Analyzer/MergingPlots.cpp (+2/-0) tools/SampleAnalyzer/Core/Configuration.cpp (+31/-0) tools/SampleAnalyzer/Core/Configuration.h (+24/-0) tools/SampleAnalyzer/Core/ProgressBar.cpp (+44/-16) tools/SampleAnalyzer/Core/ProgressBar.h (+34/-16) tools/SampleAnalyzer/Core/SampleAnalyzer.cpp (+11/-8) tools/SampleAnalyzer/Core/xdr_istream.cpp (+2/-2) tools/SampleAnalyzer/DataFormat/MCParticleFormat.h (+4/-2) tools/SampleAnalyzer/DataFormat/RecEventFormat.h (+17/-15) tools/SampleAnalyzer/DataFormat/RecParticleFormat.h (+2/-2) tools/SampleAnalyzer/DataFormat/RecTauFormat.h (+12/-0) tools/SampleAnalyzer/Filter/FilterBase.h (+2/-2) tools/SampleAnalyzer/JetClustering/JetClustererBase.h (+13/-1) tools/SampleAnalyzer/JetClustering/JetClusteringFastJet.cpp (+247/-24) tools/SampleAnalyzer/JetClustering/JetClusteringFastJet.h (+8/-0) tools/SampleAnalyzer/JetClustering/TaggerBase.cpp (+2/-0) tools/SampleAnalyzer/JetClustering/TaggerBase.h (+1/-1) tools/SampleAnalyzer/JetClustering/TauTagger.cpp (+9/-111) tools/SampleAnalyzer/JetClustering/TauTagger.h (+5/-3) tools/SampleAnalyzer/JetClustering/bTagger.cpp (+3/-43) tools/SampleAnalyzer/JetClustering/bTagger.h (+1/-1) tools/SampleAnalyzer/JetClustering/cTagger.h (+1/-1) tools/SampleAnalyzer/Makefile (+0/-89) tools/SampleAnalyzer/Reader/HEPMCReader.cpp (+66/-12) tools/SampleAnalyzer/Reader/HEPMCReader.h (+1/-1) tools/SampleAnalyzer/Reader/LHCOReader.cpp (+30/-29) tools/SampleAnalyzer/Reader/ReaderTextBase.cpp (+2/-0) tools/SampleAnalyzer/Service/CompilationService.h (+30/-0) tools/SampleAnalyzer/Service/Physics.h (+10/-2) tools/SampleAnalyzer/Writer/LHCOParticleFormat.cpp (+98/-0) tools/SampleAnalyzer/Writer/LHCOParticleFormat.h (+64/-0) tools/SampleAnalyzer/Writer/LHCOWriter.cpp (+216/-350) tools/SampleAnalyzer/Writer/LHCOWriter.h (+9/-10) tools/SampleAnalyzer/Writer/LHEParticleFormat.cpp (+115/-0) tools/SampleAnalyzer/Writer/LHEParticleFormat.h (+71/-0) tools/SampleAnalyzer/Writer/LHEWriter.cpp (+284/-257) tools/SampleAnalyzer/Writer/LHEWriter.h (+9/-6) tools/SampleAnalyzer/Writer/WriterBase.h (+3/-1) tools/SampleAnalyzer/Writer/WriterTextBase.cpp (+28/-1) tools/SampleAnalyzer/Writer/WriterTextBase.h (+7/-1) |
To merge this branch: | bzr merge lp:~ma5/madanalysis5/v1.1.7beta |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Eric Conte | Approve | ||
Review via email: mp+169179@code.launchpad.net |
Commit message
- LHCO output
- Compatibility with pythia-8 output
- Improvement of the jet clustering / object identification
- Few bug fixes
- Photons added in the reco mode
Description of the change
- LHCO output
- Compatibility with pythia-8 output
- Improvement of the jet clustering / object identification
- Few bug fixes
- Photons added in the reco mode
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'README' | |||
2 | --- README 2013-05-17 17:10:55 +0000 | |||
3 | +++ README 2013-06-13 12:22:26 +0000 | |||
4 | @@ -15,10 +15,10 @@ | |||
5 | 15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | 15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
6 | 16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
7 | 17 | # GNU General Public License for more details. | 17 | # GNU General Public License for more details. |
9 | 18 | # | 18 | # |
10 | 19 | # You should have received a copy of the GNU General Public License | 19 | # You should have received a copy of the GNU General Public License |
11 | 20 | # along with MadAnalysis 5. If not, see <http://www.gnu.org/licenses/> | 20 | # along with MadAnalysis 5. If not, see <http://www.gnu.org/licenses/> |
13 | 21 | # | 21 | # |
14 | 22 | ################################################################################ | 22 | ################################################################################ |
15 | 23 | 23 | ||
16 | 24 | 24 | ||
17 | 25 | 25 | ||
18 | === modified file 'bin/ma5' (properties changed: -x to +x) | |||
19 | --- bin/ma5 2013-05-17 16:41:08 +0000 | |||
20 | +++ bin/ma5 2013-06-13 12:22:26 +0000 | |||
21 | @@ -113,8 +113,8 @@ | |||
22 | 113 | 113 | ||
23 | 114 | # Release version | 114 | # Release version |
24 | 115 | # Do not touch it !!!!! | 115 | # Do not touch it !!!!! |
27 | 116 | main.version = "1.1.6" | 116 | main.version = "1.1.25" |
28 | 117 | main.date = "2013/05/17" | 117 | main.date = "2013/06/13" |
29 | 118 | 118 | ||
30 | 119 | # Checking arguments | 119 | # Checking arguments |
31 | 120 | import getopt | 120 | import getopt |
32 | 121 | 121 | ||
33 | === modified file 'madanalysis/IOinterface/job_writer.py' | |||
34 | --- madanalysis/IOinterface/job_writer.py 2013-05-17 07:04:14 +0000 | |||
35 | +++ madanalysis/IOinterface/job_writer.py 2013-06-13 12:22:26 +0000 | |||
36 | @@ -253,7 +253,10 @@ | |||
37 | 253 | if self.output!="": | 253 | if self.output!="": |
38 | 254 | file.write(' //Getting pointer to the writer\n') | 254 | file.write(' //Getting pointer to the writer\n') |
39 | 255 | file.write(' WriterBase* writer1 = \n') | 255 | file.write(' WriterBase* writer1 = \n') |
41 | 256 | file.write(' manager.InitializeWriter("lhe","'+self.output+'");\n') | 256 | if self.output.lower().endswith('lhe') or self.output.lower().endswith('lhe.gz'): |
42 | 257 | file.write(' manager.InitializeWriter("lhe","'+self.output+'");\n') | ||
43 | 258 | elif self.output.lower().endswith('lhco') or self.output.lower().endswith('lhco.gz'): | ||
44 | 259 | file.write(' manager.InitializeWriter("lhco","'+self.output+'");\n') | ||
45 | 257 | file.write(' if (writer1==0) return 1;\n\n') | 260 | file.write(' if (writer1==0) return 1;\n\n') |
46 | 258 | if self.clustering.algorithm!="none": | 261 | if self.clustering.algorithm!="none": |
47 | 259 | file.write(' //Getting pointer to the clusterer\n') | 262 | file.write(' //Getting pointer to the clusterer\n') |
48 | @@ -958,11 +961,15 @@ | |||
49 | 958 | if not dataset.weighted_events: | 961 | if not dataset.weighted_events: |
50 | 959 | weighted_events=" --no_event_weight" | 962 | weighted_events=" --no_event_weight" |
51 | 960 | 963 | ||
52 | 964 | # Release | ||
53 | 965 | release = ' --ma5_version="' + self.main.version + ';' + self.main.date + '"' | ||
54 | 966 | |||
55 | 961 | # Running SampleAnalyzer | 967 | # Running SampleAnalyzer |
56 | 962 | res=os.system('cd '\ | 968 | res=os.system('cd '\ |
57 | 963 | +self.path+'/Output/'+name+';'\ | 969 | +self.path+'/Output/'+name+';'\ |
58 | 964 | +' ../../Build/'\ | 970 | +' ../../Build/'\ |
59 | 965 | +'MadAnalysis5Job '+weighted_events +\ | 971 | +'MadAnalysis5Job '+weighted_events +\ |
60 | 972 | release +\ | ||
61 | 966 | ' ../../Input/'+name+'.list') | 973 | ' ../../Input/'+name+'.list') |
62 | 967 | 974 | ||
63 | 968 | return True | 975 | return True |
64 | 969 | 976 | ||
65 | === modified file 'madanalysis/IOinterface/multiparticle_reader.py' | |||
66 | --- madanalysis/IOinterface/multiparticle_reader.py 2013-05-17 06:19:22 +0000 | |||
67 | +++ madanalysis/IOinterface/multiparticle_reader.py 2013-06-13 12:22:26 +0000 | |||
68 | @@ -29,12 +29,13 @@ | |||
69 | 29 | 29 | ||
70 | 30 | class MultiparticleReader(): | 30 | class MultiparticleReader(): |
71 | 31 | 31 | ||
73 | 32 | def __init__(self,path,cmd_define,level=MA5RunningType.PARTON): | 32 | def __init__(self,path,cmd_define,level=MA5RunningType.PARTON,forced=False): |
74 | 33 | self.cmd_define = cmd_define | 33 | self.cmd_define = cmd_define |
75 | 34 | self.npart = 0 | 34 | self.npart = 0 |
76 | 35 | self.path = path | 35 | self.path = path |
77 | 36 | self.isopen = False | 36 | self.isopen = False |
78 | 37 | self.level = level | 37 | self.level = level |
79 | 38 | self.forced = forced | ||
80 | 38 | 39 | ||
81 | 39 | def Load(self): | 40 | def Load(self): |
82 | 40 | if self.level==MA5RunningType.PARTON: | 41 | if self.level==MA5RunningType.PARTON: |
83 | @@ -54,6 +55,8 @@ | |||
84 | 54 | return False | 55 | return False |
85 | 55 | self.Read() | 56 | self.Read() |
86 | 56 | self.Close() | 57 | self.Close() |
87 | 58 | self.AddSpecialMultiparticles() | ||
88 | 59 | self.Close() | ||
89 | 57 | 60 | ||
90 | 58 | def OpenPartonLevel(self): | 61 | def OpenPartonLevel(self): |
91 | 59 | 62 | ||
92 | @@ -160,7 +163,7 @@ | |||
93 | 160 | logging.debug("Extracting a multiparticle labelled by ["+split[0]+"] with a PDG-id : "+str(split[2:])) | 163 | logging.debug("Extracting a multiparticle labelled by ["+split[0]+"] with a PDG-id : "+str(split[2:])) |
94 | 161 | 164 | ||
95 | 162 | #feed multiparticle | 165 | #feed multiparticle |
97 | 163 | self.cmd_define.fill(split[0],split[2:]) | 166 | self.cmd_define.fill(split[0],split[2:],self.forced) |
98 | 164 | self.npart += 1 | 167 | self.npart += 1 |
99 | 165 | 168 | ||
100 | 166 | 169 | ||
101 | @@ -172,6 +175,7 @@ | |||
102 | 172 | text += item + " " | 175 | text += item + " " |
103 | 173 | logging.error(text) | 176 | logging.error(text) |
104 | 174 | 177 | ||
105 | 178 | |||
106 | 175 | def AddSpecialMultiparticles(self): | 179 | def AddSpecialMultiparticles(self): |
107 | 176 | # Creating invisible and hadronic multiparticles (mandatory in parton and hadron level) | 180 | # Creating invisible and hadronic multiparticles (mandatory in parton and hadron level) |
108 | 177 | if self.level==MA5RunningType.RECO: | 181 | if self.level==MA5RunningType.RECO: |
109 | 178 | 182 | ||
110 | === modified file 'madanalysis/IOinterface/particle_reader.py' | |||
111 | --- madanalysis/IOinterface/particle_reader.py 2013-05-17 06:19:22 +0000 | |||
112 | +++ madanalysis/IOinterface/particle_reader.py 2013-06-13 12:22:26 +0000 | |||
113 | @@ -29,12 +29,13 @@ | |||
114 | 29 | 29 | ||
115 | 30 | class ParticleReader(): | 30 | class ParticleReader(): |
116 | 31 | 31 | ||
118 | 32 | def __init__(self,path,cmd_define,level=MA5RunningType.PARTON): | 32 | def __init__(self,path,cmd_define,level=MA5RunningType.PARTON,forced=False): |
119 | 33 | self.cmd_define = cmd_define | 33 | self.cmd_define = cmd_define |
124 | 34 | self.npart = 0 | 34 | self.npart = 0 |
125 | 35 | self.path = path | 35 | self.path = path |
126 | 36 | self.level = level | 36 | self.level = level |
127 | 37 | self.isopen = False | 37 | self.isopen = False |
128 | 38 | self.forced = forced | ||
129 | 38 | 39 | ||
130 | 39 | def Load(self): | 40 | def Load(self): |
131 | 40 | if self.level==MA5RunningType.PARTON: | 41 | if self.level==MA5RunningType.PARTON: |
132 | @@ -162,7 +163,7 @@ | |||
133 | 162 | logging.debug("Extracting a particle labelled by ["+split[1]+"] with a PDG-id : "+split[0]) | 163 | logging.debug("Extracting a particle labelled by ["+split[1]+"] with a PDG-id : "+split[0]) |
134 | 163 | 164 | ||
135 | 164 | #feed particle | 165 | #feed particle |
137 | 165 | self.cmd_define.fill(split[1],[split[0]]) | 166 | self.cmd_define.fill(split[1],[split[0]],self.forced) |
138 | 166 | self.npart += 1 | 167 | self.npart += 1 |
139 | 167 | 168 | ||
140 | 168 | @staticmethod | 169 | @staticmethod |
141 | 169 | 170 | ||
142 | === modified file 'madanalysis/UpdateNotes.txt' | |||
143 | --- madanalysis/UpdateNotes.txt 2013-05-17 16:41:08 +0000 | |||
144 | +++ madanalysis/UpdateNotes.txt 2013-06-13 12:22:26 +0000 | |||
145 | @@ -1,5 +1,54 @@ | |||
146 | 1 | Update notes for MadAnalysis 5 (in reverse time order) | 1 | Update notes for MadAnalysis 5 (in reverse time order) |
147 | 2 | 2 | ||
148 | 3 | 76 1.1.25 (2013/06/13) econte: fixing one bug related to progress bar occuring on some plateforms | ||
149 | 4 | |||
150 | 5 | 75 1.1.24 (2013/06/12) econte: adding compilation service + remove warnings | ||
151 | 6 | |||
152 | 7 | 74 1.1.23 (2013/06/12) econte: adding MA5/SampleAnalyzer version and date to LHE and LHCO output | ||
153 | 8 | |||
154 | 9 | 73 1.1.22 (2013/06/12) econte: change operation order in ma5commit | ||
155 | 10 | |||
156 | 11 | 72 1.1.21 (2013/06/12) econte: fixing bugs with label definition in RECO mode + adding version | ||
157 | 12 | number to SampleAnalyzer | ||
158 | 13 | |||
159 | 14 | 71 1.1.20 (2013/06/12) econte: fix bug with usage of zlib from tools folder + release/date stamp | ||
160 | 15 | inside SampleAnalyzer | ||
161 | 16 | |||
162 | 17 | 70 1.1.19 (2013/06/12) econte: small fix related to the progress bar display | ||
163 | 18 | |||
164 | 19 | 69 1.1.18 (2013/06/12) econte: fixing bugs (zlib + numpy) + display progress bar | ||
165 | 20 | |||
166 | 21 | 70 1.1.19 (2013/06/12) econte: fixing bugs (numpy, zlib) + progress bar display | ||
167 | 22 | |||
168 | 23 | 69 1.1.18 (2013/06/12) econte: fixing bugs with numpy + fixing bugs with gzip + fixing bugs with | ||
169 | 24 | Progress bar [to validate] | ||
170 | 25 | |||
171 | 26 | 68 1.1.17 (2013/06/10) bfuks: Bug fixes: progress bar on macosx + empty histogram display | ||
172 | 27 | |||
173 | 28 | 67 1.1.16 (2013/06/01) econte: 2 files missed in the previous commit | ||
174 | 29 | |||
175 | 30 | 66 1.1.15 (2013/05/31) econte: finalizing jet-clustering with exclusiveId option and full | ||
176 | 31 | compatibility with Pythia8 | ||
177 | 32 | |||
178 | 33 | 65 1.1.14 (2013/05/26) econte: validation LHCO format | ||
179 | 34 | |||
180 | 35 | 64 1.1.13 (2013/05/24) econte: improving jetclustering + adding photons in NPID plot + nb of read | ||
181 | 36 | events + surprise | ||
182 | 37 | |||
183 | 38 | 63 1.1.12 (2013/05/21) econte: first implementation of the exclusive id | ||
184 | 39 | |||
185 | 40 | 62 1.1.11 (2013/05/21) econte: adding changes to LHCOWriter + fixing warning appearing in Adam's | ||
186 | 41 | computer | ||
187 | 42 | |||
188 | 43 | 61 1.1.10 (2013/05/19) econte: fixing bug with LHCO reader + implementing LHCO output (only | ||
189 | 44 | kinematics part is validated) + beautiful headers for LHCO + LHE | ||
190 | 45 | |||
191 | 46 | 60 1.1.9 (2013/05/18) econte: test | ||
192 | 47 | |||
193 | 48 | 59 1.1.8 (2013/05/17) bfuks: test | ||
194 | 49 | |||
195 | 50 | 58 1.1.7 (2013/05/17) bfuks: initializating 1.1.7 | ||
196 | 51 | |||
197 | 3 | 54 1.1.6 (2013/05/17) ma5team: - Many bug fixes (special thanks to Adam Alloul and Jose Ruiz). | 52 | 54 1.1.6 (2013/05/17) ma5team: - Many bug fixes (special thanks to Adam Alloul and Jose Ruiz). |
198 | 4 | - Simplified LHE output added, LHCO writer at the beta level. | 53 | - Simplified LHE output added, LHCO writer at the beta level. |
199 | 5 | - Clustering and b, c and tau (mis)ident. improved. | 54 | - Clustering and b, c and tau (mis)ident. improved. |
200 | 6 | 55 | ||
201 | === modified file 'madanalysis/configuration/beauty_identification.py' | |||
202 | --- madanalysis/configuration/beauty_identification.py 2013-05-17 06:19:22 +0000 | |||
203 | +++ madanalysis/configuration/beauty_identification.py 2013-06-13 12:22:26 +0000 | |||
204 | @@ -26,7 +26,7 @@ | |||
205 | 26 | class BeautyIdentification(): | 26 | class BeautyIdentification(): |
206 | 27 | 27 | ||
207 | 28 | default_matching_dr = 0.5 | 28 | default_matching_dr = 0.5 |
209 | 29 | default_exclusive = False | 29 | default_exclusive = True |
210 | 30 | default_efficiency = 1. | 30 | default_efficiency = 1. |
211 | 31 | default_misid_cjet = 0. | 31 | default_misid_cjet = 0. |
212 | 32 | default_misid_ljet = 0. | 32 | default_misid_ljet = 0. |
213 | 33 | 33 | ||
214 | === modified file 'madanalysis/configuration/clustering_configuration.py' | |||
215 | --- madanalysis/configuration/clustering_configuration.py 2013-05-17 06:19:22 +0000 | |||
216 | +++ madanalysis/configuration/clustering_configuration.py 2013-06-13 12:22:26 +0000 | |||
217 | @@ -50,7 +50,7 @@ | |||
218 | 50 | self.algorithm = "none" | 50 | self.algorithm = "none" |
219 | 51 | self.beauty = BeautyIdentification() | 51 | self.beauty = BeautyIdentification() |
220 | 52 | self.tau = TauIdentification() | 52 | self.tau = TauIdentification() |
222 | 53 | self.exclusive_id = False | 53 | self.exclusive_id = True |
223 | 54 | 54 | ||
224 | 55 | 55 | ||
225 | 56 | def Display(self): | 56 | def Display(self): |
226 | @@ -189,7 +189,6 @@ | |||
227 | 189 | if parameter=="exclusive_id": | 189 | if parameter=="exclusive_id": |
228 | 190 | if value=="true": | 190 | if value=="true": |
229 | 191 | self.exclusive_id=True | 191 | self.exclusive_id=True |
230 | 192 | logging.warning("This functionnality is not available yet.") | ||
231 | 193 | elif value=="false": | 192 | elif value=="false": |
232 | 194 | self.exclusive_id=False | 193 | self.exclusive_id=False |
233 | 195 | else: | 194 | else: |
234 | 196 | 195 | ||
235 | === modified file 'madanalysis/configuration/tau_identification.py' | |||
236 | --- madanalysis/configuration/tau_identification.py 2013-05-17 06:19:22 +0000 | |||
237 | +++ madanalysis/configuration/tau_identification.py 2013-06-13 12:22:26 +0000 | |||
238 | @@ -26,41 +26,28 @@ | |||
239 | 26 | class TauIdentification(): | 26 | class TauIdentification(): |
240 | 27 | 27 | ||
241 | 28 | default_matching_dr = 0.5 | 28 | default_matching_dr = 0.5 |
243 | 29 | default_exclusive = False | 29 | default_exclusive = True |
244 | 30 | default_efficiency = 1. | 30 | default_efficiency = 1. |
245 | 31 | default_misid_ljet = 0. | 31 | default_misid_ljet = 0. |
246 | 32 | |||
247 | 33 | 32 | ||
251 | 34 | userVariables = { "tau_id.matching_dr" : [str(default_matching_dr)],\ | 33 | userVariables = { "tau_id.efficiency" : [str(default_efficiency)],\ |
249 | 35 | "tau_id.exclusive" : [str(default_exclusive)],\ | ||
250 | 36 | "tau_id.efficiency" : [str(default_efficiency)],\ | ||
252 | 37 | "tau_id.misid_ljet" : [str(default_misid_ljet)]\ | 34 | "tau_id.misid_ljet" : [str(default_misid_ljet)]\ |
253 | 38 | } | 35 | } |
254 | 39 | 36 | ||
255 | 37 | |||
256 | 40 | def __init__(self): | 38 | def __init__(self): |
257 | 41 | self.matching_dr = TauIdentification.default_matching_dr | ||
258 | 42 | self.exclusive = TauIdentification.default_exclusive | ||
259 | 43 | self.efficiency = TauIdentification.default_efficiency | 39 | self.efficiency = TauIdentification.default_efficiency |
260 | 44 | self.misid_ljet = TauIdentification.default_misid_ljet | 40 | self.misid_ljet = TauIdentification.default_misid_ljet |
261 | 45 | 41 | ||
262 | 46 | 42 | ||
263 | 47 | def Display(self): | 43 | def Display(self): |
264 | 48 | logging.info(" + hadronic-tau identification:") | 44 | logging.info(" + hadronic-tau identification:") |
265 | 49 | self.user_DisplayParameter("tau_id.matching_dr") | ||
266 | 50 | self.user_DisplayParameter("tau_id.exclusive") | ||
267 | 51 | self.user_DisplayParameter("tau_id.efficiency") | 45 | self.user_DisplayParameter("tau_id.efficiency") |
268 | 52 | self.user_DisplayParameter("tau_id.misid_ljet") | 46 | self.user_DisplayParameter("tau_id.misid_ljet") |
269 | 53 | 47 | ||
270 | 54 | 48 | ||
271 | 55 | def user_DisplayParameter(self,parameter): | 49 | def user_DisplayParameter(self,parameter): |
280 | 56 | if parameter=="tau_id.matching_dr": | 50 | if parameter=="tau_id.efficiency": |
273 | 57 | logging.info(" + DeltaR matching = "+str(self.matching_dr)) | ||
274 | 58 | elif parameter=="tau_id.exclusive": | ||
275 | 59 | msg="false" | ||
276 | 60 | if self.exclusive: | ||
277 | 61 | msg="true" | ||
278 | 62 | logging.info(" + exclusive algo = "+msg) | ||
279 | 63 | elif parameter=="tau_id.efficiency": | ||
281 | 64 | logging.info(" + id efficiency = "+str(self.efficiency)) | 51 | logging.info(" + id efficiency = "+str(self.efficiency)) |
282 | 65 | elif parameter=="tau_id.misid_ljet": | 52 | elif parameter=="tau_id.misid_ljet": |
283 | 66 | logging.info(" + mis-id efficiency (light quarks) = "+str(self.misid_ljet)) | 53 | logging.info(" + mis-id efficiency (light quarks) = "+str(self.misid_ljet)) |
284 | @@ -70,12 +57,7 @@ | |||
285 | 70 | 57 | ||
286 | 71 | def SampleAnalyzerConfigString(self): | 58 | def SampleAnalyzerConfigString(self): |
287 | 72 | mydict = {} | 59 | mydict = {} |
288 | 73 | mydict['tau_id.matching_dr'] = str(self.matching_dr) | ||
289 | 74 | mydict['tau_id.efficiency'] = str(self.efficiency) | 60 | mydict['tau_id.efficiency'] = str(self.efficiency) |
290 | 75 | if self.exclusive: | ||
291 | 76 | mydict['tau_id.exclusive'] = '1' | ||
292 | 77 | else: | ||
293 | 78 | mydict['tau_id.exclusive'] = '0' | ||
294 | 79 | mydict['tau_id.misid_ljet'] = str(self.misid_ljet) | 61 | mydict['tau_id.misid_ljet'] = str(self.misid_ljet) |
295 | 80 | return mydict | 62 | return mydict |
296 | 81 | 63 | ||
297 | @@ -92,30 +74,8 @@ | |||
298 | 92 | 74 | ||
299 | 93 | 75 | ||
300 | 94 | def user_SetParameter(self,parameter,value): | 76 | def user_SetParameter(self,parameter,value): |
301 | 95 | # matching deltar | ||
302 | 96 | if parameter=="tau_id.matching_dr": | ||
303 | 97 | try: | ||
304 | 98 | number = float(value) | ||
305 | 99 | except: | ||
306 | 100 | logging.error("the 'matching deltaR' must be a float value.") | ||
307 | 101 | return False | ||
308 | 102 | if number<=0: | ||
309 | 103 | logging.error("the 'matching deltaR' cannot be negative or null.") | ||
310 | 104 | return False | ||
311 | 105 | self.matching_dr=number | ||
312 | 106 | |||
313 | 107 | # exclusive | ||
314 | 108 | elif parameter=="tau_id.exclusive": | ||
315 | 109 | if value == "true": | ||
316 | 110 | self.exclusive=True | ||
317 | 111 | elif value == "false": | ||
318 | 112 | self.exclusive=False | ||
319 | 113 | else: | ||
320 | 114 | logging.error("'exclusive' possible values are : 'true', 'false'") | ||
321 | 115 | return False | ||
322 | 116 | |||
323 | 117 | # efficiency | 77 | # efficiency |
325 | 118 | elif parameter=="tau_id.efficiency": | 78 | if parameter=="tau_id.efficiency": |
326 | 119 | try: | 79 | try: |
327 | 120 | number = float(value) | 80 | number = float(value) |
328 | 121 | except: | 81 | except: |
329 | 122 | 82 | ||
330 | === modified file 'madanalysis/core/config_checker.py' | |||
331 | --- madanalysis/core/config_checker.py 2013-05-17 06:19:22 +0000 | |||
332 | +++ madanalysis/core/config_checker.py 2013-06-13 12:22:26 +0000 | |||
333 | @@ -314,6 +314,23 @@ | |||
334 | 314 | os.environ['LIBRARY_PATH'] = os.environ['LIBRARY_PATH'] + \ | 314 | os.environ['LIBRARY_PATH'] = os.environ['LIBRARY_PATH'] + \ |
335 | 315 | ":" + item | 315 | ":" + item |
336 | 316 | break | 316 | break |
337 | 317 | |||
338 | 318 | # If not, test if it is there locally | ||
339 | 319 | if not find: | ||
340 | 320 | item = self.ma5dir+'/tools/zlib/lib/' | ||
341 | 321 | files=glob.glob(item+"/libz.so") | ||
342 | 322 | files.extend(glob.glob(item+"/libz.a")) | ||
343 | 323 | files.extend(glob.glob(item+"/libz.dylib")) | ||
344 | 324 | if len(files)!=0: | ||
345 | 325 | self.configLinux.libraries['ZLib']=files[0]+":"+str(os.stat(files[0]).st_mtime) | ||
346 | 326 | find=True | ||
347 | 327 | os.environ['LD_LIBRARY_PATH'] = os.environ['LD_LIBRARY_PATH'] + \ | ||
348 | 328 | ":" + item | ||
349 | 329 | os.environ['DYLD_LIBRARY_PATH'] = os.environ['DYLD_LIBRARY_PATH'] + \ | ||
350 | 330 | ":" + item | ||
351 | 331 | os.environ['LIBRARY_PATH'] = os.environ['LIBRARY_PATH'] + \ | ||
352 | 332 | ":" + item | ||
353 | 333 | # Not fail -> Warning | ||
354 | 317 | if not find: | 334 | if not find: |
355 | 318 | self.PrintFAIL(warning=True) | 335 | self.PrintFAIL(warning=True) |
356 | 319 | logging.warning("Library called 'libz' not found. Gzip format will be disabled.") | 336 | logging.warning("Library called 'libz' not found. Gzip format will be disabled.") |
357 | @@ -327,9 +344,16 @@ | |||
358 | 327 | if len(files)!=0: | 344 | if len(files)!=0: |
359 | 328 | self.configLinux.headers['ZLib']=files[0]+":"+str(os.stat(files[0]).st_mtime) | 345 | self.configLinux.headers['ZLib']=files[0]+":"+str(os.stat(files[0]).st_mtime) |
360 | 329 | find=True | 346 | find=True |
363 | 330 | os.environ['CPLUS_INCLUDE_PATH'] = os.environ['CPLUS_INCLUDE_PATH'] + \ | 347 | os.environ['CPLUS_INCLUDE_PATH'] = os.environ['CPLUS_INCLUDE_PATH'] + ":" + item |
362 | 331 | ":" + item | ||
364 | 332 | break | 348 | break |
365 | 349 | |||
366 | 350 | # If not, test if it is there locally | ||
367 | 351 | if not find: | ||
368 | 352 | find=os.path.isfile(self.ma5dir+'/tools/zlib/include/zlib.h') | ||
369 | 353 | if find: | ||
370 | 354 | os.environ['CPLUS_INCLUDE_PATH'] = os.environ['CPLUS_INCLUDE_PATH'] + ":" + \ | ||
371 | 355 | self.ma5dir+'/tools/zlib/include/' | ||
372 | 356 | |||
373 | 333 | if not find: | 357 | if not find: |
374 | 334 | self.PrintFAIL(warning=True) | 358 | self.PrintFAIL(warning=True) |
375 | 335 | logging.warning("Header file called 'zlib.h' not found. Gzip format will be disabled.") | 359 | logging.warning("Header file called 'zlib.h' not found. Gzip format will be disabled.") |
376 | @@ -369,6 +393,7 @@ | |||
377 | 369 | if(len(files))!=0: | 393 | if(len(files))!=0: |
378 | 370 | find = True | 394 | find = True |
379 | 371 | self.configLinux.fastjet_version = commands.getstatusoutput('fastjet-config --version')[1] | 395 | self.configLinux.fastjet_version = commands.getstatusoutput('fastjet-config --version')[1] |
380 | 396 | |||
381 | 372 | # If not, test if it is there locally | 397 | # If not, test if it is there locally |
382 | 373 | if not find: | 398 | if not find: |
383 | 374 | find=os.path.isfile(self.ma5dir+'/tools/fastjet/bin/fastjet-config') | 399 | find=os.path.isfile(self.ma5dir+'/tools/fastjet/bin/fastjet-config') |
384 | 375 | 400 | ||
385 | === modified file 'madanalysis/core/expert_mode.py' | |||
386 | --- madanalysis/core/expert_mode.py 2013-05-17 06:19:22 +0000 | |||
387 | +++ madanalysis/core/expert_mode.py 2013-06-13 12:22:26 +0000 | |||
388 | @@ -35,7 +35,6 @@ | |||
389 | 35 | def __init__(self,main): | 35 | def __init__(self,main): |
390 | 36 | self.main=main | 36 | self.main=main |
391 | 37 | self.path="" | 37 | self.path="" |
392 | 38 | self.dir="" | ||
393 | 39 | self.forbiddenpaths=[] | 38 | self.forbiddenpaths=[] |
394 | 40 | self.forbiddenpaths.append(os.path.normpath(self.main.ma5dir+'/lib')) | 39 | self.forbiddenpaths.append(os.path.normpath(self.main.ma5dir+'/lib')) |
395 | 41 | self.forbiddenpaths.append(os.path.normpath(self.main.ma5dir+'/bin')) | 40 | self.forbiddenpaths.append(os.path.normpath(self.main.ma5dir+'/bin')) |
396 | @@ -45,8 +44,10 @@ | |||
397 | 45 | logging.info("\nWelcome to the expert mode of MadAnalysis") | 44 | logging.info("\nWelcome to the expert mode of MadAnalysis") |
398 | 46 | logging.info("Please enter a folder for creating an empty SampleAnalyzer job") | 45 | logging.info("Please enter a folder for creating an empty SampleAnalyzer job") |
399 | 47 | answer=raw_input("Answer: ") | 46 | answer=raw_input("Answer: ") |
402 | 48 | self.dir = answer | 47 | self.path = os.path.expanduser(answer) |
403 | 49 | self.path = os.path.normpath(self.main.currentdir+'/'+answer) | 48 | if not self.path.startswith('/'): |
404 | 49 | self.path = self.main.currentdir+'/'+self.path | ||
405 | 50 | self.path = os.path.normpath(self.path) | ||
406 | 50 | 51 | ||
407 | 51 | # Checking folder | 52 | # Checking folder |
408 | 52 | if self.path in self.forbiddenpaths: | 53 | if self.path in self.forbiddenpaths: |
409 | 53 | 54 | ||
410 | === modified file 'madanalysis/core/main.py' | |||
411 | --- madanalysis/core/main.py 2013-05-17 06:19:22 +0000 | |||
412 | +++ madanalysis/core/main.py 2013-06-13 12:22:26 +0000 | |||
413 | @@ -50,10 +50,13 @@ | |||
414 | 50 | userVariables = { "currentdir" : [], \ | 50 | userVariables = { "currentdir" : [], \ |
415 | 51 | "normalize" : ["none","lumi","lumi_weight"], \ | 51 | "normalize" : ["none","lumi","lumi_weight"], \ |
416 | 52 | "lumi" : [], \ | 52 | "lumi" : [], \ |
418 | 53 | "SBratio" : ['"S/B"','"B/S"','"S/(S+B)"','"B/(B+S)"','"S/sqrt(S+B)"','"B/sqrt(B+S)"'], \ | 53 | "SBratio" : ['"S/B"','"B/S"',\ |
419 | 54 | '"S/(S+B)"','"B/(B+S)"',\ | ||
420 | 55 | '"S/sqrt(S+B)"','"B/sqrt(B+S)"'], \ | ||
421 | 54 | "SBerror" : [], \ | 56 | "SBerror" : [], \ |
422 | 55 | "stacking_method" : ["stack","superimpose","normalize2one"], \ | 57 | "stacking_method" : ["stack","superimpose","normalize2one"], \ |
424 | 56 | "outputfile" : ['"output.lhe.gz"'] } | 58 | "outputfile" : ['"output.lhe.gz"','"output.lhco.gz"'] \ |
425 | 59 | } | ||
426 | 57 | 60 | ||
427 | 58 | SBformula = { 'S/B' : '1./(B**2)*sqrt(B**2*ES**2+S**2*EB**2)', \ | 61 | SBformula = { 'S/B' : '1./(B**2)*sqrt(B**2*ES**2+S**2*EB**2)', \ |
428 | 59 | 'S/(S+B)' : '1./(S+B)**2*sqrt(B**2*ES**2+S**2*EB**2)', \ | 62 | 'S/(S+B)' : '1./(S+B)**2*sqrt(B**2*ES**2+S**2*EB**2)', \ |
429 | @@ -291,11 +294,41 @@ | |||
430 | 291 | quoteTag=True | 294 | quoteTag=True |
431 | 292 | if quoteTag: | 295 | if quoteTag: |
432 | 293 | value=value[1:-1] | 296 | value=value[1:-1] |
438 | 294 | if not value.lower().endswith(".lhe") and not value.lower().endswith(".lhe.gz"): | 297 | valuemin = value.lower() |
439 | 295 | logging.error("LHE format (*.lhe) and compressed LHE format (*.lhe.gz) are the only possible formats for output.") | 298 | |
440 | 296 | return False | 299 | # Compressed file |
441 | 297 | self.output = value | 300 | if valuemin.endswith(".gz") and not self.libZIP: |
442 | 298 | return | 301 | logging.error("Compressed formats (*.gz) are not available. "\ |
443 | 302 | + "Please install zlib with the command line:") | ||
444 | 303 | logging.error(" install zlib") | ||
445 | 304 | return False | ||
446 | 305 | |||
447 | 306 | # LHE | ||
448 | 307 | if valuemin.endswith(".lhe") or valuemin.endswith(".lhe.gz"): | ||
449 | 308 | self.output = value | ||
450 | 309 | return | ||
451 | 310 | |||
452 | 311 | # LHCO | ||
453 | 312 | elif valuemin.endswith(".lhco") or valuemin.endswith(".lhco.gz"): | ||
454 | 313 | if self.mode == MA5RunningType.RECO: | ||
455 | 314 | self.output = value | ||
456 | 315 | return | ||
457 | 316 | elif self.mode == MA5RunningType.PARTON: | ||
458 | 317 | logging.error("LHCO format is not available in PARTON mode.") | ||
459 | 318 | return False | ||
460 | 319 | elif self.mode == MA5RunningType.HADRON: | ||
461 | 320 | if self.clustering.algorithm == "none": | ||
462 | 321 | logging.error("Please select a jet-clustering algorithm before requesting a LHCO file output.") | ||
463 | 322 | logging.error("Command: set main.merging.algorithm = ") | ||
464 | 323 | return False | ||
465 | 324 | else: | ||
466 | 325 | self.output = value | ||
467 | 326 | return | ||
468 | 327 | |||
469 | 328 | else: | ||
470 | 329 | logging.error("Output format is not available. Extension allowed: " +\ | ||
471 | 330 | ".lhe .lhe.gz .lhco .lhco.gz") | ||
472 | 331 | return False | ||
473 | 299 | 332 | ||
474 | 300 | # other | 333 | # other |
475 | 301 | else: | 334 | else: |
476 | 302 | 335 | ||
477 | === modified file 'madanalysis/input/reco_default.txt' | |||
478 | --- madanalysis/input/reco_default.txt 2013-04-14 20:56:15 +0000 | |||
479 | +++ madanalysis/input/reco_default.txt 2013-06-13 12:22:26 +0000 | |||
480 | @@ -7,7 +7,8 @@ | |||
481 | 7 | 15 ta- | 7 | 15 ta- |
482 | 8 | -15 ta+ | 8 | -15 ta+ |
483 | 9 | 21 j | 9 | 21 j |
484 | 10 | 22 a | ||
485 | 10 | 5 b | 11 | 5 b |
486 | 11 | 1 nb | 12 | 1 nb |
487 | 12 | 100 met | 13 | 100 met |
488 | 13 | 101 mht | ||
489 | 14 | \ No newline at end of file | 14 | \ No newline at end of file |
490 | 15 | 101 mht | ||
491 | 15 | 16 | ||
492 | === modified file 'madanalysis/interpreter/cmd_import.py' | |||
493 | --- madanalysis/interpreter/cmd_import.py 2013-05-17 06:19:22 +0000 | |||
494 | +++ madanalysis/interpreter/cmd_import.py 2013-06-13 12:22:26 +0000 | |||
495 | @@ -163,7 +163,7 @@ | |||
496 | 163 | # Loading particles | 163 | # Loading particles |
497 | 164 | input = ParticleReader(self.main.ma5dir,cmd_define,self.main.mode) | 164 | input = ParticleReader(self.main.ma5dir,cmd_define,self.main.mode) |
498 | 165 | input.Load() | 165 | input.Load() |
500 | 166 | input = MultiparticleReader(self.main.ma5dir,cmd_define,self.main.mode) | 166 | input = MultiparticleReader(self.main.ma5dir,cmd_define,self.main.mode,self.main.forced) |
501 | 167 | input.Load() | 167 | input.Load() |
502 | 168 | 168 | ||
503 | 169 | # Reset history | 169 | # Reset history |
504 | 170 | 170 | ||
505 | === modified file 'madanalysis/interpreter/cmd_reset.py' | |||
506 | --- madanalysis/interpreter/cmd_reset.py 2013-05-17 06:19:22 +0000 | |||
507 | +++ madanalysis/interpreter/cmd_reset.py 2013-06-13 12:22:26 +0000 | |||
508 | @@ -85,7 +85,7 @@ | |||
509 | 85 | # Loading particles | 85 | # Loading particles |
510 | 86 | input = ParticleReader(self.main.ma5dir,cmd_define,self.main.mode) | 86 | input = ParticleReader(self.main.ma5dir,cmd_define,self.main.mode) |
511 | 87 | input.Load() | 87 | input.Load() |
513 | 88 | input = MultiparticleReader(self.main.ma5dir,cmd_define,self.main.mode) | 88 | input = MultiparticleReader(self.main.ma5dir,cmd_define,self.main.mode,self.main.forced) |
514 | 89 | input.Load() | 89 | input.Load() |
515 | 90 | 90 | ||
516 | 91 | 91 | ||
517 | 92 | 92 | ||
518 | === modified file 'madanalysis/interpreter/interpreter.py' | |||
519 | --- madanalysis/interpreter/interpreter.py 2013-05-17 06:19:22 +0000 | |||
520 | +++ madanalysis/interpreter/interpreter.py 2013-06-13 12:22:26 +0000 | |||
521 | @@ -282,7 +282,7 @@ | |||
522 | 282 | input.Load() | 282 | input.Load() |
523 | 283 | 283 | ||
524 | 284 | def InitializeMultiparticle(self): | 284 | def InitializeMultiparticle(self): |
526 | 285 | input = MultiparticleReader(self.main.ma5dir,self.cmd_define,self.main.mode) | 285 | input = MultiparticleReader(self.main.ma5dir,self.cmd_define,self.main.mode,self.main.forced) |
527 | 286 | input.Load() | 286 | input.Load() |
528 | 287 | 287 | ||
529 | 288 | # PreLoop | 288 | # PreLoop |
530 | @@ -474,5 +474,5 @@ | |||
531 | 474 | if line[-1] in [' ','\t']: | 474 | if line[-1] in [' ','\t']: |
532 | 475 | return '', line, len(line),len(enidx) | 475 | return '', line, len(line),len(enidx) |
533 | 476 | return text, line, begidx, endidx | 476 | return text, line, begidx, endidx |
535 | 477 | 477 | ||
536 | 478 | 478 | ||
537 | 479 | 479 | ||
538 | === modified file 'madanalysis/interpreter/interpreter_base.py' | |||
539 | --- madanalysis/interpreter/interpreter_base.py 2013-05-17 06:19:22 +0000 | |||
540 | +++ madanalysis/interpreter/interpreter_base.py 2013-06-13 12:22:26 +0000 | |||
541 | @@ -103,6 +103,12 @@ | |||
542 | 103 | # --> removing additionnal whitespace characters | 103 | # --> removing additionnal whitespace characters |
543 | 104 | line = line.lstrip() | 104 | line = line.lstrip() |
544 | 105 | 105 | ||
545 | 106 | # pattern design | ||
546 | 107 | if len(line)==4 and \ | ||
547 | 108 | line[0]=='m' and line[1]=='u' and line[2]=='f' and line[3]=='!': | ||
548 | 109 | self.pattern_design() | ||
549 | 110 | return '' | ||
550 | 111 | |||
551 | 106 | # Add the line to the history | 112 | # Add the line to the history |
552 | 107 | # except for useless commands (empty history, help calls and comments) | 113 | # except for useless commands (empty history, help calls and comments) |
553 | 108 | if line != "history" and \ | 114 | if line != "history" and \ |
554 | @@ -334,3 +340,44 @@ | |||
555 | 334 | else: | 340 | else: |
556 | 335 | out.append(data) | 341 | out.append(data) |
557 | 336 | return out | 342 | return out |
558 | 343 | |||
559 | 344 | |||
560 | 345 | def pattern_design(self): | ||
561 | 346 | pattern=[] | ||
562 | 347 | pattern.append('32-32-32-32-32-32-32-32-95-95-95-95-95-32') | ||
563 | 348 | pattern.append('32-32-32-32-32-95-45-126-126-32-32-32-32-32-126-126-45-95-47-47-32') | ||
564 | 349 | pattern.append('32-32-32-47-126-32-32-32-32-32-32-32-32-32-32-32-32-32-126-92-32') | ||
565 | 350 | pattern.append('32-32-124-32-32-32-32-32-32-32-32-32-32-32-32-32-32-95-32-32-124-95-32') | ||
566 | 351 | pattern.append('32-124-32-32-32-32-32-32-32-32-32-95-45-45-126-126-126-32-41-126-126-32-41-95-95-95-32') | ||
567 | 352 | pattern.append('92-124-32-32-32-32-32-32-32-32-47-32-32-32-95-95-95-32-32-32-95-45-126-32-32-32-126-45-39-95-32') | ||
568 | 353 | pattern.append('92-32-32-32-32-32-32-32-32-32-32-95-45-126-32-32-32-126-45-95-32-32-32-32-32-32-32-32-32-92-32') | ||
569 | 354 | pattern.append('124-32-32-32-32-32-32-32-32-32-47-32-32-32-32-32-32-32-32-32-92-32-32-32-32-32-32-32-32-32-124-32') | ||
570 | 355 | pattern.append('124-32-32-32-32-32-32-32-32-124-32-32-32-32-32-32-32-32-32-32-32-124-32-32-32-32-32-40-79-32-32-124-32') | ||
571 | 356 | pattern.append('32-124-32-32-32-32-32-32-124-32-32-32-32-32-32-32-32-32-32-32-32-32-124-32-32-32-32-32-32-32-32-124-32') | ||
572 | 357 | pattern.append('32-32-124-32-32-32-32-32-32-124-32-32-32-79-41-32-32-32-32-32-32-32-32-124-32-32-32-32-32-32-32-124-32') | ||
573 | 358 | pattern.append('32-32-47-124-32-32-32-32-32-32-124-32-32-32-32-32-32-32-32-32-32-32-124-32-32-32-32-32-32-32-47-32') | ||
574 | 359 | pattern.append('32-32-47-32-92-32-95-45-45-95-32-92-32-32-32-32-32-32-32-32-32-47-45-95-32-32-32-95-45-126-41-32') | ||
575 | 360 | pattern.append('32-32-32-32-47-126-32-32-32-32-92-32-126-45-95-32-32-32-95-45-126-32-32-32-126-126-126-95-95-47-32') | ||
576 | 361 | pattern.append('32-32-32-124-32-32-32-124-92-32-32-126-45-95-32-126-126-126-32-95-45-126-126-45-45-45-126-32-32-92-32') | ||
577 | 362 | pattern.append('32-32-32-124-32-32-32-124-32-124-32-32-32-32-126-45-45-126-126-32-32-47-32-92-32-32-32-32-32-32-126-45-39-95-32') | ||
578 | 363 | pattern.append('32-32-32-124-32-32-32-92-32-124-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-126-45-39-95-32') | ||
579 | 364 | pattern.append('32-32-32-32-92-32-32-32-126-45-124-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-126-126-45-45-95-95-32-95-45-126-126-45-44-32') | ||
580 | 365 | pattern.append('32-32-32-32-32-126-45-95-32-32-32-124-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-47-32-32-32-32-32-124-32') | ||
581 | 366 | pattern.append('32-32-32-32-32-32-32-32-126-126-45-45-124-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-47-32') | ||
582 | 367 | pattern.append('32-32-32-32-32-32-32-32-32-32-124-32-32-124-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-47-32') | ||
583 | 368 | pattern.append('32-32-32-32-32-32-32-32-32-32-124-32-32-32-124-32-32-32-32-32-32-32-32-32-32-32-32-32-32-95-32-32-32-32-32-32-32-32-32-32-32-32-95-45-126-32') | ||
584 | 369 | pattern.append('32-32-32-32-32-32-32-32-32-32-124-32-32-47-126-126-45-45-95-32-32-32-95-95-45-45-45-126-126-32-32-32-32-32-32-32-32-32-32-95-45-126-32') | ||
585 | 370 | pattern.append('32-32-32-32-32-32-32-32-32-32-124-32-32-92-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-32-95-95-45-45-126-126-32') | ||
586 | 371 | pattern.append('32-32-32-32-32-32-32-32-32-32-124-32-32-124-126-126-45-45-95-95-32-32-32-32-32-95-95-95-45-45-45-126-126-32') | ||
587 | 372 | pattern.append('32-32-32-32-32-32-32-32-32-32-124-32-32-124-32-32-32-32-32-32-126-126-126-126-126-32') | ||
588 | 373 | pattern.append('32-32-32-32-32-32-32-32-32-32-124-32-32-124-32') | ||
589 | 374 | |||
590 | 375 | for word in pattern: | ||
591 | 376 | msg="" | ||
592 | 377 | words = word.split('-') | ||
593 | 378 | for i in range(len(words)): | ||
594 | 379 | msg+=chr((int(words[i]))) | ||
595 | 380 | logging.info("\x1b[1m"+"\x1b[32m"+msg+"\x1b[0m") | ||
596 | 381 | logging.info("") | ||
597 | 382 | |||
598 | 383 | |||
599 | 337 | 384 | ||
600 | === modified file 'madanalysis/job/job_execute.py' | |||
601 | --- madanalysis/job/job_execute.py 2013-05-17 06:19:22 +0000 | |||
602 | +++ madanalysis/job/job_execute.py 2013-06-13 12:22:26 +0000 | |||
603 | @@ -162,6 +162,24 @@ | |||
604 | 162 | container+'.push_back(&(event.rec()->electrons()[i]));\n') | 162 | container+'.push_back(&(event.rec()->electrons()[i]));\n') |
605 | 163 | 163 | ||
606 | 164 | 164 | ||
607 | 165 | def WriteFillWithPhotonContainer(part,file,rank,status): | ||
608 | 166 | |||
609 | 167 | # If PTrank, no fill | ||
610 | 168 | if part.PTrank!=0: | ||
611 | 169 | return | ||
612 | 170 | |||
613 | 171 | # Skipping if already defined | ||
614 | 172 | if InstanceName.Find('P_'+part.name+rank+status): | ||
615 | 173 | return | ||
616 | 174 | |||
617 | 175 | # Getting container name | ||
618 | 176 | container=InstanceName.Get('P_'+part.name+rank+status) | ||
619 | 177 | |||
620 | 178 | # Put photon | ||
621 | 179 | if part.particle.Find(22): | ||
622 | 180 | file.write(' '+container+'.push_back(&(event.rec()->photons()[i]));\n') | ||
623 | 181 | |||
624 | 182 | |||
625 | 165 | def WriteFillWithMuonContainer(part,file,rank,status): | 183 | def WriteFillWithMuonContainer(part,file,rank,status): |
626 | 166 | 184 | ||
627 | 167 | # If PTrank, no fill | 185 | # If PTrank, no fill |
628 | @@ -299,6 +317,14 @@ | |||
629 | 299 | file.write(' }\n') | 317 | file.write(' }\n') |
630 | 300 | InstanceName.Clear() | 318 | InstanceName.Clear() |
631 | 301 | 319 | ||
632 | 320 | # Filling with photons | ||
633 | 321 | file.write(' for (UInt_t i=0;i<event.rec()->photons().size();i++)\n') | ||
634 | 322 | file.write(' {\n') | ||
635 | 323 | for item in part_list: | ||
636 | 324 | WriteFillWithPhotonContainer(item[0],file,item[1],item[2]) | ||
637 | 325 | file.write(' }\n') | ||
638 | 326 | InstanceName.Clear() | ||
639 | 327 | |||
640 | 302 | # Filling with electrons | 328 | # Filling with electrons |
641 | 303 | file.write(' for (UInt_t i=0;i<event.rec()->electrons().size();i++)\n') | 329 | file.write(' for (UInt_t i=0;i<event.rec()->electrons().size();i++)\n') |
642 | 304 | file.write(' {\n') | 330 | file.write(' {\n') |
643 | 305 | 331 | ||
644 | === modified file 'madanalysis/job/job_initialize.py' | |||
645 | --- madanalysis/job/job_initialize.py 2013-05-17 06:19:22 +0000 | |||
646 | +++ madanalysis/job/job_initialize.py 2013-06-13 12:22:26 +0000 | |||
647 | @@ -45,13 +45,390 @@ | |||
648 | 45 | file.write('{\n') | 45 | file.write('{\n') |
649 | 46 | 46 | ||
650 | 47 | # mcConfig initialization | 47 | # mcConfig initialization |
658 | 48 | #if main.mode!=MA5RunningType.RECO: FOR ALL MODES !!!! | 48 | if main.mode!=MA5RunningType.RECO: |
659 | 49 | file.write(' // Initializing PhysicsService for MC\n') | 49 | file.write(' // Initializing PhysicsService for MC\n') |
660 | 50 | file.write(' PHYSICS->mcConfig().Reset();\n\n') | 50 | file.write(' PHYSICS->mcConfig().Reset();\n\n') |
661 | 51 | WriteHadronicList(file,main) | 51 | WriteHadronicList(file,main) |
662 | 52 | file.write('\n') | 52 | file.write('\n') |
663 | 53 | WriteInvisibleList(file,main) | 53 | WriteInvisibleList(file,main) |
664 | 54 | file.write('\n') | 54 | file.write('\n') |
665 | 55 | else: | ||
666 | 56 | file.write(' // Initializing PhysicsService for MC\n') | ||
667 | 57 | file.write(' PHYSICS->mcConfig().Reset();\n\n') | ||
668 | 58 | file.write('\n') | ||
669 | 59 | file.write(' // definition of the multiparticle "hadronic"\n') | ||
670 | 60 | file.write(' PHYSICS->mcConfig().AddHadronicId(-20543);\n') | ||
671 | 61 | file.write(' PHYSICS->mcConfig().AddHadronicId(-20533);\n') | ||
672 | 62 | file.write(' PHYSICS->mcConfig().AddHadronicId(-20523);\n') | ||
673 | 63 | file.write(' PHYSICS->mcConfig().AddHadronicId(-20513);\n') | ||
674 | 64 | file.write(' PHYSICS->mcConfig().AddHadronicId(-20433);\n') | ||
675 | 65 | file.write(' PHYSICS->mcConfig().AddHadronicId(-20423);\n') | ||
676 | 66 | file.write(' PHYSICS->mcConfig().AddHadronicId(-20413);\n') | ||
677 | 67 | file.write(' PHYSICS->mcConfig().AddHadronicId(-20323);\n') | ||
678 | 68 | file.write(' PHYSICS->mcConfig().AddHadronicId(-20313);\n') | ||
679 | 69 | file.write(' PHYSICS->mcConfig().AddHadronicId(-20213);\n') | ||
680 | 70 | file.write(' PHYSICS->mcConfig().AddHadronicId(-10543);\n') | ||
681 | 71 | file.write(' PHYSICS->mcConfig().AddHadronicId(-10541);\n') | ||
682 | 72 | file.write(' PHYSICS->mcConfig().AddHadronicId(-10533);\n') | ||
683 | 73 | file.write(' PHYSICS->mcConfig().AddHadronicId(-10531);\n') | ||
684 | 74 | file.write(' PHYSICS->mcConfig().AddHadronicId(-10523);\n') | ||
685 | 75 | file.write(' PHYSICS->mcConfig().AddHadronicId(-10521);\n') | ||
686 | 76 | file.write(' PHYSICS->mcConfig().AddHadronicId(-10513);\n') | ||
687 | 77 | file.write(' PHYSICS->mcConfig().AddHadronicId(-10511);\n') | ||
688 | 78 | file.write(' PHYSICS->mcConfig().AddHadronicId(-10433);\n') | ||
689 | 79 | file.write(' PHYSICS->mcConfig().AddHadronicId(-10431);\n') | ||
690 | 80 | file.write(' PHYSICS->mcConfig().AddHadronicId(-10423);\n') | ||
691 | 81 | file.write(' PHYSICS->mcConfig().AddHadronicId(-10421);\n') | ||
692 | 82 | file.write(' PHYSICS->mcConfig().AddHadronicId(-10413);\n') | ||
693 | 83 | file.write(' PHYSICS->mcConfig().AddHadronicId(-10411);\n') | ||
694 | 84 | file.write(' PHYSICS->mcConfig().AddHadronicId(-10323);\n') | ||
695 | 85 | file.write(' PHYSICS->mcConfig().AddHadronicId(-10321);\n') | ||
696 | 86 | file.write(' PHYSICS->mcConfig().AddHadronicId(-10313);\n') | ||
697 | 87 | file.write(' PHYSICS->mcConfig().AddHadronicId(-10311);\n') | ||
698 | 88 | file.write(' PHYSICS->mcConfig().AddHadronicId(-10213);\n') | ||
699 | 89 | file.write(' PHYSICS->mcConfig().AddHadronicId(-10211);\n') | ||
700 | 90 | file.write(' PHYSICS->mcConfig().AddHadronicId(-5554);\n') | ||
701 | 91 | file.write(' PHYSICS->mcConfig().AddHadronicId(-5544);\n') | ||
702 | 92 | file.write(' PHYSICS->mcConfig().AddHadronicId(-5542);\n') | ||
703 | 93 | file.write(' PHYSICS->mcConfig().AddHadronicId(-5534);\n') | ||
704 | 94 | file.write(' PHYSICS->mcConfig().AddHadronicId(-5532);\n') | ||
705 | 95 | file.write(' PHYSICS->mcConfig().AddHadronicId(-5524);\n') | ||
706 | 96 | file.write(' PHYSICS->mcConfig().AddHadronicId(-5522);\n') | ||
707 | 97 | file.write(' PHYSICS->mcConfig().AddHadronicId(-5514);\n') | ||
708 | 98 | file.write(' PHYSICS->mcConfig().AddHadronicId(-5512);\n') | ||
709 | 99 | file.write(' PHYSICS->mcConfig().AddHadronicId(-5503);\n') | ||
710 | 100 | file.write(' PHYSICS->mcConfig().AddHadronicId(-5444);\n') | ||
711 | 101 | file.write(' PHYSICS->mcConfig().AddHadronicId(-5442);\n') | ||
712 | 102 | file.write(' PHYSICS->mcConfig().AddHadronicId(-5434);\n') | ||
713 | 103 | file.write(' PHYSICS->mcConfig().AddHadronicId(-5432);\n') | ||
714 | 104 | file.write(' PHYSICS->mcConfig().AddHadronicId(-5424);\n') | ||
715 | 105 | file.write(' PHYSICS->mcConfig().AddHadronicId(-5422);\n') | ||
716 | 106 | file.write(' PHYSICS->mcConfig().AddHadronicId(-5414);\n') | ||
717 | 107 | file.write(' PHYSICS->mcConfig().AddHadronicId(-5412);\n') | ||
718 | 108 | file.write(' PHYSICS->mcConfig().AddHadronicId(-5403);\n') | ||
719 | 109 | file.write(' PHYSICS->mcConfig().AddHadronicId(-5401);\n') | ||
720 | 110 | file.write(' PHYSICS->mcConfig().AddHadronicId(-5342);\n') | ||
721 | 111 | file.write(' PHYSICS->mcConfig().AddHadronicId(-5334);\n') | ||
722 | 112 | file.write(' PHYSICS->mcConfig().AddHadronicId(-5332);\n') | ||
723 | 113 | file.write(' PHYSICS->mcConfig().AddHadronicId(-5324);\n') | ||
724 | 114 | file.write(' PHYSICS->mcConfig().AddHadronicId(-5322);\n') | ||
725 | 115 | file.write(' PHYSICS->mcConfig().AddHadronicId(-5314);\n') | ||
726 | 116 | file.write(' PHYSICS->mcConfig().AddHadronicId(-5312);\n') | ||
727 | 117 | file.write(' PHYSICS->mcConfig().AddHadronicId(-5303);\n') | ||
728 | 118 | file.write(' PHYSICS->mcConfig().AddHadronicId(-5301);\n') | ||
729 | 119 | file.write(' PHYSICS->mcConfig().AddHadronicId(-5242);\n') | ||
730 | 120 | file.write(' PHYSICS->mcConfig().AddHadronicId(-5232);\n') | ||
731 | 121 | file.write(' PHYSICS->mcConfig().AddHadronicId(-5224);\n') | ||
732 | 122 | file.write(' PHYSICS->mcConfig().AddHadronicId(-5222);\n') | ||
733 | 123 | file.write(' PHYSICS->mcConfig().AddHadronicId(-5214);\n') | ||
734 | 124 | file.write(' PHYSICS->mcConfig().AddHadronicId(-5212);\n') | ||
735 | 125 | file.write(' PHYSICS->mcConfig().AddHadronicId(-5203);\n') | ||
736 | 126 | file.write(' PHYSICS->mcConfig().AddHadronicId(-5201);\n') | ||
737 | 127 | file.write(' PHYSICS->mcConfig().AddHadronicId(-5142);\n') | ||
738 | 128 | file.write(' PHYSICS->mcConfig().AddHadronicId(-5132);\n') | ||
739 | 129 | file.write(' PHYSICS->mcConfig().AddHadronicId(-5122);\n') | ||
740 | 130 | file.write(' PHYSICS->mcConfig().AddHadronicId(-5114);\n') | ||
741 | 131 | file.write(' PHYSICS->mcConfig().AddHadronicId(-5112);\n') | ||
742 | 132 | file.write(' PHYSICS->mcConfig().AddHadronicId(-5103);\n') | ||
743 | 133 | file.write(' PHYSICS->mcConfig().AddHadronicId(-5101);\n') | ||
744 | 134 | file.write(' PHYSICS->mcConfig().AddHadronicId(-4444);\n') | ||
745 | 135 | file.write(' PHYSICS->mcConfig().AddHadronicId(-4434);\n') | ||
746 | 136 | file.write(' PHYSICS->mcConfig().AddHadronicId(-4432);\n') | ||
747 | 137 | file.write(' PHYSICS->mcConfig().AddHadronicId(-4424);\n') | ||
748 | 138 | file.write(' PHYSICS->mcConfig().AddHadronicId(-4422);\n') | ||
749 | 139 | file.write(' PHYSICS->mcConfig().AddHadronicId(-4414);\n') | ||
750 | 140 | file.write(' PHYSICS->mcConfig().AddHadronicId(-4412);\n') | ||
751 | 141 | file.write(' PHYSICS->mcConfig().AddHadronicId(-4403);\n') | ||
752 | 142 | file.write(' PHYSICS->mcConfig().AddHadronicId(-4334);\n') | ||
753 | 143 | file.write(' PHYSICS->mcConfig().AddHadronicId(-4332);\n') | ||
754 | 144 | file.write(' PHYSICS->mcConfig().AddHadronicId(-4324);\n') | ||
755 | 145 | file.write(' PHYSICS->mcConfig().AddHadronicId(-4322);\n') | ||
756 | 146 | file.write(' PHYSICS->mcConfig().AddHadronicId(-4314);\n') | ||
757 | 147 | file.write(' PHYSICS->mcConfig().AddHadronicId(-4312);\n') | ||
758 | 148 | file.write(' PHYSICS->mcConfig().AddHadronicId(-4303);\n') | ||
759 | 149 | file.write(' PHYSICS->mcConfig().AddHadronicId(-4301);\n') | ||
760 | 150 | file.write(' PHYSICS->mcConfig().AddHadronicId(-4232);\n') | ||
761 | 151 | file.write(' PHYSICS->mcConfig().AddHadronicId(-4224);\n') | ||
762 | 152 | file.write(' PHYSICS->mcConfig().AddHadronicId(-4222);\n') | ||
763 | 153 | file.write(' PHYSICS->mcConfig().AddHadronicId(-4214);\n') | ||
764 | 154 | file.write(' PHYSICS->mcConfig().AddHadronicId(-4212);\n') | ||
765 | 155 | file.write(' PHYSICS->mcConfig().AddHadronicId(-4203);\n') | ||
766 | 156 | file.write(' PHYSICS->mcConfig().AddHadronicId(-4201);\n') | ||
767 | 157 | file.write(' PHYSICS->mcConfig().AddHadronicId(-4132);\n') | ||
768 | 158 | file.write(' PHYSICS->mcConfig().AddHadronicId(-4122);\n') | ||
769 | 159 | file.write(' PHYSICS->mcConfig().AddHadronicId(-4114);\n') | ||
770 | 160 | file.write(' PHYSICS->mcConfig().AddHadronicId(-4112);\n') | ||
771 | 161 | file.write(' PHYSICS->mcConfig().AddHadronicId(-4103);\n') | ||
772 | 162 | file.write(' PHYSICS->mcConfig().AddHadronicId(-4101);\n') | ||
773 | 163 | file.write(' PHYSICS->mcConfig().AddHadronicId(-3334);\n') | ||
774 | 164 | file.write(' PHYSICS->mcConfig().AddHadronicId(-3324);\n') | ||
775 | 165 | file.write(' PHYSICS->mcConfig().AddHadronicId(-3322);\n') | ||
776 | 166 | file.write(' PHYSICS->mcConfig().AddHadronicId(-3314);\n') | ||
777 | 167 | file.write(' PHYSICS->mcConfig().AddHadronicId(-3312);\n') | ||
778 | 168 | file.write(' PHYSICS->mcConfig().AddHadronicId(-3303);\n') | ||
779 | 169 | file.write(' PHYSICS->mcConfig().AddHadronicId(-3224);\n') | ||
780 | 170 | file.write(' PHYSICS->mcConfig().AddHadronicId(-3222);\n') | ||
781 | 171 | file.write(' PHYSICS->mcConfig().AddHadronicId(-3214);\n') | ||
782 | 172 | file.write(' PHYSICS->mcConfig().AddHadronicId(-3212);\n') | ||
783 | 173 | file.write(' PHYSICS->mcConfig().AddHadronicId(-3203);\n') | ||
784 | 174 | file.write(' PHYSICS->mcConfig().AddHadronicId(-3201);\n') | ||
785 | 175 | file.write(' PHYSICS->mcConfig().AddHadronicId(-3122);\n') | ||
786 | 176 | file.write(' PHYSICS->mcConfig().AddHadronicId(-3114);\n') | ||
787 | 177 | file.write(' PHYSICS->mcConfig().AddHadronicId(-3112);\n') | ||
788 | 178 | file.write(' PHYSICS->mcConfig().AddHadronicId(-3103);\n') | ||
789 | 179 | file.write(' PHYSICS->mcConfig().AddHadronicId(-3101);\n') | ||
790 | 180 | file.write(' PHYSICS->mcConfig().AddHadronicId(-2224);\n') | ||
791 | 181 | file.write(' PHYSICS->mcConfig().AddHadronicId(-2214);\n') | ||
792 | 182 | file.write(' PHYSICS->mcConfig().AddHadronicId(-2212);\n') | ||
793 | 183 | file.write(' PHYSICS->mcConfig().AddHadronicId(-2203);\n') | ||
794 | 184 | file.write(' PHYSICS->mcConfig().AddHadronicId(-2114);\n') | ||
795 | 185 | file.write(' PHYSICS->mcConfig().AddHadronicId(-2112);\n') | ||
796 | 186 | file.write(' PHYSICS->mcConfig().AddHadronicId(-2103);\n') | ||
797 | 187 | file.write(' PHYSICS->mcConfig().AddHadronicId(-2101);\n') | ||
798 | 188 | file.write(' PHYSICS->mcConfig().AddHadronicId(-1114);\n') | ||
799 | 189 | file.write(' PHYSICS->mcConfig().AddHadronicId(-1103);\n') | ||
800 | 190 | file.write(' PHYSICS->mcConfig().AddHadronicId(-545);\n') | ||
801 | 191 | file.write(' PHYSICS->mcConfig().AddHadronicId(-543);\n') | ||
802 | 192 | file.write(' PHYSICS->mcConfig().AddHadronicId(-541);\n') | ||
803 | 193 | file.write(' PHYSICS->mcConfig().AddHadronicId(-535);\n') | ||
804 | 194 | file.write(' PHYSICS->mcConfig().AddHadronicId(-533);\n') | ||
805 | 195 | file.write(' PHYSICS->mcConfig().AddHadronicId(-531);\n') | ||
806 | 196 | file.write(' PHYSICS->mcConfig().AddHadronicId(-525);\n') | ||
807 | 197 | file.write(' PHYSICS->mcConfig().AddHadronicId(-523);\n') | ||
808 | 198 | file.write(' PHYSICS->mcConfig().AddHadronicId(-521);\n') | ||
809 | 199 | file.write(' PHYSICS->mcConfig().AddHadronicId(-515);\n') | ||
810 | 200 | file.write(' PHYSICS->mcConfig().AddHadronicId(-513);\n') | ||
811 | 201 | file.write(' PHYSICS->mcConfig().AddHadronicId(-511);\n') | ||
812 | 202 | file.write(' PHYSICS->mcConfig().AddHadronicId(-435);\n') | ||
813 | 203 | file.write(' PHYSICS->mcConfig().AddHadronicId(-433);\n') | ||
814 | 204 | file.write(' PHYSICS->mcConfig().AddHadronicId(-431);\n') | ||
815 | 205 | file.write(' PHYSICS->mcConfig().AddHadronicId(-425);\n') | ||
816 | 206 | file.write(' PHYSICS->mcConfig().AddHadronicId(-423);\n') | ||
817 | 207 | file.write(' PHYSICS->mcConfig().AddHadronicId(-421);\n') | ||
818 | 208 | file.write(' PHYSICS->mcConfig().AddHadronicId(-415);\n') | ||
819 | 209 | file.write(' PHYSICS->mcConfig().AddHadronicId(-413);\n') | ||
820 | 210 | file.write(' PHYSICS->mcConfig().AddHadronicId(-411);\n') | ||
821 | 211 | file.write(' PHYSICS->mcConfig().AddHadronicId(-325);\n') | ||
822 | 212 | file.write(' PHYSICS->mcConfig().AddHadronicId(-323);\n') | ||
823 | 213 | file.write(' PHYSICS->mcConfig().AddHadronicId(-321);\n') | ||
824 | 214 | file.write(' PHYSICS->mcConfig().AddHadronicId(-315);\n') | ||
825 | 215 | file.write(' PHYSICS->mcConfig().AddHadronicId(-313);\n') | ||
826 | 216 | file.write(' PHYSICS->mcConfig().AddHadronicId(-311);\n') | ||
827 | 217 | file.write(' PHYSICS->mcConfig().AddHadronicId(-215);\n') | ||
828 | 218 | file.write(' PHYSICS->mcConfig().AddHadronicId(-213);\n') | ||
829 | 219 | file.write(' PHYSICS->mcConfig().AddHadronicId(-211);\n') | ||
830 | 220 | file.write(' PHYSICS->mcConfig().AddHadronicId(111);\n') | ||
831 | 221 | file.write(' PHYSICS->mcConfig().AddHadronicId(113);\n') | ||
832 | 222 | file.write(' PHYSICS->mcConfig().AddHadronicId(115);\n') | ||
833 | 223 | file.write(' PHYSICS->mcConfig().AddHadronicId(130);\n') | ||
834 | 224 | file.write(' PHYSICS->mcConfig().AddHadronicId(211);\n') | ||
835 | 225 | file.write(' PHYSICS->mcConfig().AddHadronicId(213);\n') | ||
836 | 226 | file.write(' PHYSICS->mcConfig().AddHadronicId(215);\n') | ||
837 | 227 | file.write(' PHYSICS->mcConfig().AddHadronicId(221);\n') | ||
838 | 228 | file.write(' PHYSICS->mcConfig().AddHadronicId(223);\n') | ||
839 | 229 | file.write(' PHYSICS->mcConfig().AddHadronicId(225);\n') | ||
840 | 230 | file.write(' PHYSICS->mcConfig().AddHadronicId(310);\n') | ||
841 | 231 | file.write(' PHYSICS->mcConfig().AddHadronicId(311);\n') | ||
842 | 232 | file.write(' PHYSICS->mcConfig().AddHadronicId(313);\n') | ||
843 | 233 | file.write(' PHYSICS->mcConfig().AddHadronicId(315);\n') | ||
844 | 234 | file.write(' PHYSICS->mcConfig().AddHadronicId(321);\n') | ||
845 | 235 | file.write(' PHYSICS->mcConfig().AddHadronicId(323);\n') | ||
846 | 236 | file.write(' PHYSICS->mcConfig().AddHadronicId(325);\n') | ||
847 | 237 | file.write(' PHYSICS->mcConfig().AddHadronicId(331);\n') | ||
848 | 238 | file.write(' PHYSICS->mcConfig().AddHadronicId(333);\n') | ||
849 | 239 | file.write(' PHYSICS->mcConfig().AddHadronicId(335);\n') | ||
850 | 240 | file.write(' PHYSICS->mcConfig().AddHadronicId(411);\n') | ||
851 | 241 | file.write(' PHYSICS->mcConfig().AddHadronicId(413);\n') | ||
852 | 242 | file.write(' PHYSICS->mcConfig().AddHadronicId(415);\n') | ||
853 | 243 | file.write(' PHYSICS->mcConfig().AddHadronicId(421);\n') | ||
854 | 244 | file.write(' PHYSICS->mcConfig().AddHadronicId(423);\n') | ||
855 | 245 | file.write(' PHYSICS->mcConfig().AddHadronicId(425);\n') | ||
856 | 246 | file.write(' PHYSICS->mcConfig().AddHadronicId(431);\n') | ||
857 | 247 | file.write(' PHYSICS->mcConfig().AddHadronicId(433);\n') | ||
858 | 248 | file.write(' PHYSICS->mcConfig().AddHadronicId(435);\n') | ||
859 | 249 | file.write(' PHYSICS->mcConfig().AddHadronicId(441);\n') | ||
860 | 250 | file.write(' PHYSICS->mcConfig().AddHadronicId(443);\n') | ||
861 | 251 | file.write(' PHYSICS->mcConfig().AddHadronicId(445);\n') | ||
862 | 252 | file.write(' PHYSICS->mcConfig().AddHadronicId(511);\n') | ||
863 | 253 | file.write(' PHYSICS->mcConfig().AddHadronicId(513);\n') | ||
864 | 254 | file.write(' PHYSICS->mcConfig().AddHadronicId(515);\n') | ||
865 | 255 | file.write(' PHYSICS->mcConfig().AddHadronicId(521);\n') | ||
866 | 256 | file.write(' PHYSICS->mcConfig().AddHadronicId(523);\n') | ||
867 | 257 | file.write(' PHYSICS->mcConfig().AddHadronicId(525);\n') | ||
868 | 258 | file.write(' PHYSICS->mcConfig().AddHadronicId(531);\n') | ||
869 | 259 | file.write(' PHYSICS->mcConfig().AddHadronicId(533);\n') | ||
870 | 260 | file.write(' PHYSICS->mcConfig().AddHadronicId(535);\n') | ||
871 | 261 | file.write(' PHYSICS->mcConfig().AddHadronicId(541);\n') | ||
872 | 262 | file.write(' PHYSICS->mcConfig().AddHadronicId(543);\n') | ||
873 | 263 | file.write(' PHYSICS->mcConfig().AddHadronicId(545);\n') | ||
874 | 264 | file.write(' PHYSICS->mcConfig().AddHadronicId(551);\n') | ||
875 | 265 | file.write(' PHYSICS->mcConfig().AddHadronicId(553);\n') | ||
876 | 266 | file.write(' PHYSICS->mcConfig().AddHadronicId(555);\n') | ||
877 | 267 | file.write(' PHYSICS->mcConfig().AddHadronicId(1103);\n') | ||
878 | 268 | file.write(' PHYSICS->mcConfig().AddHadronicId(1114);\n') | ||
879 | 269 | file.write(' PHYSICS->mcConfig().AddHadronicId(2101);\n') | ||
880 | 270 | file.write(' PHYSICS->mcConfig().AddHadronicId(2103);\n') | ||
881 | 271 | file.write(' PHYSICS->mcConfig().AddHadronicId(2112);\n') | ||
882 | 272 | file.write(' PHYSICS->mcConfig().AddHadronicId(2114);\n') | ||
883 | 273 | file.write(' PHYSICS->mcConfig().AddHadronicId(2203);\n') | ||
884 | 274 | file.write(' PHYSICS->mcConfig().AddHadronicId(2212);\n') | ||
885 | 275 | file.write(' PHYSICS->mcConfig().AddHadronicId(2214);\n') | ||
886 | 276 | file.write(' PHYSICS->mcConfig().AddHadronicId(2224);\n') | ||
887 | 277 | file.write(' PHYSICS->mcConfig().AddHadronicId(3101);\n') | ||
888 | 278 | file.write(' PHYSICS->mcConfig().AddHadronicId(3103);\n') | ||
889 | 279 | file.write(' PHYSICS->mcConfig().AddHadronicId(3112);\n') | ||
890 | 280 | file.write(' PHYSICS->mcConfig().AddHadronicId(3114);\n') | ||
891 | 281 | file.write(' PHYSICS->mcConfig().AddHadronicId(3122);\n') | ||
892 | 282 | file.write(' PHYSICS->mcConfig().AddHadronicId(3201);\n') | ||
893 | 283 | file.write(' PHYSICS->mcConfig().AddHadronicId(3203);\n') | ||
894 | 284 | file.write(' PHYSICS->mcConfig().AddHadronicId(3212);\n') | ||
895 | 285 | file.write(' PHYSICS->mcConfig().AddHadronicId(3214);\n') | ||
896 | 286 | file.write(' PHYSICS->mcConfig().AddHadronicId(3222);\n') | ||
897 | 287 | file.write(' PHYSICS->mcConfig().AddHadronicId(3224);\n') | ||
898 | 288 | file.write(' PHYSICS->mcConfig().AddHadronicId(3303);\n') | ||
899 | 289 | file.write(' PHYSICS->mcConfig().AddHadronicId(3312);\n') | ||
900 | 290 | file.write(' PHYSICS->mcConfig().AddHadronicId(3314);\n') | ||
901 | 291 | file.write(' PHYSICS->mcConfig().AddHadronicId(3322);\n') | ||
902 | 292 | file.write(' PHYSICS->mcConfig().AddHadronicId(3324);\n') | ||
903 | 293 | file.write(' PHYSICS->mcConfig().AddHadronicId(3334);\n') | ||
904 | 294 | file.write(' PHYSICS->mcConfig().AddHadronicId(4101);\n') | ||
905 | 295 | file.write(' PHYSICS->mcConfig().AddHadronicId(4103);\n') | ||
906 | 296 | file.write(' PHYSICS->mcConfig().AddHadronicId(4112);\n') | ||
907 | 297 | file.write(' PHYSICS->mcConfig().AddHadronicId(4114);\n') | ||
908 | 298 | file.write(' PHYSICS->mcConfig().AddHadronicId(4122);\n') | ||
909 | 299 | file.write(' PHYSICS->mcConfig().AddHadronicId(4132);\n') | ||
910 | 300 | file.write(' PHYSICS->mcConfig().AddHadronicId(4201);\n') | ||
911 | 301 | file.write(' PHYSICS->mcConfig().AddHadronicId(4203);\n') | ||
912 | 302 | file.write(' PHYSICS->mcConfig().AddHadronicId(4212);\n') | ||
913 | 303 | file.write(' PHYSICS->mcConfig().AddHadronicId(4214);\n') | ||
914 | 304 | file.write(' PHYSICS->mcConfig().AddHadronicId(4222);\n') | ||
915 | 305 | file.write(' PHYSICS->mcConfig().AddHadronicId(4224);\n') | ||
916 | 306 | file.write(' PHYSICS->mcConfig().AddHadronicId(4232);\n') | ||
917 | 307 | file.write(' PHYSICS->mcConfig().AddHadronicId(4301);\n') | ||
918 | 308 | file.write(' PHYSICS->mcConfig().AddHadronicId(4303);\n') | ||
919 | 309 | file.write(' PHYSICS->mcConfig().AddHadronicId(4312);\n') | ||
920 | 310 | file.write(' PHYSICS->mcConfig().AddHadronicId(4314);\n') | ||
921 | 311 | file.write(' PHYSICS->mcConfig().AddHadronicId(4322);\n') | ||
922 | 312 | file.write(' PHYSICS->mcConfig().AddHadronicId(4324);\n') | ||
923 | 313 | file.write(' PHYSICS->mcConfig().AddHadronicId(4332);\n') | ||
924 | 314 | file.write(' PHYSICS->mcConfig().AddHadronicId(4334);\n') | ||
925 | 315 | file.write(' PHYSICS->mcConfig().AddHadronicId(4403);\n') | ||
926 | 316 | file.write(' PHYSICS->mcConfig().AddHadronicId(4412);\n') | ||
927 | 317 | file.write(' PHYSICS->mcConfig().AddHadronicId(4414);\n') | ||
928 | 318 | file.write(' PHYSICS->mcConfig().AddHadronicId(4422);\n') | ||
929 | 319 | file.write(' PHYSICS->mcConfig().AddHadronicId(4424);\n') | ||
930 | 320 | file.write(' PHYSICS->mcConfig().AddHadronicId(4432);\n') | ||
931 | 321 | file.write(' PHYSICS->mcConfig().AddHadronicId(4434);\n') | ||
932 | 322 | file.write(' PHYSICS->mcConfig().AddHadronicId(4444);\n') | ||
933 | 323 | file.write(' PHYSICS->mcConfig().AddHadronicId(5101);\n') | ||
934 | 324 | file.write(' PHYSICS->mcConfig().AddHadronicId(5103);\n') | ||
935 | 325 | file.write(' PHYSICS->mcConfig().AddHadronicId(5112);\n') | ||
936 | 326 | file.write(' PHYSICS->mcConfig().AddHadronicId(5114);\n') | ||
937 | 327 | file.write(' PHYSICS->mcConfig().AddHadronicId(5122);\n') | ||
938 | 328 | file.write(' PHYSICS->mcConfig().AddHadronicId(5132);\n') | ||
939 | 329 | file.write(' PHYSICS->mcConfig().AddHadronicId(5142);\n') | ||
940 | 330 | file.write(' PHYSICS->mcConfig().AddHadronicId(5201);\n') | ||
941 | 331 | file.write(' PHYSICS->mcConfig().AddHadronicId(5203);\n') | ||
942 | 332 | file.write(' PHYSICS->mcConfig().AddHadronicId(5212);\n') | ||
943 | 333 | file.write(' PHYSICS->mcConfig().AddHadronicId(5214);\n') | ||
944 | 334 | file.write(' PHYSICS->mcConfig().AddHadronicId(5222);\n') | ||
945 | 335 | file.write(' PHYSICS->mcConfig().AddHadronicId(5224);\n') | ||
946 | 336 | file.write(' PHYSICS->mcConfig().AddHadronicId(5232);\n') | ||
947 | 337 | file.write(' PHYSICS->mcConfig().AddHadronicId(5242);\n') | ||
948 | 338 | file.write(' PHYSICS->mcConfig().AddHadronicId(5301);\n') | ||
949 | 339 | file.write(' PHYSICS->mcConfig().AddHadronicId(5303);\n') | ||
950 | 340 | file.write(' PHYSICS->mcConfig().AddHadronicId(5312);\n') | ||
951 | 341 | file.write(' PHYSICS->mcConfig().AddHadronicId(5314);\n') | ||
952 | 342 | file.write(' PHYSICS->mcConfig().AddHadronicId(5322);\n') | ||
953 | 343 | file.write(' PHYSICS->mcConfig().AddHadronicId(5324);\n') | ||
954 | 344 | file.write(' PHYSICS->mcConfig().AddHadronicId(5332);\n') | ||
955 | 345 | file.write(' PHYSICS->mcConfig().AddHadronicId(5334);\n') | ||
956 | 346 | file.write(' PHYSICS->mcConfig().AddHadronicId(5342);\n') | ||
957 | 347 | file.write(' PHYSICS->mcConfig().AddHadronicId(5401);\n') | ||
958 | 348 | file.write(' PHYSICS->mcConfig().AddHadronicId(5403);\n') | ||
959 | 349 | file.write(' PHYSICS->mcConfig().AddHadronicId(5412);\n') | ||
960 | 350 | file.write(' PHYSICS->mcConfig().AddHadronicId(5414);\n') | ||
961 | 351 | file.write(' PHYSICS->mcConfig().AddHadronicId(5422);\n') | ||
962 | 352 | file.write(' PHYSICS->mcConfig().AddHadronicId(5424);\n') | ||
963 | 353 | file.write(' PHYSICS->mcConfig().AddHadronicId(5432);\n') | ||
964 | 354 | file.write(' PHYSICS->mcConfig().AddHadronicId(5434);\n') | ||
965 | 355 | file.write(' PHYSICS->mcConfig().AddHadronicId(5442);\n') | ||
966 | 356 | file.write(' PHYSICS->mcConfig().AddHadronicId(5444);\n') | ||
967 | 357 | file.write(' PHYSICS->mcConfig().AddHadronicId(5503);\n') | ||
968 | 358 | file.write(' PHYSICS->mcConfig().AddHadronicId(5512);\n') | ||
969 | 359 | file.write(' PHYSICS->mcConfig().AddHadronicId(5514);\n') | ||
970 | 360 | file.write(' PHYSICS->mcConfig().AddHadronicId(5522);\n') | ||
971 | 361 | file.write(' PHYSICS->mcConfig().AddHadronicId(5524);\n') | ||
972 | 362 | file.write(' PHYSICS->mcConfig().AddHadronicId(5532);\n') | ||
973 | 363 | file.write(' PHYSICS->mcConfig().AddHadronicId(5534);\n') | ||
974 | 364 | file.write(' PHYSICS->mcConfig().AddHadronicId(5542);\n') | ||
975 | 365 | file.write(' PHYSICS->mcConfig().AddHadronicId(5544);\n') | ||
976 | 366 | file.write(' PHYSICS->mcConfig().AddHadronicId(5554);\n') | ||
977 | 367 | file.write(' PHYSICS->mcConfig().AddHadronicId(10111);\n') | ||
978 | 368 | file.write(' PHYSICS->mcConfig().AddHadronicId(10113);\n') | ||
979 | 369 | file.write(' PHYSICS->mcConfig().AddHadronicId(10211);\n') | ||
980 | 370 | file.write(' PHYSICS->mcConfig().AddHadronicId(10213);\n') | ||
981 | 371 | file.write(' PHYSICS->mcConfig().AddHadronicId(10221);\n') | ||
982 | 372 | file.write(' PHYSICS->mcConfig().AddHadronicId(10223);\n') | ||
983 | 373 | file.write(' PHYSICS->mcConfig().AddHadronicId(10311);\n') | ||
984 | 374 | file.write(' PHYSICS->mcConfig().AddHadronicId(10313);\n') | ||
985 | 375 | file.write(' PHYSICS->mcConfig().AddHadronicId(10321);\n') | ||
986 | 376 | file.write(' PHYSICS->mcConfig().AddHadronicId(10323);\n') | ||
987 | 377 | file.write(' PHYSICS->mcConfig().AddHadronicId(10331);\n') | ||
988 | 378 | file.write(' PHYSICS->mcConfig().AddHadronicId(10333);\n') | ||
989 | 379 | file.write(' PHYSICS->mcConfig().AddHadronicId(10411);\n') | ||
990 | 380 | file.write(' PHYSICS->mcConfig().AddHadronicId(10413);\n') | ||
991 | 381 | file.write(' PHYSICS->mcConfig().AddHadronicId(10421);\n') | ||
992 | 382 | file.write(' PHYSICS->mcConfig().AddHadronicId(10423);\n') | ||
993 | 383 | file.write(' PHYSICS->mcConfig().AddHadronicId(10431);\n') | ||
994 | 384 | file.write(' PHYSICS->mcConfig().AddHadronicId(10433);\n') | ||
995 | 385 | file.write(' PHYSICS->mcConfig().AddHadronicId(10441);\n') | ||
996 | 386 | file.write(' PHYSICS->mcConfig().AddHadronicId(10443);\n') | ||
997 | 387 | file.write(' PHYSICS->mcConfig().AddHadronicId(10511);\n') | ||
998 | 388 | file.write(' PHYSICS->mcConfig().AddHadronicId(10513);\n') | ||
999 | 389 | file.write(' PHYSICS->mcConfig().AddHadronicId(10521);\n') | ||
1000 | 390 | file.write(' PHYSICS->mcConfig().AddHadronicId(10523);\n') | ||
1001 | 391 | file.write(' PHYSICS->mcConfig().AddHadronicId(10531);\n') | ||
1002 | 392 | file.write(' PHYSICS->mcConfig().AddHadronicId(10533);\n') | ||
1003 | 393 | file.write(' PHYSICS->mcConfig().AddHadronicId(10541);\n') | ||
1004 | 394 | file.write(' PHYSICS->mcConfig().AddHadronicId(10543);\n') | ||
1005 | 395 | file.write(' PHYSICS->mcConfig().AddHadronicId(10551);\n') | ||
1006 | 396 | file.write(' PHYSICS->mcConfig().AddHadronicId(10553);\n') | ||
1007 | 397 | file.write(' PHYSICS->mcConfig().AddHadronicId(20113);\n') | ||
1008 | 398 | file.write(' PHYSICS->mcConfig().AddHadronicId(20213);\n') | ||
1009 | 399 | file.write(' PHYSICS->mcConfig().AddHadronicId(20223);\n') | ||
1010 | 400 | file.write(' PHYSICS->mcConfig().AddHadronicId(20313);\n') | ||
1011 | 401 | file.write(' PHYSICS->mcConfig().AddHadronicId(20323);\n') | ||
1012 | 402 | file.write(' PHYSICS->mcConfig().AddHadronicId(20333);\n') | ||
1013 | 403 | file.write(' PHYSICS->mcConfig().AddHadronicId(20413);\n') | ||
1014 | 404 | file.write(' PHYSICS->mcConfig().AddHadronicId(20423);\n') | ||
1015 | 405 | file.write(' PHYSICS->mcConfig().AddHadronicId(20433);\n') | ||
1016 | 406 | file.write(' PHYSICS->mcConfig().AddHadronicId(20443);\n') | ||
1017 | 407 | file.write(' PHYSICS->mcConfig().AddHadronicId(20513);\n') | ||
1018 | 408 | file.write(' PHYSICS->mcConfig().AddHadronicId(20523);\n') | ||
1019 | 409 | file.write(' PHYSICS->mcConfig().AddHadronicId(20533);\n') | ||
1020 | 410 | file.write(' PHYSICS->mcConfig().AddHadronicId(20543);\n') | ||
1021 | 411 | file.write(' PHYSICS->mcConfig().AddHadronicId(20553);\n') | ||
1022 | 412 | file.write(' PHYSICS->mcConfig().AddHadronicId(100443);\n') | ||
1023 | 413 | file.write(' PHYSICS->mcConfig().AddHadronicId(100553);\n') | ||
1024 | 414 | file.write(' PHYSICS->mcConfig().AddHadronicId(9900440);\n') | ||
1025 | 415 | file.write(' PHYSICS->mcConfig().AddHadronicId(9900441);\n') | ||
1026 | 416 | file.write(' PHYSICS->mcConfig().AddHadronicId(9900443);\n') | ||
1027 | 417 | file.write(' PHYSICS->mcConfig().AddHadronicId(9900551);\n') | ||
1028 | 418 | file.write(' PHYSICS->mcConfig().AddHadronicId(9900553);\n') | ||
1029 | 419 | file.write(' PHYSICS->mcConfig().AddHadronicId(9910441);\n') | ||
1030 | 420 | file.write(' PHYSICS->mcConfig().AddHadronicId(9910551);\n') | ||
1031 | 421 | file.write('\n') | ||
1032 | 422 | file.write(' // definition of the multiparticle "invisible"\n') | ||
1033 | 423 | file.write(' PHYSICS->mcConfig().AddInvisibleId(-16);\n') | ||
1034 | 424 | file.write(' PHYSICS->mcConfig().AddInvisibleId(-14);\n') | ||
1035 | 425 | file.write(' PHYSICS->mcConfig().AddInvisibleId(-12);\n') | ||
1036 | 426 | file.write(' PHYSICS->mcConfig().AddInvisibleId(12);\n') | ||
1037 | 427 | file.write(' PHYSICS->mcConfig().AddInvisibleId(14);\n') | ||
1038 | 428 | file.write(' PHYSICS->mcConfig().AddInvisibleId(16);\n') | ||
1039 | 429 | file.write(' PHYSICS->mcConfig().AddInvisibleId(1000022);\n') | ||
1040 | 430 | file.write('\n') | ||
1041 | 431 | |||
1042 | 55 | 432 | ||
1043 | 56 | # recConfig initialization | 433 | # recConfig initialization |
1044 | 57 | if main.mode==MA5RunningType.RECO: | 434 | if main.mode==MA5RunningType.RECO: |
1045 | 58 | 435 | ||
1046 | === modified file 'madanalysis/job/job_plot.py' | |||
1047 | --- madanalysis/job/job_plot.py 2013-05-17 06:19:22 +0000 | |||
1048 | +++ madanalysis/job/job_plot.py 2013-06-13 12:22:26 +0000 | |||
1049 | @@ -88,6 +88,12 @@ | |||
1050 | 88 | # RECO mode | 88 | # RECO mode |
1051 | 89 | else: | 89 | else: |
1052 | 90 | 90 | ||
1053 | 91 | # photons | ||
1054 | 92 | file.write(' for (unsigned int i=0;i<event.rec()->photons().size();i++)\n') | ||
1055 | 93 | file.write(' {\n') | ||
1056 | 94 | file.write(' H'+str(ihisto)+'_->Fill(22,__event_weight__);\n') | ||
1057 | 95 | file.write(' }\n') | ||
1058 | 96 | |||
1059 | 91 | # electrons | 97 | # electrons |
1060 | 92 | file.write(' for (unsigned int i=0;i<event.rec()->electrons().size();i++)\n') | 98 | file.write(' for (unsigned int i=0;i<event.rec()->electrons().size();i++)\n') |
1061 | 93 | file.write(' {\n') | 99 | file.write(' {\n') |
1062 | 94 | 100 | ||
1063 | === modified file 'madanalysis/layout/histogram.py' | |||
1064 | --- madanalysis/layout/histogram.py 2013-05-17 06:19:22 +0000 | |||
1065 | +++ madanalysis/layout/histogram.py 2013-06-13 12:22:26 +0000 | |||
1066 | @@ -24,7 +24,6 @@ | |||
1067 | 24 | 24 | ||
1068 | 25 | from madanalysis.layout.histogram_core import HistogramCore | 25 | from madanalysis.layout.histogram_core import HistogramCore |
1069 | 26 | import logging | 26 | import logging |
1070 | 27 | import numpy | ||
1071 | 28 | 27 | ||
1072 | 29 | 28 | ||
1073 | 30 | class Histogram: | 29 | class Histogram: |
1074 | @@ -49,6 +48,8 @@ | |||
1075 | 49 | 48 | ||
1076 | 50 | def FinalizeReading(self,main,dataset): | 49 | def FinalizeReading(self,main,dataset): |
1077 | 51 | 50 | ||
1078 | 51 | import numpy | ||
1079 | 52 | |||
1080 | 52 | # Statistics | 53 | # Statistics |
1081 | 53 | self.summary.nevents = self.positive.nevents + self.negative.nevents | 54 | self.summary.nevents = self.positive.nevents + self.negative.nevents |
1082 | 54 | self.summary.nentries = self.positive.nentries + self.negative.nentries | 55 | self.summary.nentries = self.positive.nentries + self.negative.nentries |
1083 | 55 | 56 | ||
1084 | === modified file 'madanalysis/layout/histogram_frequency_core.py' | |||
1085 | --- madanalysis/layout/histogram_frequency_core.py 2013-05-17 06:19:22 +0000 | |||
1086 | +++ madanalysis/layout/histogram_frequency_core.py 2013-06-13 12:22:26 +0000 | |||
1087 | @@ -23,11 +23,11 @@ | |||
1088 | 23 | 23 | ||
1089 | 24 | 24 | ||
1090 | 25 | import logging | 25 | import logging |
1091 | 26 | import numpy | ||
1092 | 27 | 26 | ||
1093 | 28 | class HistogramFrequencyCore: | 27 | class HistogramFrequencyCore: |
1094 | 29 | 28 | ||
1095 | 30 | def __init__(self): | 29 | def __init__(self): |
1096 | 30 | import numpy | ||
1097 | 31 | self.integral = 0 | 31 | self.integral = 0 |
1098 | 32 | self.nevents = 0 | 32 | self.nevents = 0 |
1099 | 33 | self.entries = 0 | 33 | self.entries = 0 |
1100 | 34 | 34 | ||
1101 | === modified file 'madanalysis/layout/plotflow.py' | |||
1102 | --- madanalysis/layout/plotflow.py 2013-05-17 06:19:22 +0000 | |||
1103 | +++ madanalysis/layout/plotflow.py 2013-06-13 12:22:26 +0000 | |||
1104 | @@ -164,7 +164,6 @@ | |||
1105 | 164 | 164 | ||
1106 | 165 | # Loop over datasets and histos | 165 | # Loop over datasets and histos |
1107 | 166 | for ind in range(0,len(histos)): | 166 | for ind in range(0,len(histos)): |
1108 | 167 | |||
1109 | 168 | # Scaling | 167 | # Scaling |
1110 | 169 | histos[ind].Scale(scales[ind]) | 168 | histos[ind].Scale(scales[ind]) |
1111 | 170 | 169 | ||
1112 | @@ -396,7 +395,7 @@ | |||
1113 | 396 | stack = THStack("mystack","") | 395 | stack = THStack("mystack","") |
1114 | 397 | ntot = 0 | 396 | ntot = 0 |
1115 | 398 | for item in histos: | 397 | for item in histos: |
1117 | 399 | ntot+=item.GetEntries() | 398 | ntot+=item.Integral() |
1118 | 400 | stack.Add(item) | 399 | stack.Add(item) |
1119 | 401 | 400 | ||
1120 | 402 | # Drawing | 401 | # Drawing |
1121 | 403 | 402 | ||
1122 | === modified file 'tools/SampleAnalyzer/Analyzer/AnalyzerBase.h' | |||
1123 | --- tools/SampleAnalyzer/Analyzer/AnalyzerBase.h 2013-05-17 06:19:22 +0000 | |||
1124 | +++ tools/SampleAnalyzer/Analyzer/AnalyzerBase.h 2013-06-13 12:22:26 +0000 | |||
1125 | @@ -94,10 +94,10 @@ | |||
1126 | 94 | 94 | ||
1127 | 95 | /// Initialize (common part to all analyses) | 95 | /// Initialize (common part to all analyses) |
1128 | 96 | bool PreInitialize(const std::string& outputName, | 96 | bool PreInitialize(const std::string& outputName, |
1130 | 97 | bool weighted_events=false) | 97 | const Configuration* cfg) |
1131 | 98 | { | 98 | { |
1134 | 99 | weighted_events_ = weighted_events; | 99 | weighted_events_ = cfg->IsNoEventWeight(); |
1135 | 100 | out_.Initialize(outputName.c_str()); | 100 | out_.Initialize(cfg,outputName.c_str()); |
1136 | 101 | return true; | 101 | return true; |
1137 | 102 | } | 102 | } |
1138 | 103 | 103 | ||
1139 | 104 | 104 | ||
1140 | === modified file 'tools/SampleAnalyzer/Analyzer/MergingPlots.cpp' | |||
1141 | --- tools/SampleAnalyzer/Analyzer/MergingPlots.cpp 2013-05-17 06:19:22 +0000 | |||
1142 | +++ tools/SampleAnalyzer/Analyzer/MergingPlots.cpp 2013-06-13 12:22:26 +0000 | |||
1143 | @@ -27,6 +27,7 @@ | |||
1144 | 27 | #include "SampleAnalyzer/Analyzer/MergingPlots.h" | 27 | #include "SampleAnalyzer/Analyzer/MergingPlots.h" |
1145 | 28 | #include "SampleAnalyzer/Core/Configuration.h" | 28 | #include "SampleAnalyzer/Core/Configuration.h" |
1146 | 29 | #include "SampleAnalyzer/Service/Physics.h" | 29 | #include "SampleAnalyzer/Service/Physics.h" |
1147 | 30 | #include "SampleAnalyzer/Service/CompilationService.h" | ||
1148 | 30 | 31 | ||
1149 | 31 | //STL headers | 32 | //STL headers |
1150 | 32 | #include <sstream> | 33 | #include <sstream> |
1151 | @@ -201,6 +202,7 @@ | |||
1152 | 201 | void MergingPlots::ExtractDJRwithFortran(const std::vector<fastjet::PseudoJet>& inputs,std::vector<Double_t>& DJRvalues) | 202 | void MergingPlots::ExtractDJRwithFortran(const std::vector<fastjet::PseudoJet>& inputs,std::vector<Double_t>& DJRvalues) |
1153 | 202 | { | 203 | { |
1154 | 203 | double PP[512][4]; | 204 | double PP[512][4]; |
1155 | 205 | UNUSED(PP); | ||
1156 | 204 | for (unsigned int i=0;i<inputs.size();i++) | 206 | for (unsigned int i=0;i<inputs.size();i++) |
1157 | 205 | { | 207 | { |
1158 | 206 | PP[i][0]=inputs[i].px(); | 208 | PP[i][0]=inputs[i].px(); |
1159 | 207 | 209 | ||
1160 | === modified file 'tools/SampleAnalyzer/Core/Configuration.cpp' | |||
1161 | --- tools/SampleAnalyzer/Core/Configuration.cpp 2013-05-17 06:19:22 +0000 | |||
1162 | +++ tools/SampleAnalyzer/Core/Configuration.cpp 2013-06-13 12:22:26 +0000 | |||
1163 | @@ -36,6 +36,14 @@ | |||
1164 | 36 | 36 | ||
1165 | 37 | 37 | ||
1166 | 38 | // ----------------------------------------------------------------------------- | 38 | // ----------------------------------------------------------------------------- |
1167 | 39 | // Initializing static data members | ||
1168 | 40 | // ----------------------------------------------------------------------------- | ||
1169 | 41 | // DO NOT TOUCH THESE LINES | ||
1170 | 42 | const std::string Configuration::sampleanalyzer_version_ = "1.1.25"; | ||
1171 | 43 | const std::string Configuration::sampleanalyzer_date_ = "2013/06/13"; | ||
1172 | 44 | // DO NOT TOUCH THESE LINES | ||
1173 | 45 | |||
1174 | 46 | // ----------------------------------------------------------------------------- | ||
1175 | 39 | // PrintSyntax | 47 | // PrintSyntax |
1176 | 40 | // ----------------------------------------------------------------------------- | 48 | // ----------------------------------------------------------------------------- |
1177 | 41 | void Configuration::PrintSyntax() | 49 | void Configuration::PrintSyntax() |
1178 | @@ -94,6 +102,22 @@ | |||
1179 | 94 | // weighted event | 102 | // weighted event |
1180 | 95 | else if (option=="--no_event_weight") no_event_weight_ = true; | 103 | else if (option=="--no_event_weight") no_event_weight_ = true; |
1181 | 96 | 104 | ||
1182 | 105 | // version | ||
1183 | 106 | else if (option.find("--ma5_version=")==0) | ||
1184 | 107 | { | ||
1185 | 108 | std::string stamp = option.substr(14,std::string::npos); | ||
1186 | 109 | std::size_t result = stamp.find(";"); | ||
1187 | 110 | if (result==std::string::npos) | ||
1188 | 111 | { | ||
1189 | 112 | WARNING << "MA5 version '" << stamp << "' is not valid." << std::endl; | ||
1190 | 113 | } | ||
1191 | 114 | else | ||
1192 | 115 | { | ||
1193 | 116 | pythoninterface_version_ = stamp.substr(0,result); | ||
1194 | 117 | pythoninterface_date_ = stamp.substr(result+1,std::string::npos); | ||
1195 | 118 | } | ||
1196 | 119 | } | ||
1197 | 120 | |||
1198 | 97 | // unknown option | 121 | // unknown option |
1199 | 98 | else | 122 | else |
1200 | 99 | { | 123 | { |
1201 | @@ -116,6 +140,13 @@ | |||
1202 | 116 | // ----------------------------------------------------------------------------- | 140 | // ----------------------------------------------------------------------------- |
1203 | 117 | void Configuration::Display() | 141 | void Configuration::Display() |
1204 | 118 | { | 142 | { |
1205 | 143 | INFO << " - version: " << sampleanalyzer_version_ << " (" << sampleanalyzer_date_ << ") "; | ||
1206 | 144 | if ((sampleanalyzer_version_!=pythoninterface_version_ && pythoninterface_version_!="") || | ||
1207 | 145 | (sampleanalyzer_date_!=pythoninterface_date_ && pythoninterface_version_!="")) | ||
1208 | 146 | INFO << "[ python interface version: " << pythoninterface_version_ | ||
1209 | 147 | << " (" << pythoninterface_date_ << ") ]"; | ||
1210 | 148 | INFO << endmsg; | ||
1211 | 149 | |||
1212 | 119 | INFO << " - general: "; | 150 | INFO << " - general: "; |
1213 | 120 | 151 | ||
1214 | 121 | // Is there option ? | 152 | // Is there option ? |
1215 | 122 | 153 | ||
1216 | === modified file 'tools/SampleAnalyzer/Core/Configuration.h' | |||
1217 | --- tools/SampleAnalyzer/Core/Configuration.h 2013-05-17 06:19:22 +0000 | |||
1218 | +++ tools/SampleAnalyzer/Core/Configuration.h 2013-06-13 12:22:26 +0000 | |||
1219 | @@ -44,6 +44,14 @@ | |||
1220 | 44 | // ------------------------------------------------------------- | 44 | // ------------------------------------------------------------- |
1221 | 45 | private: | 45 | private: |
1222 | 46 | 46 | ||
1223 | 47 | /// SampleAnalyzer version | ||
1224 | 48 | static const std::string sampleanalyzer_version_; | ||
1225 | 49 | static const std::string sampleanalyzer_date_; | ||
1226 | 50 | |||
1227 | 51 | /// Python interface version | ||
1228 | 52 | std::string pythoninterface_version_; | ||
1229 | 53 | std::string pythoninterface_date_; | ||
1230 | 54 | |||
1231 | 47 | /// option : check event mode | 55 | /// option : check event mode |
1232 | 48 | Bool_t check_event_; | 56 | Bool_t check_event_; |
1233 | 49 | 57 | ||
1234 | @@ -76,6 +84,22 @@ | |||
1235 | 76 | /// Help message | 84 | /// Help message |
1236 | 77 | void PrintSyntax(); | 85 | void PrintSyntax(); |
1237 | 78 | 86 | ||
1238 | 87 | /// Accessor to the sampleanalyzer date | ||
1239 | 88 | const std::string& GetSampleAnalyzerDate() const | ||
1240 | 89 | {return sampleanalyzer_date_;} | ||
1241 | 90 | |||
1242 | 91 | /// Accessor to the sampleanalyzer version | ||
1243 | 92 | const std::string& GetSampleAnalyzerVersion() const | ||
1244 | 93 | {return sampleanalyzer_version_;} | ||
1245 | 94 | |||
1246 | 95 | /// Accessor to the python interface date | ||
1247 | 96 | const std::string& GetPythonInterfaceDate() const | ||
1248 | 97 | {return sampleanalyzer_date_;} | ||
1249 | 98 | |||
1250 | 99 | /// Accessor to the python interface version | ||
1251 | 100 | const std::string& GetPythonInterfaceVersion() const | ||
1252 | 101 | {return sampleanalyzer_version_;} | ||
1253 | 102 | |||
1254 | 79 | /// Accessor to the input name | 103 | /// Accessor to the input name |
1255 | 80 | const std::string& GetInputFileName() const | 104 | const std::string& GetInputFileName() const |
1256 | 81 | {return input_list_name_;} | 105 | {return input_list_name_;} |
1257 | 82 | 106 | ||
1258 | === modified file 'tools/SampleAnalyzer/Core/ProgressBar.cpp' | |||
1259 | --- tools/SampleAnalyzer/Core/ProgressBar.cpp 2013-05-17 06:19:22 +0000 | |||
1260 | +++ tools/SampleAnalyzer/Core/ProgressBar.cpp 2013-06-13 12:22:26 +0000 | |||
1261 | @@ -23,6 +23,8 @@ | |||
1262 | 23 | 23 | ||
1263 | 24 | 24 | ||
1264 | 25 | // STL headers | 25 | // STL headers |
1265 | 26 | #include <cstdlib> | ||
1266 | 27 | |||
1267 | 26 | // SampleAnalyzer headers | 28 | // SampleAnalyzer headers |
1268 | 27 | #include "SampleAnalyzer/Core/ProgressBar.h" | 29 | #include "SampleAnalyzer/Core/ProgressBar.h" |
1269 | 28 | #include "SampleAnalyzer/Service/LogStream.h" | 30 | #include "SampleAnalyzer/Service/LogStream.h" |
1270 | @@ -30,7 +32,7 @@ | |||
1271 | 30 | using namespace MA5; | 32 | using namespace MA5; |
1272 | 31 | 33 | ||
1273 | 32 | 34 | ||
1275 | 33 | const std::string ProgressBar::header(" => progress "); | 35 | const std::string ProgressBar::header(" => progress: "); |
1276 | 34 | 36 | ||
1277 | 35 | 37 | ||
1278 | 36 | // ----------------------------------------------------------------------------- | 38 | // ----------------------------------------------------------------------------- |
1279 | @@ -63,14 +65,22 @@ | |||
1280 | 63 | // std::cout << "eric Indicator_=" << Indicator_ << std::endl; | 65 | // std::cout << "eric Indicator_=" << Indicator_ << std::endl; |
1281 | 64 | 66 | ||
1282 | 65 | /// Saving previous stream buffer related to std::cout | 67 | /// Saving previous stream buffer related to std::cout |
1284 | 66 | oldstreambuf_ = std::cout.rdbuf(); | 68 | oldstreambuf_cout_ = std::cout.rdbuf(); |
1285 | 67 | std::cout.flush(); | 69 | std::cout.flush(); |
1286 | 70 | oldstreambuf_cerr_ = std::cerr.rdbuf(); | ||
1287 | 71 | std::cerr.flush(); | ||
1288 | 72 | oldstreambuf_clog_ = std::clog.rdbuf(); | ||
1289 | 73 | std::clog.flush(); | ||
1290 | 68 | 74 | ||
1291 | 69 | /// Assigning a new stream buffer with spy | 75 | /// Assigning a new stream buffer with spy |
1296 | 70 | newstreambuf_ = new SpyStreamBuffer(oldstreambuf_); | 76 | newstreambuf_cout_ = new SpyStreamBuffer(oldstreambuf_cout_); |
1297 | 71 | std::cout.rdbuf(newstreambuf_); | 77 | std::cout.rdbuf(newstreambuf_cout_); |
1298 | 72 | 78 | ||
1299 | 73 | // std::cout << "muf Indicator_=" << Indicator_ << std::endl; | 79 | newstreambuf_cerr_ = new SpyStreamBuffer(oldstreambuf_cerr_); |
1300 | 80 | std::cout.rdbuf(newstreambuf_cerr_); | ||
1301 | 81 | |||
1302 | 82 | newstreambuf_clog_ = new SpyStreamBuffer(oldstreambuf_clog_); | ||
1303 | 83 | std::cout.rdbuf(newstreambuf_clog_); | ||
1304 | 74 | 84 | ||
1305 | 75 | } | 85 | } |
1306 | 76 | 86 | ||
1307 | @@ -120,22 +130,30 @@ | |||
1308 | 120 | todisplay[ind+1]='>'; | 130 | todisplay[ind+1]='>'; |
1309 | 121 | todisplay[Nstep_+1]=']'; // overwrite the character '>' if ind=Nstep_ | 131 | todisplay[Nstep_+1]=']'; // overwrite the character '>' if ind=Nstep_ |
1310 | 122 | 132 | ||
1311 | 133 | bool newline=false; | ||
1312 | 123 | // Go back to the line ? | 134 | // Go back to the line ? |
1313 | 124 | if (ind!=0 && !FirstTime_) | 135 | if (ind!=0 && !FirstTime_) |
1314 | 125 | { | 136 | { |
1320 | 126 | std::vector<char> last_chars = newstreambuf_->get_last_chars(); | 137 | if (!newstreambuf_cout_->GetProgressBarMode()) newline=true; |
1321 | 127 | if (last_chars[0] != '\n') std::cout << std::endl; | 138 | if (!newstreambuf_cerr_->GetProgressBarMode()) newline=true; |
1322 | 128 | else if (last_chars[5] == 93 && last_chars[4] == 27 && | 139 | if (!newstreambuf_clog_->GetProgressBarMode()) newline=true; |
1318 | 129 | last_chars[3] == 91 && last_chars[2] == 48 && | ||
1319 | 130 | last_chars[1] == 109) std::cout << "\b\r"; | ||
1323 | 131 | } | 140 | } |
1324 | 132 | FirstTime_=false; | ||
1325 | 133 | 141 | ||
1326 | 134 | // Adding header | 142 | // Adding header |
1327 | 143 | unsigned int toremove = (header+todisplay).size(); | ||
1328 | 135 | todisplay = header + "\x1b[34m"+ todisplay + "\x1b[0m"; | 144 | todisplay = header + "\x1b[34m"+ todisplay + "\x1b[0m"; |
1329 | 136 | 145 | ||
1330 | 137 | // Displaying | 146 | // Displaying |
1332 | 138 | std::cout << todisplay << std::endl; | 147 | newstreambuf_cout_->SetProgressBarMode(false); |
1333 | 148 | newstreambuf_cerr_->SetProgressBarMode(false); | ||
1334 | 149 | newstreambuf_clog_->SetProgressBarMode(false); | ||
1335 | 150 | if (newline) std::cout << std::endl; | ||
1336 | 151 | else if (!FirstTime_) std::cout << std::string(toremove,'\b'); | ||
1337 | 152 | std::cout << todisplay; | ||
1338 | 153 | newstreambuf_cout_->SetProgressBarMode(true); | ||
1339 | 154 | newstreambuf_cerr_->SetProgressBarMode(true); | ||
1340 | 155 | newstreambuf_clog_->SetProgressBarMode(true); | ||
1341 | 156 | FirstTime_=false; | ||
1342 | 139 | } | 157 | } |
1343 | 140 | 158 | ||
1344 | 141 | 159 | ||
1345 | @@ -149,11 +167,21 @@ | |||
1346 | 149 | 167 | ||
1347 | 150 | // Display the indicator with a status of 100% ? | 168 | // Display the indicator with a status of 100% ? |
1348 | 151 | if (!MuteEnd_) Display(Nstep_); | 169 | if (!MuteEnd_) Display(Nstep_); |
1349 | 170 | newstreambuf_cout_->SetProgressBarMode(false); | ||
1350 | 171 | newstreambuf_cerr_->SetProgressBarMode(false); | ||
1351 | 172 | newstreambuf_clog_->SetProgressBarMode(false); | ||
1352 | 173 | std::cout << std::endl; | ||
1353 | 152 | 174 | ||
1354 | 153 | // Restoring the initial stream buffer | 175 | // Restoring the initial stream buffer |
1358 | 154 | std::cout.rdbuf(oldstreambuf_); | 176 | std::cout.rdbuf(oldstreambuf_cout_); |
1359 | 155 | oldstreambuf_=0; | 177 | std::cerr.rdbuf(oldstreambuf_cerr_); |
1360 | 156 | if (newstreambuf_!=0) delete newstreambuf_; | 178 | std::clog.rdbuf(oldstreambuf_clog_); |
1361 | 179 | oldstreambuf_cout_=0; | ||
1362 | 180 | oldstreambuf_cerr_=0; | ||
1363 | 181 | oldstreambuf_clog_=0; | ||
1364 | 182 | if (newstreambuf_cout_!=0) delete newstreambuf_cout_; | ||
1365 | 183 | if (newstreambuf_cerr_!=0) delete newstreambuf_cerr_; | ||
1366 | 184 | if (newstreambuf_clog_!=0) delete newstreambuf_clog_; | ||
1367 | 157 | 185 | ||
1368 | 158 | // Reset the progress bar | 186 | // Reset the progress bar |
1369 | 159 | Reset(); | 187 | Reset(); |
1370 | 160 | 188 | ||
1371 | === modified file 'tools/SampleAnalyzer/Core/ProgressBar.h' | |||
1372 | --- tools/SampleAnalyzer/Core/ProgressBar.h 2013-05-17 06:19:22 +0000 | |||
1373 | +++ tools/SampleAnalyzer/Core/ProgressBar.h 2013-06-13 12:22:26 +0000 | |||
1374 | @@ -56,30 +56,36 @@ | |||
1375 | 56 | public: | 56 | public: |
1376 | 57 | 57 | ||
1377 | 58 | /// Constructor | 58 | /// Constructor |
1379 | 59 | SpyStreamBuffer(std::streambuf* buf) : buf(buf) | 59 | SpyStreamBuffer(std::streambuf* buf) : buf_(buf) |
1380 | 60 | { | 60 | { |
1382 | 61 | last_chars.resize(7,traits_type::eof()); | 61 | add_endl_=false; |
1383 | 62 | // no buffering, overflow on every char | 62 | // no buffering, overflow on every char |
1384 | 63 | setp(0, 0); | 63 | setp(0, 0); |
1385 | 64 | } | 64 | } |
1386 | 65 | 65 | ||
1390 | 66 | /// Getting last character | 66 | /// Set ProgressBar mode |
1391 | 67 | const std::vector<char>& get_last_chars() const | 67 | void SetProgressBarMode(bool status=true) |
1392 | 68 | { return last_chars; } | 68 | { add_endl_=status; } |
1393 | 69 | |||
1394 | 70 | /// Accessor to ProgressBar mode status | ||
1395 | 71 | bool GetProgressBarMode() const | ||
1396 | 72 | { return add_endl_; } | ||
1397 | 69 | 73 | ||
1398 | 70 | /// Overflow method | 74 | /// Overflow method |
1399 | 71 | virtual int_type overflow(int_type c) | 75 | virtual int_type overflow(int_type c) |
1400 | 72 | { | 76 | { |
1405 | 73 | buf->sputc(c); | 77 | if (add_endl_) |
1406 | 74 | for (unsigned int i=(last_chars.size()-1);i>0;i--) | 78 | { |
1407 | 75 | last_chars[i]=last_chars[i-1]; | 79 | buf_->sputc('\n'); |
1408 | 76 | last_chars[0] = c; | 80 | add_endl_=false; |
1409 | 81 | } | ||
1410 | 82 | buf_->sputc(c); | ||
1411 | 77 | return c; | 83 | return c; |
1412 | 78 | } | 84 | } |
1413 | 79 | private: | 85 | private: |
1414 | 80 | 86 | ||
1417 | 81 | std::streambuf* buf; | 87 | std::streambuf* buf_; |
1418 | 82 | std::vector<char> last_chars; | 88 | bool add_endl_; |
1419 | 83 | }; | 89 | }; |
1420 | 84 | 90 | ||
1421 | 85 | // ------------------------------------------------------------- | 91 | // ------------------------------------------------------------- |
1422 | @@ -112,10 +118,14 @@ | |||
1423 | 112 | std::vector<Long64_t> Thresholds_; | 118 | std::vector<Long64_t> Thresholds_; |
1424 | 113 | 119 | ||
1425 | 114 | /// Pointer to the new stream buffer | 120 | /// Pointer to the new stream buffer |
1427 | 115 | SpyStreamBuffer* newstreambuf_; | 121 | SpyStreamBuffer* newstreambuf_cout_; |
1428 | 122 | SpyStreamBuffer* newstreambuf_cerr_; | ||
1429 | 123 | SpyStreamBuffer* newstreambuf_clog_; | ||
1430 | 116 | 124 | ||
1431 | 117 | /// Pointer to the old stream buffer | 125 | /// Pointer to the old stream buffer |
1433 | 118 | std::streambuf* oldstreambuf_; | 126 | std::streambuf* oldstreambuf_cout_; |
1434 | 127 | std::streambuf* oldstreambuf_cerr_; | ||
1435 | 128 | std::streambuf* oldstreambuf_clog_; | ||
1436 | 119 | 129 | ||
1437 | 120 | static const std::string header; | 130 | static const std::string header; |
1438 | 121 | 131 | ||
1439 | @@ -127,14 +137,22 @@ | |||
1440 | 127 | /// Constructor without argument | 137 | /// Constructor without argument |
1441 | 128 | ProgressBar() | 138 | ProgressBar() |
1442 | 129 | { | 139 | { |
1445 | 130 | newstreambuf_=0; | 140 | newstreambuf_cout_=0; |
1446 | 131 | oldstreambuf_=0; | 141 | newstreambuf_cerr_=0; |
1447 | 142 | newstreambuf_clog_=0; | ||
1448 | 143 | oldstreambuf_cout_=0; | ||
1449 | 144 | oldstreambuf_cerr_=0; | ||
1450 | 145 | oldstreambuf_clog_=0; | ||
1451 | 132 | Reset(); | 146 | Reset(); |
1452 | 133 | } | 147 | } |
1453 | 134 | 148 | ||
1454 | 135 | /// Destructor | 149 | /// Destructor |
1455 | 136 | ~ProgressBar() | 150 | ~ProgressBar() |
1457 | 137 | { if (newstreambuf_!=0) delete newstreambuf_; } | 151 | { |
1458 | 152 | if (newstreambuf_cout_!=0) delete newstreambuf_cout_; | ||
1459 | 153 | if (newstreambuf_cerr_!=0) delete newstreambuf_cerr_; | ||
1460 | 154 | if (newstreambuf_clog_!=0) delete newstreambuf_clog_; | ||
1461 | 155 | } | ||
1462 | 138 | 156 | ||
1463 | 139 | /// Reset | 157 | /// Reset |
1464 | 140 | void Reset() | 158 | void Reset() |
1465 | 141 | 159 | ||
1466 | === modified file 'tools/SampleAnalyzer/Core/SampleAnalyzer.cpp' | |||
1467 | --- tools/SampleAnalyzer/Core/SampleAnalyzer.cpp 2013-05-17 06:19:22 +0000 | |||
1468 | +++ tools/SampleAnalyzer/Core/SampleAnalyzer.cpp 2013-06-13 12:22:26 +0000 | |||
1469 | @@ -27,15 +27,14 @@ | |||
1470 | 27 | #include "SampleAnalyzer/Writer/SAFWriter.h" | 27 | #include "SampleAnalyzer/Writer/SAFWriter.h" |
1471 | 28 | #include "SampleAnalyzer/Service/ExceptionService.h" | 28 | #include "SampleAnalyzer/Service/ExceptionService.h" |
1472 | 29 | #include "SampleAnalyzer/Service/TimeService.h" | 29 | #include "SampleAnalyzer/Service/TimeService.h" |
1473 | 30 | #include "SampleAnalyzer/Service/Terminate.h" | ||
1474 | 31 | #include "SampleAnalyzer/Service/PDGService.h" | 30 | #include "SampleAnalyzer/Service/PDGService.h" |
1475 | 32 | #include "SampleAnalyzer/Service/Terminate.h" | 31 | #include "SampleAnalyzer/Service/Terminate.h" |
1476 | 32 | #include "SampleAnalyzer/Service/CompilationService.h" | ||
1477 | 33 | 33 | ||
1478 | 34 | 34 | ||
1479 | 35 | using namespace MA5; | 35 | using namespace MA5; |
1480 | 36 | 36 | ||
1483 | 37 | 37 | /// Constructor without arguments | |
1482 | 38 | /// Constructor withtout arguments | ||
1484 | 39 | SampleAnalyzer::SampleAnalyzer() | 38 | SampleAnalyzer::SampleAnalyzer() |
1485 | 40 | { | 39 | { |
1486 | 41 | // Initializing service | 40 | // Initializing service |
1487 | @@ -49,7 +48,7 @@ | |||
1488 | 49 | progressBar_=0; | 48 | progressBar_=0; |
1489 | 50 | 49 | ||
1490 | 51 | // Header | 50 | // Header |
1492 | 52 | INFO << " * SampleAnalyzer 2.0 for MadAnalysis 5 - Welcome."; | 51 | INFO << " * SampleAnalyzer for MadAnalysis 5 - Welcome."; |
1493 | 53 | INFO << endmsg; | 52 | INFO << endmsg; |
1494 | 54 | 53 | ||
1495 | 55 | } | 54 | } |
1496 | @@ -74,7 +73,7 @@ | |||
1497 | 74 | std::string filename = cfg_.GetInputListName(); | 73 | std::string filename = cfg_.GetInputListName(); |
1498 | 75 | 74 | ||
1499 | 76 | // Checks if a file has been provided | 75 | // Checks if a file has been provided |
1501 | 77 | INFO << " - extracting event samples..." << endmsg; | 76 | INFO << " - extracting the list of event samples..." << endmsg; |
1502 | 78 | std::ifstream input(filename.c_str()); | 77 | std::ifstream input(filename.c_str()); |
1503 | 79 | if (!input) | 78 | if (!input) |
1504 | 80 | { | 79 | { |
1505 | @@ -151,7 +150,7 @@ | |||
1506 | 151 | 150 | ||
1507 | 152 | // Initialize (common part to all analyses) | 151 | // Initialize (common part to all analyses) |
1508 | 153 | if (!myAnalysis->PreInitialize(outputname, | 152 | if (!myAnalysis->PreInitialize(outputname, |
1510 | 154 | cfg_.IsNoEventWeight())) | 153 | &cfg_)) |
1511 | 155 | { | 154 | { |
1512 | 156 | ERROR << "problem during the pre-initialization of the analysis called '" | 155 | ERROR << "problem during the pre-initialization of the analysis called '" |
1513 | 157 | << name << "'" << endmsg; | 156 | << name << "'" << endmsg; |
1514 | @@ -195,7 +194,7 @@ | |||
1515 | 195 | 194 | ||
1516 | 196 | // Initialize (common part to all filters) | 195 | // Initialize (common part to all filters) |
1517 | 197 | if (!myFilter->PreInitialize(outputname, | 196 | if (!myFilter->PreInitialize(outputname, |
1519 | 198 | cfg_.IsNoEventWeight())) | 197 | &cfg_)) |
1520 | 199 | { | 198 | { |
1521 | 200 | ERROR << "problem during the pre-initialization of the filter called '" | 199 | ERROR << "problem during the pre-initialization of the filter called '" |
1522 | 201 | << name << "'" << endmsg; | 200 | << name << "'" << endmsg; |
1523 | @@ -237,7 +236,7 @@ | |||
1524 | 237 | writers_.push_back(myWriter); | 236 | writers_.push_back(myWriter); |
1525 | 238 | 237 | ||
1526 | 239 | // Initializing | 238 | // Initializing |
1528 | 240 | if (!myWriter->Initialize(outputname)) | 239 | if (!myWriter->Initialize(&cfg_,outputname)) |
1529 | 241 | { | 240 | { |
1530 | 242 | ERROR << "problem during the initialization of the writer called '" | 241 | ERROR << "problem during the initialization of the writer called '" |
1531 | 243 | << name << "'" << endmsg; | 242 | << name << "'" << endmsg; |
1532 | @@ -302,6 +301,10 @@ | |||
1533 | 302 | if (progressBar_!=0) | 301 | if (progressBar_!=0) |
1534 | 303 | { | 302 | { |
1535 | 304 | progressBar_->Finalize(); | 303 | progressBar_->Finalize(); |
1536 | 304 | INFO << " => total number of events: " << counter_read_[file_index_-1] | ||
1537 | 305 | << " ( analyzed: " << counter_passed_[file_index_-1] | ||
1538 | 306 | << " ; skipped: " << counter_read_[file_index_-1] - counter_passed_[file_index_-1] | ||
1539 | 307 | << " ) " << endmsg; | ||
1540 | 305 | } | 308 | } |
1541 | 306 | 309 | ||
1542 | 307 | // Next file | 310 | // Next file |
1543 | 308 | 311 | ||
1544 | === modified file 'tools/SampleAnalyzer/Core/xdr_istream.cpp' | |||
1545 | --- tools/SampleAnalyzer/Core/xdr_istream.cpp 2013-05-17 06:19:22 +0000 | |||
1546 | +++ tools/SampleAnalyzer/Core/xdr_istream.cpp 2013-06-13 12:22:26 +0000 | |||
1547 | @@ -115,7 +115,7 @@ | |||
1548 | 115 | { | 115 | { |
1549 | 116 | if (eof()) return (*this); | 116 | if (eof()) return (*this); |
1550 | 117 | 117 | ||
1552 | 118 | UInt_t n; | 118 | UInt_t n=0; |
1553 | 119 | (*this)>>n; | 119 | (*this)>>n; |
1554 | 120 | Float_t* vp = reinterpret_cast<Float_t*>(&n); | 120 | Float_t* vp = reinterpret_cast<Float_t*>(&n); |
1555 | 121 | v=*vp; | 121 | v=*vp; |
1556 | @@ -130,7 +130,7 @@ | |||
1557 | 130 | { | 130 | { |
1558 | 131 | if (eof()) return (*this); | 131 | if (eof()) return (*this); |
1559 | 132 | 132 | ||
1561 | 133 | ULong64_t n; | 133 | ULong64_t n=0; |
1562 | 134 | (*this)>>n; | 134 | (*this)>>n; |
1563 | 135 | Double_t* vp = reinterpret_cast<Double_t*>(&n); | 135 | Double_t* vp = reinterpret_cast<Double_t*>(&n); |
1564 | 136 | v=*vp; | 136 | v=*vp; |
1565 | 137 | 137 | ||
1566 | === modified file 'tools/SampleAnalyzer/DataFormat/MCParticleFormat.h' | |||
1567 | --- tools/SampleAnalyzer/DataFormat/MCParticleFormat.h 2013-05-17 06:19:22 +0000 | |||
1568 | +++ tools/SampleAnalyzer/DataFormat/MCParticleFormat.h 2013-06-13 12:22:26 +0000 | |||
1569 | @@ -70,7 +70,8 @@ | |||
1570 | 70 | /// 2 intermediate state, 1 final state) | 70 | /// 2 intermediate state, 1 final state) |
1571 | 71 | UInt_t mothup1_; /// first mother index | 71 | UInt_t mothup1_; /// first mother index |
1572 | 72 | UInt_t mothup2_; /// second mother index | 72 | UInt_t mothup2_; /// second mother index |
1574 | 73 | Int_t extra_; | 73 | Int_t extra1_; |
1575 | 74 | Int_t extra2_; | ||
1576 | 74 | 75 | ||
1577 | 75 | std::vector<MCParticleFormat*> Daughters_; | 76 | std::vector<MCParticleFormat*> Daughters_; |
1578 | 76 | 77 | ||
1579 | @@ -96,7 +97,8 @@ | |||
1580 | 96 | { | 97 | { |
1581 | 97 | momentum_.SetPxPyPzE(0.,0.,0.,0.); | 98 | momentum_.SetPxPyPzE(0.,0.,0.,0.); |
1582 | 98 | ctau_=0.; spin_=0.; pdgid_=0; | 99 | ctau_=0.; spin_=0.; pdgid_=0; |
1584 | 99 | statuscode_=0; mothup1_=0; mothup2_=0; mother1_=0; mother2_=0; extra_=0; | 100 | statuscode_=0; mothup1_=0; mothup2_=0; mother1_=0; mother2_=0; |
1585 | 101 | extra1_=0; extra2_=0; | ||
1586 | 100 | } | 102 | } |
1587 | 101 | 103 | ||
1588 | 102 | /// Print particle informations | 104 | /// Print particle informations |
1589 | 103 | 105 | ||
1590 | === modified file 'tools/SampleAnalyzer/DataFormat/RecEventFormat.h' | |||
1591 | --- tools/SampleAnalyzer/DataFormat/RecEventFormat.h 2013-05-17 06:19:22 +0000 | |||
1592 | +++ tools/SampleAnalyzer/DataFormat/RecEventFormat.h 2013-06-13 12:22:26 +0000 | |||
1593 | @@ -48,6 +48,7 @@ | |||
1594 | 48 | class ROOTReader; | 48 | class ROOTReader; |
1595 | 49 | class TauTagger; | 49 | class TauTagger; |
1596 | 50 | class bTagger; | 50 | class bTagger; |
1597 | 51 | class JetClusteringFastJet; | ||
1598 | 51 | 52 | ||
1599 | 52 | class RecEventFormat | 53 | class RecEventFormat |
1600 | 53 | { | 54 | { |
1601 | @@ -56,6 +57,7 @@ | |||
1602 | 56 | friend class ROOTReader; | 57 | friend class ROOTReader; |
1603 | 57 | friend class TauTagger; | 58 | friend class TauTagger; |
1604 | 58 | friend class bTagger; | 59 | friend class bTagger; |
1605 | 60 | friend class JetClusteringFastJet; | ||
1606 | 59 | 61 | ||
1607 | 60 | // ------------------------------------------------------------- | 62 | // ------------------------------------------------------------- |
1608 | 61 | // data members | 63 | // data members |
1609 | @@ -90,19 +92,19 @@ | |||
1610 | 90 | Double_t THT_; | 92 | Double_t THT_; |
1611 | 91 | 93 | ||
1612 | 92 | /// Monte Carlo taus decaying hadronically | 94 | /// Monte Carlo taus decaying hadronically |
1614 | 93 | std::vector<MCParticleFormat*> MCHadronicTaus_; | 95 | std::vector<const MCParticleFormat*> MCHadronicTaus_; |
1615 | 94 | 96 | ||
1616 | 95 | /// Monte Carlo taus decaying into muon | 97 | /// Monte Carlo taus decaying into muon |
1618 | 96 | std::vector<MCParticleFormat*> MCMuonicTaus_; | 98 | std::vector<const MCParticleFormat*> MCMuonicTaus_; |
1619 | 97 | 99 | ||
1620 | 98 | /// Monte Carlo taus decaying into electron | 100 | /// Monte Carlo taus decaying into electron |
1622 | 99 | std::vector<MCParticleFormat*> MCElectronicTaus_; | 101 | std::vector<const MCParticleFormat*> MCElectronicTaus_; |
1623 | 100 | 102 | ||
1624 | 101 | /// Monte Carlo b-quarks | 103 | /// Monte Carlo b-quarks |
1626 | 102 | std::vector<MCParticleFormat*> MCBquarks_; | 104 | std::vector<const MCParticleFormat*> MCBquarks_; |
1627 | 103 | 105 | ||
1628 | 104 | /// Monte Carlo c-quarks | 106 | /// Monte Carlo c-quarks |
1630 | 105 | std::vector<MCParticleFormat*> MCCquarks_; | 107 | std::vector<const MCParticleFormat*> MCCquarks_; |
1631 | 106 | 108 | ||
1632 | 107 | 109 | ||
1633 | 108 | // ------------------------------------------------------------- | 110 | // ------------------------------------------------------------- |
1634 | @@ -146,23 +148,23 @@ | |||
1635 | 146 | const Double_t& THT() const {return THT_;} | 148 | const Double_t& THT() const {return THT_;} |
1636 | 147 | 149 | ||
1637 | 148 | /// Accessor to the Monte Carlo taus decaying hadronically | 150 | /// Accessor to the Monte Carlo taus decaying hadronically |
1639 | 149 | const std::vector<MCParticleFormat*>& MCHadronicTaus() const | 151 | const std::vector<const MCParticleFormat*>& MCHadronicTaus() const |
1640 | 150 | {return MCHadronicTaus_;} | 152 | {return MCHadronicTaus_;} |
1641 | 151 | 153 | ||
1642 | 152 | /// Accessor to Monte Carlo taus decaying into muon | 154 | /// Accessor to Monte Carlo taus decaying into muon |
1644 | 153 | const std::vector<MCParticleFormat*>& MCMuonicTaus() const | 155 | const std::vector<const MCParticleFormat*>& MCMuonicTaus() const |
1645 | 154 | {return MCMuonicTaus_;} | 156 | {return MCMuonicTaus_;} |
1646 | 155 | 157 | ||
1647 | 156 | /// Accessor to Monte Carlo taus decaying into electron | 158 | /// Accessor to Monte Carlo taus decaying into electron |
1649 | 157 | const std::vector<MCParticleFormat*>& MCElectronicTaus() const | 159 | const std::vector<const MCParticleFormat*>& MCElectronicTaus() const |
1650 | 158 | {return MCElectronicTaus_;} | 160 | {return MCElectronicTaus_;} |
1651 | 159 | 161 | ||
1652 | 160 | /// Accessor to Monte Carlo b-quarks | 162 | /// Accessor to Monte Carlo b-quarks |
1654 | 161 | const std::vector<MCParticleFormat*>& MCBquarks() const | 163 | const std::vector<const MCParticleFormat*>& MCBquarks() const |
1655 | 162 | {return MCBquarks_;} | 164 | {return MCBquarks_;} |
1656 | 163 | 165 | ||
1657 | 164 | /// Accessor to Monte Carlo c-quarks | 166 | /// Accessor to Monte Carlo c-quarks |
1659 | 165 | const std::vector<MCParticleFormat*>& MCCquarks() const | 167 | const std::vector<const MCParticleFormat*>& MCCquarks() const |
1660 | 166 | {return MCCquarks_;} | 168 | {return MCCquarks_;} |
1661 | 167 | 169 | ||
1662 | 168 | /// Accessor to the electron collection | 170 | /// Accessor to the electron collection |
1663 | @@ -193,23 +195,23 @@ | |||
1664 | 193 | Double_t& THT() {return THT_;} | 195 | Double_t& THT() {return THT_;} |
1665 | 194 | 196 | ||
1666 | 195 | /// Accessor to the Monte Carlo taus decaying hadronically | 197 | /// Accessor to the Monte Carlo taus decaying hadronically |
1668 | 196 | std::vector<MCParticleFormat*>& MCHadronicTaus() | 198 | std::vector<const MCParticleFormat*>& MCHadronicTaus() |
1669 | 197 | {return MCHadronicTaus_;} | 199 | {return MCHadronicTaus_;} |
1670 | 198 | 200 | ||
1671 | 199 | /// Accessor to Monte Carlo taus decaying into muon | 201 | /// Accessor to Monte Carlo taus decaying into muon |
1673 | 200 | std::vector<MCParticleFormat*>& MCMuonicTaus() | 202 | std::vector<const MCParticleFormat*>& MCMuonicTaus() |
1674 | 201 | {return MCMuonicTaus_;} | 203 | {return MCMuonicTaus_;} |
1675 | 202 | 204 | ||
1676 | 203 | /// Accessor to Monte Carlo taus decaying into electron | 205 | /// Accessor to Monte Carlo taus decaying into electron |
1678 | 204 | std::vector<MCParticleFormat*>& MCElectronicTaus() | 206 | std::vector<const MCParticleFormat*>& MCElectronicTaus() |
1679 | 205 | {return MCElectronicTaus_;} | 207 | {return MCElectronicTaus_;} |
1680 | 206 | 208 | ||
1681 | 207 | /// Accessor to Monte Carlo b-quarks | 209 | /// Accessor to Monte Carlo b-quarks |
1683 | 208 | std::vector<MCParticleFormat*>& MCBquarks() | 210 | std::vector<const MCParticleFormat*>& MCBquarks() |
1684 | 209 | {return MCBquarks_;} | 211 | {return MCBquarks_;} |
1685 | 210 | 212 | ||
1686 | 211 | /// Accessor to Monte Carlo c-quarks | 213 | /// Accessor to Monte Carlo c-quarks |
1688 | 212 | std::vector<MCParticleFormat*>& MCCquarks() | 214 | std::vector<const MCParticleFormat*>& MCCquarks() |
1689 | 213 | {return MCCquarks_;} | 215 | {return MCCquarks_;} |
1690 | 214 | 216 | ||
1691 | 215 | /// Clearing all information | 217 | /// Clearing all information |
1692 | 216 | 218 | ||
1693 | === modified file 'tools/SampleAnalyzer/DataFormat/RecParticleFormat.h' | |||
1694 | --- tools/SampleAnalyzer/DataFormat/RecParticleFormat.h 2013-05-17 06:19:22 +0000 | |||
1695 | +++ tools/SampleAnalyzer/DataFormat/RecParticleFormat.h 2013-06-13 12:22:26 +0000 | |||
1696 | @@ -53,7 +53,7 @@ | |||
1697 | 53 | protected: | 53 | protected: |
1698 | 54 | 54 | ||
1699 | 55 | Float_t HEoverEE_; /// hadronic energy over electromagnetic energy | 55 | Float_t HEoverEE_; /// hadronic energy over electromagnetic energy |
1701 | 56 | MCParticleFormat* mc_ ; /// mother generated particle | 56 | const MCParticleFormat* mc_ ; /// mother generated particle |
1702 | 57 | 57 | ||
1703 | 58 | // ------------------------------------------------------------- | 58 | // ------------------------------------------------------------- |
1704 | 59 | // method members | 59 | // method members |
1705 | @@ -94,7 +94,7 @@ | |||
1706 | 94 | const MCParticleFormat* mc() const {return mc_;} | 94 | const MCParticleFormat* mc() const {return mc_;} |
1707 | 95 | 95 | ||
1708 | 96 | /// Mutator relatied to matched Monte Carlo particle | 96 | /// Mutator relatied to matched Monte Carlo particle |
1710 | 97 | void setMc(MCParticleFormat* mc) {mc_=mc;} | 97 | void setMc(const MCParticleFormat* mc) {mc_=mc;} |
1711 | 98 | 98 | ||
1712 | 99 | /// Accessor to hadronic energy / electromagnetic energy ratio | 99 | /// Accessor to hadronic energy / electromagnetic energy ratio |
1713 | 100 | const Float_t& HEoverEE() const {return HEoverEE_;} | 100 | const Float_t& HEoverEE() const {return HEoverEE_;} |
1714 | 101 | 101 | ||
1715 | === modified file 'tools/SampleAnalyzer/DataFormat/RecTauFormat.h' | |||
1716 | --- tools/SampleAnalyzer/DataFormat/RecTauFormat.h 2013-05-17 06:19:22 +0000 | |||
1717 | +++ tools/SampleAnalyzer/DataFormat/RecTauFormat.h 2013-06-13 12:22:26 +0000 | |||
1718 | @@ -98,13 +98,25 @@ | |||
1719 | 98 | const Float_t charge() const | 98 | const Float_t charge() const |
1720 | 99 | { if (charge_) return +1.; else return -1.; } | 99 | { if (charge_) return +1.; else return -1.; } |
1721 | 100 | 100 | ||
1722 | 101 | /// Mutator to the electric charge | ||
1723 | 102 | void setCharge(Float_t charge ) | ||
1724 | 103 | { if (charge>0) charge_=true; else charge_=false; } | ||
1725 | 104 | |||
1726 | 101 | /// Accessor to the number of tracks | 105 | /// Accessor to the number of tracks |
1727 | 102 | const UShort_t ntracks() const | 106 | const UShort_t ntracks() const |
1728 | 103 | { return ntracks_; } | 107 | { return ntracks_; } |
1729 | 104 | 108 | ||
1730 | 109 | /// Mutator to the number of tracks | ||
1731 | 110 | void setNtracks(UShort_t ntracks) | ||
1732 | 111 | { ntracks_=ntracks; } | ||
1733 | 112 | |||
1734 | 105 | /// Accessor to the decay mode | 113 | /// Accessor to the decay mode |
1735 | 106 | const Int_t DecayMode() const | 114 | const Int_t DecayMode() const |
1736 | 107 | { return DecayMode_; } | 115 | { return DecayMode_; } |
1737 | 116 | |||
1738 | 117 | /// Mutator to the decay mode | ||
1739 | 118 | void setDecayMode(Int_t mode) | ||
1740 | 119 | { DecayMode_=mode; } | ||
1741 | 108 | }; | 120 | }; |
1742 | 109 | 121 | ||
1743 | 110 | } | 122 | } |
1744 | 111 | 123 | ||
1745 | === modified file 'tools/SampleAnalyzer/Filter/FilterBase.h' | |||
1746 | --- tools/SampleAnalyzer/Filter/FilterBase.h 2013-05-17 06:19:22 +0000 | |||
1747 | +++ tools/SampleAnalyzer/Filter/FilterBase.h 2013-06-13 12:22:26 +0000 | |||
1748 | @@ -93,10 +93,10 @@ | |||
1749 | 93 | 93 | ||
1750 | 94 | /// Initialize (common part to all analyses) | 94 | /// Initialize (common part to all analyses) |
1751 | 95 | bool PreInitialize(const std::string& outputName, | 95 | bool PreInitialize(const std::string& outputName, |
1753 | 96 | bool weighted_events=false) | 96 | const Configuration* cfg) |
1754 | 97 | { | 97 | { |
1755 | 98 | outputName_ = outputName; | 98 | outputName_ = outputName; |
1757 | 99 | weighted_events_ = weighted_events; | 99 | weighted_events_ = cfg->IsNoEventWeight(); |
1758 | 100 | return true; | 100 | return true; |
1759 | 101 | } | 101 | } |
1760 | 102 | 102 | ||
1761 | 103 | 103 | ||
1762 | === modified file 'tools/SampleAnalyzer/JetClustering/JetClustererBase.h' | |||
1763 | --- tools/SampleAnalyzer/JetClustering/JetClustererBase.h 2013-05-17 06:19:22 +0000 | |||
1764 | +++ tools/SampleAnalyzer/JetClustering/JetClustererBase.h 2013-06-13 12:22:26 +0000 | |||
1765 | @@ -55,7 +55,7 @@ | |||
1766 | 55 | /// Is the jet clustering exclusive ? | 55 | /// Is the jet clustering exclusive ? |
1767 | 56 | Bool_t Exclusive_; | 56 | Bool_t Exclusive_; |
1768 | 57 | 57 | ||
1770 | 58 | /// Exclusive id for tau-elec-jet | 58 | /// Exclusive id for tau-elec-photon-jet |
1771 | 59 | Bool_t ExclusiveId_; | 59 | Bool_t ExclusiveId_; |
1772 | 60 | 60 | ||
1773 | 61 | /// Tagger | 61 | /// Tagger |
1774 | @@ -63,6 +63,12 @@ | |||
1775 | 63 | cTagger* myCtagger_; | 63 | cTagger* myCtagger_; |
1776 | 64 | TauTagger* myTAUtagger_; | 64 | TauTagger* myTAUtagger_; |
1777 | 65 | 65 | ||
1778 | 66 | UInt_t muon; | ||
1779 | 67 | UInt_t electron; | ||
1780 | 68 | UInt_t tauH; | ||
1781 | 69 | UInt_t tauM; | ||
1782 | 70 | UInt_t tauE; | ||
1783 | 71 | UInt_t photon; | ||
1784 | 66 | 72 | ||
1785 | 67 | //-------------------------------------------------------------------------- | 73 | //-------------------------------------------------------------------------- |
1786 | 68 | // method members | 74 | // method members |
1787 | @@ -81,6 +87,12 @@ | |||
1788 | 81 | myBtagger_ = 0; | 87 | myBtagger_ = 0; |
1789 | 82 | myCtagger_ = 0; | 88 | myCtagger_ = 0; |
1790 | 83 | myTAUtagger_ = 0; | 89 | myTAUtagger_ = 0; |
1791 | 90 | muon=0; | ||
1792 | 91 | electron=0; | ||
1793 | 92 | tauH=0; | ||
1794 | 93 | tauM=0; | ||
1795 | 94 | tauE=0; | ||
1796 | 95 | photon=0; | ||
1797 | 84 | } | 96 | } |
1798 | 85 | 97 | ||
1799 | 86 | /// Destructor | 98 | /// Destructor |
1800 | 87 | 99 | ||
1801 | === modified file 'tools/SampleAnalyzer/JetClustering/JetClusteringFastJet.cpp' | |||
1802 | --- tools/SampleAnalyzer/JetClustering/JetClusteringFastJet.cpp 2013-05-17 06:19:22 +0000 | |||
1803 | +++ tools/SampleAnalyzer/JetClustering/JetClusteringFastJet.cpp 2013-06-13 12:22:26 +0000 | |||
1804 | @@ -27,13 +27,230 @@ | |||
1805 | 27 | 27 | ||
1806 | 28 | using namespace MA5; | 28 | using namespace MA5; |
1807 | 29 | 29 | ||
1808 | 30 | |||
1809 | 31 | void JetClusteringFastJet::GetFinalState(const MCParticleFormat* part, std::set<const MCParticleFormat*>& finalstates) | ||
1810 | 32 | { | ||
1811 | 33 | for (unsigned int i=0; i<part->Daughters().size(); i++) | ||
1812 | 34 | { | ||
1813 | 35 | if (PHYSICS->IsFinalState(part->Daughters()[i])) finalstates.insert(part->Daughters()[i]); | ||
1814 | 36 | else return GetFinalState(part->Daughters()[i],finalstates); | ||
1815 | 37 | } | ||
1816 | 38 | } | ||
1817 | 39 | |||
1818 | 40 | Bool_t JetClusteringFastJet::IsLast(const MCParticleFormat* part, EventFormat& myEvent) | ||
1819 | 41 | { | ||
1820 | 42 | for (unsigned int i=0; i<part->Daughters().size(); i++) | ||
1821 | 43 | { | ||
1822 | 44 | if (part->Daughters()[i]->pdgid()==part->pdgid()) return false; | ||
1823 | 45 | } | ||
1824 | 46 | return true; | ||
1825 | 47 | } | ||
1826 | 48 | |||
1827 | 49 | |||
1828 | 50 | Bool_t JetClusteringFastJet::IrrelevantPhoton(const MCParticleFormat* part) | ||
1829 | 51 | { | ||
1830 | 52 | if (part->mother1()==0) return false; | ||
1831 | 53 | |||
1832 | 54 | // Checking mother | ||
1833 | 55 | UInt_t absid = std::abs(part->mother1()->pdgid()); | ||
1834 | 56 | |||
1835 | 57 | if (absid==15) return true; | ||
1836 | 58 | else return IrrelevantPhoton(part->mother1()); | ||
1837 | 59 | } | ||
1838 | 60 | |||
1839 | 61 | Bool_t JetClusteringFastJet::ComingFromHadronDecay(const MCParticleFormat* part) | ||
1840 | 62 | { | ||
1841 | 63 | // Weird case ? Safety: removing this case | ||
1842 | 64 | if (part->mother1()==0) return true; | ||
1843 | 65 | // std::cout << "part " << part->pdgid() << " <- " << part->mother1()->pdgid() << std::endl; | ||
1844 | 66 | // Checking mother | ||
1845 | 67 | Bool_t had = PHYSICS->IsHadronic(part->mother1()->pdgid()) && part->mother1()->pdgid()!=21; | ||
1846 | 68 | if (had && part->mother1()->mother1()==0) return false; | ||
1847 | 69 | else if (had) return true; | ||
1848 | 70 | else return ComingFromHadronDecay(part->mother1()); | ||
1849 | 71 | } | ||
1850 | 72 | |||
1851 | 73 | |||
1852 | 30 | bool JetClusteringFastJet::Execute(SampleFormat& mySample, EventFormat& myEvent) | 74 | bool JetClusteringFastJet::Execute(SampleFormat& mySample, EventFormat& myEvent) |
1853 | 31 | { | 75 | { |
1855 | 32 | if (mySample.mc()==0 || myEvent.mc()==0) return false; | 76 | if (mySample.mc()==0 || myEvent.mc()==0) return false; |
1856 | 33 | if (mySample.rec()==0) mySample.InitializeRec(); | 77 | if (mySample.rec()==0) mySample.InitializeRec(); |
1857 | 34 | if (myEvent.rec() ==0) myEvent.InitializeRec(); | 78 | if (myEvent.rec() ==0) myEvent.InitializeRec(); |
1858 | 79 | |||
1859 | 80 | // Reseting the reconstructed event | ||
1860 | 35 | myEvent.rec()->Reset(); | 81 | myEvent.rec()->Reset(); |
1861 | 36 | 82 | ||
1862 | 83 | // Veto | ||
1863 | 84 | std::vector<bool> vetos(myEvent.mc()->particles().size(),false); | ||
1864 | 85 | std::set<const MCParticleFormat*> vetos2; | ||
1865 | 86 | |||
1866 | 87 | // Filling the dataformat with electron/muon | ||
1867 | 88 | for (unsigned int i=0;i<myEvent.mc()->particles().size();i++) | ||
1868 | 89 | { | ||
1869 | 90 | const MCParticleFormat& part = myEvent.mc()->particles()[i]; | ||
1870 | 91 | UInt_t absid = std::abs(part.pdgid()); | ||
1871 | 92 | |||
1872 | 93 | // Rejecting particle with a null pt (initial state ?) | ||
1873 | 94 | if (part.pt()<1e-10) continue; | ||
1874 | 95 | |||
1875 | 96 | // Treating intermediate particles | ||
1876 | 97 | if (PHYSICS->IsInterState(part)) | ||
1877 | 98 | { | ||
1878 | 99 | // rejecting not interesting particles | ||
1879 | 100 | if (absid!=5 && absid!=4 && absid!=15) continue; | ||
1880 | 101 | |||
1881 | 102 | // keeping the last particle with the same id in the decay chain | ||
1882 | 103 | if (!IsLast(&part, myEvent)) continue; | ||
1883 | 104 | |||
1884 | 105 | // looking for b quarks | ||
1885 | 106 | if (absid==5) | ||
1886 | 107 | { | ||
1887 | 108 | bool found=false; | ||
1888 | 109 | for (unsigned int j=0;j<myEvent.rec()->MCBquarks_.size();j++) | ||
1889 | 110 | { | ||
1890 | 111 | if (myEvent.rec()->MCBquarks_[j]==&(part)) | ||
1891 | 112 | {found=true; break;} | ||
1892 | 113 | } | ||
1893 | 114 | if (!found) myEvent.rec()->MCBquarks_.push_back(&(part)); | ||
1894 | 115 | } | ||
1895 | 116 | |||
1896 | 117 | // looking for c quarks | ||
1897 | 118 | else if (absid==4) | ||
1898 | 119 | { | ||
1899 | 120 | bool found=false; | ||
1900 | 121 | for (unsigned int j=0;j<myEvent.rec()->MCCquarks_.size();j++) | ||
1901 | 122 | { | ||
1902 | 123 | if (myEvent.rec()->MCCquarks_[j]==&(part)) | ||
1903 | 124 | {found=true; break;} | ||
1904 | 125 | } | ||
1905 | 126 | if (!found) myEvent.rec()->MCCquarks_.push_back(&(part)); | ||
1906 | 127 | } | ||
1907 | 128 | |||
1908 | 129 | // looking for taus | ||
1909 | 130 | else if (absid==15) | ||
1910 | 131 | { | ||
1911 | 132 | // rejecting particle if coming from hadronization | ||
1912 | 133 | if (ComingFromHadronDecay(&part)) continue; | ||
1913 | 134 | |||
1914 | 135 | // Looking taus daughters id | ||
1915 | 136 | bool leptonic = true; | ||
1916 | 137 | bool muonic = false; | ||
1917 | 138 | bool electronic = false; | ||
1918 | 139 | for (unsigned int j=0;j<part.Daughters().size();j++) | ||
1919 | 140 | { | ||
1920 | 141 | UInt_t pdgid = std::abs(part.Daughters()[j]->pdgid()); | ||
1921 | 142 | if (pdgid==13) muonic=true; | ||
1922 | 143 | else if (pdgid==11) electronic=true; | ||
1923 | 144 | else if (pdgid!=22 /*photons*/ && | ||
1924 | 145 | !(pdgid>=11 && pdgid<=16) /*neutrinos*/) | ||
1925 | 146 | leptonic=false; | ||
1926 | 147 | } | ||
1927 | 148 | if (!leptonic) {muonic=false; electronic=false;} | ||
1928 | 149 | |||
1929 | 150 | // Saving taus decaying into muons (only one copy) | ||
1930 | 151 | if (muonic) | ||
1931 | 152 | { | ||
1932 | 153 | bool found=false; | ||
1933 | 154 | for (unsigned int j=0;j<myEvent.rec()->MCMuonicTaus_.size();j++) | ||
1934 | 155 | { | ||
1935 | 156 | if (myEvent.rec()->MCMuonicTaus_[j]==&(part)) | ||
1936 | 157 | {found=true; break;} | ||
1937 | 158 | } | ||
1938 | 159 | if (!found) myEvent.rec()->MCMuonicTaus_.push_back(&(part)); | ||
1939 | 160 | } | ||
1940 | 161 | |||
1941 | 162 | // Saving taus decaying into electrons (only one copy) | ||
1942 | 163 | else if (electronic) | ||
1943 | 164 | { | ||
1944 | 165 | bool found=false; | ||
1945 | 166 | for (unsigned int j=0;j<myEvent.rec()->MCElectronicTaus_.size();j++) | ||
1946 | 167 | { | ||
1947 | 168 | if (myEvent.rec()->MCElectronicTaus_[j]==&(part)) | ||
1948 | 169 | {found=true; break;} | ||
1949 | 170 | } | ||
1950 | 171 | if (!found) myEvent.rec()->MCElectronicTaus_.push_back(&(part)); | ||
1951 | 172 | } | ||
1952 | 173 | |||
1953 | 174 | // Saving taus decaying into hadrons (only copy) | ||
1954 | 175 | else | ||
1955 | 176 | { | ||
1956 | 177 | bool found=false; | ||
1957 | 178 | for (unsigned int j=0;j<myEvent.rec()->MCHadronicTaus_.size();j++) | ||
1958 | 179 | { | ||
1959 | 180 | if (myEvent.rec()->MCHadronicTaus_[j]==&(part)) | ||
1960 | 181 | {found=true; break;} | ||
1961 | 182 | } | ||
1962 | 183 | if (!found) | ||
1963 | 184 | { | ||
1964 | 185 | // Saving the hadrons in MC container | ||
1965 | 186 | myEvent.rec()->MCHadronicTaus_.push_back(&(part)); | ||
1966 | 187 | |||
1967 | 188 | // Applying efficiency | ||
1968 | 189 | if (!myTAUtagger_->IsIdentified()) continue; | ||
1969 | 190 | |||
1970 | 191 | // Creating reco hadronic taus | ||
1971 | 192 | RecTauFormat* myTau = myEvent.rec()->GetNewTau(); | ||
1972 | 193 | if (part.pdgid()>0) myTau->setCharge(-1.); | ||
1973 | 194 | else myTau->setCharge(+1.); | ||
1974 | 195 | myTau->setMomentum(part.momentum()); | ||
1975 | 196 | myTau->setMc(&part); | ||
1976 | 197 | myTau->setDecayMode(PHYSICS->GetTauDecayMode(myTau->mc())); | ||
1977 | 198 | if (myTau->DecayMode()<=0) myTau->setNtracks(0); // ERROR case | ||
1978 | 199 | else if (myTau->DecayMode()==7 || | ||
1979 | 200 | myTau->DecayMode()==9) myTau->setNtracks(3); // 3-Prong | ||
1980 | 201 | else myTau->setNtracks(1); // 1-Prong | ||
1981 | 202 | |||
1982 | 203 | // Searching final state | ||
1983 | 204 | GetFinalState(&part,vetos2); | ||
1984 | 205 | } | ||
1985 | 206 | } | ||
1986 | 207 | } | ||
1987 | 208 | } | ||
1988 | 209 | |||
1989 | 210 | // Keeping only final states | ||
1990 | 211 | else if (PHYSICS->IsFinalState(part)) | ||
1991 | 212 | { | ||
1992 | 213 | // rejecting not interesting particles | ||
1993 | 214 | if (absid!=22 && absid!=11 && absid!=13) continue; | ||
1994 | 215 | |||
1995 | 216 | // rejecting particle if coming from hadronization | ||
1996 | 217 | if (ExclusiveId_ && ComingFromHadronDecay(&part)) continue; | ||
1997 | 218 | |||
1998 | 219 | // Muons | ||
1999 | 220 | if (absid==13) | ||
2000 | 221 | { | ||
2001 | 222 | vetos[i]=true; | ||
2002 | 223 | RecLeptonFormat * muon = myEvent.rec()->GetNewMuon(); | ||
2003 | 224 | muon->setMomentum(part.momentum()); | ||
2004 | 225 | muon->setMc(&(part)); | ||
2005 | 226 | if (part.pdgid()==13) muon->SetCharge(-1); | ||
2006 | 227 | else muon->SetCharge(+1); | ||
2007 | 228 | } | ||
2008 | 229 | |||
2009 | 230 | // Electrons | ||
2010 | 231 | else if (absid==11) | ||
2011 | 232 | { | ||
2012 | 233 | vetos[i]=true; | ||
2013 | 234 | RecLeptonFormat * elec = myEvent.rec()->GetNewElectron(); | ||
2014 | 235 | elec->setMomentum(part.momentum()); | ||
2015 | 236 | elec->setMc(&(part)); | ||
2016 | 237 | if (part.pdgid()==11) elec->SetCharge(-1); | ||
2017 | 238 | else elec->SetCharge(+1); | ||
2018 | 239 | } | ||
2019 | 240 | |||
2020 | 241 | // Photons | ||
2021 | 242 | else if (absid==22) | ||
2022 | 243 | { | ||
2023 | 244 | if (IrrelevantPhoton(&part)) continue; | ||
2024 | 245 | vetos[i]=true; | ||
2025 | 246 | RecPhotonFormat * photon = myEvent.rec()->GetNewPhoton(); | ||
2026 | 247 | photon->setMomentum(part.momentum()); | ||
2027 | 248 | photon->setMc(&(part)); | ||
2028 | 249 | } | ||
2029 | 250 | } | ||
2030 | 251 | |||
2031 | 252 | } | ||
2032 | 253 | |||
2033 | 37 | double & TET = myEvent.rec()->TET(); | 254 | double & TET = myEvent.rec()->TET(); |
2034 | 38 | double & THT = myEvent.rec()->THT(); | 255 | double & THT = myEvent.rec()->THT(); |
2035 | 39 | 256 | ||
2036 | @@ -41,10 +258,21 @@ | |||
2037 | 41 | std::vector<fastjet::PseudoJet> inputs; | 258 | std::vector<fastjet::PseudoJet> inputs; |
2038 | 42 | for (unsigned int i=0;i<myEvent.mc()->particles().size();i++) | 259 | for (unsigned int i=0;i<myEvent.mc()->particles().size();i++) |
2039 | 43 | { | 260 | { |
2040 | 261 | const MCParticleFormat& part = myEvent.mc()->particles()[i]; | ||
2041 | 262 | |||
2042 | 44 | // Selecting input for jet clustering | 263 | // Selecting input for jet clustering |
2043 | 45 | if (myEvent.mc()->particles()[i].statuscode()!=1) continue; | 264 | if (myEvent.mc()->particles()[i].statuscode()!=1) continue; |
2044 | 46 | if (PHYSICS->IsInvisible(myEvent.mc()->particles()[i])) continue; | 265 | if (PHYSICS->IsInvisible(myEvent.mc()->particles()[i])) continue; |
2046 | 47 | if (fabs(myEvent.mc()->particles()[i].pdgid())==13) continue; | 266 | |
2047 | 267 | // ExclusiveId mode | ||
2048 | 268 | if (ExclusiveId_) | ||
2049 | 269 | { | ||
2050 | 270 | if (vetos[i]) continue; | ||
2051 | 271 | if (vetos2.find(&part)!=vetos2.end()) continue; | ||
2052 | 272 | } | ||
2053 | 273 | |||
2054 | 274 | // NonExclusive Id mode | ||
2055 | 275 | else if (std::abs(myEvent.mc()->particles()[i].pdgid())==13) continue; | ||
2056 | 48 | 276 | ||
2057 | 49 | // Filling good particle for clustering | 277 | // Filling good particle for clustering |
2058 | 50 | inputs.push_back( | 278 | inputs.push_back( |
2059 | @@ -90,40 +318,35 @@ | |||
2060 | 90 | for (unsigned int j=0;j<constituents.size();j++) | 318 | for (unsigned int j=0;j<constituents.size();j++) |
2061 | 91 | { | 319 | { |
2062 | 92 | jet->AddConstituent(constituents[j].user_index()); | 320 | jet->AddConstituent(constituents[j].user_index()); |
2064 | 93 | // if (fabs(myEvent.mc()->particles()[constituents[j].user_index()].pdgid())==11) continue; | 321 | // if (std::abs(myEvent.mc()->particles()[constituents[j].user_index()].pdgid())==11) continue; |
2065 | 94 | if (PDG->IsCharged(myEvent.mc()->particles()[constituents[j].user_index()].pdgid())) tracks++; | 322 | if (PDG->IsCharged(myEvent.mc()->particles()[constituents[j].user_index()].pdgid())) tracks++; |
2066 | 95 | } | 323 | } |
2067 | 96 | jet->ntracks_ = tracks; | 324 | jet->ntracks_ = tracks; |
2068 | 97 | } | 325 | } |
2069 | 98 | 326 | ||
2072 | 99 | // Filling the dataformat with electron/muon | 327 | |
2073 | 100 | for (unsigned int i=0;i<myEvent.mc()->particles().size();i++) | 328 | if (ExclusiveId_) |
2074 | 101 | { | 329 | { |
2091 | 102 | if (myEvent.mc()->particles()[i].statuscode()!=1) continue; | 330 | for (unsigned int i=0;i<myEvent.rec()->electrons().size();i++) |
2092 | 103 | if (fabs(myEvent.mc()->particles()[i].pdgid())==13) | 331 | { |
2093 | 104 | { | 332 | (*MET) -= myEvent.rec()->electrons()[i].momentum(); |
2094 | 105 | RecLeptonFormat * muon = myEvent.rec()->GetNewMuon(); | 333 | TET += myEvent.rec()->electrons()[i].pt(); |
2095 | 106 | muon->setMomentum(myEvent.mc()->particles()[i].momentum()); | 334 | } |
2096 | 107 | muon->setMc(&(myEvent.mc()->particles()[i])); | 335 | for (unsigned int i=0;i<myEvent.rec()->photons().size();i++) |
2097 | 108 | if (myEvent.mc()->particles()[i].pdgid()==13) muon->SetCharge(-1); | 336 | { |
2098 | 109 | else muon->SetCharge(+1); | 337 | (*MET) -= myEvent.rec()->photons()[i].momentum(); |
2099 | 110 | } | 338 | TET += myEvent.rec()->photons()[i].pt(); |
2100 | 111 | else if (fabs(myEvent.mc()->particles()[i].pdgid())==11) | 339 | } |
2101 | 112 | { | 340 | for (unsigned int i=0;i<myEvent.rec()->taus().size();i++) |
2102 | 113 | RecLeptonFormat * elec = myEvent.rec()->GetNewElectron(); | 341 | { |
2103 | 114 | elec->setMomentum(myEvent.mc()->particles()[i].momentum()); | 342 | (*MET) -= myEvent.rec()->taus()[i].momentum(); |
2104 | 115 | elec->setMc(&(myEvent.mc()->particles()[i])); | 343 | TET += myEvent.rec()->taus()[i].pt(); |
2089 | 116 | if (myEvent.mc()->particles()[i].pdgid()==11) elec->SetCharge(-1); | ||
2090 | 117 | else elec->SetCharge(+1); | ||
2105 | 118 | } | 344 | } |
2106 | 119 | } | 345 | } |
2107 | 120 | 346 | ||
2108 | 121 | |||
2109 | 122 | for (unsigned int i=0;i<myEvent.rec()->muons().size();i++) | 347 | for (unsigned int i=0;i<myEvent.rec()->muons().size();i++) |
2110 | 123 | { | 348 | { |
2111 | 124 | (*MET) -= myEvent.rec()->muons()[i].momentum(); | 349 | (*MET) -= myEvent.rec()->muons()[i].momentum(); |
2112 | 125 | // MET->momentum().SetPx(MET->momentum().Px() - myEvent.rec()->muons()[i].px()); | ||
2113 | 126 | // MET->momentum().SetPy(MET->momentum().Py() - myEvent.rec()->muons()[i].py()); | ||
2114 | 127 | TET += myEvent.rec()->muons()[i].pt(); | 350 | TET += myEvent.rec()->muons()[i].pt(); |
2115 | 128 | } | 351 | } |
2116 | 129 | 352 | ||
2117 | 130 | 353 | ||
2118 | === modified file 'tools/SampleAnalyzer/JetClustering/JetClusteringFastJet.h' | |||
2119 | --- tools/SampleAnalyzer/JetClustering/JetClusteringFastJet.h 2013-05-17 06:19:22 +0000 | |||
2120 | +++ tools/SampleAnalyzer/JetClustering/JetClusteringFastJet.h 2013-06-13 12:22:26 +0000 | |||
2121 | @@ -55,6 +55,7 @@ | |||
2122 | 55 | /// Jet definition | 55 | /// Jet definition |
2123 | 56 | fastjet::JetDefinition JetDefinition_; | 56 | fastjet::JetDefinition JetDefinition_; |
2124 | 57 | 57 | ||
2125 | 58 | |||
2126 | 58 | //--------------------------------------------------------------------------------- | 59 | //--------------------------------------------------------------------------------- |
2127 | 59 | // method members | 60 | // method members |
2128 | 60 | //--------------------------------------------------------------------------------- | 61 | //--------------------------------------------------------------------------------- |
2129 | @@ -74,6 +75,13 @@ | |||
2130 | 74 | /// Initialization | 75 | /// Initialization |
2131 | 75 | virtual bool Initialize(const std::map<std::string,std::string>& options)=0; | 76 | virtual bool Initialize(const std::map<std::string,std::string>& options)=0; |
2132 | 76 | 77 | ||
2133 | 78 | private: | ||
2134 | 79 | Bool_t IsLast(const MCParticleFormat* part, EventFormat& myEvent); | ||
2135 | 80 | Bool_t ComingFromHadronDecay(const MCParticleFormat* part); | ||
2136 | 81 | Bool_t IrrelevantPhoton(const MCParticleFormat* part); | ||
2137 | 82 | void GetFinalState(const MCParticleFormat* part, std::set<const MCParticleFormat*>& finalstates); | ||
2138 | 83 | |||
2139 | 84 | |||
2140 | 77 | }; | 85 | }; |
2141 | 78 | 86 | ||
2142 | 79 | } | 87 | } |
2143 | 80 | 88 | ||
2144 | === modified file 'tools/SampleAnalyzer/JetClustering/TaggerBase.cpp' | |||
2145 | --- tools/SampleAnalyzer/JetClustering/TaggerBase.cpp 2013-05-17 06:19:22 +0000 | |||
2146 | +++ tools/SampleAnalyzer/JetClustering/TaggerBase.cpp 2013-06-13 12:22:26 +0000 | |||
2147 | @@ -35,6 +35,8 @@ | |||
2148 | 35 | } | 35 | } |
2149 | 36 | 36 | ||
2150 | 37 | 37 | ||
2151 | 38 | |||
2152 | 39 | |||
2153 | 38 | void TaggerBase::SetParameter(const std::string& key, | 40 | void TaggerBase::SetParameter(const std::string& key, |
2154 | 39 | const std::string& value, | 41 | const std::string& value, |
2155 | 40 | std::string header) | 42 | std::string header) |
2156 | 41 | 43 | ||
2157 | === modified file 'tools/SampleAnalyzer/JetClustering/TaggerBase.h' | |||
2158 | --- tools/SampleAnalyzer/JetClustering/TaggerBase.h 2013-05-17 06:19:22 +0000 | |||
2159 | +++ tools/SampleAnalyzer/JetClustering/TaggerBase.h 2013-06-13 12:22:26 +0000 | |||
2160 | @@ -79,7 +79,7 @@ | |||
2161 | 79 | } | 79 | } |
2162 | 80 | 80 | ||
2163 | 81 | /// Destructor | 81 | /// Destructor |
2165 | 82 | ~TaggerBase() | 82 | virtual ~TaggerBase() |
2166 | 83 | {} | 83 | {} |
2167 | 84 | 84 | ||
2168 | 85 | /// Matching using dr | 85 | /// Matching using dr |
2169 | 86 | 86 | ||
2170 | === modified file 'tools/SampleAnalyzer/JetClustering/TauTagger.cpp' | |||
2171 | --- tools/SampleAnalyzer/JetClustering/TauTagger.cpp 2013-05-17 06:19:22 +0000 | |||
2172 | +++ tools/SampleAnalyzer/JetClustering/TauTagger.cpp 2013-06-13 12:22:26 +0000 | |||
2173 | @@ -28,116 +28,10 @@ | |||
2174 | 28 | 28 | ||
2175 | 29 | void TauTagger::Method1 (SampleFormat& mySample, EventFormat& myEvent) | 29 | void TauTagger::Method1 (SampleFormat& mySample, EventFormat& myEvent) |
2176 | 30 | { | 30 | { |
2177 | 31 | // loop on the particles searching for tau | ||
2178 | 32 | for (unsigned int i=0;i<myEvent.mc()->particles().size();i++) | ||
2179 | 33 | { | ||
2180 | 34 | // Keeping only taus | ||
2181 | 35 | if (fabs(myEvent.mc()->particles()[i].pdgid())!=15) continue; | ||
2182 | 36 | |||
2183 | 37 | // Removing initial states | ||
2184 | 38 | if (PHYSICS->IsInitialState(myEvent.mc()->particles()[i])) continue; | ||
2185 | 39 | |||
2186 | 40 | // Removing final states | ||
2187 | 41 | if (PHYSICS->IsFinalState(myEvent.mc()->particles()[i])) continue; | ||
2188 | 42 | |||
2189 | 43 | // Keeping the last taus in the decay chain | ||
2190 | 44 | if (!IsLast(&myEvent.mc()->particles()[i], myEvent)) continue; | ||
2191 | 45 | |||
2192 | 46 | // Removing taus decaying to leptons | ||
2193 | 47 | bool leptonic=true; | ||
2194 | 48 | bool muonic=false; | ||
2195 | 49 | bool electronic=false; | ||
2196 | 50 | for (unsigned int j=0;j<myEvent.mc()->particles()[i].Daughters().size();j++) | ||
2197 | 51 | { | ||
2198 | 52 | unsigned int pdgid = | ||
2199 | 53 | std::abs(myEvent.mc()->particles()[i].Daughters()[j]->pdgid()); | ||
2200 | 54 | if (pdgid==13) muonic=true; | ||
2201 | 55 | else if (pdgid==11) electronic=true; | ||
2202 | 56 | if (pdgid!=22 && !(pdgid>=11 && pdgid<=18)) {leptonic=false;} | ||
2203 | 57 | } | ||
2204 | 58 | if (leptonic && muonic) | ||
2205 | 59 | { | ||
2206 | 60 | bool found=false; | ||
2207 | 61 | for (unsigned int j=0;j<myEvent.rec()->MCMuonicTaus_.size();j++) | ||
2208 | 62 | { | ||
2209 | 63 | if (myEvent.rec()->MCMuonicTaus_[j]==&(myEvent.mc()->particles()[i])) | ||
2210 | 64 | {found=true; break;} | ||
2211 | 65 | } | ||
2212 | 66 | if (!found) | ||
2213 | 67 | myEvent.rec()->MCMuonicTaus_.push_back(&(myEvent.mc()->particles()[i])); | ||
2214 | 68 | } | ||
2215 | 69 | else if (leptonic && electronic) | ||
2216 | 70 | { | ||
2217 | 71 | bool found=false; | ||
2218 | 72 | for (unsigned int j=0;j<myEvent.rec()->MCElectronicTaus_.size();j++) | ||
2219 | 73 | { | ||
2220 | 74 | if (myEvent.rec()->MCElectronicTaus_[j]==&(myEvent.mc()->particles()[i])) | ||
2221 | 75 | {found=true; break;} | ||
2222 | 76 | } | ||
2223 | 77 | if (!found) | ||
2224 | 78 | myEvent.rec()->MCElectronicTaus_.push_back(&(myEvent.mc()->particles()[i])); | ||
2225 | 79 | } | ||
2226 | 80 | else if (!leptonic) | ||
2227 | 81 | { | ||
2228 | 82 | bool found=false; | ||
2229 | 83 | for (unsigned int j=0;j<myEvent.rec()->MCHadronicTaus_.size();j++) | ||
2230 | 84 | { | ||
2231 | 85 | if (myEvent.rec()->MCHadronicTaus_[j]==&(myEvent.mc()->particles()[i])) | ||
2232 | 86 | {found=true; break;} | ||
2233 | 87 | } | ||
2234 | 88 | if (!found) | ||
2235 | 89 | myEvent.rec()->MCHadronicTaus_.push_back(&(myEvent.mc()->particles()[i])); | ||
2236 | 90 | |||
2237 | 91 | } | ||
2238 | 92 | } | ||
2239 | 93 | |||
2240 | 94 | // Matching MCtaus and RECtaus | ||
2241 | 95 | std::vector<std::pair<RecJetFormat*,MCParticleFormat*> > Candidates; | ||
2242 | 96 | for (unsigned int i=0;i<myEvent.rec()->MCHadronicTaus_.size();i++) | ||
2243 | 97 | { | ||
2244 | 98 | RecJetFormat* tag = 0; | ||
2245 | 99 | Double_t DeltaRmax = DeltaRmax_; | ||
2246 | 100 | |||
2247 | 101 | // loop on the jets | ||
2248 | 102 | for (unsigned int j=0;j<myEvent.rec()->jets().size();j++) | ||
2249 | 103 | { | ||
2250 | 104 | // if (myEvent.rec()->jets()[j].ntracks()!=1 && | ||
2251 | 105 | // myEvent.rec()->jets()[j].ntracks()!=3) continue; | ||
2252 | 106 | |||
2253 | 107 | // Calculating Delta R | ||
2254 | 108 | Float_t DeltaR = | ||
2255 | 109 | myEvent.rec()->MCHadronicTaus_[i]->dr(myEvent.rec()->jets()[j]); | ||
2256 | 110 | |||
2257 | 111 | if (DeltaR <= DeltaRmax) | ||
2258 | 112 | { | ||
2259 | 113 | if(Exclusive_) | ||
2260 | 114 | { | ||
2261 | 115 | tag = &(myEvent.rec()->jets()[j]); | ||
2262 | 116 | DeltaRmax = DeltaR; | ||
2263 | 117 | } | ||
2264 | 118 | else Candidates.push_back( | ||
2265 | 119 | std::make_pair(& myEvent.rec()->jets()[j], | ||
2266 | 120 | myEvent.rec()->MCHadronicTaus_[i]) ); | ||
2267 | 121 | } | ||
2268 | 122 | } | ||
2269 | 123 | if (Exclusive_ && tag!=0) | ||
2270 | 124 | Candidates.push_back(std::make_pair(tag, | ||
2271 | 125 | myEvent.rec()->MCHadronicTaus_[i])); | ||
2272 | 126 | } | ||
2273 | 127 | |||
2274 | 128 | // Performing efficiency | ||
2275 | 129 | for (unsigned int i=0;i<Candidates.size();i++) | ||
2276 | 130 | { | ||
2277 | 131 | if (!IsIdentified()) continue; | ||
2278 | 132 | Candidates[i].first->mc_ = Candidates[i].second; | ||
2279 | 133 | RecTauFormat* myTau = myEvent.rec()->GetNewTau(); | ||
2280 | 134 | Jet2Tau(Candidates[i].first, myTau, myEvent); | ||
2281 | 135 | // myEvent.rec()->jets().erase((std::vector<RecJetFormat>::iterator) Candidates[j-1]); | ||
2282 | 136 | } | ||
2283 | 137 | |||
2284 | 138 | // Performing mis-id | 31 | // Performing mis-id |
2285 | 139 | if (doMisefficiency_) | 32 | if (doMisefficiency_) |
2286 | 140 | { | 33 | { |
2287 | 34 | std::vector<unsigned int> toRemove; | ||
2288 | 141 | for (unsigned int i=0;i<myEvent.rec()->jets().size();i++) | 35 | for (unsigned int i=0;i<myEvent.rec()->jets().size();i++) |
2289 | 142 | { | 36 | { |
2290 | 143 | // keeping only light jets | 37 | // keeping only light jets |
2291 | @@ -149,8 +43,14 @@ | |||
2292 | 149 | { | 43 | { |
2293 | 150 | RecTauFormat* myTau = myEvent.rec()->GetNewTau(); | 44 | RecTauFormat* myTau = myEvent.rec()->GetNewTau(); |
2294 | 151 | Jet2Tau(&myEvent.rec()->jets()[i], myTau, myEvent); | 45 | Jet2Tau(&myEvent.rec()->jets()[i], myTau, myEvent); |
2295 | 46 | toRemove.push_back(i); | ||
2296 | 152 | } | 47 | } |
2297 | 153 | } | 48 | } |
2298 | 49 | for (unsigned int i =0;i<toRemove.size();i++) | ||
2299 | 50 | { | ||
2300 | 51 | myEvent.rec()->jets().erase(myEvent.rec()->jets().begin() | ||
2301 | 52 | + toRemove[i]); | ||
2302 | 53 | } | ||
2303 | 154 | } | 54 | } |
2304 | 155 | 55 | ||
2305 | 156 | } | 56 | } |
2306 | @@ -338,8 +238,8 @@ | |||
2307 | 338 | charge += PDG->GetCharge(myEvent.mc()->particles()[myJet->Constituents_[i]].pdgid()); | 238 | charge += PDG->GetCharge(myEvent.mc()->particles()[myJet->Constituents_[i]].pdgid()); |
2308 | 339 | } | 239 | } |
2309 | 340 | 240 | ||
2312 | 341 | if (charge == 3) myTau->charge_ = true; | 241 | if (charge>0) myTau->charge_ = true; |
2313 | 342 | else if (charge == -3) myTau->charge_ = false; | 242 | else if (charge<=0) myTau->charge_ = false; |
2314 | 343 | } | 243 | } |
2315 | 344 | 244 | ||
2316 | 345 | 245 | ||
2317 | @@ -378,8 +278,6 @@ | |||
2318 | 378 | std::string TauTagger::GetParameters() | 278 | std::string TauTagger::GetParameters() |
2319 | 379 | { | 279 | { |
2320 | 380 | std::stringstream str; | 280 | std::stringstream str; |
2321 | 381 | str << "dR=" << DeltaRmax_ << " ; "; | ||
2322 | 382 | if (Exclusive_) str << "Exclusive ; "; else str << "Inclusive ; "; | ||
2323 | 383 | str << "IDeff=" << Efficiency_; | 281 | str << "IDeff=" << Efficiency_; |
2324 | 384 | str << " ; MisID(q)=" << misid_ljet_; | 282 | str << " ; MisID(q)=" << misid_ljet_; |
2325 | 385 | return str.str(); | 283 | return str.str(); |
2326 | 386 | 284 | ||
2327 | === modified file 'tools/SampleAnalyzer/JetClustering/TauTagger.h' | |||
2328 | --- tools/SampleAnalyzer/JetClustering/TauTagger.h 2013-05-17 06:19:22 +0000 | |||
2329 | +++ tools/SampleAnalyzer/JetClustering/TauTagger.h 2013-06-13 12:22:26 +0000 | |||
2330 | @@ -27,7 +27,7 @@ | |||
2331 | 27 | 27 | ||
2332 | 28 | //SampleAnalyser headers | 28 | //SampleAnalyser headers |
2333 | 29 | #include "SampleAnalyzer/JetClustering/TaggerBase.h" | 29 | #include "SampleAnalyzer/JetClustering/TaggerBase.h" |
2335 | 30 | 30 | #include <TH1F.h> | |
2336 | 31 | 31 | ||
2337 | 32 | namespace MA5 | 32 | namespace MA5 |
2338 | 33 | { | 33 | { |
2339 | @@ -44,7 +44,7 @@ | |||
2340 | 44 | 44 | ||
2341 | 45 | /// Apply misefficiency | 45 | /// Apply misefficiency |
2342 | 46 | Bool_t doMisefficiency_; | 46 | Bool_t doMisefficiency_; |
2344 | 47 | 47 | // TH1F* htest; | |
2345 | 48 | 48 | ||
2346 | 49 | //--------------------------------------------------------------------------------- | 49 | //--------------------------------------------------------------------------------- |
2347 | 50 | // method members | 50 | // method members |
2348 | @@ -56,10 +56,12 @@ | |||
2349 | 56 | { | 56 | { |
2350 | 57 | misid_ljet_=0.0; | 57 | misid_ljet_=0.0; |
2351 | 58 | doMisefficiency_=false; | 58 | doMisefficiency_=false; |
2352 | 59 | // htest = new TH1F("eric","eric",10,0,10); | ||
2353 | 59 | } | 60 | } |
2354 | 60 | 61 | ||
2355 | 61 | /// Destructor | 62 | /// Destructor |
2357 | 62 | ~TauTagger () { } | 63 | virtual ~TauTagger () |
2358 | 64 | { /*htest->SaveAs("Alloul.root");*/ } | ||
2359 | 63 | 65 | ||
2360 | 64 | /// Matching using dr | 66 | /// Matching using dr |
2361 | 65 | virtual void Method1 (SampleFormat& mySample, EventFormat& myEvent); | 67 | virtual void Method1 (SampleFormat& mySample, EventFormat& myEvent); |
2362 | 66 | 68 | ||
2363 | === modified file 'tools/SampleAnalyzer/JetClustering/bTagger.cpp' | |||
2364 | --- tools/SampleAnalyzer/JetClustering/bTagger.cpp 2013-05-17 06:19:22 +0000 | |||
2365 | +++ tools/SampleAnalyzer/JetClustering/bTagger.cpp 2013-06-13 12:22:26 +0000 | |||
2366 | @@ -29,49 +29,6 @@ | |||
2367 | 29 | { | 29 | { |
2368 | 30 | std::vector<RecJetFormat*> Candidates; | 30 | std::vector<RecJetFormat*> Candidates; |
2369 | 31 | 31 | ||
2370 | 32 | // loop on the particles searching for b | ||
2371 | 33 | for (unsigned int i=0;i<myEvent.mc()->particles().size();i++) | ||
2372 | 34 | { | ||
2373 | 35 | // Keeping only b-quark | ||
2374 | 36 | if (std::abs(myEvent.mc()->particles()[i].pdgid())!=5 && | ||
2375 | 37 | std::abs(myEvent.mc()->particles()[i].pdgid())!=4) continue; | ||
2376 | 38 | |||
2377 | 39 | // Removing initial states | ||
2378 | 40 | if (PHYSICS->IsInitialState(myEvent.mc()->particles()[i])) continue; | ||
2379 | 41 | |||
2380 | 42 | // Removing final states | ||
2381 | 43 | if (PHYSICS->IsFinalState(myEvent.mc()->particles()[i])) continue; | ||
2382 | 44 | |||
2383 | 45 | // Keeping the last taus in the decay chain | ||
2384 | 46 | if (!IsLast(&myEvent.mc()->particles()[i], myEvent)) continue; | ||
2385 | 47 | |||
2386 | 48 | // b-quark already defined ? | ||
2387 | 49 | if (std::abs(myEvent.mc()->particles()[i].pdgid())==5) | ||
2388 | 50 | { | ||
2389 | 51 | bool found=false; | ||
2390 | 52 | for (unsigned int j=0;j<myEvent.rec()->MCBquarks_.size();j++) | ||
2391 | 53 | { | ||
2392 | 54 | if (myEvent.rec()->MCBquarks_[j]==&(myEvent.mc()->particles()[i])) | ||
2393 | 55 | {found=true; break;} | ||
2394 | 56 | } | ||
2395 | 57 | if (!found) | ||
2396 | 58 | myEvent.rec()->MCBquarks_.push_back(&(myEvent.mc()->particles()[i])); | ||
2397 | 59 | } | ||
2398 | 60 | |||
2399 | 61 | // c-quark already defined ? | ||
2400 | 62 | else if (std::abs(myEvent.mc()->particles()[i].pdgid())==4) | ||
2401 | 63 | { | ||
2402 | 64 | bool found=false; | ||
2403 | 65 | for (unsigned int j=0;j<myEvent.rec()->MCCquarks_.size();j++) | ||
2404 | 66 | { | ||
2405 | 67 | if (myEvent.rec()->MCCquarks_[j]==&(myEvent.mc()->particles()[i])) | ||
2406 | 68 | {found=true; break;} | ||
2407 | 69 | } | ||
2408 | 70 | if (!found) | ||
2409 | 71 | myEvent.rec()->MCCquarks_.push_back(&(myEvent.mc()->particles()[i])); | ||
2410 | 72 | } | ||
2411 | 73 | } | ||
2412 | 74 | |||
2413 | 75 | // Matching b-quarks to jets | 32 | // Matching b-quarks to jets |
2414 | 76 | for (unsigned int i=0;i<myEvent.rec()->MCBquarks_.size();i++) | 33 | for (unsigned int i=0;i<myEvent.rec()->MCBquarks_.size();i++) |
2415 | 77 | { | 34 | { |
2416 | @@ -81,6 +38,7 @@ | |||
2417 | 81 | // loop on the jets | 38 | // loop on the jets |
2418 | 82 | for (unsigned int j=0;j<myEvent.rec()->jets().size();j++) | 39 | for (unsigned int j=0;j<myEvent.rec()->jets().size();j++) |
2419 | 83 | { | 40 | { |
2420 | 41 | if (myEvent.rec()->jets()[j].pt()<1e-10) continue; | ||
2421 | 84 | Float_t DeltaR = myEvent.rec()->MCBquarks_[i]->dr(myEvent.rec()->jets()[j]); | 42 | Float_t DeltaR = myEvent.rec()->MCBquarks_[i]->dr(myEvent.rec()->jets()[j]); |
2422 | 85 | 43 | ||
2423 | 86 | if (DeltaR <= DeltaRmax) | 44 | if (DeltaR <= DeltaRmax) |
2424 | @@ -112,6 +70,8 @@ | |||
2425 | 112 | // loop on the jets | 70 | // loop on the jets |
2426 | 113 | for (unsigned int j=0;j<myEvent.rec()->jets().size();j++) | 71 | for (unsigned int j=0;j<myEvent.rec()->jets().size();j++) |
2427 | 114 | { | 72 | { |
2428 | 73 | if (myEvent.rec()->jets()[j].pt()<1e-10) continue; | ||
2429 | 74 | |||
2430 | 115 | Float_t DeltaR = | 75 | Float_t DeltaR = |
2431 | 116 | myEvent.rec()->MCCquarks_[i]->dr(myEvent.rec()->jets()[j]); | 76 | myEvent.rec()->MCCquarks_[i]->dr(myEvent.rec()->jets()[j]); |
2432 | 117 | 77 | ||
2433 | 118 | 78 | ||
2434 | === modified file 'tools/SampleAnalyzer/JetClustering/bTagger.h' | |||
2435 | --- tools/SampleAnalyzer/JetClustering/bTagger.h 2013-05-17 06:19:22 +0000 | |||
2436 | +++ tools/SampleAnalyzer/JetClustering/bTagger.h 2013-06-13 12:22:26 +0000 | |||
2437 | @@ -62,7 +62,7 @@ | |||
2438 | 62 | } | 62 | } |
2439 | 63 | 63 | ||
2440 | 64 | /// Destructor | 64 | /// Destructor |
2442 | 65 | ~bTagger() {} | 65 | virtual ~bTagger() {} |
2443 | 66 | 66 | ||
2444 | 67 | /// Matching using dr | 67 | /// Matching using dr |
2445 | 68 | virtual void Method1 (SampleFormat& mySample, EventFormat& myEvent); | 68 | virtual void Method1 (SampleFormat& mySample, EventFormat& myEvent); |
2446 | 69 | 69 | ||
2447 | === modified file 'tools/SampleAnalyzer/JetClustering/cTagger.h' | |||
2448 | --- tools/SampleAnalyzer/JetClustering/cTagger.h 2013-05-17 06:19:22 +0000 | |||
2449 | +++ tools/SampleAnalyzer/JetClustering/cTagger.h 2013-06-13 12:22:26 +0000 | |||
2450 | @@ -45,7 +45,7 @@ | |||
2451 | 45 | cTagger() {} | 45 | cTagger() {} |
2452 | 46 | 46 | ||
2453 | 47 | /// Destructor | 47 | /// Destructor |
2455 | 48 | ~cTagger () {} | 48 | virtual ~cTagger () {} |
2456 | 49 | 49 | ||
2457 | 50 | /// Matching using dr | 50 | /// Matching using dr |
2458 | 51 | virtual void Method1 (SampleFormat& mySample, EventFormat& myEvent); | 51 | virtual void Method1 (SampleFormat& mySample, EventFormat& myEvent); |
2459 | 52 | 52 | ||
2460 | === removed file 'tools/SampleAnalyzer/Makefile' | |||
2461 | --- tools/SampleAnalyzer/Makefile 2013-04-19 17:21:55 +0000 | |||
2462 | +++ tools/SampleAnalyzer/Makefile 1970-01-01 00:00:00 +0000 | |||
2463 | @@ -1,89 +0,0 @@ | |||
2464 | 1 | ################################################################################ | ||
2465 | 2 | # MAKEFILE DEVOTED TO SAMPLE ANALYZER LIBRARY # | ||
2466 | 3 | ################################################################################ | ||
2467 | 4 | |||
2468 | 5 | # Compilators | ||
2469 | 6 | GCC = g++ | ||
2470 | 7 | |||
2471 | 8 | # Options for compilation | ||
2472 | 9 | CXXFASTJET = $(shell fastjet-config --cxxflags --plugins) | ||
2473 | 10 | CXXFLAGS = -Wall -O3 $(shell root-config --cflags) -I./../ -DZIP_USE -DFASTJET_USE $(CXXFASTJET) | ||
2474 | 11 | |||
2475 | 12 | # Files | ||
2476 | 13 | SRCS = $(wildcard */*.cpp) | ||
2477 | 14 | HDRS = $(wildcard */*.h) | ||
2478 | 15 | OBJS = $(SRCS:.cpp=.o) | ||
2479 | 16 | |||
2480 | 17 | # Name of the library | ||
2481 | 18 | PROGRAM = SampleAnalyzer | ||
2482 | 19 | |||
2483 | 20 | # Defining colours | ||
2484 | 21 | GREEN = "\\033[1;32m" | ||
2485 | 22 | RED = "\\033[1;31m" | ||
2486 | 23 | PINK = "\\033[1;35m" | ||
2487 | 24 | BLUE = "\\033[1;34m" | ||
2488 | 25 | YELLOW = "\\033[1;33m" | ||
2489 | 26 | CYAN = "\\033[1;36m" | ||
2490 | 27 | NORMAL = "\\033[0;39m" | ||
2491 | 28 | |||
2492 | 29 | # All target | ||
2493 | 30 | all: header compile_header compile link_header link | ||
2494 | 31 | |||
2495 | 32 | # Header target | ||
2496 | 33 | header: | ||
2497 | 34 | @echo -e $(YELLOW)"--------------------------------------------------" | ||
2498 | 35 | @echo -e " Building SampleAnalyzer library " | ||
2499 | 36 | @echo -e "--------------------------------------------------"$(NORMAL) | ||
2500 | 37 | |||
2501 | 38 | # Compile_header target | ||
2502 | 39 | compile_header: | ||
2503 | 40 | @echo -e $(YELLOW)"--------------------------------------------------" | ||
2504 | 41 | @echo -e " Compilation " | ||
2505 | 42 | @echo -e "--------------------------------------------------"$(NORMAL) | ||
2506 | 43 | |||
2507 | 44 | # Link_header target | ||
2508 | 45 | link_header: | ||
2509 | 46 | @echo -e $(YELLOW)"--------------------------------------------------" | ||
2510 | 47 | @echo -e " Final linking " | ||
2511 | 48 | @echo -e "--------------------------------------------------"$(NORMAL) | ||
2512 | 49 | |||
2513 | 50 | # clean_header target | ||
2514 | 51 | clean_header: | ||
2515 | 52 | @echo -e $(YELLOW)"--------------------------------------------------" | ||
2516 | 53 | @echo -e " Removing intermediate files from building " | ||
2517 | 54 | @echo -e "--------------------------------------------------"$(NORMAL) | ||
2518 | 55 | |||
2519 | 56 | # mrproper_header target | ||
2520 | 57 | mrproper_header: | ||
2521 | 58 | @echo -e $(YELLOW)"--------------------------------------------------" | ||
2522 | 59 | @echo -e " Cleaning all the project " | ||
2523 | 60 | @echo -e "--------------------------------------------------"$(NORMAL) | ||
2524 | 61 | |||
2525 | 62 | # Precompile target | ||
2526 | 63 | precompile: | ||
2527 | 64 | |||
2528 | 65 | # Compile target | ||
2529 | 66 | compile: precompile $(OBJS) | ||
2530 | 67 | |||
2531 | 68 | # Link target | ||
2532 | 69 | link: $(OBJS) | ||
2533 | 70 | ar -ruc Lib/lib$(PROGRAM).a $(OBJS) | ||
2534 | 71 | |||
2535 | 72 | # Phony target | ||
2536 | 73 | .PHONY: do_clean header compile_header link_header | ||
2537 | 74 | |||
2538 | 75 | # Clean target | ||
2539 | 76 | clean: clean_header do_clean | ||
2540 | 77 | |||
2541 | 78 | # Do clean target | ||
2542 | 79 | do_clean: | ||
2543 | 80 | @rm -f $(OBJS) Reader/FACdict.* | ||
2544 | 81 | |||
2545 | 82 | # Mr Proper target | ||
2546 | 83 | mrproper: mrproper_header do_mrproper | ||
2547 | 84 | |||
2548 | 85 | # Do Mr Proper target | ||
2549 | 86 | do_mrproper: do_clean | ||
2550 | 87 | @rm -f Lib/lib$(PROGRAM).a | ||
2551 | 88 | @rm -f compilation.log linking.log cleanup.log *~ */*~ | ||
2552 | 89 | |||
2553 | 90 | 0 | ||
2554 | === modified file 'tools/SampleAnalyzer/Reader/HEPMCReader.cpp' | |||
2555 | --- tools/SampleAnalyzer/Reader/HEPMCReader.cpp 2013-05-17 06:19:22 +0000 | |||
2556 | +++ tools/SampleAnalyzer/Reader/HEPMCReader.cpp 2013-06-13 12:22:26 +0000 | |||
2557 | @@ -133,6 +133,7 @@ | |||
2558 | 133 | } | 133 | } |
2559 | 134 | 134 | ||
2560 | 135 | 135 | ||
2561 | 136 | |||
2562 | 136 | // ----------------------------------------------------------------------------- | 137 | // ----------------------------------------------------------------------------- |
2563 | 137 | // FinalizeEvent | 138 | // FinalizeEvent |
2564 | 138 | // ----------------------------------------------------------------------------- | 139 | // ----------------------------------------------------------------------------- |
2565 | @@ -150,11 +151,39 @@ | |||
2566 | 150 | mySample.mc()->set_xsection(value); | 151 | mySample.mc()->set_xsection(value); |
2567 | 151 | mySample.mc()->set_xsection_error(err_value); | 152 | mySample.mc()->set_xsection_error(err_value); |
2568 | 152 | 153 | ||
2570 | 153 | // Mother pointer assignment | 154 | // Computing met, mht, ... |
2571 | 154 | for (unsigned int i=0; i<myEvent.mc()->particles_.size();i++) | 155 | for (unsigned int i=0; i<myEvent.mc()->particles_.size();i++) |
2572 | 155 | { | 156 | { |
2573 | 156 | MCParticleFormat& part = myEvent.mc()->particles_[i]; | 157 | MCParticleFormat& part = myEvent.mc()->particles_[i]; |
2574 | 157 | 158 | ||
2575 | 159 | // Setting mother | ||
2576 | 160 | if (part.extra1_!=part.extra2_) | ||
2577 | 161 | { | ||
2578 | 162 | unsigned int nmother=0; | ||
2579 | 163 | for (unsigned int j=0; j < myEvent.mc()->particles_.size();j++) | ||
2580 | 164 | { | ||
2581 | 165 | if (i==j) continue; | ||
2582 | 166 | if (part.extra1_ == myEvent.mc()->particles_[j].extra2_) | ||
2583 | 167 | { | ||
2584 | 168 | // set daughter | ||
2585 | 169 | myEvent.mc()->particles_[j].Daughters_.push_back(&part); | ||
2586 | 170 | |||
2587 | 171 | // set mother | ||
2588 | 172 | nmother++; | ||
2589 | 173 | if (nmother==1) part.mother1_=&(myEvent.mc()->particles()[j]); | ||
2590 | 174 | else if (nmother==2) part.mother2_=&(myEvent.mc()->particles()[j]); | ||
2591 | 175 | else | ||
2592 | 176 | { | ||
2593 | 177 | if (warnmother_) | ||
2594 | 178 | { | ||
2595 | 179 | WARNING << "Number of mothers greather than 2 : " << nmother << endmsg; | ||
2596 | 180 | warnmother_=false; | ||
2597 | 181 | } | ||
2598 | 182 | } | ||
2599 | 183 | } | ||
2600 | 184 | } | ||
2601 | 185 | } | ||
2602 | 186 | |||
2603 | 158 | // MET, MHT, TET, THT | 187 | // MET, MHT, TET, THT |
2604 | 159 | if (part.statuscode()==1 && !PHYSICS->IsInvisible(part)) | 188 | if (part.statuscode()==1 && !PHYSICS->IsInvisible(part)) |
2605 | 160 | { | 189 | { |
2606 | @@ -410,12 +439,12 @@ | |||
2607 | 410 | // FillEventParticleLine | 439 | // FillEventParticleLine |
2608 | 411 | // ----------------------------------------------------------------------------- | 440 | // ----------------------------------------------------------------------------- |
2609 | 412 | void HEPMCReader::FillEventParticleLine(const std::string& line, | 441 | void HEPMCReader::FillEventParticleLine(const std::string& line, |
2611 | 413 | EventFormat& myEvent) | 442 | EventFormat& myEvent) |
2612 | 414 | { | 443 | { |
2613 | 415 | std::stringstream str; | 444 | std::stringstream str; |
2614 | 416 | str << line; | 445 | str << line; |
2615 | 417 | 446 | ||
2617 | 418 | double tmp; // temporary variable to fill in LorentzVector | 447 | double tmp; // temporary variable to fill in LorentzVector |
2618 | 419 | 448 | ||
2619 | 420 | // Get a new particle | 449 | // Get a new particle |
2620 | 421 | MCParticleFormat * part = myEvent.mc()->GetNewParticle(); | 450 | MCParticleFormat * part = myEvent.mc()->GetNewParticle(); |
2621 | @@ -432,9 +461,8 @@ | |||
2622 | 432 | str >> part->statuscode_; | 461 | str >> part->statuscode_; |
2623 | 433 | str >> tmp; | 462 | str >> tmp; |
2624 | 434 | str >> tmp; | 463 | str >> tmp; |
2628 | 435 | str >> part->extra_; | 464 | str >> part->extra2_; |
2629 | 436 | 465 | part->extra1_=current_vertex_.barcode_; | |
2627 | 437 | SetMother(part, myEvent); | ||
2630 | 438 | } | 466 | } |
2631 | 439 | 467 | ||
2632 | 440 | // ----------------------------------------------------------------------------- | 468 | // ----------------------------------------------------------------------------- |
2633 | @@ -460,19 +488,45 @@ | |||
2634 | 460 | //-------------------------------------------------------------------------- | 488 | //-------------------------------------------------------------------------- |
2635 | 461 | // SetMother | 489 | // SetMother |
2636 | 462 | //-------------------------------------------------------------------------- | 490 | //-------------------------------------------------------------------------- |
2638 | 463 | void HEPMCReader::SetMother(MCParticleFormat* part, EventFormat& myEvent) | 491 | void HEPMCReader::SetMother(MCParticleFormat* const part, EventFormat& myEvent) |
2639 | 464 | { | 492 | { |
2640 | 493 | /* std::cout << current_vertex_.barcode_ << std::endl; | ||
2641 | 494 | |||
2642 | 495 | // No history | ||
2643 | 465 | if (myEvent.mc()->particles().size()==0) return; | 496 | if (myEvent.mc()->particles().size()==0) return; |
2645 | 466 | 497 | ||
2646 | 498 | //ERIC orphan special treatment | ||
2647 | 499 | if (part->extra_==current_vertex_.barcode_) return; | ||
2648 | 500 | |||
2649 | 501 | std::cout << "---------------------------------------------" << std::endl; | ||
2650 | 502 | for (unsigned int i=0;i<myEvent.mc()->particles().size();i++) | ||
2651 | 503 | { | ||
2652 | 504 | std::cout << "i=" << i << "\t" << myEvent.mc()->particles()[i].pdgid() << " from "; | ||
2653 | 505 | if (myEvent.mc()->particles()[i].mother1()!=0) std::cout << myEvent.mc()->particles()[i].mother1()->pdgid(); | ||
2654 | 506 | std::cout << " extra=" << myEvent.mc()->particles()[i].extra_ << " current=" << current_vertex_.barcode_ << std::endl; | ||
2655 | 507 | std::cout << std::endl; | ||
2656 | 508 | } | ||
2657 | 509 | |||
2658 | 510 | |||
2659 | 467 | unsigned int nmother=0; | 511 | unsigned int nmother=0; |
2661 | 468 | for (unsigned int i =0; i<(myEvent.mc()->particles().size()-1);i++) | 512 | for (unsigned int i=0;i<(myEvent.mc()->particles().size()-1);i++) |
2662 | 469 | { | 513 | { |
2663 | 470 | if(myEvent.mc()->particles()[i].extra_==current_vertex_.barcode_) | 514 | if(myEvent.mc()->particles()[i].extra_==current_vertex_.barcode_) |
2664 | 471 | { | 515 | { |
2665 | 472 | nmother++; | 516 | nmother++; |
2669 | 473 | if(nmother==1) part->mother1_=&(myEvent.mc()->particles()[i]); | 517 | if (nmother==1) part->mother1_=&(myEvent.mc()->particles()[i]); |
2670 | 474 | else if(nmother==2) part->mother2_=&(myEvent.mc()->particles()[i]); | 518 | else if (nmother==2) part->mother2_=&(myEvent.mc()->particles()[i]); |
2671 | 475 | else { if (warnmother_) {WARNING << "Number of mothers greather than 2 : " << nmother << endmsg; warnmother_=false;} } | 519 | else |
2672 | 520 | { | ||
2673 | 521 | if (warnmother_) | ||
2674 | 522 | { | ||
2675 | 523 | WARNING << "Number of mothers greather than 2 : " << nmother << endmsg; | ||
2676 | 524 | warnmother_=false; | ||
2677 | 525 | } | ||
2678 | 526 | } | ||
2679 | 476 | } | 527 | } |
2680 | 477 | } | 528 | } |
2681 | 529 | |||
2682 | 530 | if (part->pdgid()==-24) {std::cout << "MMMMHHH" << std::endl; ComingFromHadronDecay(part); } | ||
2683 | 531 | */ | ||
2684 | 478 | } | 532 | } |
2685 | 479 | 533 | ||
2686 | === modified file 'tools/SampleAnalyzer/Reader/HEPMCReader.h' | |||
2687 | --- tools/SampleAnalyzer/Reader/HEPMCReader.h 2013-05-17 06:19:22 +0000 | |||
2688 | +++ tools/SampleAnalyzer/Reader/HEPMCReader.h 2013-06-13 12:22:26 +0000 | |||
2689 | @@ -96,7 +96,7 @@ | |||
2690 | 96 | void FillEventPDFInfo(const std::string& line, SampleFormat& mySample, EventFormat& myEvent); | 96 | void FillEventPDFInfo(const std::string& line, SampleFormat& mySample, EventFormat& myEvent); |
2691 | 97 | void FillEventParticleLine(const std::string& line, EventFormat& myEvent); | 97 | void FillEventParticleLine(const std::string& line, EventFormat& myEvent); |
2692 | 98 | void FillEventVertexLine(const std::string& line, EventFormat& myEvent); | 98 | void FillEventVertexLine(const std::string& line, EventFormat& myEvent); |
2694 | 99 | void SetMother(MCParticleFormat* part, EventFormat& myEvent); | 99 | void SetMother(MCParticleFormat* const part, EventFormat& myEvent); |
2695 | 100 | Bool_t FillWeightNames(const std::string& line); | 100 | Bool_t FillWeightNames(const std::string& line); |
2696 | 101 | Bool_t FillHeavyIons(const std::string& line); | 101 | Bool_t FillHeavyIons(const std::string& line); |
2697 | 102 | 102 | ||
2698 | 103 | 103 | ||
2699 | === modified file 'tools/SampleAnalyzer/Reader/LHCOReader.cpp' | |||
2700 | --- tools/SampleAnalyzer/Reader/LHCOReader.cpp 2013-05-17 07:13:44 +0000 | |||
2701 | +++ tools/SampleAnalyzer/Reader/LHCOReader.cpp 2013-06-13 12:22:26 +0000 | |||
2702 | @@ -65,49 +65,49 @@ | |||
2703 | 65 | 65 | ||
2704 | 66 | bool EndOfLoop = false; | 66 | bool EndOfLoop = false; |
2705 | 67 | 67 | ||
2707 | 68 | // Declarging a new string for line | 68 | // Declarging a new string for line |
2708 | 69 | std::string line; | 69 | std::string line; |
2709 | 70 | std::string tmp; | 70 | std::string tmp; |
2710 | 71 | 71 | ||
2711 | 72 | do | 72 | do |
2734 | 73 | { | 73 | { |
2735 | 74 | std::stringstream str; | 74 | std::stringstream str; |
2736 | 75 | str.str(""); | 75 | str.str(""); |
2737 | 76 | 76 | ||
2738 | 77 | 77 | if (!ReadLine(line)) | |
2739 | 78 | if (!ReadLine(line)) | 78 | { |
2740 | 79 | { | 79 | EndOfFile_=true; |
2741 | 80 | EndOfFile_=true; | 80 | return StatusCode::KEEP; |
2742 | 81 | return StatusCode::KEEP; | 81 | } |
2743 | 82 | } | 82 | str << line; |
2744 | 83 | str << line; | 83 | str >> tmp; |
2745 | 84 | str >> tmp; | 84 | |
2746 | 85 | 85 | if (saved_) | |
2747 | 86 | if (saved_) | 86 | { |
2748 | 87 | { | 87 | FillEventInitLine(savedline_,myEvent); |
2749 | 88 | FillEventInitLine(savedline_,myEvent); | 88 | saved_=false; |
2750 | 89 | saved_=false; | 89 | } |
2751 | 90 | } | 90 | |
2752 | 91 | 91 | if(tmp=="0") | |
2753 | 92 | if(tmp=="0") | 92 | { |
2754 | 93 | { | 93 | if(firstevent_ ) |
2733 | 94 | if(firstevent_ ) | ||
2755 | 95 | { | 94 | { |
2756 | 96 | FillEventInitLine(line,myEvent); | 95 | FillEventInitLine(line,myEvent); |
2757 | 96 | firstevent_=false; | ||
2758 | 97 | continue; | ||
2759 | 97 | } | 98 | } |
2761 | 98 | else | 99 | else |
2762 | 99 | { | 100 | { |
2763 | 100 | EndOfLoop = true; | 101 | EndOfLoop = true; |
2764 | 101 | savedline_=line; | 102 | savedline_=line; |
2765 | 102 | saved_=true; | 103 | saved_=true; |
2766 | 103 | continue; | 104 | continue; |
2767 | 104 | } | 105 | } |
2769 | 105 | } | 106 | } |
2770 | 106 | 107 | ||
2772 | 107 | FillEventParticleLine(line,myEvent); | 108 | FillEventParticleLine(line,myEvent); |
2773 | 108 | 109 | ||
2776 | 109 | firstevent_=false; | 110 | } |
2775 | 110 | } | ||
2777 | 111 | while(!EndOfLoop); | 111 | while(!EndOfLoop); |
2778 | 112 | 112 | ||
2779 | 113 | // Normal end | 113 | // Normal end |
2780 | @@ -280,6 +280,7 @@ | |||
2781 | 280 | // 9th column : isolation | 280 | // 9th column : isolation |
2782 | 281 | str >> tmp; | 281 | str >> tmp; |
2783 | 282 | muon->sumPT_isol_=std::floor(tmp); | 282 | muon->sumPT_isol_=std::floor(tmp); |
2784 | 283 | |||
2785 | 283 | Float_t ET_PT=tmp-muon->sumPT_isol_; | 284 | Float_t ET_PT=tmp-muon->sumPT_isol_; |
2786 | 284 | Bool_t test=false; | 285 | Bool_t test=false; |
2787 | 285 | for (unsigned int j=0;j<5;j++) | 286 | for (unsigned int j=0;j<5;j++) |
2788 | @@ -291,7 +292,7 @@ | |||
2789 | 291 | break; | 292 | break; |
2790 | 292 | } | 293 | } |
2791 | 293 | } | 294 | } |
2793 | 294 | if (test) muon->sumET_isol_=std::floor(ET_PT)*muon->sumPT_isol_; | 295 | if (test) muon->sumET_isol_=std::floor(ET_PT)*muon->pt(); |
2794 | 295 | else muon->sumET_isol_=0; | 296 | else muon->sumET_isol_=0; |
2795 | 296 | } | 297 | } |
2796 | 297 | 298 | ||
2797 | 298 | 299 | ||
2798 | === modified file 'tools/SampleAnalyzer/Reader/ReaderTextBase.cpp' | |||
2799 | --- tools/SampleAnalyzer/Reader/ReaderTextBase.cpp 2013-05-17 06:19:22 +0000 | |||
2800 | +++ tools/SampleAnalyzer/Reader/ReaderTextBase.cpp 2013-06-13 12:22:26 +0000 | |||
2801 | @@ -233,6 +233,8 @@ | |||
2802 | 233 | Long64_t ReaderTextBase::GetPosition() | 233 | Long64_t ReaderTextBase::GetPosition() |
2803 | 234 | { | 234 | { |
2804 | 235 | if (input_==0) return 0; | 235 | if (input_==0) return 0; |
2805 | 236 | #ifdef ZIP_USE | ||
2806 | 236 | if (compress_) return gzinput_->tellg(); | 237 | if (compress_) return gzinput_->tellg(); |
2807 | 238 | #endif | ||
2808 | 237 | else return input_->tellg(); | 239 | else return input_->tellg(); |
2809 | 238 | } | 240 | } |
2810 | 239 | 241 | ||
2811 | === added file 'tools/SampleAnalyzer/Service/CompilationService.h' | |||
2812 | --- tools/SampleAnalyzer/Service/CompilationService.h 1970-01-01 00:00:00 +0000 | |||
2813 | +++ tools/SampleAnalyzer/Service/CompilationService.h 2013-06-13 12:22:26 +0000 | |||
2814 | @@ -0,0 +1,30 @@ | |||
2815 | 1 | //////////////////////////////////////////////////////////////////////////////// | ||
2816 | 2 | // | ||
2817 | 3 | // Copyright (C) 2012-2013 Eric Conte, Benjamin Fuks | ||
2818 | 4 | // The MadAnalysis development team, email: <ma5team@iphc.cnrs.fr> | ||
2819 | 5 | // | ||
2820 | 6 | // This file is part of MadAnalysis 5. | ||
2821 | 7 | // Official website: <https://launchpad.net/madanalysis5> | ||
2822 | 8 | // | ||
2823 | 9 | // MadAnalysis 5 is free software: you can redistribute it and/or modify | ||
2824 | 10 | // it under the terms of the GNU General Public License as published by | ||
2825 | 11 | // the Free Software Foundation, either version 3 of the License, or | ||
2826 | 12 | // (at your option) any later version. | ||
2827 | 13 | // | ||
2828 | 14 | // MadAnalysis 5 is distributed in the hope that it will be useful, | ||
2829 | 15 | // but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
2830 | 16 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
2831 | 17 | // GNU General Public License for more details. | ||
2832 | 18 | // | ||
2833 | 19 | // You should have received a copy of the GNU General Public License | ||
2834 | 20 | // along with MadAnalysis 5. If not, see <http://www.gnu.org/licenses/> | ||
2835 | 21 | // | ||
2836 | 22 | //////////////////////////////////////////////////////////////////////////////// | ||
2837 | 23 | |||
2838 | 24 | |||
2839 | 25 | #ifndef TIMER_SERVICE_H | ||
2840 | 26 | #define TIMER_SERVICE_H | ||
2841 | 27 | |||
2842 | 28 | #define UNUSED(expr) do {(void)(expr);} while(0); | ||
2843 | 29 | |||
2844 | 30 | #endif | ||
2845 | 0 | 31 | ||
2846 | === modified file 'tools/SampleAnalyzer/Service/Physics.h' | |||
2847 | --- tools/SampleAnalyzer/Service/Physics.h 2013-05-17 06:19:22 +0000 | |||
2848 | +++ tools/SampleAnalyzer/Service/Physics.h 2013-06-13 12:22:26 +0000 | |||
2849 | @@ -132,7 +132,8 @@ | |||
2850 | 132 | /// Is Initial State | 132 | /// Is Initial State |
2851 | 133 | Bool_t IsInitialState(const MCParticleFormat& part) const | 133 | Bool_t IsInitialState(const MCParticleFormat& part) const |
2852 | 134 | { | 134 | { |
2854 | 135 | return (part.statuscode()==initialstate_); | 135 | // return (part.statuscode()==initialstate_); |
2855 | 136 | return (part.statuscode()==-1 || (part.statuscode()>=11 && part.statuscode()<=19)); | ||
2856 | 136 | } | 137 | } |
2857 | 137 | 138 | ||
2858 | 138 | /// Is Final State | 139 | /// Is Final State |
2859 | @@ -144,7 +145,7 @@ | |||
2860 | 144 | /// Is Inter State | 145 | /// Is Inter State |
2861 | 145 | Bool_t IsInterState(const MCParticleFormat& part) const | 146 | Bool_t IsInterState(const MCParticleFormat& part) const |
2862 | 146 | { | 147 | { |
2864 | 147 | return (part.statuscode()!=finalstate_ && part.statuscode()!=initialstate_); | 148 | return (!IsInitialState(part) && !IsFinalState(part)); |
2865 | 148 | } | 149 | } |
2866 | 149 | 150 | ||
2867 | 150 | /// Is Initial State | 151 | /// Is Initial State |
2868 | @@ -225,6 +226,13 @@ | |||
2869 | 225 | if (found==mcConfig_.hadronic_ids_.end()) return false; else return true; | 226 | if (found==mcConfig_.hadronic_ids_.end()) return false; else return true; |
2870 | 226 | } | 227 | } |
2871 | 227 | 228 | ||
2872 | 229 | /// Is hadronic ? | ||
2873 | 230 | inline bool IsHadronic(Int_t pdgid) const | ||
2874 | 231 | { | ||
2875 | 232 | std::set<Int_t>::iterator found = mcConfig_.hadronic_ids_.find(pdgid); | ||
2876 | 233 | if (found==mcConfig_.hadronic_ids_.end()) return false; else return true; | ||
2877 | 234 | } | ||
2878 | 235 | |||
2879 | 228 | /// Is invisible ? | 236 | /// Is invisible ? |
2880 | 229 | inline bool IsInvisible(const MCParticleFormat& part) const | 237 | inline bool IsInvisible(const MCParticleFormat& part) const |
2881 | 230 | { | 238 | { |
2882 | 231 | 239 | ||
2883 | === added file 'tools/SampleAnalyzer/Writer/LHCOParticleFormat.cpp' | |||
2884 | --- tools/SampleAnalyzer/Writer/LHCOParticleFormat.cpp 1970-01-01 00:00:00 +0000 | |||
2885 | +++ tools/SampleAnalyzer/Writer/LHCOParticleFormat.cpp 2013-06-13 12:22:26 +0000 | |||
2886 | @@ -0,0 +1,98 @@ | |||
2887 | 1 | //////////////////////////////////////////////////////////////////////////////// | ||
2888 | 2 | // | ||
2889 | 3 | // Copyright (C) 2012-2013 Eric Conte, Benjamin Fuks | ||
2890 | 4 | // The MadAnalysis development team, email: <ma5team@iphc.cnrs.fr> | ||
2891 | 5 | // | ||
2892 | 6 | // This file is part of MadAnalysis 5. | ||
2893 | 7 | // Official website: <https://launchpad.net/madanalysis5> | ||
2894 | 8 | // | ||
2895 | 9 | // MadAnalysis 5 is free software: you can redistribute it and/or modify | ||
2896 | 10 | // it under the terms of the GNU General Public License as published by | ||
2897 | 11 | // the Free Software Foundation, either version 3 of the License, or | ||
2898 | 12 | // (at your option) any later version. | ||
2899 | 13 | // | ||
2900 | 14 | // MadAnalysis 5 is distributed in the hope that it will be useful, | ||
2901 | 15 | // but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
2902 | 16 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
2903 | 17 | // GNU General Public License for more details. | ||
2904 | 18 | // | ||
2905 | 19 | // You should have received a copy of the GNU General Public License | ||
2906 | 20 | // along with MadAnalysis 5. If not, see <http://www.gnu.org/licenses/> | ||
2907 | 21 | // | ||
2908 | 22 | //////////////////////////////////////////////////////////////////////////////// | ||
2909 | 23 | |||
2910 | 24 | |||
2911 | 25 | // STL headers | ||
2912 | 26 | #include <sstream> | ||
2913 | 27 | #include <iomanip> | ||
2914 | 28 | |||
2915 | 29 | // SampleAnalyzer headers | ||
2916 | 30 | #include "SampleAnalyzer/Writer/LHCOParticleFormat.h" | ||
2917 | 31 | |||
2918 | 32 | using namespace MA5; | ||
2919 | 33 | |||
2920 | 34 | // ----------------------------------------------------------------------------- | ||
2921 | 35 | // Header | ||
2922 | 36 | // ----------------------------------------------------------------------------- | ||
2923 | 37 | const std::string LHCOParticleFormat::header = " # typ eta phi pt jmas ntrk btag had/em dum1 dum2"; | ||
2924 | 38 | |||
2925 | 39 | |||
2926 | 40 | // ----------------------------------------------------------------------------- | ||
2927 | 41 | // Print a particle line | ||
2928 | 42 | // ----------------------------------------------------------------------------- | ||
2929 | 43 | void LHCOParticleFormat::Print(UInt_t num, std::ostream* out) | ||
2930 | 44 | { | ||
2931 | 45 | *out << std::setw(3) << std::right << num; | ||
2932 | 46 | *out << " "; | ||
2933 | 47 | *out << std::setw(2) << std::right << id; | ||
2934 | 48 | *out << " "; | ||
2935 | 49 | *out << std::fixed; | ||
2936 | 50 | unsigned int pres = out->precision(); | ||
2937 | 51 | out->precision(3); | ||
2938 | 52 | double myeta = eta; | ||
2939 | 53 | if (myeta>9) myeta=9.999; | ||
2940 | 54 | else if (myeta<-9) myeta=-9.999; | ||
2941 | 55 | *out << std::setw(6) << std::right << myeta; // -X.YYY | ||
2942 | 56 | *out << " "; | ||
2943 | 57 | *out << std::setw(6) << std::right << phi; // -X.YYY | ||
2944 | 58 | *out << " "; | ||
2945 | 59 | *out << std::setw(8) << std::right << pt; // XXXX.YYY | ||
2946 | 60 | *out << " "; | ||
2947 | 61 | *out << std::setw(6) << std::right << jmass; // -X.YYY | ||
2948 | 62 | *out << " "; | ||
2949 | 63 | double myntrk = ntrk; | ||
2950 | 64 | if (myntrk>9) myntrk=9.999; | ||
2951 | 65 | else if (myntrk<-9) myntrk=-9.999; | ||
2952 | 66 | *out << std::setw(6) << std::right << myntrk; // -X.YYY | ||
2953 | 67 | *out << " "; | ||
2954 | 68 | *out << std::setw(5) << std::right << btag; // X.YYY | ||
2955 | 69 | *out << " "; | ||
2956 | 70 | out->precision(2); | ||
2957 | 71 | *out << std::setw(5) << std::right << hadem; // XX.YY | ||
2958 | 72 | *out << " "; | ||
2959 | 73 | *out << std::setw(5) << std::right << 0.; // -X.YY | ||
2960 | 74 | *out << " "; | ||
2961 | 75 | *out << std::setw(5) << std::right << 0.; // -X.YY | ||
2962 | 76 | out->precision(pres); | ||
2963 | 77 | *out << std::endl; | ||
2964 | 78 | } | ||
2965 | 79 | |||
2966 | 80 | |||
2967 | 81 | // ----------------------------------------------------------------------------- | ||
2968 | 82 | // Print the event header | ||
2969 | 83 | // ----------------------------------------------------------------------------- | ||
2970 | 84 | void LHCOParticleFormat::WriteEventHeader(unsigned int numEvent, | ||
2971 | 85 | std::ostream* out) | ||
2972 | 86 | { | ||
2973 | 87 | // Particle number | ||
2974 | 88 | *out << std::setw(3) << std::right << 0; | ||
2975 | 89 | *out << " "; | ||
2976 | 90 | |||
2977 | 91 | // Event number | ||
2978 | 92 | *out << std::setw(10) << std::right << numEvent+1; | ||
2979 | 93 | *out << " "; | ||
2980 | 94 | |||
2981 | 95 | // Trigger word | ||
2982 | 96 | *out << std::setw(6) << std::right << 0; | ||
2983 | 97 | *out << std::endl; | ||
2984 | 98 | } | ||
2985 | 0 | 99 | ||
2986 | === added file 'tools/SampleAnalyzer/Writer/LHCOParticleFormat.h' | |||
2987 | --- tools/SampleAnalyzer/Writer/LHCOParticleFormat.h 1970-01-01 00:00:00 +0000 | |||
2988 | +++ tools/SampleAnalyzer/Writer/LHCOParticleFormat.h 2013-06-13 12:22:26 +0000 | |||
2989 | @@ -0,0 +1,64 @@ | |||
2990 | 1 | //////////////////////////////////////////////////////////////////////////////// | ||
2991 | 2 | // | ||
2992 | 3 | // Copyright (C) 2012-2013 Eric Conte, Benjamin Fuks | ||
2993 | 4 | // The MadAnalysis development team, email: <ma5team@iphc.cnrs.fr> | ||
2994 | 5 | // | ||
2995 | 6 | // This file is part of MadAnalysis 5. | ||
2996 | 7 | // Official website: <https://launchpad.net/madanalysis5> | ||
2997 | 8 | // | ||
2998 | 9 | // MadAnalysis 5 is free software: you can redistribute it and/or modify | ||
2999 | 10 | // it under the terms of the GNU General Public License as published by | ||
3000 | 11 | // the Free Software Foundation, either version 3 of the License, or | ||
3001 | 12 | // (at your option) any later version. | ||
3002 | 13 | // | ||
3003 | 14 | // MadAnalysis 5 is distributed in the hope that it will be useful, | ||
3004 | 15 | // but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
3005 | 16 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
3006 | 17 | // GNU General Public License for more details. | ||
3007 | 18 | // | ||
3008 | 19 | // You should have received a copy of the GNU General Public License | ||
3009 | 20 | // along with MadAnalysis 5. If not, see <http://www.gnu.org/licenses/> | ||
3010 | 21 | // | ||
3011 | 22 | //////////////////////////////////////////////////////////////////////////////// | ||
3012 | 23 | |||
3013 | 24 | |||
3014 | 25 | #ifndef LHCO_PARTICLE_FORMAT_h | ||
3015 | 26 | #define LHCO_PARTICLE_FORMAT_h | ||
3016 | 27 | |||
3017 | 28 | // STL headers | ||
3018 | 29 | #include <iostream> | ||
3019 | 30 | #include <string> | ||
3020 | 31 | |||
3021 | 32 | // ROOT headers | ||
3022 | 33 | #include <Rtypes.h> | ||
3023 | 34 | |||
3024 | 35 | namespace MA5 | ||
3025 | 36 | { | ||
3026 | 37 | |||
3027 | 38 | class LHCOParticleFormat | ||
3028 | 39 | { | ||
3029 | 40 | |||
3030 | 41 | // ------------------------------------------------------------- | ||
3031 | 42 | // data members | ||
3032 | 43 | // ------------------------------------------------------------- | ||
3033 | 44 | public: | ||
3034 | 45 | |||
3035 | 46 | UInt_t id; | ||
3036 | 47 | Float_t eta; | ||
3037 | 48 | Float_t phi; | ||
3038 | 49 | Float_t pt; | ||
3039 | 50 | Float_t jmass; | ||
3040 | 51 | Float_t ntrk; | ||
3041 | 52 | Float_t btag; | ||
3042 | 53 | Float_t hadem; | ||
3043 | 54 | |||
3044 | 55 | static const std::string header; | ||
3045 | 56 | |||
3046 | 57 | void Print(UInt_t num, std::ostream* out); | ||
3047 | 58 | static void WriteEventHeader(unsigned int numEvent,std::ostream* out); | ||
3048 | 59 | }; | ||
3049 | 60 | |||
3050 | 61 | |||
3051 | 62 | } | ||
3052 | 63 | |||
3053 | 64 | #endif | ||
3054 | 0 | 65 | ||
3055 | === modified file 'tools/SampleAnalyzer/Writer/LHCOWriter.cpp' | |||
3056 | --- tools/SampleAnalyzer/Writer/LHCOWriter.cpp 2013-05-17 06:19:22 +0000 | |||
3057 | +++ tools/SampleAnalyzer/Writer/LHCOWriter.cpp 2013-06-13 12:22:26 +0000 | |||
3058 | @@ -31,105 +31,93 @@ | |||
3059 | 31 | 31 | ||
3060 | 32 | using namespace MA5; | 32 | using namespace MA5; |
3061 | 33 | 33 | ||
3062 | 34 | std::string LHCOWriter::FortranFormat_SimplePrecision(Float_t value,UInt_t precision) | ||
3063 | 35 | { | ||
3064 | 36 | std::stringstream str; | ||
3065 | 37 | str.precision(precision); | ||
3066 | 38 | std::string word; | ||
3067 | 39 | |||
3068 | 40 | Bool_t negative=false; | ||
3069 | 41 | if (value<0) {negative=true; value*=-1;} | ||
3070 | 42 | |||
3071 | 43 | Int_t exponent = 0; | ||
3072 | 44 | if (value!=0) | ||
3073 | 45 | { | ||
3074 | 46 | for (; value > 1.0; exponent++) value/=10.; | ||
3075 | 47 | for (; value < 0.0; exponent--) value*=10.; | ||
3076 | 48 | } | ||
3077 | 49 | |||
3078 | 50 | str << std::uppercase << std::fixed << value << "E"; | ||
3079 | 51 | if (exponent>=0) str << "+"; else str << "-"; | ||
3080 | 52 | if (abs(exponent)<10) str << "0"; | ||
3081 | 53 | str << abs(exponent); | ||
3082 | 54 | str >> word; | ||
3083 | 55 | if (!negative) return word; | ||
3084 | 56 | else return "-"+word; | ||
3085 | 57 | } | ||
3086 | 58 | |||
3087 | 59 | |||
3088 | 60 | std::string LHCOWriter::FortranFormat_DoublePrecision(Double_t value,UInt_t precision) | ||
3089 | 61 | { | ||
3090 | 62 | std::stringstream str; | ||
3091 | 63 | str.precision(precision); | ||
3092 | 64 | std::string word; | ||
3093 | 65 | |||
3094 | 66 | Bool_t negative=false; | ||
3095 | 67 | if (value<0) {negative=true; value*=-1;} | ||
3096 | 68 | |||
3097 | 69 | Int_t exponent = 0; | ||
3098 | 70 | if (value!=0) | ||
3099 | 71 | { | ||
3100 | 72 | for (; value > 1.0; exponent++) value/=10.; | ||
3101 | 73 | for (; value < 0.0; exponent--) value*=10.; | ||
3102 | 74 | } | ||
3103 | 75 | |||
3104 | 76 | str << std::uppercase << std::fixed << value << "E"; | ||
3105 | 77 | if (exponent>=0) str << "+"; else str << "-"; | ||
3106 | 78 | if (abs(exponent)<10) str << "0"; | ||
3107 | 79 | str << abs(exponent); | ||
3108 | 80 | str >> word; | ||
3109 | 81 | if (!negative) return word; | ||
3110 | 82 | else return "-"+word; | ||
3111 | 83 | } | ||
3112 | 84 | |||
3113 | 85 | 34 | ||
3114 | 86 | /// Read the sample | 35 | /// Read the sample |
3115 | 87 | bool LHCOWriter::WriteHeader(const SampleFormat& mySample) | 36 | bool LHCOWriter::WriteHeader(const SampleFormat& mySample) |
3116 | 88 | { | 37 | { |
3129 | 89 | // Opening tag | 38 | // MA5 logo |
3130 | 90 | *output_ << "<LesHouchesEvents version=""1.0"">" << std::endl; | 39 | WriteMA5header(); |
3131 | 91 | 40 | ||
3132 | 92 | // Header block | 41 | // LHCO format tag |
3133 | 93 | *output_ << "<header>" << std::endl; | 42 | *output_ << "#<MA5Format> LHCO format </MA5Format>" << std::endl; |
3134 | 94 | *output_ << "<!--" << std::endl; | 43 | |
3135 | 95 | *output_ << "#*********************************************************************" << std::endl; | 44 | // Python interface version |
3136 | 96 | *output_ << "# *" << std::endl; | 45 | *output_ << "#<MadAnalysis5Version> " << cfg_->GetPythonInterfaceVersion() |
3137 | 97 | *output_ << "# This file has been produced by MadAnalysis 5 *" << std::endl; | 46 | << " " << cfg_->GetPythonInterfaceDate() |
3138 | 98 | *output_ << "# *" << std::endl; | 47 | << "</MadAnalysis5Version>" << std::endl; |
3139 | 99 | *output_ << "#....................................................................*" << std::endl; | 48 | |
3140 | 100 | *output_ << "" << std::endl; | 49 | // SampleAnalyzer version |
3141 | 50 | *output_ << "#<SampleAnalyzerVersion> "<< cfg_->GetSampleAnalyzerVersion() | ||
3142 | 51 | << " " << cfg_->GetSampleAnalyzerVersion() | ||
3143 | 52 | << " </SampleAnalyzerVersion>" << std::endl; | ||
3144 | 53 | |||
3145 | 54 | // Explanation about the LHCO | ||
3146 | 55 | *output_ << "#<FormatDescription>" << std::endl; | ||
3147 | 56 | *output_ << "#################################################################################" << std::endl; | ||
3148 | 57 | *output_ << "# Each event begins with a header row. Meaning of the different columns: #" << std::endl; | ||
3149 | 58 | *output_ << "# the following: #" << std::endl; | ||
3150 | 59 | *output_ << "# - column 1: label '0' indicating the beginning a new event. #" << std::endl; | ||
3151 | 60 | *output_ << "# - column 2: event number. #" << std::endl; | ||
3152 | 61 | *output_ << "# - column 3: triggering information. For files produced by MadAnalysis, this #" << std::endl; | ||
3153 | 62 | *output_ << "# value is set to 0. #" << std::endl; | ||
3154 | 63 | *output_ << "# #" << std::endl; | ||
3155 | 64 | *output_ << "# The rest of the rows are the physics objects in the events. Meaning of the #" << std::endl; | ||
3156 | 65 | *output_ << "# different columns: #" << std::endl; | ||
3157 | 66 | *output_ << "# - column 1: row number #" << std::endl; | ||
3158 | 67 | *output_ << "# - column 2: type of physics object. The possible values are: #" << std::endl; | ||
3159 | 68 | *output_ << "# 0 = photon, 1 = electron, 2 = muon, #" << std::endl; | ||
3160 | 69 | *output_ << "# 3 = hadronically-decaying tau, 4 = jet, 6 = MET #" << std::endl; | ||
3161 | 70 | *output_ << "# - column 3: pseudorapidity (eta) of the physics object #" << std::endl; | ||
3162 | 71 | *output_ << "# - column 4: azimuthal angle (phi) of the physics object #" << std::endl; | ||
3163 | 72 | *output_ << "# - column 5: transverse momentum (pt) of the physics object #" << std::endl; | ||
3164 | 73 | *output_ << "# - column 6: mass of the physics object. Required information to #" << std::endl; | ||
3165 | 74 | *output_ << "# reconstruct the four-vector momentum of jets. #" << std::endl; | ||
3166 | 75 | *output_ << "# - column 7: #" << std::endl; | ||
3167 | 76 | *output_ << "# + case of a jet: number of tracks associated with the object. #" << std::endl; | ||
3168 | 77 | *output_ << "# + case of an electron/muon: electric charge. #" << std::endl; | ||
3169 | 78 | *output_ << "# + case of an hadronically-decaying tau: electric charge times the number of #" << std::endl; | ||
3170 | 79 | *output_ << "# tracks associated with the object. #" << std::endl; | ||
3171 | 80 | *output_ << "# Usual values: +/-1 , +/-3. #" << std::endl; | ||
3172 | 81 | *output_ << "# + other cases: 0. #" << std::endl; | ||
3173 | 82 | *output_ << "# - column 8: #" << std::endl; | ||
3174 | 83 | *output_ << "# + case of a jet: b-jet tag. Allowed values are: #" << std::endl; | ||
3175 | 84 | *output_ << "# 0 = no identified b-jet, #" << std::endl; | ||
3176 | 85 | *output_ << "# 1 = b-jet identified by a loose tagger algorithm, #" << std::endl; | ||
3177 | 86 | *output_ << "# 2 = b-jet identified by a tight tagger algorithm #" << std::endl; | ||
3178 | 87 | *output_ << "# (the value 2 is not used by MadAnalysis 5). #" << std::endl; | ||
3179 | 88 | *output_ << "# + case of a muon: the value indicates the row number of the closest jet #" << std::endl; | ||
3180 | 89 | *output_ << "# in DeltaR. #" << std::endl; | ||
3181 | 90 | *output_ << "# + other cases: 0. #" << std::endl; | ||
3182 | 91 | *output_ << "# - column 9: #" << std::endl; | ||
3183 | 92 | *output_ << "# + case of jet/electron/photon: ratio of the hadronic versus #" << std::endl; | ||
3184 | 93 | *output_ << "# electromagnetic energy deposited in the #" << std::endl; | ||
3185 | 94 | *output_ << "# calorimeters cells associated to the object. #" << std::endl; | ||
3186 | 95 | *output_ << "# It is typically > 1 for a jet and < 1 for an #" << std::endl; | ||
3187 | 96 | *output_ << "# electron or a photon. #" << std::endl; | ||
3188 | 97 | *output_ << "# + case of muon: value related to muon isolation. The format of this value #" << std::endl; | ||
3189 | 98 | *output_ << "# is XXX.YYY. The integer part (XXX) is the summed transverse #" << std::endl; | ||
3190 | 99 | *output_ << "# momentum of tracks in a DeltaR-cone (typically DeltaR=0.4), #" << std::endl; | ||
3191 | 100 | *output_ << "# excluding the muon track. The decimal part (YYY) is the #" << std::endl; | ||
3192 | 101 | *output_ << "# ratio of the transverse energy in the same DeltaR-cone to #" << std::endl; | ||
3193 | 102 | *output_ << "# the transverse momentum of the muon. #" << std::endl; | ||
3194 | 103 | *output_ << "# + in other cases: 0. #" << std::endl; | ||
3195 | 104 | *output_ << "# - column 10: empty column, added for possible use. #" << std::endl; | ||
3196 | 105 | *output_ << "# - column 11: empty column, added for possible use. #" << std::endl; | ||
3197 | 106 | *output_ << "#################################################################################" << std::endl; | ||
3198 | 107 | *output_ << "#</FormatDescription>" << std::endl; | ||
3199 | 101 | 108 | ||
3200 | 102 | if (mySample.mc()!=0) | 109 | if (mySample.mc()!=0) |
3201 | 103 | { | 110 | { |
3203 | 104 | *output_ << "Original header:" << std::endl; | 111 | *output_ << "#Original header:" << std::endl; |
3204 | 105 | *output_ << "" << std::endl; | 112 | *output_ << "" << std::endl; |
3205 | 106 | 113 | ||
3206 | 107 | for (unsigned int i=0;i<mySample.mc()->header().size();i++) | 114 | for (unsigned int i=0;i<mySample.mc()->header().size();i++) |
3208 | 108 | *output_ << mySample.mc()->header()[i] << std::endl; | 115 | *output_ << "#" << mySample.mc()->header()[i] << std::endl; |
3209 | 109 | } | 116 | } |
3210 | 110 | 117 | ||
3211 | 118 | // One line to remind the meaning of each line | ||
3212 | 111 | *output_ << " #" << std::endl; | 119 | *output_ << " #" << std::endl; |
3234 | 112 | // *output_ << " ## More info on LHCO files: " | 120 | *output_ << LHCOParticleFormat::header << std::endl; |
3214 | 113 | // << "http://cp3wks05.fynu.ucl.ac.be/Manual/lhco.html" << std::endl; | ||
3215 | 114 | *output_ << " # eventNum triggerWord" << std::endl; | ||
3216 | 115 | *output_ << " # typ "; | ||
3217 | 116 | *output_ << std::setw(18) << std::right << "eta"; | ||
3218 | 117 | *output_ << " "; | ||
3219 | 118 | *output_ << std::setw(18) << std::right << "phi"; | ||
3220 | 119 | *output_ << " "; | ||
3221 | 120 | *output_ << std::setw(18) << std::right << "pt"; | ||
3222 | 121 | *output_ << " "; | ||
3223 | 122 | *output_ << std::setw(18) << std::right << "jmass"; | ||
3224 | 123 | *output_ << " "; | ||
3225 | 124 | *output_ << std::setw(5) << std::right << "ntracks"; | ||
3226 | 125 | *output_ << " "; | ||
3227 | 126 | *output_ << std::setw(4) << std::right << "btag"; | ||
3228 | 127 | *output_ << " "; | ||
3229 | 128 | *output_ << std::setw(7) << std::right << "had/em"; | ||
3230 | 129 | *output_ << " "; | ||
3231 | 130 | *output_ << std::setw(4) << std::right << "dum1"; | ||
3232 | 131 | *output_ << " "; | ||
3233 | 132 | *output_ << std::setw(4) << std::right << "dum2" << std::endl; | ||
3235 | 133 | 121 | ||
3236 | 134 | return true; | 122 | return true; |
3237 | 135 | } | 123 | } |
3238 | @@ -138,67 +126,78 @@ | |||
3239 | 138 | bool LHCOWriter::WriteEvent(const EventFormat& myEvent, | 126 | bool LHCOWriter::WriteEvent(const EventFormat& myEvent, |
3240 | 139 | const SampleFormat& mySample) | 127 | const SampleFormat& mySample) |
3241 | 140 | { | 128 | { |
3244 | 141 | // Event header | 129 | // FirstEvent |
3245 | 142 | *output_ << "0" << std::endl; | 130 | if (counter_==0) |
3246 | 131 | { | ||
3247 | 132 | WriteHeader(mySample); | ||
3248 | 133 | } | ||
3249 | 143 | 134 | ||
3250 | 144 | // Skipping event if no reconstructed object | 135 | // Skipping event if no reconstructed object |
3251 | 145 | if (myEvent.rec()==0) return true; | 136 | if (myEvent.rec()==0) return true; |
3252 | 146 | 137 | ||
3257 | 147 | // Counter of particles | 138 | // Event header |
3258 | 148 | unsigned int npart=0; | 139 | LHCOParticleFormat::WriteEventHeader(counter_,output_); |
3259 | 149 | 140 | ||
3260 | 150 | // Writing electrons | 141 | // Particle container in LHCO format |
3261 | 142 | std::vector<LHCOParticleFormat> PartTable; | ||
3262 | 143 | PartTable.reserve( myEvent.rec()->photons().size() + | ||
3263 | 144 | myEvent.rec()->electrons().size() + | ||
3264 | 145 | myEvent.rec()->muons().size() + | ||
3265 | 146 | myEvent.rec()->taus().size() + | ||
3266 | 147 | myEvent.rec()->jets().size() + 1 /*MET*/); | ||
3267 | 148 | |||
3268 | 149 | // Writing photons (=0) | ||
3269 | 150 | for (unsigned int i=0;i<myEvent.rec()->photons().size();i++) | ||
3270 | 151 | { | ||
3271 | 152 | PartTable.push_back(LHCOParticleFormat()); | ||
3272 | 153 | WritePhoton(myEvent.rec()->photons()[i],&PartTable.back()); | ||
3273 | 154 | } | ||
3274 | 155 | |||
3275 | 156 | // Writing electrons (=1) | ||
3276 | 151 | for (unsigned int i=0;i<myEvent.rec()->electrons().size();i++) | 157 | for (unsigned int i=0;i<myEvent.rec()->electrons().size();i++) |
3277 | 152 | { | 158 | { |
3280 | 153 | npart++; | 159 | PartTable.push_back(LHCOParticleFormat()); |
3281 | 154 | WriteElectron(myEvent.rec()->electrons()[i],npart); | 160 | WriteElectron(myEvent.rec()->electrons()[i],&PartTable.back()); |
3282 | 155 | } | 161 | } |
3283 | 156 | 162 | ||
3285 | 157 | // Writing muons | 163 | // Writing muons (=2) |
3286 | 158 | for (unsigned int i=0;i<myEvent.rec()->muons().size();i++) | 164 | for (unsigned int i=0;i<myEvent.rec()->muons().size();i++) |
3287 | 159 | { | 165 | { |
3290 | 160 | npart++; | 166 | PartTable.push_back(LHCOParticleFormat()); |
3291 | 161 | WriteMuon(myEvent.rec()->muons()[i],npart); | 167 | WriteMuon(myEvent.rec()->muons()[i],&PartTable.back(),myEvent.rec(), |
3292 | 168 | myEvent.rec()->photons().size()+ | ||
3293 | 169 | myEvent.rec()->electrons().size()+ | ||
3294 | 170 | myEvent.rec()->muons().size()); | ||
3295 | 162 | } | 171 | } |
3296 | 163 | 172 | ||
3298 | 164 | // Writing taus | 173 | // Writing taus (=3) |
3299 | 165 | for (unsigned int i=0;i<myEvent.rec()->taus().size();i++) | 174 | for (unsigned int i=0;i<myEvent.rec()->taus().size();i++) |
3300 | 166 | { | 175 | { |
3303 | 167 | npart++; | 176 | PartTable.push_back(LHCOParticleFormat()); |
3304 | 168 | WriteTau(myEvent.rec()->taus()[i],npart); | 177 | WriteTau(myEvent.rec()->taus()[i],&PartTable.back()); |
3305 | 169 | } | 178 | } |
3306 | 170 | 179 | ||
3308 | 171 | // Writing jets | 180 | // Writing jets (=4) |
3309 | 172 | for (unsigned int i=0;i<myEvent.rec()->jets().size();i++) | 181 | for (unsigned int i=0;i<myEvent.rec()->jets().size();i++) |
3310 | 173 | { | 182 | { |
3313 | 174 | npart++; | 183 | PartTable.push_back(LHCOParticleFormat()); |
3314 | 175 | WriteJet(myEvent.rec()->jets()[i],npart); | 184 | WriteJet(myEvent.rec()->jets()[i],&PartTable.back()); |
3315 | 176 | } | 185 | } |
3316 | 177 | 186 | ||
3341 | 178 | // Writing MET | 187 | // Writing MET (=6) |
3342 | 179 | npart++; | 188 | PartTable.push_back(LHCOParticleFormat()); |
3343 | 180 | WriteMET(myEvent.rec()->MET(),npart); | 189 | WriteMET(myEvent.rec()->MET(),&PartTable.back()); |
3344 | 181 | 190 | ||
3345 | 182 | return true; | 191 | // Printing the table |
3346 | 183 | } | 192 | for (UInt_t i=0;i<PartTable.size();i++) PartTable[i].Print(i+1,output_); |
3347 | 184 | 193 | ||
3348 | 185 | 194 | // Incremeting event counter | |
3349 | 186 | /// Finalize the event | 195 | counter_++; |
3350 | 187 | bool LHCOWriter::WriteEventHeader(const SampleFormat& mySample,unsigned int numEvent) | 196 | |
3351 | 188 | { | 197 | return true; |
3352 | 189 | // Particle number | 198 | } |
3353 | 190 | *output_ << std::setw(3) << std::right << 0; | 199 | |
3354 | 191 | *output_ << " "; | 200 | |
3331 | 192 | |||
3332 | 193 | // Event number | ||
3333 | 194 | *output_ << std::setw(18) << std::right << numEvent; | ||
3334 | 195 | *output_ << " "; | ||
3335 | 196 | |||
3336 | 197 | // Trigger word | ||
3337 | 198 | *output_ << std::setw(18) << std::right << 0; | ||
3338 | 199 | |||
3339 | 200 | return true; | ||
3340 | 201 | } | ||
3355 | 202 | 201 | ||
3356 | 203 | 202 | ||
3357 | 204 | /// Finalize the event | 203 | /// Finalize the event |
3358 | @@ -208,93 +207,48 @@ | |||
3359 | 208 | } | 207 | } |
3360 | 209 | 208 | ||
3361 | 210 | 209 | ||
3363 | 211 | void LHCOWriter::WriteJet(const RecJetFormat& jet,unsigned int partNum) | 210 | void LHCOWriter::WriteJet(const RecJetFormat& jet, |
3364 | 211 | LHCOParticleFormat* lhco) | ||
3365 | 212 | { | 212 | { |
3413 | 213 | // Particle number | 213 | lhco->id = 4; |
3414 | 214 | *output_ << std::setw(3) << std::right << partNum; | 214 | lhco->eta = jet.momentum().Eta(); |
3415 | 215 | *output_ << " "; | 215 | lhco->phi = jet.momentum().Phi(); |
3416 | 216 | 216 | lhco->pt = jet.momentum().Pt(); | |
3417 | 217 | // Particle type | 217 | lhco->jmass = jet.momentum().M(); |
3418 | 218 | *output_ << std::setw(3) << std::right << 4; | 218 | lhco->ntrk = jet.ntracks(); |
3419 | 219 | *output_ << " "; | 219 | if (jet.btag()) lhco->btag = 1.0; else lhco->btag = 0.0; |
3420 | 220 | 220 | lhco->hadem = jet.HEoverEE(); | |
3374 | 221 | // eta | ||
3375 | 222 | *output_ << std::setw(18) << std::right | ||
3376 | 223 | << LHCOWriter::FortranFormat_DoublePrecision(jet.momentum().Eta()) | ||
3377 | 224 | << " "; | ||
3378 | 225 | |||
3379 | 226 | // phi | ||
3380 | 227 | *output_ << std::setw(18) << std::right | ||
3381 | 228 | << LHCOWriter::FortranFormat_DoublePrecision(jet.momentum().Phi()) | ||
3382 | 229 | << " "; | ||
3383 | 230 | |||
3384 | 231 | // pt | ||
3385 | 232 | *output_ << std::setw(18) << std::right | ||
3386 | 233 | << LHCOWriter::FortranFormat_DoublePrecision(jet.momentum().Pt()) | ||
3387 | 234 | << " "; | ||
3388 | 235 | |||
3389 | 236 | // mass | ||
3390 | 237 | *output_ << std::setw(18) << std::right | ||
3391 | 238 | << LHCOWriter::FortranFormat_DoublePrecision(jet.momentum().M()) | ||
3392 | 239 | << " "; | ||
3393 | 240 | |||
3394 | 241 | // ntracks | ||
3395 | 242 | *output_ << std::setw(5) << std::right | ||
3396 | 243 | << LHCOWriter::FortranFormat_DoublePrecision(jet.ntracks()) | ||
3397 | 244 | << " "; | ||
3398 | 245 | |||
3399 | 246 | // b tagging | ||
3400 | 247 | if (jet.btag()) *output_ << " 1.0 "; | ||
3401 | 248 | else *output_ << " 0.0 "; | ||
3402 | 249 | |||
3403 | 250 | // HE/EE | ||
3404 | 251 | *output_ << std::setw(7) << std::right | ||
3405 | 252 | << LHCOWriter::FortranFormat_DoublePrecision(jet.HEoverEE()) | ||
3406 | 253 | << " "; | ||
3407 | 254 | |||
3408 | 255 | // dummy1 & dummy2 | ||
3409 | 256 | *output_ << "0.00 0.00"; | ||
3410 | 257 | |||
3411 | 258 | // end | ||
3412 | 259 | *output_ << std::endl; | ||
3421 | 260 | } | 221 | } |
3422 | 261 | 222 | ||
3424 | 262 | void LHCOWriter::WriteMuon(const RecLeptonFormat& muon,unsigned int partNum) | 223 | void LHCOWriter::WriteMuon(const RecLeptonFormat& muon, |
3425 | 224 | LHCOParticleFormat* lhco, | ||
3426 | 225 | const RecEventFormat* myEvent, | ||
3427 | 226 | unsigned int npart) | ||
3428 | 263 | { | 227 | { |
3463 | 264 | // Particle number | 228 | lhco->id = 2; |
3464 | 265 | *output_ << std::setw(3) << std::right << partNum; | 229 | lhco->eta = muon.momentum().Eta(); |
3465 | 266 | *output_ << " "; | 230 | lhco->phi = muon.momentum().Phi(); |
3466 | 267 | 231 | lhco->pt = muon.momentum().Pt(); | |
3467 | 268 | // Particle type | 232 | lhco->jmass = muon.momentum().M(); |
3468 | 269 | *output_ << std::setw(3) << std::right << 2; | 233 | if (muon.charge()>0) lhco->ntrk=+1.; else lhco->ntrk=-1.; |
3469 | 270 | *output_ << " "; | 234 | |
3470 | 271 | 235 | //------------- the closest jet --------------- | |
3471 | 272 | // eta | 236 | unsigned int theClosestJet=0; |
3472 | 273 | *output_ << std::setw(18) << std::right | 237 | Double_t minDeltaR=-1; |
3473 | 274 | << LHCOWriter::FortranFormat_DoublePrecision(muon.momentum().Eta()) | 238 | for (unsigned int i=0;i<myEvent->jets().size();i++) |
3474 | 275 | << " "; | 239 | { |
3475 | 276 | 240 | if (myEvent->jets()[i].pt()==0) continue; | |
3476 | 277 | // phi | 241 | Double_t DeltaR=muon.dr(myEvent->jets()[i]); |
3477 | 278 | *output_ << std::setw(18) << std::right | 242 | if (i==0 || DeltaR<minDeltaR) |
3478 | 279 | << LHCOWriter::FortranFormat_DoublePrecision(muon.momentum().Phi()) | 243 | { |
3479 | 280 | << " "; | 244 | theClosestJet=i; |
3480 | 281 | 245 | minDeltaR=DeltaR; | |
3481 | 282 | // pt | 246 | } |
3482 | 283 | *output_ << std::setw(18) << std::right | 247 | } |
3483 | 284 | << LHCOWriter::FortranFormat_DoublePrecision(muon.momentum().Pt()) | 248 | if (minDeltaR<0) lhco->btag = 0.; |
3484 | 285 | << " "; | 249 | else lhco->btag = theClosestJet+npart+1; |
3485 | 286 | 250 | ||
3486 | 287 | // mass | 251 | //---------------- isolation ------------------ |
3453 | 288 | *output_ << std::setw(18) << std::right | ||
3454 | 289 | << LHCOWriter::FortranFormat_DoublePrecision(muon.momentum().M()) | ||
3455 | 290 | << " "; | ||
3456 | 291 | |||
3457 | 292 | // electric charge | ||
3458 | 293 | if (muon.charge()>0) *output_ << " +1.0 "; | ||
3459 | 294 | else *output_ << " -1.0 "; | ||
3460 | 295 | |||
3461 | 296 | // null | ||
3462 | 297 | *output_ << "0.0 "; | ||
3487 | 298 | 252 | ||
3488 | 299 | // isolation : sumPT_isol | 253 | // isolation : sumPT_isol |
3489 | 300 | double isolation = 0; | 254 | double isolation = 0; |
3490 | @@ -302,147 +256,59 @@ | |||
3491 | 302 | 256 | ||
3492 | 303 | // isolation : sumET_isol | 257 | // isolation : sumET_isol |
3493 | 304 | double ET_PT = 0; | 258 | double ET_PT = 0; |
3496 | 305 | if (muon.sumPT_isol()!=0) ET_PT=muon.sumET_isol()/muon.sumPT_isol(); | 259 | if (muon.pt()!=0) ET_PT=muon.sumET_isol()/muon.pt(); |
3495 | 306 | ET_PT=std::floor(ET_PT); | ||
3497 | 307 | 260 | ||
3498 | 308 | // gathering isolation variables | 261 | // gathering isolation variables |
3510 | 309 | bool test=false; | 262 | if (ET_PT>100) ET_PT=0.99; else ET_PT=ET_PT/100.; |
3511 | 310 | for (unsigned int j=0;j<5;j++) | 263 | |
3501 | 311 | { | ||
3502 | 312 | ET_PT/=10; | ||
3503 | 313 | if (ET_PT<1.) | ||
3504 | 314 | { | ||
3505 | 315 | test=true; | ||
3506 | 316 | break; | ||
3507 | 317 | } | ||
3508 | 318 | } | ||
3509 | 319 | if (!test) ET_PT=0; | ||
3512 | 320 | isolation+=ET_PT; | 264 | isolation+=ET_PT; |
3640 | 321 | *output_ << std::setw(7) << std::right | 265 | lhco->hadem = isolation; |
3641 | 322 | << LHCOWriter::FortranFormat_DoublePrecision(isolation) | 266 | } |
3642 | 323 | << " "; | 267 | |
3643 | 324 | 268 | void LHCOWriter::WriteElectron(const RecLeptonFormat& electron, | |
3644 | 325 | // dummy1 & dummy2 | 269 | LHCOParticleFormat* lhco) |
3645 | 326 | *output_ << "0.00 0.00"; | 270 | { |
3646 | 327 | 271 | lhco->id = 1; | |
3647 | 328 | // end | 272 | lhco->eta = electron.momentum().Eta(); |
3648 | 329 | *output_ << std::endl; | 273 | lhco->phi = electron.momentum().Phi(); |
3649 | 330 | } | 274 | lhco->pt = electron.momentum().Pt(); |
3650 | 331 | 275 | lhco->jmass = electron.momentum().M(); | |
3651 | 332 | void LHCOWriter::WriteElectron(const RecLeptonFormat& electron, unsigned int partNum) | 276 | if (electron.charge()>0) lhco->ntrk=+1.; else lhco->ntrk=-1.; |
3652 | 333 | { | 277 | lhco->btag = 0.; |
3653 | 334 | // Particle number | 278 | lhco->hadem = electron.HEoverEE(); |
3654 | 335 | *output_ << std::setw(3) << std::right << partNum; | 279 | } |
3655 | 336 | *output_ << " "; | 280 | |
3656 | 337 | 281 | void LHCOWriter::WritePhoton(const RecPhotonFormat& photon, | |
3657 | 338 | // Particle type | 282 | LHCOParticleFormat* lhco) |
3658 | 339 | *output_ << std::setw(3) << std::right << 1; | 283 | { |
3659 | 340 | *output_ << " "; | 284 | lhco->id = 0; |
3660 | 341 | 285 | lhco->eta = photon.momentum().Eta(); | |
3661 | 342 | // eta | 286 | lhco->phi = photon.momentum().Phi(); |
3662 | 343 | *output_ << std::setw(18) << std::right | 287 | lhco->pt = photon.momentum().Pt(); |
3663 | 344 | << LHCOWriter::FortranFormat_DoublePrecision(electron.momentum().Eta()) << " "; | 288 | lhco->jmass = photon.momentum().M(); |
3664 | 345 | 289 | lhco->ntrk = 0.; | |
3665 | 346 | // phi | 290 | lhco->btag = 0.; |
3666 | 347 | *output_ << std::setw(18) << std::right | 291 | lhco->hadem = photon.HEoverEE(); |
3667 | 348 | << LHCOWriter::FortranFormat_DoublePrecision(electron.momentum().Phi()) << " "; | 292 | } |
3668 | 349 | 293 | ||
3669 | 350 | // pt | 294 | void LHCOWriter::WriteTau(const RecTauFormat& tau, |
3670 | 351 | *output_ << std::setw(18) << std::right | 295 | LHCOParticleFormat* lhco) |
3671 | 352 | << LHCOWriter::FortranFormat_DoublePrecision(electron.momentum().Pt()) << " "; | 296 | { |
3672 | 353 | 297 | lhco->id = 3; | |
3673 | 354 | // mass | 298 | lhco->eta = tau.momentum().Eta(); |
3674 | 355 | *output_ << std::setw(18) << std::right | 299 | lhco->phi = tau.momentum().Phi(); |
3675 | 356 | << LHCOWriter::FortranFormat_DoublePrecision(electron.momentum().M()) << " "; | 300 | lhco->pt = tau.momentum().Pt(); |
3676 | 357 | 301 | lhco->jmass = tau.momentum().M(); | |
3677 | 358 | // electric charge | 302 | if (tau.charge()>0) lhco->ntrk=tau.ntracks(); else lhco->ntrk=-tau.ntracks(); |
3678 | 359 | if (electron.charge()>0) *output_ << " +1.0 "; | 303 | lhco->btag = 0.; |
3679 | 360 | else *output_ << " -1.0 "; | 304 | lhco->hadem = tau.HEoverEE(); |
3680 | 361 | 305 | } | |
3681 | 362 | // null | 306 | |
3682 | 363 | *output_ << "0.0 "; | 307 | void LHCOWriter::WriteMET(const ParticleBaseFormat& met, |
3683 | 364 | 308 | LHCOParticleFormat* lhco) | |
3684 | 365 | // HE/EE | 309 | { |
3685 | 366 | *output_ << std::setw(18) << std::right | 310 | lhco->id = 6; |
3686 | 367 | << LHCOWriter::FortranFormat_DoublePrecision(electron.HEoverEE()) | 311 | lhco->eta = 0.; |
3687 | 368 | << " "; | 312 | lhco->phi = met.phi(); |
3688 | 369 | 313 | lhco->pt = met.pt(); | |
3562 | 370 | // dummy1 & dummy2 | ||
3563 | 371 | *output_ << "0.00 0.00"; | ||
3564 | 372 | |||
3565 | 373 | // end | ||
3566 | 374 | *output_ << std::endl; | ||
3567 | 375 | } | ||
3568 | 376 | |||
3569 | 377 | void LHCOWriter::WriteTau(const RecTauFormat& tau, unsigned int partNum) | ||
3570 | 378 | { | ||
3571 | 379 | // Particle number | ||
3572 | 380 | *output_ << std::setw(3) << std::right << partNum; | ||
3573 | 381 | *output_ << " "; | ||
3574 | 382 | |||
3575 | 383 | // Particle type | ||
3576 | 384 | *output_ << std::setw(3) << std::right << 3; | ||
3577 | 385 | *output_ << " "; | ||
3578 | 386 | |||
3579 | 387 | // eta | ||
3580 | 388 | *output_ << std::setw(18) << std::right | ||
3581 | 389 | << LHCOWriter::FortranFormat_DoublePrecision(tau.momentum().Eta()) << " "; | ||
3582 | 390 | |||
3583 | 391 | // phi | ||
3584 | 392 | *output_ << std::setw(18) << std::right | ||
3585 | 393 | << LHCOWriter::FortranFormat_DoublePrecision(tau.momentum().Phi()) << " "; | ||
3586 | 394 | |||
3587 | 395 | // pt | ||
3588 | 396 | *output_ << std::setw(18) << std::right | ||
3589 | 397 | << LHCOWriter::FortranFormat_DoublePrecision(tau.momentum().Pt()) << " "; | ||
3590 | 398 | |||
3591 | 399 | // mass | ||
3592 | 400 | *output_ << std::setw(18) << std::right | ||
3593 | 401 | << LHCOWriter::FortranFormat_DoublePrecision(tau.momentum().M()) << " "; | ||
3594 | 402 | |||
3595 | 403 | // electric charge | ||
3596 | 404 | if (tau.charge()>0) *output_ << " +1.0 "; | ||
3597 | 405 | else *output_ << " -1.0 "; | ||
3598 | 406 | |||
3599 | 407 | // HE/EE | ||
3600 | 408 | *output_ << std::setw(18) << std::right | ||
3601 | 409 | << LHCOWriter::FortranFormat_DoublePrecision(tau.HEoverEE()) << " "; | ||
3602 | 410 | |||
3603 | 411 | // dummy1 & dummy2 | ||
3604 | 412 | *output_ << "0.00 0.00"; | ||
3605 | 413 | |||
3606 | 414 | // end | ||
3607 | 415 | *output_ << std::endl; | ||
3608 | 416 | } | ||
3609 | 417 | |||
3610 | 418 | void LHCOWriter::WriteMET(const ParticleBaseFormat& met, unsigned int partNum) | ||
3611 | 419 | { | ||
3612 | 420 | // Particle number | ||
3613 | 421 | *output_ << std::setw(3) << std::right << partNum; | ||
3614 | 422 | *output_ << " "; | ||
3615 | 423 | |||
3616 | 424 | // Particle type | ||
3617 | 425 | *output_ << std::setw(3) << std::right << 6; | ||
3618 | 426 | *output_ << " "; | ||
3619 | 427 | |||
3620 | 428 | // no eta for met | ||
3621 | 429 | *output_ << std::setw(18) << std::right | ||
3622 | 430 | << LHCOWriter::FortranFormat_DoublePrecision(0) | ||
3623 | 431 | << " "; | ||
3624 | 432 | |||
3625 | 433 | // phi | ||
3626 | 434 | *output_ << std::setw(18) << std::right | ||
3627 | 435 | << LHCOWriter::FortranFormat_DoublePrecision(met.phi()) | ||
3628 | 436 | << " "; | ||
3629 | 437 | |||
3630 | 438 | // et | ||
3631 | 439 | *output_ << std::setw(18) << std::right | ||
3632 | 440 | << LHCOWriter::FortranFormat_DoublePrecision(met.et()) | ||
3633 | 441 | << " "; | ||
3634 | 442 | |||
3635 | 443 | // dummy1 & dummy2 | ||
3636 | 444 | *output_ << "0.00 0.00"; | ||
3637 | 445 | |||
3638 | 446 | // end | ||
3639 | 447 | *output_ << std::endl; | ||
3689 | 448 | } | 314 | } |
3690 | 449 | 315 | ||
3691 | === modified file 'tools/SampleAnalyzer/Writer/LHCOWriter.h' | |||
3692 | --- tools/SampleAnalyzer/Writer/LHCOWriter.h 2013-05-17 06:19:22 +0000 | |||
3693 | +++ tools/SampleAnalyzer/Writer/LHCOWriter.h 2013-06-13 12:22:26 +0000 | |||
3694 | @@ -32,6 +32,7 @@ | |||
3695 | 32 | 32 | ||
3696 | 33 | // SampleAnalyzer headers | 33 | // SampleAnalyzer headers |
3697 | 34 | #include "SampleAnalyzer/Writer/WriterTextBase.h" | 34 | #include "SampleAnalyzer/Writer/WriterTextBase.h" |
3698 | 35 | #include "SampleAnalyzer/Writer/LHCOParticleFormat.h" | ||
3699 | 35 | 36 | ||
3700 | 36 | namespace MA5 | 37 | namespace MA5 |
3701 | 37 | { | 38 | { |
3702 | @@ -44,7 +45,7 @@ | |||
3703 | 44 | // ------------------------------------------------------------- | 45 | // ------------------------------------------------------------- |
3704 | 45 | protected: | 46 | protected: |
3705 | 46 | 47 | ||
3707 | 47 | 48 | UInt_t counter_; | |
3708 | 48 | 49 | ||
3709 | 49 | // ------------------------------------------------------------- | 50 | // ------------------------------------------------------------- |
3710 | 50 | // method members | 51 | // method members |
3711 | @@ -53,7 +54,7 @@ | |||
3712 | 53 | 54 | ||
3713 | 54 | /// Constructor without argument | 55 | /// Constructor without argument |
3714 | 55 | LHCOWriter() : WriterTextBase() | 56 | LHCOWriter() : WriterTextBase() |
3716 | 56 | {} | 57 | { counter_=0; } |
3717 | 57 | 58 | ||
3718 | 58 | /// Destructor | 59 | /// Destructor |
3719 | 59 | virtual ~LHCOWriter() | 60 | virtual ~LHCOWriter() |
3720 | @@ -71,17 +72,15 @@ | |||
3721 | 71 | 72 | ||
3722 | 72 | private: | 73 | private: |
3723 | 73 | 74 | ||
3724 | 74 | static std::string FortranFormat_SimplePrecision(Float_t value,UInt_t precision=7); | ||
3725 | 75 | static std::string FortranFormat_DoublePrecision(Double_t value,UInt_t precision=11); | ||
3726 | 76 | 75 | ||
3727 | 77 | // Writing a reconstructed jet | 76 | // Writing a reconstructed jet |
3728 | 78 | 77 | ||
3735 | 79 | bool WriteEventHeader(const SampleFormat& mySample,unsigned int); | 78 | void WriteJet(const RecJetFormat& jet, LHCOParticleFormat* lhco); |
3736 | 80 | void WriteJet(const RecJetFormat& jet,unsigned int); | 79 | void WriteMuon(const RecLeptonFormat& muon, LHCOParticleFormat* lhco, const RecEventFormat* myEvent, unsigned int npart); |
3737 | 81 | void WriteMuon(const RecLeptonFormat& muon,unsigned int); | 80 | void WriteElectron(const RecLeptonFormat& electron, LHCOParticleFormat* lhco); |
3738 | 82 | void WriteElectron(const RecLeptonFormat& electron,unsigned int); | 81 | void WritePhoton(const RecPhotonFormat& photon, LHCOParticleFormat* lhco); |
3739 | 83 | void WriteTau(const RecTauFormat& tau,unsigned int); | 82 | void WriteTau(const RecTauFormat& tau, LHCOParticleFormat* lhco); |
3740 | 84 | void WriteMET(const ParticleBaseFormat& met,unsigned int); | 83 | void WriteMET(const ParticleBaseFormat& met, LHCOParticleFormat* lhco); |
3741 | 85 | 84 | ||
3742 | 86 | 85 | ||
3743 | 87 | }; | 86 | }; |
3744 | 88 | 87 | ||
3745 | === added file 'tools/SampleAnalyzer/Writer/LHEParticleFormat.cpp' | |||
3746 | --- tools/SampleAnalyzer/Writer/LHEParticleFormat.cpp 1970-01-01 00:00:00 +0000 | |||
3747 | +++ tools/SampleAnalyzer/Writer/LHEParticleFormat.cpp 2013-06-13 12:22:26 +0000 | |||
3748 | @@ -0,0 +1,115 @@ | |||
3749 | 1 | //////////////////////////////////////////////////////////////////////////////// | ||
3750 | 2 | // | ||
3751 | 3 | // Copyright (C) 2012-2013 Eric Conte, Benjamin Fuks | ||
3752 | 4 | // The MadAnalysis development team, email: <ma5team@iphc.cnrs.fr> | ||
3753 | 5 | // | ||
3754 | 6 | // This file is part of MadAnalysis 5. | ||
3755 | 7 | // Official website: <https://launchpad.net/madanalysis5> | ||
3756 | 8 | // | ||
3757 | 9 | // MadAnalysis 5 is free software: you can redistribute it and/or modify | ||
3758 | 10 | // it under the terms of the GNU General Public License as published by | ||
3759 | 11 | // the Free Software Foundation, either version 3 of the License, or | ||
3760 | 12 | // (at your option) any later version. | ||
3761 | 13 | // | ||
3762 | 14 | // MadAnalysis 5 is distributed in the hope that it will be useful, | ||
3763 | 15 | // but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
3764 | 16 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
3765 | 17 | // GNU General Public License for more details. | ||
3766 | 18 | // | ||
3767 | 19 | // You should have received a copy of the GNU General Public License | ||
3768 | 20 | // along with MadAnalysis 5. If not, see <http://www.gnu.org/licenses/> | ||
3769 | 21 | // | ||
3770 | 22 | //////////////////////////////////////////////////////////////////////////////// | ||
3771 | 23 | |||
3772 | 24 | |||
3773 | 25 | // STL headers | ||
3774 | 26 | #include <sstream> | ||
3775 | 27 | #include <iomanip> | ||
3776 | 28 | #include <cstdlib> | ||
3777 | 29 | |||
3778 | 30 | // SampleAnalyzer headers | ||
3779 | 31 | #include "SampleAnalyzer/Writer/LHEParticleFormat.h" | ||
3780 | 32 | |||
3781 | 33 | using namespace MA5; | ||
3782 | 34 | |||
3783 | 35 | |||
3784 | 36 | // ----------------------------------------------------------------------------- | ||
3785 | 37 | // FortranFormat_SimplePrecision | ||
3786 | 38 | // ----------------------------------------------------------------------------- | ||
3787 | 39 | std::string LHEParticleFormat::FortranFormat_SimplePrecision(Float_t value,UInt_t precision) | ||
3788 | 40 | { | ||
3789 | 41 | std::stringstream str; | ||
3790 | 42 | str.precision(precision); | ||
3791 | 43 | std::string word; | ||
3792 | 44 | |||
3793 | 45 | Bool_t negative=false; | ||
3794 | 46 | if (value<0) {negative=true; value*=-1;} | ||
3795 | 47 | |||
3796 | 48 | Int_t exponent = 0; | ||
3797 | 49 | if (value!=0) | ||
3798 | 50 | { | ||
3799 | 51 | for (; value > 1.0; exponent++) value/=10.; | ||
3800 | 52 | for (; value < 0.0; exponent--) value*=10.; | ||
3801 | 53 | } | ||
3802 | 54 | |||
3803 | 55 | str << std::uppercase << std::fixed << value << "E"; | ||
3804 | 56 | if (exponent>=0) str << "+"; else str << "-"; | ||
3805 | 57 | if (std::abs(exponent)<10) str << "0"; | ||
3806 | 58 | str << std::abs(exponent); | ||
3807 | 59 | str >> word; | ||
3808 | 60 | if (!negative) return word; | ||
3809 | 61 | else return "-"+word; | ||
3810 | 62 | } | ||
3811 | 63 | |||
3812 | 64 | |||
3813 | 65 | // ----------------------------------------------------------------------------- | ||
3814 | 66 | // FortranFormat_DoublePrecision | ||
3815 | 67 | // ----------------------------------------------------------------------------- | ||
3816 | 68 | std::string LHEParticleFormat::FortranFormat_DoublePrecision(Double_t value,UInt_t precision) | ||
3817 | 69 | { | ||
3818 | 70 | std::stringstream str; | ||
3819 | 71 | str.precision(precision); | ||
3820 | 72 | std::string word; | ||
3821 | 73 | |||
3822 | 74 | Bool_t negative=false; | ||
3823 | 75 | if (value<0) {negative=true; value*=-1;} | ||
3824 | 76 | |||
3825 | 77 | Int_t exponent = 0; | ||
3826 | 78 | if (value!=0) | ||
3827 | 79 | { | ||
3828 | 80 | for (; value > 1.0; exponent++) value/=10.; | ||
3829 | 81 | for (; value < 0.0; exponent--) value*=10.; | ||
3830 | 82 | } | ||
3831 | 83 | |||
3832 | 84 | str << std::uppercase << std::fixed << value << "E"; | ||
3833 | 85 | if (exponent>=0) str << "+"; else str << "-"; | ||
3834 | 86 | if (std::abs(exponent)<10) str << "0"; | ||
3835 | 87 | str << std::abs(exponent); | ||
3836 | 88 | str >> word; | ||
3837 | 89 | if (!negative) return word; | ||
3838 | 90 | else return "-"+word; | ||
3839 | 91 | } | ||
3840 | 92 | |||
3841 | 93 | |||
3842 | 94 | // ----------------------------------------------------------------------------- | ||
3843 | 95 | // Print a particle line | ||
3844 | 96 | // ----------------------------------------------------------------------------- | ||
3845 | 97 | void LHEParticleFormat::Print(UInt_t num, std::ostream* out) | ||
3846 | 98 | { | ||
3847 | 99 | *out << std::setw(9) << std::right << id << " "; | ||
3848 | 100 | *out << std::setw(4) << std::right << status << " "; | ||
3849 | 101 | *out << std::setw(4) << std::right << mother1 << " "; | ||
3850 | 102 | *out << std::setw(4) << std::right << mother2 << " "; | ||
3851 | 103 | *out << std::setw(4) << std::right << color1 << " "; | ||
3852 | 104 | *out << std::setw(4) << std::right << color2 << " "; | ||
3853 | 105 | *out << std::setw(18) << std::right << FortranFormat_DoublePrecision(px) << " "; | ||
3854 | 106 | *out << std::setw(18) << std::right << FortranFormat_DoublePrecision(py) << " "; | ||
3855 | 107 | *out << std::setw(18) << std::right << FortranFormat_DoublePrecision(pz) << " "; | ||
3856 | 108 | *out << std::setw(18) << std::right << FortranFormat_DoublePrecision(e) << " "; | ||
3857 | 109 | *out << std::setw(18) << std::right << FortranFormat_DoublePrecision(m) << " "; | ||
3858 | 110 | *out << std::setw(2) << std::right << std::showpoint << ctau << " "; | ||
3859 | 111 | *out << std::setw(3) << std::right << std::showpoint << spin; | ||
3860 | 112 | *out << std::endl; | ||
3861 | 113 | } | ||
3862 | 114 | |||
3863 | 115 | |||
3864 | 0 | 116 | ||
3865 | === added file 'tools/SampleAnalyzer/Writer/LHEParticleFormat.h' | |||
3866 | --- tools/SampleAnalyzer/Writer/LHEParticleFormat.h 1970-01-01 00:00:00 +0000 | |||
3867 | +++ tools/SampleAnalyzer/Writer/LHEParticleFormat.h 2013-06-13 12:22:26 +0000 | |||
3868 | @@ -0,0 +1,71 @@ | |||
3869 | 1 | //////////////////////////////////////////////////////////////////////////////// | ||
3870 | 2 | // | ||
3871 | 3 | // Copyright (C) 2012-2013 Eric Conte, Benjamin Fuks | ||
3872 | 4 | // The MadAnalysis development team, email: <ma5team@iphc.cnrs.fr> | ||
3873 | 5 | // | ||
3874 | 6 | // This file is part of MadAnalysis 5. | ||
3875 | 7 | // Official website: <https://launchpad.net/madanalysis5> | ||
3876 | 8 | // | ||
3877 | 9 | // MadAnalysis 5 is free software: you can redistribute it and/or modify | ||
3878 | 10 | // it under the terms of the GNU General Public License as published by | ||
3879 | 11 | // the Free Software Foundation, either version 3 of the License, or | ||
3880 | 12 | // (at your option) any later version. | ||
3881 | 13 | // | ||
3882 | 14 | // MadAnalysis 5 is distributed in the hope that it will be useful, | ||
3883 | 15 | // but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
3884 | 16 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
3885 | 17 | // GNU General Public License for more details. | ||
3886 | 18 | // | ||
3887 | 19 | // You should have received a copy of the GNU General Public License | ||
3888 | 20 | // along with MadAnalysis 5. If not, see <http://www.gnu.org/licenses/> | ||
3889 | 21 | // | ||
3890 | 22 | //////////////////////////////////////////////////////////////////////////////// | ||
3891 | 23 | |||
3892 | 24 | |||
3893 | 25 | #ifndef LHE_PARTICLE_FORMAT_h | ||
3894 | 26 | #define LHE_PARTICLE_FORMAT_h | ||
3895 | 27 | |||
3896 | 28 | // STL headers | ||
3897 | 29 | #include <iostream> | ||
3898 | 30 | #include <string> | ||
3899 | 31 | |||
3900 | 32 | // ROOT headers | ||
3901 | 33 | #include <Rtypes.h> | ||
3902 | 34 | |||
3903 | 35 | namespace MA5 | ||
3904 | 36 | { | ||
3905 | 37 | |||
3906 | 38 | class LHEParticleFormat | ||
3907 | 39 | { | ||
3908 | 40 | |||
3909 | 41 | // ------------------------------------------------------------- | ||
3910 | 42 | // data members | ||
3911 | 43 | // ------------------------------------------------------------- | ||
3912 | 44 | public: | ||
3913 | 45 | |||
3914 | 46 | Int_t id; | ||
3915 | 47 | Int_t status; | ||
3916 | 48 | UInt_t mother1; | ||
3917 | 49 | UInt_t mother2; | ||
3918 | 50 | UInt_t color1; | ||
3919 | 51 | UInt_t color2; | ||
3920 | 52 | Float_t px; | ||
3921 | 53 | Float_t py; | ||
3922 | 54 | Float_t pz; | ||
3923 | 55 | Float_t e; | ||
3924 | 56 | Float_t m; | ||
3925 | 57 | Float_t ctau; | ||
3926 | 58 | Float_t spin; | ||
3927 | 59 | |||
3928 | 60 | static std::string FortranFormat_SimplePrecision(Float_t value, | ||
3929 | 61 | UInt_t precision=7); | ||
3930 | 62 | static std::string FortranFormat_DoublePrecision(Double_t value, | ||
3931 | 63 | UInt_t precision=11); | ||
3932 | 64 | |||
3933 | 65 | void Print(UInt_t num, std::ostream* out); | ||
3934 | 66 | }; | ||
3935 | 67 | |||
3936 | 68 | |||
3937 | 69 | } | ||
3938 | 70 | |||
3939 | 71 | #endif | ||
3940 | 0 | 72 | ||
3941 | === modified file 'tools/SampleAnalyzer/Writer/LHEWriter.cpp' | |||
3942 | --- tools/SampleAnalyzer/Writer/LHEWriter.cpp 2013-05-17 06:19:22 +0000 | |||
3943 | +++ tools/SampleAnalyzer/Writer/LHEWriter.cpp 2013-06-13 12:22:26 +0000 | |||
3944 | @@ -88,16 +88,14 @@ | |||
3945 | 88 | // Opening tag | 88 | // Opening tag |
3946 | 89 | *output_ << "<LesHouchesEvents version=""1.0"">" << std::endl; | 89 | *output_ << "<LesHouchesEvents version=""1.0"">" << std::endl; |
3947 | 90 | 90 | ||
3949 | 91 | // Header block | 91 | // Header tag |
3950 | 92 | *output_ << "<header>" << std::endl; | 92 | *output_ << "<header>" << std::endl; |
3951 | 93 | *output_ << "<!--" << std::endl; | 93 | *output_ << "<!--" << std::endl; |
3959 | 94 | *output_ << "#*********************************************************************" << std::endl; | 94 | |
3960 | 95 | *output_ << "# *" << std::endl; | 95 | // MA5 logo |
3961 | 96 | *output_ << "# This file has been produced by MadAnalysis 5 *" << std::endl; | 96 | WriteMA5header(); |
3962 | 97 | *output_ << "# *" << std::endl; | 97 | |
3963 | 98 | *output_ << "#....................................................................*" << std::endl; | 98 | // LHE format |
3957 | 99 | *output_ << "" << std::endl; | ||
3958 | 100 | // Explanation about the Simplified LHE | ||
3964 | 101 | if (mySample.rec()!=0) | 99 | if (mySample.rec()!=0) |
3965 | 102 | { | 100 | { |
3966 | 103 | *output_ << "<MA5Format> Simplified LHE format </MA5Format>" << std::endl; | 101 | *output_ << "<MA5Format> Simplified LHE format </MA5Format>" << std::endl; |
3967 | @@ -106,79 +104,106 @@ | |||
3968 | 106 | { | 104 | { |
3969 | 107 | *output_ << "<MA5Format> LHE format </MA5Format>" << std::endl; | 105 | *output_ << "<MA5Format> LHE format </MA5Format>" << std::endl; |
3970 | 108 | } | 106 | } |
3971 | 107 | |||
3972 | 108 | // Python interface version | ||
3973 | 109 | *output_ << "<MadAnalysis5Version> " << cfg_->GetPythonInterfaceVersion() | ||
3974 | 110 | << " " << cfg_->GetPythonInterfaceDate() | ||
3975 | 111 | << "</MadAnalysis5Version>" << std::endl; | ||
3976 | 112 | |||
3977 | 113 | // SampleAnalyzer version | ||
3978 | 114 | *output_ << "<SampleAnalyzerVersion> "<< cfg_->GetSampleAnalyzerVersion() | ||
3979 | 115 | << " " << cfg_->GetSampleAnalyzerVersion() | ||
3980 | 116 | << " </SampleAnalyzerVersion>" << std::endl; | ||
3981 | 117 | |||
3982 | 118 | // Explanation about the LHE | ||
3983 | 109 | *output_ << "<FormatDescription>" << std::endl; | 119 | *output_ << "<FormatDescription>" << std::endl; |
4032 | 110 | *output_ << "The original Les Houches Event (LHE) format is defined in hep-ph/0609017" << std::endl; | 120 | *output_ << "#################################################################################" << std::endl; |
4033 | 111 | *output_ << "" << std::endl; | 121 | *output_ << "# The original Les Houches Event (LHE) format is defined in hep-ph/0609017 #" << std::endl; |
4034 | 112 | *output_ << "The <init> ... </init> block contains global information about the samples given as a single line:" << std::endl; | 122 | *output_ << "#################################################################################" << std::endl; |
4035 | 113 | *output_ << " IDBMUP1 IDBMUP2 EBMUP1 EBMUP2 PDFGUP1 PDFGUP2 PDFSUP1 PDFSUP1 PDFSUP2 IDWTUP NPRUP" << std::endl; | 123 | *output_ << "# The <init> ... </init> block contains global information about the samples #" << std::endl; |
4036 | 114 | *output_ << "with:" << std::endl; | 124 | *output_ << "# given as a single line: #" << std::endl; |
4037 | 115 | *output_ << " - IDBMUP1: PDG code of the first beam" << std::endl; | 125 | *output_ << "# IDBM1 IDBM2 EBM1 EBM2 PDFG1 PDFG2 PDFS1 PDFS1 PDFS2 IDWT NPR #" << std::endl; |
4038 | 116 | *output_ << " - IDBMUP2: PDG code of the second beam" << std::endl; | 126 | *output_ << "# with: #" << std::endl; |
4039 | 117 | *output_ << " - EBMUP1: energy of the first beam" << std::endl; | 127 | *output_ << "# - IDBM1: PDG code of the first beam. #" << std::endl; |
4040 | 118 | *output_ << " - EBMUP2: energy of the second beam" << std::endl; | 128 | *output_ << "# - IDBM2: PDG code of the second beam. #" << std::endl; |
4041 | 119 | *output_ << " - PDFGUP1: author group of the PDF employed for the first beam" << std::endl; | 129 | *output_ << "# - EBM1: energy of the first beam. #" << std::endl; |
4042 | 120 | *output_ << " - PDFGUP2: author group of the PDF employed for the second beam" << std::endl; | 130 | *output_ << "# - EBM2: energy of the second beam. #" << std::endl; |
4043 | 121 | *output_ << " - PDFSUP1: id of the PDF set employed for the first beam" << std::endl; | 131 | *output_ << "# - PDFG1: author group of the PDF employed for the first beam. #" << std::endl; |
4044 | 122 | *output_ << " - PDFSUP2: id of the PDF set employed for the second beam" << std::endl; | 132 | *output_ << "# - PDFG2: author group of the PDF employed for the second beam. #" << std::endl; |
4045 | 123 | *output_ << " - IDWTUP: weighting strategy" << std::endl; | 133 | *output_ << "# - PDFS1: id of the PDF set employed for the first beam. #" << std::endl; |
4046 | 124 | *output_ << " - NPRUP: number of physics processes involved during the generation of the sample" << std::endl; | 134 | *output_ << "# - PDFS2: id of the PDF set employed for the second beam. #" << std::endl; |
4047 | 125 | *output_ << "; the following lines give detailed process information (one line for each process):" << std::endl; | 135 | *output_ << "# - IDWT: weighting strategy. #" << std::endl; |
4048 | 126 | *output_ << " XSECUP XERRUP XMAXUP LPRUP" << std::endl; | 136 | *output_ << "# - NPR: number of physics processes involved during the generation of #" << std::endl; |
4049 | 127 | *output_<< "with:" << std::endl; | 137 | *output_ << "# the sample. #" << std::endl; |
4050 | 128 | *output_ << " - XSECUP: cross section" << std::endl; | 138 | *output_ << "# The following lines give detailed process information (one line for each #" << std::endl; |
4051 | 129 | *output_ << " - XERRUP: cross section error" << std::endl; | 139 | *output_ << "# process): #" << std::endl; |
4052 | 130 | *output_ << " - XMAXUP: maximum event weight" << std::endl; | 140 | *output_ << "# XSEC XERR XMAX LPR #" << std::endl; |
4053 | 131 | *output_ << " - LPRUP: process id" << std::endl; | 141 | *output_ << "# with: #" << std::endl; |
4054 | 132 | *output_ << "" << std::endl; | 142 | *output_ << "# - XSEC: cross section #" << std::endl; |
4055 | 133 | *output_ << "Each event is described by an <event> ... </event> block. This block always starts by a single line containing general information on the event:" << std::endl; | 143 | *output_ << "# - XERR: cross section error #" << std::endl; |
4056 | 134 | *output_ << " NUP IDPRUP XWGTUP SCALUP AQEDUP AQCDUP" << std::endl; | 144 | *output_ << "# - XMAX: maximum event weight #" << std::endl; |
4057 | 135 | *output_ << "with:" << std::endl; | 145 | *output_ << "# - LPR: process id #" << std::endl; |
4058 | 136 | *output_ << " - NUP: number of particles" << std::endl; | 146 | *output_ << "#################################################################################" << std::endl; |
4059 | 137 | *output_ << " - IDPRUP: process id" << std::endl; | 147 | *output_ << "# Each event is described by an <event> ... </event> block. This block always #" << std::endl; |
4060 | 138 | *output_ << " - XWGTUP: event weight" << std::endl; | 148 | *output_ << "# starts by a single line containing general information on the event: #" << std::endl; |
4061 | 139 | *output_ << " - SCALUP: scale" << std::endl; | 149 | *output_ << "# N IDPR XWGT SCAL AQED AQCD #" << std::endl; |
4062 | 140 | *output_ << " - AQEDUP: alpha QED" << std::endl; | 150 | *output_ << "# with: #" << std::endl; |
4063 | 141 | *output_ << " - AQCDUP: alpha QCD" << std::endl; | 151 | *output_ << "# - N: number of particles #" << std::endl; |
4064 | 142 | *output_ << "This line is then followed by one line for each particle in the event:" << std::endl; | 152 | *output_ << "# - IDPR: process id #" << std::endl; |
4065 | 143 | *output_ << " IDUP ISTUP MOTHUP1 MOTHUP2 ICOLUP1 ICOLUP2 PUP1 PUP2 PUP3 PUP4 PUP5 VTIMUP SPINUP" << std::endl; | 153 | *output_ << "# - XWGT: event weight #" << std::endl; |
4066 | 144 | *output_ << "with:" << std::endl; | 154 | *output_ << "# - SCAL: scale #" << std::endl; |
4067 | 145 | *output_ << " - IDUP: PDG code" << std::endl; | 155 | *output_ << "# - AQED: alpha QED #" << std::endl; |
4068 | 146 | *output_ << " - ISTUP: status code" << std::endl; | 156 | *output_ << "# - AQCD: alpha QCD #" << std::endl; |
4069 | 147 | *output_ << " - MOTHUP1: index of the first mother particle" << std::endl; | 157 | *output_ << "# This line is then followed by one line for each particle in the event: #" << std::endl; |
4070 | 148 | *output_ << " - MOTHUP2: index of the second mother particle" << std::endl; | 158 | *output_ << "# ID IST MOTH1 MOTH2 ICOL1 ICOL2 P1 P2 P3 P4 P5 VTIM SPIN #" << std::endl; |
4071 | 149 | *output_ << " - ICOLUP1: first color tag" << std::endl; | 159 | *output_ << "# with: #" << std::endl; |
4072 | 150 | *output_ << " - ICOLUP2: second color tag" << std::endl; | 160 | *output_ << "# - ID: PDG code #" << std::endl; |
4073 | 151 | *output_ << " - PUP1: PX [GeV/c]" << std::endl; | 161 | *output_ << "# - IST: status code #" << std::endl; |
4074 | 152 | *output_ << " - PUP2: PY [GeV/c]" << std::endl; | 162 | *output_ << "# - MOTH1: row number corresponding to the first mother particle #" << std::endl; |
4075 | 153 | *output_ << " - PUP3: PZ [GeV/c]" << std::endl; | 163 | *output_ << "# - MOTH2: row number corresponding to the second mother particle #" << std::endl; |
4076 | 154 | *output_ << " - PUP4: E [GeV]" << std::endl; | 164 | *output_ << "# - ICOL1: first color tag #" << std::endl; |
4077 | 155 | *output_ << " - PUP5: M [GeV/c^2] (a space-like virtuality is denoted by a negative mass)" << std::endl; | 165 | *output_ << "# - ICOL2: second color tag #" << std::endl; |
4078 | 156 | *output_ << " - VTIMUP: c tau" << std::endl; | 166 | *output_ << "# - P1: PX #" << std::endl; |
4079 | 157 | *output_ << " - SPINUP: cosine of the angle between the spin vector of the particle and its three-momentum" << std::endl; | 167 | *output_ << "# - P2: PY #" << std::endl; |
4080 | 168 | *output_ << "# - P3: PZ #" << std::endl; | ||
4081 | 169 | *output_ << "# - P4: E #" << std::endl; | ||
4082 | 170 | *output_ << "# - P5: M (a space-like virtuality is denoted by a negative mass) #" << std::endl; | ||
4083 | 171 | *output_ << "# - VTIM: c tau #" << std::endl; | ||
4084 | 172 | *output_ << "# - SPIN: cosine of the angle between the spin vector of the particle and #" << std::endl; | ||
4085 | 173 | *output_ << "# its three-momentum #" << std::endl; | ||
4086 | 174 | *output_ << "#################################################################################" << std::endl; | ||
4087 | 158 | 175 | ||
4088 | 159 | // Explanation about the Simplified LHE | 176 | // Explanation about the Simplified LHE |
4089 | 160 | if (mySample.rec()!=0) | 177 | if (mySample.rec()!=0) |
4090 | 161 | { | 178 | { |
4111 | 162 | *output_ << "" << std::endl; | 179 | *output_ << "# In the 'simplified LHE' format, there are three types of objects classified #" << std::endl; |
4112 | 163 | *output_ << "In the 'simplified LHE' format, there are three types of objects classified according to their statuscode:" << std::endl; | 180 | *output_ << "# according to their statuscode: #" << std::endl; |
4113 | 164 | *output_ << " - Objects with StatusCode = -1: initial interacting partons" << std::endl; | 181 | *output_ << "# - objects with StatusCode = -1: initial interacting partons. #" << std::endl; |
4114 | 165 | *output_ << " - Objects with StatusCode = +3: particles produced during the hard process" << std::endl; | 182 | *output_ << "# - objects with StatusCode = +3: particles produced during the hard process. #" << std::endl; |
4115 | 166 | *output_ << " - Objects with StatusCode = +1: reconstructed objects (after applying a fast simulation of a (possibly perfect) detector and a jet-clustering algorithm" << std::endl; | 183 | *output_ << "# - objects with StatusCode = +1: physics objects reconstructed by a fast #" << std::endl; |
4116 | 167 | *output_ << "When MadAnalysis is in charge of the reconstruction (i.e., applying the jet-clustering algorithm), the particle codes follow the conventions:" << std::endl; | 184 | *output_ << "# detector simulation (or perfect detector). #" << std::endl; |
4117 | 168 | *output_ << " - particle with a PDG code = +11 or -11: electrons and positrons." <<std::endl; | 185 | *output_ << "# When MadAnalysis is in charge of the reconstruction (i.e., applying the #" << std::endl; |
4118 | 169 | *output_ << " They can be isolated or not as well aspossibly issued from the hadronization process." << std::endl; | 186 | *output_ << "# jet-clustering algorithm), the particle codes follow the conventions: #" << std::endl; |
4119 | 170 | *output_ << " - particle with a PDG code = +13 or -13: muons and antimuons." << std::endl; | 187 | *output_ << "# - particle with a PDG code = +11 or -11: electrons and positrons. #" << std::endl; |
4120 | 171 | *output_ << " They can be isolated or not as well aspossibly issued from the hadronization process." << std::endl; | 188 | *output_ << "# They can be isolated or not as well as possibly issued from the #" << std::endl; |
4121 | 172 | *output_ << " - particle with a PDG code = +15 or -15: hadronically decaying (anti)taus." << std::endl; | 189 | *output_ << "# hadronization process. #" << std::endl; |
4122 | 173 | *output_ << " These consist of jets matching a hadronically decaying tau when inspecting the Monte Carlo history." << std::endl; | 190 | *output_ << "# - particle with a PDG code = +13 or -13: muons and antimuons. #" << std::endl; |
4123 | 174 | *output_ << " (Mis)Identification efficiency can be possibly included." << std::endl; | 191 | *output_ << "# They can be isolated or not as well as possibly issued from the #" << std::endl; |
4124 | 175 | *output_ << " - particle with a PDG code = 5: b-jets." << std::endl; | 192 | *output_ << "# hadronization process. #" << std::endl; |
4125 | 176 | *output_ << " These consist of jets matching a b-quark when inspecting the Monte Carlo history." << std::endl; | 193 | *output_ << "# - particle with a PDG code = +15 or -15: hadronically decaying (anti)taus. #" << std::endl; |
4126 | 177 | *output_ << " (Mis)Identification efficiency can be possibly included." << std::endl; | 194 | *output_ << "# These consist of jets matching a hadronically-decaying tau when #" << std::endl; |
4127 | 178 | *output_ << " - particle with a PDG code = 21: jets which are not b-tagged and taus which are not tau-tagged." << std::endl; | 195 | *output_ << "# inspecting the Monte Carlo history. (Mis)Identification efficiency can be #" << std::endl; |
4128 | 179 | *output_ << " the jet collection includes also electrons collection and hadronic taus collection" << std::endl; | 196 | *output_ << "# possibly included. #" << std::endl; |
4129 | 180 | *output_ << " - particle with a PDG code = 12: the missing transverse energy." << std::endl; | 197 | *output_ << "# - particle with a PDG code = 5: b-jets. #" << std::endl; |
4130 | 181 | *output_ << " The missing transverse energy is computed as opposite to the sum of the four-momenta of all jets, electrons, muons and hadronic taus." << std::endl; | 198 | *output_ << "# These consist of jets matching a b-quark when inspecting the Monte Carlo #" << std::endl; |
4131 | 199 | *output_ << "# history. (Mis)Identification efficiency can be possibly included. #" << std::endl; | ||
4132 | 200 | *output_ << "# - particle with a PDG code = 21: jets which are not b-tagged and taus which #" << std::endl; | ||
4133 | 201 | *output_ << "# are not tau-tagged. The jet collection includes also electrons collection #" << std::endl; | ||
4134 | 202 | *output_ << "# and hadronic taus collection #" << std::endl; | ||
4135 | 203 | *output_ << "# - particle with a PDG code = 12: the missing transverse energy. #" << std::endl; | ||
4136 | 204 | *output_ << "# The missing transverse energy is computed as opposite to the sum of the #" << std::endl; | ||
4137 | 205 | *output_ << "# four-momenta of all jets, electrons, muons and hadronic taus. #" << std::endl; | ||
4138 | 206 | *output_ << "#################################################################################" << std::endl; | ||
4139 | 182 | } | 207 | } |
4140 | 183 | *output_ << "</FormatDescription>" << std::endl; | 208 | *output_ << "</FormatDescription>" << std::endl; |
4141 | 184 | if (mySample.mc()!=0) | 209 | if (mySample.mc()!=0) |
4142 | @@ -279,59 +304,43 @@ | |||
4143 | 279 | // Event header | 304 | // Event header |
4144 | 280 | *output_ << "<event>" << std::endl; | 305 | *output_ << "<event>" << std::endl; |
4145 | 281 | 306 | ||
4147 | 282 | unsigned int counter = 0; | 307 | // Container for particles |
4148 | 308 | std::vector<LHEParticleFormat> particles; | ||
4149 | 309 | UInt_t counter=0; | ||
4150 | 283 | 310 | ||
4151 | 284 | // Writing MC particles : only MC info case | 311 | // Writing MC particles : only MC info case |
4152 | 285 | // -> hypothesis : input = LHE | 312 | // -> hypothesis : input = LHE |
4153 | 286 | if (myEvent.mc()!=0 && myEvent.rec()==0) | 313 | if (myEvent.mc()!=0 && myEvent.rec()==0) |
4154 | 287 | { | 314 | { |
4156 | 288 | for (unsigned int i=0;i<myEvent.mc()->particles().size();i++) counter ++; | 315 | counter += myEvent.mc()->particles().size(); |
4157 | 289 | } | 316 | } |
4158 | 290 | 317 | ||
4159 | 291 | // Writing MC particles : MC+REC info case | 318 | // Writing MC particles : MC+REC info case |
4160 | 292 | // -> hypothesis : input = HEP | 319 | // -> hypothesis : input = HEP |
4162 | 293 | if (myEvent.mc()!=0 && myEvent.rec()!=0) | 320 | else if (myEvent.mc()!=0 && myEvent.rec()!=0) |
4163 | 294 | { | 321 | { |
4165 | 295 | for (unsigned int i=4;i<myEvent.mc()->particles().size();i++) | 322 | for (unsigned int i=0;i<myEvent.mc()->particles().size();i++) |
4166 | 323 | { | ||
4167 | 296 | if (myEvent.mc()->particles()[i].statuscode()==3 || | 324 | if (myEvent.mc()->particles()[i].statuscode()==3 || |
4168 | 297 | ( myEvent.mc()->particles()[i].statuscode()>=21 && | 325 | ( myEvent.mc()->particles()[i].statuscode()>=21 && |
4169 | 298 | myEvent.mc()->particles()[i].statuscode()<=29) | 326 | myEvent.mc()->particles()[i].statuscode()<=29) |
4170 | 299 | ) counter++; | 327 | ) counter++; |
4171 | 328 | } | ||
4172 | 329 | |||
4173 | 300 | } | 330 | } |
4174 | 301 | 331 | ||
4175 | 302 | // Writing REC particles | 332 | // Writing REC particles |
4176 | 303 | if (myEvent.rec()!=0) | 333 | if (myEvent.rec()!=0) |
4177 | 304 | { | 334 | { |
4205 | 305 | if (myEvent.mc()==0) | 335 | counter += myEvent.rec()->muons().size() + |
4206 | 306 | { | 336 | myEvent.rec()->electrons().size() + |
4207 | 307 | for (unsigned int i=0;i<myEvent.rec()->muons().size();i++) | 337 | myEvent.rec()->taus().size() + |
4208 | 308 | counter++; | 338 | myEvent.rec()->photons().size() + |
4209 | 309 | for (unsigned int i=0;i<myEvent.rec()->electrons().size();i++) | 339 | myEvent.rec()->jets().size() + 1 /*MET*/; |
4183 | 310 | counter++; | ||
4184 | 311 | for (unsigned int i=0;i<myEvent.rec()->taus().size();i++) | ||
4185 | 312 | counter++; | ||
4186 | 313 | } | ||
4187 | 314 | else | ||
4188 | 315 | { | ||
4189 | 316 | for (unsigned int i=6;i<myEvent.mc()->particles().size();i++) | ||
4190 | 317 | { | ||
4191 | 318 | if ( (myEvent.mc()->particles()[i].statuscode()==3 || | ||
4192 | 319 | ( myEvent.mc()->particles()[i].statuscode()>=21 && | ||
4193 | 320 | myEvent.mc()->particles()[i].statuscode()<=29))&& ( | ||
4194 | 321 | fabs(myEvent.mc()->particles()[i].pdgid())==11 || | ||
4195 | 322 | fabs(myEvent.mc()->particles()[i].pdgid())==13 || | ||
4196 | 323 | fabs(myEvent.mc()->particles()[i].pdgid())==15 )) | ||
4197 | 324 | { | ||
4198 | 325 | counter++; | ||
4199 | 326 | } | ||
4200 | 327 | } | ||
4201 | 328 | } | ||
4202 | 329 | for (unsigned int i=0;i<myEvent.rec()->jets().size();i++) | ||
4203 | 330 | counter++; | ||
4204 | 331 | counter++; | ||
4210 | 332 | } | 340 | } |
4211 | 333 | 341 | ||
4212 | 334 | // Writing event global information | 342 | // Writing event global information |
4213 | 343 | particles.reserve(counter); | ||
4214 | 335 | WriteEventHeader(myEvent,counter); | 344 | WriteEventHeader(myEvent,counter); |
4215 | 336 | 345 | ||
4216 | 337 | // Writing MC particles : only MC info case | 346 | // Writing MC particles : only MC info case |
4217 | @@ -339,9 +348,14 @@ | |||
4218 | 339 | if (myEvent.mc()!=0 && myEvent.rec()==0) | 348 | if (myEvent.mc()!=0 && myEvent.rec()==0) |
4219 | 340 | { | 349 | { |
4220 | 341 | for (unsigned int i=0;i<myEvent.mc()->particles().size();i++) | 350 | for (unsigned int i=0;i<myEvent.mc()->particles().size();i++) |
4221 | 351 | { | ||
4222 | 352 | particles.push_back(LHEParticleFormat()); | ||
4223 | 342 | WriteParticle(myEvent.mc()->particles()[i], | 353 | WriteParticle(myEvent.mc()->particles()[i], |
4224 | 343 | myEvent.mc()->particles()[i].mothup1_, | 354 | myEvent.mc()->particles()[i].mothup1_, |
4226 | 344 | myEvent.mc()->particles()[i].mothup2_); | 355 | myEvent.mc()->particles()[i].mothup2_, |
4227 | 356 | 0, | ||
4228 | 357 | particles.back()); | ||
4229 | 358 | } | ||
4230 | 345 | } | 359 | } |
4231 | 346 | 360 | ||
4232 | 347 | // Writing MC particles : MC+REC info case | 361 | // Writing MC particles : MC+REC info case |
4233 | @@ -350,20 +364,22 @@ | |||
4234 | 350 | { | 364 | { |
4235 | 351 | for (unsigned int i=0;i<myEvent.mc()->particles().size();i++) | 365 | for (unsigned int i=0;i<myEvent.mc()->particles().size();i++) |
4236 | 352 | { | 366 | { |
4243 | 353 | if ( myEvent.mc()->particles()[i].statuscode()>=11 && | 367 | if ( myEvent.mc()->particles()[i].statuscode()==-1 || |
4244 | 354 | myEvent.mc()->particles()[i].statuscode()<=19 ) | 368 | ( myEvent.mc()->particles()[i].statuscode()>=11 && |
4245 | 355 | WriteParticle(myEvent.mc()->particles()[i],0,0,-1); | 369 | myEvent.mc()->particles()[i].statuscode()<=19 )) |
4246 | 356 | 370 | { | |
4247 | 357 | else if (i>3 && i<6 && myEvent.mc()->particles()[i].statuscode()==3) | 371 | particles.push_back(LHEParticleFormat()); |
4248 | 358 | WriteParticle(myEvent.mc()->particles()[i],0,0,-1); | 372 | WriteParticle(myEvent.mc()->particles()[i],0,0,-1, particles.back()); |
4249 | 373 | } | ||
4250 | 359 | 374 | ||
4251 | 360 | else if (myEvent.mc()->particles()[i].statuscode()==3 || | 375 | else if (myEvent.mc()->particles()[i].statuscode()==3 || |
4252 | 361 | ( myEvent.mc()->particles()[i].statuscode()>=21 && | 376 | ( myEvent.mc()->particles()[i].statuscode()>=21 && |
4253 | 362 | myEvent.mc()->particles()[i].statuscode()<=29)) | 377 | myEvent.mc()->particles()[i].statuscode()<=29)) |
4254 | 363 | { | 378 | { |
4255 | 379 | particles.push_back(LHEParticleFormat()); | ||
4256 | 364 | Int_t moth1 = GetMotherIndex(myEvent.mc()->particles()[i].mothup1_); | 380 | Int_t moth1 = GetMotherIndex(myEvent.mc()->particles()[i].mothup1_); |
4257 | 365 | Int_t moth2 = GetMotherIndex(myEvent.mc()->particles()[i].mothup2_); | 381 | Int_t moth2 = GetMotherIndex(myEvent.mc()->particles()[i].mothup2_); |
4259 | 366 | WriteParticle(myEvent.mc()->particles()[i],moth1,moth2,3); | 382 | WriteParticle(myEvent.mc()->particles()[i],moth1,moth2,3, particles.back()); |
4260 | 367 | } | 383 | } |
4261 | 368 | } | 384 | } |
4262 | 369 | } | 385 | } |
4263 | @@ -371,40 +387,39 @@ | |||
4264 | 371 | // Writing REC particles | 387 | // Writing REC particles |
4265 | 372 | if (myEvent.rec()!=0) | 388 | if (myEvent.rec()!=0) |
4266 | 373 | { | 389 | { |
4293 | 374 | // if (myEvent.mc()==0) | 390 | for (unsigned int i=0;i<myEvent.rec()->muons().size();i++) |
4294 | 375 | { | 391 | { |
4295 | 376 | for (unsigned int i=0;i<myEvent.rec()->muons().size();i++) | 392 | particles.push_back(LHEParticleFormat()); |
4296 | 377 | WriteMuon(myEvent.rec()->muons()[i]); | 393 | WriteMuon(myEvent.rec()->muons()[i],particles.back()); |
4297 | 378 | for (unsigned int i=0;i<myEvent.rec()->electrons().size();i++) | 394 | } |
4298 | 379 | WriteElectron(myEvent.rec()->electrons()[i]); | 395 | for (unsigned int i=0;i<myEvent.rec()->electrons().size();i++) |
4299 | 380 | for (unsigned int i=0;i<myEvent.rec()->taus().size();i++) | 396 | { |
4300 | 381 | WriteTau(myEvent.rec()->taus()[i]); | 397 | particles.push_back(LHEParticleFormat()); |
4301 | 382 | } | 398 | WriteElectron(myEvent.rec()->electrons()[i],particles.back()); |
4302 | 383 | /* | 399 | } |
4303 | 384 | else | 400 | for (unsigned int i=0;i<myEvent.rec()->taus().size();i++) |
4304 | 385 | { | 401 | { |
4305 | 386 | for (unsigned int i=6;i<myEvent.mc()->particles().size();i++) | 402 | particles.push_back(LHEParticleFormat()); |
4306 | 387 | { | 403 | WriteTau(myEvent.rec()->taus()[i],particles.back()); |
4307 | 388 | if ((myEvent.mc()->particles()[i].statuscode()==3 || | 404 | } |
4282 | 389 | ( myEvent.mc()->particles()[i].statuscode()>=21 && | ||
4283 | 390 | myEvent.mc()->particles()[i].statuscode()<=29)) && ( | ||
4284 | 391 | fabs(myEvent.mc()->particles()[i].pdgid())==11 || | ||
4285 | 392 | fabs(myEvent.mc()->particles()[i].pdgid())==13 || | ||
4286 | 393 | fabs(myEvent.mc()->particles()[i].pdgid())==15 )) | ||
4287 | 394 | { | ||
4288 | 395 | WriteParticle(myEvent.mc()->particles()[i],0,0,1); | ||
4289 | 396 | } | ||
4290 | 397 | } | ||
4291 | 398 | }*/ | ||
4292 | 399 | |||
4308 | 400 | for (unsigned int i=0;i<myEvent.rec()->jets().size();i++) | 405 | for (unsigned int i=0;i<myEvent.rec()->jets().size();i++) |
4311 | 401 | WriteJet(myEvent.rec()->jets()[i]); | 406 | { |
4312 | 402 | WriteMET(myEvent.rec()->MET()); | 407 | particles.push_back(LHEParticleFormat()); |
4313 | 408 | WriteJet(myEvent.rec()->jets()[i],particles.back()); | ||
4314 | 409 | } | ||
4315 | 410 | for (unsigned int i=0;i<myEvent.rec()->photons().size();i++) | ||
4316 | 411 | { | ||
4317 | 412 | particles.push_back(LHEParticleFormat()); | ||
4318 | 413 | WritePhoton(myEvent.rec()->photons()[i],particles.back()); | ||
4319 | 414 | } | ||
4320 | 415 | particles.push_back(LHEParticleFormat()); | ||
4321 | 416 | WriteMET(myEvent.rec()->MET(),particles.back()); | ||
4322 | 403 | } | 417 | } |
4323 | 404 | 418 | ||
4324 | 405 | // Event foot | 419 | // Event foot |
4325 | 420 | for (unsigned int i=0;i<particles.size();i++) particles[i].Print(i+1, output_); | ||
4326 | 406 | *output_ << "</event>" << std::endl; | 421 | *output_ << "</event>" << std::endl; |
4328 | 407 | return true; | 422 | return true; |
4329 | 408 | } | 423 | } |
4330 | 409 | 424 | ||
4331 | 410 | 425 | ||
4332 | @@ -447,117 +462,129 @@ | |||
4333 | 447 | 462 | ||
4334 | 448 | 463 | ||
4335 | 449 | /// Writing a particle | 464 | /// Writing a particle |
4449 | 450 | bool LHEWriter::WriteParticle(const MCParticleFormat& myPart, Int_t mother1, Int_t mother2, Int_t statuscode ) | 465 | void LHEWriter::WriteParticle(const MCParticleFormat& myPart, |
4450 | 451 | { | 466 | Int_t mother1, Int_t mother2, |
4451 | 452 | *output_ << std::setw(9) << std::right << myPart.pdgid_ << " "; | 467 | Int_t statuscode, LHEParticleFormat& lhe) |
4452 | 453 | if (statuscode!=0) *output_ << std::setw(4) << std::right << statuscode << " "; | 468 | { |
4453 | 454 | else *output_ << std::setw(4) << std::right << myPart.statuscode_ << " "; | 469 | if (statuscode!=0) lhe.status = statuscode; |
4454 | 455 | *output_ << std::setw(4) << std::right << mother1 /*myPart.mothup1_*/ << " "; | 470 | else lhe.status = myPart.statuscode_; |
4455 | 456 | *output_ << std::setw(4) << std::right << mother2 /*myPart.mothup2_*/ << " "; | 471 | lhe.id = myPart.pdgid_; |
4456 | 457 | *output_ << std::setw(4) << std::right << 0 << " "; | 472 | lhe.mother1 = mother1; |
4457 | 458 | *output_ << std::setw(4) << std::right << 0 << " "; | 473 | lhe.mother2 = mother2; |
4458 | 459 | *output_ << std::setw(18) << std::right << LHEWriter::FortranFormat_DoublePrecision(myPart.momentum_.Px()) << " "; | 474 | lhe.color1 = 0; |
4459 | 460 | *output_ << std::setw(18) << std::right << LHEWriter::FortranFormat_DoublePrecision(myPart.momentum_.Py()) << " "; | 475 | lhe.color2 = 0; |
4460 | 461 | *output_ << std::setw(18) << std::right << LHEWriter::FortranFormat_DoublePrecision(myPart.momentum_.Pz()) << " "; | 476 | lhe.px = myPart.momentum().Px(); |
4461 | 462 | *output_ << std::setw(18) << std::right << LHEWriter::FortranFormat_DoublePrecision(myPart.momentum_.E()) << " "; | 477 | lhe.py = myPart.momentum().Py(); |
4462 | 463 | *output_ << std::setw(18) << std::right << LHEWriter::FortranFormat_DoublePrecision(myPart.momentum_.M()) << " "; | 478 | lhe.pz = myPart.momentum().Pz(); |
4463 | 464 | *output_ << std::setw(2) << std::right << std::showpoint << myPart.ctau_ << " "; | 479 | lhe.e = myPart.momentum().E(); |
4464 | 465 | *output_ << std::setw(3) << std::right << std::showpoint << myPart.spin_; | 480 | lhe.m = myPart.momentum().M(); |
4465 | 466 | *output_ << std::endl; | 481 | lhe.ctau = myPart.ctau_; |
4466 | 467 | return true; | 482 | lhe.spin = myPart.spin_; |
4467 | 468 | } | 483 | } |
4468 | 469 | 484 | ||
4469 | 470 | 485 | ||
4470 | 471 | void LHEWriter::WriteJet(const RecJetFormat& jet) | 486 | void LHEWriter::WriteJet(const RecJetFormat& jet, LHEParticleFormat& lhe) |
4471 | 472 | { | 487 | { |
4472 | 473 | if (jet.btag()) *output_ << std::setw(9) << std::right << 5 << " "; | 488 | if (jet.btag()) lhe.id = 5; else lhe.id = 21; |
4473 | 474 | else *output_ << std::setw(9) << std::right << 21 << " "; | 489 | lhe.status = 1; |
4474 | 475 | *output_ << std::setw(4) << std::right << 1 << " "; | 490 | lhe.mother1 = 0; |
4475 | 476 | *output_ << std::setw(4) << std::right << 0 << " "; | 491 | lhe.mother2 = 0; |
4476 | 477 | *output_ << std::setw(4) << std::right << 0 << " "; | 492 | lhe.color1 = 0; |
4477 | 478 | *output_ << std::setw(4) << std::right << 0 << " "; | 493 | lhe.color2 = 0; |
4478 | 479 | *output_ << std::setw(4) << std::right << 0 << " "; | 494 | lhe.px = jet.momentum().Px(); |
4479 | 480 | *output_ << std::setw(18) << std::right << LHEWriter::FortranFormat_DoublePrecision(jet.momentum().Px()) << " "; | 495 | lhe.py = jet.momentum().Py(); |
4480 | 481 | *output_ << std::setw(18) << std::right << LHEWriter::FortranFormat_DoublePrecision(jet.momentum().Py()) << " "; | 496 | lhe.pz = jet.momentum().Pz(); |
4481 | 482 | *output_ << std::setw(18) << std::right << LHEWriter::FortranFormat_DoublePrecision(jet.momentum().Pz()) << " "; | 497 | lhe.e = jet.momentum().E(); |
4482 | 483 | *output_ << std::setw(18) << std::right << LHEWriter::FortranFormat_DoublePrecision(jet.momentum().E()) << " "; | 498 | lhe.m = jet.momentum().M(); |
4483 | 484 | *output_ << std::setw(18) << std::right << LHEWriter::FortranFormat_DoublePrecision(jet.momentum().M()) << " "; | 499 | lhe.ctau = 0.; |
4484 | 485 | *output_ << std::setw(2) << std::right << std::showpoint << 0. << " "; | 500 | lhe.spin = 0.; |
4485 | 486 | *output_ << std::setw(3) << std::right << std::showpoint << 0.; | 501 | } |
4486 | 487 | *output_ << std::endl; | 502 | |
4487 | 488 | } | 503 | |
4488 | 489 | 504 | void LHEWriter::WriteMuon(const RecLeptonFormat& muon, LHEParticleFormat& lhe) | |
4489 | 490 | void LHEWriter::WriteMuon(const RecLeptonFormat& muon) | 505 | { |
4490 | 491 | { | 506 | if (muon.charge()>0) lhe.id = -13; else lhe.id = +13; |
4491 | 492 | if (muon.charge()>0) *output_ << std::setw(9) << std::right << -13 << " "; | 507 | lhe.status = 1; |
4492 | 493 | else *output_ << std::setw(9) << std::right << +13 << " "; | 508 | lhe.mother1 = 0; |
4493 | 494 | *output_ << std::setw(4) << std::right << 1 << " "; | 509 | lhe.mother2 = 0; |
4494 | 495 | *output_ << std::setw(4) << std::right << 0 << " "; | 510 | lhe.color1 = 0; |
4495 | 496 | *output_ << std::setw(4) << std::right << 0 << " "; | 511 | lhe.color2 = 0; |
4496 | 497 | *output_ << std::setw(4) << std::right << 0 << " "; | 512 | lhe.px = muon.momentum().Px(); |
4497 | 498 | *output_ << std::setw(4) << std::right << 0 << " "; | 513 | lhe.py = muon.momentum().Py(); |
4498 | 499 | *output_ << std::setw(18) << std::right << LHEWriter::FortranFormat_DoublePrecision(muon.momentum().Px()) << " "; | 514 | lhe.pz = muon.momentum().Pz(); |
4499 | 500 | *output_ << std::setw(18) << std::right << LHEWriter::FortranFormat_DoublePrecision(muon.momentum().Py()) << " "; | 515 | lhe.e = muon.momentum().E(); |
4500 | 501 | *output_ << std::setw(18) << std::right << LHEWriter::FortranFormat_DoublePrecision(muon.momentum().Pz()) << " "; | 516 | lhe.m = muon.momentum().M(); |
4501 | 502 | *output_ << std::setw(18) << std::right << LHEWriter::FortranFormat_DoublePrecision(muon.momentum().E()) << " "; | 517 | lhe.ctau = 0.; |
4502 | 503 | *output_ << std::setw(18) << std::right << LHEWriter::FortranFormat_DoublePrecision(muon.momentum().M()) << " "; | 518 | lhe.spin = 0.; |
4503 | 504 | *output_ << std::setw(2) << std::right << std::showpoint << 0. << " "; | 519 | } |
4504 | 505 | *output_ << std::setw(3) << std::right << std::showpoint << 0.; | 520 | |
4505 | 506 | *output_ << std::endl; | 521 | void LHEWriter::WriteElectron(const RecLeptonFormat& electron, LHEParticleFormat& lhe) |
4506 | 507 | } | 522 | { |
4507 | 508 | 523 | if (electron.charge()>0) lhe.id = -11; else lhe.id = +11; | |
4508 | 509 | void LHEWriter::WriteElectron(const RecLeptonFormat& electron) | 524 | lhe.status = 1; |
4509 | 510 | { | 525 | lhe.mother1 = 0; |
4510 | 511 | if (electron.charge()>0) *output_ << std::setw(9) << std::right << -11 << " "; | 526 | lhe.mother2 = 0; |
4511 | 512 | else *output_ << std::setw(9) << std::right << +11 << " "; | 527 | lhe.color1 = 0; |
4512 | 513 | *output_ << std::setw(4) << std::right << 1 << " "; | 528 | lhe.color2 = 0; |
4513 | 514 | *output_ << std::setw(4) << std::right << 0 << " "; | 529 | lhe.px = electron.momentum().Px(); |
4514 | 515 | *output_ << std::setw(4) << std::right << 0 << " "; | 530 | lhe.py = electron.momentum().Py(); |
4515 | 516 | *output_ << std::setw(4) << std::right << 0 << " "; | 531 | lhe.pz = electron.momentum().Pz(); |
4516 | 517 | *output_ << std::setw(4) << std::right << 0 << " "; | 532 | lhe.e = electron.momentum().E(); |
4517 | 518 | *output_ << std::setw(18) << std::right << LHEWriter::FortranFormat_DoublePrecision(electron.momentum().Px()) << " "; | 533 | lhe.m = electron.momentum().M(); |
4518 | 519 | *output_ << std::setw(18) << std::right << LHEWriter::FortranFormat_DoublePrecision(electron.momentum().Py()) << " "; | 534 | lhe.ctau = 0.; |
4519 | 520 | *output_ << std::setw(18) << std::right << LHEWriter::FortranFormat_DoublePrecision(electron.momentum().Pz()) << " "; | 535 | lhe.spin = 0.; |
4520 | 521 | *output_ << std::setw(18) << std::right << LHEWriter::FortranFormat_DoublePrecision(electron.momentum().E()) << " "; | 536 | } |
4521 | 522 | *output_ << std::setw(18) << std::right << LHEWriter::FortranFormat_DoublePrecision(electron.momentum().M()) << " "; | 537 | |
4522 | 523 | *output_ << std::setw(2) << std::right << std::showpoint << 0. << " "; | 538 | |
4523 | 524 | *output_ << std::setw(3) << std::right << std::showpoint << 0.; | 539 | void LHEWriter::WritePhoton(const RecPhotonFormat& photon, LHEParticleFormat& lhe) |
4524 | 525 | *output_ << std::endl; | 540 | { |
4525 | 526 | } | 541 | lhe.id = 22; |
4526 | 527 | 542 | lhe.status = 1; | |
4527 | 528 | void LHEWriter::WriteTau(const RecTauFormat& tau) | 543 | lhe.mother1 = 0; |
4528 | 529 | { | 544 | lhe.mother2 = 0; |
4529 | 530 | if (tau.charge()>0) *output_ << std::setw(9) << std::right << -15 << " "; | 545 | lhe.color1 = 0; |
4530 | 531 | else *output_ << std::setw(9) << std::right << +15 << " "; | 546 | lhe.color2 = 0; |
4531 | 532 | *output_ << std::setw(4) << std::right << 1 << " "; | 547 | lhe.px = photon.momentum().Px(); |
4532 | 533 | *output_ << std::setw(4) << std::right << 0 << " "; | 548 | lhe.py = photon.momentum().Py(); |
4533 | 534 | *output_ << std::setw(4) << std::right << 0 << " "; | 549 | lhe.pz = photon.momentum().Pz(); |
4534 | 535 | *output_ << std::setw(4) << std::right << 0 << " "; | 550 | lhe.e = photon.momentum().E(); |
4535 | 536 | *output_ << std::setw(4) << std::right << 0 << " "; | 551 | lhe.m = photon.momentum().M(); |
4536 | 537 | *output_ << std::setw(18) << std::right << LHEWriter::FortranFormat_DoublePrecision(tau.momentum().Px()) << " "; | 552 | lhe.ctau = 0.; |
4537 | 538 | *output_ << std::setw(18) << std::right << LHEWriter::FortranFormat_DoublePrecision(tau.momentum().Py()) << " "; | 553 | lhe.spin = 0.; |
4538 | 539 | *output_ << std::setw(18) << std::right << LHEWriter::FortranFormat_DoublePrecision(tau.momentum().Pz()) << " "; | 554 | } |
4539 | 540 | *output_ << std::setw(18) << std::right << LHEWriter::FortranFormat_DoublePrecision(tau.momentum().E()) << " "; | 555 | |
4540 | 541 | *output_ << std::setw(18) << std::right << LHEWriter::FortranFormat_DoublePrecision(tau.momentum().M()) << " "; | 556 | |
4541 | 542 | *output_ << std::setw(2) << std::right << std::showpoint << 0. << " "; | 557 | void LHEWriter::WriteTau(const RecTauFormat& tau, LHEParticleFormat& lhe) |
4542 | 543 | *output_ << std::setw(3) << std::right << std::showpoint << 0.; | 558 | { |
4543 | 544 | *output_ << std::endl; | 559 | if (tau.charge()>0) lhe.id = -15; else lhe.id = +15; |
4544 | 545 | } | 560 | lhe.status = 1; |
4545 | 546 | 561 | lhe.mother1 = 0; | |
4546 | 547 | void LHEWriter::WriteMET(const ParticleBaseFormat& met) | 562 | lhe.mother2 = 0; |
4547 | 548 | { | 563 | lhe.color1 = 0; |
4548 | 549 | *output_ << std::setw(9) << std::right << 12 << " "; | 564 | lhe.color2 = 0; |
4549 | 550 | *output_ << std::setw(4) << std::right << 1 << " "; | 565 | lhe.px = tau.momentum().Px(); |
4550 | 551 | *output_ << std::setw(4) << std::right << 0 << " "; | 566 | lhe.py = tau.momentum().Py(); |
4551 | 552 | *output_ << std::setw(4) << std::right << 0 << " "; | 567 | lhe.pz = tau.momentum().Pz(); |
4552 | 553 | *output_ << std::setw(4) << std::right << 0 << " "; | 568 | lhe.e = tau.momentum().E(); |
4553 | 554 | *output_ << std::setw(4) << std::right << 0 << " "; | 569 | lhe.m = tau.momentum().M(); |
4554 | 555 | *output_ << std::setw(18) << std::right << LHEWriter::FortranFormat_DoublePrecision(met.px()) << " "; | 570 | lhe.ctau = 0.; |
4555 | 556 | *output_ << std::setw(18) << std::right << LHEWriter::FortranFormat_DoublePrecision(met.py()) << " "; | 571 | lhe.spin = 0.; |
4556 | 557 | *output_ << std::setw(18) << std::right << LHEWriter::FortranFormat_DoublePrecision(0.) << " "; | 572 | } |
4557 | 558 | *output_ << std::setw(18) << std::right << LHEWriter::FortranFormat_DoublePrecision(met.pt()) << " "; | 573 | |
4558 | 559 | *output_ << std::setw(18) << std::right << LHEWriter::FortranFormat_DoublePrecision(0.) << " "; | 574 | |
4559 | 560 | *output_ << std::setw(2) << std::right << std::showpoint << 0. << " "; | 575 | void LHEWriter::WriteMET(const ParticleBaseFormat& met, LHEParticleFormat& lhe) |
4560 | 561 | *output_ << std::setw(3) << std::right << std::showpoint << 0.; | 576 | { |
4561 | 562 | *output_ << std::endl; | 577 | lhe.id = 12; |
4562 | 578 | lhe.status = 1; | ||
4563 | 579 | lhe.mother1 = 0; | ||
4564 | 580 | lhe.mother2 = 0; | ||
4565 | 581 | lhe.color1 = 0; | ||
4566 | 582 | lhe.color2 = 0; | ||
4567 | 583 | lhe.px = met.px(); | ||
4568 | 584 | lhe.py = met.py(); | ||
4569 | 585 | lhe.pz = 0.; | ||
4570 | 586 | lhe.e = met.pt(); | ||
4571 | 587 | lhe.m = 0.; | ||
4572 | 588 | lhe.ctau = 0.; | ||
4573 | 589 | lhe.spin = 0.; | ||
4574 | 563 | } | 590 | } |
4575 | 564 | 591 | ||
4576 | === modified file 'tools/SampleAnalyzer/Writer/LHEWriter.h' | |||
4577 | --- tools/SampleAnalyzer/Writer/LHEWriter.h 2013-05-17 06:19:22 +0000 | |||
4578 | +++ tools/SampleAnalyzer/Writer/LHEWriter.h 2013-06-13 12:22:26 +0000 | |||
4579 | @@ -32,6 +32,7 @@ | |||
4580 | 32 | 32 | ||
4581 | 33 | // SampleAnalyzer headers | 33 | // SampleAnalyzer headers |
4582 | 34 | #include "SampleAnalyzer/Writer/WriterTextBase.h" | 34 | #include "SampleAnalyzer/Writer/WriterTextBase.h" |
4583 | 35 | #include "SampleAnalyzer/Writer/LHEParticleFormat.h" | ||
4584 | 35 | 36 | ||
4585 | 36 | namespace MA5 | 37 | namespace MA5 |
4586 | 37 | { | 38 | { |
4587 | @@ -76,17 +77,19 @@ | |||
4588 | 76 | unsigned int nevents); | 77 | unsigned int nevents); |
4589 | 77 | 78 | ||
4590 | 78 | /// Writing a particle | 79 | /// Writing a particle |
4592 | 79 | bool WriteParticle(const MCParticleFormat& myPart, Int_t mother1, Int_t mother2, Int_t statuscode=0); | 80 | void WriteParticle(const MCParticleFormat& myPart, Int_t mother1, Int_t mother2, |
4593 | 81 | Int_t statuscode, LHEParticleFormat& lhe); | ||
4594 | 80 | 82 | ||
4595 | 81 | static std::string FortranFormat_SimplePrecision(Float_t value,UInt_t precision=7); | 83 | static std::string FortranFormat_SimplePrecision(Float_t value,UInt_t precision=7); |
4596 | 82 | static std::string FortranFormat_DoublePrecision(Double_t value,UInt_t precision=11); | 84 | static std::string FortranFormat_DoublePrecision(Double_t value,UInt_t precision=11); |
4597 | 83 | 85 | ||
4598 | 84 | // Writing a reconstructed jet | 86 | // Writing a reconstructed jet |
4604 | 85 | void WriteJet(const RecJetFormat& jet); | 87 | void WriteJet(const RecJetFormat& jet, LHEParticleFormat& lhe); |
4605 | 86 | void WriteMuon(const RecLeptonFormat& muon); | 88 | void WriteMuon(const RecLeptonFormat& muon, LHEParticleFormat& lhe); |
4606 | 87 | void WriteElectron(const RecLeptonFormat& electron); | 89 | void WriteElectron(const RecLeptonFormat& electron, LHEParticleFormat& lhe); |
4607 | 88 | void WriteTau(const RecTauFormat& tau); | 90 | void WritePhoton(const RecPhotonFormat& photon, LHEParticleFormat& lhe); |
4608 | 89 | void WriteMET(const ParticleBaseFormat& met); | 91 | void WriteTau(const RecTauFormat& tau, LHEParticleFormat& lhe); |
4609 | 92 | void WriteMET(const ParticleBaseFormat& met, LHEParticleFormat& lhe); | ||
4610 | 90 | 93 | ||
4611 | 91 | 94 | ||
4612 | 92 | }; | 95 | }; |
4613 | 93 | 96 | ||
4614 | === modified file 'tools/SampleAnalyzer/Writer/WriterBase.h' | |||
4615 | --- tools/SampleAnalyzer/Writer/WriterBase.h 2013-05-17 06:19:22 +0000 | |||
4616 | +++ tools/SampleAnalyzer/Writer/WriterBase.h 2013-06-13 12:22:26 +0000 | |||
4617 | @@ -36,6 +36,7 @@ | |||
4618 | 36 | #include "SampleAnalyzer/DataFormat/EventFormat.h" | 36 | #include "SampleAnalyzer/DataFormat/EventFormat.h" |
4619 | 37 | #include "SampleAnalyzer/DataFormat/SampleFormat.h" | 37 | #include "SampleAnalyzer/DataFormat/SampleFormat.h" |
4620 | 38 | #include "SampleAnalyzer/Service/Physics.h" | 38 | #include "SampleAnalyzer/Service/Physics.h" |
4621 | 39 | #include "SampleAnalyzer/Core/Configuration.h" | ||
4622 | 39 | 40 | ||
4623 | 40 | // ROOT headers | 41 | // ROOT headers |
4624 | 41 | #include <TVector.h> | 42 | #include <TVector.h> |
4625 | @@ -77,7 +78,8 @@ | |||
4626 | 77 | } | 78 | } |
4627 | 78 | 79 | ||
4628 | 79 | /// Initialize (virtual pure) | 80 | /// Initialize (virtual pure) |
4630 | 80 | virtual bool Initialize(const std::string& filename) = 0; | 81 | virtual bool Initialize(const Configuration* cfg, |
4631 | 82 | const std::string& filename) = 0; | ||
4632 | 81 | 83 | ||
4633 | 82 | /// Read the sample (virtual pure) | 84 | /// Read the sample (virtual pure) |
4634 | 83 | virtual bool WriteHeader(const SampleFormat& mySample) = 0; | 85 | virtual bool WriteHeader(const SampleFormat& mySample) = 0; |
4635 | 84 | 86 | ||
4636 | === modified file 'tools/SampleAnalyzer/Writer/WriterTextBase.cpp' | |||
4637 | --- tools/SampleAnalyzer/Writer/WriterTextBase.cpp 2013-05-17 06:19:22 +0000 | |||
4638 | +++ tools/SampleAnalyzer/Writer/WriterTextBase.cpp 2013-06-13 12:22:26 +0000 | |||
4639 | @@ -37,8 +37,12 @@ | |||
4640 | 37 | // ----------------------------------------------------------------------------- | 37 | // ----------------------------------------------------------------------------- |
4641 | 38 | // Initialize | 38 | // Initialize |
4642 | 39 | // ----------------------------------------------------------------------------- | 39 | // ----------------------------------------------------------------------------- |
4644 | 40 | bool WriterTextBase::Initialize(const std::string& rawfilename) | 40 | bool WriterTextBase::Initialize(const Configuration* cfg, |
4645 | 41 | const std::string& rawfilename) | ||
4646 | 41 | { | 42 | { |
4647 | 43 | // Saving configuration file | ||
4648 | 44 | cfg_ = cfg; | ||
4649 | 45 | |||
4650 | 42 | // Is the file stored in Rfio | 46 | // Is the file stored in Rfio |
4651 | 43 | rfio_ = ReaderBase::IsRfioMode(rawfilename); | 47 | rfio_ = ReaderBase::IsRfioMode(rawfilename); |
4652 | 44 | 48 | ||
4653 | @@ -147,3 +151,26 @@ | |||
4654 | 147 | return true; | 151 | return true; |
4655 | 148 | } | 152 | } |
4656 | 149 | 153 | ||
4657 | 154 | |||
4658 | 155 | // ----------------------------------------------------------------------------- | ||
4659 | 156 | // Header | ||
4660 | 157 | // ----------------------------------------------------------------------------- | ||
4661 | 158 | void WriterTextBase::WriteMA5header() | ||
4662 | 159 | { | ||
4663 | 160 | *output_ << "#################################################################################" << std::endl; | ||
4664 | 161 | *output_ << "# THIS FILE HAS BEEN PRODUCED BY MADANALYSIS 5 #" << std::endl; | ||
4665 | 162 | *output_ << "# ______ ______ #" << std::endl; | ||
4666 | 163 | *output_ << "# /'\\_/`\\/\\ __ \\/\\ ___\\ #" << std::endl; | ||
4667 | 164 | *output_ << "# /\\ \\ \\ \\_\\ \\ \\ \\__/ #" << std::endl; | ||
4668 | 165 | *output_ << "# \\ \\ \\__\\ \\ \\ __ \\ \\___``\\ #" << std::endl; | ||
4669 | 166 | *output_ << "# \\ \\ \\_/\\ \\ \\ \\/\\ \\/\\ \\_\\ \\ #" << std::endl; | ||
4670 | 167 | *output_ << "# \\ \\_\\\\ \\_\\ \\_\\ \\_\\ \\____/ #" << std::endl; | ||
4671 | 168 | *output_ << "# \\/_/ \\/_/\\/_/\\/_/\\/___/ #" << std::endl; | ||
4672 | 169 | *output_ << "# #" << std::endl; | ||
4673 | 170 | // *output_ << "# MA5 release : " + "%-24s" % main.version + "%+15s" % main.date + " #" << std::endl; | ||
4674 | 171 | // *output_ << "# #" << std::endl; | ||
4675 | 172 | *output_ << "# Comput. Phys. Commun. 184 (2013) 222-256 #" << std::endl; | ||
4676 | 173 | *output_ << "# The MadAnalysis Development Team - Please visit us at #" << std::endl; | ||
4677 | 174 | *output_ << "# https://launchpad.net/madanalysis5 #" << std::endl; | ||
4678 | 175 | *output_ << "#################################################################################" << std::endl; | ||
4679 | 176 | } | ||
4680 | 150 | 177 | ||
4681 | === modified file 'tools/SampleAnalyzer/Writer/WriterTextBase.h' | |||
4682 | --- tools/SampleAnalyzer/Writer/WriterTextBase.h 2013-05-17 06:19:22 +0000 | |||
4683 | +++ tools/SampleAnalyzer/Writer/WriterTextBase.h 2013-06-13 12:22:26 +0000 | |||
4684 | @@ -52,6 +52,8 @@ | |||
4685 | 52 | /// Streaming for reading input | 52 | /// Streaming for reading input |
4686 | 53 | std::ostream* output_; | 53 | std::ostream* output_; |
4687 | 54 | 54 | ||
4688 | 55 | /// Configuration | ||
4689 | 56 | const Configuration* cfg_; | ||
4690 | 55 | 57 | ||
4691 | 56 | // ------------------------------------------------------------- | 58 | // ------------------------------------------------------------- |
4692 | 57 | // method members | 59 | // method members |
4693 | @@ -71,7 +73,8 @@ | |||
4694 | 71 | } | 73 | } |
4695 | 72 | 74 | ||
4696 | 73 | /// Initialize | 75 | /// Initialize |
4698 | 74 | virtual bool Initialize(const std::string& filename); | 76 | virtual bool Initialize(const Configuration* cfg, |
4699 | 77 | const std::string& filename); | ||
4700 | 75 | 78 | ||
4701 | 76 | /// Read the sample (virtual pure) | 79 | /// Read the sample (virtual pure) |
4702 | 77 | virtual bool WriteHeader(const SampleFormat& mySample) = 0; | 80 | virtual bool WriteHeader(const SampleFormat& mySample) = 0; |
4703 | @@ -85,6 +88,9 @@ | |||
4704 | 85 | 88 | ||
4705 | 86 | /// Finalize | 89 | /// Finalize |
4706 | 87 | virtual bool Finalize(); | 90 | virtual bool Finalize(); |
4707 | 91 | |||
4708 | 92 | /// MA5 logo | ||
4709 | 93 | void WriteMA5header(); | ||
4710 | 88 | 94 | ||
4711 | 89 | }; | 95 | }; |
4712 | 90 | 96 |
release validated !