]>
Commit | Line | Data |
---|---|---|
d47d42ee | 1 | /* |
7390f655 | 2 | // .x ~/NimStyle.C |
3 | // .x ~/rootlogon.C | |
7ce80437 | 4 | |
d47d42ee | 5 | gSystem->AddIncludePath("-I$ALICE_ROOT/TPC"); |
e2914767 | 6 | |
e2914767 | 7 | |
8 | ||
7ce80437 | 9 | .L $ALICE_ROOT/TPC/CalibMacros/CalibEnv.C+ |
d47d42ee | 10 | Init(); |
6e7d7dc4 | 11 | CalibEnv("run.list"); |
7ce80437 | 12 | GetTree(); |
13 | ||
e79211e8 | 14 | TFile f("dcsTime.root") |
d47d42ee | 15 | |
7ce80437 | 16 | // |
17 | // if you want to use alien OCDB | |
18 | // | |
19 | gSystem->Load("libXrdClient.so"); | |
20 | gSystem->Load("libNetx.so"); | |
21 | if (!gGrid) TGrid::Connect("alien://",0,0,"t"); | |
22 | ||
23 | ||
e2914767 | 24 | |
d47d42ee | 25 | */ |
26 | ||
27 | #include <iostream> | |
28 | #include <fstream> | |
5312f439 | 29 | #include <stdio.h> |
d47d42ee | 30 | #include <AliCDBManager.h> |
31 | #include <AliCDBEntry.h> | |
32 | #include <AliLog.h> | |
33 | #include <AliMagF.h> | |
34 | #include "AliTPCcalibDB.h" | |
892226be | 35 | #include "AliTPCcalibDButil.h" |
d47d42ee | 36 | #include "AliTPCAltroMapping.h" |
37 | #include "AliTPCExB.h" | |
38 | #include "AliTPCCalROC.h" | |
39 | #include "AliTPCCalPad.h" | |
40 | #include "AliTPCSensorTempArray.h" | |
41 | #include "AliGRPObject.h" | |
42 | #include "AliTPCTransform.h" | |
43 | #include "TFile.h" | |
44 | #include "TKey.h" | |
45 | #include "TObjArray.h" | |
46 | #include "TObjString.h" | |
47 | #include "TString.h" | |
48 | #include "AliTPCCalPad.h" | |
5312f439 | 49 | #include "AliTPCROC.h" |
50 | #include "AliTPCParam.h" | |
d47d42ee | 51 | #include "AliTPCCalibPulser.h" |
52 | #include "AliTPCCalibPedestal.h" | |
53 | #include "AliTPCCalibCE.h" | |
54 | #include "AliTPCExBFirst.h" | |
55 | #include "TTreeStream.h" | |
56 | #include "AliTPCTempMap.h" | |
5312f439 | 57 | #include "TVectorD.h" |
58 | #include "TMatrixD.h" | |
6e7d7dc4 | 59 | #include "AliTPCCalibRaw.h" |
7390f655 | 60 | #include "AliSplineFit.h" |
d47d42ee | 61 | |
7ce80437 | 62 | |
63 | TTree * dcsTree=0; | |
7390f655 | 64 | TString refFile="/data/Work/data/calib/guiTrees/RefCalPads_83680.root"; |
65 | // TString refFile="/lustre/alice/wiechula/calib/guiTrees/RefCalPads_83680.root" | |
6fb51ca4 | 66 | void GetProductionInfo(Int_t run, Int_t &nalien, Int_t &nRawAlien, Int_t &nlocal, Int_t &nRawLocal); |
5312f439 | 67 | |
6e7d7dc4 | 68 | void Init2008(){ |
d47d42ee | 69 | // |
70 | // | |
71 | // | |
162637e4 | 72 | AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT/OCDB"); |
73 | AliCDBManager::Instance()->SetSpecificStorage("TPC/Calib/Parameters","local://$ALICE_ROOT/OCDB"); | |
e6970ab5 | 74 | AliCDBManager::Instance()->SetSpecificStorage("GRP/GRP/Data","local:///lustre/alice/alien/alice/data/2008/LHC08d/OCDB/"); |
75 | AliCDBManager::Instance()->SetSpecificStorage("TPC/Calib/Temperature","local:///lustre/alice/alien/alice/data/2008/LHC08d/OCDB/"); | |
76 | AliCDBManager::Instance()->SetSpecificStorage("TPC/Calib/HighVoltage","local:///lustre/alice/alien/alice/data/2008/LHC08d/OCDB/"); | |
77 | AliCDBManager::Instance()->SetSpecificStorage("TPC/Calib/Goofie","local:///lustre/alice/alien/alice/data/2008/LHC08d/OCDB/"); | |
d47d42ee | 78 | AliCDBManager::Instance()->SetRun(1); |
e2914767 | 79 | } |
80 | ||
6e7d7dc4 | 81 | void Init(){ |
82 | AliCDBManager::Instance()->SetDefaultStorage("local:///lustre/alice/alien/alice/data/2009/OCDB/"); | |
83 | AliCDBManager::Instance()->SetRun(1); | |
84 | } | |
d47d42ee | 85 | |
e2914767 | 86 | void InitAlien(const char *path="LHC08b"){ |
87 | // | |
88 | // | |
89 | // | |
90 | TString alpath="alien://folder=/alice/data/2008/"; | |
91 | alpath+=path; | |
92 | alpath+="/OCDB"; | |
7ce80437 | 93 | |
162637e4 | 94 | AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT/OCDB"); |
95 | AliCDBManager::Instance()->SetSpecificStorage("TPC/Calib/Parameters","local://$ALICE_ROOT/OCDB"); | |
e2914767 | 96 | AliCDBManager::Instance()->SetSpecificStorage("GRP/GRP/Data",alpath.Data()); |
97 | AliCDBManager::Instance()->SetSpecificStorage("TPC/Calib/Temperature",alpath.Data()); | |
98 | AliCDBManager::Instance()->SetSpecificStorage("TPC/Calib/Goofie",alpath.Data()); | |
99 | AliCDBManager::Instance()->SetRun(1); | |
d47d42ee | 100 | } |
101 | ||
102 | ||
103 | void CalibEnv(const char * runList){ | |
104 | // | |
105 | // | |
7ce80437 | 106 | // |
e79211e8 | 107 | AliTPCcalibDB * calibDB = AliTPCcalibDB::Instance(); |
d47d42ee | 108 | ifstream in; |
109 | in.open(runList); | |
110 | Int_t irun=0; | |
e79211e8 | 111 | TTreeSRedirector *pcstream = new TTreeSRedirector("dcsTime.root"); |
892226be | 112 | AliTPCcalibDButil dbutil; |
7390f655 | 113 | dbutil.SetRefFile(refFile.Data()); |
114 | Int_t startTime = 0; | |
115 | Int_t endTime = 0; | |
116 | Int_t startTimeGRP = 0; | |
117 | Int_t stopTimeGRP = 0; | |
118 | ||
119 | AliSplineFit *fitVdrift=0x0; | |
d47d42ee | 120 | // for (Int_t irun=startRun; irun<stopRun; irun++){ |
121 | while(in.good()) { | |
122 | in >> irun; | |
6e7d7dc4 | 123 | if (in.eof()) break; |
d47d42ee | 124 | if (irun==0) continue; |
e2914767 | 125 | printf("Processing run %d ...\n",irun); |
5312f439 | 126 | AliTPCcalibDB::Instance()->SetRun(irun); |
892226be | 127 | dbutil.UpdateFromCalibDB(); |
7390f655 | 128 | AliDCSSensorArray *arrHV=calibDB->GetVoltageSensors(irun); |
129 | if (!arrHV) continue; | |
130 | for (Int_t isenHV=0; isenHV<arrHV->NumSensors(); ++isenHV){ | |
131 | AliDCSSensor *senHV=arrHV->GetSensorNum(isenHV); | |
132 | if (!senHV) continue; | |
133 | startTime=senHV->GetStartTime(); | |
134 | endTime =senHV->GetEndTime(); | |
135 | if (startTime>0&&endTime>0) break; | |
136 | } | |
137 | if (calibDB->GetGRP(irun)){ | |
138 | startTimeGRP = AliTPCcalibDB::GetGRP(irun)->GetTimeStart(); | |
139 | stopTimeGRP = AliTPCcalibDB::GetGRP(irun)->GetTimeEnd(); | |
140 | } | |
141 | // AliDCSSensor * sensorPressure = AliTPCcalibDB::Instance()->GetPressureSensor(irun); | |
142 | // if (!sensorPressure) continue; | |
143 | // Int_t startTime = sensorPressure->GetStartTime(); | |
144 | // Int_t endTime = sensorPressure->GetEndTime(); | |
145 | // Int_t startTimeGRP = AliTPCcalibDB::GetGRP(irun)->GetTimeStart(); | |
146 | // Int_t stopTimeGRP = AliTPCcalibDB::GetGRP(irun)->GetTimeEnd(); | |
d47d42ee | 147 | AliTPCSensorTempArray * tempArray = AliTPCcalibDB::Instance()->GetTemperatureSensor(irun); |
148 | AliTPCTempMap * tempMap = new AliTPCTempMap(tempArray); | |
149 | AliDCSSensorArray* goofieArray = AliTPCcalibDB::Instance()->GetGoofieSensors(irun); | |
150 | // | |
d47d42ee | 151 | Int_t dtime = TMath::Max((endTime-startTime)/20,10*60); |
892226be | 152 | //Goofie statistical data |
153 | TVectorD vecEntries, vecMean, vecMedian,vecRMS; | |
154 | dbutil.ProcessGoofie(vecEntries ,vecMedian, vecMean, vecRMS); | |
5312f439 | 155 | //CE data processing - see ProcessCEdata function for description of the results |
156 | TVectorD fitResultsA, fitResultsC; | |
892226be | 157 | Int_t nmaskedCE; |
7390f655 | 158 | dbutil.ProcessCEdata("(sector<36)++gx++gy++lx++lx**2",fitResultsA,fitResultsC,nmaskedCE); |
892226be | 159 | TVectorD vecTEntries, vecTMean, vecTRMS, vecTMedian, vecQEntries, vecQMean, vecQRMS, vecQMedian; |
160 | Float_t driftTimeA, driftTimeC; | |
161 | dbutil.ProcessCEgraphs(vecTEntries, vecTMean, vecTRMS, vecTMedian, | |
162 | vecQEntries, vecQMean, vecQRMS, vecQMedian, | |
163 | driftTimeA, driftTimeC ); | |
7390f655 | 164 | //drift velocity using tracks |
165 | fitVdrift=calibDB->GetVdriftSplineFit("ALISPLINEFIT_MEAN_VDRIFT_COSMICS_ALL",irun); | |
5312f439 | 166 | //noise data Processing - see ProcessNoiseData function for description of the results |
167 | TVectorD vNoiseMean, vNoiseMeanSenRegions, vNoiseRMS, vNoiseRMSSenRegions; | |
168 | Int_t nonMaskedZero=0; | |
892226be | 169 | dbutil.ProcessNoiseData(vNoiseMean, vNoiseMeanSenRegions, vNoiseRMS, vNoiseRMSSenRegions, nonMaskedZero); |
7390f655 | 170 | // comparisons |
171 | TVectorF pedestalDeviations; | |
172 | TVectorF noiseDeviations; | |
173 | TVectorF pulserQdeviations; | |
174 | Float_t varQMean; | |
175 | Int_t npadsOutOneTB; | |
176 | Int_t npadsOffAdd; | |
177 | dbutil.ProcessPedestalVariations(pedestalDeviations); | |
178 | dbutil.ProcessNoiseVariations(noiseDeviations); | |
179 | dbutil.ProcessPulserVariations(pulserQdeviations,varQMean,npadsOutOneTB,npadsOffAdd); | |
180 | ||
e6970ab5 | 181 | //L3 data |
5312f439 | 182 | Float_t bz=AliTPCcalibDB::GetBz(irun); |
183 | Char_t l3pol=AliTPCcalibDB::GetL3Polarity(irun); | |
184 | //calibration Pulser data processing | |
5312f439 | 185 | Int_t nOffChannels=0; |
892226be | 186 | TVectorD vTimePulser; |
187 | nOffChannels=dbutil.GetNPulserOutliers(); | |
188 | dbutil.ProcessPulser(vTimePulser); | |
189 | //ALTRO data | |
190 | Int_t nMasked=0; | |
191 | dbutil.ProcessALTROConfig(nMasked); | |
6e7d7dc4 | 192 | //Calib RAW data |
193 | Int_t nFailL1=-1; | |
194 | if (calibDB->GetCalibRaw()) | |
195 | nFailL1=calibDB->GetCalibRaw()->GetNFailL1Phase(); | |
5312f439 | 196 | //production information |
6fb51ca4 | 197 | Int_t nalien=0,nRawAlien=0,nlocal=0,nRawLocal=0; |
e6970ab5 | 198 | // GetProductionInfo(irun, nalien, nRawAlien, nlocal,nRawLocal); |
5312f439 | 199 | //run type |
200 | TObjString runType(AliTPCcalibDB::GetRunType(irun).Data()); | |
201 | ||
d47d42ee | 202 | for (Int_t itime=startTime; itime<endTime; itime+=dtime){ |
203 | // | |
5312f439 | 204 | TTimeStamp tstamp(itime); |
e79211e8 | 205 | Float_t valuePressure = calibDB->GetPressure(tstamp,irun,0); |
206 | Float_t valuePressure2 = calibDB->GetPressure(tstamp,irun,1); | |
5312f439 | 207 | //temperature fits |
d47d42ee | 208 | TLinearFitter * fitter = 0; |
209 | TVectorD vecTemp[10]; | |
e79211e8 | 210 | for (Int_t itype=0; itype<5; itype++) |
5312f439 | 211 | for (Int_t iside=0; iside<2; iside++){ |
212 | fitter= tempMap->GetLinearFitter(itype,iside,tstamp); | |
213 | if (!fitter) continue; | |
214 | fitter->Eval(); | |
215 | fitter->GetParameters(vecTemp[itype+iside*5]); | |
216 | delete fitter; | |
217 | } | |
218 | //measured skirt temperatures | |
219 | TVectorD vecSkirtTempA(18); | |
220 | TVectorD vecSkirtTempC(18); | |
221 | Int_t nsenTemp=tempArray->NumSensors(); | |
222 | for (Int_t isenTemp=0;isenTemp<nsenTemp;++isenTemp){ | |
223 | AliTPCSensorTemp *senTemp=(AliTPCSensorTemp*)tempArray->GetSensorNum(isenTemp); | |
224 | if (senTemp->GetType()!=3) continue; | |
225 | if (TMath::Sqrt(senTemp->GetX()*senTemp->GetX()+senTemp->GetY()*senTemp->GetY())<100) continue; //only skirt, outer FC vessel | |
226 | Double_t val=senTemp->GetValue(tstamp); | |
227 | if (senTemp->GetSide()==0) | |
228 | vecSkirtTempA[senTemp->GetSector()]=val; | |
229 | else | |
230 | vecSkirtTempC[senTemp->GetSector()]=val; | |
231 | } | |
892226be | 232 | //goofie data |
233 | TVectorD vecGoofie; | |
5312f439 | 234 | if (goofieArray){ |
235 | vecGoofie.ResizeTo(goofieArray->NumSensors()); | |
5312f439 | 236 | for (Int_t isensor=0; isensor<goofieArray->NumSensors();isensor++){ |
237 | AliDCSSensor *gsensor = goofieArray->GetSensor(isensor); | |
238 | if (gsensor){ | |
239 | vecGoofie[isensor] = gsensor->GetValue(tstamp); | |
240 | } | |
241 | } | |
892226be | 242 | } else { |
243 | vecGoofie.ResizeTo(19); | |
d47d42ee | 244 | } |
892226be | 245 | Double_t ptrelative0 = AliTPCcalibDB::GetPTRelative((UInt_t)itime,irun,0); |
246 | Double_t ptrelative1 = AliTPCcalibDB::GetPTRelative((UInt_t)itime,irun,1); | |
e2914767 | 247 | // |
5312f439 | 248 | TVectorD voltagesIROC(36); |
249 | TVectorD voltagesOROC(36); | |
892226be | 250 | for(Int_t j=1; j<36; j++) voltagesIROC[j-1] = AliTPCcalibDB::Instance()->GetChamberHighVoltage(irun, j,itime); |
251 | for(Int_t j=36; j<72; j++) voltagesOROC[j-36] = AliTPCcalibDB::Instance()->GetChamberHighVoltage(irun, j,itime); | |
7ce80437 | 252 | Double_t voltIROC = TMath::Median(36, voltagesIROC.GetMatrixArray()); |
253 | Double_t voltOROC = TMath::Median(36, voltagesOROC.GetMatrixArray()); | |
254 | // | |
5312f439 | 255 | Float_t coverIA=AliTPCcalibDB::GetCoverVoltage(irun,0,itime); |
256 | Float_t coverIC=AliTPCcalibDB::GetCoverVoltage(irun,18,itime); | |
257 | Float_t coverOA=AliTPCcalibDB::GetCoverVoltage(irun,36,itime); | |
258 | Float_t coverOC=AliTPCcalibDB::GetCoverVoltage(irun,54,itime); | |
259 | Float_t skirtA=AliTPCcalibDB::GetSkirtVoltage(irun,0,itime); | |
260 | Float_t skirtC=AliTPCcalibDB::GetSkirtVoltage(irun,18,itime); | |
261 | Float_t ggOffA=AliTPCcalibDB::GetGGoffsetVoltage(irun,0,itime); | |
262 | Float_t ggOffC=AliTPCcalibDB::GetGGoffsetVoltage(irun,18,itime); | |
7390f655 | 263 | //drift velocity |
264 | Float_t dvCorr=-5; | |
265 | if (fitVdrift) dvCorr=fitVdrift->Eval(itime); | |
5312f439 | 266 | |
267 | ||
e2914767 | 268 | //tempMap->GetLinearFitter(0,0,itime); |
e6970ab5 | 269 | (*pcstream)<<"dcs"<< |
5312f439 | 270 | "run="<<irun<< |
271 | "time="<<itime<< | |
6fb51ca4 | 272 | "startTimeGRP="<<startTimeGRP<< |
273 | "stopTimeGRP="<<stopTimeGRP<< | |
5312f439 | 274 | //run type |
275 | "runType.="<<&runType<< | |
276 | // voltage setting | |
277 | "VIROC.="<<&voltagesIROC<< | |
278 | "VOROC.="<<&voltagesOROC<< | |
279 | "medianVIROC="<<voltIROC<< | |
280 | "medianVOROC="<<voltOROC<< | |
7ce80437 | 281 | "coverIA=" << coverIA << |
282 | "coverIC=" << coverIC << | |
283 | "coverOA=" << coverOA << | |
284 | "coverOC=" << coverOC << | |
285 | "skirtA=" << skirtA << | |
286 | "skirtC=" << skirtC << | |
287 | "ggOffA=" << ggOffA << | |
288 | "ggOffC=" << ggOffC << | |
5312f439 | 289 | // |
290 | "ptrel0="<<ptrelative0<< // deltaTP/TP - A side | |
291 | "ptrel1="<<ptrelative1<< // deltaTP/TPC - C side | |
292 | "goofie.="<<&vecGoofie<< | |
293 | "goofieE.="<<&vecEntries<< | |
294 | "goofieMean.="<<&vecMean<< | |
295 | "goofieMedian.="<<&vecMedian<< | |
296 | "goofieRMS.="<<&vecRMS<< | |
297 | // | |
298 | "press="<<valuePressure<< | |
299 | "press2="<<valuePressure2<< | |
300 | "temp00.="<<&vecTemp[0]<< | |
301 | "temp10.="<<&vecTemp[1]<< | |
302 | "temp20.="<<&vecTemp[2]<< | |
303 | "temp30.="<<&vecTemp[3]<< | |
304 | "temp40.="<<&vecTemp[4]<< | |
305 | "temp01.="<<&vecTemp[5]<< | |
306 | "temp11.="<<&vecTemp[6]<< | |
307 | "temp21.="<<&vecTemp[7]<< | |
308 | "temp31.="<<&vecTemp[8]<< | |
309 | "temp41.="<<&vecTemp[9]<< | |
310 | "tempSkirtA.="<<&vecSkirtTempA<< | |
6e7d7dc4 | 311 | "tempSkirtC.="<<&vecSkirtTempC; |
312 | ||
313 | (*pcstream)<<"dcs"<< | |
5312f439 | 314 | //noise data |
315 | "meanNoise.="<<&vNoiseMean<< | |
316 | "meanNoiseSen.="<<&vNoiseMeanSenRegions<< | |
317 | "rmsNoise.="<<&vNoiseRMS<< | |
318 | "rmsNoiseSen.="<<&vNoiseRMSSenRegions<< | |
319 | "zeroNoise="<<nonMaskedZero<< | |
320 | //pulser data | |
892226be | 321 | "timePulser.=" << &vTimePulser << |
5312f439 | 322 | "nOffPulser="<<nOffChannels<< |
892226be | 323 | //altro data |
324 | "nMasked="<<nMasked<< | |
5312f439 | 325 | //ce data |
326 | "CEfitA.="<<&fitResultsA<< | |
327 | "CEfitC.="<<&fitResultsC<< | |
892226be | 328 | "nmaskedCE="<<nmaskedCE<< |
329 | //ce graph data | |
330 | "CEgrTEntries.="<<&vecTEntries<< | |
331 | "CEgrTMean.="<<&vecTMean<< | |
332 | "CEgrTRMS.="<<&vecTRMS<< | |
333 | "CEgrTMedian.="<<&vecTMedian<< | |
334 | "CEgrQEntries.="<<&vecQEntries<< | |
335 | "CEgrQMean.="<<&vecQMean<< | |
336 | "CEgrQRMS.="<<&vecQRMS<< | |
337 | "CEgrQMedian.="<<&vecQMedian<< | |
892226be | 338 | "CEgrDriftA="<<driftTimeA<< |
339 | "CEgrDriftC="<<driftTimeC<< | |
6e7d7dc4 | 340 | //calib raw data |
341 | "nFailL1="<<nFailL1<< | |
5312f439 | 342 | // b field |
343 | "Bz="<< bz << | |
344 | "L3polarity="<<l3pol<< | |
345 | // production information | |
346 | "nalien="<<nalien<< | |
6fb51ca4 | 347 | "nRawAlien="<<nRawAlien<< |
5312f439 | 348 | "nlocal="<<nlocal<< |
6fb51ca4 | 349 | "nRawLocal="<<nRawLocal<< |
7390f655 | 350 | //comparisons with ref data |
351 | "pedestalDeviations.="<<&pedestalDeviations<< | |
352 | "noiseDeviations.="<<&noiseDeviations<< | |
353 | "pulserQdeviations.="<<&pulserQdeviations<< | |
354 | // "pulserVarQMean="<<varQMean<< | |
355 | "pulserNpadsOutOneTB="<<npadsOutOneTB<< | |
356 | "pulserNpadsOffAdd="<<npadsOffAdd<< | |
357 | "driftCorrCosmAll="<<dvCorr<< | |
358 | ||
5312f439 | 359 | "\n"; |
d47d42ee | 360 | } |
361 | } | |
362 | delete pcstream; | |
363 | } | |
364 | ||
365 | ||
5312f439 | 366 | |
5312f439 | 367 | |
6fb51ca4 | 368 | void GetProductionInfo(Int_t run, Int_t &nalien, Int_t &nRawAlien, Int_t &nlocal, Int_t &nRawLocal){ |
5312f439 | 369 | // |
370 | // find number of ESDs in central and local production for run | |
371 | // | |
372 | ||
373 | nalien=0; | |
6fb51ca4 | 374 | nRawAlien=0; |
5312f439 | 375 | nlocal=0; |
6fb51ca4 | 376 | nRawLocal=0; |
5312f439 | 377 | TString sNlines; |
5312f439 | 378 | //find number of ESDs in alien |
379 | TString command="alien_find /alice/data/2009 "; | |
380 | command += Form("%09d",run); | |
381 | command += " | grep AliESDs.root | wc -l"; | |
6fb51ca4 | 382 | sNlines = gSystem->GetFromPipe(command.Data()); |
5312f439 | 383 | nalien=sNlines.Atoi(); |
6fb51ca4 | 384 | //find number of raw files on alien |
385 | command="alien_find /alice/data/2009 "; | |
386 | command += Form("%09d",run); | |
387 | command += " | grep raw | grep -v tag | wc -l"; | |
388 | sNlines = gSystem->GetFromPipe(command.Data()); | |
389 | nRawAlien=sNlines.Atoi(); | |
5312f439 | 390 | //find number of ESDs local |
6fb51ca4 | 391 | command="find /lustre/alice/alien/alice/data/2009 -name AliESDs.root | grep "; |
5312f439 | 392 | command += Form("%09d",run); |
6fb51ca4 | 393 | command += " | wc -l"; |
394 | sNlines = gSystem->GetFromPipe(command.Data()); | |
5312f439 | 395 | nlocal=sNlines.Atoi(); |
6fb51ca4 | 396 | //find number of local raw data files |
397 | command="find /lustre/alice/alien/alice/data/2009 -name \"*.root\" | grep "; | |
398 | command += Form("%09d",run); | |
399 | command += " | grep raw | grep -v tag | wc -l"; | |
400 | sNlines = gSystem->GetFromPipe(command.Data()); | |
401 | nRawLocal=sNlines.Atoi(); | |
5312f439 | 402 | } |
e2914767 | 403 | |
404 | void FilterMag(const char * runList){ | |
405 | // | |
406 | // | |
407 | // | |
408 | // AliTPCcalibDB * calibDB = AliTPCcalibDB::Instance(); | |
409 | ifstream in; | |
410 | in.open(runList); | |
411 | Int_t irun=0; | |
412 | while(in.good()) { | |
413 | in >> irun; | |
414 | if (irun==0) continue; | |
415 | AliGRPObject *grp = AliTPCcalibDB::GetGRP(irun); | |
416 | Float_t current = -1; | |
417 | Float_t bz = -1; | |
5312f439 | 418 | // Float_t press = 0; |
e2914767 | 419 | if (grp){ |
420 | current = grp->GetL3Current((AliGRPObject::Stats)0); | |
421 | bz = 5*current/30000.; | |
422 | printf("Run%d\tL3 current%f\tBz\t%f\n",irun,current,bz); | |
423 | } | |
424 | else{ | |
425 | printf("Run%d\tL3 current%f\tBz\t%f\n",irun,current,bz); | |
426 | } | |
427 | } | |
7ce80437 | 428 | |
429 | } | |
430 | ||
431 | ||
432 | void GetTree(){ | |
433 | TFile *fdcs = new TFile("dcsTime.root"); | |
5312f439 | 434 | dcsTree = (TTree*)fdcs->Get("dcs"); |
7ce80437 | 435 | // |
436 | // mean temp A | |
5312f439 | 437 | |
7ce80437 | 438 | dcsTree->Draw("temp30.fElements[0]"); |
5312f439 | 439 | |
e2914767 | 440 | } |
441 | ||
7ce80437 | 442 | void GetNominalValues(){ |
443 | // | |
444 | if (!dcsTree) return; | |
445 | } | |
446 | ||
447 | ||
448 | ||
449 | ||
d47d42ee | 450 | /* |
451 | ||
452 | AliDCSSensor * sensorPressure = AliTPCcalibDB::Instance()->GetPressureSensor(62084); | |
453 | entry = AliCDBManager::Instance()->Get("TPC/Calib/Temperature",run); | |
454 | AliTPCSensorTempArray * tempArray = (AliTPCSensorTempArray *)entry->GetObject(); | |
455 | AliTPCSensorTempArray * tempArray = (AliTPCSensorTempArray *)AliTPCcalibDB::Instance()->GetTemperatureSensor(62084) | |
456 | AliTPCTempMap * tempMap = new AliTPCTempMap(tempArray); | |
e79211e8 | 457 | TLinearFitter * fitter = tempMap->GetLinearFitter(0,0,tempArray->GetStartTime()); |
d47d42ee | 458 | |
459 | AliDCSSensorArray* goofieArray = AliTPCcalibDB::Instance()->GetGoofieSensors(62084); | |
460 | ||
461 | */ | |
7ce80437 | 462 | |
463 | /* | |
464 | ||
465 | void PlotPressureResol(){ | |
466 | // | |
467 | // Example | |
468 | // | |
469 | dcs->Draw("100000*(press-press2-4.782)/press/sqrt(2.)>>his(100,-50,50)","run>61400","") | |
470 | his->SetXTitle("#sigma_{P/P_{0}}(10^{-5})"); | |
471 | gPad->SaveAs("picDCS/deltaPoverP.eps"); | |
472 | gPad->SaveAs("picDCS/deltaPoverP.gif"); | |
5312f439 | 473 | |
7ce80437 | 474 | } |
475 | void PlotTresol(){ | |
476 | // | |
477 | // T resolution example | |
478 | // plot difference of the temperature from A and C side | |
479 | // Supposing the error is independent - (division by sqrt(2)) | |
480 | dcs->Draw("100000*(temp30.fElements[0]-temp31.fElements[0]+0.00509)/(temp31.fElements[0]+273.15)/sqrt(2.)>>his(100,-5,5)","run>61400",""); | |
481 | his->SetXTitle("#sigma_{T/T_{0}}(10^{-5})"); | |
482 | gPad->SaveAs("picDCS/deltaToverT.eps"); | |
483 | gPad->SaveAs("picDCS/deltaToverT.gif"); | |
484 | } | |
485 | */ |