FillNearRunQuality Class Reference

#include <FillNearRunQuality.h>

Inheritance diagram for FillNearRunQuality:
JobCModule

List of all members.

Public Member Functions

 FillNearRunQuality ()
 ~FillNearRunQuality ()
void BeginJob ()
JobCResult Ana (const MomNavigator *mom)
const RegistryDefaultConfig () const
void Config (const Registry &r)
void EndJob ()

Private Types

enum  fInstrumType_t { kSpectrometer = 0, kCalorimeter = 1, kError = 3 }

Private Member Functions

void WriteToDatabase ()
void ReadFromDatabase ()
void WriteOutDatabaseVariables ()
void WriteOutFile ()
void PrepareRow ()
void ProcessHeader (TObject *obj)
void ProcessBlock (TObject *obj)
void EndSubRun ()
void WriteSubRun ()
void Reset ()

Private Attributes

const Int_t NbConnMindersSpec
const Int_t NbConnMenusSpec
const Int_t NbConnMindersCal
const Int_t NbConnMenusCal
Int_t fDbiTaskNear
Int_t fWriteOutDatabaseVariables
Int_t fWriteToDatabase
Int_t fReadFromDatabase
TFile * fDatabaseFile
TTree * fDatabaseTree
TString fName
TString fOutputLocation
Int_t fRunElements [11]
Int_t fGoodRun
Int_t fCapidErrorCut
Int_t fParityErrorCut
Int_t fMiscountErrorCut
Int_t fPriorTruncErrorCut
Int_t fSameMenuErrorCut
Int_t fSharedMinderErrorCut
Int_t fTransfMinderErrorCut
Int_t fHighAdcCut
Int_t fHotLimitCal
Int_t fHotLimitSpec
Int_t fColdLimitCal
Int_t fColdLimitSpec
Int_t fTimeframeArrayCounter
Int_t fRecCounter
Int_t fCounter
Int_t fGoodCounter
Int_t fSnarls
Int_t fGoodSnarls
Int_t fTimeFrames
Int_t fSnarlRateMin
Int_t fSnarlRateMax
Float_t fSnarlRateMean
Float_t fSnarlRateMedian
Int_t * fSnarlRates
Int_t fTriggersPlane
Int_t fTriggersActivity
Int_t fTriggersSpill
Int_t fRun
Int_t fSubRun
Int_t fRunType
Int_t fTime
Int_t fTimeFrame
Int_t fSnarl
Int_t fTrigSrc
Int_t fDigits
Int_t fPhysicsRun
Int_t fModifiedRun
Int_t fTestRun
Int_t fStartTime
Int_t fEndTime
Int_t fSubrunLength
Int_t fTrigBaseTime
Int_t fTrigTime
Int_t fRopMask
Int_t fTriggerMask
Int_t fRate
Int_t fCrate
Int_t fMaster
Int_t fMinder
Int_t fMenu
Int_t fNearReadoutInt
Int_t fAdc
Int_t fTdc
Int_t fDeltatdc
Int_t fCratet0sec
Int_t fCratet0nsec
Int_t fDatatype
Int_t fErrorcode
NearReadoutfNearReadout
Int_t fMinTdc
Int_t fMaxTdc
Int_t fNbCratesReadout
Int_t fNTimeframesBadCrates
Int_t fMaxNbColdMindersCal
Int_t fMaxNbColdMindersSpec
Int_t fMaxNbColdCrates
Int_t fMaxNbColdMenusCal
Int_t fMaxNbColdMenusSpec
Int_t fMaxNbHotMenusSpec
Int_t fMaxNbHotMenusCal
fInstrumType_t fInstrumType
Int_t arrayColdMindersCal [8][16][8]
Int_t arrayColdMindersSpec [8][16][8]
Int_t * arrayTimeCountColdMindersSpec
Int_t * arrayTimeCountColdMenusSpec
Int_t * arrayTimeCountColdMindersCal
Int_t * arrayTimeCountColdMenusCal
Int_t * arrayTimeCountHotMenusSpec
Int_t * arrayTimeCountHotMenusCal
Int_t fTimeCountMaxHotMenusSpec
Int_t fTimeCountMaxHotMenusCal
Int_t fTimeCountMaxColdMenusSpec
Int_t fTimeCountMaxColdMenusCal
Int_t fTimeCountMaxColdMindersSpec
Int_t fTimeCountMaxColdMindersCal
Int_t vAdcPerSnarl [8][16][8][16]
Int_t vAverageAdc [8][16][8][16]
Int_t vCapidChannel [8][16][8][16]
Int_t vParityChannel [8][16][8][16]
Int_t vMisCntChannel [8][16][8][16]
Int_t vPrTruncChannel [8][16][8][16]
Int_t vCapMenuChannel [8][16][8][16]
Int_t vCapMindChannel [8][16][8][16]
Int_t vTransferChannel [8][16][8][16]
Int_t fNbLIChan
Float_t fLIRate
Int_t fHighAdcSpec
Int_t fHighAdcCal
Int_t fNbCapidSpec
Int_t fNbCapidCal
Int_t fNbParitySpec
Int_t fNbParityCal
Int_t fNbMisCountSpec
Int_t fNbMisCountCal
Int_t fNbPriorityTruncSpec
Int_t fNbPriorityTruncCal
Int_t fNbSameMenuSpec
Int_t fNbSameMenuCal
Int_t fNbSharedMinderSpec
Int_t fNbSharedMinderCal
Int_t fNbTransferMinderSpec
Int_t fNbTransferMinderCal
Int_t fLow
Int_t fLowCutoff
Int_t fHigh
Int_t fHighCutoff
Int_t cntLow
Int_t cntHigh
Int_t cntGate
Float_t fAvgLow
Float_t fAvgHigh
Float_t fAvgGate
Int_t fReadWrite

Detailed Description

Definition at line 23 of file FillNearRunQuality.h.


Member Enumeration Documentation

Enumerator:
kSpectrometer 
kCalorimeter 
kError 

Definition at line 164 of file FillNearRunQuality.h.

00164                      {
00165     kSpectrometer = 0,
00166     kCalorimeter = 1,
00167     kError = 3
00168   };


Constructor & Destructor Documentation

FillNearRunQuality::FillNearRunQuality (  ) 

Definition at line 65 of file FillNearRunQuality.cxx.

References Msg::kDebug, and MSG.

00065                                        :
00066 
00067   NbConnMindersSpec(50),
00068   NbConnMenusSpec(800),
00069   NbConnMindersCal(528),
00070   NbConnMenusCal(8448),
00071 
00072   fDbiTaskNear(1),
00073 
00074   fWriteOutDatabaseVariables(0),
00075   fWriteToDatabase(0),
00076   fReadFromDatabase(0),
00077   fDatabaseFile(0),
00078   fDatabaseTree(0),
00079   fName(""),
00080   fOutputLocation("."),
00081 
00082   fCapidErrorCut(100),
00083   fParityErrorCut(10),
00084   fMiscountErrorCut(10),
00085   fPriorTruncErrorCut(10),
00086   fSameMenuErrorCut(30),
00087   fSharedMinderErrorCut(10),
00088   fTransfMinderErrorCut(10),
00089   fHighAdcCut(1000),
00090   fHotLimitCal(1000),
00091   fHotLimitSpec(1000),
00092   fColdLimitCal(1),
00093   fColdLimitSpec(20),
00094   
00095   fTimeframeArrayCounter(30),
00096 
00097   fRecCounter(0),
00098   fCounter(-1),
00099   fGoodCounter(0),
00100   fSnarls(0),
00101   fGoodSnarls(0),
00102   fTimeFrames(0),
00103   fSnarlRateMin(-1),
00104   fSnarlRateMax(-1),
00105   fSnarlRateMean(-999.9),
00106   fSnarlRateMedian(-999.9),
00107   fTriggersPlane(0),
00108   fTriggersActivity(0),
00109   fTriggersSpill(0),
00110 
00111   fRun(-1),
00112   fSubRun(-1),
00113   fRunType(-1),
00114   fTime(-1),
00115   fTimeFrame(-1),
00116   fSnarl(0),
00117   fTrigSrc(-1),
00118   fDigits(-1),
00119   fPhysicsRun(-1),
00120   fModifiedRun(-1),
00121   fTestRun(-1),
00122   fStartTime(-1),
00123   fEndTime(-1),
00124   fSubrunLength(-1),
00125 
00126   fTrigBaseTime(-1),
00127   fTrigTime(-1),
00128   fRopMask(-1),
00129   fTriggerMask(-1),
00130   fRate(-1),
00131   fCrate(-1), 
00132   fMaster(-1),
00133   fMinder(-1),
00134   fMenu(-1),
00135   fNearReadoutInt(-1),
00136 
00137   fAdc(-1),
00138   fTdc(-1),
00139   fDeltatdc(-1),
00140   fCratet0sec(-1),
00141   fCratet0nsec(-1),
00142   fDatatype(-1),
00143   fErrorcode(-1),
00144 
00145   fMinTdc(0),
00146   fMaxTdc(0),
00147   
00148   fNbCratesReadout(0),
00149   fNTimeframesBadCrates(0),
00150   fMaxNbColdMindersCal(0),
00151   fMaxNbColdMindersSpec(0),
00152   fMaxNbColdCrates(0),
00153   fMaxNbColdMenusCal(0),
00154   fMaxNbColdMenusSpec(0),
00155   fMaxNbHotMenusSpec(0),
00156   fMaxNbHotMenusCal(0),
00157   fTimeCountMaxHotMenusSpec(0),
00158   fTimeCountMaxHotMenusCal(0),
00159   fTimeCountMaxColdMenusSpec(0),
00160   fTimeCountMaxColdMenusCal(0),
00161   fTimeCountMaxColdMindersSpec(0),
00162   fTimeCountMaxColdMindersCal(0),
00163 
00164   fNbLIChan(0),
00165   fLIRate(0.),
00166   fHighAdcSpec(0),
00167   fHighAdcCal(0),
00168   fNbCapidSpec(0),
00169   fNbCapidCal(0),
00170   fNbParitySpec(0),
00171   fNbParityCal(0),
00172   fNbMisCountSpec(0),
00173   fNbMisCountCal(0),
00174   fNbPriorityTruncSpec(0),
00175   fNbPriorityTruncCal(0),
00176   fNbSameMenuSpec(0),
00177   fNbSameMenuCal(0),
00178   fNbSharedMinderSpec(0),
00179   fNbSharedMinderCal(0),
00180   fNbTransferMinderSpec(0),
00181   fNbTransferMinderCal(0),
00182 
00183   fReadWrite(-1)
00184 {
00185   MSG("FillNearRunQuality",Msg::kDebug) << " *** FillNearRunQuality::FillNearRunQuality() *** " << endl;
00186   
00187   arrayTimeCountColdMindersSpec = new Int_t[NbConnMindersSpec];
00188   arrayTimeCountColdMenusSpec = new Int_t[NbConnMenusSpec];
00189   arrayTimeCountColdMindersCal = new Int_t[NbConnMindersCal];
00190   arrayTimeCountColdMenusCal = new Int_t[NbConnMenusCal];
00191   arrayTimeCountHotMenusSpec = new Int_t[NbConnMenusSpec];
00192   arrayTimeCountHotMenusCal = new Int_t[NbConnMenusCal];
00193 
00194   fSnarlRates = new Int_t[1001];
00195 
00196   fNearReadout = new NearReadout();
00197 
00198   this->Reset();
00199 }

FillNearRunQuality::~FillNearRunQuality (  ) 

Definition at line 202 of file FillNearRunQuality.cxx.

References arrayTimeCountColdMenusCal, arrayTimeCountColdMenusSpec, arrayTimeCountColdMindersCal, arrayTimeCountColdMindersSpec, arrayTimeCountHotMenusCal, arrayTimeCountHotMenusSpec, fNearReadout, fSnarlRates, Msg::kDebug, and MSG.

00203 {
00204   MSG("FillNearRunQuality",Msg::kDebug) << " *** FillNearRunQuality::~FillNearRunQuality() *** " << endl;
00205 
00206   delete[] fSnarlRates;
00207   if(fNearReadout) delete fNearReadout;
00208   delete[] arrayTimeCountColdMindersSpec;
00209   delete[] arrayTimeCountColdMenusSpec;
00210   delete[] arrayTimeCountColdMindersCal;
00211   delete[] arrayTimeCountColdMenusCal;
00212   delete[] arrayTimeCountHotMenusSpec;
00213   delete[] arrayTimeCountHotMenusCal;
00214 }


Member Function Documentation

JobCResult FillNearRunQuality::Ana ( const MomNavigator mom  )  [virtual]

Implement this for read only access to the MomNavigator

Reimplemented from JobCModule.

Definition at line 223 of file FillNearRunQuality.cxx.

References fPhysicsRun, MomNavigator::FragmentIter(), fRecCounter, RawRecord::GetRawBlockIter(), RawRecord::GetRawHeader(), RecMinosHdr::GetVldContext(), Msg::kDebug, JobCResult::kPassed, Msg::kWarning, MSG, ProcessBlock(), ProcessHeader(), and JobCResult::SetFailed().

00224 {
00225   MSG("FillNearRunQuality",Msg::kDebug) << " *** FillNearRunQuality::Ana(...) [" << fRecCounter << "] *** " << endl;
00226 
00227   JobCResult result(JobCResult::kPassed);
00228 
00229   VldContext vldc;
00230   TObject* momobject = 0;
00231   Bool_t   foundit   = 0;
00232 
00233   // ===================
00234   // PROCESS RAW RECORDS
00235   // ===================
00236   // Iterate over raw records in mom and extract
00237   // monitoring information from raw data blocks
00238 
00239   TIter momitr(mom->FragmentIter());
00240   while( (momobject = momitr()) ){
00241     if(momobject->InheritsFrom("RawRecord")){
00242       foundit = 1;
00243       fRecCounter++;
00244       MSG("FillNearRunQuality",Msg::kDebug) << "  *** RAW RECORD [" << fRecCounter << "] ***  " << endl;
00245       RawRecord* rawrec = dynamic_cast<RawRecord*>(momobject);
00246 
00247       // Get the raw header and extract validity context
00248       vldc = rawrec->GetRawHeader()->GetVldContext();
00249       this->ProcessHeader((TObject*)(rawrec->GetRawHeader()));
00250 
00251       // Iterate over the raw blocks in raw record
00252       // [Only analyse raw blocks for physics runs]
00253       TIter rawrecitr = rawrec->GetRawBlockIter();
00254       TObject* tob = 0;
00255       while((tob = rawrecitr())){
00256         MSG("FillNearRunQuality",Msg::kDebug) << " " << tob->GetName() << endl;
00257         if( fPhysicsRun>0 ) this->ProcessBlock(tob);
00258       }
00259     }
00260   }
00261 
00262   if (!foundit){
00263     MSG("FillNearRunQuality", Msg::kWarning) << "  *** FAILED TO FIND RAW RECORD ***  " << endl;
00264     return result.SetFailed();
00265   }
00266 
00267   MSG("FillNearRunQuality",Msg::kDebug) << " *** FillNearRunQuality::Ana( ) FINISHED *** " << endl;
00268   return result;
00269 
00270 }

void FillNearRunQuality::BeginJob ( void   )  [virtual]

Implement for notification of begin of job

Reimplemented from JobCModule.

Definition at line 217 of file FillNearRunQuality.cxx.

References Msg::kDebug, and MSG.

00218 {
00219   MSG("FillNearRunQuality",Msg::kDebug) << " *** FillNearRunQuality::BeginJob() *** " << endl;
00220 }

void FillNearRunQuality::Config ( const Registry r  )  [virtual]

Return the actual configuration. If your module directly pulls its configuration from the fConfig Registry, you don't need to override this. Override if you have local config variables.

Reimplemented from JobCModule.

Definition at line 319 of file FillNearRunQuality.cxx.

References fCapidErrorCut, fColdLimitCal, fColdLimitSpec, fDbiTaskNear, fHighAdcCut, fHotLimitCal, fHotLimitSpec, fMiscountErrorCut, fName, fOutputLocation, fParityErrorCut, fPriorTruncErrorCut, fReadFromDatabase, fSameMenuErrorCut, fSharedMinderErrorCut, fTimeframeArrayCounter, fTransfMinderErrorCut, fWriteOutDatabaseVariables, fWriteToDatabase, Registry::Get(), Msg::kDebug, and MSG.

00320 {
00321   MSG("FillNearRunQuality",Msg::kDebug) << " *** FillNearRunQuality::Config() *** " << endl;
00322 
00323   Int_t tmpint; 
00324   const char* tmpchar = 0;
00325 
00326   if(r.Get("DbiTaskNear",tmpint)) fDbiTaskNear = tmpint;
00327   if(r.Get("WriteOutDatabaseVariables",tmpint)) fWriteOutDatabaseVariables = tmpint;
00328   if(r.Get("WriteToDatabase", tmpint)) fWriteToDatabase = tmpint;
00329   if(r.Get("ReadFromDatabase", tmpint)) fReadFromDatabase = tmpint;
00330   if(r.Get("CapidErrorCut",tmpint)) fCapidErrorCut = tmpint;
00331   if(r.Get("ParityErrorCut",tmpint)) fParityErrorCut = tmpint;
00332   if(r.Get("MiscountErrorCut",tmpint)) fMiscountErrorCut = tmpint;
00333   if(r.Get("PriorTruncErrorCut",tmpint)) fPriorTruncErrorCut = tmpint;
00334   if(r.Get("SameMenuErrorCut",tmpint)) fSameMenuErrorCut = tmpint;
00335   if(r.Get("SharedMinderErrorCut",tmpint)) fSharedMinderErrorCut = tmpint;
00336   if(r.Get("TransfMinderErrorCut",tmpint)) fTransfMinderErrorCut = tmpint;
00337   if(r.Get("HighAdcCut",tmpint)) fHighAdcCut = tmpint;
00338   if(r.Get("Name",tmpchar)) fName = tmpchar;
00339   if(r.Get("OutputLocation",tmpchar)) fOutputLocation = tmpchar;
00340   if(r.Get("CalorimeterHotChannelLimit",tmpint)) fHotLimitCal = tmpint;
00341   if(r.Get("SpectrometerHotChannelLimit",tmpint)) fHotLimitSpec = tmpint;
00342   if(r.Get("CalorimeterColdChannelLimit",tmpint)) fColdLimitCal = tmpint;
00343   if(r.Get("SpectrometerColdChannelLimit",tmpint)) fColdLimitSpec = tmpint;
00344   if(r.Get("TimeframeCounter",tmpint)) fTimeframeArrayCounter = tmpint;
00345   return;
00346 }

const Registry & FillNearRunQuality::DefaultConfig ( void   )  const [virtual]

Get the default configuration registry. This should normally be overridden. One useful idiom is to implement it like:

const Registry& MyModule::DefaultConfig() const { static Registry cfg; // never is destroyed if (cfg.Size()) return cfg; // already filled it // set defaults: cfg.Set("TheAnswer",42); cfg.Set("Units","unknown"); return cfg; }

Reimplemented from JobCModule.

Definition at line 286 of file FillNearRunQuality.cxx.

References fCapidErrorCut, fColdLimitCal, fColdLimitSpec, fDbiTaskNear, fHighAdcCut, fHotLimitCal, fHotLimitSpec, fMiscountErrorCut, fName, fOutputLocation, fParityErrorCut, fPriorTruncErrorCut, fReadFromDatabase, fSameMenuErrorCut, fSharedMinderErrorCut, fTimeframeArrayCounter, fTransfMinderErrorCut, fWriteOutDatabaseVariables, fWriteToDatabase, Msg::kDebug, Registry::LockValues(), MSG, Registry::Set(), and Registry::UnLockValues().

00287 {
00288   MSG("FillNearRunQuality",Msg::kDebug) << " *** FillNearRunQuality::DefaultConfig() *** " << endl;
00289 
00290   static Registry r;
00291   r.SetName("FillNearRunQuality.config.default");
00292   r.UnLockValues();
00293   r.Set("DbiTaskNear",fDbiTaskNear);
00294   r.Set("WriteOutDatabaseVariables",fWriteOutDatabaseVariables);
00295   r.Set("WriteToDatabase", fWriteToDatabase);
00296   r.Set("ReadFromDatabase", fReadFromDatabase);
00297   r.Set("CapidErrorCut",fCapidErrorCut);
00298   r.Set("ParityErrorCut",fParityErrorCut);
00299   r.Set("MiscountErrorCut",fMiscountErrorCut);
00300   r.Set("PriorTruncErrorCut",fPriorTruncErrorCut);
00301   r.Set("SameMenuErrorCut",fSameMenuErrorCut);
00302   r.Set("SharedMinderErrorCut",fSharedMinderErrorCut);
00303   r.Set("TransfMinderErrorCut",fTransfMinderErrorCut);
00304   r.Set("CalorimeterHotChannelLimit",fHotLimitCal);
00305   r.Set("SpectrometerHotChannelLimit",fHotLimitSpec);
00306   r.Set("CalorimeterColdChannelLimit",fColdLimitCal);
00307   r.Set("SpectrometerColdChannelLimit",fColdLimitSpec);
00308   r.Set("HighAdcCut",fHighAdcCut);
00309   r.Set("Name",fName.Data());
00310   r.Set("OutputLocation",fOutputLocation.Data());
00311   r.Set("TimeframeCounter",fTimeframeArrayCounter);
00312   r.LockValues();
00313 
00314   return r;
00315 }

void FillNearRunQuality::EndJob (  )  [virtual]

Implement for notification of end of job

Reimplemented from JobCModule.

Definition at line 273 of file FillNearRunQuality.cxx.

References EndSubRun(), fWriteOutDatabaseVariables, Msg::kInfo, MSG, Reset(), and WriteOutFile().

00274 {
00275   MSG("FillNearRunQuality",Msg::kInfo) << " *** FillNearRunQuality::EndJob() *** " << endl;
00276 
00277   this->EndSubRun();
00278 
00279   if (fWriteOutDatabaseVariables) this->WriteOutFile();
00280 
00281   this->Reset();
00282 
00283 }

void FillNearRunQuality::EndSubRun (  )  [private]

Definition at line 1090 of file FillNearRunQuality.cxx.

References arrayTimeCountColdMenusCal, arrayTimeCountColdMenusSpec, arrayTimeCountColdMindersCal, arrayTimeCountColdMindersSpec, arrayTimeCountHotMenusCal, arrayTimeCountHotMenusSpec, cntGate, cntHigh, cntLow, fAvgGate, fAvgHigh, fAvgLow, fCapidErrorCut, fEndTime, fHigh, fHighAdcCal, fHighAdcCut, fHighAdcSpec, fHighCutoff, fLIRate, fLow, fLowCutoff, fMiscountErrorCut, fNbCapidCal, fNbCapidSpec, fNbLIChan, fNbMisCountCal, fNbMisCountSpec, fNbParityCal, fNbParitySpec, fNbPriorityTruncCal, fNbPriorityTruncSpec, fNbSameMenuCal, fNbSameMenuSpec, fNbSharedMinderCal, fNbSharedMinderSpec, fNbTransferMinderCal, fNbTransferMinderSpec, fParityErrorCut, fPhysicsRun, fPriorTruncErrorCut, fSameMenuErrorCut, fSharedMinderErrorCut, fSnarlRateMax, fSnarlRateMean, fSnarlRateMedian, fSnarlRateMin, fSnarlRates, fSnarls, fStartTime, fSubrunLength, fTimeCountMaxColdMenusCal, fTimeCountMaxColdMenusSpec, fTimeCountMaxColdMindersCal, fTimeCountMaxColdMindersSpec, fTimeCountMaxHotMenusCal, fTimeCountMaxHotMenusSpec, fTimeframeArrayCounter, fTimeFrames, fTransfMinderErrorCut, fTriggersActivity, fTriggersPlane, fTriggersSpill, Msg::kDebug, Msg::kInfo, Msg::kWarning, MSG, NbConnMenusCal, NbConnMenusSpec, NbConnMindersCal, NbConnMindersSpec, vAverageAdc, vCapidChannel, vCapMenuChannel, vCapMindChannel, vMisCntChannel, vParityChannel, vPrTruncChannel, vTransferChannel, and WriteSubRun().

Referenced by EndJob(), and ProcessHeader().

01091 {
01092   MSG("FillNearRunQuality",Msg::kInfo) << " *** FillNearRunQuality::EndSubRun() *** " << endl;
01093   MSG("FillNearRunQuality",Msg::kDebug) << "... EndSubRun : Calculate subrun variables..." << endl;
01094 
01095   // Abort non-physics runs
01096   // ======================
01097   if( fPhysicsRun<=0 ){
01098     MSG("FillNearRunQuality",Msg::kInfo) << "    EndSubRun : Not a physics run, RETURN" << endl;
01099     return;
01100   }
01101 
01102   // Duration of Subrun
01103   //===================
01104   fSubrunLength = fEndTime - fStartTime;
01105   MSG("FillNearRunQuality",Msg::kInfo) << " SUBRUN START TIME  : " << fStartTime << endl;
01106   MSG("FillNearRunQuality",Msg::kInfo) << " SUBRUN END TIME    : " << fEndTime << endl;
01107   MSG("FillNearRunQuality",Msg::kInfo) << " SUBRUN DURATION    : " << fSubrunLength << " s." << endl;
01108 
01109   // Mean and median snarl rates
01110   //============================
01111   if(fTimeFrames > 0){
01112     Int_t oldtotal = 0;
01113     Int_t newtotal = 0;
01114     Int_t middletotal = (Int_t)(0.5*fTimeFrames);
01115   
01116     for(Int_t i=0; i<1001; i++){
01117       oldtotal = newtotal;
01118       newtotal += fSnarlRates[i];
01119       if( oldtotal<=middletotal && middletotal<newtotal ){
01120         fSnarlRateMedian = (float)i - 0.5;
01121         if( newtotal-oldtotal>0 )
01122           fSnarlRateMedian += (float)(middletotal-oldtotal)/(float)(newtotal-oldtotal);
01123       }
01124     }
01125     if(fSnarlRateMedian < fSnarlRateMin) fSnarlRateMedian=fSnarlRateMin;
01126     if(fSnarlRateMedian > fSnarlRateMax) fSnarlRateMedian=fSnarlRateMax;
01127     fSnarlRateMean = ((float)(fSnarls))/((float)(fTimeFrames));
01128     MSG("FillNearRunQuality",Msg::kInfo) << endl << " SNARL RATES SUMMARY " << endl
01129          << "  MIN  : " << fSnarlRateMin << endl
01130          << "  MED  : " << fSnarlRateMedian << endl
01131          << "  MEAN : " << fSnarlRateMean << endl
01132          << "  MAX  : " << fSnarlRateMax << endl;
01133   }
01134 
01135   // Trigger Rate
01136   //=============
01137   MSG("FillNearRunQuality",Msg::kInfo) << endl << " TRIGGER SUMMARY " << endl
01138        << "  SGATE Triggers    : " << fTriggersSpill << endl
01139        << "  Plane Triggers    : " << fTriggersPlane << endl
01140        << "  Activity Triggers : " << fTriggersActivity << endl
01141        << "  Total Snarls      : " << fSnarls << endl;
01142 
01143   // LI Variables
01144   //=============
01145   if (fSubrunLength > 0) fLIRate = (Float_t)fNbLIChan / fSubrunLength;
01146   else fLIRate = 0.;
01147   MSG("FillNearRunQuality",Msg::kDebug) << endl << " LI RATE " << endl
01148        << fNbLIChan << " hits in the subrun, making an averaged frequency of " << fLIRate << " Hz" << endl;
01149   
01150   // Error Variables - see Config methods for cut values
01151   // High ADC Values
01152   //====================================================
01153   Float_t avgadc = 0.;
01154   Float_t caperr = fCapidErrorCut * fSubrunLength;
01155   Float_t parerr = fParityErrorCut* fSubrunLength;
01156   Float_t miserr = fMiscountErrorCut* fSubrunLength;
01157   Float_t trcerr = fPriorTruncErrorCut* fSubrunLength;
01158   Float_t menerr = fSameMenuErrorCut* fSubrunLength;
01159   Float_t minerr = fSharedMinderErrorCut* fSubrunLength;
01160   Float_t trserr = fTransfMinderErrorCut* fSubrunLength;
01161 
01162   for(int i=0; i<8; ++i)
01163     for(int j=0; j<16; ++j)
01164       for(int k=0; k<8; ++k)
01165         for(int l=0; l<16; ++l){
01166 
01167           // Inflate high-ADC cut for spectrometer, since these channels are multiplexed
01168           if(fTriggersSpill > 0) avgadc = (Float_t)vAverageAdc[i][j][k][l] / fTriggersSpill; 
01169           else                   avgadc = 0.0;
01170           if ( i<2 ) { if (avgadc > 2.5*fHighAdcCut) ++fHighAdcSpec; }
01171           else       { if (avgadc >     fHighAdcCut) ++fHighAdcCal;  }
01172 
01173           // Count up channels with readout errors
01174           if ( vCapidChannel[i][j][k][l] > caperr )  
01175             { if (i<2) ++fNbCapidSpec; else ++fNbCapidCal; }
01176           if ( vParityChannel[i][j][k][l] > parerr )   
01177             { if (i<2) ++fNbParitySpec; else ++fNbParityCal; }
01178           if ( vMisCntChannel[i][j][k][l] > miserr )   
01179             { if (i<2) ++fNbMisCountSpec; else ++fNbMisCountCal; }
01180           if ( vPrTruncChannel[i][j][k][l] > trcerr )  
01181             { if (i<2) ++fNbPriorityTruncSpec; else ++fNbPriorityTruncCal; }
01182           if ( vCapMenuChannel[i][j][k][l] > menerr )  
01183             { if (i<2) ++fNbSameMenuSpec; else ++fNbSameMenuCal; }
01184           if ( vCapMindChannel[i][j][k][l] > minerr )  
01185             { if (i<2) ++fNbSharedMinderSpec; else ++fNbSharedMinderCal; }
01186           if ( vTransferChannel[i][j][k][l] > trserr ) 
01187             { if (i<2) ++fNbTransferMinderSpec; else  ++fNbTransferMinderCal; }
01188         }
01189 
01190   MSG("FillNearRunQuality",Msg::kInfo) << endl << " ERROR SUMMARY" << endl
01191        << "  " << fNbCapidSpec+fNbCapidCal << " Channels with more than " 
01192        << fCapidErrorCut << " CAPID Errors" << endl
01193        << "  " << fNbParitySpec+fNbParityCal << " Channels with more than " 
01194        << fParityErrorCut << " Parity Errors." << endl
01195        << "  " << fNbMisCountSpec+fNbMisCountCal << " Channels with more than " 
01196        << fMiscountErrorCut << " MisCount Errors." << endl
01197        << "  " << fNbPriorityTruncSpec+fNbPriorityTruncCal << " Channels with more than " 
01198        << fPriorTruncErrorCut << " PriorityTruncate Errors." << endl
01199        << "  " << fNbSameMenuSpec+fNbSameMenuCal << " Channels with more than " 
01200        << fSameMenuErrorCut << " CapIdSameMenu Errors." << endl
01201        << "  " << fNbSharedMinderSpec+fNbSharedMinderCal << " Channels with more than " 
01202        << fSharedMinderErrorCut << " CapIdSharedMinder Errors." << endl
01203        << "  " << fNbTransferMinderSpec+fNbTransferMinderCal << " Channels with more than " 
01204        << fTransfMinderErrorCut << " TransferSharedMinder Errors." << endl;
01205 
01206   // Timing Variables
01207   //=================
01208   if( fLow-fLowCutoff>0 ) fAvgLow  = ((Float_t)cntLow)  / (fLow-fLowCutoff);
01209   if( fHighCutoff-fHigh>0 ) fAvgHigh = ((Float_t)cntHigh) / (fHighCutoff-fHigh);
01210   fAvgGate = ((Float_t)cntGate) / 520;   // 520 buckets = SGATE duration
01211   
01212 
01213   //Duration of Readout Problems
01214   //============================
01215   Int_t timeCounter = 0;
01216   
01217   //CALORIMETER
01218   //----------- 
01219   for(int i=(NbConnMenusCal-1);i>0;i--){
01220     timeCounter += arrayTimeCountColdMenusCal[i];    
01221     if(timeCounter>=fTimeframeArrayCounter){
01222       fTimeCountMaxColdMenusCal = i; break;} 
01223   }
01224   
01225   timeCounter = 0;
01226   for(int i=(NbConnMindersCal-1);i>0;i--){
01227     timeCounter += arrayTimeCountColdMindersCal[i];    
01228     if(timeCounter>=fTimeframeArrayCounter){fTimeCountMaxColdMindersCal = i; break;}
01229   }
01230 
01231   timeCounter = 0;
01232   for(int i=(NbConnMenusCal-1);i>0;i--){
01233     timeCounter += arrayTimeCountHotMenusCal[i];    
01234     if(timeCounter>=fTimeframeArrayCounter){
01235       fTimeCountMaxHotMenusCal = i; break;} 
01236   }
01237 
01238   //SPECTROMETER
01239   //------------
01240   timeCounter = 0;
01241   for(int i=(NbConnMenusSpec-1);i>0;i--){
01242     timeCounter += arrayTimeCountColdMenusSpec[i];    
01243     if(timeCounter>=fTimeframeArrayCounter){fTimeCountMaxColdMenusSpec = i; break;}
01244   }
01245 
01246   timeCounter = 0;
01247   for(int i=(NbConnMindersSpec-1);i>0;i--){
01248     timeCounter += arrayTimeCountColdMindersSpec[i];    
01249     if(timeCounter>=fTimeframeArrayCounter){fTimeCountMaxColdMindersSpec = i; break;}
01250   }
01251   
01252   timeCounter = 0;
01253   for(int i=799;i>0;i--){
01254     timeCounter += arrayTimeCountHotMenusSpec[i];    
01255     if(timeCounter>=fTimeframeArrayCounter){
01256       fTimeCountMaxHotMenusSpec = i; break;} 
01257   }
01258 
01259   // write variables to database
01260   // ===========================
01261   if( fStartTime>=0 && fEndTime>=0
01262    && fSubrunLength>0 && fTimeFrames>0 ){
01263     this->WriteSubRun();
01264   }
01265   else{
01266     MSG("FillNearRunQuality",Msg::kWarning) << " *** Run has no timeframes, no database entry will be created *** " << endl;
01267   }
01268 
01269   return;
01270 }

void FillNearRunQuality::PrepareRow (  )  [private]

Definition at line 609 of file FillNearRunQuality.cxx.

References fModifiedRun, fPhysicsRun, fRopMask, fRun, fRunElements, fSubRun, fSubrunLength, fTestRun, fTriggerMask, fTriggersActivity, fTriggersPlane, fTriggersSpill, Msg::kDebug, and MSG.

Referenced by WriteToDatabase().

00610 {
00611   MSG("FillNearRunQuality",Msg::kDebug) << " *** FillNearRunQuality::PrepareRow() *** " << endl;
00612 
00613   fRunElements[0] = fRun;
00614   fRunElements[1] = fSubRun;
00615   fRunElements[2] = fSubrunLength;
00616   fRunElements[3] = fPhysicsRun;
00617   fRunElements[4] = fModifiedRun;
00618   fRunElements[5] = fTestRun;
00619   fRunElements[6] = fTriggersPlane;
00620   fRunElements[7] = fTriggersActivity;
00621   fRunElements[8] = fTriggersSpill;
00622   fRunElements[9] = fRopMask;
00623   fRunElements[10] = fTriggerMask;
00624 }

void FillNearRunQuality::ProcessBlock ( TObject *  obj  )  [private]

Definition at line 740 of file FillNearRunQuality.cxx.

References arrayColdMindersCal, arrayColdMindersSpec, arrayTimeCountColdMenusCal, arrayTimeCountColdMenusSpec, arrayTimeCountColdMindersCal, arrayTimeCountColdMindersSpec, arrayTimeCountHotMenusCal, arrayTimeCountHotMenusSpec, cntGate, cntHigh, cntLow, NearReadout::ConnectedMinder(), fAdc, fColdLimitCal, fColdLimitSpec, fCrate, fCratet0nsec, fCratet0sec, fDatatype, fDeltatdc, fErrorcode, fHigh, fHighCutoff, fHotLimitCal, fHotLimitSpec, fInstrumType, fLow, fLowCutoff, fMaster, fMaxNbColdCrates, fMaxNbColdMenusCal, fMaxNbColdMenusSpec, fMaxNbColdMindersCal, fMaxNbColdMindersSpec, fMaxNbHotMenusCal, fMaxNbHotMenusSpec, fMaxTdc, fMenu, fMinder, fMinTdc, fNbCratesReadout, fNbLIChan, fNearReadout, fNearReadoutInt, fNTimeframesBadCrates, fPhysicsRun, fRate, fRopMask, fTdc, fTrigBaseTime, fTriggerMask, fTrigSrc, fTrigTime, RawConfigFilesBlock::GetConfigFile(), RawChannelId::GetCrate(), RawDigitDataBlock::GetDatumIter(), RawTpSinglesSummaryBlock::GetHitsPerSecByCrate(), RawChannelId::GetMaster(), RawChannelId::GetMenu(), RawChannelId::GetMinder(), VldTimeStamp::GetNanoSec(), RawTpSinglesSummaryBlock::GetNumberOfCrates(), RawTpSinglesSummaryBlock::GetRates(), RawRunConfigBlock::GetRunConfig(), RawTpSinglesSummaryBlock::GetSource(), VldContext::GetTimeStamp(), RawSnarlHeaderBlock::GetTriggerTime(), RawDaqHeaderBlock::GetVldContext(), kCalorimeter, RawQieDigit::kCapIdError, RawQieDigit::kCapIdSameMenuError, RawQieDigit::kCapIdSharedMinderError, Msg::kDebug, kError, Detector::kFar, RawQieDigit::kMisCountError, Detector::kNear, RawQieDigit::kParityError, RawQieDigit::kPriorityTruncate, kSpectrometer, RawQieDigit::kTransferSharedMinderError, Detector::kUnknown, Msg::kVerbose, MSG, n, vAverageAdc, vCapidChannel, vCapMenuChannel, vCapMindChannel, vMisCntChannel, vParityChannel, vPrTruncChannel, and vTransferChannel.

Referenced by Ana().

00741 {
00742 
00743   MSG("FillNearRunQuality",Msg::kDebug) << "*** ProcessBlock *** " << endl;
00744 
00745   // SKIP NON-PHYSICS RUNS
00746   // =====================
00747   if( fPhysicsRun<=0 ){
00748     MSG("FillNearRunQuality",Msg::kDebug) << "    ProcessBlock : Not a physics run, RETURN" << endl;
00749     return;
00750   }
00751 
00752   // HEADER BLOCKS
00753   // =============
00754   if(obj->InheritsFrom("RawDaqHeaderBlock")){
00755     MSG("FillNearRunQuality",Msg::kDebug) << " ... found RawDaqHeaderBlock " << endl;
00756     RawDaqHeaderBlock* rdb = (RawDaqHeaderBlock*)(obj);
00757     fTrigBaseTime = rdb->GetVldContext().GetTimeStamp().GetNanoSec();
00758   }
00759 
00760   // SNARL HEADER BLOCK
00761   // ==================
00762   if(obj->InheritsFrom("RawSnarlHeaderBlock")){
00763     MSG("FillNearRunQuality",Msg::kDebug) << " ... found RawSnarlHeaderBlock " << endl;
00764     RawSnarlHeaderBlock* rdb = (RawSnarlHeaderBlock*)(obj);
00765     fTrigTime = rdb->GetTriggerTime().GetNanoSec();
00766   }
00767 
00768   // RUN CONFIGURATION BLOCK
00769   // =======================
00770   if(obj->InheritsFrom("RawRunConfigBlock")){
00771     MSG("FillNearRunQuality",Msg::kDebug) << " ... found RawRunConfigBlock " << endl;
00772     RawRunConfigBlock* rdb = (RawRunConfigBlock*)(obj);
00773 
00774     char* config;
00775     config = (char*)(rdb->GetRunConfig());
00776 
00777     MSG("FillNearRunQuality",Msg::kVerbose) << " RUN_CONFIG_BLOCK: " << config << endl;
00778     
00779     char* word;
00780     int ctr = 0;
00781     bool cont = 1;
00782     word = strtok(config,";");
00783 
00784     while( cont ){
00785       MSG("FillNearRunQuality",Msg::kVerbose) << " (" << ctr << ") " << word << endl;
00786 
00787       // extract RopMask from run configuration
00788       if( strstr(word,"ropIdMask#") ){
00789         if( (word = strchr(word,'=')) ){
00790           if( strlen(word)>1 ){
00791             word=&(word[1]); 
00792             MSG("FillNearRunQuality",Msg::kVerbose) << " word=" << word << endl;
00793             if( fRopMask<0 ) fRopMask = strtol(word,&word,0);
00794           }
00795         }
00796       }
00797 
00798       // extract TriggerMask from  run configuration
00799       if( strstr(word,"triggerMask#") ){
00800         if( (word = strchr(word,'=')) ){
00801           if( strlen(word)>1 ){
00802             word=&(word[1]); 
00803             MSG("FillNearRunQuality",Msg::kVerbose) << " word=" << word << endl;
00804             if( fTriggerMask<0 ) fTriggerMask = strtol(word,&word,0);
00805           }
00806         }
00807       }
00808 
00809       cont = ( word = strtok(0,";") );
00810       ctr++;
00811     }
00812 
00813     // convert RopMask into CrateMask
00814     if( fRopMask>=0 ){
00815       Int_t cratemask = 0;
00816       for( Int_t n=0; n<16; n++){
00817         Int_t nbit = ( 1 << n );
00818         if( (fRopMask&nbit)==(nbit) ) cratemask++;
00819       }
00820       // (could record number of crates here)
00821       //fCrateMask = cratemask;
00822     }
00823 
00824     MSG("FillNearRunQuality",Msg::kDebug) << " RopMask=" << fRopMask << " TriggerMask=" << fTriggerMask << endl;
00825   }
00826 
00827   // RUN CONFIGURATION FILES
00828   // =======================
00829   if(obj->InheritsFrom("RawConfigFilesBlock")){
00830     MSG("FillNearRunQuality",Msg::kDebug) << " ... found RawConfigFilesBlock " << endl;
00831     RawConfigFilesBlock* rdb = (RawConfigFilesBlock*)(obj);
00832 
00833     char* config;
00834     config = (char*)(rdb->GetConfigFile()); 
00835 
00837     // MSG("FillNearRunQuality",Msg::kVerbose) << " RUN_CONFIG_FILE: " << config << endl;
00838   }
00839 
00840   // MONITORING BLOCKS
00841   // =================
00842   if(obj->InheritsFrom("RawTpSinglesSummaryBlock")){
00843 
00844     MSG("FillNearRunQuality",Msg::kDebug) << " ... found RawTpSinglesSummaryBlock " << endl;
00845     RawTpSinglesSummaryBlock* rdb = (RawTpSinglesSummaryBlock*)(obj);
00846     
00847     Int_t source = rdb->GetSource();
00848     Int_t sourcecheck = 0;
00849   
00850     Detector::Detector_t Detector = Detector::kUnknown;
00851     
00852     switch( source ){
00853     case 0: // Crate only
00854       Detector = Detector::kUnknown;
00855       break;
00856     case 1: // Crate and VARC (VA)
00857       Detector = Detector::kFar;
00858       break;
00859     case 2: // Crate and VFB/ADCSEL (VA)
00860       Detector = Detector::kFar;
00861       break;
00862     case 3: // Crate and VACHIP (VA)
00863       Detector = Detector::kFar;
00864       break;
00865     case 4: // Crate and Plane
00866       Detector = Detector::kUnknown;
00867       break;
00868     case 5: // Crate and MASTER (QIE)
00869       Detector = Detector::kNear;
00870       break;
00871     case 6: // Crate and MINDER (QIE)
00872       Detector = Detector::kNear;
00873       break;
00874     case 7: // Crate and MENU (QIE)
00875       Detector = Detector::kNear;
00876       sourcecheck = 1;
00877       break;
00878     default:
00879       break;
00880     }
00881     
00882     Int_t nbhotmenuscal = 0;
00883     Int_t nbhotmenusspec = 0;
00884 
00885     //Clear arrays to hold minders for this timeframe
00886     for(int i=0;i<8;i++){
00887       for(int j=0;j<16;j++){
00888         for(int k=0;k<8;k++){
00889           arrayColdMindersCal[i][j][k] = 0;
00890           arrayColdMindersSpec[i][j][k] = 0;
00891         }
00892       }
00893     }
00894     
00895     
00896     //Iterate over crates for crate rates
00897     fNbCratesReadout = 0;                     
00898     Int_t ncrates = rdb->GetNumberOfCrates();
00899 
00900     for(int i=0;i<ncrates;i++){
00901       Int_t craterate = rdb->GetHitsPerSecByCrate(i);
00902       if(craterate>0) fNbCratesReadout++;
00903     }
00904 
00905     
00906     // Iterate over raw channels for minders on/off per timeframe
00907     typedef std::map<RawChannelId,UInt_t> RCIdToRateMap;
00908     const RCIdToRateMap& rates = rdb->GetRates();
00909     RCIdToRateMap::const_iterator rateItr = rates.begin();
00910     RCIdToRateMap::const_iterator rateEnd = rates.end();
00911     
00912 
00913     //Perform the iteration
00914     //---------------------
00915     while(rateItr != rateEnd){
00916 
00917       RawChannelId rawch = rateItr->first;
00918       Int_t rawrate = rateItr->second;
00919       fRate   = rawrate;
00920       fCrate  = rawch.GetCrate();
00921       fMaster = rawch.GetMaster();
00922       fMinder = rawch.GetMinder();
00923       fMenu   = rawch.GetMenu();      
00924 
00925       fNearReadoutInt = fNearReadout->ConnectedMinder(fCrate,fMaster,fMinder);
00926 
00927       if(fCrate>1) fInstrumType = kCalorimeter;
00928       else if(fCrate<2) fInstrumType = kSpectrometer;
00929       else fInstrumType = kError;
00930             
00931       if(fNearReadoutInt==1){
00932 
00933         //Cold Channels
00934         //-------------
00935         if( (fInstrumType == kCalorimeter) && fRate < fColdLimitCal){        
00936           arrayColdMindersCal[fCrate][fMaster-9][fMinder]++;
00937         }
00938         if( (fInstrumType == kSpectrometer) && fRate < fColdLimitSpec){
00939           arrayColdMindersSpec[fCrate][fMaster-9][fMinder]++;
00940         }
00941         
00942         //Hot Channels
00943         //------------  
00944         if( (fInstrumType == kCalorimeter) && fRate>fHotLimitCal){
00945           nbhotmenuscal++;
00946         }  
00947         if( (fInstrumType == kSpectrometer) && fRate>fHotLimitSpec){
00948           nbhotmenusspec++;
00949         }
00950       }  
00951       rateItr++;
00952     }
00953 
00954     //Check crate readout status, if fewer than 8 set to bad
00955     if(fNbCratesReadout < 8){
00956       fNTimeframesBadCrates++;
00957     }
00958     
00959     if(( 8-fNbCratesReadout) > fMaxNbColdCrates) fMaxNbColdCrates = (8-fNbCratesReadout);
00960 
00961     
00962     Int_t nboffminders = 0;
00963     Int_t nboffchannelstotal = 0;
00964    
00965     //CALORIMETER
00966     //===========
00967     for(int i=0;i<8;i++){
00968       for(int j=0;j<16;j++){
00969         for(int k=0;k<8;k++){
00970           Int_t offchannels = arrayColdMindersCal[i][j][k];
00971           if(offchannels > 15) nboffminders++;
00972           nboffchannelstotal += offchannels;
00973         }
00974       }
00975     }
00976       
00977     if(nboffminders > fMaxNbColdMindersCal) fMaxNbColdMindersCal = nboffminders;
00978     if(nboffchannelstotal > fMaxNbColdMenusCal) fMaxNbColdMenusCal = nboffchannelstotal;
00979     arrayTimeCountColdMenusCal[nboffchannelstotal]++;
00980     arrayTimeCountColdMindersCal[nboffminders]++;
00981 
00982     if(nbhotmenuscal > fMaxNbHotMenusCal) fMaxNbHotMenusCal = nbhotmenuscal;
00983     arrayTimeCountHotMenusCal[nbhotmenuscal]++;  
00984 
00985 
00986     //SPECTROMETER
00987     //============
00988     nboffminders = 0;
00989     nboffchannelstotal = 0;
00990       
00991     for(int i=0;i<8;i++){
00992       for(int j=0;j<16;j++){
00993         for(int k=0;k<8;k++){
00994           Int_t offchannels = arrayColdMindersSpec[i][j][k];
00995           if(offchannels > 15) nboffminders++;
00996           nboffchannelstotal += offchannels;
00997         }
00998       }
00999     }
01000 
01001     if(nboffminders > fMaxNbColdMindersSpec) fMaxNbColdMindersSpec = nboffminders;
01002     if(nboffchannelstotal > fMaxNbColdMenusSpec) fMaxNbColdMenusSpec = nboffchannelstotal;
01003     arrayTimeCountColdMenusSpec[nboffchannelstotal]++;
01004     arrayTimeCountColdMindersSpec[nboffminders]++;
01005 
01006     if(nbhotmenusspec > fMaxNbHotMenusSpec) fMaxNbHotMenusSpec = nbhotmenusspec;
01007     arrayTimeCountHotMenusSpec[nbhotmenusspec]++;  
01008 
01009   } //END OF TPSINGLESBLOCK***
01010   
01011 
01012   // RAW DATA BLOCKS
01013   // ===============
01014   if(obj->InheritsFrom("RawDigitDataBlock")){
01015     MSG("FillNearRunQuality",Msg::kDebug) << " ... found RawDigitDataBlock " << endl;
01016     RawDigitDataBlock* rdb = (RawDigitDataBlock*)(obj);
01017 
01018     // Min and Max TDC
01019     // ===============
01020     //1055 buckets <=> ~20 microsec, normal max length of time window
01021     TIter digitr0 = rdb->GetDatumIter();
01022     Int_t tdc;
01023     Int_t mintdc = 100000000;
01024     Int_t maxtdc = 0;
01025     while(RawDigit *rd = (RawDigit*)(digitr0())){
01026       if (rd){
01027         tdc = (Int_t)(rd->GetTDC());
01028         if( tdc<mintdc ) mintdc = tdc;
01029         if( tdc>maxtdc ) maxtdc = tdc;
01030       }
01031     }
01032     fMinTdc = mintdc;
01033     fMaxTdc = maxtdc;
01034 
01035     // Iterate over raw digits
01036     // =======================    
01037     TIter digitr = rdb->GetDatumIter();
01038     while(RawDigit *rd = (RawDigit*)(digitr())){
01039       if(rd){
01040         // Get the data
01041         RawChannelId rawch = (RawChannelId)(rd->GetChannel());
01042         fCrate  = rawch.GetCrate();
01043         fMaster = rawch.GetMaster();
01044         fMinder = rawch.GetMinder();
01045         fMenu   = rawch.GetMenu();      
01046 
01047         fAdc = (Int_t)(rd->GetADC());
01048         fTdc = (Int_t)(rd->GetTDC());
01049         fErrorcode = (Int_t)(rd->GetErrorCode());
01050         fDeltatdc  = fTdc - fMinTdc; 
01051 
01052         fCratet0sec  = rd->GetCrateT0().GetSec();
01053         fCratet0nsec = rd->GetCrateT0().GetNanoSec();
01054         fDatatype    = rd->GetDataType();
01055 
01056         // Check the readout map
01057         fNearReadoutInt = fNearReadout->ConnectedMinder(fCrate,fMaster,fMinder);
01058 
01059         // ADC Rates
01060         if( (fAdc>100) && (fTrigSrc==65536) )  vAverageAdc[fCrate][fMaster-8][fMinder][fMenu] += fAdc;
01061 
01062         // LI TPMT hits show up in 0-16-0 (65536d = 16b = sgate trigger)
01063         if ( fTrigSrc==65536 &&  fCrate==0 && fMaster==16 && fMinder==0 ) fNbLIChan++;
01064 
01065         // Error counters
01066         if( (fErrorcode&0x01)==RawQieDigit::kParityError)  vParityChannel[fCrate][fMaster-8][fMinder][fMenu]++;
01067         if( (fErrorcode&0x02)==RawQieDigit::kCapIdError)   vCapidChannel[fCrate][fMaster-8][fMinder][fMenu]++;
01068         if( (fErrorcode&0x04)==RawQieDigit::kMisCountError) vMisCntChannel[fCrate][fMaster-8][fMinder][fMenu]++;
01069         if( (fErrorcode&0x08)==RawQieDigit::kPriorityTruncate) vPrTruncChannel[fCrate][fMaster-8][fMinder][fMenu]++;
01070         if( (fErrorcode&0x10)==RawQieDigit::kCapIdSameMenuError) vCapMenuChannel[fCrate][fMaster-8][fMinder][fMenu]++;
01071         if( (fErrorcode&0x20)==RawQieDigit::kCapIdSharedMinderError) vCapMindChannel[fCrate][fMaster-8][fMinder][fMenu]++;
01072         if( (fErrorcode&0x40)==RawQieDigit::kTransferSharedMinderError) vTransferChannel[fCrate][fMaster-8][fMinder][fMenu]++;
01073 
01074         // Timing counters, only for SGATE trigger (Reduce noise w/ cut on ADC)
01075         if ( (fTrigSrc==65536) && (fAdc>300) ){
01076           if ( fDeltatdc >= fLowCutoff
01077             && fDeltatdc < fLow ) cntLow++;
01078           else if ( fDeltatdc >= fLow 
01079                  && fDeltatdc < fHigh ) cntGate++;
01080           else if ( fDeltatdc >= fHigh
01081                  && fDeltatdc < fHighCutoff ) cntHigh++;
01082         }
01083       }
01084     }
01085   }  
01086   return;
01087 }

void FillNearRunQuality::ProcessHeader ( TObject *  obj  )  [private]

Definition at line 626 of file FillNearRunQuality.cxx.

References EndSubRun(), fCounter, fDigits, fEndTime, fGoodCounter, fGoodSnarls, fHigh, fHighCutoff, fLow, fLowCutoff, fModifiedRun, fPhysicsRun, fRun, fRunType, fSnarl, fSnarlRateMax, fSnarlRateMin, fSnarlRates, fSnarls, fStartTime, fSubRun, fTestRun, fTime, fTimeFrame, fTimeFrames, fTriggersActivity, fTriggersPlane, fTriggersSpill, fTrigSrc, RawDaqSnarlHeader::GetNumRawDigits(), RawDaqHeader::GetRun(), RawDaqHeader::GetRunType(), VldTimeStamp::GetSec(), RawDaqSnarlHeader::GetSnarl(), RawDaqHeader::GetSubRun(), RawDaqHeader::GetTimeFrameNum(), VldContext::GetTimeStamp(), RawDaqSnarlHeader::GetTrigSrc(), RecMinosHdr::GetVldContext(), Msg::kDebug, Msg::kInfo, MSG, Reset(), run(), RUN_TYPE_MASK_MODIFIED, RUN_TYPE_MASK_TEST, RUN_TYPE_PHYSICS, TRIGGER_BIT_ACTIVITY, TRIGGER_BIT_PLANE, and TRIGGER_BIT_SPILL.

Referenced by Ana().

00627 {
00628   MSG("FillNearRunQuality",Msg::kDebug) << "*** ProcessHeader *** " << endl;
00629 
00630   // DAQ HEADER
00631   // ==========
00632   if(obj->InheritsFrom("RawDaqHeader")){
00633     MSG("FillNearRunQuality",Msg::kDebug) << " ... found RawDaqHeader " << endl;
00634     RawDaqHeader* hdr = (RawDaqHeader*)(obj);
00635         
00636     Int_t time = hdr->GetVldContext().GetTimeStamp().GetSec();
00637     Int_t timeframe = hdr->GetTimeFrameNum();
00638     Int_t run       = hdr->GetRun();
00639     Int_t subrun    = hdr->GetSubRun();
00640     Int_t runtype   = hdr->GetRunType();
00641 
00642     // New Run/Subrun
00643     if(  (fRun >= 0 && fSubRun >= 0)
00644      && !(run == fRun && subrun == fSubRun)
00645      && !(run == fRun && fEndTime-fStartTime < 30) ) {
00646       MSG("FillNearRunQuality",Msg::kInfo) << "   closing: " << fRun << "/" << fSubRun << endl;
00647       this->EndSubRun();
00648       this->Reset();
00649     }
00650 
00651     // Record Run/Subrun
00652     if(fRun < 0 || fSubRun < 0){
00653        MSG("FillNearRunQuality",Msg::kInfo) << "   opening: " << run << "/" << subrun << endl;
00654        fRun = run;
00655        fSubRun = subrun;
00656        fRunType = runtype;
00657     }
00658 
00659     // Record Run Type
00660     if(fPhysicsRun < 0){
00661       if(fRun >= 0){
00662         fPhysicsRun = 0;
00663         fModifiedRun = 0;
00664         fTestRun = 0;
00665         if(fRunType >= 0){
00666           if( (fRunType == 2) ) fPhysicsRun = 1;
00667           if( (fRunType&RUN_TYPE_PHYSICS) == (RUN_TYPE_PHYSICS) ) fPhysicsRun = 1;
00668           if( (fRunType&RUN_TYPE_MASK_MODIFIED) == (RUN_TYPE_MASK_MODIFIED) ) fModifiedRun = 1;
00669           if( (fRunType&RUN_TYPE_MASK_TEST) == (RUN_TYPE_MASK_TEST) ) fTestRun = 1;
00670         }
00671       }
00672       MSG("FillNearRunQuality",Msg::kInfo) << "   physics run = " << fPhysicsRun << endl;
00673     }
00674 
00675     // Duration of subrun
00676     if(timeframe >= 0 && time != fTime){
00677       if(time > fTime){
00678         if(fStartTime < 0) fStartTime = time;
00679         if(fEndTime < time)  fEndTime = time;
00680         if(fCounter >= 0 ){
00681           if(fSnarlRateMin < 0 || fCounter < fSnarlRateMin) fSnarlRateMin = fCounter;
00682           if(fCounter > fSnarlRateMax) fSnarlRateMax = fCounter;
00683           if(fCounter > 1000) fCounter = 1000;
00684           fSnarls += fCounter;
00685           fGoodSnarls += fGoodCounter;
00686           fSnarlRates[fCounter]++;
00687           fTimeFrames++;
00688         }
00689       }
00690       fCounter = 0;
00691       fGoodCounter = 0;
00692       fTime = time;
00693       fTimeFrame = timeframe;
00694     }
00695 
00696     // Set Integration Limits for Timing Check
00697     Int_t limitRun = 7719; //set by D.Petyt on integration intervals of tdc spectra
00698     if (fRun < limitRun) {
00699       fLowCutoff = 0;
00700       fLow  = 20;
00701       fHigh = 540;
00702       fHighCutoff = 640;
00703     }
00704     else {
00705       fLowCutoff = 15;
00706       fLow  = 80;
00707       fHigh = 600;
00708       fHighCutoff = 700;
00709     }
00710   }
00711 
00712   // SNARL HEADER
00713   // ============
00714   if(obj->InheritsFrom("RawDaqSnarlHeader")){
00715     MSG("FillNearRunQuality",Msg::kDebug) << " ... found RawDaqSnarlHeader " << endl;
00716     RawDaqSnarlHeader* hdr = (RawDaqSnarlHeader*)(obj);
00717         
00718     fTrigSrc = hdr->GetTrigSrc();
00719     fSnarl   = hdr->GetSnarl(); 
00720     fDigits  = hdr->GetNumRawDigits();
00721 
00722     // Trigger Counters
00723     Bool_t good_trigger = 0;
00724     Bool_t plane_trigger = ( (fTrigSrc&TRIGGER_BIT_PLANE) == (TRIGGER_BIT_PLANE) );
00725     Bool_t activity_trigger = ( (fTrigSrc&TRIGGER_BIT_ACTIVITY) == (TRIGGER_BIT_ACTIVITY) );
00726     Bool_t spill_trigger = ( (fTrigSrc&TRIGGER_BIT_SPILL) == (TRIGGER_BIT_SPILL) );
00727 
00728     if(plane_trigger)   {good_trigger |= 1; fTriggersPlane++; }
00729     if(activity_trigger){good_trigger |= 1; fTriggersActivity++; }
00730     if(spill_trigger)   {good_trigger |= 1; fTriggersSpill++; }
00731 
00732     if(fCounter>=0){
00733       fCounter++;
00734       if (good_trigger) fGoodCounter++;
00735     }
00736   }
00737 }

void FillNearRunQuality::ReadFromDatabase (  )  [private]

Definition at line 476 of file FillNearRunQuality.cxx.

References fAvgGate, fAvgHigh, fAvgLow, fDbiTaskNear, fEndTime, fGoodRun, fHighAdcCal, fHighAdcSpec, fLIRate, fMaxNbColdCrates, fMaxNbColdMenusCal, fMaxNbColdMenusSpec, fMaxNbColdMindersCal, fMaxNbColdMindersSpec, fMaxNbHotMenusCal, fMaxNbHotMenusSpec, fModifiedRun, fNbCapidCal, fNbCapidSpec, fNbMisCountCal, fNbMisCountSpec, fNbParityCal, fNbParitySpec, fNbPriorityTruncCal, fNbPriorityTruncSpec, fNbSameMenuCal, fNbSameMenuSpec, fNbSharedMinderCal, fNbSharedMinderSpec, fNbTransferMinderCal, fNbTransferMinderSpec, fPhysicsRun, fRopMask, fRun, fSnarlRateMax, fSnarlRateMean, fSnarlRateMedian, fSnarlRateMin, fStartTime, fSubRun, fSubrunLength, fTestRun, fTimeCountMaxColdMenusCal, fTimeCountMaxColdMenusSpec, fTimeCountMaxColdMindersCal, fTimeCountMaxColdMindersSpec, fTimeCountMaxHotMenusCal, fTimeCountMaxHotMenusSpec, fTriggerMask, fTriggersActivity, fTriggersPlane, fTriggersSpill, DbuNearRunQuality::GetAvgGate(), DbuNearRunQuality::GetAvgHigh(), DbuNearRunQuality::GetAvgLow(), DbiTableProxyRegistry::GetCascader(), DbuNearRunQuality::GetColdCrates(), DbuNearRunQuality::GetColdMenusCal(), DbuNearRunQuality::GetColdMenusSpec(), DbuNearRunQuality::GetColdMindersCal(), DbuNearRunQuality::GetColdMindersSpec(), DbuNearRunQuality::GetEndTime(), DbuNearRunQuality::GetGoodRun(), DbuNearRunQuality::GetHighAdcCal(), DbuNearRunQuality::GetHighAdcSpec(), DbuNearRunQuality::GetHotMenusCal(), DbuNearRunQuality::GetHotMenusSpec(), DbuNearRunQuality::GetLIRate(), DbuNearRunQuality::GetModifiedRun(), DbuNearRunQuality::GetNbCapidCal(), DbuNearRunQuality::GetNbCapidSpec(), DbuNearRunQuality::GetNbMisCountCal(), DbuNearRunQuality::GetNbMisCountSpec(), DbuNearRunQuality::GetNbParityCal(), DbuNearRunQuality::GetNbParitySpec(), DbuNearRunQuality::GetNbPriorityTruncCal(), DbuNearRunQuality::GetNbPriorityTruncSpec(), DbuNearRunQuality::GetNbSameMenuCal(), DbuNearRunQuality::GetNbSameMenuSpec(), DbuNearRunQuality::GetNbSharedMinderCal(), DbuNearRunQuality::GetNbSharedMinderSpec(), DbuNearRunQuality::GetNbTransferMinderCal(), DbuNearRunQuality::GetNbTransferMinderSpec(), DbiResultPtr< T >::GetNumRows(), DbuNearRunQuality::GetPhysicsRun(), DbuNearRunQuality::GetRopMask(), DbiResultPtr< T >::GetRow(), DbuNearRunQuality::GetRun(), VldTimeStamp::GetSec(), DbuNearRunQuality::GetSnarlRateMax(), DbuNearRunQuality::GetSnarlRateMean(), DbuNearRunQuality::GetSnarlRateMedian(), DbuNearRunQuality::GetSnarlRateMin(), DbuNearRunQuality::GetStartTime(), DbuNearRunQuality::GetSubRun(), DbuNearRunQuality::GetSubrunLength(), DbuNearRunQuality::GetTestRun(), DbuNearRunQuality::GetTimeCountColdMenusCal(), DbuNearRunQuality::GetTimeCountColdMenusSpec(), DbuNearRunQuality::GetTimeCountColdMindersCal(), DbuNearRunQuality::GetTimeCountColdMindersSpec(), DbuNearRunQuality::GetTimeCountHotMenusCal(), DbuNearRunQuality::GetTimeCountHotMenusSpec(), DbuNearRunQuality::GetTriggerMask(), DbuNearRunQuality::GetTriggersActivity(), DbuNearRunQuality::GetTriggersPlane(), DbuNearRunQuality::GetTriggersSpill(), DbiTableProxyRegistry::Instance(), SimFlag::kData, Msg::kDebug, Detector::kNear, Msg::kVerbose, MSG, and DbiCascader::TableExists().

Referenced by WriteSubRun().

00477 {
00478   MSG("FillNearRunQuality",Msg::kDebug) << " *** FillNearRunQuality::ReadFromDatabase() *** " << endl;
00479 
00480   DbiCascader& cascader = DbiTableProxyRegistry::Instance().GetCascader();
00481 
00482   if( cascader.TableExists("DBUNEARRUNQUALITY") ){
00483     MSG("FillNearRunQuality",Msg::kVerbose) << "    Reading from DBUNEARRUNQUALITY table... " << endl;
00484     cout << "    Reading from DBUNEARRUNQUALITY table... " << endl;
00485     
00486     Int_t time = (Int_t)(0.5*((double)fStartTime+(double)fEndTime));
00487     VldTimeStamp timestamp(time,0);
00488     VldContext vldc(Detector::kNear,SimFlag::kData,timestamp);
00489     Dbi::Task task = fDbiTaskNear;
00490 
00491     DbiResultPtr<DbuNearRunQuality> resptr("DBUNEARRUNQUALITY",vldc,task);
00492 
00493     MSG("FillNearRunQuality",Msg::kVerbose) << "    Number Of Rows = " << resptr.GetNumRows() << endl;
00494 
00495     if( resptr.GetNumRows()>0 ){
00496       for( unsigned int i=0; i<resptr.GetNumRows(); i++){
00497         const DbuNearRunQuality* rowptr = resptr.GetRow(i);
00498         fRun = rowptr->GetRun();
00499         fSubRun = rowptr->GetSubRun();
00500         fStartTime = rowptr->GetStartTime().GetSec();
00501         fEndTime = rowptr->GetEndTime().GetSec(); 
00502         fSubrunLength = rowptr->GetSubrunLength();
00503         fPhysicsRun = rowptr->GetPhysicsRun();
00504         fModifiedRun = rowptr->GetModifiedRun();
00505         fTestRun = rowptr->GetTestRun();
00506         fTriggersPlane = rowptr->GetTriggersPlane();
00507         fTriggersActivity = rowptr->GetTriggersActivity();
00508         fTriggersSpill = rowptr->GetTriggersSpill();
00509         fRopMask = rowptr->GetRopMask();
00510         fTriggerMask = rowptr->GetTriggerMask();
00511         fMaxNbColdCrates = rowptr->GetColdCrates();
00512         fMaxNbColdMindersSpec = rowptr->GetColdMindersSpec();
00513         fMaxNbColdMenusSpec = rowptr->GetColdMenusSpec();
00514         fMaxNbColdMindersCal = rowptr->GetColdMindersCal();
00515         fMaxNbColdMenusCal = rowptr->GetColdMenusCal();
00516         fMaxNbHotMenusSpec = rowptr->GetHotMenusSpec();
00517         fMaxNbHotMenusCal = rowptr->GetHotMenusCal();
00518         fTimeCountMaxHotMenusSpec = rowptr->GetTimeCountHotMenusSpec();
00519         fTimeCountMaxHotMenusCal = rowptr->GetTimeCountHotMenusCal();
00520         fTimeCountMaxColdMenusSpec = rowptr->GetTimeCountColdMenusSpec();
00521         fTimeCountMaxColdMenusCal = rowptr->GetTimeCountColdMenusCal();
00522         fTimeCountMaxColdMindersSpec = rowptr->GetTimeCountColdMindersSpec();
00523         fTimeCountMaxColdMindersCal = rowptr->GetTimeCountColdMindersCal();
00524         fLIRate = rowptr->GetLIRate();
00525         fHighAdcSpec = rowptr->GetHighAdcSpec();
00526         fHighAdcCal = rowptr->GetHighAdcCal();
00527         fNbCapidSpec = rowptr->GetNbCapidSpec();
00528         fNbCapidCal = rowptr->GetNbCapidCal();
00529         fNbParitySpec = rowptr->GetNbParitySpec();
00530         fNbParityCal = rowptr->GetNbParityCal();
00531         fNbMisCountSpec = rowptr->GetNbMisCountSpec();
00532         fNbMisCountCal = rowptr->GetNbMisCountCal();
00533         fNbPriorityTruncSpec = rowptr->GetNbPriorityTruncSpec();
00534         fNbPriorityTruncCal = rowptr->GetNbPriorityTruncCal();
00535         fNbSameMenuSpec = rowptr->GetNbSameMenuSpec();
00536         fNbSameMenuCal = rowptr->GetNbSameMenuCal();
00537         fNbSharedMinderSpec = rowptr->GetNbSharedMinderSpec();
00538         fNbSharedMinderCal = rowptr->GetNbSharedMinderCal();
00539         fNbTransferMinderSpec = rowptr->GetNbTransferMinderSpec();
00540         fNbTransferMinderCal = rowptr->GetNbTransferMinderCal();
00541         fAvgLow = rowptr->GetAvgLow();
00542         fAvgHigh = rowptr->GetAvgHigh();
00543         fAvgGate = rowptr->GetAvgGate();
00544         fSnarlRateMin = rowptr->GetSnarlRateMin();
00545         fSnarlRateMax = rowptr->GetSnarlRateMax();
00546         fSnarlRateMedian = rowptr->GetSnarlRateMedian();
00547         fSnarlRateMean = rowptr->GetSnarlRateMean();
00548         fGoodRun = rowptr->GetGoodRun(fDbiTaskNear);
00549 
00550         MSG("FillNearRunQuality",Msg::kDebug) << endl
00551                                           << " READING RESULTS: " << endl
00552                                           << " =============== " << endl
00553                                           << " Run=" << fRun << endl
00554                                           << " SubRun=" << fSubRun << endl
00555                                           << " StartTime=" << fStartTime << endl
00556                                           << " EndTime=" << fEndTime << endl
00557                                           << " SubRunLength=" << fSubrunLength << endl
00558                                           << " PhysicsRun=" << fPhysicsRun << endl
00559                                           << " ModifiedRun=" << fModifiedRun << endl
00560                                           << " TestRun=" << fTestRun << endl
00561                                           << " PlaneTriggers=" << fTriggersPlane << endl
00562                                           << " TriggerActivity=" << fTriggersActivity<< endl
00563                                           << " SpillTriggers=" << fTriggersSpill << endl
00564                                           << " RopMask=" << fRopMask << endl
00565                                           << " TriggerMask=" << fTriggerMask << endl
00566                                           << " ColdCrates=" << fMaxNbColdCrates<< endl
00567                                           << " ColdMindersSpec=" << fMaxNbColdMindersSpec<< endl
00568                                           << " ColdMenusSpec=" << fMaxNbColdMenusSpec<< endl
00569                                           << " ColdMindersCal=" << fMaxNbColdMindersCal<< endl
00570                                           << " ColdMenusCal=" << fMaxNbColdMenusCal << endl
00571                                           << " HotMenusSpec=" << fMaxNbHotMenusSpec << endl
00572                                           << " HotMenusCal=" << fMaxNbHotMenusCal << endl
00573                                           << " TimeCountHotMenusSpec=" << fTimeCountMaxHotMenusSpec << endl
00574                                           << " TimeCountHotMenusCal=" << fTimeCountMaxHotMenusCal << endl
00575                                           << " TimeCountColdMenusSpec=" << fTimeCountMaxColdMenusSpec << endl
00576                                           << " TimeCountColdMenusCal=" << fTimeCountMaxColdMenusCal << endl
00577                                           << " TimeCountColdMindersSpec=" << fTimeCountMaxColdMindersSpec << endl
00578                                           << " TimeCountColdMindersCal=" << fTimeCountMaxColdMindersCal << endl
00579                                           << " LIRate=" << fLIRate << endl
00580                                           << " HighAdcSpec=" << fHighAdcSpec << endl
00581                                           << " HighAdcCal=" << fHighAdcCal << endl
00582                                           << " CapidSpec=" << fNbCapidSpec << endl
00583                                           << " CapidCal=" << fNbCapidCal << endl
00584                                           << " ParitySpec=" << fNbParitySpec << endl
00585                                           << " ParityCal=" << fNbParityCal << endl
00586                                           << " MisCountSpec=" << fNbMisCountSpec << endl
00587                                           << " MisCountCal=" << fNbMisCountCal << endl
00588                                           << " PriorityTruncSpec=" << fNbPriorityTruncSpec << endl
00589                                           << " PriorityTruncCal=" << fNbPriorityTruncCal << endl
00590                                           << " SameMenuSpec=" << fNbSameMenuSpec << endl
00591                                           << " SameMenuCal=" << fNbSameMenuCal << endl
00592                                           << " SharedMinderSpec=" << fNbSharedMinderSpec << endl      
00593                                           << " SharedMinderCal=" << fNbSharedMinderCal << endl
00594                                           << " TransferMinderSpec=" << fNbTransferMinderSpec << endl
00595                                           << " TransferMinderCal=" << fNbTransferMinderCal << endl
00596                                           << " AvgLow=" << fAvgLow << endl
00597                                           << " AvgHigh=" << fAvgHigh << endl
00598                                           << " AvgGate=" << fAvgGate << endl 
00599                                           << " MinSnarlRate=" << fSnarlRateMin << endl
00600                                           << " MaxSnarlRate=" << fSnarlRateMax << endl
00601                                           << " MedianSnarlRate=" << fSnarlRateMedian << endl
00602                                           << " MeanSnarlRate=" << fSnarlRateMean << endl                                          
00603                                           << " GoodRun=" << fGoodRun << endl;
00604       }
00605     }
00606   }
00607 }

void FillNearRunQuality::Reset (  )  [private, virtual]

Implement to reset oneself

Reimplemented from JobCModule.

Definition at line 1404 of file FillNearRunQuality.cxx.

References arrayColdMindersCal, arrayColdMindersSpec, arrayTimeCountColdMenusCal, arrayTimeCountColdMenusSpec, arrayTimeCountColdMindersCal, arrayTimeCountColdMindersSpec, arrayTimeCountHotMenusCal, arrayTimeCountHotMenusSpec, cntGate, cntHigh, cntLow, fAdc, fCapidErrorCut, fCounter, fCrate, fCratet0nsec, fCratet0sec, fDatabaseFile, fDatabaseTree, fDatatype, fDeltatdc, fDigits, fEndTime, fErrorcode, fGoodCounter, fGoodSnarls, fHigh, fHighAdcCal, fHighAdcCut, fHighAdcSpec, fHighCutoff, fInstrumType, fLIRate, fLow, fLowCutoff, fMaster, fMaxNbColdCrates, fMaxNbColdMenusCal, fMaxNbColdMenusSpec, fMaxNbColdMindersCal, fMaxNbColdMindersSpec, fMaxNbHotMenusCal, fMaxNbHotMenusSpec, fMaxTdc, fMenu, fMinder, fMinTdc, fMiscountErrorCut, fModifiedRun, fName, fNbCapidCal, fNbCapidSpec, fNbCratesReadout, fNbLIChan, fNbMisCountCal, fNbMisCountSpec, fNbParityCal, fNbParitySpec, fNbPriorityTruncCal, fNbPriorityTruncSpec, fNbSameMenuCal, fNbSameMenuSpec, fNbSharedMinderCal, fNbSharedMinderSpec, fNbTransferMinderCal, fNbTransferMinderSpec, fNearReadoutInt, fNTimeframesBadCrates, fOutputLocation, fParityErrorCut, fPhysicsRun, fPriorTruncErrorCut, fRate, fRecCounter, fRopMask, fRun, fRunType, fSameMenuErrorCut, fSharedMinderErrorCut, fSnarl, fSnarlRateMax, fSnarlRateMean, fSnarlRateMedian, fSnarlRateMin, fSnarlRates, fSnarls, fStartTime, fSubRun, fSubrunLength, fTdc, fTestRun, fTime, fTimeCountMaxColdMenusCal, fTimeCountMaxColdMenusSpec, fTimeCountMaxColdMindersCal, fTimeCountMaxColdMindersSpec, fTimeCountMaxHotMenusCal, fTimeCountMaxHotMenusSpec, fTimeFrame, fTimeFrames, fTransfMinderErrorCut, fTrigBaseTime, fTriggerMask, fTriggersActivity, fTriggersPlane, fTriggersSpill, fTrigSrc, fTrigTime, fWriteOutDatabaseVariables, kError, Msg::kInfo, MSG, NbConnMenusCal, NbConnMenusSpec, NbConnMindersCal, NbConnMindersSpec, vAdcPerSnarl, vAverageAdc, vCapidChannel, vCapMenuChannel, vCapMindChannel, vMisCntChannel, vParityChannel, vPrTruncChannel, and vTransferChannel.

Referenced by EndJob(), and ProcessHeader().

01405 {
01406   MSG("FillNearRunQuality",Msg::kInfo) << " *** FillNearRunQuality::Reset() *** " << endl;
01407 
01408   fWriteOutDatabaseVariables = 0;
01409   fDatabaseFile = 0;
01410   fDatabaseTree = 0;
01411   fName = "";
01412   fOutputLocation = ".";
01413   fCapidErrorCut = 100;
01414   fParityErrorCut = 10;
01415   fMiscountErrorCut = 10;
01416   fPriorTruncErrorCut = 10;
01417   fSameMenuErrorCut = 30;
01418   fSharedMinderErrorCut = 10;
01419   fTransfMinderErrorCut = 10;
01420   fHighAdcCut = 1000;
01421 
01422   fRecCounter = 0;
01423   fCounter = -1;
01424   fGoodCounter = 0;
01425   fSnarls = 0;
01426   fGoodSnarls = 0;
01427   fTimeFrames = 0;
01428   fSnarlRateMin = -1;
01429   fSnarlRateMax = -1;
01430   fSnarlRateMean = -999.9;
01431   fSnarlRateMedian = -999.9;
01432   fTriggersPlane = 0;
01433   fTriggersActivity = 0;
01434   fTriggersSpill = 0;
01435   fRopMask = -1;
01436   fTriggerMask = -1;
01437 
01438   fRun = -1;
01439   fSubRun = -1;
01440   fRunType = -1;
01441   fSnarl = 0;
01442   fTrigSrc = -1;
01443   fDigits = -1;
01444   fTrigTime = -1;
01445   fTrigBaseTime = -1;
01446   fTimeFrame = -1;
01447   fTime = -1;
01448   fAdc = -1;
01449   fTdc = -1;
01450   fDeltatdc = -1;
01451   fCrate = -1; 
01452   fMaster = -1;
01453   fMinder = -1;
01454   fMenu = -1;
01455   fCratet0sec = -1;
01456   fCratet0nsec = -1;
01457   fDatatype = -1;
01458   fErrorcode = -1;
01459   fRate = -1;
01460   fNearReadoutInt = -1;
01461   fRopMask = -1;
01462   fTriggerMask = -1;
01463 
01464   fPhysicsRun = -1;
01465   fModifiedRun = -1;
01466   fTestRun = -1;
01467   fStartTime = -1;
01468   fEndTime = -1;
01469   fSubrunLength = -1;
01470   fMinTdc = 0;
01471   fMaxTdc = 0;
01472 
01473   fNbCratesReadout = 0;
01474   fNTimeframesBadCrates = 0;
01475   fMaxNbColdMindersCal = 0;
01476   fMaxNbColdMindersSpec = 0;
01477   fMaxNbColdCrates = 0;
01478   fMaxNbColdMenusCal = 0;
01479   fMaxNbColdMenusSpec = 0;
01480   fInstrumType = kError;
01481   
01482   for(int i=0;i<8;i++){
01483     for(int j=0;j<16;j++){
01484       for(int k=0;k<8;k++){
01485         arrayColdMindersCal[i][j][k] = 0;
01486         arrayColdMindersSpec[i][j][k] = 0;
01487       }
01488     }
01489   }
01490   for(int i=0;i<NbConnMenusSpec;i++) arrayTimeCountColdMenusSpec[i] = 0;
01491   for(int i=0;i<NbConnMindersSpec;i++) arrayTimeCountColdMindersSpec[i] = 0;
01492   for(int i=0;i<NbConnMenusCal;i++) arrayTimeCountColdMenusCal[i] = 0;
01493   for(int i=0;i<NbConnMindersCal;i++) arrayTimeCountColdMindersCal[i] = 0;
01494   for(int i=0;i<NbConnMenusSpec;i++) arrayTimeCountHotMenusSpec[i] = 0;
01495   for(int i=0;i<NbConnMenusCal;i++) arrayTimeCountHotMenusCal[i] = 0;
01496 
01497 
01498   fMaxNbHotMenusSpec = 0;
01499   fMaxNbHotMenusCal = 0;
01500   fTimeCountMaxHotMenusSpec = 0;
01501   fTimeCountMaxHotMenusCal = 0;
01502   fTimeCountMaxColdMenusSpec = 0;
01503   fTimeCountMaxColdMenusCal = 0;
01504   fTimeCountMaxColdMindersSpec = 0;
01505   fTimeCountMaxColdMindersCal = 0;
01506 
01507   fNbLIChan = 0;
01508   fLIRate = 0.;
01509   fHighAdcSpec = 0;
01510   fHighAdcCal = 0;
01511   fNbCapidSpec = 0;
01512   fNbCapidCal = 0;
01513   fNbParitySpec = 0;
01514   fNbParityCal = 0;
01515   fNbMisCountSpec = 0;
01516   fNbMisCountCal = 0;
01517   fNbPriorityTruncSpec = 0;
01518   fNbPriorityTruncCal = 0;
01519   fNbSameMenuSpec = 0;
01520   fNbSameMenuCal = 0;
01521   fNbSharedMinderSpec = 0;
01522   fNbSharedMinderCal = 0;
01523   fNbTransferMinderSpec = 0;
01524   fNbTransferMinderCal = 0;
01525 
01526   fLowCutoff = 0;
01527   fLow = 0;
01528   fHigh = 0;
01529   fHighCutoff = 0;
01530 
01531   cntLow = 0;
01532   cntGate = 0;
01533   cntHigh = 0;
01534 
01535   for(int i=0; i<8; ++i)
01536     for(int j=0; j<16; ++j)
01537       for(int k=0; k<8; ++k)
01538         for(int l=0; l<16; ++l){
01539           vCapidChannel[i][j][k][l] = 0;
01540           vParityChannel[i][j][k][l] = 0;
01541           vMisCntChannel[i][j][k][l] = 0;
01542           vPrTruncChannel[i][j][k][l] = 0;
01543           vCapMenuChannel[i][j][k][l] = 0;
01544           vCapMindChannel[i][j][k][l] = 0;
01545           vTransferChannel[i][j][k][l] = 0;
01546           vAdcPerSnarl[i][j][k][l] = 0;
01547           vAverageAdc[i][j][k][l] = 0;
01548         }
01549 
01550   for(Int_t i=0; i<1001; i++){ fSnarlRates[i]=0; }
01551 }

void FillNearRunQuality::WriteOutDatabaseVariables (  )  [private]

Definition at line 1310 of file FillNearRunQuality.cxx.

References fAvgGate, fAvgHigh, fAvgLow, fDatabaseFile, fDatabaseTree, fEndTime, fHighAdcCal, fHighAdcSpec, fLIRate, fMaxNbColdCrates, fMaxNbColdMenusCal, fMaxNbColdMenusSpec, fMaxNbColdMindersCal, fMaxNbColdMindersSpec, fMaxNbHotMenusCal, fMaxNbHotMenusSpec, fModifiedRun, fName, fNbCapidCal, fNbCapidSpec, fNbMisCountCal, fNbMisCountSpec, fNbParityCal, fNbParitySpec, fNbPriorityTruncCal, fNbPriorityTruncSpec, fNbSameMenuCal, fNbSameMenuSpec, fNbSharedMinderCal, fNbSharedMinderSpec, fNbTransferMinderCal, fNbTransferMinderSpec, fOutputLocation, fPhysicsRun, fReadWrite, fRopMask, fRun, fSnarlRateMax, fSnarlRateMean, fSnarlRateMedian, fSnarlRateMin, fStartTime, fSubRun, fSubrunLength, fTestRun, fTimeCountMaxColdMenusCal, fTimeCountMaxColdMenusSpec, fTimeCountMaxColdMindersCal, fTimeCountMaxColdMindersSpec, fTimeCountMaxHotMenusCal, fTimeCountMaxHotMenusSpec, fTriggerMask, fTriggersActivity, fTriggersPlane, fTriggersSpill, Msg::kInfo, and MSG.

Referenced by WriteSubRun().

01311 {
01312   MSG("FillNearRunQuality",Msg::kInfo) << " *** FillNearRunQuality::WriteOutDatabaseVariables() *** " << endl; 
01313 
01314   if( !fDatabaseFile ){
01315     TDirectory* tmpd = gDirectory;
01316     TString filename(fOutputLocation.Data());
01317     filename.Append("/dataquality.databasevariables");
01318     if( fName.Length()>0 ){
01319       filename.Append(".");
01320       filename.Append(fName.Data());
01321     }
01322     filename.Append(".root");
01323     MSG("FillNearRunQuality",Msg::kInfo) << "   opening file: " << filename << endl;
01324     fDatabaseFile = new TFile(filename.Data(),"RECREATE");
01325     fDatabaseTree = new TTree("DatabaseVariables","DatabaseVariables");
01326     fDatabaseTree->SetAutoSave(100);
01327     fDatabaseTree->Branch("Run",&fRun,"Run/I");
01328     fDatabaseTree->Branch("Subrun",&fSubRun,"Subrun/I");
01329     fDatabaseTree->Branch("StartTime",&fStartTime,"StartTime/I");
01330     fDatabaseTree->Branch("EndTime",&fEndTime,"EndTime/I");
01331     fDatabaseTree->Branch("Duration",&fSubrunLength,"Duration/I");
01332     fDatabaseTree->Branch("PhysicsRun", &fPhysicsRun,"PhysicsRun/I");
01333     fDatabaseTree->Branch("ModifiedRun", &fModifiedRun,"ModifiedRun/I");
01334     fDatabaseTree->Branch("TestRun", &fTestRun,"TestRun/I");
01335     fDatabaseTree->Branch("TriggersPlane", &fTriggersPlane,"TriggersPlane/I");
01336     fDatabaseTree->Branch("TriggersActivity", &fTriggersActivity,"TriggersActivity/I");
01337     fDatabaseTree->Branch("TriggersSpill", &fTriggersSpill,"TriggersSpill/I");
01338     fDatabaseTree->Branch("RopMask",&fRopMask,"RopMask/I");
01339     fDatabaseTree->Branch("TriggerMask",&fTriggerMask,"TriggerMask/I");
01340     fDatabaseTree->Branch("ColdCrates",&fMaxNbColdCrates,"ColdCrates/I");
01341     fDatabaseTree->Branch("ColdMindersCal",&fMaxNbColdMindersCal,"ColdMindersCal/I");
01342     fDatabaseTree->Branch("ColdMindersSpec",&fMaxNbColdMindersSpec,"ColdMindersSpec/I");
01343     fDatabaseTree->Branch("ColdMenusCal",&fMaxNbColdMenusCal,"ColdMenusCal/I");
01344     fDatabaseTree->Branch("ColdMenusSpec",&fMaxNbColdMenusSpec,"ColdMenusSpec/I");
01345     fDatabaseTree->Branch("HotMenusCal",&fMaxNbHotMenusCal,"HotMenusCal/I");
01346     fDatabaseTree->Branch("HotMenusSpec",&fMaxNbHotMenusSpec,"HotMenusSpec/I");
01347     fDatabaseTree->Branch("TimeCountHotMenusSpec",&fTimeCountMaxHotMenusSpec,"TimeCountHotMenusSpec/I");
01348     fDatabaseTree->Branch("TimeCountHotMenusCal",&fTimeCountMaxHotMenusCal,"TimeCountHotMenusCal/I");
01349     fDatabaseTree->Branch("TimeCountColdMenusSpec",&fTimeCountMaxColdMenusSpec,"TimeCountColdMenusSpec/I");
01350     fDatabaseTree->Branch("TimeCountColdMenusCal",&fTimeCountMaxColdMenusCal,"TimeCountColdMenusCal/I");
01351     fDatabaseTree->Branch("TimeCountColdMindersSpec",&fTimeCountMaxColdMindersSpec,"TimeCountColdMindersSpec/I");
01352     fDatabaseTree->Branch("TimeCountColdMindersCal",&fTimeCountMaxColdMindersCal,"TimeCountColdMindersCal/I");
01353     fDatabaseTree->Branch("LIRate",&fLIRate,"LIRate/F");
01354     fDatabaseTree->Branch("HighAdcSpec",&fHighAdcSpec,"HighAdcSpec/I");
01355     fDatabaseTree->Branch("HighAdcCal",&fHighAdcCal,"HighAdcCal/I");
01356     fDatabaseTree->Branch("CapidSpec",&fNbCapidSpec,"CapidSpec/I");
01357     fDatabaseTree->Branch("CapidCal",&fNbCapidCal,"CapidCal/I");
01358     fDatabaseTree->Branch("ParitySpec",&fNbParitySpec,"ParitySpec/I");
01359     fDatabaseTree->Branch("ParityCal",&fNbParityCal,"ParityCal/I");
01360     fDatabaseTree->Branch("MiscountSpec",&fNbMisCountSpec,"MiscountSpec/I");
01361     fDatabaseTree->Branch("MiscountCal",&fNbMisCountCal,"MiscountCal/I");
01362     fDatabaseTree->Branch("PriorTruncSpec",&fNbPriorityTruncSpec,"PriorTruncSpec/I");
01363     fDatabaseTree->Branch("PriorTruncCal",&fNbPriorityTruncCal,"PriorTruncCal/I");
01364     fDatabaseTree->Branch("SameMenuSpec",&fNbSameMenuSpec,"SameMenuSpec/I");
01365     fDatabaseTree->Branch("SameMenuCal",&fNbSameMenuCal,"SameMenuCal/I");
01366     fDatabaseTree->Branch("SharedMinderSpec",&fNbSharedMinderSpec,"SharedMinderSpec/I");
01367     fDatabaseTree->Branch("SharedMinderCal",&fNbSharedMinderCal,"SharedMinderCal/I");
01368     fDatabaseTree->Branch("TransferMinderSpec",&fNbTransferMinderSpec,"TransferMinderSpec/I");
01369     fDatabaseTree->Branch("TransferMinderCal",&fNbTransferMinderCal,"TransferMinderCal/I");
01370     fDatabaseTree->Branch("TimingAvgLow",&fAvgLow,"TimingAvgLow/F");
01371     fDatabaseTree->Branch("TimingAvgHigh",&fAvgHigh,"TimingAvgHigh/F");
01372     fDatabaseTree->Branch("TimingAvgGate",&fAvgGate,"TimingAvgGate/F");
01373     fDatabaseTree->Branch("SnarlRateMin",&fSnarlRateMin,"SnarlRateMin/I");
01374     fDatabaseTree->Branch("SnarlRateMax",&fSnarlRateMax,"SnarlRateMax/I");
01375     fDatabaseTree->Branch("SnarlRateMedian",&fSnarlRateMedian,"SnarlRateMedian/F");
01376     fDatabaseTree->Branch("SnarlRateMean",&fSnarlRateMean,"SnarlRateMean/F");
01377     fDatabaseTree->Branch("ReadWrite",&fReadWrite,"ReadWrite/I");
01378     gDirectory = tmpd;
01379   }
01380 
01381   if( fDatabaseFile ){
01382     TDirectory* tmpd = gDirectory;
01383     fDatabaseFile->cd();
01384     fDatabaseTree->Fill();
01385     gDirectory = tmpd;
01386   }
01387 
01388   return;
01389 }

void FillNearRunQuality::WriteOutFile (  )  [private]

Definition at line 1391 of file FillNearRunQuality.cxx.

References fDatabaseFile, fDatabaseTree, Msg::kInfo, and MSG.

Referenced by EndJob().

01392 {
01393   if(fDatabaseFile){
01394     MSG("FillNearRunQuality",Msg::kInfo) << " *** FillNearRunQuality::WriteOutFile() *** " << endl;
01395     TDirectory* tmpd = gDirectory;
01396     fDatabaseFile->cd();
01397     fDatabaseTree->Write();
01398     fDatabaseFile->Close();
01399     gDirectory = tmpd;
01400     MSG("FillNearRunQuality",Msg::kInfo) << "   closing file. " << endl;
01401   }
01402 }

void FillNearRunQuality::WriteSubRun (  )  [private]

Definition at line 1273 of file FillNearRunQuality.cxx.

References fReadFromDatabase, fReadWrite, fWriteOutDatabaseVariables, fWriteToDatabase, Msg::kDebug, Msg::kInfo, MSG, ReadFromDatabase(), WriteOutDatabaseVariables(), and WriteToDatabase().

Referenced by EndSubRun().

01274 {
01275   MSG("FillNearRunQuality",Msg::kInfo) << endl << " *** FillNearRunQuality::WriteSubRun() *** " << endl;
01276 
01277   //Write database variables in root file
01278   //=====================================
01279   if( fWriteOutDatabaseVariables ) {
01280     fReadWrite = 0;
01281     this->WriteOutDatabaseVariables();
01282     MSG("FillNearRunQuality",Msg::kDebug) << endl << "... EndSubRun : Write ROOT file... End." << endl;
01283   }
01284 
01285   // write results to database
01286   // =========================
01287   if( fWriteToDatabase ){
01288     this->WriteToDatabase();
01289     MSG("FillNearRunQuality",Msg::kDebug) << endl << "... EndSubRun : Write To Database... End." << endl;
01290     //if( fWriteOutDatabaseVariables ) {
01291     //  fReadWrite = 1;
01292     //  this->WriteOutDatabaseVariables();
01293     //}
01294   }
01295     
01296   // read results from database
01297   // ==========================
01298   if( fReadFromDatabase ){
01299     this->ReadFromDatabase();
01300     MSG("FillNearRunQuality",Msg::kDebug) << endl << "... EndSubRun : Read From Database... End." << endl;
01301     //if( fWriteOutDatabaseVariables ) {
01302     //  fReadWrite = 2;
01303     //  this->WriteOutDatabaseVariables();
01304     //}
01305   }
01306 
01307 }

void FillNearRunQuality::WriteToDatabase (  )  [private]

Definition at line 348 of file FillNearRunQuality.cxx.

References DbiCascader::CreateTemporaryTable(), fAvgGate, fAvgHigh, fAvgLow, fDbiTaskNear, fEndTime, fGoodRun, fHighAdcCal, fHighAdcSpec, fLIRate, fMaxNbColdCrates, fMaxNbColdMenusCal, fMaxNbColdMenusSpec, fMaxNbColdMindersCal, fMaxNbColdMindersSpec, fMaxNbHotMenusCal, fMaxNbHotMenusSpec, fModifiedRun, fNbCapidCal, fNbCapidSpec, fNbMisCountCal, fNbMisCountSpec, fNbParityCal, fNbParitySpec, fNbPriorityTruncCal, fNbPriorityTruncSpec, fNbSameMenuCal, fNbSameMenuSpec, fNbSharedMinderCal, fNbSharedMinderSpec, fNbTransferMinderCal, fNbTransferMinderSpec, fPhysicsRun, fRopMask, fRun, fRunElements, fSnarlRateMax, fSnarlRateMean, fSnarlRateMedian, fSnarlRateMin, fStartTime, fSubRun, fSubrunLength, fTestRun, fTimeCountMaxColdMenusCal, fTimeCountMaxColdMenusSpec, fTimeCountMaxColdMindersCal, fTimeCountMaxColdMindersSpec, fTimeCountMaxHotMenusCal, fTimeCountMaxHotMenusSpec, fTriggerMask, fTriggersActivity, fTriggersPlane, fTriggersSpill, DbiTableProxyRegistry::GetCascader(), DbiTableProxyRegistry::Instance(), SimFlag::kData, Msg::kDebug, Detector::kNear, Msg::kVerbose, MSG, PrepareRow(), and DbiCascader::TableExists().

Referenced by WriteSubRun().

00349 {
00350   MSG("FillNearRunQuality",Msg::kDebug) << " *** FillNearRunQuality::WriteToDatabase() *** " << endl;
00351 
00352   DbiCascader& cascader = DbiTableProxyRegistry::Instance().GetCascader();
00353 
00354   // Create the table
00355   //=================
00356   if( !cascader.TableExists("DBUNEARRUNQUALITY") ){
00357     MSG("FillNearRunQuality",Msg::kDebug) << "    Creating temporary DBUNEARRUNQUALITY table " << endl;
00358 
00359     //change here
00360     string tableDescr = "(SEQNO int, RUN int, SUBRUN int, STARTTIME timestamp, ENDTIME timestamp, SUBRUNLENGTH int,  PHYSICSRUN int, MODIFIEDRUN int, TESTRUN int, TRIGGERSPLANE int, TRIGGERSACTIVITY int,  TRIGGERSSPILL int, ROPMASK int, TRIGGERMASK int, COLDCRATES int, COLDMINDERSSPEC int, COLDMENUSSPEC int, COLDMINDERSCAL int, COLDMENUSCAL int, HOTMENUSSPEC int, HOTMENUSCAL int, TIMECOUNTHOTMENUSSPEC int, TIMECOUNTHOTMENUSCAL int, TIMECOUNTCOLDMENUSSPEC int, TIMECOUNTCOLDMENUSCAL int, TIMECOUNTCOLDMINDERSSPEC int, TIMECOUNTCOLDMINDERSCAL int, LIRATE float, HIGHADCSPEC int, HIGHADCCAL int, NBCAPIDSPEC int, NBCAPIDCAL int, NBPARITYSPEC int, NBPARITYCAL int, NBMISCOUNTSPEC int, NBMISCOUNTCAL int, NBPRIORITYTRUNCSPEC int, NBPRIORITYTRUNCCAL int, NBSAMEMENUSPEC int, NBSAMEMENUCAL int, NBSHAREDMINDERSPEC int, NBSHAREDMINDERCAL int, NBTRANSFERMINDERSPEC int, NBTRANSFERMINDERCAL int, AVGLOW float, AVGHIGH float, AVGGATE float, SNARLRATEMIN int, SNARLRATEMAX int, SNARLRATEMEDIAN float, SNARLRATEMEAN float)";
00361 
00362     Int_t dbNoTempDb = cascader.CreateTemporaryTable("DBUNEARRUNQUALITY",tableDescr);
00363 
00364     MSG("FillNearRunQuality",Msg::kDebug) << "    DbNoTempDb=" << dbNoTempDb << endl;
00365   } 
00366 
00367 
00368   // The table exists, Create the entry
00369   //===================================
00370   if( cascader.TableExists("DBUNEARRUNQUALITY") ){
00371     MSG("FillNearRunQuality",Msg::kVerbose) << "    Writing to DBUNEARRUNQUALITY table... " << endl;
00372 
00373     this->PrepareRow();
00374 
00375     VldTimeStamp start(fStartTime,0);
00376     VldTimeStamp end(fEndTime+1,0);
00377     TString logentry("Run Quality (Run=");
00378     logentry+=fRun;
00379     logentry.Append("/");
00380     logentry+=fSubRun;
00381     logentry.Append(")");
00382 
00383     MSG("FillNearRunQuality",Msg::kVerbose) << "     run: " << fRun << "/" << fSubRun << endl; 
00384     MSG("FillNearRunQuality",Msg::kVerbose) << "     start time: " << start << endl;
00385     MSG("FillNearRunQuality",Msg::kVerbose) << "     end time: " << end << endl;
00386     MSG("FillNearRunQuality",Msg::kVerbose) << "     log entry: " << logentry.Data() << endl;
00387 
00388     VldRange range(Detector::kNear,SimFlag::kData,start,end,logentry.Data());
00389     
00390     DbuNearRunQuality row( fRunElements, start, end,
00391                            fMaxNbColdCrates, fMaxNbColdMindersSpec, fMaxNbColdMenusSpec,
00392                            fMaxNbColdMindersCal, fMaxNbColdMenusCal, fMaxNbHotMenusSpec,
00393                            fMaxNbHotMenusCal, fTimeCountMaxHotMenusSpec,
00394                            fTimeCountMaxHotMenusCal, fTimeCountMaxColdMenusSpec,
00395                            fTimeCountMaxColdMenusCal, fTimeCountMaxColdMindersSpec,
00396                            fTimeCountMaxColdMindersCal, fLIRate, fHighAdcSpec,
00397                            fHighAdcCal, fNbCapidSpec, fNbCapidCal,
00398                            fNbParitySpec, fNbParityCal, fNbMisCountSpec,
00399                            fNbMisCountCal, fNbPriorityTruncSpec,
00400                            fNbPriorityTruncCal, fNbSameMenuSpec,
00401                            fNbSameMenuCal, fNbSharedMinderSpec,
00402                            fNbSharedMinderCal, fNbTransferMinderSpec,
00403                            fNbTransferMinderCal, fAvgLow, fAvgHigh,
00404                            fAvgGate, fSnarlRateMin, fSnarlRateMax,
00405                            fSnarlRateMedian, fSnarlRateMean );
00406 
00407     fGoodRun = row.GetGoodRun(fDbiTaskNear);
00408 
00409     Int_t aggNo = row.GetAggregateNo();
00410     Dbi::Task task = fDbiTaskNear;
00411     VldTimeStamp creationDate;
00412 
00413     MSG("FillNearRunQuality",Msg::kVerbose) << "     aggNo: " << aggNo << " taskNo: " << task << endl;
00414 
00415     DbiWriter<DbuNearRunQuality> writer(range,aggNo,task,creationDate,0,logentry.Data());
00416     writer << row;
00417     writer.Close();
00418 
00419     MSG("FillNearRunQuality",Msg::kDebug) << endl
00420                                       << " WRITING RESULTS: " << endl
00421                                       << " =============== " << endl
00422                                       << " Run=" << fRun << endl
00423                                       << " SubRun=" << fSubRun << endl
00424                                       << " StartTime=" << fStartTime << endl
00425                                       << " EndTime=" << fEndTime << endl
00426                                       << " SubRunLength=" << fSubrunLength << endl
00427                                       << " PhysicsRun=" << fPhysicsRun << endl
00428                                       << " ModifiedRun=" << fModifiedRun << endl
00429                                       << " TestRun=" << fTestRun << endl
00430                                       << " PlaneTriggers=" << fTriggersPlane << endl
00431                                       << " TriggerActivity=" << fTriggersActivity<< endl
00432                                       << " SpillTriggers=" << fTriggersSpill << endl
00433                                       << " RopMask=" << fRopMask << endl
00434                                       << " TriggerMask=" << fTriggerMask << endl
00435                                       << " ColdCrates=" << fMaxNbColdCrates<< endl
00436                                       << " ColdMindersSpec=" << fMaxNbColdMindersSpec<< endl
00437                                       << " ColdMenusSpec=" << fMaxNbColdMenusSpec<< endl
00438                                       << " ColdMindersCal=" << fMaxNbColdMindersCal<< endl
00439                                       << " ColdMenusCal=" << fMaxNbColdMenusCal << endl
00440                                       << " HotMenusSpec=" << fMaxNbHotMenusSpec << endl
00441                                       << " HotMenusCal=" << fMaxNbHotMenusCal << endl
00442                                       << " TimeCountHotMenusSpec=" << fTimeCountMaxHotMenusSpec << endl
00443                                       << " TimeCountHotMenusCal=" << fTimeCountMaxHotMenusCal << endl
00444                                       << " TimeCountColdMenusSpec=" << fTimeCountMaxColdMenusSpec << endl
00445                                       << " TimeCountColdMenusCal=" << fTimeCountMaxColdMenusCal << endl
00446                                       << " TimeCountColdMindersSpec=" << fTimeCountMaxColdMindersSpec << endl
00447                                       << " TimeCountColdMindersCal=" << fTimeCountMaxColdMindersCal << endl
00448                                       << " LIRate=" << fLIRate << endl
00449                                       << " HighAdcSpec=" << fHighAdcSpec << endl
00450                                       << " HighAdcCal=" << fHighAdcCal << endl
00451                                       << " CapidSpec=" << fNbCapidSpec << endl
00452                                       << " CapidCal=" << fNbCapidCal << endl
00453                                       << " ParitySpec=" << fNbParitySpec << endl
00454                                       << " ParityCal=" << fNbParityCal << endl
00455                                       << " MisCountSpec=" << fNbMisCountSpec << endl
00456                                       << " MisCountCal=" << fNbMisCountCal << endl
00457                                       << " PriorityTruncSpec=" << fNbPriorityTruncSpec << endl
00458                                       << " PriorityTruncCal=" << fNbPriorityTruncCal << endl
00459                                       << " SameMenuSpec=" << fNbSameMenuSpec << endl
00460                                       << " SameMenuCal=" << fNbSameMenuCal << endl
00461                                       << " SharedMinderSpec=" << fNbSharedMinderSpec << endl      
00462                                       << " SharedMinderCal=" << fNbSharedMinderCal << endl
00463                                       << " TransferMinderSpec=" << fNbTransferMinderSpec << endl
00464                                       << " TransferMinderCal=" << fNbTransferMinderCal << endl
00465                                       << " AvgLow=" << fAvgLow << endl
00466                                       << " AvgHigh=" << fAvgHigh << endl
00467                                       << " AvgGate=" << fAvgGate << endl 
00468                                       << " MinSnarlRate=" << fSnarlRateMin << endl
00469                                       << " MaxSnarlRate=" << fSnarlRateMax << endl
00470                                       << " MedianSnarlRate=" << fSnarlRateMedian << endl
00471                                       << " MeanSnarlRate=" << fSnarlRateMean << endl                                              
00472                                       << " GoodRun=" << fGoodRun << endl;
00473   }
00474 }


Member Data Documentation

Int_t FillNearRunQuality::arrayColdMindersCal[8][16][8] [private]

Definition at line 171 of file FillNearRunQuality.h.

Referenced by ProcessBlock(), and Reset().

Int_t FillNearRunQuality::arrayColdMindersSpec[8][16][8] [private]

Definition at line 172 of file FillNearRunQuality.h.

Referenced by ProcessBlock(), and Reset().

Definition at line 176 of file FillNearRunQuality.h.

Referenced by EndSubRun(), ProcessBlock(), Reset(), and ~FillNearRunQuality().

Definition at line 174 of file FillNearRunQuality.h.

Referenced by EndSubRun(), ProcessBlock(), Reset(), and ~FillNearRunQuality().

Definition at line 175 of file FillNearRunQuality.h.

Referenced by EndSubRun(), ProcessBlock(), Reset(), and ~FillNearRunQuality().

Definition at line 173 of file FillNearRunQuality.h.

Referenced by EndSubRun(), ProcessBlock(), Reset(), and ~FillNearRunQuality().

Definition at line 178 of file FillNearRunQuality.h.

Referenced by EndSubRun(), ProcessBlock(), Reset(), and ~FillNearRunQuality().

Definition at line 177 of file FillNearRunQuality.h.

Referenced by EndSubRun(), ProcessBlock(), Reset(), and ~FillNearRunQuality().

Int_t FillNearRunQuality::cntGate [private]

Definition at line 222 of file FillNearRunQuality.h.

Referenced by EndSubRun(), ProcessBlock(), and Reset().

Int_t FillNearRunQuality::cntHigh [private]

Definition at line 221 of file FillNearRunQuality.h.

Referenced by EndSubRun(), ProcessBlock(), and Reset().

Int_t FillNearRunQuality::cntLow [private]

Definition at line 220 of file FillNearRunQuality.h.

Referenced by EndSubRun(), ProcessBlock(), and Reset().

Int_t FillNearRunQuality::fAdc [private]

Definition at line 140 of file FillNearRunQuality.h.

Referenced by ProcessBlock(), and Reset().

Float_t FillNearRunQuality::fAvgGate [private]
Float_t FillNearRunQuality::fAvgHigh [private]
Float_t FillNearRunQuality::fAvgLow [private]

Definition at line 77 of file FillNearRunQuality.h.

Referenced by Config(), DefaultConfig(), EndSubRun(), and Reset().

Definition at line 87 of file FillNearRunQuality.h.

Referenced by Config(), DefaultConfig(), and ProcessBlock().

Definition at line 88 of file FillNearRunQuality.h.

Referenced by Config(), DefaultConfig(), and ProcessBlock().

Definition at line 94 of file FillNearRunQuality.h.

Referenced by ProcessHeader(), and Reset().

Int_t FillNearRunQuality::fCrate [private]

Definition at line 134 of file FillNearRunQuality.h.

Referenced by ProcessBlock(), and Reset().

Definition at line 144 of file FillNearRunQuality.h.

Referenced by ProcessBlock(), and Reset().

Definition at line 143 of file FillNearRunQuality.h.

Referenced by ProcessBlock(), and Reset().

Definition at line 66 of file FillNearRunQuality.h.

Referenced by Reset(), WriteOutDatabaseVariables(), and WriteOutFile().

Definition at line 67 of file FillNearRunQuality.h.

Referenced by Reset(), WriteOutDatabaseVariables(), and WriteOutFile().

Definition at line 145 of file FillNearRunQuality.h.

Referenced by ProcessBlock(), and Reset().

Definition at line 58 of file FillNearRunQuality.h.

Referenced by Config(), DefaultConfig(), ReadFromDatabase(), and WriteToDatabase().

Definition at line 142 of file FillNearRunQuality.h.

Referenced by ProcessBlock(), and Reset().

Int_t FillNearRunQuality::fDigits [private]

Definition at line 118 of file FillNearRunQuality.h.

Referenced by ProcessHeader(), and Reset().

Definition at line 146 of file FillNearRunQuality.h.

Referenced by ProcessBlock(), and Reset().

Definition at line 95 of file FillNearRunQuality.h.

Referenced by ProcessHeader(), and Reset().

Definition at line 73 of file FillNearRunQuality.h.

Referenced by ReadFromDatabase(), and WriteToDatabase().

Definition at line 97 of file FillNearRunQuality.h.

Referenced by ProcessHeader(), and Reset().

Int_t FillNearRunQuality::fHigh [private]

Definition at line 218 of file FillNearRunQuality.h.

Referenced by EndSubRun(), ProcessBlock(), ProcessHeader(), and Reset().

Definition at line 84 of file FillNearRunQuality.h.

Referenced by Config(), DefaultConfig(), EndSubRun(), and Reset().

Definition at line 219 of file FillNearRunQuality.h.

Referenced by EndSubRun(), ProcessBlock(), ProcessHeader(), and Reset().

Definition at line 85 of file FillNearRunQuality.h.

Referenced by Config(), DefaultConfig(), and ProcessBlock().

Definition at line 86 of file FillNearRunQuality.h.

Referenced by Config(), DefaultConfig(), and ProcessBlock().

Definition at line 169 of file FillNearRunQuality.h.

Referenced by ProcessBlock(), and Reset().

Float_t FillNearRunQuality::fLIRate [private]
Int_t FillNearRunQuality::fLow [private]

Definition at line 216 of file FillNearRunQuality.h.

Referenced by EndSubRun(), ProcessBlock(), ProcessHeader(), and Reset().

Definition at line 217 of file FillNearRunQuality.h.

Referenced by EndSubRun(), ProcessBlock(), ProcessHeader(), and Reset().

Int_t FillNearRunQuality::fMaster [private]

Definition at line 135 of file FillNearRunQuality.h.

Referenced by ProcessBlock(), and Reset().

Int_t FillNearRunQuality::fMaxTdc [private]

Definition at line 151 of file FillNearRunQuality.h.

Referenced by ProcessBlock(), and Reset().

Int_t FillNearRunQuality::fMenu [private]

Definition at line 137 of file FillNearRunQuality.h.

Referenced by ProcessBlock(), and Reset().

Int_t FillNearRunQuality::fMinder [private]

Definition at line 136 of file FillNearRunQuality.h.

Referenced by ProcessBlock(), and Reset().

Int_t FillNearRunQuality::fMinTdc [private]

Definition at line 150 of file FillNearRunQuality.h.

Referenced by ProcessBlock(), and Reset().

Definition at line 79 of file FillNearRunQuality.h.

Referenced by Config(), DefaultConfig(), EndSubRun(), and Reset().

TString FillNearRunQuality::fName [private]

Reimplemented from JobCModule.

Definition at line 69 of file FillNearRunQuality.h.

Referenced by Config(), DefaultConfig(), Reset(), and WriteOutDatabaseVariables().

Definition at line 155 of file FillNearRunQuality.h.

Referenced by ProcessBlock(), and Reset().

Definition at line 197 of file FillNearRunQuality.h.

Referenced by EndSubRun(), ProcessBlock(), and Reset().

Definition at line 148 of file FillNearRunQuality.h.

Referenced by ProcessBlock(), and ~FillNearRunQuality().

Definition at line 138 of file FillNearRunQuality.h.

Referenced by ProcessBlock(), and Reset().

Definition at line 156 of file FillNearRunQuality.h.

Referenced by ProcessBlock(), and Reset().

Definition at line 70 of file FillNearRunQuality.h.

Referenced by Config(), DefaultConfig(), Reset(), and WriteOutDatabaseVariables().

Definition at line 78 of file FillNearRunQuality.h.

Referenced by Config(), DefaultConfig(), EndSubRun(), and Reset().

Definition at line 80 of file FillNearRunQuality.h.

Referenced by Config(), DefaultConfig(), EndSubRun(), and Reset().

Int_t FillNearRunQuality::fRate [private]

Definition at line 133 of file FillNearRunQuality.h.

Referenced by ProcessBlock(), and Reset().

Definition at line 64 of file FillNearRunQuality.h.

Referenced by Config(), DefaultConfig(), and WriteSubRun().

Definition at line 227 of file FillNearRunQuality.h.

Referenced by WriteOutDatabaseVariables(), and WriteSubRun().

Definition at line 93 of file FillNearRunQuality.h.

Referenced by Ana(), and Reset().

Int_t FillNearRunQuality::fRun [private]
Int_t FillNearRunQuality::fRunElements[11] [private]

Definition at line 72 of file FillNearRunQuality.h.

Referenced by PrepareRow(), and WriteToDatabase().

Definition at line 113 of file FillNearRunQuality.h.

Referenced by ProcessHeader(), and Reset().

Definition at line 81 of file FillNearRunQuality.h.

Referenced by Config(), DefaultConfig(), EndSubRun(), and Reset().

Definition at line 82 of file FillNearRunQuality.h.

Referenced by Config(), DefaultConfig(), EndSubRun(), and Reset().

Int_t FillNearRunQuality::fSnarl [private]

Definition at line 116 of file FillNearRunQuality.h.

Referenced by ProcessHeader(), and Reset().

Definition at line 103 of file FillNearRunQuality.h.

Referenced by EndSubRun(), ProcessHeader(), Reset(), and ~FillNearRunQuality().

Int_t FillNearRunQuality::fSnarls [private]

Definition at line 96 of file FillNearRunQuality.h.

Referenced by EndSubRun(), ProcessHeader(), and Reset().

Int_t FillNearRunQuality::fSubRun [private]
Int_t FillNearRunQuality::fTdc [private]

Definition at line 141 of file FillNearRunQuality.h.

Referenced by ProcessBlock(), and Reset().

Int_t FillNearRunQuality::fTime [private]

Definition at line 114 of file FillNearRunQuality.h.

Referenced by ProcessHeader(), and Reset().

Definition at line 115 of file FillNearRunQuality.h.

Referenced by ProcessHeader(), and Reset().

Definition at line 89 of file FillNearRunQuality.h.

Referenced by Config(), DefaultConfig(), and EndSubRun().

Definition at line 98 of file FillNearRunQuality.h.

Referenced by EndSubRun(), ProcessHeader(), and Reset().

Definition at line 83 of file FillNearRunQuality.h.

Referenced by Config(), DefaultConfig(), EndSubRun(), and Reset().

Definition at line 129 of file FillNearRunQuality.h.

Referenced by ProcessBlock(), and Reset().

Definition at line 117 of file FillNearRunQuality.h.

Referenced by ProcessBlock(), ProcessHeader(), and Reset().

Definition at line 130 of file FillNearRunQuality.h.

Referenced by ProcessBlock(), and Reset().

Definition at line 62 of file FillNearRunQuality.h.

Referenced by Config(), DefaultConfig(), EndJob(), Reset(), and WriteSubRun().

Definition at line 63 of file FillNearRunQuality.h.

Referenced by Config(), DefaultConfig(), and WriteSubRun().

const Int_t FillNearRunQuality::NbConnMenusCal [private]

Definition at line 54 of file FillNearRunQuality.h.

Referenced by EndSubRun(), and Reset().

const Int_t FillNearRunQuality::NbConnMenusSpec [private]

Definition at line 52 of file FillNearRunQuality.h.

Referenced by EndSubRun(), and Reset().

const Int_t FillNearRunQuality::NbConnMindersCal [private]

Definition at line 53 of file FillNearRunQuality.h.

Referenced by EndSubRun(), and Reset().

Definition at line 51 of file FillNearRunQuality.h.

Referenced by EndSubRun(), and Reset().

Int_t FillNearRunQuality::vAdcPerSnarl[8][16][8][16] [private]

Definition at line 188 of file FillNearRunQuality.h.

Referenced by Reset().

Int_t FillNearRunQuality::vAverageAdc[8][16][8][16] [private]

Definition at line 189 of file FillNearRunQuality.h.

Referenced by EndSubRun(), ProcessBlock(), and Reset().

Int_t FillNearRunQuality::vCapidChannel[8][16][8][16] [private]

Definition at line 190 of file FillNearRunQuality.h.

Referenced by EndSubRun(), ProcessBlock(), and Reset().

Int_t FillNearRunQuality::vCapMenuChannel[8][16][8][16] [private]

Definition at line 194 of file FillNearRunQuality.h.

Referenced by EndSubRun(), ProcessBlock(), and Reset().

Int_t FillNearRunQuality::vCapMindChannel[8][16][8][16] [private]

Definition at line 195 of file FillNearRunQuality.h.

Referenced by EndSubRun(), ProcessBlock(), and Reset().

Int_t FillNearRunQuality::vMisCntChannel[8][16][8][16] [private]

Definition at line 192 of file FillNearRunQuality.h.

Referenced by EndSubRun(), ProcessBlock(), and Reset().

Int_t FillNearRunQuality::vParityChannel[8][16][8][16] [private]

Definition at line 191 of file FillNearRunQuality.h.

Referenced by EndSubRun(), ProcessBlock(), and Reset().

Int_t FillNearRunQuality::vPrTruncChannel[8][16][8][16] [private]

Definition at line 193 of file FillNearRunQuality.h.

Referenced by EndSubRun(), ProcessBlock(), and Reset().

Int_t FillNearRunQuality::vTransferChannel[8][16][8][16] [private]

Definition at line 196 of file FillNearRunQuality.h.

Referenced by EndSubRun(), ProcessBlock(), and Reset().


The documentation for this class was generated from the following files:

Generated on 2 Nov 2017 for loon by  doxygen 1.6.1