]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/ITSSPDVertexDiamondda.cxx
Coverity fix
[u/mrichter/AliRoot.git] / ITS / ITSSPDVertexDiamondda.cxx
index 616a82d1e514ff6b6b2b5c8c3f438dd0435bd00d..e95177485cc71540211f93811d8bce67d583e6ad 100644 (file)
@@ -1,13 +1,13 @@
 /*
 Contact: cvetan.cheshkov@cern.ch
-Link: http://alisoft.cern.ch/viewvc/trunk/ITS/ITSSPDVertexDiamondda.cxx?root=AliRoot&view=log , /afs/cern.ch/user/c/cheshkov/public/08000058338016.30.root.date.gz , /afs/cern.ch/user/c/cheshkov/public/ITS/VD_da_test.date
+Link: http://alisoft.cern.ch/viewvc/trunk/ITS/ITSSPDVertexDiamondda.cxx?root=AliRoot&view=log , /afs/cern.ch/user/c/cheshkov/public/ITS/VD_da_test.date , /afs/cern.ch/user/c/cheshkov/public/08000058338016.30.root.date.gz
 Reference Run: 58338
 Run Type: PHYSICS
 DA Type: MON
 Number of events needed: 100
-Input Files: GRP/Geometry/Data , ITS/Align/Data , spd_noisy_ocdb , spd_dead_ocdb (all the files are taken from DQM OCDB snapshot)
+Input Files: GRP/Geometry/Data , ITS/Align/Data , spd_noisy_ocdb , spd_dead_ocdb , TRIGGER/SPD/PITConditions (all the files are taken from SPD daqDetDB)
 Output Files: SPDVertexDiamondDA.root
-Trigger types used: All SPD F0 triggers 
+Trigger types used: PHYSICS, SPD-F0 
 */
 
 #define OUTPUT_FILE "SPDVertexDiamondDA.root"
@@ -30,8 +30,10 @@ extern "C" {
 #include <TH1.h>
 #include <TH2.h>
 #include <TSystem.h>
+#include <TGeoGlobalMagField.h>
 
 #include "AliLog.h"
+#include "AliMagF.h"
 #include "AliRawReaderDate.h"
 #include "AliCDBManager.h"
 #include "AliITSMeanVertexer.h"
@@ -86,7 +88,6 @@ int main(int argc, char **argv) {
   }
   int runNr = atoi(getenv("DATE_RUN_NUMBER"));
 
-  /*
   // Get the necessary OCDB files from the DAQ detector DB
   if (gSystem->AccessPathName("localOCDB/GRP/Geometry/Data",kFileExists)) {
     if (gSystem->mkdir("localOCDB/GRP/Geometry/Data",kTRUE) != 0) {
@@ -136,16 +137,32 @@ int main(int argc, char **argv) {
     return -1;
   }
 
-  */
+  if (gSystem->AccessPathName("localOCDB/TRIGGER/SPD/PITConditions",kFileExists)) {
+    if (gSystem->mkdir("localOCDB/TRIGGER/SPD/PITConditions",kTRUE) != 0) {
+      printf("Failed to create directory: localOCDB/TRIGGER/SPD/PITConditions");
+      return -1;
+    }
+  }
+  status = daqDA_DB_getFile("TRIGGER/SPD/PITConditions","localOCDB/TRIGGER/SPD/PITConditions/Run0_999999999_v0_s0.root");
+  if (status) {
+    printf("Failed to get spd trigger file (TRIGGER/SPD/PITConditions) from DAQdetDB, status=%d\n", status);
+    return -1;
+  }
+ status = daqDA_DB_getFile("mfchebKGI_sym.root","localOCDB/mfchebKGI_sym.root");
+  if (status) {
+    printf("Failed to get spd file (mfchebKGI_sym.root) from DAQdetDB, status=%d\n", status);
+    return -1;
+  }
 
   // Global initializations
+
+  // The B filed is required in AliITSClusterFinderV2SPD
+  // for the Lorentz angle correction. B set to 0.      
+  TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", 0., 0., AliMagF::k5kGUniform,AliMagF::kBeamTypeAA,-1,2,15,"localOCDB/mfchebKGI_sym.root"));  
   AliLog::SetGlobalLogLevel(AliLog::kError);
-  if (gSystem->AccessPathName("/local/cdb",kFileExists)) {
-    printf("Local OCDB directory (/local/cdb) does not exist");
-    return -1;
-  }
   AliCDBManager *man = AliCDBManager::Instance();
-  man->SetDefaultStorage("local:///local/cdb");
+  man->SetDefaultStorage("local://localOCDB");
   man->SetRun(runNr);
 
   // Init mean vertexer