add getter to cut on n cells
[u/mrichter/AliRoot.git] / ITS / MakeITSPlaneEfficiencySDD.C
CommitLineData
7167ae53 1#if !defined(__CINT__) || defined(__MAKECINT__)
2#include <TRandom3.h>
3#include "AliCDBManager.h"
4#include "AliCDBMetaData.h"
5#include "AliCDBStorage.h"
6#include "AliCDBRunRange.h"
7#include "AliCDBId.h"
8#include "AliITSPlaneEffSDD.h"
9#endif
6344adcc 10void MakeITSPlaneEfficiencySDD(Int_t firstRun=0,Int_t lastRun=AliCDBRunRange::Infinity()){
11
12 if(!AliCDBManager::Instance()->IsDefaultStorageSet()) {
162637e4 13 AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
6344adcc 14 }
15
16 AliCDBMetaData *md1= new AliCDBMetaData(); // metaData describing the object
17 md1->SetObjectClassName("AliITSPlaneEff");
18 md1->SetResponsible("Giuseppe Bruno");
19 md1->SetBeamPeriod(0);
7167ae53 20 md1->SetAliRootVersion("head 16/01/08"); //root version
6344adcc 21
22 AliCDBId idplaneeffSDD("ITS/PlaneEff/PlaneEffSDD",firstRun, lastRun);
23
24 AliITSPlaneEffSDD* planeeffSDD = new AliITSPlaneEffSDD();
7167ae53 25 TRandom3 *gran = new TRandom3();
6344adcc 26
27// planeeffSDD->SetOwner(kFALSE);
28
29
30 // loop over SDD basic block
31 Bool_t BFound=kFALSE;
32 //for(Int_t key=0;key<2080;key++){
33 for(UInt_t mod=0;mod<260;mod++){
34 for(UInt_t chip=0;chip<4;chip++){
35 for(UInt_t wing=0;wing<2;wing++){
36 for(UInt_t subw=0;subw<1;subw++){
37 // suppose to have 1000 tracks in each block and an average efficiency of 99%
38 for(Int_t j=0; j<1000; j++) {
39 BFound=kFALSE;
7167ae53 40 //if (gRandom->Uniform(0,1000)>10) BFound=kTRUE;
41 if (1000*gran->Uniform()>10) BFound=kTRUE;
6344adcc 42 planeeffSDD->UpDatePlaneEff(BFound,mod,chip,wing,subw);
43 }
44 }}}}
45 if(AliCDBManager::Instance()->GetDefaultStorage()->Put(planeeffSDD, idplaneeffSDD, md1))
7167ae53 46 printf("Local CDB file with random SDD plane efficiencies written \n");
47 delete gran;
48 delete planeeffSDD;
49 delete md1;
6344adcc 50}