OscFit::Interface Class Reference

#include <Interface.h>

List of all members.

Public Member Functions

void Make (Int_t nOsc, Source_t source, Sample_t sample, Flavour_t trueFlavour, Charge_t trueCharge, Systematic_t systematic, Shift_t shift, Run_t run, Containment_t containment, Flavour_t recoFlavour, Charge_t recoCharge, Resolution_t resolution, Topology_t topology, ProtonTag_t proton, ElectronTag_t electron)
void Fill (Int_t nOsc, Source_t source, Sample_t sample, Flavour_t trueFlavour, Charge_t trueCharge, Systematic_t systematic, Shift_t shift, Run_t run, Containment_t containment, Flavour_t recoFlavour, Charge_t recoCharge, Resolution_t resolution, Topology_t topology, ProtonTag_t proton, ElectronTag_t electron, Double_t a, Double_t b=1.0, Double_t c=1.0)
void Fill (Int_t nOsc, Source_t source, Sample_t sample, Flavour_t trueFlavour, Charge_t trueCharge, Systematic_t systematic, Shift_t shift, Run_t run, Containment_t containment, Flavour_t recoFlavour, Charge_t recoCharge, Resolution_t resolution, Topology_t topology, ProtonTag_t proton, ElectronTag_t electron, TH1D *h, Double_t extraWeight=1.0)
void Fill (Int_t nOsc, Source_t source, Sample_t sample, Flavour_t trueFlavour, Charge_t trueCharge, Systematic_t systematic, Shift_t shift, Run_t run, Containment_t containment, Flavour_t recoFlavour, Charge_t recoCharge, Resolution_t resolution, Topology_t topology, ProtonTag_t proton, ElectronTag_t electron, TH2D *h, Double_t extraWeight=1.0)
void Fill (Int_t nOsc, Event *event, Double_t extraWeight)

Static Public Member Functions

static InterfaceInstance ()

Private Member Functions

 Interface ()
virtual ~Interface ()

Detailed Description

Definition at line 13 of file GhostFitter/HEAD/Interface.h.


Constructor & Destructor Documentation

Interface::Interface (  )  [private]

Definition at line 30 of file GhostFitter/HEAD/Interface.cxx.

00031 {
00032   
00033 }

Interface::~Interface (  )  [private, virtual]

Definition at line 35 of file GhostFitter/HEAD/Interface.cxx.

00036 {
00037   
00038 }


Member Function Documentation

void Interface::Fill ( Int_t  nOsc,
Event event,
Double_t  extraWeight 
)

Definition at line 79 of file GhostFitter/HEAD/Interface.cxx.

References MuELoss::a, OscFit::AsString(), OscFit::Event::Containment, OscFit::Event::ElectronTag, Fill(), Instance(), OscFit::kAtmos2D, OscFit::kAtmos2DHiRes, OscFit::kAtmos2DLoRes, OscFit::kAtmosAngle, OscFit::kAtmosAngleHiRes, OscFit::kAtmosAngleLoRes, OscFit::kAtmosEnergy, OscFit::kAtmosLogLE, OscFit::kAtmosSingleBin, OscFit::kBeamCC, OscFit::kBeamHiRes, OscFit::kBeamNUE, OscFit::kSingleBin, OscFit::Event::ProtonTag, OscFit::Event::RecoCharge, OscFit::Event::RecoEnergy, OscFit::Event::RecoFlavour, OscFit::Event::Resolution, OscFit::Event::RunPeriod, OscFit::Event::Sample, OscFit::Event::Shift, OscFit::Event::Source, OscFit::Event::Systematic, OscFit::Event::Topology, OscFit::Event::TrueCharge, OscFit::Event::TrueFlavour, and OscFit::Event::Weight.

00080 {
00081   // sanity checks
00082   if( event==0 
00083    || event->RecoEnergy<=0
00084    || extraWeight*event->Weight<=0 ) return;
00085 
00086   // add this event
00087   Double_t a = 0.0;
00088   Double_t b = 0.0;
00089   Double_t c = 0.0;
00090 
00091   Double_t weight = extraWeight*event->Weight;
00092 
00093   // look up binning scheme
00094   Binning_t theBinning = BinningScheme::Instance()->LookupBinning( event->RunPeriod,
00095                                                                    event->Containment,
00096                                                                    event->RecoFlavour,
00097                                                                    event->Resolution );
00098   // single bin
00099   if( theBinning==OscFit::kSingleBin ){
00100     a = 0.0;
00101     b = weight;
00102     c = 0.0;
00103   }
00104  
00105   // bin by energy
00106   else if( theBinning==OscFit::kBeamCC 
00107    || theBinning==OscFit::kBeamNUE
00108    || theBinning==OscFit::kBeamHiRes ){
00109     a = event->RecoEnergy;
00110     b = weight;
00111     c = 0.0;
00112   }
00113 
00114   // bin by Log(L/E)
00115   else if( theBinning==OscFit::kAtmosLogLE ){
00116     a = event->RecoLength/event->RecoEnergy;
00117     b = weight;
00118     c = 0.0;
00119   }
00120 
00121   // bin by energy
00122   else if( theBinning==OscFit::kAtmosEnergy
00123    || theBinning==OscFit::kAtmosSingleBin ){
00124     a = event->RecoEnergy;
00125     b = weight;
00126     c = 0.0;
00127   }
00128 
00129   // bin by zenith angle
00130   else if( theBinning==OscFit::kAtmosAngle 
00131    || theBinning==OscFit::kAtmosAngleLoRes
00132    || theBinning==OscFit::kAtmosAngleHiRes ){
00133     a = event->RecoCosZen;
00134     b = weight;
00135     c = 0.0;
00136   }
00137 
00138   // bin by zenith angle vs energy
00139   else if( theBinning==OscFit::kAtmos2D 
00140    || theBinning==OscFit::kAtmos2DLoRes 
00141    || theBinning==OscFit::kAtmos2DHiRes ){
00142     a = event->RecoCosZen;
00143     b = event->RecoEnergy;
00144     c = weight;
00145   }
00146 
00147   // bail out
00148   else {
00149     std::cout << " warning: unrecognised binning scheme [" << OscFit::AsString(theBinning) << "] " << std::endl;
00150     assert(0);
00151   }
00152 
00153   // add this event
00154   Fill( nOsc,
00155         event->Source, event->Sample,
00156         event->TrueFlavour, event->TrueCharge,
00157         event->Systematic, event->Shift,
00158         event->RunPeriod, event->Containment,
00159         event->RecoFlavour, event->RecoCharge,
00160         event->Resolution, event->Topology,
00161         event->ProtonTag, event->ElectronTag,
00162         a, b, c );
00163 
00164   return;
00165 }

void Interface::Fill ( Int_t  nOsc,
Source_t  source,
Sample_t  sample,
Flavour_t  trueFlavour,
Charge_t  trueCharge,
Systematic_t  systematic,
Shift_t  shift,
Run_t  run,
Containment_t  containment,
Flavour_t  recoFlavour,
Charge_t  recoCharge,
Resolution_t  resolution,
Topology_t  topology,
ProtonTag_t  proton,
ElectronTag_t  electron,
TH2D *  h,
Double_t  extraWeight = 1.0 
)

Definition at line 192 of file GhostFitter/HEAD/Interface.cxx.

References MuELoss::a, Fill(), and OscFit::BinningScheme::Instance().

00193 {
00194   if( h==0 ) return;
00195 
00196    assert( BinningScheme::Instance()->CheckBinning( run, containment, 
00197                                                     recoFlavour, resolution, 
00198                                                     h->GetXaxis()->GetNbins(), 
00199                                                     h->GetYaxis()->GetNbins() ) );
00200    
00201   for( Int_t nx=0; nx<h->GetXaxis()->GetNbins(); nx++ ){
00202     for( Int_t ny=0; ny<h->GetYaxis()->GetNbins(); ny++ ){
00203       Double_t a = h->GetXaxis()->GetBinCenter(nx+1);
00204       Double_t b = h->GetYaxis()->GetBinCenter(ny+1);
00205       Double_t c = extraWeight * h->GetBinContent(nx+1,ny+1);
00206 
00207       Fill( nOsc, 
00208             source, sample, trueFlavour, trueCharge, systematic, shift,
00209             run, containment, recoFlavour, recoCharge, 
00210             resolution, topology, proton, electron, 
00211             a, b, c );
00212     }
00213   }
00214 }

void Interface::Fill ( Int_t  nOsc,
Source_t  source,
Sample_t  sample,
Flavour_t  trueFlavour,
Charge_t  trueCharge,
Systematic_t  systematic,
Shift_t  shift,
Run_t  run,
Containment_t  containment,
Flavour_t  recoFlavour,
Charge_t  recoCharge,
Resolution_t  resolution,
Topology_t  topology,
ProtonTag_t  proton,
ElectronTag_t  electron,
TH1D *  h,
Double_t  extraWeight = 1.0 
)

Definition at line 167 of file GhostFitter/HEAD/Interface.cxx.

References MuELoss::a, Fill(), OscFit::BinningScheme::Instance(), OscFit::Configuration::Instance(), OscFit::kAtmosData, OscFit::kLoRes, and n.

00168 {
00169   if( h==0 ) return;
00170 
00171   assert( BinningScheme::Instance()->CheckBinning( run, containment, 
00172                                                    recoFlavour, resolution, 
00173                                                    h->GetXaxis()->GetNbins(), 1 ) );
00174   
00175   for( Int_t n=0; n<h->GetXaxis()->GetNbins(); n++ ){
00176     Double_t a = h->GetXaxis()->GetBinCenter(n+1);
00177     Double_t b = extraWeight * h->GetBinContent(n+1);
00178 
00179     if( source==OscFit::kAtmosData && resolution==OscFit::kLoRes
00180      && Configuration::Instance()->DoingLowResolutionEnergyBins()==false ){
00181       if( n==0 ) b = extraWeight * h->Integral(); else continue;
00182     }
00183 
00184     Fill( nOsc, 
00185           source, sample, trueFlavour, trueCharge, systematic, shift,
00186           run, containment, recoFlavour, recoCharge, 
00187           resolution, topology, proton, electron, 
00188           a, b );
00189   }
00190 }

void Interface::Fill ( Int_t  nOsc,
Source_t  source,
Sample_t  sample,
Flavour_t  trueFlavour,
Charge_t  trueCharge,
Systematic_t  systematic,
Shift_t  shift,
Run_t  run,
Containment_t  containment,
Flavour_t  recoFlavour,
Charge_t  recoCharge,
Resolution_t  resolution,
Topology_t  topology,
ProtonTag_t  proton,
ElectronTag_t  electron,
Double_t  a,
Double_t  b = 1.0,
Double_t  c = 1.0 
)

Definition at line 53 of file GhostFitter/HEAD/Interface.cxx.

References OscFit::Template::Fill(), Instance(), OscFit::Configuration::Instance(), OscFit::kAnyCharge, OscFit::kCentre, OscFit::kCosmic, OscFit::kData, OscFit::kNC, OscFit::kNoCharge, and OscFit::TemplateMap::MakeTemplate().

Referenced by Fill(), and Make().

00054 {
00055   if( nOsc>0 ){
00056     if( sample==OscFit::kData || sample==OscFit::kCosmic
00057      || trueCharge==OscFit::kNoCharge || trueCharge==OscFit::kAnyCharge
00058      || trueFlavour==OscFit::kNC ) return;
00059   }
00060 
00061   if( Configuration::Instance()->UsingThisRun(run)==0 ) return;
00062 
00063   if( systematic!=OscFit::kCentre
00064    && Configuration::Instance()->DoingSystematics()==0 ) return;
00065 
00066   TemplateMap* tempMap = TemplateGrid::Instance()->MakeTemplate( nOsc );
00067   if( tempMap==0 ) return;
00068 
00069   Template* temp = tempMap->MakeTemplate( source, sample, trueFlavour, trueCharge, systematic, shift );
00070   if( temp==0 ) return;
00071 
00072   temp->Fill( run, containment, recoFlavour, recoCharge, 
00073               resolution, topology, proton, electron, 
00074               a, b, c );
00075 
00076   return;
00077 }  

Interface * Interface::Instance (  )  [static]

Definition at line 21 of file GhostFitter/HEAD/Interface.cxx.

Referenced by Fill().

00022 {
00023   if( !fgInterface ){
00024     fgInterface = new Interface();
00025   }
00026 
00027   return fgInterface;
00028 }

void Interface::Make ( Int_t  nOsc,
Source_t  source,
Sample_t  sample,
Flavour_t  trueFlavour,
Charge_t  trueCharge,
Systematic_t  systematic,
Shift_t  shift,
Run_t  run,
Containment_t  containment,
Flavour_t  recoFlavour,
Charge_t  recoCharge,
Resolution_t  resolution,
Topology_t  topology,
ProtonTag_t  proton,
ElectronTag_t  electron 
)

Definition at line 40 of file GhostFitter/HEAD/Interface.cxx.

References Fill().

00041 {
00042   return Fill(nOsc,
00043               source, sample,
00044               trueFlavour, trueCharge,
00045               systematic, shift,
00046               run, containment,
00047               recoFlavour, recoCharge,
00048               resolution, topology,
00049               proton, electron,
00050               0.0, 0.0, 0.0 );
00051 }


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

Generated on 18 Oct 2018 for loon by  doxygen 1.6.1