/[PAMELA software]/gp2root/testcashit.cpp
ViewVC logotype

Diff of /gp2root/testcashit.cpp

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

revision 1.1 by pamela, Wed Apr 19 23:35:58 2006 UTC revision 1.2 by cafagna, Sun Oct 22 08:27:23 2006 UTC
# Line 1  Line 1 
1  #include <iostream>  #include <iostream>
2  #include "pEvent.h"  #include "pEvent.h"
3    #include "TROOT.h"
4    #include "TFile.h"
5    #include "TTree.h"
6    
7  using std::cout;  using std::cout;
8  using std::endl;  using std::endl;
# Line 21  union test { Line 24  union test {
24  };  };
25    
26  int main(){  int main(){
27      TROOT baseapp("baseapp","My first root application");
28    test prova;    test prova;
29    //  pDetector pcal=pUtil::GetDet("CAL");    //  pDetector pcal=pUtil::GetDet("CAL");
30    pEvent event;    pEvent *event=new pEvent();
31    event.AddDetector("CAL");  
32      TFile *mf= new TFile("test.root","recreate");
33      TTree *mt=new TTree("gptree","GPAMELA Tree");
34      mt->Branch("pEvent_branch","pEvent",&event,16000,0);
35    
36      event->AddDetector("CAL");
37    for(int i=0; i<3; ++i){    for(int i=0; i<3; ++i){
38      prova.adesc._ipart=1+i;      prova.adesc._ipart=1+i;
39      prova.adesc._ical=2+i;      prova.adesc._ical=2+i;
# Line 32  int main(){ Line 41  int main(){
41      prova.adesc._xin=3.+i;      prova.adesc._xin=3.+i;
42      prova.adesc._yin=4.+i;      prova.adesc._yin=4.+i;
43      prova.adesc._zin=5.+i;      prova.adesc._zin=5.+i;
44  //     prova.adesc._xout=6.+i;      //     prova.adesc._xout=6.+i;
45  //     prova.adesc._yout=7.+i;      //     prova.adesc._yout=7.+i;
46  //     prova.adesc._zout=8.+i;      //     prova.adesc._zout=8.+i;
47      prova.adesc._erel=9.+i;      prova.adesc._erel=9.+i;
48  //     prova.adesc._time=10.+i;      //     prova.adesc._time=10.+i;
49  //     prova.adesc._pathcal=11.+i;      //     prova.adesc._pathcal=11.+i;
50  //     prova.adesc._p0=12.+i;      //     prova.adesc._p0=12.+i;
51  //    pcal.AddHit(new pCalHit(prova.b));      //    pcal.AddHit(new pCalHit(prova.b));
52  //    pcal.AddHit(pUtil::GetpHit(pcal.GetName(),prova.b));      //    pcal.AddHit(pUtil::GetpHit(pcal.GetName(),prova.b));
53      event.AddHit("CAL",prova.b);      event->AddHit("CAL",prova.b);
54    
55    }    }
56    //  event.AddDetector(pcal.GetName(),&pcal);    //  event.AddDetector(pcal.GetName(),&pcal);
57    //  pcal.Print();    //  pcal.Print();
58    event.Print();    event->Print();
59    //    pCalHit phit(prova.b);    //    pCalHit phit(prova.b);
60    
61    
62    //  phit.Print();    //  phit.Print();
63  //   cout <<  cid->GetIcas() << endl;    //   cout <<  cid->GetIcas() << endl;
64  //   cout <<  phit.GetXin() << endl;    //   cout <<  phit.GetXin() << endl;
65  //   cout <<  phit.GetYin() << endl;    //   cout <<  phit.GetYin() << endl;
66  //   cout <<  phit.GetZin() << endl;    //   cout <<  phit.GetZin() << endl;
67  //   cout <<  phit.GetXout() << endl;    //   cout <<  phit.GetXout() << endl;
68  //   cout <<  phit.GetYout() << endl;    //   cout <<  phit.GetYout() << endl;
69  //   cout <<  phit.GetZout() << endl;    //   cout <<  phit.GetZout() << endl;
70  //   cout <<  phit.GetTime() << endl;    //   cout <<  phit.GetTime() << endl;
71  //   cout <<  phit.GetErel() << endl;    //   cout <<  phit.GetErel() << endl;
72  //   cout <<  phit.GetPath() << endl;    //   cout <<  phit.GetPath() << endl;
73  //   cout <<  phit.GetP0() << endl;    //   cout <<  phit.GetP0() << endl;
74  //   cout <<  phit.GetIpart() << endl;    //   cout <<  phit.GetIpart() << endl;
75      mt->Fill();
76      mf->Write();
77      mf->Close();
78    return 0;    return 0;
79  }  }

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

  ViewVC Help
Powered by ViewVC 1.1.23