Subversion Repositories f9daq

Rev

Rev 266 | Rev 271 | 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)
8
        .appendField("1. Particle");
9
    this.appendValueInput("list2")
10
        .setCheck("particle list")
11
        .setAlign(Blockly.ALIGN_RIGHT)
12
        .appendField("2. Particle");
13
    this.appendDummyInput()
267 f9daq 14
        .appendField("Same particle lists?")
15
        .appendField(new Blockly.FieldDropdown([["No", "0"], ["Yes", "1"]]), "sameparticles");
16
    this.appendDummyInput()
193 f9daq 17
        .appendField("New Particle")
18
        .appendField(new Blockly.FieldDropdown([["electron", "ELECTRON"], ["muon", "MUON"], ["pion", "PION"], ["kaon", "KAON"], ["proton", "PROTON"], ["photon", "PHOTON"], ["Ks", "KS"], ["D", "D"], ["D*", "DSTAR"], ["J/Psi", "JPSI"]]), "simplepid");
19
    this.appendDummyInput()
20
        .setAlign(Blockly.ALIGN_RIGHT)
21
        .appendField("Min mass [GeV] :")
22
        .appendField(new Blockly.FieldNumber(0, 0, Infinity, 0.0001), "mass0");
23
    this.appendDummyInput()
24
        .setAlign(Blockly.ALIGN_RIGHT)
25
        .appendField("Max mass  [GeV] :")
26
        .appendField(new Blockly.FieldNumber(0, 0, Infinity, 0.0001), "mass1");
27
    this.appendValueInput("histogram")
28
        .setCheck("histogram")
29
        .appendField("Histogram");
30
    this.setInputsInline(false);
31
    this.setOutput(true, "particle list");
32
    this.setColour(120);
267 f9daq 33
    this.setTooltip('Combine two particles in the new particle by making combinations between particles in two input lists');
193 f9daq 34
    this.setHelpUrl('http://www.example.com/');
35
  }
36
};
37
 
38
Blockly.Blocks['particle_selector'] = {
39
  init: function() {
40
    this.appendDummyInput()
41
        .appendField("Select Particles");
42
    this.appendValueInput("list1")
43
        .setCheck("particle list")
44
        .appendField("Particles");
45
    this.appendDummyInput()
46
        .appendField("Charge")
47
        .appendField(new Blockly.FieldDropdown([["-1", "-1"], ["0", "0"], ["1", "1"]]), "chargelist");
48
    this.appendDummyInput()
49
        .appendField("Type")
266 f9daq 50
        .appendField(new Blockly.FieldDropdown([["electron", "ELECTRON"], ["muon", "MUON"], ["pion", "PION"], ["kaon", "KAON"], ["proton", "PROTON"], ["photon", "PHOTON"], ["Ks", "KS"], ["D", "D"], ["D*", "DSTAR"], ["J/Psi", "JPSI"], ["all particles", "ALL"]]), "simplepid");
193 f9daq 51
    this.appendValueInput("histogram")
52
        .setCheck("histogram")
53
        .appendField("Histogram");
54
    this.setInputsInline(false);
55
    this.setOutput(true, "particle list");
56
    this.setColour(65);
267 f9daq 57
    this.setTooltip('Create a new list of particles based on the original particle list or any input particle list');
193 f9daq 58
    this.setHelpUrl('http://www.example.com/');
59
  }
60
};
61
 
62
Blockly.Blocks['histogram_creator'] = {
63
  init: function() {
64
    this.appendDummyInput()
65
        .appendField("Histogram");
66
    this.appendDummyInput()
67
        .setAlign(Blockly.ALIGN_RIGHT)
68
        .appendField("Title")
69
        .appendField(new Blockly.FieldTextInput("Reconstructed Mass"), "name");
70
    this.appendDummyInput()
71
        .setAlign(Blockly.ALIGN_RIGHT)
72
        .appendField("Number of bins")
73
        .appendField(new Blockly.FieldNumber(40, 0), "nbins");
74
    this.appendDummyInput()
75
        .setAlign(Blockly.ALIGN_RIGHT)
76
        .appendField("Min:")
77
        .appendField(new Blockly.FieldNumber(0, -Infinity, Infinity, 0.0001), "min");
78
    this.appendDummyInput()
79
        .setAlign(Blockly.ALIGN_RIGHT)
80
        .appendField("Max:")
81
        .appendField(new Blockly.FieldNumber(0, -Infinity, Infinity, 0.0001), "max");
82
    this.appendDummyInput()
83
        .appendField("Variable")
84
        .appendField(new Blockly.FieldDropdown([["mass", "GetMass"], ["momentum", "GetMomentum"], ["energy", "GetEnergy"]]), "varname");
85
    this.setInputsInline(true);
86
    this.setOutput(true, "histogram");
87
    this.setColour(20);
267 f9daq 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');
193 f9daq 89
    this.setHelpUrl('http://www.example.com/');
90
  }
91
};
92
 
93
Blockly.Blocks['simple_analysis'] = {
94
  init: function() {
95
    this.appendDummyInput()
96
        .appendField("Belle II Masterclass");
97
    this.appendDummyInput()
98
        .appendField("Number of events: ")
99
        .appendField(new Blockly.FieldNumber(5000, 0), "neve");
100
    this.appendDummyInput()
267 f9daq 101
        .appendField("First event: ")
102
        .appendField(new Blockly.FieldNumber(0, 0), "first");
103
    this.appendDummyInput()
193 f9daq 104
        .appendField("Data Source")
105
        .appendField(new Blockly.FieldDropdown([["hadron-1", "1"], ["hadron-2", "2"]]), "datasource");
267 f9daq 106
    this.appendDummyInput()
107
        .appendField("Print particle list?")
108
        .appendField(new Blockly.FieldDropdown([["No", "0"], ["Yes", "1"]]), "print");
193 f9daq 109
    this.appendValueInput("list")
110
        .setCheck("particle list")
111
        .appendField("Particle List");
112
    this.setColour(230);
267 f9daq 113
    this.setTooltip('Run the analysis, specify data source, number of events, first event and a list of particles to process.');
193 f9daq 114
    this.setHelpUrl('http://www.example.com/');
115
  }
116
};
117
 
118
Blockly.Blocks['particle_mass_fix'] = {
119
  init: function() {
120
    this.appendDummyInput()
121
        .appendField("Particle mass fix");
122
    this.appendValueInput("list")
123
        .setCheck("particle list")
124
        .appendField("Particle List");
125
    this.setOutput(true, "particle list");
126
    this.setColour(150);
127
    this.setTooltip('');
128
    this.setHelpUrl('http://www.example.com/');
129
  }
130
};
131
 
132
Blockly.Blocks['primary_list'] = {
133
  init: function() {
134
    this.appendDummyInput()
135
        .appendField("Stored Particles:");
136
    this.appendValueInput("histogram")
137
        .setCheck("histogram")
138
        .appendField("Histogram:");
139
    this.setInputsInline(true);
140
    this.setOutput(true, "particle list");
141
    this.setColour(180);
267 f9daq 142
    this.setTooltip('Create a list of primary particles, if not used, the primary particles are used in the empty particle list connectors');
193 f9daq 143
    this.setHelpUrl('http://www.example.com/');
144
  }
145
};