Initial version of the Alice Prompt Reconstruction Online (AliPRO) program
authorcvetan <cvetan@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 26 Mar 2008 16:45:45 +0000 (16:45 +0000)
committercvetan <cvetan@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 26 Mar 2008 16:45:45 +0000 (16:45 +0000)
MONITOR/alipro_main.cxx [new file with mode: 0644]
MONITOR/binalipro.pkg [new file with mode: 0644]
build/module.dep

diff --git a/MONITOR/alipro_main.cxx b/MONITOR/alipro_main.cxx
new file mode 100644 (file)
index 0000000..5e74f00
--- /dev/null
@@ -0,0 +1,277 @@
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+
+///////////////////////////////////////////////////////////////////////////////
+//                                                                           //
+// This the source code of AliPRO (ALICE Prompt Reconstruction Online)       //
+//                                                                           //
+//                                                                           //
+///////////////////////////////////////////////////////////////////////////////
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#ifdef ALI_DATE
+#include "event.h"
+#include "monitor.h"
+#include "TROOT.h"
+#include "TSystem.h"
+#include "TGeoManager.h"
+#include "TGrid.h"
+#include "AliRun.h"
+#include "AliCDBManager.h"
+#include "AliLog.h"
+#include "AliITSRecoParam.h"
+#include "AliITSReconstructor.h"
+#include "AliTPCRecoParam.h"
+#include "AliTPCReconstructor.h"
+#include "AliMUONRecoParam.h"
+#include "AliMUONReconstructor.h"
+#include "AliPHOSRecoParam.h"
+#include "AliPHOSReconstructor.h"
+#include "AliMagFMaps.h"
+#include "AliTracker.h"
+#include "AliRecoParam.h"
+#include "AliReconstruction.h"
+#include "AliExternalTrackParam.h"
+#endif
+
+/* Main routine
+      Arguments: 
+      1- monitoring data source
+*/
+#ifdef ALI_DATE
+int main(int argc, char **argv) {
+
+  int status;
+  
+  if (argc!=2) {
+    printf("Wrong number of arguments\n");
+    return -1;
+  }
+
+
+  /* open result file */
+  FILE *fp=NULL;
+  fp=fopen("./result.txt","a");
+  if (fp==NULL) {
+    printf("Failed to open file\n");
+    return -1;
+  }
+  
+
+  /* define data source : this is argument 1 */  
+  status=monitorSetDataSource( argv[1] );
+  if (status!=0) {
+    printf("monitorSetDataSource() failed : %s\n",monitorDecodeError(status));
+    return -1;
+  }
+
+
+  /* declare monitoring program */
+  status=monitorDeclareMp( __FILE__ );
+  if (status!=0) {
+    printf("monitorDeclareMp() failed : %s\n",monitorDecodeError(status));
+    return -1;
+  }
+
+
+  /* define wait event timeout - 1s max */
+  monitorSetNowait();
+  monitorSetNoWaitNetworkTimeout(1000);
+  
+
+  /* log start of process */
+  printf("AliPRO program started\n");  
+
+
+  /* init some counters */
+  int nevents_physics=0;
+  int nevents_total=0;
+
+  
+  /////////////////////////////////////////////////////////////////////////////////////////
+  //
+  // First version of the reconstruction
+  // script for the FDR'08
+  /////////////////////////////////////////////////////////////////////////////////////////
+
+  // Set the CDB storage location
+  AliCDBManager * man = AliCDBManager::Instance();
+  man->SetDefaultStorage("local://./LocalCDB");
+  // Get run number from environment / GRP-in-memory
+  man->SetRun(25984);
+  
+  // ITS settings
+  AliITSRecoParam * itsRecoParam = AliITSRecoParam::GetCosmicTestParam();
+  itsRecoParam->SetClusterErrorsParam(2);
+  itsRecoParam->SetFindV0s(kFALSE);
+  itsRecoParam->SetAddVirtualClustersInDeadZone(kFALSE);
+  itsRecoParam->SetUseAmplitudeInfo(kFALSE);
+  // In case we want to switch off a layer
+  //  itsRecoParam->SetLayerToSkip(<N>);
+  itsRecoParam->SetLayerToSkip(4);
+  itsRecoParam->SetLayerToSkip(5);
+  itsRecoParam->SetLayerToSkip(2);
+  itsRecoParam->SetLayerToSkip(3);
+  AliITSReconstructor::SetRecoParam(itsRecoParam);
+
+  // TPC settings
+  AliLog::SetClassDebugLevel("AliTPCclustererMI",2);
+  AliTPCRecoParam * tpcRecoParam = AliTPCRecoParam::GetCosmicTestParam(kTRUE);
+  tpcRecoParam->SetTimeInterval(60,940);
+  tpcRecoParam->Dump();
+  AliTPCReconstructor::SetRecoParam(tpcRecoParam);
+  AliTPCReconstructor::SetStreamLevel(1);
+
+  // PHOS settings
+  AliPHOSRecoParam* recEmc = new AliPHOSRecoParamEmc();
+  recEmc->SetSubtractPedestals(kTRUE);
+  recEmc->SetMinE(0.05);
+  recEmc->SetClusteringThreshold(0.10);
+  AliPHOSReconstructor::SetRecoParamEmc(recEmc);
+
+  // T0 settings
+  AliLog::SetModuleDebugLevel("T0", 10);
+
+  // MUON settings
+  AliLog::SetClassDebugLevel("AliMUONRawStreamTracker",3);
+  AliMUONRecoParam *muonRecoParam = AliMUONRecoParam::GetLowFluxParam();
+  muonRecoParam->CombineClusterTrackReco(kTRUE);
+  muonRecoParam->SetCalibrationMode("NOGAIN");
+  //muonRecoParam->SetClusteringMode("PEAKFIT");
+  //muonRecoParam->SetClusteringMode("PEAKCOG");
+  muonRecoParam->Print("FULL");
+  AliRecoParam::Instance()->RegisterRecoParam(muonRecoParam);
+  // Tracking settings
+  AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 2, 0., 10., 2);
+  AliTracker::SetFieldMap(field,1);
+  Double_t mostProbPt=0.35;
+  AliExternalTrackParam::SetMostProbablePt(mostProbPt);
+
+  // Instantiation of AliReconstruction
+  // AliReconstruction settings
+  AliReconstruction rec;
+
+  rec.SetUniformFieldTracking(kFALSE);
+  rec.SetWriteESDfriend(kTRUE);
+  rec.SetWriteAlignmentData();
+
+  rec.SetRunReconstruction("ALL");
+  rec.SetUseTrackingErrorsForAlignment("ITS");
+  
+  // In case some detectors have to be switched off...
+  //  rec.SetRunLocalReconstruction("ALL");
+  //  rec.SetRunTracking("ALL");
+  //  rec.SetFillESD("ALL");
+  // Disable vertex finder for the moment
+  rec.SetRunVertexFinder(kFALSE);
+  
+  // To be enabled if some equipment IDs are not set correctly by DAQ
+  //  rec.SetEquipmentIdMap("EquipmentIdMap.data");
+  
+  // Detector options if any
+  rec.SetOption("ITS","cosmics,onlyITS");
+  rec.SetOption("MUON","SAVEDIGITS");
+  rec.SetOption("TPC","OldRCUFormat");
+  rec.SetOption("PHOS","OldRCUFormat");
+  
+  // To be enabled when CTP readout starts
+  rec.SetFillTriggerESD(kFALSE);
+  
+  // all events in one single file
+  rec.SetNumberOfEventsPerFile(-1);
+  
+  // switch off cleanESD
+  rec.SetCleanESD(kFALSE);
+  
+  rec.SetRunQA(kFALSE);
+       
+  void* eventPtr = NULL;
+  rec.InitRun(NULL,&eventPtr);
+
+  /* main loop (infinite) */
+  for(;;) {
+    struct eventHeaderStruct *event;
+    eventTypeType eventT;
+    
+    /* get next event (blocking call until timeout) */
+    status=monitorGetEventDynamic(&eventPtr);
+    event=(eventHeaderStruct*)eventPtr;
+    if (status==MON_ERR_EOF) {
+      printf ("End of File detected\n");
+      break; /* end of monitoring file has been reached */
+    }
+    
+    if (status!=0) {
+      printf("monitorGetEventDynamic() failed : %s\n",monitorDecodeError(status));
+      break;
+    }
+    
+    /* retry if got no event */
+    if (event==NULL) {
+      continue;
+    }
+    
+    
+    /* use event - here, just write event id to result file */
+    eventT=event->eventType;
+    
+    if (eventT==PHYSICS_EVENT) {
+      fprintf(fp,"Run #%lu, event size: %lu, BC:%u, Orbit:%u, Period:%u\n",
+             (unsigned long)event->eventRunNb,
+             (unsigned long)event->eventSize,
+             EVENT_ID_GET_BUNCH_CROSSING(event->eventId),
+             EVENT_ID_GET_ORBIT(event->eventId),
+             EVENT_ID_GET_PERIOD(event->eventId)
+             );
+      nevents_physics++;
+      
+      AliLog::Flush();
+
+      rec.AddEventAndRun();
+     
+    }
+    nevents_total++;
+
+    /* free resources */
+    free(event);
+    
+    /* exit when last event received, no need to wait for TERM signal */
+    if (eventT==END_OF_RUN) {
+      printf("EOR event detected\n");
+      break;
+    }
+  }
+
+  rec.FinishRun();
+
+  /* write report */
+  fprintf(fp,"Run #%s, received %d physics events out of %d\n",getenv("DATE_RUN_NUMBER"),nevents_physics,nevents_total);
+
+  /* close result file */
+  fclose(fp);
+
+  return status;
+}
+#else
+int main(int /*argc*/, char** /*argv*/)
+{
+  printf("This program was compiled without DATE\n");
+
+  return 1;
+}
+#endif
diff --git a/MONITOR/binalipro.pkg b/MONITOR/binalipro.pkg
new file mode 100644 (file)
index 0000000..25a5e79
--- /dev/null
@@ -0,0 +1,20 @@
+#-*- Mode: Makefile -*-
+
+SRCS:=alipro_main.cxx
+
+EINCLUDE+= TPC ITS RAW MUON PHOS
+
+PACKBLIBS := $(ROOTCLIBS) $(SYSLIBS)
+
+ifdef DATE_ROOT
+
+PACKBLIBS += $(shell date-config --monitorlibs)
+ELIBSDIR:=
+ELIBS:=STEERBase ESD AOD CDB STEER RAWDatabase RAWDatarec RAWDatasim TPCbase TPCrec HLTbase ITSbase ITSrec MUONrec MUONbase MUONsim MUONgeometry MUONraw MUONcalib MUONmapping MUONtrigger MUONevaluation MUONcore PHOSbase PHOSrec PHOSsim
+EINCLUDE+= ${DATE_COMMON_DEFS} ${DATE_MONITOR_DIR}
+
+endif
+
+ifneq (,$(findstring macosx,$(ALICE_TARGET)))
+PACKLDFLAGS:=$(LDFLAGS) $(ELIBS:%=-Wl,-u,_G__cpp_setupG__%)
+endif
index 2c53835..a2813b2 100644 (file)
@@ -17,7 +17,7 @@ ITS/module.mk:                ITS/libITSbase.pkg ITS/libITSsim.pkg ITS/libITSrec.pkg
 JETAN/module.mk:       JETAN/libJETAN.pkg JETAN/libJETANMC.pkg
 MEVSIM/module.mk:      MEVSIM/libmevsim.pkg
 MICROCERN/module.mk:   MICROCERN/libmicrocern.pkg
 JETAN/module.mk:       JETAN/libJETAN.pkg JETAN/libJETANMC.pkg
 MEVSIM/module.mk:      MEVSIM/libmevsim.pkg
 MICROCERN/module.mk:   MICROCERN/libmicrocern.pkg
-MONITOR/module.mk:     MONITOR/libMONITOR.pkg MONITOR/binmonitorGDC.pkg MONITOR/binmonitorCheck.pkg MONITOR/binderoot.pkg
+MONITOR/module.mk:     MONITOR/libMONITOR.pkg MONITOR/binmonitorGDC.pkg MONITOR/binmonitorCheck.pkg MONITOR/binderoot.pkg MONITOR/binalipro.pkg
 MUON/module.mk:                MUON/binmchview.pkg MUON/libMUONgeometry.pkg MUON/libMUONshuttle.pkg MUON/libMUONbase.pkg MUON/libMUONgraphics.pkg  MUON/libMUONsim.pkg MUON/libMUONcalib.pkg MUON/libMUONmapping.pkg MUON/libMUONtrigger.pkg MUON/libMUONcore.pkg MUON/libMUONraw.pkg MUON/libMUONevaluation.pkg  MUON/libMUONrec.pkg
 LHC/module.mk:         LHC/libLHC.pkg
 LHAPDF/module.mk:      LHAPDF/liblhapdf.pkg
 MUON/module.mk:                MUON/binmchview.pkg MUON/libMUONgeometry.pkg MUON/libMUONshuttle.pkg MUON/libMUONbase.pkg MUON/libMUONgraphics.pkg  MUON/libMUONsim.pkg MUON/libMUONcalib.pkg MUON/libMUONmapping.pkg MUON/libMUONtrigger.pkg MUON/libMUONcore.pkg MUON/libMUONraw.pkg MUON/libMUONevaluation.pkg  MUON/libMUONrec.pkg
 LHC/module.mk:         LHC/libLHC.pkg
 LHAPDF/module.mk:      LHAPDF/liblhapdf.pkg