15 #include "fhiclcpp/ParameterSet.h"
16 #include "art/Framework/Principal/Handle.h"
18 #include "art/Framework/Principal/Event.h"
19 #include "gallery/Event.h"
30 #include "nusimdata/SimulationBase/MCParticle.h"
31 #include "nusimdata/SimulationBase/MCTruth.h"
39 #include <sys/types.h>
40 #include <sys/socket.h>
42 #include <netinet/ip.h>
44 #include <sys/types.h>
56 bool operator<(
const art::InputTag&
a,
const art::InputTag& b)
58 return (std::make_tuple(a.label(), a.instance(), a.process()) <
59 std::make_tuple(b.label(), b.instance(), b.process()));
75 if(fSock)
close(fSock);
81 std::swap(cx[0], cx[1]);
86 const std::string content =
"text/html",
91 "Server: WebEVD/1.0.0\r\n"
92 "Content-Type: "+content+
"\r\n";
94 if(gzip) str +=
"Content-Encoding: gzip\r\n";
98 write(sock, &str.front(), str.size());
104 "HTTP/1.0 404 Not Found\r\n"
105 "Server: WebEVD/1.0.0\r\n"
106 "Content-Type: text/plain\r\n"
110 write(sock, str, strlen(str));
116 "HTTP/1.0 501 Not Implemented\r\n"
117 "Server: WebEVD/1.0.0\r\n"
118 "Content-Type: text/plain\r\n"
120 "I don't know how to do that\r\n";
122 write(sock, str, strlen(str));
129 std::vector<char> buf(1024*1024);
131 const int nread = read(sock, &buf.front(), buf.size());
132 if(nread == 0)
return ret;
133 ret.insert(ret.end(), buf.begin(), buf.begin()+nread);
136 if(ret.find(
"\r\n\r\n") != std::string::npos)
return ret;
142 std::cout << call <<
"() error " << errno <<
" = " << strerror(errno) << std::endl;
150 int run = -1, subrun = -1,
evt = -1;
153 if(cmd ==
"/QUIT") code =
kQUIT;
154 if(cmd ==
"/NEXT") code =
kNEXT;
155 if(cmd ==
"/PREV") code =
kPREV;
156 if(cmd ==
"/NEXT_TRACES"){ code =
kNEXT; traces =
true;}
157 if(cmd ==
"/PREV_TRACES"){ code =
kPREV; traces =
true;}
159 if(cmd.find(
"/seek/") == 0 ||
160 cmd.find(
"/seek_traces/") == 0){
161 if(cmd.find(
"/seek_traces/") == 0) traces =
true;
165 strtok_r(cmd.data(),
"/", &ctx);
166 run = atoi(strtok_r(0,
"/", &ctx));
167 subrun = atoi(strtok_r(0,
"/", &ctx));
168 evt = atoi(strtok_r(0,
"/", &ctx));
174 const int delay = (code ==
kQUIT) ? 2000 : 0;
175 const std::string txt = (code ==
kQUIT) ?
"Goodbye!" :
"Please wait...";
176 const std::string next = traces ?
"/traces.html" :
"/";
180 const std::string
msg = TString::Format(
"<!DOCTYPE html><html><head><meta charset=\"utf-8\"><script>setTimeout(function(){window.location.replace('%s');}, %d);</script></head><body><script>if(window.sessionStorage.theme != 'lighttheme'){document.body.style.backgroundColor='black';document.body.style.color='white';}</script><h1>%s</h1></body></html>", next.c_str(), delay, txt.c_str()).
Data();
182 write(sock, msg.c_str(), msg.size());
201 if(getenv(
"MRB_SOURCE")) cet::search_path(
"MRB_SOURCE").find_file(
"webevd/webevd/WebEVD/web/", webdir);
203 if(webdir.empty() && getenv(
"PRODUCTS") && getenv(
"WEBEVD_VERSION")) cet::search_path(
"PRODUCTS").find_file(
"webevd/"+std::string(getenv(
"WEBEVD_VERSION"))+
"/webevd/", webdir);
206 std::cout <<
"Unable to find webevd files under $MRB_SOURCE or $PRODUCTS" << std::endl;
223 const std::string mime =
"image/png";
228 const char* pName = strtok_r(&doc.front(),
"_", &ctx);
229 const char* pIdx = strtok_r(0,
"_", &ctx);
230 const char* pDim = strtok_r(0,
".", &ctx);
232 if(!pName || !pIdx || !pDim){
238 const std::string
name(pName);
239 const int idx = atoi(pIdx);
240 const int dim = atoi(pDim);
243 if(name ==
"/dig") arena = &digs->
GetArena();
244 if(name ==
"/wire") arena = &wires->
GetArena();
253 FILE* f = fdopen(sock,
"wb");
261 std::vector<unsigned char>& dest,
266 strm.zalloc = Z_NULL;
268 strm.opaque = Z_NULL;
271 strm.avail_in = length;
275 deflateInit2(&strm, level, Z_DEFLATED, 15 | 16, 9, Z_DEFAULT_STRATEGY);
278 dest.resize(deflateBound(&strm, length));
280 strm.next_out = dest.data();
281 strm.avail_out = dest.size();
283 deflate(&strm, Z_FINISH);
285 dest.resize(dest.size() - strm.avail_out);
295 const std::string&
name)
297 std::vector<unsigned char> dest;
300 std::cout <<
"Writing " << length <<
" bytes (compressed to " << dest.size() <<
") for " << name <<
"\n" << std::endl;
302 write(sock, dest.data(), dest.size());
308 int fd_in =
open(loc.c_str(), O_RDONLY);
313 unsigned char* src = (
unsigned char*)mmap(0, st.st_size, PROT_READ, MAP_PRIVATE, fd_in, 0);
317 munmap(src, st.st_size);
323 bool endswith(
const std::string&
s,
const std::string& suffix)
325 return s.rfind(suffix)+suffix.size() == s.size();
331 json <<
"\"" << t.label();
332 if(!t.instance().empty()) json <<
":" << t.instance();
333 if(!t.process().empty()) json <<
":" << t.process();
341 json <<
"\"" << std::string(
id) <<
"\"";
349 return json <<
"\"" << std::string(plane) <<
"\"";
357 <<
", \"rms\": " << hit.
RMS()
364 return json << TVector3(vtx.
position().x(),
383 return json << TVector3(pt.X(), pt.Y(), pt.Z());
389 return json <<
"{\"pdg\": " << edep.
PdgCode() <<
", "
390 <<
"\"start\": " << edep.
Start() <<
", "
391 <<
"\"end\": " << edep.
End() <<
", "
392 <<
"\"edep\": " << edep.
Energy()
399 return json << TVector3(sp.
XYZ());
405 std::vector<TVector3> pts;
411 pts.emplace_back(pt.X(), pt.Y(), pt.Z());
414 return json <<
"{ \"positions\": " << pts <<
" }";
420 const int apdg =
abs(part.PdgCode());
421 if(apdg == 12 || apdg == 14 || apdg == 16)
return json <<
"{ \"pdg\": " << apdg <<
", \"positions\": [] }";
422 std::vector<TVector3> pts;
423 for(
unsigned int j = 0; j < part.NumberTrajectoryPoints(); ++j){
424 pts.emplace_back(part.Vx(j), part.Vy(j), part.Vz(j));
427 return json <<
"{ \"pdg\": " << apdg <<
", \"positions\": " << pts <<
" }";
433 json << std::map<std::string, double>{
434 {
"tcenter", flash.
Time()},
437 {
"ywidth", flash.
YWidth()},
439 {
"zwidth", flash.
ZWidth()},
449 const TVector3 r0(cryo.
MinX(), cryo.
MinY(), cryo.
MinZ());
450 const TVector3 r1(cryo.
MaxX(), cryo.
MaxY(), cryo.
MaxZ());
451 return json <<
"{ \"min\": " << r0 <<
", \"max\": " << r1 <<
" }";
457 return json <<
"{ \"name\": " << opdet.
ID() <<
", "
458 <<
"\"center\": " << TVector3(opdet.
GetCenter().X(),
461 <<
"\"length\": " << opdet.
Length() <<
", "
462 <<
"\"width\": " << opdet.
Width() <<
", "
463 <<
"\"height\": " << opdet.
Height() <<
" }";
470 os <<
"{\"blocks\": [\n";
471 for(
unsigned int ix = 0; ix < v.
blocks.size(); ++ix){
472 for(
unsigned int iy = 0; iy < v.
blocks[ix].size(); ++iy){
476 if(!first) os <<
",\n";
480 for(
unsigned int d = 0; d < v.
arena.
data.size(); ++d){
496 <<
"\"fname\": \"" << v.
arena.
name <<
"_" << dataidx <<
"\", "
498 <<
"\"u\": " << texdx <<
", "
499 <<
"\"v\": " << texdy <<
", "
510 template<
class TProd,
class TEvt>
void
515 const std::vector<art::InputTag> tags = evt.template getInputTags<std::vector<TProd>>();
517 for(
const art::InputTag& tag: tags){
518 typename TEvt::template HandleT<std::vector<TProd>> prods;
520 if(!evt.getByLabel(tag, prods))
continue;
522 json <<
" " << tag <<
": ";
526 if(tag != tags.back()){
536 template<
class TProd,
class TEvt>
void
538 const std::string& in_label,
541 typename TEvt::template HandleT<std::vector<TProd>> prods;
542 evt.getByLabel(in_label, prods);
555 typedef std::map<std::string, int> EIdMap;
556 json << EIdMap({{
"run", evt.run()}, {
"subrun", evt.subRun()}, {
"evt", evt.event()}});
572 json <<
" \"planes\": {\n";
575 const int view = planegeo.
View();
576 const unsigned int nwires = planegeo.
Nwires();
577 const double pitch = planegeo.
WirePitch();
584 const double depth = planegeo.
Depth();
585 const double width = planegeo.
Width();
586 const TVector3 depthdir = planegeo.
DepthDir();
587 const TVector3 widthdir = planegeo.
WidthDir();
590 const double tick_pitch = detprop.
ConvertTicksToX(1, plane) - tick_origin;
594 if(!first) json <<
",\n";
597 json <<
" " << plane <<
": {"
598 <<
"\"view\": " << view <<
", "
599 <<
"\"nwires\": " << nwires <<
", "
600 <<
"\"pitch\": " << pitch <<
", "
601 <<
"\"nticks\": " << maxTick <<
", "
602 <<
"\"tick_origin\": " << tick_origin <<
", "
603 <<
"\"tick_pitch\": " << tick_pitch <<
", "
604 <<
"\"center\": " << c <<
", "
605 <<
"\"across\": " << d <<
", "
606 <<
"\"wiredir\": " << wiredir <<
", "
607 <<
"\"depth\": " << depth <<
", "
608 <<
"\"width\": " << width <<
", "
609 <<
"\"depthdir\": " << depthdir <<
", "
610 <<
"\"widthdir\": " << widthdir <<
", "
611 <<
"\"normal\": " << n <<
"}";
625 json <<
" \"cryos\": [\n";
626 for(
unsigned int i = 0; i < geom->
Ncryostats(); ++i){
628 if(i != geom->
Ncryostats()-1) json <<
",\n";
else json <<
"\n";
632 json <<
" \"opdets\": [\n";
633 for(
unsigned int i = 0; i < geom->
NOpDets(); ++i){
635 if(i != geom->
NOpDets()-1) json <<
",\n";
else json <<
"\n";
642 template<
class T>
void
645 std::map<art::InputTag, std::map<geo::PlaneID, std::vector<recob::Hit>>> plane_hits;
647 for(art::InputTag tag: evt.template getInputTags<std::vector<recob::Hit>>()){
648 typename T::template HandleT<std::vector<recob::Hit>> hits;
650 if(!evt.getByLabel(tag, hits))
continue;
663 plane_hits[tag][plane].emplace_back(
hit.Channel(),
hit.StartTick(),
hit.EndTick(),
hit.PeakTime(),
hit.SigmaPeakTime(),
hit.RMS(),
hit.PeakAmplitude(),
hit.SigmaPeakAmplitude(),
hit.SummedADC(),
hit.Integral(),
hit.SigmaIntegral(),
hit.Multiplicity(),
hit.LocalIndex(),
hit.GoodnessOfFit(),
hit.DegreesOfFreedom(),
hit.View(),
hit.SignalType(), wire);
672 template<
class T> std::map<int, std::vector<T>>
ToSnippets(
const std::vector<T>& adcs, T pedestal = 0)
675 snip.reserve(adcs.size());
677 std::map<int, std::vector<T>> snips;
683 snips[t-snip.size()] = snip;
688 snip.push_back(adc - pedestal);
695 if(!snip.empty()) snips[t-snip.size()] = snip;
699 snips[adcs.size()] = {};
710 std::map<art::InputTag, std::map<geo::PlaneID, std::map<int, std::map<int, std::vector<short>>>>> traces;
712 for(art::InputTag tag: evt.template getInputTags<std::vector<raw::RawDigit>>()){
713 typename T::template HandleT<std::vector<raw::RawDigit>> digs;
715 if(!evt.getByLabel(tag, digs))
continue;
724 traces[tag][plane][wire.Wire] =
ToSnippets(adcs,
short(dig.GetPedestal()));
738 std::map<art::InputTag, std::map<geo::PlaneID, std::map<int, std::map<int, std::vector<float>>>>> traces;
740 for(art::InputTag tag: evt.template getInputTags<std::vector<recob::Wire>>()){
741 typename T::template HandleT<std::vector<recob::Wire>> wires;
743 if(!evt.getByLabel(tag, wires))
continue;
761 const std::string mime =
"application/json";
763 std::stringstream ss;
767 else if(doc ==
"/tracks.json") SerializeProduct<recob::Track>(*
evt,
json);
768 else if(doc ==
"/spacepoints.json") SerializeProduct<recob::SpacePoint>(*
evt,
json);
769 else if(doc ==
"/vtxs.json") SerializeProduct<recob::Vertex>(*
evt,
json);
770 else if(doc ==
"/trajs.json") SerializeProductByLabel<simb::MCParticle>(*
evt,
"largeant",
json);
771 else if(doc ==
"/mctruth.json") SerializeProduct<simb::MCTruth>(*
evt,
json);
772 else if(doc ==
"/simedep.json") SerializeProduct<sim::SimEnergyDeposit>(*
evt,
json);
773 else if(doc ==
"/opflashes.json") SerializeProduct<recob::OpFlash>(*
evt,
json);
774 else if(doc ==
"/hits.json")
SerializeHits(*evt, geom, json);
776 else if(doc ==
"/digs.json") digs->
Serialize(json);
777 else if(doc ==
"/wires.json") wires->
Serialize(json);
786 std::string response = ss.str();
795 if(doc ==
"/") doc =
"/index.html";
808 std::string mime =
"text/html";
809 if(
endswith(doc,
".js" )) mime =
"application/javascript";
810 if(
endswith(doc,
".css")) mime =
"text/css";
811 if(
endswith(doc,
".ico")) mime =
"image/vnd.microsoft.icon";
816 const std::set<std::string> whitelist = {
"/evd.css",
"/evd.js",
"/traces.js",
"/favicon.ico",
"/index.html",
"/traces.html"};
818 if(whitelist.count(doc)){
832 if(fSock != 0)
return 0;
835 gethostname(host, 1024);
836 char*
user = getlogin();
838 std::cout <<
"\n------------------------------------------------------------\n" << std::endl;
844 while(system(TString::Format(
"ss -an | grep -q %d", port).
Data()) == 0) ++
port;
847 fSock = socket(AF_INET, SOCK_STREAM, 0);
848 if(fSock == -1)
return err(
"socket");
852 if(setsockopt(fSock, SOL_SOCKET, SO_REUSEADDR,
853 &one,
sizeof(one)) != 0)
return err(
"setsockopt");
856 addr.sin_family = AF_INET;
858 addr.sin_addr.s_addr = INADDR_ANY;
860 if(bind(fSock, (sockaddr*)&addr,
sizeof(addr)) != 0)
return err(
"bind");
862 if(listen(fSock, 128) != 0)
return err(
"listen");
867 << port <<
":localhost:" << port <<
" "
868 << user <<
"@" << host << std::endl << std::endl;
869 std::cout <<
"and then navigate to http://localhost:" << port <<
"/ in your favorite browser." << std::endl << std::endl;
898 std::lock_guard guard(
fLock);
902 for(art::InputTag tag:
fEvt->template getInputTags<std::vector<raw::RawDigit>>()){
903 typename T::template HandleT<std::vector<raw::RawDigit>> digs;
905 if(!
fEvt->getByLabel(tag, digs))
continue;
924 const int adc = adcs[
tick] ? int(adcs[
tick])-dig.GetPedestal() : 0;
928 bytes(wire.Wire-w0.
Wire, tick, 3) = std::min(
abs(adc), 255);
953 std::map<art::InputTag, std::map<geo::PlaneID, PNGView>>
fImgs;
979 std::lock_guard guard(
fLock);
983 for(art::InputTag tag:
fEvt->template getInputTags<std::vector<recob::Wire>>()){
984 typename T::template HandleT<std::vector<recob::Wire>> wires;
986 if(!
fEvt->getByLabel(tag, wires))
continue;
1001 const auto adcs = rbwire.Signal();
1002 for(
unsigned int tick = 0;
tick < adcs.size(); ++
tick){
1003 if(adcs[
tick] <= 0)
continue;
1008 bytes(wire.Wire-w0.
Wire,
tick, 3) = std::max(0, std::min(
int(10*adcs[
tick]), 255));
1025 std::map<art::InputTag, std::map<geo::PlaneID, PNGView>>
fImgs;
1036 signal(SIGPIPE, SIG_IGN);
1038 if(EnsureListen() != 0)
return kERROR;
1043 std::list<std::thread> threads;
1046 int sock = accept(fSock, 0, 0);
1047 if(sock == -1)
return err(
"accept");
1054 char* verb = strtok_r(&req.front(),
" ", &ctx);
1056 if(verb && std::string(verb) ==
"GET"){
1057 char* freq = strtok_r(0,
" ", &ctx);
1058 std::string sreq(freq);
1060 if(sreq ==
"/NEXT" ||
1062 sreq ==
"/NEXT_TRACES" ||
1063 sreq ==
"/PREV_TRACES" ||
1065 sreq.find(
"/seek/") == 0 ||
1066 sreq.find(
"/seek_traces/") == 0){
1067 for(std::thread& t: threads) t.join();
1071 threads.emplace_back(_HandleGet<T>, sreq, sock, &evt, &digs, &wires, geom, &detprop);
virtual PNGArena & GetArena() override
JSONFormatter & operator<<(JSONFormatter &json, const art::InputTag &t)
void SerializeDigitTraces(const T &evt, const geo::GeometryCore *geom, JSONFormatter &json)
double std(const std::vector< short > &wf, const double ped_mean, size_t start, size_t nsample)
void write_ok200(int sock, const std::string content="text/html", bool gzip=false)
OpDetGeo const & OpDetGeoFromOpDet(unsigned int OpDet) const
Returns the geo::OpDetGeo object for the given detector number.
std::map< int, std::vector< T > > ToSnippets(const std::vector< T > &adcs, T pedestal=0)
PlaneGeo const & Plane(unsigned int const p, unsigned int const tpc=0, unsigned int const cstat=0) const
Returns the specified wire.
Collection of charge vs time digitized from a single readout channel.
void SerializeProductByLabel(const TEvt &evt, const std::string &in_label, JSONFormatter &json)
std::map< art::InputTag, std::map< geo::PlaneID, PNGView > > fImgs
process_name opflash particleana ie x
std::vector< std::unique_ptr< std::array< png_byte, kTotBytes > > > data
void SerializeProduct(const TEvt &evt, JSONFormatter &json)
virtual PNGArena & GetArena() override
geo::WireID WireID() const
float RMS() const
RMS of the hit shape, in tick units.
constexpr bool operator<(CryostatID const &a, CryostatID const &b)
Order cryostats with increasing ID.
const recob::TrackTrajectory & Trajectory() const
Access to the stored recob::TrackTrajectory.
size_t LastValidPoint() const
Returns the index of the last valid point in the trajectory.
Declaration of signal hit object.
EResult err(const char *call)
double MinX() const
Returns the world x coordinate of the start of the box.
The data type to uniquely identify a Plane.
LazyWires(const T &evt, const geo::GeometryCore *geom)
void SerializePlanes(const geo::GeometryCore *geom, const detinfo::DetectorPropertiesData &detprop, JSONFormatter &json)
std::vector< short > ADCvector_t
Type representing a (compressed) vector of ADC counts.
std::vector< geo::WireID > ChannelToWire(raw::ChannelID_t const channel) const
Returns a list of wires connected to the specified TPC channel.
void write_compressed_file(const std::string &loc, int fd_out, int level)
std::string read_all(int sock)
bool endswith(const std::string &s, const std::string &suffix)
Definition of basic raw digits.
void GetCenter(double *xyz, double localz=0.0) const
double MaxX() const
Returns the world x coordinate of the end of the box.
WireID_t Wire
Index of the wire within its plane.
process_name use argoneut_mc_hitfinder track
Geometry information for a single cryostat.
Vector GetNormalDirection() const
Returns the direction normal to the plane.
unsigned int Ncryostats() const
Returns the number of cryostats in the detector.
Vector GetIncreasingWireDirection() const
Returns the direction of increasing wires.
Definition of vertex object for LArSoft.
LazyDigits(const T &evt, const geo::GeometryCore *geom)
float PeakAmplitude() const
The estimated amplitude of the hit at its peak, in ADC units.
void gzip_buffer(unsigned char *src, int length, std::vector< unsigned char > &dest, int level)
short swap_byte_order(short x)
IteratorBox< plane_id_iterator,&GeometryCore::begin_plane_id,&GeometryCore::end_plane_id > IteratePlaneIDs() const
Enables ranged-for loops on all plane IDs of the detector.
Access the description of detector geometry.
View_t View() const
Which coordinate does this plane measure.
virtual PNGArena & GetArena()=0
geo::Point_t Start() const
const geo::GeometryCore * fGeom
const geo::GeometryCore * fGeom
IDparameter< geo::WireID > WireID
Member type of validated geo::WireID parameter.
Result HandleCommand(std::string cmd, int sock)
A trajectory in space reconstructed from hits.
T LocationAtPoint(unsigned int p) const
Position at point p. Use e.g. as:
double Depth() const
Return the depth of the plane.
Collect all the RawData header files together.
Point GetCenter() const
Returns the centre of the wire plane in world coordinates [cm].
Geometry information for a single wire plane.The plane is represented in the geometry by a solid whic...
double Width() const
Return the width of the plane.
bool HasValidPoint(size_t i) const
Returns whether the specified point has NoPoint flag unset.
double MinZ() const
Returns the world z coordinate of the start of the box.
tick_as<> tick
Tick number, represented by std::ptrdiff_t.
void write_compressed_buffer(unsigned char *src, int length, int sock, int level, const std::string &name)
const art::EventAuxiliary & eventAuxiliary() const
virtual void Serialize(JSONFormatter &json)=0
unsigned int NumberTimeSamples() const
CryostatGeo const & Cryostat(geo::CryostatID const &cryoid) const
Returns the specified cryostat.
const Double32_t * XYZ() const
void _HandleGetPNG(std::string doc, int sock, ILazy *digs, ILazy *wires)
Description of geometry of one entire detector.
void _HandleGet(std::string doc, int sock, const T *evt, ILazy *digs, ILazy *wires, const geo::GeometryCore *geom, const detinfo::DetectorPropertiesData *detprop)
std::vector< std::vector< png_byte * > > blocks
void SerializeGeometry(const geo::GeometryCore *geom, const detinfo::DetectorPropertiesData &detprop, JSONFormatter &json)
Provides recob::Track data product.
unsigned int NOpDets() const
Number of OpDets in the whole detector.
double MaxY() const
Returns the world y coordinate of the end of the box.
double ConvertTicksToX(double ticks, int p, int t, int c) const
void SerializeEventID(const T &evt, JSONFormatter &json)
Vector DepthDir() const
Return the direction of plane depth.
then echo Cowardly refusing to create a new FHiCL file with the same name as the original one('${SourceName}')." >&2 exit 1 fi echo "'$
float PeakTime() const
Time of the signal peak, in tick units.
geo::WireID GetBeginWireID(geo::CryostatID const &id) const
Returns the ID of the first wire in the specified cryostat.
virtual void Serialize(JSONFormatter &json) override
size_t FirstValidPoint() const
Returns the index of the first valid point in the trajectory.
void _HandleGetJSON(std::string doc, int sock, const T *evt, const geo::GeometryCore *geom, const detinfo::DetectorPropertiesData *detprop, ILazy *digs, ILazy *wires)
virtual void Serialize(JSONFormatter &json) override
void write_unimp501(int sock)
then echo File list $list not found else cat $list while read file do echo $file sed s
double MaxZ() const
Returns the world z coordinate of the end of the box.
void write_notfound404(int sock)
contains information for a single step in the detector simulation
Result serve(const T &evt, const geo::GeometryCore *geom, const detinfo::DetectorPropertiesData &detprop)
unsigned int Nwires() const
Number of wires in this plane.
Energy deposition in the active material.
std::string MCTruthShortText(const simb::MCTruth &truth)
Vector WidthDir() const
Return the direction of plane width.
Class holding the regions of interest of signal from a channel.
std::map< art::InputTag, std::map< geo::PlaneID, PNGView > > fImgs
Declaration of basic channel signal object.
geo::OpDetID const & ID() const
Returns the geometry ID of this optical detector.
void SerializeWireTraces(const T &evt, const geo::GeometryCore *geom, JSONFormatter &json)
2D representation of charge deposited in the TDC/wire plane
basic_json<> json
default JSON class
std::size_t count(Cont const &cont)
print OUTPUT<< EOF;< setup name="Default"version="1.0">< worldref="volWorld"/></setup ></gdml > EOF close(OUTPUT)
void Uncompress(const std::vector< short > &adc, std::vector< short > &uncompressed, raw::Compress_t compress)
Uncompresses a raw data buffer.
The data type to uniquely identify a optical detector.
void WritePNGBytes(FILE *fout, int imgIdx, int dim)
void SerializeHits(const T &evt, const geo::GeometryCore *geom, JSONFormatter &json)
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Point_t
Type for representation of position in physical 3D space.
double MinY() const
Returns the world y coordinate of the start of the box.
byte bytes
Alias for common language habits.
const Point_t & position() const
Return vertex 3D position.
BEGIN_PROLOG could also be cout
Track from a non-cascading particle.A recob::Track consists of a recob::TrackTrajectory, plus additional members relevant for a "fitted" track:
double WirePitch() const
Return the wire pitch (in centimeters). It is assumed constant.
Vector GetWireDirection() const
Returns the direction of the wires.
open(RACETRACK) or die("Could not open file $RACETRACK for writing")