Skip to content

Commit 192e7cc

Browse files
committed
add path for all run eras in a year
1 parent 4b5cc30 commit 192e7cc

File tree

2 files changed

+102
-59
lines changed

2 files changed

+102
-59
lines changed

index.js

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,10 @@ function welcome(request,response)
3030
{
3131
console.log(request.get('Host'));
3232
var reply={
33-
message: "Add a path, available paths: /years and /runeras (or: /years/<YYYY> /years/<YYYY>/<key> /runeras/<RunYYYYN> /runeras/<RunYYYYN>/<key>)"
33+
usage: "Add a path, available paths: /years and /runeras",
34+
years: "use: /years/<YYYY> to get a specific year or: /years/<YYYY>/<key> for a specific value within a year",
35+
runeras: "use: /runeras/<RunYYYYN> to get a specific run era or: /runeras/<RunYYYYN>/<key> for a specific value within a run era",
36+
or: "or use: /runeras/<YYYY> to get run eras of a year or: /runeras/<YYYY>/<key> to get specific values for run eras within a year"
3437
}
3538
response.send(reply);
3639
}
@@ -71,11 +74,27 @@ function searchEra(request,response)
7174

7275
if (era)
7376
{
74-
const this_era = run_eras.filter(an_era => an_era.run_era == era);
75-
reply=this_era[0];
76-
if (key)
77+
if (era.includes("Run"))
78+
{
79+
const this_era = run_eras.filter(an_era => an_era.run_era == era);
80+
reply=this_era[0];
81+
if (key)
82+
{
83+
reply=String(this_era[0][key]);
84+
}
85+
}
86+
else
7787
{
78-
reply=String(this_era[0][key]);
88+
console.log("No 'Run' in era, consider it as year");
89+
var year = era;
90+
const these_eras = run_eras.filter(an_era => an_era.year == year);
91+
reply=these_eras;
92+
if (key)
93+
{
94+
// note that era.key won't work
95+
let keyvalues = these_eras.map(era => era[key]);
96+
reply = keyvalues;
97+
}
7998
}
8099
}
81100
else

run_ranges.json

Lines changed: 78 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,217 +1,241 @@
11
[
22
{
33
"run_era": "Run2015A",
4+
"year": 2015,
45
"run_min": 247607,
56
"run_max": 250932,
6-
"released": " no",
7-
"type": " pp-0T",
7+
"released": "no",
8+
"type": "pp-0T",
89
"comments": "data taken at 0T including commissioning runs and low-PU runs for FSQ physics.",
9-
"source": ""
10+
"source": "https://twiki.cern.ch/twiki/bin/view/CMS/PdmV2015Analysis"
1011
},
1112
{
1213
"run_era": "Run2015B",
14+
"year": 2015,
1315
"run_min": 250985,
1416
"run_max": 253620,
15-
"released": " no",
16-
"type": " pp-0T",
17+
"released": "no",
18+
"type": "pp-0T",
1719
"comments": "data taken at 0T and 3.8T. The first run with 3.8T magnetic field was 250985. The first run with trigger menu for 50 ns collisions was 251168.",
18-
"source": ""
20+
"source": "https://twiki.cern.ch/twiki/bin/view/CMS/PdmV2015Analysis"
1921
},
2022
{
2123
"run_era": "Run2015C",
24+
"year": 2015,
2225
"run_min": 253659,
2326
"run_max": 256464,
24-
"released": " no",
25-
"type": " pp-phys",
27+
"released": "no",
28+
"type": "pp-phys",
2629
"comments": "range 254227-255031 excluding run 254833 that was taken with the 50ns condition.",
27-
"source": ""
30+
"source": "https://twiki.cern.ch/twiki/bin/view/CMS/PdmV2015Analysis"
2831
},
2932
{
3033
"run_era": "Run2015D",
34+
"year": 2015,
3135
"run_min": 256630,
3236
"run_max": 260627,
33-
"released": " yes",
34-
"type": " pp-phys",
37+
"released": "yes",
38+
"type": "pp-phys",
3539
"comments": "range 256630-260627. Run 259152-259431 are special runs taken for CMS/TOTEM",
36-
"source": ""
40+
"source": "https://twiki.cern.ch/twiki/bin/view/CMS/PdmV2015Analysis"
3741
},
3842
{
3943
"run_era": "Run2016A",
44+
"year": 2016,
4045
"run_min": 271036,
4146
"run_max": 271658,
42-
"released": " no",
43-
"type": " pp-0T",
47+
"released": "no",
48+
"type": "pp-0T",
4449
"comments": "data taken at 0T including commissioning runs",
45-
"source": " https://twiki.cern.ch/twiki/bin/view/CMS/PdmVDatasetsUL2016"
50+
"source": "https://twiki.cern.ch/twiki/bin/view/CMS/PdmVDatasetsUL2016"
4651
},
4752
{
4853
"run_era": "Run2016B",
54+
"year": 2016,
4955
"run_min": 272007,
5056
"run_max": 275376,
51-
"released": " no",
52-
"type": " pp-phys",
57+
"released": "no",
58+
"type": "pp-phys",
5359
"comments": "Run2016B has two sets of RAW data containing disjoint sets of runs. This is reflected in the strings ver1 and ver2. This means both should be included in the analysis.",
5460
"source": "https://twiki.cern.ch/twiki/bin/view/CMS/PdmVDatasetsUL2016"
5561
},
5662
{
5763
"run_era": "Run2016C",
64+
"year": 2016,
5865
"run_min": 275657,
5966
"run_max": 276283,
60-
"released": " no",
61-
"type": " pp-phys",
67+
"released": "no",
68+
"type": "pp-phys",
6269
"comments": "pre-VFP - reconstructed with a reconstruction including HIP mitigation",
6370
"source": "https://twiki.cern.ch/twiki/bin/view/CMS/PdmVDatasetsUL2016"
6471
},
6572
{
6673
"run_era": "Run2016D",
74+
"year": 2016,
6775
"run_min": 276315,
6876
"run_max": 276811,
69-
"released": " no",
70-
"type": " pp-phys",
77+
"released": "no",
78+
"type": "pp-phys",
7179
"comments": "pre-VFP - reconstructed with a reconstruction including HIP mitigation",
7280
"source": "https://twiki.cern.ch/twiki/bin/view/CMS/PdmVDatasetsUL2016"
7381
},
7482
{
7583
"run_era": "Run2016E",
84+
"year": 2016,
7685
"run_min": 276831,
7786
"run_max": 277420,
78-
"released": " no",
79-
"type": " pp-phys",
87+
"released": "no",
88+
"type": "pp-phys",
8089
"comments": "pre-VFP - reconstructed with a reconstruction including HIP mitigation",
8190
"source": ""
8291
},
8392
{
8493
"run_era": "Run2016F",
94+
"year": 2016,
8595
"run_min": 277772,
8696
"run_max": 278808,
87-
"released": " no",
88-
"type": " pp-phys",
97+
"released": "no",
98+
"type": "pp-phys",
8999
"comments": "pre-VFP - reconstructed with a reconstruction including HIP mitigation and post-VFP with the default track reconstruction runs 278769 278801 278802 278803 278804 278805 278808",
90100
"source": "https://twiki.cern.ch/twiki/bin/view/CMS/PdmVDatasetsUL2016"
91101
},
92102
{
93103
"run_era": "Run2016G",
104+
"year": 2016,
94105
"run_min": 278820,
95106
"run_max": 280385,
96-
"released": " no",
97-
"type": " pp-phys",
107+
"released": "no",
108+
"type": "pp-phys",
98109
"comments": "post-VFP with the default track reconstruction",
99110
"source": "https://twiki.cern.ch/twiki/bin/view/CMS/PdmVDatasetsUL2016"
100111
},
101112
{
102113
"run_era": "Run2016H",
114+
"year": 2016,
103115
"run_min": 280919,
104116
"run_max": 284044,
105-
"released": " no",
106-
"type": " pp-phys",
117+
"released": "no",
118+
"type": "pp-phys",
107119
"comments": "post-VFP with the default track reconstruction",
108120
"source": "https://twiki.cern.ch/twiki/bin/view/CMS/PdmVDatasetsUL2016"
109121
},
110122
{
111123
"run_era": "Run2017A",
124+
"year": 2017,
112125
"run_min": 294927,
113126
"run_max": 297019,
114-
"released": " no",
115-
"type": " pp-0lum",
127+
"released": "no",
128+
"type": "pp-0lum",
116129
"comments": "",
117130
"source": "https://twiki.cern.ch/twiki/bin/view/CMS/PdmVDataReprocessingUL2017"
118131
},
119132
{
120133
"run_era": "Run2017B",
134+
"year": 2017,
121135
"run_min": 297046,
122136
"run_max": 299329,
123-
"released": " no",
124-
"type": " pp-phys",
137+
"released": "no",
138+
"type": "pp-phys",
125139
"comments": "",
126140
"source": "https://twiki.cern.ch/twiki/bin/view/CMS/PdmVDataReprocessingUL2017"
127141
},
128142
{
129143
"run_era": "Run2017C",
144+
"year": 2017,
130145
"run_min": 299368,
131146
"run_max": 302029,
132-
"released": " no",
133-
"type": " pp-phys",
147+
"released": "no",
148+
"type": "pp-phys",
134149
"comments": "Includes low PU runs 299996 300018 300027 300043 300088",
135-
"source": " https://twiki.cern.ch/twiki/bin/view/CMS/PdmVDataReprocessingUL2017"
150+
"source": "https://twiki.cern.ch/twiki/bin/view/CMS/PdmVDataReprocessingUL2017"
136151
},
137152
{
138153
"run_era": "Run2017D",
154+
"year": 2017,
139155
"run_min": 302030,
140156
"run_max": 303434,
141-
"released": " no",
142-
"type": " pp-phys",
157+
"released": "no",
158+
"type": "pp-phys",
143159
"comments": "",
144160
"source": "https://twiki.cern.ch/twiki/bin/view/CMS/PdmVDataReprocessingUL2017"
145161
},
146162
{
147163
"run_era": "Run2017E",
164+
"year": 2017,
148165
"run_min": 303824,
149166
"run_max": 304797,
150-
"released": " no",
151-
"type": " pp-phys",
167+
"released": "no",
168+
"type": "pp-phys",
152169
"comments": "",
153170
"source": "https://twiki.cern.ch/twiki/bin/view/CMS/PdmVDataReprocessingUL2017"
154171
},
155172
{
156173
"run_era": "Run2017F",
174+
"year": 2017,
157175
"run_min": 305040,
158176
"run_max": 306462,
159-
"released": " no",
160-
"type": " pp-phys",
177+
"released": "no",
178+
"type": "pp-phys",
161179
"comments": "",
162180
"source": "https://twiki.cern.ch/twiki/bin/view/CMS/PdmVDataReprocessingUL2017"
163181
},
164182
{
165183
"run_era": "Run2017G",
184+
"year": 2017,
166185
"run_min": 306472,
167186
"run_max": 306826,
168-
"released": " no",
169-
"type": " pp-5TeV",
187+
"released": "no",
188+
"type": "pp-5TeV",
170189
"comments": "Era Run2017G is the 5 TeV Run",
171190
"source": "https://twiki.cern.ch/twiki/bin/view/CMS/PdmVDataReprocessingUL2017"
172191
},
173192
{
174193
"run_era": "Run2017H",
194+
"year": 2017,
175195
"run_min": 306896,
176196
"run_max": 307082,
177-
"released": " no",
178-
"type": " pp-lowpu",
197+
"released": "no",
198+
"type": "pp-lowpu",
179199
"comments": "Era Run2017H is low PU",
180200
"source": "https://twiki.cern.ch/twiki/bin/view/CMS/PdmVDataReprocessingUL2017"
181201
},
182202
{
183203
"run_era": "Run2018A",
204+
"year": 2018,
184205
"run_min": 315252,
185206
"run_max": 316995,
186-
"released": " no",
187-
"type": " pp-phys",
207+
"released": "no",
208+
"type": "pp-phys",
188209
"comments": "",
189210
"source": "https://twiki.cern.ch/twiki/bin/viewauth/CMS/PdmVDataReprocessingUL2018"
190211
},
191212
{
192213
"run_era": "Run2018B",
214+
"year": 2018,
193215
"run_min": 317080,
194216
"run_max": 319310,
195-
"released": " no",
196-
"type": " pp-phys",
217+
"released": "no",
218+
"type": "pp-phys",
197219
"comments": "",
198220
"source": "https://twiki.cern.ch/twiki/bin/viewauth/CMS/PdmVDataReprocessingUL2018"
199221
},
200222
{
201223
"run_era": "Run2018C",
224+
"year": 2018,
202225
"run_min": 319337,
203226
"run_max": 320065,
204-
"released": " no",
205-
"type": " pp-phys",
227+
"released": "no",
228+
"type": "pp-phys",
206229
"comments": "",
207230
"source": "https://twiki.cern.ch/twiki/bin/viewauth/CMS/PdmVDataReprocessingUL2018"
208231
},
209232
{
210233
"run_era": "Run2018D",
234+
"year": 2018,
211235
"run_min": 320673,
212236
"run_max": 325175,
213-
"released": " no",
214-
"type": " pp-phys",
237+
"released": "no",
238+
"type": "pp-phys",
215239
"comments": "",
216240
"source": "https://twiki.cern.ch/twiki/bin/viewauth/CMS/PdmVDataReprocessingUL2018"
217241
}

0 commit comments

Comments
 (0)