00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #include "StTpcMixerMaker.h"
00016 #include "StMessMgr.h"
00017 #include "StTpcRawData.h"
00018 #include "TSystem.h"
00019 ClassImp(StTpcMixerMaker)
00020
00021 Int_t StTpcMixerMaker::Make() {
00022 StTpcRawData *inputs[2] = {0, 0};
00023 TDataSetIter next(StMaker::GetTopChain(),9999);
00024 TDataSet *set = 0;
00025 Int_t nfound = 0;
00026 while (( set = next()) && nfound < 2) {
00027 TString Path(gSystem->BaseName(set->Path()));
00028 if (Path != "Event") continue;
00029 TObjectSet *event = dynamic_cast<TObjectSet *>(set);
00030 if (! event) continue;
00031 inputs[nfound] = dynamic_cast<StTpcRawData *>(event->GetObject());
00032 if (! inputs[nfound]) continue;
00033 LOG_INFO << "Found \t" << Path << " in " << set->Path() << "\tas Input" << nfound+1 << endm;
00034 nfound++;
00035 if (nfound == 2) break;
00036 }
00037 if (nfound==2) {
00038 *inputs[0] += *inputs[1];
00039 } else {
00040 LOG_INFO << "Found only " << nfound << " Event with StTpcRawData ==> Do nothing!" << endm;
00041 }
00042 return kStOK;
00043 }
00044
00045