StatisticalFluctuations Class Reference

#include <StatisticalFluctuations.h>

List of all members.

Public Member Functions

 StatisticalFluctuations (const VldContext &vldc)
virtual ~StatisticalFluctuations ()
void Fill (const AlignmentStrip &astrip)
void Reset (const VldContext &vldc, const int ntracks)
unsigned int GetNSubsets () const
map< unsigned int, map< PlexStripEndId,
SubsetSummary > > 
GetStripResidualSample () const
map< unsigned int, map< PlexScintMdlId,
SubsetSummary > > 
GetModuleResidualSample () const
map< unsigned int, map< PlexStripEndId,
SubsetSummary > > 
GetStripChargeSample () const
map< unsigned int, VldContextGetSubsetValidity () const
map< unsigned int, int > GetSubsetNRecords () const

Private Member Functions

void FillStripSubsetStat (map< PlexStripEndId, SubsetStat > &set, const PlexStripEndId &plexseid, const double &value)
void FillModuleSubsetStat (map< PlexScintMdlId, SubsetStat > &set, const PlexScintMdlId &plexmdlid, const double &value)

Private Attributes

map< PlexStripEndId, SubsetStatfmStripResidualCurrentSubset
map< unsigned int, map< PlexStripEndId,
SubsetSummary > > 
fmStripResidualSample
map< PlexStripEndId, SubsetStatfmStripChargeCurrentSubset
map< unsigned int, map< PlexStripEndId,
SubsetSummary > > 
fmStripChargeSample
map< PlexScintMdlId, SubsetStatfmMdlResidualCurrentSubset
map< unsigned int, map< PlexScintMdlId,
SubsetSummary > > 
fmMdlResidualSample
map< unsigned int, VldContextfmValidity
map< unsigned int, int > fmNRecords
unsigned int fNumberOfSubsets


Detailed Description

Definition at line 34 of file StatisticalFluctuations.h.


Constructor & Destructor Documentation

StatisticalFluctuations::StatisticalFluctuations ( const VldContext vldc  ) 

Definition at line 30 of file StatisticalFluctuations.cxx.

References fmValidity, and fNumberOfSubsets.

00031    :fNumberOfSubsets(0)
00032 {
00033    pair<unsigned int, VldContext> p_vld(fNumberOfSubsets, vldc);
00034    fmValidity.insert(p_vld);
00035 }

StatisticalFluctuations::~StatisticalFluctuations (  )  [virtual]

Definition at line 201 of file StatisticalFluctuations.cxx.

00202 {
00203 }


Member Function Documentation

void StatisticalFluctuations::Fill ( const AlignmentStrip astrip  ) 

Definition at line 38 of file StatisticalFluctuations.cxx.

References AlignmentStrip::charge, FillModuleSubsetStat(), FillStripSubsetStat(), fmMdlResidualCurrentSubset, fmStripChargeCurrentSubset, fmStripResidualCurrentSubset, PlexStripEndId::GetScintMdlId(), AlignmentStrip::plexseid, and AlignmentStrip::residual.

Referenced by AlignmentAlgorithm::Fill(), FillModuleSubsetStat(), and FillStripSubsetStat().

00039 {
00040    PlexStripEndId plexseid(astrip.plexseid);      
00041    PlexScintMdlId plexmdlid = plexseid.GetScintMdlId();      
00042    
00043    //fill strip residual sample
00044    FillStripSubsetStat(fmStripResidualCurrentSubset, plexseid, astrip.residual);
00045    
00046    //fill strip charge sample
00047    FillStripSubsetStat(fmStripChargeCurrentSubset, plexseid, astrip.charge);
00048    
00049    //fill module residual sample
00050    FillModuleSubsetStat(fmMdlResidualCurrentSubset, plexmdlid, astrip.residual);
00051 }

void StatisticalFluctuations::FillModuleSubsetStat ( map< PlexScintMdlId, SubsetStat > &  set,
const PlexScintMdlId plexmdlid,
const double &  value 
) [private]

Definition at line 179 of file StatisticalFluctuations.cxx.

References Fill(), and Munits::second.

Referenced by Fill().

00182 {
00183    map<PlexScintMdlId, SubsetStat>::iterator fit = set.find(plexmdlid);
00184    
00185    //create and insert SubsetStat object if it does not exist
00186    //otherwise fill with strip residual
00187    if(fit == set.end())
00188    {
00189       SubsetStat stat;
00190       stat.Fill(value);
00191       pair<PlexScintMdlId, SubsetStat> p(plexmdlid, stat);
00192       set.insert(p);
00193    }
00194    else
00195    {
00196       (fit -> second).Fill(value);
00197    }   
00198 }

void StatisticalFluctuations::FillStripSubsetStat ( map< PlexStripEndId, SubsetStat > &  set,
const PlexStripEndId plexseid,
const double &  value 
) [private]

Definition at line 157 of file StatisticalFluctuations.cxx.

References Fill(), and Munits::second.

Referenced by Fill().

00160 {
00161    map<PlexStripEndId, SubsetStat>::iterator fit = set.find(plexseid);
00162    
00163    //create and insert SubsetStat object if it does not exist
00164    //otherwise fill with strip residual
00165    if(fit == set.end())
00166    {
00167       SubsetStat stat;
00168       stat.Fill(value);
00169       pair<PlexStripEndId, SubsetStat> p(plexseid, stat);
00170       set.insert(p);
00171    }
00172    else
00173    {
00174       (fit -> second).Fill(value);
00175    }   
00176 }

map<unsigned int, map<PlexScintMdlId, SubsetSummary> > StatisticalFluctuations::GetModuleResidualSample (  )  const [inline]

Definition at line 52 of file StatisticalFluctuations.h.

References fmMdlResidualSample.

Referenced by AlignmentAlgorithm::AnalyzeModuleResiduals().

00053    {   return fmMdlResidualSample;}

unsigned int StatisticalFluctuations::GetNSubsets (  )  const [inline]

Definition at line 47 of file StatisticalFluctuations.h.

References fNumberOfSubsets.

Referenced by AlignmentAlgorithm::AnalyzeModuleResiduals(), and AlignmentAlgorithm::AnalyzeStripData().

00047 {return fNumberOfSubsets;};

map<unsigned int, map<PlexStripEndId, SubsetSummary> > StatisticalFluctuations::GetStripChargeSample (  )  const [inline]

Definition at line 55 of file StatisticalFluctuations.h.

References fmStripChargeSample.

Referenced by AlignmentAlgorithm::AnalyzeStripData().

00056    {   return fmStripChargeSample;}

map<unsigned int, map<PlexStripEndId, SubsetSummary> > StatisticalFluctuations::GetStripResidualSample (  )  const [inline]

Definition at line 49 of file StatisticalFluctuations.h.

References fmStripResidualSample.

Referenced by AlignmentAlgorithm::AnalyzeStripData().

00050    {   return fmStripResidualSample;}

map<unsigned int, int> StatisticalFluctuations::GetSubsetNRecords (  )  const [inline]

Definition at line 61 of file StatisticalFluctuations.h.

References fmNRecords.

Referenced by AlignmentAlgorithm::AnalyzeStripData().

00062    {   return fmNRecords;}

map<unsigned int, VldContext> StatisticalFluctuations::GetSubsetValidity (  )  const [inline]

Definition at line 58 of file StatisticalFluctuations.h.

References fmValidity.

Referenced by AlignmentAlgorithm::AnalyzeStripData().

00059    {   return fmValidity;}

void StatisticalFluctuations::Reset ( const VldContext vldc,
const int  ntracks 
)

Definition at line 54 of file StatisticalFluctuations.cxx.

References fmMdlResidualCurrentSubset, fmMdlResidualSample, fmNRecords, fmStripChargeCurrentSubset, fmStripChargeSample, fmStripResidualCurrentSubset, fmStripResidualSample, fmValidity, fNumberOfSubsets, SubsetSummary::mean, Munits::second, SubsetSummary::sigma, SubsetSummary::size, and SubsetSummary::sum.

Referenced by AlignmentAlgorithm::ResetSubset().

00055 {
00056    fNumberOfSubsets++;
00057 
00058    //Get mean, sigm and size for current strip residual subset
00059    map<PlexStripEndId, SubsetSummary> StripResSummary;
00060    for(map<PlexStripEndId, SubsetStat>::const_iterator sit = fmStripResidualCurrentSubset.begin();
00061        sit != fmStripResidualCurrentSubset.end(); ++sit)
00062    {
00063       const SubsetStat stat = sit -> second;
00064 
00065       //create and fill stat summary struct  
00066       SubsetSummary summary;
00067       summary.mean  = stat.GetMean();
00068       summary.sigma = stat.GetSigma();
00069       summary.sum   = stat.GetSum();
00070       summary.size  = stat.GetSize();
00071       
00072       pair<PlexStripEndId, SubsetSummary> p(sit->first, summary);
00073       StripResSummary.insert(p);
00074    }
00075 
00076    map<unsigned int, map<PlexStripEndId, SubsetSummary> >::const_iterator fsit =
00077       fmStripResidualSample.find(fNumberOfSubsets);
00078    if(fsit != fmStripResidualSample.end())
00079       abort();
00080    else
00081    {
00082       pair<unsigned int, map<PlexStripEndId, SubsetSummary> > p(fNumberOfSubsets, StripResSummary);
00083       fmStripResidualSample.insert(p);
00084    }
00085 
00086    //Get mean, sigm and size for current strip charge subset
00087    map<PlexStripEndId, SubsetSummary> StripChargeSummary;
00088    for(map<PlexStripEndId, SubsetStat>::const_iterator sit = fmStripChargeCurrentSubset.begin();
00089        sit != fmStripChargeCurrentSubset.end(); ++sit)
00090    {
00091       const SubsetStat stat = sit -> second;
00092 
00093       //create and fill stat summary struct      
00094       SubsetSummary summary;
00095       summary.mean  = stat.GetMean();
00096       summary.sigma = stat.GetSigma();
00097       summary.sum   = stat.GetSum();
00098       summary.size  = stat.GetSize();
00099       
00100       pair<PlexStripEndId, SubsetSummary> p(sit->first, summary);
00101       StripChargeSummary.insert(p);
00102    }
00103 
00104 
00105    fsit = fmStripChargeSample.find(fNumberOfSubsets);
00106    if(fsit != fmStripChargeSample.end())
00107       abort();
00108    else
00109    {
00110       pair<unsigned int, map<PlexStripEndId, SubsetSummary> > p(fNumberOfSubsets, StripChargeSummary);
00111       fmStripChargeSample.insert(p);
00112    }
00113 
00114    //Get mean, sigm and size for current module residual subset
00115    map<PlexScintMdlId, SubsetSummary> MdlResSummary;
00116    for(map<PlexScintMdlId, SubsetStat>::const_iterator mit = fmMdlResidualCurrentSubset.begin();
00117        mit != fmMdlResidualCurrentSubset.end(); ++mit)
00118    {
00119       const SubsetStat stat = mit -> second;
00120       
00121       //create and fill stat summary struct  
00122       SubsetSummary summary;
00123       summary.mean  = stat.GetMean();
00124       summary.sigma = stat.GetSigma();
00125       summary.sum   = stat.GetSum();
00126       summary.size  = stat.GetSize();
00127       
00128       pair<PlexScintMdlId, SubsetSummary> p(mit->first, summary);
00129       MdlResSummary.insert(p);
00130    }
00131 
00132    map<unsigned int, map<PlexScintMdlId, SubsetSummary> >::const_iterator fmit =
00133       fmMdlResidualSample.find(fNumberOfSubsets);
00134    if(fmit != fmMdlResidualSample.end())
00135       abort();
00136    else
00137    {
00138       pair<unsigned int, map<PlexScintMdlId, SubsetSummary> > p(fNumberOfSubsets, MdlResSummary);
00139       fmMdlResidualSample.insert(p);
00140    }
00141    
00142    //insert validity context for time subset was reset
00143    pair<unsigned int, VldContext> p_vld(fNumberOfSubsets, vldc);
00144    fmValidity.insert(p_vld);
00145 
00146    
00147    pair<unsigned int, int> p_record(fNumberOfSubsets, ntracks);
00148    fmNRecords.insert(p_record);
00149 
00150    //clear subset maps
00151    fmStripResidualCurrentSubset.clear();
00152    fmStripChargeCurrentSubset.clear();
00153    fmMdlResidualCurrentSubset.clear();
00154 }


Member Data Documentation

map<PlexScintMdlId, SubsetStat> StatisticalFluctuations::fmMdlResidualCurrentSubset [private]

Definition at line 85 of file StatisticalFluctuations.h.

Referenced by Fill(), and Reset().

map<unsigned int, map<PlexScintMdlId, SubsetSummary> > StatisticalFluctuations::fmMdlResidualSample [private]

Definition at line 86 of file StatisticalFluctuations.h.

Referenced by GetModuleResidualSample(), and Reset().

map<unsigned int, int> StatisticalFluctuations::fmNRecords [private]

Definition at line 92 of file StatisticalFluctuations.h.

Referenced by GetSubsetNRecords(), and Reset().

map<PlexStripEndId, SubsetStat> StatisticalFluctuations::fmStripChargeCurrentSubset [private]

Definition at line 81 of file StatisticalFluctuations.h.

Referenced by Fill(), and Reset().

map<unsigned int, map<PlexStripEndId, SubsetSummary> > StatisticalFluctuations::fmStripChargeSample [private]

Definition at line 82 of file StatisticalFluctuations.h.

Referenced by GetStripChargeSample(), and Reset().

map<PlexStripEndId, SubsetStat> StatisticalFluctuations::fmStripResidualCurrentSubset [private]

Definition at line 77 of file StatisticalFluctuations.h.

Referenced by Fill(), and Reset().

map<unsigned int, map<PlexStripEndId, SubsetSummary> > StatisticalFluctuations::fmStripResidualSample [private]

Definition at line 78 of file StatisticalFluctuations.h.

Referenced by GetStripResidualSample(), and Reset().

map<unsigned int, VldContext> StatisticalFluctuations::fmValidity [private]

Definition at line 89 of file StatisticalFluctuations.h.

Referenced by GetSubsetValidity(), Reset(), and StatisticalFluctuations().

unsigned int StatisticalFluctuations::fNumberOfSubsets [private]

Definition at line 94 of file StatisticalFluctuations.h.

Referenced by GetNSubsets(), Reset(), and StatisticalFluctuations().


The documentation for this class was generated from the following files:
Generated on Wed Dec 10 22:50:34 2014 for loon by  doxygen 1.4.7