QA validation macro and script
[u/mrichter/AliRoot.git] / test / cosmic / rec.C
index d426b872d85c868ba29f87fa309f565b86df29aa..bcc7a2a231ee8a347e93e5aa96c9ce0002e0e90a 100644 (file)
-void rec(Int_t runNumber = 0, const char* year = "08", const char *localFileName = NULL)\r
+void rec(const char *filename="raw.root", const Int_t mfield=1)\r
 {\r
-  // Offline shifter reconstruction macro\r
-\r
-  cout << "Going to run the reconstruction for run: " << runNumber << endl;\r
-\r
-  // connect to the grid \r
-  TGrid * grid = 0x0 ; \r
-  grid = TGrid::Connect("alien://") ; \r
-               \r
-  // make the file name pattern year and run number\r
-  TString pattern;\r
-  pattern.Form("%9d",runNumber);\r
-  pattern.ReplaceAll(" ", "0") ; \r
-  pattern.Prepend(year);\r
-  pattern.Append("*0.root");\r
-\r
-  // find the files associated to this run\r
-  // get the list of files from AliEn directly \r
-  TString baseDir; \r
-  baseDir.Form("/alice/data/20%s/",year);\r
-\r
-  cout << "Looking for raw-data files with pattern " << pattern << " in folder " << baseDir << endl;\r
-\r
-  TGridResult *result = grid->Query(baseDir, pattern);\r
-\r
-  TList *fileList = result->GetFileInfoList();\r
-\r
-  cout << fileList->GetEntries() << " raw-data files found" << endl;\r
-  if ( fileList->GetEntries() == 0) {\r
-    cout << "Exiting..." << endl;\r
-    return;\r
-  }\r
-\r
-  // Take the first (or last?) file...\r
-  TFileInfo *fi =  (TFileInfo *)fileList->At(0); \r
-  //  TFileInfo *fi =  (TFileInfo *)fileList->At(fileList->GetEntries()-1); \r
-\r
-  cout << "Getting the file:" << fi->GetCurrentUrl()->GetUrl() << endl;\r
-  fi->Dump();\r
-\r
-  TString filename(fi->GetCurrentUrl()->GetUrl());\r
-\r
-  AliLog::Flush();\r
-\r
   /////////////////////////////////////////////////////////////////////////////////////////\r
   //\r
-  // First version of the reconstruction\r
-  // script for the FDR'08\r
+  // Second version of the reconstruction\r
+  // script for the 2008 cosmic data (LHC08b) \r
+  //\r
+  /////////////////////////////////////////////////////////////////////////////////////////\r
+  //AliLog::SetGlobalLogLevel(AliLog::kWarning);\r
+  AliLog::SetGlobalLogLevel(AliLog::kError);\r
+\r
+  gSystem->Load("libRAliEn.so");\r
+  gSystem->Load("libNet.so");\r
+  gSystem->Load("libMonaLisa.so");\r
+  new TMonaLisaWriter(0, "GridAliRoot-rec.C", 0, 0, "global");\r
+  gSystem->Setenv("APMON_INTERVAL", "120");\r
 \r
   // Set the CDB storage location\r
-  // AliLog::SetModuleDebugLevel("STEER",2);\r
   AliCDBManager * man = AliCDBManager::Instance();\r
-  //  man->SetDefaultStorage("local://LocalCDB");\r
-  man->SetDefaultStorage("alien://folder=/alice/data/2008/LHC08a/OCDB/");\r
+    man->SetDefaultStorage("local://$ALICE_ROOT");\r
+  //man->SetDefaultStorage("alien://folder=/alice/data/2008/LHC08a/OCDB/");\r
+  man->SetSpecificStorage("ITS/Calib/*","local://$ALICE_ROOT");\r
   \r
-  // Files that we can not read from alien...\r
-  man->SetSpecificStorage("ITS/Calib/MapsAnodeSDD","local://$ALICE_ROOT");\r
-  man->SetSpecificStorage("ITS/Calib/MapsTimeSDD","local://$ALICE_ROOT");\r
-  man->SetSpecificStorage("TPC/Calib/ExB","local://$ALICE_ROOT");\r
-\r
-  // Objects not found if using LHC07w database\r
-  //  man->SetSpecificStorage("ITS/Calib/MapsAnodeSDD","local:///afs/cern.ch/user/c/cheshkov/public/OCDB");\r
-  // man->SetSpecificStorage("GRP/GRP/Data","local://$ALICE_ROOT");\r
-  // man->SetSpecificStorage("ITS/Calib/DDLMapSDD","local://$ALICE_ROOT");\r
-  // man->SetSpecificStorage("MUON/Calib/Mapping","local://$ALICE_ROOT");\r
-  // man->SetSpecificStorage("MUON/Calib/DDLStore","local://$ALICE_ROOT");\r
+  // Example in case a specific CDB storage is needed\r
+  //  man->SetSpecificStorage("ITS/Calib/MapsAnodeSDD","local://$ALICE_ROOT");\r
+\r
+  // Reconstruction settings\r
+  AliReconstruction rec;\r
 \r
   // ITS settings\r
   AliITSRecoParam * itsRecoParam = AliITSRecoParam::GetCosmicTestParam();\r
+  itsRecoParam->SetFactorSAWindowSizes(20);\r
   itsRecoParam->SetClusterErrorsParam(2);\r
   itsRecoParam->SetFindV0s(kFALSE);\r
   itsRecoParam->SetAddVirtualClustersInDeadZone(kFALSE);\r
   itsRecoParam->SetUseAmplitudeInfo(kFALSE);\r
   // In case we want to switch off a layer\r
   //  itsRecoParam->SetLayerToSkip(<N>);\r
-  itsRecoParam->SetLayerToSkip(4);\r
-  itsRecoParam->SetLayerToSkip(5);\r
+  //  itsRecoParam->SetLayerToSkip(4);\r
+  //  itsRecoParam->SetLayerToSkip(5);\r
   itsRecoParam->SetLayerToSkip(2);\r
   itsRecoParam->SetLayerToSkip(3);\r
-  AliITSReconstructor::SetRecoParam(itsRecoParam);\r
+  //itsRecoParam->SetSAOnePointTracks();\r
+  itsRecoParam->SetClusterMisalError(0.1); // [cm]\r
+  itsRecoParam->SetSAUseAllClusters();\r
+  rec.SetRecoParam("ITS",itsRecoParam);\r
 \r
   // TPC settings\r
-  AliLog::SetClassDebugLevel("AliTPCclustererMI",2);\r
-  AliTPCRecoParam * tpcRecoParam = AliTPCRecoParam::GetCosmicTestParam(kTRUE);\r
+  //AliLog::SetClassDebugLevel("AliTPCclustererMI",2);\r
+  AliTPCRecoParam * tpcRecoParam = AliTPCRecoParam::GetCosmicTestParam(kFALSE);\r
   tpcRecoParam->SetTimeInterval(60,940);\r
-  tpcRecoParam->Dump();\r
-  AliTPCReconstructor::SetRecoParam(tpcRecoParam);\r
+  Double_t sysError[5]={0.3,1, 0.3/150., 1./150.,0.3/(150*150.)};\r
+  tpcRecoParam->SetSystematicError(sysError);\r
+  tpcRecoParam->SetMinMaxCutAbs(4.);\r
+  tpcRecoParam->SetMinLeftRightCutAbs(6.);\r
+  tpcRecoParam->SetMinUpDownCutAbs(6.);\r
+  //  tpcRecoParam->Dump();\r
+  rec.SetRecoParam("TPC",tpcRecoParam);\r
   AliTPCReconstructor::SetStreamLevel(1);\r
 \r
+  // TRD setting\r
+  // Settings for the TRD Raw Reader\r
+  AliTRDrawStreamBase::SetRawStreamVersion("TB");\r
+  AliTRDrawStreamTB::SetNoErrorWarning();\r
+  AliTRDrawStreamTB::AllowCorruptedData();\r
+  AliTRDrawStreamTB::DisableStackNumberChecker();\r
+  AliTRDrawStreamTB::DisableStackLinkNumberChecker();\r
+  AliTRDrawStreamTB::SetSubtractBaseline(10);\r
+  \r
+  // TRD reconstruction params\r
+  AliTRDrecoParam *fTRDrecoParam = AliTRDrecoParam::GetCosmicTestParam();\r
+  rec.SetRecoParam("TRD",fTRDrecoParam);\r
+  AliTRDtrackerV1::SetNTimeBins(30);\r
+\r
   // PHOS settings\r
-  AliPHOSRecoParam* recEmc = new AliPHOSRecoParamEmc();\r
-  recEmc->SetSubtractPedestals(kTRUE);\r
-  recEmc->SetMinE(0.05);\r
-  recEmc->SetClusteringThreshold(0.10);\r
-  AliPHOSReconstructor::SetRecoParamEmc(recEmc);\r
+  AliPHOSRecoParam* recPHOS = new AliPHOSRecoParam();\r
+  recPHOS->SetEMCSubtractPedestals(kTRUE);\r
+  recPHOS->SetEMCMinE(0.05);\r
+  recPHOS->SetEMCClusteringThreshold(0.10);\r
+  rec.SetRecoParam("PHOS",recPHOS);\r
 \r
   // T0 settings\r
-  AliLog::SetModuleDebugLevel("T0", 10);\r
+  //AliLog::SetModuleDebugLevel("T0", 10);\r
 \r
   // MUON settings\r
-  AliLog::SetClassDebugLevel("AliMUONRawStreamTracker",3);\r
+  //AliLog::SetClassDebugLevel("AliMUONRawStreamTracker",3);\r
   AliMUONRecoParam *muonRecoParam = AliMUONRecoParam::GetLowFluxParam();\r
   muonRecoParam->CombineClusterTrackReco(kTRUE);\r
   muonRecoParam->SetCalibrationMode("NOGAIN");\r
   //muonRecoParam->SetClusteringMode("PEAKFIT");\r
   //muonRecoParam->SetClusteringMode("PEAKCOG");\r
   muonRecoParam->Print("FULL");\r
-  AliRecoParam::Instance()->RegisterRecoParam(muonRecoParam);\r
+  rec.SetRecoParam("MUON",muonRecoParam);\r
  \r
   // Tracking settings\r
-  //  AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 2, 1., 10., 1);\r
-  AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 2, 0., 10., 2);\r
+  AliMagFMaps* field;\r
+  if (mfield)\r
+     field = new AliMagFMaps("Maps","Maps", 2, 1., 10., AliMagFMaps::k5kG);\r
+   else\r
+     field = new AliMagFMaps("Maps","Maps", 2, 0., 10., 2);\r
   AliTracker::SetFieldMap(field,1);\r
   Double_t mostProbPt=0.35;\r
   AliExternalTrackParam::SetMostProbablePt(mostProbPt);\r
 \r
   // AliReconstruction settings\r
-  AliReconstruction rec;\r
   rec.SetUniformFieldTracking(kFALSE);\r
   rec.SetWriteESDfriend(kTRUE);\r
   rec.SetWriteAlignmentData();\r
-  rec.SetInput(filename.Data());\r
-  rec.SetRunReconstruction("ALL");\r
+  rec.SetInput(filename);\r
+  //  rec.SetRunReconstruction("ALL");\r
   rec.SetUseTrackingErrorsForAlignment("ITS");\r
 \r
   // In case some detectors have to be switched off...\r
-  //  rec.SetRunLocalReconstruction("ALL");\r
-  //  rec.SetRunTracking("ALL");\r
-  //  rec.SetFillESD("ALL");\r
-  // Disable vertex finder for the moment\r
-  rec.SetRunVertexFinder(kFALSE);\r
+  rec.SetRunReconstruction("ITS TPC TRD TOF HMPID PHOS MUON FMD PMD T0 VZERO ZDC ACORDE");\r
+\r
+  // Enable vertex finder - it is needed for cosmic track reco\r
+  rec.SetRunVertexFinder(kTRUE);\r
 \r
   // To be enabled if some equipment IDs are not set correctly by DAQ\r
   //  rec.SetEquipmentIdMap("EquipmentIdMap.data");\r
 \r
   // Detector options if any\r
-  rec.SetOption("ITS","cosmics,onlyITS");\r
+  rec.SetOption("ITS","cosmics");\r
   rec.SetOption("MUON","SAVEDIGITS");\r
-  rec.SetOption("TPC","OldRCUFormat");\r
-  rec.SetOption("PHOS","OldRCUFormat");\r
+  rec.SetOption("T0","cosmic");\r
 \r
-  // To be enabled when CTP readout starts\r
-  rec.SetFillTriggerESD(kFALSE);\r
+  // Enabled when CTP readout starts\r
+  rec.SetFillTriggerESD(kTRUE);\r
 \r
   // all events in one single file\r
   rec.SetNumberOfEventsPerFile(-1);\r
@@ -149,10 +133,10 @@ void rec(Int_t runNumber = 0, const char* year = "08", const char *localFileName
   // switch off cleanESD\r
   rec.SetCleanESD(kFALSE);\r
 \r
-  // rec.SetEventRange(0,15);\r
-  // AliLog::SetGlobalDebugLevel(2);\r
+  //rec.SetEventRange(0,15);\r
 \r
-  rec.SetRunQA(kFALSE);\r
+  rec.SetRunQA("ITS TPC:ESD RECPOINT");\r
+  rec.SetRunGlobalQA(kTRUE);\r
   AliLog::Flush();\r
   rec.Run();\r
 \r