Hi This can certainly easily be done , the only warning will be that I think one has to setup the limits at the time of the defs of parameters, so if this is not done after the geodef it is probably ok stay tuned for a brief while - a nice little task before the next cup of coffee. Flemming ---------------------------------------------------------------- Flemming Videbaek Physics Department Brookhaven National Laboratory e-mail: videbaek@bnl.gov phone: 631-344-4106 ----- Original Message ----- From: "Bjorn H Samset" <bjornhs@rcf2.rhic.bnl.gov> To: "BRAHMS Software list" <brahms-dev-l@lists.bnl.gov> Sent: Wednesday, November 17, 2004 9:08 AM Subject: [Brahms-dev-l] BRAG update request > > Dear dev'ils, in particular the fortran/BRAG-knowledgeable of you: > > I have a request for an update that would make acceptance generation a lot > easier: Could someone, in guxint.F, add a kine definition that finds the > front planes of D1 and D5 (i.e. the front magnet volumes) and throws a > flat, random distribution in this square area? > > This is identical to what Peters acceptance software does, but since all > the geometry informaion can be input to BRAG through Flemmings > generatebraggeometry program it would be very useful to do this > automatically rather than having to through the database one more time. > All the values are present, so it should be an easy fix for someone who > knows the ins and outs of brag a bit better than I do. > > To be specific, what I want is to be able to simply issue the following > command: > kine 13 <pmin> <pmax> <spec_id> <pid> > BRAG then determines the position and angle of the front plane of D1 > (if spec_id==0) or D5 (if spec_id==1), and uses the max and min vertex > z position defined through control/spot to find the max and min theta and > phi angles that can hit this plane. The distribution should just be a > flat, random dist. between these values and between PMIN and PMAX. > > Could someone look at this? (If noone volunteers in a day or two I'll look > at it myself, but since I'm lousy at fortran this is not the most time > efficient way to get it done ;-) > > Regards > --Bjorn > > PS: For reference, here's the math that Peter uses in his generate code: > //__________________________________________________________________________ _ > void GetAngleRange(BrVector3D vtx1, > BrVector3D vtx2, > BrMagnetVolume* magnet, > Float_t* theta, > Float_t* phi, > Bool_t isMrs) > { > // --- get theta and phi ranges > > Float_t* size = magnet->GetSize(); > BrVector3D *frontRight = new BrVector3D(-size[0]/2.0, -size[1]/2.0, > -size[2]/2.0); > BrVector3D *frontLeft = new BrVector3D(size[0]/2.0, size[1]/2.0, > -size[2]/2.0); > > magnet->LocalToGlobal(*frontRight, *frontRight, 0); > magnet->LocalToGlobal(*frontLeft, *frontLeft, 0); > > *frontLeft -= vtx1; > *frontRight -= vtx2; > > // --- theta > const Float_t radtodeg = 180.0/TMath::Pi(); > > // --- phi > if (isMrs) { > theta[0] = radtodeg * frontRight->Theta(); > theta[1] = radtodeg * frontLeft->Theta(); > phi[0] = -radtodeg * TMath::Abs(frontRight->Phi()); > phi[1] = radtodeg * TMath::Abs(frontRight->Phi()); > } > else { > theta[0] = radtodeg * frontLeft->Theta(); > theta[1] = radtodeg * frontRight->Theta(); > phi[0] = radtodeg * TMath::Abs(frontRight->Phi()); > phi[1] = 360-radtodeg * TMath::Abs(frontRight->Phi()); > } > } > > > > > -- > Bjorn H. Samset Phone: 22856465/92051998 > PhD student, heavy ion physics Adr: Schouterrassen 6 > Inst. of Physics, University of Oslo 0573 Oslo > \|/ > ----------------------------> -*- <----------------------------- > /|\ > > _______________________________________________ > Brahms-dev-l mailing list > Brahms-dev-l@lists.bnl.gov > http://lists.bnl.gov/mailman/listinfo/brahms-dev-l > _______________________________________________ Brahms-dev-l mailing list Brahms-dev-l@lists.bnl.gov http://lists.bnl.gov/mailman/listinfo/brahms-dev-lReceived on Wed Nov 17 09:26:36 2004
This archive was generated by hypermail 2.1.8 : Wed Nov 17 2004 - 09:26:53 EST