Usage of CTrig and CRTrig: 1. Initial scan of raw data, accumulating histograms, finding peaks, saving the peak parameters on calib/trigger_parameters.dat. This can be done like in /misc/misko/ceres/anal/00-raw/analyze2.cpp. To compile it, proceed like for the standard analyze.cpp. CAnalyzer,CPostAnalyzer,CHistoCollection are not needed. The execution time is of the order of 100 s per burst and seems to be I/O limited. 2. Regular analysis of raw data. Parameters from calib/trigger_parameters.dat are needed. // initialization: CTrig* trig = new CTrig("./calib/trigger_parameters.dat"); CREvent* event = new CREvent(); // in event loop: int runnr=evMgr->getEvt()->getRunNumber(); int burstnr=evMgr->getEvt()->getBurstNumber(); int eventnr=evMgr->getEvt()->getEventNumber(); // does not work... int eventtime = evMgr->getEvt()->getTime().seconds()-rwEpoch; eventnr=processedEvents; if (!trig->unpack(*evMgr)) {cout << "Trig unpack problem\n"; continue;} trig->calibrate(runnr,burstnr); event->setTrig(trig); event->setHeader(runnr,burstnr,eventnr,eventtime); xxx = trig->getJitterForTPC(); // trigger jitter can be accessed for the TPC... yyy = trig->getJitterForSD(7); // ...and, for example, for scaner 7 of SD 3. Analysis of root tree. For short explanation of the new variables look into CRTrig.h, or type event->Dump(). The variables can be accessed via tree->Draw("trig.adc[0]") or via event->getTrig()->getXXX(). For example, the analysis of the root tree with cuts might look like CRTrig* trig=event->getTrig(); if (trig.getPattern()&4 && // central trigger trig.getNevadc()==1 && // only one ADC gate in this event trig.getNevtdc()==1 && // only one TDC stop in this event abs(getBC1Adc())<4 && // BC1 ADC in peak within 4 sigma abs(getBC2Adc())<4) { // BC2 ADC in peak within 4 sigma // analyze event } The before/afterprotection can be accessed like in the example below. Please note that positive (negative) times correspond to beam particles which passed before (after) the official beam particle, i.e. the one who caused the trigger. hit = 0; for (i=0; i-2000 && trig.getTimeBC1(i)<-1000) hit = 1; } if (hit) { cout<<"This event had an additional beam particle between 1 "; cout<<"and 2 microseconds after the official beam particle. "; }