]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/MakeITSPlaneEfficiencySSD.C
correcting AliHLTGlobalTriggerDecision::Clear(): using Delete instead of Clear for...
[u/mrichter/AliRoot.git] / ITS / MakeITSPlaneEfficiencySSD.C
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
11 void MakeITSPlaneEfficiencySSD(Int_t firstRun=0,Int_t lastRun=AliCDBRunRange::Infinity()){
12   
13   if(!AliCDBManager::Instance()->IsDefaultStorageSet()) {
14     AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
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();
26   TRandom3 *gran = new TRandom3();
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;
36       //if (gRandom->Uniform(0,1000)>10) BFound=kTRUE;
37       if (1000*gran->Uniform()>10) BFound=kTRUE;
38       planeeffSSD->UpDatePlaneEff(BFound,mod);
39     }
40   }
41   if(AliCDBManager::Instance()->GetDefaultStorage()->Put(planeeffSSD, idplaneeffSSD, md1))
42   printf("Local CDB file with random SSD plane efficiencies written \n");
43  delete gran;
44  delete planeeffSSD;
45  delete md1;
46 }