// ---------------------------------------------------- // This file belongs to the ray tracing framework // for the use with Cherenkov detectors // // created 2007 //----------------------------------------------------- #include "PndDrcOptDev.h" //#include "PndDrcPhoton.h" //#include "PndDrcOptReflAbs.h" #include "PndDrcSurfAbs.h" //#include "PndDrcOptMatAbs.h" // //#include "TObject.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 using std::cout; //using std::cerr; //using std::cin; using std::endl; // //#include //using std::valarray; // //#include //using std::fstream; // //#include //using std::string; // //#include //using std::list; // //#include //---------------------------------------------------------------------- PndDrcOptDev::PndDrcOptDev() { fCopyNumber = 0; fName = "unnamed PndDrcOptDev"; fPhotonTrace = false; fVerbosity = 0; fKx = XYZVector(1,0,0); fKy = XYZVector(0,1,0); fKz = XYZVector(0,0,1); } //---------------------------------------------------------------------- void PndDrcOptDev::Copy(const PndDrcOptDev& d) { fCopyNumber = d.fCopyNumber; fName = d.fName; fVerbosity = d.fVerbosity; fPhotonTrace = d.fPhotonTrace; fPhotonTraceStream = d.fPhotonTraceStream; fListSurf.clear(); list::const_iterator kSurf; for(kSurf=d.fListSurf.begin(); kSurf != d.fListSurf.end(); ++kSurf) { const PndDrcSurfAbs* tmp = (*kSurf); PndDrcSurfAbs* tmp1 = tmp->Clone(); fListSurf.push_back(tmp1); } fKx = d.fKx; fKy = d.fKy; fKz = d.fKz; } //---------------------------------------------------------------------- PndDrcOptDev::PndDrcOptDev(const PndDrcOptDev& d) { if (d.fVerbosity>=1) cout<<" PndDrcOptDev::PndDrcOptDev" <<"(const PndDrcOptDev&) name,copy: " <=1) cout<<" PndDrcOptDev::operator=" <<"(const PndDrcOptDev&) name,copy: " <::const_iterator kSurf; for(kSurf=fListSurf.begin(); kSurf != fListSurf.end(); ++kSurf) { delete (*kSurf); } } //---------------------------------------------------------------------- void PndDrcOptDev::SetCopyNumber(int i) { fCopyNumber = i; // found following lines to be wron implementing the system couplings... 22.1.2010CS //list::const_iterator kSurf; //for(kSurf=fListSurf.begin(); kSurf != fListSurf.end(); ++kSurf) //{ // (*kSurf)->SetCopyNumber(i); //} } //---------------------------------------------------------------------- void PndDrcOptDev::AddSurface(const PndDrcSurfAbs& surf) { if (fVerbosity>=1) cout<<" PndDrcOptDev::addSurface to "<::const_iterator kSurf; for(kSurf=fListSurf.begin(); kSurf != fListSurf.end(); ++kSurf) { if (fVerbosity>=3) cout<<" PndDrcOptDev::print: set print flag for " <<(*kSurf)->Name()<<" "<<(*kSurf)->CopyNumber()<Print(stream); } // prepare tracing of photons fPhotonTrace = true; fPhotonTraceStream = &stream; } //---------------------------------------------------------------------- PndDrcOptMatAbs& PndDrcOptDev::OptMaterial() const { static PndDrcOptMatAbs* dummy = 0; // //cerr<<" *** PndDrcOptDev::optMaterial: This function must be overloaded when\n"; //cerr<<" using volumes with refraction. Abort.\n"; //exit(EXIT_FAILURE); return *dummy; } //---------------------------------------------------------------------- void PndDrcOptDev::AddTransform(const Transform3D& trans) { list::const_iterator kSurf; for (kSurf=fListSurf.begin(); kSurf != fListSurf.end(); ++kSurf) { const_cast(*kSurf)->AddTransform(trans); } fKx = trans * fKx; fKy = trans * fKy; fKz = trans * fKz; } //---------------------------------------------------------------------- void PndDrcOptDev::Print() { list::const_iterator kSurf; for (kSurf=fListSurf.begin(); kSurf != fListSurf.end(); ++kSurf) { cout<<"\t\t\t"<Name()<::const_iterator kSurf; for (kSurf=fListSurf.begin(); kSurf != fListSurf.end(); ++kSurf) { (*kSurf)->SetPrintColor(col); } } //---------------------------------------------------------------------- void PndDrcOptDev::SetFresnel(bool flag) { list::const_iterator kSurf; for (kSurf=fListSurf.begin(); kSurf != fListSurf.end(); ++kSurf) { (*kSurf)->SetFresnel(flag); } }