#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 "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 "PndDrcOptReflAbs.h" #include "PndDrcSurfAbs.h" #include "PndDrcSurfPolyFlat.h" #include "PndDrcOptReflSilver.h" #include "PndDrcOptMatAbs.h" #include "PndDrcOptMatLithotecQ0.h" #include "PndDrcOptDev.h" #include "PndDrcOptDevSys.h" #include "PndDrcOptVol.h" #include "PndDrcOptDevManager.h" #include "PndDrcOptBrik.h" int main() { // 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::PhotMeasured) icnt_measured++; else if ((*iph).fate()==Drc::PhotFlying) icnt_flying++; // should never happen. else if ((*iph).fate()==Drc::PhotAbsorbed) icnt_absorbed++; else icnt_lost++; } int icnt = icnt_measured+icnt_flying+icnt_lost+icnt_absorbed; cout<<" generated photons: "<