ROOT logo
#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/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

  AliCDBId idplaneeffSSD("ITS/PlaneEff/PlaneEffSSD",firstRun, lastRun);
  
  AliITSPlaneEffSSD* planeeffSSD = new AliITSPlaneEffSSD();
  TRandom3 *gran = new TRandom3();

//  planeeffSSD->SetOwner(kFALSE);

  // loop over SSD modules
  Bool_t BFound=kFALSE;
  for(UInt_t mod=0;mod<1698;mod++){
  // 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 (1000*gran->Uniform()>10) BFound=kTRUE;
      planeeffSSD->UpDatePlaneEff(BFound,mod);
    }
  }
  if(AliCDBManager::Instance()->GetDefaultStorage()->Put(planeeffSSD, idplaneeffSSD, md1))
  printf("Local CDB file with random SSD plane efficiencies written \n");
 delete gran;
 delete planeeffSSD;
 delete md1;
}
 MakeITSPlaneEfficiencySSD.C:1
 MakeITSPlaneEfficiencySSD.C:2
 MakeITSPlaneEfficiencySSD.C:3
 MakeITSPlaneEfficiencySSD.C:4
 MakeITSPlaneEfficiencySSD.C:5
 MakeITSPlaneEfficiencySSD.C:6
 MakeITSPlaneEfficiencySSD.C:7
 MakeITSPlaneEfficiencySSD.C:8
 MakeITSPlaneEfficiencySSD.C:9
 MakeITSPlaneEfficiencySSD.C:10
 MakeITSPlaneEfficiencySSD.C:11
 MakeITSPlaneEfficiencySSD.C:12
 MakeITSPlaneEfficiencySSD.C:13
 MakeITSPlaneEfficiencySSD.C:14
 MakeITSPlaneEfficiencySSD.C:15
 MakeITSPlaneEfficiencySSD.C:16
 MakeITSPlaneEfficiencySSD.C:17
 MakeITSPlaneEfficiencySSD.C:18
 MakeITSPlaneEfficiencySSD.C:19
 MakeITSPlaneEfficiencySSD.C:20
 MakeITSPlaneEfficiencySSD.C:21
 MakeITSPlaneEfficiencySSD.C:22
 MakeITSPlaneEfficiencySSD.C:23
 MakeITSPlaneEfficiencySSD.C:24
 MakeITSPlaneEfficiencySSD.C:25
 MakeITSPlaneEfficiencySSD.C:26
 MakeITSPlaneEfficiencySSD.C:27
 MakeITSPlaneEfficiencySSD.C:28
 MakeITSPlaneEfficiencySSD.C:29
 MakeITSPlaneEfficiencySSD.C:30
 MakeITSPlaneEfficiencySSD.C:31
 MakeITSPlaneEfficiencySSD.C:32
 MakeITSPlaneEfficiencySSD.C:33
 MakeITSPlaneEfficiencySSD.C:34
 MakeITSPlaneEfficiencySSD.C:35
 MakeITSPlaneEfficiencySSD.C:36
 MakeITSPlaneEfficiencySSD.C:37
 MakeITSPlaneEfficiencySSD.C:38
 MakeITSPlaneEfficiencySSD.C:39
 MakeITSPlaneEfficiencySSD.C:40
 MakeITSPlaneEfficiencySSD.C:41
 MakeITSPlaneEfficiencySSD.C:42
 MakeITSPlaneEfficiencySSD.C:43
 MakeITSPlaneEfficiencySSD.C:44
 MakeITSPlaneEfficiencySSD.C:45
 MakeITSPlaneEfficiencySSD.C:46
 MakeITSPlaneEfficiencySSD.C:47