EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
dupper.F
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file dupper.F
1 
2 C **********************************************************************
3 
4  FUNCTION dupper(V1)
5 
6  IMPLICIT NONE
7 
8 C...Upper limit on second variable (y, Q**2 or W**2) depending on first
9 C...variable x=V1. Used for integrating differential cross-section.
10 
11 *
12 * to avoid variable conflictions, a second keep element is necessary
13 * with the same common block name (see LPTOU2)
14 *
15  COMMON /leptou/ cut(14),lst(40),parl(30),
16  & x,y,w2,q2,u
17  REAL cut,parl,x,y,w2,q2,u
18  INTEGER lst
19  SAVE /leptou/
20 
21  COMMON /lintrl/ psave(3,4,5),ksave(4),xmin,xmax,ymin,ymax,
22  &q2min,q2max,w2min,w2max,ilep,inu,ig,iz
23  REAL psave,xmin,xmax,ymin,ymax,q2min,q2max,w2min,w2max
24  INTEGER ksave,ilep,inu,ig,iz
25  SAVE /lintrl/
26 
27  REAL dupper,v1,s,pm2
28 
29 C...CMS energy squared and target nucleon mass.
30  s=parl(21)
31  pm2=psave(3,2,5)**2
32  IF(lst(31).EQ.1) THEN
33  dupper=min(q2max,v1*ymax*s,(w2max-pm2)*v1/max(1.-v1,1.e-22))
34  ELSEIF(lst(31).EQ.2) THEN
35  dupper=min(ymax,q2max/(s*v1),(w2max-pm2)/max(s*(1.-v1),1.e-22))
36  ELSEIF(lst(31).EQ.3) THEN
37  dupper=min(w2max,(1.-v1)*ymax*s+pm2,
38  & q2max*(1.-v1)/max(v1,1.e-22)+pm2)
39  ENDIF
40  RETURN
41  END