00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #include "TGo4TreeStoreParameter.h"
00017
00018 #include "Riostream.h"
00019
00020 #include "Go4EventServerTypes.h"
00021 #include "TGo4Status.h"
00022 #include "TGo4Log.h"
00023
00024 TGo4TreeStoreParameter::TGo4TreeStoreParameter(const char* name,
00025 Int_t splitlevel,
00026 Int_t bufsize,
00027 const char* filename,
00028 Int_t compression)
00029 : TGo4EventStoreParameter(name, GO4EV_TREE),
00030 fiSplit(splitlevel), fiBufsize(bufsize), fiCompression(compression)
00031 {
00032 TRACE((14,"TGo4TreeStoreParameter::TGo4TreeStoreParameter(Text_t*,...)", __LINE__, __FILE__));
00033 if(filename) fxBranchFile = filename;
00034 else fxBranchFile="";
00035 }
00036
00037 TGo4TreeStoreParameter::TGo4TreeStoreParameter()
00038 : TGo4EventStoreParameter("default go4 treestore", GO4EV_TREE),
00039 fiSplit(1), fiBufsize(64000), fiCompression(5), fxBranchFile("")
00040 {
00041 TRACE((14,"TGo4TreeStoreParameter::TGo4TreeStoreParameter()", __LINE__, __FILE__));
00042
00043
00044 }
00045
00046
00047 TGo4TreeStoreParameter::~TGo4TreeStoreParameter()
00048 {
00049 TRACE((14,"TGo4TreeStoreParameter::~TGo4TreeStoreParameter()", __LINE__, __FILE__));
00050 }
00051
00052 Int_t TGo4TreeStoreParameter::PrintParameter(Text_t* buffer, Int_t buflen)
00053 {
00054 TRACE((12,"TGo4TreeStoreParameter::PrintParameter()",__LINE__, __FILE__));
00055 Int_t locallen=128000;
00056 Text_t localbuf[128000];
00057 if(buflen<0 && buffer!=0)
00058 return 0;
00059 Int_t size=0;
00060 Text_t* current=localbuf;
00061 Int_t restlen=locallen;
00062 Int_t delta=TGo4EventStoreParameter::PrintParameter(current,restlen);
00063 restlen-=delta;
00064 current+=delta;
00065 current=TGo4Status::PrintIndent(current,restlen);
00066 current=TGo4Status::PrintBuffer(current,restlen, " Split level: \t%d \n",fiSplit);
00067 current=TGo4Status::PrintIndent(current,restlen);
00068 current=TGo4Status::PrintBuffer(current,restlen, " Compression level: \t%d \n",fiCompression);
00069 current=TGo4Status::PrintIndent(current,restlen);
00070 current=TGo4Status::PrintBuffer(current,restlen, " Buffer size: \t%d \n",fiBufsize);
00071 if(!fxBranchFile.IsNull()) {
00072 current=TGo4Status::PrintIndent(current,restlen);
00073 current=TGo4Status::PrintBuffer(current,restlen, " Branch file name: \t%s \n",fxBranchFile.Data());
00074 }
00075 if(buffer==0)
00076 {
00077 cout << localbuf << endl;
00078 }
00079 else
00080 {
00081 size=locallen-restlen;
00082 if(size>buflen-1)
00083 size=buflen-1;
00084 strncpy(buffer,localbuf,size);
00085 }
00086 return size;
00087 }
00088
00089 Bool_t TGo4TreeStoreParameter::UpdateFrom(TGo4Parameter* rhs)
00090 {
00091 TRACE((12,"TGo4TreeStoreParameter::UpdateFrom()",__LINE__, __FILE__));
00092 if((rhs!=0) && rhs->InheritsFrom(TGo4TreeStoreParameter::Class()))
00093 {
00094 TGo4TreeStoreParameter* treepar=dynamic_cast<TGo4TreeStoreParameter*>(rhs);
00095 if(!treepar) return kFALSE;
00096 if(!TGo4EventStoreParameter::UpdateFrom(rhs)) return kFALSE;
00097 fiSplit=treepar->fiSplit;
00098 fiBufsize=treepar->fiBufsize;
00099 fiCompression=treepar->fiCompression;
00100 return kTRUE;
00101 }
00102 else
00103 {
00104 return kFALSE;
00105 }
00106 return kFALSE;
00107 }
00108
00109