FarDetDeadChipModule Class Reference

#include <FarDetDeadChipModule.h>

Inheritance diagram for FarDetDeadChipModule:
JobCModule

List of all members.

Public Member Functions

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

Private Attributes

TFile * fDeadChipFile
TTree * fDeadChipTree
Int_t date
Int_t time
Int_t run
Int_t snarl
Int_t crate
Int_t varc
Int_t vmm
Int_t vaadc
Int_t vachip
Int_t plane
Int_t shld
Int_t nanosec
Int_t status
Int_t fWriteBusyChips
Int_t fWriteColdChips
Int_t fWriteHotChips

Detailed Description

Definition at line 11 of file FarDetDeadChipModule.h.


Constructor & Destructor Documentation

FarDetDeadChipModule::FarDetDeadChipModule (  ) 

Definition at line 18 of file FarDetDeadChipModule.cxx.

00018                                            :
00019   fDeadChipFile(0),
00020   fDeadChipTree(0),
00021   fWriteBusyChips(0),
00022   fWriteColdChips(1),
00023   fWriteHotChips(1)
00024 {
00025 
00026 }

FarDetDeadChipModule::~FarDetDeadChipModule (  ) 

Definition at line 28 of file FarDetDeadChipModule.cxx.

00029 {
00030 
00031 }


Member Function Documentation

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

Implement this for read only access to the MomNavigator

Reimplemented from JobCModule.

Definition at line 38 of file FarDetDeadChipModule.cxx.

References crate, date, fDeadChipFile, fDeadChipTree, CandRecord::FindCandHandle(), fWriteBusyChips, fWriteColdChips, fWriteHotChips, FarDetDataQualityHandle::GetDate(), CandHandle::GetDaughterIterator(), MomNavigator::GetFragment(), FarDetDataQualityHandle::GetNanosec(), FarDetDataQualityHandle::GetRun(), FarDetDataQualityHandle::GetSnarl(), FarDetDataQualityHandle::GetTime(), VaChip::kBusy, VaChip::kCold, VaChip::kHot, Msg::kInfo, JobCResult::kPassed, MSG, nanosec, plane, run, shld, snarl, status, time, vaadc, vachip, varc, and vmm.

00039 {
00040   MSG("FarDetDeadChipModule",Msg::kInfo) << " *** FarDetDeadChipModule::Ana() *** " << endl;
00041   
00042   JobCResult result(JobCResult::kPassed);
00043 
00044   CandRecord* candrec = dynamic_cast<CandRecord*>(mom->GetFragment("CandRecord", "PrimaryCandidateRecord"));
00045   if( candrec ){
00046     FarDetDataQualityHandle* fardet = dynamic_cast<FarDetDataQualityHandle*>(candrec->FindCandHandle("FarDetDataQualityHandle"));
00047     if( fardet ){
00048 
00049       if( !fDeadChipFile ){
00050         // TString mystring("./results/fardet.deadchip");
00051         // mystring.Append("."); mystring+=fRun; 
00052         // mystring.Append(".root");
00053         TString mystring("fardet.deadchip.root");
00054         TDirectory* tmpddd = gDirectory;
00055         fDeadChipFile = new TFile(mystring.Data(),"RECREATE");
00056         fDeadChipTree = new TTree("DeadChipTree","DeadChipTree");
00057         fDeadChipTree->SetAutoSave(100);
00058         fDeadChipTree->Branch("date",&date,"date/I");
00059         fDeadChipTree->Branch("time",&time,"time/I");
00060         fDeadChipTree->Branch("run",&run,"run/I");
00061         fDeadChipTree->Branch("snarl",&snarl,"snarl/I");
00062         fDeadChipTree->Branch("crate",&crate,"crate/I");
00063         fDeadChipTree->Branch("varc",&varc,"varc/I");
00064         fDeadChipTree->Branch("vmm",&vmm,"vmm/I");
00065         fDeadChipTree->Branch("vaadc",&vaadc,"vaadc/I");
00066         fDeadChipTree->Branch("vachip",&vachip,"vachip/I");
00067         fDeadChipTree->Branch("plane",&plane,"plane/I");
00068         fDeadChipTree->Branch("shld",&shld,"shld/I");
00069         fDeadChipTree->Branch("nanosec",&nanosec,"nanosec/I");
00070         fDeadChipTree->Branch("status",&status,"status/I");
00071         gDirectory = tmpddd;
00072       }
00073 
00074 
00075       date=fardet->GetDate();
00076       time=fardet->GetTime();
00077       run=fardet->GetRun();
00078       snarl=fardet->GetSnarl();
00079 
00080       TIter chipitr(fardet->GetDaughterIterator());
00081       while(FarDetDeadChipHandle* deadchip = dynamic_cast<FarDetDeadChipHandle*>(chipitr())){
00082         crate=deadchip->GetCrate();
00083         varc=deadchip->GetVarc();
00084         vmm=deadchip->GetVmm();
00085         vaadc=deadchip->GetVaadc();
00086         vachip=deadchip->GetVaChip();
00087         plane=deadchip->GetPlane();
00088         shld=deadchip->GetShld();
00089         nanosec=deadchip->GetNanosec()-fardet->GetNanosec();
00090         status=0;
00091 
00092         if( fWriteBusyChips && deadchip->GetVaChipStatus()==VaChip::kBusy ){
00093           status=2;
00094           TDirectory* tmpddd = gDirectory;
00095           fDeadChipFile->cd();
00096           fDeadChipTree->Fill();
00097           gDirectory = tmpddd;
00098         }
00099 
00100         if( fWriteColdChips && deadchip->GetVaChipStatus()==VaChip::kCold ){
00101           status=4;
00102           TDirectory* tmpddd = gDirectory;
00103           fDeadChipFile->cd();
00104           fDeadChipTree->Fill();
00105           gDirectory = tmpddd;
00106         }
00107 
00108         if( fWriteHotChips && deadchip->GetVaChipStatus()==VaChip::kHot ){
00109           status=5;
00110           TDirectory* tmpddd = gDirectory;
00111           fDeadChipFile->cd();
00112           fDeadChipTree->Fill();
00113           gDirectory = tmpddd;
00114         }
00115 
00116       }
00117 
00118     }
00119   }
00120 
00121   return result;
00122 
00123 }

void FarDetDeadChipModule::BeginJob ( void   )  [virtual]

Implement for notification of begin of job

Reimplemented from JobCModule.

Definition at line 33 of file FarDetDeadChipModule.cxx.

References Msg::kInfo, and MSG.

00034 {
00035   MSG("FarDetDeadChipModule",Msg::kInfo) << " *** FarDetDeadChipModule::BeginJob() *** " << endl;
00036 }

void FarDetDeadChipModule::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 140 of file FarDetDeadChipModule.cxx.

References fWriteBusyChips, fWriteColdChips, fWriteHotChips, Registry::Get(), Msg::kInfo, and MSG.

00141 {
00142   MSG("FarDetDeadChipModule",Msg::kInfo) << " *** FarDetDeadChipModule::Config() *** " << endl;
00143                     
00144   Int_t tmpint;
00145                          
00146   if(r.Get("WriteBusyChips",tmpint)) fWriteBusyChips = tmpint;
00147   if(r.Get("WriteColdChips",tmpint)) fWriteColdChips = tmpint;
00148   if(r.Get("WriteHotChips",tmpint)) fWriteHotChips = tmpint;
00149 
00150   MSG("FarDetDeadChipModule",Msg::kInfo)
00151     << "  configuration: " << endl
00152     << "     WriteBusyChips=" << fWriteBusyChips << endl
00153     << "     WriteColdChips=" << fWriteColdChips << endl
00154     << "     WriteHotChips=" << fWriteHotChips << endl;
00155 
00156   return;
00157 }

const Registry & FarDetDeadChipModule::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 125 of file FarDetDeadChipModule.cxx.

References fWriteBusyChips, fWriteColdChips, fWriteHotChips, Msg::kInfo, Registry::LockValues(), MSG, Registry::Set(), and Registry::UnLockValues().

00126 {
00127   MSG("FarDetDeadChipModule",Msg::kInfo) << " *** FarDetDeadChipModule::DefaultConfig() *** " << endl;
00128 
00129   static Registry r;
00130   r.SetName("FarDetDeadChipModule.config.default");
00131   r.UnLockValues();
00132   r.Set("WriteBusyChips",fWriteBusyChips);
00133   r.Set("WriteColdChips",fWriteColdChips);
00134   r.Set("WriteHotChips",fWriteHotChips);
00135   r.LockValues();
00136 
00137   return r;
00138 }

void FarDetDeadChipModule::EndJob (  )  [virtual]

Implement for notification of end of job

Reimplemented from JobCModule.

Definition at line 160 of file FarDetDeadChipModule.cxx.

References fDeadChipFile, fDeadChipTree, Msg::kDebug, Msg::kInfo, and MSG.

00161 {
00162   MSG("FarDetDeadChipModule",Msg::kInfo) << " *** FarDetDeadChipModule::EndJob() *** " << endl;
00163 
00164   if(fDeadChipFile){
00165     MSG("FarDetDeadChipModule",Msg::kDebug) << " *** saving DEAD CHIP INFO to file *** " << endl;
00166     TDirectory* tmpddd = gDirectory;
00167     fDeadChipFile->cd();
00168     fDeadChipTree->Write();
00169     fDeadChipFile->Close();
00170     gDirectory = tmpddd;
00171     MSG("FarDetDeadChipModule",Msg::kDebug) << "    ... data saved to file " << endl;
00172   }
00173 
00174 }


Member Data Documentation

Int_t FarDetDeadChipModule::crate [private]

Definition at line 29 of file FarDetDeadChipModule.h.

Referenced by Ana().

Int_t FarDetDeadChipModule::date [private]

Definition at line 27 of file FarDetDeadChipModule.h.

Referenced by Ana().

Definition at line 24 of file FarDetDeadChipModule.h.

Referenced by Ana(), and EndJob().

Definition at line 25 of file FarDetDeadChipModule.h.

Referenced by Ana(), and EndJob().

Definition at line 34 of file FarDetDeadChipModule.h.

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

Definition at line 35 of file FarDetDeadChipModule.h.

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

Definition at line 36 of file FarDetDeadChipModule.h.

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

Definition at line 31 of file FarDetDeadChipModule.h.

Referenced by Ana().

Int_t FarDetDeadChipModule::plane [private]

Definition at line 30 of file FarDetDeadChipModule.h.

Referenced by Ana().

Int_t FarDetDeadChipModule::run [private]

Definition at line 28 of file FarDetDeadChipModule.h.

Referenced by Ana().

Int_t FarDetDeadChipModule::shld [private]

Definition at line 30 of file FarDetDeadChipModule.h.

Referenced by Ana().

Int_t FarDetDeadChipModule::snarl [private]

Definition at line 28 of file FarDetDeadChipModule.h.

Referenced by Ana().

Definition at line 32 of file FarDetDeadChipModule.h.

Referenced by Ana().

Int_t FarDetDeadChipModule::time [private]

Definition at line 27 of file FarDetDeadChipModule.h.

Referenced by Ana().

Int_t FarDetDeadChipModule::vaadc [private]

Definition at line 29 of file FarDetDeadChipModule.h.

Referenced by Ana().

Definition at line 29 of file FarDetDeadChipModule.h.

Referenced by Ana().

Int_t FarDetDeadChipModule::varc [private]

Definition at line 29 of file FarDetDeadChipModule.h.

Referenced by Ana().

Int_t FarDetDeadChipModule::vmm [private]

Definition at line 29 of file FarDetDeadChipModule.h.

Referenced by Ana().


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

Generated on 2 Nov 2017 for loon by  doxygen 1.6.1