00001
00002
00003
00004
00005
00006
00007
00008
00009 #ifndef DETECTOR_H
00010 #define DETECTOR_H
00011 #include "channel.h"
00012 #include "Validity/VldTimeStamp.h"
00013 #include "Validity/VldContext.h"
00014 #include "RawData/RawChannelId.h"
00015 #include "TSystem.h"
00016
00017 using std::cout;
00018 using std::cerr;
00019 using std::endl;
00020
00021 class Detector {
00022
00023
00024 public:
00025 VldContext validity;
00026 protected:
00027
00028
00029 Int_t calibpoint;
00030 Int_t pulserbox;
00031 Int_t led;
00032 Int_t pulse_height;
00033 Int_t pulse_width;
00034 Int_t period;
00035 Int_t calibtype;
00036 Int_t timestamp;
00037 Int_t pulses;
00038
00039
00040 Int_t crate;
00041 Int_t chAdd;
00042 Int_t vaarc;
00043 Int_t vmm;
00044 Int_t vaadc;
00045
00046 Int_t plane;
00047 Int_t chip;
00048 Int_t channel;
00049
00050 Int_t no_entries;
00051 Double_t mean;
00052 Double_t rms;
00053
00054 VldTimeStamp time;
00055 Int_t first_time;
00056
00057
00058 Char_t filename[256];
00059
00060 TFile *outfile;
00061 TTree *outtree;
00062
00063 PlexHandle *myplexhandle;
00064 Int_t RunNo;
00065
00066 public:
00067
00068 Detector();
00069 ~Detector(){
00070
00071 Update(0,0,0,0,0,time,0,0,0);
00072 outfile->cd();
00073 outtree->Write();
00074 cout << " ** Written out tree ** " << endl;
00075 outfile->Close();
00076 cout << " ** Closed output file ** " << endl;
00077 cout << " ** Killed detector ** " << endl;};
00078
00079
00080 Channel *channels[10 * 6000];
00081
00082 void Update(Int_t new_led,
00083 Int_t new_pulse_height,
00084 Int_t new_pulse_width,
00085 Int_t new_pulserbox,
00086 Int_t new_calibpoint,
00087 VldTimeStamp new_time,
00088 Int_t new_calibtype,
00089 Int_t new_pulses,
00090 Int_t period);
00091
00092 void InitialiseTree();
00093
00094
00095 void AddEntry(RawChannelId channelid,
00096 Double_t mean,
00097 Double_t rms,
00098 Int_t no_entries
00099 );
00100
00101 };
00102
00103 #endif