]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/MakeITSPlaneEfficiencySDD.C
Merge branch 'master' of https://git.cern.ch/reps/AliRoot
[u/mrichter/AliRoot.git] / ITS / MakeITSPlaneEfficiencySDD.C
index a0053af12f02504a03979174f5a580abe94dc2d9..e283359886c220a0edf3248d656494c84214e8a8 100644 (file)
@@ -1,18 +1,28 @@
+#if !defined(__CINT__) || defined(__MAKECINT__)
+#include <TRandom3.h>
+#include "AliCDBManager.h"
+#include "AliCDBMetaData.h"
+#include "AliCDBStorage.h"
+#include "AliCDBRunRange.h"
+#include "AliCDBId.h"
+#include "AliITSPlaneEffSDD.h"
+#endif
 void MakeITSPlaneEfficiencySDD(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
   md1->SetObjectClassName("AliITSPlaneEff");
   md1->SetResponsible("Giuseppe Bruno");
   md1->SetBeamPeriod(0);
-  md1->SetAliRootVersion("head 02/01/08"); //root version
+  md1->SetAliRootVersion("head 16/01/08"); //root version
 
   AliCDBId idplaneeffSDD("ITS/PlaneEff/PlaneEffSDD",firstRun, lastRun);
   
   AliITSPlaneEffSDD* planeeffSDD = new AliITSPlaneEffSDD();
+  TRandom3 *gran = new TRandom3();
 
 //  planeeffSDD->SetOwner(kFALSE);
   
@@ -27,10 +37,14 @@ void MakeITSPlaneEfficiencySDD(Int_t firstRun=0,Int_t lastRun=AliCDBRunRange::In
   // suppose to have 1000 tracks in each block 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;
       planeeffSDD->UpDatePlaneEff(BFound,mod,chip,wing,subw);
     }
   }}}}
   if(AliCDBManager::Instance()->GetDefaultStorage()->Put(planeeffSDD, idplaneeffSDD, md1))
-  {cout << "Riuscito " << endl;}
+  printf("Local CDB file with random SDD plane efficiencies written \n");
+  delete gran;
+  delete planeeffSDD;
+  delete md1;
 }