364 |
* Given estrip entry returns energy plus view, plane and strip numbers |
* Given estrip entry returns energy plus view, plane and strip numbers |
365 |
**/ |
**/ |
366 |
Float_t CaloLevel1::DecodeEstrip(Int_t entry, Int_t &view, Int_t &plane, Int_t &strip){ |
Float_t CaloLevel1::DecodeEstrip(Int_t entry, Int_t &view, Int_t &plane, Int_t &strip){ |
367 |
|
Bool_t sat = false; |
368 |
|
Float_t mip=this->DecodeEstrip(entry,view,plane,strip,sat); |
369 |
|
return(mip); |
370 |
|
}; |
371 |
|
|
372 |
|
/** |
373 |
|
* Given estrip entry returns energy plus view, plane, strip numbers and saturation info |
374 |
|
**/ |
375 |
|
Float_t CaloLevel1::DecodeEstrip(Int_t entry, Int_t &view, Int_t &plane, Int_t &strip, Bool_t &saturated){ |
376 |
// |
// |
377 |
if ( entry>istrip ) return(0.); |
if ( entry>istrip ){ |
378 |
|
// |
379 |
|
printf(" ERROR: problems decoding entry %i, it seems that number of entries is %i\n",entry,istrip); |
380 |
|
// |
381 |
|
return(0.); |
382 |
|
}; |
383 |
// |
// |
384 |
// printf(" num lim %f \n",std::numeric_limits<Float_t>::max()); |
// printf(" num lim %f \n",std::numeric_limits<Float_t>::max()); |
385 |
// printf(" estrip.At(%i) = %i \n",entry,estrip.At(entry)); |
// printf(" estrip.At(%i) = %i \n",entry,estrip.At(entry)); |
423 |
// |
// |
424 |
Float_t mip = ((Float_t)(eval - fbi*1000000000 -plom*10000000 -strip*100000))/tim; |
Float_t mip = ((Float_t)(eval - fbi*1000000000 -plom*10000000 -strip*100000))/tim; |
425 |
// |
// |
426 |
|
saturated = false; |
427 |
|
if ( mip > 5000. ){ |
428 |
|
mip -= 5000.; |
429 |
|
saturated = true; |
430 |
|
}; |
431 |
if ( mip > 0. && mip < 99999. ) return(mip); |
if ( mip > 0. && mip < 99999. ) return(mip); |
432 |
// |
// |
433 |
printf(" WARNING: 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); |
434 |
// |
// |
435 |
view = -1; |
view = -1; |
436 |
plane = -1; |
plane = -1; |
442 |
* Returns energy released on plane nplane (where 0<= nplane <= 43, 0 = 1Y, 1 = 1X, 2 = 2Y, 3 = 2X, etc. etc.). |
* Returns energy released on plane nplane (where 0<= nplane <= 43, 0 = 1Y, 1 = 1X, 2 = 2Y, 3 = 2X, etc. etc.). |
443 |
*/ |
*/ |
444 |
Float_t CaloLevel1::qtotpl(Int_t nplane){ |
Float_t CaloLevel1::qtotpl(Int_t nplane){ |
445 |
|
Bool_t sat = false; |
446 |
|
Float_t mip = this->qtotpl(nplane,sat); |
447 |
|
return(mip); |
448 |
|
}; |
449 |
|
|
450 |
|
/* |
451 |
|
* Returns energy released on plane nplane (where 0<= nplane <= 43, 0 = 1Y, 1 = 1X, 2 = 2Y, 3 = 2X, etc. etc.). |
452 |
|
*/ |
453 |
|
Float_t CaloLevel1::qtotpl(Int_t nplane, Bool_t &sat){ |
454 |
// |
// |
455 |
|
sat = false; |
456 |
Int_t sview = 1; |
Int_t sview = 1; |
457 |
if ( nplane%2 ) sview = 0; |
if ( nplane%2 ) sview = 0; |
458 |
// |
// |
459 |
Int_t splane = nplane-(sview+1)/2; |
Int_t splane = nplane-(sview+1)/2; |
460 |
// |
// |
461 |
Float_t totmip = qtotpl(sview,splane); |
Float_t totmip = qtotpl(sview,splane,sat); |
462 |
// |
// |
463 |
return(totmip); |
return(totmip); |
464 |
// |
// |
468 |
* Returns energy released on view "view" (0 = X, 1 = Y) and plane "plane" ( 0 <= plane <= 21 ). |
* Returns energy released on view "view" (0 = X, 1 = Y) and plane "plane" ( 0 <= plane <= 21 ). |
469 |
*/ |
*/ |
470 |
Float_t CaloLevel1::qtotpl(Int_t sview, Int_t splane){ |
Float_t CaloLevel1::qtotpl(Int_t sview, Int_t splane){ |
471 |
|
Bool_t sat = false; |
472 |
|
Float_t mip = this->qtotpl(sview,splane,sat); |
473 |
|
return(mip); |
474 |
|
}; |
475 |
|
|
476 |
|
/* |
477 |
|
* Returns energy released on view "view" (0 = X, 1 = Y) and plane "plane" ( 0 <= plane <= 21 ). |
478 |
|
*/ |
479 |
|
Float_t CaloLevel1::qtotpl(Int_t sview, Int_t splane, Bool_t &sat){ |
480 |
// |
// |
481 |
Int_t view = -1; |
Int_t view = -1; |
482 |
Int_t plane = -1; |
Int_t plane = -1; |
483 |
Int_t strip = -1; |
Int_t strip = -1; |
484 |
|
Bool_t lsat = false; |
485 |
|
sat = false; |
486 |
// |
// |
487 |
Float_t mip = 0.; |
Float_t mip = 0.; |
488 |
Float_t totmip = 0.; |
Float_t totmip = 0.; |
491 |
// |
// |
492 |
for (Int_t i = 0; i<istrip; i++ ){ |
for (Int_t i = 0; i<istrip; i++ ){ |
493 |
// |
// |
494 |
mip = DecodeEstrip(i,view,plane,strip); |
mip = DecodeEstrip(i,view,plane,strip,lsat); |
495 |
// |
// |
496 |
if ( view == sview && splane == plane ) totmip += mip; |
if ( view == sview && splane == plane ){ |
497 |
|
if ( lsat ) sat = true; |
498 |
|
totmip += mip; |
499 |
|
}; |
500 |
// |
// |
501 |
// 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 |
502 |
// |
// |