Subversion Repositories f9daq

Rev

Rev 318 | Rev 321 | 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("Particle 1");
  9.     this.appendValueInput("list2")
  10.         .setCheck("particle list")
  11.         .setAlign(Blockly.ALIGN_RIGHT)
  12.         .appendField("Particle 2");
  13.     this.appendDummyInput()
  14.         .appendField("Same particle lists?")
  15.         .appendField(new Blockly.FieldDropdown([["No", "0"], ["Yes", "1"]]), "sameparticles");
  16.     this.appendDummyInput()
  17.         .appendField("Set identity to")
  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");
  19.     this.appendDummyInput()
  20.         .setAlign(Blockly.ALIGN_RIGHT)
  21.         .appendField("Min mass [GeV/c2] :")
  22.         .appendField(new Blockly.FieldNumber(0, 0, Infinity, 0.0001), "mass0");
  23.     this.appendDummyInput()
  24.         .setAlign(Blockly.ALIGN_RIGHT)
  25.         .appendField("Max mass  [GeV/c2] :")
  26.         .appendField(new Blockly.FieldNumber(0, 0, Infinity, 0.0001), "mass1");
  27.     //this.appendValueInput("histogram").setCheck("histogram").appendField("Histogram");
  28.     this.appendDummyInput().appendField("Histograms");
  29.     this.appendStatementInput("histogram")
  30.         .setCheck("histogram");
  31.     this.setInputsInline(false);
  32.     this.setOutput(true, "particle list");
  33.     this.setColour(120);
  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/');
  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")
  45.         .appendField("Particle");
  46.     this.appendDummyInput()
  47.         .appendField("Charge")
  48.         .appendField(new Blockly.FieldDropdown([["-1", "-1"], ["0", "0"], ["1", "1"], ["Any", "2"]]), "chargelist");
  49.     this.appendDummyInput()
  50.         .appendField("Type")
  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");
  52.     //this.appendValueInput("histogram").setCheck("histogram").appendField("Histogram");
  53.     this.appendDummyInput().appendField("Histograms");
  54.     this.appendStatementInput("histogram")
  55.         .setCheck("histogram");
  56.     this.setInputsInline(false);
  57.     this.setOutput(true, "particle list");
  58.     this.setColour(65);
  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/');
  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")
  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");
  87.     this.setInputsInline(true);
  88.     this.setPreviousStatement(true);
  89.     this.setNextStatement(true);
  90.     this.setColour(20);
  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');
  92.     this.setHelpUrl('http://belle2.jp/');
  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()
  104.         .appendField("First event: ")
  105.         .appendField(new Blockly.FieldNumber(0, 0), "first");
  106.     this.appendDummyInput()
  107.         .appendField("Data Source")
  108.         .appendField(new Blockly.FieldDropdown([["hadron-1", "1"], ["hadron-2", "2"]]), "datasource");
  109.     this.appendDummyInput()
  110.         .appendField("Print particle list?")
  111.         .appendField(new Blockly.FieldDropdown([["No", "0"], ["Yes", "1"]]), "print");
  112.     this.appendValueInput("list")
  113.         .setCheck("particle list")
  114.         .appendField("Particle List");
  115.     this.setColour(230);
  116.     this.setTooltip('Run the analysis, specify data source, number of events, first event and a list of particles to process.');
  117.     this.setHelpUrl('http://belle2.jp/');
  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('');
  131.     this.setHelpUrl('http://belle2.jp/');
  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);
  145.     this.setTooltip('Create a list of primary particles, if not used, the primary particles are used in the empty particle list connectors');
  146.     this.setHelpUrl('http://belle2.jp/');
  147.   }
  148. };
  149.