AtNuEventSelector Class Reference

#include <AtNuEventSelector.h>

List of all members.

Public Member Functions

 AtNuEventSelector ()
virtual ~AtNuEventSelector ()
void Initialize ()
void AddFile (const char *file)
void AddList (const char *file)
void SelectGoodSlice (Bool_t select=1)
void SelectGoodEvent (Bool_t select=1)
void SelectGoodTrack (Bool_t select=1)
void SelectGoodShower (Bool_t select=1)
void SelectCV (Bool_t select=1)
void SelectCE (Bool_t select=1)
void SelectFC (Bool_t select=1)
void SelectPC (Bool_t select=1)
void SelectCVUP (Bool_t select=1)
void SelectUPMU (Bool_t select=1)
void SelectCosmic (Bool_t select=1)
void SelectGoodCosmic (Bool_t select=1)
void SelectStoppingMuon (Bool_t select=1)
void SelectThroughGoingMuon (Bool_t select=1)
void SelectMultipleMuon (Bool_t select=1)
void SelectSpill (Bool_t select=1)
void SelectFakeSpill (Bool_t select=1)
void SelectBeamSpill (Bool_t select=1)
void SelectAtmosNumu (Bool_t select=1)
void SelectAtmosNue (Bool_t select=1)
void PassGoodSlice (Bool_t pass=1)
void PassGoodEvent (Bool_t pass=1)
void PassGoodTrack (Bool_t pass=1)
void PassGoodShower (Bool_t pass=1)
void PassCV (Bool_t pass=1)
void PassCE (Bool_t pass=1)
void PassFC (Bool_t pass=1)
void PassPC (Bool_t pass=1)
void PassCVUP (Bool_t pass=1)
void PassUPMU (Bool_t pass=1)
void PassCosmic (Bool_t pass=1)
void PassGoodCosmic (Bool_t pass=1)
void PassStoppingMuon (Bool_t pass=1)
void PassThroughGoingMuon (Bool_t pass=1)
void PassMultipleMuon (Bool_t pass=1)
void PassSpill (Bool_t pass=1)
void PassBeamSpill (Bool_t pass=1)
void PassFakeSpill (Bool_t pass=1)
void FailGoodSlice (Bool_t fail=1)
void FailGoodEvent (Bool_t fail=1)
void FailGoodTrack (Bool_t fail=1)
void FailGoodShower (Bool_t fail=1)
void FailCV (Bool_t fail=1)
void FailCE (Bool_t fail=1)
void FailFC (Bool_t fail=1)
void FailPC (Bool_t fail=1)
void FailCVUP (Bool_t fail=1)
void FailUPMU (Bool_t fail=1)
void FailCosmic (Bool_t fail=1)
void FailGoodCosmic (Bool_t fail=1)
void FailStoppingMuon (Bool_t fail=1)
void FailThroughGoingMuon (Bool_t fail=1)
void FailMultipleMuon (Bool_t fail=1)
void FailSpill (Bool_t fail=1)
void FailBeamSpill (Bool_t fail=1)
void FailFakeSpill (Bool_t fail=1)
void PreSelectAtmosNumu (Bool_t select=1)
void PreSelectAtmosNue (Bool_t select=1)
void WriteEvents (Bool_t write=1)
void SetEventFile (const char *filename)
void SetEventFileMaxSize (Double_t maxsize_mb)
void WriteSummaries (Bool_t write=1)
void SetSummaryFile (const char *filename)
void SetSummaryFileMaxSize (Double_t maxsize_mb)
void WriteTracks (Bool_t write=1)
void WriteShowers (Bool_t write=1)
void WriteTracksLimit (Int_t limit=1)
void WriteShowersLimit (Int_t limit=1)
void Run (Int_t entries=-1)

Private Member Functions

void RunEventSelection (Int_t entries=-1)
void RunEventSelectionEnd ()
void StartEventSelection ()
Bool_t PassFail (Int_t eventtype, Int_t atmoseventtype)
void OpenFile (TString filename)
void WriteToFile ()
void CloseFile ()
void WriteOutEvent ()
void WriteOutSummary (AtmosEvent *event, Int_t eventtype, Int_t atmoseventtype, Double_t shieldtime, Double_t spilltime, Int_t ptrackid, Int_t pshowerid)

Private Attributes

TFile * fNewFile
TTree * fNewTree
TString fNewFileName
TString fSummaryFileName
Double_t fEventFileMaxSizeBytes
Double_t fEventFileMaxSizeMegaBytes
Double_t fSummaryFileMaxSizeBytes
Double_t fSummaryFileMaxSizeMegaBytes
Int_t fFileNumber
AtNuEventSelectionFactoryfSelectionFactory
AtNuEventSelectionfSelection
AtNuEventNtuplefNtuple
Bool_t fWriteTracks
Bool_t fWriteShowers
Int_t fWriteTracksLimit
Int_t fWriteShowersLimit
Bool_t fSelectionOnOff
Bool_t fSelectEventType
Bool_t fSelectGoodSlice
Bool_t fSelectGoodEvent
Bool_t fSelectGoodTrack
Bool_t fSelectGoodShower
Bool_t fSelectCV
Bool_t fSelectCE
Bool_t fSelectFC
Bool_t fSelectPC
Bool_t fSelectCVUP
Bool_t fSelectUPMU
Bool_t fSelectCosmic
Bool_t fSelectGoodCosmic
Bool_t fSelectStoppingMuon
Bool_t fSelectThroughGoingMuon
Bool_t fSelectMultipleMuon
Bool_t fSelectSpill
Bool_t fSelectBeamSpill
Bool_t fSelectFakeSpill
Bool_t fSelectAtmosNumu
Bool_t fSelectAtmosNue
Bool_t fPassGoodSlice
Bool_t fPassGoodEvent
Bool_t fPassGoodTrack
Bool_t fPassGoodShower
Bool_t fPassCV
Bool_t fPassCE
Bool_t fPassFC
Bool_t fPassPC
Bool_t fPassCVUP
Bool_t fPassUPMU
Bool_t fPassCosmic
Bool_t fPassGoodCosmic
Bool_t fPassStoppingMuon
Bool_t fPassThroughGoingMuon
Bool_t fPassMultipleMuon
Bool_t fPassSpill
Bool_t fPassBeamSpill
Bool_t fPassFakeSpill
Bool_t fFailGoodSlice
Bool_t fFailGoodEvent
Bool_t fFailGoodTrack
Bool_t fFailGoodShower
Bool_t fFailCV
Bool_t fFailCE
Bool_t fFailFC
Bool_t fFailPC
Bool_t fFailCVUP
Bool_t fFailUPMU
Bool_t fFailCosmic
Bool_t fFailGoodCosmic
Bool_t fFailStoppingMuon
Bool_t fFailThroughGoingMuon
Bool_t fFailMultipleMuon
Bool_t fFailSpill
Bool_t fFailBeamSpill
Bool_t fFailFakeSpill
Bool_t fPreSelectAtmosNumu
Bool_t fPreSelectAtmosNue
Bool_t fWriteEvents
Bool_t fWriteSummaries
TChain * fChain
Int_t fLast
Int_t fRun
Int_t fEventList
Int_t fEventListCounter
Int_t fEventListLast
vector< Int_t > fRunList
vector< Int_t > fSnarlList
AtmosEventfEvent

Detailed Description

Definition at line 25 of file AtNuEventSelector.h.


Constructor & Destructor Documentation

AtNuEventSelector::AtNuEventSelector (  ) 

Definition at line 16 of file AtNuEventSelector.cxx.

References Initialize().

00016                                      :
00017   fNewFile(0),
00018   fNewTree(0),
00019   fNewFileName("ntp.reduce.root"),
00020   fSummaryFileName("ntp.summary.root"),
00021   fEventFileMaxSizeBytes(0),
00022   fEventFileMaxSizeMegaBytes(0),
00023   fSummaryFileMaxSizeBytes(0),
00024   fSummaryFileMaxSizeMegaBytes(0),
00025   fFileNumber(0),
00026   fSelectionFactory(0),
00027   fSelection(0),
00028   fNtuple(0),   
00029   fWriteTracks(0),
00030   fWriteShowers(0),
00031   fWriteTracksLimit(-1),
00032   fWriteShowersLimit(-1),
00033   fSelectionOnOff(0),
00034   fSelectEventType(0),
00035   fSelectGoodSlice(0), 
00036   fSelectGoodEvent(0),
00037   fSelectGoodTrack(0),
00038   fSelectGoodShower(0),
00039   fSelectCV(0),
00040   fSelectCE(0),
00041   fSelectFC(0),
00042   fSelectPC(0),
00043   fSelectCVUP(0),
00044   fSelectUPMU(0),
00045   fSelectCosmic(0),
00046   fSelectGoodCosmic(0),
00047   fSelectStoppingMuon(0),
00048   fSelectThroughGoingMuon(0),
00049   fSelectMultipleMuon(0),
00050   fSelectSpill(0),
00051   fSelectBeamSpill(0),
00052   fSelectFakeSpill(0),
00053   fSelectAtmosNumu(0),
00054   fSelectAtmosNue(0),
00055   fPassGoodSlice(0),
00056   fPassGoodEvent(0),
00057   fPassGoodTrack(0),
00058   fPassGoodShower(0),
00059   fPassCV(0),
00060   fPassCE(0),
00061   fPassFC(0),
00062   fPassPC(0),
00063   fPassCVUP(0),
00064   fPassUPMU(0),
00065   fPassCosmic(0),
00066   fPassGoodCosmic(0),
00067   fPassStoppingMuon(0),
00068   fPassThroughGoingMuon(0),
00069   fPassMultipleMuon(0),
00070   fPassSpill(0),
00071   fPassBeamSpill(0),
00072   fPassFakeSpill(0),
00073   fFailGoodSlice(0),
00074   fFailGoodEvent(0),
00075   fFailGoodTrack(0),
00076   fFailGoodShower(0),
00077   fFailCV(0),
00078   fFailCE(0),
00079   fFailFC(0),
00080   fFailPC(0),
00081   fFailCVUP(0),
00082   fFailUPMU(0),
00083   fFailCosmic(0),
00084   fFailGoodCosmic(0),
00085   fFailStoppingMuon(0),
00086   fFailThroughGoingMuon(0),
00087   fFailMultipleMuon(0),
00088   fFailSpill(0),
00089   fFailBeamSpill(0),
00090   fFailFakeSpill(0), 
00091   fPreSelectAtmosNumu(0),
00092   fPreSelectAtmosNue(0),
00093   fWriteEvents(0),
00094   fWriteSummaries(0),
00095   fChain(0),
00096   fLast(-1),
00097   fRun(-1),
00098   fEventList(0),
00099   fEventListCounter(0),
00100   fEventListLast(0),
00101   fEvent(0)
00102 {
00103   this->Initialize();
00104 }

AtNuEventSelector::~AtNuEventSelector (  )  [virtual]

Definition at line 106 of file AtNuEventSelector.cxx.

References fNtuple, fSelection, and fSelectionFactory.

00107 {
00108   if(fSelectionFactory) delete fSelectionFactory;
00109   if(fSelection) delete fSelection;
00110   if(fNtuple) delete fNtuple;
00111 }


Member Function Documentation

void AtNuEventSelector::AddFile ( const char *  file  ) 

Definition at line 140 of file AtNuEventSelector.cxx.

References fChain, and fLast.

00141 {
00142   std::cout << " adding files from: " << file << std::endl;
00143  
00144   fChain->Add(file);
00145   fLast=fChain->GetEntries();
00146    
00147   std::cout << "   ... total entries=" << fLast << std::endl;
00148 
00149   return;
00150 }

void AtNuEventSelector::AddList ( const char *  file  ) 

Definition at line 152 of file AtNuEventSelector.cxx.

References fEventList, fEventListLast, fRunList, fSnarlList, and run().

00153 {
00154   Int_t run=-1,snarl=-1;
00155 
00156   std::cout << " reading in events from: " << file << std::endl;
00157 
00158   std::ifstream input(file);
00159   if(input){
00160     while( !input.eof() ){
00161       run=-1; snarl=-1;
00162       input >> run >> snarl;
00163       if( run>=0 && snarl>=0 ){
00164         std::cout << "  (" << fEventListLast << ") run/snarl = " << run << "/" << snarl << std::endl;
00165         fRunList.push_back(run);
00166         fSnarlList.push_back(snarl);
00167         fEventListLast++;
00168         fEventList=1;
00169       }
00170     }
00171   }
00172   input.close();
00173 
00174   return;
00175 }

void AtNuEventSelector::CloseFile (  )  [private]

Definition at line 1017 of file AtNuEventSelector.cxx.

References fNewFile, and fNewTree.

Referenced by RunEventSelectionEnd(), and WriteOutEvent().

01018 {
01019   if( fNewFile ){
01020     std::cout << " closing file: " << fNewFile->GetName() << std::endl;
01021     TDirectory* tmpd = gDirectory;
01022     fNewFile->cd();
01023     fNewTree->Write();
01024     fNewFile->Close();
01025     gDirectory = tmpd;
01026   }
01027 }

void AtNuEventSelector::FailBeamSpill ( Bool_t  fail = 1  ) 

Definition at line 647 of file AtNuEventSelector.cxx.

References fFailBeamSpill, and fSelectionOnOff.

00648 {
00649   if( fail ){
00650     fSelectionOnOff = 1;
00651     fFailBeamSpill = fail;
00652   }
00653 }

void AtNuEventSelector::FailCE ( Bool_t  fail = 1  ) 

Definition at line 559 of file AtNuEventSelector.cxx.

References fFailCE, and fSelectionOnOff.

00560 {
00561   if( fail ){
00562     fSelectionOnOff = 1;
00563     fFailCE = fail;
00564   }
00565 }

void AtNuEventSelector::FailCosmic ( Bool_t  fail = 1  ) 

Definition at line 599 of file AtNuEventSelector.cxx.

References fFailCosmic, and fSelectionOnOff.

00600 {
00601   if(fail){
00602     fSelectionOnOff = 1;
00603     fFailCosmic = fail;
00604   }
00605 }

void AtNuEventSelector::FailCV ( Bool_t  fail = 1  ) 

Definition at line 551 of file AtNuEventSelector.cxx.

References fFailCV, and fSelectionOnOff.

00552 {
00553   if( fail ){
00554     fSelectionOnOff = 1;
00555     fFailCV = fail;
00556   }
00557 }

void AtNuEventSelector::FailCVUP ( Bool_t  fail = 1  ) 

Definition at line 583 of file AtNuEventSelector.cxx.

References fFailCVUP, and fSelectionOnOff.

00584 {
00585   if( fail ){
00586     fSelectionOnOff = 1;
00587     fFailCVUP = fail;
00588   }
00589 }

void AtNuEventSelector::FailFakeSpill ( Bool_t  fail = 1  ) 

Definition at line 655 of file AtNuEventSelector.cxx.

References fFailFakeSpill, and fSelectionOnOff.

00656 {
00657   if( fail ){
00658     fSelectionOnOff = 1;
00659     fFailFakeSpill = fail;
00660   }
00661 }

void AtNuEventSelector::FailFC ( Bool_t  fail = 1  ) 

Definition at line 567 of file AtNuEventSelector.cxx.

References fFailFC, and fSelectionOnOff.

00568 {
00569   if( fail ){
00570     fSelectionOnOff = 1;
00571     fFailFC = fail;
00572   }
00573 }

void AtNuEventSelector::FailGoodCosmic ( Bool_t  fail = 1  ) 

Definition at line 607 of file AtNuEventSelector.cxx.

References fFailGoodCosmic, and fSelectionOnOff.

00608 {
00609   if(fail){
00610     fSelectionOnOff = 1;
00611     fFailGoodCosmic = fail;
00612   }
00613 }

void AtNuEventSelector::FailGoodEvent ( Bool_t  fail = 1  ) 

Definition at line 527 of file AtNuEventSelector.cxx.

References fFailGoodEvent, and fSelectionOnOff.

00528 {
00529   if( fail ){
00530     fSelectionOnOff = 1;
00531     fFailGoodEvent = fail;
00532   }
00533 }

void AtNuEventSelector::FailGoodShower ( Bool_t  fail = 1  ) 

Definition at line 543 of file AtNuEventSelector.cxx.

References fFailGoodShower, and fSelectionOnOff.

00544 {
00545   if( fail ){
00546     fSelectionOnOff = 1;
00547     fFailGoodShower = fail;
00548   }
00549 }

void AtNuEventSelector::FailGoodSlice ( Bool_t  fail = 1  ) 

Definition at line 519 of file AtNuEventSelector.cxx.

References fFailGoodSlice, and fSelectionOnOff.

00520 {
00521   if( fail ){
00522     fSelectionOnOff = 1;
00523     fFailGoodSlice = fail;
00524   }
00525 }

void AtNuEventSelector::FailGoodTrack ( Bool_t  fail = 1  ) 

Definition at line 535 of file AtNuEventSelector.cxx.

References fFailGoodTrack, and fSelectionOnOff.

00536 {
00537   if( fail ){
00538     fSelectionOnOff = 1;
00539     fFailGoodTrack = fail;
00540   }
00541 }

void AtNuEventSelector::FailMultipleMuon ( Bool_t  fail = 1  ) 

Definition at line 631 of file AtNuEventSelector.cxx.

References fFailMultipleMuon, and fSelectionOnOff.

00632 {
00633   if( fail ){
00634     fSelectionOnOff = 1;
00635     fFailMultipleMuon = fail;
00636   }
00637 }

void AtNuEventSelector::FailPC ( Bool_t  fail = 1  ) 

Definition at line 575 of file AtNuEventSelector.cxx.

References fFailPC, and fSelectionOnOff.

00576 {
00577   if( fail ){
00578     fSelectionOnOff = 1;
00579     fFailPC = fail;
00580   }
00581 }

void AtNuEventSelector::FailSpill ( Bool_t  fail = 1  ) 

Definition at line 639 of file AtNuEventSelector.cxx.

References fFailSpill, and fSelectionOnOff.

00640 {
00641   if( fail ){
00642     fSelectionOnOff = 1;
00643     fFailSpill = fail;
00644   }
00645 }

void AtNuEventSelector::FailStoppingMuon ( Bool_t  fail = 1  ) 

Definition at line 615 of file AtNuEventSelector.cxx.

References fFailStoppingMuon, and fSelectionOnOff.

00616 {
00617   if( fail ){
00618     fSelectionOnOff = 1;
00619     fFailStoppingMuon = fail;
00620   }
00621 }

void AtNuEventSelector::FailThroughGoingMuon ( Bool_t  fail = 1  ) 

Definition at line 623 of file AtNuEventSelector.cxx.

References fFailThroughGoingMuon, and fSelectionOnOff.

00624 {
00625   if( fail ){
00626     fSelectionOnOff = 1;
00627     fFailThroughGoingMuon = fail;
00628   }
00629 }

void AtNuEventSelector::FailUPMU ( Bool_t  fail = 1  ) 

Definition at line 591 of file AtNuEventSelector.cxx.

References fFailUPMU, and fSelectionOnOff.

00592 {
00593   if( fail ){
00594     fSelectionOnOff = 1;
00595     fFailUPMU = fail;
00596   }
00597 }

void AtNuEventSelector::Initialize (  ) 

Definition at line 113 of file AtNuEventSelector.cxx.

References fChain, fEvent, fSelectionFactory, and AtNuSettings::PrintSettings().

00114 {
00115   // print settings
00116   AtNuSettings::PrintSettings();
00117 
00118   std::cout << " *** AtNuEventSelector::Initialize() *** " << std::endl;
00119   std::cout << "  initializing... " << std::endl;
00120 
00121   // creating event selection factory
00122   std::cout << "  creating selection factory..." << std::endl;
00123   if( !fSelectionFactory ){
00124     fSelectionFactory = new AtNuEventSelectionFactory();
00125     if( fSelectionFactory ) std::cout << "   ...done" << std::endl; 
00126   }
00127 
00128   // create chain of ntuples
00129   // (how to do this from command line???)
00130   std::cout << "  creating ntuple chain..." << std::endl;
00131   if( !fChain ){
00132     fChain = new TChain("ntp","chain");
00133     fChain->SetBranchAddress("evt",&fEvent);
00134     if( fChain ) std::cout << "   ...done" << std::endl; 
00135   }
00136 
00137   return;
00138 }

void AtNuEventSelector::OpenFile ( TString  filename  )  [private]

Definition at line 991 of file AtNuEventSelector.cxx.

References fEvent, fNewFile, and fNewTree.

Referenced by WriteOutEvent().

00992 {
00993   std::cout << " opening file: " << filename.Data() << std::endl;
00994   TDirectory* tmpd = gDirectory;
00995   fNewFile = new TFile(filename.Data(),"recreate");
00996   fNewTree = new TTree("ntp","atmos event ntuple");
00997   fNewTree->SetDirectory(fNewFile);
00998   fNewTree->Branch("evt","AtmosEvent",&fEvent);
00999   fNewTree->SetAutoSave(100);
01000   gDirectory = tmpd;
01001 
01002   return;
01003 }

void AtNuEventSelector::PassBeamSpill ( Bool_t  pass = 1  ) 

Definition at line 503 of file AtNuEventSelector.cxx.

References fPassBeamSpill, and fSelectionOnOff.

00504 {
00505   if( pass ){
00506     fSelectionOnOff = 1;
00507     fPassBeamSpill = pass;
00508   }
00509 }

void AtNuEventSelector::PassCE ( Bool_t  pass = 1  ) 

Definition at line 415 of file AtNuEventSelector.cxx.

References fPassCE, and fSelectionOnOff.

00416 {
00417   if( pass ){
00418     fSelectionOnOff = 1;
00419     fPassCE = pass;
00420   }
00421 }

void AtNuEventSelector::PassCosmic ( Bool_t  pass = 1  ) 

Definition at line 455 of file AtNuEventSelector.cxx.

References fPassCosmic, and fSelectionOnOff.

00456 {
00457   if(pass){
00458     fSelectionOnOff = 1;
00459     fPassCosmic = pass;
00460   }
00461 }

void AtNuEventSelector::PassCV ( Bool_t  pass = 1  ) 

Definition at line 407 of file AtNuEventSelector.cxx.

References fPassCV, and fSelectionOnOff.

00408 {
00409   if( pass ){
00410     fSelectionOnOff = 1;
00411     fPassCV = pass;
00412   }
00413 }

void AtNuEventSelector::PassCVUP ( Bool_t  pass = 1  ) 

Definition at line 439 of file AtNuEventSelector.cxx.

References fPassCVUP, and fSelectionOnOff.

00440 {
00441   if( pass ){
00442     fSelectionOnOff = 1;
00443     fPassCVUP = pass;
00444   }
00445 }

Bool_t AtNuEventSelector::PassFail ( Int_t  eventtype,
Int_t  atmoseventtype 
) [private]

Definition at line 844 of file AtNuEventSelector.cxx.

References fFailBeamSpill, fFailCE, fFailCosmic, fFailCV, fFailCVUP, fFailFakeSpill, fFailFC, fFailGoodCosmic, fFailGoodEvent, fFailGoodShower, fFailGoodSlice, fFailGoodTrack, fFailMultipleMuon, fFailPC, fFailSpill, fFailStoppingMuon, fFailThroughGoingMuon, fFailUPMU, fPassBeamSpill, fPassCE, fPassCosmic, fPassCV, fPassCVUP, fPassFakeSpill, fPassFC, fPassGoodCosmic, fPassGoodEvent, fPassGoodShower, fPassGoodSlice, fPassGoodTrack, fPassMultipleMuon, fPassPC, fPassSpill, fPassStoppingMuon, fPassThroughGoingMuon, fPassUPMU, fPreSelectAtmosNue, fPreSelectAtmosNumu, fSelectAtmosNue, fSelectAtmosNumu, fSelectBeamSpill, fSelectCE, fSelectCosmic, fSelectCV, fSelectCVUP, fSelectEventType, fSelectFakeSpill, fSelectFC, fSelectGoodCosmic, fSelectGoodEvent, fSelectGoodShower, fSelectGoodSlice, fSelectGoodTrack, fSelectMultipleMuon, fSelectPC, fSelectSpill, fSelectStoppingMuon, fSelectThroughGoingMuon, fSelectUPMU, AtNuAtmosEventType::kAtmosNue, AtNuAtmosEventType::kAtmosNueCVcut1, AtNuAtmosEventType::kAtmosNumu, AtNuAtmosEventType::kAtmosNumuCVcut1, AtNuAtmosEventType::kAtmosNumuUPcut1, AtNuEventType::kBeamSpill, AtNuEventType::kCE, AtNuEventType::kCosmic, AtNuEventType::kCV, AtNuEventType::kCVUP, AtNuEventType::kFakeSpill, AtNuEventType::kFC, AtNuEventType::kGoodCosmic, AtNuEventType::kGoodEvent, AtNuEventType::kGoodShower, AtNuEventType::kGoodSlice, AtNuEventType::kGoodTrack, AtNuEventType::kMultipleMuon, AtNuEventType::kPC, AtNuEventType::kSpill, AtNuEventType::kStoppingMuon, AtNuEventType::kThroughGoingMuon, AtNuEventType::kUPMU, and passfail().

Referenced by RunEventSelection().

00845 {
00846  
00847   Bool_t passfail = 0;
00848 
00849   // pass event types (AND)
00850   // ======================
00851   if( ( !fPassGoodSlice 
00852     || (eventtype&AtNuEventType::kGoodSlice)==(AtNuEventType::kGoodSlice) )
00853    && ( !fPassGoodEvent 
00854     || (eventtype&AtNuEventType::kGoodEvent)==(AtNuEventType::kGoodEvent) )
00855    && ( !fPassGoodTrack 
00856     || (eventtype&AtNuEventType::kGoodTrack)==(AtNuEventType::kGoodTrack) ) 
00857    && ( !fPassGoodShower 
00858     || (eventtype&AtNuEventType::kGoodShower)==(AtNuEventType::kGoodShower) )
00859    && ( !fPassCV
00860     || (eventtype&AtNuEventType::kCV)==(AtNuEventType::kCV) )
00861    && ( !fPassCE
00862     || (eventtype&AtNuEventType::kCE)==(AtNuEventType::kCE) )
00863    && ( !fPassFC
00864     || (eventtype&AtNuEventType::kFC)==(AtNuEventType::kFC) )
00865    && ( !fPassPC
00866     || (eventtype&AtNuEventType::kPC)==(AtNuEventType::kPC) )
00867    && ( !fPassCVUP
00868     || (eventtype&AtNuEventType::kCVUP)==(AtNuEventType::kCVUP) )
00869    && ( !fPassUPMU
00870     || (eventtype&AtNuEventType::kUPMU)==(AtNuEventType::kUPMU) )
00871    && ( !fPassCosmic
00872     || (eventtype&AtNuEventType::kCosmic)==(AtNuEventType::kCosmic) ) 
00873    && ( !fPassGoodCosmic
00874     || (eventtype&AtNuEventType::kGoodCosmic)==(AtNuEventType::kGoodCosmic) ) 
00875    && ( !fPassStoppingMuon
00876     || (eventtype&AtNuEventType::kStoppingMuon)==(AtNuEventType::kStoppingMuon) )
00877    && ( !fPassThroughGoingMuon 
00878     || (eventtype&AtNuEventType::kThroughGoingMuon)==(AtNuEventType::kThroughGoingMuon) ) 
00879    && ( !fPassMultipleMuon 
00880     || (eventtype&AtNuEventType::kMultipleMuon)==(AtNuEventType::kMultipleMuon) )  
00881    && ( !fPassSpill
00882     || (eventtype&AtNuEventType::kSpill)==(AtNuEventType::kSpill) )
00883    && ( !fPassBeamSpill
00884     || (eventtype&AtNuEventType::kBeamSpill)==(AtNuEventType::kBeamSpill) )
00885    && ( !fPassFakeSpill
00886     || (eventtype&AtNuEventType::kFakeSpill)==(AtNuEventType::kFakeSpill) ) ){
00887     passfail = 1; 
00888   }
00889 
00890   // fail event types (overrides pass)
00891   // =================================
00892   if( ( fFailGoodSlice 
00893     && (eventtype&AtNuEventType::kGoodSlice)==(AtNuEventType::kGoodSlice) )
00894    || ( fFailGoodEvent 
00895     && (eventtype&AtNuEventType::kGoodEvent)==(AtNuEventType::kGoodEvent) )
00896    || ( fFailGoodTrack 
00897     && (eventtype&AtNuEventType::kGoodTrack)==(AtNuEventType::kGoodTrack) ) 
00898    || ( fFailGoodShower 
00899     && (eventtype&AtNuEventType::kGoodShower)==(AtNuEventType::kGoodShower) ) 
00900    || ( fFailCV
00901     && (eventtype&AtNuEventType::kCV)==(AtNuEventType::kCV) )
00902    || ( fFailCE
00903     && (eventtype&AtNuEventType::kCE)==(AtNuEventType::kCE) )
00904    || ( fFailFC
00905     && (eventtype&AtNuEventType::kFC)==(AtNuEventType::kFC) )
00906    || ( fFailPC
00907     && (eventtype&AtNuEventType::kPC)==(AtNuEventType::kPC) )
00908    || ( fFailCVUP
00909     && (eventtype&AtNuEventType::kCVUP)==(AtNuEventType::kCVUP) )
00910    || ( fFailUPMU
00911     && (eventtype&AtNuEventType::kUPMU)==(AtNuEventType::kUPMU) )
00912    || ( fFailCosmic
00913     && (eventtype&AtNuEventType::kCosmic)==(AtNuEventType::kCosmic) ) 
00914    || ( fFailGoodCosmic
00915     && (eventtype&AtNuEventType::kGoodCosmic)==(AtNuEventType::kGoodCosmic) ) 
00916    || ( fFailStoppingMuon
00917     && (eventtype&AtNuEventType::kStoppingMuon)==(AtNuEventType::kStoppingMuon) )
00918    || ( fFailThroughGoingMuon 
00919     && (eventtype&AtNuEventType::kThroughGoingMuon)==(AtNuEventType::kThroughGoingMuon) ) 
00920    || ( fFailMultipleMuon 
00921     && (eventtype&AtNuEventType::kMultipleMuon)==(AtNuEventType::kMultipleMuon) )  
00922    || ( fFailSpill
00923     && (eventtype&AtNuEventType::kSpill)==(AtNuEventType::kSpill) )
00924    || ( fFailBeamSpill
00925     && (eventtype&AtNuEventType::kBeamSpill)==(AtNuEventType::kBeamSpill) )
00926    || ( fFailFakeSpill
00927     && (eventtype&AtNuEventType::kFakeSpill)==(AtNuEventType::kFakeSpill) ) ){
00928     passfail = 0; 
00929   }
00930 
00931   // select event types (OR)
00932   // =======================
00933   if( passfail ){
00934     if( fSelectEventType ){
00935       passfail = 0;
00936       if( ( fSelectGoodSlice 
00937         && (eventtype&AtNuEventType::kGoodSlice)==(AtNuEventType::kGoodSlice) )
00938        || ( fSelectGoodEvent 
00939         && (eventtype&AtNuEventType::kGoodEvent)==(AtNuEventType::kGoodEvent) )
00940        || ( fSelectGoodTrack 
00941         && (eventtype&AtNuEventType::kGoodTrack)==(AtNuEventType::kGoodTrack) ) 
00942        || ( fSelectGoodShower
00943         && (eventtype&AtNuEventType::kGoodShower)==(AtNuEventType::kGoodShower) ) 
00944        || ( fSelectCV
00945         && (eventtype&AtNuEventType::kCV)==(AtNuEventType::kCV) )
00946        || ( fSelectCE
00947         && (eventtype&AtNuEventType::kCE)==(AtNuEventType::kCE) )
00948        || ( fSelectFC
00949         && (eventtype&AtNuEventType::kFC)==(AtNuEventType::kFC) )
00950        || ( fSelectPC
00951         && (eventtype&AtNuEventType::kPC)==(AtNuEventType::kPC) )
00952        || ( fSelectCVUP
00953         && (eventtype&AtNuEventType::kCVUP)==(AtNuEventType::kCVUP) )
00954        || ( fSelectUPMU
00955         && (eventtype&AtNuEventType::kUPMU)==(AtNuEventType::kUPMU) )
00956        || ( fSelectCosmic
00957         && (eventtype&AtNuEventType::kCosmic)==(AtNuEventType::kCosmic) ) 
00958        || ( fSelectGoodCosmic
00959         && (eventtype&AtNuEventType::kGoodCosmic)==(AtNuEventType::kGoodCosmic) ) 
00960        || ( fSelectStoppingMuon
00961         && (eventtype&AtNuEventType::kStoppingMuon)==(AtNuEventType::kStoppingMuon) )
00962        || ( fSelectThroughGoingMuon 
00963         && (eventtype&AtNuEventType::kThroughGoingMuon)==(AtNuEventType::kThroughGoingMuon) ) 
00964        || ( fSelectMultipleMuon 
00965         && (eventtype&AtNuEventType::kMultipleMuon)==(AtNuEventType::kMultipleMuon) )  
00966        || ( fSelectSpill
00967         && (eventtype&AtNuEventType::kSpill)==(AtNuEventType::kSpill) )
00968        || ( fSelectBeamSpill
00969         && (eventtype&AtNuEventType::kBeamSpill)==(AtNuEventType::kBeamSpill) )
00970        || ( fSelectFakeSpill
00971         && (eventtype&AtNuEventType::kFakeSpill)==(AtNuEventType::kFakeSpill) )
00972        || ( fPreSelectAtmosNumu
00973         && (atmoseventtype&AtNuAtmosEventType::kAtmosNumuCVcut1)==(AtNuAtmosEventType::kAtmosNumuCVcut1) )
00974        || ( fPreSelectAtmosNumu
00975         && (atmoseventtype&AtNuAtmosEventType::kAtmosNumuUPcut1)==(AtNuAtmosEventType::kAtmosNumuUPcut1) )
00976        || ( fPreSelectAtmosNue
00977         && (atmoseventtype&AtNuAtmosEventType::kAtmosNueCVcut1)==(AtNuAtmosEventType::kAtmosNueCVcut1) ) 
00978        || ( fSelectAtmosNumu
00979         && (atmoseventtype&AtNuAtmosEventType::kAtmosNumu)==(AtNuAtmosEventType::kAtmosNumu) )
00980        || ( fSelectAtmosNue
00981         && (atmoseventtype&AtNuAtmosEventType::kAtmosNue)==(AtNuAtmosEventType::kAtmosNue) ) ){
00982         passfail = 1; 
00983       }
00984     }
00985   }
00986 
00987   return passfail;
00988 
00989 }

void AtNuEventSelector::PassFakeSpill ( Bool_t  pass = 1  ) 

Definition at line 511 of file AtNuEventSelector.cxx.

References fPassFakeSpill, and fSelectionOnOff.

00512 {
00513   if( pass ){
00514     fSelectionOnOff = 1;
00515     fPassFakeSpill = pass;
00516   }
00517 }

void AtNuEventSelector::PassFC ( Bool_t  pass = 1  ) 

Definition at line 423 of file AtNuEventSelector.cxx.

References fPassFC, and fSelectionOnOff.

00424 {
00425   if( pass ){
00426     fSelectionOnOff = 1;
00427     fPassFC = pass;
00428   }
00429 }

void AtNuEventSelector::PassGoodCosmic ( Bool_t  pass = 1  ) 

Definition at line 463 of file AtNuEventSelector.cxx.

References fPassGoodCosmic, and fSelectionOnOff.

00464 {
00465   if(pass){
00466     fSelectionOnOff = 1;
00467     fPassGoodCosmic = pass;
00468   }
00469 }

void AtNuEventSelector::PassGoodEvent ( Bool_t  pass = 1  ) 

Definition at line 383 of file AtNuEventSelector.cxx.

References fPassGoodEvent, and fSelectionOnOff.

00384 {
00385   if( pass ){
00386     fSelectionOnOff = 1;
00387     fPassGoodEvent = pass;
00388   }
00389 }

void AtNuEventSelector::PassGoodShower ( Bool_t  pass = 1  ) 

Definition at line 399 of file AtNuEventSelector.cxx.

References fPassGoodShower, and fSelectionOnOff.

00400 {
00401   if( pass ){
00402     fSelectionOnOff = 1;
00403     fPassGoodShower = pass;
00404   }
00405 }

void AtNuEventSelector::PassGoodSlice ( Bool_t  pass = 1  ) 

Definition at line 375 of file AtNuEventSelector.cxx.

References fPassGoodSlice, and fSelectionOnOff.

00376 {
00377   if( pass ){
00378     fSelectionOnOff = 1;
00379     fPassGoodSlice = pass;
00380   }
00381 }

void AtNuEventSelector::PassGoodTrack ( Bool_t  pass = 1  ) 

Definition at line 391 of file AtNuEventSelector.cxx.

References fPassGoodTrack, and fSelectionOnOff.

00392 {
00393   if( pass ){
00394     fSelectionOnOff = 1;
00395     fPassGoodTrack = pass;
00396   }
00397 }

void AtNuEventSelector::PassMultipleMuon ( Bool_t  pass = 1  ) 

Definition at line 487 of file AtNuEventSelector.cxx.

References fPassMultipleMuon, and fSelectionOnOff.

00488 {
00489   if( pass ){
00490     fSelectionOnOff = 1;
00491     fPassMultipleMuon = pass;
00492   }
00493 }

void AtNuEventSelector::PassPC ( Bool_t  pass = 1  ) 

Definition at line 431 of file AtNuEventSelector.cxx.

References fPassPC, and fSelectionOnOff.

00432 {
00433   if( pass ){
00434     fSelectionOnOff = 1;
00435     fPassPC = pass;
00436   }
00437 }

void AtNuEventSelector::PassSpill ( Bool_t  pass = 1  ) 

Definition at line 495 of file AtNuEventSelector.cxx.

References fPassSpill, and fSelectionOnOff.

00496 {
00497   if( pass ){
00498     fSelectionOnOff = 1;
00499     fPassSpill = pass;
00500   }
00501 }

void AtNuEventSelector::PassStoppingMuon ( Bool_t  pass = 1  ) 

Definition at line 471 of file AtNuEventSelector.cxx.

References fPassStoppingMuon, and fSelectionOnOff.

00472 {
00473   if( pass ){
00474     fSelectionOnOff = 1;
00475     fPassStoppingMuon = pass;
00476   }
00477 }

void AtNuEventSelector::PassThroughGoingMuon ( Bool_t  pass = 1  ) 

Definition at line 479 of file AtNuEventSelector.cxx.

References fPassThroughGoingMuon, and fSelectionOnOff.

00480 {
00481   if( pass ){
00482     fSelectionOnOff = 1;
00483     fPassThroughGoingMuon = pass;
00484   }
00485 }

void AtNuEventSelector::PassUPMU ( Bool_t  pass = 1  ) 

Definition at line 447 of file AtNuEventSelector.cxx.

References fPassUPMU, and fSelectionOnOff.

00448 {
00449   if( pass ){
00450     fSelectionOnOff = 1;
00451     fPassUPMU = pass;
00452   }
00453 }

void AtNuEventSelector::PreSelectAtmosNue ( Bool_t  select = 1  ) 

Definition at line 366 of file AtNuEventSelector.cxx.

References fPreSelectAtmosNue, fSelectEventType, and fSelectionOnOff.

00367 {
00368   if( select ){
00369     fSelectionOnOff = 1;
00370     fPreSelectAtmosNue = select;
00371     fSelectEventType = 1;
00372   }
00373 }

void AtNuEventSelector::PreSelectAtmosNumu ( Bool_t  select = 1  ) 

Definition at line 357 of file AtNuEventSelector.cxx.

References fPreSelectAtmosNumu, fSelectEventType, and fSelectionOnOff.

00358 {
00359   if( select ){
00360     fSelectionOnOff = 1;
00361     fPreSelectAtmosNumu = select;
00362     fSelectEventType = 1;
00363   }
00364 }

void AtNuEventSelector::Run ( Int_t  entries = -1  ) 

Definition at line 731 of file AtNuEventSelector.cxx.

References RunEventSelection(), and StartEventSelection().

00732 {
00733   std::cout << " *** Run() *** " << std::endl;
00734 
00735   this->StartEventSelection();
00736   this->RunEventSelection(entries);
00737 }

void AtNuEventSelector::RunEventSelection ( Int_t  entries = -1  )  [private]

Definition at line 739 of file AtNuEventSelector.cxx.

References fChain, fEvent, fEventList, fEventListCounter, fEventListLast, fRun, fRunList, fSelection, fSelectionOnOff, fSnarlList, fWriteEvents, fWriteSummaries, AtNuEventSelection::GetAtmosEventType(), AtNuEventSelection::GetEventType(), AtNuEventSelection::GetPrimaryShowerIndex(), AtNuEventSelection::GetPrimaryTrackIndex(), AtNuEventSelection::GetShieldTime(), AtNuEventSelection::GetSpillTime(), AtNuEventType::kNothing, AtNuAtmosEventType::kNothing, passfail(), PassFail(), AtmosEvent::Run, RunEventSelectionEnd(), AtmosEvent::Snarl, WriteOutEvent(), and WriteOutSummary().

Referenced by Run().

00740 {
00741   if( fChain ){
00742 
00743     // number of events
00744     // ================
00745     Int_t run_entries = entries;
00746     if( run_entries<0 || run_entries>fChain->GetEntries() ){
00747       run_entries = fChain->GetEntries();
00748     }
00749 
00750     std::cout << " running over " << run_entries << " events " << std::endl;
00751 
00752     for(Int_t i=0; i<run_entries; i++){
00753 
00754       if( 0 ) std::cout << " " << i << "/" << run_entries << std::endl;
00755 
00756       fChain->GetEntry(i);  
00757 
00758       // check for new run
00759       // =================
00760       if( fEvent->Run != fRun ){
00761         std::cout << "  Run " << fEvent->Run << std::endl;
00762         fRun = fEvent->Run;
00763       }
00764 
00765       // search event list
00766       // =================
00767       // (assuming that everything is in numerical order)
00768       Bool_t foundit = 1;
00769       if( fEventList ){
00770         foundit = 0;
00771         if( fEventListCounter<fEventListLast
00772          && fEvent->Run==fRunList[fEventListCounter]
00773          && fEvent->Snarl==fSnarlList[fEventListCounter] ){
00774           std::cout << "  (" << fEventListCounter << "/" << fEventListLast-1 << ") found: " << fEvent->Run << " " << fEvent->Snarl << std::endl;
00775           fEventListCounter++;
00776           foundit = 1;
00777         }
00778       }
00779 
00780       // pass/fail event
00781       // ===============
00782       if( foundit ){
00783         Bool_t passfail = 1;
00784         Int_t eventtype = AtNuEventType::kNothing;
00785         Int_t atmoseventtype = AtNuAtmosEventType::kNothing;
00786         Double_t shieldtime = -99999.9;
00787         Double_t spilltime = -99999.9;
00788         Int_t ptrackid = -1;
00789         Int_t pshowerid = -1;
00790 
00791         if( fSelection ){
00792           eventtype = fSelection->GetEventType(fEvent);
00793           atmoseventtype = fSelection->GetAtmosEventType(fEvent);
00794           shieldtime = fSelection->GetShieldTime(fEvent);
00795           spilltime = fSelection->GetSpillTime(fEvent);
00796           ptrackid = fSelection->GetPrimaryTrackIndex(fEvent);
00797           pshowerid = fSelection->GetPrimaryShowerIndex(fEvent);   
00798         }
00799 
00800         if( fSelectionOnOff ){
00801           passfail = this->PassFail(eventtype,
00802                                     atmoseventtype);
00803         }
00804       
00805         if( passfail ){
00806           if( fWriteEvents ){
00807             this->WriteOutEvent();
00808           }
00809           if( fWriteSummaries ){
00810             this->WriteOutSummary(fEvent,
00811                                   eventtype,atmoseventtype,
00812                                   shieldtime,spilltime,
00813                                   ptrackid,pshowerid);
00814           }
00815         }
00816       }
00817 
00818     }
00819 
00820     this->RunEventSelectionEnd();
00821   }
00822 
00823   return;
00824 }

void AtNuEventSelector::RunEventSelectionEnd (  )  [private]

Definition at line 826 of file AtNuEventSelector.cxx.

References AtNuEventNtuple::Close(), CloseFile(), fNewFile, and fNtuple.

Referenced by RunEventSelection().

00827 {
00828   if( fNewFile ){
00829     this->CloseFile();
00830   }
00831 
00832   if( fNtuple ){
00833     fNtuple->Close();
00834   }
00835 }

void AtNuEventSelector::SelectAtmosNue ( Bool_t  select = 1  ) 

Definition at line 348 of file AtNuEventSelector.cxx.

References fSelectAtmosNue, fSelectEventType, and fSelectionOnOff.

00349 {
00350   if( select ){
00351     fSelectionOnOff = 1;
00352     fSelectAtmosNue = select;
00353     fSelectEventType = 1;
00354   }
00355 }

void AtNuEventSelector::SelectAtmosNumu ( Bool_t  select = 1  ) 

Definition at line 339 of file AtNuEventSelector.cxx.

References fSelectAtmosNumu, fSelectEventType, and fSelectionOnOff.

00340 {
00341   if( select ){
00342     fSelectionOnOff = 1;
00343     fSelectAtmosNumu = select;
00344     fSelectEventType = 1;
00345   }
00346 }

void AtNuEventSelector::SelectBeamSpill ( Bool_t  select = 1  ) 

Definition at line 321 of file AtNuEventSelector.cxx.

References fSelectBeamSpill, fSelectEventType, and fSelectionOnOff.

00322 {
00323   if( select ){
00324     fSelectionOnOff = 1;
00325     fSelectBeamSpill = select;
00326     fSelectEventType = 1;
00327   }
00328 }

void AtNuEventSelector::SelectCE ( Bool_t  select = 1  ) 

Definition at line 222 of file AtNuEventSelector.cxx.

References fSelectCE, fSelectEventType, and fSelectionOnOff.

00223 {
00224   if( select ){
00225     fSelectionOnOff = 1;
00226     fSelectCE = select;
00227     fSelectEventType = 1;
00228   }
00229 }

void AtNuEventSelector::SelectCosmic ( Bool_t  select = 1  ) 

Definition at line 267 of file AtNuEventSelector.cxx.

References fSelectCosmic, fSelectEventType, and fSelectionOnOff.

00268 {
00269   if(select){
00270     fSelectionOnOff = 1;
00271     fSelectCosmic = select;
00272     fSelectEventType = 1;
00273   }
00274 }

void AtNuEventSelector::SelectCV ( Bool_t  select = 1  ) 

Definition at line 213 of file AtNuEventSelector.cxx.

References fSelectCV, fSelectEventType, and fSelectionOnOff.

00214 {
00215   if( select ){
00216     fSelectionOnOff = 1;
00217     fSelectCV = select;
00218     fSelectEventType = 1;
00219   }
00220 }

void AtNuEventSelector::SelectCVUP ( Bool_t  select = 1  ) 

Definition at line 249 of file AtNuEventSelector.cxx.

References fSelectCVUP, fSelectEventType, and fSelectionOnOff.

00250 {
00251   if( select ){
00252     fSelectionOnOff = 1;
00253     fSelectCVUP = select;
00254     fSelectEventType = 1;
00255   }
00256 }

void AtNuEventSelector::SelectFakeSpill ( Bool_t  select = 1  ) 

Definition at line 330 of file AtNuEventSelector.cxx.

References fSelectEventType, fSelectFakeSpill, and fSelectionOnOff.

00331 {
00332   if( select ){
00333     fSelectionOnOff = 1;
00334     fSelectFakeSpill = select;
00335     fSelectEventType = 1;
00336   }
00337 }

void AtNuEventSelector::SelectFC ( Bool_t  select = 1  ) 

Definition at line 231 of file AtNuEventSelector.cxx.

References fSelectEventType, fSelectFC, and fSelectionOnOff.

00232 {
00233   if( select ){
00234     fSelectionOnOff = 1;
00235     fSelectFC = select; 
00236     fSelectEventType = 1;
00237   }
00238 }

void AtNuEventSelector::SelectGoodCosmic ( Bool_t  select = 1  ) 

Definition at line 276 of file AtNuEventSelector.cxx.

References fSelectEventType, fSelectGoodCosmic, and fSelectionOnOff.

00277 {
00278   if(select){
00279     fSelectionOnOff = 1;
00280     fSelectGoodCosmic = select;
00281     fSelectEventType = 1;
00282   }
00283 }

void AtNuEventSelector::SelectGoodEvent ( Bool_t  select = 1  ) 

Definition at line 186 of file AtNuEventSelector.cxx.

References fSelectEventType, fSelectGoodEvent, and fSelectionOnOff.

00187 {
00188   if( select ){
00189     fSelectionOnOff = 1;
00190     fSelectGoodEvent = select;
00191     fSelectEventType = 1;
00192   }
00193 }

void AtNuEventSelector::SelectGoodShower ( Bool_t  select = 1  ) 

Definition at line 204 of file AtNuEventSelector.cxx.

References fSelectEventType, fSelectGoodShower, and fSelectionOnOff.

00205 {
00206   if( select ){
00207     fSelectionOnOff = 1;
00208     fSelectGoodShower = select;
00209     fSelectEventType = 1;
00210   }
00211 }

void AtNuEventSelector::SelectGoodSlice ( Bool_t  select = 1  ) 

Definition at line 177 of file AtNuEventSelector.cxx.

References fSelectEventType, fSelectGoodSlice, and fSelectionOnOff.

00178 {
00179   if( select ){
00180     fSelectionOnOff = 1;
00181     fSelectGoodSlice = select;
00182     fSelectEventType = 1;
00183   }
00184 }

void AtNuEventSelector::SelectGoodTrack ( Bool_t  select = 1  ) 

Definition at line 195 of file AtNuEventSelector.cxx.

References fSelectEventType, fSelectGoodTrack, and fSelectionOnOff.

00196 {
00197   if( select ){
00198     fSelectionOnOff = 1;
00199     fSelectGoodTrack = select;
00200     fSelectEventType = 1;
00201   }
00202 }

void AtNuEventSelector::SelectMultipleMuon ( Bool_t  select = 1  ) 

Definition at line 303 of file AtNuEventSelector.cxx.

References fSelectEventType, fSelectionOnOff, and fSelectMultipleMuon.

00304 {
00305   if( select ){
00306     fSelectionOnOff = 1;
00307     fSelectMultipleMuon = select;
00308     fSelectEventType = 1;
00309   }
00310 }

void AtNuEventSelector::SelectPC ( Bool_t  select = 1  ) 

Definition at line 240 of file AtNuEventSelector.cxx.

References fSelectEventType, fSelectionOnOff, and fSelectPC.

00241 {
00242   if( select ){
00243     fSelectionOnOff = 1;
00244     fSelectPC = select; 
00245     fSelectEventType = 1;
00246   }
00247 }

void AtNuEventSelector::SelectSpill ( Bool_t  select = 1  ) 

Definition at line 312 of file AtNuEventSelector.cxx.

References fSelectEventType, fSelectionOnOff, and fSelectSpill.

00313 {
00314   if( select ){
00315     fSelectionOnOff = 1;
00316     fSelectSpill = select;
00317     fSelectEventType = 1;
00318   }
00319 }

void AtNuEventSelector::SelectStoppingMuon ( Bool_t  select = 1  ) 

Definition at line 285 of file AtNuEventSelector.cxx.

References fSelectEventType, fSelectionOnOff, and fSelectStoppingMuon.

00286 {
00287   if( select ){
00288     fSelectionOnOff = 1;
00289     fSelectStoppingMuon = select;
00290     fSelectEventType = 1;
00291   }
00292 }

void AtNuEventSelector::SelectThroughGoingMuon ( Bool_t  select = 1  ) 

Definition at line 294 of file AtNuEventSelector.cxx.

References fSelectEventType, fSelectionOnOff, and fSelectThroughGoingMuon.

00295 {
00296   if( select ){
00297     fSelectionOnOff = 1;
00298     fSelectThroughGoingMuon = select;
00299     fSelectEventType = 1;
00300   }
00301 }

void AtNuEventSelector::SelectUPMU ( Bool_t  select = 1  ) 

Definition at line 258 of file AtNuEventSelector.cxx.

References fSelectEventType, fSelectionOnOff, and fSelectUPMU.

00259 {
00260   if( select ){
00261     fSelectionOnOff = 1;
00262     fSelectUPMU = select;
00263     fSelectEventType = 1;
00264   }
00265 }

void AtNuEventSelector::SetEventFile ( const char *  filename  ) 

Definition at line 673 of file AtNuEventSelector.cxx.

References fNewFileName.

00674 {
00675   fNewFileName = filename;
00676 }

void AtNuEventSelector::SetEventFileMaxSize ( Double_t  maxsize_mb  ) 

Definition at line 683 of file AtNuEventSelector.cxx.

References fEventFileMaxSizeBytes, and fEventFileMaxSizeMegaBytes.

00684 {
00685   fEventFileMaxSizeBytes = 1.0e6*maxsize_mb;
00686   fEventFileMaxSizeMegaBytes = maxsize_mb; 
00687 }

void AtNuEventSelector::SetSummaryFile ( const char *  filename  ) 

Definition at line 678 of file AtNuEventSelector.cxx.

References fSummaryFileName.

00679 {
00680   fSummaryFileName = filename;
00681 }

void AtNuEventSelector::SetSummaryFileMaxSize ( Double_t  maxsize_mb  ) 

Definition at line 689 of file AtNuEventSelector.cxx.

References fSummaryFileMaxSizeBytes, and fSummaryFileMaxSizeMegaBytes.

00690 {
00691   fSummaryFileMaxSizeBytes = 1.0e6*maxsize_mb;
00692   fSummaryFileMaxSizeMegaBytes = maxsize_mb; 
00693 }

void AtNuEventSelector::StartEventSelection (  )  [private]

Definition at line 837 of file AtNuEventSelector.cxx.

References fSelection, fSelectionFactory, and AtNuEventSelectionFactory::MakeEventSelection().

Referenced by Run().

00838 {
00839   if( !fSelection ){
00840     fSelection = fSelectionFactory->MakeEventSelection();
00841   }
00842 }

void AtNuEventSelector::WriteEvents ( Bool_t  write = 1  ) 

Definition at line 663 of file AtNuEventSelector.cxx.

References fWriteEvents.

00664 {
00665   fWriteEvents = write;
00666 }

void AtNuEventSelector::WriteOutEvent (  )  [private]

Definition at line 1029 of file AtNuEventSelector.cxx.

References CloseFile(), fEventFileMaxSizeBytes, fFileNumber, fNewFile, fNewFileName, fWriteEvents, OpenFile(), and WriteToFile().

Referenced by RunEventSelection().

01030 {
01031   
01032   if( fWriteEvents ){
01033 
01034     // open file
01035     if( !fNewFile ){
01036       this->OpenFile(fNewFileName);
01037     }
01038 
01039     // open new file
01040     if( fNewFile 
01041      && fEventFileMaxSizeBytes>0
01042      && fNewFile->GetBytesWritten()>fEventFileMaxSizeBytes ){
01043       std::cout << " FILE SIZE EXCEEDS LIMIT (" << 1.0e-6*fNewFile->GetBytesWritten() << ">" << 1.0e-6*fEventFileMaxSizeBytes << ")" << std::endl;
01044       std::cout << "  ... SWITCHING TO NEW FILE" << std::endl;
01045 
01046       // close current file
01047       this->CloseFile();
01048 
01049       // adjust file name
01050       fFileNumber++;
01051       TString filename = fNewFileName;
01052       TString tempfilename = ".";
01053       if( fFileNumber<10 ) tempfilename.Append("000");
01054       else if( fFileNumber<100 ) tempfilename.Append("00");
01055       else if( fFileNumber<1000 ) tempfilename.Append("0");
01056       else if( fFileNumber>9999 ) std::cout << "  warning: file number exceeded 10000 ! " << std::endl;
01057       tempfilename += fFileNumber;
01058 
01059       if( filename.EndsWith(".root") ){
01060         filename.Insert(filename.Length()-5,tempfilename);
01061       }
01062       else{
01063         filename.Append(tempfilename);
01064       }
01065      
01066       std::cout << "  ... CREATING NEW OUTPUT FILE: " << filename.Data() << std::endl;
01067 
01068       // create new file
01069       this->OpenFile(filename);
01070     }
01071 
01072     // write to file   
01073     if( fNewFile ){
01074       this->WriteToFile();
01075     }
01076   }
01077 
01078   return;
01079 }

void AtNuEventSelector::WriteOutSummary ( AtmosEvent event,
Int_t  eventtype,
Int_t  atmoseventtype,
Double_t  shieldtime,
Double_t  spilltime,
Int_t  ptrackid,
Int_t  pshowerid 
) [private]
void AtNuEventSelector::WriteShowers ( Bool_t  write = 1  ) 

Definition at line 704 of file AtNuEventSelector.cxx.

References fWriteShowers.

00705 {
00706   if( write && !fWriteShowers ){
00707     fWriteShowers = write;
00708   }
00709 
00710   return;
00711 }

void AtNuEventSelector::WriteShowersLimit ( Int_t  limit = 1  ) 

Definition at line 722 of file AtNuEventSelector.cxx.

References fWriteShowersLimit.

00723 {
00724   if( limit>=0 ){
00725     fWriteShowersLimit = limit;
00726   }
00727 
00728   return;
00729 }

void AtNuEventSelector::WriteSummaries ( Bool_t  write = 1  ) 

Definition at line 668 of file AtNuEventSelector.cxx.

References fWriteSummaries.

00669 {
00670   fWriteSummaries = write;
00671 }

void AtNuEventSelector::WriteToFile (  )  [private]

Definition at line 1005 of file AtNuEventSelector.cxx.

References fNewFile, and fNewTree.

Referenced by WriteOutEvent().

01006 {
01007   if( fNewFile ){
01008     TDirectory* tmpd = gDirectory;
01009     fNewFile->cd();
01010     fNewTree->Fill();
01011     gDirectory = tmpd;
01012   }
01013 
01014   return;
01015 }

void AtNuEventSelector::WriteTracks ( Bool_t  write = 1  ) 

Definition at line 695 of file AtNuEventSelector.cxx.

References fWriteTracks.

00696 {
00697   if( write && !fWriteTracks ){
00698     fWriteTracks = write;
00699   }
00700 
00701   return;
00702 }

void AtNuEventSelector::WriteTracksLimit ( Int_t  limit = 1  ) 

Definition at line 713 of file AtNuEventSelector.cxx.

References fWriteTracksLimit.

00714 {
00715   if( limit>=0 ){
00716     fWriteTracksLimit = limit;
00717   }
00718 
00719   return;
00720 }


Member Data Documentation

TChain* AtNuEventSelector::fChain [private]

Definition at line 220 of file AtNuEventSelector.h.

Referenced by AddFile(), Initialize(), and RunEventSelection().

Definition at line 231 of file AtNuEventSelector.h.

Referenced by Initialize(), OpenFile(), and RunEventSelection().

Definition at line 137 of file AtNuEventSelector.h.

Referenced by SetEventFileMaxSize(), and WriteOutEvent().

Definition at line 138 of file AtNuEventSelector.h.

Referenced by SetEventFileMaxSize().

Definition at line 224 of file AtNuEventSelector.h.

Referenced by AddList(), and RunEventSelection().

Definition at line 225 of file AtNuEventSelector.h.

Referenced by RunEventSelection().

Definition at line 226 of file AtNuEventSelector.h.

Referenced by AddList(), and RunEventSelection().

Definition at line 211 of file AtNuEventSelector.h.

Referenced by FailBeamSpill(), and PassFail().

Bool_t AtNuEventSelector::fFailCE [private]

Definition at line 200 of file AtNuEventSelector.h.

Referenced by FailCE(), and PassFail().

Definition at line 205 of file AtNuEventSelector.h.

Referenced by FailCosmic(), and PassFail().

Bool_t AtNuEventSelector::fFailCV [private]

Definition at line 199 of file AtNuEventSelector.h.

Referenced by FailCV(), and PassFail().

Bool_t AtNuEventSelector::fFailCVUP [private]

Definition at line 203 of file AtNuEventSelector.h.

Referenced by FailCVUP(), and PassFail().

Definition at line 212 of file AtNuEventSelector.h.

Referenced by FailFakeSpill(), and PassFail().

Bool_t AtNuEventSelector::fFailFC [private]

Definition at line 201 of file AtNuEventSelector.h.

Referenced by FailFC(), and PassFail().

Definition at line 206 of file AtNuEventSelector.h.

Referenced by FailGoodCosmic(), and PassFail().

Definition at line 196 of file AtNuEventSelector.h.

Referenced by FailGoodEvent(), and PassFail().

Definition at line 198 of file AtNuEventSelector.h.

Referenced by FailGoodShower(), and PassFail().

Definition at line 195 of file AtNuEventSelector.h.

Referenced by FailGoodSlice(), and PassFail().

Definition at line 197 of file AtNuEventSelector.h.

Referenced by FailGoodTrack(), and PassFail().

Definition at line 209 of file AtNuEventSelector.h.

Referenced by FailMultipleMuon(), and PassFail().

Bool_t AtNuEventSelector::fFailPC [private]

Definition at line 202 of file AtNuEventSelector.h.

Referenced by FailPC(), and PassFail().

Definition at line 210 of file AtNuEventSelector.h.

Referenced by FailSpill(), and PassFail().

Definition at line 207 of file AtNuEventSelector.h.

Referenced by FailStoppingMuon(), and PassFail().

Definition at line 208 of file AtNuEventSelector.h.

Referenced by FailThroughGoingMuon(), and PassFail().

Bool_t AtNuEventSelector::fFailUPMU [private]

Definition at line 204 of file AtNuEventSelector.h.

Referenced by FailUPMU(), and PassFail().

Definition at line 141 of file AtNuEventSelector.h.

Referenced by WriteOutEvent().

Int_t AtNuEventSelector::fLast [private]

Definition at line 221 of file AtNuEventSelector.h.

Referenced by AddFile().

TFile* AtNuEventSelector::fNewFile [private]

Definition at line 135 of file AtNuEventSelector.h.

Referenced by SetEventFile(), and WriteOutEvent().

TTree* AtNuEventSelector::fNewTree [private]

Definition at line 134 of file AtNuEventSelector.h.

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

Definition at line 145 of file AtNuEventSelector.h.

Referenced by RunEventSelectionEnd(), WriteOutSummary(), and ~AtNuEventSelector().

Definition at line 192 of file AtNuEventSelector.h.

Referenced by PassBeamSpill(), and PassFail().

Bool_t AtNuEventSelector::fPassCE [private]

Definition at line 181 of file AtNuEventSelector.h.

Referenced by PassCE(), and PassFail().

Definition at line 186 of file AtNuEventSelector.h.

Referenced by PassCosmic(), and PassFail().

Bool_t AtNuEventSelector::fPassCV [private]

Definition at line 180 of file AtNuEventSelector.h.

Referenced by PassCV(), and PassFail().

Bool_t AtNuEventSelector::fPassCVUP [private]

Definition at line 184 of file AtNuEventSelector.h.

Referenced by PassCVUP(), and PassFail().

Definition at line 193 of file AtNuEventSelector.h.

Referenced by PassFail(), and PassFakeSpill().

Bool_t AtNuEventSelector::fPassFC [private]

Definition at line 182 of file AtNuEventSelector.h.

Referenced by PassFail(), and PassFC().

Definition at line 187 of file AtNuEventSelector.h.

Referenced by PassFail(), and PassGoodCosmic().

Definition at line 177 of file AtNuEventSelector.h.

Referenced by PassFail(), and PassGoodEvent().

Definition at line 179 of file AtNuEventSelector.h.

Referenced by PassFail(), and PassGoodShower().

Definition at line 176 of file AtNuEventSelector.h.

Referenced by PassFail(), and PassGoodSlice().

Definition at line 178 of file AtNuEventSelector.h.

Referenced by PassFail(), and PassGoodTrack().

Definition at line 190 of file AtNuEventSelector.h.

Referenced by PassFail(), and PassMultipleMuon().

Bool_t AtNuEventSelector::fPassPC [private]

Definition at line 183 of file AtNuEventSelector.h.

Referenced by PassFail(), and PassPC().

Definition at line 191 of file AtNuEventSelector.h.

Referenced by PassFail(), and PassSpill().

Definition at line 188 of file AtNuEventSelector.h.

Referenced by PassFail(), and PassStoppingMuon().

Definition at line 189 of file AtNuEventSelector.h.

Referenced by PassFail(), and PassThroughGoingMuon().

Bool_t AtNuEventSelector::fPassUPMU [private]

Definition at line 185 of file AtNuEventSelector.h.

Referenced by PassFail(), and PassUPMU().

Definition at line 215 of file AtNuEventSelector.h.

Referenced by PassFail(), and PreSelectAtmosNue().

Definition at line 214 of file AtNuEventSelector.h.

Referenced by PassFail(), and PreSelectAtmosNumu().

Int_t AtNuEventSelector::fRun [private]

Definition at line 222 of file AtNuEventSelector.h.

Referenced by RunEventSelection().

vector<Int_t> AtNuEventSelector::fRunList [private]

Definition at line 228 of file AtNuEventSelector.h.

Referenced by AddList(), and RunEventSelection().

Definition at line 174 of file AtNuEventSelector.h.

Referenced by PassFail(), and SelectAtmosNue().

Definition at line 173 of file AtNuEventSelector.h.

Referenced by PassFail(), and SelectAtmosNumu().

Definition at line 171 of file AtNuEventSelector.h.

Referenced by PassFail(), and SelectBeamSpill().

Bool_t AtNuEventSelector::fSelectCE [private]

Definition at line 160 of file AtNuEventSelector.h.

Referenced by PassFail(), and SelectCE().

Definition at line 165 of file AtNuEventSelector.h.

Referenced by PassFail(), and SelectCosmic().

Bool_t AtNuEventSelector::fSelectCV [private]

Definition at line 159 of file AtNuEventSelector.h.

Referenced by PassFail(), and SelectCV().

Definition at line 163 of file AtNuEventSelector.h.

Referenced by PassFail(), and SelectCVUP().

Definition at line 172 of file AtNuEventSelector.h.

Referenced by PassFail(), and SelectFakeSpill().

Bool_t AtNuEventSelector::fSelectFC [private]

Definition at line 161 of file AtNuEventSelector.h.

Referenced by PassFail(), and SelectFC().

Definition at line 166 of file AtNuEventSelector.h.

Referenced by PassFail(), and SelectGoodCosmic().

Definition at line 156 of file AtNuEventSelector.h.

Referenced by PassFail(), and SelectGoodEvent().

Definition at line 158 of file AtNuEventSelector.h.

Referenced by PassFail(), and SelectGoodShower().

Definition at line 155 of file AtNuEventSelector.h.

Referenced by PassFail(), and SelectGoodSlice().

Definition at line 157 of file AtNuEventSelector.h.

Referenced by PassFail(), and SelectGoodTrack().

Definition at line 144 of file AtNuEventSelector.h.

Referenced by RunEventSelection(), StartEventSelection(), and ~AtNuEventSelector().

Definition at line 143 of file AtNuEventSelector.h.

Referenced by Initialize(), StartEventSelection(), and ~AtNuEventSelector().

Definition at line 169 of file AtNuEventSelector.h.

Referenced by PassFail(), and SelectMultipleMuon().

Bool_t AtNuEventSelector::fSelectPC [private]

Definition at line 162 of file AtNuEventSelector.h.

Referenced by PassFail(), and SelectPC().

Definition at line 170 of file AtNuEventSelector.h.

Referenced by PassFail(), and SelectSpill().

Definition at line 167 of file AtNuEventSelector.h.

Referenced by PassFail(), and SelectStoppingMuon().

Definition at line 168 of file AtNuEventSelector.h.

Referenced by PassFail(), and SelectThroughGoingMuon().

Definition at line 164 of file AtNuEventSelector.h.

Referenced by PassFail(), and SelectUPMU().

vector<Int_t> AtNuEventSelector::fSnarlList [private]

Definition at line 229 of file AtNuEventSelector.h.

Referenced by AddList(), and RunEventSelection().

Definition at line 139 of file AtNuEventSelector.h.

Referenced by SetSummaryFileMaxSize().

Definition at line 140 of file AtNuEventSelector.h.

Referenced by SetSummaryFileMaxSize(), and WriteOutSummary().

Definition at line 136 of file AtNuEventSelector.h.

Referenced by SetSummaryFile(), and WriteOutSummary().

Definition at line 217 of file AtNuEventSelector.h.

Referenced by RunEventSelection(), WriteEvents(), and WriteOutEvent().

Definition at line 148 of file AtNuEventSelector.h.

Referenced by WriteOutSummary(), and WriteShowers().

Definition at line 150 of file AtNuEventSelector.h.

Referenced by WriteOutSummary(), and WriteShowersLimit().

Definition at line 218 of file AtNuEventSelector.h.

Referenced by RunEventSelection(), WriteOutSummary(), and WriteSummaries().

Definition at line 147 of file AtNuEventSelector.h.

Referenced by WriteOutSummary(), and WriteTracks().

Definition at line 149 of file AtNuEventSelector.h.

Referenced by WriteOutSummary(), and WriteTracksLimit().


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

Generated on 2 Nov 2017 for loon by  doxygen 1.6.1