ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
LArCalorimeter
LArG4
LArG4ShowerLib
src
ShowerLibList.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
/*
6
* ShowerLibList.cpp
7
*
8
* Created on: Mar 24, 2011
9
* Author: sedov
10
*/
11
12
#include "
LArG4ShowerLib/ShowerLibList.h
"
13
#include <vector>
14
15
16
// list of all libraries
17
#include "
LArG4ShowerLib/EtaEnergyShowerLib.h
"
18
#include "
LArG4ShowerLib/TestShowerLib.h
"
19
#include "
LArG4ShowerLib/FCALDistEnergyShowerLib.h
"
20
#include "
LArG4ShowerLib/FCALDistEtaEnergyShowerLib.h
"
21
22
namespace
ShowerLib
{
23
24
typedef
IShowerLib
* (*readTTree)(TFile*);
25
typedef
std::vector<readTTree>
vectorTTree
;
26
typedef
IShowerLib
* (*readStruct)(
const
std::string&);
27
typedef
std::vector<readStruct>
vectorStruct
;
28
29
vectorTTree
vectorTTreeFull
()
30
{
31
vectorTTree
ttreeVector;
32
33
// List all TTree reader functions
34
ttreeVector.push_back(&(
EtaEnergyShowerLib::readFromROOTFile
));
35
ttreeVector.push_back(&(
FCALDistEnergyShowerLib::readFromROOTFile
));
36
ttreeVector.push_back(&(
FCALDistEtaEnergyShowerLib::readFromROOTFile
));
37
ttreeVector.push_back(&(
TestShowerLib::readFromROOTFile
));
38
39
return
ttreeVector;
40
}
41
42
vectorStruct
vectorStructFull
()
43
{
44
vectorStruct
structVector;
45
46
// List all Struct reader functions
47
structVector.push_back(&(
EtaEnergyShowerLib::createEmptyLib
));
48
structVector.push_back(&(
FCALDistEnergyShowerLib::createEmptyLib
));
49
structVector.push_back(&(
FCALDistEtaEnergyShowerLib::createEmptyLib
));
50
structVector.push_back(&(
TestShowerLib::createEmptyLib
));
51
52
return
structVector;
53
}
54
55
IShowerLib
*
iterateTTree
(TFile *fname)
56
{
57
IShowerLib
* library =
nullptr
;
58
vectorTTree
ttreeVector =
vectorTTreeFull
();
59
vectorTTree::const_iterator libiter;
60
for
(libiter = ttreeVector.begin(); libiter != ttreeVector.end(); ++libiter) {
61
library = (**libiter)(fname);
62
if
(library !=
nullptr
)
break
;
63
}
64
return
library;
65
}
66
67
IShowerLib
*
iterateStruct
(
const
std::string & fname)
68
{
69
IShowerLib
* library =
nullptr
;
70
vectorStruct
structVector =
vectorStructFull
();
71
vectorStruct::const_iterator libiter;
72
for
(libiter = structVector.begin(); libiter != structVector.end(); ++libiter) {
73
library = (**libiter)(fname);
74
if
(library !=
nullptr
)
break
;
75
}
76
return
library;
77
}
78
}
EtaEnergyShowerLib.h
FCALDistEnergyShowerLib.h
FCALDistEtaEnergyShowerLib.h
ShowerLibList.h
TestShowerLib.h
ShowerLib::EtaEnergyShowerLib::createEmptyLib
static IShowerLib * createEmptyLib(const std::string &inputFile)
factory method. create empty library with the given structure. returns NULL if file is invalid.
Definition
EtaEnergyShowerLib.cxx:62
ShowerLib::EtaEnergyShowerLib::readFromROOTFile
static IShowerLib * readFromROOTFile(TFile *source)
factory method. create a library from root file. returns NULL if file is invalid.
Definition
EtaEnergyShowerLib.cxx:36
ShowerLib::FCALDistEnergyShowerLib::readFromROOTFile
static IShowerLib * readFromROOTFile(TFile *source)
factory method. create a library from root file. returns NULL if file is invalid.
Definition
FCALDistEnergyShowerLib.cxx:53
ShowerLib::FCALDistEnergyShowerLib::createEmptyLib
static IShowerLib * createEmptyLib(const std::string &inputFile)
factory method. create empty library with the given structure. returns NULL if file is invalid.
Definition
FCALDistEnergyShowerLib.cxx:79
ShowerLib::FCALDistEtaEnergyShowerLib::createEmptyLib
static IShowerLib * createEmptyLib(const std::string &inputFile)
factory method. create empty library with the given structure. returns NULL if file is invalid.
Definition
FCALDistEtaEnergyShowerLib.cxx:94
ShowerLib::FCALDistEtaEnergyShowerLib::readFromROOTFile
static IShowerLib * readFromROOTFile(TFile *source)
factory method. create a library from root file. returns NULL if file is invalid.
Definition
FCALDistEtaEnergyShowerLib.cxx:56
ShowerLib::IShowerLib
Class for shower library shower lib interface.
Definition
IShowerLib.h:40
ShowerLib::TestShowerLib::createEmptyLib
static IShowerLib * createEmptyLib(const std::string &inputFile)
factory method. create empty library with the given structure. returns NULL if file is invalid.
Definition
TestShowerLib.cxx:67
ShowerLib::TestShowerLib::readFromROOTFile
static IShowerLib * readFromROOTFile(TFile *source)
factory method. create a library from root file. returns NULL if file is invalid.
Definition
TestShowerLib.cxx:41
ShowerLib
Namespace for the ShowerLib related classes.
Definition
StepInfo.h:17
ShowerLib::vectorTTree
std::vector< readTTree > vectorTTree
Definition
ShowerLibList.cxx:25
ShowerLib::vectorTTreeFull
vectorTTree vectorTTreeFull()
Definition
ShowerLibList.cxx:29
ShowerLib::vectorStruct
std::vector< readStruct > vectorStruct
Definition
ShowerLibList.cxx:27
ShowerLib::vectorStructFull
vectorStruct vectorStructFull()
Definition
ShowerLibList.cxx:42
ShowerLib::iterateStruct
IShowerLib * iterateStruct(const std::string &fname)
Definition
ShowerLibList.cxx:67
ShowerLib::iterateTTree
IShowerLib * iterateTTree(TFile *fname)
Definition
ShowerLibList.cxx:55
Generated on
for ATLAS Offline Software by
1.17.0