Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

Gryfindor_phil.cxx File Reference

#include <iostream.h>
#include <fstream.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "TFile.h"
#include "TROOT.h"
#include "TH1.h"
#include "TF1.h"
#include "TH2.h"
#include "TF2.h"
#include "TH3.h"
#include "TStyle.h"
#include "TApplication.h"
#include "TCanvas.h"
#include "TMath.h"
#include "TMinuit.h"
#include "TNtuple.h"
#include "TLatex.h"
#include "TLine.h"
#include "TFrame.h"
#include "TEllipse.h"
#include "detector/detector.h"

Go to the source code of this file.

Functions

TROOT simple ("stuff","stuff")
void Draw (Detector *detector[10][21], int start_plane, int pick_led, int led_pattern)
void DrawFourPlanes (Detector *detector_one, Detector *detector_two, Int_t start_plane, Int_t led)
int SanityCheck (int plane, int chip, int channel)
int GetPixel (int channel)
Int_t main (Int_t argv, char **argc)


Function Documentation

void Draw Detector detector[10][21],
int  start_plane,
int  pick_led,
int  led_pattern
 

Definition at line 183 of file Gryfindor_phil.cxx.

References DrawFourPlanes(), and Detector::Update().

Referenced by HadMuMonModule::BeginJob(), PmtPixel::Draw(), MyClass::Draw(), Anp::StdHepTab::Expose(), Anp::SnarlTimeTab::Expose(), Anp::SnarlAdcTab::Expose(), Anp::EventHitTab::Expose(), Anp::EventAdcTab::Expose(), main(), PTGuiMainFrame::Plot(), LIPlexMaps::ReadDbGains(), Plot::TestError(), and Plot::TestHist().

00184 {
00185   static TCanvas *c1=0, *c2=0;
00186   static bool first = true;
00187   if (first) {
00188     c1 = new TCanvas("fourplanes","fourplanes",0,0,600,750);
00189     c2 = new TCanvas("fourmoreplanes","fourmoreplanes",600,0,600,750);
00190     first = false;
00191   }
00192   c1->Clear();
00193   c2->Clear();
00194   c1->cd();
00195  if(start_plane < 65)
00196       DrawFourPlanes(detector[0][pick_led],detector[0][pick_led],start_plane,led_pattern);
00197     else if(start_plane >64 && start_plane < 129)
00198       DrawFourPlanes(detector[2][pick_led],detector[2][pick_led],start_plane,led_pattern);
00199     else if(start_plane >129 && start_plane < 193)
00200       DrawFourPlanes(detector[4][pick_led],detector[4][pick_led],start_plane,led_pattern);
00201  // else if(start_plane >192 && start_plane < 256)
00202    //     DrawFourPlanes(detector[6][pick_led],detector[6][pick_led],start_plane,led_pattern);
00203  c2->cd();
00204  if(start_plane < 65)
00205       DrawFourPlanes(detector[1][pick_led],detector[1][pick_led],start_plane,led_pattern);
00206     else if(start_plane >64 && start_plane < 129)
00207       DrawFourPlanes(detector[3][pick_led],detector[3][pick_led],start_plane,led_pattern);
00208  //else if(start_plane >129 && start_plane < 193)
00209       //DrawFourPlanes(detector[5][pick_led],detector[5][pick_led],start_plane,led_pattern);
00210       // else if(start_plane >192 && start_plane < 256)
00211       //DrawFourPlanes(detector[7][pick_led],detector[7][pick_led],start_plane,led_pattern);
00212 
00213  c1->Update();
00214  c2->Update();
00215 
00216  char c;
00217  cout<<"Print?"<<endl;
00218  cin >>c;
00219  if (c=='p') {
00220    char fname[100];
00221    sprintf(fname,"plane%d_led%d_even.eps",start_plane,pick_led);
00222    c1->Print(fname);
00223    sprintf(fname,"plane%d_led%d_odd.eps",start_plane,pick_led);
00224    c2->Print(fname);
00225  }
00226 
00227 }

void DrawFourPlanes Detector detector_one,
Detector detector_two,
Int_t  start_plane,
Int_t  led
 

int GetPixel int  channel  ) 
 

Int_t main Int_t  argv,
char **  argc
 

Definition at line 40 of file Gryfindor_phil.cxx.

References Draw(), DrawFourPlanes(), infile, and Detector::SetStats().

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

int SanityCheck int  plane,
int  chip,
int  channel
 

TROOT simple "stuff"  ,
"stuff" 
 


Generated on Mon Feb 15 11:07:59 2010 for loon by  doxygen 1.3.9.1