ParticleReport Class Reference

#include <ParticleReport.h>

Inheritance diagram for ParticleReport:
JobCModule

List of all members.

Public Member Functions

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

Private Attributes

ParticleReportHelperreporter

Detailed Description

Id
ParticleReport.h,v 1.1 2009/06/19 14:32:39 scavan Exp

(Document me!)

scavan@fas.harvard.edu

Definition at line 14 of file ParticleReport.h.


Constructor & Destructor Documentation

ParticleReport::ParticleReport (  ) 

(Document me!)

Definition at line 31 of file ParticleReport.cxx.

References reporter.

00031                               :reporter(0)  
00032 {
00033 
00034 
00035 reporter = new ParticleReportHelper();
00036 
00037 
00041 }

ParticleReport::~ParticleReport (  ) 

(Document me!)

Definition at line 44 of file ParticleReport.cxx.

References reporter.

00045 {
00049 
00050 if(reporter) delete reporter;
00051 
00052 }


Member Function Documentation

void ParticleReport::BeginJob ( void   )  [virtual]

Implement for notification of begin of job

(Document me!)

Reimplemented from JobCModule.

Definition at line 56 of file ParticleReport.cxx.

00057 {
00061 }

void ParticleReport::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 190 of file ParticleReport.cxx.

00191 {
00195 }

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

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

00170 {
00174   static Registry r; // Default configuration for module
00175 
00176   // Set name of config
00177   std::string name = this->GetName();
00178   name += ".config.default";
00179   r.SetName(name.c_str());
00180 
00181   // Set values in configuration
00182   r.UnLockValues();
00183   r.LockValues();
00184 
00185   return r;
00186 }

void ParticleReport::EndJob (  )  [virtual]

Implement for notification of end of job

(Document me!)

Reimplemented from JobCModule.

Definition at line 65 of file ParticleReport.cxx.

00066 {
00070 }

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

Implement this for read-write access to the MomNavigator

(Document me!)

Reimplemented from JobCModule.

Definition at line 74 of file ParticleReport.cxx.

References ParticleReportHelper::addfound(), ParticleReportHelper::addtruth(), MomNavigator::AdoptFragment(), NtpStRecord::GetEvents(), MomNavigator::GetFragment(), MomNavigator::GetFragmentList(), NtpStRecord::GetStrips(), JobCResult::kPassed, n, ParticleObjectHolder::particlematch, ParticleObjectHolder::particles, ParticleObjectHolder::particletruth, ParticleReportHelper::Process(), reporter, and ParticleReportHelper::Reset().

00075 {
00079 
00080 //MSG("ParticleReport",Msg::kDebug) << "reco called\n";
00081 
00082   NtpStRecord *str=dynamic_cast<NtpStRecord *>(mom->GetFragment("NtpStRecord"));
00083 
00084 
00085   //std::vector<ParticleObjectHolder *>* hf;
00086   std:vector<TObject* > hft =( mom->GetFragmentList("ParticleObjectHolder"));
00087 
00088 
00089 
00090   int make_new_holder=1;
00091 
00092 
00093   if(hft.size()>0)
00094   {
00095       make_new_holder=0;
00096   }
00097  
00098 
00099 printf("size of found array %d\n",hft.size()); 
00100 
00101   std::vector<const NtpSREvent* > evts = str->GetEvents();
00102   std::vector<const NtpSRStrip* > stp = str->GetStrips();
00103 
00104   printf("Events %d \n",evts.size());
00105   if(evts.size()<1)
00106         {
00107 
00108                 if(make_new_holder)
00109                 {
00110                         ParticleObjectHolder * h = new ParticleObjectHolder(); 
00111                         mom->AdoptFragment(h);
00112                 }
00113 
00114                 return JobCResult::kPassed;  
00115         }
00116 
00117 
00118         printf("!!! %d events, %d  currently there \n", evts.size(), hft.size());
00119 
00120   //for(int ievt=0;ievt<evts.size();ievt++)
00121  // {
00122 int ievt=0;
00123 
00124         reporter->Reset();
00125 
00126 
00127         ParticleObjectHolder *n=0;
00128 
00129 
00130         if(make_new_holder || hft.size() < ievt+1)
00131         {
00132                 ParticleObjectHolder * h = new ParticleObjectHolder();
00133                 mom->AdoptFragment(h);
00134                 n=h;
00135         }else{
00136                 n=dynamic_cast<ParticleObjectHolder *>(hft[ievt]);
00137         }
00138 
00139 
00140 printf("partices in current evt %d array %d \n", ievt, n->particles->GetEntries());
00141 
00142         if(n->particlematch->GetEntries()>0)return JobCResult::kPassed;//continue; //dont rerun it
00143 
00144 
00145         //loop over found particles
00146         
00147 
00148                 //loop over planes, strips in found particles
00149 
00150                 for(int i=0;i<n->particletruth[0].GetEntries();i++)
00151                         reporter->addtruth((ParticleTruthObject*)n->particletruth[0][i]);
00152 
00153                 for(int i=0;i<n->particles[0].GetEntries();i++)
00154                         reporter->addfound((ParticleObject *)n->particles[0][i]);
00155 
00156                 //record 
00157                 reporter->Process(*n);
00158 
00159 
00160  // }
00161 
00162 
00163 
00164   return JobCResult::kPassed; // kNoDecision, kFailed, etc.
00165 }

void ParticleReport::Reset (  )  [virtual]

Implement to reset oneself

(Document me!)

Reimplemented from JobCModule.

Definition at line 199 of file ParticleReport.cxx.

00200 {
00204 }


Member Data Documentation

Definition at line 38 of file ParticleReport.h.

Referenced by ParticleReport(), Reco(), and ~ParticleReport().


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

Generated on 2 Nov 2017 for loon by  doxygen 1.6.1