/[PAMELA software]/root2paw/macros/GroundDataConvert.c
ViewVC logotype

Diff of /root2paw/macros/GroundDataConvert.c

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

revision 1.1 by mocchiut, Mon Dec 5 16:17:38 2005 UTC revision 1.3 by mocchiut, Thu Mar 9 15:46:26 2006 UTC
# Line 2  Line 2 
2  // Program to convert rootples to ntuples and viceversa for the PAMELA ground data.  // Program to convert rootples to ntuples and viceversa for the PAMELA ground data.
3  // Written by Emiliano Mocchiutti.    // Written by Emiliano Mocchiutti.  
4  //  //
5  //                   Version 3.00 (2005/11/29)  //                   Version 4.00 (2006/03/09)
6  //  //
7  // Changelog:  // Changelog:
8  //  //
9    // 3.01 - 4.00  (2006/03/09): convert tracker software output release r3v04.
10    //
11    // 3.00 - 3.01  (2006/02/14): bug in the booking of the level2 tracker rootple (wrong dimension of axv and wrong dereference to image[ntrk]), fixed (thanks to Silvio Orsi).
12    //
13  // 2.00 - 3.00  (2005/11/29): compiled.  // 2.00 - 3.00  (2005/11/29): compiled.
14  //  //
15  // 1.05 - 2.00  (2005/10/07): added TOF and TRIGGER level1 conversion (from PAW to ROOT).  // 1.05 - 2.00  (2005/10/07): added TOF and TRIGGER level1 conversion (from PAW to ROOT).
# Line 33  Line 37 
37  #include <iostream>  #include <iostream>
38  #include <iomanip>  #include <iomanip>
39  //  //
 //#include <trklev1struct.h>  
40  #include <ctrkstruct.h>  #include <ctrkstruct.h>
41  #include <ctofstruct.h>  #include <ctofstruct.h>
42  #include <cacstruct.h>  #include <cacstruct.h>
# Line 387  int GroundDataConvert(TString filename, Line 390  int GroundDataConvert(TString filename,
390              tree = new TTree("TrkLevel1","PAMELA level1 tracker data");              tree = new TTree("TrkLevel1","PAMELA level1 tracker data");
391              tree->Branch("good1",&trklev1.good1,"good1/O");              tree->Branch("good1",&trklev1.good1,"good1/O");
392              tree->Branch("nev1",&trklev1.nev1,"nev1/I");              tree->Branch("nev1",&trklev1.nev1,"nev1/I");
393                tree->Branch("whic_calib1",&trklev1.whic_calib1,"whic_calib1/I");
394                tree->Branch("swcode1",&trklev1.swcode1,"swcode1/I");
395                //      tree->Branch("crc1",trklev1.crc1,"crc1[12]/O");
396                tree->Branch("crc1",trklev1.crc1,"crc1[12]/I");
397              tree->Branch("pkt_type1",&trklev1.pkt_type1,"pkt_type1/I");              tree->Branch("pkt_type1",&trklev1.pkt_type1,"pkt_type1/I");
398              tree->Branch("pkt_num1",&trklev1.pkt_num1,"pkt_num1/I");              tree->Branch("pkt_num1",&trklev1.pkt_num1,"pkt_num1/I");
399              tree->Branch("obt1",&trklev1.obt1,"obt1/I");              tree->Branch("obt1",&trklev1.obt1,"obt1/I");
400              tree->Branch("which_calib1",&trklev1.which_calib1,"which_calib1/I");              tree->Branch("cpu_crc1",&trklev1.cpu_crc1,"cpu_crc1/O");
401              tree->Branch("nclstr1",&trklev1.nclstr1,"nclstr1/I");              tree->Branch("nclstr1",&trklev1.nclstr1,"nclstr1/I");
402              tree->Branch("view",trklev1.view,"view[nclstr1]/I");              tree->Branch("view",trklev1.view,"view[nclstr1]/I");
403              tree->Branch("ladder",trklev1.ladder,"ladder[nclstr1]/I");              tree->Branch("ladder",trklev1.ladder,"ladder[nclstr1]/I");
# Line 454  int GroundDataConvert(TString filename, Line 461  int GroundDataConvert(TString filename,
461              TTree *tree = 0;              TTree *tree = 0;
462              hfile = new TFile(file2.str().c_str(),type,"Tracker LEVEL2 data");              hfile = new TFile(file2.str().c_str(),type,"Tracker LEVEL2 data");
463              tree = new TTree("TrkLevel2","PAMELA level2 tracker data");              tree = new TTree("TrkLevel2","PAMELA level2 tracker data");
464                // GENERAL
465              tree->Branch("good2",&trklev2.good2,"good2/O");              tree->Branch("good2",&trklev2.good2,"good2/O");
466              tree->Branch("nev2",&trklev2.nev2,"nev2/I");              tree->Branch("nev2",&trklev2.nev2,"nev2/I");
467                tree->Branch("which_calib",&trklev2.which_calib,"which_calib/I");
468                tree->Branch("swcode",&trklev2.swcode,"swcode/I");
469                //      tree->Branch("crc",trklev2.crc,"crc[12]/O");
470                tree->Branch("crc",trklev2.crc,"crc[12]/I");
471                // CPU
472              tree->Branch("pkt_type",&trklev2.pkt_type,"pkt_type/I");              tree->Branch("pkt_type",&trklev2.pkt_type,"pkt_type/I");
473              tree->Branch("pkt_num",&trklev2.pkt_num,"pkt_num/I");              tree->Branch("pkt_num",&trklev2.pkt_num,"pkt_num/I");
474              tree->Branch("obt",&trklev2.obt,"obt/I");              tree->Branch("obt",&trklev2.obt,"obt/I");
475              tree->Branch("which_calib",&trklev2.which_calib,"which_calib/I");              tree->Branch("cpu_crc",&trklev2.cpu_crc,"cpu_crc/I");
476                // TRACKS
477              tree->Branch("ntrk",&trklev2.ntrk,"ntrk/I");              tree->Branch("ntrk",&trklev2.ntrk,"ntrk/I");
478              tree->Branch("image",&trklev2.image,"image[ntrk]/I");              tree->Branch("image",trklev2.image,"image[ntrk]/I");
479              tree->Branch("xm",trklev2.xm,"xm[ntrk][6]/F");              tree->Branch("xm",trklev2.xm,"xm[ntrk][6]/F");
480              tree->Branch("ym",trklev2.ym,"ym[ntrk][6]/F");              tree->Branch("ym",trklev2.ym,"ym[ntrk][6]/F");
481              tree->Branch("zm",trklev2.zm,"zm[ntrk][6]/F");              tree->Branch("zm",trklev2.zm,"zm[ntrk][6]/F");
# Line 475  int GroundDataConvert(TString filename, Line 489  int GroundDataConvert(TString filename,
489              tree->Branch("xv",trklev2.xv,"xv[ntrk][6]/F");              tree->Branch("xv",trklev2.xv,"xv[ntrk][6]/F");
490              tree->Branch("yv",trklev2.yv,"yv[ntrk][6]/F");              tree->Branch("yv",trklev2.yv,"yv[ntrk][6]/F");
491              tree->Branch("zv",trklev2.zv,"zv[ntrk][6]/F");              tree->Branch("zv",trklev2.zv,"zv[ntrk][6]/F");
492              tree->Branch("axv",trklev2.axv,"axv[ntrk]/F");              tree->Branch("axv",trklev2.axv,"axv[ntrk][6]/F");
493              tree->Branch("ayv",trklev2.ayv,"ayv[ntrk][6]/F");              tree->Branch("ayv",trklev2.ayv,"ayv[ntrk][6]/F");
494              tree->Branch("dedxp",trklev2.dedxp,"dedxp[ntrk][6]/F");              tree->Branch("dedx_x",trklev2.dedx_x,"dedx_x[ntrk][6]/F");
495              tree->Branch("nclsx",trklev2.nclsx,"nclsx[6]/I");              tree->Branch("dedx_y",trklev2.dedx_y,"dedx_y[ntrk][6]/F");
496              tree->Branch("nclsy",trklev2.nclsy,"nclsy[6]/I");              tree->Branch("bdl",trklev2.bdl,"bdl[ntrk]/F");
497                // SINGLETX
498                tree->Branch("nclsx",&trklev2.nclsx,"nclsx/I");
499                tree->Branch("planex",trklev2.planex,"planex[nclsx]/I");
500                tree->Branch("xs",trklev2.xs,"xs[nclsx][2]/F");
501                tree->Branch("sgnlxs",trklev2.sgnlxs,"sgnlxs[nclsx]/F");
502                // SINGLETY
503                tree->Branch("nclsy",&trklev2.nclsy,"nclsy/I");
504                tree->Branch("planey",trklev2.planey,"planey[nclsy]/I");
505                tree->Branch("ys",trklev2.ys,"ys[nclsy][2]/F");
506                tree->Branch("sgnlys",trklev2.sgnlys,"sgnlys[nclsy]/F");
507              //              //
508              Int_t trnev = 0;              Int_t trnev = 0;
509              coptrklev2(ifile.str().c_str(),trklev2,trnev);              coptrklev2(ifile.str().c_str(),trklev2,trnev);

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

  ViewVC Help
Powered by ViewVC 1.1.23