88 #include "StSvtDbMaker.h"
90 #include "St_DataSetIter.h"
91 #include "St_ObjectSet.h"
92 #include "StMessMgr.h"
94 #include "StSvtClassLibrary/StSvtEnumerations.hh"
96 #include "StDbUtilities/StCoordinates.hh"
97 #include "StDbUtilities/StSvtCoordinateTransform.hh"
98 #include "StSvtClassLibrary/StSvtGeometry.hh"
99 #include "StSvtClassLibrary/StSvtT0.hh"
102 #include "TVector3.h"
103 #include "StSvtClassLibrary/StSvtConfig.hh"
104 #include "StSvtClassLibrary/StSvtHybridPed.hh"
105 #include "StSvtClassLibrary/StSvtHybridDriftVelocity.hh"
106 #include "StSvtClassLibrary/StSvtHybridDriftCurve.hh"
107 #include "StSvtClassLibrary/StSvtHybridAnodeDriftCorr.hh"
108 #include "StSvtClassLibrary/StSvtHybridCollection.hh"
109 #include "StSvtClassLibrary/StSvtHybridBadAnodes.hh"
110 #include "StSvtClassLibrary/StSvtGeometry.hh"
111 #include "StSvtClassLibrary/StSvtWaferGeometry.hh"
112 #include "StSvtClassLibrary/StSvtT0.hh"
113 #include "StSvtClassLibrary/StSvtDaq.hh"
115 #include "tables/St_svtConfiguration_Table.h"
116 #include "tables/St_svtDriftVelAvg_Table.h"
117 #include "tables/St_svtDriftCurve_Table.h"
118 #include "tables/St_svtBadAnodes_Table.h"
119 #include "tables/St_svtAnodeDriftCorr_Table.h"
120 #include "tables/St_svtPedestals_Table.h"
121 #include "tables/St_svtRms_Table.h"
123 #include "tables/St_svtWafersPosition_Table.h"
125 #include "tables/St_Survey_Table.h"
127 #include "tables/St_svtDimensions_Table.h"
128 #include "tables/St_svtElectronics_Table.h"
129 #include "tables/St_svtDaq_Table.h"
130 #include "tables/St_svtHybridDriftVelocity_Table.h"
131 #include "StDbUtilities/St_svtRDOstrippedC.h"
132 #include "StDbUtilities/St_svtHybridDriftVelocityC.h"
133 #include "StTpcDb/StTpcDb.h"
135 svtElectronics_st *electronic = NULL;
136 THashList *StSvtDbMaker::fRotList = 0;
141 int type_of_call SvtGtoL_(
float *x,
float *xp,
int* index){
146 dataSet = gStSvtDbMaker->GetDataSet(
"StSvtGeometry");
148 if(GeomDataBase) transform.setParamPointers(GeomDataBase, NULL, NULL, NULL, NULL);
151 transform.GlobaltoLocal(a, b,*index, -1);
153 xp[0] = b.position().x();
154 xp[1] = b.position().y();
155 xp[2] = b.position().z();
161 int type_of_call SvtLtoG_(
float *xp,
float *x,
int* index){
163 int layer,ladder,wafer;
168 dataSet = gStSvtDbMaker->GetDataSet(
"StSvtGeometry");
170 if(GeomDataBase) transform.setParamPointers(GeomDataBase, NULL, NULL, NULL, NULL);
176 wafer = (*index -1000*layer)/100;
177 ladder = *index -1000*layer -100*wafer;
183 transform.LocaltoGlobal(a, b, -1);
196 StSvtDbMaker::~StSvtDbMaker() { gStSvtDbMaker = NULL;}
198 Int_t StSvtDbMaker::Init()
200 if (Debug()) gMessMgr->Debug() <<
"StSvtDbMaker::Init" << endm;
203 const Char_t *tabNames[3] = {
"svtWafersPosition",
"svtDriftCorrection",
"svtRDOstripped"};
204 for (Int_t i = 0; i < 3; i++) {
205 gMessMgr->Message() <<
206 "StSvtDbMaker::Init setting " << tabNames[i] <<
" to simu" << endm;
207 SetFlavor(
"simu",tabNames[i]);
211 return StMaker::Init();
215 Int_t StSvtDbMaker::InitRun(
int runumber)
217 gMessMgr->Info() <<
"StSvtDbMaker::InitRun" << endm;
220 if (! svtRDOstrippedC) {
221 St_svtRDOstripped *svtRDOstripped = (St_svtRDOstripped *) GetDataBase(
"Calibrations/svt/svtRDOstripped");
224 assert(St_svtRDOstrippedC::instance());
227 if (! svtHybridDriftVelocityC) {
228 St_svtHybridDriftVelocity *svtHybridDriftVelocity =
229 (St_svtHybridDriftVelocity *) GetDataBase(
"Calibrations/svt/svtHybridDriftVelocity");
232 assert(St_svtHybridDriftVelocityC::instance());
239 if (Debug()) gMessMgr->Debug() <<
"StSvtDbMaker::Make" << endm;
241 if (svtRDOstrippedC) {
242 UInt_t ut = GetDateTime().Convert();
243 svtRDOstrippedC->SetDate(ut);
244 if (Debug() > 2) svtRDOstrippedC->PrintRDOmap();
250 void StSvtDbMaker::Clear(
const char*)
252 if (Debug()) gMessMgr->Debug() <<
"StSvtDaqMaker::Clear" << endm;
260 if (Debug()) gMessMgr->Debug() <<
"StSvtDbMaker::Finish" << endm;
267 gMessMgr->Info() <<
"StSvtDbMaker::getConfiguration" << endm;
269 St_svtConfiguration *configuration = (St_svtConfiguration*) GetDataBase(
"Geometry/svt/svtConfiguration");
270 if (!(configuration && configuration->HasData()) ){
271 gMessMgr->Message(
"Error Finding SVT Configuration",
"E");
275 svtConfiguration_st* config = configuration->GetTable();
277 gMessMgr->Info() <<
"numberOfBarrels = " << config->numberOfBarrels << endm;
278 gMessMgr->Info() <<
"numberOfLadders = " << config->numberOfLadders << endm;
279 gMessMgr->Info() <<
"numberOfWafers = " << config->numberOfWafers << endm;
280 gMessMgr->Info() <<
"numberOfHybrids = " << config->numberOfHybrids << endm;
282 gMessMgr->Info() <<
"numberOfLaddersPerBarrel[0] = " << config->numberOfLaddersPerBarrel[0] << endm;
283 gMessMgr->Info() <<
"numberOfLaddersPerBarrel[1] = " << config->numberOfLaddersPerBarrel[1] << endm;
284 gMessMgr->Info() <<
"numberOfLaddersPerBarrel[2] = " << config->numberOfLaddersPerBarrel[2] << endm;
285 gMessMgr->Info() <<
"numberOfWafersPerLadder[0] = " << config->numberOfWafersPerLadder[0] << endm;
286 gMessMgr->Info() <<
"numberOfWafersPerLadder[1] = " << config->numberOfWafersPerLadder[1] << endm;
287 gMessMgr->Info() <<
"numberOfWafersPerLadder[2] = " << config->numberOfWafersPerLadder[2] << endm;
288 gMessMgr->Info() <<
"numberOfHybridsPerWafer = " << config->numberOfHybridsPerWafer << endm;
291 mSvtConfig->setNumberOfBarrels(config->numberOfBarrels);
293 for (
int i=0; i<config->numberOfBarrels; i++) {
294 mSvtConfig->setNumberOfLadders(i+1,config->numberOfLaddersPerBarrel[i]);
295 mSvtConfig->setNumberOfWafers(i+1, config->numberOfWafersPerLadder[i]);
297 mSvtConfig->setNumberOfHybrids(config->numberOfHybridsPerWafer);
298 mSvtConfig->setTotalNumberOfHybrids(config->numberOfHybrids);
301 mSvtConfig->setNumberOfAnodes(240);
302 mSvtConfig->setNumberOfTimeBins(128);
304 mSvtConfig->setConfiguration();
313 gMessMgr->Info() <<
"StSvtDbMaker::getDriftVelocityCurve" << endm;
317 St_svtDriftCurve *driftVelocityCurve=0;
319 svtDriftCurve_st *driftCurve=0;
325 for (
int barrel = 1;barrel <= mSvtConfig->getNumberOfBarrels();barrel++) {
326 for (
int ladder = 1;ladder <= mSvtConfig->getNumberOfLadders(barrel);ladder++) {
327 for (
int wafer = 1;wafer <= mSvtConfig->getNumberOfWafers(barrel);wafer++) {
328 for (
int hybrid = 1;hybrid <= mSvtConfig->getNumberOfHybrids();hybrid++) {
330 index = mSvtConfig->getHybridIndex(barrel,ladder,wafer,hybrid);
332 if (index < 0)
continue;
336 sprintf(path,
"InnerBarrel/Ladder_0%d/Wafer_0%d/Hybrid_0%d/svtDriftCurve",ladder,wafer,hybrid);
340 sprintf(path,
"MiddleBarrel/Ladder_0%d/Wafer_0%d/Hybrid_0%d/svtDriftCurve",ladder,wafer,hybrid);
342 sprintf(path,
"MiddleBarrel/Ladder_%d/Wafer_0%d/Hybrid_0%d/svtDriftCurve",ladder,wafer,hybrid);
346 sprintf(path,
"OuterBarrel/Ladder_0%d/Wafer_0%d/Hybrid_0%d/svtDriftCurve",ladder,wafer,hybrid);
348 sprintf(path,
"OuterBarrel/Ladder_%d/Wafer_0%d/Hybrid_0%d/svtDriftCurve",ladder,wafer,hybrid);
353 TString
Path(
"Calibrations/svt/");
355 driftVelocityCurve = (St_svtDriftCurve*) GetDataBase(
Path);
356 if (!(driftVelocityCurve && driftVelocityCurve->HasData()) ){
357 gMessMgr->Message(
"Error Finding SVT drift velocity curve",
"E");
361 driftCurve = driftVelocityCurve->GetTable();
364 if (!hybridDriftCurve)
368 for (
int i=1; i<=3; i++)
369 for (
int j=1; j<=10; j++) {
370 hybridDriftCurve->setParameter(i,j,driftCurve->driftCurve[i-1][j-1]);
374 mSvtDriftCurve->put_at(hybridDriftCurve,index);
381 return mSvtDriftCurve;
387 gMessMgr->Info() <<
"StSvtDbMaker::getAnodeDriftCorr" << endm;
390 St_svtAnodeDriftCorr *anodeDriftCorr;
391 svtAnodeDriftCorr_st *driftCorr;
401 for (
int barrel = 1;barrel <= mSvtConfig->getNumberOfBarrels();barrel++) {
402 for (
int ladder = 1;ladder <= mSvtConfig->getNumberOfLadders(barrel);ladder++) {
403 for (
int wafer = 1;wafer <= mSvtConfig->getNumberOfWafers(barrel);wafer++) {
404 for (
int hybrid = 1;hybrid <= mSvtConfig->getNumberOfHybrids();hybrid++) {
406 index = mSvtConfig->getHybridIndex(barrel,ladder,wafer,hybrid);
408 if (index < 0)
continue;
412 sprintf(path,
"InnerBarrel/Ladder_0%d/Wafer_0%d/Hybrid_0%d/svtAnodeDriftCorr",ladder,wafer,hybrid);
416 sprintf(path,
"MiddleBarrel/Ladder_0%d/Wafer_0%d/Hybrid_0%d/svtAnodeDriftCorr",ladder,wafer,hybrid);
418 sprintf(path,
"MiddleBarrel/Ladder_%d/Wafer_0%d/Hybrid_0%d/svtAnodeDriftCorr",ladder,wafer,hybrid);
422 sprintf(path,
"OuterBarrel/Ladder_0%d/Wafer_0%d/Hybrid_0%d/svtAnodeDriftCorr",ladder,wafer,hybrid);
424 sprintf(path,
"OuterBarrel/Ladder_%d/Wafer_0%d/Hybrid_0%d/svtAnodeDriftCorr",ladder,wafer,hybrid);
429 TString
Path(
"Calibrations/svt/");
431 anodeDriftCorr = (St_svtAnodeDriftCorr*) GetDataBase(
Path);
432 if (!(anodeDriftCorr && anodeDriftCorr->HasData()) ){
433 gMessMgr->Message(
"Error Finding SVT bad anodes",
"E");
436 driftCorr = anodeDriftCorr->GetTable();
439 if (!hybridAnodeDriftCorr)
443 for (
int anode=1;anode<=mSvtConfig->getNumberOfAnodes();anode++) {
444 hybridAnodeDriftCorr->setValue(anode,driftCorr->driftVelocCorr[anode-1]);
449 mSvtAnodeDriftCorr->put_at(hybridAnodeDriftCorr,index);
456 return mSvtAnodeDriftCorr;
462 gMessMgr->Info() <<
"StSvtDbMaker::getPedestals" << endm;
464 St_svtPedestals *pedestals = (St_svtPedestals*)GetDataBase(
"Calibrations/svt/svtPedestals");
465 if (!(pedestals && pedestals->HasData()) ){
466 gMessMgr->Message(
"Error Finding SVT Pedestals",
"E");
470 svtPedestals_st *pedestal = pedestals->GetTable();
478 for (
int barrel = 1;barrel <= mSvtConfig->getNumberOfBarrels();barrel++) {
479 for (
int ladder = 1;ladder <= mSvtConfig->getNumberOfLadders(barrel);ladder++) {
480 for (
int wafer = 1;wafer <= mSvtConfig->getNumberOfWafers(barrel);wafer++) {
481 for (
int hybrid = 1;hybrid <= mSvtConfig->getNumberOfHybrids();hybrid++) {
483 index = mSvtConfig->getHybridIndex(barrel,ladder,wafer,hybrid);
485 if (index < 0)
continue;
493 for (
int anode = 1; anode <= mSvtConfig->getNumberOfAnodes(); anode++)
494 for (
int time = 0; time < mSvtConfig->getNumberOfTimeBins(); time++) {
495 hybridPed->addToPixel(anode,time,pedestal[index].pedestal[anode-1][time]);
499 mSvtPed->put_at(hybridPed,index);
513 gMessMgr->Info() <<
"StSvtDbMaker::getRms" << endm;
515 St_svtRms *st_rms = (St_svtRms*)GetDataBase(
"Calibrations/svt/svtRms");
516 if (!(st_rms && st_rms->HasData()) ){
517 gMessMgr->Message(
"Error Finding SVT RMS",
"E");
521 svtRms_st *rms = st_rms->GetTable();
529 for (
int barrel = 1;barrel <= mSvtConfig->getNumberOfBarrels();barrel++) {
530 for (
int ladder = 1;ladder <= mSvtConfig->getNumberOfLadders(barrel);ladder++) {
531 for (
int wafer = 1;wafer <= mSvtConfig->getNumberOfWafers(barrel);wafer++) {
532 for (
int hybrid = 1;hybrid <= mSvtConfig->getNumberOfHybrids();hybrid++) {
534 index = mSvtConfig->getHybridIndex(barrel,ladder,wafer,hybrid);
536 if (index < 0)
continue;
544 for (
int anode = 1; anode <= mSvtConfig->getNumberOfAnodes(); anode++)
545 for (
int time = 0; time < mSvtConfig->getNumberOfTimeBins(); time++) {
546 hybridRms->addToPixel(anode,time,rms[index].rms[anode-1][time]);
550 mSvtRms->put_at(hybridRms,index);
563 gMessMgr->Info() <<
"StSvtDbMaker::getGeometry" << endm;
566 St_svtDimensions *dimensions = (St_svtDimensions*)GetDataBase(
"Geometry/svt/svtDimensions");
567 if (!(dimensions && dimensions->HasData()) ){
568 gMessMgr->Message(
"Error Finding SVT Dimensions",
"E");
572 svtDimensions_st *dimension = dimensions->GetTable();
577 mSvtGeom->setBarrelRadius(dimension->barrelRadius);
578 mSvtGeom->setWaferLength(dimension->waferLength);
579 mSvtGeom->setWaferThickness(dimension->waferThickness);
580 mSvtGeom->setWaferWidth(dimension->waferWidth);
582 mSvtGeom->setAnodePitch(0.025);
583 mSvtGeom->setFocusRegionLength(dimension->focusRegionLength);
584 mSvtGeom->setDistanceInjector(dimension->distanceInjector);
585 mSvtGeom->setLaserPosition(dimension->laserPosition);
586 fRotList =
new THashList(100,0);
587 fRotList->SetOwner(kFALSE);
588 St_Survey *SvtOnGlobal = (St_Survey *) GetDataBase(
"Geometry/svt/SvtOnGlobal");
589 if (! SvtOnGlobal) {cout <<
"SvtOnGlobal has not been found" << endl;
return 0;}
591 TGeoHMatrix GL, LS,SG,LA,WG;
592 Survey_st *OnGlobal = SvtOnGlobal->GetTable();
593 GL.SetRotation(&OnGlobal->r00);
594 GL.SetTranslation(&OnGlobal->t0);
595 const TGeoHMatrix &Tpc2Global = gStTpcDb->Tpc2GlobalMatrix();
598 St_Survey *WaferOnLadder = (St_Survey *) GetDataBase(
"Geometry/svt/WaferOnLadder");
599 St_Survey *LadderOnSurvey = (St_Survey *) GetDataBase(
"Geometry/svt/LadderOnSurvey");
600 St_Survey *LadderOnShell = (St_Survey *) GetDataBase(
"Geometry/svt/LadderOnShell");
601 St_Survey *ShellOnGlobal = (St_Survey *) GetDataBase(
"Geometry/svt/ShellOnGlobal");
602 Int_t NW = WaferOnLadder->GetNRows();
603 Int_t NL = LadderOnSurvey->GetNRows();
604 Survey_st *waferOnLadder = WaferOnLadder->GetTable();
605 Survey_st *shellOnGlobal0 = ShellOnGlobal->GetTable(0);
606 Survey_st *shellOnGlobal1 = ShellOnGlobal->GetTable(1);
607 TGeoHMatrix LSU, LSH, SHG[2];
608 SHG[0].SetRotation(&shellOnGlobal0->r00);
609 SHG[0].SetTranslation(&shellOnGlobal0->t0);
610 SHG[1].SetRotation(&shellOnGlobal1->r00);
611 SHG[1].SetTranslation(&shellOnGlobal1->t0);
614 Double_t swap[9] = { 1, 0, 0, 0, 0, 1, 0, 1, 0};
615 TGeoHMatrix SWAP(
"SWAP");
616 SWAP.SetRotation(swap);
618 for (Int_t i = 0; i < NW; i++, waferOnLadder++) {
619 Int_t
id = waferOnLadder->Id;
620 Int_t wbarrel =
id/1000;
621 Int_t wwafer = (
id - 1000*wbarrel)/100;
622 Int_t wladder =
id%100;
623 Int_t wlayer = 2*wbarrel + wladder%2 - 1;
625 Int_t Id = 1000*wlayer + 100*wwafer + wladder;
626 Int_t index = mSvtGeom->getWaferIndex(wbarrel,wladder,wwafer);
627 if (index < 0)
continue;
629 if (waferGeom)
continue;
631 mSvtGeom->put_at(waferGeom,index);
633 Survey_st *ladderOnSurvey = LadderOnSurvey->GetTable();
634 for ( Int_t j = 0; j < NL; j++, ladderOnSurvey++) {
635 Int_t Idl = ladderOnSurvey->Id;
636 Int_t lbarrel = Idl/1000;
637 Int_t lladder = Idl%100;
638 if( wladder != lladder || wbarrel != lbarrel)
continue;
639 Survey_st *ladderOnShell = LadderOnShell->GetTable();
641 for ( Int_t l = 0; l < NL; l++, ladderOnShell++)
if (ladderOnShell->Id == ladderOnSurvey->Id) {found++;
break;}
642 if (! found)
continue;
643 LSH.SetRotation(&ladderOnShell->r00);
644 LSH.SetTranslation(&ladderOnShell->t0);
646 if( (wbarrel == 1 && wladder <= 4) || (wbarrel == 2 && wladder <= 6) || (wbarrel == 3 && wladder <= 8) ) Shell = 0;
650 wL.SetRotation(&waferOnLadder->r00);
651 wL.SetTranslation(&waferOnLadder->t0);
652 LSU.SetRotation(&ladderOnSurvey->r00);
653 LSU.SetTranslation(&ladderOnSurvey->t0);
656 TGeoHMatrix WLL = LSU * wL;
658 TGeoHMatrix *WL = (TGeoHMatrix *) fRotList->FindObject(Form(
"WL%04i",Id));
660 WL =
new TGeoHMatrix(Form(
"WL%04i",Id));
661 Double_t *r = WLL.GetRotationMatrix();
662 Double_t rot[9] = {r[0], r[2], r[1],
666 WL->SetRotation(rot);
667 WL->SetTranslation(WLL.GetTranslation());
676 cout <<
"Tpc2Global "; Tpc2Global.Print();
677 cout <<
"GL "; GL.Print();
678 TGeoHMatrix test = Tpc2Global * GL; cout <<
"test "; test.Print();
680 WG = Tpc2Global * GL * SHG[Shell] * LSH * WLL;
681 Double_t *r = WG.GetRotationMatrix();
683 for (
int l = 0; l < 9; l++) {
684 if (TMath::Abs(r[l]) >= 1.000001) fail++;
686 if (fail && Debug()) {
687 cout <<
"===============" << waferOnLadder->Id <<
" "<<
id <<
" " << Id <<endl;
688 cout <<
"WG\t"; WG.Print();
691 TVector3 d(r[0],r[3],r[6]); norm = 1/d.Mag(); d *= norm;
692 TVector3 t(r[2],r[5],r[8]); norm = 1/t.Mag(); t *= norm;
693 TVector3 n(r[1],r[4],r[7]); norm = 1/n.Mag(); n *= norm;
694 TVector3 c = d.Cross(t);
695 if (c.Dot(n) < 0) c *= -1;
697 Double_t *wgtr = WG.GetTranslation();
702 waferGeom->SetRotation(rot);
703 waferGeom->SetTranslation(wgtr);
704 if (Debug()) waferGeom->print();
705 fRotList->Add(waferGeom);
711 TIter next(fRotList);
714 while ((comb = (TGeoHMatrix *) next())) {
715 TString Name(comb->GetName());
716 if (Name.BeginsWith(
"R")) {
717 TGeoHMatrix *WL = (TGeoHMatrix *) fRotList->FindObject(Form(
"WL%s",Name.Data()+1));
719 cout << Form(
"WL%s",Name.Data()+1) <<
" has not been found" << endl;
731 gMessMgr->Info() <<
"StSvtDbMaker::getBadAnodes" << endm;
734 St_svtBadAnodes *badAnodes;
735 svtBadAnodes_st *badAnode;
744 for (
int barrel = 1;barrel <= mSvtConfig->getNumberOfBarrels();barrel++) {
745 for (
int ladder = 1;ladder <= mSvtConfig->getNumberOfLadders(barrel);ladder++) {
746 for (
int wafer = 1;wafer <= mSvtConfig->getNumberOfWafers(barrel);wafer++) {
747 for (
int hybrid = 1;hybrid <= mSvtConfig->getNumberOfHybrids();hybrid++) {
749 index = mSvtConfig->getHybridIndex(barrel,ladder,wafer,hybrid);
751 if (index < 0)
continue;
755 sprintf(path,
"InnerBarrel/Ladder_0%d/Wafer_0%d/Hybrid_0%d/svtBadAnodes",ladder,wafer,hybrid);
759 sprintf(path,
"MiddleBarrel/Ladder_0%d/Wafer_0%d/Hybrid_0%d/svtBadAnodes",ladder,wafer,hybrid);
761 sprintf(path,
"MiddleBarrel/Ladder_%d/Wafer_0%d/Hybrid_0%d/svtBadAnodes",ladder,wafer,hybrid);
765 sprintf(path,
"OuterBarrel/Ladder_0%d/Wafer_0%d/Hybrid_0%d/svtBadAnodes",ladder,wafer,hybrid);
767 sprintf(path,
"OuterBarrel/Ladder_%d/Wafer_0%d/Hybrid_0%d/svtBadAnodes",ladder,wafer,hybrid);
772 TString
Path(
"Calibrations/svt/");
774 badAnodes = (St_svtBadAnodes*) GetDataBase(
Path);
775 if (!(badAnodes && badAnodes->HasData()) ){
776 gMessMgr->Message(
"Error Finding SVT bad anodes",
"E");
780 badAnode = badAnodes->GetTable();
783 if (!hybridBadAnodes)
787 for (
int anode=1;anode<=mSvtConfig->getNumberOfAnodes();anode++) {
788 if (badAnode->isBadAnode[anode-1]) {
789 hybridBadAnodes->setBadAnode(anode);
794 mSvtBadAnodes->put_at(hybridBadAnodes,index);
801 return mSvtBadAnodes;
805 int StSvtDbMaker::getElectronics()
808 St_svtElectronics *electronics = (St_svtElectronics*)GetDataBase(
"Calibrations/svt/svtElectronics");
809 if (!(electronics && electronics->HasData()) ){
810 gMessMgr->Message(
"Error Finding SVT Electronics",
"E");
814 electronic = electronics->GetTable();
823 if (getElectronics()) {
824 for (
int i=0;i<24;i++)
825 mSvtT0->setT0(electronic->tZero[i],i+1);
826 mSvtT0->setFsca(electronic->samplingFrequency);
828 gMessMgr->Info() <<
"t0 = " << mSvtT0->getT0(1) <<
", fsca = " << mSvtT0->getFsca() << endm;
837 StSvtDaq* StSvtDbMaker::getDaqParameters()
839 gMessMgr->Info() <<
"StSvtDbMaker::getDaqParameters" << endm;
841 St_svtDaq *daq = (St_svtDaq*)GetDataBase(
"Calibrations/svt/svtDaq");
842 if (!(daq && daq->HasData()) ){
843 gMessMgr->Message(
"Error Finding SVT Daq",
"E");
847 svtDaq_st* daqParam = daq->GetTable();
849 gMessMgr->Info() <<
"clearedTimeBins = " << daqParam->clearedTimeBins<< endm;
850 gMessMgr->Info() <<
"pixelsBefore = " << daqParam->pixelsBefore << endm;
851 gMessMgr->Info() <<
"pixelsAfter = " << daqParam->pixelsAfter << endm;
852 gMessMgr->Info() <<
"pedOffset = " << daqParam->pedOffset << endm;
853 gMessMgr->Info() <<
"seqLo = " << daqParam->seqLo << endm;
854 gMessMgr->Info() <<
"seqHi = " << daqParam->seqHi << endm;
855 gMessMgr->Info() <<
"threshLo = " << daqParam->threshLo << endm;
856 gMessMgr->Info() <<
"threshHi = " << daqParam->threshHi << endm;
860 mSvtDaq->setClearedTimeBins(daqParam->clearedTimeBins);
861 mSvtDaq->setSavedBlackAnodes(daqParam->savedBlackAnodes[0],0);
862 mSvtDaq->setSavedBlackAnodes(daqParam->savedBlackAnodes[1],1);
863 mSvtDaq->setSavedBlackAnodes(daqParam->savedBlackAnodes[2],2);
864 mSvtDaq->setSavedBlackAnodes(daqParam->savedBlackAnodes[2],3);
865 mSvtDaq->setPixelsBefore(daqParam->pixelsBefore);
866 mSvtDaq->setPixelsAfter(daqParam->pixelsAfter);
867 mSvtDaq->setPedOffset(daqParam->pedOffset);
868 mSvtDaq->setSeqLo(daqParam->seqLo);
869 mSvtDaq->setSeqHi(daqParam->seqHi);
870 mSvtDaq->setThreshLo(daqParam->threshLo);
871 mSvtDaq->setThreshHi(daqParam->threshHi);
877 TDataSet *StSvtDbMaker::FindDataSet (
const char* logInput,
const StMaker *uppMk,
880 TDataSet *ds = StMaker::FindDataSet(logInput,uppMk,dowMk);
882 static const Char_t *SetNames[] = {
"StSvtConfig",
"StSvtDriftVelocity",
"StSvtDriftCurve",
883 "StSvtAnodeDriftCorr",
"StSvtPedestal",
"StSvtRMSPedestal",
884 "StSvtGeometry",
"StSvtBadAnodes",
"StSvtT0",
"StSvtDaq",
886 TString Input(logInput);
887 if (! Input.Contains(
"StSvt"))
return ds;
890 for (Int_t i = 0; SetNames[i]; i++) {
891 if (Input.CompareTo(SetNames[i]))
continue;
893 This->AddConst(objs);
895 if (! Input.CompareTo(
"StSvtConfig")) o = This->getConfiguration();
896 else if (! Input.CompareTo(
"StSvtDriftVelocity")) o = 0;
897 else if (! Input.CompareTo(
"StSvtDriftCurve")) o = This->getDriftCurve();
898 else if (! Input.CompareTo(
"StSvtAnodeDriftCorr"))o = This->getAnodeDriftCorr();
899 else if (! Input.CompareTo(
"StSvtPedestal")) o = This->getPedestals();
900 else if (! Input.CompareTo(
"StSvtRMSPedestal")) o = This->getRms();
901 else if (! Input.CompareTo(
"StSvtGeometry")) o = This->getGeometry();
902 else if (! Input.CompareTo(
"StSvtBadAnodes")) o = This->getBadAnodes();
903 else if (! Input.CompareTo(
"StSvtT0")) o = This->getT0();
904 else if (! Input.CompareTo(
"StSvtDaq")) o = This->getDaqParameters();
905 else if (! Input.CompareTo(
"StSvtGeometry")) o = This->getGeometry();
912 THashList *StSvtDbMaker::GetRotations() {
913 FindDataSet(
"StSvtGeometry");
virtual void Clear(Option_t *option="")
User defined functions.
virtual void SetObject(TObject *obj)
The depricated method (left here for the sake of the backward compatibility)
virtual TObject * GetObject() const
The depricated method (left here for the sake of the backward compatibility)
virtual TString Path() const
return the full path of this data set