25 #include "TOctalFADCIsland.h"
26 #include "TOctalFADCBankReader.h"
52 "MPulseTimeSeparation",
72 for(std::map<std::string, std::string>::iterator mapIter = bank_to_detector_map.begin();
73 mapIter != bank_to_detector_map.end(); mapIter++) {
76 std::string histname =
"h" + detname +
"_PulseSeparation";
77 std::string histtitle =
"Plot of the time difference between consecutive pulses for the " + detname +
" detector";
78 TH1I* hPulseTimeDiff =
new TH1I(histname.c_str(),histtitle.c_str(),200,0,200);
79 hPulseTimeDiff->GetXaxis()->SetTitle(
"Time Difference Between Consecutive Pulses [ms]");
80 hPulseTimeDiff->GetYaxis()->SetTitle(
"Number of pulse pairs");
81 hPulseTimeDiff->SetBit(TH1::kCanRebin);
83 time_separation_histogram_map[mapIter->first] = hPulseTimeDiff;
85 histname =
"h" + detname +
"_PulseSeparationWRTFirstPulse";
86 histtitle =
"Plot of the time difference wrt the first pulse for the " + detname +
" detector";
87 hPulseTimeDiff =
new TH1I(histname.c_str(), histtitle.c_str(),200,0,200);
88 hPulseTimeDiff->GetXaxis()->SetTitle(
"Time Difference Between wrt the First Pulse [ms]");
89 hPulseTimeDiff->GetYaxis()->SetTitle(
"Number of pulse pairs");
90 hPulseTimeDiff->SetBit(TH1::kCanRebin);
92 time_separation_wrt_first_pulse_histogram_map[mapIter->first] = hPulseTimeDiff;
104 int midas_event_number = pheader->serial_number;
108 typedef pair<string, vector<TPulseIsland*> > TStringPulseIslandPair;
109 typedef map<string, vector<TPulseIsland*> >::iterator map_iterator;
113 TStringPulseIslandMap& pulse_islands_map =
117 for (map_iterator theMapIter = pulse_islands_map.begin(); theMapIter != pulse_islands_map.end(); theMapIter++)
119 std::string bankname = theMapIter->first;
120 std::vector<TPulseIsland*> thePulses = theMapIter->second;
123 for (std::vector<TPulseIsland*>::iterator thePulseIter = thePulses.begin(); thePulseIter != thePulses.end(); thePulseIter++) {
126 if (thePulseIter!=thePulses.begin())
127 time_separation_histogram_map[bankname]->Fill( ((*thePulseIter)->GetTimeStamp() - (*(thePulseIter-1))->GetTimeStamp()) * (*thePulseIter)->GetClockTickInNs() * 1e-6);
129 int initial_time_stamp = (*thePulses.begin())->GetTimeStamp();
131 double pulse_frequency = 65;
132 double pulse_period = (1 / pulse_frequency) * 1e9;
134 if (initial_time_stamp * (*thePulseIter)->GetClockTickInNs() > pulse_period) {
135 initial_time_stamp += pulse_period / (*thePulseIter)->GetClockTickInNs();
138 time_separation_wrt_first_pulse_histogram_map[bankname]->Fill( ((*thePulseIter)->GetTimeStamp() - initial_time_stamp) * (*thePulseIter)->GetClockTickInNs() * 1e-6);