Macros for raw-data reco and QA at P2
[u/mrichter/AliRoot.git] / test / cosmic / rec.C
CommitLineData
40d0f38f 1void rec(Int_t runNumber = 0, const char* year = "08", const char *localFileName = NULL)\r
2{\r
3 // Offline shifter reconstruction macro\r
4\r
5 cout << "Going to run the reconstruction for run: " << runNumber << endl;\r
6\r
7 // connect to the grid \r
8 TGrid * grid = 0x0 ; \r
9 grid = TGrid::Connect("alien://") ; \r
10 \r
11 // make the file name pattern year and run number\r
12 TString pattern;\r
13 pattern.Form("%9d",runNumber);\r
14 pattern.ReplaceAll(" ", "0") ; \r
15 pattern.Prepend(year);\r
16 pattern.Append("*0.root");\r
17\r
18 // find the files associated to this run\r
19 // get the list of files from AliEn directly \r
20 TString baseDir; \r
21 baseDir.Form("/alice/data/20%s/",year);\r
22\r
23 cout << "Looking for raw-data files with pattern " << pattern << " in folder " << baseDir << endl;\r
24\r
25 TGridResult *result = grid->Query(baseDir, pattern);\r
26\r
27 TList *fileList = result->GetFileInfoList();\r
28\r
29 cout << fileList->GetEntries() << " raw-data files found" << endl;\r
30 if ( fileList->GetEntries() == 0) {\r
31 cout << "Exiting..." << endl;\r
32 return;\r
33 }\r
34\r
35 // Take the first (or last?) file...\r
36 TFileInfo *fi = (TFileInfo *)fileList->At(0); \r
37 // TFileInfo *fi = (TFileInfo *)fileList->At(fileList->GetEntries()-1); \r
38\r
39 cout << "Getting the file:" << fi->GetCurrentUrl()->GetUrl() << endl;\r
40 fi->Dump();\r
41\r
42 TString filename(fi->GetCurrentUrl()->GetUrl());\r
43\r
44 AliLog::Flush();\r
45\r
46 /////////////////////////////////////////////////////////////////////////////////////////\r
47 //\r
48 // First version of the reconstruction\r
49 // script for the FDR'08\r
50\r
51 // Set the CDB storage location\r
52 // AliLog::SetModuleDebugLevel("STEER",2);\r
53 AliCDBManager * man = AliCDBManager::Instance();\r
54 // man->SetDefaultStorage("local://LocalCDB");\r
55 man->SetDefaultStorage("alien://folder=/alice/data/2008/LHC08a/OCDB/");\r
56 \r
57 // Files that we can not read from alien...\r
58 man->SetSpecificStorage("ITS/Calib/MapsAnodeSDD","local://$ALICE_ROOT");\r
59 man->SetSpecificStorage("ITS/Calib/MapsTimeSDD","local://$ALICE_ROOT");\r
60 man->SetSpecificStorage("TPC/Calib/ExB","local://$ALICE_ROOT");\r
61\r
62 // Objects not found if using LHC07w database\r
63 // man->SetSpecificStorage("ITS/Calib/MapsAnodeSDD","local:///afs/cern.ch/user/c/cheshkov/public/OCDB");\r
64 // man->SetSpecificStorage("GRP/GRP/Data","local://$ALICE_ROOT");\r
65 // man->SetSpecificStorage("ITS/Calib/DDLMapSDD","local://$ALICE_ROOT");\r
66 // man->SetSpecificStorage("MUON/Calib/Mapping","local://$ALICE_ROOT");\r
67 // man->SetSpecificStorage("MUON/Calib/DDLStore","local://$ALICE_ROOT");\r
68\r
69 // ITS settings\r
70 AliITSRecoParam * itsRecoParam = AliITSRecoParam::GetCosmicTestParam();\r
71 itsRecoParam->SetClusterErrorsParam(2);\r
72 itsRecoParam->SetFindV0s(kFALSE);\r
73 itsRecoParam->SetAddVirtualClustersInDeadZone(kFALSE);\r
74 itsRecoParam->SetUseAmplitudeInfo(kFALSE);\r
75 // In case we want to switch off a layer\r
76 // itsRecoParam->SetLayerToSkip(<N>);\r
77 itsRecoParam->SetLayerToSkip(4);\r
78 itsRecoParam->SetLayerToSkip(5);\r
79 itsRecoParam->SetLayerToSkip(2);\r
80 itsRecoParam->SetLayerToSkip(3);\r
81 AliITSReconstructor::SetRecoParam(itsRecoParam);\r
82\r
83 // TPC settings\r
84 AliLog::SetClassDebugLevel("AliTPCclustererMI",2);\r
85 AliTPCRecoParam * tpcRecoParam = AliTPCRecoParam::GetCosmicTestParam(kTRUE);\r
86 tpcRecoParam->SetTimeInterval(60,940);\r
87 tpcRecoParam->Dump();\r
88 AliTPCReconstructor::SetRecoParam(tpcRecoParam);\r
89 AliTPCReconstructor::SetStreamLevel(1);\r
90\r
91 // PHOS settings\r
92 AliPHOSRecoParam* recEmc = new AliPHOSRecoParamEmc();\r
93 recEmc->SetSubtractPedestals(kTRUE);\r
94 recEmc->SetMinE(0.05);\r
95 recEmc->SetClusteringThreshold(0.10);\r
96 AliPHOSReconstructor::SetRecoParamEmc(recEmc);\r
97\r
98 // T0 settings\r
99 AliLog::SetModuleDebugLevel("T0", 10);\r
100\r
101 // MUON settings\r
102 AliLog::SetClassDebugLevel("AliMUONRawStreamTracker",3);\r
103 AliMUONRecoParam *muonRecoParam = AliMUONRecoParam::GetLowFluxParam();\r
104 muonRecoParam->CombineClusterTrackReco(kTRUE);\r
105 muonRecoParam->SetCalibrationMode("NOGAIN");\r
106 //muonRecoParam->SetClusteringMode("PEAKFIT");\r
107 //muonRecoParam->SetClusteringMode("PEAKCOG");\r
108 muonRecoParam->Print("FULL");\r
109 AliRecoParam::Instance()->RegisterRecoParam(muonRecoParam);\r
110 \r
111 // Tracking settings\r
112 // AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 2, 1., 10., 1);\r
113 AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 2, 0., 10., 2);\r
114 AliTracker::SetFieldMap(field,1);\r
115 Double_t mostProbPt=0.35;\r
116 AliExternalTrackParam::SetMostProbablePt(mostProbPt);\r
117\r
118 // AliReconstruction settings\r
119 AliReconstruction rec;\r
120 rec.SetUniformFieldTracking(kFALSE);\r
121 rec.SetWriteESDfriend(kTRUE);\r
122 rec.SetWriteAlignmentData();\r
123 rec.SetInput(filename.Data());\r
124 rec.SetRunReconstruction("ALL");\r
125 rec.SetUseTrackingErrorsForAlignment("ITS");\r
126\r
127 // In case some detectors have to be switched off...\r
128 // rec.SetRunLocalReconstruction("ALL");\r
129 // rec.SetRunTracking("ALL");\r
130 // rec.SetFillESD("ALL");\r
131 // Disable vertex finder for the moment\r
132 rec.SetRunVertexFinder(kFALSE);\r
133\r
134 // To be enabled if some equipment IDs are not set correctly by DAQ\r
135 // rec.SetEquipmentIdMap("EquipmentIdMap.data");\r
136\r
137 // Detector options if any\r
138 rec.SetOption("ITS","cosmics,onlyITS");\r
139 rec.SetOption("MUON","SAVEDIGITS");\r
140 rec.SetOption("TPC","OldRCUFormat");\r
141 rec.SetOption("PHOS","OldRCUFormat");\r
142\r
143 // To be enabled when CTP readout starts\r
144 rec.SetFillTriggerESD(kFALSE);\r
145\r
146 // all events in one single file\r
147 rec.SetNumberOfEventsPerFile(-1);\r
148\r
149 // switch off cleanESD\r
150 rec.SetCleanESD(kFALSE);\r
151\r
152 // rec.SetEventRange(0,15);\r
153 // AliLog::SetGlobalDebugLevel(2);\r
154\r
155 rec.SetRunQA(kFALSE);\r
156 AliLog::Flush();\r
157 rec.Run();\r
158\r
159 //cout << "-----------------------------------------------------------------" << endl;\r
160 //cout << "-----------------------------------------------------------------" << endl;\r
161 //cout << "--------- Reconstruction Completed. Start merging QAs -----------" << endl;\r
162 //cout << "-----------------------------------------------------------------" << endl;\r
163 //cout << "-----------------------------------------------------------------" << endl;\r
164 //AliQADataMakerSteer qas;\r
165 //qas.Merge();\r
166}\r