2 # include "evpReader.hh"
3 # include "emcReader.h"
4 # include "trgReader.h"
6 # include "DAQ_READER/daqReader.h"
7 # include "DAQ_READER/daq_dta.h"
8 # include "DAQ_EMC/daq_emc.h"
9 # include "DAQ_ETOW/daq_etow.h"
10 # include "DAQ_ESMD/daq_esmd.h"
11 # include "DAQ_TRG/daq_trg.h"
12 # include "DAQ_READER/evpReaderClass.h"
13 # include "DAQ_EMC/emcReader.h"
14 # include <RTS/include/daqFormats.h>
17 #include <TObjArray.h>
19 #include "StEEmcUtil/database/StEEmcDb.h"
21 #include "EEMCPlots.h"
22 #include "EEqaSorter.h"
23 #include "Tonko2Ezt.h"
28 void EEMCPlots::initHisto(TObjArray *list,
const char *eemcDbDump,
const char *eemcPathIn,
const char *eemcPathOut) {
29 if (EEMCPlotsInstance)
delete EEMCPlotsInstance; EEMCPlotsInstance = 0;
30 EEMCPlotsInstance =
new EEMCPlots(list, eemcDbDump, eemcPathIn, eemcPathOut);
31 if (EEMCPlotsInstance) {
32 EEMCPlotsInstance->resetHistograms();
36 void EEMCPlots::resetHisto() {
37 if (EEMCPlotsInstance) {
38 EEMCPlotsInstance->resetHistograms();
42 void EEMCPlots::saveHisto(TFile *hfile) {
43 if (EEMCPlotsInstance) {
44 EEMCPlotsInstance->saveHistograms(hfile);
48 void EEMCPlots::fillHisto(
char *rdr
49 ,
const unsigned char * dsm0inp
50 ,
const unsigned short int * dsm1inp
51 ,
const unsigned short int * dsm2inp
52 ,
const unsigned short int * dsm3inp
54 if (EEMCPlotsInstance) {
55 EEMCPlotsInstance->processEvent(rdr, dsm0inp, dsm1inp, dsm2inp, dsm3inp);
59 EEMCPlots::EEMCPlots(TObjArray *list,
const char *eemcDbDump,
const char *eemcPathIn,
const char *eemcPathOut)
63 eeDb->setSectors(1, 12);
64 eeDb->setAsciiDatabase(eemcDbDump);
67 eeqa->setPath(eemcPathIn, eemcPathOut);
68 eeqa->initHisto(list, 200,1000);
74 EEMCPlots::~EEMCPlots() {
75 if (eeqa)
delete eeqa;
76 if (eeDb)
delete eeDb;
81 void EEMCPlots::resetHistograms() {
82 if (eeqa) eeqa->resetHisto();
85 void EEMCPlots::saveHistograms(TFile *hfile) {
86 if (eeqa) eeqa->saveHisto(hfile);
89 void EEMCPlots::processEvent(
char *datap
90 ,
const unsigned char * dsm0inp
91 ,
const unsigned short int * dsm1inp
92 ,
const unsigned short int * dsm2inp
93 ,
const unsigned short int * dsm3inp
99 int ret = emcReader(datap);
102 #ifdef NEW_DAQ_READER
103 unsigned int runId = rdr->run;
104 unsigned int token = rdr->token;
109 unsigned int runId = evp->run;
110 unsigned int token = evp->token;
117 eeqa->sort(ezt.eETowPresent ? &ezt.eETow : 0, ezt.eESmdPresent ? &ezt.eESmd : 0, runId, token, TRG_VERSION, dsm0inp, dsm1inp, dsm2inp, dsm3inp);