//#include //#include //#include #include using std::cout; using std::cerr; using std::cin; using std::endl; #include using std::valarray; #include using std::vector; #include using std::string; #include using std::list; #include using std::map; #include #include using std::fstream; #include using std::pair; //#include #include "TROOT.h" #include "TRint.h" #include "TVector3.h" #include "TRandom.h" #include "Math/Vector3D.h" using ROOT::Math::XYZVector; #include "Math/Point3D.h" using ROOT::Math::XYZPoint; #include "Math/Transform3D.h" using ROOT::Math::Transform3D; #include "Math/RotationX.h" using ROOT::Math::RotationX; #include "Math/RotationY.h" using ROOT::Math::RotationY; #include "Math/RotationZ.h" using ROOT::Math::RotationZ; #include "Math/Rotation3D.h" using ROOT::Math::Rotation3D; #include "PndDrcPhoton.h" #include "PndDrcSurfPolyFlat.h" #include "PndDrcSurfCyl.h" #include "PndDrcOptReflSilver.h" #include "PndDrcOptMatLithotecQ0.h" #include "PndDrcOptDevSys.h" #include "PndDrcOptVol.h" #include "PndDrcOptDevManager.h" int main(int argc, char *argv[]) { const double pi = 3.1415926535; int verbosity = 0; // 0=quiet, 1=constructors,2=member,3=functionality // 4=photons, 5=everything. XYZPoint p1(0,0,-1000); XYZPoint p2(0,0,+1000); double radius1 = 480; double radius2 = 497; PndDrcSurfCyl scyl_out; scyl_out.Set(p1,p2,radius2); scyl_out.SetName("scyl_out"); PndDrcSurfCyl scyl_in; scyl_in.Set(p1,p2,radius1); scyl_in.SetName("scyl_in"); // p4 p3 // // p1 p2 XYZPoint r1(-500,-500,0); XYZPoint r2(+500,-500,0); XYZPoint r3(+500,+500,0); XYZPoint r4(-500,+500,0); PndDrcSurfPolyFlat s1; s1.AddPoint(r1); s1.AddPoint(r2); s1.AddPoint(r3); s1.AddPoint(r4); Transform3D trans_plus(XYZVector(0,0,1000)); Transform3D trans_minus(XYZVector(0,0,-1000)); PndDrcOptReflSilver refl; PndDrcSurfPolyFlat sfront(s1); sfront.SetReflectivity(refl); sfront.AddTransform(trans_plus); sfront.SetName("sfront"); PndDrcSurfPolyFlat sback(s1); sback.AddTransform(trans_minus); sback.SetPixel(); sback.SetPrintColor(2); sback.SetName("sback"); PndDrcOptVol vcyl; PndDrcOptMatLithotecQ0 quartz; vcyl.SetOptMaterial(quartz); vcyl.AddSurface(scyl_out); //vcyl.AddSurface(scyl_in); vcyl.AddSurface(sfront); vcyl.AddSurface(sback); vcyl.SetName("cylinder"); vcyl.SetVerbosity(verbosity); PndDrcOptDevSys sys; sys.AddDevice(vcyl); PndDrcOptDevManager manager; manager.AddDeviceSystem(sys); fstream geo; geo.open("Geo.C",std::ios::out); geo<<"{"<GetVersionInt() < 51600) { geo<<" TView *view = new TView(1);"<SetRange(-1000,-1000,-1000,1000,1000,1000);"<SetView(0,90,90,i);"<SetMarkerStyle(20);"<SetMinimum(-100);"<SetMaximum(+100);"<Draw(\"POL\");"<SetMarkerStyle(20);"<SetMinimum(0);"<SetMaximum(+50);"<Draw(\"POL\");"< list_photon = manager.PhotonList(); // get list list::iterator iph; for (iph = list_photon.begin(); iph != list_photon.end(); ++iph) { //cout<<(*iph).fate()<SetMarkerColor(" <<(*iph).ColorNumber((*iph).Wavelength()) <<");"<SetMarkerSize(0.7);"<Draw();"< pi) phi-=2*pi; if (phi < -pi) phi+=2*pi; //cout<<(*iph).position().X()<<" "<<(*iph).position().Y()<<" " // <<(*iph).time()<SetMarkerColor(" <<(*iph).ColorNumber((*iph).Wavelength()) <<");"<SetMarkerSize(0.7);"<Draw();"<