/[PAMELA software]/yoda/event/PamelaRun.h
ViewVC logotype

Annotation of /yoda/event/PamelaRun.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 6.1 - (hide annotations) (download)
Wed Mar 8 13:51:45 2006 UTC (18 years, 8 months ago) by kusanagi
Branch: MAIN
CVS Tags: YODA6_2/01, YODA6_2/00, YODA6_3/10, YODA6_3/06, YODA6_1/00, YODA6_3/04, YODA6_3/05, YODA6_3/07, YODA6_3/00, YODA6_3/01, YODA6_3/02, YODA6_3/03, YODA6_3/08, YODA6_3/09
Changes since 6.0: +9 -3 lines
File MIME type: text/plain
Update: add the -o option to allow the bypass of the YODA_DATA environment variable

1 kusanagi 1.1 /** @file
2 kusanagi 2.0 * $Source: /home/cvsmanager/yoda/event/PamelaRun.h,v $
3 kusanagi 6.1 * $Id: PamelaRun.h,v 6.0 2006/02/07 17:11:07 kusanagi Exp $
4 kusanagi 6.0 * $Author: kusanagi $
5 kusanagi 1.1 *
6     * Header file for the PamelaRun class.
7     */
8     /*! \mainpage Yoda
9     * <H1> Yet anOther Data Analysis package</H1>
10     * YODA is the proposed data processing and analysis package for
11     * <A HREF="http://wizard.roma2.infn.it/pamela/fram_des.htm">Pamela</A>.
12     * Aditionally to the automatically generated information, there is a short
13     * tutorial available:
14     * <H2> <A HREF="yoda1.html">Installation</A></H2>
15     * <H2> <A HREF="yoda2.html">General terminology</A></H2>
16     * <H2> <A HREF="yoda3.html">Directory and file structure</A></H2>
17     * <H2> <A HREF="yoda4.html">Code organization</A></H2>
18     * <H2> <A HREF="yoda5.html">Interactive analysis</A></H2>
19     * <H2> <A HREF="yoda6.html">Existing subpackets</A></H2>
20     * <H2> <A HREF="yoda7.html">Writing new subpackets</A></H2>
21     * <H2> <A HREF="yoda8.html">Writing Algorithms</A></H2>
22 kusanagi 4.1 * <H2> <A HREF="yoda9.html">Bibliography</A></H2>
23 kusanagi 1.1 *
24     */
25     #ifndef PAMELA_RUN_H
26     #define PAMELA_RUN_H
27    
28 kusanagi 5.1
29 kusanagi 1.1 #include <TFile.h> //Substituted by Maurizio 05 Feb 2004
30     #include <TTree.h> //Substituted by Maurizio 05 Feb 2004
31     #include <TChain.h> //Substituted by Maurizio 05 Feb 2004
32    
33     #include "Algorithm.h"
34     #include "EventHeader.h"
35     #include "RunInfo.h"
36 kusanagi 5.1 #include <list>
37 kusanagi 1.1
38     /**
39     * pamela is the base namespace of this package.
40     */
41     namespace pamela {
42     class Algorithm;
43     /**
44     * Base class for a "Run", that is used for reading and writing
45     * data to the ROOT files in pamela.
46     */
47     class PamelaRun {
48     private:
49 kusanagi 2.1 std::stringstream oss;
50 kusanagi 1.1 /**
51     * The path to the bases of the ROOT repository.
52     */
53 kusanagi 6.1 std::string Path;
54     /**
55     * The path to the bases for Unpacking.
56     */
57     std::string UnpackPath;
58 kusanagi 1.1 /**
59     * The run name;
60     */
61     std::string Run;
62     /**
63     * The run number.
64     */
65     int RunNumber;
66     /**
67 kusanagi 5.1 * compression Level.
68     */
69     short compression;
70     /**
71     * Multiple/Single unpack.
72     */
73     bool Multiple;
74     /**
75     * single File.
76     */
77     TFile *SingleFile;
78     /**
79 kusanagi 1.1 * The information about the run to be stored in the ROOT files
80     */
81     pamela::RunInfo info;
82 kusanagi 2.1 void RunExists(std::string) throw (std::exception);
83 kusanagi 1.1 std::string GetDirName(const pamela::PacketType*) const;
84 kusanagi 2.1 std::string GetFileName(const pamela::SubPacket*, std::string) ;
85     std::string GetFileName(const pamela::SubPacket*) ;
86 kusanagi 1.1 TChain* ReadHeaderTree(const pamela::PacketType*) throw (std::exception);
87     TTree* CreateTTree(pamela::Algorithm*, const pamela::SubPacket*, std::string name)
88     throw (std::exception);
89    
90     protected:
91     /**
92     * A map used to store ROOT trees distinguished by the packet type.
93     */
94     typedef std::map<const pamela::PacketType*, TTree*> RootTreeMap;
95     /**
96     * A map of all opened header ROOT trees, sorted by the
97     * PacketType. The trees will have mounted all other trees of the
98     * same package type as friends.
99     */
100     RootTreeMap TTreeMap; //!
101     /**
102     * A list of ROOT TFiles.
103     */
104     typedef std::list<TFile *> TFileList;
105     /**
106     * A list of ROOT TTrees.
107     */
108     typedef std::list<TTree *> TTreeList;
109     /**
110     * A map of Root Tree lists, with their packet type as key.
111     */
112     typedef std::map<const pamela::PacketType*, TTreeList> TTreeListMap;
113     /**
114     * The map of lists of all ROOT TTrees, sorted by the packet type.
115     */
116     TTreeListMap WritingRootTrees; //!
117     /**
118     * A map that contains subpacket objects sorted by their names.
119     */
120     typedef std::map<std::string, pamela::SubPacket*> SubPacketMap;
121     /**
122     * The map of all subpackets that are currently read from the trees.
123     */
124     SubPacketMap SubPacketAddresses;
125 kusanagi 2.1
126    
127 kusanagi 1.1
128     public:
129 kusanagi 5.1 PamelaRun(std::string, std::string, bool, short);
130 kusanagi 1.1 static std::string GetRunName(int run);
131     //static int RunExists(int = 1) throw (std::exception);
132    
133     /**
134     * Get the run number.
135     */
136     int GetRunNumber(void) const { return RunNumber; }
137     TTree* ReadTTree(pamela::PacketType const *);
138     void ReadSubPacket(void *);
139     void ReadSubPacket(void *, std::string);
140     void ReadSubPacket(const pamela::Algorithm*, void*);
141     void ReadSubPacket(const pamela::Algorithm*, void*, std::string);
142     void WriteSubPacket(pamela::Algorithm*, void*, const TClass*);
143     void WriteSubPacket(pamela::Algorithm*, void*, const TClass*, std::string);
144     void WriteHeaders(pamela::Algorithm*, pamela::EventHeader **);
145     void WriteHeader(pamela::Algorithm*, pamela::EventHeader**, const pamela::PacketType*); // 23/11/2002 maurizio mede it from private to public
146     void WriteFiles(void);
147     void FillTrees(const pamela::PacketType*);
148     std::string GetRun(){ return Run; }
149 kusanagi 6.1 std::string GetPath(){ return Path; }
150     std::string GetUnpackPath(){ return UnpackPath; }
151     ClassDef(PamelaRun, 3)
152 kusanagi 1.1 };
153     }
154    
155     #endif /* PAMELA_RUN_H */

  ViewVC Help
Powered by ViewVC 1.1.23