ParticleTruthHelper Class Reference

#include <ParticleTruthHelper.h>

List of all members.

Public Member Functions

 ParticleTruthHelper ()
 ~ParticleTruthHelper ()
void Reset ()
void AddStrip (int mypid, int trkid, int myplane, int mystrip, double myenergy, int view)
void Process (ParticleObjectHolder &p)

Private Attributes

std::map< int, std::map< int,
std::map< int, std::map< int,
double > > > > 
main_map
std::map< int, std::map< int,
std::map< int, std::map< int,
int > > > > 
test_map
std::map< int, int > pid_map

Detailed Description

Definition at line 10 of file ParticleTruthHelper.h.


Constructor & Destructor Documentation

ParticleTruthHelper::ParticleTruthHelper (  ) 

Definition at line 12 of file ParticleTruthHelper.cxx.

00013 {
00014 
00015 //      sorter_map.clear();
00016 }

ParticleTruthHelper::~ParticleTruthHelper (  ) 

Definition at line 18 of file ParticleTruthHelper.cxx.

00019 {
00020 }


Member Function Documentation

void ParticleTruthHelper::AddStrip ( int  mypid,
int  trkid,
int  myplane,
int  mystrip,
double  myenergy,
int  view 
)

Definition at line 23 of file ParticleTruthHelper.cxx.

References main_map, pid_map, and test_map.

Referenced by ParticleTruthMaker::Reco().

00024 {
00025 
00026 
00027 
00028         if(test_map[view][plane][strip][trkid]!=1)      
00029         main_map[view][plane][strip][trkid]=0;   //reset if not already in use... there must be a better way to do this, if we can can guarente the default value for a double, otherwise, we may need to use an object instead of a double....
00030 
00031 
00032         main_map[view][plane][strip][trkid]+=myenergy;
00033         test_map[view][plane][strip][trkid]=1;
00034         pid_map[trkid]=pid;
00035 
00036 
00037 }

void ParticleTruthHelper::Process ( ParticleObjectHolder p  ) 

Definition at line 40 of file ParticleTruthHelper.cxx.

References MuELoss::a, UgliPlnHandle::GetCenter(), UgliGeomHandle::GetScintPlnHandle(), UgliScintPlnHandle::GetStripHandle(), UgliStripHandle::GetTPos(), it, SimFlag::kData, Detector::kFar, main_map, and s().

Referenced by ParticleTruthMaker::Reco().

00041 {
00042 
00043 
00044         VldContext vldc(Detector::kFar , SimFlag::kData , VldTimeStamp());
00045         UgliGeomHandle geo(vldc);            
00046 
00047 
00048         //iterate over map, and for each entry, make a new entry to add in p
00049 
00050         std::map<int, std::map<int, std::map<int, std::map<int, double> > > >::iterator it;
00051         std::map<int, std::map<int, std::map<int, double> > >::iterator it1;
00052         std::map<int, std::map<int, double> > ::iterator it2;
00053         std::map<int, double>::iterator it3;
00054 
00055 
00056 
00057 
00058         for(it=main_map.begin();it!=main_map.end();it++)
00059         for(it1=it->second.begin();it1!=it->second.end();it1++)
00060         {
00061                 double thisz=0;
00062 
00063                 PlexPlaneId pl(Detector::kFar, it1->first);
00064                 UgliScintPlnHandle  h = geo.GetScintPlnHandle(pl); 
00065                 thisz = h.GetCenter()[2];
00066 
00067                 for(it2=it1->second.begin();it2!=it1->second.end();it2++)
00068                 {
00069                         double thist=0;
00070                         PlexStripEndId s(pl,it2->first);
00071                         UgliStripHandle a = h.GetStripHandle(s);   
00072                         thist = a.GetTPos();
00073 
00074         
00075                         for(it3=it2->second.begin();it3!=it2->second.end();it3++)
00076                         {       
00077 /*
00078                                 ParticleTruthObject *d = (ParticleTruthObject*)p.particletruth->New(p.particletruth->GetEntries());
00079                                 d->plane=it1->first;
00080                                 d->strip=it2->first;
00081                                 d->trkid=it3->first;
00082                                 d->pid=pid_map[it3->first];
00083                                 d->sumenergy=it3->second;
00084                                 d->view=it->first;
00085                                 d->t=thist;
00086                                 d->z=thisz;
00087 */                      }
00088                 }
00089         }
00090 }

void ParticleTruthHelper::Reset (  )  [inline]

Definition at line 17 of file ParticleTruthHelper.h.

References main_map, and test_map.

Referenced by ParticleTruthMaker::Reco().

00017 {main_map.clear(); test_map.clear();};


Member Data Documentation

std::map<int, std::map<int, std::map<int, std::map<int, double> > > > ParticleTruthHelper::main_map [private]

Definition at line 26 of file ParticleTruthHelper.h.

Referenced by AddStrip(), Process(), and Reset().

std::map<int, int> ParticleTruthHelper::pid_map [private]

Definition at line 30 of file ParticleTruthHelper.h.

Referenced by AddStrip().

std::map<int, std::map<int, std::map<int, std::map<int, int> > > > ParticleTruthHelper::test_map [private]

Definition at line 28 of file ParticleTruthHelper.h.

Referenced by AddStrip(), and Reset().


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

Generated on 2 Nov 2017 for loon by  doxygen 1.6.1