| 1 |
************************************************************************* |
************************************************************************ |
| 2 |
* |
* |
| 3 |
* functions.f |
* functions.f |
| 4 |
* |
* |
| 133 |
end |
end |
| 134 |
|
|
| 135 |
|
|
| 136 |
|
c------------------------------------------------------------------------ |
| 137 |
|
|
| 138 |
function coordsi(istrip,view) |
function coordsi(istrip,view) |
| 139 |
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
| 275 |
c------------------------------------------------------------------------ |
c------------------------------------------------------------------------ |
| 276 |
|
|
| 277 |
|
|
| 278 |
|
double precision function dcoordsi(rstrip,view) |
| 279 |
|
* |
| 280 |
|
* same as COORDSI, but accept a real value of strip!!! |
| 281 |
|
* and gives a double precision output |
| 282 |
|
* |
| 283 |
|
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
| 284 |
|
* it gives the strip coordinate in micrometers, |
| 285 |
|
* knowing the strip number (1..3072) and the view |
| 286 |
|
* number. the origin of the coordinate is on the |
| 287 |
|
* centre of the sensor the strip belongs to. |
| 288 |
|
* the axes directions are the same as in the PAMELA |
| 289 |
|
* reference frame (i.e.: the 11th view coordinate |
| 290 |
|
* direction has to be inverted here) |
| 291 |
|
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
| 292 |
|
|
| 293 |
|
c integer is,view,istrip |
| 294 |
|
|
| 295 |
|
integer view,is,istrip |
| 296 |
|
real rstrip |
| 297 |
|
double precision strip,stripladder,p |
| 298 |
|
double precision edge,dim |
| 299 |
|
double precision coord1 |
| 300 |
|
|
| 301 |
|
|
| 302 |
|
include 'commontracker.f' |
| 303 |
|
|
| 304 |
|
c NB mettere il 1024 nel commontracker...!??? |
| 305 |
|
|
| 306 |
|
strip=DBLE(rstrip) |
| 307 |
|
|
| 308 |
|
istrip = int(strip+0.5) !istrip stores the closest integer to strip |
| 309 |
|
|
| 310 |
|
is=istrip !it stores istrip number |
| 311 |
|
is=mod(is-1,1024)+1 !it puts all clusters on a single ladder |
| 312 |
|
|
| 313 |
|
dcoordsi=0. |
| 314 |
|
|
| 315 |
|
if(mod(view,2).eq.0) then !X view |
| 316 |
|
|
| 317 |
|
c if((is.le.3).or.(is.ge.1022)) then !X has 1018 strips... |
| 318 |
|
c print*,'functions: WARNING: false X strip: strip ',is |
| 319 |
|
c endif |
| 320 |
|
|
| 321 |
|
is=is-3 !4 =< is =< 1021 --> 1 =< is =< 1018 |
| 322 |
|
|
| 323 |
|
edge=edgeX |
| 324 |
|
dim=SiDimX |
| 325 |
|
|
| 326 |
|
elseif(mod(view,2).eq.1) then !Y view |
| 327 |
|
|
| 328 |
|
edge=edgeY |
| 329 |
|
dim=SiDimY |
| 330 |
|
|
| 331 |
|
c$$$ if(view.eq.11) then !INVERSIONE!??? |
| 332 |
|
c$$$ is=1025-is |
| 333 |
|
c$$$ endif |
| 334 |
|
|
| 335 |
|
endif |
| 336 |
|
|
| 337 |
|
|
| 338 |
|
stripladder = DBLE(is)+(strip-DBLE(istrip))!cluster position relative to ladder |
| 339 |
|
p=pitch(view) |
| 340 |
|
|
| 341 |
|
ccccc coord1=(is-1)*p !referred to 1st sensor strip |
| 342 |
|
coord1=(stripladder-1)*p !referred to 1st sensor strip |
| 343 |
|
coord1=coord1+edge !referred to sensor edge |
| 344 |
|
dcoordsi=coord1-dim/2 !referred to the centre of the sensor |
| 345 |
|
|
| 346 |
|
if(view.eq.11) then !INVERSION: it puts y axis in the same direction for all views |
| 347 |
|
dcoordsi=-dcoordsi |
| 348 |
|
endif |
| 349 |
|
|
| 350 |
|
end |
| 351 |
|
|
| 352 |
|
|
| 353 |
|
|
| 354 |
|
c------------------------------------------------------------------------ |
| 355 |
|
|
| 356 |
|
|
| 357 |
function coord(coordsi,view,ladder,sen) |
function coord(coordsi,view,ladder,sen) |
| 358 |
* it gives the coordinate in |
* it gives the coordinate in |
| 359 |
* micrometers, knowing the coordinate in the sensor |
* micrometers, knowing the coordinate in the sensor |
| 438 |
|
|
| 439 |
dcoord=0. |
dcoord=0. |
| 440 |
|
|
| 441 |
|
if( |
| 442 |
|
$ ladder.lt.1.or. |
| 443 |
|
$ ladder.gt.nladders_view.or. |
| 444 |
|
$ sen.lt.1.or. |
| 445 |
|
$ sen.gt.2.or. |
| 446 |
|
$ view.lt.1.or. |
| 447 |
|
$ view.gt.nviews.or. |
| 448 |
|
$ .false.)then |
| 449 |
|
print*,'dcoord ---> wrong input: ladder ',ladder |
| 450 |
|
$ ,' sensor ',sen |
| 451 |
|
$ ,' view ',view |
| 452 |
|
return |
| 453 |
|
endif |
| 454 |
|
|
| 455 |
sx=ladder |
sx=ladder |
| 456 |
sy=sen |
sy=sen |
| 457 |
sz=npl(view) |
sz=npl(view) |
| 458 |
|
|
| 459 |
|
|
| 460 |
if(mod(view,2).eq.0) then !X view |
if(mod(view,2).eq.0) then !X view |
| 461 |
|
|
| 462 |
trasl=x_mech_sensor(sz,sx,sy) !in mm |
trasl=x_mech_sensor(sz,sx,sy) !in mm |