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