]>
Commit | Line | Data |
---|---|---|
6c9e411d | 1 | /* |
2 | // Pseudo code | |
3 | // 1. Load Calibration from DB | |
4 | ||
5 | .x $ALICE_ROOT/TPC/macros/ConfigOCDB.C | |
6 | ||
7 | // | |
8 | //2. Load Calibration components | |
9 | // | |
10 | .x ~/UliStyle.C | |
11 | gSystem->Load("libANALYSIS"); | |
12 | gSystem->Load("libSTAT"); | |
13 | gSystem->Load("libTPCcalib"); | |
14 | TFile fcalib("CalibObjects.root"); | |
15 | TObjArray * array = (TObjArray*)fcalib.Get("TPCCalib"); | |
16 | AliTPCcalibTracksGain * gain = ( AliTPCcalibTracksGain *)array->FindObject("calibTracksGain"); | |
17 | ||
18 | // | |
19 | //3. | |
20 | // | |
21 | AliTPCClusterParam * paramCl = AliTPCcalibDB::Instance()->GetClusterParam(); | |
22 | gain->UpdateClusterParam(paramCl); | |
23 | ||
24 | // | |
25 | //4. Test - visulaize results | |
26 | // | |
27 | TF1 fdr("fdr","AliTPCClusterParam::SQnorm(0,0,x,0,0)",0,1); | |
28 | ||
29 | // | |
30 | //5. Update the ClusterParam in your OCDB | |
31 | // | |
32 | // | |
33 | Int_t runNumber = 0; //61725 | |
34 | AliCDBMetaData *metaData= new AliCDBMetaData(); | |
35 | metaData->SetObjectClassName("AliTPCClusterParam"); | |
36 | metaData->SetResponsible("Marian Ivanov"); | |
37 | metaData->SetBeamPeriod(1); | |
38 | metaData->SetAliRootVersion("05-06-00"); //root version | |
39 | metaData->SetComment("October runs calibration"); | |
40 | AliCDBId id1("TPC/Calib/ClusterParam", runNumber, AliCDBRunRange::Infinity()); | |
162637e4 | 41 | gStorage = AliCDBManager::Instance()->GetStorage("local://$ALICE_ROOT/OCDB"); |
6c9e411d | 42 | gStorage->Put(paramCl, id1, metaData); |
43 | ||
44 | ||
45 | // | |
46 | // 6. dEdx matching - Currently only debug streamers | |
47 | // Load Proof with OCDB | |
48 | See pseudo code TestChainCosmicdEdx | |
49 | */ | |
50 | ||
51 | ||
52 | ||
53 | ||
54 | ||
55 | void TestChainCosmicDedx(){ | |
56 | // | |
57 | // pseudo cose | |
58 | // | |
59 | gSystem->Load("libANALYSIS"); | |
60 | gSystem->Load("libSTAT"); | |
61 | gSystem->Load("libTPCcalib"); | |
62 | ||
63 | //e.g | |
64 | gSystem->AddIncludePath("-I$ALICE_ROOT/TPC/macros"); | |
65 | gROOT->LoadMacro("$ALICE_ROOT/TPC/macros/AliXRDPROOFtoolkit.cxx+"); | |
66 | AliXRDPROOFtoolkit tool; | |
67 | TChain * chainCosmic = tool.MakeChain("cosmic.txt","Track0",0,1000000); | |
68 | chainCosmic->Lookup(); | |
69 | ||
70 | ||
71 | ||
72 | TCut cutT("cutT","abs(Tr1.fP[3]+Tr0.fP[3])<0.01"); // OK | |
73 | TCut cutD("cutD","abs(Tr0.fP[0]+Tr1.fP[0])<2"); // OK | |
74 | TCut cutP1("cutP1","abs(Tr0.fP[1]-Tr1.fP[1])<3"); // OK | |
75 | TCut cutPt("cutPt","abs(Tr1.fP[4]+Tr0.fP[4])<0.1&&abs(Tr0.fP[4])+abs(Tr1.fP[4])<10"); | |
76 | TCut cutN("cutN","min(Orig0.fTPCncls,Orig1.fTPCncls)>100"); | |
77 | TCut cutA=cutT+cutD+cutPt+cutN+cutP1; | |
78 | ||
79 | TCut cutS("cutS","Orig0.fIp.fP[1]*Orig1.fIp.fP[1]>0"); | |
80 | ||
81 | if (gProof) chainCosmic->SetProof(kTRUE); | |
82 | // | |
83 | // | |
84 | // | |
85 | // | |
86 | ||
87 | // | |
88 | // Q normalization - short - medium - long | |
89 | // | |
90 | ||
91 | TVectorD paramT(3); | |
92 | TVectorD paramM(3); | |
93 | TH1 * hisRatio =0; | |
94 | ||
95 | chainCosmic->Draw("Seed0.CookdEdxNorm(0.01,0.65,0,0,64,0,kFALSE)/Seed0.CookdEdxNorm(0.01,0.65,0,0,159,0,kFALSE)>>hisRatio(100,0.5,1.5)","min(Orig0.fTPCncls,Orig1.fTPCncls)>130",""); | |
96 | hisRatio = (TH1*)gROOT->FindObject("hisRatio"); | |
97 | hisRatio->Fit("gaus"); | |
98 | paramT[0]=hisRatio->GetFunction("gaus")->GetParameter(1); | |
99 | // | |
100 | chainCosmic->Draw("Seed0.CookdEdxNorm(0.01,0.65,0,64,127,0,kFALSE)/Seed0.CookdEdxNorm(0.01,0.65,0,0,159,0,kFALSE)>>hisRatio(100,0.5,1.5)","min(Orig0.fTPCncls,Orig1.fTPCncls)>130",""); | |
101 | hisRatio = (TH1*)gROOT->FindObject("hisRatio"); | |
102 | hisRatio->Fit("gaus"); | |
103 | paramT[1]=hisRatio->GetFunction("gaus")->GetParameter(1); | |
104 | // | |
105 | chainCosmic->Draw("Seed0.CookdEdxNorm(0.01,0.65,0,127,159,0,kFALSE)/Seed0.CookdEdxNorm(0.01,0.65,0,0,159,0,kFALSE)>>hisRatio(100,0.5,1.5)","min(Orig0.fTPCncls,Orig1.fTPCncls)>130",""); | |
106 | hisRatio = (TH1*)gROOT->FindObject("hisRatio"); | |
107 | hisRatio->Fit("gaus"); | |
108 | paramT[2]=hisRatio->GetFunction("gaus")->GetParameter(1); | |
109 | // | |
110 | chainCosmic->Draw("Seed0.CookdEdxNorm(0.01,0.65,1,0,64,0,kFALSE)/Seed0.CookdEdxNorm(0.01,0.65,1,0,159,0,kFALSE)>>hisRatio(100,0.5,1.5)","min(Orig0.fTPCncls,Orig1.fTPCncls)>130",""); | |
111 | hisRatio = (TH1*)gROOT->FindObject("hisRatio"); | |
112 | hisRatio->Fit("gaus"); | |
113 | paramM[0]=hisRatio->GetFunction("gaus")->GetParameter(1); | |
114 | // | |
115 | chainCosmic->Draw("Seed0.CookdEdxNorm(0.01,0.65,1,64,127,0,kFALSE)/Seed0.CookdEdxNorm(0.01,0.65,1,0,159,0,kFALSE)>>hisRatio(100,0.5,1.5)","min(Orig0.fTPCncls,Orig1.fTPCncls)>130",""); | |
116 | hisRatio = (TH1*)gROOT->FindObject("hisRatio"); | |
117 | hisRatio->Fit("gaus"); | |
118 | paramM[1]=hisRatio->GetFunction("gaus")->GetParameter(1); | |
119 | // | |
120 | chainCosmic->Draw("Seed0.CookdEdxNorm(0.01,0.65,1,127,159,0,kFALSE)/Seed0.CookdEdxNorm(0.01,0.65,1,0,159,0,kFALSE)>>hisRatio(100,0.5,1.5)","min(Orig0.fTPCncls,Orig1.fTPCncls)>130",""); | |
121 | hisRatio = (TH1*)gROOT->FindObject("hisRatio"); | |
122 | hisRatio->Fit("gaus"); | |
123 | paramM[2]=hisRatio->GetFunction("gaus")->GetParameter(1); | |
124 | // | |
125 | ||
126 | ||
127 | ||
128 | ||
129 | ||
130 | paramCl->fQpadTnorm=(TVectorD*)paramT->Clone(); | |
131 | paramCl->fQpadMnorm=(TVectorD*)paramM->Clone(); | |
132 | ||
133 | ||
134 | //check | |
135 | ||
136 | ||
137 | } | |
138 | ||
139 | ||
140 | ||
141 | ||
142 | ||
143 |