| /belle2/masterclass/index.php |
|---|
| 351,7 → 351,6 |
| document.getElementById('file-input').addEventListener('change', readSingleFile, false); |
| // var toolbox = document.getElementById("toolbox"); |
| var toolbox = loadDoc("toolbox.xml"); |
| var options = { |
| 383,16 → 382,8 |
| snap: true} |
| }; |
| /* Inject your workspace */ |
| var workspace = Blockly.inject('blocklyDiv', options); |
| /* Load Workspace Blocks from XML to workspace. Remove all code below if no blocks to load */ |
| /* TODO: Change workspace blocks XML ID if necessary. Can export workspace blocks XML from Workspace Factory. */ |
| //var workspaceBlocks = document.getElementById("workspaceBlocks"); |
| /* Load blocks to workspace. */ |
| // Blockly.Xml.domToWorkspace(workspaceBlocks, workspace); |
| <?php |
| if (isset($_GET["decay"])){ |
| 407,11 → 398,13 |
| ?> |
| //displayContents(workspaceBlocks); |
| </script> |
| <div id="drawing"></div> |
| </script> |
| <div id="drawing"></div> |
| <?php |
| $hostname = gethostname(); |
| if ($hostname != "belle2.ijs.si") { |
| echo "<a href='update.php'>Update code from the central server</a>"; |
| } |
| ?> |
| </body> |
| <a href="update.php">Update code</a> |
| </html> |
| /belle2/masterclass/ip2coordinates.php |
|---|
| 8,8 → 8,8 |
| if($ipcheck == -1 || $ipcheck === false) |
| trigger_error('Invalid IP, what are you doing? :|', E_USER_ERROR); |
| else |
| $uri = 'http://freegeoip.net/json/' . $ip; |
| $key='482198dbcb57d1747babb7acebc5c02e'; |
| $uri = 'http://api.ipstack.com/' . $ip . '?access_key=' . $key . '&output=json&legacy=1'; |
| $json = file_get_contents($uri); |
| $data = json_decode($json, true); |
| $location = $data['country_name']; |
| /belle2/masterclass/js/belle2_def.js |
|---|
| 5,11 → 5,11 |
| this.appendValueInput("list1") |
| .setCheck("particle list") |
| .setAlign(Blockly.ALIGN_RIGHT) |
| .appendField("1. Particle"); |
| .appendField("Particle 1"); |
| this.appendValueInput("list2") |
| .setCheck("particle list") |
| .setAlign(Blockly.ALIGN_RIGHT) |
| .appendField("2. Particle"); |
| .appendField("Particle 2"); |
| this.appendDummyInput() |
| .appendField("Same particle lists?") |
| .appendField(new Blockly.FieldDropdown([["No", "0"], ["Yes", "1"]]), "sameparticles"); |
| 30,8 → 30,8 |
| this.setInputsInline(false); |
| this.setOutput(true, "particle list"); |
| this.setColour(120); |
| this.setTooltip('Combine two particles in the new particle by making combinations between particles in two input lists'); |
| this.setHelpUrl('http://www.example.com/'); |
| 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'); |
| this.setHelpUrl('http://belle.jp/'); |
| } |
| }; |
| 41,7 → 41,7 |
| .appendField("Select Particles"); |
| this.appendValueInput("list1") |
| .setCheck("particle list") |
| .appendField("Particles"); |
| .appendField("Particle"); |
| this.appendDummyInput() |
| .appendField("Charge") |
| .appendField(new Blockly.FieldDropdown([["-1", "-1"], ["0", "0"], ["1", "1"], ["Any", "2"]]), "chargelist"); |
| 54,8 → 54,8 |
| this.setInputsInline(false); |
| this.setOutput(true, "particle list"); |
| this.setColour(65); |
| this.setTooltip('Create a new list of particles based on the original particle list or any input particle list'); |
| this.setHelpUrl('http://www.example.com/'); |
| 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.'); |
| this.setHelpUrl('http://belle.jp/'); |
| } |
| }; |
| 86,7 → 86,7 |
| this.setOutput(true, "histogram"); |
| this.setColour(20); |
| 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'); |
| this.setHelpUrl('http://www.example.com/'); |
| this.setHelpUrl('http://belle2.jp/'); |
| } |
| }; |
| 111,7 → 111,7 |
| .appendField("Particle List"); |
| this.setColour(230); |
| this.setTooltip('Run the analysis, specify data source, number of events, first event and a list of particles to process.'); |
| this.setHelpUrl('http://www.example.com/'); |
| this.setHelpUrl('http://belle2.jp/'); |
| } |
| }; |
| 125,7 → 125,7 |
| this.setOutput(true, "particle list"); |
| this.setColour(150); |
| this.setTooltip(''); |
| this.setHelpUrl('http://www.example.com/'); |
| this.setHelpUrl('http://belle2.jp/'); |
| } |
| }; |
| 140,6 → 140,6 |
| this.setOutput(true, "particle list"); |
| this.setColour(180); |
| this.setTooltip('Create a list of primary particles, if not used, the primary particles are used in the empty particle list connectors'); |
| this.setHelpUrl('http://www.example.com/'); |
| this.setHelpUrl('http://belle2.jp/'); |
| } |
| }; |
| /belle2/masterclass/toolbox.xml |
|---|
| 1,29 → 1,24 |
| <xml xmlns="http://www.w3.org/1999/xhtml" id="toolbox" style="display: none;"> |
| <category name="Particles"> |
| <block type="particle_combiner"> |
| <field name="simplepid">e</field> |
| <field name="mass0">0</field> |
| <field name="mass1">0</field> |
| </block> |
| <block type="particle_selector"> |
| <field name="chargelist">-1</field> |
| <field name="simplepid">MUON</field> |
| </block> |
| <block type="primary_list"></block> |
| <block type="particle_mass_fix"></block> |
| </category> |
| <category name="Analysis"> |
| <category name="Blocks"> |
| <block type="simple_analysis"> |
| <field name="neve">5000</field> |
| <field name="datasource">1</field> |
| </block> |
| <block type="histogram_creator"> |
| <field name="name">Reconstructed Mass</field> |
| <field name="name">Mass</field> |
| <field name="nbins">200</field> |
| <field name="min">0</field> |
| <field name="max">5</field> |
| <field name="varname">GetMass</field> |
| </block> |
| <block type="particle_selector"> |
| <field name="chargelist">-1</field> |
| <field name="simplepid">MUON</field> |
| </block> |
| <block type="particle_combiner"> |
| <field name="simplepid">ELECTRON</field> |
| <field name="mass0">0</field> |
| <field name="mass1">5</field> |
| </block> |
| </category> |
| <category name="Variables" colour="#A65C81" custom="VARIABLE"></category> |
| </xml> |
| /belle2/masterclass/visitormap.php |
|---|
| 63,6 → 63,30 |
| <body> |
| <h3>Belle II Masterclass visitor map</h3> |
| <div id="map" style="width: 90%; height: 90%"></div> |
| <?php |
| if (isset($_GET['debug'])){ |
| $nc=0; |
| echo ('<table>'); |
| $query = mysql_query('SELECT * FROM `visitor_map`'); |
| while($row = mysql_fetch_array($query, MYSQL_ASSOC)){ |
| if ($nc==0){ |
| echo('<tr>'); |
| foreach ($row as $key=>$val){ |
| echo("<th>$key"); |
| } |
| $nc++; |
| } |
| echo('<tr>'); |
| foreach ($row as $key=>$val){ |
| echo("<th>$val"); |
| } |
| } |
| echo ('</table>'); |
| } |
| ?> |
| </body> |
| </html> |