00001 #include "TObject.h"
00002 #include "MessageService/MsgService.h"
00003 #include "CalDetDST/UberHit.h"
00004
00005 ClassImp(UberHit)
00006
00007 CVSID("$Id: UberHit.cxx,v 1.7 2005/05/03 11:15:44 minoscvs Exp $");
00008 using namespace std;
00009 int UberHit::nuberhit =0;
00010
00011 UberHit::UberHit():
00012 plane(0),
00013 strip(0),
00014 padc(0),
00015 nadc(0),
00016 psiglin(0.),
00017 nsiglin(0.),
00018 pnpe(0.),
00019 nnpe(0.),
00020 pmip(0.),
00021 nmip(0.),
00022 ptime(0.),
00023 ntime(0.),
00024 pagg(0),
00025 nagg(0),
00026 pbckt(0),
00027 nbckt(0)
00028 {
00029 MSG("UberHit",Msg::kDebug)<<"In UberHit creator"<<endl;
00030 nuberhit++;
00031 }
00032
00033 UberHit::~UberHit()
00034 {nuberhit--;}
00035
00036 void UberHit::SetPlaneStrip(UShort_t p, UShort_t s)
00037 {
00038 plane = p;
00039 strip =s ;
00040
00041 }
00042
00043 void UberHit::AddValues(StripEnd::StripEnd_t se,
00044 Int_t adc, Float_t siglin, Float_t npe,
00045 Float_t mip, Float_t time, Int_t pmtagg)
00046 {
00047
00048
00049
00050 MSG("UberHit",Msg::kDebug)<<"In UberHit AddValues"<<endl;
00051 if(se==StripEnd::kPositive){
00052 if(padc==0){
00053
00054 ptime = time;
00055 pagg = pmtagg;
00056 }
00057
00058 if(time<ptime){
00059 ptime = time;
00060 }
00061 padc += adc;
00062 psiglin += siglin;
00063 pnpe += npe;
00064 pmip += mip;
00065 pbckt++;
00066
00067
00068 }
00069 else if(se==StripEnd::kNegative){
00070 if(nadc==0){
00071
00072 ntime = time;
00073 nagg = pmtagg;
00074 }
00075
00076 if(time<ntime){
00077 ntime = time;
00078 }
00079 nadc += adc;
00080 nsiglin += siglin;
00081 nnpe += npe;
00082 nmip += mip;
00083 nbckt++;
00084
00085
00086 }
00087 else{
00088 MSG("UberUberHit",Msg::kWarning)<<"Strip end unknown, not filling"<<endl;
00089 }
00090
00091 return;
00092 }
00093
00094 void UberHit::Print(Option_t* ) const
00095 {
00096 cout<<"________________________________________________"<<endl;
00097 cout<<"Plane "<<plane<<" Strip "<<strip<<endl
00098 <<"Pos adc "<<padc<<" Neg adc "<<nadc<<endl
00099 <<"Pos Sig Lin "<<psiglin<<" Neg SigLin "<<nsiglin<<endl
00100 <<"Pos npe "<<pnpe<<" Neg npe "<<nnpe<<endl
00101 <<"Pos mip "<<pmip<<" Neg mip "<<nmip<<endl
00102 <<"Pos time "<<ptime<<" Neg time "<<ntime<<endl
00103 <<"Pos agg "<<hex<<pagg<<dec<<" Neg agg "<<hex<<nagg<<dec
00104 <<"Pos num. buckets "<<pbckt<<" Neg num. buckets "<<nbckt<<endl;
00105
00106 }
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116