Subversion Repositories f9daq

Rev

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

Blockly.Blocks['particle_combiner'] = {
  init: function() {
    this.appendDummyInput()
        .appendField("Combine 2 particles");
    this.appendValueInput("list1")
        .setCheck("particle list")
        .setAlign(Blockly.ALIGN_RIGHT)
        .appendField("1. Particle");
    this.appendValueInput("list2")
        .setCheck("particle list")
        .setAlign(Blockly.ALIGN_RIGHT)
        .appendField("2. Particle");
    this.appendDummyInput()
        .appendField("New Particle")
        .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");
    this.appendDummyInput()
        .setAlign(Blockly.ALIGN_RIGHT)
        .appendField("Min mass [GeV] :")
        .appendField(new Blockly.FieldNumber(0, 0, Infinity, 0.0001), "mass0");
    this.appendDummyInput()
        .setAlign(Blockly.ALIGN_RIGHT)
        .appendField("Max mass  [GeV] :")
        .appendField(new Blockly.FieldNumber(0, 0, Infinity, 0.0001), "mass1");
    this.appendValueInput("histogram")
        .setCheck("histogram")
        .appendField("Histogram");
    this.setInputsInline(false);
    this.setOutput(true, "particle list");
    this.setColour(120);
    this.setTooltip('');
    this.setHelpUrl('http://www.example.com/');
  }
};

Blockly.Blocks['particle_selector'] = {
  init: function() {
    this.appendDummyInput()
        .appendField("Select Particles");
    this.appendValueInput("list1")
        .setCheck("particle list")
        .appendField("Particles");
    this.appendDummyInput()
        .appendField("Charge")
        .appendField(new Blockly.FieldDropdown([["-1", "-1"], ["0", "0"], ["1", "1"]]), "chargelist");
    this.appendDummyInput()
        .appendField("Type")
        .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");
    this.appendValueInput("histogram")
        .setCheck("histogram")
        .appendField("Histogram");
    this.setInputsInline(false);
    this.setOutput(true, "particle list");
    this.setColour(65);
    this.setTooltip('');
    this.setHelpUrl('http://www.example.com/');
  }
};

Blockly.Blocks['histogram_creator'] = {
  init: function() {
    this.appendDummyInput()
        .appendField("Histogram");
    this.appendDummyInput()
        .setAlign(Blockly.ALIGN_RIGHT)
        .appendField("Title")
        .appendField(new Blockly.FieldTextInput("Reconstructed Mass"), "name");
    this.appendDummyInput()
        .setAlign(Blockly.ALIGN_RIGHT)
        .appendField("Number of bins")
        .appendField(new Blockly.FieldNumber(40, 0), "nbins");
    this.appendDummyInput()
        .setAlign(Blockly.ALIGN_RIGHT)
        .appendField("Min:")
        .appendField(new Blockly.FieldNumber(0, -Infinity, Infinity, 0.0001), "min");
    this.appendDummyInput()
        .setAlign(Blockly.ALIGN_RIGHT)
        .appendField("Max:")
        .appendField(new Blockly.FieldNumber(0, -Infinity, Infinity, 0.0001), "max");
    this.appendDummyInput()
        .appendField("Variable")
        .appendField(new Blockly.FieldDropdown([["mass", "GetMass"], ["momentum", "GetMomentum"], ["energy", "GetEnergy"]]), "varname");
    this.setInputsInline(true);
    this.setOutput(true, "histogram");
    this.setColour(20);
    this.setTooltip('');
    this.setHelpUrl('http://www.example.com/');
  }
};

Blockly.Blocks['simple_analysis'] = {
  init: function() {
    this.appendDummyInput()
        .appendField("Belle II Masterclass");
    this.appendDummyInput()
        .appendField("Number of events: ")
        .appendField(new Blockly.FieldNumber(5000, 0), "neve");
    this.appendDummyInput()
        .appendField("Data Source")
        .appendField(new Blockly.FieldDropdown([["hadron-1", "1"], ["hadron-2", "2"]]), "datasource");
    this.appendValueInput("list")
        .setCheck("particle list")
        .appendField("Particle List");
    this.setColour(230);
    this.setTooltip('');
    this.setHelpUrl('http://www.example.com/');
  }
};

Blockly.Blocks['particle_mass_fix'] = {
  init: function() {
    this.appendDummyInput()
        .appendField("Particle mass fix");
    this.appendValueInput("list")
        .setCheck("particle list")
        .appendField("Particle List");
    this.setOutput(true, "particle list");
    this.setColour(150);
    this.setTooltip('');
    this.setHelpUrl('http://www.example.com/');
  }
};

Blockly.Blocks['primary_list'] = {
  init: function() {
    this.appendDummyInput()
        .appendField("Stored Particles:");
    this.appendValueInput("histogram")
        .setCheck("histogram")
        .appendField("Histogram:");
    this.setInputsInline(true);
    this.setOutput(true, "particle list");
    this.setColour(180);
    this.setTooltip('');
    this.setHelpUrl('http://www.example.com/');
  }
};