Skip to content

Instantly share code, notes, and snippets.

View JeremyMcCormick's full-sized avatar

Jeremy McCormick JeremyMcCormick

View GitHub Profile
#!/usr/bin/env python
import MySQLdb
f = open('hodo_channels_daq.csv', 'r')
lines = f.readlines()
lines = lines[1:]
records = []
for l in lines:
rec = l.strip().split(',')
import multiprocessing
from multiprocessing import Pool
def power(x):
if x==0:
exponent=.5
elif x==1:
exponent=2
elif x==2:
<!-- userinfo defs -->
<auxiliary auxtype="DetectorID" auxvalue="DefaultID">
<auxiliary auxtype="IDField" auxvalue="subdet">
<auxiliary auxtype="StartBit" auxvalue="0"/>
<auxiliary auxtype="EndBit" auxvalue="3"/>
</auxiliary>
<auxiliary auxtype="IDField" auxvalue="layer">
<auxiliary auxtype="StartBit" auxvalue="4"/>
<auxiliary auxtype="EndBit" auxvalue="11"/>
</auxiliary>
get_cmake_property(_variableNames VARIABLES)
foreach (_variableName ${_variableNames})
message(STATUS "${_variableName}=${${_variableName}}")
endforeach()
ss << std::setprecision(10)
<< std::scientific
<< std::uppercase
<< "\t" << hepeup.IDUP[line]
<< "\t" << hepeup.ISTUP[line]
<< "\t" << hepeup.MOTHUP[line].first
<< "\t" << hepeup.MOTHUP[line].second
<< "\t" << hepeup.ICOLUP[line].first
<< "\t" << hepeup.ICOLUP[line].second
<< "\t" << hepeup.PUP[line][0]
G4PhysicalVolumeStore* pvs = G4PhysicalVolumeStore::GetInstance();
std::cout << "Dumping PV store ..." << std::endl;
for (G4PhysicalVolumeStore::iterator it = pvs->begin();
it != pvs->end(); it++) {
G4VPhysicalVolume* pv = (*it);
std::cout << "volume: " << pv->GetName() << ", pos: " << pv->GetTranslation() << std::endl;
}
G4TouchableHandle touchable = prePoint->GetTouchableHandle();
const G4NavigationHistory* touchableHistory = touchable->GetHistory();
G4int hdepth = touchable->GetHistoryDepth();
std::cout << "Dumping volume hierarchy ..." << std::endl;
for (int i = hdepth; i > 0; i--) {
G4VPhysicalVolume* pv = touchableHistory->GetVolume(i);
std::cout << " depth: " << i << ", physvol name: " << pv->GetName() << ", copynum: " << pv->GetCopyNo() << std::endl;
}
void print_aux(const G4GDMLAuxListType* auxInfoList, G4String prepend="|")
{
for(std::vector<G4GDMLAuxStructType>::const_iterator iaux = auxInfoList->begin();
iaux != auxInfoList->end(); iaux++ )
{
G4String str=iaux->type;
G4String val=iaux->value;
G4String unit=iaux->unit;
G4cout << prepend << str << " : " << val << " " << unit << G4endl;
public class PrintRequestServlet extends HttpServlet {
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
PrintWriter out = resp.getWriter();
out.println("<b>HTTP Headers</b><br/>");
Enumeration<?> headers = req.getHeaderNames();
for (;;) {
if (!headers.hasMoreElements()) {
package org.hps.crawler;
import java.io.File;
/**
* Reads metadata from EVIO files, including the event count, run min and run max expected by the datacat, as well as
* many custom field values applicable to HPS EVIO raw data.
*
* @author Jeremy McCormick, SLAC
*/