00001 /* 00002 * TSTSHit.cxx 00003 * 00004 * Created on: Jan 9, 2012 00005 * Author: isorokin 00006 */ 00007 00008 #include "TSTSHit.h" 00009 00010 00011 TSTSHit::~TSTSHit() 00012 { 00013 if( fClusters[0] ) delete fClusters[0]; 00014 if( fClusters[1] ) delete fClusters[1]; 00015 } 00016 00017 00018 00019 Long64_t TSTSHit::GetTime() const 00020 { 00021 if( fClusters[0] && fClusters[1] ) return ( ( fClusters[0]->GetTime() - fClusters[1]->GetTime() ) / 2 + fClusters[1]->GetTime() ); 00022 return 0; 00023 } 00024 00025 00026 00027 Long64_t TSTSHit::GetTimeLength() const 00028 { 00029 if( ! fClusters[0] || ! fClusters[1] ) { 00030 printf("ERROR: THit::GetTimeLength() invoked for non-initialized hit!\n"); 00031 return -100; 00032 } 00033 Long64_t diff = fClusters[0]->GetTime() - fClusters[1]->GetTime(); 00034 return diff; 00035 // if( diff < 0 ) return - diff; 00036 // return diff; 00037 } 00038 00039 00040 00041 void TSTSHit::Print() const 00042 { 00043 printf( "===== HIT ======"); 00044 fClusters[0]->Print(); 00045 fClusters[1]->Print(); 00046 }