]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/runDataReconstruction.C
Fixing compiler warnings
[u/mrichter/AliRoot.git] / MUON / runDataReconstruction.C
1 /**************************************************************************
2  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3  *                                                                        *
4  * Author: The ALICE Off-line Project.                                    *
5  * Contributors are mentioned in the code where appropriate.              *
6  *                                                                        *
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  **************************************************************************/
15
16 /* $Id: runReconstruction.C 23207 2007-12-20 09:59:20Z ivana $ */
17
18 /// \ingroup macros
19 /// \file runDataReconstruction.C
20 /// \brief Macro for running reconstruction
21 ///
22 /// Macro for running reconstruction on the cosmics run data.
23 ///
24 /// \author Laurent Aphecetche, Nicole Bastid, Bogdan Vulpescu, ...
25
26 #if !defined(__CINT__) || defined(__MAKECINT__)
27 #include "AliMUONReconstructor.h"
28 #include "AliMUONRecoParam.h"
29 #include "AliRecoParam.h"
30 #include "AliCDBManager.h"
31 #include "AliMagF.h"
32 #include "AliTracker.h"
33 #include "AliReconstruction.h"
34 #include <TRandom.h>
35 #include <TGrid.h>
36 #include <TSystem.h>
37 //#include <TObjectTable.h>
38 #endif
39
40 TString caliboption1 = "NOGAIN";
41 TString caliboption2 = "GAINCONSTANTCAPA";
42 TString recoptions = "SAVEDIGITS";
43 Int_t seed = 1234567;
44
45 void runDataReconstruction(const char* input = "/Users/laurent/Alice/Data/Raw/09000067495031.10.root",
46                            const char* ocdbPath = "alien://folder=/alice/data/2009/OCDB",
47                            Int_t calib = 1)
48
49   TGrid::Connect("alien://");
50   
51   AliCDBManager* man = AliCDBManager::Instance();
52   man->SetDefaultStorage(ocdbPath);
53
54   gRandom->SetSeed(seed);
55
56   TString socdb(ocdbPath);
57   if ( socdb.Contains("local://") )
58   {
59     // no magnetic field
60     AliMagF* field = new AliMagF("Maps","Maps",2,0.,0., 10.,AliMagF::k5kG);
61     TGeoGlobalMagField::Instance()->SetField(field);
62     TGeoGlobalMagField::Instance()->Lock();
63   }
64   
65   AliReconstruction *MuonRec = new AliReconstruction();
66   
67   MuonRec->SetInput(gSystem->ExpandPathName(input));
68   MuonRec->SetRunVertexFinder(kFALSE);
69   MuonRec->SetRunLocalReconstruction("MUON");
70   MuonRec->SetRunTracking("MUON");
71   MuonRec->SetFillESD(" ");
72   MuonRec->SetLoadAlignData("MUON");
73   MuonRec->SetNumberOfEventsPerFile(0);
74   MuonRec->SetOption("MUON",recoptions.Data());
75   
76   // reconstruction parameters
77   AliMUONRecoParam *muonRecoParam = AliMUONRecoParam::GetCosmicParam();
78   
79   // digit selection
80   TString caliboption = caliboption1;
81   if ( calib == 2 ) caliboption = caliboption2;
82   muonRecoParam->SetCalibrationMode(caliboption.Data());
83   
84   // cut on (non)bending slopes
85   muonRecoParam->SetMaxNonBendingSlope(0.4);
86   muonRecoParam->SetMaxBendingSlope(0.5);
87   
88   // tracking algorithm
89   muonRecoParam->MakeMoreTrackCandidates(kTRUE);
90   muonRecoParam->RequestStation(0, kFALSE);
91   muonRecoParam->RequestStation(2, kFALSE);
92   muonRecoParam->RequestStation(3, kFALSE);
93   muonRecoParam->RequestStation(4, kFALSE);
94   
95   muonRecoParam->Print("FULL");
96   
97   MuonRec->SetRecoParam("MUON",muonRecoParam);
98   
99   MuonRec->SetRunQA("MUON:ALL");
100
101   MuonRec->Run();
102   
103   delete MuonRec;
104   
105   //gObjectTable->Print();
106 }
107