--- DarthVader/TrackerLevel2/src/F77/functions.f 2007/05/24 16:45:48 1.4 +++ DarthVader/TrackerLevel2/src/F77/functions.f 2007/09/04 15:44:50 1.5 @@ -133,6 +133,7 @@ end +c------------------------------------------------------------------------ function coordsi(istrip,view) * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * @@ -274,6 +275,85 @@ c------------------------------------------------------------------------ + double precision function dcoordsi(rstrip,view) +* +* same as COORDSI, but accept a real value of strip!!! +* and gives a double precision output +* +* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +* it gives the strip coordinate in micrometers, +* knowing the strip number (1..3072) and the view +* number. the origin of the coordinate is on the +* centre of the sensor the strip belongs to. +* the axes directions are the same as in the PAMELA +* reference frame (i.e.: the 11th view coordinate +* direction has to be inverted here) +* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + +c integer is,view,istrip + + integer view,is,istrip + real rstrip + double precision strip,stripladder,p + double precision edge,dim + double precision coord1 + + + include 'commontracker.f' + +c NB mettere il 1024 nel commontracker...!??? + + strip=DBLE(rstrip) + + istrip = int(strip+0.5) !istrip stores the closest integer to strip + + is=istrip !it stores istrip number + is=mod(is-1,1024)+1 !it puts all clusters on a single ladder + + dcoordsi=0. + + if(mod(view,2).eq.0) then !X view + +c if((is.le.3).or.(is.ge.1022)) then !X has 1018 strips... +c print*,'functions: WARNING: false X strip: strip ',is +c endif + + is=is-3 !4 =< is =< 1021 --> 1 =< is =< 1018 + + edge=edgeX + dim=SiDimX + + elseif(mod(view,2).eq.1) then !Y view + + edge=edgeY + dim=SiDimY + +c$$$ if(view.eq.11) then !INVERSIONE!??? +c$$$ is=1025-is +c$$$ endif + + endif + + + stripladder = DBLE(is)+(strip-DBLE(istrip))!cluster position relative to ladder + p=pitch(view) + +ccccc coord1=(is-1)*p !referred to 1st sensor strip + coord1=(stripladder-1)*p !referred to 1st sensor strip + coord1=coord1+edge !referred to sensor edge + dcoordsi=coord1-dim/2 !referred to the centre of the sensor + + if(view.eq.11) then !INVERSION: it puts y axis in the same direction for all views + dcoordsi=-dcoordsi + endif + + end + + + +c------------------------------------------------------------------------ + + function coord(coordsi,view,ladder,sen) * it gives the coordinate in * micrometers, knowing the coordinate in the sensor