OscFit::TemplateIO Class Reference

#include <TemplateIO.h>

List of all members.

Public Member Functions

void ReadData (const char *filename)
void ReadMC (const char *filename)
void ReadMC (Int_t nOsc, const char *filename)
void Read (Int_t nOsc, const char *filename)
void Read (const char *filename)
void Write (const char *filename)
void ReadTemplates (const char *filename)
void WriteTemplates (const char *filename)
void WriteHistograms (Template *temp, const char *filename)
void WriteOutput (Template *temp, const char *filename)
void WriteBeamData (Template *temp, const char *filename)
void WriteAtmosData (Template *temp, const char *filename)
void PrintTemplates ()
void WriteNQ (Bool_t yesno=1)
void WritePQ (Bool_t yesno=1)
void WriteNue (Bool_t yesno=1)
void WriteNumu (Bool_t yesno=1)
void CheckMC (const char *filename)

Static Public Member Functions

static TemplateIOInstance ()

Private Member Functions

 TemplateIO ()
virtual ~TemplateIO ()
void OpenFile (const char *filename)
void CloseFile ()
void ReadFromFile (Int_t nOsc, const char *filename)
void WriteData (TemplateMap *tempMap, const char *filename)
void WriteMC (TemplateMap *tempMap, const char *filename)
void WriteToFile (Template *temp, const char *label)
void WriteToFile (Template *temp, const char *label, Source_t source, Sample_t sample, Flavour_t flavour, Charge_t charge, Systematic_t systematic, Shift_t shift)
void WriteToFile (Histogram *hist, const char *label)
void WriteToFile (Histogram *hist, const char *label, Run_t run, Containment_t containment, Flavour_t flavour, Charge_t charge, Resolution_t resolution, Topology_t topology, ProtonTag_t proton, ElectronTag_t electron)
TString GetLabelForTruth (Source_t source, Sample_t sample, Flavour_t flavour, Charge_t charge, Systematic_t systematic, Shift_t shift)
TString GetLabelForReco (Run_t run, Containment_t containment, Flavour_t flavour, Charge_t charge, Resolution_t resolution, Topology_t topology, ProtonTag_t proton, ElectronTag_t electron)
TString GetShortLabelForReco (Run_t run, Containment_t containment, Flavour_t flavour, Charge_t charge, Resolution_t resolution, Topology_t topology, ProtonTag_t proton, ElectronTag_t electron)

Private Attributes

TDirectory * fDirHandle
TFile * fFileHandle
TTree * fTreeHandle
Int_t fSource
Int_t fSample
Int_t fTrueFlavour
Int_t fTrueCharge
Int_t fSystematic
Int_t fShift
Int_t fRun
Int_t fContainment
Int_t fRecoFlavour
Int_t fRecoCharge
Int_t fResolution
Int_t fTopology
Int_t fProton
Int_t fElectron
Int_t fDimensions
TString fLabel
Bool_t fWriteNQ
Bool_t fWritePQ
Bool_t fWriteNue
Bool_t fWriteNumu
Bool_t fUseShortLabelling

Detailed Description

Definition at line 19 of file TemplateIO.h.


Constructor & Destructor Documentation

TemplateIO::TemplateIO (  )  [private]

Definition at line 28 of file TemplateIO.cxx.

References fFileHandle, fLabel, fTreeHandle, fUseShortLabelling, fWriteNQ, fWriteNue, fWriteNumu, and fWritePQ.

00029 {
00030   fFileHandle = 0;
00031   fTreeHandle = 0;
00032 
00033   fLabel = "hist";
00034 
00035   fWriteNQ = 1;
00036   fWritePQ = 1;
00037 
00038   fWriteNue = 1;
00039   fWriteNumu = 1;
00040 
00041   fUseShortLabelling = 0;
00042 }

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

Definition at line 44 of file TemplateIO.cxx.

00045 {
00046   
00047 }


Member Function Documentation

void TemplateIO::CheckMC ( const char *  filename  ) 

Definition at line 176 of file TemplateIO.cxx.

References gSystem(), OscFit::TemplateGrid::Instance(), and Instance().

00177 {
00178   //
00179   // std::cout << " *** TemplateIO::CheckMC(...) *** " << std::endl;
00180   //
00181 
00182   std::cout << "  Checking Templates: " << filename << std::endl;      
00183 
00184   if( TemplateGrid::Instance()->TouchGrid()==0 ){
00185     std::cout << " --- WARNING: NO GRID LOADED --- " << std::endl;
00186   }
00187 
00188   // Loop over Grid Points
00189   Bool_t okay = true;
00190 
00191   for( Int_t nOsc=0; nOsc<TemplateGrid::Instance()->GetNumGridPoints(); nOsc++ ){
00192   
00193     // Construct Label
00194     TString label = ".";
00195     label.Append( TemplateGrid::Instance()->GetLabel(nOsc) );
00196 
00197     TString inFile = filename;
00198 
00199     if( inFile.EndsWith(".root") ){
00200       inFile.Insert(inFile.Length()-5,label);
00201     }
00202     else{
00203       inFile.Append(label);
00204     }
00205 
00206     // Touch Data
00207     if( gSystem->AccessPathName( inFile.Data() ) ) { // returns kTrue if non-existent
00208 
00209       std::cout << "   Warning, missing grid point: " << nOsc << std::endl;      
00210 
00211       //
00212       // std::cout << nOsc << "," << nOsc+1 << std::endl;  // Print out the new jobs!
00213       //
00214 
00215       okay = false;
00216     }
00217   }
00218  
00219   if( okay ){
00220     std::cout << "   Done!" << std::endl;
00221   }
00222   else{
00223     std::cout << "   Warning, missing grid points [Bailing out...] " << std::endl;
00224     assert( okay ); 
00225   }
00226 
00227   return;
00228 }

void TemplateIO::CloseFile (  )  [private]

Definition at line 85 of file TemplateIO.cxx.

References fDirHandle, fFileHandle, and fTreeHandle.

Referenced by WriteAtmosData(), WriteBeamData(), WriteData(), WriteMC(), and WriteOutput().

00086 {
00087   if( fFileHandle==0 ) return;
00088 
00089   std::cout << "  Closing File: " << fFileHandle->GetName() << std::endl;
00090 
00091   fTreeHandle->Write();
00092   fFileHandle->Close();
00093   fFileHandle = 0;
00094   fTreeHandle = 0;
00095 
00096   gDirectory = fDirHandle;
00097 }

TString TemplateIO::GetLabelForReco ( Run_t  run,
Containment_t  containment,
Flavour_t  flavour,
Charge_t  charge,
Resolution_t  resolution,
Topology_t  topology,
ProtonTag_t  proton,
ElectronTag_t  electron 
) [private]

Definition at line 799 of file TemplateIO.cxx.

References OscFit::AsString().

Referenced by ReadFromFile(), and WriteToFile().

00800 {
00801   TString label = "";
00802 
00803   label.Append( OscFit::AsString(run) );
00804   label.Append("_");
00805   label.Append( OscFit::AsString(containment) );
00806   label.Append("_");
00807   label.Append( OscFit::AsString(flavour) );
00808   label.Append("_");
00809   label.Append( OscFit::AsString(charge) );
00810   label.Append("_");
00811   label.Append( OscFit::AsString(resolution) );
00812   label.Append("_");
00813   label.Append( OscFit::AsString(topology) );
00814   label.Append("_");
00815   label.Append( OscFit::AsString(proton) );
00816   label.Append("_");
00817   label.Append( OscFit::AsString(electron) );
00818 
00819   return label;
00820 }

TString TemplateIO::GetLabelForTruth ( Source_t  source,
Sample_t  sample,
Flavour_t  flavour,
Charge_t  charge,
Systematic_t  systematic,
Shift_t  shift 
) [private]

Definition at line 780 of file TemplateIO.cxx.

References OscFit::AsString().

Referenced by ReadFromFile(), and WriteToFile().

00781 {
00782   TString label = "";
00783   
00784   label.Append( OscFit::AsString(source) );
00785   label.Append("_");
00786   label.Append( OscFit::AsString(sample) );
00787   label.Append("_");
00788   label.Append( OscFit::AsString(flavour) );
00789   label.Append("_");
00790   label.Append( OscFit::AsString(charge) );
00791   label.Append("_");
00792   label.Append( OscFit::AsString(systematic) );
00793   label.Append("_");
00794   label.Append( OscFit::AsString(shift) );
00795 
00796   return label;
00797 }

TString TemplateIO::GetShortLabelForReco ( Run_t  run,
Containment_t  containment,
Flavour_t  flavour,
Charge_t  charge,
Resolution_t  resolution,
Topology_t  topology,
ProtonTag_t  proton,
ElectronTag_t  electron 
) [private]

Definition at line 822 of file TemplateIO.cxx.

References OscFit::kAmbig, OscFit::kAntiNeutrino, OscFit::kAny, OscFit::kAtmos, OscFit::kBeam, OscFit::kContainedVertex, OscFit::kElectron, OscFit::kFrontPlane, OscFit::kFullyContained, OscFit::kInnerEdge, OscFit::kLoRes, OscFit::kMulti, OscFit::kNC, OscFit::kNeutrino, OscFit::kNoElectron, OscFit::kNoProton, OscFit::kNu, OscFit::kNuBar, OscFit::kNue, OscFit::kNumu, OscFit::kNutau, OscFit::kOuterEdge, OscFit::kPartiallyContained, OscFit::kProton, OscFit::kQuasiElastic, OscFit::kResBin0, OscFit::kResBin1, OscFit::kResBin2, OscFit::kResBin3, OscFit::kResBin4, OscFit::kResBin5, OscFit::kResBin6, OscFit::kResBin7, OscFit::kResBin8, OscFit::kResBin9, OscFit::kRockMuon, OscFit::kRunI, OscFit::kRunIHE, OscFit::kRunII, OscFit::kRunIII, OscFit::kRunIV, OscFit::kRunIVFHC, OscFit::kRunIX, OscFit::kRunV, OscFit::kRunVI, OscFit::kRunVII, OscFit::kRunVIII, OscFit::kRunX, OscFit::kRunXI, OscFit::kRunXII, OscFit::kRunXIII, OscFit::kSingle, OscFit::kUpStop, and OscFit::kUpThrough.

Referenced by WriteToFile().

00823 {
00824   TString label = "";  
00825 
00826   
00827   switch( run ) {
00828     case kAtmos:        label.Append("atmos");    break;   
00829     case kBeam:         label.Append("beam");     break;
00830     case kNeutrino:     label.Append("fhc");      break;
00831     case kAntiNeutrino: label.Append("rhc");      break; 
00832     case kRunI:         label.Append("run01");    break;       
00833     case kRunIHE:       label.Append("run01phe"); break;    
00834     case kRunII:        label.Append("run02");    break;    
00835     case kRunIII:       label.Append("run03");    break;
00836     case kRunIVFHC:     label.Append("run04fhc"); break;
00837     case kRunIV:        label.Append("run04");    break;    
00838     case kRunV:         label.Append("run05");    break;    
00839     case kRunVI:        label.Append("run06");    break;    
00840     case kRunVII:       label.Append("run07");    break;   
00841     case kRunVIII:      label.Append("run08");    break;    
00842     case kRunIX:        label.Append("run09");    break;    
00843     case kRunX:         label.Append("run10");    break;    
00844     case kRunXI:        label.Append("run11");    break;    
00845     case kRunXII:       label.Append("run12");    break;
00846     case kRunXIII:      label.Append("run13");    break;
00847     default:            label.Append("data");     break;    
00848   }
00849 
00850   switch( containment ) {
00851     case kContainedVertex:    label.Append("_cv");     break;
00852     case kFullyContained:     label.Append("_fc");     break;
00853     case kPartiallyContained: label.Append("_pc");     break;
00854     case kRockMuon:           label.Append("_rock");   break;
00855     case kUpStop:             label.Append("_upstop"); break;
00856     case kUpThrough:          label.Append("_upthru"); break;
00857     case kInnerEdge:          label.Append("_inner");  break;
00858     case kOuterEdge:          label.Append("_outer");  break;
00859     case kFrontPlane:         label.Append("_front");  break;
00860     default:                  break;          
00861   }
00862 
00863   switch( flavour ) { 
00864     case kNC:    label.Append("_nc");    break;
00865     case kNue:   label.Append("_nue");   break;
00866     case kNumu:  label.Append("_numu");  break;
00867     case kNutau: label.Append("_nutau"); break;
00868     default:     break;   
00869   }
00870 
00871   if( charge==kAmbig && resolution!=kLoRes ){
00872     label.Append("_ambig");
00873   }
00874   
00875   if( charge==kAny && resolution==kLoRes ){
00876     label.Append("_all");
00877   }
00878 
00879   switch( charge ) {
00880     case kNu:    label.Append("_nu");    break;
00881     case kNuBar: label.Append("_nubar"); break;
00882     default:     break;
00883   }
00884   
00885   switch( resolution ) {
00886     case kLoRes:   label.Append("_lores"); break;
00887     case kResBin0: label.Append("_bin0"); break;
00888     case kResBin1: label.Append("_bin1"); break;
00889     case kResBin2: label.Append("_bin2"); break;
00890     case kResBin3: label.Append("_bin3"); break;
00891     case kResBin4: label.Append("_bin4"); break;
00892     case kResBin5: label.Append("_bin5"); break;
00893     case kResBin6: label.Append("_bin6"); break;
00894     case kResBin7: label.Append("_bin7"); break;
00895     case kResBin8: label.Append("_bin8"); break;
00896     case kResBin9: label.Append("_bin9"); break;
00897     default:       break;
00898   }
00899 
00900   switch( topology ) {
00901     case kSingle:       label.Append("_single"); break;
00902     case kMulti:        label.Append("_multi"); break;
00903     case kQuasiElastic: label.Append("_qel"); break;
00904     default:            break;
00905   }
00906 
00907   switch( proton ) {  
00908     case kNoProton: label.Append("_noptag"); break;
00909     case kProton:   label.Append("_ptag"); break;
00910     default:        break;
00911   }
00912 
00913   switch( electron ) {  
00914     case kNoElectron: label.Append("_noetag"); break;
00915     case kElectron:   label.Append("_etag"); break;
00916     default:          break;
00917   }
00918 
00919   return label;
00920 }

TemplateIO * TemplateIO::Instance (  )  [static]

Definition at line 19 of file TemplateIO.cxx.

Referenced by CheckMC(), PrintTemplates(), ReadFromFile(), ReadMC(), and Write().

00020 {
00021   if( !fgTemplateIO ){
00022     fgTemplateIO = new TemplateIO();
00023   }
00024 
00025   return fgTemplateIO;
00026 }

void TemplateIO::OpenFile ( const char *  filename  )  [private]

Definition at line 54 of file TemplateIO.cxx.

References fContainment, fDimensions, fDirHandle, fElectron, fFileHandle, fProton, fRecoCharge, fRecoFlavour, fResolution, fRun, fSample, fShift, fSource, fSystematic, fTopology, fTreeHandle, fTrueCharge, and fTrueFlavour.

Referenced by WriteAtmosData(), WriteBeamData(), WriteData(), WriteMC(), and WriteOutput().

00055 {
00056   std::cout << "  Opening File: " << filename << std::endl;
00057 
00058   if( fFileHandle ) return;
00059 
00060   fDirHandle = gDirectory;
00061   fFileHandle = new TFile(filename,"recreate");
00062 
00063   assert( fFileHandle->IsOpen() );
00064 
00065   fTreeHandle = new TTree("index","Index of histograms stored in this file"); 
00066   fTreeHandle->Branch("source",&fSource,"source/I"); 
00067   fTreeHandle->Branch("sample",&fSample,"sample/I"); 
00068   fTreeHandle->Branch("trueflavour",&fTrueFlavour,"trueflavour/I"); 
00069   fTreeHandle->Branch("truecharge",&fTrueCharge,"truecharge/I"); 
00070   fTreeHandle->Branch("systematic",&fSystematic,"systematic/I"); 
00071   fTreeHandle->Branch("shift",&fShift,"shift/I");
00072   fTreeHandle->Branch("run",&fRun,"run/I");
00073   fTreeHandle->Branch("containment",&fContainment,"containment/I"); 
00074   fTreeHandle->Branch("recoflavour",&fRecoFlavour,"recoflavour/I");
00075   fTreeHandle->Branch("recocharge",&fRecoCharge,"recocharge/I");
00076   fTreeHandle->Branch("resolution",&fResolution,"resolution/I"); 
00077   fTreeHandle->Branch("topology",&fTopology,"topology/I");
00078   fTreeHandle->Branch("proton",&fProton,"proton/I");
00079   fTreeHandle->Branch("electron",&fElectron,"electron/I"); 
00080   fTreeHandle->Branch("dimensions",&fDimensions,"dimensions/I"); 
00081 
00082   return;
00083 }

void TemplateIO::PrintTemplates (  ) 

Definition at line 49 of file TemplateIO.cxx.

References Instance(), and PrintTemplates().

Referenced by PrintTemplates().

00050 {
00051   return TemplateGrid::Instance()->PrintTemplates();
00052 }

void TemplateIO::Read ( const char *  filename  ) 

Definition at line 118 of file TemplateIO.cxx.

References ReadData(), and ReadMC().

00119 {
00120   TString label = ".data";
00121   TString inFile = filename;
00122 
00123   if( inFile.EndsWith(".root") ){
00124     inFile.Insert(inFile.Length()-5,label);
00125   }
00126   else{
00127     inFile.Append(label);
00128   }
00129 
00130   ReadData( inFile.Data() );  
00131   ReadMC( filename );         
00132 }

void TemplateIO::Read ( Int_t  nOsc,
const char *  filename 
)

Definition at line 99 of file TemplateIO.cxx.

References ReadData(), and ReadMC().

Referenced by ReadTemplates().

00100 {
00101   if( nOsc==0 ){
00102     TString label = ".data";
00103     TString inFile = filename;
00104 
00105     if( inFile.EndsWith(".root") ){
00106       inFile.Insert(inFile.Length()-5,label);
00107     }
00108     else{
00109       inFile.Append(label);
00110     }
00111 
00112     ReadData( inFile.Data() );  
00113   }
00114 
00115   ReadMC( nOsc, filename );
00116 }

void TemplateIO::ReadData ( const char *  filename  ) 

Definition at line 134 of file TemplateIO.cxx.

References ReadFromFile().

Referenced by Read().

00135 {
00136   std::cout << " *** TemplateIO::Read(...) *** " << std::endl;
00137   std::cout << "  Reading templates from: " << filename << std::endl;
00138 
00139   ReadFromFile( 0, filename ); // assume that file only contains data!
00140 }

void TemplateIO::ReadFromFile ( Int_t  nOsc,
const char *  filename 
) [private]

Definition at line 533 of file TemplateIO.cxx.

References OscFit::Configuration::DoingScalingInReader(), fContainment, fDimensions, fElectron, fLabel, fProton, fRecoCharge, fRecoFlavour, fResolution, fRun, fSample, fShift, fSource, fSystematic, fTopology, fTrueCharge, fTrueFlavour, OscFit::GetContainmentType(), OscFit::GetID(), GetLabelForReco(), GetLabelForTruth(), OscFit::GetResolutionType(), OscFit::GetSource(), gSystem(), Instance(), OscFit::Configuration::Instance(), OscFit::IsMINOSPlus(), OscFit::kAtmosData, OscFit::kBeamData, OscFit::kCentre, OscFit::kContainedVertex, OscFit::kData, OscFit::kHiRes, OscFit::kIgnoreElectron, OscFit::kIgnoreProton, OscFit::kNCbkg, OscFit::kNoCharge, OscFit::kNull, OscFit::kNumu, OscFit::kResBin1, OscFit::kResBin2, OscFit::kResBin3, OscFit::kResBin4, OscFit::kResBin5, OscFit::kResBin6, OscFit::kResBin7, OscFit::kResBin8, OscFit::kRockMuon, OscFit::kVanilla, n, run(), OscFit::Configuration::ScalingBothDataAndMC(), and OscFit::Configuration::UsingThisRun().

Referenced by ReadData(), and ReadMC().

00534 { 
00535   if( gSystem->AccessPathName( filename ) ) { // returns kTrue if non-existent
00536     std::cout << "  Warning, failed to find: " << filename << std::endl;
00537     assert(0); // something's wrong, bail out
00538     return;
00539   }
00540 
00541   //
00542   // --- PRINT FILE NAME ---
00543   // std::cout << "   Reading: [" << nOsc << "]\t " << filename << std::endl;
00544   //
00545 
00546   TDirectory* tmpd = gDirectory;
00547   TFile* file = TFile::Open(filename);
00548   TTree* tree = (TTree*)(file->Get("index"));
00549 
00550   tree->SetBranchAddress("source",&fSource); 
00551   tree->SetBranchAddress("sample",&fSample); 
00552   tree->SetBranchAddress("trueflavour",&fTrueFlavour);
00553   tree->SetBranchAddress("truecharge",&fTrueCharge);
00554   tree->SetBranchAddress("systematic",&fSystematic);
00555   tree->SetBranchAddress("shift",&fShift);
00556   tree->SetBranchAddress("run",&fRun);
00557   tree->SetBranchAddress("containment",&fContainment);
00558   tree->SetBranchAddress("recoflavour",&fRecoFlavour);
00559   tree->SetBranchAddress("recocharge",&fRecoCharge);
00560   tree->SetBranchAddress("resolution",&fResolution);
00561   tree->SetBranchAddress("topology",&fTopology);
00562   tree->SetBranchAddress("proton",&fProton);
00563   tree->SetBranchAddress("electron",&fElectron);
00564   tree->SetBranchAddress("dimensions",&fDimensions);
00565 
00566   for( Int_t n=0; n<tree->GetEntries(); n++ ){
00567     tree->GetEntry(n);
00568 
00569     // get label
00570     Source_t      source      = static_cast<Source_t>(fSource);
00571     Sample_t      sample      = static_cast<Sample_t>(fSample);
00572     Flavour_t     trueflavour = static_cast<Flavour_t>(fTrueFlavour);
00573     Charge_t      truecharge  = static_cast<Charge_t>(fTrueCharge);
00574     Systematic_t  systematic  = static_cast<Systematic_t>(fSystematic);
00575     Shift_t       shift       = static_cast<Shift_t>(fShift);
00576     Run_t         run         = static_cast<Run_t>(fRun);
00577     Containment_t containment = static_cast<Containment_t>(fContainment);
00578     Flavour_t     recoflavour = static_cast<Flavour_t>(fRecoFlavour);
00579     Charge_t      recocharge  = static_cast<Charge_t>(fRecoCharge);
00580     Resolution_t  resolution  = static_cast<Resolution_t>(fResolution);
00581     Topology_t    topology    = static_cast<Topology_t>(fTopology);
00582     ProtonTag_t   proton      = static_cast<ProtonTag_t>(fProton);
00583     ElectronTag_t electron    = static_cast<ElectronTag_t>(fElectron);
00584 
00585     // checks on run period
00586     if( Configuration::Instance()->UsingThisRun(run)==0 ) continue;
00587  
00588     // apply scaling factor
00589     Double_t applyScaleFactor = 1.0;
00590 
00591     if( Configuration::Instance()->DoingScalingInReader()==true ){
00592       if( Configuration::Instance()->ScalingBothDataAndMC()==true || sample!=OscFit::kData ){
00593         applyScaleFactor = Configuration::Instance()->GetScale(run);
00594       }
00595     }
00596 
00597     // checks on systematics
00598     if( systematic!=OscFit::kCentre
00599      && Configuration::Instance()->DoingSystematics()==0 ) continue;
00600 
00601     // neglect NC systematic for MINOS+ data
00602     if ( OscFit::IsMINOSPlus(run) && systematic==OscFit::kNCbkg
00603       && Configuration::Instance()->DoingNCBkgSystematicInMINOSPlus()==0 ) continue;
00604 
00605     // read from file
00606     TString histName = fLabel;
00607     histName.Append("_");
00608     histName.Append( GetLabelForTruth( source, sample, trueflavour, truecharge, 
00609                                        systematic, shift ) );
00610     histName.Append("_");
00611     histName.Append( GetLabelForReco( run, containment, recoflavour, recocharge, 
00612                                       resolution, topology, proton, electron ) );
00613 
00614     //
00615     // --- PRINT HISTOGRAM NAMES ---
00616     // std::cout << "   Reading: [" << nOsc << "]\t " << histName.Data() << std::endl;
00617     //
00618 
00619     // combine bins
00620     // (note: this code is currently duplicated in TemplateCalculator.cxx)
00621     Containment_t newContainment = containment;
00622     Charge_t      newRecoCharge  = recocharge;
00623     Resolution_t  newResolution  = resolution;
00624     Topology_t    newTopology    = topology;
00625     ProtonTag_t   newProton      = proton;
00626     ElectronTag_t newElectron    = electron;
00627 
00628     if( Configuration::Instance()->DoingCombinationsInReader()==true ){
00629 
00630       if( Configuration::Instance()->UsingContainedVertexOnly()==true ){
00631         if( OscFit::GetContainmentType( containment )!=OscFit::kContainedVertex ){
00632           newContainment = OscFit::kNull;
00633         }
00634       }
00635   
00636       if( Configuration::Instance()->UsingHighResolutionOnly()==true ){
00637         if( OscFit::GetResolutionType( newResolution )!=OscFit::kHiRes ){
00638           newContainment = OscFit::kNull;
00639         }
00640       }
00641 
00642       if( OscFit::GetSource(run)==OscFit::kAtmosData 
00643        && Configuration::Instance()->UsingAtmosMuonNeutrinosOnly()==true ){
00644         if( recoflavour!=OscFit::kNumu ){
00645           newContainment = OscFit::kNull;
00646         }
00647       }
00648 
00649       if( OscFit::GetSource(run)==OscFit::kBeamData 
00650        && Configuration::Instance()->UsingBeamMuonNeutrinosOnly()==true ){
00651         if( recoflavour!=OscFit::kNumu ){
00652           newContainment = OscFit::kNull;
00653         }
00654       }
00655 
00656       if( OscFit::GetSource(run)==OscFit::kAtmosData 
00657        && Configuration::Instance()->UsingNewResolutionBinning()==true
00658        && OscFit::GetContainmentType( newContainment )==OscFit::kContainedVertex
00659        && recoflavour==OscFit::kNumu ){
00660 
00661         if( Configuration::Instance()->GetNumberOfNewResolutionBins()<8 ){
00662           if( newResolution==OscFit::kResBin5 ) newResolution=OscFit::kResBin1;
00663           if( newResolution==OscFit::kResBin6 ) newResolution=OscFit::kResBin2;
00664           if( newResolution==OscFit::kResBin7 ) newResolution=OscFit::kResBin3;
00665           if( newResolution==OscFit::kResBin8 ) newResolution=OscFit::kResBin4;
00666         }
00667      
00668         if( Configuration::Instance()->GetNumberOfNewResolutionBins()<4 ){
00669           if( newResolution==OscFit::kResBin3 ) newResolution=OscFit::kResBin1;
00670           if( newResolution==OscFit::kResBin4 ) newResolution=OscFit::kResBin2;
00671         }
00672 
00673         if( Configuration::Instance()->GetNumberOfNewResolutionBins()<2 ){
00674           if( newResolution==OscFit::kResBin2 ) newResolution=OscFit::kResBin1;
00675           if( newResolution==OscFit::kResBin1 ) newResolution=OscFit::kHiRes;
00676         }
00677        
00678         if( Configuration::Instance()->DiscardingWorstResolutionBin() ){
00679 
00680           if( Configuration::Instance()->GetNumberOfNewResolutionBins()>=8 ){
00681             if( newResolution==OscFit::kResBin8 ) newContainment = OscFit::kNull;
00682           }
00683           else if( Configuration::Instance()->GetNumberOfNewResolutionBins()>=4 ){
00684             if( newResolution==OscFit::kResBin4 ) newContainment = OscFit::kNull;
00685           }
00686           else if( Configuration::Instance()->GetNumberOfNewResolutionBins()>=2 ){
00687             if( newResolution==OscFit::kResBin2 ) newContainment = OscFit::kNull;
00688           }
00689         }
00690       }
00691 
00692       if( OscFit::GetSource(run)==OscFit::kAtmosData 
00693        && OscFit::GetContainmentType( newContainment )==OscFit::kContainedVertex
00694        && Configuration::Instance()->CombiningAtmosResBinsCV()==true ){
00695         newResolution = OscFit::GetResolutionType( resolution );
00696       }
00697 
00698       if( OscFit::GetSource(run)==OscFit::kAtmosData 
00699        && OscFit::GetContainmentType( newContainment )==OscFit::kRockMuon
00700        && Configuration::Instance()->CombiningAtmosResBinsRAF()==true ){
00701         newResolution = OscFit::GetResolutionType( resolution );
00702       }
00703  
00704       if( OscFit::GetSource(run)==OscFit::kBeamData 
00705        && OscFit::GetContainmentType( newContainment )==OscFit::kContainedVertex
00706        && Configuration::Instance()->CombiningResBins(run)==true ){
00707         newResolution = OscFit::GetResolutionType( resolution );
00708       }
00709 
00710       if( OscFit::GetSource(run)==OscFit::kAtmosData 
00711        && Configuration::Instance()->CombiningAtmosChargeBins()==true ){
00712         newRecoCharge = OscFit::kNoCharge;
00713       }
00714 
00715       if( OscFit::GetSource(run)==OscFit::kBeamData 
00716        && Configuration::Instance()->CombiningBeamChargeBins()==true ){
00717         newRecoCharge = OscFit::kNoCharge;
00718       }
00719 
00720       if( Configuration::Instance()->CombiningTopologies()==true ){
00721         newTopology = OscFit::kVanilla;
00722       }
00723 
00724       if( Configuration::Instance()->DoingProtonTagging()==false ){
00725         newProton = OscFit::kIgnoreProton;
00726       }
00727 
00728       if( Configuration::Instance()->DoingElectronTagging()==false ){
00729         newElectron = OscFit::kIgnoreElectron;
00730       }
00731 
00732       if( Configuration::Instance()->DoingPerfectChargeSeparation()==true ){
00733         if( recoflavour==OscFit::kNumu ) newRecoCharge = truecharge;
00734       }
00735     }
00736 
00737     Int_t id = Template::GetID( run, newContainment, 
00738                                 recoflavour, newRecoCharge,
00739                                 newResolution, newTopology,
00740                                 newProton, newElectron );
00741     if( id<0 ) continue;
00742 
00743     // load histogram (1D)
00744     if( fDimensions==1 ){
00745       TH1D* h = (TH1D*)( file->Get( histName.Data() ) );
00746       if( h ) Interface::Instance()->Fill( nOsc, 
00747                                            source, sample, 
00748                                            trueflavour, truecharge,
00749                                            systematic, shift,
00750                                            run, newContainment, 
00751                                            recoflavour, newRecoCharge,
00752                                            newResolution, newTopology,
00753                                            newProton, newElectron,
00754                                            h, applyScaleFactor );
00755       else std::cout << "     Failed to find this histogram... " << std::endl;
00756     }
00757 
00758     // load histogram (2D)
00759     if( fDimensions==2 ){
00760       TH2D* h = (TH2D*)( file->Get( histName.Data() ) );
00761       if( h ) Interface::Instance()->Fill( nOsc, 
00762                                            source, sample, 
00763                                            trueflavour, truecharge,
00764                                            systematic, shift,
00765                                            run, newContainment, 
00766                                            recoflavour, newRecoCharge,
00767                                            newResolution, newTopology,
00768                                            newProton, newElectron,
00769                                            h, applyScaleFactor );
00770       else std::cout << "     Failed to find this histogram... " << std::endl;
00771     }
00772   }
00773 
00774   file->Close();
00775   tmpd->cd();
00776 
00777   return;
00778 } 

void TemplateIO::ReadMC ( Int_t  nOsc,
const char *  filename 
)

Definition at line 152 of file TemplateIO.cxx.

References OscFit::TemplateGrid::Instance(), and ReadFromFile().

00153 {
00154   // Check for Grid
00155   if( nOsc>0
00156    && TemplateGrid::Instance()->TouchGrid()==0 ){
00157     std::cout << " --- WARNING: NO GRID LOADED --- " << std::endl;
00158   }
00159 
00160   // Read Data
00161   TString label = ".";
00162   label.Append( TemplateGrid::Instance()->GetLabel(nOsc) );
00163 
00164   TString inFile = filename;
00165 
00166   if( inFile.EndsWith(".root") ){
00167     inFile.Insert(inFile.Length()-5,label);
00168   }
00169   else{
00170     inFile.Append(label);
00171   }
00172 
00173   ReadFromFile( nOsc, inFile.Data() );
00174 }

void TemplateIO::ReadMC ( const char *  filename  ) 

Definition at line 142 of file TemplateIO.cxx.

References Instance(), and n.

Referenced by Read().

00143 { 
00144   std::cout << " *** TemplateIO::Read(...) *** " << std::endl;
00145   std::cout << "  Reading templates from: " << filename << std::endl;
00146 
00147   for( Int_t n=0; n<TemplateGrid::Instance()->GetNumGridPoints(); n++ ){
00148     ReadMC( n, filename );
00149   }
00150 }

void OscFit::TemplateIO::ReadTemplates ( const char *  filename  )  [inline]

Definition at line 34 of file TemplateIO.h.

References Read().

00034 { Read( filename ); }

void TemplateIO::Write ( const char *  filename  ) 

Definition at line 230 of file TemplateIO.cxx.

References OscFit::TemplateGrid::Instance(), Instance(), n, WriteData(), and WriteMC().

Referenced by WriteTemplates().

00231 {
00232   // Check for Grid
00233   if( TemplateGrid::Instance()->TouchGrid()==0 ){
00234     std::cout << " *** TemplateIO::Write(...) *** " << std::endl;
00235     std::cout << " --- WARNING: NO GRID LOADED --- " << std::endl;
00236   }
00237 
00238   std::cout<<"writiing "<<TemplateGrid::Instance()->GetNumTemplates()<<" points"<<std::endl;
00239 
00240   // Write Data
00241   if( TemplateGrid::Instance()->TouchData() ){
00242     TemplateMap* tempMap = TemplateGrid::Instance()->GetTemplate(0);
00243 
00244     TString label = ".data";
00245     TString outFile = filename;
00246 
00247     if( outFile.EndsWith(".root") ){
00248       outFile.Insert(outFile.Length()-5,label);
00249     }
00250     else{
00251       outFile.Append(label);
00252     }
00253 
00254     WriteData( tempMap, outFile.Data() );
00255   }
00256   else std::cout<<"not data"<<std::endl;
00257 
00258   // Write MC
00259   //  if( TemplateGrid::Instance()->TouchMC() ){
00260     for( Int_t n=0; n<TemplateGrid::Instance()->GetNumGridPoints(); n++ ){
00261       TemplateMap* tempMap = TemplateGrid::Instance()->GetTemplate(n);
00262 
00263       TString label = ".";
00264       label.Append( TemplateGrid::Instance()->GetLabel(n) );
00265 
00266       TString outFile = filename;
00267 
00268       if( outFile.EndsWith(".root") ){
00269         outFile.Insert(outFile.Length()-5,label);
00270       }
00271       else{
00272         outFile.Append(label);
00273       }
00274 
00275       WriteMC( tempMap, outFile.Data() );
00276     }
00277     //  }
00278     //else std::cout<<"not mc"<<std::endl;
00279 }

void TemplateIO::WriteAtmosData ( Template temp,
const char *  filename 
)

Definition at line 356 of file TemplateIO.cxx.

References CloseFile(), fLabel, OscFit::kAtmosData, OscFit::kCentre, OscFit::kData, OscFit::kNoCharge, OscFit::kNoFlavour, OscFit::kNoShift, OpenFile(), and WriteToFile().

00357 {
00358   if( temp==0 ) return;
00359 
00360   std::cout << " *** TemplateIO::WriteAtmosData(...) *** " << std::endl;
00361   std::cout << "  Writing to file: " << filename << std::endl;  
00362 
00363   OpenFile(filename);
00364 
00365   WriteToFile( temp, fLabel.Data(),
00366                kAtmosData, kData, kNoFlavour, kNoCharge, kCentre, kNoShift );
00367 
00368   CloseFile();
00369 
00370   std::cout << "  Done! " << std::endl;
00371 }

void TemplateIO::WriteBeamData ( Template temp,
const char *  filename 
)

Definition at line 373 of file TemplateIO.cxx.

References CloseFile(), fLabel, OscFit::kBeamData, OscFit::kCentre, OscFit::kData, OscFit::kNoCharge, OscFit::kNoFlavour, OscFit::kNoShift, OpenFile(), and WriteToFile().

00374 {
00375   if( temp==0 ) return;
00376   
00377   std::cout << " *** TemplateIO::WriteBeamData(...) *** " << std::endl;
00378   std::cout << "  Writing to file: " << filename << std::endl; 
00379 
00380   OpenFile(filename);
00381 
00382   WriteToFile( temp, fLabel.Data(),
00383                kBeamData, kData, kNoFlavour, kNoCharge, kCentre, kNoShift );
00384 
00385   CloseFile();
00386 
00387   std::cout << "  Done! " << std::endl;
00388 }

void TemplateIO::WriteData ( TemplateMap tempMap,
const char *  filename 
) [private]

Definition at line 281 of file TemplateIO.cxx.

References CloseFile(), fLabel, OscFit::TemplateMap::GetIndex(), OscFit::TemplateMap::GetNumTemplates(), OscFit::TemplateMap::GetTemplateAtIndex(), OscFit::TemplateMap::InvertID(), OscFit::kData, OscFit::kNoShift, OscFit::kUnknown, OscFit::kUnknownCharge, OscFit::kUnknownData, OscFit::kUnknownFlavour, OscFit::kUnknownSystematic, n, OpenFile(), OscFit::TemplateMap::TouchData(), and WriteToFile().

Referenced by Write().

00282 {
00283   if( tempMap==0 
00284    || tempMap->TouchData()==0 ) return;
00285   
00286   std::cout << " *** TemplateIO::WriteData(...) *** " << std::endl;
00287   std::cout << "  Writing to file: " << filename << std::endl;
00288 
00289   OpenFile(filename);
00290 
00291   for( UInt_t n=0; n<tempMap->GetNumTemplates(); n++ ){
00292 
00293      Int_t index = tempMap->GetIndex(n);
00294      Template* temp = tempMap->GetTemplateAtIndex(index);
00295 
00296      Source_t     source     = kUnknownData;
00297      Sample_t     sample     = kUnknown;
00298      Flavour_t    flavour    = kUnknownFlavour;
00299      Charge_t     charge     = kUnknownCharge;
00300      Systematic_t systematic = kUnknownSystematic;
00301      Shift_t      shift      = kNoShift;
00302 
00303      TemplateMap::InvertID( index, source, sample, flavour, charge, systematic, shift );
00304 
00305      if( sample != OscFit::kData ) continue; // write data
00306 
00307      WriteToFile( temp, fLabel.Data(),
00308                   source, sample, flavour, charge, systematic, shift );
00309   }
00310 
00311   CloseFile();
00312 
00313   std::cout << "  Done! " << std::endl;
00314 
00315   return;
00316 }

void OscFit::TemplateIO::WriteHistograms ( Template temp,
const char *  filename 
) [inline]

Definition at line 37 of file TemplateIO.h.

References WriteOutput().

00038                                                  { WriteOutput( temp, filename ); }

void TemplateIO::WriteMC ( TemplateMap tempMap,
const char *  filename 
) [private]

Definition at line 318 of file TemplateIO.cxx.

References CloseFile(), fLabel, OscFit::TemplateMap::GetIndex(), OscFit::TemplateMap::GetNumTemplates(), OscFit::TemplateMap::GetTemplateAtIndex(), OscFit::TemplateMap::InvertID(), OscFit::kData, OscFit::kNoShift, OscFit::kUnknown, OscFit::kUnknownCharge, OscFit::kUnknownData, OscFit::kUnknownFlavour, OscFit::kUnknownSystematic, n, OpenFile(), OscFit::TemplateMap::TouchMC(), and WriteToFile().

Referenced by Write().

00319 {
00320   if( tempMap==0 
00321    || tempMap->TouchMC()==0 ) return;
00322   
00323   std::cout << " *** TemplateIO::WriteMC(...) *** " << std::endl;
00324   std::cout << "  Writing to file: " << filename << std::endl;
00325 
00326   OpenFile(filename);
00327 
00328   for( UInt_t n=0; n<tempMap->GetNumTemplates(); n++ ){
00329 
00330      Int_t index = tempMap->GetIndex(n);
00331      Template* temp = tempMap->GetTemplateAtIndex(index);
00332 
00333      Source_t     source     = kUnknownData;
00334      Sample_t     sample     = kUnknown;
00335      Flavour_t    flavour    = kUnknownFlavour;
00336      Charge_t     charge     = kUnknownCharge;
00337      Systematic_t systematic = kUnknownSystematic;
00338      Shift_t      shift      = kNoShift;
00339 
00340      TemplateMap::InvertID( index, source, sample, flavour, charge, systematic, shift );
00341 
00342      if( sample == OscFit::kData ) continue; // write MC
00343 
00344      WriteToFile( temp, fLabel.Data(),
00345                   source, sample, flavour, charge, systematic, shift );
00346   }
00347 
00348   CloseFile();
00349 
00350   std::cout << "  Done! " << std::endl;
00351 
00352   return;
00353 }

void OscFit::TemplateIO::WriteNQ ( Bool_t  yesno = 1  )  [inline]

Definition at line 46 of file TemplateIO.h.

References fWriteNQ.

00046 { fWriteNQ = yesno; }

void OscFit::TemplateIO::WriteNue ( Bool_t  yesno = 1  )  [inline]

Definition at line 49 of file TemplateIO.h.

References fWriteNue.

00049 { fWriteNue = yesno; }

void OscFit::TemplateIO::WriteNumu ( Bool_t  yesno = 1  )  [inline]

Definition at line 50 of file TemplateIO.h.

References fWriteNumu.

00050 { fWriteNumu = yesno; }

void TemplateIO::WriteOutput ( Template temp,
const char *  filename 
)

Definition at line 390 of file TemplateIO.cxx.

References CloseFile(), fLabel, fSample, fShift, fSource, fSystematic, fTrueCharge, fTrueFlavour, fUseShortLabelling, OscFit::kNoShift, OscFit::kUnknown, OscFit::kUnknownCharge, OscFit::kUnknownData, OscFit::kUnknownFlavour, OscFit::kUnknownSystematic, OpenFile(), and WriteToFile().

Referenced by WriteHistograms().

00391 {
00392   if( temp==0 ) return;
00393 
00394   std::cout << " *** TemplateIO::WriteOutput(...) *** " << std::endl;
00395   std::cout << "  Writing to file: " << filename << std::endl;
00396 
00397   Bool_t saveFlag = fUseShortLabelling;
00398   fUseShortLabelling = 1;
00399 
00400   OpenFile(filename);
00401 
00402   fSource      = kUnknownData;
00403   fSample      = kUnknown;
00404   fTrueFlavour = kUnknownFlavour;
00405   fTrueCharge  = kUnknownCharge;
00406   fSystematic  = kUnknownSystematic;
00407   fShift       = kNoShift;
00408 
00409   WriteToFile( temp, fLabel.Data() );
00410 
00411   CloseFile();
00412 
00413   std::cout << "  Done! " << std::endl;
00414 
00415   fUseShortLabelling = saveFlag;
00416 
00417   return;
00418 }

void OscFit::TemplateIO::WritePQ ( Bool_t  yesno = 1  )  [inline]

Definition at line 47 of file TemplateIO.h.

References fWritePQ.

00047 { fWritePQ = yesno; }

void OscFit::TemplateIO::WriteTemplates ( const char *  filename  )  [inline]

Definition at line 35 of file TemplateIO.h.

References Write().

00035 { Write( filename ); }

void TemplateIO::WriteToFile ( Histogram hist,
const char *  label,
Run_t  run,
Containment_t  containment,
Flavour_t  flavour,
Charge_t  charge,
Resolution_t  resolution,
Topology_t  topology,
ProtonTag_t  proton,
ElectronTag_t  electron 
) [private]

Definition at line 474 of file TemplateIO.cxx.

References fContainment, fElectron, fProton, fRecoCharge, fRecoFlavour, fResolution, fRun, fTopology, fUseShortLabelling, GetLabelForReco(), GetShortLabelForReco(), and WriteToFile().

00475 {
00476   if( hist==0 ) return;
00477 
00478   fRun         = static_cast<Int_t>(run);
00479   fContainment = static_cast<Int_t>(containment);
00480   fRecoFlavour = static_cast<Int_t>(flavour);
00481   fRecoCharge  = static_cast<Int_t>(charge);
00482   fResolution  = static_cast<Int_t>(resolution);
00483   fTopology    = static_cast<Int_t>(topology);
00484   fProton      = static_cast<Int_t>(proton);
00485   fElectron    = static_cast<Int_t>(electron);
00486    
00487   TString newLabel = label;
00488   newLabel.Append("_");
00489 
00490   if( fUseShortLabelling ){
00491     newLabel.Append( GetShortLabelForReco( run, containment, flavour, charge, 
00492                                            resolution, topology, proton, electron ) );
00493   }
00494   else{
00495     newLabel.Append( GetLabelForReco( run, containment, flavour, charge, 
00496                                       resolution, topology, proton, electron ) );
00497   }
00498 
00499   return WriteToFile( hist, newLabel.Data() );
00500 }

void TemplateIO::WriteToFile ( Histogram hist,
const char *  label 
) [private]

Definition at line 502 of file TemplateIO.cxx.

References fDimensions, fFileHandle, fTreeHandle, fUseShortLabelling, OscFit::Histogram::GetTotalContent(), OscFit::Histogram::MakeTH1D(), and OscFit::Histogram::MakeTH2D().

00503 {
00504   if( hist==0 ) return;
00505 
00506   std::cout << "    Writing: " << label; 
00507   if( fUseShortLabelling ) std::cout << " (Total=" << hist->GetTotalContent() << ") ";
00508   std::cout << std::endl;
00509 
00510   TH1D* h1 = hist->MakeTH1D( label );
00511   if( h1 ){
00512     fDimensions = 1;
00513     fFileHandle->cd();
00514     fTreeHandle->Fill();
00515     h1->SetDirectory( fFileHandle );
00516     h1->Write(); 
00517     return;
00518   }
00519 
00520   TH2D* h2 = hist->MakeTH2D( label );
00521   if( h2 ){
00522     fDimensions = 2;
00523     fFileHandle->cd();
00524     fTreeHandle->Fill();
00525     h2->SetDirectory( fFileHandle );
00526     h2->Write(); 
00527     return;
00528   }
00529 
00530   return;
00531 }

void TemplateIO::WriteToFile ( Template temp,
const char *  label,
Source_t  source,
Sample_t  sample,
Flavour_t  flavour,
Charge_t  charge,
Systematic_t  systematic,
Shift_t  shift 
) [private]

Definition at line 420 of file TemplateIO.cxx.

References fSample, fShift, fSource, fSystematic, fTrueCharge, fTrueFlavour, GetLabelForTruth(), and WriteToFile().

00421 {
00422   if( temp==0 ) return;
00423 
00424   fSource      = static_cast<Int_t>(source);
00425   fSample      = static_cast<Int_t>(sample);
00426   fTrueFlavour = static_cast<Int_t>(flavour);
00427   fTrueCharge  = static_cast<Int_t>(charge);
00428   fSystematic  = static_cast<Int_t>(systematic);
00429   fShift       = static_cast<Int_t>(shift);
00430 
00431   TString newLabel = label;
00432   newLabel.Append("_");
00433   newLabel.Append( GetLabelForTruth( source, sample, flavour, charge, systematic, shift ) );
00434 
00435   return WriteToFile( temp, newLabel.Data() );
00436 }

void TemplateIO::WriteToFile ( Template temp,
const char *  label 
) [private]

Definition at line 438 of file TemplateIO.cxx.

References fWriteNQ, fWriteNue, fWriteNumu, fWritePQ, OscFit::Template::GetHistogramAtIndex(), OscFit::Template::GetNumHistograms(), OscFit::Template::GetOrderedIndex(), OscFit::Template::InvertID(), OscFit::kNegative, OscFit::kNothing, OscFit::kNue, OscFit::kNull, OscFit::kNumu, OscFit::kPositive, OscFit::kUnknownCharge, OscFit::kUnknownElectronTag, OscFit::kUnknownFlavour, OscFit::kUnknownProtonTag, OscFit::kUnknownRes, OscFit::kUnknownRun, n, and run().

Referenced by WriteAtmosData(), WriteBeamData(), WriteData(), WriteMC(), WriteOutput(), and WriteToFile().

00439 {
00440   if( temp==0 ) return;
00441 
00442   for( UInt_t n=0; n<temp->GetNumHistograms(); n++ ){
00443 
00444     Int_t index = temp->GetOrderedIndex(n);
00445     Histogram* hist = temp->GetHistogramAtIndex(index);
00446 
00447     Run_t         run         = kUnknownRun;
00448     Containment_t containment = kNull;
00449     Flavour_t     flavour     = kUnknownFlavour;
00450     Charge_t      charge      = kUnknownCharge;
00451     Resolution_t  resolution  = kUnknownRes;
00452     Topology_t    topology    = kNothing;
00453     ProtonTag_t   proton      = kUnknownProtonTag;
00454     ElectronTag_t electron    = kUnknownElectronTag;
00455 
00456     Template::InvertID( index,
00457                         run, containment, flavour, charge, 
00458                         resolution, topology, proton, electron );
00459 
00460     if( flavour==kNue     && fWriteNue==0  ) continue;
00461     if( flavour==kNumu    && fWriteNumu==0 ) continue;
00462 
00463     if( charge==kNegative && fWriteNQ==0   ) continue;
00464     if( charge==kPositive && fWritePQ==0   ) continue;
00465 
00466     WriteToFile( hist, label, 
00467                  run, containment, flavour, charge, 
00468                  resolution, topology, proton, electron );
00469   }
00470 
00471   return;
00472 }


Member Data Documentation

Definition at line 107 of file TemplateIO.h.

Referenced by OpenFile(), ReadFromFile(), and WriteToFile().

Definition at line 114 of file TemplateIO.h.

Referenced by OpenFile(), ReadFromFile(), and WriteToFile().

TDirectory* OscFit::TemplateIO::fDirHandle [private]

Definition at line 95 of file TemplateIO.h.

Referenced by CloseFile(), and OpenFile().

Definition at line 113 of file TemplateIO.h.

Referenced by OpenFile(), ReadFromFile(), and WriteToFile().

Definition at line 96 of file TemplateIO.h.

Referenced by CloseFile(), OpenFile(), TemplateIO(), and WriteToFile().

TString OscFit::TemplateIO::fLabel [private]
Int_t OscFit::TemplateIO::fProton [private]

Definition at line 112 of file TemplateIO.h.

Referenced by OpenFile(), ReadFromFile(), and WriteToFile().

Definition at line 109 of file TemplateIO.h.

Referenced by OpenFile(), ReadFromFile(), and WriteToFile().

Definition at line 108 of file TemplateIO.h.

Referenced by OpenFile(), ReadFromFile(), and WriteToFile().

Definition at line 110 of file TemplateIO.h.

Referenced by OpenFile(), ReadFromFile(), and WriteToFile().

Int_t OscFit::TemplateIO::fRun [private]

Definition at line 106 of file TemplateIO.h.

Referenced by OpenFile(), ReadFromFile(), and WriteToFile().

Int_t OscFit::TemplateIO::fSample [private]

Definition at line 100 of file TemplateIO.h.

Referenced by OpenFile(), ReadFromFile(), WriteOutput(), and WriteToFile().

Int_t OscFit::TemplateIO::fShift [private]

Definition at line 104 of file TemplateIO.h.

Referenced by OpenFile(), ReadFromFile(), WriteOutput(), and WriteToFile().

Int_t OscFit::TemplateIO::fSource [private]

Definition at line 99 of file TemplateIO.h.

Referenced by OpenFile(), ReadFromFile(), WriteOutput(), and WriteToFile().

Definition at line 103 of file TemplateIO.h.

Referenced by OpenFile(), ReadFromFile(), WriteOutput(), and WriteToFile().

Definition at line 111 of file TemplateIO.h.

Referenced by OpenFile(), ReadFromFile(), and WriteToFile().

Definition at line 97 of file TemplateIO.h.

Referenced by CloseFile(), OpenFile(), TemplateIO(), and WriteToFile().

Definition at line 102 of file TemplateIO.h.

Referenced by OpenFile(), ReadFromFile(), WriteOutput(), and WriteToFile().

Definition at line 101 of file TemplateIO.h.

Referenced by OpenFile(), ReadFromFile(), WriteOutput(), and WriteToFile().

Definition at line 124 of file TemplateIO.h.

Referenced by TemplateIO(), WriteOutput(), and WriteToFile().

Bool_t OscFit::TemplateIO::fWriteNQ [private]

Definition at line 118 of file TemplateIO.h.

Referenced by TemplateIO(), WriteNQ(), and WriteToFile().

Definition at line 121 of file TemplateIO.h.

Referenced by TemplateIO(), WriteNue(), and WriteToFile().

Definition at line 122 of file TemplateIO.h.

Referenced by TemplateIO(), WriteNumu(), and WriteToFile().

Bool_t OscFit::TemplateIO::fWritePQ [private]

Definition at line 119 of file TemplateIO.h.

Referenced by TemplateIO(), WritePQ(), and WriteToFile().


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

Generated on 15 Jul 2018 for loon by  doxygen 1.6.1