54 void BeginRun(
int transition,
int run,
int time){
57 fTree =
new TTree(
"midas_data",
"MIDAS data");
63 fTree->Branch(
"nchannels",&nchannels,
"nchannels/I");
64 fTree->Branch(
"adc_value",adc_value,
"adc_value[nchannels]/I");
70 void EndRun(
int transition,
int run,
int time){
88 for(
int i = 0; i < nchannels;i++) adc_value[i] = 0;
92 for(
unsigned int i = 0; i < measurements.size(); i++){
94 int chan = measurements[i].GetChannel();
95 uint32_t adc = measurements[i].GetMeasurement();
97 if(chan >= 0 && chan < nchannels)
98 adc_value[chan] = adc;
113 Int_t in_num = 0, part = 0;
114 Int_t num[2] = { 0, 0 };
116 for (
int i=0; ; ++i) {
117 char ch = midasFilename[i];
121 num[0] = num[1] = in_num = part = 0;
122 }
else if (ch >=
'0' && ch <=
'9' && part < 2) {
123 num[part] = num[part] * 10 + (ch -
'0');
132 std::cerr <<
"File name run number (" << num[0]
133 <<
") disagrees with MIDAS run (" << run <<
")" << std::endl;
136 sprintf(buff,
"output_%.6d_%.4d.root", run, num[1]);
137 printf(
"Using filename %s\n",buff);
139 sprintf(buff,
"output_%.6d.root", run);
141 return std::string(buff);
151 int main(
int argc,
char *argv[])
154 Analyzer::CreateSingleton<Analyzer>();
std::string SetFullOutputFileName(int run, std::string midasFilename)
void BeginRun(int transition, int run, int time)
bool ProcessMidasEvent(TDataContainer &dataContainer)
void EndRun(int transition, int run, int time)
T * GetEventData(const char *name)
Add a templated function that returns event data in the format that we want.
TMidasEvent & GetMidasEvent() const
uint32_t GetTimeStamp() const
return the time stamp (unix time in seconds)
uint32_t GetSerialNumber() const
return the serial number
static TRootanaEventLoop & Get(void)
int ExecuteLoop(int argc, char *argv[])
Method to actually process the Midas information, either as file or online.
Class for storing data from CAEN V792 module.
std::vector< VADCMeasurement > & GetMeasurements()
Get the Vector of TDC Measurements.
int main(int argc, char *argv[])