43 std::vector<double> rotmat=ps.get<std::vector<double> >(
"rotmatrix");
44 TVector3 newX,newY,newZ;
45 if (rotmat.size()==9) {
46 std::cout<<
"FluxReader: Matrix defined with new axis values"<<std::endl;
47 newX=TVector3(rotmat[0], rotmat[1], rotmat[2]);
48 newY=TVector3(rotmat[3], rotmat[4], rotmat[5]);
49 newZ=TVector3(rotmat[6], rotmat[7], rotmat[8]);
50 }
else if (rotmat.size()==6) {
51 std::cout<<
"FluxReader: Matrix defined with theta phi rotations"<<std::endl;
62 }
catch (std::exception&
e) {
63 std::cout<<
"FluxReader: "<<e.what()<<std::endl;
64 std::cout<<
"FluxReader: These are not numbers"<<std::endl;
69 fhicl::ParameterSet rotps=ps.get<fhicl::ParameterSet >(
"rotmatrix");
70 double xrot=rotps.get<
double>(
"x");
71 double yrot=rotps.get<
double>(
"y");
72 double zrot=rotps.get<
double>(
"z");
77 std::cout<<
"FluxReader: Matrix defined with series of rotations"<<std::endl;
81 }
catch (std::exception& e) {
82 std::cout<<
"FluxReader: "<<e.what()<<std::endl;
83 std::cout<<
"FluxReader: Looks like it was numbers"<<std::endl;
87 std::cout <<
"FluxReader: fBeamRotXML: " << std::setprecision(
p) << std::endl;
99 << std::setw(w) <<
fBeamRotXML.ZZ() <<
" ] " << std::endl;
102 std::vector<double> detxyz=ps.get<std::vector<double> >(
"userbeam");
103 TVector3 userpos,beampos;
104 if (detxyz.size()==3) {
105 userpos=TVector3(0,0,0);
106 beampos=TVector3(detxyz[0], detxyz[1], detxyz[2]);
107 }
else if (detxyz.size()==6) {
108 userpos=TVector3(detxyz[0], detxyz[1], detxyz[2]);
109 beampos=TVector3(detxyz[3], detxyz[4], detxyz[5]);
111 std::cout<<
"FluxReader: userbeam needs 3 or 6 numbers to be properly defined"<<std::endl;
117 std::cout <<
"FluxReader: fBeamPosXML: [ " << std::setprecision(
p)
123 std::vector<double>
windowBase=ps.get<std::vector<double> >(
"windowBase");
124 std::vector<double>
window1 =ps.get<std::vector<double> >(
"window1");
125 std::vector<double>
window2 =ps.get<std::vector<double> >(
"window2");
128 fFluxWindowPtUser[1]=TVector3( window1[0] , window1[1] , window1[2] );
129 fFluxWindowPtUser[2]=TVector3( window2[0] , window2[1] , window2[2] );
133 TLorentzVector ptbm0, ptbm1, ptbm2;
134 User2BeamPos(TLorentzVector(fFluxWindowPtUser[0],0),ptbm0);
135 User2BeamPos(TLorentzVector(fFluxWindowPtUser[1],0),ptbm1);
136 User2BeamPos(TLorentzVector(fFluxWindowPtUser[2],0),ptbm2);
151 if ( TMath::Abs(dot) > 1.0e-8 )
152 std::cout <<
"FluxReader: Dot product between window direction vectors was "
153 << dot <<
"; please check for orthoganality"<<std::endl;
161 TLorentzVector detVec;
163 fDkMeta->location[1].x=detVec.Vect().X();
164 fDkMeta->location[1].y=detVec.Vect().Y();
165 fDkMeta->location[1].z=detVec.Vect().Z();
167 std::cout<<
"FluxReader: Locations "<<std::endl;
168 for (
unsigned int i=0;i<
fDkMeta->location.size();i++) {
171 <<
fDkMeta->location[i].z<<std::endl;
constexpr auto dot(Vector const &a, Vector const &b)
Return cross product of two vectors.
TLorentzVector fFluxWindowDir2
void User2BeamPos(const TLorentzVector &usrxyz, TLorentzVector &beamxyz) const
TVector3 AnglesToAxis(double theta, double phi)
TVector3 fFluxWindowPtUser[3]
TLorentzRotation fBeamRotInv
TLorentzVector fFluxWindowBase
TLorentzVector fFluxWindowDir1
BEGIN_PROLOG could also be cout
TLorentzRotation fBeamRot