ParticleTruthMaker Class Reference

#include <ParticleTruthMaker.h>

Inheritance diagram for ParticleTruthMaker:
JobCModule

List of all members.

Public Member Functions

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

Private Attributes

ParticleTruthHelperhelper

Detailed Description

Id
ParticleTruthMaker.h,v 1.1 2009/06/19 14:32:40 scavan Exp

(Document me!)

scavan@fas.harvard.edu

Definition at line 14 of file ParticleTruthMaker.h.


Constructor & Destructor Documentation

ParticleTruthMaker::ParticleTruthMaker (  ) 

(Document me!)

Definition at line 33 of file ParticleTruthMaker.cxx.

References helper.

00033                                        :helper(0)  
00034 {
00035 
00036 helper = new ParticleTruthHelper();
00037 
00038 
00039 
00043 }

ParticleTruthMaker::~ParticleTruthMaker (  ) 

(Document me!)

Definition at line 46 of file ParticleTruthMaker.cxx.

References helper.

00047 {
00051 
00052 if(helper) delete helper;
00053 
00054 }


Member Function Documentation

void ParticleTruthMaker::BeginJob ( void   )  [virtual]

Implement for notification of begin of job

(Document me!)

Reimplemented from JobCModule.

Definition at line 58 of file ParticleTruthMaker.cxx.

00059 {
00063 }

void ParticleTruthMaker::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 226 of file ParticleTruthMaker.cxx.

00227 {
00231 }

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

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

00206 {
00210   static Registry r; // Default configuration for module
00211 
00212   // Set name of config
00213   std::string name = this->GetName();
00214   name += ".config.default";
00215   r.SetName(name.c_str());
00216 
00217   // Set values in configuration
00218   r.UnLockValues();
00219   r.LockValues();
00220 
00221   return r;
00222 }

void ParticleTruthMaker::EndJob (  )  [virtual]

Implement for notification of end of job

(Document me!)

Reimplemented from JobCModule.

Definition at line 67 of file ParticleTruthMaker.cxx.

00068 {
00072 }

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

Implement this for read-write access to the MomNavigator

(Document me!)

continue; //dont rerun it

Reimplemented from JobCModule.

Definition at line 76 of file ParticleTruthMaker.cxx.

References ParticleTruthHelper::AddStrip(), MomNavigator::AdoptFragment(), NtpMCDigiScintHit::dE, NtpStRecord::digihit, NtpStRecord::GetEvents(), MomNavigator::GetFragment(), MomNavigator::GetFragmentList(), helper, NtpMCStdHep::IdHEP, JobCResult::kPassed, n, ParticleObjectHolder::particles, ParticleObjectHolder::particletruth, NtpMCDigiScintHit::plane, NtpMCDigiScintHit::planeview, ParticleTruthHelper::Process(), ParticleTruthHelper::Reset(), NtpStRecord::stdhep, NtpMCDigiScintHit::strip, and NtpMCDigiScintHit::trkId.

00077 {
00081 
00082 //MSG("ParticleTruthMaker",Msg::kDebug) << "reco called\n";
00083 
00084   NtpStRecord *str=dynamic_cast<NtpStRecord *>(mom->GetFragment("NtpStRecord"));
00085 
00086 
00087   //std::vector<ParticleObjectHolder *>* hf;
00088   std:vector<TObject* > hft =( mom->GetFragmentList("ParticleObjectHolder"));
00089 
00090 
00091 
00092   int make_new_holder=1;
00093 
00094 
00095   if(hft.size()>0)
00096   {
00097       make_new_holder=0;
00098   }
00099  
00100 
00101 printf("size of found array %d\n",hft.size()); 
00102 
00103   std::vector<const NtpSREvent* > evts = str->GetEvents();
00104   
00105 
00106   //TClonesArray * digihit = str->digihit;
00107 
00108   printf("Events %d \n",evts.size());
00109   if(evts.size()<1)
00110         {
00111 
00112                 if(make_new_holder)
00113                 {
00114                         ParticleObjectHolder * h = new ParticleObjectHolder(); 
00115                         mom->AdoptFragment(h);
00116                 }
00117 
00118                 return JobCResult::kPassed;  
00119         }
00120 
00121 
00122         printf("!!! %d events, %d  currently there \n", evts.size(), hft.size());
00123 
00124 //for now multiple events are in the same TObjArray...
00125 
00126 int ievt=0;
00127  // for(int ievt=0;ievt<evts.size();ievt++)
00128  // {
00129 
00130    //    std::vector<const NtpSRStrip* > stp = str->GetStrips(ievt);
00131 //      TClonesArray * digihit = &( str->digihit[ievt]); 
00132 
00133         TClonesArray * digihit = str->digihit;
00134 
00135 
00136         TClonesArray * stdhep = str->stdhep;
00137         
00138 //      TClonesArray *digihit = &dh[ievt];
00139 
00140         helper->Reset();
00141 
00142 
00143         ParticleObjectHolder *n=0;
00144 
00145 
00146         if(make_new_holder || hft.size() < ievt+1)
00147         {
00148                 ParticleObjectHolder * h = new ParticleObjectHolder();
00149                 mom->AdoptFragment(h);
00150                 n=h;
00151         }else{
00152                 n=dynamic_cast<ParticleObjectHolder *>(hft[ievt]);
00153         }
00154 
00155 
00156 printf("partices in current evt %d array %d \n", ievt, n->particles->GetEntries());
00157 
00158         if(n->particletruth->GetEntries()>0)return JobCResult::kPassed; 
00159 
00160 
00161 
00162 
00163         printf("-event %d  with %d strips\n",ievt,evts[ievt]->nstrip);
00164 
00165         //Load processor with event strip data
00166         for(int i=0;i<digihit[ievt].GetEntries();i++)
00167         {
00168         //      helper->AddStrip(stp[evts[ievt]->stp[i]]->plane, stp[evts[ievt]->stp[i]]->strip, (stp[evts[ievt]->stp[i]]->ph0.sigcor+stp[evts[ievt]->stp[i]]->ph1.sigcor)/565.0, stp[evts[ievt]->stp[i]]->tpos, stp[evts[ievt]->stp[i]]->z);
00169                 NtpMCDigiScintHit * dh =  ( NtpMCDigiScintHit *)digihit[ievt][i];
00170                 
00171 
00172                 int trkid = dh->trkId;
00173                 trkid=trkid<0?-trkid:trkid; //abs it
00174 
00175                 NtpMCStdHep * sh = (NtpMCStdHep *)stdhep[ievt][trkid];
00176 
00177                 
00178 
00179                 helper->AddStrip(sh->IdHEP, trkid, dh->plane,dh->strip, dh->dE, dh->planeview);
00180 
00181 
00182 //              printf("%d %d %d %f\n", dh->pId, dh->plane,dh->strip, dh->dE);
00183 
00184         }
00185 
00186         helper->Process(*n);
00187         
00188 
00189         //process event, returns particleobject 
00190 
00191 //dont need digihits anymore, so reset them
00192 digihit->Clear();
00193 
00194   //}
00195 
00196 
00197 
00198 
00199 
00200   return JobCResult::kPassed; // kNoDecision, kFailed, etc.
00201 }

void ParticleTruthMaker::Reset (  )  [virtual]

Implement to reset oneself

(Document me!)

Reimplemented from JobCModule.

Definition at line 235 of file ParticleTruthMaker.cxx.

00236 {
00240 }


Member Data Documentation

Definition at line 38 of file ParticleTruthMaker.h.

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


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

Generated on 2 Nov 2017 for loon by  doxygen 1.6.1