1 #if !defined(__CINT__) || defined(__MAKECINT__)
3 #include "AliCDBManager.h"
4 #include "AliCDBMetaData.h"
5 #include "AliCDBStorage.h"
6 #include "AliCDBRunRange.h"
8 #include "AliITSPlaneEffSPD.h"
11 void MakeITSPlaneEfficiencySPD(Int_t firstRun=0, Int_t lastRun=AliCDBRunRange::Infinity(),
12 Double_t eff=0.99, Int_t nTried=1000){
14 if(eff<0 || eff > 1) {
15 printf("Efficiency must be in the range [0,1]: nothing done");
17 if(!AliCDBManager::Instance()->IsDefaultStorageSet()) {
18 AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT");
21 AliCDBMetaData *md1= new AliCDBMetaData(); // metaData describing the object
22 md1->SetObjectClassName("AliITSPlaneEff");
23 md1->SetResponsible("Giuseppe Bruno");
24 md1->SetBeamPeriod(0);
25 md1->SetAliRootVersion("head 16/02/08"); //root version
27 AliCDBId idplaneeffSPD("ITS/PlaneEff/PlaneEffSPD",firstRun, lastRun);
29 AliITSPlaneEffSPD* planeeffSPD = new AliITSPlaneEffSPD();
30 TRandom3 *gran = new TRandom3();
32 // planeeffSPD->SetOwner(kFALSE);
35 Double_t limit=nTried;
37 printf("limit = %f",limit);
40 for(UInt_t key=0;key<planeeffSPD->Nblock();key++){
41 //for(UInt_t mod=0;mod<240;mod++){
42 //for(UInt_t chip=0;chip<5;chip++){
43 // suppose to have 1000 tracks in each chip and an average efficiency of 99%
44 for(Int_t j=0; j<nTried; j++) {
46 //if (gRandom->Uniform(0,1000)>10) BFound=kTRUE;
47 if (nTried*gran->Uniform()>limit) BFound=kTRUE;
48 //planeeffSPD->UpDatePlaneEff(BFound,mod,chip);
49 planeeffSPD->UpDatePlaneEff(BFound,key);
53 if(AliCDBManager::Instance()->GetDefaultStorage()->Put(planeeffSPD, idplaneeffSPD, md1))
54 printf("Local CDB file with random SPD plane efficiencies written \n");