00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00016
00017 #ifndef LISUMMARYSORTER_H
00018 #define LISUMMARYSORTER_H
00019
00020 #include <vector>
00021 #include <map>
00022 #include <string>
00023
00024 #include "TFile.h"
00025 #include "TTree.h"
00026
00027 #include "Validity/VldTimeStamp.h"
00028 #include "Validity/VldContext.h"
00029 #include "RawData/RawChannelId.h"
00030 #include "Plex/PlexHandle.h"
00031
00032 #include "LISummary/LIChannel.h"
00033 #include "LISummary/LILookup.h"
00034
00035 class LISummarySorter{
00036
00037 public:
00038
00039 LISummarySorter();
00040 ~LISummarySorter();
00041
00042 void AddEntry(RawChannelId channelid,
00043 Float_t mean,
00044 Float_t rms,
00045 Int_t numEntries);
00046 void CloseFile(TFile* outfile);
00047 void CountNumSummaries(Int_t num){rawSummaryCounter+=num;};
00048 void GetElectronicsData(Int_t channel);
00049 void GetMuxBoxInfo(PlexPinDiodeId plexPinDiodeId);
00050 void GetMuxBoxInfo(PlexPixelSpotId plexPixelSpotId);
00051 TFile* OpenFile(Int_t runNumber,Int_t runNumberSub,
00052 Int_t detectorType);
00053 void OutputData();
00054 void PrintRecoSummary();
00055 void ReconstructStripEnd(Int_t channel);
00056 Bool_t ReconstructPin(Int_t channel);
00057 void ReconstructTrigPmt();
00058 void ResetTreeVariables();
00059 void SetDetector(VldContext vldC);
00060 void SetRawDaqVldCtx(VldContext vldC);
00061 void SetRunNumber(Int_t runNum){runNumber=runNum;};
00062 void SetRunNumberSub(Short_t runNumSub){runNumberSub=static_cast
00063 <Int_t>(runNumSub);};
00064 void SetRunType(Short_t runT){runType=static_cast<Int_t>(runT);};
00065
00066 void SetPlexHandle(VldContext vldC);
00067 Bool_t Update(Int_t led,Int_t pulseHeight,Int_t pulseWidth,
00068 Int_t pulserBox,Int_t calibPoint,VldTimeStamp time,
00069 Int_t calibType,Int_t pulses,Int_t period);
00070 void WriteFile(TFile* outfile);
00071
00072 private:
00073
00074
00075 void InitialiseTree();
00076 void SetLIVariables(Int_t led,Int_t pulseHeight,Int_t pulseWidth,
00077 Int_t pulserBox,Int_t calibPoint,
00078 VldTimeStamp time,Int_t calibType,Int_t pulses,
00079 Int_t period);
00080
00081
00082 string GetElecString() const;
00083 string GetElecString(RawChannelId rChId) const;
00084 void PrintBigMessage() const;
00085 void PrintBlockInfo(string preString) const;
00086
00087
00088 Int_t ashtray;
00089 Int_t badHitCounter;
00090 Int_t calibPoint;
00091 Int_t calibType;
00092 Int_t cerenkovCounter;
00093 Int_t chAdd;
00094 Int_t channel;
00095 std::vector<LIChannel> channels;
00096 Int_t chip;
00097 Int_t commonModeCounter;
00098 Int_t correlatedHit;
00099 Int_t crate;
00100 std::map<Int_t,Int_t> crates;
00101 Int_t detectorType;
00102 Int_t eastWest;
00103 Int_t elecType;
00104 Int_t farLed;
00105 Int_t farPulserBox;
00106 string filename;
00107 Int_t first_time;
00108 Int_t inRack;
00109 Int_t geoAdd;
00110 Int_t goodHitCounter;
00111 Int_t led;
00112 std::map<Int_t,Int_t> leds;
00113 LILookup fLookup;
00114 Int_t fMasterCh;
00115 Float_t mean;
00116 Int_t fMinderCh;
00117 PlexHandle *plexHandle;
00118 Int_t nearLed;
00119 Int_t nearPulserBox;
00120 Int_t numEntries;
00121 Int_t numericMuxBox;
00122 TTree *outtree;
00123 TFile *outputFile;
00124 Float_t fPe;
00125 Int_t period;
00126 Int_t pixel;
00127 Int_t pinCounter;
00128 std::map<Int_t,Int_t> pinCounterReco;
00129 Int_t pinGain;
00130 Int_t pinInBox;
00131 Int_t plane;
00132 std::map<Int_t,Int_t> plexOppPbCounter;
00133 std::map<Int_t,Int_t> plexPbCounter;
00134 Int_t pulseHeight;
00135 Int_t pulserBox;
00136 std::map<Int_t,Int_t> pulserBoxes;
00137 Int_t pulses;
00138 Int_t pulseWidth;
00139 Int_t rackBay;
00140 Int_t rackLevel;
00141 VldContext fRawDaqVldCtx;
00142 Int_t rawSummaryBlockCounter;
00143 Int_t rawSummaryCounter;
00144 Int_t readoutType;
00145 Int_t runNumber;
00146
00147
00148
00149 Int_t runNumberSub;
00150 Int_t runType;
00151 Float_t rms;
00152 Int_t strip;
00153 Int_t stripCounter;
00154 Int_t fStripEnd;
00155 Int_t summaryCounter;
00156 VldTimeStamp time;
00157 Int_t timestamp;
00158 Int_t timestampNanoSec;
00159 Int_t timingFidCounter;
00160 Int_t tofCounter;
00161 Int_t triggerOrCounter;
00162 Int_t trigPmtCounter;
00163 Int_t unconnectedPixelCounter;
00164 Int_t unknownCounter;
00165 VldContext validity;
00166 Int_t varc;
00167 Int_t vfb;
00168 Int_t vmm;
00169 };
00170
00171 #endif
00172