29 #include "StFpdMaker.h"
31 #include "StEventTypes.h"
33 #include "StDaqLib/FPD/FPD_Reader.hh"
34 #include "StDAQMaker/StDAQReader.h"
46 StFpdMaker::~StFpdMaker(){}
50 Int_t StFpdMaker::Init(){
51 return StMaker::Init();
59 cout <<
"===========FPDP_DEBUG=========================================" << endl;
65 mEvent = (
StEvent *) GetInputDS(
"StEvent");
68 cout <<
"StFpdMaker found no StEvent... Create local StEvent" << endl;
75 fpdCollection = mEvent->fpdCollection();
76 if(fpdCollection != 0) {
79 cout <<
"StFpdMaker fpdCollection does not exist" << endl;
80 cout <<
"StFpdMaker creating fpdCollection in StEvent ... ";
82 mEvent->setFpdCollection(fpdCollection);
83 fpdCollection = mEvent->fpdCollection();
84 if (fpdCollection) cout <<
"OK"<< endl;
86 cout <<
"FAILED" << endl;
96 cout <<
"StFpdMaker found no StTriggerDetectorCollection... Create and add" << endl;
98 mEvent->setTriggerDetectorCollection(trg);
103 cout <<
"StFapdMaker getting data from FPDDAQ Reader ... " << endl;
104 St_DataSet* daqReaderDS = GetDataSet(
"StDAQReader");
106 cout <<
"StFpdMaker No StDAQReader dataset. Event skipped" << endl;
111 cout <<
"StFpdMaker No StDAQReader object. Event skipped" << endl;
114 if (!(daqReader->FPDPresent())) {
115 cout <<
"StFpdMaker FPD is not in datastream. Event skipped" << endl;
120 cout <<
"StFpdMaker Failed to getFpdReader()...." << endl;
126 fpdCollection->setToken(fpdReader->GetEventNumber());
127 for (
unsigned int i=0;i<fpdCollection->numberOfADC();i++){
128 fpdCollection->setAdc(i,fpdReader->GetAdc(i));
130 for (
unsigned int i=0;i<fpdCollection->numberOfTDC();i++){
131 fpdCollection->setTdc(i,fpdReader->GetTdc(i));
133 for (
unsigned int i=0;i<fpdCollection->numberOfRegisters();i++){
134 fpdCollection->setRegister(i,fpdReader->GetReg(i));
136 for (
unsigned int i=0;i<fpdCollection->numberOfPedestal();i++){
137 fpdCollection->setPedestal(i,fpdReader->GetPed(i));
139 for (
unsigned int i=0;i<fpdCollection->numberOfScalers();i++){
140 fpdCollection->setScaler(i,fpdReader->GetScl(i));
143 for (
unsigned int i=0;i<32;i++){
144 bbcTriggerDetector.setAdc(i,fpdReader->GetBbcAdc(i));
145 bbcTriggerDetector.setTdc(i,fpdReader->GetBbcAdc(i+32));
147 for (
unsigned int i=0;i<bbcTriggerDetector.numberOfRegisters();i++){
148 bbcTriggerDetector.setRegister(i,fpdReader->GetBbcAdc(i+64));
150 for (
unsigned int i=0;i<bbcTriggerDetector.numberOfPedestalData();i++){
151 bbcTriggerDetector.setPedestal(i,fpdReader->GetBbcPed(i));
153 for (
unsigned int i=0;i<bbcTriggerDetector.numberOfScalars();i++){
154 bbcTriggerDetector.setScalar(i,fpdReader->GetBbcScl(i));
virtual void AddData(TDataSet *data, const char *dir=".data")
User methods.
virtual TObject * GetObject() const
The depricated method (left here for the sake of the backward compatibility)