For Pythia with tune don't switch off MI in ConfigHeavyFlavor
[u/mrichter/AliRoot.git] / ITS / StoreDriftSpeedSDD.C
CommitLineData
18da6e54 1#if !defined(__CINT__) || defined(__MAKECINT__)
2#include "AliCDBManager.h"
3#include "AliITSCalibrationSDD.h"
4#include "AliITSresponseSDD.h"
5#include "AliITSDriftSpeedSDD.h"
6#include "AliITSDriftSpeedArraySDD.h"
7#include "AliCDBMetaData.h"
8#include "AliCDBStorage.h"
9#include "AliCDBId.h"
10#include "AliCDBPath.h"
11#include "AliCDBEntry.h"
12#include <TObjArray.h>
13#include <TRandom3.h>
14#endif
15
16void StoreDriftSpeedSDD(Int_t firstRun=0,Int_t lastRun=9999999 ){
17 ///////////////////////////////////////////////////////////////////////
18 // Macro to generate and store the drift speed files for SDD //
19 // Generates: //
20 // 1 file with 520 AliITSDriftSpeedArraySDD objects with //
21 ///////////////////////////////////////////////////////////////////////
22
23 if(!AliCDBManager::Instance()->IsDefaultStorageSet()) {
24 AliCDBManager::Instance()->SetDefaultStorage("local://OCDB");
25 }
26
27
28 AliCDBMetaData *md1= new AliCDBMetaData(); // metaData describing the object
74999ed1 29 md1->SetObjectClassName("TObjArray");
30 md1->SetResponsible("Francesco Prino");
18da6e54 31 md1->SetBeamPeriod(0);
74999ed1 32 md1->SetComment("Simulated data");
18da6e54 33
34 AliCDBId drSpeed("ITS/Calib/DriftSpeedSDD",firstRun, lastRun);
35 TObjArray vdrift(520);
36 vdrift.SetOwner(kFALSE);
37
38
39
74999ed1 40 Double_t drVelParam[4]={6.533,0.001285,-0.000005,0};
4c1bcb5e 41 Double_t edrVelParam[4]={0.1,0,0,0};
42 Double_t drVel[4];
18da6e54 43 TRandom3 *gran = new TRandom3();
44
45 for(Int_t mod=0;mod<260;mod++){
46 AliITSDriftSpeedArraySDD *arr0 = new AliITSDriftSpeedArraySDD(5);
47 AliITSDriftSpeedArraySDD *arr1 = new AliITSDriftSpeedArraySDD(5);
48 for(Int_t iev=0; iev<5;iev++){
49 for(Int_t ic=0;ic<4;ic++) drVel[ic]=gran->Gaus(drVelParam[ic],edrVelParam[ic]);
50 AliITSDriftSpeedSDD *v0=new AliITSDriftSpeedSDD(iev*20,iev+1000,3,drVel);
51 arr0->AddDriftSpeed(v0);
52 for(Int_t ic=0;ic<4;ic++) drVel[ic]=gran->Gaus(drVelParam[ic],edrVelParam[ic]);
53 AliITSDriftSpeedSDD *v1=new AliITSDriftSpeedSDD(iev*20,iev+1000,3,drVel);
54 arr1->AddDriftSpeed(v1);
55 }
56 vdrift.Add(arr0);
57 vdrift.Add(arr1);
58 printf("Added module %d\n",mod);
59 }
60
61 AliCDBManager::Instance()->GetDefaultStorage()->Put(&vdrift, drSpeed, md1);
62}