Rev 333 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 333 | Rev 344 | ||
|---|---|---|---|
| 1 | Blockly.Blocks['particle_combiner'] = { |
1 | Blockly.Blocks['particle_combiner'] = { |
| 2 | init: function() { |
2 | init: function() { |
| 3 | this.appendDummyInput() |
3 | this.appendDummyInput() |
| 4 | .appendField("Combine 2 particles"); |
4 | .appendField("Combine 2 particles"); |
| 5 | this.appendValueInput("list1") |
5 | this.appendValueInput("list1") |
| 6 | .setCheck("particle list") |
6 | .setCheck("particle list") |
| 7 | .setAlign(Blockly.ALIGN_RIGHT) |
7 | .setAlign(Blockly.ALIGN_RIGHT) |
| 8 | .appendField("Particle 1"); |
8 | .appendField("Particle 1"); |
| 9 | this.appendValueInput("list2") |
9 | this.appendValueInput("list2") |
| 10 | .setCheck("particle list") |
10 | .setCheck("particle list") |
| 11 | .setAlign(Blockly.ALIGN_RIGHT) |
11 | .setAlign(Blockly.ALIGN_RIGHT) |
| 12 | .appendField("Particle 2"); |
12 | .appendField("Particle 2"); |
| 13 | this.appendDummyInput() |
13 | this.appendDummyInput() |
| 14 | .appendField("Same particle lists?") |
14 | .appendField("Same particle lists?") |
| 15 | .appendField(new Blockly.FieldDropdown([["No", "0"], ["Yes", "1"]]), "sameparticles"); |
15 | .appendField(new Blockly.FieldDropdown([["No", "0"], ["Yes", "1"]]), "sameparticles"); |
| 16 | this.appendDummyInput() |
16 | this.appendDummyInput() |
| 17 | .appendField("Set identity to") |
17 | .appendField("Set identity to") |
| 18 | .appendField(new Blockly.FieldDropdown([["electron", "ELECTRON"], ["muon", "MUON"], ["pion", "PION"], ["kaon", "KAON"], |
18 | .appendField(new Blockly.FieldDropdown([["electron", "ELECTRON"], ["muon", "MUON"], ["pion", "PION"], ["kaon", "KAON"], |
| 19 | ["proton", "PROTON"], ["photon", "PHOTON"], ["Phi meson", "PHI"], ["D meson", "D"], |
19 | ["proton", "PROTON"], ["photon", "PHOTON"], ["Phi meson", "PHI"], ["D meson", "D"], |
| 20 | ["D* meson", "DSTAR"], ["J/Psi meson", "JPSI"],["B meson","B"], ["Lambda 0","LAMBDA0"], ["do not set","ALL"]]), "simplepid"); |
20 | ["D* meson", "DSTAR"], ["J/Psi meson", "JPSI"],["B meson","B"], ["Lambda 0","LAMBDA0"], ["do not set","ALL"]]), "simplepid"); |
| 21 | this.appendDummyInput() |
21 | this.appendDummyInput() |
| 22 | .setAlign(Blockly.ALIGN_RIGHT) |
22 | .setAlign(Blockly.ALIGN_RIGHT) |
| 23 | .appendField("Min mass [GeV/c2] :") |
23 | .appendField("Min mass [GeV/c2] :") |
| 24 | .appendField(new Blockly.FieldNumber(0, 0, Infinity, 0.0001), "mass0"); |
24 | .appendField(new Blockly.FieldNumber(0, 0, Infinity, 0.0001), "mass0"); |
| 25 | this.appendDummyInput() |
25 | this.appendDummyInput() |
| 26 | .setAlign(Blockly.ALIGN_RIGHT) |
26 | .setAlign(Blockly.ALIGN_RIGHT) |
| 27 | .appendField("Max mass [GeV/c2] :") |
27 | .appendField("Max mass [GeV/c2] :") |
| 28 | .appendField(new Blockly.FieldNumber(0, 0, Infinity, 0.0001), "mass1"); |
28 | .appendField(new Blockly.FieldNumber(0, 0, Infinity, 0.0001), "mass1"); |
| 29 | //this.appendValueInput("histogram").setCheck("histogram").appendField("Histogram"); |
29 | //this.appendValueInput("histogram").setCheck("histogram").appendField("Histogram"); |
| 30 | this.appendDummyInput().appendField("Histograms"); |
30 | this.appendDummyInput().appendField("Histograms"); |
| 31 | this.appendStatementInput("histogram") |
31 | this.appendStatementInput("histogram") |
| 32 | .setCheck("histogram"); |
32 | .setCheck("histogram"); |
| 33 | this.setInputsInline(false); |
33 | this.setInputsInline(false); |
| 34 | this.setOutput(true, "particle list"); |
34 | this.setOutput(true, "particle list"); |
| 35 | this.setColour(120); |
35 | this.setColour(120); |
| 36 | this.setTooltip('Combine two particles in the new particle by making combinations between particles in two input lists. If the input connector is empty, the full particle list will be used'); |
36 | this.setTooltip('Combine two particles in the new particle by making combinations between particles in two input lists. If the input connector is empty, the full particle list will be used'); |
| 37 | this.setHelpUrl('http://belle.jp/'); |
37 | this.setHelpUrl('http://belle.jp/'); |
| 38 | } |
38 | } |
| 39 | }; |
39 | }; |
| 40 | 40 | ||
| 41 | Blockly.Blocks['particle_combiner3'] = { |
41 | Blockly.Blocks['particle_combiner3'] = { |
| 42 | init: function() { |
42 | init: function() { |
| 43 | this.appendDummyInput() |
43 | this.appendDummyInput() |
| 44 | .appendField("Combine 3 particles"); |
44 | .appendField("Combine 3 particles"); |
| 45 | this.appendValueInput("list1") |
45 | this.appendValueInput("list1") |
| 46 | .setCheck("particle list") |
46 | .setCheck("particle list") |
| 47 | .setAlign(Blockly.ALIGN_RIGHT) |
47 | .setAlign(Blockly.ALIGN_RIGHT) |
| 48 | .appendField("Particle 1"); |
48 | .appendField("Particle 1"); |
| 49 | this.appendValueInput("list2") |
49 | this.appendValueInput("list2") |
| 50 | .setCheck("particle list") |
50 | .setCheck("particle list") |
| 51 | .setAlign(Blockly.ALIGN_RIGHT) |
51 | .setAlign(Blockly.ALIGN_RIGHT) |
| 52 | .appendField("Particle 2"); |
52 | .appendField("Particle 2"); |
| 53 | this.appendValueInput("list3") |
53 | this.appendValueInput("list3") |
| 54 | .setCheck("particle list") |
54 | .setCheck("particle list") |
| 55 | .setAlign(Blockly.ALIGN_RIGHT) |
55 | .setAlign(Blockly.ALIGN_RIGHT) |
| 56 | .appendField("Particle 3"); |
56 | .appendField("Particle 3"); |
| 57 | this.appendDummyInput() |
57 | this.appendDummyInput() |
| 58 | .appendField("Same particle lists?") |
58 | .appendField("Same particle lists?") |
| 59 | .appendField(new Blockly.FieldDropdown([["No", "0"], ["Yes", "1"]]), "sameparticles"); |
59 | .appendField(new Blockly.FieldDropdown([["No", "0"], ["Yes", "1"]]), "sameparticles"); |
| 60 | this.appendDummyInput() |
60 | this.appendDummyInput() |
| 61 | .appendField("Set identity to") |
61 | .appendField("Set identity to") |
| 62 | .appendField(new Blockly.FieldDropdown([["electron", "ELECTRON"], ["muon", "MUON"], ["pion", "PION"], ["kaon", "KAON"], |
62 | .appendField(new Blockly.FieldDropdown([["electron", "ELECTRON"], ["muon", "MUON"], ["pion", "PION"], ["kaon", "KAON"], |
| 63 | ["proton", "PROTON"], ["photon", "PHOTON"], ["Phi meson", "PHI"], ["D meson", "D"], |
63 | ["proton", "PROTON"], ["photon", "PHOTON"], ["Phi meson", "PHI"], ["D meson", "D"], |
| 64 | ["D* meson", "DSTAR"], ["J/Psi meson", "JPSI"],["B meson","B"], ["Lambda 0","LAMBDA0"], ["do not set","ALL"]]), "simplepid"); |
64 | ["D* meson", "DSTAR"], ["J/Psi meson", "JPSI"],["B meson","B"], ["Lambda 0","LAMBDA0"], ["do not set","ALL"]]), "simplepid"); |
| 65 | 65 | ||
| 66 | this.appendDummyInput() |
66 | this.appendDummyInput() |
| 67 | .setAlign(Blockly.ALIGN_RIGHT) |
67 | .setAlign(Blockly.ALIGN_RIGHT) |
| 68 | .appendField("Min mass [GeV/c2] :") |
68 | .appendField("Min mass [GeV/c2] :") |
| 69 | .appendField(new Blockly.FieldNumber(0, 0, Infinity, 0.0001), "mass0"); |
69 | .appendField(new Blockly.FieldNumber(0, 0, Infinity, 0.0001), "mass0"); |
| 70 | this.appendDummyInput() |
70 | this.appendDummyInput() |
| 71 | .setAlign(Blockly.ALIGN_RIGHT) |
71 | .setAlign(Blockly.ALIGN_RIGHT) |
| 72 | .appendField("Max mass [GeV/c2] :") |
72 | .appendField("Max mass [GeV/c2] :") |
| 73 | .appendField(new Blockly.FieldNumber(0, 0, Infinity, 0.0001), "mass1"); |
73 | .appendField(new Blockly.FieldNumber(0, 0, Infinity, 0.0001), "mass1"); |
| 74 | //this.appendValueInput("histogram").setCheck("histogram").appendField("Histogram"); |
74 | //this.appendValueInput("histogram").setCheck("histogram").appendField("Histogram"); |
| 75 | this.appendDummyInput().appendField("Histograms"); |
75 | this.appendDummyInput().appendField("Histograms"); |
| 76 | this.appendStatementInput("histogram") |
76 | this.appendStatementInput("histogram") |
| 77 | .setCheck("histogram"); |
77 | .setCheck("histogram"); |
| 78 | this.setInputsInline(false); |
78 | this.setInputsInline(false); |
| 79 | this.setOutput(true, "particle list"); |
79 | this.setOutput(true, "particle list"); |
| 80 | this.setColour(0); |
80 | this.setColour(0); |
| 81 | this.setTooltip('Combine three particles in the new particle by making combinations between particles in three input lists. If the input connector is empty, the full particle list will be used'); |
81 | this.setTooltip('Combine three particles in the new particle by making combinations between particles in three input lists. If the input connector is empty, the full particle list will be used'); |
| 82 | this.setHelpUrl('http://belle.jp/'); |
82 | this.setHelpUrl('http://belle.jp/'); |
| 83 | } |
83 | } |
| 84 | }; |
84 | }; |
| 85 | 85 | ||
| 86 | 86 | ||
| 87 | Blockly.Blocks['particle_selector'] = { |
87 | Blockly.Blocks['particle_selector'] = { |
| 88 | init: function() { |
88 | init: function() { |
| 89 | this.appendDummyInput() |
89 | this.appendDummyInput() |
| 90 | .appendField("Select Particles"); |
90 | .appendField("Select Particles"); |
| 91 | this.appendValueInput("list1") |
91 | this.appendValueInput("list1") |
| 92 | .setCheck("particle list") |
92 | .setCheck("particle list") |
| 93 | .appendField("Particle"); |
93 | .appendField("Particle"); |
| 94 | this.appendDummyInput() |
94 | this.appendDummyInput() |
| 95 | .appendField("Charge") |
95 | .appendField("Charge") |
| 96 | .appendField(new Blockly.FieldDropdown([["-1", "-1"], ["0", "0"], ["1", "1"], ["Any", "2"]]), "chargelist"); |
96 | .appendField(new Blockly.FieldDropdown([["-1", "-1"], ["0", "0"], ["1", "1"], ["Any", "2"]]), "chargelist"); |
| 97 | this.appendDummyInput() |
97 | this.appendDummyInput() |
| 98 | .appendField("Type") |
98 | .appendField("Type") |
| 99 | .appendField(new Blockly.FieldDropdown([["electron", "ELECTRON"], ["muon", "MUON"], ["pion", "PION"], ["kaon", "KAON"], |
99 | .appendField(new Blockly.FieldDropdown([["electron", "ELECTRON"], ["muon", "MUON"], ["pion", "PION"], ["kaon", "KAON"], |
| 100 | ["proton", "PROTON"], ["photon", "PHOTON"], ["Phi meson", "PHI"], ["D meson", "D"], |
100 | ["proton", "PROTON"], ["photon", "PHOTON"], ["Phi meson", "PHI"], ["D meson", "D"], |
| 101 | ["D* meson", "DSTAR"], ["J/Psi meson", "JPSI"],["B meson","B"],["all particles","ALL"]]), "simplepid"); |
101 | ["D* meson", "DSTAR"], ["J/Psi meson", "JPSI"],["B meson","B"],["all particles","ALL"]]), "simplepid"); |
| 102 | //this.appendValueInput("histogram").setCheck("histogram").appendField("Histogram"); |
102 | //this.appendValueInput("histogram").setCheck("histogram").appendField("Histogram"); |
| 103 | this.appendDummyInput().appendField("Histograms"); |
103 | this.appendDummyInput().appendField("Histograms"); |
| 104 | this.appendStatementInput("histogram") |
104 | this.appendStatementInput("histogram") |
| 105 | .setCheck("histogram"); |
105 | .setCheck("histogram"); |
| 106 | this.setInputsInline(false); |
106 | this.setInputsInline(false); |
| 107 | this.setOutput(true, "particle list"); |
107 | this.setOutput(true, "particle list"); |
| 108 | this.setColour(65); |
108 | this.setColour(65); |
| 109 | this.setTooltip('Create a new list of particles based on the input particle list. If the input is empty, all the particles in the event are used.'); |
109 | this.setTooltip('Create a new list of particles based on the input particle list. If the input is empty, all the particles in the event are used.'); |
| 110 | this.setHelpUrl('http://belle.jp/'); |
110 | this.setHelpUrl('http://belle.jp/'); |
| 111 | } |
111 | } |
| 112 | }; |
112 | }; |
| 113 | 113 | ||
| 114 | Blockly.Blocks['histogram_creator'] = { |
114 | Blockly.Blocks['histogram_creator'] = { |
| 115 | init: function() { |
115 | init: function() { |
| 116 | this.appendDummyInput() |
116 | this.appendDummyInput() |
| 117 | .appendField("Histogram"); |
117 | .appendField("Histogram"); |
| 118 | this.appendDummyInput() |
118 | this.appendDummyInput() |
| 119 | .setAlign(Blockly.ALIGN_RIGHT) |
119 | .setAlign(Blockly.ALIGN_RIGHT) |
| 120 | .appendField("Title") |
120 | .appendField("Title") |
| 121 | .appendField(new Blockly.FieldTextInput("Reconstructed Mass"), "name"); |
121 | .appendField(new Blockly.FieldTextInput("Reconstructed Mass"), "name"); |
| 122 | this.appendDummyInput() |
122 | this.appendDummyInput() |
| 123 | .setAlign(Blockly.ALIGN_RIGHT) |
123 | .setAlign(Blockly.ALIGN_RIGHT) |
| 124 | .appendField("Number of bins") |
124 | .appendField("Number of bins") |
| 125 | .appendField(new Blockly.FieldNumber(40, 0), "nbins"); |
125 | .appendField(new Blockly.FieldNumber(40, 0), "nbins"); |
| 126 | this.appendDummyInput() |
126 | this.appendDummyInput() |
| 127 | .setAlign(Blockly.ALIGN_RIGHT) |
127 | .setAlign(Blockly.ALIGN_RIGHT) |
| 128 | .appendField("Min:") |
128 | .appendField("Min:") |
| 129 | .appendField(new Blockly.FieldNumber(0, -Infinity, Infinity, 0.0001), "min"); |
129 | .appendField(new Blockly.FieldNumber(0, -Infinity, Infinity, 0.0001), "min"); |
| 130 | this.appendDummyInput() |
130 | this.appendDummyInput() |
| 131 | .setAlign(Blockly.ALIGN_RIGHT) |
131 | .setAlign(Blockly.ALIGN_RIGHT) |
| 132 | .appendField("Max:") |
132 | .appendField("Max:") |
| 133 | .appendField(new Blockly.FieldNumber(0, -Infinity, Infinity, 0.0001), "max"); |
133 | .appendField(new Blockly.FieldNumber(0, -Infinity, Infinity, 0.0001), "max"); |
| 134 | this.appendDummyInput() |
134 | this.appendDummyInput() |
| 135 | .appendField("Variable") |
135 | .appendField("Variable") |
| 136 | .appendField(new Blockly.FieldDropdown([["mass", "GetMass"], ["momentum", "GetMomentum"], ["energy", "GetEnergy"],["charge", "GetCharge"], ["identity", "GetPid"],["polar angle", "GetTheta"],["cos(polar ang.)", "GetCosTheta"],["px", "GetXMomentum"],["py", "GetYMomentum"],["pz", "GetZMomentum"],["pT", "GetTransverseMomentum |
136 | .appendField(new Blockly.FieldDropdown([["mass", "GetMass"], ["momentum", "GetMomentum"], ["energy", "GetEnergy"],["charge", "GetCharge"], ["identity", "GetPid"],["polar angle", "GetTheta"],["cos(polar ang.)", "GetCosTheta"],["px", "GetXMomentum"],["py", "GetYMomentum"],["pz", "GetZMomentum"],["pT", "GetTransverseMomentum"]]), "varname"); |
| 137 | this.setInputsInline(true); |
137 | this.setInputsInline(true); |
| 138 | this.setPreviousStatement(true); |
138 | this.setPreviousStatement(true); |
| 139 | this.setNextStatement(true); |
139 | this.setNextStatement(true); |
| 140 | this.setColour(20); |
140 | this.setColour(20); |
| 141 | this.setTooltip('This block handles the histogram creation and filling. Define a number of bins, minimum and maximum of the range and assign a variable to plot'); |
141 | this.setTooltip('This block handles the histogram creation and filling. Define a number of bins, minimum and maximum of the range and assign a variable to plot'); |
| 142 | this.setHelpUrl('http://belle2.jp/'); |
142 | this.setHelpUrl('http://belle2.jp/'); |
| 143 | } |
143 | } |
| 144 | }; |
144 | }; |
| 145 | 145 | ||
| 146 | Blockly.Blocks['simple_analysis'] = { |
146 | Blockly.Blocks['simple_analysis'] = { |
| 147 | init: function() { |
147 | init: function() { |
| 148 | this.appendDummyInput() |
148 | this.appendDummyInput() |
| 149 | .appendField("Belle II Masterclass"); |
149 | .appendField("Belle II Masterclass"); |
| 150 | this.appendDummyInput() |
150 | this.appendDummyInput() |
| 151 | .appendField("Number of events: ") |
151 | .appendField("Number of events: ") |
| 152 | .appendField(new Blockly.FieldNumber(5000, 0), "neve"); |
152 | .appendField(new Blockly.FieldNumber(5000, 0), "neve"); |
| 153 | this.appendDummyInput() |
153 | this.appendDummyInput() |
| 154 | .appendField("First event: ") |
154 | .appendField("First event: ") |
| 155 | .appendField(new Blockly.FieldNumber(0, 0), "first"); |
155 | .appendField(new Blockly.FieldNumber(0, 0), "first"); |
| 156 | this.appendDummyInput() |
156 | this.appendDummyInput() |
| 157 | .appendField("Data Source") |
157 | .appendField("Data Source") |
| 158 | .appendField(new Blockly.FieldDropdown([["hadron-1", "1"], ["hadron-2", "2"]]), "datasource"); |
158 | .appendField(new Blockly.FieldDropdown([["hadron-1", "1"], ["hadron-2", "2"]]), "datasource"); |
| 159 | this.appendDummyInput() |
159 | this.appendDummyInput() |
| 160 | .appendField("Print particle list?") |
160 | .appendField("Print particle list?") |
| 161 | .appendField(new Blockly.FieldDropdown([["No", "0"], ["Yes", "1"]]), "print"); |
161 | .appendField(new Blockly.FieldDropdown([["No", "0"], ["Yes", "1"]]), "print"); |
| 162 | this.appendValueInput("list") |
162 | this.appendValueInput("list") |
| 163 | .setCheck("particle list") |
163 | .setCheck("particle list") |
| 164 | .appendField("Particle List"); |
164 | .appendField("Particle List"); |
| 165 | this.setColour(230); |
165 | this.setColour(230); |
| 166 | this.setTooltip('Run the analysis, specify data source, number of events, first event and a list of particles to process.'); |
166 | this.setTooltip('Run the analysis, specify data source, number of events, first event and a list of particles to process.'); |
| 167 | this.setHelpUrl('http://belle2.jp/'); |
167 | this.setHelpUrl('http://belle2.jp/'); |
| 168 | } |
168 | } |
| 169 | }; |
169 | }; |
| 170 | 170 | ||
| 171 | Blockly.Blocks['particle_mass_fix'] = { |
171 | Blockly.Blocks['particle_mass_fix'] = { |
| 172 | init: function() { |
172 | init: function() { |
| 173 | this.appendDummyInput() |
173 | this.appendDummyInput() |
| 174 | .appendField("Particle mass fix"); |
174 | .appendField("Particle mass fix"); |
| 175 | this.appendValueInput("list") |
175 | this.appendValueInput("list") |
| 176 | .setCheck("particle list") |
176 | .setCheck("particle list") |
| 177 | .appendField("Particle List"); |
177 | .appendField("Particle List"); |
| 178 | this.setOutput(true, "particle list"); |
178 | this.setOutput(true, "particle list"); |
| 179 | this.setColour(150); |
179 | this.setColour(150); |
| 180 | this.setTooltip(''); |
180 | this.setTooltip(''); |
| 181 | this.setHelpUrl('http://belle2.jp/'); |
181 | this.setHelpUrl('http://belle2.jp/'); |
| 182 | } |
182 | } |
| 183 | }; |
183 | }; |
| 184 | 184 | ||
| 185 | Blockly.Blocks['primary_list'] = { |
185 | Blockly.Blocks['primary_list'] = { |
| 186 | init: function() { |
186 | init: function() { |
| 187 | this.appendDummyInput() |
187 | this.appendDummyInput() |
| 188 | .appendField("Stored Particles:"); |
188 | .appendField("Stored Particles:"); |
| 189 | this.appendValueInput("histogram") |
189 | this.appendValueInput("histogram") |
| 190 | .setCheck("histogram") |
190 | .setCheck("histogram") |
| 191 | .appendField("Histogram:"); |
191 | .appendField("Histogram:"); |
| 192 | this.setInputsInline(true); |
192 | this.setInputsInline(true); |
| 193 | this.setOutput(true, "particle list"); |
193 | this.setOutput(true, "particle list"); |
| 194 | this.setColour(180); |
194 | this.setColour(180); |
| 195 | this.setTooltip('Create a list of primary particles, if not used, the primary particles are used in the empty particle list connectors'); |
195 | this.setTooltip('Create a list of primary particles, if not used, the primary particles are used in the empty particle list connectors'); |
| 196 | this.setHelpUrl('http://belle2.jp/'); |
196 | this.setHelpUrl('http://belle2.jp/'); |
| 197 | } |
197 | } |
| 198 | }; |
198 | }; |
| 199 | 199 | ||