Functions
test_depoplanex.cxx File Reference
#include "WireCellGen/DepoPlaneX.h"
#include "WireCellIface/SimpleDepo.h"
#include <iostream>

Go to the source code of this file.

Functions

void test_depoplanex ()
 
int main ()
 

Function Documentation

int main ( void  )

Definition at line 51 of file test_depoplanex.cxx.

52 {
54 }
void test_depoplanex()
void test_depoplanex ( )

Definition at line 8 of file test_depoplanex.cxx.

9 {
10  const double tunit = units::us; // for display
11 
13  std::vector<double> times{10.,25.,50.,100.0,500.0, 1000.0}; // us
14  std::vector<double> xes{100.0, 0.0, 50.0, 10.0, 75.0}; // cm
15 
16  for (auto t : times) {
17  t *= tunit;
18  for (auto x : xes) {
19  x *= units::cm;
20  auto depo = std::make_shared<SimpleDepo>(t,Point(x,0.0,0.0));
21  auto newdepo = dpx.add(depo);
22  std::cerr << "\tx=" << x/units::cm << "cm, t=" << newdepo->time()/tunit << "us\n";
23  }
24  std::cerr << "^ t=" << t/tunit << "us, fot=" << dpx.freezeout_time()/tunit << "us\n";
25  }
26  dpx.freezeout();
27  double fot = dpx.freezeout_time();
28  std::cerr << dpx.frozen_queue().size() << " frozen with fot=" << fot/tunit << "us, " << dpx.working_queue().size() << " working\n";
29 
30  auto removed = dpx.pop(fot/2.0);
31  std::cerr << "Popped " << removed.size() << " at " << fot/2.0/tunit << std::endl;
32  for (auto depo : removed) {
33  std::cerr << "\tx=" << depo->pos().x()/units::cm << "cm, t=" << depo->time()/tunit << "us";
34  std::cerr << " <--- ";
35  std::cerr << "x=" << depo->prior()->pos().x()/units::cm << "cm, t=" << depo->prior()->time()/tunit << "us\n";
36  }
37  std::cerr << "Frozen " << dpx.frozen_queue().size() << std::endl;
38  for (auto depo : dpx.frozen_queue()) {
39  std::cerr << "\tx=" << depo->pos().x()/units::cm << "cm, t=" << depo->time()/tunit << "us";
40  std::cerr << " <--- ";
41  std::cerr << "x=" << depo->prior()->pos().x()/units::cm << "cm, t=" << depo->prior()->time()/tunit << "us\n";
42  }
43  std::cerr << "Left " << dpx.working_queue().size() << std::endl;
44  for (auto depo : dpx.working_queue()) {
45  std::cerr << "\tx=" << depo->pos().x()/units::cm << "cm, t=" << depo->time()/tunit << "us";
46  std::cerr << " <--- ";
47  std::cerr << "x=" << depo->prior()->pos().x()/units::cm << "cm, t=" << depo->prior()->time()/tunit << "us\n";
48  }
49 }
std::tuple< double, double, const reco::ClusterHit3D * > Point
Definitions used by the VoronoiDiagram algorithm.
Definition: DCEL.h:34
static const double us
Definition: Units.h:101
static const double cm
Definition: Units.h:76
list x
Definition: train.py:276
QTextStream & endl(QTextStream &s)