1 | // $Id: MakePixelMapPhotonFile.C 2941 2011-06-22 13:48:02Z naumov $ |
---|
2 | // Author: A.Thea 2005/04/19 |
---|
3 | |
---|
4 | /***************************************************************************** |
---|
5 | * ESAF: Euso Simulation and Analysis Framework * |
---|
6 | * * |
---|
7 | * Id: MakePixelMapPhotonFile * |
---|
8 | * Package: Macros * |
---|
9 | * Coordinator: Alessandro.Thea * |
---|
10 | * * |
---|
11 | *****************************************************************************/ |
---|
12 | |
---|
13 | /* #include "EsafConfigurable.hh" |
---|
14 | #include "Config.hh" |
---|
15 | #include "EsafMsgSource.hh" |
---|
16 | #include "EsafMsgDispatcher.hh" |
---|
17 | #include "TString.h" |
---|
18 | #include "PixelMapBuilder.hh" |
---|
19 | */ |
---|
20 | |
---|
21 | //______________________________________________________________________________ |
---|
22 | void MakePixelMapPhotonFile( const char* name=0 ) { |
---|
23 | // |
---|
24 | // Builds the pixlemap photons file according the current config |
---|
25 | // |
---|
26 | |
---|
27 | if ( name ) { |
---|
28 | TString key = "PixelMapBuilder"; |
---|
29 | TString value = key+".fRootFileName = "+name; |
---|
30 | Config::Get()->AddUserDefinition(std::string(key),std::string(value)); |
---|
31 | } |
---|
32 | EsafMsgDispatcher::Get()->SetScreenSeverity(EsafMsg::Debug); |
---|
33 | |
---|
34 | PixelMapBuilder builder; |
---|
35 | Long64_t n = builder.Conf()->GetNum("PixelMapBuilder.fNumPhotons"); |
---|
36 | string filename = builder.Conf()->GetStr("PixelMapBuilder.fRootFileName"); |
---|
37 | // builder.SetSaveHistograms((filename+"_histos").c_str()); // DN save histos |
---|
38 | builder.MakePhotonsFile(filename.c_str(),n); |
---|
39 | // EGViewer *display = new EGViewer; |
---|
40 | // builder.SetDisplay(display); |
---|
41 | |
---|
42 | builder.MakeMap(filename.c_str(),(filename+"map").c_str()); |
---|
43 | |
---|
44 | // builder.OpenRoot(name); |
---|
45 | // builder.Go(); |
---|
46 | // builder.CloseRoot(); |
---|
47 | } |
---|
48 | |
---|
49 | //______________________________________________________________________________ |
---|
50 | void MakeUserPixelMapPhotonFile( const char* name=0, const char* usercfg=0 ) { |
---|
51 | // |
---|
52 | // Builds the pixlemap photons file according the user config |
---|
53 | // |
---|
54 | |
---|
55 | if ( usercfg ) { |
---|
56 | cout << "User config file " << usercfg << " loaded" << endl; |
---|
57 | Config::Get()->LoadUserConfig(usercfg); |
---|
58 | } |
---|
59 | |
---|
60 | MakePixelMapPhotonFile( name ); |
---|
61 | } |
---|