1 // Author: Filimon Roukoutakis 02/08/2006
3 /******************************************************************************
4 MOOD - Monitor Of On-line Data and Detector Debugger for ALICE Experiment
5 ******************************************************************************/
8 #include <TSysEvtHandler.h>
12 int deroot(const char *rootFileName, const char *dateFileName);
14 int deroot(const char *rootFileName, const char *dateFileName) {
16 unsigned char *dateEvent=new unsigned char [100000000];
19 size_t gdcCounter, gdcSize;
20 TFile rootFile(rootFileName);
21 TTree *t=(TTree *)rootFile.Get("RAW");
23 cerr << "Error getting RAW tree" << endl;
26 AliRawEvent *rootEvent=NULL;
28 t->SetBranchAddress("rawevent", &rootEvent);
30 if(!(dateFile=fopen(dateFileName, "wb"))) {
31 cerr << "Error opening DATE file" << endl;
35 for(gdcCounter=0; gdcCounter<t->GetEntries(); gdcCounter++) {
36 rootEvent=new AliRawEvent;
37 t->GetEntry(gdcCounter);
38 gdcSize=Root2Date(rootEvent, dateEvent);
40 cerr << "\r \r" << setprecision(3) << 100*(float)(gdcCounter+1)/t->GetEntries() << "% ";
41 fwrite(dateEvent, gdcSize, 1, dateFile);
57 int main(int argc, char **argv) {
60 cerr << "Usage: deroot <input_root_file> <output_date_file>" << endl;
64 deroot(argv[1], argv[2]);
71 int main(int /*argc*/, char** /*argv*/)
73 ::Error("main", "this program was compiled without DATE");