ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitCommon/OptIO/src/OptLoad.cc
Revision: 1.3
Committed: Thu Feb 26 16:18:07 2009 UTC (16 years, 2 months ago) by loizides
Content type: text/plain
Branch: MAIN
CVS Tags: Mit_008pre1
Changes since 1.2: +11 -7 lines
Log Message:
Added more docu.

File Contents

# User Rev Content
1 loizides 1.3 // $Id: OptLoad.cc,v 1.2 2009/02/24 20:13:57 loizides Exp $
2 loizides 1.1
3     #include "MitCommon/OptIO/interface/OptInt.h"
4     #include <TROOT.h>
5     #include <TSystem.h>
6     #include <TError.h>
7     #include <TEnv.h>
8     #include <Riostream.h>
9    
10     using namespace mithep;
11    
12     //--------------------------------------------------------------------------------------------------
13     namespace {
14     class OptIntLoad {
15     public:
16     OptIntLoad() {
17 loizides 1.3 Int_t verbose = gEnv->GetValue("Root.OptIO.Verbose",0);
18     if(verbose)
19     ::Info("OptIntLoad", "Loading libMitCommonOptIO.so for the optimized IO interface.");
20 loizides 1.1 Int_t zipmode = gEnv->GetValue("Root.ZipMode",-1);
21     if (zipmode>0) {
22 loizides 1.3 if(verbose)
23     ::Warning("OptIntLoad", "Setting ZipMode to %d as specified in rootrc", zipmode);
24 loizides 1.1 OptInt::SetZipMode(zipmode);
25     }
26     Double_t lzf = gEnv->GetValue("Root.OptIO.LzoFraction",1.);
27     Double_t gzf = gEnv->GetValue("Root.OptIO.GzipFraction",1.);
28     Double_t bzf = gEnv->GetValue("Root.OptIO.BzipFraction",1.);
29 loizides 1.2 Double_t lzm = gEnv->GetValue("Root.OptIO.LzmaFraction",1.);
30     if (lzf!=1 || gzf!= 1 || bzf!=1 || lzm!=1) {
31 loizides 1.3 if(verbose)
32     ::Warning("OptIntLoad", "Setting algo fractions to %.2f, %.2f, %.2f, %.2f"
33     " as specified in rootrc", lzf, gzf, bzf, lzm);
34 loizides 1.2 OptInt::SetAlgoFractions(lzf, gzf, bzf, lzm);
35 loizides 1.1 }
36     Int_t smalloc = gEnv->GetValue("Root.OptIO.SMalloc",0);
37     if (smalloc) {
38 loizides 1.3 if(verbose)
39     ::Warning("OptIntLoad", "Enabling static memory allocation as specified in rootrc");
40 loizides 1.1 OptInt::SetStaticMalloc(smalloc==1);
41     }
42     if (verbose) {
43     ::Warning("OptIntLoad", "Setting verbosity to %d as specified in rootrc", verbose);
44     OptInt::SetVerbose(verbose);
45     }
46     }
47     };
48     OptIntLoad dummy;
49     }