3 FMD DA for online calibration of conditions
6 Link: fmd.nbi.dk/fmd/offline
9 Number of events needed: depending on the run, being run-level
11 Output Files: conditions.csv
12 Trigger types used: PHYSICS_EVENT
18 #include <AliFMDParameters.h>
19 #include <AliRawReader.h>
20 #include <TStopwatch.h>
21 #include <AliFMDBaseDA.h>
22 #include <AliRawReaderDate.h>
23 #include <AliRawReaderRoot.h>
26 #include "TPluginManager.h"
30 int main(int argc, char **argv)
34 /* magic line from Rene - for future reference! */
35 gROOT->GetPluginManager()->AddHandler("TVirtualStreamerInfo",
43 const Char_t* tableSOD[] = {"ALL", "no", "SOD", "all", NULL, NULL};
46 monitorDeclareTable(const_cast<char**>(tableSOD));
48 AliFMDParameters::Instance()->Init(kFALSE,0);
49 AliFMDParameters::Instance()->UseCompleteHeader(old);
50 struct eventHeaderStruct *event;
52 /* define data source : this is argument 1 */
53 status=monitorSetDataSource( argv[1] );
55 printf("monitorSetDataSource() failed : %s\n",monitorDecodeError(status));
59 /* declare monitoring program */
60 status=monitorDeclareMp( __FILE__ );
62 printf("monitorDeclareMp() failed : %s\n",monitorDecodeError(status));
67 monitorSetNoWaitNetworkTimeout(1000);
69 AliRawReader *reader = 0;
73 Bool_t SODread = kFALSE;
74 while(!SODread && iev<1000) {
76 /* check shutdown condition */
77 if (daqDA_checkShutdown()) {break;}
79 /* get next event (blocking call until timeout) */
80 status=monitorGetEventDynamic((void **)&event);
81 if (status==MON_ERR_EOF) {
82 printf ("End of File detected\n");
83 break; /* end of monitoring file has been reached */
87 printf("monitorGetEventDynamic() failed : %s\n",monitorDecodeError(status));
91 /* retry if got no event */
98 switch (event->eventType){
101 reader = new AliRawReaderDate((void*)event);
104 retval = daqDA_FES_storeFile("conditions.csv", AliFMDParameters::Instance()->GetConditionsShuttleID());
105 if (retval != 0) std::cerr << "Base DA failed" << std::endl;