]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/MakeITSPlaneEfficiencySSD.C
Adding the correction task for the multi-dimensional balance function analysis
[u/mrichter/AliRoot.git] / ITS / MakeITSPlaneEfficiencySSD.C
index a992aadb67f8481ee695285491744717a71eb00a..d66c1338ac083eb51ce8aa91fd4bfc9ec148c275 100644 (file)
@@ -1,7 +1,17 @@
+#if !defined(__CINT__) || defined(__MAKECINT__)
+#include <TRandom3.h>
+#include "AliCDBManager.h"
+#include "AliCDBMetaData.h"
+#include "AliCDBStorage.h"
+#include "AliCDBRunRange.h"
+#include "AliCDBId.h"
+#include "AliITSPlaneEffSSD.h"
+#endif
+
 void MakeITSPlaneEfficiencySSD(Int_t firstRun=0,Int_t lastRun=AliCDBRunRange::Infinity()){
   
   if(!AliCDBManager::Instance()->IsDefaultStorageSet()) {
-    AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT");
+    AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
   }
   
   AliCDBMetaData *md1= new AliCDBMetaData(); // metaData describing the object
@@ -13,6 +23,7 @@ void MakeITSPlaneEfficiencySSD(Int_t firstRun=0,Int_t lastRun=AliCDBRunRange::In
   AliCDBId idplaneeffSSD("ITS/PlaneEff/PlaneEffSSD",firstRun, lastRun);
   
   AliITSPlaneEffSSD* planeeffSSD = new AliITSPlaneEffSSD();
+  TRandom3 *gran = new TRandom3();
 
 //  planeeffSSD->SetOwner(kFALSE);
 
@@ -22,10 +33,14 @@ void MakeITSPlaneEfficiencySSD(Int_t firstRun=0,Int_t lastRun=AliCDBRunRange::In
   // suppose to have 1000 tracks in each module and an average efficiency of 99%
     for(Int_t j=0; j<1000; j++) {
       BFound=kFALSE;
-      if (gRandom->Uniform(0,1000)>10) BFound=kTRUE;
+      //if (gRandom->Uniform(0,1000)>10) BFound=kTRUE;
+      if (1000*gran->Uniform()>10) BFound=kTRUE;
       planeeffSSD->UpDatePlaneEff(BFound,mod);
     }
   }
   if(AliCDBManager::Instance()->GetDefaultStorage()->Put(planeeffSSD, idplaneeffSSD, md1))
-  {cout << "Riuscito " << endl;}
+  printf("Local CDB file with random SSD plane efficiencies written \n");
+ delete gran;
+ delete planeeffSSD;
+ delete md1;
 }