00001
00002
00003
00004
00005
00006 #if !defined(__CINT__) || defined(__MAKECINT__)
00007
00008 #include "Riostream.h"
00009 #include <stdio.h>
00010 #include "TROOT.h"
00011 #include "TSystem.h"
00012 #include "TMath.h"
00013 #include "TH1.h"
00014 #include "TH2.h"
00015 #include "TH3.h"
00016 #include "TStyle.h"
00017 #include "TF1.h"
00018 #include "TProfile.h"
00019 #include "TTree.h"
00020 #include "TChain.h"
00021 #include "TFile.h"
00022 #include "TNtuple.h"
00023 #include "TCanvas.h"
00024 #include "TString.h"
00025 #include "TList.h"
00026 #include "TLegend.h"
00027 #include "TFileSet.h"
00028 #include "TDataSetIter.h"
00029 #include "TDirIter.h"
00030 #include "TTreeIter.h"
00031 #endif
00032 static Int_t run = 0;
00033 static Int_t date = 0;
00034 static Int_t Time = 0;
00035
00036 static Double_t DVAll[2][3];
00037 static Double_t dDVAll[2][3];
00038
00039 void MakeTable() {
00040 TString fOut = Form("tpcDriftVelocity.%8i.%06i.C",date,Time);
00041 ofstream out;
00042 cout << "Create " << fOut << endl;
00043 out.open(fOut.Data());
00044 out << "TDataSet *CreateTable() {" << endl;
00045 out << " if (!gROOT->GetClass(\"St_tpcDriftVelocity\")) return 0;" << endl;
00046 out << " St_tpcDriftVelocity *tableSet = new St_tpcDriftVelocity(\"tpcDriftVelocity\",1);" << endl;
00047 out << " tpcDriftVelocity_st row;// Laser Run " << run << endl;
00048 out << " row.laserDriftVelocityEast = " << DVAll[1][0] << "; // +/- " << dDVAll[1][0] << " cm/us All: East = " << DVAll[1][2] << " +/- " << dDVAll[1][2] << endl;
00049 out << " row.laserDriftVelocityWest = " << DVAll[1][0] << "; // +/- " << dDVAll[1][0] << " cm/us All: West = " << DVAll[1][1] << " +/- " << dDVAll[1][1] << endl;
00050 out << " row.cathodeDriftVelocityEast = 0; // cm/us : from cathode emission ;" << endl;
00051 out << " row.cathodeDriftVelocityWest = 0; // cm/us : from cathode emission ;" << endl;
00052 out << " tableSet->AddAt(&row);// 1e3*Delta: All = " << DVAll[0][0] << " +/- " << dDVAll[0][0] << endl;
00053 out << " return (TDataSet *)tableSet;//"
00054 << " West = " << DVAll[0][1] << " +/- " << dDVAll[0][1]
00055 << " East = " << DVAll[0][2] << " +/- " << dDVAll[0][2] << endl;
00056 out << "};" << endl;
00057 }
00058
00059 void Slopes(Int_t n1 = 1, Int_t n2 = 9999) {
00060 Int_t NF = 0;
00061 TSeqCollection *files = gROOT->GetListOfFiles();
00062 Int_t nn = files->GetSize();
00063 if (! nn) return;
00064 cout << "Oneped " << nn << " Files" << endl;
00065 TFile **Files = new TFile *[nn];
00066
00067 if (! files) return;
00068 TIter next(files);
00069 TFile *f = 0;
00070 Int_t l = 0;
00071 TString cut("fFit.Prob>1e-2&&fFit.ndf>4");
00072 while ( (f = (TFile *) next()) ) {
00073 TTree *laser = (TTree *) f->Get("laser");
00074 if (! laser) {
00075 cout << "Skip file " << f->GetName() << " with no laser Tree" << endl;
00076 delete f; continue;
00077 }
00078 Long64_t n = laser->Draw("fFit.slope",cut,"goff");
00079 if (n < 100) {
00080 cout << "Skip file " << f->GetName() << " with " << n << " Entries" << endl;
00081 delete f;
00082 } else {
00083 l++;
00084 if (l >= n1 && l <= n2) {
00085 cout << l << " Add file " << f->GetName() << " with " << n << " Entries" << endl;
00086
00087 Files[NF] = f;
00088 NF++;
00089 }
00090
00091 }
00092 }
00093 if (!NF) return;
00094 Int_t ny = (Int_t) TMath::Sqrt(NF);
00095 Int_t nx = NF/ny;
00096 if (nx*ny != NF) nx++;
00097 cout << "NF = " << NF << " nx " << nx << " ny " << ny << endl;
00098 TCanvas *c[2];
00099 c[0] = new TCanvas(Form("Slopes %i",n1),Form("Slopes %i",n1));
00100 c[1] = new TCanvas(Form("LDV %i",n1),Form("Laser Drift Velocities %i",n1));
00101 c[0]->Divide(nx,ny);
00102 c[1]->Divide(nx,ny);
00103 for (Int_t i = 0; i < NF; i++) {
00104 memset(&DVAll[0][0], 0, 6*sizeof(Double_t));
00105 memset(&dDVAll[0][0], 0, 6*sizeof(Double_t));
00106 f = Files[i];
00107
00108 if (! f) continue;
00109 cout << "i = " << i << " " << f->GetName() << endl;
00110 f->cd();
00111 TTree *laser = (TTree *) f->Get("laser");
00112 if (! laser) {
00113 cout << "Did not find TTree laser in " << f->GetName() << endl;
00114 continue;
00115 }
00116 laser->SetMarkerStyle(20);
00117 laser->Draw("fEvtHdr.fRun:fEvtHdr.fDate:fEvtHdr.fTime","","goff",1);
00118 run = (Int_t) laser->GetV1()[0];
00119 date = (Int_t) laser->GetV2()[0];
00120 Time = (Int_t) laser->GetV3()[0];
00121 cout << "Run = " << run << " date = " << date << " Time = " << Time << endl;
00122
00123
00124 TString histN, plot, plotW, Plot, Plot2, profN;
00125 TString plotE;
00126 TString CutW(cut); CutW += " && fFit.Sector < 13";
00127 TString CutE(cut); CutE += " && fFit.Sector > 12";
00128 Char_t *cutName[3] = {"All ","West","East"};
00129 Char_t *plName[2] = {"SS", "dV"};
00130 Char_t *FMT[2] = {"%s dV = (%7.2f +/- %7.2f) x 10^3","%s dV = (%10.5f +/- %10.5f) cm/mksec"};
00131 for (Int_t l = 0; l < 2; l++) {
00132 c[l]->cd(i+1)->SetLogz(1);
00133 histN = Form("%s%i",plName[l],run);
00134 if (l == 0) {
00135 plotW = "1e3*fFit.slope:fFit.Sector>>";
00136 plotE = plotW; plotE += "+";
00137
00138 } else {
00139 plotW = "1e-6*fEvtHdr.fOnlClock/fEvtHdr.fClock*fEvtHdr.fDriVel/(1.+fFit.slope-fEvtHdr.fOnlClock/fEvtHdr.fClock*fEvtHdr.fDriVel/TMath::Ccgs()):fFit.Sector>>";
00140 plotE = plotW; plotE += "+";
00141
00142 }
00143 Plot = plotW;
00144 profN = histN;
00145 profN += "_pfx";
00146 Plot += profN;
00147 Plot += "(24,1,25)";
00148 Long64_t n = laser->Draw(Plot,CutW,"prof");
00149 Plot = plotE; Plot += profN;
00150 n += laser->Draw(Plot,CutE,"prof");
00151 if (n < 10) {
00152 cout << f->GetName() << " empty only " << n << " entries" << endl;
00153 continue;
00154 }
00155 TProfile *SSp = (TProfile *) gDirectory->Get(profN);
00156 if (! SSp) continue;
00157 if (SSp->GetEntries() <= 10) {
00158 cout << SSp->GetName() << " empty only " << n << " entries" << endl;
00159 continue;
00160 }
00161 Plot2 = plotW;
00162 Plot2 += histN;
00163 SSp->SetMarkerColor(3);
00164 Double_t ymin = SSp->GetMean(2) - 3*SSp->GetRMS(2);
00165 Double_t ymax = SSp->GetMean(2) + 3*SSp->GetRMS(2);
00166 Plot2 += Form("(24,1,25,100,%f,%f)",ymin,ymax);
00167 laser->Draw(Plot2,CutW,"colz");
00168 Plot2 = plotE;
00169 Plot2 += histN;
00170 laser->Draw(Plot2,CutE,"colz");
00171 TH2F *SS = (TH2F *) gDirectory->Get(histN);
00172 if (! SS) {
00173 cout << "Did not find histogram " << histN << endl;
00174 continue;
00175 }
00176 SS->FitSlicesY();
00177 TString fitN(histN);
00178 fitN += "_1";
00179 TH1D *fit = (TH1D *) gDirectory->Get(fitN);
00180 TLegend *leg = new TLegend(0.1,0.1,0.55,0.25,"");
00181 if (fit) {
00182 fit->SetMarkerStyle(20);
00183 TF1 *pol0 = (TF1*) gROOT->GetFunction("pol0");
00184 if (pol0) {
00185 for (Int_t k = 0; k < 3; k++) {
00186 pol0->SetLineColor(k+1);
00187 if (k == 0) fit->Fit(pol0,"er","",1,25);
00188 if (k == 1) fit->Fit(pol0,"er+","",1,13);
00189 if (k == 2) fit->Fit(pol0,"er+","",13,25);
00190 DVAll[l][k] = pol0->GetParameter(0);
00191 dDVAll[l][k] = pol0->GetParError(0);
00192 if (!l || dDVAll[l][k] > 0 && dDVAll[l][k]< 1e-3)
00193 leg->AddEntry((TF1 *) fit->GetListOfFunctions()->Last(), Form(FMT[l],cutName[k],DVAll[l][k],dDVAll[l][k]));
00194 }
00195 }
00196 }
00197 SS->SetTitle(Form("Run: %i",run));
00198 SS->SetXTitle("Sector");
00199 SS->SetYTitle("Drift Velocity ");
00200 SS->Draw("colz");
00201 if (SSp) SSp->Draw("same");
00202 if (fit) fit->Draw("same");
00203 if (l && DVAll[l][0] > 0) {
00204 if (DVAll[l][0] > 5.5 && dDVAll[l][0] > 0 && dDVAll[l][0]< 1e-3) MakeTable();
00205 else {
00206 cout << "File " << f->GetName() << " fails =============================" << endl;
00207 leg->AddEntry(fit, "Rejected");
00208 }
00209 }
00210 leg->Draw();
00211 c[l]->Update();
00212 }
00213 }
00214 }
00215 #if 0
00216
00217 void Offsets() {
00218 Int_t NF = 0;
00219 TSeqCollection *files = gROOT->GetListOfFiles();
00220 Int_t nn = files->GetSize();
00221 if (! nn) return;
00222 TFile **Files = new TFile *[nn];
00223 if (! files) return;
00224 TIter next(files);
00225 TFile *f = 0;
00226 while ( (f = (TFile *) next()) ) {
00227 TTree *laser = (TTree *) f->Get("laser");
00228 if (! laser) continue;
00229 cout << "Add " << f->GetName() << endl;
00230 Files[NF] = f; NF++;
00231 }
00232 Int_t ny = (Int_t) TMath::Sqrt(NF);
00233 Int_t nx = NF/ny;
00234 if (nx*ny != NF) nx++;
00235 TCanvas *c1 = new TCanvas("Offsets","Offsets");
00236 c1->Divide(nx,ny);
00237 for (Int_t i = 0; i < NF; i++) {
00238 c1->cd(i+1);
00239 f = Files[i];
00240 if (! f) continue;
00241 TTree *laser = (TTree *) f->Get("laser");
00242 if (! laser) continue;
00243 laser->SetMarkerStyle(20);
00244
00245
00246 laser->Draw(Form("abs(fFit.offset)-6.66274:fFit.Sector>>OS%i(24,1,25)",i),"fFit.doffset > 0 && fFit.doffset <5","prof");
00247 TProfile *OS = (TProfile *) gDirectory->Get(Form("OS%i",i));
00248 TString Name(gSystem->BaseName(f->GetName()));
00249 Name.ReplaceAll(".root","");
00250 Name.ReplaceAll("laser_","Run ");
00251 cout << Name << " i = " << i << endl;
00252 OS->SetTitle(Name);
00253 OS->SetXTitle("Sector");
00254 OS->SetYTitle("dZ(cm)");
00255 OS->Draw();
00256 c1->Update();
00257
00258
00259 }
00260 }
00261 #endif
00262
00263 void dPhi() {
00264 TTree *laser = (TTree *) gDirectory->Get("laser");
00265 if (! laser) return;
00266
00267
00268 laser->Draw(
00269 "atan(fTracks.Laser.dirU.mX2/fTracks.Laser.dirU.mX1)-atan(fTracks.dirPU.mX2/fTracks.dirPU.mX1):fTracks.mSector>>dPhi(12,1,25,100,-.15,0.15)",
00270 "fTracks.Flag>1&&abs(fTracks.dU.mX1)<1&&abs(fTracks.dU.mX2)<1","colz");
00271 TH2D *dPhi = (TH2D *) gDirectory->Get("dPhi");
00272 if (! dPhi) return;
00273 dPhi->FitSlicesY();
00274 TH1D *dPhi_1 = (TH1D *) gDirectory->Get("dPhi_1");
00275 dPhi_1->SetMarkerStyle(20);
00276 dPhi_1->Draw("same");
00277 for (Int_t bin = 1; bin <= 12; bin++) {
00278 cout << "sector: " << 2*bin << " dPhi: " << 1e3*dPhi_1->GetBinContent(bin) << " +/- "
00279 << 1e3*dPhi_1->GetBinError(bin) << "(mrad)" << endl;
00280 }
00281 }
00282
00283 void dTheta() {
00284 TTree *laser = (TTree *) gDirectory->Get("laser");
00285 if (! laser) return;
00286 laser->Draw("atan(fTracks.Laser.dirU.mX3)-atan(fTracks.dirPU.mX3):fTracks.mSector>>dTheta(12,1,25,100,-.15,0.15)",
00287 "fTracks.Flag>1&&abs(fTracks.dU.mX1)<1&&abs(fTracks.dU.mX2)<1","colz");
00288 TH2D *dTheta = (TH2D *) gDirectory->Get("dTheta");
00289 if (! dTheta) return;
00290 dTheta->FitSlicesY();
00291 TH1D *dTheta_1 = (TH1D *) gDirectory->Get("dTheta_1");
00292 dTheta_1->SetMarkerStyle(20);
00293 dTheta_1->Draw("same");
00294 for (Int_t bin = 1; bin <= 12; bin++) {
00295 cout << "sector: " << 2*bin << " dTheta: " << 1e3*dTheta_1->GetBinContent(bin) << " +/- "
00296 << 1e3*dTheta_1->GetBinError(bin) << "(mrad)" << endl;
00297 }
00298 }
00299
00300 void dX() {
00301 TTree *laser = (TTree *) gDirectory->Get("laser");
00302 if (! laser) return;
00303 laser->Draw("fTracks.XyzPU.mX1-fTracks.Laser.XyzU.mX1:7*(3*(fTracks.Laser.Sector-2)+fTracks.Laser.Bundle-1)+fTracks.Laser.Mirror-0.5>>dX(504,0,504,100,-.2,0.2)","fTracks.Flag>1","colz");
00304 TH2D *dX = (TH2D *) gDirectory->Get("dX");
00305 if (! dX) return;
00306 dX->FitSlicesY();
00307 TH1D *dX_1 = (TH1D *) gDirectory->Get("dX_1");
00308 dX_1->SetMarkerStyle(20);
00309 dX_1->Draw("same");
00310 for (Int_t bin = 1; bin <= 504; bin++) {
00311 Int_t mirror = (bin-1)%7 + 1;
00312 Int_t bundle = ((bin-1)/7)%6 + 1;
00313 Int_t sector = ((bin-1)/(7*6)+1)*2;
00314 cout << "sector: " << sector << " bundle: " << bundle << " mirror: " << mirror
00315 << " dX: " << dX_1->GetBinContent(bin) << " +/- "
00316 << dX_1->GetBinError(bin) << "(cm)" << endl;
00317 }
00318 }
00319
00320 void dY() {
00321 TTree *laser = (TTree *) gDirectory->Get("laser");
00322 if (! laser) return;
00323 laser->Draw("fTracks.XyzPU.mX2-fTracks.Laser.XyzU.mX2:7*(3*(fTracks.Laser.Sector-2)+fTracks.Laser.Bundle-1)+fTracks.Laser.Mirror-0.5>>dY(504,0,504,100,-.2,0.2)","fTracks.Flag>1","colz");
00324 TH2D *dY = (TH2D *) gDirectory->Get("dY");
00325 if (! dY) return;
00326 dY->FitSlicesY();
00327 TH1D *dY_1 = (TH1D *) gDirectory->Get("dY_1");
00328 dY_1->SetMarkerStyle(20);
00329 dY_1->Draw("same");
00330 for (Int_t bin = 1; bin <= 504; bin++) {
00331 Int_t mirror = (bin-1)%7 + 1;
00332 Int_t bundle = ((bin-1)/7)%6 + 1;
00333 Int_t sector = ((bin-1)/(7*6)+1)*2;
00334 cout << "sector: " << sector << " bundle: " << bundle << " mirror: " << mirror
00335 << " dY: " << dY_1->GetBinContent(bin) << " +/- "
00336 << dY_1->GetBinError(bin) << "(cm)" << endl;
00337 }
00338 }
00339
00340 void FillHists(Int_t n1 = 0,const Char_t *Dir = ".") {
00341 TFileSet *fileset = new TFileSet(Dir);
00342 TDataSetIter iter(fileset);
00343 Int_t NF = 0;
00344 Int_t NFiles = 0;
00345 const Int_t NperC = 64;
00346 TString cut("fFit.Prob>1e-2&&fFit.ndf>4");
00347 TDataSet *set = 0;
00348 while ((set = iter())) {
00349 TString Title(set->GetTitle());
00350 if (Title != "file") continue;
00351 TString file(set->GetName());
00352
00353 if (!file.BeginsWith("laser") || !file.EndsWith(".root")) continue;
00354
00355 TFile *f = new TFile(file);
00356 TTree *laser = (TTree *) f->Get("laser");
00357 if (! laser) {
00358 cout << "Skip file " << f->GetName() << " with no laser TTree" << endl;
00359 }
00360 else {
00361 Long64_t n = laser->Draw("fFit.slope",cut,"goff");
00362 if (n < 100) {
00363 cout << "Skip file " << f->GetName() << " with " << n << " Entries" << endl;
00364 } else {
00365 NFiles++;
00366 if (n1 >= 0) {
00367 if (NFiles <= NperC*n1) continue;
00368 if (NFiles > NperC*(n1+1)) break;
00369 }
00370 cout << "Add file " << f->GetName() << " with " << n << " Entries" << endl;
00371 set->Mark();
00372 NF++;
00373 }
00374 }
00375 delete f;
00376 }
00377 if (NF == 0) return;
00378 Int_t ny = (Int_t) TMath::Sqrt(NF);
00379 Int_t nx = NF/ny;
00380 if (nx*ny != NF) nx++;
00381 cout << "NF = " << NF << " nx " << nx << " ny " << ny << endl;
00382 TCanvas *c[2] = {0,0};
00383 TString OutFile("LaserOut");
00384 if (n1 >= 0) OutFile += n1;
00385 OutFile += ".root";
00386 TFile *fOut = new TFile(OutFile,"recreate");
00387 iter.Reset();
00388 Int_t i = 0;
00389
00390 if (n1 < 0) n1 = 0;
00391 while ((set = iter())) {
00392 if (! set->IsMarked()) continue;
00393 memset(&DVAll[0][0], 0, 6*sizeof(Double_t));
00394 memset(&dDVAll[0][0], 0, 6*sizeof(Double_t));
00395 TString file(set->GetName());
00396 cout << "Open " << file << endl;
00397 TFile *f = new TFile(file);
00398 TTree *laser = (TTree *) f->Get("laser");
00399 if (! laser) {
00400 cout << "Cannot find laser TTRee in marked file " << file << endl;
00401 continue;
00402 }
00403 if (! c[0] || ! c[1]) {
00404 c[0] = new TCanvas(Form("Slopes %i",n1),Form("Slopes %i",n1));
00405 c[1] = new TCanvas(Form("LDV %i",n1),Form("Laser Drift Velocities %i",n1));
00406 c[0]->Divide(nx,ny);
00407 c[1]->Divide(nx,ny);
00408 }
00409 laser->SetMarkerStyle(20);
00410 laser->Draw("fEvtHdr.fRun:fEvtHdr.fDate:fEvtHdr.fTime","","goff",1);
00411 run = (Int_t) laser->GetV1()[0];
00412 date = (Int_t) laser->GetV2()[0];
00413 Time = (Int_t) laser->GetV3()[0];
00414 cout << "Run = " << run << " date = " << date << " Time = " << Time << endl;
00415
00416
00417 TString histN, plot, plotW, Plot, Plot2, profN;
00418 TString plotE;
00419 TString CutW(cut); CutW += " && fFit.Sector < 13";
00420 TString CutE(cut); CutE += " && fFit.Sector > 12";
00421 Char_t *cutName[3] = {"All ","West","East"};
00422 Char_t *plName[2] = {"SS", "dV"};
00423 Char_t *FMT[2] = {"%s dV = (%7.2f +/- %7.2f) x 10^3","%s dV = (%10.5f +/- %10.5f) cm/mksec"};
00424 for (Int_t l = 0; l < 2; l++) {
00425 c[l]->cd(i+1)->SetLogz(1);
00426 histN = Form("%s%i",plName[l],run);
00427 if (l == 0) {
00428 plotW = "1e3*fFit.slope:fFit.Sector>>";
00429 plotE = plotW; plotE += "+";
00430
00431 } else {
00432 plotW = "1e-6*fEvtHdr.fOnlClock/fEvtHdr.fClock*fEvtHdr.fDriVel/(1.+fFit.slope-fEvtHdr.fOnlClock/fEvtHdr.fClock*fEvtHdr.fDriVel/TMath::Ccgs()):fFit.Sector>>";
00433 plotE = plotW; plotE += "+";
00434
00435 }
00436 Plot = plotW;
00437 profN = histN;
00438 profN += "_pfx";
00439 Plot += profN;
00440 Plot += "(24,1,25)";
00441 fOut->cd();
00442 Long64_t n = laser->Draw(Plot,CutW,"prof");
00443 Plot = plotE; Plot += profN;
00444 n += laser->Draw(Plot,CutE,"prof");
00445 if (n < 10) {
00446 cout << f->GetName() << " empty only " << n << " entries" << endl;
00447 continue;
00448 }
00449 TProfile *SSp = (TProfile *) gDirectory->Get(profN);
00450 if (! SSp) continue;
00451 if (SSp->GetEntries() <= 10) {
00452 cout << SSp->GetName() << " empty only " << n << " entries" << endl;
00453 continue;
00454 }
00455 Plot2 = plotW;
00456 Plot2 += histN;
00457 SSp->SetMarkerColor(3);
00458 Double_t ymin = SSp->GetMean(2) - 3*SSp->GetRMS(2);
00459 Double_t ymax = SSp->GetMean(2) + 3*SSp->GetRMS(2);
00460 Plot2 += Form("(24,1,25,100,%f,%f)",ymin,ymax);
00461 laser->Draw(Plot2,CutW,"colz");
00462 Plot2 = plotE;
00463 Plot2 += histN;
00464 laser->Draw(Plot2,CutE,"colz");
00465 TH2F *SS = (TH2F *) gDirectory->Get(histN);
00466 if (! SS) {
00467 cout << "Did not find histogram " << histN << endl;
00468 continue;
00469 }
00470 SS->FitSlicesY();
00471 TString fitN(histN);
00472 fitN += "_1";
00473 TH1D *fit = (TH1D *) gDirectory->Get(fitN);
00474 TLegend *leg = new TLegend(0.1,0.1,0.55,0.25,"");
00475 if (fit) {
00476 fit->SetMarkerStyle(20);
00477 TF1 *pol0 = (TF1*) gROOT->GetFunction("pol0");
00478 if (pol0) {
00479 for (Int_t k = 0; k < 3; k++) {
00480 pol0->SetLineColor(k+1);
00481 if (k == 0) fit->Fit(pol0,"er","",1,25);
00482 if (k == 1) fit->Fit(pol0,"er+","",1,13);
00483 if (k == 2) fit->Fit(pol0,"er+","",13,25);
00484 DVAll[l][k] = pol0->GetParameter(0);
00485 dDVAll[l][k] = pol0->GetParError(0);
00486 if (!l || dDVAll[l][k] > 0 && dDVAll[l][k]< 1e-3)
00487 leg->AddEntry((TF1 *) fit->GetListOfFunctions()->Last(), Form(FMT[l],cutName[k],DVAll[l][k],dDVAll[l][k]));
00488 }
00489 }
00490 }
00491 SS->SetTitle(Form("Run: %i",run));
00492 SS->SetXTitle("Sector");
00493 SS->SetYTitle("Drift Velocity ");
00494 SS->Draw("colz");
00495 if (SSp) SSp->Draw("same");
00496 if (fit) fit->Draw("same");
00497 if (l && DVAll[l][0] > 0) {
00498 if (DVAll[l][0] > 5.5 && dDVAll[l][0] > 0 && dDVAll[l][0]< 1e-3) MakeTable();
00499 else {
00500 cout << "File " << f->GetName() << " fails =============================" << endl;
00501 leg->AddEntry(fit, "Rejected");
00502 }
00503 }
00504 leg->Draw();
00505 c[l]->Update();
00506 }
00507 i++;
00508
00509
00510
00511 }
00512 fOut->Write();
00513 }
00514
00515 void Laser(Int_t n1 = -1){
00516
00517 FillHists(n1);
00518 }