Subversion Repositories f9daq

Rev

Rev 329 | Rev 332 | 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")
321 f9daq 18
       .appendField(new Blockly.FieldDropdown([["electron", "ELECTRON"], ["muon", "MUON"], ["pion", "PION"], ["kaon", "KAON"],
19
                                                  ["proton", "PROTON"], ["photon", "PHOTON"], ["Phi meson", "PHI"], ["D meson", "D"],
329 f9daq 20
                                                  ["D* meson", "DSTAR"], ["J/Psi meson", "JPSI"],["B meson","B"], ["Lambda 0","LAMBDA0"]]), "simplepid");
193 f9daq 21
    this.appendDummyInput()
22
        .setAlign(Blockly.ALIGN_RIGHT)
271 f9daq 23
        .appendField("Min mass [GeV/c2] :")
193 f9daq 24
        .appendField(new Blockly.FieldNumber(0, 0, Infinity, 0.0001), "mass0");
25
    this.appendDummyInput()
26
        .setAlign(Blockly.ALIGN_RIGHT)
271 f9daq 27
        .appendField("Max mass  [GeV/c2] :")
193 f9daq 28
        .appendField(new Blockly.FieldNumber(0, 0, Infinity, 0.0001), "mass1");
319 f9daq 29
    //this.appendValueInput("histogram").setCheck("histogram").appendField("Histogram");
30
    this.appendDummyInput().appendField("Histograms");
31
    this.appendStatementInput("histogram")
32
        .setCheck("histogram");
193 f9daq 33
    this.setInputsInline(false);
34
    this.setOutput(true, "particle list");
35
    this.setColour(120);
318 f9daq 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/');
193 f9daq 38
  }
39
};
40
 
330 f9daq 41
Blockly.Blocks['particle_combiner3'] = {
42
  init: function() {
43
    this.appendDummyInput()
44
        .appendField("Combine 3 particles");
45
    this.appendValueInput("list1")
46
        .setCheck("particle list")
47
        .setAlign(Blockly.ALIGN_RIGHT)
48
        .appendField("Particle 1");
49
    this.appendValueInput("list2")
50
        .setCheck("particle list")
51
        .setAlign(Blockly.ALIGN_RIGHT)
52
        .appendField("Particle 2");
53
    this.appendValueInput("list3")
54
        .setCheck("particle list")
55
        .setAlign(Blockly.ALIGN_RIGHT)
56
        .appendField("Particle 3");
57
    this.appendDummyInput()
58
        .appendField("Same particle lists?")
59
        .appendField(new Blockly.FieldDropdown([["No", "0"], ["Yes", "1"]]), "sameparticles");
60
    this.appendDummyInput()
61
        .appendField("Set identity to")
62
       .appendField(new Blockly.FieldDropdown([["electron", "ELECTRON"], ["muon", "MUON"], ["pion", "PION"], ["kaon", "KAON"],
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"]]), "simplepid");
65
    this.appendDummyInput()
66
        .setAlign(Blockly.ALIGN_RIGHT)
67
        .appendField("Min mass [GeV/c2] :")
68
        .appendField(new Blockly.FieldNumber(0, 0, Infinity, 0.0001), "mass0");
69
    this.appendDummyInput()
70
        .setAlign(Blockly.ALIGN_RIGHT)
71
        .appendField("Max mass  [GeV/c2] :")
72
        .appendField(new Blockly.FieldNumber(0, 0, Infinity, 0.0001), "mass1");
73
    //this.appendValueInput("histogram").setCheck("histogram").appendField("Histogram");
74
    this.appendDummyInput().appendField("Histograms");
75
    this.appendStatementInput("histogram")
76
        .setCheck("histogram");
77
    this.setInputsInline(false);
78
    this.setOutput(true, "particle list");
79
    this.setColour(0);
80
    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.setHelpUrl('http://belle.jp/');
82
  }
83
};
84
 
85
 
193 f9daq 86
Blockly.Blocks['particle_selector'] = {
87
  init: function() {
88
    this.appendDummyInput()
89
        .appendField("Select Particles");
90
    this.appendValueInput("list1")
91
        .setCheck("particle list")
318 f9daq 92
        .appendField("Particle");
193 f9daq 93
    this.appendDummyInput()
94
        .appendField("Charge")
272 f9daq 95
        .appendField(new Blockly.FieldDropdown([["-1", "-1"], ["0", "0"], ["1", "1"], ["Any", "2"]]), "chargelist");
193 f9daq 96
    this.appendDummyInput()
97
        .appendField("Type")
321 f9daq 98
       .appendField(new Blockly.FieldDropdown([["electron", "ELECTRON"], ["muon", "MUON"], ["pion", "PION"], ["kaon", "KAON"],
99
                                                  ["proton", "PROTON"], ["photon", "PHOTON"], ["Phi meson", "PHI"], ["D meson", "D"],
100
                                                  ["D* meson", "DSTAR"], ["J/Psi meson", "JPSI"],["B meson","B"],["all particles","ALL"]]), "simplepid");
319 f9daq 101
    //this.appendValueInput("histogram").setCheck("histogram").appendField("Histogram");
102
    this.appendDummyInput().appendField("Histograms");
103
    this.appendStatementInput("histogram")
104
        .setCheck("histogram");
193 f9daq 105
    this.setInputsInline(false);
106
    this.setOutput(true, "particle list");
107
    this.setColour(65);
318 f9daq 108
    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.setHelpUrl('http://belle.jp/');
193 f9daq 110
  }
111
};
112
 
113
Blockly.Blocks['histogram_creator'] = {
114
  init: function() {
115
    this.appendDummyInput()
116
        .appendField("Histogram");
117
    this.appendDummyInput()
118
        .setAlign(Blockly.ALIGN_RIGHT)
119
        .appendField("Title")
120
        .appendField(new Blockly.FieldTextInput("Reconstructed Mass"), "name");
121
    this.appendDummyInput()
122
        .setAlign(Blockly.ALIGN_RIGHT)
123
        .appendField("Number of bins")
124
        .appendField(new Blockly.FieldNumber(40, 0), "nbins");
125
    this.appendDummyInput()
126
        .setAlign(Blockly.ALIGN_RIGHT)
127
        .appendField("Min:")
128
        .appendField(new Blockly.FieldNumber(0, -Infinity, Infinity, 0.0001), "min");
129
    this.appendDummyInput()
130
        .setAlign(Blockly.ALIGN_RIGHT)
131
        .appendField("Max:")
132
        .appendField(new Blockly.FieldNumber(0, -Infinity, Infinity, 0.0001), "max");
133
    this.appendDummyInput()
134
        .appendField("Variable")
273 f9daq 135
        .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 136
    this.setInputsInline(true);
319 f9daq 137
    this.setPreviousStatement(true);
138
    this.setNextStatement(true);
193 f9daq 139
    this.setColour(20);
267 f9daq 140
    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 141
    this.setHelpUrl('http://belle2.jp/');
193 f9daq 142
  }
143
};
144
 
145
Blockly.Blocks['simple_analysis'] = {
146
  init: function() {
147
    this.appendDummyInput()
148
        .appendField("Belle II Masterclass");
149
    this.appendDummyInput()
150
        .appendField("Number of events: ")
151
        .appendField(new Blockly.FieldNumber(5000, 0), "neve");
152
    this.appendDummyInput()
267 f9daq 153
        .appendField("First event: ")
154
        .appendField(new Blockly.FieldNumber(0, 0), "first");
155
    this.appendDummyInput()
193 f9daq 156
        .appendField("Data Source")
157
        .appendField(new Blockly.FieldDropdown([["hadron-1", "1"], ["hadron-2", "2"]]), "datasource");
267 f9daq 158
    this.appendDummyInput()
159
        .appendField("Print particle list?")
160
        .appendField(new Blockly.FieldDropdown([["No", "0"], ["Yes", "1"]]), "print");
193 f9daq 161
    this.appendValueInput("list")
162
        .setCheck("particle list")
163
        .appendField("Particle List");
164
    this.setColour(230);
267 f9daq 165
    this.setTooltip('Run the analysis, specify data source, number of events, first event and a list of particles to process.');
318 f9daq 166
    this.setHelpUrl('http://belle2.jp/');
193 f9daq 167
  }
168
};
169
 
170
Blockly.Blocks['particle_mass_fix'] = {
171
  init: function() {
172
    this.appendDummyInput()
173
        .appendField("Particle mass fix");
174
    this.appendValueInput("list")
175
        .setCheck("particle list")
176
        .appendField("Particle List");
177
    this.setOutput(true, "particle list");
178
    this.setColour(150);
179
    this.setTooltip('');
318 f9daq 180
    this.setHelpUrl('http://belle2.jp/');
193 f9daq 181
  }
182
};
183
 
184
Blockly.Blocks['primary_list'] = {
185
  init: function() {
186
    this.appendDummyInput()
187
        .appendField("Stored Particles:");
188
    this.appendValueInput("histogram")
189
        .setCheck("histogram")
190
        .appendField("Histogram:");
191
    this.setInputsInline(true);
192
    this.setOutput(true, "particle list");
193
    this.setColour(180);
267 f9daq 194
    this.setTooltip('Create a list of primary particles, if not used, the primary particles are used in the empty particle list connectors');
318 f9daq 195
    this.setHelpUrl('http://belle2.jp/');
193 f9daq 196
  }
197
};