00001
00002
00003
00004
00005
00006
00007
00008
00010 #include "Filtration/FiltSGateModule.h"
00011 #include <cstdio>
00012 using namespace std;
00013
00014
00015 #include "TFile.h"
00016 #include "TStyle.h"
00017 #include "TMath.h"
00018 #include "TString.h"
00019
00020
00021 #include "MessageService/MsgService.h"
00022 #include "MinosObjectMap/MomNavigator.h"
00023
00024 #include "RawData/RawRecord.h"
00025 #include "RawData/RawDaqSnarlHeader.h"
00026 #include "RawData/RawVtmTimeInfoBlock.h"
00027 #include "RawData/RawDigitDataBlock.h"
00028 #include "RawData/RawQieDigit.h"
00029
00030 #include "OnlineUtil/mdTriggerCodes.h"
00031
00032 #include "Conventions/Munits.h"
00033 #include "JobControl/JobCommand.h"
00034 #include "JobControl/JobCModuleRegistry.h"
00035
00036 CVSID("$Id: FiltSGateModule.cxx,v 1.12 2005/01/21 22:40:40 rhatcher Exp $");
00037 JOBMODULE(FiltSGateModule,"FiltSGateModule","Compute and record total charge in time window around SGate time.\n");
00038
00039
00040
00041
00042 void chooseTimeScale(double rangeSec, double& scale, const char*& tag)
00043 {
00044 if (rangeSec < 1.0e-6 ) {
00045 tag = "ns";
00046 scale = 1.0e9;
00047 }
00048 else if (rangeSec < 1.0e-3 ) {
00049 tag = "#musec";
00050 scale = 1.0e6;
00051 }
00052 else if (rangeSec < 1.0 ) {
00053 tag = "millisec";
00054 scale = 1.0e3;
00055 }
00056 else {
00057 tag = "sec";
00058 scale = 1.0;
00059 }
00060 }
00061
00062
00063
00064
00065
00066 typedef struct user_analysis_ntuple {
00067 Float_t qtot;
00068 Float_t nhit;
00069 } FiltSGateModuleNtuple_t;
00070
00071 const char* gsChTags = "qtot:nhit";
00072
00073
00074
00075 const Int_t kDefaultTicksPerSec = 53103000;
00076 const Int_t kPedAdc = 50;
00077
00078
00079
00080 FiltSGateModule::FiltSGateModule() :
00081
00082 fTicksPerSec(kDefaultTicksPerSec),
00083 fQieErrorMask(0),
00084 fPedSubAdcMin(0),
00085 fCheckTimeFrame(0),
00086 fTminWindow(-20.0),
00087 fTmaxWindow( 20.0),
00088 fTriggerMaskAllow(0),
00089 fDrawHists(1),
00090 fWriteHists(true),
00091 fKeepCanvas(true),
00092
00093 fCanvas(new TCanvas(std::tmpnam(0),"SGate Filter",800,800)),
00094
00095
00096
00097 fLastRFClockHist("fLastRFClock",
00098 Form("Last RF Clock - %d",kDefaultTicksPerSec),
00099 150,-25,125),
00100 fSpillTimeRFHist("fSpillTimeRF", "Spill Time RF", 50, 0,53104000),
00101 fAdcVsTimeRFHist1("fAdcVsTimeRFHist1", "Adc vs. Time rel RF", 500,-20.0,20.0),
00102 fSnarlVsTimeRFHist("fSnarlVsTimeRFHist1", "Snarl vs. Time rel RF", 500,-20.0,20.0),
00103 fAdcVsTimeRFHist2("fAdcVsTimeRFHist2", "Adc vs. Time rel RF", 500,-100.0,100.0),
00104
00105 fNtuple("fNtuple","Event Summary",gsChTags),
00106
00107 fLatestRun(-1),
00108 fLatestSubRun(-1),
00109 fLatestSpillTimeTF(-1),
00110 fLatestSpillTimeRF(-1),
00111 fLastRFClock(-1),
00112 fLastRFClockPrevTF(-1),
00113 fLatchedSpillTimeTF(-1)
00114
00115 {
00116
00117
00118
00119
00120
00121
00122 fLastRFClockHist.SetXTitle("Ticks");
00123 fLastRFClockHist.SetYTitle("VtmTimeInfo blocks");
00124
00125 fSpillTimeRFHist.SetXTitle("Ticks");
00126 fSpillTimeRFHist.SetYTitle("VtmTimeInfo blocks");
00127
00128 fAdcVsTimeRFHist1.SetXTitle("TDC-SpillTimeRF (sec)");
00129 fAdcVsTimeRFHist1.SetYTitle("#Sigma Adc");
00130
00131 fSnarlVsTimeRFHist.SetXTitle("TDC-SpillTimeRF (sec)");
00132 fSnarlVsTimeRFHist.SetYTitle("#Snarls");
00133
00134 fAdcVsTimeRFHist2.SetXTitle("TDC-SpillTimeRF (sec)");
00135 fAdcVsTimeRFHist2.SetYTitle("#Sigma Adc");
00136
00137 }
00138
00139
00140
00141 const Registry& FiltSGateModule::DefaultConfig() const
00142 {
00143
00144
00145
00146 static Registry r;
00147
00148
00149 std::string name = this->GetName();
00150 name += ".config.default";
00151 r.SetName(name.c_str());
00152
00153 Int_t qieErrorMask = 0;
00154 qieErrorMask |= RawQieDigit::kParityError;
00155 qieErrorMask |= RawQieDigit::kCapIdError;
00156 qieErrorMask |= RawQieDigit::kMisCountError;
00157 qieErrorMask |= RawQieDigit::kPriorityTruncate;
00158 qieErrorMask |= RawQieDigit::kCapIdSameMenuError;
00159 qieErrorMask |= RawQieDigit::kCapIdSharedMinderError;
00160
00161 Int_t trigMaskAllow = 0;
00162
00163
00164
00165
00166
00167
00168
00169 trigMaskAllow |= TRIGGER_BIT_SPILL;
00170 trigMaskAllow |= TRIGGER_BIT_SPILL_IP;
00171
00172
00173 r.UnLockValues();
00174 r.Set("TicksPerSec", kDefaultTicksPerSec);
00175 r.Set("QieErrorMask", qieErrorMask);
00176 r.Set("PedSubAdcMin", 0);
00177 r.Set("CheckTimeFrame", 0);
00178
00179 r.Set("TminWindow", -100.0e-6);
00180 r.Set("TmaxWindow", 100.0e-6);
00181 r.Set("TriggerMaskAllow", trigMaskAllow);
00182
00183 r.Set("DrawHists", 1);
00184 r.Set("WriteHists", true);
00185
00186 r.Set("Nbin1", 200);
00187 r.Set("Tmin1", -20.0e-6);
00188 r.Set("Tmax1", 20.0e-6);
00189 r.Set("Nbin2", 200);
00190 r.Set("Tmin2", -100.0e-6);
00191 r.Set("Tmax2", 100.0e-6);
00192
00193 r.Set("NbinLastRF", 600);
00194 r.Set("TminLastRF", -25);
00195 r.Set("TmaxLastRF", 575);
00196
00197 r.LockValues();
00198
00199 return r;
00200 }
00201
00202
00203
00204 void FiltSGateModule::Config(const Registry& r)
00205 {
00206
00207
00208
00209
00210 double tmpd;
00211 int tmpi;
00212
00213 if (r.Get("TicksPerSec", tmpi)) { fTicksPerSec = tmpi; }
00214 if (r.Get("QieErrorMask", tmpi)) { fQieErrorMask = tmpi; }
00215 if (r.Get("PedSubAdcMin", tmpi)) { fPedSubAdcMin = tmpi; }
00216 if (r.Get("CheckTimeFrame", tmpi)) { fCheckTimeFrame = tmpi; }
00217
00218 if (r.Get("TminWindow", tmpd)) { fTminWindow = tmpd; }
00219 if (r.Get("TmaxWindow", tmpd)) { fTmaxWindow = tmpd; }
00220
00221 if (r.Get("TriggerMaskAllow",tmpi)) { fTriggerMaskAllow = tmpi; }
00222
00223 if (r.Get("DrawHists", tmpi)) { fDrawHists = tmpi; }
00224 if (r.Get("WriteHists", tmpi)) { fWriteHists = tmpi; }
00225 if (r.Get("KeepCanvas", tmpi)) { fKeepCanvas = tmpi; }
00226
00227
00228 bool reBin;
00229 int nbin;
00230 double xmin, xmax;
00231 const char* timeUnitsTag;
00232
00233 reBin = false;
00234 nbin = fAdcVsTimeRFHist1.GetNbinsX();
00235 xmin = fAdcVsTimeRFHist1.GetXaxis()->GetXmin();
00236 xmax = fAdcVsTimeRFHist1.GetXaxis()->GetXmax();
00237 if (r.Get("Nbin1",tmpi)) { reBin = true; nbin = tmpi; }
00238 if (r.Get("Tmin1",tmpd)) { reBin = true; xmin = tmpd; }
00239 if (r.Get("Tmax1",tmpd)) { reBin = true; xmax = tmpd; }
00240 if (reBin) {
00241 MSG("Filt",Msg::kSynopsis)
00242 << "Rebin Hist1 nbins=" << nbin
00243 << " [ " << xmin << " : " << xmax << " ]"
00244 << endl;
00245 chooseTimeScale(xmax-xmin,fHist1TScale,timeUnitsTag);
00246 fAdcVsTimeRFHist1.SetBins(nbin,xmin*fHist1TScale,xmax*fHist1TScale);
00247 fAdcVsTimeRFHist1.SetXTitle(Form("TDC-SpillTimeRF (%s)",timeUnitsTag));
00248 fSnarlVsTimeRFHist.SetBins(nbin,xmin*fHist1TScale,xmax*fHist1TScale);
00249 fSnarlVsTimeRFHist.SetXTitle(Form("TDC-SpillTimeRF (%s)",timeUnitsTag));
00250 }
00251
00252 reBin = false;
00253 nbin = fAdcVsTimeRFHist2.GetNbinsX();
00254 xmin = fAdcVsTimeRFHist2.GetXaxis()->GetXmin();
00255 xmax = fAdcVsTimeRFHist2.GetXaxis()->GetXmax();
00256 if (r.Get("Nbin2",tmpi)) { reBin = true; nbin = tmpi; }
00257 if (r.Get("Tmin2",tmpd)) { reBin = true; xmin = tmpd; }
00258 if (r.Get("Tmax2",tmpd)) { reBin = true; xmax = tmpd; }
00259 if (reBin) {
00260 MSG("Filt",Msg::kSynopsis)
00261 << "Rebin Hist2 nbins=" << nbin
00262 << " [ " << xmin << " : " << xmax << " ]"
00263 << endl;
00264 chooseTimeScale(xmax-xmin,fHist2TScale,timeUnitsTag);
00265 fAdcVsTimeRFHist2.SetBins(nbin,xmin*fHist2TScale,xmax*fHist2TScale);
00266 fAdcVsTimeRFHist2.SetXTitle(Form("TDC-SpillTimeRF (%s)",timeUnitsTag));
00267 }
00268
00269 reBin = false;
00270 nbin = fLastRFClockHist.GetNbinsX();
00271 xmin = fLastRFClockHist.GetXaxis()->GetXmin();
00272 xmax = fLastRFClockHist.GetXaxis()->GetXmax();
00273 if (r.Get("NbinLastRF",tmpi)) { reBin = true; nbin = tmpi; }
00274 if (r.Get("TminLastRF",tmpd)) { reBin = true; xmin = tmpd; }
00275 if (r.Get("TmaxLastRF",tmpd)) { reBin = true; xmax = tmpd; }
00276 if (reBin) {
00277 MSG("Filt",Msg::kSynopsis)
00278 << "Rebin RFClock nbins=" << nbin
00279 << " [ " << xmin << " : " << xmax << " ]"
00280 << endl;
00281 fLastRFClockHist.SetBins(nbin,xmin,xmax);
00282 }
00283 }
00284
00285
00286
00287 void FiltSGateModule::Report()
00288 {
00289
00290
00291
00292
00293
00294
00295 MSG("Demo",Msg::kInfo)
00296 << "Report For FiltSGateModule Module:\n" << endl;
00297 if (fDrawHists!=0) this->DrawHistgrams();
00298 }
00299
00300
00301
00302 void FiltSGateModule::EndJob()
00303 {
00304
00305
00306
00307
00308
00309
00310
00311 if (fWriteHists) {
00312 TFile userFile("sgate_filter.root","RECREATE");
00313 fLastRFClockHist.Write();
00314 fSpillTimeRFHist.Write();
00315 fAdcVsTimeRFHist1.Write();
00316 fSnarlVsTimeRFHist.Write();
00317 fAdcVsTimeRFHist2.Write();
00318 fNtuple.Write();
00319 }
00320
00321 if ( ! fKeepCanvas ) delete fCanvas;
00322 }
00323
00324
00325
00326 JobCResult FiltSGateModule::Ana(const MomNavigator *mom)
00327 {
00328
00329
00330
00331
00332
00333 vector<const RawVtmTimeInfoBlock*> vtmBlks;
00334 vector<const RawDigitDataBlock*> digitBlks;
00335 Int_t snarlTfNum = -1;
00336
00337 int nrawrec=0;
00338 int nrawblk=0;
00339 bool acceptBecauseTrigMask = false;
00340 UInt_t trigSrc = 0;
00341 Int_t snarlNum = -1;
00342 bool sawMonitorRecord = false;
00343
00344 TObject* recObj = 0;
00345 TIter recItr = mom->FragmentIter();
00346 while ( ( recObj = recItr.Next() ) ) {
00347 RawRecord* rawrec = dynamic_cast<RawRecord*>(recObj);
00348 if (!rawrec) continue;
00349 nrawrec++;
00350
00351
00352 const RawDaqSnarlHeader* snarlHdr =
00353 dynamic_cast<const RawDaqSnarlHeader*>(rawrec->GetHeader());
00354 if ( snarlHdr ) {
00355 fLatestRun = snarlHdr->GetRun();
00356 fLatestSubRun = snarlHdr->GetSubRun();
00357 snarlTfNum = snarlHdr->GetTimeFrameNum();
00358 snarlNum = snarlHdr->GetSnarl();
00359 if ( snarlHdr->GetTrigSrc() & fTriggerMaskAllow ) {
00360
00361 acceptBecauseTrigMask = true;
00362 trigSrc = snarlHdr->GetTrigSrc();
00363 }
00364 }
00365 else
00366 sawMonitorRecord = true;
00367
00368 TObject* blkObj = 0;
00369 TIter blkItr = rawrec->GetRawBlockIter();
00370 while ( ( blkObj = blkItr.Next() ) ) {
00371 const RawDataBlock* rawBlk = dynamic_cast<const RawDataBlock*>(blkObj);
00372 if (!rawBlk) continue;
00373 nrawblk++;
00374
00375 const RawVtmTimeInfoBlock* vtmblk =
00376 dynamic_cast<const RawVtmTimeInfoBlock*>(rawBlk);
00377 if (vtmblk) vtmBlks.push_back(vtmblk);
00378
00379 const RawDigitDataBlock* digitblk =
00380 dynamic_cast<const RawDigitDataBlock*>(rawBlk);
00381 if (digitblk) digitBlks.push_back(digitblk);
00382
00383 }
00384 }
00385
00386 MSG("Filt",Msg::kDebug)
00387 << "Saw " << (vtmBlks.size()) << " RawVtmTimeInfoBlocks "
00388 << "and " << (digitBlks.size()) << " RawDigitDataBlocks "
00389 << " from " << nrawblk << " blocks in " << nrawrec << " records"
00390 << endl;
00391
00392
00393 ProcessVtmTimeInfoBlks(vtmBlks);
00394
00395
00396 bool digitsInWindow = ProcessDigitDataBlks(digitBlks,snarlTfNum);
00397
00398
00399
00400
00401
00402
00403 if (fDrawHists!=0) {
00404 static Int_t lastTF_drawn = -9999;
00405 if ( ( digitsInWindow ) ||
00406 ( fDrawHists < 0 ) ||
00407 ( fLatestSpillTimeTF >= lastTF_drawn+fDrawHists ) )
00408 {
00409 this->DrawHistgrams();
00410 lastTF_drawn = fLatestSpillTimeTF;
00411 }
00412 }
00413
00414 if ( acceptBecauseTrigMask || digitsInWindow ) {
00415 MSG("Filt",Msg::kSynopsis )
00416 << std::right
00417 << "FiltSGate Snarl=" << setw(6) << snarlNum
00418 << " in TF=" << setw(5) << snarlTfNum
00419 << " TrigMask="
00420 << (acceptBecauseTrigMask?"yes":"no ")
00421 << " (0x" << std::hex << std::setfill('0') << std::right << setw(8)
00422 << trigSrc
00423 << std::setfill(' ') << std::left << std::dec
00424 << ") digitsInWindow="
00425 << (digitsInWindow?"yes":"no ")
00426 << endl;
00427 return JobCResult::kPassed;
00428 }
00429 if ( sawMonitorRecord ) {
00430 MSG("Filt",Msg::kDebug )
00431 << "FiltSGateModule AOK because DaqMonitor record in recset."
00432 << endl;
00433 return JobCResult::kAOK;
00434 }
00435
00436 return JobCResult::kFailed;
00437 }
00438
00439
00440
00441 void FiltSGateModule::ProcessVtmTimeInfoBlks(std::vector<const RawVtmTimeInfoBlock*>& vtmBlks)
00442 {
00443
00444
00445
00446
00447
00448
00449
00450
00451 size_t n = vtmBlks.size();
00452 if ( ! n ) return;
00453
00454 const size_t maxCrates = 16;
00455 int crate[maxCrates];
00456 int tfnum[maxCrates];
00457 int spillTimeRF[maxCrates];
00458 int lastRFClock[maxCrates];
00459 Msg::LogLevel_t dumpLevel = Msg::kDebug;
00460
00461 Int_t sum = 0;
00462
00463 for (size_t i = 0; i < n; ++i) {
00464 const RawVtmTimeInfoBlock* vti = vtmBlks[i];
00465
00466 crate[i] = vti->GetCrate();
00467 tfnum[i] = vti->GetTimeFrameNum();
00468 spillTimeRF[i] = vti->GetSpillTimeRF();
00469 lastRFClock[i] = vti->GetLastTimeStamp();
00470
00471 if ( 0 == i ) {
00472 fLatestRun = vti->GetRun();
00473 fLatestSubRun = vti->GetSubRun();
00474 }
00475
00476 sum += spillTimeRF[i];
00477
00478 fLastRFClockHist.Fill(lastRFClock[i]-kDefaultTicksPerSec);
00479
00480 MSG("Filt",Msg::kDebug)
00481 << " TF " << setw(5) << tfnum[i]
00482 << " VtmTimeInfo crate " << setw(2) << crate[i]
00483 << " RF " << setw(9) << spillTimeRF[i]
00484 << " GPS " << setw(9) << vti->GetSpillTimeGPS()
00485 << endl;
00486 }
00487
00488 Int_t fSpillTimeRFAvg = sum/n;
00489 fLatestSpillTimeTF = (Int_t)TMath::Median(n,tfnum);
00490 Int_t medianSpillTimeRF = (Int_t)TMath::Median(n,spillTimeRF);
00491
00492
00493
00494
00495 if ( medianSpillTimeRF != fLatestSpillTimeRF ) {
00496 fLatchedSpillTimeTF = fLatestSpillTimeTF;
00497
00498 if (fLatestSpillTimeRF>=0) fSpillTimeRFHist.Fill(fLatestSpillTimeRF);
00499 dumpLevel = Msg::kSynopsis;
00500 }
00501 fLatestSpillTimeRF = medianSpillTimeRF;
00502 fLastRFClockPrevTF = fLastRFClock;
00503 fLastRFClock = (Int_t)TMath::Median(n,lastRFClock);
00504
00505 MSG("Filt",dumpLevel)
00506 << std::right
00507 << " Run " << setw(5) << fLatestRun
00508 << "/" << setw(2) << fLatestSubRun
00509 << " TF " << setw(5) << fLatestSpillTimeTF
00510 << " (" << setw(5) << fLatchedSpillTimeTF << ")"
00511 << " SpillTimeRF"
00512 << " median " << setw(9) << fLatestSpillTimeRF
00513 << ( (fLatestSpillTimeRF == fSpillTimeRFAvg) ? " consistent":" median!=avg")
00514
00515
00516
00517
00518 << endl;
00519 }
00520
00521
00522
00523 bool FiltSGateModule::ProcessDigitDataBlks(std::vector<const RawDigitDataBlock*>& digitBlks, Int_t snarlTfNum)
00524 {
00525
00526
00527
00528
00529
00530
00531
00532
00533
00534
00535 size_t n = digitBlks.size();
00536 if ( ! n ) return false;
00537
00538 bool sawWindowDigits = false;
00539
00540
00541 #ifdef RAWCHANNELID_NEW_CTOR
00542 RawChannelId rcid_bad(Detector::kNear,ElecType::kQIE,5,18,0,12);
00543 #else
00544 RawChannelId rcid_bad(Detector::kNear,ElecType::kQIE,5,18,0,12,false,false);
00545 #endif
00546
00547 for (size_t i = 0; i < n; ++i) {
00548 const RawDigitDataBlock* rddb = digitBlks[i];
00549
00550 TIter rditr = rddb->GetDatumIter();
00551 const RawDigit* digit = 0;
00552 Int_t nd = 0;
00553
00554 Int_t mintdc = 0x7FFFFFF;
00555 Int_t maxtdc = -(mintdc-1);
00556 Char_t dtlast = -1;
00557 Msg::LogLevel_t dumpLevel = Msg::kDebug;
00558
00559 Double_t sumAdcTime = 0;
00560 Double_t sumAdc = 0;
00561
00562
00563
00564
00565 Double_t tfOffset =
00566 (snarlTfNum-fLatchedSpillTimeTF) * near_tdc_sec(fLastRFClockPrevTF);
00567 if ( fCheckTimeFrame == 0 ) tfOffset = 0;
00568
00569 while ( ( digit = dynamic_cast<RawDigit*>(rditr.Next()) ) ) {
00570
00571
00572 if ( digit->GetErrorCode() & fQieErrorMask ) continue;
00573
00574
00575 RawChannelId rcid = digit->GetChannel();
00576 rcid.ClearModeBits();
00577 if ( rcid == rcid_bad ) continue;
00578
00579 Int_t tdc = digit->GetTDC();
00580 Double_t subTime_sec =
00581 near_tdc_sec(tdc-fLatestSpillTimeRF) + tfOffset;
00582
00583
00584 Int_t pedSubAdc = digit->GetADC()-kPedAdc;
00585
00586 if ( pedSubAdc < fPedSubAdcMin ) continue;
00587
00588 fAdcVsTimeRFHist1.Fill(subTime_sec*fHist1TScale,pedSubAdc);
00589 fAdcVsTimeRFHist2.Fill(subTime_sec*fHist2TScale,pedSubAdc);
00590
00591 sumAdcTime += pedSubAdc * subTime_sec*fHist1TScale;
00592 sumAdc += pedSubAdc;
00593
00594 if ( subTime_sec >= fTminWindow &&
00595 subTime_sec <= fTmaxWindow ) {
00596 sawWindowDigits = true;
00597 dumpLevel = Msg::kSynopsis;
00598 }
00599
00600 nd++;
00601
00602 if ( tdc < mintdc ) mintdc = tdc;
00603 if ( tdc > maxtdc ) maxtdc = tdc;
00604 Char_t dt = digit->GetDataType();
00605 if ( dtlast != dt && dtlast != -1 ) {
00606 MSG("Filt",Msg::kWarning)
00607 << " RawDigitDataBlock has mixed DataTypes!"
00608 << (Int_t)dtlast << " -> " << (Int_t)dt
00609 << endl;
00610 }
00611 dtlast = dt;
00612 }
00613
00614 if ( sumAdc > 0.0 ) fSnarlVsTimeRFHist.Fill(sumAdcTime/sumAdc,1.0);
00615
00616
00617 const char* tagrf = " ";
00618 if ( mintdc <= fLatestSpillTimeRF &&
00619 fLatestSpillTimeRF <= maxtdc ) tagrf = "<== ";
00620
00621 MSG("Filt",dumpLevel)
00622 << std::right
00623 << " Run " << setw(5) << fLatestRun
00624 << "/" << setw(2) << fLatestSubRun
00625 << " TF " << setw(5) << snarlTfNum
00626 << " TDC"
00627 << " min " << setw(9) << mintdc
00628 << " max " << setw(9) << maxtdc
00629
00630
00631
00632 << " nd " << setw(5) << nd << " "
00633 << RawQieDigit::AsString((RawQieDigit::EQieDataTypes)dtlast)
00634 << (dtlast==RawQieDigit::kSGate?" ##":" ")
00635 << tagrf
00636
00637
00638
00639
00640
00641
00642 << endl;
00643
00644 }
00645
00646 return sawWindowDigits;
00647 }
00648
00649
00650
00651 Double_t FiltSGateModule::near_tdc_sec(Int_t tdc)
00652 {
00653 return tdc/((double)fTicksPerSec);
00654
00655
00656
00657 }
00658
00659
00660
00661 void FiltSGateModule::DrawHistgrams()
00662 {
00663
00664
00665
00666
00667 static bool first = true;
00668 if (first) {
00669 first = false;
00670 fCanvas->Divide(1,4);
00671 fCanvas->cd(4);
00672 gPad->Divide(2,1);
00673 gStyle->SetOptStat(111111);
00674 }
00675
00676 fCanvas->cd(1);
00677 gPad->SetLogy(0);
00678 fAdcVsTimeRFHist1.DrawCopy();
00679
00680 fCanvas->cd(2);
00681 gPad->SetLogy(0);
00682 fSnarlVsTimeRFHist.DrawCopy();
00683
00684 fCanvas->cd(3);
00685 gPad->SetLogy(0);
00686 fAdcVsTimeRFHist1.DrawCopy();
00687
00688 fCanvas->cd(4);
00689 gPad->cd(1);
00690
00691 fLastRFClockHist.DrawCopy();
00692
00693 fCanvas->cd(4);
00694 gPad->cd(2);
00695
00696 fSpillTimeRFHist.DrawCopy();
00697
00698 fCanvas->cd(1);
00699 fCanvas->Update();
00700 }
00701