11 #include "TClonesArray.h"
19 fBranchName(branchName),
20 fClassName(className),
22 fActivateBuffering(kTRUE),
39 std::cout <<
"Before removing: ";
47 std::cout <<
"After removing: ";
55 std::cout <<
"DeadTime map after readout time: " << time << std::endl;
69 std::vector<FairTimeStamp*>
data;
72 std::cout <<
"-I- FairWriteoutBuffer::WriteOutData for time: " << time << std::endl;
78 std::cout <<
"-E- FairWriteoutBuffer::WriteOutData " <<
fBranchName <<
" array is not available!" << std::endl;
81 std::cout <<
"-I- FairWriteoutBuffer::WriteOutData size: " << data.size() << std::endl;
83 for (
int i = 0; i < data.size(); i++) {
86 std::cout << i <<
" : ";
88 std::cout << std::endl;
101 double ultimateTime = 0;
114 if (ultimateTime > 0) {
122 typedef std::multimap<double, FairTimeStamp*>::iterator DTMapIter;
123 std::vector<FairTimeStamp*> result;
126 std::cout <<
"-I- GetRemoveOldData: DeadTime: " <<
it->first <<
" Data: " <<
it->second << std::endl;
128 result.push_back(
it->second);
147 std::cout <<
"StartTime: " << startTime << std::endl;
149 std::pair<double, FairTimeStamp*> timeData(activeTime, dataClone);
150 fStartTime_map.insert(std::pair<
double, std::pair<double, FairTimeStamp*> >(startTime, timeData));
162 typedef std::multimap<double, FairTimeStamp*>::iterator DTMapIter;
163 typedef std::map<FairTimeStamp, double>::iterator DataMapIter;
167 if(timeOfOldData > -1) {
169 std::cout <<
" OldData found! " << timeOfOldData << std::endl;
172 std::cout <<
"New Data: " << activeTime <<
" : " << data << std::endl;
174 double currentdeadtime = timeOfOldData;
176 bool dataFound =
false;
180 oldData =
it->second;
182 std::cout <<
"Check Data: " <<
it->first <<
" : " << oldData << std::endl;
184 if (oldData->
equal(data)) {
186 std::cout <<
" oldData == data " << std::endl;
189 std::cout <<
it->first <<
" : " <<
it->second << std::endl;
198 if (dataFound ==
true) {
199 std::vector<std::pair<double, FairTimeStamp*> > modifiedData =
Modify(std::pair<double, FairTimeStamp*>(currentdeadtime, oldData), std::pair<double, FairTimeStamp*>(-1, data));
200 for (
int i = 0; i < modifiedData.size(); i++) {
203 std::cout << i <<
" :Modified Data: " << modifiedData[i].first <<
" : " << modifiedData[i].second << std::endl;
207 std::cout <<
"-E- FairWriteoutBuffer::FillDataToDeadTimeMap: old data present in dataMap but not in deadTimeMap!" << std::endl;
212 std::cout <<
"-I- FairWriteoutBuffer::FillDataToDeadTimeMap Data Inserted: " << activeTime <<
" : ";
214 std::cout << std::endl;
216 fDeadTime_map.insert(std::pair<double, FairTimeStamp*>(activeTime, data));
228 typedef std::multimap<double, std::pair<double, FairTimeStamp*> >::iterator startTimeMapIter;
231 for (startTimeMapIter iter =
fStartTime_map.begin(); iter != stopTime; iter++) {
232 std::pair<double, FairTimeStamp*>
data = iter->second;
241 typedef std::multimap<double, std::pair<double, FairTimeStamp*> >::iterator startTimeMapIter;
242 std::cout <<
"StartTimeMap: " << std::endl;
245 std::cout <<
" | " << iter->first <<
"/" << data->
GetTimeStamp();
247 std::cout <<
" |" << std::endl;
252 typedef std::multimap<double, FairTimeStamp*>::iterator DTMapIter;
253 std::cout <<
"DeadTimeMap: " << std::endl;
255 std::cout <<
it->first <<
" / ";
257 std::cout << std::endl;
259 std::cout << std::endl;