ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitCommon/OptIO/src/OptLoad.cc
Revision: 1.1
Committed: Tue Feb 24 11:56:42 2009 UTC (16 years, 2 months ago) by loizides
Content type: text/plain
Branch: MAIN
Log Message:
Preload lib for compression improvements.

File Contents

# User Rev Content
1 loizides 1.1 // $Id: Types.cc,v 1.1 2008/09/27 05:44:11 loizides Exp $
2    
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     ::Info("OptIntLoad", "Loading libMitCommonOptIO.so for the optimized IO interface.");
18     Int_t zipmode = gEnv->GetValue("Root.ZipMode",-1);
19     if (zipmode>0) {
20     ::Warning("OptIntLoad", "Setting ZipMode to %d as specified in rootrc", zipmode);
21     OptInt::SetZipMode(zipmode);
22     }
23     Double_t lzf = gEnv->GetValue("Root.OptIO.LzoFraction",1.);
24     Double_t gzf = gEnv->GetValue("Root.OptIO.GzipFraction",1.);
25     Double_t bzf = gEnv->GetValue("Root.OptIO.BzipFraction",1.);
26     if (lzf!=1 || gzf!= 1 || bzf!=1 ) {
27     ::Warning("OptIntLoad", "Setting algo fractions to %f %f %f as specified in rootrc",
28     lzf, gzf, bzf);
29     OptInt::SetAlgoFractions(lzf, gzf, bzf);
30     }
31     Int_t smalloc = gEnv->GetValue("Root.OptIO.SMalloc",0);
32     if (smalloc) {
33     ::Warning("OptIntLoad", "Enabling static memory allocation as specified in rootrc");
34     OptInt::SetStaticMalloc(smalloc==1);
35     }
36     Int_t verbose = gEnv->GetValue("Root.OptIO.Verbose",0);
37     if (verbose) {
38     ::Warning("OptIntLoad", "Setting verbosity to %d as specified in rootrc", verbose);
39     OptInt::SetVerbose(verbose);
40     }
41     }
42     };
43     OptIntLoad dummy;
44     }