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

UberHit.cxx

Go to the documentation of this file.
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 }//end UberHit(UShort_t, UShort_t)
00032 //_______________________________________________________________________________
00033 UberHit::~UberHit()
00034 {nuberhit--;}//end ~UberHit()
00035 //_______________________________________________________________________________
00036 void UberHit::SetPlaneStrip(UShort_t p, UShort_t s)
00037 {
00038   plane = p;
00039   strip =s ;
00040   
00041 }//end SetPlaneStrip()
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 {//se is stripend, rest of parameters are obvious
00047   //for near detector electronics, we want to do a +=, except for time,
00048   //which we will take to be the first time.
00049 
00050   MSG("UberHit",Msg::kDebug)<<"In UberHit AddValues"<<endl;
00051   if(se==StripEnd::kPositive){ //if se==+, fill the p values
00052     if(padc==0){//if we havent filled padc yet, we want to fill time with the 
00053                 //time of this hit
00054       ptime = time;
00055       pagg = pmtagg;
00056     }
00057     //added 9-29-2003
00058     if(time<ptime){
00059        ptime = time;
00060     }
00061     padc += adc;
00062     psiglin += siglin;
00063     pnpe += npe;
00064     pmip += mip;
00065     pbckt++;
00066     // ptime += time;
00067     //pagg += pmtagg;
00068   }
00069   else if(se==StripEnd::kNegative){ //if se==-, fill n values
00070     if(nadc==0){//if we havent filled nadc yet, we want to fill time with the 
00071                 //time of this hit
00072       ntime = time;
00073       nagg = pmtagg;
00074     }
00075     //added 9-29-2003
00076     if(time<ntime){
00077        ntime = time;
00078     }
00079     nadc += adc;
00080     nsiglin += siglin;
00081     nnpe += npe;
00082     nmip += mip;
00083     nbckt++;
00084     //    ntime += time;
00085     //   nagg += pmtagg;
00086   }
00087   else{//somethings gone wrong
00088     MSG("UberUberHit",Msg::kWarning)<<"Strip end unknown, not filling"<<endl;
00089   }
00090 
00091   return;
00092 }//end AddValues()
00093 //_______________________________________________________________________________
00094 void UberHit::Print(Option_t* /* option */) 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 }//end Print()
00107 //_______________________________________________________________________________
00108 
00109 
00110 
00111 
00112 
00113 
00114 
00115 
00116 

Generated on Mon Feb 15 11:07:47 2010 for loon by  doxygen 1.3.9.1