StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StTpcMixerMaker.cxx
1 /***************************************************************************
2  *
3  * $Id: StTpcMixerMaker.cxx,v 1.5 2018/10/17 20:45:27 fisyak Exp $
4  * $Log: StTpcMixerMaker.cxx,v $
5  * Revision 1.5 2018/10/17 20:45:27 fisyak
6  * Restore update for Run XVIII dE/dx calibration removed by Gene on 08/07/2018
7  *
8  * Revision 1.4 2014/06/26 21:31:42 fisyak
9  * New Tpc Alignment, v632
10  *
11  * Revision 1.3 2012/05/02 22:21:59 fisyak
12  * Remove requirement to have 2 and only 2 inputs
13  *
14  * Revision 1.2 2012/03/20 15:43:30 fisyak
15  * Ignore Input1/2 setting, find Event data sets from chain in order which they have been instantiated, bug 2299
16  *
17  * Revision 1.1 2008/07/31 20:45:27 fisyak
18  * Add TpcMixer
19  *
20  **************************************************************************/
21 #include "StTpcMixerMaker.h"
22 #include "StMessMgr.h"
23 #include "StTpcRawData.h"
24 #include "TSystem.h"
25 ClassImp(StTpcMixerMaker)
26 //______________________________________________________________________________
27 Int_t StTpcMixerMaker::Make() {
28  StTpcRawData *inputs[2] = {0, 0};
29  TDataSetIter next(StMaker::GetTopChain(),9999);
30  TDataSet *set = 0;
31  Int_t nfound = 0;
32  while (( set = next()) && nfound < 2) {//loop over makers/data sets
33  TString Path(gSystem->BaseName(set->Path()));
34  if (Path != "Event") continue;
35  TObjectSet *event = dynamic_cast<TObjectSet *>(set);
36  if (! event) continue;
37  inputs[nfound] = dynamic_cast<StTpcRawData *>(event->GetObject());
38  if (! inputs[nfound]) continue;
39  LOG_INFO << "Found \t" << Path << " in " << set->Path() << "\tas Input" << nfound+1 << endm;
40  nfound++;
41  }
42  if (nfound == 2) {
43  *inputs[0] += *inputs[1];
44  } else {
45  LOG_ERROR << "Found " << nfound << " Makers with StTpcRawData Event" << endm;
46  if (! nfound) return kStERR;
47  }
48  return kStOK;
49 }
50 
51 
Definition: Stypes.h:40
virtual TString Path() const
return the full path of this data set
Definition: TDataSet.cxx:626
Definition: Stypes.h:45