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
14 #include <Riostream.h>
20 #include <AliFMDParameters.h>
21 #include <AliRawReader.h>
22 #include <TStopwatch.h>
23 #include <AliFMDBaseDA.h>
24 #include <AliRawReaderDate.h>
25 #include <AliRawReaderRoot.h>
28 #include "TPluginManager.h"
32 int main(int argc, char **argv)
36 /* magic line from Rene - for future reference! */
37 gROOT->GetPluginManager()->AddHandler("TVirtualStreamerInfo",
45 const Char_t* tableSOD[] = {"ALL", "no", "SOD", "all", NULL, NULL};
48 monitorDeclareTable(const_cast<char**>(tableSOD));
50 AliFMDParameters::Instance()->Init(kFALSE,0);
51 AliFMDParameters::Instance()->UseCompleteHeader(old);
52 struct eventHeaderStruct *event;
54 /* define data source : this is argument 1 */
56 cout << "No monitor source set" << endl;
59 status=monitorSetDataSource( argv[1] );
61 printf("monitorSetDataSource() failed : %s\n",monitorDecodeError(status));
65 if (argc > 2) AliLog::SetModuleDebugLevel("FMD", atoi(argv[2]));
66 /* declare monitoring program */
67 status=monitorDeclareMp( __FILE__ );
69 printf("monitorDeclareMp() failed : %s\n",monitorDecodeError(status));
74 monitorSetNoWaitNetworkTimeout(1000);
76 AliRawReader *reader = 0;
80 Bool_t SODread = kFALSE;
81 while(!SODread && iev<1000) {
83 /* check shutdown condition */
84 if (daqDA_checkShutdown()) {break;}
86 /* get next event (blocking call until timeout) */
87 status=monitorGetEventDynamic((void **)&event);
88 if (status==MON_ERR_EOF) {
89 printf ("End of File detected\n");
90 break; /* end of monitoring file has been reached */
94 printf("monitorGetEventDynamic() failed : %s\n",monitorDecodeError(status));
98 /* retry if got no event */
105 switch (event->eventType){
108 reader = new AliRawReaderDate((void*)event);
112 daqDA_FES_storeFile("conditions.csv",
113 AliFMDParameters::Instance()->GetConditionsShuttleID());
114 if (retval != 0) cerr << "Base DA failed" << endl;