Rev 321 | Rev 330 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 321 | Rev 329 | ||
|---|---|---|---|
| 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"]]), "simplepid"); |
20 | ["D* meson", "DSTAR"], ["J/Psi meson", "JPSI"],["B meson","B"], ["Lambda 0","LAMBDA0"]]), "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_selector'] = { |
41 | Blockly.Blocks['particle_selector'] = { |
| 42 | init: function() { |
42 | init: function() { |
| 43 | this.appendDummyInput() |
43 | this.appendDummyInput() |
| 44 | .appendField("Select Particles"); |
44 | .appendField("Select Particles"); |
| 45 | this.appendValueInput("list1") |
45 | this.appendValueInput("list1") |
| 46 | .setCheck("particle list") |
46 | .setCheck("particle list") |
| 47 | .appendField("Particle"); |
47 | .appendField("Particle"); |
| 48 | this.appendDummyInput() |
48 | this.appendDummyInput() |
| 49 | .appendField("Charge") |
49 | .appendField("Charge") |
| 50 | .appendField(new Blockly.FieldDropdown([["-1", "-1"], ["0", "0"], ["1", "1"], ["Any", "2"]]), "chargelist"); |
50 | .appendField(new Blockly.FieldDropdown([["-1", "-1"], ["0", "0"], ["1", "1"], ["Any", "2"]]), "chargelist"); |
| 51 | this.appendDummyInput() |
51 | this.appendDummyInput() |
| 52 | .appendField("Type") |
52 | .appendField("Type") |
| 53 | .appendField(new Blockly.FieldDropdown([["electron", "ELECTRON"], ["muon", "MUON"], ["pion", "PION"], ["kaon", "KAON"], |
53 | .appendField(new Blockly.FieldDropdown([["electron", "ELECTRON"], ["muon", "MUON"], ["pion", "PION"], ["kaon", "KAON"], |
| 54 | ["proton", "PROTON"], ["photon", "PHOTON"], ["Phi meson", "PHI"], ["D meson", "D"], |
54 | ["proton", "PROTON"], ["photon", "PHOTON"], ["Phi meson", "PHI"], ["D meson", "D"], |
| 55 | ["D* meson", "DSTAR"], ["J/Psi meson", "JPSI"],["B meson","B"],["all particles","ALL"]]), "simplepid"); |
55 | ["D* meson", "DSTAR"], ["J/Psi meson", "JPSI"],["B meson","B"],["all particles","ALL"]]), "simplepid"); |
| 56 | //this.appendValueInput("histogram").setCheck("histogram").appendField("Histogram"); |
56 | //this.appendValueInput("histogram").setCheck("histogram").appendField("Histogram"); |
| 57 | this.appendDummyInput().appendField("Histograms"); |
57 | this.appendDummyInput().appendField("Histograms"); |
| 58 | this.appendStatementInput("histogram") |
58 | this.appendStatementInput("histogram") |
| 59 | .setCheck("histogram"); |
59 | .setCheck("histogram"); |
| 60 | this.setInputsInline(false); |
60 | this.setInputsInline(false); |
| 61 | this.setOutput(true, "particle list"); |
61 | this.setOutput(true, "particle list"); |
| 62 | this.setColour(65); |
62 | this.setColour(65); |
| 63 | 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.'); |
63 | 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.'); |
| 64 | this.setHelpUrl('http://belle.jp/'); |
64 | this.setHelpUrl('http://belle.jp/'); |
| 65 | } |
65 | } |
| 66 | }; |
66 | }; |
| 67 | 67 | ||
| 68 | Blockly.Blocks['histogram_creator'] = { |
68 | Blockly.Blocks['histogram_creator'] = { |
| 69 | init: function() { |
69 | init: function() { |
| 70 | this.appendDummyInput() |
70 | this.appendDummyInput() |
| 71 | .appendField("Histogram"); |
71 | .appendField("Histogram"); |
| 72 | this.appendDummyInput() |
72 | this.appendDummyInput() |
| 73 | .setAlign(Blockly.ALIGN_RIGHT) |
73 | .setAlign(Blockly.ALIGN_RIGHT) |
| 74 | .appendField("Title") |
74 | .appendField("Title") |
| 75 | .appendField(new Blockly.FieldTextInput("Reconstructed Mass"), "name"); |
75 | .appendField(new Blockly.FieldTextInput("Reconstructed Mass"), "name"); |
| 76 | this.appendDummyInput() |
76 | this.appendDummyInput() |
| 77 | .setAlign(Blockly.ALIGN_RIGHT) |
77 | .setAlign(Blockly.ALIGN_RIGHT) |
| 78 | .appendField("Number of bins") |
78 | .appendField("Number of bins") |
| 79 | .appendField(new Blockly.FieldNumber(40, 0), "nbins"); |
79 | .appendField(new Blockly.FieldNumber(40, 0), "nbins"); |
| 80 | this.appendDummyInput() |
80 | this.appendDummyInput() |
| 81 | .setAlign(Blockly.ALIGN_RIGHT) |
81 | .setAlign(Blockly.ALIGN_RIGHT) |
| 82 | .appendField("Min:") |
82 | .appendField("Min:") |
| 83 | .appendField(new Blockly.FieldNumber(0, -Infinity, Infinity, 0.0001), "min"); |
83 | .appendField(new Blockly.FieldNumber(0, -Infinity, Infinity, 0.0001), "min"); |
| 84 | this.appendDummyInput() |
84 | this.appendDummyInput() |
| 85 | .setAlign(Blockly.ALIGN_RIGHT) |
85 | .setAlign(Blockly.ALIGN_RIGHT) |
| 86 | .appendField("Max:") |
86 | .appendField("Max:") |
| 87 | .appendField(new Blockly.FieldNumber(0, -Infinity, Infinity, 0.0001), "max"); |
87 | .appendField(new Blockly.FieldNumber(0, -Infinity, Infinity, 0.0001), "max"); |
| 88 | this.appendDummyInput() |
88 | this.appendDummyInput() |
| 89 | .appendField("Variable") |
89 | .appendField("Variable") |
| 90 | .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"); |
90 | .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"); |
| 91 | this.setInputsInline(true); |
91 | this.setInputsInline(true); |
| 92 | this.setPreviousStatement(true); |
92 | this.setPreviousStatement(true); |
| 93 | this.setNextStatement(true); |
93 | this.setNextStatement(true); |
| 94 | this.setColour(20); |
94 | this.setColour(20); |
| 95 | 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'); |
95 | 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'); |
| 96 | this.setHelpUrl('http://belle2.jp/'); |
96 | this.setHelpUrl('http://belle2.jp/'); |
| 97 | } |
97 | } |
| 98 | }; |
98 | }; |
| 99 | 99 | ||
| 100 | Blockly.Blocks['simple_analysis'] = { |
100 | Blockly.Blocks['simple_analysis'] = { |
| 101 | init: function() { |
101 | init: function() { |
| 102 | this.appendDummyInput() |
102 | this.appendDummyInput() |
| 103 | .appendField("Belle II Masterclass"); |
103 | .appendField("Belle II Masterclass"); |
| 104 | this.appendDummyInput() |
104 | this.appendDummyInput() |
| 105 | .appendField("Number of events: ") |
105 | .appendField("Number of events: ") |
| 106 | .appendField(new Blockly.FieldNumber(5000, 0), "neve"); |
106 | .appendField(new Blockly.FieldNumber(5000, 0), "neve"); |
| 107 | this.appendDummyInput() |
107 | this.appendDummyInput() |
| 108 | .appendField("First event: ") |
108 | .appendField("First event: ") |
| 109 | .appendField(new Blockly.FieldNumber(0, 0), "first"); |
109 | .appendField(new Blockly.FieldNumber(0, 0), "first"); |
| 110 | this.appendDummyInput() |
110 | this.appendDummyInput() |
| 111 | .appendField("Data Source") |
111 | .appendField("Data Source") |
| 112 | .appendField(new Blockly.FieldDropdown([["hadron-1", "1"], ["hadron-2", "2"]]), "datasource"); |
112 | .appendField(new Blockly.FieldDropdown([["hadron-1", "1"], ["hadron-2", "2"]]), "datasource"); |
| 113 | this.appendDummyInput() |
113 | this.appendDummyInput() |
| 114 | .appendField("Print particle list?") |
114 | .appendField("Print particle list?") |
| 115 | .appendField(new Blockly.FieldDropdown([["No", "0"], ["Yes", "1"]]), "print"); |
115 | .appendField(new Blockly.FieldDropdown([["No", "0"], ["Yes", "1"]]), "print"); |
| 116 | this.appendValueInput("list") |
116 | this.appendValueInput("list") |
| 117 | .setCheck("particle list") |
117 | .setCheck("particle list") |
| 118 | .appendField("Particle List"); |
118 | .appendField("Particle List"); |
| 119 | this.setColour(230); |
119 | this.setColour(230); |
| 120 | this.setTooltip('Run the analysis, specify data source, number of events, first event and a list of particles to process.'); |
120 | this.setTooltip('Run the analysis, specify data source, number of events, first event and a list of particles to process.'); |
| 121 | this.setHelpUrl('http://belle2.jp/'); |
121 | this.setHelpUrl('http://belle2.jp/'); |
| 122 | } |
122 | } |
| 123 | }; |
123 | }; |
| 124 | 124 | ||
| 125 | Blockly.Blocks['particle_mass_fix'] = { |
125 | Blockly.Blocks['particle_mass_fix'] = { |
| 126 | init: function() { |
126 | init: function() { |
| 127 | this.appendDummyInput() |
127 | this.appendDummyInput() |
| 128 | .appendField("Particle mass fix"); |
128 | .appendField("Particle mass fix"); |
| 129 | this.appendValueInput("list") |
129 | this.appendValueInput("list") |
| 130 | .setCheck("particle list") |
130 | .setCheck("particle list") |
| 131 | .appendField("Particle List"); |
131 | .appendField("Particle List"); |
| 132 | this.setOutput(true, "particle list"); |
132 | this.setOutput(true, "particle list"); |
| 133 | this.setColour(150); |
133 | this.setColour(150); |
| 134 | this.setTooltip(''); |
134 | this.setTooltip(''); |
| 135 | this.setHelpUrl('http://belle2.jp/'); |
135 | this.setHelpUrl('http://belle2.jp/'); |
| 136 | } |
136 | } |
| 137 | }; |
137 | }; |
| 138 | 138 | ||
| 139 | Blockly.Blocks['primary_list'] = { |
139 | Blockly.Blocks['primary_list'] = { |
| 140 | init: function() { |
140 | init: function() { |
| 141 | this.appendDummyInput() |
141 | this.appendDummyInput() |
| 142 | .appendField("Stored Particles:"); |
142 | .appendField("Stored Particles:"); |
| 143 | this.appendValueInput("histogram") |
143 | this.appendValueInput("histogram") |
| 144 | .setCheck("histogram") |
144 | .setCheck("histogram") |
| 145 | .appendField("Histogram:"); |
145 | .appendField("Histogram:"); |
| 146 | this.setInputsInline(true); |
146 | this.setInputsInline(true); |
| 147 | this.setOutput(true, "particle list"); |
147 | this.setOutput(true, "particle list"); |
| 148 | this.setColour(180); |
148 | this.setColour(180); |
| 149 | this.setTooltip('Create a list of primary particles, if not used, the primary particles are used in the empty particle list connectors'); |
149 | this.setTooltip('Create a list of primary particles, if not used, the primary particles are used in the empty particle list connectors'); |
| 150 | this.setHelpUrl('http://belle2.jp/'); |
150 | this.setHelpUrl('http://belle2.jp/'); |
| 151 | } |
151 | } |
| 152 | }; |
152 | }; |
| 153 | 153 | ||