/[PAMELA software]/chewbacca/PamOffLineSW/PacketUser.h
ViewVC logotype

Diff of /chewbacca/PamOffLineSW/PacketUser.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.5 by pam-fi, Wed Aug 5 18:48:42 2009 UTC revision 1.7 by mocchiut, Thu Feb 11 09:02:09 2010 UTC
# Line 1  Line 1 
1  //============================================================================  //============================================================================
2  // $Id: PacketUser.h,v 1.4 2008-12-18 14:47:00 mocchiut Exp $  // $Id: PacketUser.h,v 1.6 2009/12/24 10:31:13 mocchiut Exp $
3  // Description :  // Description :
4  //============================================================================  //============================================================================
5  #ifndef PACKETUSER_H_  #ifndef PACKETUSER_H_
# Line 8  Line 8 
8  #include <TTimeStamp.h>  #include <TTimeStamp.h>
9  #include "../event/PacketType.h"  #include "../event/PacketType.h"
10  #include "EventReader.h"  #include "EventReader.h"
11    #include "ReaderAlgorithms.h"
12    #include "../event/mcmd/McmdEvent.h"
13    #include "../event/mcmd/McmdRecord.h"
14    
15  #include "TROOT.h" //ROOT version > 5.14  #include "TROOT.h" //ROOT version > 5.14
16  #include "TSystem.h" // EMI  #include "TSystem.h" // EMI
17    #include "TArrayI.h" // EMI
18    
19    #include <vector>
20    
21  using namespace pamela;  using namespace pamela;
22  using namespace pamela::techmodel;  using namespace pamela::techmodel;
23    
24  namespace PamOffLineSW {  namespace PamOffLineSW {
25    
26    
27    /* class dbinfo{ */
28    /*   public: */
29    /*   dbinfo( */
30    /*   char * v_folder_name,  */
31    /*   char* v_file_name, */
32    /*   unsigned long int v_pkt_number_in,  */
33    /*   unsigned long int v_pkt_number_fin,  */
34    /*   unsigned long int v_obt_in, */
35    /*   unsigned long int v_obt_fin,  */
36    /*   unsigned long int v_mboot_num,  */
37    /*   unsigned long int v_time_offset,  */
38    /*   int v_bad_pkt, */
39    /*   int v_bad_pkt_read,  */
40    /*   int v_bad_pkt_CalRead,  */
41    /*   int v_num_PKT_Saved,  */
42    /*   char* v_nome_input,  */
43    /*   bool v__time_is_estimated */
44    /*   ){ */
45    /*     folder_name = strdup(v_folder_name);  */
46    /*     file_name = strdup(v_file_name); */
47    /*     pkt_number_in = v_pkt_number_in;  */
48    /*     pkt_number_fin = v_pkt_number_fin;  */
49    /*     obt_in = v_obt_in; */
50    /*     obt_fin = v_obt_fin;  */
51    /*     mboot_num = v_mboot_num;  */
52    /*     time_offset = v_time_offset;  */
53    /*     bad_pkt = v_bad_pkt; */
54    /*     bad_pkt_read = v_bad_pkt_read;  */
55    /*     bad_pkt_CalRead = v_bad_pkt_CalRead;  */
56    /*     num_PKT_Saved = v_num_PKT_Saved;  */
57    /*     nome_input = v_nome_input;  */
58    /*     _time_is_estimated = v__time_is_estimated; */
59    /*   } */
60    /*   ~dbinfo(){ */
61    /*     free(folder_name);  */
62    /*     free(file_name); */
63    /*   } */
64    /*   char* folder_name;  */
65    /*   char* file_name; */
66    /*   unsigned long int pkt_number_in;  */
67    /*   unsigned long int pkt_number_fin;  */
68    /*   unsigned long int obt_in; */
69    /*   unsigned long int obt_fin;  */
70    /*   unsigned long int mboot_num;  */
71    /*   unsigned long int time_offset;  */
72    /*   int bad_pkt; */
73    /*   int bad_pkt_read;  */
74    /*   int bad_pkt_CalRead;  */
75    /*   int num_PKT_Saved;  */
76    /*   char* nome_input;  */
77    /*   bool _time_is_estimated; */
78    /* }; */
79    
80  class PacketUser {  class PacketUser {
81    
82  public:  public:
# Line 31  public: Line 92  public:
92    void FinishLastGroup();    void FinishLastGroup();
93    
94  private:  private:
95      
96      // store dbinfo when file is bad but num. packet more than 1000
97      //  vector <dbinfo*> m_dbinfos;
98    
99    //the Event Reader handler    //the Event Reader handler
100    pamela::techmodel::EventReader* reader;    pamela::techmodel::EventReader* reader;
101    //the Pamela Run handler,  one for ech ROOT file created    //the Pamela Run handler,  one for ech ROOT file created
# Line 99  private: Line 164  private:
164    //the table name in our DB for MERGING    //the table name in our DB for MERGING
165    const char* Table_ROOT_Merging;    const char* Table_ROOT_Merging;
166    
167      //
168      Int_t recoverlimit;
169      // list of ID in root_table_bad with more than XXX packets
170      TArrayI *idtorecover;
171      //
172      Int_t arsize;
173      // delete small files in root_table_bad from disk
174      void CleanDisk();
175    
176    //starts a new root file    //starts a new root file
177    void StartGroup();    void StartGroup();
178    //set the value of the counter and obt of the first packet of the group    //set the value of the counter and obt of the first packet of the group
# Line 113  private: Line 187  private:
187    void setBootNumber(char* packet, long int pktLenght, const PacketType* type);    void setBootNumber(char* packet, long int pktLenght, const PacketType* type);
188    //set real_time_init and real_time_last    //set real_time_init and real_time_last
189    void setReal_Time();    void setReal_Time();
190    //    
191      void setReal_TimeRECOVERY(
192                                unsigned long int & _real_time_init,
193                                unsigned long int & _real_time_last,
194                                unsigned long int _obt_init,
195                                unsigned long int _obt_last
196                                );
197      
198    //
199    void recover_boot_number();    void recover_boot_number();
200    
201    //retrieve the timeOffset from table=Table_GL_RESURS_OFFSET    //retrieve the timeOffset from table=Table_GL_RESURS_OFFSET
202    unsigned long int retrieveTimeOffset(const char * table);    unsigned long int retrieveTimeOffset(const char * table);
203    
204    unsigned int select_maxIDN_DB(const char* table_name);    unsigned int select_maxIDN_DB(const char* table_name, const char* file_name);
205    
206    //function that saves informations in our DB    //function that saves informations in our DB
207    bool saveROOT_DB(const char* table_name, char* folder_name, char* file_name, unsigned long int pkt_number_in,    bool saveROOT_DB(const char* table_name, const char* folder_name, const char* file_name, unsigned long int pkt_number_in,
208        unsigned long int pkt_number_fin, unsigned long int obt_in, unsigned long int obt_fin, unsigned long int oT_sync,        unsigned long int pkt_number_fin, unsigned long int obt_in, unsigned long int obt_fin, unsigned long int oT_sync,
209        unsigned long int lT_sync_info, unsigned long int mtime_init, unsigned long int mtime_last,        unsigned long int lT_sync_info, unsigned long int mtime_init, unsigned long int mtime_last,
210        unsigned long int mboot_num, unsigned long int time_offset, int bad_pkt, int bad_pkt_read, int bad_pkt_CalRead,        unsigned long int mboot_num, unsigned long int time_offset, int bad_pkt, int bad_pkt_read, int bad_pkt_CalRead,
211        int num_PKT_Saved, char* nome_input, bool _time_is_estimated);        int num_PKT_Saved, const char* nome_input, bool _time_is_estimated);
212    
213    ///new part merging    ///new part merging
214    

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.7

  ViewVC Help
Powered by ViewVC 1.1.23