source: JEM-EUSO/esaf_lal/tags/v1_r0/esaf/macros/tools/PhP2PhPRoot.C @ 117

Last change on this file since 117 was 117, checked in by moretto, 11 years ago

ESAF version compilable on mac OS

File size: 1.6 KB
Line 
1// $Id: PhP2PhPRoot.C 2031 2005-07-10 19:54:57Z thea $
2// Author: A.Thea 2005/07/05
3
4/*****************************************************************************
5 * ESAF: Euso Simulation and Analysis Framework                              *
6 *                                                                           *
7 *  Id: PhP2PhPRoot                                                          *
8 *  Package: Macros                                                          *
9 *  Coordinator: Alessandro.Thea                                             *
10 *                                                                           *
11 *****************************************************************************/
12
13void PhP2PhPRoot( const char* in, const char* out, Double_t r=3000 ) {
14
15    Config::Get()->Reset();
16
17    EEvent* ev =  new EEvent();
18    EEvent::SetCurrent(ev);
19
20    std::string key;
21    std::string value;
22
23    key = "FileUnisimLightToEuso";
24    value = key+".fFileName="+in;
25    Config::Get()->AddUserDefinition(key,value);
26
27    value = key+".fFirstEvent=0";
28    Config::Get()->AddUserDefinition(key,value);
29
30    key = "PhPToRootFileDetector";
31    value = key+".fFileName="+out; 
32    Config::Get()->AddUserDefinition(key,value);
33
34    value = key+".fRadius="+Form("%f",r);
35    Config::Get()->AddUserDefinition(key,value);
36
37    LightToEuso* light = new FileUnisimLightToEuso();
38    Detector* det = new PhPToRootFileDetector();
39
40    while( kTRUE ) {
41        PhotonsOnPupil* php = light->Get( det->GetGeometry() );
42
43        if (!php) break;
44
45        det->Reset();
46        det->Get(php);
47    } 
48
49    delete det;
50    delete light;
51    delete ev;
52}
53       
Note: See TracBrowser for help on using the repository browser.