53 "MCommonOnlineDisplayPlots",
76 for(std::map<std::string, std::string>::iterator mapIter = bank_to_detector_map.begin();
77 mapIter != bank_to_detector_map.end(); mapIter++) {
79 std::string bankname = mapIter->first;
82 int n_digitizer_bits = 0;
84 n_digitizer_bits = 12;
86 n_digitizer_bits = 14;
88 n_digitizer_bits = 12;
90 long max_adc_value = std::pow(2, n_digitizer_bits);
93 std::string histname =
"h" + bankname +
"_Heights";
94 std::string histtitle =
"Plot of the pulse heights in the " + detname +
" channels";
95 TH1I* hPulseHeights =
new TH1I(histname.c_str(), histtitle.c_str(), max_adc_value,0,max_adc_value);
96 hPulseHeights->GetXaxis()->SetTitle(
"Pulse Height [ADC value]");
97 hPulseHeights->GetYaxis()->SetTitle(
"Number of Pulses");
98 height_histograms_map[bankname] = hPulseHeights;
101 histname =
"h" + bankname +
"_Times";
102 histtitle =
"Plot of the pulse times in the " + detname +
" channels";
103 TH1I* hPulseTimes =
new TH1I(histname.c_str(), histtitle.c_str(), 2000, 0, 2e8);
104 hPulseTimes->GetXaxis()->SetTitle(
"Time");
105 hPulseTimes->GetYaxis()->SetTitle(
"Number of Pulses");
106 time_histograms_map[bankname] = hPulseTimes;
109 histname =
"h" + bankname +
"_Shapes";
110 histtitle =
"Plot of the pulse shapes in the " + detname +
" channels";
111 TH2D* hPulseShapes =
new TH2D(histname.c_str(), histtitle.c_str(), 400,-0.5,399.5,max_adc_value+1,0,max_adc_value+1);
112 hPulseShapes->GetXaxis()->SetTitle(
"Time Stamp");
113 hPulseShapes->GetYaxis()->SetTitle(
"ADC Value");
114 shape_histograms_map[bankname] = hPulseShapes;
117 histname =
"h" + bankname +
"_LatestPulse";
118 histtitle =
"Plot of the latest pulse in the " + detname +
" channels";
119 TH1I* hLatestPulse =
new TH1I(histname.c_str(), histtitle.c_str(), 64,-0.5,63.5);
120 hLatestPulse->GetXaxis()->SetTitle(
"Time Stamp");
121 hLatestPulse->GetYaxis()->SetTitle(
"ADC Value");
122 latest_pulse_histograms_map[bankname] = hLatestPulse;
127 std::string histname =
"hPulseRawCount";
128 std::string histtitle =
"Plot of the raw counts in each channels";
129 hPulseRawCount =
new TH1I(histname.c_str(), histtitle.c_str(), 1,0,1);
141 for(std::map<std::string, std::string>::iterator mapIter = bank_to_detector_map.begin();
142 mapIter != bank_to_detector_map.end(); mapIter++) {
144 std::string bankname = mapIter->first;
145 height_histograms_map[bankname]->Reset();
146 time_histograms_map[bankname]->Reset();
147 shape_histograms_map[bankname]->Reset();
148 latest_pulse_histograms_map[bankname]->Reset();
161 int midas_event_number = pheader->serial_number;
165 typedef pair<string, vector<TPulseIsland*> > TStringPulseIslandPair;
166 typedef map<string, vector<TPulseIsland*> >::iterator map_iterator;
170 TStringPulseIslandMap& pulse_islands_map =
174 for (map_iterator theMapIter = pulse_islands_map.begin(); theMapIter != pulse_islands_map.end(); theMapIter++)
176 std::string bankname = theMapIter->first;
178 std::vector<TPulseIsland*> thePulses = theMapIter->second;
181 for (std::vector<TPulseIsland*>::iterator pulseIter = thePulses.begin(); pulseIter != thePulses.end(); pulseIter++) {
185 bool underflow =
false;
186 if (shape_histograms_map.find(bankname) != shape_histograms_map.end()) {
187 TH2* shape_histogram = shape_histograms_map[bankname];
188 TH1* latest_pulse_histogram = latest_pulse_histograms_map[bankname];
190 latest_pulse_histogram->Reset();
192 std::vector<int> theSamples = (*pulseIter)->GetSamples();
193 for (std::vector<int>::iterator sampleIter = theSamples.begin(); sampleIter != theSamples.end(); sampleIter++) {
194 int sample_number = sampleIter - theSamples.begin();
195 int sample_value = *sampleIter;
197 if (sample_value == 4096) {
201 shape_histogram->Fill(sample_number, sample_value);
202 latest_pulse_histogram->SetBinContent(sample_number, sample_value);
206 if (underflow ==
false) {
207 if (height_histograms_map.find(bankname) != height_histograms_map.end())
208 height_histograms_map[bankname]->Fill((*pulseIter)->GetPulseHeight());
210 if (time_histograms_map.find(bankname) != time_histograms_map.end())
211 time_histograms_map[bankname]->Fill((*pulseIter)->GetPulseTime());