CDPreFilterModule Class Reference

#include <CDPreFilterModule.h>

Inheritance diagram for CDPreFilterModule:
JobCModule

List of all members.

Public Member Functions

 CDPreFilterModule ()
 In the Handle Commands: off = 0; yes = 1; no = -1;.
JobCResult Ana (const MomNavigator *mom)
void Config (const Registry &r)
void EndJob ()
void HandleCommand (JobCommand *cmd)
const RegistryDefaultConfig () const

Private Member Functions

Bool_t FilterOnSnarlSize (const RawDigitDataBlock *rddb)
Bool_t FilterSnarlForErrors (const RawDigitDataBlock *rddb)
std::string GetCutStatus (Int_t cut) const
std::string GetErrorString () const
std::string Pct (Double_t top, Double_t bottom) const
void PrintFilterSummary () const
std::string SForm (Int_t number) const

Private Attributes

int fplanetrig
UInt_t fnplane
int fbeamonly
int fcerenkov
int fnodeadchips
int fli
int ftof
Int_t fNoNdErrors
Int_t fNoFdErrors
Int_t fBigSnarls
Int_t fPlaneTrigCounter
Int_t fBeamOnlyCounter
Int_t fCerenkovCounter
Int_t fNoDeadChipsCounter
Int_t fLiCounter
Int_t fTofCounter
Int_t fTotalFailedCounter
Int_t fTotalPassedCounter
Int_t fTotalInputCounter
Int_t fNoNdErrorsCounter
Int_t fNoFdErrorsCounter
Int_t fBigSnarlsCounter
Int_t fNdSnarlErrorCounter
Int_t fNdSnarlFFFFCounter
Int_t fFdSnarlErrorCounter
Int_t fDigitCounter
Int_t fNdDigitCounter
Int_t fFdDigitCounter
Int_t fNdDigitErrorCounter
Int_t fNdDigitFFFFCounter
Int_t fFdDigitErrorCounter
Int_t fNdParityErrorCounter
Int_t fNdCapIdErrorCounter
Int_t fNdMisCountErrorCounter
Int_t fNdPriorityTruncateCounter
Int_t fFdAdcNegativeCounter
Int_t fFdNonStdDataCounter
Int_t fFdWarningStateCounter
Int_t fFdParityErr0Counter
Int_t fFdParityErr1Counter
Int_t fFdWordBitErr0Counter
Int_t fFdWordBitErr1Counter
UInt_t fMinNumDigitsHit
UInt_t fMinNumChannelsHit
Detector::Detector_t fDetector

Detailed Description

Definition at line 23 of file CDPreFilterModule.h.


Constructor & Destructor Documentation

CDPreFilterModule::CDPreFilterModule (  ) 

In the Handle Commands: off = 0; yes = 1; no = -1;.

For all trigger flags: 0 = don't care, i.e. don't cut on it 1 = accept only if bit is set; -1 = accept only if bit is NOT set

Definition at line 42 of file CDPreFilterModule.cxx.

References fbeamonly, fBeamOnlyCounter, fBigSnarls, fBigSnarlsCounter, fcerenkov, fCerenkovCounter, fDetector, fDigitCounter, fFdAdcNegativeCounter, fFdDigitCounter, fFdDigitErrorCounter, fFdNonStdDataCounter, fFdParityErr0Counter, fFdParityErr1Counter, fFdSnarlErrorCounter, fFdWarningStateCounter, fFdWordBitErr0Counter, fFdWordBitErr1Counter, fli, fLiCounter, fMinNumChannelsHit, fMinNumDigitsHit, fNdCapIdErrorCounter, fNdDigitCounter, fNdDigitErrorCounter, fNdDigitFFFFCounter, fNdMisCountErrorCounter, fNdParityErrorCounter, fNdPriorityTruncateCounter, fNdSnarlErrorCounter, fNdSnarlFFFFCounter, fnodeadchips, fNoDeadChipsCounter, fNoFdErrors, fNoFdErrorsCounter, fNoNdErrors, fNoNdErrorsCounter, fnplane, fplanetrig, fPlaneTrigCounter, ftof, fTofCounter, fTotalFailedCounter, fTotalInputCounter, fTotalPassedCounter, and Detector::kUnknown.

00043 {
00044   //don't cut on any trigger bits by default
00045   fplanetrig=0;
00046   fnplane=0;
00047   fbeamonly=0;
00048   fcerenkov=0;
00049   fnodeadchips=0;
00050   fli=0;
00051   ftof=0;
00052   fNoNdErrors=0;
00053   fNoFdErrors=0;
00054   fBigSnarls=0;
00055 
00056   //initialise the counters
00057   fPlaneTrigCounter=0;
00058   fBeamOnlyCounter=0;
00059   fCerenkovCounter=0;
00060   fNoDeadChipsCounter=0;
00061   fLiCounter=0;
00062   fTofCounter=0;
00063   fTotalPassedCounter=0;
00064   fTotalFailedCounter=0;
00065   fTotalInputCounter=0;
00066   fNoNdErrorsCounter=0;
00067   fNoFdErrorsCounter=0;
00068   fBigSnarlsCounter=0;
00069 
00070   //error counters
00071   fNdSnarlErrorCounter=0;
00072   fNdSnarlFFFFCounter=0;
00073   fFdSnarlErrorCounter=0;
00074   fDigitCounter=0;
00075   fNdDigitCounter=0;
00076   fFdDigitCounter=0;
00077   fNdDigitErrorCounter=0;
00078   fNdDigitFFFFCounter=0;
00079   fFdDigitErrorCounter=0;
00080 
00081   //specific error counters
00082   fNdParityErrorCounter=0;
00083   fNdCapIdErrorCounter=0;
00084   fNdMisCountErrorCounter=0;
00085   fNdPriorityTruncateCounter=0;
00086   fFdAdcNegativeCounter=0;
00087   fFdNonStdDataCounter=0;
00088   fFdWarningStateCounter=0;
00089   fFdParityErr0Counter=0;
00090   fFdParityErr1Counter=0;
00091   fFdWordBitErr0Counter=0;
00092   fFdWordBitErr1Counter=0;
00093 
00094   //variables for cutting on snarl size
00095   fMinNumDigitsHit=100;
00096   fMinNumChannelsHit=100;
00097 
00098   //other
00099   fDetector=Detector::kUnknown;
00100 }


Member Function Documentation

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

Implement this for read only access to the MomNavigator

Reimplemented from JobCModule.

Definition at line 296 of file CDPreFilterModule.cxx.

References fbeamonly, fBeamOnlyCounter, fBigSnarls, fcerenkov, fCerenkovCounter, fDetector, FilterOnSnarlSize(), FilterSnarlForErrors(), RawRecord::FindRawBlock(), fli, fLiCounter, fnodeadchips, fNoDeadChipsCounter, fNoFdErrors, fNoNdErrors, fnplane, fplanetrig, fPlaneTrigCounter, ftof, fTofCounter, fTotalFailedCounter, fTotalInputCounter, fTotalPassedCounter, VldContext::GetDetector(), MomNavigator::GetFragment(), RawTOFBlock::GetNumberOfDigits(), RawDeadChipBlock::GetNumberOfEntries(), RawRecord::GetRawHeader(), RawDaqSnarlHeader::GetTrigSrc(), RecMinosHdr::GetVldContext(), JobCResult::kPassed, Msg::kWarning, MSG, JobCResult::SetFailed(), and JobCResult::SetPassed().

00297 {
00298   JobCResult result(JobCResult::kPassed);
00299 
00300   //count every snarl that is input
00301   //this should stay at the top of the method
00302   fTotalInputCounter++;
00303 
00304   //the master/deciding cut variable, this MUST ONLY be set to TRUE
00305   //in the code below, setting it to false would override previous
00306   //decissions
00307   Bool_t rejectSnarl=false;
00308   //Note that the setting of "result" is mostly irrelevant
00309   //but it makes it clearer what passed and what failed.
00310 
00311   RawRecord *rr=dynamic_cast<RawRecord *>
00312     (mom->GetFragment("RawRecord"));
00313   if (rr==0) {
00314     MSG("CDPreFilterModule", Msg::kWarning) 
00315       << "No RawRecord in MOM." << endl;
00316     result.SetFailed();//added by JJH 12/Dec/2003
00317     return result;
00318   }
00319 
00320   const RawHeader* rawHdr=
00321     dynamic_cast<const RawHeader*>(rr->GetRawHeader());
00322   if(!rawHdr){
00323     MSG("CDPreFilterModule", Msg::kWarning) 
00324       << "No RawHeader in RawRecord" << endl;
00325     //result.SetFailed();
00326     //return result;
00327   }
00328   else{
00329     fDetector=rawHdr->GetVldContext().GetDetector();
00330   }
00331 
00332   Int_t num_tof_digits=0;
00333   const RawTOFBlock* tofblock=
00334     dynamic_cast<const RawTOFBlock*>(rr->FindRawBlock("RawTOFBlock"));
00335   if (tofblock) {
00336     num_tof_digits=tofblock->GetNumberOfDigits();
00337   }
00338 
00339   UInt_t trigword=0;
00340   const RawDaqSnarlHeader* snarlHdr =
00341     dynamic_cast<const RawDaqSnarlHeader*>(rr->GetRawHeader());
00342   if (snarlHdr) {
00343     trigword=snarlHdr->GetTrigSrc();
00344   }
00345 
00346   Int_t num_dead_chips=0;
00347   const RawDeadChipBlock* deadblock =
00348     dynamic_cast<const RawDeadChipBlock*>
00349     (rr->FindRawBlock("RawDeadChipBlock"));
00350   if(deadblock) {
00351     num_dead_chips=deadblock->GetNumberOfEntries();
00352   }
00353 
00354   //check the plane trigger
00355   if(fplanetrig==1) {
00356     if((trigword & 0x4) && (trigword>>8)>=fnplane)
00357       result.SetPassed();
00358     else {
00359       result.SetFailed();
00360       rejectSnarl=true;
00361       fPlaneTrigCounter++;
00362       //return result;
00363     }
00364   }
00365   
00366   //check the tof hits
00367   if(fbeamonly!=0) {
00368     if(fbeamonly==1 && (trigword & 0x80)) result.SetPassed();
00369     else if(fbeamonly==2 && num_tof_digits>0) result.SetPassed();
00370     else if(fbeamonly==-1 && !(trigword & 0x80)) result.SetPassed();
00371     else if(fbeamonly==-2 && num_tof_digits==0) result.SetPassed();
00372     else {
00373       result.SetFailed();
00374       rejectSnarl=true;
00375       fBeamOnlyCounter++;
00376       //return result;
00377     }
00378   }
00379 
00380   //check the cerenkov hits
00381   if(fcerenkov!=0) {
00382     if(fcerenkov==1 && 
00383        ((trigword & 0x10) || (trigword & 0x20) || (trigword & 0x40))){
00384       result.SetPassed();
00385     }
00386     else if(fcerenkov==-1 && 
00387             !(trigword&0x10) && !(trigword&0x20) && !(trigword&0x40)){
00388       result.SetPassed();
00389     }
00390     else {
00391       result.SetFailed();
00392       rejectSnarl=true;
00393       fCerenkovCounter++;
00394       //return result;
00395     }
00396   }
00397   
00398   //check the light injection
00399   if(fli!=0){
00400     if(fli==1 && (trigword & 0x2)) result.SetPassed();
00401     else if(fli==-1 && !(trigword & 0x2)) result.SetPassed();
00402     else {
00403       result.SetFailed();
00404       rejectSnarl=true;
00405       fLiCounter++;
00406       //return result;
00407     }
00408   }
00409 
00410   //check the tofs again??? JJH
00411   if(ftof!=0){
00412     if(ftof==1 && (trigword & 0x8)) result.SetPassed();
00413     else if(ftof==-1 && !(trigword & 0x8)) result.SetPassed();
00414     else {
00415       result.SetFailed();
00416       rejectSnarl=true;
00417       fTofCounter++;
00418       //return result;
00419     }
00420   }
00421 
00422   //check the dead chips
00423   if(fnodeadchips!=0) {
00424     if(fnodeadchips==1 && num_dead_chips==0) result.SetPassed();
00425     else if(fnodeadchips==-1 && num_dead_chips>0) result.SetPassed();
00426     else {
00427       result.SetFailed();
00428       rejectSnarl=true;
00429       fNoDeadChipsCounter++;
00430       //return result;
00431     }
00432   }
00433 
00434   //if any of the digit filters are enabled
00435   if (fNoNdErrors || fNoFdErrors || fBigSnarls){
00436     //get the raw digit data block
00437     const RawDigitDataBlock* rddb=dynamic_cast<const RawDigitDataBlock*>
00438       (rr->FindRawBlock("RawDigitDataBlock"));
00439     if (!rddb){
00440       MSG("CDPreFilterModule",Msg::kWarning) 
00441         <<"No RawDigitDataBlock in RawRecord"<<endl;
00442       //return JobCResult::kFailed;
00443     }
00444     else{
00445       //look at the digit errors
00446       if (fNoNdErrors || fNoFdErrors){
00447         Bool_t reject=this->FilterSnarlForErrors(rddb);
00448         if (reject) rejectSnarl=true;
00449       }
00450       //look at the digit size
00451       if (fBigSnarls){
00452         Bool_t reject=this->FilterOnSnarlSize(rddb);
00453         if (reject) rejectSnarl=true;
00454       }
00455     }
00456   }
00457   
00458   //gave up on this bit, you have to loop to get all the 
00459   //raw records and also over the raw records themselves to get
00460   //all the rvebs since there are 16 of them per rr!!!!
00461 
00462   //const RawVarcErrorInTfBlock* rveb=
00463   //dynamic_cast<const RawVarcErrorInTfBlock*>
00464   //(rr->FindRawBlock("RawVarcErrorInTfBlock"));
00465   //if (!rveb){
00466   //MAXMSG("CDPreFilterModule",Msg::kWarning,10) 
00467   //  <<"No RawVarcErrorInTfBlock in RawRecord"<<endl;
00468   //return JobCResult::kFailed;
00469   //}
00470   //else{
00471   //MAXMSG("CDPreFilterModule",Msg::kInfo,200) 
00472   //  <<"Found RawVarcErrorInTfBlock, Num SparsErrors="
00473   //  <<rveb->GetNumberOfSparsErrors()
00474   //  <<", Num EtcErrors="<<rveb->GetNumberOfEtcErrors()
00475   //  <<endl;
00476   //rveb->Print();
00477   //}
00478 
00479   //check the final result
00480   if (rejectSnarl){
00481     //fail the event
00482     result.SetFailed();
00483     //count the events failed
00484     fTotalFailedCounter++;
00485   }
00486   else {
00487     //pass the event
00488     result.SetPassed();
00489     //count the events passed
00490     fTotalPassedCounter++;
00491   }
00492 
00493   //return the final result
00494   return result;
00495 }

void CDPreFilterModule::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.

Purpose: Configure the module given a registry.

Reimplemented from JobCModule.

Definition at line 1128 of file CDPreFilterModule.cxx.

References fMinNumChannelsHit, fMinNumDigitsHit, Registry::Get(), Msg::kDebug, and MSG.

01129 {
01131 
01132   MSG("CDPreFilterModule", Msg::kDebug) 
01133     <<"CDPreFilterModule::Config"<<endl;
01134 
01135   Int_t temp=0;
01136 
01137   temp=0;
01138   //set fMinNumDigitsHit
01139   if (r.Get("MinNumDigitsHit",temp)) {
01140     fMinNumDigitsHit=temp;
01141   }
01142 
01143   temp=0;
01144   //set fMinNumChannelsHit
01145   if (r.Get("MinNumChannelsHit",temp)) {
01146     fMinNumChannelsHit=temp;
01147   }
01148 }

const Registry & CDPreFilterModule::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; }

Purpose: Method to return default configuration.

Reimplemented from JobCModule.

Definition at line 1104 of file CDPreFilterModule.cxx.

References JobCModule::GetName(), Msg::kDebug, Registry::LockValues(), MSG, Registry::Set(), and Registry::UnLockValues().

01105 {
01107 
01108   MSG("CDPreFilterModule", Msg::kDebug)
01109     << "Running CDPreFilterModule::DefaultConfig..." << endl;
01110     
01111   static Registry r;
01112 
01113   string name=this->JobCModule::GetName();
01114   name+=".config.default";
01115   r.SetName(name.c_str());
01116   r.UnLockValues();
01117 
01118   r.Set("MinNumDigitsHit",0);
01119   r.Set("MinNumChannelsHit",0);
01120 
01121   r.LockValues();
01122 
01123   return r;
01124 }

void CDPreFilterModule::EndJob (  )  [virtual]

Implement for notification of end of job

Reimplemented from JobCModule.

Definition at line 693 of file CDPreFilterModule.cxx.

References PrintFilterSummary().

00694 {
00695   //print what was found and what was filtered
00696   this->PrintFilterSummary();
00697 }

Bool_t CDPreFilterModule::FilterOnSnarlSize ( const RawDigitDataBlock rddb  )  [private]

Definition at line 995 of file CDPreFilterModule.cxx.

References bfld::AsString(), fBigSnarls, fBigSnarlsCounter, fDetector, fMinNumChannelsHit, fMinNumDigitsHit, RawDigit::GetChannel(), RawDigitDataBlock::GetDatumIter(), RawChannelId::GetElecType(), RawChannelId::GetEncoded(), RawDigitDataBlock::GetNumberOfDigits(), RawChannelId::GetVmm(), Detector::kCalDet, Msg::kDebug, ElecType::kQIE, ElecType::kVA, Msg::kWarning, and MSG.

Referenced by Ana().

00997 {  
00998   Bool_t rejectSnarl=false;
00999 
01000   //variables to be evaluated before filtering the snarl
01001   Bool_t lowNumDigits=false;
01002   Bool_t lowNumChannels=false;
01003   Bool_t highNumDigits=false;
01004   Bool_t highNumChannels=false;
01005 
01006   //check snarl initially on the number of digits (buckets+vaHits)
01007   if (rddb->GetNumberOfDigits()<static_cast<Int_t>(fMinNumDigitsHit)){
01008     lowNumDigits=true;
01009   }
01010   //check that snarls over fMinNumDigitsHit satisfy the channel cut
01011   else{
01012     highNumDigits=true;
01013 
01014     //variables for counting up the hits
01015     map<UInt_t,UInt_t> qieChannelsHit;
01016     UInt_t vaChannelsHit=0;
01017     UInt_t qieDigitCounter=0;
01018     UInt_t vaDigitCounter=0;
01019 
01020     //loop over digits
01021     TIter datit = rddb->GetDatumIter();
01022     while (TObject *tobd=datit()){
01023       
01024       //get the raw digit
01025       RawDigit *rd=dynamic_cast<RawDigit *>(tobd);
01026 
01027       //count the hits
01028       if (rd->GetChannel().GetElecType()==ElecType::kQIE){
01029         //count up the buckets
01030         qieChannelsHit[rd->GetChannel().GetEncoded()]++;
01031         qieDigitCounter++;
01032       }
01033       else if (rd->GetChannel().GetElecType()==ElecType::kVA){
01034         //only count the scint channels at CalDet
01035         if (rd->GetChannel().GetVmm()<5 || 
01036             fDetector!=Detector::kCalDet){
01037           vaChannelsHit++;
01038           vaDigitCounter++;
01039         }
01040       }
01041       else{
01042         MSG("CDPreFilterModule",Msg::kWarning)
01043           <<"ElecType not recognised: "
01044           <<ElecType::AsString(rd->GetChannel().GetElecType())<<endl;
01045       }
01046     }
01047 
01048     //check the number of channels
01049     if (vaChannelsHit+qieChannelsHit.size()<fMinNumChannelsHit){
01050       lowNumChannels=true;
01051 
01052       //print message
01053       static Int_t msgCounter=0;
01054       if (msgCounter<100){
01055         MSG("CDPreFilterModule",Msg::kDebug)
01056           <<"Snarl with low num channels: vaCh="<<vaChannelsHit
01057           <<", qieCh="<<qieChannelsHit.size()
01058           <<", totalDig="<<rddb->GetNumberOfDigits()
01059           <<", vaDig="<<vaDigitCounter
01060           <<", qieDig="<<qieDigitCounter
01061           <<endl;
01062       }
01063       else if (msgCounter==100){
01064         MSG("CDPreFilterModule",Msg::kDebug)
01065           <<"Not printing any more snarls with low num channels"<<endl;
01066       }
01067       msgCounter++;
01068     }
01069     else{
01070       highNumChannels=true;
01071     }
01072   }
01073 
01075   //Section to actually reject the snarls based on the sizes
01077 
01078   //only reject the snarl if the cut 
01079   //is enabled (1) not anti-enabled (-1)
01080   if (fBigSnarls==1){
01081     if (lowNumDigits || lowNumChannels) rejectSnarl=true;
01082   }
01083   //check if the cut is anti-enabled (-1) rather than enabled (1)
01084   //so here you cut on snarls over fMinNumDigitsHit & fMinNumChannelsHit
01085   else if (fBigSnarls==-1){
01086     if (highNumDigits || highNumChannels) rejectSnarl=true;
01087   }
01088   else {
01089     MSG("CDPreFilterModule",Msg::kWarning)
01090       <<"Not cutting on BigSnarls"
01091       <<", control variable value not recognised: "
01092       <<"fBigSnarls="<<fBigSnarls<<endl;
01093   }
01094 
01095   //count the rejected snarls
01096   if (rejectSnarl) fBigSnarlsCounter++;
01097 
01098   //return the result
01099   return rejectSnarl;
01100 }

Bool_t CDPreFilterModule::FilterSnarlForErrors ( const RawDigitDataBlock rddb  )  [private]

Definition at line 701 of file CDPreFilterModule.cxx.

References bfld::AsString(), fDetector, fDigitCounter, fFdAdcNegativeCounter, fFdDigitCounter, fFdDigitErrorCounter, fFdNonStdDataCounter, fFdParityErr0Counter, fFdParityErr1Counter, fFdSnarlErrorCounter, fFdWarningStateCounter, fFdWordBitErr0Counter, fFdWordBitErr1Counter, fNdCapIdErrorCounter, fNdDigitCounter, fNdDigitErrorCounter, fNdDigitFFFFCounter, fNdMisCountErrorCounter, fNdParityErrorCounter, fNdPriorityTruncateCounter, fNdSnarlErrorCounter, fNdSnarlFFFFCounter, fNoFdErrors, fNoFdErrorsCounter, fNoNdErrors, fNoNdErrorsCounter, RawDigit::GetADC(), RawDigit::GetChannel(), RawChannelId::GetCrate(), RawDigitDataBlock::GetDatumIter(), RawChannelId::GetElecType(), RawDigit::GetErrorCode(), RawChannelId::GetGeographicAddress(), RawChannelId::GetMasterChannel(), RawChannelId::GetMinderChannel(), RawChannelId::GetVaAdcSel(), RawChannelId::GetVaChannel(), RawChannelId::GetVaChip(), RawChannelId::GetVarcId(), RawChannelId::GetVmm(), RawVaDigit::kAdcNegative, Detector::kCalDet, RawQieDigit::kCapIdError, Msg::kDebug, RawQieDigit::kMisCountError, RawVaDigit::kNonStdData, RawVaDigit::kParityErr0, RawVaDigit::kParityErr1, RawQieDigit::kParityError, RawQieDigit::kPriorityTruncate, ElecType::kQIE, ElecType::kVA, Msg::kVerbose, Msg::kWarning, RawVaDigit::kWarningState, RawVaDigit::kWordBitErr0, RawVaDigit::kWordBitErr1, and MSG.

Referenced by Ana().

00703 {  
00704   //counting snarls control variables
00705   Bool_t foundNdError=false;
00706   Bool_t foundNdFFFF=false;
00707   Bool_t foundFdError=false;
00708 
00709   //counting snarl error control variables
00710   Bool_t foundParityError=false;
00711   Bool_t foundCapIdError=false;
00712   Bool_t foundMisCountError=false;
00713   Bool_t foundPriorityTruncate=false;
00714   Bool_t foundAdcNegative=false;
00715   Bool_t foundNonStdData=false;
00716   Bool_t foundWarningState=false;
00717   Bool_t foundParityErr0=false;
00718   Bool_t foundParityErr1=false;
00719   Bool_t foundWordBitErr0=false;
00720   Bool_t foundWordBitErr1=false;
00721 
00722   TIter datit = rddb->GetDatumIter();
00723   while (TObject *tobd=datit()){
00724 
00725     //get the raw digit
00726     RawDigit *rd=dynamic_cast<RawDigit *>(tobd);
00727 
00728     //count the digits
00729     fDigitCounter++;
00730 
00731     //check the digit for errors and FFFF
00732 
00733     //look at far detector digits if fNoFdErrors is non-zero
00734     if (rd->GetChannel().GetElecType()==ElecType::kVA){
00735       if (fNoFdErrors){//allows to only count ND errors
00736         //count the FD digits
00737         fFdDigitCounter++;
00738 
00739         //check if there is an error (and that the vmm was <5 if CalDet)
00740         if (rd->GetErrorCode() && (rd->GetChannel().GetVmm()<5 
00741                                    || fDetector!=
00742                                    Detector::kCalDet)){
00743 
00744           //count the digits with errors
00745           fFdDigitErrorCounter++;
00746 
00747           //count the snarls with errors
00748           if (!foundFdError){
00749             foundFdError=true;
00750             fFdSnarlErrorCounter++;
00751           }
00752 
00753           //count the individual error types occurance in snarls
00754           Char_t errCode=rd->GetErrorCode();
00755           Bool_t errorRecognised=false;
00756           if ((errCode&0x1)==RawVaDigit::kAdcNegative){//bit0
00757             if (!foundAdcNegative) fFdAdcNegativeCounter++;
00758             foundAdcNegative=true;
00759             errorRecognised=true;
00760           }
00761           if ((errCode&0x2)==RawVaDigit::kNonStdData){//bit1
00762             if (!foundNonStdData) fFdNonStdDataCounter++;
00763             foundNonStdData=true;
00764             errorRecognised=true;
00765             static Int_t msgCounter=0;
00766             if (msgCounter<100){
00767               RawChannelId rcid=rd->GetChannel();
00768               MSG("CDPreFilterModule",Msg::kDebug)
00769                 <<"Error: NonStdData on VA("<<rcid.GetCrate()<<","
00770                 <<rcid.GetVarcId()<<","<<rcid.GetVmm()<<","
00771                 <<rcid.GetVaAdcSel()<<","<<rcid.GetVaChip()<<","
00772                 <<rcid.GetVaChannel()<<")"<<endl;
00773             }
00774             else if (msgCounter==100){
00775               MSG("CDPreFilterModule",Msg::kDebug)
00776                 <<"Not printing any more NonStdData errors"<<endl;
00777             }
00778             msgCounter++;
00779           }
00780           if ((errCode&0x4)==RawVaDigit::kWarningState){//bit2
00781             if (!foundWarningState) fFdWarningStateCounter++;
00782             foundWarningState=true;
00783             errorRecognised=true;
00784           }
00785           if ((errCode&0x8)==RawVaDigit::kParityErr0){//bit3
00786             if (!foundParityErr0) fFdParityErr0Counter++;
00787             foundParityErr0=true;
00788             errorRecognised=true;
00789 
00790             static Int_t msgCounter=0;
00791             if (msgCounter<100){
00792               RawChannelId rcid=rd->GetChannel();
00793               MSG("CDPreFilterModule",Msg::kDebug)
00794                 <<"Error: ParityErr0 on VA("<<rcid.GetCrate()<<","
00795                 <<rcid.GetVarcId()<<","<<rcid.GetVmm()<<","
00796                 <<rcid.GetVaAdcSel()<<","<<rcid.GetVaChip()<<","
00797                 <<rcid.GetVaChannel()<<")"<<endl;
00798             }
00799             else if (msgCounter==100){
00800               MSG("CDPreFilterModule",Msg::kDebug)
00801                 <<"Not printing any more ParityErr0 errors"<<endl;
00802             }
00803             msgCounter++;
00804           }
00805           if ((errCode&0x10)==RawVaDigit::kParityErr1){//bit4
00806             if (!foundParityErr1) fFdParityErr1Counter++;
00807             foundParityErr1=true;
00808             errorRecognised=true;
00809           }
00810           if ((errCode&0x20)==RawVaDigit::kWordBitErr0){//bit5
00811             if (!foundWordBitErr0) fFdWordBitErr0Counter++;
00812             foundWordBitErr0=true;
00813             errorRecognised=true;
00814           }
00815           if ((errCode&0x40)==RawVaDigit::kWordBitErr1){//bit6
00816             if (!foundWordBitErr1) fFdWordBitErr1Counter++;
00817             foundWordBitErr1=true;
00818             errorRecognised=true;
00819           }
00820 
00821           //check that the error was recognised 
00822           if (!errorRecognised){
00823             RawChannelId rcid=rd->GetChannel();
00824             MSG("CDPreFilterModule",Msg::kWarning)
00825               <<"EVaErrorCode not recognised: "
00826               <<static_cast<Int_t>(errCode)
00827               //have to cast it as it might not be a printable character
00828               <<" VA("<<rcid.GetCrate()<<","
00829               <<rcid.GetVarcId()<<","<<rcid.GetVmm()<<","
00830               <<rcid.GetVaAdcSel()<<","<<rcid.GetVaChip()<<","
00831               <<rcid.GetVaChannel()<<")"<<endl;
00832           }
00833         }
00834       }
00835     }
00836     //look at near detector digits if fNoNdErrors is non-zero
00837     else if (rd->GetChannel().GetElecType()==ElecType::kQIE){
00838       if (fNoNdErrors){//allows to only count FD errors
00839         //count the ND digits
00840         fNdDigitCounter++;
00841 
00842         //check for FFFFs
00843         if (rd->GetADC()==0xFFFF){
00844           fNdDigitFFFFCounter++;
00845           //count the snarls with errors
00846           if (!foundNdFFFF){
00847             foundNdFFFF=true;
00848             fNdSnarlFFFFCounter++;
00849           }
00850         }
00851       
00852         //check for errors
00853         if (rd->GetErrorCode()){
00854 
00855           //count the digits with errors
00856           fNdDigitErrorCounter++;
00857 
00858           //count the snarls with errors
00859           if (!foundNdError){
00860             foundNdError=true;
00861             fNdSnarlErrorCounter++;
00862 
00863             //count the individual error types occurance in snarls
00864             Char_t errCode=rd->GetErrorCode();
00865             Bool_t errorRecognised=false;
00866             if ((errCode&0x1)==RawQieDigit::kParityError){//bit0
00867               if (!foundParityError) fNdParityErrorCounter++;
00868               foundParityError=true;
00869               errorRecognised=true;
00870             }
00871             if ((errCode&0x2)==RawQieDigit::kCapIdError){//bit1
00872               if (!foundCapIdError) fNdCapIdErrorCounter++;
00873               foundCapIdError=true;
00874               errorRecognised=true;
00875               static Int_t msgCounter=0;
00876               if (msgCounter<100){
00877                 RawChannelId rcid=rd->GetChannel();
00878                 MSG("CDPreFilterModule",Msg::kDebug)
00879                   <<"Error: CapIdError on QIE("
00880                   <<rcid.GetCrate()<<","
00881                   <<rcid.GetGeographicAddress()<<","
00882                   <<rcid.GetMasterChannel()<<","
00883                   <<rcid.GetMinderChannel()<<")"<<endl;
00884               }
00885               else if (msgCounter==100){
00886                 MSG("CDPreFilterModule",Msg::kDebug)
00887                   <<"Not printing any more CapId errors"<<endl;
00888               }
00889               msgCounter++;
00890             }
00891             if ((errCode&0x4)==RawQieDigit::kMisCountError){//bit2
00892               if (!foundMisCountError) fNdMisCountErrorCounter++;
00893               foundMisCountError=true;
00894               errorRecognised=true;
00895             }
00896             if ((errCode&0x8)==RawQieDigit::kPriorityTruncate){//bit3
00897               if (!foundPriorityTruncate) fNdPriorityTruncateCounter++;
00898               foundPriorityTruncate=true;
00899               errorRecognised=true;
00900             }
00901 
00902             if (!errorRecognised){
00903               RawChannelId rcid=rd->GetChannel();
00904               MSG("CDPreFilterModule",Msg::kWarning)
00905                 <<"EQieErrorCode not recognised: "
00906                 <<static_cast<Int_t>(errCode)
00907                 <<" QIE("
00908                 <<rcid.GetCrate()<<","
00909                 <<rcid.GetGeographicAddress()<<","
00910                 <<rcid.GetMasterChannel()<<","
00911                 <<rcid.GetMinderChannel()<<")"<<endl;
00912             }
00913           }
00914           //check the type of error here as well
00915           //
00916         }
00917       }
00918     }
00919     else{
00920       MSG("CDPreFilterModule",Msg::kWarning)
00921         <<"ElecType not recognised: "
00922         <<ElecType::AsString(rd->GetChannel().GetElecType())<<endl;
00923     }
00924   }
00925 
00927   //Section to actually reject the snarls based on the errors
00929 
00930   Bool_t rejectSnarl=false;
00931 
00932   //check the ND errors
00933   //only pass snarls without errors
00934   if (fNoNdErrors==1){
00935     if (foundNdError || foundNdFFFF) rejectSnarl=true;
00936     if (rejectSnarl) fNoNdErrorsCounter++;
00937 
00938     MSG("CDPreFilterModule",Msg::kVerbose)
00939       <<"enabled, foundNdError="<<foundNdError
00940       <<", foundNdFFFF="<<foundNdFFFF<<", reject="<<rejectSnarl
00941       <<", counter="<<fNoNdErrorsCounter<<endl;
00942   }
00943   //if anti-enabled only pass snarls WITH errors
00944   else if (fNoNdErrors==-1){
00945     //don't reject if found an error, only reject with errors!
00946     if (!foundNdError && !foundNdFFFF) rejectSnarl=true;
00947     if (rejectSnarl) fNoNdErrorsCounter++;
00948 
00949     MSG("CDPreFilterModule",Msg::kVerbose)
00950       <<"anti-enabled, foundNdError="<<foundNdError
00951       <<", foundNdFFFF="<<foundNdFFFF<<", reject="<<rejectSnarl
00952       <<", counter="<<fNoNdErrorsCounter<<endl;
00953   }
00954   else if (fNoNdErrors==0){
00955     //don't do anything in this case
00956   }
00957   else {
00958     MSG("CDPreFilterModule",Msg::kWarning)
00959       <<"Not cutting on NoNdErrors"
00960       <<", control variable value not recognised: "
00961       <<"fNoNdErrors="<<fNoNdErrors<<endl;
00962   } 
00963 
00964   //check the FD errors
00965   //only pass snarls without errors
00966   if (fNoFdErrors==1){
00967     if (foundFdError){
00968       rejectSnarl=true;
00969       fNoFdErrorsCounter++;
00970     }
00971   }
00972   //if anti-enabled only pass snarls WITH errors
00973   else if (fNoFdErrors==-1){
00974     if (!foundFdError){
00975       rejectSnarl=true;
00976       fNoFdErrorsCounter++;
00977     }
00978   }
00979   else if (fNoFdErrors==0){
00980     //don't do anything in this case
00981   }
00982   else {
00983     MSG("CDPreFilterModule",Msg::kWarning)
00984       <<"Not cutting on NoFdErrors"
00985       <<", control variable value not recognised: "
00986       <<"fNoFdErrors="<<fNoFdErrors<<endl;
00987   }
00988 
00989   //return the decision
00990   return rejectSnarl;
00991 }

string CDPreFilterModule::GetCutStatus ( Int_t  cut  )  const [private]

Definition at line 678 of file CDPreFilterModule.cxx.

Referenced by PrintFilterSummary().

00679 {
00680   string status="";
00681   if (cut==0) status="disabled";
00682   else if (cut==1) status="enabled";
00683   else if (cut==-1) status="anti-enabled";
00684   else if (cut==2) status="enabled, special";
00685   else if (cut==-2) status="anti-enabled, special";
00686   else status="Cut not recognised";
00687 
00688   return status;
00689 }

string CDPreFilterModule::GetErrorString (  )  const [private]

Work out what errors to print

Definition at line 597 of file CDPreFilterModule.cxx.

References fDigitCounter, fFdAdcNegativeCounter, fFdDigitCounter, fFdDigitErrorCounter, fFdNonStdDataCounter, fFdParityErr0Counter, fFdParityErr1Counter, fFdSnarlErrorCounter, fFdWarningStateCounter, fFdWordBitErr0Counter, fFdWordBitErr1Counter, fNdCapIdErrorCounter, fNdDigitCounter, fNdDigitErrorCounter, fNdDigitFFFFCounter, fNdMisCountErrorCounter, fNdParityErrorCounter, fNdPriorityTruncateCounter, fNdSnarlErrorCounter, fNdSnarlFFFFCounter, fNoFdErrors, fNoNdErrors, fTotalFailedCounter, fTotalPassedCounter, Pct(), and SForm().

Referenced by PrintFilterSummary().

00598 {
00600 
00601   Int_t totalHits=0;
00602   totalHits=fTotalFailedCounter+fTotalPassedCounter;
00603  
00604   string sErrors="  Snarl Error and FFFF Summary:\n";
00605   string sNdErrors="";
00606   sNdErrors=
00607     "    Num ND Snarls with Errors  ="+SForm(fNdSnarlErrorCounter)+
00608     " ("+Pct(fNdSnarlErrorCounter,totalHits)+"%)"+"\n"
00609     +"      -Parity errors           ="+SForm(fNdParityErrorCounter)
00610     +" ("+Pct(fNdParityErrorCounter,totalHits)+"%)"+"\n"
00611     +"      -CapId errors            ="+SForm(fNdCapIdErrorCounter)
00612     +" ("+Pct(fNdCapIdErrorCounter,totalHits)+"%)"+"\n"
00613     +"      -MisCount errors         ="+SForm(fNdMisCountErrorCounter)
00614     +" ("+Pct(fNdMisCountErrorCounter,totalHits)+"%)"+"\n"
00615     +"      -PriorityTruncate errors ="+
00616     SForm(fNdPriorityTruncateCounter)
00617     +" ("+Pct(fNdPriorityTruncateCounter,totalHits)+"%)"+"\n"
00618     +"    Num ND Snarls with FFFFs   ="+SForm(fNdSnarlFFFFCounter)
00619     +" ("+Pct(fNdSnarlFFFFCounter,totalHits)+"%)"+"\n";
00620   string sFdErrors="";
00621   sFdErrors=
00622     "    Num FD Snarls (VMM<5 - if CalDet) with Errors="+
00623     SForm(fFdSnarlErrorCounter)
00624     +" ("+Pct(fFdSnarlErrorCounter,totalHits)+"%)"+"\n"
00625     +"      -AdcNegative errors      ="+SForm(fFdAdcNegativeCounter)
00626     +" ("+Pct(fFdAdcNegativeCounter,totalHits)+"%)"+"\n"
00627     +"      -NonStdData errors       ="+SForm(fFdNonStdDataCounter)
00628     +" ("+Pct(fFdNonStdDataCounter,totalHits)+"%)"+"\n"
00629     +"      -WarningState errors     ="+SForm(fFdWarningStateCounter)
00630     +" ("+Pct(fFdWarningStateCounter,totalHits)+"%)"+"\n"
00631     +"      -ParityErr0 errors       ="+SForm(fFdParityErr0Counter)
00632     +" ("+Pct(fFdParityErr0Counter,totalHits)+"%)"+"\n"
00633     +"      -ParityErr1 errors       ="+SForm(fFdParityErr1Counter)
00634     +" ("+Pct(fFdParityErr1Counter,totalHits)+"%)"+"\n"
00635     +"      -WordBitErr0 errors      ="+SForm(fFdWordBitErr0Counter)
00636     +" ("+Pct(fFdWordBitErr0Counter,totalHits)+"%)"+"\n"
00637     +"      -WordBitErr1 errors      ="+SForm(fFdWordBitErr1Counter)
00638     +" ("+Pct(fFdWordBitErr1Counter,totalHits)+"%)"+"\n";
00639 
00640   string sDigitErrors="";
00641   sDigitErrors="  Digit Error and FFFF Summary:\n";
00642   sDigitErrors+="    Total Number of Digits="+SForm(fDigitCounter)+"\n";
00643 
00644   string sFdDigits="";
00645   sFdDigits=
00646     "      -Num FD Digits="+SForm(fFdDigitCounter)
00647     +" ("+Pct(fFdDigitCounter,fDigitCounter)+"%)"+"\n";
00648   string sNdDigits="";
00649   sNdDigits=
00650     "      -Num ND Digits="+SForm(fNdDigitCounter)
00651     +" ("+Pct(fNdDigitCounter,fDigitCounter)+"%)"+"\n";
00652     
00653   string sFdDigitErrors="";
00654   sFdDigitErrors=
00655     "    Num FD Digits with Errors="+SForm(fFdDigitErrorCounter)
00656     +" ("+Pct(fFdDigitErrorCounter,fDigitCounter)+"%)"+"\n";
00657   string sNdDigitErrors="";
00658   sNdDigitErrors=
00659     "    Num ND Digits with Errors="+SForm(fNdDigitErrorCounter)
00660     +" ("+Pct(fNdDigitErrorCounter,fNdDigitCounter)+"%)"+"\n"
00661     +"    Num ND Digits with FFFFs="+SForm(fNdDigitFFFFCounter)
00662     +" ("+Pct(fNdDigitFFFFCounter,fNdDigitCounter)+"%)"+"\n";
00663 
00664   //work out what to print...
00665   if (fNoNdErrors) sErrors+=sNdErrors;
00666   if (fNoFdErrors) sErrors+=sFdErrors;
00667   sErrors+=sDigitErrors;
00668   if (fNoNdErrors) sErrors+=sNdDigits;
00669   if (fNoFdErrors) sErrors+=sFdDigits;
00670   if (fNoNdErrors) sErrors+=sNdDigitErrors;
00671   if (fNoFdErrors) sErrors+=sFdDigitErrors;
00672 
00673   return sErrors;
00674 }

void CDPreFilterModule::HandleCommand ( JobCommand command  )  [virtual]

Implement to handle a JobCommand

Reimplemented from JobCModule.

Definition at line 104 of file CDPreFilterModule.cxx.

References fbeamonly, fBigSnarls, fcerenkov, fli, fnodeadchips, fNoFdErrors, fNoNdErrors, fnplane, fplanetrig, ftof, JobCommand::HaveCmd(), JobCommand::HaveOpt(), Msg::kVerbose, Msg::kWarning, MSG, JobCommand::PopCmd(), JobCommand::PopIntOpt(), and JobCommand::PopOpt().

00105 {
00106 
00107   if (cmd->HaveCmd()) {       // If we have a command...
00108     string sc=cmd->PopCmd();// Get the command
00109     
00110     if (sc == "PlaneTrig"){
00111       if(cmd->HaveOpt()){
00112         Int_t tempPlanes=cmd->PopIntOpt();
00113         if (tempPlanes==0 || tempPlanes==1){
00114           fplanetrig=0;//no point having a 0 or 1 out of M plane trig
00115         }
00116         else if (tempPlanes<0){
00117           fplanetrig=0;
00118           MSG("CDPreFilterModule",Msg::kWarning) 
00119             <<"Can't do plane trigger with negative number of planes!"
00120             <<" Not cutting on plane trigger"<<endl;
00121         }
00122         else{
00123           fplanetrig=1;
00124           fnplane=tempPlanes;
00125         }
00126       }
00127       else {
00128         fplanetrig=0;
00129         MSG("CDPreFilterModule",Msg::kWarning) 
00130           << "PlaneTrig command given without number of planes option."
00131           << " Not cutting on Plane Trigger"  << endl;
00132       }
00133       
00134       MSG("CDPreFilterModule",Msg::kVerbose) 
00135         <<"Plane trigger control flag fplanetrig="<<fplanetrig
00136         <<endl;
00137       return;
00138     }
00139     else if (sc == "BeamSpill") {
00140       fbeamonly=1;
00141       if(cmd->HaveOpt()) {
00142         string opt=cmd->PopOpt();
00143         if(opt == "yes") fbeamonly=1; 
00144         else if(opt == "no") fbeamonly=-1;
00145         else if(opt == "off") fbeamonly=0;
00146         else if(opt == "tof") {
00147           if(cmd->HaveOpt()) {
00148             string opt2=cmd->PopOpt();
00149             if(opt2 == "yes") fbeamonly=2;
00150             else if(opt2 == "no") fbeamonly=-2;
00151             else {
00152               MSG("CDPreFilterModule",Msg::kWarning) 
00153                 << "Don't understand '" << opt2.c_str() << "'\n" 
00154                 << "Module will be ignoring "<<sc.c_str()<<" triggers"
00155                 << endl;
00156               fbeamonly=0;
00157             }
00158           }
00159           else {
00160             MSG("CDPreFilterModule",Msg::kWarning) 
00161               << "No option specified with " 
00162               << sc.c_str() << " " << opt.c_str() 
00163               << " needed for this Handle Command" 
00164               << "Module ignoring " << sc.c_str()<<" triggers"<<endl;
00165             fbeamonly=0;
00166           }
00167         }
00168         else {
00169           MSG("CDPreFilterModule",Msg::kWarning) 
00170             <<"Don't understand '" << opt.c_str() << "'\n" 
00171             <<"Module will be ignoring " << sc.c_str()<<" triggers"
00172             <<endl;
00173           fbeamonly=0;
00174         }
00175       }
00176       return;
00177     }
00178     else if(sc == "Cerenkov") {
00179       fcerenkov=1;
00180       if(cmd->HaveOpt()){
00181         string opt=cmd->PopOpt();
00182         if(opt == "yes") fcerenkov=1; 
00183         else if(opt == "no") fcerenkov=-1;
00184         else if(opt == "off") fcerenkov=0;
00185         else {
00186           MSG("CDPreFilterModule",Msg::kWarning) 
00187             << "Don't understand '" << opt.c_str() << "'\n" 
00188             <<"Module will be accepting "<<sc.c_str()<<" triggers"
00189             <<endl;
00190         }
00191       }
00192       return;
00193     }
00194     else if(sc == "LI") {
00195       fli=1;
00196       if(cmd->HaveOpt()){
00197         string opt=cmd->PopOpt();
00198         if(opt == "yes") fli=1; 
00199         else if(opt == "no") fli=-1;
00200         else if(opt == "off") fli=0;
00201         else {
00202           MSG("CDPreFilterModule",Msg::kWarning) 
00203             << "Don't understand '" << opt.c_str() << "'\n" 
00204             <<"Module will be accepting "<<sc.c_str()<<" triggers"
00205             <<endl;
00206         }   
00207       }
00208       return;
00209     }
00210     else if(sc == "TOF") {
00211       ftof=1;
00212       if(cmd->HaveOpt()){
00213         string opt=cmd->PopOpt();
00214         if(opt == "yes") ftof=1; 
00215         else if(opt == "no") ftof=-1;
00216         else if(opt == "off") ftof=0;
00217         else {
00218           MSG("CDPreFilterModule",Msg::kWarning) 
00219             << "Don't understand '" << opt.c_str() << "'\n" 
00220             <<"Module will be accepting "<<sc.c_str()<<" triggers"
00221             <<endl;
00222         }
00223       }
00224       return;
00225     }
00226     else if(sc == "NoDeadChips") {
00227       fnodeadchips=1;
00228       if(cmd->HaveOpt()){
00229         string opt=cmd->PopOpt();
00230         if(opt == "yes") fnodeadchips=1;
00231         else if(opt == "no") fnodeadchips=-1;
00232         else if(opt == "off") fnodeadchips=0;
00233         else {
00234           MSG("CDPreFilterModule",Msg::kWarning) 
00235             << "Don't understand '" << opt.c_str() << "'\n" 
00236             <<"Module will be requiring "<<sc.c_str()<<" triggers"
00237             <<endl;
00238         }
00239       }
00240       return;
00241     }
00242     else if(sc =="NoNdErrors"){
00243       fNoNdErrors=1;
00244       if(cmd->HaveOpt()){
00245         string opt=cmd->PopOpt();
00246         if(opt == "yes") fNoNdErrors=1;
00247         else if(opt == "no") fNoNdErrors=-1;
00248         else if(opt == "off") fNoNdErrors=0;
00249         else {
00250           MSG("CDPreFilterModule",Msg::kWarning) 
00251             << "Don't understand '" << opt.c_str() << "'\n" 
00252             <<"Module will be requiring "<<sc.c_str()<<endl;
00253         }
00254       }
00255       return;
00256     }
00257     else if(sc =="NoFdErrors"){
00258       fNoFdErrors=1;
00259       if(cmd->HaveOpt()){
00260         string opt=cmd->PopOpt();
00261         if(opt == "yes") fNoFdErrors=1;
00262         else if(opt == "no") fNoFdErrors=-1;
00263         else if(opt == "off") fNoFdErrors=0;
00264         else {
00265           MSG("CDPreFilterModule",Msg::kWarning) 
00266             << "Don't understand '" << opt.c_str() << "'\n" 
00267             <<"Module will be requiring "<<sc.c_str()<<endl;
00268         }
00269       }
00270       return;
00271     }
00272     else if(sc =="BigSnarls"){
00273       fBigSnarls=1;
00274       if(cmd->HaveOpt()){
00275         string opt=cmd->PopOpt();
00276         if(opt == "yes") fBigSnarls=1;
00277         else if(opt == "no") fBigSnarls=-1;
00278         else if(opt == "off") fBigSnarls=0;
00279         else {
00280           MSG("CDPreFilterModule",Msg::kWarning) 
00281             << "Don't understand '" << opt.c_str() << "'\n" 
00282             <<"Module will be requiring "<<sc.c_str()<<endl;
00283         }
00284       }
00285       return;
00286     }
00287     else{
00288       MSG("CDPreFilterModule",Msg::kWarning)
00289         << "Don't understand '" << sc.c_str() << "'\n";
00290     }
00291   }
00292 }

string CDPreFilterModule::Pct ( Double_t  top,
Double_t  bottom 
) const [private]

method to calculate a simple percentage safely and formatted

Definition at line 570 of file CDPreFilterModule.cxx.

References Form().

Referenced by GetErrorString(), and PrintFilterSummary().

00571 {
00573   Double_t percent=-1;
00574   string sPercent="notset";
00575   if (bottom!=0){
00576     percent=top/bottom;
00577     percent*=100;
00578     sPercent=Form("%.1f",percent);
00579   }
00580   else{
00581     sPercent="fpe!";
00582   }
00583   return sPercent;
00584 }

void CDPreFilterModule::PrintFilterSummary (  )  const [private]

print out summary of reconstruction information

Definition at line 499 of file CDPreFilterModule.cxx.

References fbeamonly, fBeamOnlyCounter, fBigSnarls, fBigSnarlsCounter, fcerenkov, fCerenkovCounter, fli, fLiCounter, fnodeadchips, fNoDeadChipsCounter, fNoFdErrors, fNoFdErrorsCounter, fNoNdErrors, fNoNdErrorsCounter, fplanetrig, fPlaneTrigCounter, ftof, fTofCounter, fTotalFailedCounter, fTotalInputCounter, fTotalPassedCounter, GetCutStatus(), GetErrorString(), Msg::kInfo, Msg::kVerbose, MSG, and Pct().

Referenced by EndJob().

00500 {
00501   MSG("CDPreFilterModule",Msg::kVerbose)
00502     <<"Running PrintFilterSummary method..."<<endl;
00503 
00505 
00506   if (fTotalInputCounter>=0){
00507     Int_t totalHits=0;
00508     totalHits=fTotalFailedCounter+fTotalPassedCounter;
00509     
00510     MSG("CDPreFilterModule",Msg::kInfo) 
00511       <<endl 
00512       <<" ** Filter Summary Information: **"<<endl
00513       <<"  Total snarls input="<<fTotalInputCounter<<endl
00514       <<"    Snarls passed="<<fTotalPassedCounter
00515       <<" ("<<Pct(fTotalPassedCounter,totalHits)<<"%)"<<endl      
00516       <<"    Snarls failed="<<fTotalFailedCounter
00517       <<" ("<<Pct(fTotalFailedCounter,totalHits)<<"%)"<<endl      
00518       <<"    Sum of hits passed or failed="<<totalHits<<endl;
00519 
00520     MSG("CDPreFilterModule",Msg::kInfo) 
00521       <<"  Data Summary:"<<endl
00522       <<"    PlaneTrigger cut="<<fPlaneTrigCounter
00523       <<" ("<<Pct(fPlaneTrigCounter,totalHits)<<"%)"
00524       <<" ("<<GetCutStatus(fplanetrig)<<")"<<endl
00525       <<"    BeamOnly cut="<<fBeamOnlyCounter
00526       <<" ("<<Pct(fBeamOnlyCounter,totalHits)<<"%)"
00527       <<" ("<<GetCutStatus(fbeamonly)<<")"<<endl
00528       <<"    Cerenkov cut="<<fCerenkovCounter
00529       <<" ("<<Pct(fCerenkovCounter,totalHits)<<"%)"
00530       <<" ("<<GetCutStatus(fcerenkov)<<")"<<endl
00531       <<"    NoDeadChips cut="<<fNoDeadChipsCounter
00532       <<" ("<<Pct(fNoDeadChipsCounter,totalHits)<<"%)"
00533       <<" ("<<GetCutStatus(fnodeadchips)<<")"<<endl
00534       <<"    Li cut="<<fLiCounter
00535       <<" ("<<Pct(fLiCounter,totalHits)<<"%)"
00536       <<" ("<<GetCutStatus(fli)<<")"<<endl
00537       <<"    Tof cut="<<fTofCounter
00538       <<" ("<<Pct(fTofCounter,totalHits)<<"%)"
00539       <<" ("<<GetCutStatus(ftof)<<")"<<endl
00540       <<"    ND Error cut="<<fNoNdErrorsCounter
00541       <<" ("<<Pct(fNoNdErrorsCounter,totalHits)<<"%)"
00542       <<" ("<<GetCutStatus(fNoNdErrors)<<")"<<endl
00543       <<"    FD Error cut="<<fNoFdErrorsCounter
00544       <<" ("<<Pct(fNoFdErrorsCounter,totalHits)<<"%)"
00545       <<" ("<<GetCutStatus(fNoFdErrors)<<")"<<endl
00546       <<"    Big Snarls cut="<<fBigSnarlsCounter
00547       <<" ("<<Pct(fBigSnarlsCounter,totalHits)<<"%)"
00548       <<" ("<<GetCutStatus(fBigSnarls)<<")"<<endl;
00549 
00550     //now print out the errors
00551     if (fNoNdErrors || fNoFdErrors){
00552       MSG("CDPreFilterModule",Msg::kInfo) 
00553         <<this->GetErrorString();
00554     }
00555 
00556     MSG("CDPreFilterModule",Msg::kInfo) 
00557       <<" ** End of Filter Summary Information ** "<<endl; 
00558   }
00559   else {
00560     MSG("CDPreFilterModule",Msg::kInfo) 
00561       <<" ** No data input to prefilter **"<<endl<<endl;
00562   }
00563 
00564   MSG("CDPreFilterModule",Msg::kVerbose) 
00565     <<"Finished PrintFilterSummary method"<<endl;
00566 }

string CDPreFilterModule::SForm ( Int_t  number  )  const [private]

Definition at line 588 of file CDPreFilterModule.cxx.

References Form().

Referenced by GetErrorString().

00589 {
00590   string sNumber="";
00591   sNumber=Form("%d",number);
00592   return sNumber;
00593 }


Member Data Documentation

Definition at line 66 of file CDPreFilterModule.h.

Referenced by Ana(), CDPreFilterModule(), HandleCommand(), and PrintFilterSummary().

Definition at line 77 of file CDPreFilterModule.h.

Referenced by Ana(), CDPreFilterModule(), and PrintFilterSummary().

Definition at line 87 of file CDPreFilterModule.h.

Referenced by CDPreFilterModule(), FilterOnSnarlSize(), and PrintFilterSummary().

Definition at line 67 of file CDPreFilterModule.h.

Referenced by Ana(), CDPreFilterModule(), HandleCommand(), and PrintFilterSummary().

Definition at line 78 of file CDPreFilterModule.h.

Referenced by Ana(), CDPreFilterModule(), and PrintFilterSummary().

Definition at line 93 of file CDPreFilterModule.h.

Referenced by CDPreFilterModule(), FilterSnarlForErrors(), and GetErrorString().

Definition at line 105 of file CDPreFilterModule.h.

Referenced by CDPreFilterModule(), FilterSnarlForErrors(), and GetErrorString().

Definition at line 95 of file CDPreFilterModule.h.

Referenced by CDPreFilterModule(), FilterSnarlForErrors(), and GetErrorString().

Definition at line 98 of file CDPreFilterModule.h.

Referenced by CDPreFilterModule(), FilterSnarlForErrors(), and GetErrorString().

Definition at line 106 of file CDPreFilterModule.h.

Referenced by CDPreFilterModule(), FilterSnarlForErrors(), and GetErrorString().

Definition at line 108 of file CDPreFilterModule.h.

Referenced by CDPreFilterModule(), FilterSnarlForErrors(), and GetErrorString().

Definition at line 109 of file CDPreFilterModule.h.

Referenced by CDPreFilterModule(), FilterSnarlForErrors(), and GetErrorString().

Definition at line 92 of file CDPreFilterModule.h.

Referenced by CDPreFilterModule(), FilterSnarlForErrors(), and GetErrorString().

Definition at line 107 of file CDPreFilterModule.h.

Referenced by CDPreFilterModule(), FilterSnarlForErrors(), and GetErrorString().

Definition at line 110 of file CDPreFilterModule.h.

Referenced by CDPreFilterModule(), FilterSnarlForErrors(), and GetErrorString().

Definition at line 111 of file CDPreFilterModule.h.

Referenced by CDPreFilterModule(), FilterSnarlForErrors(), and GetErrorString().

int CDPreFilterModule::fli [private]

Definition at line 69 of file CDPreFilterModule.h.

Referenced by Ana(), CDPreFilterModule(), HandleCommand(), and PrintFilterSummary().

Definition at line 80 of file CDPreFilterModule.h.

Referenced by Ana(), CDPreFilterModule(), and PrintFilterSummary().

Definition at line 115 of file CDPreFilterModule.h.

Referenced by CDPreFilterModule(), Config(), and FilterOnSnarlSize().

Definition at line 114 of file CDPreFilterModule.h.

Referenced by CDPreFilterModule(), Config(), and FilterOnSnarlSize().

Definition at line 102 of file CDPreFilterModule.h.

Referenced by CDPreFilterModule(), FilterSnarlForErrors(), and GetErrorString().

Definition at line 94 of file CDPreFilterModule.h.

Referenced by CDPreFilterModule(), FilterSnarlForErrors(), and GetErrorString().

Definition at line 96 of file CDPreFilterModule.h.

Referenced by CDPreFilterModule(), FilterSnarlForErrors(), and GetErrorString().

Definition at line 97 of file CDPreFilterModule.h.

Referenced by CDPreFilterModule(), FilterSnarlForErrors(), and GetErrorString().

Definition at line 103 of file CDPreFilterModule.h.

Referenced by CDPreFilterModule(), FilterSnarlForErrors(), and GetErrorString().

Definition at line 101 of file CDPreFilterModule.h.

Referenced by CDPreFilterModule(), FilterSnarlForErrors(), and GetErrorString().

Definition at line 104 of file CDPreFilterModule.h.

Referenced by CDPreFilterModule(), FilterSnarlForErrors(), and GetErrorString().

Definition at line 90 of file CDPreFilterModule.h.

Referenced by CDPreFilterModule(), FilterSnarlForErrors(), and GetErrorString().

Definition at line 91 of file CDPreFilterModule.h.

Referenced by CDPreFilterModule(), FilterSnarlForErrors(), and GetErrorString().

Definition at line 68 of file CDPreFilterModule.h.

Referenced by Ana(), CDPreFilterModule(), HandleCommand(), and PrintFilterSummary().

Definition at line 79 of file CDPreFilterModule.h.

Referenced by Ana(), CDPreFilterModule(), and PrintFilterSummary().

Definition at line 86 of file CDPreFilterModule.h.

Referenced by CDPreFilterModule(), FilterSnarlForErrors(), and PrintFilterSummary().

Definition at line 85 of file CDPreFilterModule.h.

Referenced by CDPreFilterModule(), FilterSnarlForErrors(), and PrintFilterSummary().

UInt_t CDPreFilterModule::fnplane [private]

Definition at line 61 of file CDPreFilterModule.h.

Referenced by Ana(), CDPreFilterModule(), and HandleCommand().

Definition at line 60 of file CDPreFilterModule.h.

Referenced by Ana(), CDPreFilterModule(), HandleCommand(), and PrintFilterSummary().

Definition at line 76 of file CDPreFilterModule.h.

Referenced by Ana(), CDPreFilterModule(), and PrintFilterSummary().

int CDPreFilterModule::ftof [private]

Definition at line 70 of file CDPreFilterModule.h.

Referenced by Ana(), CDPreFilterModule(), HandleCommand(), and PrintFilterSummary().

Definition at line 81 of file CDPreFilterModule.h.

Referenced by Ana(), CDPreFilterModule(), and PrintFilterSummary().

Definition at line 82 of file CDPreFilterModule.h.

Referenced by Ana(), CDPreFilterModule(), GetErrorString(), and PrintFilterSummary().

Definition at line 84 of file CDPreFilterModule.h.

Referenced by Ana(), CDPreFilterModule(), and PrintFilterSummary().

Definition at line 83 of file CDPreFilterModule.h.

Referenced by Ana(), CDPreFilterModule(), GetErrorString(), and PrintFilterSummary().


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

Generated on 2 Nov 2017 for loon by  doxygen 1.6.1