/[PAMELA software]/PamelaLevel2/inc/PamLevel2.h
ViewVC logotype

Annotation of /PamelaLevel2/inc/PamLevel2.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.12 - (hide annotations) (download)
Tue Jan 16 15:26:45 2007 UTC (17 years, 10 months ago) by mocchiut
Branch: MAIN
Changes since 1.11: +9 -2 lines
File MIME type: text/plain
Added method UpdateRunInfo to synchronize reading of events and runs (see example3.C)

1 pam-fi 1.1
2    
3     /**
4     * \file PamLevel2.h
5     * \author Elena Vannuccini
6     */
7     #ifndef pamlevel2_h
8     #define pamlevel2_h
9    
10 pam-fi 1.2 #include <TRefArray.h>
11 pam-fi 1.1
12 pam-fi 1.4 #include <TrkLevel1.h>
13 pam-fi 1.1 #include <TrkLevel2.h>
14 pam-fi 1.6 #include <TrkHough.h>
15     #include <CaloLevel1.h>
16 pam-fi 1.1 #include <CaloLevel2.h>
17     #include <ToFLevel2.h>
18     #include <TrigLevel2.h>
19     #include <S4Level2.h>
20     #include <NDLevel2.h>
21     #include <AcLevel2.h>
22 pam-fi 1.2 #include <OrbitalInfo.h>
23 pam-fi 1.4 #include <RunInfo.h>
24     #include <GLTables.h>
25    
26 pam-fi 1.1
27     #include <TTree.h>
28 pam-fi 1.7 #include <TFriendElement.h>
29 pam-fi 1.2 #include <TChain.h>
30 pam-fi 1.1 #include <TFile.h>
31 pam-fi 1.2 #include <TList.h>
32     #include <TKey.h>
33     #include <TSystemFile.h>
34     #include <TSystemDirectory.h>
35 pam-fi 1.1
36     #include <iostream>
37     using namespace std;
38    
39     /**
40     * \brief Class to describe particle tracks in the apparatus, including tracker and track-related variables from other detectors (calorimeter and TOF).
41     *
42     * This class inherites from TrkTrack, CaloTrkVar ecc...
43     *
44     */
45 pam-fi 1.10 //class PamTrack : public TrkTrack, public CaloTrkVar, public ToFTrkVar {
46     class PamTrack : public TObject {
47 pam-fi 1.1
48     private:
49    
50     TrkTrack* trk_track;
51     CaloTrkVar* calo_track;
52     ToFTrkVar* tof_track;
53    
54 pam-fi 1.10 bool candeleteobj;
55    
56     // TClonesArray *Cluster; ///< clusters (if stored)
57    
58 pam-fi 1.1 public:
59    
60     PamTrack();
61 pam-fi 1.10 PamTrack(TrkTrack* , CaloTrkVar* , ToFTrkVar* );
62     PamTrack(const PamTrack&);
63     ~PamTrack(){ Delete(); };
64 pam-fi 1.1
65 pam-fi 1.10 void Clear();
66     void Clear(Option_t *option){Clear();};
67     void Delete();
68 pam-fi 1.1
69 pam-fi 1.10 TrkTrack* GetTrkTrack(){return trk_track;};
70 pam-fi 1.8 CaloTrkVar* GetCaloTrack(){return calo_track;};
71 pam-fi 1.10 ToFTrkVar* GetToFTrack(){return tof_track;};
72 pam-fi 1.8
73 pam-fi 1.1 ClassDef(PamTrack,1);
74     };
75    
76     /**
77     * \brief Class to describe PAMELA LEVEL2 data.
78     *
79     * This class inherites from TrkLevel2, CaloLevel2 ecc... and it overrides the TrkLevel2:GetTrack(int it) and TrkLevel2:GetTrackImage(int it) methods.
80     * This allows to solve the tracker ambiguity (that is, to choose between track images) by using also information from other detectors.
81     */
82    
83 pam-fi 1.10 //class PamLevel2 : public CaloLevel2, public CaloLevel1, public ToFLevel2, public TrkLevel2, public TrkLevel1, public TrkHough, public TrigLevel2, public S4Level2, public NDLevel2, public AcLevel2, public OrbitalInfo {
84     class PamLevel2 : public TObject {
85 pam-fi 1.1
86     private:
87 mocchiut 1.12 ULong64_t runfirstentry;
88     ULong64_t runlastentry;
89     Int_t irun;
90    
91 pam-fi 1.7 public:
92 pam-fi 1.1
93 pam-fi 1.6 TrkLevel1* trk1_obj;
94     TrkLevel2* trk2_obj;
95     TrkHough* trkh_obj;
96    
97     CaloLevel1* calo1_obj;
98     CaloLevel2* calo2_obj;
99    
100 pam-fi 1.2 ToFLevel2* tof_obj;
101     TrigLevel2* trig_obj;
102     S4Level2* s4_obj;
103     NDLevel2* nd_obj;
104     AcLevel2* ac_obj;
105 pam-fi 1.6 OrbitalInfo* orb_obj;
106 pam-fi 1.4
107 pam-fi 1.6 GL_RUN* run_obj;
108 mocchiut 1.11 SoftInfo* soft_obj; // Emiliano
109 pam-fi 1.1
110 pam-fi 1.10 TTree* tree_clone[8];
111    
112     // TRefArray* sorted_tracks;
113     // TRefArray sorted_tracks;
114    
115     TClonesArray *tsorted;
116     TClonesArray *timage;
117    
118    
119     PamTrack *track; //store the last required
120 pam-fi 1.7
121    
122 pam-fi 1.6 Bool_t CAL2; //level2 branch
123     Bool_t CAL1; //level1 branch
124    
125     Bool_t TRK2; //level2 branch
126     Bool_t TRK1; //level1 branch
127     Bool_t TRKh; //hough branch
128    
129     Bool_t TRG;
130     Bool_t TOF;
131     Bool_t S4;
132     Bool_t ND;
133     Bool_t AC;
134     Bool_t ORB;
135 pam-fi 1.9
136     Bool_t RUN;
137 pam-fi 1.6
138 pam-fi 1.1 PamLevel2();
139 pam-fi 1.10 ~PamLevel2(){Delete();};
140 pam-fi 1.2
141 pam-fi 1.6 void Clear();
142 pam-fi 1.10 void Delete();
143 pam-fi 1.2
144 mocchiut 1.12
145 pam-fi 1.7 // =========================================
146     // methods needed to read/write Level2 trees
147     // =========================================
148 pam-fi 1.6 void SetWhichTrees(TString);
149 pam-fi 1.8 void GetWhichTrees(TFile*);
150    
151     TTree* GetPamTree(TFile*,TString);
152     TTree* GetPamTree(TFile* f){return GetPamTree(f,"");};
153    
154 pam-fi 1.6 TList* GetListOfLevel2Files(TString, TString);
155     Bool_t CheckLevel2File(TString);
156     TChain* GetPamTree(TList*,TString);
157 pam-fi 1.8 TChain* GetPamTree(TString ddir,TString list,TString detlist){ return GetPamTree(GetListOfLevel2Files(ddir,list),detlist); };
158     TChain* GetPamTree(TString ddir,TString list){ return GetPamTree(GetListOfLevel2Files(ddir,list),""); };
159    
160 pam-fi 1.6 TTree* GetRunTree(TFile*);
161     TChain* GetRunTree(TList*);
162 mocchiut 1.12 TChain* GetRunTree(TString ddir,TString list){ return GetRunTree(GetListOfLevel2Files(ddir,list)); };
163     Bool_t UpdateRunInfo(TTree *,ULong64_t);
164     Bool_t UpdateRunInfo(TChain *,ULong64_t);
165 pam-fi 1.7
166 pam-fi 1.8 void CreateCloneTrees0(TChain *fChain, TFile* file);
167     void CreateCloneTrees(TFile* file);
168 pam-fi 1.7 void FillCloneTrees();
169     TTree *GetCloneTree(TString);
170     void WriteCloneTrees();
171    
172 pam-fi 1.6 void SetBranchAddress(TTree *);
173     void SetBranchAddress(TChain *);
174    
175 pam-fi 1.10 // ========================================================
176     // methods needed to retrieve subdetector general variables
177     // ========================================================
178 pam-fi 1.6 void* GetPointerTo(const char*);
179 pam-fi 1.10 TrkLevel1 *GetTrkLevel1() { return trk1_obj;};
180 mocchiut 1.12 TrkLevel2 *GetTrkLevel2() { return trk2_obj;};
181 pam-fi 1.10 TrkHough *GetTrkHough() { return trkh_obj;};
182     CaloLevel1 *GetCaloLevel1() { return calo1_obj;};
183     CaloLevel2 *GetCaloLevel2() { return calo2_obj;};
184     ToFLevel2 *GetToFLevel2() { return tof_obj;};
185     TrigLevel2 *GetTrigLevel2() { return trig_obj;};
186     S4Level2 *GetS4Level2() { return s4_obj;};
187     NDLevel2 *GetNDLevel2() { return nd_obj;};
188     AcLevel2 *GetAcLevel2() { return ac_obj;};
189     OrbitalInfo *GetOrbitalInfo(){ return orb_obj;};
190 mocchiut 1.11 GL_RUN *GetRunInfo() { return run_obj; };
191     SoftInfo *GetSoftInfo() { return soft_obj; }; // Emiliano
192 pam-fi 1.3
193     // ==============================================
194     // methods to retrieve subdetectors stored tracks
195     // ==============================================
196 pam-fi 1.10 TrkTrack* GetTrkStoredTrack(int seqno){return trk2_obj->TrkLevel2::GetStoredTrack(seqno); };
197 pam-fi 1.6 CaloTrkVar* GetCaloStoredTrack(int);
198     ToFTrkVar* GetToFStoredTrack(int);
199     //
200     PamTrack* GetPamTrackAlong(TrkTrack*);
201 pam-fi 1.3 // PamTrack* GetPamTrackAlong(CaloTrkVar*); //se serve
202     // PamTrack* GetPamTrackAlong(ToFTrkVar*); //se serve
203    
204 pam-fi 1.1 // =================================
205     // methods to retrieve pamela tracks
206     // =================================
207 pam-fi 1.3 PamTrack* GetStoredTrack(Int_t);
208 pam-fi 1.6 //
209     void SortTracks(TString); //assign value to variable sorted_tracks
210 pam-fi 1.10 // TRefArray* GetTracks(); //return sorted_tracks
211     TClonesArray* GetTracks(); //return sorted_tracks
212 pam-fi 1.6 PamTrack* GetTrack(int);
213 pam-fi 1.1 PamTrack* GetTrackImage(int);
214 pam-fi 1.2
215 pam-fi 1.6 // =================================
216     // other methods
217     // =================================
218 pam-fi 1.10 // Int_t ntrk(){ return trk2_obj->TrkLevel2::ntrk(); };
219 pam-fi 1.6
220    
221 pam-fi 1.1 ClassDef(PamLevel2,1);
222     };
223    
224     //===============================================================================================
225     //
226     //
227     //
228     //
229     //===============================================================================================
230    
231    
232     #endif
233    

  ViewVC Help
Powered by ViewVC 1.1.23