StripCands Class Reference

#include <StripCands.h>

Inheritance diagram for StripCands:
JobCModule

List of all members.

Public Member Functions

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

Private Attributes

std::string fKeepDigitList

Detailed Description

Id
StripCands.h,v 1.1 2006/06/27 13:44:34 cbs Exp

(Document me!)

howcroft@flatpackcat.net

Definition at line 23 of file StripCands.h.


Constructor & Destructor Documentation

StripCands::StripCands (  ) 

(Document me!)

Definition at line 38 of file StripCands.cxx.

00038                        : 
00039   fKeepDigitList("")
00040 {
00044 }

StripCands::~StripCands (  ) 

(Document me!)

Definition at line 47 of file StripCands.cxx.

00048 {
00052 }


Member Function Documentation

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

Implement this for read only access to the MomNavigator

(Document me!)

Reimplemented from JobCModule.

Definition at line 74 of file StripCands.cxx.

References RawDigitDataBlock::At(), RawRecord::FindRawBlock(), RawDigit::GetADC(), CandRecord::GetCandHandleIter(), CandHandle::GetDaughterIterator(), MomNavigator::GetFragment(), RecMinos::GetHeader(), CandHandle::GetName(), CandHandle::GetNDaughters(), CandDigitHandle::GetRawDigitIndex(), CandHeader::GetRun(), CandHeader::GetSnarl(), RawDigit::GetTDC(), header, MsgService::Instance(), MsgService::IsActive(), Msg::kDebug, JobCResult::kFailed, Msg::kInfo, JobCResult::kPassed, Msg::kVerbose, Msg::kWarning, and MSG.

00075 {
00079  CandRecord* candrec = dynamic_cast<CandRecord*>(mom->GetFragment("CandRecord"));
00080   if(!candrec){
00081     MSG("StripCands",Msg::kDebug) << " Unable to find CandRecord in mom " << endl;
00082     return JobCResult::kFailed;
00083   }
00084 
00085   const CandHeader* header  = dynamic_cast<const CandHeader*>(candrec->GetHeader());
00086 
00087   TIter iter(candrec->GetCandHandleIter());
00088   TObject* tobj = NULL;
00089   MSG("StripCands",Msg::kInfo)  << "************* New Mom **************" <<endl;
00090   if(header){
00091     MSG("StripCands",Msg::kInfo)  << "  Run:  " << header->GetRun()
00092                                <<  "    " << header->GetSnarl()<<endl;
00093   }
00094 
00095   RawRecord *rr = dynamic_cast<RawRecord *>(mom->GetFragment("RawRecord"));
00096   if (rr == 0) {
00097     MSG("StripCands", Msg::kWarning) << "No RawRecord in MOM." << endl;
00098     return JobCResult::kFailed;
00099   }
00100   const RawDigitDataBlock *rddb=dynamic_cast<const RawDigitDataBlock *>
00101     (rr->FindRawBlock("RawDigitDataBlock"));
00102 
00103   while((tobj = iter()) ){
00104     const CandHandle* cand = dynamic_cast<const CandHandle*>(tobj);
00105     assert(cand);
00106     MSG("StripCands",Msg::kInfo)  << cand->ClassName()<<":"
00107                                <<((cand->GetName())?cand->GetName():" ? ")
00108                                << "  N "  << cand->GetNDaughters() << endl;
00109     if(strcmp("CandDeMuxDigitListHandle", tobj->ClassName()) !=0 &&
00110        strcmp("CandDigitListHandle", tobj->ClassName()) !=0 &&
00111        strcmp("CandStripListHandle", tobj->ClassName()) !=0){
00112       TIter iter2(cand->GetDaughterIterator());
00113       TObject* tobj2 = 0;
00114       while((tobj2 = iter2())){
00115         const CandHandle* cand2= dynamic_cast<const CandHandle*>(tobj2);
00116         assert(cand2);
00117         MSG("StripCands",Msg::kInfo)  << "  " << cand2->ClassName()<<":"
00118                                    <<((cand2->GetName()!=NULL)?cand2->GetName():" ")<<endl;
00119       }
00120     }
00121     else if(MsgService::Instance()->IsActive("StripCands",Msg::kVerbose) && 
00122             strcmp("CandDigitListHandle", tobj->ClassName())==0){      
00123       TIter iter2(cand->GetDaughterIterator());
00124       TObject* tobj2 = 0;
00125       while((tobj2 = iter2())){
00126         const CandDigitHandle* cand2 = dynamic_cast<const CandDigitHandle*>(tobj2);
00127         const RawDigit* raw_digit = rddb->At(cand2->GetRawDigitIndex());
00128         MSG("StripCands",Msg::kVerbose) << cand2->GetRawDigitIndex() << " " 
00129                                         << raw_digit->GetADC() << " " 
00130                                         << raw_digit->GetTDC() << endl;
00131       }
00132     }
00133   }
00134   return JobCResult::kPassed; // kNoDecision, kFailed, etc.
00135 }

void StripCands::BeginJob ( void   )  [virtual]

Implement for notification of begin of job

(Document me!)

Reimplemented from JobCModule.

Definition at line 56 of file StripCands.cxx.

00057 {
00061 }

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

Configure the module given the Registry r

Reimplemented from JobCModule.

Definition at line 218 of file StripCands.cxx.

References fKeepDigitList, and Registry::GetCharString().

00219 {
00223   fKeepDigitList = r.GetCharString("keepdigitlist");
00224 }

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

Supply the default configuration for the module

Reimplemented from JobCModule.

Definition at line 196 of file StripCands.cxx.

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

00197 {
00201   static Registry r; // Default configuration for module
00202 
00203   // Set name of config
00204   std::string name = this->GetName();
00205   name += ".config.default";
00206   r.SetName(name.c_str());
00207 
00208   // Set values in configuration
00209   r.UnLockValues();
00210   r.Set("keepdigitlist","mergedigitlist");
00211   r.LockValues();
00212 
00213   return r;
00214 }

void StripCands::EndJob (  )  [virtual]

Implement for notification of end of job

(Document me!)

Reimplemented from JobCModule.

Definition at line 65 of file StripCands.cxx.

00066 {
00070 }

JobCResult StripCands::Reco ( MomNavigator mom  )  [virtual]

Implement this for read-write access to the MomNavigator

Removes all cands apart from the one named: fkeepdigitlist

Reimplemented from JobCModule.

Definition at line 139 of file StripCands.cxx.

References fKeepDigitList, CandRecord::GetCandHandleIter(), MomNavigator::GetFragment(), RecMinos::GetHeader(), CandHandle::GetName(), CandHeader::GetRun(), header, Msg::kDebug, JobCResult::kFailed, JobCResult::kPassed, MSG, CandRecord::RemoveCandHandle(), and CandHandle::SetName().

00140 {
00144   
00145  CandRecord* candrec = dynamic_cast<CandRecord*>(mom->GetFragment("CandRecord"));
00146   if(!candrec){
00147     MSG("StripCands",Msg::kDebug)  << " Unable to find CandRecord in mom " << endl;
00148     return JobCResult::kFailed;
00149   }
00150 
00151   const CandHeader* header  = dynamic_cast<const CandHeader*>(candrec->GetHeader());
00152   if(header){
00153     MSG("StripCands",Msg::kDebug)  << "Run:  " << header->GetRun()<<endl;
00154   }
00155 
00156   TIter iter(candrec->GetCandHandleIter());
00157   TObject* tobj = NULL;
00158   MSG("StripCands",Msg::kDebug)  << " New Mom : " <<endl;
00159   while( (tobj = iter()) ){
00160     CandHandle* cand = dynamic_cast<CandHandle*>(tobj);
00161     if( strcmp("candrmmulist", tobj->GetName()) ==0 ) { 
00162       MSG("StripCands",Msg::kDebug) << " Found and keeping: " 
00163                                  << tobj->ClassName() 
00164                                  <<":"<<tobj->GetName()<<endl;
00165       continue;
00166     }
00167     else if( strcmp(fKeepDigitList.c_str(), tobj->GetName()) !=0 ) {
00168       MSG("StripCands",Msg::kDebug) << " REMOVING: " <<  tobj->ClassName() 
00169                                  <<":"<<tobj->GetName()<<endl;
00170       candrec->RemoveCandHandle(cand);
00171     }
00172     else{
00173       MSG("StripCands",Msg::kDebug) <<" KEEPING: " <<  tobj->ClassName()
00174                                  <<":"<<tobj->GetName()<<endl;
00175       cand->SetName("canddigitlist");
00176       MSG("StripCands",Msg::kDebug) << "   Changed name " 
00177                                  << cand->GetName() <<endl; 
00178     }
00179   }
00180 
00181   /* NOT DOING THIS ANYMORE - CAN ALL BE CONFIGURED VIA MACRO
00182   //rename any Ntp objects:
00183   NtpStRecord *ntpst = dynamic_cast<NtpStRecord*> (mom->GetFragment("NtpStRecord"));
00184   if(ntpst) {
00185     MSG("StripCands",Msg::kDebug) << " RENAMING: " <<  ntpst->ClassName() 
00186                                   << ":" << ntpst->GetName() << endl;
00187     ntpst->SetName("NtpStRecordOld");
00188   }
00189   */
00190   
00191   return JobCResult::kPassed; // kNoDecision, kFailed, etc.
00192 }


Member Data Documentation

std::string StripCands::fKeepDigitList [private]

Definition at line 45 of file StripCands.h.

Referenced by Config(), and Reco().


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

Generated on 22 Nov 2017 for loon by  doxygen 1.6.1