Rev 318 | Rev 321 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
193 | f9daq | 1 | Blockly.Blocks['particle_combiner'] = { |
2 | init: function() { |
||
3 | this.appendDummyInput() |
||
4 | .appendField("Combine 2 particles"); |
||
5 | this.appendValueInput("list1") |
||
6 | .setCheck("particle list") |
||
7 | .setAlign(Blockly.ALIGN_RIGHT) |
||
318 | f9daq | 8 | .appendField("Particle 1"); |
193 | f9daq | 9 | this.appendValueInput("list2") |
10 | .setCheck("particle list") |
||
11 | .setAlign(Blockly.ALIGN_RIGHT) |
||
318 | f9daq | 12 | .appendField("Particle 2"); |
193 | f9daq | 13 | this.appendDummyInput() |
267 | f9daq | 14 | .appendField("Same particle lists?") |
15 | .appendField(new Blockly.FieldDropdown([["No", "0"], ["Yes", "1"]]), "sameparticles"); |
||
16 | this.appendDummyInput() |
||
272 | f9daq | 17 | .appendField("Set identity to") |
302 | f9daq | 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"); |
193 | f9daq | 19 | this.appendDummyInput() |
20 | .setAlign(Blockly.ALIGN_RIGHT) |
||
271 | f9daq | 21 | .appendField("Min mass [GeV/c2] :") |
193 | f9daq | 22 | .appendField(new Blockly.FieldNumber(0, 0, Infinity, 0.0001), "mass0"); |
23 | this.appendDummyInput() |
||
24 | .setAlign(Blockly.ALIGN_RIGHT) |
||
271 | f9daq | 25 | .appendField("Max mass [GeV/c2] :") |
193 | f9daq | 26 | .appendField(new Blockly.FieldNumber(0, 0, Infinity, 0.0001), "mass1"); |
319 | f9daq | 27 | //this.appendValueInput("histogram").setCheck("histogram").appendField("Histogram"); |
28 | this.appendDummyInput().appendField("Histograms"); |
||
29 | this.appendStatementInput("histogram") |
||
30 | .setCheck("histogram"); |
||
193 | f9daq | 31 | this.setInputsInline(false); |
32 | this.setOutput(true, "particle list"); |
||
33 | this.setColour(120); |
||
318 | f9daq | 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'); |
35 | this.setHelpUrl('http://belle.jp/'); |
||
193 | f9daq | 36 | } |
37 | }; |
||
38 | |||
39 | Blockly.Blocks['particle_selector'] = { |
||
40 | init: function() { |
||
41 | this.appendDummyInput() |
||
42 | .appendField("Select Particles"); |
||
43 | this.appendValueInput("list1") |
||
44 | .setCheck("particle list") |
||
318 | f9daq | 45 | .appendField("Particle"); |
193 | f9daq | 46 | this.appendDummyInput() |
47 | .appendField("Charge") |
||
272 | f9daq | 48 | .appendField(new Blockly.FieldDropdown([["-1", "-1"], ["0", "0"], ["1", "1"], ["Any", "2"]]), "chargelist"); |
193 | f9daq | 49 | this.appendDummyInput() |
50 | .appendField("Type") |
||
271 | f9daq | 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"); |
319 | f9daq | 52 | //this.appendValueInput("histogram").setCheck("histogram").appendField("Histogram"); |
53 | this.appendDummyInput().appendField("Histograms"); |
||
54 | this.appendStatementInput("histogram") |
||
55 | .setCheck("histogram"); |
||
193 | f9daq | 56 | this.setInputsInline(false); |
57 | this.setOutput(true, "particle list"); |
||
58 | this.setColour(65); |
||
318 | f9daq | 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.'); |
60 | this.setHelpUrl('http://belle.jp/'); |
||
193 | f9daq | 61 | } |
62 | }; |
||
63 | |||
64 | Blockly.Blocks['histogram_creator'] = { |
||
65 | init: function() { |
||
66 | this.appendDummyInput() |
||
67 | .appendField("Histogram"); |
||
68 | this.appendDummyInput() |
||
69 | .setAlign(Blockly.ALIGN_RIGHT) |
||
70 | .appendField("Title") |
||
71 | .appendField(new Blockly.FieldTextInput("Reconstructed Mass"), "name"); |
||
72 | this.appendDummyInput() |
||
73 | .setAlign(Blockly.ALIGN_RIGHT) |
||
74 | .appendField("Number of bins") |
||
75 | .appendField(new Blockly.FieldNumber(40, 0), "nbins"); |
||
76 | this.appendDummyInput() |
||
77 | .setAlign(Blockly.ALIGN_RIGHT) |
||
78 | .appendField("Min:") |
||
79 | .appendField(new Blockly.FieldNumber(0, -Infinity, Infinity, 0.0001), "min"); |
||
80 | this.appendDummyInput() |
||
81 | .setAlign(Blockly.ALIGN_RIGHT) |
||
82 | .appendField("Max:") |
||
83 | .appendField(new Blockly.FieldNumber(0, -Infinity, Infinity, 0.0001), "max"); |
||
84 | this.appendDummyInput() |
||
85 | .appendField("Variable") |
||
273 | f9daq | 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"); |
193 | f9daq | 87 | this.setInputsInline(true); |
319 | f9daq | 88 | this.setPreviousStatement(true); |
89 | this.setNextStatement(true); |
||
193 | f9daq | 90 | this.setColour(20); |
267 | f9daq | 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'); |
318 | f9daq | 92 | this.setHelpUrl('http://belle2.jp/'); |
193 | f9daq | 93 | } |
94 | }; |
||
95 | |||
96 | Blockly.Blocks['simple_analysis'] = { |
||
97 | init: function() { |
||
98 | this.appendDummyInput() |
||
99 | .appendField("Belle II Masterclass"); |
||
100 | this.appendDummyInput() |
||
101 | .appendField("Number of events: ") |
||
102 | .appendField(new Blockly.FieldNumber(5000, 0), "neve"); |
||
103 | this.appendDummyInput() |
||
267 | f9daq | 104 | .appendField("First event: ") |
105 | .appendField(new Blockly.FieldNumber(0, 0), "first"); |
||
106 | this.appendDummyInput() |
||
193 | f9daq | 107 | .appendField("Data Source") |
108 | .appendField(new Blockly.FieldDropdown([["hadron-1", "1"], ["hadron-2", "2"]]), "datasource"); |
||
267 | f9daq | 109 | this.appendDummyInput() |
110 | .appendField("Print particle list?") |
||
111 | .appendField(new Blockly.FieldDropdown([["No", "0"], ["Yes", "1"]]), "print"); |
||
193 | f9daq | 112 | this.appendValueInput("list") |
113 | .setCheck("particle list") |
||
114 | .appendField("Particle List"); |
||
115 | this.setColour(230); |
||
267 | f9daq | 116 | this.setTooltip('Run the analysis, specify data source, number of events, first event and a list of particles to process.'); |
318 | f9daq | 117 | this.setHelpUrl('http://belle2.jp/'); |
193 | f9daq | 118 | } |
119 | }; |
||
120 | |||
121 | Blockly.Blocks['particle_mass_fix'] = { |
||
122 | init: function() { |
||
123 | this.appendDummyInput() |
||
124 | .appendField("Particle mass fix"); |
||
125 | this.appendValueInput("list") |
||
126 | .setCheck("particle list") |
||
127 | .appendField("Particle List"); |
||
128 | this.setOutput(true, "particle list"); |
||
129 | this.setColour(150); |
||
130 | this.setTooltip(''); |
||
318 | f9daq | 131 | this.setHelpUrl('http://belle2.jp/'); |
193 | f9daq | 132 | } |
133 | }; |
||
134 | |||
135 | Blockly.Blocks['primary_list'] = { |
||
136 | init: function() { |
||
137 | this.appendDummyInput() |
||
138 | .appendField("Stored Particles:"); |
||
139 | this.appendValueInput("histogram") |
||
140 | .setCheck("histogram") |
||
141 | .appendField("Histogram:"); |
||
142 | this.setInputsInline(true); |
||
143 | this.setOutput(true, "particle list"); |
||
144 | this.setColour(180); |
||
267 | f9daq | 145 | this.setTooltip('Create a list of primary particles, if not used, the primary particles are used in the empty particle list connectors'); |
318 | f9daq | 146 | this.setHelpUrl('http://belle2.jp/'); |
193 | f9daq | 147 | } |
148 | }; |