ParticleReportHelper Class Reference

#include <ParticleReportHelper.h>

List of all members.

Public Member Functions

 ParticleReportHelper ()
 ~ParticleReportHelper ()
void Reset ()
void addtruth (ParticleTruthObject *h)
void addfound (ParticleObject *h)
void Process (ParticleObjectHolder &p)

Private Attributes

std::map< int, std::map< int,
std::map< int, double > > > 
found_map
std::map< int, std::map< int,
std::map< int, double > > > 
truth_map

Detailed Description

Definition at line 12 of file ParticleReportHelper.h.


Constructor & Destructor Documentation

ParticleReportHelper::ParticleReportHelper (  ) 

Definition at line 4 of file ParticleReportHelper.cxx.

00005 {
00006 
00007 //      sorter_map.clear();
00008 }

ParticleReportHelper::~ParticleReportHelper (  ) 

Definition at line 10 of file ParticleReportHelper.cxx.

00011 {
00012 }


Member Function Documentation

void ParticleReportHelper::addfound ( ParticleObject h  ) 

Definition at line 23 of file ParticleReportHelper.cxx.

References ParticleObject::energy, found_map, ParticleObject::particle_id, ParticleObject::plane, and ParticleObject::strip.

Referenced by ParticleReport::Reco().

00024 {
00025 
00026         for(int i=0;i<h->plane.size();i++)
00027 {               found_map[h->plane[i]][h->strip[i]][h->particle_id]+=h->energy[i];
00028 
00029 
00030         printf("adding particle to record matcher p,s,pid %d %d %d\n",h->plane[i],h->strip[i],h->particle_id);
00031 }
00032 }

void ParticleReportHelper::addtruth ( ParticleTruthObject h  ) 
void ParticleReportHelper::Process ( ParticleObjectHolder p  ) 

Definition at line 37 of file ParticleReportHelper.cxx.

References found_map, and truth_map.

Referenced by ParticleReport::Reco().

00038 {
00039 
00040         //iterate over map, and for each entry, make a new entry to add in p
00041 
00042 
00043         std::map<int, std::map<int, std::map<int, double> > >::iterator it1;
00044         std::map<int, std::map<int, double> > ::iterator it2;
00045         std::map<int, double>::iterator it3;
00046 
00047 
00048         std::map<int, std::map<int, double> > found_maxe_map;
00049         std::map<int, std::map<int, double> > found_tote_map;
00050         std::map<int, std::map<int, int> > found_maxpid_map;
00051 
00052         for(it1=found_map.begin();it1!=found_map.end();it1++)
00053         for(it2=it1->second.begin();it2!=it1->second.end();it2++)
00054         {
00055                 double found_tote=0;
00056                 double found_maxe=0;
00057                 int found_maxpid=0;
00058 
00059                 for(it3=it2->second.begin();it3!=it2->second.end();it3++)
00060                 {
00061                         found_tote+=found_map[it1->first][it2->first][it3->first];
00062 
00063                         if (found_map[it1->first][it2->first][it3->first]>found_maxe)
00064                         {
00065                                 found_maxe = found_map[it1->first][it2->first][it3->first];
00066                                 found_maxpid = it3->first;
00067                         }
00068                 }       
00069 
00070                 int plane = it1->first;
00071                 int strip = it2->first;
00072         
00073                 found_maxe_map[plane][strip]=found_maxe;
00074                 found_tote_map[plane][strip]=found_tote;
00075                 found_maxpid_map[plane][strip]=found_maxpid;
00076         }
00077 
00078 
00079         std::map<int, std::map<int, double> > true_maxe_map;
00080         std::map<int, std::map<int, double> > true_tote_map;
00081         std::map<int, std::map<int, int> > true_maxpid_map;
00082 
00083         for(it1=truth_map.begin();it1!=truth_map.end();it1++)
00084         for(it2=it1->second.begin();it2!=it1->second.end();it2++)
00085         {
00086                 double true_tote=0;
00087                 double true_maxe=0;
00088                 int true_maxpid=0;
00089 
00090                 for(it3=it2->second.begin();it3!=it2->second.end();it3++)
00091                 {
00092                         true_tote+=truth_map[it1->first][it2->first][it3->first];
00093 
00094                         if (truth_map[it1->first][it2->first][it3->first]>true_maxe)
00095                         {
00096                                 true_maxe = truth_map[it1->first][it2->first][it3->first];
00097                                 true_maxpid = it3->first;
00098                         }
00099                 }
00100 
00101                 true_maxe_map[it1->first][it2->first]=true_maxe;
00102                 true_tote_map[it1->first][it2->first]=true_tote;
00103                 true_maxpid_map[it1->first][it2->first]=true_maxpid;
00104         }
00105 
00106 
00107         //now iterate over found/true maps to get stats
00108 
00109 
00110         int totstrip=0;
00111         int matched_strips=0;
00112 
00113         double tote=0;
00114         double matched_e=0;
00115 
00116         for(it2=found_maxe_map.begin();it2!=found_maxe_map.end();it2++)
00117         for(it3=it2->second.begin();it3!=it2->second.end();it3++)
00118         {
00119                 totstrip++;
00120                 tote+=found_tote_map[it2->first][it3->first];
00121                 
00122                 if(found_maxpid_map[it2->first][it3->first]==true_maxpid_map[it2->first][it3->first])
00123                 {
00124                         matched_strips++;
00125                         matched_e+=found_maxe_map[it2->first][it3->first];
00126                 }
00127 
00128         }
00129 
00130    /*     ParticleReportObject *d = (ParticleReportObject*)p.particlematch->New(p.particlematch->GetEntries());
00131 
00132 
00133         d->totstrips=totstrip;
00134         d->matched_strips=matched_strips;
00135         d->tote=tote;
00136         d->matched_e=matched_e;
00137 */
00138 
00139 }

void ParticleReportHelper::Reset (  )  [inline]

Definition at line 19 of file ParticleReportHelper.h.

References found_map, and truth_map.

Referenced by ParticleReport::Reco().

00019 {found_map.clear(); truth_map.clear();};


Member Data Documentation

std::map<int, std::map<int, std::map<int, double> > > ParticleReportHelper::found_map [private]

Definition at line 30 of file ParticleReportHelper.h.

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

std::map<int, std::map<int, std::map<int, double> > > ParticleReportHelper::truth_map [private]

Definition at line 31 of file ParticleReportHelper.h.

Referenced by addtruth(), Process(), 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