Subversion Repositories f9daq

Rev

Rev 267 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

  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()
  14.         .appendField("New Particle")
  15.         .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");
  16.     this.appendDummyInput()
  17.         .setAlign(Blockly.ALIGN_RIGHT)
  18.         .appendField("Min mass [GeV] :")
  19.         .appendField(new Blockly.FieldNumber(0, 0, Infinity, 0.0001), "mass0");
  20.     this.appendDummyInput()
  21.         .setAlign(Blockly.ALIGN_RIGHT)
  22.         .appendField("Max mass  [GeV] :")
  23.         .appendField(new Blockly.FieldNumber(0, 0, Infinity, 0.0001), "mass1");
  24.     this.appendValueInput("histogram")
  25.         .setCheck("histogram")
  26.         .appendField("Histogram");
  27.     this.setInputsInline(false);
  28.     this.setOutput(true, "particle list");
  29.     this.setColour(120);
  30.     this.setTooltip('');
  31.     this.setHelpUrl('http://www.example.com/');
  32.   }
  33. };
  34.  
  35. Blockly.Blocks['particle_selector'] = {
  36.   init: function() {
  37.     this.appendDummyInput()
  38.         .appendField("Select Particles");
  39.     this.appendValueInput("list1")
  40.         .setCheck("particle list")
  41.         .appendField("Particles");
  42.     this.appendDummyInput()
  43.         .appendField("Charge")
  44.         .appendField(new Blockly.FieldDropdown([["-1", "-1"], ["0", "0"], ["1", "1"]]), "chargelist");
  45.     this.appendDummyInput()
  46.         .appendField("Type")
  47.         .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");
  48.     this.appendValueInput("histogram")
  49.         .setCheck("histogram")
  50.         .appendField("Histogram");
  51.     this.setInputsInline(false);
  52.     this.setOutput(true, "particle list");
  53.     this.setColour(65);
  54.     this.setTooltip('');
  55.     this.setHelpUrl('http://www.example.com/');
  56.   }
  57. };
  58.  
  59. Blockly.Blocks['histogram_creator'] = {
  60.   init: function() {
  61.     this.appendDummyInput()
  62.         .appendField("Histogram");
  63.     this.appendDummyInput()
  64.         .setAlign(Blockly.ALIGN_RIGHT)
  65.         .appendField("Title")
  66.         .appendField(new Blockly.FieldTextInput("Reconstructed Mass"), "name");
  67.     this.appendDummyInput()
  68.         .setAlign(Blockly.ALIGN_RIGHT)
  69.         .appendField("Number of bins")
  70.         .appendField(new Blockly.FieldNumber(40, 0), "nbins");
  71.     this.appendDummyInput()
  72.         .setAlign(Blockly.ALIGN_RIGHT)
  73.         .appendField("Min:")
  74.         .appendField(new Blockly.FieldNumber(0, -Infinity, Infinity, 0.0001), "min");
  75.     this.appendDummyInput()
  76.         .setAlign(Blockly.ALIGN_RIGHT)
  77.         .appendField("Max:")
  78.         .appendField(new Blockly.FieldNumber(0, -Infinity, Infinity, 0.0001), "max");
  79.     this.appendDummyInput()
  80.         .appendField("Variable")
  81.         .appendField(new Blockly.FieldDropdown([["mass", "GetMass"], ["momentum", "GetMomentum"], ["energy", "GetEnergy"]]), "varname");
  82.     this.setInputsInline(true);
  83.     this.setOutput(true, "histogram");
  84.     this.setColour(20);
  85.     this.setTooltip('');
  86.     this.setHelpUrl('http://www.example.com/');
  87.   }
  88. };
  89.  
  90. Blockly.Blocks['simple_analysis'] = {
  91.   init: function() {
  92.     this.appendDummyInput()
  93.         .appendField("Belle II Masterclass");
  94.     this.appendDummyInput()
  95.         .appendField("Number of events: ")
  96.         .appendField(new Blockly.FieldNumber(5000, 0), "neve");
  97.     this.appendDummyInput()
  98.         .appendField("Data Source")
  99.         .appendField(new Blockly.FieldDropdown([["hadron-1", "1"], ["hadron-2", "2"]]), "datasource");
  100.     this.appendValueInput("list")
  101.         .setCheck("particle list")
  102.         .appendField("Particle List");
  103.     this.setColour(230);
  104.     this.setTooltip('');
  105.     this.setHelpUrl('http://www.example.com/');
  106.   }
  107. };
  108.  
  109. Blockly.Blocks['particle_mass_fix'] = {
  110.   init: function() {
  111.     this.appendDummyInput()
  112.         .appendField("Particle mass fix");
  113.     this.appendValueInput("list")
  114.         .setCheck("particle list")
  115.         .appendField("Particle List");
  116.     this.setOutput(true, "particle list");
  117.     this.setColour(150);
  118.     this.setTooltip('');
  119.     this.setHelpUrl('http://www.example.com/');
  120.   }
  121. };
  122.  
  123. Blockly.Blocks['primary_list'] = {
  124.   init: function() {
  125.     this.appendDummyInput()
  126.         .appendField("Stored Particles:");
  127.     this.appendValueInput("histogram")
  128.         .setCheck("histogram")
  129.         .appendField("Histogram:");
  130.     this.setInputsInline(true);
  131.     this.setOutput(true, "particle list");
  132.     this.setColour(180);
  133.     this.setTooltip('');
  134.     this.setHelpUrl('http://www.example.com/');
  135.   }
  136. };
  137.