313 |
}; |
}; |
314 |
|
|
315 |
/** |
/** |
316 |
|
* Given a point in the space or a strip it returns the Silicon sensor number. Numbering goes like this: |
317 |
|
* |
318 |
|
* y ^ |
319 |
|
* | |
320 |
|
* | 6 7 8 |
321 |
|
* | 3 4 5 |
322 |
|
* | 0 1 2 |
323 |
|
* | -----------> x |
324 |
|
* |
325 |
|
**/ |
326 |
|
Int_t CaloStrip::GetSiSensor() { |
327 |
|
// |
328 |
|
// fX fY fZ // fView fPlane |
329 |
|
// |
330 |
|
Float_t deadsi = 0.096; |
331 |
|
Float_t dead = 0.05; |
332 |
|
Float_t sidim = 8.00; |
333 |
|
// Float_t stripdim = 0.244; |
334 |
|
Float_t sensitarea = 7.808; |
335 |
|
// |
336 |
|
Float_t xoffset = 0.; |
337 |
|
Float_t yoffset = 0.; |
338 |
|
// |
339 |
|
if ( (fView-1) == 0 && !((fPlane-1)%2) ){ |
340 |
|
xoffset = +0.05; |
341 |
|
yoffset = 0.0; |
342 |
|
}; |
343 |
|
if ( (fView-1) == 0 && ((fPlane-1)%2) ){ |
344 |
|
xoffset = -0.05; |
345 |
|
yoffset = -0.20; |
346 |
|
}; |
347 |
|
if ( (fView-1) == 1 && !((fPlane-1)%2) ){ |
348 |
|
xoffset = +0.10; |
349 |
|
yoffset = -0.05; |
350 |
|
}; |
351 |
|
if ( (fView-1) == 1 && ((fPlane-1)%2) ){ |
352 |
|
xoffset = -0.10; |
353 |
|
yoffset = -0.15; |
354 |
|
}; |
355 |
|
// |
356 |
|
Int_t iind = -1; |
357 |
|
Int_t jind = -1; |
358 |
|
// |
359 |
|
for (Int_t i = 0; i < 3; i++){ |
360 |
|
if ( (fX+xoffset+12.1) >= (deadsi+(sidim+dead)*i) && (fX+xoffset+12.1) <= (sensitarea+deadsi+(sidim+dead)*i) ){ |
361 |
|
iind = i; |
362 |
|
break; |
363 |
|
}; |
364 |
|
}; |
365 |
|
// |
366 |
|
for (Int_t j = 0; j < 3; j++){ |
367 |
|
if ( (fY+yoffset+12.1) >= (deadsi+(sidim+dead)*j) && (fY+yoffset+12.1) <= (sensitarea+deadsi+(sidim+dead)*j) ){ |
368 |
|
jind = j; |
369 |
|
break; |
370 |
|
}; |
371 |
|
}; |
372 |
|
// |
373 |
|
Int_t sensor = -1; |
374 |
|
if ( iind != -1 && jind != -1 ){ |
375 |
|
sensor = iind + jind * 3; |
376 |
|
}; |
377 |
|
// |
378 |
|
// printf(" View %i Plane %i x %f y %f z %f xoffset %f yoffset %f iind %i jind %i \n",fView,fPlane,fX,fY,fZ,xoffset,yoffset,iind,jind); |
379 |
|
// |
380 |
|
return(sensor); |
381 |
|
// |
382 |
|
}; |
383 |
|
|
384 |
|
/** |
385 |
* CaloLevel1 constructor |
* CaloLevel1 constructor |
386 |
**/ |
**/ |
387 |
CaloLevel1::CaloLevel1() { |
CaloLevel1::CaloLevel1() { |
490 |
// |
// |
491 |
strip = (Int_t)truncf((Float_t)((eval - fbi*1000000000 -plom*10000000)/100000)); |
strip = (Int_t)truncf((Float_t)((eval - fbi*1000000000 -plom*10000000)/100000)); |
492 |
// |
// |
493 |
Float_t mip = ((Float_t)(eval - fbi*1000000000 -plom*10000000 -strip*100000))/tim; |
Double_t mip = (Double_t)(((Float_t)(eval - fbi*1000000000 -plom*10000000 -strip*100000))/tim); |
494 |
// |
// |
495 |
saturated = false; |
saturated = false; |
496 |
if ( mip > 5000. ){ |
if ( mip > 5000. ){ |
497 |
mip -= 5000.; |
mip -= 5000.; |
498 |
saturated = true; |
saturated = true; |
499 |
}; |
}; |
500 |
if ( mip > 0. && mip < 99999. ) return(mip); |
if ( mip > 0. && mip < 99999. ) return((Float_t)mip); |
501 |
// |
// |
502 |
printf(" ERROR: problems decoding value %i at entry %i \n",estrip.At(entry),entry); |
printf(" ERROR: problems decoding value %i at entry %i \n",estrip.At(entry),entry); |
503 |
// |
// |
525 |
Int_t sview = 1; |
Int_t sview = 1; |
526 |
if ( nplane%2 ) sview = 0; |
if ( nplane%2 ) sview = 0; |
527 |
// |
// |
528 |
Int_t splane = nplane-(sview+1)/2; |
// Int_t splane = nplane-(sview+1)/2; |
529 |
|
Int_t splane = (nplane+sview-1)/2; |
530 |
// |
// |
531 |
Float_t totmip = qtotpl(sview,splane,sat); |
Float_t totmip = qtotpl(sview,splane,sat); |
532 |
// |
// |
566 |
if ( view == sview && splane == plane ){ |
if ( view == sview && splane == plane ){ |
567 |
if ( lsat ) sat = true; |
if ( lsat ) sat = true; |
568 |
totmip += mip; |
totmip += mip; |
569 |
|
//printf(" totmip %f mip %f \n",totmip,mip); |
570 |
}; |
}; |
571 |
// |
// |
572 |
// entry are ordered by strip, plane and view number. Go out if you pass the input strip |
// entry are ordered by strip, plane and view number. Go out if you pass the input strip |