00039 {
00040 TApplication *theApp=new TApplication("App", &argv, argc);
00041
00042 TFile *infile = new TFile("drift.root");
00043
00044 TTree *li_tree = (TTree*) infile->Get("li_tree");
00045
00046 Int_t calibpoint;
00047 Int_t pulserbox;
00048 Int_t led;
00049 Int_t pulse_height;
00050 Int_t pulse_width;
00051 Int_t period;
00052 Int_t calibtype;
00053 Int_t timestamp;
00054 Int_t pulses;
00055
00056 Int_t crate;
00057 Int_t chAdd;
00058 Int_t vaarc;
00059 Int_t vmm;
00060 Int_t vaadc;
00061
00062 Int_t plane;
00063 Int_t chip;
00064 Int_t channel;
00065
00066 Double_t mean;
00067 Double_t rms;
00068
00069 Int_t no_entries;
00070
00071 li_tree->SetBranchAddress("calibpoint",&calibpoint);
00072 li_tree->SetBranchAddress("pulserbox",&pulserbox);
00073 li_tree->SetBranchAddress("led",&led);
00074 li_tree->SetBranchAddress("pulse_height",&pulse_height);
00075 li_tree->SetBranchAddress("pulse_width",&pulse_width);
00076 li_tree->SetBranchAddress("period",&period);
00077 li_tree->SetBranchAddress("calibtype",&calibtype);
00078 li_tree->SetBranchAddress("pulses",&pulses);
00079 li_tree->SetBranchAddress("timestamp",×tamp);
00080
00081 li_tree->SetBranchAddress("crate",&crate);
00082 li_tree->SetBranchAddress("chAdd",&chAdd);
00083 li_tree->SetBranchAddress("vaarc",&vaarc);
00084 li_tree->SetBranchAddress("vmm",&vmm);
00085 li_tree->SetBranchAddress("vaadc",&vaadc);
00086
00087 li_tree->SetBranchAddress("plane",&plane);
00088 li_tree->SetBranchAddress("chip",&chip);
00089 li_tree->SetBranchAddress("channel",&channel);
00090
00091 li_tree->SetBranchAddress("no_entries",&no_entries);
00092 li_tree->SetBranchAddress("mean",&mean);
00093 li_tree->SetBranchAddress("rms",&rms);
00094
00095 Stat_t no_events = li_tree->GetEntries();
00097
00098 Detector *detector[4][21]={0};
00099 Double_t progress_percentage;
00100 progress_percentage=0;
00101
00102 cout << endl;
00103 cout << " *************************************** " << endl;
00104 cout << " ** Initialised objects to hold data ** " << endl;
00105 cout << " ** Reading in data ** " << endl;
00106 cout << " ** 0%------------------------100% ** " << endl;
00107 cout << " ** ";
00108
00109 for(Int_t index = 0; index<no_events;index++){
00110 li_tree->GetEntry(index);
00111
00112 if(detector[pulserbox][21-led] ==0)
00113 detector[pulserbox][21-led] = new Detector();
00114
00115 if(plane > 0)
00116 detector[pulserbox][21-led]->SetStats(crate%2,plane,chip,channel,no_entries,mean,rms);
00117 if( (index/no_events) > (progress_percentage+0.1) ){
00118 cout << "***";
00119 progress_percentage = index/no_events;
00120 }
00121 }
00122 cout << "***";
00123 cout << " ** " << endl;
00124 cout << " *************************************** " << endl;
00125 cout << endl;
00126
00128
00129
00131
00132
00133 Int_t pick_led;
00134 Int_t led_pattern;
00135 Int_t start_plane;
00136 pick_led =1;
00137 int pulser_pick=0;
00138 cout << " Which 4 plane number? (ie 1,5,9,13...) : " ;
00139 cin >> start_plane;
00140
00141
00142
00143
00144 while(pick_led > 0){
00145 cout << " Which led No : ";
00146 cin >> pick_led;
00147 cout << " Which led pattern : ";
00148 cin >> led_pattern;
00149 if(start_plane < 65)
00150 DrawFourPlanes(detector[0][pick_led],detector[0][pick_led],start_plane,led_pattern);
00151 else if(start_plane >64 && start_plane < 129)
00152 DrawFourPlanes(detector[2][pick_led],detector[2][pick_led],start_plane,led_pattern);
00153 else if(start_plane >129 && start_plane < 193)
00154 DrawFourPlanes(detector[4][pick_led],detector[4][pick_led],start_plane,led_pattern);
00155 else if(start_plane >192 && start_plane < 256)
00156 DrawFourPlanes(detector[6][pick_led],detector[6][pick_led],start_plane,led_pattern);
00157 }
00158
00159
00160
00161
00162
00163
00164 theApp->Run(kTRUE);
00165 }