SimCheck Class Reference

#include <SimCheck.h>

Inheritance diagram for SimCheck:
JobCModule

List of all members.

Public Member Functions

 SimCheck ()
 ~SimCheck ()
JobCResult Ana (const MomNavigator *mom)
const RegistryDefaultConfig () const
void Config (const Registry &r)

Detailed Description

Id
SimCheck.h,v 1.1 2005/12/09 00:07:10 tagg Exp

(Document me!)

tagg@minos.phy.tufts.edu

Definition at line 12 of file SimCheck.h.


Constructor & Destructor Documentation

SimCheck::SimCheck (  ) 

(Document me!)

Definition at line 27 of file SimCheck.cxx.

00028 {
00032 }

SimCheck::~SimCheck (  ) 

(Document me!)

Definition at line 35 of file SimCheck.cxx.

00036 {
00040 }


Member Function Documentation

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

Implement this for read only access to the MomNavigator

(Document me!)

Reimplemented from JobCModule.

Definition at line 44 of file SimCheck.cxx.

References RecDataRecord< T >::FindComponent(), MomNavigator::FragmentIter(), DigiSignal::GetHit(), DigiSignal::GetNumberOfHits(), Msg::kError, JobCResult::kFailed, JobCResult::kPassed, and MSG.

00045 {
00049 
00050   SimSnarlRecord* simsnarl = 0;
00051   TObject* tobj;
00052   TIter    fragiter = mom->FragmentIter();
00053 
00054   // Get the simsnarl.
00055   while( ( tobj = fragiter.Next() ) ) {
00056     simsnarl = dynamic_cast<SimSnarlRecord*>(tobj);
00057     if(simsnarl) break;
00058   }
00059   
00060   // Verify there IS a simsnarl.
00061   if(!simsnarl) {
00062     MSG("Photon",Msg::kError) << "No SimSnarl found. You must run RerootToTruthModule()!" << endl;
00063     return JobCResult::kFailed;
00064   }
00065 
00066 
00067   const TObjArray* hitlist = 
00068     dynamic_cast<const TObjArray*>(simsnarl->FindComponent(0,"DigiScintHits"));
00069   if(!hitlist) return JobCResult::kFailed;
00070 
00071   //const TObjArray* pelist = 
00072   //  dynamic_cast<const TObjArray*>(simsnarl->FindTemporary(0,"DigiListPe"));
00073 
00074   //if(!pelist) return JobCResult::kFailed;
00075 
00076   const TObjArray* signallist = 
00077     dynamic_cast<const TObjArray*>(simsnarl->FindComponent(0,"DigiSignal"));
00078   if(!signallist) return JobCResult::kFailed;
00079 
00080   std::set<const DigiScintHit*> hits;
00081   std::set<const DigiScintHit*> sighits;
00082   std::set<const DigiScintHit*> intersection;
00083   std::set<const DigiScintHit*> difference1;
00084   std::set<const DigiScintHit*> difference2;
00085   
00086 
00087   TIter hitarrayIter(hitlist);
00088   while( (tobj = hitarrayIter.Next()) ) {
00089     const DigiScintHit* scinthit = dynamic_cast<const DigiScintHit*>(tobj);
00090     if(scinthit) {
00091       hits.insert(scinthit);
00092     }
00093   } 
00094 
00095   TIter sigarrayIter(signallist);
00096   while( (tobj = sigarrayIter.Next()) ) {
00097     const DigiSignal* signal = dynamic_cast<const DigiSignal*>(tobj);
00098     if(signal) {
00099       for(UInt_t i=0; i<signal->GetNumberOfHits(); i++) {
00100         sighits.insert(signal->GetHit(i));
00101       }
00102     }
00103   } 
00104 
00105 //gmi These unused declarations are giving an error in GCC 4.4.0
00106 //gmi  set_intersection(hits.begin(),hits.end(),
00107 //gmi              sighits.begin(), sighits.end(),
00108 //gmi              inserter(intersection,intersection.begin()) );
00109 //gmi
00110 //gmi  set_difference(hits.begin(), hits.end(),          
00111 //gmi            sighits.begin(), sighits.end(),
00112 //gmi            inserter(difference1,difference1.begin()) );
00113 //gmi
00114 //gmi  set_difference(sighits.begin(), sighits.end(),
00115 //gmi            hits.begin(), hits.end(),               
00116 //gmi            inserter(difference2,difference2.begin()) );
00117 
00118   cout << "SimCheck-----------------------------------" << endl;
00119   cout << "In Hit list: " << hits.size() << endl;
00120   cout << "In DigiSignals: " << sighits.size() << endl;
00121   cout << "Intersection: " << intersection.size() << endl;
00122   cout << "Diff1: " << difference1.size() << endl;
00123   cout << "Diff2: " << difference2.size() << endl;
00124   
00125 
00126   return JobCResult::kPassed; // kNoDecision, kFailed, etc.
00127 }

void SimCheck::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 152 of file SimCheck.cxx.

00153 {
00157 }

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

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

00132 {
00136   static Registry r; // Default configuration for module
00137 
00138   // Set name of config
00139   std::string name = this->GetName();
00140   name += ".config.default";
00141   r.SetName(name.c_str());
00142 
00143   // Set values in configuration
00144   r.UnLockValues();
00145   r.LockValues();
00146 
00147   return r;
00148 }


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

Generated on 22 Nov 2017 for loon by  doxygen 1.6.1