ROOTANA
Loading...
Searching...
No Matches
TAnaManager.cxx
Go to the documentation of this file.
1#include "TAnaManager.hxx"
2#include "TV1720RawData.h"
3#include "TRB3Decoder.hxx"
4
6
7#ifdef USE_V792
9#endif
10
11#ifdef USE_V1190
13#endif
14
15#ifdef USE_L2249
17#endif
18
19#ifdef USE_AGILENT
21#endif
22
23#ifdef USE_V1720
24
26
27 fV1720PHCompare = new TH2F("V1720PHCompare","Pulse Height: Channel 1 vs 0",100,300,700,100,300,700);
28 fV1720PHCompare->SetXTitle("Channel 0");
29 fV1720PHCompare->SetYTitle("Channel 1");
30 fV1720TimeCompare = new TH2F("V1720TimeCompare","Time: Channel 1 vs 0",100,0,2000,100,0,2000);
31 fV1720TimeCompare->SetXTitle("Channel 0");
32 fV1720TimeCompare->SetYTitle("Channel 1");
33#endif
34
35#ifdef USE_V1720
37#endif
38
39#ifdef USE_V1730DPP
41#endif
42
43#ifdef USE_V1730RAW
45#endif
46
47#ifdef USE_DT724
49#endif
50
51#ifdef USE_TRB3
52 // Set the TDC linear calibration values
57#endif
58
59#ifdef USE_CAMACADC
61#endif
62
63
64
65};
66
67
69 histo->DisableAutoUpdate();
70
71 //histo->CreateHistograms();
72 fHistos.push_back(histo);
73
74}
75
76
78
79 // Fill all the histograms
80 for (unsigned int i = 0; i < fHistos.size(); i++) {
81 // Some histograms are very time-consuming to draw, so we can
82 // delay their update until the canvas is actually drawn.
83 if (!fHistos[i]->IsUpdateWhenPlotted()) {
84 fHistos[i]->UpdateHistograms(dataContainer);
85 }
86 }
87
88 if(1){
89
90 TV1720RawData *v1720 = dataContainer.GetEventData<TV1720RawData>("W200");
91
92 if(v1720 && !v1720->IsZLECompressed()){
93
94 double time[2],ph[2];
95
96 for(int i = 0; i < 2; i++){ // loop first two channels
97
98 TV1720RawChannel channelData = v1720->GetChannelData(i);
99 if(channelData.GetNSamples() <= 0) continue;
100
101 double max_adc_value = -1.0;
102 double max_adc_time = -1;
103 for(int j = 0; j < channelData.GetNSamples(); j++){
104 double adc = channelData.GetADCSample(j);
105 if(adc > max_adc_value){
106 max_adc_value = adc;
107 max_adc_time = j * 4.0; // 4ns per bin
108 }
109 }
110 time[i] = max_adc_time;
111 ph[i] = max_adc_value;
112 //std::cout << i << " " << max_adc_time << " " << max_adc_value << std::endl;
113 }
114#ifdef USE_V1720
115 fV1720PHCompare->Fill(ph[0],ph[1]);
116 fV1720TimeCompare->Fill(time[0],time[1]);
117#endif
118 }
119 }
120 return 1;
121}
122
123
124// Little trick; we only fill the transient histograms here (not cumulative), since we don't want
125// to fill histograms for events that we are not displaying.
126// It is pretty slow to fill histograms for each event.
128 std::vector<THistogramArrayBase*> histos = GetHistograms();
129
130 for (unsigned int i = 0; i < histos.size(); i++) {
131 if (histos[i]->IsUpdateWhenPlotted()) {
132 histos[i]->UpdateHistograms(dataContainer);
133 }
134 }
135}
136
137
Class for making histograms of Agilent ampere data.
TH2F * fV1720PHCompare
std::vector< THistogramArrayBase * > fHistos
TH2F * fV1720TimeCompare
int ProcessMidasEvent(TDataContainer &dataContainer)
Processes the midas event, fills histograms, etc.
void UpdateTransientPlots(TDataContainer &dataContainer)
std::vector< THistogramArrayBase * > GetHistograms()
void AddHistogram(THistogramArrayBase *histo)
Class for making histograms of Camac 12-chan ADC data.
Class for making histograms of raw DT724 waveforms;.
T * GetEventData(const char *name)
Add a templated function that returns event data in the format that we want.
void DisableAutoUpdate(bool DisableautoUpdate=true)
Class for making histograms of L2249 ADC data.
Class for making diff histograms of TRB3 FPGA-TDC data.
Class for making histograms of TRB3 raw fine times .
Class for making histograms of TRB3 FPGA-TDC data.
Class for making histograms of V1190 TDC data.
int GetNSamples() const
Get the ADC sample for a particular bin (for uncompressed data).
int GetADCSample(int i) const
Get the ADC sample for a particular bin (for uncompressed data).
TV1720RawChannel GetChannelData(int i)
Get Channel Data.
bool IsZLECompressed() const
Is the V1720 data ZLE compressed?
Class for making histogram of V1730 waveforms (with DPP event encoding)
Class for making histogram of raw V1730Dpp waveforms.
Class for making histograms of V792 ADC data.
static Trb3Calib & getInstance()
void SetTRB3LinearCalibrationConstants(float low_value, float high_value)