#include <detector.h>
Public Types | |
| typedef enum Detector::EDetector | Detector_t |
| enum | EDetector { kUnknown = 0x00, kNear = 0x01, kFar = 0x02, kCalDet = 0x04, kCalib = 0x04, kTestStand = 0x08, kMapper = 0x10 } |
Public Member Functions | |
| Detector () | |
| ~Detector () | |
| void | Update (Int_t new_led, Int_t new_pulse_height, Int_t new_pulse_width, Int_t new_pulserbox, Int_t new_calibpoint, VldTimeStamp new_time, Int_t new_calibtype, Int_t new_pulses, Int_t period) |
| void | InitialiseTree () |
| void | AddEntry (RawChannelId channelid, Double_t mean, Double_t rms, Int_t no_entries) |
| Detector () | |
| void | Clean () |
| void | AddStats (Int_t in_side, Int_t in_plane, Int_t in_chip, Int_t in_channel, Int_t new_entries, Double_t new_mean, Double_t new_rms) |
| void | SetStats (Int_t in_side, Int_t in_plane, Int_t in_chip, Int_t in_channel, Int_t new_entries, Double_t new_mean, Double_t new_rms) |
| Int_t | GetEntries (Int_t in_side, Int_t in_plane, Int_t in_chip, Int_t in_channel) |
| Double_t | GetMean (Int_t in_side, Int_t in_plane, Int_t in_chip, Int_t in_channel) |
| Double_t | GetRMS (Int_t in_side, Int_t in_plane, Int_t in_chip, Int_t in_channel) |
| Double_t | GetPinMean (Int_t box, Int_t led, Int_t level) |
| Double_t | GetPinRMS (Int_t box, Int_t led, Int_t level) |
| Int_t | GetPinEntries (Int_t box, Int_t led, Int_t level) |
| void | RemoveDemons (Int_t box, Int_t led) |
| void | FillMeanHist (TH1F *meanhist) |
| Int_t | FillStripHist (Int_t box, Int_t led, Int_t side, TH2F *ratiohist) |
| void | FillChipHist (Int_t side, TH2F *chiphist) |
| Int_t | GetStrip (Int_t side, Int_t plane, Int_t chip, Int_t channel, Int_t led) |
| Int_t | GetPixelEntries (Int_t in_side, Int_t in_plane, Int_t in_pmt, Int_t in_pixel) |
| Double_t | GetPixelMean (Int_t in_side, Int_t in_plane, Int_t in_pmt, Int_t in_pixel) |
| Double_t | GetPixelRMS (Int_t in_side, Int_t in_plane, Int_t in_pmt, Int_t in_pixel) |
| Int_t | GetChip (Int_t pmt) |
| Int_t | GetChannel (Int_t pmt) |
Public Attributes | |
| VldContext | validity |
| Channel * | channels [10 *6000] |
Protected Attributes | |
| Int_t | calibpoint |
| Int_t | pulserbox |
| Int_t | led |
| Int_t | pulse_height |
| Int_t | pulse_width |
| Int_t | period |
| Int_t | calibtype |
| Int_t | timestamp |
| Int_t | pulses |
| Int_t | crate |
| Int_t | chAdd |
| Int_t | vaarc |
| Int_t | vmm |
| Int_t | vaadc |
| Int_t | plane |
| Int_t | chip |
| Int_t | channel |
| Int_t | no_entries |
| Double_t | mean |
| Double_t | rms |
| VldTimeStamp | time |
| Int_t | first_time |
| Char_t | filename [256] |
| TFile * | outfile |
| TTree * | outtree |
| PlexHandle * | myplexhandle |
| Int_t | RunNo |
| Side * | sides [2] |
|
|
|
|
|
Definition at line 27 of file Detector.h. Referenced by Zbeam::GetWeight(). 00027 {
00028 kUnknown = 0x00,
00029 kNear = 0x01,
00030 kFar = 0x02,
00031 kCalDet = 0x04,
00032 kCalib = 0x04,
00033 kTestStand = 0x08,
00034 kMapper = 0x10
00035 } Detector_t;
|
|
|
Definition at line 5 of file detector.cxx. References channels, filename, first_time, gSystem(), InitialiseTree(), and outfile. 00006 {
00007 memset(channels,0,sizeof(channels));
00008 first_time=0;
00009
00010 const char *dir = gSystem->Getenv("LISUMMARY_OUTPUT_DIR");
00011 if (!dir) {
00012 cerr << "Set LISUMMARY_OUTPUT_DIR first!\n";
00013 exit(1);
00014 }
00015
00016 sprintf(filename,"%s/combined.root",dir);
00017 outfile = new TFile(filename,"NEW");
00018 if(!outfile->IsOpen()){
00019 cout << " ** file already exists, making different name ** " << endl;
00020 sprintf(filename,"%s/combined_1.root",dir);
00021 outfile = new TFile(filename,"NEW");
00022 }
00023 cout << " ** Created output file " << filename << " ** " << endl;
00024 InitialiseTree();
00025 cout << " ** Made detector ** " << endl;
00026 }
|
|
|
Definition at line 69 of file detector.h. References outfile. 00069 {
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;};
|
|
|
|
|
||||||||||||||||||||
|
Definition at line 120 of file detector.cxx. References Channel::AddEntry(), channels, RawChannelId::GetChAdd(), and RawChannelId::GetCrate(). Referenced by RawLILooker::Ana(). 00124 {
00125 Int_t channel_address=0;
00126 channel_address = (channelid.GetCrate()*6000) + channelid.GetChAdd();
00127
00128 if(channels[ channel_address ] ==0){
00129 channels[ channel_address ] = new Channel(channelid);
00130 }
00131
00132 channels[channel_address]->AddEntry(no_entries,mean,rms);
00133
00134 };
|
|
||||||||||||||||||||||||||||||||
|
Definition at line 51 of file Gryfindor/detector/detector.cxx. References Side::AddStats(), and sides. 00051 {
00052 if(sides[in_side] == 0)
00053 sides[in_side]=new Side(in_side);
00054 sides[in_side]->AddStats(in_plane,in_chip,in_channel,new_entries,new_mean,new_rms);
00055 };
|
|
|
Definition at line 44 of file Gryfindor/detector/detector.cxx. References Side::Clean(), and sides. 00044 {
00045 for(Int_t n=0;n<2;n++){
00046 if(sides[n] != 0)
00047 sides[n]->Clean();
00048 }
00049 };
|
|
||||||||||||
|
Definition at line 84 of file Gryfindor/detector/detector.cxx. References Side::FillChipHist(), and sides. 00084 {
00085 if(sides[side]!=0)
00086 sides[side]->FillChipHist(chiphist);
00087
00088 }
|
|
|
Definition at line 31 of file Gryfindor/detector/detector.cxx. References Side::FillMeanHist(), and sides. 00031 {
00032 for(Int_t n=0;n<2;n++)
00033 if(sides[n]!=0)
00034 sides[n]->FillMeanHist(meanhist);
00035
00036 };
|
|
||||||||||||||||||||
|
Definition at line 13 of file Gryfindor/detector/detector.cxx. References Side::FillStripHist(), and sides. 00013 {
00014
00015
00016 if(sides[side]!=0){
00017 sides[side]->FillStripHist(box,led,ratiohist);
00018 }
00019 else
00020 return 0;
00021 return 1;
00022 };
|
|
|
Definition at line 217 of file Gryfindor/detector/detector.cxx. Referenced by GetPixelEntries(), GetPixelMean(), and GetPixelRMS(). 00217 {
00218 int channelmap[] ={3,5,14,16,7,9,10,12,11,13,6,8,17,15,2,4};
00219
00220 return channelmap[pixel];
00221 };
|
|
|
Definition at line 223 of file Gryfindor/detector/detector.cxx. Referenced by GetPixelEntries(), GetPixelMean(), and GetPixelRMS(). 00223 {
00224 if(pmt == 0)
00225 return 0;
00226 if(pmt == 1)
00227 return 2;
00228 if(pmt == 2)
00229 return 1;
00230 };
|
|
||||||||||||||||||||
|
Definition at line 66 of file Gryfindor/detector/detector.cxx. References Side::GetEntries(), and sides. Referenced by GetPinEntries(), and GetPixelEntries(). 00066 {
00067 if(sides[in_side] != 0)
00068 return sides[in_side]->GetEntries(in_plane,in_chip,in_channel);
00069 return 0;
00070 };
|
|
||||||||||||||||||||
|
Definition at line 72 of file Gryfindor/detector/detector.cxx. References Side::GetMean(), and sides. Referenced by GetPinMean(), and GetPixelMean(). 00072 {
00073 if(sides[in_side] != 0)
00074 return sides[in_side]->GetMean(in_plane,in_chip,in_channel);
00075 return 0;
00076 };
|
|
||||||||||||||||
|
Definition at line 164 of file Gryfindor/detector/detector.cxx. References GetEntries(). 00164 {
00165
00166 if(box ==0){
00167 if(level == 0){
00168 return GetEntries(0,pin_locations_low_0[led],0,18);
00169 }
00170 if(level == 1)
00171 return GetEntries(0,pin_locations_high_0[led],1,18);
00172 }
00173
00174 if(box ==1){
00175 if(level == 0){
00176 return GetEntries(1,pin_locations_low_1[led],0,18);
00177 }
00178 if(level == 1)
00179 return GetEntries(1,pin_locations_high_1[led],1,18);
00180 }
00181
00182 if(box ==2){
00183 if(level == 0){
00184 return GetEntries(0,pin_locations_low_2[led],0,18);
00185 }
00186 if(level == 1)
00187 return GetEntries(0,pin_locations_high_2[led],1,18);
00188 }
00189
00190 if(box ==3){
00191 if(level == 0){
00192 return GetEntries(1,pin_locations_low_3[led],0,18);
00193 }
00194 if(level == 1)
00195 return GetEntries(1,pin_locations_high_3[led],1,18);
00196 }
00197 return 0;
00198 }
|
|
||||||||||||||||
|
Definition at line 90 of file Gryfindor/detector/detector.cxx. References GetMean(). 00090 {
00091 if(box ==0){
00092 if(level == 0){
00093 return GetMean(0,pin_locations_low_0[led],0,18);
00094 }
00095 if(level == 1)
00096 return GetMean(0,pin_locations_high_0[led],1,18);
00097 }
00098 if(box ==1){
00099 if(level == 0){
00100 return GetMean(1,pin_locations_low_1[led],0,18);
00101 }
00102 if(level == 1)
00103 return GetMean(1,pin_locations_high_1[led],1,18);
00104 }
00105
00106 if(box ==2){
00107 if(level == 0){
00108 return GetMean(0,pin_locations_low_2[led],0,18);
00109 }
00110 if(level == 1)
00111 return GetMean(0,pin_locations_high_2[led],1,18);
00112 }
00113 if(box ==3){
00114 if(level == 0){
00115 return GetMean(1,pin_locations_low_3[led],0,18);
00116 }
00117 if(level == 1)
00118 return GetMean(1,pin_locations_high_3[led],1,18);
00119 }
00120
00121 return 0;
00122 }
|
|
||||||||||||||||
|
Definition at line 124 of file Gryfindor/detector/detector.cxx. References GetRMS(). 00124 {
00125
00126 if(box ==0){
00127 if(level == 0){
00128 return GetRMS(0,pin_locations_low_0[led],0,18);
00129 }
00130 if(level == 1)
00131 return GetRMS(0,pin_locations_high_0[led],1,18);
00132 }
00133
00134 if(box ==1){
00135 if(level == 0){
00136 return GetRMS(1,pin_locations_low_1[led],0,18);
00137 }
00138 if(level == 1)
00139 return GetRMS(1,pin_locations_high_1[led],1,18);
00140 }
00141
00142 if(box ==2){
00143 if(level == 0){
00144 return GetRMS(0,pin_locations_low_2[led],0,18);
00145 }
00146 if(level == 1)
00147 return GetRMS(0,pin_locations_high_2[led],1,18);
00148 }
00149
00150 if(box ==3){
00151 if(level == 0){
00152 return GetRMS(1,pin_locations_low_3[led],0,18);
00153 }
00154 if(level == 1)
00155 return GetRMS(1,pin_locations_high_3[led],1,18);
00156 }
00157
00158 return 0;
00159 }
|
|
||||||||||||||||||||
|
Definition at line 206 of file Gryfindor/detector/detector.cxx. References GetChannel(), GetChip(), and GetEntries(). 00206 {
00207 return GetEntries(in_side,in_plane,GetChip(in_pmt),GetChannel(in_pixel));
00208 };
|
|
||||||||||||||||||||
|
Definition at line 209 of file Gryfindor/detector/detector.cxx. References GetChannel(), GetChip(), and GetMean(). Referenced by DrawFourPlanes(). 00209 {
00210 return GetMean(in_side,in_plane,GetChip(in_pmt),GetChannel(in_pixel));
00211
00212 };
|
|
||||||||||||||||||||
|
Definition at line 213 of file Gryfindor/detector/detector.cxx. References GetChannel(), GetChip(), and GetRMS(). Referenced by DrawFourPlanes(). 00213 {
00214 return GetRMS(in_side,in_plane,GetChip(in_pmt),GetChannel(in_pixel));
00215 };
|
|
||||||||||||||||||||
|
Definition at line 78 of file Gryfindor/detector/detector.cxx. References Side::GetRMS(), and sides. Referenced by GetPinRMS(), and GetPixelRMS(). 00078 {
00079 if(sides[in_side] != 0)
00080 return sides[in_side]->GetRMS(in_plane,in_chip,in_channel);
00081 return 0;
00082 };
|
|
||||||||||||||||||||||||
|
Definition at line 200 of file Gryfindor/detector/detector.cxx. References Side::GetStrip(), and sides. 00200 {
00201 if(sides[side]!=0)
00202 return sides[side]->GetStrip(plane,chip,channel,led);
00203 return -1;
00204
00205 };
|
|
|
Definition at line 138 of file detector.cxx. References calibpoint, calibtype, chAdd, channel, chip, crate, filename, led, mean, no_entries, outfile, outtree, period, plane, pulse_height, pulse_width, pulserbox, pulses, rms, timestamp, vaadc, vaarc, and vmm. Referenced by Detector(). 00138 {
00139 cout << " Making Tree " << endl;
00140 outfile = new TFile(filename,"RECREATE");
00141 outtree = new TTree("li_tree","li_tree");
00142
00143
00144 outtree->Branch("calibpoint",&calibpoint,"calibpoint/I",32000);
00145 outtree->Branch("pulserbox",&pulserbox,"pulserbox/I",32000);
00146 outtree->Branch("led",&led,"led/I",32000);
00147 outtree->Branch("pulse_height",&pulse_height,"pulse_height/I",32000);
00148 outtree->Branch("pulse_width",&pulse_width,"pulse_width/I",32000);
00149 outtree->Branch("period",&period,"period/I",32000);
00150 outtree->Branch("calibtype",&calibtype,"calibtype/I",32000);
00151 outtree->Branch("pulses",&pulses,"pulses/I",32000);
00152 outtree->Branch("timestamp",×tamp,"timestamp/I",32000);
00153
00154
00155 outtree->Branch("crate",&crate,"crate/I",32000);
00156 outtree->Branch("chAdd",&chAdd,"chAdd/I",32000);
00157 outtree->Branch("vaarc",&vaarc,"vaarc/I",32000);
00158 outtree->Branch("vmm",&vmm,"vmm/I",32000);
00159 outtree->Branch("vaadc",&vaadc,"vaadc/I",32000);
00160
00161
00162 outtree->Branch("plane",&plane,"plane/I",32000);
00163 outtree->Branch("chip",&chip,"chip/I",32000);
00164 outtree->Branch("channel",&channel,"channel/I",32000);
00165
00166 outtree->Branch("no_entries",&no_entries,"no_entries/I",32000);
00167 outtree->Branch("mean",&mean,"mean/D",32000);
00168 outtree->Branch("rms",&rms,"rms/D",32000);
00169
00170 cout <<" ** Made Tree ** " << endl;
00171
00172 };
|
|
||||||||||||
|
Definition at line 25 of file Gryfindor/detector/detector.cxx. References Side::RemoveDemons(), and sides. 00025 {
00026 for(Int_t n=0;n<2;n++)
00027 if(sides[n]!=0)
00028 sides[n]->RemoveDemons(box,led);
00029 };
|
|
||||||||||||||||||||||||||||||||
|
Definition at line 57 of file Gryfindor/detector/detector.cxx. References Side::SetStats(), and sides. Referenced by main(). 00057 {
00058 // cout << " here " << in_side << "\t" << in_plane << "\t" << in_chip << "\t" << in_channel <<endl;
00059 if(sides[in_side] == 0)
00060 sides[in_side]=new Side(in_side);
00061
00062 sides[in_side]->SetStats(in_plane,in_chip,in_channel,new_entries,new_mean,new_rms);
00063 }
|
|
||||||||||||||||||||||||||||||||||||||||
|
Definition at line 30 of file detector.cxx. References calibpoint, calibtype, chAdd, channel, channels, chip, crate, first_time, RawChannelId::GetChAdd(), Channel::GetChannelId(), RawChannelId::GetCrate(), Channel::GetEntries(), Channel::GetMean(), PlexSEIdAltL::GetPlane(), Channel::GetRMS(), VldTimeStamp::GetSec(), PlexHandle::GetSEIdAltL(), RawChannelId::GetVaAdcSel(), RawChannelId::GetVaChannel(), RawChannelId::GetVaChip(), RawChannelId::GetVarcId(), RawChannelId::GetVmm(), led, mean, myplexhandle, no_entries, outtree, period, plane, pulse_height, pulse_width, pulserbox, pulses, rms, time, timestamp, vaadc, vaarc, validity, and vmm. Referenced by RawLILooker::Ana(), Draw(), and DrawFourPlanes(). 00038 {
00039
00040
00041
00042 if(first_time==0){
00043 first_time=1;
00044 calibpoint = new_calibpoint;
00045 pulse_height = new_pulse_height;
00046 pulse_width = new_pulse_width;
00047 pulserbox = new_pulserbox;
00048 led = new_led;
00049 time = new_time;
00050 period = new_period;
00051 calibtype = new_calibtype;
00052 pulses = new_pulses;
00053
00054 cout << " ** Found first point " << new_pulserbox << " :: "
00055 << new_led << " at time " << new_time << " ** " << endl;
00056
00057 cout << " ** opening database ** " << endl;
00058 myplexhandle = new PlexHandle(validity);
00059
00060 }
00061
00062 if( (new_led != led)
00063 || (new_pulse_height != pulse_height)
00064 || (new_pulse_width != pulse_width)
00065 || (new_pulserbox != pulserbox)
00066 || (new_calibpoint != calibpoint)){
00067
00068 cout << " ** Found new point " << new_pulserbox << " :: "
00069 << new_led << " at time " << new_time << " ** " << endl;
00070
00071 // Write out data here...
00072 Int_t channel_address;
00073
00074 for(Int_t crate_loop=0;crate_loop<10;crate_loop++){
00075 for(Int_t chad_loop=0;chad_loop<6000;chad_loop++){
00076 channel_address = (crate_loop*6000) + chad_loop;
00077 if(channels[channel_address] !=0){
00078 timestamp = new_time.GetSec();
00079
00080 mean = channels[channel_address]->GetMean();
00081 rms = channels[channel_address]->GetRMS();
00082 no_entries = channels[channel_address]->GetEntries();
00083
00084 crate = channels[channel_address]->GetChannelId().GetCrate();
00085 chAdd = channels[channel_address]->GetChannelId().GetChAdd();
00086 vaarc = channels[channel_address]->GetChannelId().GetVarcId();
00087 vmm = channels[channel_address]->GetChannelId().GetVmm();
00088 vaadc = channels[channel_address]->GetChannelId().GetVaAdcSel();
00089
00090 chip = channels[channel_address]->GetChannelId().GetVaChip();
00091 channel = channels[channel_address]->GetChannelId().GetVaChannel();
00092 plane = myplexhandle->GetSEIdAltL(channels[channel_address]->GetChannelId()).GetPlane();
00093
00094 outtree->Fill();
00095 }
00096 }
00097 }
00098 // Clean all channels..
00099
00100 memset(channels,0,sizeof(channels));
00101
00102
00103
00104 first_time=1;
00105 calibpoint = new_calibpoint;
00106 pulse_height = new_pulse_height;
00107 pulse_width = new_pulse_width;
00108 pulserbox = new_pulserbox;
00109 led = new_led;
00110 period = new_period;
00111 calibtype = new_calibtype;
00112 pulses = new_pulses;
00113
00114
00115 }
00116
00117
00118 };
|
|
|
Definition at line 29 of file detector.h. Referenced by InitialiseTree(), and Update(). |
|
|
Definition at line 35 of file detector.h. Referenced by InitialiseTree(), and Update(). |
|
|
Definition at line 41 of file detector.h. Referenced by InitialiseTree(), and Update(). |
|
|
Definition at line 48 of file detector.h. Referenced by InitialiseTree(), and Update(). |
|
|
Definition at line 80 of file detector.h. Referenced by AddEntry(), Detector(), and Update(). |
|
|
Definition at line 47 of file detector.h. Referenced by InitialiseTree(), and Update(). |
|
|
Definition at line 40 of file detector.h. Referenced by InitialiseTree(), and Update(). |
|
|
Definition at line 58 of file detector.h. Referenced by Detector(), and InitialiseTree(). |
|
|
Definition at line 55 of file detector.h. Referenced by Detector(), and Update(). |
|
|
Definition at line 31 of file detector.h. Referenced by InitialiseTree(), and Update(). |
|
|
Definition at line 51 of file detector.h. Referenced by InitialiseTree(), and Update(). |
|
|
Definition at line 63 of file detector.h. Referenced by Update(). |
|
|
Definition at line 50 of file detector.h. Referenced by InitialiseTree(), and Update(). |
|
|
Definition at line 60 of file detector.h. Referenced by Detector(), and InitialiseTree(). |
|
|
Definition at line 61 of file detector.h. Referenced by InitialiseTree(), and Update(). |
|
|
Definition at line 34 of file detector.h. Referenced by InitialiseTree(), and Update(). |
|
|
Definition at line 46 of file detector.h. Referenced by InitialiseTree(), and Update(). |
|
|
Definition at line 32 of file detector.h. Referenced by InitialiseTree(), and Update(). |
|
|
Definition at line 33 of file detector.h. Referenced by InitialiseTree(), and Update(). |
|
|
Definition at line 30 of file detector.h. Referenced by InitialiseTree(), and Update(). |
|
|
Definition at line 37 of file detector.h. Referenced by InitialiseTree(), and Update(). |
|
|
Definition at line 52 of file detector.h. Referenced by InitialiseTree(), and Update(). |
|
|
Definition at line 64 of file detector.h. |
|
|
Definition at line 33 of file Gryfindor/detector/detector.h. Referenced by AddStats(), Clean(), FillChipHist(), FillMeanHist(), FillStripHist(), GetEntries(), GetMean(), GetRMS(), GetStrip(), RemoveDemons(), and SetStats(). |
|
|
Definition at line 54 of file detector.h. Referenced by Update(). |
|
|
Definition at line 36 of file detector.h. Referenced by InitialiseTree(), and Update(). |
|
|
Definition at line 44 of file detector.h. Referenced by InitialiseTree(), and Update(). |
|
|
Definition at line 42 of file detector.h. Referenced by InitialiseTree(), and Update(). |
|
|
Definition at line 25 of file detector.h. Referenced by RawLILooker::Ana(), and Update(). |
|
|
Definition at line 43 of file detector.h. Referenced by InitialiseTree(), and Update(). |
1.3.9.1