#include "test_profile_gradfit.hh" #include "EventFile.hh" #include "Det.hh" #include "Trk.hh" int main(int argc, char *argv[] ){ EventFile f( "/sps/km3net/users/jseneca/aanet/data/km3_v5/mcv5.1.genhen_nueCC.km3_AAv1.jte.jchain.aashower.94.root" ); f.set_index( 2147 ); Det det( "/sps/km3net/users/jseneca/aanet/data/km3_v5/KM3NeT_-00000001_20171212.detx" ); Trk trk = f.evt.mc_trks[0]; vector pre_hits = f.evt.hits; det.apply( pre_hits ); vector hits; foreach( h, pre_hits ){ h.t = h.t - ( f.evt.mc_t - f.evt.t.AsDouble()*1e9 ); double D = ( f.evt.mc_trks[0].pos - h.pos ).len(); double dt = abs( h.t - D/v_light ); if( D < 500 && dt < 100){ hits.push_back( h ); }; }; print( "len hits: ", hits.size() ); assert( hits.size() ); CascadePdf cascade_pdf( "/pbs/throng/km3net/src/Jpp/master/data/J14p.dat", "/pbs/throng/km3net/src/Jpp/master/data/J13p.dat", 0, 3, 5000, -100, 900, 0.0 ); JppShower_simple pdf( cascade_pdf ); JppShowerFit_simple testf( (string)"test", &pdf ); cout << "Made pdf here" << endl; pdf.init_event( det, hits, trk.pos, 300, false ); cout << "Init event here" << endl; uint N = 100; double pi = 3.14159265; vector< vector< double > > dims = { { -3.0, 3.0 }, { -3.0, 3.0 }, { -3.0, 3.0 }, { 0.0001, pi }, { 0.0001, 2*pi }, { -50., 200. }, { 1e5, 1e7 } }; for( uint id = 0; id != 7; id++ ){ double xs[N]; for( uint ip = 0; ip != N; ip++ ){ Trk test_trk = trk; xs[ip] = ip * ( dims[id][1] - dims[id][0] ) / double(N) + dims[id][0]; if ( id == 0 ) test_trk.pos.x = test_trk.pos.x + xs[ip]; else if( id == 1 ) test_trk.pos.y = test_trk.pos.y + xs[ip]; else if( id == 2 ) test_trk.pos.z = test_trk.pos.z + xs[ip]; else if( id == 3 ) test_trk.dir.set_angles( xs[ip], test_trk.dir.phi() ); else if( id == 4 ) test_trk.dir.set_angles( test_trk.dir.theta(), xs[ip] ); else if( id == 5 ) test_trk.t = xs[ip]; else if( id == 6 ) test_trk.E = xs[ip]; test_trk.dir = test_trk.dir.normalize(); pdf.eval_L_grad_first( test_trk ); } } return 1; };