RockMatrixRAF0720Eonly Class Reference

#include <RockMatrixRAF0720Eonly.h>

Inheritance diagram for RockMatrixRAF0720Eonly:
RockMatrix NuMatrix

List of all members.

Public Member Functions

 RockMatrixRAF0720Eonly (Double_t POT=0.0)
 Constructor: sets up fit, display and Jess histograms.
virtual void PrepareBins (RockEvent *nu) const
 Finds the global bin number for an event.
virtual void FillJess (const RockEvent &nu, const Double_t weight)
 Fills true-to-reco histograms for input into Jess's fitter.
virtual void Fill (const RockEvent &nu, const Double_t weight, const bool display=false)
 Fills histograms that are used in the fit and optionally display histograms.
virtual void Fill (const NuEvent &nu, const Double_t weight, const bool display=false)
 Fills histograms that are used in the fit and optionally display histograms.
virtual void FillFromFileRockEvents (TString fname, TString brName="r")
 Fills (using Fill()) using an input file of RockEvents.
virtual void FillFromFileNuEvents (TString fname, TString brName="s")
 Fills (using Fill()) using an input file of NuEvents.
virtual void ResetPOT (Double_t new_POT)
 We need a special ResetPOT.
virtual Double_t StatsLikelihood (const NuMatrix *with) const
 Computes the log likelihood.
virtual Double_t StatsLikelihood (const RockMatrixRAF0720Eonly *with) const
 Computes the log likelihood.
virtual RockMatrixRAF0720EonlyCopy (void) const
 Makes a 'deep copy' - every subclass should implement this.
virtual Bool_t Complete () const
 Always returns true; not clear what the purpose is.
virtual TH1 * Spectrum (void) const
 Not implemented.
virtual void Draw (Option_t *option="")
 Does nothing (no drawing, for instance).
virtual Int_t Write (const TString &name) const
 Writes to the currently open file fit, Jess, and display histograms.
virtual Int_t Read (const TString &fname, const TString &name)
 Reads in fit, Jess and display histograms.
virtual void SetValue (Double_t val)
 Do not use; has no clear purpose.
virtual void ScaleToPOT (Double_t new_POT)
 Scales by protons-on-target.
virtual void Scale (Double_t value)
 Scales all histograms uniformly.
virtual void Divide (const NuMatrix &correction)
 Do not use; no clear purpose.
virtual void Divide (const TH1 &correction, const Option_t *option="")
 Do not use; no clear purpose.
virtual void Divide (const TGraph &correction)
 Do not use; no clear purpose.
virtual void Multiply (const NuMatrix &correction)
 Do not use; no clear purpose.
virtual void Multiply (const TH1 &correction, const Option_t *option="")
 Do not use; no clear purpose.
virtual void Multiply (const TGraph &correction)
 Do not use; no clear purpose.
virtual void Add (const NuMatrix &correction, Bool_t addpot=false)
 Add the fit histograms of this with another set.
virtual void Add (const RockMatrixRAF0720Eonly &correction, Bool_t addpot=false)
 Add the fit histograms of this with another set.
virtual void Subtract (const NuMatrix &correction)
 Subtract the fit histograms another set from this.
virtual void Subtract (const RockMatrixRAF0720Eonly &correction)
 Subtract the fit histograms another set from this.
virtual void RecoToTrue (const TH2D &correction)
 Do not use; no clear purpose (the purpose suggested by the name is handled elsewhere).
virtual void TrueToReco (const TH2D &correction)
 Do not use; no clear purpose (the purpose suggested by the name is handled elsewhere).
virtual void ExtrapolateNDToFD (const TH2D &beammatrix)
 Do not use; no clear purpose (the purpose suggested by the name is handled elsewhere).
virtual void Oscillate (const Double_t dm2, const Double_t sn2)
 Do not use; no clear purpose (the purpose suggested by the name is handled elsewhere).
virtual void DecayCC (double, double, double)
 Do not use; no clear purpose (the purpose suggested by the name is handled elsewhere).
virtual void DecayNC (double, double)
 Do not use; no clear purpose (the purpose suggested by the name is handled elsewhere).
virtual void DecayMuToTau (double, double, double)
 Do not use; no clear purpose (the purpose suggested by the name is handled elsewhere).
virtual void Decohere (double, double, double)
 Do not use; no clear purpose (the purpose suggested by the name is handled elsewhere).
NuMatrix1DFront (void)
 Returns fit histogram for front events.
NuMatrix1DGap (void)
 Returns fit histogram for gap events.
NuMatrix1DGapEdge (void)
 Returns fit histogram for gap edge events.
NuMatrix1DBack (void)
 Returns fit histogram for back events.
NuMatrix1DEdgeRock (void)
 Returns fit histogram for rock-like edge events.
NuMatrix1DEdgeDet (void)
 Returns fit histogram for detector-like edge events.
NuMatrix1Ddispfront (void)
 Return display histogram for front events.
NuMatrix1Ddispgap (void)
 Returns display histogram for gap events.
NuMatrix1Ddispgapedge (void)
 Returns display histogram for gap edge events.
NuMatrix1Ddispback (void)
 Returns display histogram for back events.
NuMatrix1Ddispedgerock (void)
 Returns display histogram for rock-like edge events.
NuMatrix1Ddispedgedet (void)
 Returns display histogram for detector-like edge events.
NuMatrix1Ddisprocklike (void)
 Returns display histogram for all rock-like events.
NuMatrix1Ddispdetlike (void)
 Returns display histogram for all detector-like events.
NuMatrix1Ddispall (void)
 Returns display histogram for all RAF events.
NuMatrix1Ddispallnc (void)
 Returns display histogram for true neutral current events.
NuMatrix2DJess_ccmu (void)
 Returns Jess histogram for true CC numu(bar) events.
NuMatrix2DJess_cctau (void)
 Returns Jess histogram for true CC nutau(bar) events.
NuMatrix1DJess_no (void)
 Returns Jess histogram for true non-ocillating events (neutral current, nue(bar)).
NuMatrix1DAllReco (void)
 Returns fit histogram in global bin number.
NuMatrix1DAllRecoNW (void)
 Returns fit histogram with no monte carlo event weighting (so the MC statistics are obvious).
NuMatrix1DAllTruth (void)
 Returns histogram of true neutrino energy for all RAF events.

Static Public Member Functions

static int er2GlobalBin (const Float_t trkEn, const Int_t regionTrkVtx, const Char_t edgemid)
 Given an energy and detector region, returns the global RAF bin number.
static void GlobalBin2er (Float_t &trkEn, Int_t &regionTrkVtx, Char_t &edgemid, int globalbin)
 Given a global RAF bin number, provides the average energy and region.
static void GlobalBin2trkEn (Float_t &trkEn, int globalbin)
 Given a global RAF bin number, provides the average energy.

Protected Attributes

NuMatrix1D fFront
NuMatrix1D fGap
NuMatrix1D fGapEdge
NuMatrix1D fBack
NuMatrix1D fEdgeRock
NuMatrix1D fEdgeDet
NuMatrix1D fAllReco
NuMatrix1D fAllRecoNW
NuMatrix1D fAllTruth
NuMatrix1D fdispfront
NuMatrix1D fdispgap
NuMatrix1D fdispgapedge
NuMatrix1D fdispback
NuMatrix1D fdispedgerock
NuMatrix1D fdispedgedet
NuMatrix1D fdisprocklike
NuMatrix1D fdispdetlike
NuMatrix1D fdispall
NuMatrix1D fdispallnc
NuMatrix2D fJess_ccmu
NuMatrix2D fJess_cctau
NuMatrix1D fJess_no

Detailed Description

CC 2010 official analysis for Rock and Antifiducial Muons

Definition at line 20 of file RockMatrixRAF0720Eonly.h.


Constructor & Destructor Documentation

RockMatrixRAF0720Eonly::RockMatrixRAF0720Eonly ( Double_t  POT = 0.0  ) 

Constructor: sets up fit, display and Jess histograms.

Definition at line 112 of file RockMatrixRAF0720Eonly.cxx.

References coarse(), coarsedisp(), fAllReco, fAllRecoNW, fAllTruth, fBack, fdispall, fdispallnc, fdispback, fdispdetlike, fdispedgedet, fdispedgerock, fdispfront, fdispgap, fdispgapedge, fdisprocklike, fEdgeDet, fEdgeRock, fFront, fGap, fGapEdge, fine(), finedisp(), fJess_ccmu, fJess_cctau, fJess_no, Plot::Format(), NBINSCOARSE, NBINSFINE, NuMatrix1D::SetSpectrum(), NuMatrix2D::SetSpectrum(), and summeddisp().

Referenced by Copy().

00112                                                            :
00113                                            NuMatrix(POT), RockMatrix(POT)
00114 {
00115   static unsigned int hin = 0; // Shut ROOT up about histogram names
00116   hin++;
00117 
00118   // Hey look!  It's one of those ROOT functions that modifies a global state!
00119   // I'll do all the extra work necessary to avoid this hurting other people.
00120   bool restore_sumw2 = TH1::GetDefaultSumw2();
00121   TH1::SetDefaultSumw2(); // yes, this sets it for TH1D, TH2D, etc.
00122 
00123   coarse.Sumw2();
00124   fine.Sumw2();
00125   coarsedisp.Sumw2();
00126   finedisp.Sumw2();
00127   summeddisp.Sumw2();
00128 
00129   fFront   .SetSpectrum(fine);
00130   fEdgeRock.SetSpectrum(fine);
00131   fEdgeDet .SetSpectrum(fine);
00132   fGap     .SetSpectrum(coarse);
00133   fGapEdge .SetSpectrum(coarse);
00134   fBack    .SetSpectrum(coarse);
00135 
00136   const int NHISTOS = 6;  // These are the numbers used directly for analysis
00137   // normal bins plus under & overflow for each, even if those are always empty
00138   int totalbins = NBINSCOARSE*3 + NBINSFINE*3 + NHISTOS*2;
00139 
00140 // ------------------------------------------------------------------------
00141 
00142   // These are for Jess and not used directly by the RAF analysis
00143   TH2D true2reco(TString::Format("trueenergy2recobin%d", hin),
00144                    "trueenergy2recobin", 800, 0, 200, totalbins, 0, totalbins);
00145 
00146   TH1D oned(TString::Format("oned%d", hin), "", totalbins, 0, totalbins);
00147 
00148   fJess_ccmu.SetSpectrum(true2reco); // CC nu mu (bar) events
00149   fJess_cctau.SetSpectrum(true2reco); // CC nu tau (bar) events
00150   fJess_no.SetSpectrum(oned); // All else, i.e. things that don't oscillate
00151 
00152 // ------------------------------------------------------------------------
00153 
00154   // This is for convenience of debugging
00155   TH1D reco(TString::Format("recobin%d", hin),"recobin",totalbins,0,totalbins);
00156   fAllReco.SetSpectrum(reco);
00157   fAllRecoNW.SetSpectrum(reco);
00158 
00159   TH1D truth(TString::Format("truthbin%d", hin), "truthbin", 800, 0, 200);
00160   fAllTruth.SetSpectrum(truth);
00161 
00162 
00163 // ------------------------------------------------------------------------
00164 
00165   // These are for display (and debugging)
00166 
00167   fdisprocklike.SetSpectrum(summeddisp);
00168   fdispdetlike .SetSpectrum(summeddisp);
00169   fdispall     .SetSpectrum(summeddisp);
00170   fdispallnc   .SetSpectrum(summeddisp);
00171 
00172   fdispfront   .SetSpectrum(finedisp);
00173   fdispedgerock.SetSpectrum(finedisp);
00174   fdispedgedet .SetSpectrum(finedisp);
00175   fdispgap     .SetSpectrum(coarsedisp);
00176   fdispgapedge .SetSpectrum(coarsedisp);
00177   fdispback    .SetSpectrum(coarsedisp);
00178 
00179   // Put the GLOBAL state back to where it was at the top
00180   TH1::SetDefaultSumw2(restore_sumw2);
00181 }


Member Function Documentation

void RockMatrixRAF0720Eonly::Add ( const RockMatrixRAF0720Eonly correction,
Bool_t  addpot = false 
) [virtual]

Add the fit histograms of this with another set.

Implements NuMatrix.

Definition at line 782 of file RockMatrixRAF0720Eonly.cxx.

References NuMatrix1D::Add(), fBack, fEdgeDet, fEdgeRock, fFront, fGap, fGapEdge, NuMatrix::GetPOT(), and ResetPOT().

00783 {
00784   // Base the addition on the 'essential' histograms listed in complete
00785   // Also, this probably won't be used so don't bother with validation/clever behaviour for now
00786   fFront.Add(correction.fFront);
00787   fGap.Add(correction.fGap);
00788   fGapEdge.Add(correction.fGapEdge);
00789   fBack.Add(correction.fBack);
00790   fEdgeRock.Add(correction.fEdgeRock);
00791   fEdgeDet.Add(correction.fEdgeDet);
00792   
00793   if (addpot) ResetPOT(GetPOT()+correction.GetPOT());
00794 }

void RockMatrixRAF0720Eonly::Add ( const NuMatrix correction,
Bool_t  addpot = false 
) [virtual]

Add the fit histograms of this with another set.

Definition at line 770 of file RockMatrixRAF0720Eonly.cxx.

References Msg::kWarning, and MSG.

00771 {
00772   // Convert the NuMatrix to a RockMatrixRAF0720Eonly
00773   const RockMatrixRAF0720Eonly *other = dynamic_cast<const RockMatrixRAF0720Eonly*>(&with);
00774   if (other == 0) {
00775     MSG("RockMatrixRAF0720Eonly",Msg::kWarning) << "Attempting to add a RockMatrixRAF0720Eonly to something other than a RockMatrixRAF0720Eonly" << endl;
00776   }
00777 
00778   this->Add(*other, addpot);
00779 }

NuMatrix1D& RockMatrixRAF0720Eonly::AllReco ( void   )  [inline]

Returns fit histogram in global bin number.

Definition at line 200 of file RockMatrixRAF0720Eonly.h.

References fAllReco.

00200 { return fAllReco; }  

NuMatrix1D& RockMatrixRAF0720Eonly::AllRecoNW ( void   )  [inline]

Returns fit histogram with no monte carlo event weighting (so the MC statistics are obvious).

Definition at line 203 of file RockMatrixRAF0720Eonly.h.

References fAllRecoNW.

00203 { return fAllRecoNW; }

NuMatrix1D& RockMatrixRAF0720Eonly::AllTruth ( void   )  [inline]

Returns histogram of true neutrino energy for all RAF events.

Definition at line 206 of file RockMatrixRAF0720Eonly.h.

References fAllTruth.

00206 { return fAllTruth; }  

NuMatrix1D& RockMatrixRAF0720Eonly::Back ( void   )  [inline]

Returns fit histogram for back events.

Definition at line 152 of file RockMatrixRAF0720Eonly.h.

References fBack.

00152 { return fBack; }

Bool_t RockMatrixRAF0720Eonly::Complete (  )  const [virtual]

Always returns true; not clear what the purpose is.

Implements NuMatrix.

Definition at line 754 of file RockMatrixRAF0720Eonly.cxx.

References NuMatrix1D::Complete(), fBack, fEdgeDet, fEdgeRock, fFront, fGap, and fGapEdge.

00755 {
00756   Bool_t complete = true;
00757 
00758   // This can't possibly return anything but true... what's the point?
00759   complete = complete || fFront.Complete();
00760   complete = complete || fGap.Complete();
00761   complete = complete || fGapEdge.Complete();
00762   complete = complete || fBack.Complete();
00763   complete = complete || fEdgeRock.Complete();
00764   complete = complete || fEdgeDet.Complete();
00765 
00766   return complete;
00767 }

virtual RockMatrixRAF0720Eonly* RockMatrixRAF0720Eonly::Copy ( void   )  const [inline, virtual]

Makes a 'deep copy' - every subclass should implement this.

Implements NuMatrix.

Definition at line 57 of file RockMatrixRAF0720Eonly.h.

References RockMatrixRAF0720Eonly().

00057                                                    {
00058     return new RockMatrixRAF0720Eonly(*this);
00059   }

virtual void RockMatrixRAF0720Eonly::DecayCC ( double  ,
double  ,
double   
) [inline, virtual]

Do not use; no clear purpose (the purpose suggested by the name is handled elsewhere).

Definition at line 131 of file RockMatrixRAF0720Eonly.h.

00131 {assert(0 && "Not implemented");}

virtual void RockMatrixRAF0720Eonly::DecayMuToTau ( double  ,
double  ,
double   
) [inline, virtual]

Do not use; no clear purpose (the purpose suggested by the name is handled elsewhere).

Definition at line 137 of file RockMatrixRAF0720Eonly.h.

00137 {assert(0 && "Not implemented");}

virtual void RockMatrixRAF0720Eonly::DecayNC ( double  ,
double   
) [inline, virtual]

Do not use; no clear purpose (the purpose suggested by the name is handled elsewhere).

Definition at line 134 of file RockMatrixRAF0720Eonly.h.

00134 {assert(0 && "Not implemented");}

virtual void RockMatrixRAF0720Eonly::Decohere ( double  ,
double  ,
double   
) [inline, virtual]

Do not use; no clear purpose (the purpose suggested by the name is handled elsewhere).

Definition at line 140 of file RockMatrixRAF0720Eonly.h.

00140 {assert(0 && "Not implemented");}

NuMatrix1D& RockMatrixRAF0720Eonly::dispall ( void   )  [inline]

Returns display histogram for all RAF events.

Definition at line 185 of file RockMatrixRAF0720Eonly.h.

References fdispall.

00185 { return fdispall; }

NuMatrix1D& RockMatrixRAF0720Eonly::dispallnc ( void   )  [inline]

Returns display histogram for true neutral current events.

Definition at line 188 of file RockMatrixRAF0720Eonly.h.

References fdispallnc.

00188 { return fdispallnc; }

NuMatrix1D& RockMatrixRAF0720Eonly::dispback ( void   )  [inline]

Returns display histogram for back events.

Definition at line 170 of file RockMatrixRAF0720Eonly.h.

References fdispback.

00170 { return fdispback; }

NuMatrix1D& RockMatrixRAF0720Eonly::dispdetlike ( void   )  [inline]

Returns display histogram for all detector-like events.

Definition at line 182 of file RockMatrixRAF0720Eonly.h.

References fdispdetlike.

00182 { return fdispdetlike; }

NuMatrix1D& RockMatrixRAF0720Eonly::dispedgedet ( void   )  [inline]

Returns display histogram for detector-like edge events.

Definition at line 176 of file RockMatrixRAF0720Eonly.h.

References fdispedgedet.

00176 { return fdispedgedet; }

NuMatrix1D& RockMatrixRAF0720Eonly::dispedgerock ( void   )  [inline]

Returns display histogram for rock-like edge events.

Definition at line 173 of file RockMatrixRAF0720Eonly.h.

References fdispedgerock.

00173 { return fdispedgerock; }

NuMatrix1D& RockMatrixRAF0720Eonly::dispfront ( void   )  [inline]

Return display histogram for front events.

Definition at line 161 of file RockMatrixRAF0720Eonly.h.

References fdispfront.

00161 { return fdispfront; }

NuMatrix1D& RockMatrixRAF0720Eonly::dispgap ( void   )  [inline]

Returns display histogram for gap events.

Definition at line 164 of file RockMatrixRAF0720Eonly.h.

References fdispgap.

00164 { return fdispgap; }

NuMatrix1D& RockMatrixRAF0720Eonly::dispgapedge ( void   )  [inline]

Returns display histogram for gap edge events.

Definition at line 167 of file RockMatrixRAF0720Eonly.h.

References fdispgapedge.

00167 { return fdispgapedge; }

NuMatrix1D& RockMatrixRAF0720Eonly::disprocklike ( void   )  [inline]

Returns display histogram for all rock-like events.

Definition at line 179 of file RockMatrixRAF0720Eonly.h.

References fdisprocklike.

00179 { return fdisprocklike; }

void RockMatrixRAF0720Eonly::Divide ( const TGraph &  correction  )  [virtual]

Do not use; no clear purpose.

Implements NuMatrix.

Definition at line 703 of file RockMatrixRAF0720Eonly.cxx.

References Msg::kError, and MSG.

00704 {
00705   MSG("RockMatrixRAF0720Eonly",Msg::kError)<<"Divide not implemented"<<endl;
00706 }

void RockMatrixRAF0720Eonly::Divide ( const TH1 &  correction,
const Option_t *  option = "" 
) [virtual]

Do not use; no clear purpose.

Implements NuMatrix.

Definition at line 697 of file RockMatrixRAF0720Eonly.cxx.

References Msg::kError, and MSG.

00698 {
00699   MSG("RockMatrixRAF0720Eonly",Msg::kError)<<"Divide not implemented"<<endl;
00700 }

void RockMatrixRAF0720Eonly::Divide ( const NuMatrix correction  )  [virtual]

Do not use; no clear purpose.

Definition at line 691 of file RockMatrixRAF0720Eonly.cxx.

References Msg::kError, and MSG.

00692 {
00693   MSG("RockMatrixRAF0720Eonly",Msg::kError)<<"Divide not implemented"<<endl;
00694 }

void RockMatrixRAF0720Eonly::Draw ( Option_t *  option = ""  )  [virtual]

Does nothing (no drawing, for instance).

Implements NuMatrix.

Definition at line 562 of file RockMatrixRAF0720Eonly.cxx.

00563 {
00564 
00565 }

NuMatrix1D& RockMatrixRAF0720Eonly::EdgeDet ( void   )  [inline]

Returns fit histogram for detector-like edge events.

Definition at line 158 of file RockMatrixRAF0720Eonly.h.

References fEdgeDet.

00158 { return fEdgeDet; }

NuMatrix1D& RockMatrixRAF0720Eonly::EdgeRock ( void   )  [inline]

Returns fit histogram for rock-like edge events.

Definition at line 155 of file RockMatrixRAF0720Eonly.h.

References fEdgeRock.

00155 { return fEdgeRock; }

int RockMatrixRAF0720Eonly::er2GlobalBin ( const Float_t  trkEn,
const Int_t  regionTrkVtx,
const Char_t  edgemid 
) [static]

Given an energy and detector region, returns the global RAF bin number.

Definition at line 212 of file RockMatrixRAF0720Eonly.cxx.

References clampcoarse(), clampfine(), coarse(), fine(), Msg::kError, MAXMSG, NBINSCOARSE, and NBINSFINE.

Referenced by GlobalBin2er(), and PrepareBins().

00214 {
00215   // This awkwardly duplicates Fill, and must be kept in sync with it
00216   // Whee good programming practices!
00217 
00218   const int UNDERANDOVERFLOW = 2;
00219 
00220   if(regionTrkVtx==4 || regionTrkVtx==5){ // Front and front+edge
00221     return fine.FindBin(clampfine(trkEn));
00222   }
00223 
00224   else if(regionTrkVtx==1 && edgemid == 0){ // Edge rock-like
00225     return fine.FindBin(clampfine(trkEn))
00226       + NBINSFINE
00227       + UNDERANDOVERFLOW;
00228      // The bug on the twig on the branch on the tree in the hole in the ground
00229   }
00230 
00231   else if(regionTrkVtx==1 && edgemid == 1){ // Edge detector-like
00232     return fine.FindBin(clampfine(trkEn))
00233       + NBINSFINE*2
00234       + 2*UNDERANDOVERFLOW;
00235      // The hair on the bug on the twig on the branch on the tree in the hole
00236      // in the ground. And the green grass grows all round, the green grass
00237      // grows all around
00238   }
00239 
00240   else if(regionTrkVtx==8 || regionTrkVtx==12){ // N & S side of gap
00241     return coarse.FindBin(clampcoarse(trkEn))
00242       + NBINSFINE*3
00243       + 3*UNDERANDOVERFLOW;
00244     // The tree in the hole in the ground
00245   }
00246 
00247   else if(regionTrkVtx==9 || regionTrkVtx==13){ //N & S side of gap+edge
00248     return coarse.FindBin(clampcoarse(trkEn))
00249       + NBINSFINE*3
00250       + NBINSCOARSE
00251       + 4*UNDERANDOVERFLOW;
00252       // The branch on the tree in the hole in the ground
00253   }
00254 
00255   else if(regionTrkVtx==16 || regionTrkVtx==17){ // Back and back+edge
00256     return coarse.FindBin(clampcoarse(trkEn))
00257       + NBINSFINE*3
00258       + NBINSCOARSE*2
00259       + 5*UNDERANDOVERFLOW;
00260      // The twig on the branch on the tree in the hole in the ground
00261   }
00262 
00263   else{
00264     MAXMSG("RockMatrixRAF0720Eonly", Msg::kError, 100) <<
00265      "No events should reach this point in RockMatrixRAF0720Eonly::"
00266      "er2GlobalBin!\nregionTrkVtx = " << int(regionTrkVtx) << endl <<
00267      "edgemid = "      << int(edgemid) << endl;
00268     return -1;
00269   }
00270 }

void RockMatrixRAF0720Eonly::ExtrapolateNDToFD ( const TH2D &  beammatrix  )  [virtual]

Do not use; no clear purpose (the purpose suggested by the name is handled elsewhere).

Implements NuMatrix.

Definition at line 740 of file RockMatrixRAF0720Eonly.cxx.

References Msg::kError, and MSG.

00741 {
00742   MSG("RockMatrixRAF0720Eonly",Msg::kError)
00743     << "ExtrapolateNDToFD not implemented" << endl;
00744 }

virtual void RockMatrixRAF0720Eonly::Fill ( const NuEvent nu,
const Double_t  weight,
const bool  display = false 
) [inline, virtual]

Fills histograms that are used in the fit and optionally display histograms.

Implements RockMatrix.

Definition at line 38 of file RockMatrixRAF0720Eonly.h.

References Fill().

00038                                                                                           {
00039     this->Fill(RockEvent(nu), weight, display);
00040   }

void RockMatrixRAF0720Eonly::Fill ( const RockEvent nu,
const Double_t  weight,
const bool  display = false 
) [virtual]

Fills histograms that are used in the fit and optionally display histograms.

Implements RockMatrix.

Definition at line 390 of file RockMatrixRAF0720Eonly.cxx.

References RockEvent::binNumber, clampcoarse(), clampfine(), RockEvent::edgemid, fAllReco, fAllRecoNW, fAllTruth, fBack, fdispall, fdispallnc, fdispback, fdispdetlike, fdispedgedet, fdispedgerock, fdispfront, fdispgap, fdispgapedge, fdisprocklike, fEdgeDet, fEdgeRock, fFront, fGap, fGapEdge, RockEvent::iaction, Msg::kError, MAXMSG, RockEvent::neuEnMC, RockEvent::regionTrkVtx, NuMatrix1D::Spectrum(), spoonlawn(), and RockEvent::trkEn.

Referenced by Fill(), FillFromFileNuEvents(), and FillFromFileRockEvents().

00392 {
00393   // Don't fill jesstograms here since oscillation has already occured,
00394   // or if it hasn't, the taus have, in any case, been zeroed.
00395   // these are the same as adding together the three jesstograms and then
00396   // collapsing them to 1D.  It is pure convenience to explicitly construct
00397   // them here.
00398   if(display){
00399     fAllReco.Spectrum()->Fill(nu.binNumber, weight);
00400     fAllRecoNW.Spectrum()->Fill(nu.binNumber);
00401     fAllTruth.Spectrum()->Fill(nu.neuEnMC, weight);
00402     fdispall.Spectrum()->Fill(spoonlawn(nu.trkEn), weight);
00403     if(nu.iaction == 0)fdispallnc.Spectrum()->Fill(spoonlawn(nu.trkEn), weight);
00404   }
00405 
00406   // Decide where to fill based on region
00407   if(nu.regionTrkVtx==4 || nu.regionTrkVtx==5){ // Front and front+edge
00408     fFront.Spectrum()->Fill(clampfine(nu.trkEn), weight);
00409     if(display){
00410       fdispfront.Spectrum()->Fill(spoonlawn(nu.trkEn), weight);
00411       fdisprocklike.Spectrum()->Fill(spoonlawn(nu.trkEn), weight);
00412     }
00413   }
00414 
00415   else if(nu.regionTrkVtx==1 && nu.edgemid == 0){ // Edge rock-like
00416     fEdgeRock.Spectrum()->Fill(clampfine(nu.trkEn), weight);
00417     if(display){
00418       fdispedgerock.Spectrum()->Fill(spoonlawn(nu.trkEn), weight);
00419       fdisprocklike.Spectrum()->Fill(spoonlawn(nu.trkEn), weight);
00420     }
00421   }
00422 
00423   else if(nu.regionTrkVtx==1 && nu.edgemid == 1){ // Edge detector-like
00424     fEdgeDet.Spectrum()->Fill(clampfine(nu.trkEn), weight);
00425     if(display){
00426       fdispedgedet.Spectrum()->Fill(spoonlawn(nu.trkEn), weight);
00427       fdispdetlike.Spectrum()->Fill(spoonlawn(nu.trkEn), weight);
00428     }
00429   }
00430 
00431   else if(nu.regionTrkVtx==8 || nu.regionTrkVtx==12){ // N & S side of gap
00432     fGap.Spectrum()->Fill(clampcoarse(nu.trkEn), weight);
00433     if(display){
00434       fdispgap.Spectrum()->Fill(spoonlawn(nu.trkEn), weight);
00435       fdispdetlike.Spectrum()->Fill(spoonlawn(nu.trkEn), weight);
00436     }
00437   }
00438 
00439   else if(nu.regionTrkVtx==9 || nu.regionTrkVtx==13){ // N & S side of gap+edge
00440     fGapEdge.Spectrum()->Fill(clampcoarse(nu.trkEn), weight);
00441     if(display){
00442       fdispgapedge.Spectrum()->Fill(spoonlawn(nu.trkEn), weight);
00443       fdisprocklike.Spectrum()->Fill(spoonlawn(nu.trkEn), weight);
00444     }
00445   }
00446 
00447   else if(nu.regionTrkVtx==16 || nu.regionTrkVtx==17){ // Back and back+edge
00448     fBack.Spectrum()->Fill(clampcoarse(nu.trkEn), weight);
00449     if(display){
00450       fdispback.Spectrum()->Fill(spoonlawn(nu.trkEn), weight);
00451       fdispdetlike.Spectrum()->Fill(spoonlawn(nu.trkEn), weight);
00452     }
00453   }
00454 
00455   else{
00456     MAXMSG("RockMatrixRAF0720Eonly", Msg::kError, 100)
00457       << "No events should reach this point in RockMatrixRAF0720Eonly::Fill!\n"
00458          "regionTrkVtx = " << int(nu.regionTrkVtx) << endl
00459       << "edgemid = "      << int(nu.edgemid) << endl;
00460   }
00461 }

void RockMatrixRAF0720Eonly::FillFromFileNuEvents ( TString  fname,
TString  brName = "s" 
) [virtual]

Fills (using Fill()) using an input file of NuEvents.

Definition at line 484 of file RockMatrixRAF0720Eonly.cxx.

References Fill(), Msg::kError, MSG, PrepareBins(), and RockEvent::rw.

00485 {
00486   TChain ch(brName);
00487   ch.Add(fname);
00488   if(ch.GetEntries() == 0){
00489     MSG("RockMatrixRAF0720Eonly", Msg::kError)
00490       << "Empty or nonexistent file " << fname << endl;
00491     return;
00492   }
00493 
00494   NuEvent* ev = 0;
00495   ch.SetBranchAddress(brName, &ev);
00496   for(int i = 0; i < ch.GetEntries(); ++i){
00497     ch.GetEntry(i);
00498     RockEvent evr(*ev);
00499     PrepareBins(&evr);
00500     Fill(evr, evr.rw, true);
00501   }
00502 }

void RockMatrixRAF0720Eonly::FillFromFileRockEvents ( TString  fname,
TString  brName = "r" 
) [virtual]

Fills (using Fill()) using an input file of RockEvents.

Definition at line 464 of file RockMatrixRAF0720Eonly.cxx.

References Fill(), Msg::kError, MSG, PrepareBins(), and RockEvent::rw.

00465 {
00466   TChain ch(brName);
00467   ch.Add(fname);
00468   if(ch.GetEntries() == 0){
00469     MSG("RockMatrixRAF0720Eonly", Msg::kError)
00470       << "Empty or nonexistent file " << fname << endl;
00471     return;
00472   }
00473 
00474   RockEvent* ev = 0;
00475   ch.SetBranchAddress(brName, &ev);
00476   for(int i = 0; i < ch.GetEntries(); ++i){
00477     ch.GetEntry(i);
00478     PrepareBins(ev);
00479     Fill(*ev, ev->rw, true);
00480   }
00481 }

void RockMatrixRAF0720Eonly::FillJess ( const RockEvent nu,
const Double_t  weight 
) [virtual]

Fills true-to-reco histograms for input into Jess's fitter.

Reimplemented from RockMatrix.

Definition at line 369 of file RockMatrixRAF0720Eonly.cxx.

References RockEvent::binNumber, fJess_ccmu, fJess_cctau, fJess_no, RockEvent::iaction, RockEvent::inu, RockEvent::neuEnMC, NuMatrix1D::Spectrum(), and NuMatrix2D::Spectrum().

00371 {
00372   // Fill these true-to-reco histograms for Jess.
00373 
00374   // Numu(bar) charged current
00375   if(nu.iaction == 1 && abs(nu.inu) == 14)
00376     fJess_ccmu.Spectrum()->Fill(nu.neuEnMC, nu.binNumber, weight);
00377 
00378   // Nutau(bar) charged current
00379   if(nu.iaction == 1 && abs(nu.inu) == 16)
00380     fJess_cctau.Spectrum()->Fill(nu.neuEnMC, nu.binNumber, weight);
00381 
00382   // Neutral current, nue(bar) and (accidentally) most real data
00383   // Don't include taus here because we'd double-count them (the taus are
00384   // unoscillated at this point)
00385   if((nu.iaction == 0 && abs(nu.inu) != 16) || abs(nu.inu) == 12)
00386     fJess_no.Spectrum()->Fill(nu.binNumber, weight);
00387 }

NuMatrix1D& RockMatrixRAF0720Eonly::Front ( void   )  [inline]

Returns fit histogram for front events.

Definition at line 143 of file RockMatrixRAF0720Eonly.h.

References fFront.

00143 { return fFront; }

NuMatrix1D& RockMatrixRAF0720Eonly::Gap ( void   )  [inline]

Returns fit histogram for gap events.

Definition at line 146 of file RockMatrixRAF0720Eonly.h.

References fGap.

00146 { return fGap; }

NuMatrix1D& RockMatrixRAF0720Eonly::GapEdge ( void   )  [inline]

Returns fit histogram for gap edge events.

Definition at line 149 of file RockMatrixRAF0720Eonly.h.

References fGapEdge.

00149 { return fGapEdge; }

void RockMatrixRAF0720Eonly::GlobalBin2er ( Float_t &  trkEn,
Int_t &  regionTrkVtx,
Char_t &  edgemid,
int  globalbin 
) [static]

Given a global RAF bin number, provides the average energy and region.

Definition at line 293 of file RockMatrixRAF0720Eonly.cxx.

References coarse(), er2GlobalBin(), fine(), Msg::kError, MSG, NBINSCOARSE, and NBINSFINE.

Referenced by GlobalBin2trkEn().

00295 {
00296   // See PrepareBins for how the global bin number is found.  This 
00297   // function reverses the procedure.  This is obviously somewhat fragile
00298   // and quite possibly will need to be edited if PrepareBins is edited!
00299 
00300   trkEn = -1; // junk default values for errors
00301   edgemid = regionTrkVtx = -1;
00302 
00303   // The +2 in each case are for overflow and underflow bins.
00304   // These currently never have events in them but serve as error 
00305   // catching buffers.
00306   int lastbin_front   = NBINSFINE,
00307       lastbin_edgerock= lastbin_front    + NBINSFINE + 2,
00308       lastbin_edgedet = lastbin_edgerock + NBINSFINE + 2,
00309       lastbin_gap     = lastbin_edgedet  + NBINSCOARSE + 2,
00310       lastbin_gapedge = lastbin_gap      + NBINSCOARSE + 2,
00311       lastbin_back    = lastbin_gapedge  + NBINSCOARSE + 2;
00312 
00313   if(globalbin < 1 ||
00314      globalbin == lastbin_front   +1 || globalbin == lastbin_front   +2 || 
00315      globalbin == lastbin_edgerock+1 || globalbin == lastbin_edgerock+2 ||
00316      globalbin == lastbin_edgedet +1 || globalbin == lastbin_edgedet +2 ||
00317      globalbin == lastbin_gap     +1 || globalbin == lastbin_gap     +2 ||
00318      globalbin == lastbin_gapedge +1 || globalbin == lastbin_gapedge +2 ||
00319      globalbin >= lastbin_back    +1 ){
00320     MSG("RockMatrixRAF0720Eonly", Msg::kError) << "Global bin " << globalbin
00321       << " is an under/overflow in an energy histogram or a global "
00322       "over/underflow.  That can't happen unless you're passing me bad data."
00323       "\n\nAre you passing in the bin numbers from fAllReco/raf_allreco or "
00324       "fJess_[ccmu|cctau|no]/raf_jess_[ccmu|cctau|no]?  If so, you need "
00325       "to subtract one to go from the bin numbers of those histogram to the "
00326       "global bin number used to fill those histograms.  Sorry.\n\n";
00327     return;
00328   }
00329 
00330   if(globalbin <= lastbin_front){
00331     trkEn = fine.GetBinCenter(globalbin);
00332     regionTrkVtx = 4; // semi-fiducial front
00333     edgemid = 1; // not very meaningful
00334   }
00335   else if(globalbin <= lastbin_edgerock){
00336     trkEn = fine.GetBinCenter(globalbin - lastbin_front - 2);
00337     regionTrkVtx = 1; // semi-fiducial edge
00338     edgemid = 0; // detector-like edge
00339   }
00340   else if(globalbin <= lastbin_edgedet){
00341     trkEn = fine.GetBinCenter(globalbin - lastbin_edgerock - 2);
00342     regionTrkVtx = 1; // semi-fiducial edge
00343     edgemid = 1; // rock-like edge
00344   }
00345   else if(globalbin <= lastbin_gap){
00346     trkEn = coarse.GetBinCenter(globalbin - lastbin_edgedet - 2);
00347     regionTrkVtx = 12; // north side of semi-fiducial gap
00348     edgemid = 1; // not very meaningful
00349   }
00350   else if(globalbin <= lastbin_gapedge){
00351     trkEn = coarse.GetBinCenter(globalbin - lastbin_gap - 2);
00352     regionTrkVtx = 13; // north side of gap+edge
00353     edgemid = 0; // not very meaningful
00354   }
00355   else if(globalbin <= lastbin_back){
00356     trkEn = coarse.GetBinCenter(globalbin - lastbin_gapedge - 2);
00357     regionTrkVtx = 16; // semi-fiducial back
00358     edgemid = 0; // not very meaningful
00359   }
00360 
00361   // check answer
00362   if(er2GlobalBin(trkEn, regionTrkVtx, edgemid) != globalbin)
00363     cerr << "OH NO: inconsistent GlobalBin2er result for " << globalbin << endl
00364     << trkEn << " " << regionTrkVtx << " " << edgemid << endl;
00365 }

void RockMatrixRAF0720Eonly::GlobalBin2trkEn ( Float_t &  trkEn,
int  globalbin 
) [static]

Given a global RAF bin number, provides the average energy.

Definition at line 281 of file RockMatrixRAF0720Eonly.cxx.

References GlobalBin2er().

00283 {
00284   Int_t regionTrkVtx = 0;
00285   Char_t edgemid = 0;
00286   GlobalBin2er(trkEn, regionTrkVtx, edgemid, globalbin);
00287 }

NuMatrix2D& RockMatrixRAF0720Eonly::Jess_ccmu ( void   )  [inline]

Returns Jess histogram for true CC numu(bar) events.

Definition at line 191 of file RockMatrixRAF0720Eonly.h.

References fJess_ccmu.

00191 { return fJess_ccmu; }

NuMatrix2D& RockMatrixRAF0720Eonly::Jess_cctau ( void   )  [inline]

Returns Jess histogram for true CC nutau(bar) events.

Definition at line 194 of file RockMatrixRAF0720Eonly.h.

References fJess_cctau.

00194 { return fJess_cctau; }

NuMatrix1D& RockMatrixRAF0720Eonly::Jess_no ( void   )  [inline]

Returns Jess histogram for true non-ocillating events (neutral current, nue(bar)).

Definition at line 197 of file RockMatrixRAF0720Eonly.h.

References fJess_no.

00197 { return fJess_no; }

void RockMatrixRAF0720Eonly::Multiply ( const TGraph &  correction  )  [virtual]

Do not use; no clear purpose.

Implements NuMatrix.

Definition at line 721 of file RockMatrixRAF0720Eonly.cxx.

References Msg::kError, and MSG.

00722 {
00723   MSG("RockMatrixRAF0720Eonly",Msg::kError)<<"Multiply not implemented"<<endl;
00724 }

void RockMatrixRAF0720Eonly::Multiply ( const TH1 &  correction,
const Option_t *  option = "" 
) [virtual]

Do not use; no clear purpose.

Implements NuMatrix.

Definition at line 715 of file RockMatrixRAF0720Eonly.cxx.

References Msg::kError, and MSG.

00716 {
00717   MSG("RockMatrixRAF0720Eonly",Msg::kError)<<"Multiply not implemented"<<endl;
00718 }

void RockMatrixRAF0720Eonly::Multiply ( const NuMatrix correction  )  [virtual]

Do not use; no clear purpose.

Definition at line 709 of file RockMatrixRAF0720Eonly.cxx.

References Msg::kError, and MSG.

00710 {
00711   MSG("RockMatrixRAF0720Eonly",Msg::kError)<<"Multiply not implemented"<<endl;
00712 }

void RockMatrixRAF0720Eonly::Oscillate ( const Double_t  dm2,
const Double_t  sn2 
) [virtual]

Do not use; no clear purpose (the purpose suggested by the name is handled elsewhere).

Implements NuMatrix.

Definition at line 747 of file RockMatrixRAF0720Eonly.cxx.

References Msg::kError, and MSG.

00748 {
00749   MSG("RockMatrixRAF0720Eonly",Msg::kError)<<"Oscillate not implemented"<<endl;
00750 }

void RockMatrixRAF0720Eonly::PrepareBins ( RockEvent nu  )  const [virtual]

Finds the global bin number for an event.

Implements RockMatrix.

Definition at line 274 of file RockMatrixRAF0720Eonly.cxx.

References RockEvent::binNumber, RockEvent::edgemid, er2GlobalBin(), RockEvent::regionTrkVtx, and RockEvent::trkEn.

Referenced by FillFromFileNuEvents(), and FillFromFileRockEvents().

00275 {
00276   nu->binNumber = er2GlobalBin(nu->trkEn, nu->regionTrkVtx, nu->edgemid);
00277 }

Int_t RockMatrixRAF0720Eonly::Read ( const TString &  fname,
const TString &  name 
) [virtual]

Reads in fit, Jess and display histograms.

Definition at line 605 of file RockMatrixRAF0720Eonly.cxx.

References exit(), fAllReco, fAllRecoNW, fAllTruth, fBack, fEdgeDet, fEdgeRock, fFront, fGap, fGapEdge, fJess_ccmu, fJess_cctau, fJess_no, NuMatrix::fPot, Msg::kError, MSG, NuMatrix1D::Read(), and NuMatrix2D::Read().

00606 {
00607   TDirectory* dir_backup = gDirectory;
00608 
00609   TFile* f = new TFile(fname);
00610 
00611   if(!f || !f->IsOpen() || f->IsZombie()){
00612     MSG("RockMatrixRAF0720Eonly",Msg::kError) << "Read() could not open "
00613       << fname << " Bailing out\n";
00614     exit(1);
00615   }
00616 
00617   fFront   .Read(f, name + "_front"   );
00618   fGap     .Read(f, name + "_gap"     );
00619   fGapEdge .Read(f, name + "_gapedge" );
00620   fBack    .Read(f, name + "_back"    );
00621   fEdgeRock.Read(f, name + "_edgerock");
00622   fEdgeDet .Read(f, name + "_edgedet" );
00623 
00624   fAllReco .Read(f, name + "_allreco" );
00625   fAllRecoNW.Read(f, name + "_allreconw" );
00626   fAllTruth.Read(f, name + "_alltruth" );
00627 
00628   fJess_ccmu.Read(f, name + "_jess_ccmu");
00629   fJess_cctau.Read(f, name + "_jess_cctau");
00630   fJess_no.Read(f, name + "_jess_no");
00631 
00632   fPot = ((TH1*)f->Get(name + "_pot"))->GetBinContent(1);
00633 
00634   f->Close();
00635   dir_backup->cd();
00636 
00637   return 1;
00638 }

void RockMatrixRAF0720Eonly::RecoToTrue ( const TH2D &  correction  )  [virtual]

Do not use; no clear purpose (the purpose suggested by the name is handled elsewhere).

Implements NuMatrix.

Definition at line 728 of file RockMatrixRAF0720Eonly.cxx.

References Msg::kError, and MSG.

00729 {
00730   MSG("RockMatrixRAF0720Eonly",Msg::kError)<<"RecoToTrue not implemented"<<endl;
00731 }

void RockMatrixRAF0720Eonly::ResetPOT ( Double_t  new_POT  )  [virtual]

We need a special ResetPOT.

Reimplemented from NuMatrix.

Definition at line 506 of file RockMatrixRAF0720Eonly.cxx.

References fAllReco, fAllRecoNW, fAllTruth, fBack, fEdgeDet, fEdgeRock, fFront, fGap, fGapEdge, fJess_ccmu, fJess_cctau, fJess_no, NuMatrix::fPot, and NuMatrix::ResetPOT().

Referenced by Add(), and ScaleToPOT().

00507 {
00508   fFront   .ResetPOT(new_POT);
00509   fGap     .ResetPOT(new_POT);
00510   fGapEdge .ResetPOT(new_POT);
00511   fBack    .ResetPOT(new_POT);
00512   fEdgeRock.ResetPOT(new_POT);
00513   fEdgeDet .ResetPOT(new_POT);
00514 
00515   fAllReco .ResetPOT(new_POT);
00516   fAllRecoNW.ResetPOT(new_POT);
00517   fAllTruth.ResetPOT(new_POT);
00518 
00519   fJess_ccmu.ResetPOT(new_POT);
00520   fJess_cctau.ResetPOT(new_POT);
00521   fJess_no.ResetPOT(new_POT);
00522 
00523   fPot = new_POT;
00524 }

void RockMatrixRAF0720Eonly::Scale ( Double_t  value  )  [virtual]

Scales all histograms uniformly.

Implements NuMatrix.

Definition at line 672 of file RockMatrixRAF0720Eonly.cxx.

References fAllReco, fAllTruth, fBack, fEdgeDet, fEdgeRock, fFront, fGap, fGapEdge, fJess_ccmu, fJess_cctau, fJess_no, NuMatrix2D::Scale(), and NuMatrix1D::Scale().

Referenced by ScaleToPOT().

00673 {
00674   fFront   .Scale(value);
00675   fGap     .Scale(value);
00676   fGapEdge .Scale(value);
00677   fBack    .Scale(value);
00678   fEdgeRock.Scale(value);
00679   fEdgeDet .Scale(value);
00680 
00681   fJess_ccmu .Scale(value);
00682   fJess_cctau.Scale(value);
00683   fJess_no   .Scale(value);
00684 
00685   fAllReco .Scale(value);
00686   /* Don't scale fAllRecoNW since it is supposed to represent actual MC count */
00687   fAllTruth.Scale(value);
00688 }

void RockMatrixRAF0720Eonly::ScaleToPOT ( Double_t  new_POT  )  [virtual]

Scales by protons-on-target.

Implements NuMatrix.

Definition at line 660 of file RockMatrixRAF0720Eonly.cxx.

References NuMatrix::GetPOT(), ResetPOT(), and Scale().

00661 {
00662   if (GetPOT() != 0.0) {
00663     // The spectrum must exist - calculate the scale factor
00664     Double_t scale_factor = new_POT / GetPOT();
00665     Scale(scale_factor);
00666   }
00667 
00668   ResetPOT(new_POT);
00669 }

void RockMatrixRAF0720Eonly::SetValue ( Double_t  val  )  [virtual]

Do not use; has no clear purpose.

Implements NuMatrix.

Definition at line 643 of file RockMatrixRAF0720Eonly.cxx.

References fAllReco, fAllRecoNW, fAllTruth, fBack, fEdgeDet, fEdgeRock, fFront, fGap, fGapEdge, and NuMatrix1D::SetValue().

00644 {
00645   cerr << "RockMatrixRAF0720Eonly::SetValue might not do what you think.\n";
00646 
00647   fFront   .SetValue(val);
00648   fGap     .SetValue(val);
00649   fGapEdge .SetValue(val);
00650   fBack    .SetValue(val);
00651   fEdgeRock.SetValue(val);
00652   fEdgeDet .SetValue(val);
00653 
00654   fAllReco.SetValue(val);
00655   fAllRecoNW.SetValue(val);
00656   fAllTruth.SetValue(val);
00657 }

virtual TH1* RockMatrixRAF0720Eonly::Spectrum ( void   )  const [inline, virtual]

Not implemented.

Implements NuMatrix.

Definition at line 65 of file RockMatrixRAF0720Eonly.h.

00065 { /* never call this, I guess! */ return 0; }

Double_t RockMatrixRAF0720Eonly::StatsLikelihood ( const RockMatrixRAF0720Eonly with  )  const [virtual]

Computes the log likelihood.

Implements NuMatrix.

Definition at line 543 of file RockMatrixRAF0720Eonly.cxx.

References fBack, fEdgeDet, fEdgeRock, fFront, fGap, fGapEdge, and NuMatrix1D::StatsLikelihood().

00544 {
00545   Double_t like = 0.0;
00546 
00547   like += fFront   .StatsLikelihood(&with->fFront   );
00548   like += fGap     .StatsLikelihood(&with->fGap     );
00549   like += fGapEdge .StatsLikelihood(&with->fGapEdge );
00550   like += fBack    .StatsLikelihood(&with->fBack    );
00551   like += fEdgeRock.StatsLikelihood(&with->fEdgeRock);
00552   like += fEdgeDet .StatsLikelihood(&with->fEdgeDet );
00553 
00554   // This SHOULD be nearly identical to all of the above, except that it will
00555   // include underflow and overflow bins in the fit. Test this sometime.
00556   // Do NOT use both the above and this; that's double counting
00557   //like += fAllReco.StatsLikelihood(&with->fAllReco );
00558 
00559   return like;
00560 }

Double_t RockMatrixRAF0720Eonly::StatsLikelihood ( const NuMatrix with  )  const [virtual]

Computes the log likelihood.

Definition at line 526 of file RockMatrixRAF0720Eonly.cxx.

References Msg::kWarning, and MSG.

00527 {
00528   // Convert the NuMatrix to a RockMatrixRAF0720Eonly
00529   const RockMatrixRAF0720Eonly *other
00530     = dynamic_cast<const RockMatrixRAF0720Eonly*>(with);
00531   if (other == 0) {
00532     MSG("RockMatrixRAF0720Eonly",Msg::kWarning)
00533       << "Attempting to compare a RockMatrixRAF0720Eonly to "
00534          "something other than a RockMatrixRAF0720Eonly" << endl;
00535     return -1;
00536   }
00537 
00538   return this->StatsLikelihood(other);
00539 }

void RockMatrixRAF0720Eonly::Subtract ( const RockMatrixRAF0720Eonly correction  )  [virtual]

Subtract the fit histograms another set from this.

Implements NuMatrix.

Definition at line 810 of file RockMatrixRAF0720Eonly.cxx.

References NuMatrix1D::Add(), fBack, fEdgeDet, fEdgeRock, fFront, fGap, and fGapEdge.

00811 {
00812   // Base the addition on the 'essential' histograms listed in complete
00813   // Also, this probably won't be used so don't bother with validation/clever behaviour for now
00814   fFront.Add(correction.fFront, -1.0);
00815   fGap.Add(correction.fGap, -1.0);
00816   fGapEdge.Add(correction.fGapEdge, -1.0);
00817   fBack.Add(correction.fBack, -1.0);
00818   fEdgeRock.Add(correction.fEdgeRock, -1.0);
00819   fEdgeDet.Add(correction.fEdgeDet, -1.0);
00820 }

void RockMatrixRAF0720Eonly::Subtract ( const NuMatrix correction  )  [virtual]

Subtract the fit histograms another set from this.

Definition at line 797 of file RockMatrixRAF0720Eonly.cxx.

References Msg::kWarning, and MSG.

00798 {
00799   // Convert the NuMatrix to a RockMatrixRAF0720Eonly
00800   const RockMatrixRAF0720Eonly *other = dynamic_cast<const RockMatrixRAF0720Eonly*>(&with);
00801   if (other == 0) {
00802     MSG("RockMatrixRAF0720Eonly",Msg::kWarning) << "Attempting to subtract a RockMatrixRAF0720Eonly from something other than a RockMatrixRAF0720Eonly" << endl;
00803   }
00804 
00805   this->Subtract(*other);
00806   
00807 }

void RockMatrixRAF0720Eonly::TrueToReco ( const TH2D &  correction  )  [virtual]

Do not use; no clear purpose (the purpose suggested by the name is handled elsewhere).

Implements NuMatrix.

Definition at line 734 of file RockMatrixRAF0720Eonly.cxx.

References Msg::kError, and MSG.

00735 {
00736   MSG("RockMatrixRAF0720Eonly",Msg::kError)<<"TrueToReco not implemented"<<endl;
00737 }

Int_t RockMatrixRAF0720Eonly::Write ( const TString &  name  )  const [virtual]

Writes to the currently open file fit, Jess, and display histograms.

Implements NuMatrix.

Definition at line 568 of file RockMatrixRAF0720Eonly.cxx.

References fAllReco, fAllRecoNW, fAllTruth, fBack, fdispall, fdispallnc, fdispback, fdispdetlike, fdispedgedet, fdispedgerock, fdispfront, fdispgap, fdispgapedge, fdisprocklike, fEdgeDet, fEdgeRock, fFront, fGap, fGapEdge, fJess_ccmu, fJess_cctau, fJess_no, NuMatrix::fPot, NuMatrix1D::Write(), and NuMatrix2D::Write().

00569 {
00570   fFront   .Write(name + "_front"   );
00571   fGap     .Write(name + "_gap"     );
00572   fGapEdge .Write(name + "_gapedge" );
00573   fBack    .Write(name + "_back"    );
00574   fEdgeRock.Write(name + "_edgerock");
00575   fEdgeDet .Write(name + "_edgedet" );
00576 
00577   fAllReco.Write(name + "_allreco");
00578   fAllRecoNW.Write(name + "_allreconw");
00579   fAllTruth.Write(name + "_alltruth");
00580 
00581   fJess_ccmu.Write(name + "_jess_ccmu"   );
00582   fJess_cctau.Write(name + "_jess_cctau"   );
00583   fJess_no.Write(name + "_jess_no"   );
00584 
00585   fdispfront   .Write(name + "_dispfront");
00586   fdispedgerock.Write(name + "_dispedgerock");
00587   fdispedgedet .Write(name + "_dispedgedet");
00588   fdispgap     .Write(name + "_dispgap");
00589   fdispgapedge .Write(name + "_dispgapedge");
00590   fdispback    .Write(name + "_dispback");
00591 
00592   fdisprocklike.Write(name + "_disprocklike");
00593   fdispdetlike .Write(name + "_dispdetlike");
00594   fdispall     .Write(name + "_dispall");
00595   fdispallnc   .Write(name + "_dispallnc");
00596 
00597   TH1* pot = new TH1D("", "", 1, 0, 1);
00598   pot->SetBinContent(1, fPot);
00599   pot->Write(name + "_pot");
00600 
00601   return 1;
00602 }


Member Data Documentation

Definition at line 221 of file RockMatrixRAF0720Eonly.h.

Referenced by dispall(), Fill(), RockMatrixRAF0720Eonly(), and Write().

Definition at line 221 of file RockMatrixRAF0720Eonly.h.

Referenced by dispallnc(), Fill(), RockMatrixRAF0720Eonly(), and Write().

Definition at line 221 of file RockMatrixRAF0720Eonly.h.

Referenced by dispback(), Fill(), RockMatrixRAF0720Eonly(), and Write().

Definition at line 221 of file RockMatrixRAF0720Eonly.h.

Referenced by dispdetlike(), Fill(), RockMatrixRAF0720Eonly(), and Write().

Definition at line 221 of file RockMatrixRAF0720Eonly.h.

Referenced by dispedgedet(), Fill(), RockMatrixRAF0720Eonly(), and Write().

Definition at line 221 of file RockMatrixRAF0720Eonly.h.

Referenced by dispedgerock(), Fill(), RockMatrixRAF0720Eonly(), and Write().

Definition at line 221 of file RockMatrixRAF0720Eonly.h.

Referenced by dispfront(), Fill(), RockMatrixRAF0720Eonly(), and Write().

Definition at line 221 of file RockMatrixRAF0720Eonly.h.

Referenced by dispgap(), Fill(), RockMatrixRAF0720Eonly(), and Write().

Definition at line 221 of file RockMatrixRAF0720Eonly.h.

Referenced by dispgapedge(), Fill(), RockMatrixRAF0720Eonly(), and Write().

Definition at line 221 of file RockMatrixRAF0720Eonly.h.

Referenced by disprocklike(), Fill(), RockMatrixRAF0720Eonly(), and Write().


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

Generated on 22 Nov 2017 for loon by  doxygen 1.6.1