For Pythia with tune don't switch off MI in ConfigHeavyFlavor
[u/mrichter/AliRoot.git] / ITS / MakeITSPlaneEfficiencySSD.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 "AliITSPlaneEffSSD.h"
9#endif
10
6344adcc 11void MakeITSPlaneEfficiencySSD(Int_t firstRun=0,Int_t lastRun=AliCDBRunRange::Infinity()){
12
13 if(!AliCDBManager::Instance()->IsDefaultStorageSet()) {
162637e4 14 AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
6344adcc 15 }
16
17 AliCDBMetaData *md1= new AliCDBMetaData(); // metaData describing the object
18 md1->SetObjectClassName("AliITSPlaneEff");
19 md1->SetResponsible("Giuseppe Bruno");
20 md1->SetBeamPeriod(0);
21 md1->SetAliRootVersion("head 02/01/08"); //root version
22
23 AliCDBId idplaneeffSSD("ITS/PlaneEff/PlaneEffSSD",firstRun, lastRun);
24
25 AliITSPlaneEffSSD* planeeffSSD = new AliITSPlaneEffSSD();
7167ae53 26 TRandom3 *gran = new TRandom3();
6344adcc 27
28// planeeffSSD->SetOwner(kFALSE);
29
30 // loop over SSD modules
31 Bool_t BFound=kFALSE;
32 for(UInt_t mod=0;mod<1698;mod++){
33 // suppose to have 1000 tracks in each module and an average efficiency of 99%
34 for(Int_t j=0; j<1000; j++) {
35 BFound=kFALSE;
7167ae53 36 //if (gRandom->Uniform(0,1000)>10) BFound=kTRUE;
37 if (1000*gran->Uniform()>10) BFound=kTRUE;
6344adcc 38 planeeffSSD->UpDatePlaneEff(BFound,mod);
39 }
40 }
41 if(AliCDBManager::Instance()->GetDefaultStorage()->Put(planeeffSSD, idplaneeffSSD, md1))
7167ae53 42 printf("Local CDB file with random SSD plane efficiencies written \n");
43 delete gran;
44 delete planeeffSSD;
45 delete md1;
6344adcc 46}