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

Diff of /yoda/event/PamelaRun.cpp

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

revision 1.1 by kusanagi, Tue Jul 6 12:20:23 2004 UTC revision 4.1 by kusanagi, Sat May 28 08:30:01 2005 UTC
# Line 1  Line 1 
1  /** @file  /** @file
2   * $Author: nagni $   * $Author: kusanagi $
3   * $Date: 2004/06/10 15:17:46 $   * $Date: 2005/03/06 04:33:01 $
4   * $Revision: 1.11 $   * $Revision: 4.0 $
5   *   *
6   * Implementation of the PamelaRun class.   * Implementation of the PamelaRun class.
7   */   */
8  #include <iostream>  #include <iostream>
9  #include <iomanip>  #include <iomanip>
 #include <sstream>  
10  #include <list>  #include <list>
11  #include <exception>  #include <exception>
12  #include <string>  //#include <string>
13    #include <log4cxx/logger.h>
 #include <log4cpp/Category.hh>  
14    
15  #include <TFile.h>  //Substituted by Maurizio 05 Feb 2004  #include <TFile.h>  //Substituted by Maurizio 05 Feb 2004
16  #include <TTree.h>  //Substituted by Maurizio 05 Feb 2004  #include <TTree.h>  //Substituted by Maurizio 05 Feb 2004
# Line 26  Line 24 
24  #include "Algorithm.h"  #include "Algorithm.h"
25  #include "AlgorithmInfo.h"  #include "AlgorithmInfo.h"
26  #include "Exception.h"  #include "Exception.h"
27    #include <sys/stat.h>
28    
29  extern "C" {  extern "C" {
 #include "DirectoryStructure.h"  
30  #include <dirent.h>  #include <dirent.h>
31    #include "DirectoryStructure.h"
32  }  }
33    
34  using namespace pamela;  using namespace pamela;
35    
36  static log4cpp::Category& cat = log4cpp::Category::getInstance("pamela.PamelaRun");  static log4cxx::LoggerPtr logger = log4cxx::Logger::getLogger(_T("pamela.PamelaRun"));
37    
38  /**  /**
39   * Get the run name according to a certain run number.   * Get the run name according to a certain run number.
# Line 41  static log4cpp::Category& cat = log4cpp: Line 41  static log4cpp::Category& cat = log4cpp:
41   * @return a string with the run name.   * @return a string with the run name.
42   */   */
43  std::string PamelaRun::GetRunName(int run) {  std::string PamelaRun::GetRunName(int run) {
44    std::ostringstream t_Stream;    std::stringstream temp;
45    t_Stream << std::setw( 4 ) << std::setfill( '0' ) << run;    temp.str("");
46    return "Run" + t_Stream.str();    temp << std::setw( 4 ) << std::setfill( '0' ) << run;
47    //return std::string("aa");    return "Run" + temp.str();
48  }  }
49    
50  /**  /**
# Line 74  return res; Line 74  return res;
74   * @param int run - Number of the run to check   * @param int run - Number of the run to check
75   * @return int   * @return int
76   */   */
77   std::string PamelaRun::RunExists(std::string input) throw (std::exception){   void PamelaRun::RunExists(std::string input) throw (std::exception){
78   int res;   int res;
79   DIR *dirp;   DIR *dirp;
80   std::string fileName;   std::string fileName;
81   std::string pathDir((char*)getenv("YODA_DATA"));   std::string pathDir((char*)getenv("YODA_DATA"));
82   std::string tempName;   std::string tempName;
83   std::string::size_type pos;   std::string::size_type pos;
84   std::ostringstream t_Stream;  
   
85   pos = input.find_last_of("/");   pos = input.find_last_of("/");
86   //if ((pos == std::string::npos) && !input.empty()) ;//throw Exception("Directories not allowed....");   //if ((pos == std::string::npos) && !input.empty()) ;//throw Exception("Directories not allowed....");
87   fileName = input.substr(pos+1);   fileName = input.substr(pos+1);
88   pos = fileName.find_last_of(".");   pos = fileName.find_last_of(".");
89   fileName = fileName.substr(0,pos);   fileName = fileName.substr(0,pos);
90   pathDir = pathDir + "/";   pathDir = pathDir + "/";
91   tempName = pathDir + fileName;   tempName = pathDir + fileName + "00";
92     //oss << pathDir << fileName << std::setw( 2 ) << std::setfill( '0' );
93     oss.str(tempName.c_str());
94   int i = 0;   int i = 0;
95   while (res){   while (res){
96      if ((dirp = opendir(tempName.c_str())) == NULL) {      //if ((dirp = opendir(tempName.c_str())) == NULL) {
97        if ((dirp = opendir(oss.str().c_str())) == NULL) {
98          res = 0;          res = 0;
99      } else {      } else {
100          closedir(dirp);          closedir(dirp);
101          t_Stream.str("");          oss.str("");
102          t_Stream << std::setw( 2 ) << std::setfill( '0' ) << ++i;          oss << pathDir << fileName << std::setw( 2 ) << std::setfill( '0' ) << ++i;
         tempName = pathDir + fileName + t_Stream.str() ;  
103          res = 1;          res = 1;
104      }      }
105   }   }
106  return (fileName + t_Stream.str());   oss.str("");
107     oss << Path << "/" << fileName << std::setw( 2 ) << std::setfill( '0' ) << i;
108     Path = oss.str();
109     oss.str("");
110     oss << fileName << std::setw( 2 ) << std::setfill( '0' ) << i;
111     Run = oss.str();
112    //return (oss.str());
113  }  }
114    
115  /**  /**
# Line 112  return (fileName + t_Stream.str()); Line 118  return (fileName + t_Stream.str());
118   * @param path Base path name to the data   * @param path Base path name to the data
119   */   */
120  PamelaRun::PamelaRun(std::string fileName, std::string path):  PamelaRun::PamelaRun(std::string fileName, std::string path):
121    Path(path),    Path(path),
122      Run(fileName),
123    RunNumber(1){ //veirificare se è possibilie eliminare questa variabile    RunNumber(1){ //veirificare se è possibilie eliminare questa variabile
124    Run = RunExists(fileName);    logger->debug(_T("Constructor"));
125      //Run = RunExists(fileName);
126      RunExists(fileName);
127    info = RunInfo(this);    info = RunInfo(this);
   cat <<  log4cpp::Priority::DEBUG  
       <<  "Constructor"  
       <<  "\n " << log4cpp::CategoryStream::ENDLINE;  
128  }  }
129    
130  /**  /**
# Line 128  PamelaRun::PamelaRun(std::string fileNam Line 134  PamelaRun::PamelaRun(std::string fileNam
134   * @return the complete path for this event type.   * @return the complete path for this event type.
135   */   */
136  std::string PamelaRun::GetDirName(PacketType const * type) const {  std::string PamelaRun::GetDirName(PacketType const * type) const {
137    std::string EventType = type->GetName();      //std::stringstream oss;
138    return Path + "/" + Run + "/" + EventType;      //std::string name = type->GetName();
139        //oss.str("");
140        //oss << Path << "/" << Run << "/" << "pippo";
141        //return oss.str();
142        //return "pippo";
143      //std::string EventType = type->GetName();
144        return Path + "/" + Run + "/" + type->GetName();
145  }  }
146    
147  /**  /**
# Line 138  std::string PamelaRun::GetDirName(Packet Line 150  std::string PamelaRun::GetDirName(Packet
150   * @param name subpacket name.   * @param name subpacket name.
151   * @return the complete path and file name.   * @return the complete path and file name.
152   */   */
153  std::string PamelaRun::GetFileName(const SubPacket* type, std::string name) const {  std::string PamelaRun::GetFileName(const SubPacket* type, std::string name) {
154    if (type->IsDetectorSpecific()) {    if (type->IsDetectorSpecific()) {
155      return GetDirName(type->GetPacketType()) + "/"      return Path + "/" + type->GetPacketType()->GetName() + "/"
156        + type->GetSubDetector()->GetName() + "/"        + Run + "." + type->GetPacketType()->GetName() + "."
       + Run + "." + type->GetPacketType()->GetName() + "."  
157        + type->GetSubDetector()->GetName() + "."        + type->GetSubDetector()->GetName() + "."
158        + name + ".root";        + name + ".root";
159    } else {    } else {
160      return GetDirName(type->GetPacketType()) + "/"      return Path + "/" + type->GetPacketType()->GetName() + "/"
161        + Run + "." + type->GetPacketType()->GetName() + "."        + Run + "." + type->GetPacketType()->GetName() + "."
162        + name + ".root";        + name + ".root";
163       /*
164        return Path + "/" + type->GetPacketType()->GetName() + "/"
165          + Run + "." + type->GetPacketType()->GetName() + "."
166          + name + ".root"; */
167    }    }
168  }  }
169    
# Line 157  std::string PamelaRun::GetFileName(const Line 172  std::string PamelaRun::GetFileName(const
172   * @param type subpacket type.   * @param type subpacket type.
173   * @return the complete path and file name.   * @return the complete path and file name.
174   */   */
175  std::string PamelaRun::GetFileName(const SubPacket* type) const {  std::string PamelaRun::GetFileName(const SubPacket* type)  {
176    return GetFileName(type, type->GetSubPacketName());    //return GetFileName(type, type->GetSubPacketName());
177        return GetFileName(type, "pippo");
178  }  }
179    
180  /**  /**
# Line 195  static std::list<std::string> GetRootFil Line 211  static std::list<std::string> GetRootFil
211    std::list<std::string> files;    std::list<std::string> files;
212    DIR *dir = opendir(path.c_str());    DIR *dir = opendir(path.c_str());
213    if (dir == 0) {    if (dir == 0) {
214      cat <<  log4cpp::Priority::DEBUG      logger->debug("Could not open " + path);
215          <<  "Could not open " << path      //throw Exception("Could not open " + path);
         <<  "\n " << log4cpp::CategoryStream::ENDLINE;  
     throw Exception("Could not open " + path);  
216    }    }
217        
218    for (struct dirent *d = readdir(dir); d != NULL; d = readdir(dir)) {    for (struct dirent *d = readdir(dir); d != NULL; d = readdir(dir)) {
# Line 218  static std::list<std::string> GetRootFil Line 232  static std::list<std::string> GetRootFil
232        if (stat(nextfilename.c_str(), &buf) == 0) {        if (stat(nextfilename.c_str(), &buf) == 0) {
233          filename.insert(filename.size()-5, "*");          filename.insert(filename.size()-5, "*");
234        }        }
235        cat <<  log4cpp::Priority::DEBUG        logger->debug("Using " + filename);
           <<  "Using " << filename  
           <<  "\n " << log4cpp::CategoryStream::ENDLINE;  
236        files.push_back(filename);        files.push_back(filename);
237      }      }
238    }    }
# Line 258  static void AddAllAsFriend(TChain* tree, Line 270  static void AddAllAsFriend(TChain* tree,
270    }    }
271    TFile* File = new TFile(BaseFileName.c_str(), "read");    TFile* File = new TFile(BaseFileName.c_str(), "read");
272    if (!File->IsOpen()) {    if (!File->IsOpen()) {
273      cat <<  log4cpp::Priority::WARN      logger->error("Could not open file " + BaseFileName + " for reading.");
         <<  "Could not open file " << BaseFileName << " for reading."  
         <<  "\n " << log4cpp::CategoryStream::ENDLINE;  
274      return;      return;
275    }    }
276    TList* list = File->GetListOfKeys();    TList* list = File->GetListOfKeys();
# Line 271  static void AddAllAsFriend(TChain* tree, Line 281  static void AddAllAsFriend(TChain* tree,
281          TChain* FriendChain = new TChain(TreeName.c_str());          TChain* FriendChain = new TChain(TreeName.c_str());
282          FriendChain->Add(FileName.c_str());          FriendChain->Add(FileName.c_str());
283          tree->AddFriend(FriendChain, TreeName.c_str());          tree->AddFriend(FriendChain, TreeName.c_str());
284          std::ostringstream t_Stream;          //logger->warn("Adding chain " + TreeName + " with " + FriendChain->GetEntries() + " entries as Friend");
         t_Stream << "Adding chain " << TreeName << " with "  
                  << FriendChain->GetEntries() << " entries as Friend";  
         cat.debug(t_Stream.str());  
285        }        }
286      }      }
287      File->Close();      File->Close();
# Line 284  static void AddAllAsFriend(TChain* tree, Line 291  static void AddAllAsFriend(TChain* tree,
291          std::string TreeName = k->GetName();          std::string TreeName = k->GetName();
292          TTree* FriendTree = (TTree *)File->Get(TreeName.c_str());          TTree* FriendTree = (TTree *)File->Get(TreeName.c_str());
293          tree->AddFriend(FriendTree, TreeName.c_str());            tree->AddFriend(FriendTree, TreeName.c_str());  
294          std::ostringstream t_Stream;          //logger->debug("Adding tree " + TreeName + " with " + FriendTree->GetEntries() + " entries as Friend");
         t_Stream << "Adding tree " << TreeName << " with "  
                  << FriendTree->GetEntries() << " entries as Friend";  
         cat.debug(t_Stream.str());  
295        }        }
296      }      }
297    }    }
# Line 300  static void AddAllAsFriend(TChain* tree, Line 304  static void AddAllAsFriend(TChain* tree,
304   * @return The root trees with the friends.   * @return The root trees with the friends.
305   */   */
306  TTree* PamelaRun::ReadTTree(const PacketType* type) {  TTree* PamelaRun::ReadTTree(const PacketType* type) {
307    cat <<  log4cpp::Priority::DEBUG    oss.str("");
308        <<  "Getting root files of " << type->GetName()    oss <<  "Getting root files of " << type->GetName();
309        <<  "\n " << log4cpp::CategoryStream::ENDLINE;    logger->debug(oss.str().c_str());
310    RootTreeMap::iterator t = TTreeMap.find(type);    RootTreeMap::iterator t = TTreeMap.find(type);
311    if (t != TTreeMap.end()) {    if (t != TTreeMap.end()) {
312      return t->second;      return t->second;
313    } else {    } else {
314      cat <<  log4cpp::Priority::DEBUG      oss.str("");
315          <<  "Reading root files of " << type->GetName()      oss <<  "Reading root files of " << type->GetName();
316          <<  "\n " << log4cpp::CategoryStream::ENDLINE;      logger->debug(oss.str().c_str());
317      EventHeader header(type);      EventHeader header(type);
318      std::string HeaderFileName = GetFileName(&header);      std::string HeaderFileName = GetFileName(&header);
319      TChain* HeaderTree = ReadHeaderTree(type);      TChain* HeaderTree = ReadHeaderTree(type);
# Line 347  void PamelaRun::ReadSubPacket(void* subp Line 351  void PamelaRun::ReadSubPacket(void* subp
351        branch->SetAddress(subpacket);        branch->SetAddress(subpacket);
352        SubPacketAddresses.insert(SubPacketMap::value_type(FullName, packet));        SubPacketAddresses.insert(SubPacketMap::value_type(FullName, packet));
353      } else {      } else {
354          cat <<  log4cpp::Priority::ERROR          oss.str("");
355              <<  "Could not find data for " << packet->GetPacketType()->GetName() << "/" << name          oss <<  "Could not find data for " << packet->GetPacketType()->GetName() << "/" << name ;
356              <<  "\n " << log4cpp::CategoryStream::ENDLINE;          logger->error(oss.str().c_str());
357      }      }
358    }    }
359  }  }
# Line 404  TTree* PamelaRun::CreateTTree(Algorithm* Line 408  TTree* PamelaRun::CreateTTree(Algorithm*
408    std::string EventType = packet->GetPacketType()->GetName();    std::string EventType = packet->GetPacketType()->GetName();
409    CreateDirectoryStructure(FileName.c_str());    CreateDirectoryStructure(FileName.c_str());
410    TFile* File = new TFile(FileName.c_str(), "create");    TFile* File = new TFile(FileName.c_str(), "create");
411      File->SetCompressionLevel(5);
412    if (!File->IsOpen()) {    if (!File->IsOpen()) {
413      cat <<  log4cpp::Priority::ERROR      logger->error("Could not open file " + FileName);
414          <<  "Could not open file " << FileName      //throw Exception("Could not open file " + FileName);
         <<  "\n " << log4cpp::CategoryStream::ENDLINE;  
     throw Exception("Could not open file " + FileName);  
415    }    }
416    std::string TreeName = GetTreeName(packet);    std::string TreeName = GetTreeName(packet);
417    TTree *tree = new TTree(TreeName.c_str(), algo->GetAlgorithmName().c_str());    TTree *tree = new TTree(TreeName.c_str(), algo->GetAlgorithmName().c_str());
# Line 417  TTree* PamelaRun::CreateTTree(Algorithm* Line 420  TTree* PamelaRun::CreateTTree(Algorithm*
420    AlgorithmInfo ai(algo);    AlgorithmInfo ai(algo);
421    ai.Write();    ai.Write();
422    info.Write();    info.Write();
423    cat <<  log4cpp::Priority::INFO    logger->debug("Creating file " + FileName + " with Tree " + TreeName);
       <<  "Creating file " << FileName << " with Tree " << TreeName  
       <<  "\n " << log4cpp::CategoryStream::ENDLINE;  
424    return tree;    return tree;
425  }  }
426    
# Line 437  TTree* PamelaRun::CreateTTree(Algorithm* Line 438  TTree* PamelaRun::CreateTTree(Algorithm*
438  void PamelaRun::WriteSubPacket(Algorithm *algo, void* subpacket,  void PamelaRun::WriteSubPacket(Algorithm *algo, void* subpacket,
439                                 const TClass *c, std::string name) {                                 const TClass *c, std::string name) {
440    SubPacket *packet = *(SubPacket **)subpacket;    SubPacket *packet = *(SubPacket **)subpacket;
441    cat <<  log4cpp::Priority::DEBUG    oss.str("");
442        <<  "Register: " << name << " for " << algo->GetAlgorithmName() << " (writing)"    oss <<  "Register: " << name << " for " << algo->GetAlgorithmName() << " (writing)";
443        <<  "\n " << log4cpp::CategoryStream::ENDLINE;    logger->debug(oss.str().c_str());
444    TTree* HeaderTree = ReadTTree(packet->GetPacketType());    TTree* HeaderTree = ReadTTree(packet->GetPacketType());
445    TTree* tree = CreateTTree(algo, packet, name);    TTree* tree = CreateTTree(algo, packet, name);
446    cat <<  log4cpp::Priority::DEBUG    oss.str("");
447        <<  "Branch: " << name << " Class: " << c->GetName()    oss <<  "Branch: " << name << " Class: " << c->GetName();
448        <<  "\n " << log4cpp::CategoryStream::ENDLINE;    logger->debug(oss.str().c_str());
449    tree->Branch(name.c_str(), c->GetName(),  subpacket);    tree->Branch(name.c_str(), c->GetName(),  subpacket);
450    HeaderTree->AddFriend(tree, tree->GetName());    HeaderTree->AddFriend(tree, tree->GetName());
451    
# Line 476  void PamelaRun::WriteSubPacket(Algorithm Line 477  void PamelaRun::WriteSubPacket(Algorithm
477   */   */
478  void PamelaRun::WriteHeader(Algorithm* algo, EventHeader** subpacket,  void PamelaRun::WriteHeader(Algorithm* algo, EventHeader** subpacket,
479                              const PacketType* type) {                              const PacketType* type) {
   cat <<  log4cpp::Priority::DEBUG  
       <<  "Creating header tree for " << type->GetName()  
       <<  "\n " << log4cpp::CategoryStream::ENDLINE;  
480    EventHeader header(type);    EventHeader header(type);
481    std::string FileName = GetFileName(&header, GetDefaultBranchName(&header));    std::string FileName = GetFileName(&header, GetDefaultBranchName(&header));
482    std::string EventType = (&header)->GetPacketType()->GetName();    std::string EventType = (&header)->GetPacketType()->GetName();
483    CreateDirectoryStructure(FileName.c_str());    CreateDirectoryStructure(FileName.c_str());
484    TFile* File = new TFile(FileName.c_str(), "create");    TFile* File = new TFile(FileName.c_str(), "create");
485    if (!File->IsOpen()) {    if (!File->IsOpen()) {
486      cat <<  log4cpp::Priority::ERROR      logger->error("Could not open file " + FileName);
487          <<  "Could not open file " << FileName      //throw Exception("Could not open file " + FileName);
         <<  "\n " << log4cpp::CategoryStream::ENDLINE;  
     throw Exception("Could not open file " + FileName);  
488    }    }
489    //std::string TreeName = GetTreeName(packet);    //std::string TreeName = GetTreeName(packet);
490    TTree *tree = new TTree("Pscu", algo->GetAlgorithmName().c_str());    TTree *tree = new TTree("Pscu", algo->GetAlgorithmName().c_str());
# Line 497  void PamelaRun::WriteHeader(Algorithm* a Line 493  void PamelaRun::WriteHeader(Algorithm* a
493    AlgorithmInfo ai(algo);    AlgorithmInfo ai(algo);
494    ai.Write();    ai.Write();
495    info.Write();    info.Write();
496    cat <<  log4cpp::Priority::INFO    std::stringstream temp;
497        <<  "Creating file " << FileName << " with Tree Pscu"    //temp.str("");
498        <<  "\n " << log4cpp::CategoryStream::ENDLINE;    //temp << "Created file" << FileName.c_str() << " with Tree Pscu" ;
499      //logger->debug(temp.str());
500    tree->Branch(GetDefaultBranchName(&header).c_str(),    tree->Branch(GetDefaultBranchName(&header).c_str(),
501                 (*subpacket)->Class()->GetName(), subpacket);                 (*subpacket)->Class()->GetName(), subpacket);
502    TTreeMap.insert(RootTreeMap::value_type(type, tree));    TTreeMap.insert(RootTreeMap::value_type(type, tree));
# Line 513  void PamelaRun::WriteHeader(Algorithm* a Line 510  void PamelaRun::WriteHeader(Algorithm* a
510   * @param subpacket A pointer to the pointer of the header packet.   * @param subpacket A pointer to the pointer of the header packet.
511   */   */
512  void PamelaRun::WriteHeaders(Algorithm* algo, EventHeader** subpacket) {  void PamelaRun::WriteHeaders(Algorithm* algo, EventHeader** subpacket) {
513    
514        WriteHeader(algo, subpacket, PacketType::PhysEndRun);
515        WriteHeader(algo, subpacket, PacketType::CalibCalPulse1);
516        WriteHeader(algo, subpacket, PacketType::CalibCalPulse2);
517      WriteHeader(algo, subpacket, PacketType::Physics);      WriteHeader(algo, subpacket, PacketType::Physics);
518      WriteHeader(algo, subpacket, PacketType::TabDump);      WriteHeader(algo, subpacket, PacketType::CalibTrk1);
519      WriteHeader(algo, subpacket, PacketType::VarDump);      WriteHeader(algo, subpacket, PacketType::CalibTrk2);
     WriteHeader(algo, subpacket, PacketType::ArrDump);  
     WriteHeader(algo, subpacket, PacketType::Tmtc);  
     WriteHeader(algo, subpacket, PacketType::Mcmd);  
     WriteHeader(algo, subpacket, PacketType::Log);  
     WriteHeader(algo, subpacket, PacketType::CalibTrk);  
     WriteHeader(algo, subpacket, PacketType::CalibTrg);  
     WriteHeader(algo, subpacket, PacketType::CalibCal);  
     WriteHeader(algo, subpacket, PacketType::CalibTrd);  
520      WriteHeader(algo, subpacket, PacketType::CalibTof);      WriteHeader(algo, subpacket, PacketType::CalibTof);
521      WriteHeader(algo, subpacket, PacketType::CalibS4);      WriteHeader(algo, subpacket, PacketType::CalibS4);
522        WriteHeader(algo, subpacket, PacketType::CalibCalPed);
523        WriteHeader(algo, subpacket, PacketType::Calib1_Ac1);
524        WriteHeader(algo, subpacket, PacketType::Calib1_Ac2);
525        WriteHeader(algo, subpacket, PacketType::Calib2_Ac1);
526        WriteHeader(algo, subpacket, PacketType::Calib2_Ac2);
527      WriteHeader(algo, subpacket, PacketType::RunHeader);      WriteHeader(algo, subpacket, PacketType::RunHeader);
528      WriteHeader(algo, subpacket, PacketType::RunTrailer);      WriteHeader(algo, subpacket, PacketType::RunTrailer);
529      WriteHeader(algo, subpacket, PacketType::ForcedPkt);      WriteHeader(algo, subpacket, PacketType::CalibHeader);
530        WriteHeader(algo, subpacket, PacketType::CalibTrailer);
531        WriteHeader(algo, subpacket, PacketType::InitHeader);
532        WriteHeader(algo, subpacket, PacketType::InitTrailer);
533        WriteHeader(algo, subpacket, PacketType::EventTrk);
534        WriteHeader(algo, subpacket, PacketType::TestTrk);
535        WriteHeader(algo, subpacket, PacketType::TestTof);
536        WriteHeader(algo, subpacket, PacketType::Log);
537        WriteHeader(algo, subpacket, PacketType::VarDump);
538        WriteHeader(algo, subpacket, PacketType::ArrDump);
539        WriteHeader(algo, subpacket, PacketType::TabDump);
540        WriteHeader(algo, subpacket, PacketType::Tmtc);
541        WriteHeader(algo, subpacket, PacketType::Mcmd);
542        WriteHeader(algo, subpacket, PacketType::ForcedFECmd);
543        WriteHeader(algo, subpacket, PacketType::Ac1Init);
544        WriteHeader(algo, subpacket, PacketType::CalInit);
545        WriteHeader(algo, subpacket, PacketType::TrkInit);
546        WriteHeader(algo, subpacket, PacketType::TofInit);
547        WriteHeader(algo, subpacket, PacketType::TrgInit);    
548        WriteHeader(algo, subpacket, PacketType::NdInit);    
549        WriteHeader(algo, subpacket, PacketType::S4Init);    
550        WriteHeader(algo, subpacket, PacketType::Ac2Init);
551        WriteHeader(algo, subpacket, PacketType::CalAlarm);    
552        WriteHeader(algo, subpacket, PacketType::AcAlarm);    
553        WriteHeader(algo, subpacket, PacketType::TrkAlarm);    
554        WriteHeader(algo, subpacket, PacketType::TrgAlarm);    
555        WriteHeader(algo, subpacket, PacketType::TofAlarm);
556        WriteHeader(algo, subpacket, PacketType::S4Alarm);
557        WriteHeader(algo, subpacket, PacketType::TsbT);
558        WriteHeader(algo, subpacket, PacketType::TsbB);
559  }  }
560    
561  /**  /**
# Line 557  void PamelaRun::WriteFiles(void) { Line 584  void PamelaRun::WriteFiles(void) {
584   * @param type the package type of the trees to fill.   * @param type the package type of the trees to fill.
585   */   */
586  void PamelaRun::FillTrees(const PacketType* type) {  void PamelaRun::FillTrees(const PacketType* type) {
587    for (TTreeList::iterator j = WritingRootTrees[type].begin();    try{
588         j != WritingRootTrees[type].end(); j++) {      for (TTreeList::iterator j = WritingRootTrees[type].begin();
589      (*j)->Fill();          j != WritingRootTrees[type].end(); j++) {
590      ;              (*j)->Fill();
591        }
592      } catch(Exception exc){
593        logger->fatal("ORRORE!!!");
594    }    }
595  }  }
596    
597    
598    

Legend:
Removed from v.1.1  
changed lines
  Added in v.4.1

  ViewVC Help
Powered by ViewVC 1.1.23