1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
16 ///////////////////////////////////////////////////////////////////////////////
18 // This the source code of AliPRO (ALICE Prompt Reconstruction Online) //
21 ///////////////////////////////////////////////////////////////////////////////
31 #include "TGeoManager.h"
34 #include "AliCDBManager.h"
36 #include "AliITSRecoParam.h"
37 #include "AliITSReconstructor.h"
38 #include "AliTPCRecoParam.h"
39 #include "AliTPCReconstructor.h"
40 #include "AliMUONRecoParam.h"
41 #include "AliMUONReconstructor.h"
42 #include "AliPHOSRecoParam.h"
43 #include "AliPHOSReconstructor.h"
44 #include "AliMagFMaps.h"
45 #include "AliTracker.h"
46 #include "AliRecoParam.h"
47 #include "AliReconstruction.h"
48 #include "AliExternalTrackParam.h"
53 1- monitoring data source
56 int main(int argc, char **argv) {
61 printf("Wrong number of arguments\n");
66 /* open result file */
68 fp=fopen("./result.txt","a");
70 printf("Failed to open file\n");
75 /* define data source : this is argument 1 */
76 status=monitorSetDataSource( argv[1] );
78 printf("monitorSetDataSource() failed : %s\n",monitorDecodeError(status));
83 /* declare monitoring program */
84 status=monitorDeclareMp( __FILE__ );
86 printf("monitorDeclareMp() failed : %s\n",monitorDecodeError(status));
91 /* define wait event timeout - 1s max */
93 monitorSetNoWaitNetworkTimeout(1000);
96 /* log start of process */
97 printf("AliPRO program started\n");
100 /* init some counters */
101 int nevents_physics=0;
105 /////////////////////////////////////////////////////////////////////////////////////////
107 // First version of the reconstruction
108 // script for the FDR'08
109 /////////////////////////////////////////////////////////////////////////////////////////
111 // Set the CDB storage location
112 AliCDBManager * man = AliCDBManager::Instance();
113 man->SetDefaultStorage("local://./LocalCDB");
114 // Get run number from environment / GRP-in-memory
118 AliITSRecoParam * itsRecoParam = AliITSRecoParam::GetCosmicTestParam();
119 itsRecoParam->SetClusterErrorsParam(2);
120 itsRecoParam->SetFindV0s(kFALSE);
121 itsRecoParam->SetAddVirtualClustersInDeadZone(kFALSE);
122 itsRecoParam->SetUseAmplitudeInfo(kFALSE);
123 // In case we want to switch off a layer
124 // itsRecoParam->SetLayerToSkip(<N>);
125 itsRecoParam->SetLayerToSkip(4);
126 itsRecoParam->SetLayerToSkip(5);
127 itsRecoParam->SetLayerToSkip(2);
128 itsRecoParam->SetLayerToSkip(3);
129 AliITSReconstructor::SetRecoParam(itsRecoParam);
132 AliLog::SetClassDebugLevel("AliTPCclustererMI",2);
133 AliTPCRecoParam * tpcRecoParam = AliTPCRecoParam::GetCosmicTestParam(kTRUE);
134 tpcRecoParam->SetTimeInterval(60,940);
135 tpcRecoParam->Dump();
136 AliTPCReconstructor::SetRecoParam(tpcRecoParam);
137 AliTPCReconstructor::SetStreamLevel(1);
140 AliPHOSRecoParam* recEmc = new AliPHOSRecoParamEmc();
141 recEmc->SetSubtractPedestals(kTRUE);
142 recEmc->SetMinE(0.05);
143 recEmc->SetClusteringThreshold(0.10);
144 AliPHOSReconstructor::SetRecoParamEmc(recEmc);
147 AliLog::SetModuleDebugLevel("T0", 10);
150 AliLog::SetClassDebugLevel("AliMUONRawStreamTracker",3);
151 AliMUONRecoParam *muonRecoParam = AliMUONRecoParam::GetLowFluxParam();
152 muonRecoParam->CombineClusterTrackReco(kTRUE);
153 muonRecoParam->SetCalibrationMode("NOGAIN");
154 //muonRecoParam->SetClusteringMode("PEAKFIT");
155 //muonRecoParam->SetClusteringMode("PEAKCOG");
156 muonRecoParam->Print("FULL");
157 AliRecoParam::Instance()->RegisterRecoParam(muonRecoParam);
160 AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 2, 0., 10., 2);
161 AliTracker::SetFieldMap(field,1);
162 Double_t mostProbPt=0.35;
163 AliExternalTrackParam::SetMostProbablePt(mostProbPt);
165 // Instantiation of AliReconstruction
166 // AliReconstruction settings
167 AliReconstruction rec;
169 rec.SetUniformFieldTracking(kFALSE);
170 rec.SetWriteESDfriend(kTRUE);
171 rec.SetWriteAlignmentData();
173 rec.SetRunReconstruction("ALL");
174 rec.SetUseTrackingErrorsForAlignment("ITS");
176 // In case some detectors have to be switched off...
177 // rec.SetRunLocalReconstruction("ALL");
178 // rec.SetRunTracking("ALL");
179 // rec.SetFillESD("ALL");
180 // Disable vertex finder for the moment
181 rec.SetRunVertexFinder(kFALSE);
183 // To be enabled if some equipment IDs are not set correctly by DAQ
184 // rec.SetEquipmentIdMap("EquipmentIdMap.data");
186 // Detector options if any
187 rec.SetOption("ITS","cosmics,onlyITS");
188 rec.SetOption("MUON","SAVEDIGITS");
189 rec.SetOption("TPC","OldRCUFormat");
190 rec.SetOption("PHOS","OldRCUFormat");
192 // To be enabled when CTP readout starts
193 rec.SetFillTriggerESD(kFALSE);
195 // all events in one single file
196 rec.SetNumberOfEventsPerFile(-1);
198 // switch off cleanESD
199 rec.SetCleanESD(kFALSE);
201 rec.SetRunQA(kFALSE);
203 void* eventPtr = NULL;
204 rec.InitRun(NULL,&eventPtr);
206 /* main loop (infinite) */
208 struct eventHeaderStruct *event;
209 eventTypeType eventT;
211 /* get next event (blocking call until timeout) */
212 status=monitorGetEventDynamic(&eventPtr);
213 event=(eventHeaderStruct*)eventPtr;
214 if (status==MON_ERR_EOF) {
215 printf ("End of File detected\n");
216 break; /* end of monitoring file has been reached */
220 printf("monitorGetEventDynamic() failed : %s\n",monitorDecodeError(status));
224 /* retry if got no event */
230 /* use event - here, just write event id to result file */
231 eventT=event->eventType;
233 if (eventT==PHYSICS_EVENT) {
234 fprintf(fp,"Run #%lu, event size: %lu, BC:%u, Orbit:%u, Period:%u\n",
235 (unsigned long)event->eventRunNb,
236 (unsigned long)event->eventSize,
237 EVENT_ID_GET_BUNCH_CROSSING(event->eventId),
238 EVENT_ID_GET_ORBIT(event->eventId),
239 EVENT_ID_GET_PERIOD(event->eventId)
245 rec.AddEventAndRun();
253 /* exit when last event received, no need to wait for TERM signal */
254 if (eventT==END_OF_RUN) {
255 printf("EOR event detected\n");
263 fprintf(fp,"Run #%s, received %d physics events out of %d\n",getenv("DATE_RUN_NUMBER"),nevents_physics,nevents_total);
265 /* close result file */
271 int main(int /*argc*/, char** /*argv*/)
273 printf("This program was compiled without DATE\n");