#include <SpillInfo.h>
Public Member Functions | |
| SpillInfo () | |
| ~SpillInfo () | |
| void | GetSpillInfo (int month, int year, double snarltime, SpillInfoBlock &spinfo) |
Private Attributes | |
| TFile * | beamfile |
| TTree * | beamt |
| Int_t | beamsav |
| Bool_t | first_beam |
| Double_t | fTime |
| Double_t | fPot |
| Double_t | fHorn |
| Double_t | fTgtpos |
| Double_t | fHpos |
| Double_t | fVpos |
| Double_t | fMagnet |
|
|
Definition at line 15 of file SpillInfo.cxx. References beamsav, and first_beam. 00016 {
00017 beamsav=0;
00018 first_beam=true;
00019 }
|
|
|
Definition at line 22 of file SpillInfo.cxx. 00023 {
00024 //beamfile->Close();
00025 }
|
|
||||||||||||||||||||
|
Definition at line 27 of file SpillInfo.cxx. References beamfile, beamsav, beamt, fHorn, fHpos, first_beam, fMagnet, fPot, fTgtpos, fTime, fVpos, month, SpillInfoBlock::SetHorn(), SpillInfoBlock::SetHpos(), SpillInfoBlock::SetMagnet(), SpillInfoBlock::SetPot(), SpillInfoBlock::SetTgtpos(), SpillInfoBlock::SetTime(), SpillInfoBlock::SetVpos(), and SpillInfoBlock::Zero(). Referenced by MadTestAnalysis::CreatePAN(), MadDpAnalysis::CreatePAN(), and MadCluAnalysis::DataDistributions(). 00028 {
00029 Bool_t found=false;
00030 Int_t bentry=-1;
00031 Double_t diffmin=9999999.;
00032 spinfo.Zero();
00033 char myfile[256];
00034 char dir[265];
00035
00036 char mon[256];
00037 if(month==1) sprintf(mon,"january"); if(month==2) sprintf(mon,"february"); if(month==3) sprintf(mon,"march");
00038 if(month==4) sprintf(mon,"april"); if(month==5) sprintf(mon,"may"); if(month==6) sprintf(mon,"june");
00039 if(month==7) sprintf(mon,"july"); if(month==8) sprintf(mon,"august"); if(month==9) sprintf(mon,"september");
00040 if(month==10) sprintf(mon,"october"); if(month==11) sprintf(mon,"november"); if(month==12) sprintf(mon,"december");
00041
00042 Int_t myyear=year-2000;
00043
00044 sprintf(dir,"/afs/fnal.gov/files/data/minos/d80/niki/BeamFiles");
00045 sprintf(myfile,"%s/beam_ntuple_%s_0%d.root",dir,mon,myyear);
00046
00047 if(first_beam) {
00048 beamfile = new TFile(myfile,"READ");
00049 beamt = (TTree*)beamfile->Get("beamtree");
00050 beamt->SetBranchAddress("time", &fTime);
00051 beamt->SetBranchAddress("pot", &fPot);
00052 beamt->SetBranchAddress("horn", &fHorn);
00053 beamt->SetBranchAddress("tgtpos",&fTgtpos);
00054 beamt->SetBranchAddress("hpos", &fHpos);
00055 beamt->SetBranchAddress("vpos", &fVpos);
00056 beamt->SetBranchAddress("magnet",&fMagnet);
00057 first_beam = false;
00058 }
00059 Int_t ibeamlow = beamsav-10;
00060
00061 if(ibeamlow<0) ibeamlow = 0;
00062
00063 Int_t endbeam = beamt->GetEntries();
00064
00065 for (int ibeam =ibeamlow; ibeam < endbeam; ibeam++ ) {
00066 beamt->GetEntry(ibeam);
00067 if(fTime>(snarltime+10.)) break;
00068 Double_t diff=fTime-snarltime;
00069 if(fabs(diff)<diffmin){
00070 diffmin=fabs(diff);
00071 bentry=ibeam;
00072 }
00073 }
00074
00075 if(fabs(diffmin)<1.5){
00076 beamt->GetEntry(bentry);
00077 found=true;
00078 beamsav = bentry;
00079 spinfo.SetTime(fTime);
00080 spinfo.SetPot(fPot);
00081 spinfo.SetHorn(fHorn);
00082 spinfo.SetTgtpos(fTgtpos);
00083 spinfo.SetHpos(fHpos);
00084 spinfo.SetVpos(fVpos);
00085 spinfo.SetMagnet(fMagnet);
00086 }
00087
00088 if(!found){
00089 Double_t fd=-999.;
00090 spinfo.SetTime(fd);
00091 spinfo.SetPot(fd);
00092 spinfo.SetHorn(fd);
00093 spinfo.SetTgtpos(fd);
00094 spinfo.SetHpos(fd);
00095 spinfo.SetVpos(fd);
00096 spinfo.SetMagnet(fd);
00097 }
00098 return;
00099 }
|
|
|
Definition at line 14 of file SpillInfo.h. Referenced by GetSpillInfo(). |
|
|
Definition at line 16 of file SpillInfo.h. Referenced by GetSpillInfo(), and SpillInfo(). |
|
|
Definition at line 15 of file SpillInfo.h. Referenced by GetSpillInfo(). |
|
|
Definition at line 21 of file SpillInfo.h. Referenced by GetSpillInfo(). |
|
|
Definition at line 23 of file SpillInfo.h. Referenced by GetSpillInfo(). |
|
|
Definition at line 17 of file SpillInfo.h. Referenced by GetSpillInfo(), and SpillInfo(). |
|
|
Definition at line 25 of file SpillInfo.h. Referenced by GetSpillInfo(). |
|
|
Definition at line 20 of file SpillInfo.h. Referenced by GetSpillInfo(). |
|
|
Definition at line 22 of file SpillInfo.h. Referenced by GetSpillInfo(). |
|
|
Definition at line 19 of file SpillInfo.h. Referenced by GetSpillInfo(). |
|
|
Definition at line 24 of file SpillInfo.h. Referenced by GetSpillInfo(). |
1.3.9.1