Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

CellHit.cxx

Go to the documentation of this file.
00001 
00002 // $Id: CellHit.cxx,v 1.5 2007/11/27 21:17:52 scavan Exp $
00003 //
00004 // CellHit class
00005 //
00006 // shanahan@fnal.gov
00007 //
00009 
00010 #include "RecoBase/CellHit.h"
00011 #include "JobControl/Exception.h"
00012 #include <string>
00013 #include <iostream>
00014 
00015 using namespace recobase;
00016 
00017 ClassImp(CellHit);
00018 
00019 //----------------------------------------------------------------------
00020 
00021 CellHit::CellHit() : 
00022   fADC(0)
00023  ,fPE(0)
00024  ,fMIP(0)
00025  ,fTDC(0)
00026  ,fTNS(0)
00027  ,fTT0(0)
00028  ,fStatus(0)
00029  ,fChannel(0)
00030 {
00031 
00032 }
00033 
00034 //----------------------------------------------------------------------
00035 CellHit::CellHit(unsigned int channel, unsigned int adc, unsigned int tdc) : 
00036   fADC(adc)
00037  ,fPE(0)
00038  ,fMIP(0)
00039  ,fTDC(tdc)
00040  ,fTNS(0)
00041  ,fTT0(0)
00042  ,fStatus(0)
00043  ,fChannel(channel)
00044 {
00045   fStatus|=1<<kRAW; // set the status bits for ADC and TDC
00046 
00047 }
00048 
00049 CellHit::~CellHit()
00050 {
00051 
00052 }
00053 
00054 bool CellHit::ADC(unsigned short &a)  
00055 {
00056    a=0;
00057    if (!(fStatus&1<<kRAW)) return false; 
00058    a=fADC;
00059    return true;
00060 
00061 }
00062 
00063 bool CellHit::PE(float &a) 
00064 {
00065    a=-999;
00066    if (!(fStatus&1<<kPE)) return false; 
00067    a=fPE; 
00068    return true;
00069 }
00070 
00071 bool CellHit::PEAC(float &a) 
00072 {
00073    a=-999;
00074    if (!(fStatus&1<<kPEAC)) return false; 
00075    a=fPEAC; 
00076    return true;
00077 }
00078 
00079 bool CellHit::MIP(float &a)
00080 {
00081    a=-999;
00082    if (!(fStatus&1<<kMIP)) return false; 
00083    a=fMIP; 
00084    return true;
00085 }  
00086 
00087 bool CellHit::TDC(unsigned short &t) 
00088 {
00089    t=0;
00090    if (!(fStatus&1<<kRAW)) return false; 
00091    t=fTDC; 
00092    return true;
00093 }
00094 
00095 bool CellHit::TNS(double &t)
00096 {
00097    t=-9e9;
00098    if (!(fStatus&1<<kTNS)) return false; 
00099    t=fTNS; 
00100    return true;
00101 }
00102 
00103 bool CellHit::TT0(double &t)
00104 {
00105    t=-9e9;
00106    if (!(fStatus&1<<kTT0)) return false; 
00107    t=fTT0; 
00108    return true;
00109 }
00110 
00111 bool CellHit::TTrans(double &t)
00112 {
00113    t=-9e9;
00114    if (!(fStatus&1<<kTTrans)) return false; 
00115    t=fTTrans; 
00116    return true;
00117 }
00118 
00119 

Generated on Thu Sep 4 02:05:26 2008 for NOvA Offline by doxygen 1.3.5