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