11 #include "TPolyMarker.h" 24 cerr <<
"L: [ " << smear->lpos(0) <<
" , " << smear->lpos(smear->lsize()) <<
" ]"<<
endl;
25 cerr <<
"L: [ " << smear->tpos(0) <<
" , " << smear->tpos(smear->tsize()) <<
" ]"<<
endl;
27 for (
int tind = 0; tind < smear->tsize(); ++tind) {
28 for (
int lind = 0; lind < smear->lsize(); ++lind) {
29 cerr <<
"\t" << smear->get(lind, tind);
47 Assert(bb.second - bb.first == 10.0);
68 vector< IDiffusion::pointer> diffs;
69 vector< pair<double,double> > pts;
73 double mean_l = (0.5+
step)*binsize_l;
74 double mean_t = (0.5+
step)*binsize_t;
75 diffs.push_back(diff.
diffuse(mean_l, mean_t, sigma_l, sigma_t));
76 pts.push_back(make_pair(mean_l, mean_t));
80 diffs.push_back(diff.
diffuse(10*binsize_l, 100*binsize_t, 3*sigma_l, 3*sigma_t, 10.0));
81 diffs.push_back(diff.
diffuse(100*binsize_l, 10*binsize_t, 3*sigma_l, 3*sigma_t, 10.0));
83 double min_l=0,min_t=0,max_l=0,max_t=0;
84 for (
auto d : diffs) {
85 min_l =
min(min_l,
d->lpos(0));
86 min_t =
min(min_t,
d->tpos(0));
87 max_l =
max(max_l,
d->lpos(
d->lsize()));
88 max_t =
max(max_t,
d->tpos(
d->tsize()));
92 TH2F*
h =
new TH2F(
"smear",
"Smear",
93 (max_l-min_l)/binsize_l, min_l, max_l,
94 (max_t-min_t)/binsize_t, min_t, max_t);
95 for (
auto smear : diffs) {
96 for (
int tind = 0; tind < smear->tsize(); ++tind) {
97 for (
int lind = 0; lind < smear->lsize(); ++lind) {
98 h->Fill(smear->lpos(lind,0.5), smear->tpos(tind,0.5), smear->get(lind, tind));
103 h->SetXTitle(
"Longitudinal direction");
104 h->SetYTitle(
"Transverse direction");
107 TPolyMarker*
pm =
new TPolyMarker;
108 pm->SetMarkerColor(5);
109 pm->SetMarkerStyle(8);
111 for (
auto xy : pts) {
112 pm->SetPoint(count++, xy.first, xy.second);
116 gStyle->SetOptStat(11111111);
std::pair< Point, Point > Ray
A line segment running from a first (tail) to a second (head) point.
std::shared_ptr< const IDiffusion > pointer
void test_plot_hist(MultiPdf &pdf)
D3Vector< double > Point
A 3D Cartesian point in double precision.
void dump_smear(IDiffusion::pointer smear)
IDiffusion::pointer diffuse(double mean_l, double mean_t, double sigma_l, double sigma_t, double weight=1.0, IDepo::pointer depo=nullptr)
static const double microsecond
int main(int argc, char *argv[])
static int max(int a, int b)
std::pair< double, double > bounds_type
T min(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
bounds_type bounds(double mean, double sigma, double binsize, double origin=0.0)
double mean(sqlite3 *db, std::string const &table_name, std::string const &column_name)
QTextStream & endl(QTextStream &s)
h
training ###############################