AlignBC Class Reference

Module which takes BC track segments and determines alignment constants for all planes. More...

#include <AlignBC.h>

Inheritance diagram for AlignBC:

JobCModule CfgObserver List of all members.

Public Member Functions

 AlignBC (const char *version)
 ~AlignBC ()
JobCResult Ana (const EDMEventHandle &evt)
void NewRun (int run, int subrun)
void EndRun (int run, int subrun)
void Update (const CfgConfig &c)

Private Member Functions

bool Fit (const TrkInfo_t *trk, BCAlignNt *nt, bool resolve=false)
bool PreenTrackList (double res[3][4])
bool RoughAlign ()
bool FineAlign ()
void FillNt (const char *name, bool resolve)
void WriteToDB (int run)

Private Attributes

std::vector< TrkInfo_t * > fTrkInfo
int fDoFineAlign
int fMaxAlignAttempt
int fMinNClust
 Minimum number of clusters per track.
int fMinNTrack
int fMaxNTrackEvt
std::string fTrkFolder
double fOkRoughShift
double fOkFineShift
double fDriftVel
float fMinTime
float fMaxTime
int fFillNt

Static Private Attributes

static AlignBCfsModule = 0
static double fZ1 = 0
static double fZ2 = 0
 Z locations that determine track params.

Classes

struct  TrkInfo_t

Detailed Description

Module which takes BC track segments and determines alignment constants for all planes.

One needs 6 parameters to determine a coordinate system: three 3D points minus 2 equations which normalizes the (1, 0, 0) and (0, 1, 0) vectors, minus 1 equation which ensures their orthogonality. If length scale is set by wire spacing, then fixed parameters can be chosen as z of BC3, wide-angle planes of BC3 and BC1, and orientation of BC3 in xy-plane.

This module is currently meant to do "rough" alignment, i.e. w/o using drift time information. Hence, it is unlikely that XZ or YZ rotations or z-positions will be fit for correctly. Nevertheless, ignoring rotations in xz and yz planes, we have 6 parameters per chamber (4 planes, z, xy-angle), of which we must fix at least 6 in order for minimization to be meaningful.

Author:
Andre Lebedev

Definition at line 54 of file AlignBC.h.


Constructor & Destructor Documentation

AlignBC::AlignBC ( const char *  version  ) 

Definition at line 40 of file AlignBC.cxx.

References JobCModule::CheckInit(), and JobCModule::SetCfgVersion().

00040                                     :
00041   JobCModule("AlignBC")
00042 {
00043   SetCfgVersion(version);
00044   CheckInit();
00045 }

AlignBC::~AlignBC (  )  [inline]

Definition at line 63 of file AlignBC.h.

00063 {;}


Member Function Documentation

JobCResult AlignBC::Ana ( const EDMEventHandle evt  )  [virtual]

Reimplemented from JobCModule.

Definition at line 49 of file AlignBC.cxx.

References EDMEventHandle::Cal(), cham, fMaxNTrackEvt, fMinNClust, AlignBC::TrkInfo_t::fT, fTrkFolder, fTrkInfo, AlignBC::TrkInfo_t::fWeight, AlignBC::TrkInfo_t::fWire, EDMDataBucket::Get(), JobCModule::kFailed, kNBC, kNPlane, JobCModule::kPassed, p, EDMEventHandle::Raw(), and EDMEventHandle::Reco().

00050 {
00051   vector<const TrackSeg*> vec(0);
00052   // Make sure raw and calibrated data buckets are loaded
00053   evt.Raw(); 
00054   evt.Cal();
00055   try {evt.Reco().Get(fTrkFolder.c_str(), vec); }
00056   catch (...) {return kFailed;}
00057 
00058   int nTrk = vec.size();
00059   if (nTrk == 0 || nTrk > fMaxNTrackEvt) return kFailed;
00060 
00061   TrkInfo_t *trkInfo = 0;
00062   
00063   // Copy vector info into our private struct
00064   for (int i = 0; i < nTrk; ++i) {
00065     const TrackSeg* seg = vec[i];
00066 
00067     if (!trkInfo) trkInfo = new TrkInfo_t;
00068 
00069     int nGoodClu = seg->NClust();
00070     // Skip tracks with too few clusters
00071     if (nGoodClu < fMinNClust) continue;
00072 
00073     for (int cham = 0; cham < kNBC; ++cham) {
00074       for (int p = 0; p < kNPlane; ++p) {
00075     const WireClust* wc = seg->Clust(cham, p);
00076     if (!wc || wc->NWire() > 1) {
00077       trkInfo->fWeight[cham][p] = -1;
00078       nGoodClu--;
00079       if (nGoodClu < fMinNClust) {
00080         cham = kNBC;
00081         break;
00082       }
00083     }
00084     else {
00085       assert(wc->Plane() == p + 1);
00086       trkInfo->fWire[cham][p] = wc->AvgWire();
00087       trkInfo->fWeight[cham][p] = 1 / (wc->USig() * wc->USig());
00088       trkInfo->fT[cham][p] = wc->T();
00089     }
00090       }
00091     }
00092     if (nGoodClu < fMinNClust) continue;
00093     fTrkInfo.push_back(trkInfo);
00094     trkInfo = 0;
00095   }
00096 
00097   return kPassed;
00098 }

void AlignBC::EndRun ( int  run,
int  subrun 
) [virtual]

Reimplemented from JobCModule.

Definition at line 108 of file AlignBC.cxx.

References GMIPPGeo::Cham(), fDoFineAlign, fFillNt, FillNt(), FineAlign(), fMinNTrack, fTrkInfo, fZ1, fZ2, geo, GMIPPGeo::Instance(), kBC1, kBC3, kNBC, kNPlane, p, RoughAlign(), WriteToDB(), and GChamGeo::ZGas().

00109 {
00110   if ((int) fTrkInfo.size() < fMinNTrack) {
00111     cout << "AlignBC: " << fTrkInfo.size() << " is not enough tracks"
00112      << endl;
00113     return;
00114   }
00115 
00116   fZ1 = GMIPPGeo::Instance().Cham(kBC1).ZGas();
00117   fZ2 = GMIPPGeo::Instance().Cham(kBC3).ZGas();
00118   
00119   double startPar[kNBC][kNPlane];
00120   for (int c = 0; c < kNBC; ++c) {
00121     GChamGeo& geo = GMIPPGeo::Instance().Cham(c);
00122     for (int p = 0; p < kNPlane; ++p) startPar[c][p] = geo.WireZero(p + 1);
00123   }
00124 
00125   if (!RoughAlign()) return;
00126 
00127   for (int c = 0; c < kNBC; ++c) {
00128     GChamGeo& geo = GMIPPGeo::Instance().Cham(c);
00129     cout << geo.Name() << " wire 0 changes: ";
00130     for (int p = 0; p < kNPlane; ++p) {
00131       cout << geo.WireZero(p + 1) - startPar[c][p] << " ";
00132     }
00133     cout << endl;
00134   }
00135 
00136   if (fFillNt) FillNt("nt1", false);
00137 
00138   if (fDoFineAlign) {
00139     FineAlign();
00140 
00141     for (int c = 0; c < kNBC; ++c) {
00142       GChamGeo& geo = GMIPPGeo::Instance().Cham(c);
00143       cout << geo.Name() << " wire 0 changes: ";
00144       for (int p = 0; p < kNPlane; ++p) {
00145     cout << geo.WireZero(p + 1) - startPar[c][p] << " ";
00146       }
00147       cout << endl;
00148     }
00149 
00150     if (fFillNt) FillNt("nt2", true);
00151   }
00152 
00153   WriteToDB(run);
00154 }

void AlignBC::FillNt ( const char *  name,
bool  resolve 
) [private]

Definition at line 158 of file AlignBC.cxx.

References Fit(), fTrkInfo, fZ1, fZ2, geo, GMIPPGeo::Instance(), kNBC, kNPlane, nt, p, TrkRUtil::PredictXY(), tree, x2, and x3.

Referenced by EndRun().

00159 {
00160   BCAlignNt *nt = new BCAlignNt;
00161   TTree* tree = new TTree(name, "BC Alignment Ntuple");
00162   tree->Branch("nt", "BCAlignNt", &nt);
00163 
00164   double x1[3], x2[3], x3[3];
00165   x1[2] = fZ1;
00166   x2[2] = fZ2;
00167 
00168   for (unsigned int i = 0; i < fTrkInfo.size(); ++i) {
00169     if (!Fit(fTrkInfo[i], nt, resolve)) continue;
00170 
00171     x1[0] = nt->par[0];
00172     x1[1] = nt->par[1];
00173     x2[0] = nt->par[2];
00174     x2[1] = nt->par[3];
00175 
00176     for (int c = 0; c < kNBC; ++c) {
00177       GChamGeo& geo = GMIPPGeo::Instance().Cham(c);
00178       for (int p = 0; p < kNPlane; ++p) {
00179     x3[2] = geo.Z(p + 1);
00180     PredictXY(x1, 0, x2, 0, x3, 0);
00181     nt->uperp[c][p] = x3[0] * geo.GAngleSin(p + 1) + 
00182       x3[1] * geo.GAngleCos(p + 1);
00183     nt->ufit[c][p] = x3[0] * geo.GAngleCos(p + 1) -
00184       x3[1] * geo.GAngleSin(p + 1);
00185       }
00186     }
00187     tree->Fill();
00188   }
00189   tree->Write();
00190   delete tree;
00191   delete nt;
00192 }

bool AlignBC::FineAlign (  )  [private]

Definition at line 474 of file AlignBC.cxx.

References Fit(), fOkFineShift, fTrkInfo, geo, GMIPPGeo::Instance(), nt, p, and GMIPPGeo::Reset().

Referenced by EndRun().

00475 {
00476 
00477   TH1F* resH[kNBC][kNPlane];
00478   
00479   char str[256];
00480   for (int c = 0; c < kNBC; ++c) {
00481     for (int p = 0; p < kNPlane; ++p) {
00482       sprintf(str, "resid%d%d", c, p);
00483       resH[c][p] = new TH1F(str, str, 240, -0.3, 0.3); // 25 micron bins
00484       resH[c][p]->SetXTitle("Residual (cm)");
00485     }
00486   }
00487 
00488   TF1* fu = new TF1("fu", "gaus", -1, 1);
00489 
00490   BCAlignNt nt;
00491   TDirectory* dir = gDirectory;
00492 
00493   for (int at = 0; ; ++at) {
00494     cout << "BC Fine align attempt " << at << endl;
00495     sprintf(str, "fine%d", at);
00496     gDirectory->mkdir(str);
00497     gDirectory->cd(str);
00498 
00499     double maxShift = 0;
00500 
00501     int nTrk = 0;
00502     for (unsigned int i = 0; i < fTrkInfo.size(); ++i) {
00503       if (!Fit(fTrkInfo[i], &nt, true)) continue;
00504       nTrk++;
00505       for (int c = 0; c < kNBC; ++c) {
00506     for (int p = 0; p < kNPlane; ++p) { 
00507       if (fabs(nt.resid[c][p]) > 0.3) continue;
00508       resH[c][p]->Fill(nt.resid[c][p]);
00509     }
00510       }
00511     }
00512 
00513     if (nTrk < 100) return false;
00514 
00515     for (int c = 0; c < kNBC; ++c) {
00516       GChamGeo& geo = GMIPPGeo::Instance().Cham(c);
00517       for (int p = 0; p < kNPlane; ++p) {
00518     if (resH[c][p]->GetEntries() > 50) {
00519       fu->SetParameter(0, resH[c][p]->GetMaximum());
00520       fu->SetParLimits(0, resH[c][p]->GetMaximum() * 0.7,
00521                resH[c][p]->GetMaximum() * 1.5);
00522       fu->SetParameter(1, resH[c][p]->GetMean());
00523       fu->SetParLimits(1, resH[c][p]->GetMean() - 0.2, 
00524                resH[c][p]->GetMean() + 0.2);
00525       fu->SetParameter(2, resH[c][p]->GetRMS());
00526       resH[c][p]->Fit(fu, "Q0+");
00527 
00528       double res = fu->GetParameter(1);
00529       res *= 0.3 / geo.Pitch();
00530       if (maxShift < fabs(res)) maxShift = fabs(res);
00531       
00532       geo.SetWireZero(p + 1, geo.WireZero(p + 1) + res);
00533     }
00534     resH[c][p]->Write();
00535     resH[c][p]->Reset();
00536       }
00537     }
00538 
00539     dir->cd();
00540     cout << "Max shift: " << maxShift << endl;
00541     if (maxShift < fOkFineShift) break;
00542   }
00543 
00544   for (int c = 0; c < kNBC; ++c) {
00545     for (int p = 0; p < kNPlane; ++p) delete resH[c][p];
00546   }
00547   delete fu;
00548 
00549   return true;
00550 }

bool AlignBC::Fit ( const TrkInfo_t trk,
BCAlignNt nt,
bool  resolve = false 
) [private]

Definition at line 215 of file AlignBC.cxx.

References cham, fMaxTime, fMinTime, AlignBC::TrkInfo_t::fT, AlignBC::TrkInfo_t::fWeight, AlignBC::TrkInfo_t::fWire, geo, GMIPPGeo::Instance(), ChamDrift::Instance(), kNBC, kNPlane, nt, p, and ChamDrift::TimeToDist().

Referenced by FillNt(), FineAlign(), PreenTrackList(), and RoughAlign().

00217 {
00218   double w[12];
00219   double u[12];
00220   double du[12]; // Shift proportional to drift time
00221   double z[12];
00222   double cosA[12];
00223   double sinA[12];
00224   short  plane[12];
00225 
00226   ChamDrift& drift = ChamDrift::Instance();
00227   
00228   // Copy information from TrkInfo_t into arrays
00229   nt->nclust = 0;
00230   for (int cham = 0; cham < kNBC; ++cham) {
00231     GChamGeo& geo = GMIPPGeo::Instance().Cham(cham);
00232     for (int p = 0; p < kNPlane; ++p) {
00233       if (ti->fWeight[cham][p] <= 0) {
00234     nt->u[cham][p] = 1e6;
00235     continue;
00236       }
00237 
00238       if (resolve) {
00239     if(ti->fT[cham][p] < fMinTime || 
00240        ti->fT[cham][p] > fMaxTime) continue;
00241     du[nt->nclust] = 
00242       drift.TimeToDist(cham, p, ti->fT[cham][p], &w[nt->nclust]);
00243     w[nt->nclust] = 1 / (w[nt->nclust] * w[nt->nclust]);
00244       }
00245       else w[nt->nclust] = ti->fWeight[cham][p];
00246       
00247       geo.WireToU(p + 1, ti->fWire[cham][p], u[nt->nclust]);
00248       nt->u[cham][p] = u[nt->nclust];
00249       z[nt->nclust] = geo.Z(p + 1);
00250       cosA[nt->nclust] = geo.GAngleCos(p + 1);
00251       sinA[nt->nclust] = geo.GAngleSin(p + 1);
00252       plane[nt->nclust] = cham * kNPlane + p;
00253       nt->nclust++;
00254     }
00255   }
00256 
00257   if (nt->nclust < 5) return false;
00258 
00259   // Resolve ambiguity if we need to
00260   double par[4];
00261   if (resolve) {
00262     int bestMask = 0;
00263     nt->chi2 = 1e6;
00264     int nCombo = (1 << nt->nclust);
00265 
00266     double uCopy[12];
00267     for (int m = 0; m < nCombo; ++m) {
00268       bool okCombo = true; 
00269 
00270       for (int i = 0; i < nt->nclust; ++i) {
00271     if (m & (1 << i)) {
00272       // We don't have to double count combinations with du=0
00273       if (du[i] < 1e-6) {
00274         okCombo = false;
00275         break;
00276       }
00277       uCopy[i] = u[i] - du[i];
00278     }
00279     else uCopy[i] = u[i] + du[i];
00280       }
00281       if (!okCombo) continue;
00282 
00283       double c2 = FitLineFromWires(nt->nclust, uCopy, w, z, cosA, sinA, 
00284                    fZ1, fZ2, par, 0);
00285       if (c2 < nt->chi2) {
00286     nt->chi2 = c2;
00287     bestMask = m;
00288       }
00289     }
00290 
00291 //     cout << "Resolved with best mask " << (void*) bestMask
00292 //   << ", chi2 = " << nt->chi2 << "/" << nt->nclust - 4 << endl;
00293     for (int i = 0; i < nt->nclust; ++i) {
00294       if (bestMask & (1 << i)) u[i] -= du[i];
00295       else u[i] += du[i];
00296       nt->u[plane[i] / 4][plane[i] % 4] = u[i];
00297     }
00298   }
00299 
00300   // Save chi squared for the full fit
00301   nt->chi2 = FitLineFromWires(nt->nclust, u, w, z, cosA, sinA, 
00302                   fZ1, fZ2, par, 0);
00303 
00304   for (int i = 0; i < 4; ++i) nt->par[i] = par[i];
00305   nt->z1 = fZ1;
00306   nt->z2 = fZ2;
00307 
00308   double wCopy[12];
00309 
00310   double x1[3], x2[3], x3[3];
00311   x1[2] = fZ1;
00312   x2[2] = fZ2;
00313 
00314   // Now exclude one plane at a time, and save residuals
00315   for (int c = 0; c < kNBC; ++c) {
00316     GChamGeo& geo = GMIPPGeo::Instance().Cham(c);
00317     for (int p = 0; p < kNPlane; ++p) {
00318       if (ti->fWeight[c][p] <= 0) {
00319     nt->chi2rm[c][p] = 1e6;
00320     nt->resid[c][p] = 1e6;
00321     continue;
00322       }
00323       
00324       memcpy(wCopy, w, 12 * sizeof(double));
00325       
00326       int i = 0;
00327       for ( ; i < nt->nclust; ++i) {
00328     if (plane[i] == c * kNPlane + p) {
00329       wCopy[i] = 0;
00330       break;
00331     }
00332       }
00333       if (i >= nt->nclust) {
00334     nt->chi2rm[c][p] = 1e6;
00335     nt->resid[c][p] = 1e6;
00336     continue;
00337       }
00338       
00339       nt->chi2rm[c][p] = 
00340     FitLineFromWires(nt->nclust, u, wCopy, z, cosA, sinA, 
00341                fZ1, fZ2, par, 0);
00342       x1[0] = par[0];
00343       x1[1] = par[1];
00344       x2[0] = par[2];
00345       x2[1] = par[3];
00346       x3[2] = geo.Z(p + 1);
00347 
00348       PredictXY(x1, 0, x2, 0, x3, 0);
00349       nt->resid[c][p] = x3[0] * geo.GAngleCos(p + 1) - 
00350     x3[1] * geo.GAngleSin(p + 1) - u[i];
00351     }
00352   }
00353 
00354   return true;
00355 }

void AlignBC::NewRun ( int  run,
int  subrun 
) [virtual]

Reimplemented from JobCModule.

Definition at line 102 of file AlignBC.cxx.

00103 {
00104 }

bool AlignBC::PreenTrackList ( double  res[3][4]  )  [private]

Definition at line 434 of file AlignBC.cxx.

References Fit(), fTrkInfo, nt, p, and GChamGeo::Pitch().

Referenced by RoughAlign().

00435 {
00436   int removed = 0;
00437   BCAlignNt nt;
00438   int c, p;
00439 
00440   vector<TrkInfo_t*>::iterator itr(fTrkInfo.begin());
00441   int n = fTrkInfo.size();
00442   for ( ; itr != fTrkInfo.end(); ) {
00443     const TrkInfo_t* ti = *itr;
00444     n--;
00445     if (!Fit(ti, &nt)) {
00446       delete ti;
00447       itr = fTrkInfo.erase(itr);
00448       removed++;
00449       continue;
00450     }
00451 
00452     for (c = 0; c < 3; ++c) {
00453       for (p = 0; p < 4; ++p) {
00454     double r = fabs(nt.resid[c][p] / GChamGeo::Pitch(c) - res[c][p]) ;
00455     if (r < 1e3 && r > 1.5 + fabs(res[c][p]))
00456       break;
00457       }
00458       if (p != 4) break;
00459     }
00460 
00461     if (c != 3) {
00462       delete ti;
00463       itr = fTrkInfo.erase(itr);
00464       removed++;
00465     }
00466     else ++itr;
00467   }
00468 
00469   return (removed != 0);
00470 }

bool AlignBC::RoughAlign (  )  [private]

Definition at line 359 of file AlignBC.cxx.

References Fit(), fMaxAlignAttempt, fOkRoughShift, fTrkInfo, geo, GMIPPGeo::Instance(), GChamGeo::Name(), nt, p, GChamGeo::Pitch(), and PreenTrackList().

Referenced by EndRun().

00360 {
00361   TH1F* resH[kNBC][kNPlane];
00362   
00363   char str[256];
00364   for (int c = 0; c < kNBC; ++c) {
00365     for (int p = 0; p < kNPlane; ++p) {
00366       sprintf(str, "resid%d%d", c, p);
00367       resH[c][p] = new TH1F(str, str, 400, -2, 2); // 1% wire spacing bins
00368       resH[c][p]->SetXTitle("Residual (wire spacing)");
00369     }
00370   }
00371 
00372   BCAlignNt nt;
00373   TDirectory* dir = gDirectory;
00374 
00375   for (int at = 0; ; ++at) {
00376     if (at >= fMaxAlignAttempt) return false;
00377     cout << "BC align attempt " << at << " with " << fTrkInfo.size()
00378      << " tracks" << endl;
00379     sprintf(str, "attempt%d", at);
00380     gDirectory->mkdir(str);
00381     gDirectory->cd(str);
00382 
00383     for (unsigned int i = 0; i < fTrkInfo.size(); ++i) {
00384       if (!Fit(fTrkInfo[i], &nt)) continue;
00385       for (int c = 0; c < kNBC; ++c) {
00386     for (int p = 0; p < kNPlane; ++p) { 
00387       if (nt.resid[c][p] > 100) continue;
00388       resH[c][p]->Fill(nt.resid[c][p] / GChamGeo::Pitch(c));
00389     }
00390       }
00391     }
00392 
00393     double res[3][4];
00394     double maxRes = 0;
00395     int maxResP = -1;
00396     for (int c = 0; c < kNBC; ++c) {
00397       GChamGeo& geo = GMIPPGeo::Instance().Cham(c);
00398       for (int p = 0; p < kNPlane; ++p) {
00399     if (resH[c][p]->GetEntries() > 50) {
00400       res[c][p] = resH[c][p]->GetMean();
00401       if (fabs(maxRes) < fabs(res[c][p])) {
00402         maxRes = res[c][p];
00403         maxResP = c * kNPlane + p;
00404       }
00405     }
00406     resH[c][p]->Write();
00407     resH[c][p]->Reset();
00408 
00409     // Shift wire plane by a fraction of residual
00410     geo.SetWireZero(p + 1, geo.WireZero(p + 1) -
00411             geo.WireDir(p + 1) * res[c][p] * 0.3);
00412 
00413       }
00414     }
00415 
00416     dir->cd();
00417 
00418     if (maxResP < 0) return false;
00419 
00420     cout << "Max residual in " << GChamGeo::Name(maxResP / 4) 
00421      << " P" << maxResP % 4 + 1 << ": " << maxRes << " w.s." << endl;
00422     if (fabs(maxRes) < 0.25 && PreenTrackList(res)) continue;
00423     if (fabs(maxRes) < fOkRoughShift) break;
00424   }
00425 
00426   for (int c = 0; c < kNBC; ++c) {
00427     for (int p = 0; p < kNPlane; ++p) delete resH[c][p];
00428   }
00429   return true;
00430 }

void AlignBC::Update ( const CfgConfig c  )  [virtual]

Implements CfgObserver.

Definition at line 196 of file AlignBC.cxx.

References fDoFineAlign, fFillNt, JobCModule::fIsInit, fMaxAlignAttempt, fMaxNTrackEvt, fMaxTime, fMinNClust, fMinNTrack, fMinTime, fOkFineShift, fOkRoughShift, and fTrkFolder.

00197 {
00198   c("DoFineAlign").Get(fDoFineAlign); 
00199   c("MaxAlignAttempt").Get(fMaxAlignAttempt);
00200   c("MinNClust").Get(fMinNClust);
00201   c("MinNTrack").Get(fMinNTrack);
00202   c("MaxNTrackEvt").Get(fMaxNTrackEvt);
00203   c("TrkFolder").Get(fTrkFolder);
00204   c("OkRoughShift").Get(fOkRoughShift);
00205   c("OkFineShift").Get(fOkFineShift);
00206   c("MinTime").Get(fMinTime);
00207   c("MaxTime").Get(fMaxTime);
00208   c("FillNt").Get(fFillNt);
00209 
00210   fIsInit = true;
00211 }

void AlignBC::WriteToDB ( int  run  )  [private]

Definition at line 554 of file AlignBC.cxx.

References TrkChamGeo::Instance(), TrkChamGeo::kAlignBC, TrkChamGeo::SetCham(), TrkChamGeo::SetRunRange(), and TrkChamGeo::WriteToDB().

Referenced by EndRun().

00555 {
00556   static int minRun = 10000000;
00557   static int maxRun = 0;
00558 
00559   if (strcmp(getenv("PGUSER"), "mippdbwrite") != 0) {
00560     cout << "User " << getenv("PGUSER")
00561      << " is not allowed to write to DB" << endl;
00562     return;
00563   }
00564 
00565   TrkChamGeo& db = TrkChamGeo::Instance();
00566   for (int c = 0; c < kNBC; ++c) db.SetCham(c);
00567   if (minRun > run) minRun = run;
00568   if (maxRun < run) maxRun = run;
00569   db.SetRunRange(minRun, maxRun);
00570   db.WriteToDB(TrkChamGeo::kAlignBC, 7); // Write BC alignment only
00571 
00572 }


Member Data Documentation

int AlignBC::fDoFineAlign [private]

Definition at line 85 of file AlignBC.h.

Referenced by EndRun(), and Update().

double AlignBC::fDriftVel [private]

Definition at line 93 of file AlignBC.h.

int AlignBC::fFillNt [private]

Definition at line 96 of file AlignBC.h.

Referenced by EndRun(), and Update().

int AlignBC::fMaxAlignAttempt [private]

Definition at line 86 of file AlignBC.h.

Referenced by RoughAlign(), and Update().

int AlignBC::fMaxNTrackEvt [private]

Definition at line 89 of file AlignBC.h.

Referenced by Ana(), and Update().

float AlignBC::fMaxTime [private]

Definition at line 95 of file AlignBC.h.

Referenced by Fit(), and Update().

int AlignBC::fMinNClust [private]

Minimum number of clusters per track.

Definition at line 87 of file AlignBC.h.

Referenced by Ana(), and Update().

int AlignBC::fMinNTrack [private]

Definition at line 88 of file AlignBC.h.

Referenced by EndRun(), and Update().

float AlignBC::fMinTime [private]

Definition at line 94 of file AlignBC.h.

Referenced by Fit(), and Update().

double AlignBC::fOkFineShift [private]

Definition at line 92 of file AlignBC.h.

Referenced by FineAlign(), and Update().

double AlignBC::fOkRoughShift [private]

Definition at line 91 of file AlignBC.h.

Referenced by RoughAlign(), and Update().

AlignBC * AlignBC::fsModule = 0 [static, private]

Definition at line 81 of file AlignBC.h.

std::string AlignBC::fTrkFolder [private]

Definition at line 90 of file AlignBC.h.

Referenced by Ana(), and Update().

std::vector<TrkInfo_t*> AlignBC::fTrkInfo [private]

Definition at line 83 of file AlignBC.h.

Referenced by Ana(), EndRun(), FillNt(), FineAlign(), PreenTrackList(), and RoughAlign().

double AlignBC::fZ1 = 0 [static, private]

Definition at line 82 of file AlignBC.h.

Referenced by EndRun(), and FillNt().

double AlignBC::fZ2 = 0 [static, private]

Z locations that determine track params.

Definition at line 82 of file AlignBC.h.

Referenced by EndRun(), and FillNt().


The documentation for this class was generated from the following files:
Generated on Mon Nov 23 08:03:55 2009 for MIPP(E907) by  doxygen 1.4.7