BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
TofCaliSvc Class Reference

#include <TofCaliSvc.h>

Inheritance diagram for TofCaliSvc:

Public Member Functions

 TofCaliSvc (const std::string &name, ISvcLocator *svcloc)
virtual StatusCode initialize ()
virtual StatusCode finalize ()
void handle (const Incident &)
StatusCode chooseConstants (int run, int number)
const BTofCalBTof (unsigned int id) const
const BTofCommonCalBTofCommon () const
const ETofCalETof (unsigned int id) const
const EtfCalEtfTof (unsigned int id) const
const TofInfoCalTofInfo () const
const double BTDelay1 (unsigned int id)
const double BTDelay2 (unsigned int id)
const double ETDelay (unsigned int id)
const double BTCorr1 (double ADC, double zHit, unsigned int id)
const double BTCorr2 (double ADC, double zHit, unsigned int id)
const double BTCorrOffset1 (double zHit, unsigned int id, double t0)
const double BTCorrOffset2 (double zHit, unsigned int id, double t0)
const double TOffset ()
const double BTime1 (double ADC, double TDC, double zHit, unsigned int id, double t0)
const double BTime2 (double ADC, double TDC, double zHit, unsigned int id, double t0)
const double ETime (double ADC, double TDC, double rHit, unsigned int id)
const double EtfTime (double ADC1, double ADC2, double TDC1, double TDC2, unsigned int id, unsigned int strip, double t0)
const double EtfTime1 (double ADC, double TDC, double zHit, unsigned int id, unsigned int strip, double t0)
const double EtfTime2 (double ADC, double TDC, double zHit, unsigned int id, unsigned int strip, double t0)
const double EtfTimeMC (double ADC1, double ADC2, double TDC1, double TDC2, unsigned int id, unsigned int strip, double t0)
const double EtfTimeMC1 (double ADC, double TDC, double zHit, unsigned int id, unsigned int strip, double t0)
const double EtfTimeMC2 (double ADC, double TDC, double zHit, unsigned int id, unsigned int strip, double t0)
const double EtfTime (double tleft, double tright)
const double EtfBunchP (int index)
const double BTimeCounter (double tleft, double tright, double z, unsigned int id)
const double BTimeCluster (double tlayer1, double tlayer2, double z1, double z2, unsigned int id1, unsigned int id2)
const double BSigma1 (double zHit, unsigned int id)
const double BSigma2 (double zHit, unsigned int id)
const double BSigmaCounter (double zHit, unsigned int id)
const double BSigmaCluster (double zHit1, double zHit2, unsigned int id1, unsigned int id2)
const double ESigma (double rHit, unsigned int id)
const double BPulseHeight1 (double ADC, double zHit, double sint, unsigned int id)
const double BPulseHeight2 (double ADC, double zHit, double sint, unsigned int id)
const double BPulseHeight (double ADC1, double ADC2, double zHit, double sint, unsigned int id)
const double BPh (double ADC1, double ADC2, double zHit, unsigned int id)
const double EPulseHeight (double ADC, double rHit, double cost, unsigned int id)
const double EPh (double ADC, double rHit, unsigned int id)
const double BVeff (unsigned int id)
const double BAtten (unsigned int id)
const double BGainForward (unsigned int id)
const double BGainBackward (unsigned int id)
const double getQ0 (unsigned int id)
const double EVeff (unsigned int id)
const double EAtten (unsigned int id)
const double EGain (unsigned int id)
const double EtfVeff (unsigned int id, unsigned int strip)
const double ZTDC (double tleft, double tright, unsigned int id)
const double ZTDC1 (double tright, unsigned int id, double z)
const double ZTDC2 (double tleft, unsigned int id, double z)
const double ZADC (double qleft, double qright, unsigned int id)
const double ZADC1 (double qright, unsigned int id, double z)
const double ZADC2 (double qleft, unsigned int id, double z)
const double EtfZTDC (double tleft, double tright, unsigned int id, unsigned int strip)
const int RunBegin ()
const int RunEnd ()
const int Version ()
const int QCorr ()
const int QElec ()
const int MisLable ()
const int BrEast (unsigned int No)
const int BrWest (unsigned int No)
const int Endcap (unsigned int No)
const int Etf (unsigned int No)
const int RunFrom ()
const int RunTo ()
const int EventFrom ()
const int EventTo ()
void Dump ()

Detailed Description

Definition at line 29 of file TofCaliSvc.h.

Constructor & Destructor Documentation

◆ TofCaliSvc()

TofCaliSvc::TofCaliSvc ( const std::string & name,
ISvcLocator * svcloc )

Definition at line 42 of file TofCaliSvc.cxx.

43 : base_class( name, svcloc )
44// TofCaliSvc::TofCaliSvc( const std::string& name, ISvcLocator* svcloc ) : Service(name,
45// svcloc) {
46{
47 declareProperty( "Run", m_run = 1 );
48 m_sequence = 0;
49}

Referenced by TofCaliSvc().

Member Function Documentation

◆ BAtten()

const double TofCaliSvc::BAtten ( unsigned int id)

Definition at line 1019 of file TofCaliSvc.cxx.

1019 {
1020 if ( id > 175 ) return -1;
1021 return fBTofCal[176 * m_sequence + id].getAtten( 0 );
1022}

◆ BGainBackward()

const double TofCaliSvc::BGainBackward ( unsigned int id)

Definition at line 1032 of file TofCaliSvc.cxx.

1032 {
1033 if ( id > 175 ) return -1;
1034 return fBTofCal[176 * m_sequence + id].getAtten( 2 );
1035}

◆ BGainForward()

const double TofCaliSvc::BGainForward ( unsigned int id)

Definition at line 1024 of file TofCaliSvc.cxx.

1024 {
1025 if ( id > 175 ) return -1;
1026 double gainRatio = fBTofCal[176 * m_sequence + id].getAtten( 1 );
1027 double A2 = fBTofCal[176 * m_sequence + id].getAtten( 2 );
1028 double A1 = A2 * TMath::Exp( gainRatio );
1029 return A1;
1030}

◆ BPh()

const double TofCaliSvc::BPh ( double ADC1,
double ADC2,
double zHit,
unsigned int id )

Definition at line 970 of file TofCaliSvc.cxx.

970 {
971 double length = 230.0;
972 double Latten = fBTofCal[176 * m_sequence + id].getAtten( 0 );
973 double gainRatio = fBTofCal[176 * m_sequence + id].getAtten( 1 );
974 double q = ( ADC1 * TMath::Exp( ( 0.5 * length - zHit ) / Latten ) +
975 ADC2 * TMath::Exp( ( 0.5 * length + zHit ) / Latten ) ) /
976 ( 1.0 + TMath::Exp( gainRatio ) );
977 return q;
978}
****INTEGER imax DOUBLE PRECISION m_pi *DOUBLE PRECISION m_amfin DOUBLE PRECISION m_Chfin DOUBLE PRECISION m_Xenph DOUBLE PRECISION m_sinw2 DOUBLE PRECISION m_GFermi DOUBLE PRECISION m_MfinMin DOUBLE PRECISION m_ta2 INTEGER m_out INTEGER m_KeyFSR INTEGER m_KeyQCD *COMMON c_Semalib $ !copy of input $ !CMS energy $ !beam mass $ !final mass $ !beam charge $ !final charge $ !smallest final mass $ !Z mass $ !Z width $ !EW mixing angle $ !Gmu Fermi $ alphaQED at q
Definition KKsem.h:33

◆ BPulseHeight()

const double TofCaliSvc::BPulseHeight ( double ADC1,
double ADC2,
double zHit,
double sint,
unsigned int id )

Definition at line 958 of file TofCaliSvc.cxx.

959 {
960 double length = 230.0;
961 double Latten = fBTofCal[176 * m_sequence + id].getAtten( 0 );
962 double gainRatio = fBTofCal[176 * m_sequence + id].getAtten( 1 );
963 double A2 = fBTofCal[176 * m_sequence + id].getAtten( 2 );
964 double q = ( ADC1 * sint * TMath::Exp( ( 0.5 * length - zHit ) / Latten ) +
965 ADC2 * sint * TMath::Exp( ( 0.5 * length + zHit ) / Latten ) ) /
966 ( A2 * ( 1.0 + TMath::Exp( gainRatio ) ) );
967 return q;
968}

◆ BPulseHeight1()

const double TofCaliSvc::BPulseHeight1 ( double ADC,
double zHit,
double sint,
unsigned int id )

Definition at line 940 of file TofCaliSvc.cxx.

941 {
942 double length = 230.0;
943 double A = 1.0;
944 double Latten = fBTofCal[176 * m_sequence + id].getAtten( 0 );
945 double q0 = ADC * sint * TMath::Exp( ( 0.5 * length - zHit ) / Latten ) / A;
946 return q0;
947}

◆ BPulseHeight2()

const double TofCaliSvc::BPulseHeight2 ( double ADC,
double zHit,
double sint,
unsigned int id )

Definition at line 949 of file TofCaliSvc.cxx.

950 {
951 double length = 230.0;
952 double A = 1.0;
953 double Latten = fBTofCal[176 * m_sequence + id].getAtten( 0 );
954 double q0 = ADC * sint * TMath::Exp( ( 0.5 * length + zHit ) / Latten ) / A;
955 return q0;
956}

◆ BrEast()

const int TofCaliSvc::BrEast ( unsigned int No)

Definition at line 1146 of file TofCaliSvc.cxx.

1146 {
1147 return fTofInfoCal[m_sequence].getBrEast( im );
1148}

◆ BrWest()

const int TofCaliSvc::BrWest ( unsigned int No)

Definition at line 1150 of file TofCaliSvc.cxx.

1150 {
1151 return fTofInfoCal[m_sequence].getBrWest( im );
1152}

◆ BSigma1()

const double TofCaliSvc::BSigma1 ( double zHit,
unsigned int id )

Definition at line 674 of file TofCaliSvc.cxx.

674 {
675 MsgStream log( msgSvc(), name() );
676
677 double fpleft[nBarSigma];
678 for ( int i = 0; i < static_cast<int>( nBarSigma ); i++ )
679 { fpleft[i] = fBTofCal[176 * m_sequence + id].getFPLeft( i ); }
680
681 log << MSG::DEBUG << "BSigma1 id =" << id << " 1=" << fpleft[0] << " 2=" << fpleft[1]
682 << " 3=" << fpleft[2] << " 4=" << fpleft[3] << " 5=" << fpleft[4] << endmsg;
683
684 double sigmaLeft = fpleft[0] + fpleft[1] * z + fpleft[2] * z * z + fpleft[3] * z * z * z +
685 fpleft[4] * z * z * z * z;
686
687 return sigmaLeft;
688}
const unsigned int nBarSigma
IMessageSvc * msgSvc()

Referenced by BTimeCounter().

◆ BSigma2()

const double TofCaliSvc::BSigma2 ( double zHit,
unsigned int id )

Definition at line 690 of file TofCaliSvc.cxx.

690 {
691 MsgStream log( msgSvc(), name() );
692
693 double fpright[nBarSigma];
694 for ( int i = 0; i < static_cast<int>( nBarSigma ); i++ )
695 { fpright[i] = fBTofCal[176 * m_sequence + id].getFPRight( i ); }
696
697 log << MSG::DEBUG << "BSigma2 id =" << id << " 1=" << fpright[0] << " 2=" << fpright[1]
698 << " 3=" << fpright[2] << " 4=" << fpright[3] << " 5=" << fpright[4] << endmsg;
699
700 double sigmaRight = fpright[0] + fpright[1] * z + fpright[2] * z * z +
701 fpright[3] * z * z * z + fpright[4] * z * z * z * z;
702
703 return sigmaRight;
704}

Referenced by BTimeCounter().

◆ BSigmaCluster()

const double TofCaliSvc::BSigmaCluster ( double zHit1,
double zHit2,
unsigned int id1,
unsigned int id2 )

Definition at line 723 of file TofCaliSvc.cxx.

723 {
724 double sigmaInner = BSigmaCounter( z1, id1 );
725 double sigmaInner2 = sigmaInner * sigmaInner;
726 double sigmaOuter = BSigmaCounter( z2, id2 );
727 double sigmaOuter2 = sigmaOuter * sigmaOuter;
728 double sigmaCorr = fBTofCommonCal[m_sequence].getSigmaCorr( 0 );
729 double sigmaCorr2 = sigmaCorr * sigmaCorr;
730 double sigma = ( sigmaInner2 * sigmaOuter2 - sigmaCorr2 * sigmaCorr2 ) /
731 ( sigmaInner2 + sigmaOuter2 - 2.0 * sigmaCorr2 );
732 sigma = sqrt( sigma );
733 return sigma;
734}
const double BSigmaCounter(double zHit, unsigned int id)

◆ BSigmaCounter()

const double TofCaliSvc::BSigmaCounter ( double zHit,
unsigned int id )

Definition at line 706 of file TofCaliSvc.cxx.

706 {
707 MsgStream log( msgSvc(), name() );
708
709 double fplayer[nBarSigCnt];
710 for ( int i = 0; i < static_cast<int>( nBarSigCnt ); i++ )
711 { fplayer[i] = fBTofCal[176 * m_sequence + id].getFPCounter( i ); }
712
713 log << MSG::DEBUG << "BSigmaCounter id =" << id << " 1=" << fplayer[0]
714 << " 2=" << fplayer[1] << " 3=" << fplayer[2] << " 4=" << fplayer[3]
715 << " 5=" << fplayer[4] << endmsg;
716
717 double sigma = fplayer[0] + fplayer[1] * z + fplayer[2] * z * z + fplayer[3] * z * z * z +
718 fplayer[4] * z * z * z * z;
719
720 return sigma;
721}
const unsigned int nBarSigCnt

Referenced by BSigmaCluster(), and BTimeCluster().

◆ BTCorr1()

const double TofCaliSvc::BTCorr1 ( double ADC,
double zHit,
unsigned int id )

Definition at line 424 of file TofCaliSvc.cxx.

424 {
425 MsgStream log( msgSvc(), name() );
426
427 double p1[nBarPar];
428 for ( int i = 0; i < static_cast<int>( nBarPar ); i++ )
429 { p1[i] = fBTofCal[176 * m_sequence + id].getP1( i ); }
430
431 log << MSG::DEBUG << "BTCorr1 id =" << id << " 1=" << p1[0] << " 2=" << p1[1]
432 << " 3=" << p1[2] << " 4=" << p1[3] << " 5=" << p1[4] << " 6=" << p1[5] << " 7=" << p1[6]
433 << " 8=" << p1[7] << " 9=" << p1[8] << endmsg;
434
435 double tcorr1 = p1[0] + p1[1] / TMath::Sqrt( ADC ) + p1[2] * z / TMath::Sqrt( ADC ) +
436 p1[3] / ADC + p1[4] * z + p1[5] * z * z + p1[6] * z * z * z;
437
438 return tcorr1;
439}
double p1[4]
const unsigned int nBarPar

Referenced by BTime1().

◆ BTCorr2()

const double TofCaliSvc::BTCorr2 ( double ADC,
double zHit,
unsigned int id )

Definition at line 441 of file TofCaliSvc.cxx.

441 {
442 MsgStream log( msgSvc(), name() );
443
444 double p2[nBarPar];
445 for ( int i = 0; i < static_cast<int>( nBarPar ); i++ )
446 { p2[i] = fBTofCal[176 * m_sequence + id].getP2( i ); }
447
448 log << MSG::DEBUG << "BTCorr2 id =" << id << " 1=" << p2[0] << " 2=" << p2[1]
449 << " 3=" << p2[2] << " 4=" << p2[3] << " 5=" << p2[4] << " 6=" << p2[5] << " 7=" << p2[6]
450 << " 8=" << p2[7] << " 9=" << p2[8] << endmsg;
451
452 double tcorr2 = p2[0] + p2[1] / TMath::Sqrt( ADC ) + p2[2] * z / TMath::Sqrt( ADC ) +
453 p2[3] / ADC + p2[4] * z + p2[5] * z * z + p2[6] * z * z * z;
454
455 return tcorr2;
456}
double p2[4]

Referenced by BTime2().

◆ BTCorrOffset1()

const double TofCaliSvc::BTCorrOffset1 ( double zHit,
unsigned int id,
double t0 )

Definition at line 458 of file TofCaliSvc.cxx.

458 {
459 MsgStream log( msgSvc(), name() );
460
461 int numBunch = fTofInfoCal[m_sequence].getRunEnd();
462 int whichBunch =
463 ( static_cast<int>( t0 / ( 12000. / 499.8 / ( numBunch * 1.0 ) ) + 0.1 ) ) % numBunch;
464
465 double poff1[nBarParOff];
466 if ( whichBunch == 0 )
467 {
468 for ( int i = 0; i < static_cast<int>( nBarParOff ); i++ )
469 { poff1[i] = fBTofCal[176 * m_sequence + id].getPOff1_bunch0( i ); }
470 }
471 else if ( whichBunch == 1 )
472 {
473 for ( int i = 0; i < static_cast<int>( nBarParOff ); i++ )
474 { poff1[i] = fBTofCal[176 * m_sequence + id].getPOff1_bunch1( i ); }
475 }
476 else if ( whichBunch == 2 )
477 {
478 for ( int i = 0; i < static_cast<int>( nBarParOff ); i++ )
479 { poff1[i] = fBTofCal[176 * m_sequence + id].getPOff1_bunch2( i ); }
480 }
481 else if ( whichBunch == 3 )
482 {
483 for ( int i = 0; i < static_cast<int>( nBarParOff ); i++ )
484 { poff1[i] = fBTofCal[176 * m_sequence + id].getPOff1_bunch3( i ); }
485 }
486
487 double tCorrOffset1 = 0.0;
488 if ( z >= 0.0 )
489 {
490 tCorrOffset1 = poff1[0] + poff1[1] * z + poff1[2] * z * z + poff1[3] * z * z * z +
491 poff1[4] * z * z * z * z + poff1[5] * z * z * z * z * z +
492 poff1[6] * z * z * z * z * z * z;
493 }
494 else
495 {
496 tCorrOffset1 = poff1[10] + poff1[11] * z + poff1[12] * z * z + poff1[13] * z * z * z +
497 poff1[14] * z * z * z * z + poff1[15] * z * z * z * z * z +
498 poff1[16] * z * z * z * z * z * z;
499 }
500
501 log << MSG::DEBUG << "BTCorrOff1 id =" << id << " bunch number=" << whichBunch
502 << " TCorrOffset1=" << tCorrOffset1 << " 1=" << poff1[0] << " 2=" << poff1[1]
503 << " 3=" << poff1[2] << " 4=" << poff1[3] << " 5=" << poff1[4] << " 6=" << poff1[5]
504 << " 7=" << poff1[6] << " 8=" << poff1[7] << " 9=" << poff1[8] << endmsg;
505
506 return tCorrOffset1;
507}
const unsigned int nBarParOff

Referenced by BTime1().

◆ BTCorrOffset2()

const double TofCaliSvc::BTCorrOffset2 ( double zHit,
unsigned int id,
double t0 )

Definition at line 509 of file TofCaliSvc.cxx.

509 {
510 MsgStream log( msgSvc(), name() );
511
512 int numBunch = fTofInfoCal[m_sequence].getRunEnd();
513 int whichBunch =
514 ( static_cast<int>( t0 / ( 12000. / 499.8 / ( numBunch * 1.0 ) ) + 0.1 ) ) % numBunch;
515
516 double poff2[nBarParOff];
517 if ( whichBunch == 0 )
518 {
519 for ( int i = 0; i < static_cast<int>( nBarParOff ); i++ )
520 { poff2[i] = fBTofCal[176 * m_sequence + id].getPOff2_bunch0( i ); }
521 }
522 else if ( whichBunch == 1 )
523 {
524 for ( int i = 0; i < static_cast<int>( nBarParOff ); i++ )
525 { poff2[i] = fBTofCal[176 * m_sequence + id].getPOff2_bunch1( i ); }
526 }
527 else if ( whichBunch == 2 )
528 {
529 for ( int i = 0; i < static_cast<int>( nBarParOff ); i++ )
530 { poff2[i] = fBTofCal[176 * m_sequence + id].getPOff2_bunch2( i ); }
531 }
532 else if ( whichBunch == 3 )
533 {
534 for ( int i = 0; i < static_cast<int>( nBarParOff ); i++ )
535 { poff2[i] = fBTofCal[176 * m_sequence + id].getPOff2_bunch3( i ); }
536 }
537
538 double tCorrOffset2 = 0.0;
539 if ( z >= 0.0 )
540 {
541 tCorrOffset2 = poff2[0] + poff2[1] * z + poff2[2] * z * z + poff2[3] * z * z * z +
542 poff2[4] * z * z * z * z + poff2[5] * z * z * z * z * z +
543 poff2[6] * z * z * z * z * z * z;
544 }
545 else
546 {
547 tCorrOffset2 = poff2[10] + poff2[11] * z + poff2[12] * z * z + poff2[13] * z * z * z +
548 poff2[14] * z * z * z * z + poff2[15] * z * z * z * z * z +
549 poff2[16] * z * z * z * z * z * z;
550 }
551
552 log << MSG::DEBUG << "BTCorrOff2 id =" << id << " bunch number=" << whichBunch
553 << " TCorrOffset2=" << tCorrOffset2 << " 1=" << poff2[0] << " 2=" << poff2[1]
554 << " 3=" << poff2[2] << " 4=" << poff2[3] << " 5=" << poff2[4] << " 6=" << poff2[5]
555 << " 7=" << poff2[6] << " 8=" << poff2[7] << " 9=" << poff2[8] << endmsg;
556
557 return tCorrOffset2;
558}

Referenced by BTime2().

◆ BTDelay1()

const double TofCaliSvc::BTDelay1 ( unsigned int id)

Definition at line 388 of file TofCaliSvc.cxx.

388 {
389 double tdelay = 0.0;
390 if ( id < 176 ) { tdelay = fBTofCal[176 * m_sequence + id].getP1( 0 ); }
391 else
392 {
393 MsgStream log( msgSvc(), name() );
394 log << MSG::ERROR << "TofCaliSvc::BTDelay1() -- Wrong TOFID is provided! ID = " << id
395 << endmsg;
396 }
397 return tdelay;
398}

◆ BTDelay2()

const double TofCaliSvc::BTDelay2 ( unsigned int id)

Definition at line 400 of file TofCaliSvc.cxx.

400 {
401 double tdelay = 0.0;
402 if ( id < 176 ) { tdelay = fBTofCal[176 * m_sequence + id].getP2( 0 ); }
403 else
404 {
405 MsgStream log( msgSvc(), name() );
406 log << MSG::ERROR << "TofCaliSvc::BTDelay2() -- Wrong TOFID is provided! ID = " << id
407 << endmsg;
408 }
409 return tdelay;
410}

◆ BTime1()

const double TofCaliSvc::BTime1 ( double ADC,
double TDC,
double zHit,
unsigned int id,
double t0 )

Definition at line 565 of file TofCaliSvc.cxx.

565 {
566 MsgStream log( msgSvc(), name() );
567
568 double tcorr1 = BTCorr1( ADC, z, id );
569 double tcorr2 = BTCorrOffset1( z, id, t0 );
570 double tcorr3 = fBTofCommonCal[m_sequence].getOffset( 0 );
571
572 log << MSG::DEBUG << "BTime1 id =" << id << " tcorr=" << tcorr1 << " toffset=" << tcorr2
573 << " total offset=" << tcorr3 << endmsg;
574
575 double time = TDC - tcorr1 - tcorr2 - tcorr3;
576
577 if ( time < 0. )
578 {
579 log << MSG::WARNING << "TofCaliSvc::BTime1() -- A minus time is given : " << time
580 << " [Input] ADC = " << ADC << " TDC = " << TDC << " z = " << z << " ID = " << id
581 << endmsg;
582 }
583 return time;
584}
Double_t time
const double BTCorrOffset1(double zHit, unsigned int id, double t0)
const double BTCorr1(double ADC, double zHit, unsigned int id)

◆ BTime2()

const double TofCaliSvc::BTime2 ( double ADC,
double TDC,
double zHit,
unsigned int id,
double t0 )

Definition at line 586 of file TofCaliSvc.cxx.

586 {
587 MsgStream log( msgSvc(), name() );
588
589 double tcorr1 = BTCorr2( ADC, z, id );
590 double tcorr2 = BTCorrOffset2( z, id, t0 );
591 double tcorr3 = fBTofCommonCal[m_sequence].getOffset( 0 );
592
593 log << MSG::DEBUG << "BTime2 id =" << id << " tcorr=" << tcorr1 << " toffset=" << tcorr2
594 << " total offset=" << tcorr3 << endmsg;
595
596 double time = TDC - tcorr1 - tcorr2 - tcorr3;
597
598 if ( time < 0. )
599 {
600 log << MSG::WARNING << "TofCaliSvc::BTime2() -- A minus time is given : " << time
601 << " [Input] ADC = " << ADC << " TDC = " << TDC << " z = " << z << " ID = " << id
602 << endmsg;
603 }
604 return time;
605}
const double BTCorrOffset2(double zHit, unsigned int id, double t0)
const double BTCorr2(double ADC, double zHit, unsigned int id)

◆ BTimeCluster()

const double TofCaliSvc::BTimeCluster ( double tlayer1,
double tlayer2,
double z1,
double z2,
unsigned int id1,
unsigned int id2 )

Definition at line 649 of file TofCaliSvc.cxx.

650 {
651
652 double sigmaCorr = fBTofCommonCal[m_sequence].getSigmaCorr( 0 );
653 double sigmaCorr2 = sigmaCorr * sigmaCorr;
654
655 double sigmaInner = BSigmaCounter( z1, id1 );
656 double sigmaInner2 = sigmaInner * sigmaInner;
657 double sigmaOuter = BSigmaCounter( z2, id2 );
658 double sigmaOuter2 = sigmaOuter * sigmaOuter;
659
660 double fraction =
661 ( sigmaOuter2 - sigmaCorr2 ) / ( sigmaInner2 + sigmaOuter2 - 2.0 * sigmaCorr2 );
662
663 double wt = fraction * tlayer1 + ( 1.0 - fraction ) * tlayer2;
664 if ( wt < 0. )
665 {
666 MsgStream log( msgSvc(), name() );
667 log << MSG::WARNING << "TofCaliSvc::BTimeCluster() -- A minus time is given : " << wt
668 << " [Input] z1 = " << z1 << " [Input] z2 = " << z2 << " ID1 = " << id1
669 << " ID2=" << id2 << endmsg;
670 }
671 return wt;
672}

◆ BTimeCounter()

const double TofCaliSvc::BTimeCounter ( double tleft,
double tright,
double z,
unsigned int id )

Definition at line 625 of file TofCaliSvc.cxx.

625 {
626
627 double sigmaCorr = fBTofCommonCal[m_sequence].getSigmaCorr( 0 );
628 double sigmaCorr2 = sigmaCorr * sigmaCorr;
629
630 double sigmaLeft = BSigma1( z, id );
631 double sigmaLeft2 = sigmaLeft * sigmaLeft;
632 double sigmaRight = BSigma2( z, id );
633 double sigmaRight2 = sigmaRight * sigmaRight;
634
635 double fraction =
636 ( sigmaRight2 - sigmaCorr2 ) / ( sigmaLeft2 + sigmaRight2 - 2.0 * sigmaCorr2 );
637
638 double wt = fraction * tleft + ( 1.0 - fraction ) * tright;
639 if ( wt < 0. )
640 {
641 MsgStream log( msgSvc(), name() );
642 log << MSG::WARNING << "TofCaliSvc::BTimeCounter() -- A minus time is given : " << wt
643 << " [Input] z = " << z << " ID = " << id << endmsg;
644 }
645
646 return wt;
647}
const double BSigma1(double zHit, unsigned int id)
const double BSigma2(double zHit, unsigned int id)

◆ BTof()

const BTofCal * TofCaliSvc::BTof ( unsigned int id) const

Definition at line 1162 of file TofCaliSvc.cxx.

1162 {
1163 return &fBTofCal[176 * m_sequence + id];
1164}

Referenced by Dump().

◆ BTofCommon()

const BTofCommonCal * TofCaliSvc::BTofCommon ( ) const

Definition at line 1174 of file TofCaliSvc.cxx.

1174{ return &fBTofCommonCal[m_sequence]; }

◆ BVeff()

const double TofCaliSvc::BVeff ( unsigned int id)

Definition at line 1010 of file TofCaliSvc.cxx.

1010 {
1011 if ( id < 176 ) { return fBTofCal[176 * m_sequence + id].getVeff( 0 ); }
1012 else
1013 {
1014 std::cout << "bad id=" << id << std::endl;
1015 return 0.;
1016 }
1017}

◆ chooseConstants()

StatusCode TofCaliSvc::chooseConstants ( int run,
int number )

Definition at line 295 of file TofCaliSvc.cxx.

295 {
296
297 MsgStream log( msgSvc(), name() );
298
299 m_sequence = 0;
300 bool filled = false;
301 unsigned int inumber = 0;
302
303 std::vector<TofInfoCal>::iterator it = fTofInfoCal.begin();
304 if ( ( *it ).getRunFrom() == -1 )
305 {
306 if ( fTofInfoCal.size() == 1 )
307 {
308 log << MSG::INFO
309 << "TofCaliSvc::chooseConstants() -- Run From is equal to -1! The ONLY TOF "
310 "calibration constants are used!"
311 << endmsg;
312 return StatusCode::SUCCESS;
313 }
314 else
315 {
316 log << MSG::ERROR
317 << "TofCaliSvc::chooseConstants() -- Run From is equal to -1! The NUMBER of "
318 "calibration constants are NOT "
319 "equal "
320 "to 1!"
321 << endmsg;
322 return StatusCode::FAILURE;
323 }
324 }
325
326 for ( ; it != fTofInfoCal.end(); it++, inumber++ )
327 {
328 if ( ( ( *it ).getRunTo() != -1 ) && ( ( *it ).getRunTo() < ( *it ).getRunFrom() ) )
329 {
330 log << MSG::ERROR << "TofCaliSvc::chooseConstants() -- The " << inumber
331 << "th calibration constatns is ABNORMAL! Run From is LARGER than RUN To!" << endmsg;
332 return StatusCode::FAILURE;
333 }
334 if ( ( ( *it ).getRunFrom() == ( *it ).getRunTo() ) && ( ( *it ).getEventFrom() != -1 ) &&
335 ( ( *it ).getEventTo() != -1 ) && ( ( *it ).getEventFrom() > ( *it ).getEventTo() ) )
336 {
337 log << MSG::ERROR << "TofCaliSvc::chooseConstants() -- The " << inumber
338 << "th calibration constatns is ABNORMAL! Event From is LARGER than Event To!"
339 << endmsg;
340 return StatusCode::FAILURE;
341 }
342 }
343
344 it = fTofInfoCal.begin();
345 inumber = 0;
346 for ( ; it != fTofInfoCal.end(); it++, inumber++ )
347 {
348 int runFrom = ( *it ).getRunFrom();
349 int runTo = ( *it ).getRunTo();
350 int eventFrom = ( *it ).getEventFrom();
351 int eventTo = ( *it ).getEventTo();
352 if ( ( run == runFrom ) && ( ( eventFrom == -1 ) || ( event >= eventFrom ) ) )
353 {
354 if ( ( run < runTo ) ||
355 ( ( run == runTo ) && ( ( eventTo == -1 ) || ( event <= eventTo ) ) ) )
356 {
357 filled = true;
358 break;
359 }
360 }
361 if ( run > runFrom )
362 {
363 if ( ( run < runTo ) ||
364 ( ( run == runTo ) && ( ( eventTo == -1 ) || ( event <= eventTo ) ) ) )
365 {
366 filled = true;
367 break;
368 }
369 }
370 }
371
372 if ( filled )
373 {
374 m_sequence = inumber;
375 return StatusCode::SUCCESS;
376 }
377 else
378 {
379 log << MSG::ERROR << "TofCaliSvc::chooseConstants() -- The event with run number " << run
380 << " and event number " << event
381 << " is NOT suitable for this group of calibration constants" << endmsg;
382 return StatusCode::FAILURE;
383 }
384
385 return StatusCode::SUCCESS;
386}

◆ Dump()

void TofCaliSvc::Dump ( )

Definition at line 1178 of file TofCaliSvc.cxx.

1178 {
1179 std::cout << "Now We can get the TOF Calibtration Service" << std::endl;
1180 std::cout << "Barrel TOF Counter Number = " << fBTofCal.size() << std::endl;
1181 std::cout << "Endcap TOF Counter Number = " << fETofCal.size() << std::endl;
1182
1183 cout << "The O Barrel TOF PMT1 p1[0] is"
1184 << " " << BTof( 0 )->getP1( 0 ) << endl;
1185 cout << "The 0 Barrel TOF PMT1 p1[1] is"
1186 << " " << BTof( 0 )->getP1( 1 ) << endl;
1187 cout << "The 0 Barrel TOF veff is"
1188 << " " << BTof( 0 )->getVeff( 0 ) << endl;
1189 // cout<<"The 22rd Endcap TOF PMT veff is"<<" "<<ETof(22)->getVeff()<<endl;
1190}
const BTofCal * BTof(unsigned int id) const

Referenced by main().

◆ EAtten()

const double TofCaliSvc::EAtten ( unsigned int id)

Definition at line 1124 of file TofCaliSvc.cxx.

1124 {
1125 if ( id > 95 ) return -1;
1126 return fETofCal[96 * m_sequence + id].getAtten( 0 );
1127}

◆ EGain()

const double TofCaliSvc::EGain ( unsigned int id)

Definition at line 1129 of file TofCaliSvc.cxx.

1129 {
1130 if ( id > 95 ) return -1;
1131 return fETofCal[96 * m_sequence + id].getAtten( 1 );
1132}

◆ Endcap()

const int TofCaliSvc::Endcap ( unsigned int No)

Definition at line 1154 of file TofCaliSvc.cxx.

1154 {
1155 return fTofInfoCal[m_sequence].getEndcap( im );
1156}

◆ EPh()

const double TofCaliSvc::EPh ( double ADC,
double rHit,
unsigned int id )

Definition at line 996 of file TofCaliSvc.cxx.

996 {
997 double length = 44.5;
998 double a0 = fETofCal[96 * m_sequence + id].getAtten( 0 );
999 double a1 = fETofCal[96 * m_sequence + id].getAtten( 1 );
1000 double a2 = fETofCal[96 * m_sequence + id].getAtten( 2 );
1001 double q0 = ADC * TMath::Exp( -( a0 + a1 * ( rHit - length ) +
1002 a2 * ( rHit - length ) * ( rHit - length ) ) );
1003 return q0;
1004}
character *LEPTONflag integer iresonances real zeta5 real a0

◆ EPulseHeight()

const double TofCaliSvc::EPulseHeight ( double ADC,
double rHit,
double cost,
unsigned int id )

Definition at line 980 of file TofCaliSvc.cxx.

981 {
982 double length = 44.5;
983 double a0 = fETofCal[96 * m_sequence + id].getAtten( 0 );
984 double a1 = fETofCal[96 * m_sequence + id].getAtten( 1 );
985 double a2 = fETofCal[96 * m_sequence + id].getAtten( 2 );
986 double a3 = fETofCal[96 * m_sequence + id].getAtten( 3 );
987
988 double q0 =
989 ADC * fabs( cost ) *
990 TMath::Exp( -( a1 * ( rHit - length ) + a2 * ( rHit - length ) * ( rHit - length ) ) ) /
991 a3;
992
993 return q0;
994}

◆ ESigma()

const double TofCaliSvc::ESigma ( double rHit,
unsigned int id )

Definition at line 760 of file TofCaliSvc.cxx.

760 {
761 MsgStream log( msgSvc(), name() );
762
763 double fp[nEndSigma];
764 for ( int i = 0; i < static_cast<int>( nEndSigma ); i++ )
765 { fp[i] = fETofCal[96 * m_sequence + id].getFPCounter( i ); }
766
767 log << MSG::DEBUG << "ESigma id =" << id << " 1=" << fp[0] << " 2=" << fp[1]
768 << " 3=" << fp[2] << endmsg;
769
770 double sigma = fp[0] + fp[1] * r + fp[2] * r * r;
771
772 return sigma;
773}
const unsigned int nEndSigma

◆ ETDelay()

const double TofCaliSvc::ETDelay ( unsigned int id)

Definition at line 412 of file TofCaliSvc.cxx.

412 {
413 double tdelay = 0.0;
414 if ( id < 96 ) { tdelay = fETofCal[96 * m_sequence + id].getP( 0 ); }
415 else
416 {
417 MsgStream log( msgSvc(), name() );
418 log << MSG::ERROR << "TofCaliSvc::ETDelay() -- Wrong TOFID is provided! ID = " << id
419 << endmsg;
420 }
421 return tdelay;
422}

◆ Etf()

const int TofCaliSvc::Etf ( unsigned int No)

Definition at line 1158 of file TofCaliSvc.cxx.

1158 {
1159 return fTofInfoCal[m_sequence].getEndcap( im );
1160}

◆ EtfBunchP()

const double TofCaliSvc::EtfBunchP ( int index)

Definition at line 930 of file TofCaliSvc.cxx.

930 {
931 MsgStream log( msgSvc(), name() );
932
933 double pbunch = 0.0;
934 if ( fEtfBunchCal.size() > 0 && index >= 0 && index < 4 )
935 { pbunch = fEtfBunchCal[m_sequence].getBunchP( index ); }
936
937 return pbunch;
938}

Referenced by EtfTime1(), and EtfTime2().

◆ EtfTime() [1/2]

const double TofCaliSvc::EtfTime ( double ADC1,
double ADC2,
double TDC1,
double TDC2,
unsigned int id,
unsigned int strip,
double t0 )

◆ EtfTime() [2/2]

const double TofCaliSvc::EtfTime ( double tleft,
double tright )

Definition at line 920 of file TofCaliSvc.cxx.

920 {
921 MsgStream log( msgSvc(), name() );
922
923 double time = ( tleft + tright ) / 2.0;
924 log << MSG::DEBUG << "EtfTime tleft=" << tleft << " tright=" << tright << " time=" << time
925 << endmsg;
926
927 return time;
928}

◆ EtfTime1()

const double TofCaliSvc::EtfTime1 ( double ADC,
double TDC,
double zHit,
unsigned int id,
unsigned int strip,
double t0 )

Definition at line 805 of file TofCaliSvc.cxx.

806 {
807 MsgStream log( msgSvc(), name() );
808
809 double p1[nEtfPar];
810 for ( int i = 0; i < static_cast<int>( nEtfPar ); i++ )
811 { p1[i] = fEtfCal[72 * 12 * m_sequence + 12 * id + strip].getP1( i ); }
812
813 double tcorr1 = p1[0] + p1[1] / TMath::Sqrt( ADC ) + p1[2] * ADC + p1[3] * ADC * ADC +
814 p1[4] * ADC * ADC * ADC + p1[5] * ADC * ADC * ADC * ADC +
815 p1[6] * z / TMath::Sqrt( ADC ) + p1[7] / ADC + p1[8] * z / ADC +
816 p1[9] * z * ADC + p1[10] * z + p1[11] * z * z + p1[12] * z * z * z;
817 double time1 = TDC - tcorr1;
818
819 int numBunch = fTofInfoCal[m_sequence].getRunEnd();
820 int ibunch =
821 ( static_cast<int>( t0 / ( 12000. / 499.8 / ( numBunch * 1.0 ) ) + 0.1 ) ) % numBunch;
822 double pbunch = EtfBunchP( ibunch );
823
824 time1 = time1 - pbunch;
825
826 log << MSG::DEBUG << "EtfTime1 module =" << id << " strip=" << strip << " 1=" << p1[0]
827 << " 2=" << p1[1] << " 3=" << p1[2] << " 4=" << p1[3] << " 5=" << p1[4] << " 6=" << p1[5]
828 << " 7=" << p1[6] << " 8=" << p1[7] << " 9=" << p1[8] << " tcorr=" << tcorr1
829 << " t0=" << t0 << " pbunch=" << pbunch << " time1=" << time1 << endmsg;
830
831 return time1;
832}
const unsigned int nEtfPar
const double EtfBunchP(int index)

◆ EtfTime2()

const double TofCaliSvc::EtfTime2 ( double ADC,
double TDC,
double zHit,
unsigned int id,
unsigned int strip,
double t0 )

Definition at line 834 of file TofCaliSvc.cxx.

835 {
836 MsgStream log( msgSvc(), name() );
837
838 double p2[nEtfPar];
839 for ( int i = 0; i < static_cast<int>( nEtfPar ); i++ )
840 { p2[i] = fEtfCal[72 * 12 * m_sequence + 12 * id + strip].getP2( i ); }
841
842 double tcorr2 = p2[0] + p2[1] / TMath::Sqrt( ADC ) + p2[2] * ADC + p2[3] * ADC * ADC +
843 p2[4] * ADC * ADC * ADC + p2[5] * ADC * ADC * ADC * ADC +
844 p2[6] * z / TMath::Sqrt( ADC ) + p2[7] / ADC + p2[8] * z / ADC +
845 p2[9] * z * ADC + p2[10] * z + p2[11] * z * z + p2[12] * z * z * z;
846 double time2 = TDC - tcorr2;
847
848 int numBunch = fTofInfoCal[m_sequence].getRunEnd();
849 int ibunch =
850 ( static_cast<int>( t0 / ( 12000. / 499.8 / ( numBunch * 1.0 ) ) + 0.1 ) ) % numBunch;
851 double pbunch = EtfBunchP( ibunch );
852
853 time2 = time2 - pbunch;
854
855 log << MSG::DEBUG << "EtfTime2 module =" << id << " strip=" << strip << " 1=" << p2[0]
856 << " 2=" << p2[1] << " 3=" << p2[2] << " 4=" << p2[3] << " 5=" << p2[4] << " 6=" << p2[5]
857 << " 7=" << p2[6] << " 8=" << p2[7] << " 9=" << p2[8] << " tcorr=" << tcorr2
858 << " t0=" << t0 << " pbunch=" << pbunch << " time2=" << time2 << endmsg;
859
860 return time2;
861}

◆ EtfTimeMC()

const double TofCaliSvc::EtfTimeMC ( double ADC1,
double ADC2,
double TDC1,
double TDC2,
unsigned int id,
unsigned int strip,
double t0 )

Definition at line 863 of file TofCaliSvc.cxx.

864 {
865 MsgStream log( msgSvc(), name() );
866
867 double q = ( ADC1 + ADC2 ) / 2.0;
868 double t = ( TDC1 + TDC2 ) / 2.0;
869
870 double p[nEtfPar];
871 for ( int i = 0; i < static_cast<int>( nEtfPar ); i++ )
872 { p[i] = fEtfCal[72 * 12 * m_sequence + 12 * id + strip].getP( i ); }
873
874 double tcorr = p[0] + p[1] / TMath::Sqrt( q );
875 double time = t - tcorr;
876
877 log << MSG::DEBUG << "EtfTime module =" << id << " strip=" << strip << " 1=" << p[0]
878 << " 2=" << p[1] << " tcorr=" << tcorr << " t0=" << t0 << " time=" << time
879 << endmsg;
880
881 return time;
882}
int t()
Definition t.c:1

◆ EtfTimeMC1()

const double TofCaliSvc::EtfTimeMC1 ( double ADC,
double TDC,
double zHit,
unsigned int id,
unsigned int strip,
double t0 )

Definition at line 884 of file TofCaliSvc.cxx.

885 {
886 MsgStream log( msgSvc(), name() );
887
888 double p1[nEtfPar];
889 for ( int i = 0; i < static_cast<int>( nEtfPar ); i++ )
890 { p1[i] = fEtfCal[72 * 12 * m_sequence + 12 * id + strip].getP1( i ); }
891
892 double tcorr1 = p1[0] + p1[1] / TMath::Sqrt( ADC ) + p1[2] * z;
893 double time1 = TDC - tcorr1;
894
895 log << MSG::DEBUG << "EtfTime1 module =" << id << " strip=" << strip << " 1=" << p1[0]
896 << " 2=" << p1[1] << " 3=" << p1[2] << " tcorr=" << tcorr1 << " t0=" << t0
897 << " time1=" << time1 << endmsg;
898
899 return time1;
900}

◆ EtfTimeMC2()

const double TofCaliSvc::EtfTimeMC2 ( double ADC,
double TDC,
double zHit,
unsigned int id,
unsigned int strip,
double t0 )

Definition at line 902 of file TofCaliSvc.cxx.

903 {
904 MsgStream log( msgSvc(), name() );
905
906 double p2[nEtfPar];
907 for ( int i = 0; i < static_cast<int>( nEtfPar ); i++ )
908 { p2[i] = fEtfCal[72 * 12 * m_sequence + 12 * id + strip].getP2( i ); }
909
910 double tcorr2 = p2[0] + p2[1] / TMath::Sqrt( ADC ) + p2[2] * z;
911 double time2 = TDC - tcorr2;
912
913 log << MSG::DEBUG << "EtfTime2 module =" << id << " strip=" << strip << " 1=" << p2[0]
914 << " 2=" << p2[1] << " 3=" << p2[2] << " tcorr=" << tcorr2 << " t0=" << t0
915 << " time2=" << time2 << endmsg;
916
917 return time2;
918}

◆ EtfTof()

const EtfCal * TofCaliSvc::EtfTof ( unsigned int id) const

Definition at line 1170 of file TofCaliSvc.cxx.

1170 {
1171 return &fEtfCal[72 * 12 * m_sequence + id];
1172}

◆ EtfVeff()

const double TofCaliSvc::EtfVeff ( unsigned int id,
unsigned int strip )

Definition at line 1042 of file TofCaliSvc.cxx.

1042 {
1043 if ( id < 72 && strip < 12 )
1044 { return fEtfCal[72 * 12 * m_sequence + 12 * id + strip].getVeff( 0 ); }
1045 else
1046 {
1047 std::cout << "bad id=" << id << " strip=" << strip << std::endl;
1048 return 0.;
1049 }
1050}

◆ EtfZTDC()

const double TofCaliSvc::EtfZTDC ( double tleft,
double tright,
unsigned int id,
unsigned int strip )

Definition at line 1114 of file TofCaliSvc.cxx.

1115 {
1116 double ztdc = -1000.0;
1117 if ( id > 71 || strip > 11 ) return ztdc;
1118 double delay = fEtfCal[72 * 12 * m_sequence + 12 * id + strip].getVeff( 0 );
1119 double veff = fEtfCal[72 * 12 * m_sequence + 12 * id + strip].getVeff( 1 );
1120 ztdc = ( tright - tleft - delay ) / veff;
1121 return ztdc;
1122}

◆ ETime()

const double TofCaliSvc::ETime ( double ADC,
double TDC,
double rHit,
unsigned int id )

Definition at line 736 of file TofCaliSvc.cxx.

736 {
737 MsgStream log( msgSvc(), name() );
738
739 double p[nEndPar];
740 for ( int i = 0; i < static_cast<int>( nEndPar ); i++ )
741 { p[i] = fETofCal[96 * m_sequence + id].getP( i ); }
742
743 log << MSG::DEBUG << "ETime id =" << id << " 1=" << p[0] << " 2=" << p[1] << " 3=" << p[2]
744 << " 4=" << p[3] << " 5=" << p[4] << " 6=" << p[5] << " 7=" << p[6] << endmsg;
745
746 double time = TDC - ( p[0] + p[1] / TMath::Sqrt( ADC ) + p[2] / ADC + p[3] * ADC +
747 p[4] * rHit + p[5] * rHit * rHit + p[6] * rHit * rHit * rHit );
748
749 if ( time < 0. )
750 {
751 MsgStream log( msgSvc(), name() );
752 log << MSG::WARNING << "TofCaliSvc::ETime() -- A minus time is given : " << time
753 << " [Input] ADC = " << ADC << " TDC = " << TDC << " r = " << rHit << " ID = " << id
754 << endmsg;
755 }
756
757 return time;
758}
const unsigned int nEndPar

◆ ETof()

const ETofCal * TofCaliSvc::ETof ( unsigned int id) const

Definition at line 1166 of file TofCaliSvc.cxx.

1166 {
1167 return &fETofCal[96 * m_sequence + id];
1168}

◆ EVeff()

const double TofCaliSvc::EVeff ( unsigned int id)

Definition at line 1037 of file TofCaliSvc.cxx.

1037 {
1038 if ( id > 175 ) return -1;
1039 return fETofCal[96 * m_sequence + id].getVeff( 0 );
1040}

◆ EventFrom()

const int TofCaliSvc::EventFrom ( )

◆ EventTo()

const int TofCaliSvc::EventTo ( )

◆ finalize()

StatusCode TofCaliSvc::finalize ( )
virtual

Definition at line 84 of file TofCaliSvc.cxx.

84 {
85 MsgStream log( msgSvc(), name() );
86 log << MSG::INFO << name() << ": End of Run" << endmsg;
87 return StatusCode::SUCCESS;
88}

◆ getQ0()

const double TofCaliSvc::getQ0 ( unsigned int id)

Definition at line 1006 of file TofCaliSvc.cxx.

1006 {
1007 return fBTofCal[176 * m_sequence + id].getAtten( 3 );
1008}

◆ handle()

void TofCaliSvc::handle ( const Incident & inc)

Definition at line 1192 of file TofCaliSvc.cxx.

1192 {
1193 MsgStream log( msgSvc(), name() );
1194 log << MSG::DEBUG << "handle: " << inc.type() << endmsg;
1195
1196 if ( inc.type() == "NewRun" )
1197 {
1198 log << MSG::DEBUG << "New Run" << endmsg;
1199 // if(!m_hasbeeninitialized){
1200
1201 StatusCode sc = FillfromDatabase();
1202 if ( sc.isSuccess() ) { m_hasbeeninitialized = true; }
1203 // }
1204 }
1205}

◆ initialize()

StatusCode TofCaliSvc::initialize ( )
virtual

Definition at line 51 of file TofCaliSvc.cxx.

51 {
52 m_hasbeeninitialized = false;
53 m_sequence = 0;
54
55 MsgStream log( msgSvc(), name() );
56 log << MSG::INFO << name() << ": Start of run initialisation" << endmsg;
57
58 StatusCode sc = Service::initialize();
59 if ( sc.isFailure() ) return sc;
60
61 IIncidentSvc* incsvc;
62 sc = service( "IncidentSvc", incsvc );
63 int priority = 100;
64 if ( sc.isSuccess() ) { incsvc->addListener( this, "NewRun", priority ); }
65
66 StatusCode scc;
67
68 log << MSG::INFO << "setProperties()" << endmsg;
69 scc = service( "CalibDataSvc", m_pCalibDataSvc, true );
70 if ( !scc.isSuccess() )
71 {
72 log << MSG::ERROR << "Could not get IDataProviderSvc interface of CalibXmlCnvSvc"
73 << endmsg;
74 return scc;
75 }
76 else
77 { log << MSG::DEBUG << "Retrieved IDataProviderSvc interface of CalibXmlCnvSvc" << endmsg; }
78 // Get properties from the JobOptionsSvc
79 // scc = setProperties();
80
81 return sc;
82}

Referenced by main().

◆ MisLable()

const int TofCaliSvc::MisLable ( )

Definition at line 1144 of file TofCaliSvc.cxx.

1144{ return fTofInfoCal[m_sequence].getMisLable(); }

◆ QCorr()

const int TofCaliSvc::QCorr ( )

Definition at line 1140 of file TofCaliSvc.cxx.

1140{ return fTofInfoCal[m_sequence].getQCorr(); }

◆ QElec()

const int TofCaliSvc::QElec ( )

Definition at line 1142 of file TofCaliSvc.cxx.

1142{ return fTofInfoCal[m_sequence].getQElec(); }

◆ RunBegin()

const int TofCaliSvc::RunBegin ( )

Definition at line 1134 of file TofCaliSvc.cxx.

1134{ return fTofInfoCal[m_sequence].getRunBegin(); }

◆ RunEnd()

const int TofCaliSvc::RunEnd ( )

Definition at line 1136 of file TofCaliSvc.cxx.

1136{ return fTofInfoCal[m_sequence].getRunEnd(); }

◆ RunFrom()

const int TofCaliSvc::RunFrom ( )

◆ RunTo()

const int TofCaliSvc::RunTo ( )

◆ TOffset()

const double TofCaliSvc::TOffset ( )

Definition at line 560 of file TofCaliSvc.cxx.

560 {
561 double toffset = fBTofCommonCal[m_sequence].getOffset( 0 );
562 return toffset;
563}

◆ TofInfo()

const TofInfoCal * TofCaliSvc::TofInfo ( ) const

Definition at line 1176 of file TofCaliSvc.cxx.

1176{ return &fTofInfoCal[m_sequence]; }

◆ Version()

const int TofCaliSvc::Version ( )

Definition at line 1138 of file TofCaliSvc.cxx.

1138{ return fTofInfoCal[m_sequence].getVersion(); }

◆ ZADC()

const double TofCaliSvc::ZADC ( double qleft,
double qright,
unsigned int id )

Definition at line 1081 of file TofCaliSvc.cxx.

1081 {
1082 double zadc = -1000.0;
1083 if ( id > 175 ) return zadc;
1084 if ( qright < 1.0e-6 ) return zadc;
1085 double ldecay = fBTofCal[176 * m_sequence + id].getAtten( 0 );
1086 double a1overa2 = fBTofCal[176 * m_sequence + id].getAtten( 1 );
1087 double q1overq2 = log( qleft / qright );
1088 zadc = 0.5 * ldecay * ( q1overq2 - a1overa2 );
1089 return zadc;
1090}

◆ ZADC1()

const double TofCaliSvc::ZADC1 ( double qright,
unsigned int id,
double z )

Definition at line 1092 of file TofCaliSvc.cxx.

1092 {
1093 double qleft = -1000.0;
1094 if ( id > 175 ) return qleft;
1095 if ( qright < 1.0e-6 ) return qleft;
1096 double ldecay = fBTofCal[176 * m_sequence + id].getAtten( 0 );
1097 double a1overa2 = fBTofCal[176 * m_sequence + id].getAtten( 1 );
1098 double q1overq2 = 2.0 * z / ldecay + a1overa2;
1099 qleft = qright * exp( q1overq2 );
1100 return qleft;
1101}
EvtComplex exp(const EvtComplex &c)

◆ ZADC2()

const double TofCaliSvc::ZADC2 ( double qleft,
unsigned int id,
double z )

Definition at line 1103 of file TofCaliSvc.cxx.

1103 {
1104 double qright = -1000.0;
1105 if ( id > 175 ) return qright;
1106 if ( qleft < 1.0e-6 ) return qright;
1107 double ldecay = fBTofCal[176 * m_sequence + id].getAtten( 0 );
1108 double a1overa2 = fBTofCal[176 * m_sequence + id].getAtten( 1 );
1109 double q1overq2 = 2.0 * z / ldecay + a1overa2;
1110 qright = qleft * exp( -q1overq2 );
1111 return qright;
1112}

◆ ZTDC()

const double TofCaliSvc::ZTDC ( double tleft,
double tright,
unsigned int id )

Definition at line 1052 of file TofCaliSvc.cxx.

1052 {
1053 double ztdc = -1000.0;
1054 if ( id > 175 ) return ztdc;
1055 double veff = fBTofCal[176 * m_sequence + id].getVeff( 0 );
1056 double delay = fBTofCal[176 * m_sequence + id].getVeff( 1 );
1057 ztdc = 0.5 * veff * ( tright - tleft - delay );
1058 return ztdc;
1059}

◆ ZTDC1()

const double TofCaliSvc::ZTDC1 ( double tright,
unsigned int id,
double z )

Definition at line 1061 of file TofCaliSvc.cxx.

1061 {
1062 double tleft = -1000.0;
1063 if ( id > 175 ) return tleft;
1064 if ( tright < -900.0 ) return tleft;
1065 double veff = fBTofCal[176 * m_sequence + id].getVeff( 0 );
1066 double delay = fBTofCal[176 * m_sequence + id].getVeff( 1 );
1067 tleft = tright - delay - 2.0 * z / veff;
1068 return tleft;
1069}

◆ ZTDC2()

const double TofCaliSvc::ZTDC2 ( double tleft,
unsigned int id,
double z )

Definition at line 1071 of file TofCaliSvc.cxx.

1071 {
1072 double tright = -1000.0;
1073 if ( id > 175 ) return tright;
1074 if ( tleft < -900.0 ) return tright;
1075 double veff = fBTofCal[176 * m_sequence + id].getVeff( 0 );
1076 double delay = fBTofCal[176 * m_sequence + id].getVeff( 1 );
1077 tright = tleft + delay + 2.0 * z / veff;
1078 return tright;
1079}

The documentation for this class was generated from the following files: