00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef DETECTOR_H
00011 #define DETECTOR_H
00012 #include "side.h"
00013 #include "RootHeaders.h"
00014 #include "channel.h"
00015
00016
00017 static const int pin_locations_low_1[]={30,25,26,17,13,9,29,0,22,10,21,1,14,18,33,5,2,28,37,34};
00018 static const int pin_locations_high_1[]={31,32,27,28,20,4,22,7,19,11,16,8,3,39,36,0,15,23,40,35};
00019
00020 static const int pin_locations_low_0[]={57,54,25,0,62,2,1,0,10,13,22,0,9,18,26,6,21,29,17,15};
00021 static const int pin_locations_high_0[]={64,63,16,59,55,19,2,23,11,20,7,8,28,15,31,27,24,32,12,3};
00022
00023 static const int pin_locations_low_2[]={126,0,0,74,0,66,122,82,90,0,0,0,0,78,70,94,0,0,86,0};
00024 static const int pin_locations_high_2[]={0,96,0,0,124,0,0,0,0,88,84,68,76,0,0,0,92,80,0,72};
00025
00026 static const int pin_locations_high_3[]={0,79,0,0,71,75,0,67,127,83,0,91,0,0,0,95,0,87,0,123};
00027 static const int pin_locations_low_3[]={69,0,73,125,0,0,121,0,0,0,65,0,89,81,77,0,93,0,85,0};
00028
00029
00030 class Detector{
00031
00032 protected:
00033 Side *sides[2];
00034
00035 public:
00036 Detector();
00037 void Clean();
00038
00039 void AddStats(Int_t in_side,
00040 Int_t in_plane,
00041 Int_t in_chip,
00042 Int_t in_channel,
00043 Int_t new_entries,
00044 Double_t new_mean,
00045 Double_t new_rms);
00046
00047 void SetStats(Int_t in_side,
00048 Int_t in_plane,
00049 Int_t in_chip,
00050 Int_t in_channel,
00051 Int_t new_entries,
00052 Double_t new_mean,
00053 Double_t new_rms);
00054
00055 Int_t GetEntries(Int_t in_side,Int_t in_plane,Int_t in_chip, Int_t in_channel);
00056 Double_t GetMean(Int_t in_side, Int_t in_plane,Int_t in_chip, Int_t in_channel);
00057 Double_t GetRMS(Int_t in_side, Int_t in_plane,Int_t in_chip, Int_t in_channel);
00058
00059 Double_t GetPinMean(Int_t box, Int_t led,Int_t level);
00060 Double_t GetPinRMS(Int_t box, Int_t led,Int_t level);
00061 Int_t GetPinEntries(Int_t box, Int_t led,Int_t level);
00062
00063 void RemoveDemons(Int_t box,Int_t led);
00064
00065 void FillMeanHist(TH1F *meanhist);
00066 Int_t FillStripHist(Int_t box,Int_t led,Int_t side, TH2F *ratiohist);
00067 void FillChipHist(Int_t side, TH2F *chiphist);
00068
00069
00070 Int_t GetStrip(Int_t side,Int_t plane, Int_t chip, Int_t channel, Int_t led);
00071
00072
00073 Int_t GetPixelEntries(Int_t in_side,Int_t in_plane,Int_t in_pmt, Int_t in_pixel);
00074 Double_t GetPixelMean(Int_t in_side,Int_t in_plane,Int_t in_pmt, Int_t in_pixel);
00075 Double_t GetPixelRMS(Int_t in_side, Int_t in_plane,Int_t in_pmt, Int_t in_pixel);
00076
00077 Int_t GetChip(Int_t pmt);
00078 Int_t GetChannel(Int_t pmt);
00079
00080 };
00081
00082
00083
00084 #endif