#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 #include using std::fstream; #include using std::pair; #include using std::map; //#include #include "TROOT.h" #include "TRint.h" #include "TVector3.h" #include "TRandom.h" #include "TRotation.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 "PndDrcOptReflSilver.h" #include "PndDrcOptMatLithotecQ0.h" #include "PndDrcOptDevSys.h" #include "PndDrcOptVol.h" #include "PndDrcOptDevManager.h" #include "PndDrcOptBrik.h" int main(int argc, char *argv[]) { // Example for a simple bar with screen (photon detection) and mirror. PndDrcOptBrik bar(17,17.5/2,100); bar.SetOptMaterial(PndDrcOptMatLithotecQ0()); bar.SetName("bar"); bar.Surface("side6")->SetReflectivity(PndDrcOptReflSilver()); bar.Surface("side1")->SetPixel(); PndDrcOptDevSys opt_system; opt_system.AddDevice(bar); // The manager must be created as pointer. It is created as singleton, that is only // one manager can exist per application. PndDrcOptDevManager* manager = new PndDrcOptDevManager(); manager->AddDeviceSystem(opt_system); // create a list of photons in bar XYZPoint pos(0,-10,0); XYZVector dir(0,1,1); double beta = 0.69; bool photons_exist = manager->Cerenkov(pos,dir,beta); // generate photons if (photons_exist) manager->Propagate(); // propagate photons list list_photon = manager->PhotonList(); // get list // analyse list int icnt_measured = 0; int icnt_flying = 0; int icnt_lost = 0; int icnt_absorbed = 0; list::iterator iph; for(iph=list_photon.begin(); iph != list_photon.end(); ++iph) { if ((*iph).Fate()==Drc::kPhotMeasured) icnt_measured++; else if ((*iph).Fate()==Drc::kPhotFlying) icnt_flying++; // should never happen. else if ((*iph).Fate()==Drc::kPhotAbsorbed) icnt_absorbed++; else icnt_lost++; } int icnt = icnt_measured+icnt_flying+icnt_lost+icnt_absorbed; cout<<" generated photons: "<