NuTime Class Reference

#include <NuTime.h>

List of all members.

Public Member Functions

 NuTime ()
 ~NuTime ()
void FillTime (Int_t evTime, Float_t pot, Bool_t goodSpill)
void FillTimeHistos ()
void SetEntries (Int_t entriesIn)
void FillVsTimeHistos (const NuEvent &nu, Int_t earliestTime, Int_t latestTime, std::string sPrefix="") const
void FillVsTimeHistos2 (const NuEvent &nu, Int_t earliestTime, Int_t latestTime, std::string sPrefix="") const

Public Attributes

std::vector< Double_t > vPot
std::vector< Double_t > vTime
std::vector< Double_t > vPotBad
std::vector< Double_t > vTimeBad
std::vector< Double_t > vTimeNuMuEvt
std::vector< Double_t > vTimeNuMuBarEvt

Private Attributes

Int_t entries
Int_t startTimeSecs
Int_t endTimeSecs

Detailed Description

Definition at line 17 of file NuTime.h.


Constructor & Destructor Documentation

NuTime::NuTime (  ) 

Definition at line 26 of file NuTime.cxx.

References endTimeSecs, entries, Msg::kDebug, MSG, and startTimeSecs.

00027 {
00028   MSG("NuTime",Msg::kDebug)
00029     <<"Running NuTime Constructor..."<<endl;
00030 
00031   entries=-1;
00032   startTimeSecs=2000000000;//2 billion
00033   endTimeSecs=1;
00034 
00035   MSG("NuTime",Msg::kDebug)
00036     <<"Finished NuTime Constructor"<<endl;
00037 }

NuTime::~NuTime (  ) 

Definition at line 41 of file NuTime.cxx.

References Msg::kDebug, and MSG.

00042 {
00043   MSG("NuTime",Msg::kDebug)
00044     <<"Running NuTime Destructor..."<<endl;
00045   
00046 
00047   MSG("NuTime",Msg::kDebug)
00048     <<"Finished NuTime Destructor"<<endl;
00049 }


Member Function Documentation

void NuTime::FillTime ( Int_t  evTime,
Float_t  pot,
Bool_t  goodSpill 
)

Definition at line 68 of file NuTime.cxx.

References endTimeSecs, NuGeneral::EpochTo1995(), NuLibrary::general, NuLibrary::Instance(), Msg::kDebug, Msg::kWarning, MAXMSG, MSG, startTimeSecs, vPot, vPotBad, vTime, and vTimeBad.

Referenced by NuAnalysis::ChargeSeparationOneSnarl(), NuAnalysis::LIRejectionTest(), and NuAnalysis::MakeFullDST().

00069 {
00070   //get an instance of the code library
00071   NuLibrary& lib=NuLibrary::Instance();
00072   
00073   //get the min and max times
00074   if (evTime>endTimeSecs) endTimeSecs=evTime;
00075   if (evTime<startTimeSecs && evTime>0) startTimeSecs=evTime;
00076   if (evTime<=0) {
00077     MSG("NuTime",Msg::kWarning)<<"Bad time="<<evTime<<endl;
00078   }    
00079   
00080   //convert to 1995 time
00081   MAXMSG("NuTime",Msg::kDebug,1)
00082     <<"Filling time vector="<<evTime;
00083   lib.general.EpochTo1995(evTime);
00084   MAXMSG("NuTime",Msg::kDebug,1)
00085     <<", secs from 1995="<<evTime<<endl;
00086   
00087   if (!goodSpill) {
00088     vPotBad.push_back(pot*1e12);
00089     vTimeBad.push_back(evTime);
00090   }
00091   else {
00092     vPot.push_back(pot*1e12);
00093     vTime.push_back(evTime);
00094   }
00095 }

void NuTime::FillTimeHistos (  ) 

Definition at line 99 of file NuTime.cxx.

References endTimeSecs, NuGeneral::EpochTo1995(), NuLibrary::general, NuLibrary::Instance(), Msg::kInfo, MSG, NuGeneral::SetGraphAxis(), startTimeSecs, NuGeneral::TH1FFill(), vPot, vPotBad, vTime, vTimeBad, vTimeNuMuBarEvt, and vTimeNuMuEvt.

Referenced by NuAnalysis::StoreOrFinishTree().

00100 {
00101   //get an instance of the code library
00102   const NuLibrary& lib=NuLibrary::Instance();
00103 
00104   MSG("NuTime",Msg::kInfo)
00105     <<"Found start time and end time: "
00106     <<startTimeSecs<<" -> "<<endTimeSecs<<endl;
00107   lib.general.EpochTo1995(endTimeSecs);
00108   lib.general.EpochTo1995(startTimeSecs);
00109   
00110   MSG("NuTime",Msg::kInfo)<<"Filling X vs. Time plots..."<<endl;
00111   TH1F* hSpillsVsTime=new TH1F("hSpillsVsTime","hSpillsVsTime",
00112                                100,startTimeSecs,endTimeSecs);
00113   lib.general.TH1FFill(hSpillsVsTime,vTime);
00114   lib.general.SetGraphAxis(hSpillsVsTime->GetXaxis(),
00115                      startTimeSecs,endTimeSecs);
00116   hSpillsVsTime->GetXaxis()->CenterTitle();
00117   hSpillsVsTime->GetYaxis()->SetTitle("Spills");
00118   hSpillsVsTime->GetYaxis()->CenterTitle();
00119 
00120   TH1F* hSpillsBadVsTime=new TH1F("hSpillsBadVsTime","hSpillsBadVsTime",
00121                                   100,startTimeSecs,endTimeSecs);
00122   lib.general.TH1FFill(hSpillsBadVsTime,vTimeBad);
00123   lib.general.SetGraphAxis(hSpillsBadVsTime->GetXaxis(),
00124                      startTimeSecs,endTimeSecs);
00125   hSpillsBadVsTime->GetXaxis()->CenterTitle();
00126   hSpillsBadVsTime->GetYaxis()->SetTitle("Spills");
00127   hSpillsBadVsTime->GetYaxis()->CenterTitle();
00128   
00129   TH1F* hNuMuVsTime=new TH1F("hNuMuVsTime","hNuMuVsTime",
00130                              100,startTimeSecs,endTimeSecs);
00131   lib.general.TH1FFill(hNuMuVsTime,vTimeNuMuEvt);
00132   lib.general.SetGraphAxis(hNuMuVsTime->GetXaxis(),
00133                      startTimeSecs,endTimeSecs);
00134   hNuMuVsTime->GetXaxis()->CenterTitle();
00135   hNuMuVsTime->GetYaxis()->SetTitle("#nu_#mu events");
00136   hNuMuVsTime->GetYaxis()->CenterTitle();
00137 
00138   TH1F* hNuMuBarVsTime=new TH1F("hNuMuBarVsTime","hNuMuBarVsTime",
00139                                 100,startTimeSecs,endTimeSecs);
00140   lib.general.TH1FFill(hNuMuBarVsTime,vTimeNuMuBarEvt);
00141   lib.general.SetGraphAxis(hNuMuBarVsTime->GetXaxis(),
00142                      startTimeSecs,endTimeSecs);
00143   hNuMuBarVsTime->GetXaxis()->CenterTitle();
00144   hNuMuBarVsTime->GetYaxis()->SetTitle("#bar{#nu_#mu} events");
00145   hNuMuBarVsTime->GetYaxis()->CenterTitle();
00146 
00147   TH1F* hPotVsTime=new TH1F("hPotVsTime","hPotVsTime",
00148                             100,startTimeSecs,endTimeSecs);
00149   lib.general.TH1FFill(hPotVsTime,vTime,vPot);
00150   lib.general.SetGraphAxis(hPotVsTime->GetXaxis(),
00151                      startTimeSecs,endTimeSecs);
00152   hPotVsTime->GetXaxis()->CenterTitle();
00153   hPotVsTime->GetYaxis()->SetTitle("POT");
00154   hPotVsTime->GetYaxis()->CenterTitle();
00155 
00156   TH1F* hPotBadVsTime=new TH1F("hPotBadVsTime","hPotBadVsTime",
00157                                100,startTimeSecs,endTimeSecs);
00158   lib.general.TH1FFill(hPotBadVsTime,vTimeBad,vPotBad);
00159   lib.general.SetGraphAxis(hPotBadVsTime->GetXaxis(),
00160                      startTimeSecs,endTimeSecs);
00161   hPotBadVsTime->GetXaxis()->CenterTitle();
00162   hPotBadVsTime->GetYaxis()->SetTitle("POT");
00163   hPotBadVsTime->GetYaxis()->CenterTitle(); 
00164 }

void NuTime::FillVsTimeHistos ( const NuEvent nu,
Int_t  earliestTime,
Int_t  latestTime,
std::string  sPrefix = "" 
) const

Definition at line 168 of file NuTime.cxx.

References NuEvent::beamType, NuEvent::beamTypeDB, NuEvent::charge, NuEvent::coilCurrent, NuEvent::coilIsOk, NuEvent::coilIsReverse, NuEvent::energy, NuGeneral::EpochTo1995(), NuLibrary::general, NuEvent::goodBeam, NuEvent::goodBeamSntp, NuEvent::hornCur, NuLibrary::Instance(), Msg::kInfo, MSG, NuEvent::potSinceLastEvt, NuEvent::potSinceLastEvtBad, NuEvent::potSinceLastEvtGood, NuEvent::qp, NuGeneral::SetGraphAxis(), NuEvent::shwEn, NuEvent::timeSec, NuEvent::trkEnCurv, NuEvent::trkfitpass, NuEvent::xTrkEnd, NuEvent::xTrkVtx, NuEvent::yTrkEnd, NuEvent::yTrkVtx, NuEvent::zTrkEnd, and NuEvent::zTrkVtx.

Referenced by NuDSTAna::VsTime().

00171 {
00172   //get an instance of the code library
00173   const NuLibrary& lib=NuLibrary::Instance();
00174 
00175   static vector<std::string> vNamesTH1;  
00176   static vector<std::string> vNamesTProf;
00177   
00178   //AllQ  
00179   static vector<TH1F*> vVsTimeMonthsTH1AllQ;
00180   static vector<TH1F*> vVsTimeWeeksTH1AllQ;
00181   static vector<TH1F*> vVsTimeDaysTH1AllQ;
00182   static vector<TH1F*> vVsTimeHoursTH1AllQ;
00183 
00184   static vector<TProfile*> vVsTimeMonthsTProfAllQ;
00185   static vector<TProfile*> vVsTimeWeeksTProfAllQ;
00186   static vector<TProfile*> vVsTimeDaysTProfAllQ;
00187   static vector<TProfile*> vVsTimeHoursTProfAllQ;
00188 
00189   //PQ
00190   static vector<TH1F*> vVsTimeMonthsTH1PQ;
00191   static vector<TH1F*> vVsTimeWeeksTH1PQ;
00192   static vector<TH1F*> vVsTimeDaysTH1PQ;
00193   static vector<TH1F*> vVsTimeHoursTH1PQ;
00194 
00195   static vector<TProfile*> vVsTimeMonthsTProfPQ;
00196   static vector<TProfile*> vVsTimeWeeksTProfPQ;
00197   static vector<TProfile*> vVsTimeDaysTProfPQ;
00198   static vector<TProfile*> vVsTimeHoursTProfPQ;
00199 
00200   //NQ
00201   static vector<TH1F*> vVsTimeMonthsTH1NQ;
00202   static vector<TH1F*> vVsTimeWeeksTH1NQ;
00203   static vector<TH1F*> vVsTimeDaysTH1NQ;
00204   static vector<TH1F*> vVsTimeHoursTH1NQ;
00205 
00206   static vector<TProfile*> vVsTimeMonthsTProfNQ;
00207   static vector<TProfile*> vVsTimeWeeksTProfNQ;
00208   static vector<TProfile*> vVsTimeDaysTProfNQ;
00209   static vector<TProfile*> vVsTimeHoursTProfNQ;
00210 
00211   //cap the energy variables
00212   Float_t energy30=nu.energy;
00213   if (nu.energy>30) energy30=30;
00214   Float_t energy120=nu.energy;
00215   if (nu.energy>120) energy120=120;
00216   
00217   Float_t trkEnCurv30=nu.trkEnCurv;
00218   if (nu.trkEnCurv>30) trkEnCurv30=30;
00219   Float_t trkEnCurv120=nu.trkEnCurv;
00220   if (nu.trkEnCurv>120) trkEnCurv30=120;
00221 
00222   //create vectors to hold the variables
00223   vector<Double_t> vVariablesTH1;
00224   vector<Double_t> vVariablesTProf;
00225 
00226   //fill the TH1 variables  
00227   vVariablesTH1.push_back(1);//Evts: just a weight of one
00228   vVariablesTH1.push_back(nu.potSinceLastEvt*1e12);
00229   vVariablesTH1.push_back(nu.potSinceLastEvtGood*1e12);
00230   vVariablesTH1.push_back(nu.potSinceLastEvtBad*1e12);
00231 
00232   //fill the TProf variables  
00233   vVariablesTProf.push_back(nu.beamType);
00234   vVariablesTProf.push_back(nu.beamTypeDB);
00235   vVariablesTProf.push_back(nu.hornCur);
00236 
00237   vVariablesTProf.push_back(nu.goodBeam);
00238   vVariablesTProf.push_back(nu.goodBeamSntp);
00239   vVariablesTProf.push_back(nu.coilCurrent);
00240 
00241   vVariablesTProf.push_back(nu.coilIsOk);
00242   vVariablesTProf.push_back(nu.coilIsReverse);
00243   vVariablesTProf.push_back(nu.energy);
00244   vVariablesTProf.push_back(energy30);
00245   
00246   vVariablesTProf.push_back(energy120);
00247   vVariablesTProf.push_back(nu.trkEnCurv);
00248   vVariablesTProf.push_back(trkEnCurv30);
00249   
00250   vVariablesTProf.push_back(trkEnCurv120);
00251   vVariablesTProf.push_back(nu.shwEn);
00252   vVariablesTProf.push_back(nu.qp);
00253   
00254   vVariablesTProf.push_back(nu.trkfitpass);
00255   vVariablesTProf.push_back(nu.xTrkEnd);
00256   vVariablesTProf.push_back(nu.yTrkEnd);
00257 
00258   vVariablesTProf.push_back(nu.zTrkEnd);
00259   vVariablesTProf.push_back(nu.xTrkVtx);
00260   vVariablesTProf.push_back(nu.yTrkVtx);
00261 
00262   vVariablesTProf.push_back(nu.zTrkVtx);
00263   
00264   //create the histograms
00265   if (vVsTimeMonthsTH1PQ.size()==0) {
00266     //add all the TH1 variable names
00267     vNamesTH1.push_back("Evts");
00268     vNamesTH1.push_back("PotTotal");
00269     vNamesTH1.push_back("PotGood");
00270 
00271     vNamesTH1.push_back("PotBad");
00272 
00273     //add all the TProf variable names
00274     vNamesTProf.push_back("BeamType");
00275     vNamesTProf.push_back("BeamTypeDB");
00276     vNamesTProf.push_back("HornCur");
00277 
00278     vNamesTProf.push_back("GoodBeamDB");
00279     vNamesTProf.push_back("GoodBeamSntp");
00280     vNamesTProf.push_back("CoilCur");
00281 
00282     vNamesTProf.push_back("CoilIsOk");
00283     vNamesTProf.push_back("CoilIsReverse");
00284     vNamesTProf.push_back("RecoEn");
00285     vNamesTProf.push_back("RecoEn30");
00286 
00287     vNamesTProf.push_back("RecoEn120");
00288     vNamesTProf.push_back("TrkEnCurv");
00289     vNamesTProf.push_back("TrkEnCurv30");
00290     
00291     vNamesTProf.push_back("TrkEnCurv120");
00292     vNamesTProf.push_back("ShwEn");
00293     vNamesTProf.push_back("qp");
00294 
00295     vNamesTProf.push_back("trkfitpass");
00296     vNamesTProf.push_back("XTrkEnd");
00297     vNamesTProf.push_back("YTrkEnd");
00298 
00299     vNamesTProf.push_back("ZTrkEnd");
00300     vNamesTProf.push_back("XTrkVtx");
00301     vNamesTProf.push_back("YTrkVtx");
00302 
00303     vNamesTProf.push_back("ZTrkVtx");
00304 
00305     Int_t numMonths=static_cast<Int_t>
00306       ((latestTime-earliestTime)/(30*24*60*60))+1;
00307     Int_t numWeeks=static_cast<Int_t>
00308       ((latestTime-earliestTime)/(7*24*60*60))+1;
00309     Int_t numDays=static_cast<Int_t>
00310       ((latestTime-earliestTime)/(24*60*60))+1;
00311     Int_t numHours=static_cast<Int_t>
00312       ((latestTime-earliestTime)/(60*60))+1;
00313     
00314     MSG("NuTime",Msg::kInfo)
00315       <<"Using earliest time and latest time: "
00316       <<earliestTime<<" -> "<<latestTime
00317       <<endl
00318       <<"  #months="<<numMonths
00319       <<", weeks="<<numWeeks
00320       <<", days="<<numDays
00321       <<", hours="<<numHours<<endl;
00322     
00323     lib.general.EpochTo1995(earliestTime);
00324     lib.general.EpochTo1995(latestTime);
00325     
00326     //loop over all the TH1s to be created
00327     for (UInt_t i=0;i<vNamesTH1.size();++i) {
00328       MSG("NuTime",Msg::kInfo)
00329         <<"Creating "<<vNamesTH1[i]<<"VsTime histos..."<<endl;
00330       string s="";
00331 
00332       //AllQ
00333       s="h"+sPrefix+vNamesTH1[i]+"VsTimeMonthsAllQ";
00334       vVsTimeMonthsTH1AllQ.push_back
00335         (new TH1F(s.c_str(),s.c_str(),
00336                   numMonths,earliestTime,latestTime));
00337       lib.general.SetGraphAxis(vVsTimeMonthsTH1AllQ[i]->GetXaxis(),
00338                                earliestTime,latestTime);
00339       vVsTimeMonthsTH1AllQ[i]->GetXaxis()->CenterTitle();
00340       vVsTimeMonthsTH1AllQ[i]->GetYaxis()->SetTitle(vNamesTH1[i].c_str());
00341       vVsTimeMonthsTH1AllQ[i]->GetYaxis()->CenterTitle();
00342       
00343       s="h"+sPrefix+vNamesTH1[i]+"VsTimeWeeksAllQ";
00344       vVsTimeWeeksTH1AllQ.push_back
00345         (new TH1F(s.c_str(),s.c_str(),
00346                   numWeeks,earliestTime,latestTime));
00347       lib.general.SetGraphAxis(vVsTimeWeeksTH1AllQ[i]->GetXaxis(),
00348                                earliestTime,latestTime);
00349       vVsTimeWeeksTH1AllQ[i]->GetXaxis()->CenterTitle();
00350       vVsTimeWeeksTH1AllQ[i]->GetYaxis()->SetTitle(vNamesTH1[i].c_str());
00351       vVsTimeWeeksTH1AllQ[i]->GetYaxis()->CenterTitle();
00352 
00353       s="h"+sPrefix+vNamesTH1[i]+"VsTimeDaysAllQ";
00354       vVsTimeDaysTH1AllQ.push_back
00355         (new TH1F(s.c_str(),s.c_str(),
00356                   numDays,earliestTime,latestTime));
00357       lib.general.SetGraphAxis(vVsTimeDaysTH1AllQ[i]->GetXaxis(),
00358                                earliestTime,latestTime);
00359       vVsTimeDaysTH1AllQ[i]->GetXaxis()->CenterTitle();
00360       vVsTimeDaysTH1AllQ[i]->GetYaxis()->SetTitle(vNamesTH1[i].c_str());
00361       vVsTimeDaysTH1AllQ[i]->GetYaxis()->CenterTitle();
00362     
00363       s="h"+sPrefix+vNamesTH1[i]+"VsTimeHoursAllQ";
00364       vVsTimeHoursTH1AllQ.push_back
00365         (new TH1F(s.c_str(),s.c_str(),
00366                   numHours,earliestTime,latestTime));
00367       lib.general.SetGraphAxis(vVsTimeHoursTH1AllQ[i]->GetXaxis(),
00368                                earliestTime,latestTime);
00369       vVsTimeHoursTH1AllQ[i]->GetXaxis()->CenterTitle();
00370       vVsTimeHoursTH1AllQ[i]->GetYaxis()->SetTitle(vNamesTH1[i].c_str());
00371       vVsTimeHoursTH1AllQ[i]->GetYaxis()->CenterTitle();
00372   
00374       //PQ
00376       s="h"+sPrefix+vNamesTH1[i]+"VsTimeMonthsPQ";
00377       vVsTimeMonthsTH1PQ.push_back
00378         (new TH1F(s.c_str(),s.c_str(),
00379                   numMonths,earliestTime,latestTime));
00380       lib.general.SetGraphAxis(vVsTimeMonthsTH1PQ[i]->GetXaxis(),
00381                                earliestTime,latestTime);
00382       vVsTimeMonthsTH1PQ[i]->GetXaxis()->CenterTitle();
00383       vVsTimeMonthsTH1PQ[i]->GetYaxis()->SetTitle(vNamesTH1[i].c_str());
00384       vVsTimeMonthsTH1PQ[i]->GetYaxis()->CenterTitle();
00385       
00386       s="h"+sPrefix+vNamesTH1[i]+"VsTimeWeeksPQ";
00387       vVsTimeWeeksTH1PQ.push_back
00388         (new TH1F(s.c_str(),s.c_str(),
00389                   numWeeks,earliestTime,latestTime));
00390       lib.general.SetGraphAxis(vVsTimeWeeksTH1PQ[i]->GetXaxis(),
00391                                earliestTime,latestTime);
00392       vVsTimeWeeksTH1PQ[i]->GetXaxis()->CenterTitle();
00393       vVsTimeWeeksTH1PQ[i]->GetYaxis()->SetTitle(vNamesTH1[i].c_str());
00394       vVsTimeWeeksTH1PQ[i]->GetYaxis()->CenterTitle();
00395 
00396       s="h"+sPrefix+vNamesTH1[i]+"VsTimeDaysPQ";
00397       vVsTimeDaysTH1PQ.push_back
00398         (new TH1F(s.c_str(),s.c_str(),
00399                   numDays,earliestTime,latestTime));
00400       lib.general.SetGraphAxis(vVsTimeDaysTH1PQ[i]->GetXaxis(),
00401                                earliestTime,latestTime);
00402       vVsTimeDaysTH1PQ[i]->GetXaxis()->CenterTitle();
00403       vVsTimeDaysTH1PQ[i]->GetYaxis()->SetTitle(vNamesTH1[i].c_str());
00404       vVsTimeDaysTH1PQ[i]->GetYaxis()->CenterTitle();
00405     
00406       s="h"+sPrefix+vNamesTH1[i]+"VsTimeHoursPQ";
00407       vVsTimeHoursTH1PQ.push_back
00408         (new TH1F(s.c_str(),s.c_str(),
00409                   numHours,earliestTime,latestTime));
00410       lib.general.SetGraphAxis(vVsTimeHoursTH1PQ[i]->GetXaxis(),
00411                                earliestTime,latestTime);
00412       vVsTimeHoursTH1PQ[i]->GetXaxis()->CenterTitle();
00413       vVsTimeHoursTH1PQ[i]->GetYaxis()->SetTitle(vNamesTH1[i].c_str());
00414       vVsTimeHoursTH1PQ[i]->GetYaxis()->CenterTitle();
00415   
00417       //NQ
00419       s="h"+sPrefix+vNamesTH1[i]+"VsTimeMonthsNQ";
00420       vVsTimeMonthsTH1NQ.push_back
00421         (new TH1F(s.c_str(),s.c_str(),
00422                   numMonths,earliestTime,latestTime));
00423       lib.general.SetGraphAxis(vVsTimeMonthsTH1NQ[i]->GetXaxis(),
00424                                earliestTime,latestTime);
00425       vVsTimeMonthsTH1NQ[i]->GetXaxis()->CenterTitle();
00426       vVsTimeMonthsTH1NQ[i]->GetYaxis()->SetTitle(vNamesTH1[i].c_str());
00427       vVsTimeMonthsTH1NQ[i]->GetYaxis()->CenterTitle();
00428       
00429       s="h"+sPrefix+vNamesTH1[i]+"VsTimeWeeksNQ";
00430       vVsTimeWeeksTH1NQ.push_back
00431         (new TH1F(s.c_str(),s.c_str(),
00432                   numWeeks,earliestTime,latestTime));
00433       lib.general.SetGraphAxis(vVsTimeWeeksTH1NQ[i]->GetXaxis(),
00434                                earliestTime,latestTime);
00435       vVsTimeWeeksTH1NQ[i]->GetXaxis()->CenterTitle();
00436       vVsTimeWeeksTH1NQ[i]->GetYaxis()->SetTitle(vNamesTH1[i].c_str());
00437       vVsTimeWeeksTH1NQ[i]->GetYaxis()->CenterTitle();
00438 
00439       s="h"+sPrefix+vNamesTH1[i]+"VsTimeDaysNQ";
00440       vVsTimeDaysTH1NQ.push_back
00441         (new TH1F(s.c_str(),s.c_str(),
00442                   numDays,earliestTime,latestTime));
00443       lib.general.SetGraphAxis(vVsTimeDaysTH1NQ[i]->GetXaxis(),
00444                                earliestTime,latestTime);
00445       vVsTimeDaysTH1NQ[i]->GetXaxis()->CenterTitle();
00446       vVsTimeDaysTH1NQ[i]->GetYaxis()->SetTitle(vNamesTH1[i].c_str());
00447       vVsTimeDaysTH1NQ[i]->GetYaxis()->CenterTitle();
00448     
00449       s="h"+sPrefix+vNamesTH1[i]+"VsTimeHoursNQ";
00450       vVsTimeHoursTH1NQ.push_back
00451         (new TH1F(s.c_str(),s.c_str(),
00452                   numHours,earliestTime,latestTime));
00453       lib.general.SetGraphAxis(vVsTimeHoursTH1NQ[i]->GetXaxis(),
00454                                earliestTime,latestTime);
00455       vVsTimeHoursTH1NQ[i]->GetXaxis()->CenterTitle();
00456       vVsTimeHoursTH1NQ[i]->GetYaxis()->SetTitle(vNamesTH1[i].c_str());
00457       vVsTimeHoursTH1NQ[i]->GetYaxis()->CenterTitle();
00458     }  
00459 
00461     //loop over all the TProfiles to be created
00463     for (UInt_t i=0;i<vNamesTProf.size();++i) {
00464       MSG("NuTime",Msg::kInfo)
00465         <<"Creating "<<vNamesTProf[i]<<"VsTime TProfiles..."<<endl;
00466       string s="";
00467 
00468       //AllQ
00469       s="p"+sPrefix+vNamesTProf[i]+"VsTimeMonthsAllQ";
00470       vVsTimeMonthsTProfAllQ.push_back
00471         (new TProfile(s.c_str(),s.c_str(),
00472                   numMonths,earliestTime,latestTime));
00473       lib.general.SetGraphAxis(vVsTimeMonthsTProfAllQ[i]->GetXaxis(),
00474                                earliestTime,latestTime);
00475       vVsTimeMonthsTProfAllQ[i]->GetXaxis()->CenterTitle();
00476       vVsTimeMonthsTProfAllQ[i]->GetYaxis()->
00477         SetTitle(vNamesTProf[i].c_str());
00478       vVsTimeMonthsTProfAllQ[i]->GetYaxis()->CenterTitle();
00479       
00480       s="p"+sPrefix+vNamesTProf[i]+"VsTimeWeeksAllQ";
00481       vVsTimeWeeksTProfAllQ.push_back
00482         (new TProfile(s.c_str(),s.c_str(),
00483                   numWeeks,earliestTime,latestTime));
00484       lib.general.SetGraphAxis(vVsTimeWeeksTProfAllQ[i]->GetXaxis(),
00485                                earliestTime,latestTime);
00486       vVsTimeWeeksTProfAllQ[i]->GetXaxis()->CenterTitle();
00487       vVsTimeWeeksTProfAllQ[i]->GetYaxis()->
00488         SetTitle(vNamesTProf[i].c_str());
00489       vVsTimeWeeksTProfAllQ[i]->GetYaxis()->CenterTitle();
00490 
00491       s="p"+sPrefix+vNamesTProf[i]+"VsTimeDaysAllQ";
00492       vVsTimeDaysTProfAllQ.push_back
00493         (new TProfile(s.c_str(),s.c_str(),
00494                   numDays,earliestTime,latestTime));
00495       lib.general.SetGraphAxis(vVsTimeDaysTProfAllQ[i]->GetXaxis(),
00496                                earliestTime,latestTime);
00497       vVsTimeDaysTProfAllQ[i]->GetXaxis()->CenterTitle();
00498       vVsTimeDaysTProfAllQ[i]->GetYaxis()->
00499         SetTitle(vNamesTProf[i].c_str());
00500       vVsTimeDaysTProfAllQ[i]->GetYaxis()->CenterTitle();
00501     
00502       s="p"+sPrefix+vNamesTProf[i]+"VsTimeHoursAllQ";
00503       vVsTimeHoursTProfAllQ.push_back
00504         (new TProfile(s.c_str(),s.c_str(),
00505                   numHours,earliestTime,latestTime));
00506       lib.general.SetGraphAxis(vVsTimeHoursTProfAllQ[i]->GetXaxis(),
00507                                earliestTime,latestTime);
00508       vVsTimeHoursTProfAllQ[i]->GetXaxis()->CenterTitle();
00509       vVsTimeHoursTProfAllQ[i]->GetYaxis()->
00510         SetTitle(vNamesTProf[i].c_str());
00511       vVsTimeHoursTProfAllQ[i]->GetYaxis()->CenterTitle();
00512 
00513       //PQ
00514       s="p"+sPrefix+vNamesTProf[i]+"VsTimeMonthsPQ";
00515       vVsTimeMonthsTProfPQ.push_back
00516         (new TProfile(s.c_str(),s.c_str(),
00517                   numMonths,earliestTime,latestTime));
00518       lib.general.SetGraphAxis(vVsTimeMonthsTProfPQ[i]->GetXaxis(),
00519                                earliestTime,latestTime);
00520       vVsTimeMonthsTProfPQ[i]->GetXaxis()->CenterTitle();
00521       vVsTimeMonthsTProfPQ[i]->GetYaxis()->
00522         SetTitle(vNamesTProf[i].c_str());
00523       vVsTimeMonthsTProfPQ[i]->GetYaxis()->CenterTitle();
00524       
00525       s="p"+sPrefix+vNamesTProf[i]+"VsTimeWeeksPQ";
00526       vVsTimeWeeksTProfPQ.push_back
00527         (new TProfile(s.c_str(),s.c_str(),
00528                   numWeeks,earliestTime,latestTime));
00529       lib.general.SetGraphAxis(vVsTimeWeeksTProfPQ[i]->GetXaxis(),
00530                                earliestTime,latestTime);
00531       vVsTimeWeeksTProfPQ[i]->GetXaxis()->CenterTitle();
00532       vVsTimeWeeksTProfPQ[i]->GetYaxis()->
00533         SetTitle(vNamesTProf[i].c_str());
00534       vVsTimeWeeksTProfPQ[i]->GetYaxis()->CenterTitle();
00535 
00536       s="p"+sPrefix+vNamesTProf[i]+"VsTimeDaysPQ";
00537       vVsTimeDaysTProfPQ.push_back
00538         (new TProfile(s.c_str(),s.c_str(),
00539                   numDays,earliestTime,latestTime));
00540       lib.general.SetGraphAxis(vVsTimeDaysTProfPQ[i]->GetXaxis(),
00541                                earliestTime,latestTime);
00542       vVsTimeDaysTProfPQ[i]->GetXaxis()->CenterTitle();
00543       vVsTimeDaysTProfPQ[i]->GetYaxis()->
00544         SetTitle(vNamesTProf[i].c_str());
00545       vVsTimeDaysTProfPQ[i]->GetYaxis()->CenterTitle();
00546     
00547       s="p"+sPrefix+vNamesTProf[i]+"VsTimeHoursPQ";
00548       vVsTimeHoursTProfPQ.push_back
00549         (new TProfile(s.c_str(),s.c_str(),
00550                   numHours,earliestTime,latestTime));
00551       lib.general.SetGraphAxis(vVsTimeHoursTProfPQ[i]->GetXaxis(),
00552                                earliestTime,latestTime);
00553       vVsTimeHoursTProfPQ[i]->GetXaxis()->CenterTitle();
00554       vVsTimeHoursTProfPQ[i]->GetYaxis()->
00555         SetTitle(vNamesTProf[i].c_str());
00556       vVsTimeHoursTProfPQ[i]->GetYaxis()->CenterTitle();
00557       
00559       //NQ
00561       s="p"+sPrefix+vNamesTProf[i]+"VsTimeMonthsNQ";
00562       vVsTimeMonthsTProfNQ.push_back
00563         (new TProfile(s.c_str(),s.c_str(),
00564                   numMonths,earliestTime,latestTime));
00565       lib.general.SetGraphAxis(vVsTimeMonthsTProfNQ[i]->GetXaxis(),
00566                                earliestTime,latestTime);
00567       vVsTimeMonthsTProfNQ[i]->GetXaxis()->CenterTitle();
00568       vVsTimeMonthsTProfNQ[i]->GetYaxis()->
00569         SetTitle(vNamesTProf[i].c_str());
00570       vVsTimeMonthsTProfNQ[i]->GetYaxis()->CenterTitle();
00571       
00572       s="p"+sPrefix+vNamesTProf[i]+"VsTimeWeeksNQ";
00573       vVsTimeWeeksTProfNQ.push_back
00574         (new TProfile(s.c_str(),s.c_str(),
00575                   numWeeks,earliestTime,latestTime));
00576       lib.general.SetGraphAxis(vVsTimeWeeksTProfNQ[i]->GetXaxis(),
00577                                earliestTime,latestTime);
00578       vVsTimeWeeksTProfNQ[i]->GetXaxis()->CenterTitle();
00579       vVsTimeWeeksTProfNQ[i]->GetYaxis()->
00580         SetTitle(vNamesTProf[i].c_str());
00581       vVsTimeWeeksTProfNQ[i]->GetYaxis()->CenterTitle();
00582 
00583       s="p"+sPrefix+vNamesTProf[i]+"VsTimeDaysNQ";
00584       vVsTimeDaysTProfNQ.push_back
00585         (new TProfile(s.c_str(),s.c_str(),
00586                   numDays,earliestTime,latestTime));
00587       lib.general.SetGraphAxis(vVsTimeDaysTProfNQ[i]->GetXaxis(),
00588                                earliestTime,latestTime);
00589       vVsTimeDaysTProfNQ[i]->GetXaxis()->CenterTitle();
00590       vVsTimeDaysTProfNQ[i]->GetYaxis()->
00591         SetTitle(vNamesTProf[i].c_str());
00592       vVsTimeDaysTProfNQ[i]->GetYaxis()->CenterTitle();
00593     
00594       s="p"+sPrefix+vNamesTProf[i]+"VsTimeHoursNQ";
00595       vVsTimeHoursTProfNQ.push_back
00596         (new TProfile(s.c_str(),s.c_str(),
00597                       numHours,earliestTime,latestTime));
00598       lib.general.SetGraphAxis(vVsTimeHoursTProfNQ[i]->GetXaxis(),
00599                                earliestTime,latestTime);
00600       vVsTimeHoursTProfNQ[i]->GetXaxis()->CenterTitle();
00601       vVsTimeHoursTProfNQ[i]->GetYaxis()->
00602         SetTitle(vNamesTProf[i].c_str());
00603       vVsTimeHoursTProfNQ[i]->GetYaxis()->CenterTitle();
00604     }  
00605   }
00606   
00607   Int_t time=nu.timeSec;
00608   lib.general.EpochTo1995(time);//convert to 1995
00609   
00610   //loop over all the TH1s
00611   for (UInt_t i=0;i<vVsTimeMonthsTH1PQ.size();++i) {
00612     Double_t var=vVariablesTH1[i];
00613     
00614     vVsTimeMonthsTH1AllQ[i]->Fill(time,var);
00615     vVsTimeWeeksTH1AllQ[i]->Fill(time,var);
00616     vVsTimeDaysTH1AllQ[i]->Fill(time,var);
00617     vVsTimeHoursTH1AllQ[i]->Fill(time,var);
00618     
00619     if (nu.charge==+1) {
00620       vVsTimeMonthsTH1PQ[i]->Fill(time,var);
00621       vVsTimeWeeksTH1PQ[i]->Fill(time,var);
00622       vVsTimeDaysTH1PQ[i]->Fill(time,var);
00623       vVsTimeHoursTH1PQ[i]->Fill(time,var);
00624     }
00625     else if (nu.charge==-1){
00626       vVsTimeMonthsTH1NQ[i]->Fill(time,var);
00627       vVsTimeWeeksTH1NQ[i]->Fill(time,var);
00628       vVsTimeDaysTH1NQ[i]->Fill(time,var);
00629       vVsTimeHoursTH1NQ[i]->Fill(time,var);
00630     }
00631   }
00632   
00633   //loop over all the TProfs
00634   for (UInt_t i=0;i<vVsTimeMonthsTProfPQ.size();++i) {
00635     Double_t var=vVariablesTProf[i];
00636 
00637     vVsTimeMonthsTProfAllQ[i]->Fill(time,var);
00638     vVsTimeWeeksTProfAllQ[i]->Fill(time,var);
00639     vVsTimeDaysTProfAllQ[i]->Fill(time,var);
00640     vVsTimeHoursTProfAllQ[i]->Fill(time,var);
00641 
00642     if (nu.charge==+1) {
00643       vVsTimeMonthsTProfPQ[i]->Fill(time,var);
00644       vVsTimeWeeksTProfPQ[i]->Fill(time,var);
00645       vVsTimeDaysTProfPQ[i]->Fill(time,var);
00646       vVsTimeHoursTProfPQ[i]->Fill(time,var);
00647     }
00648     else if (nu.charge==-1){
00649       vVsTimeMonthsTProfNQ[i]->Fill(time,var);
00650       vVsTimeWeeksTProfNQ[i]->Fill(time,var);
00651       vVsTimeDaysTProfNQ[i]->Fill(time,var);
00652       vVsTimeHoursTProfNQ[i]->Fill(time,var);
00653     }
00654   }
00655 }

void NuTime::FillVsTimeHistos2 ( const NuEvent nu,
Int_t  earliestTime,
Int_t  latestTime,
std::string  sPrefix = "" 
) const

Definition at line 659 of file NuTime.cxx.

References NuEvent::beamType, NuEvent::beamTypeDB, NuEvent::charge, NuEvent::coilCurrent, NuEvent::coilIsOk, NuEvent::coilIsReverse, NuEvent::energy, NuGeneral::EpochTo1995(), NuLibrary::general, NuEvent::goodBeam, NuEvent::goodBeamSntp, NuEvent::hornCur, NuLibrary::Instance(), Msg::kInfo, MSG, NuEvent::potSinceLastEvt, NuEvent::potSinceLastEvtBad, NuEvent::potSinceLastEvtGood, NuEvent::qp, NuGeneral::SetGraphAxis(), NuEvent::shwEn, NuEvent::timeSec, NuEvent::trkEnCurv, NuEvent::trkfitpass, NuEvent::xTrkEnd, NuEvent::xTrkVtx, NuEvent::yTrkEnd, NuEvent::yTrkVtx, NuEvent::zTrkEnd, and NuEvent::zTrkVtx.

Referenced by NuDSTAna::VsTime().

00662 {
00663   //get an instance of the code library
00664   const NuLibrary& lib=NuLibrary::Instance();
00665 
00666   static vector<std::string> vNamesTH1;  
00667   static vector<std::string> vNamesTProf;
00668   
00669   //AllQ  
00670   static vector<TH1F*> vVsTimeMonthsTH1AllQ;
00671   static vector<TH1F*> vVsTimeWeeksTH1AllQ;
00672   static vector<TH1F*> vVsTimeDaysTH1AllQ;
00673   static vector<TH1F*> vVsTimeHoursTH1AllQ;
00674 
00675   static vector<TProfile*> vVsTimeMonthsTProfAllQ;
00676   static vector<TProfile*> vVsTimeWeeksTProfAllQ;
00677   static vector<TProfile*> vVsTimeDaysTProfAllQ;
00678   static vector<TProfile*> vVsTimeHoursTProfAllQ;
00679 
00680   //PQ
00681   static vector<TH1F*> vVsTimeMonthsTH1PQ;
00682   static vector<TH1F*> vVsTimeWeeksTH1PQ;
00683   static vector<TH1F*> vVsTimeDaysTH1PQ;
00684   static vector<TH1F*> vVsTimeHoursTH1PQ;
00685 
00686   static vector<TProfile*> vVsTimeMonthsTProfPQ;
00687   static vector<TProfile*> vVsTimeWeeksTProfPQ;
00688   static vector<TProfile*> vVsTimeDaysTProfPQ;
00689   static vector<TProfile*> vVsTimeHoursTProfPQ;
00690 
00691   //NQ
00692   static vector<TH1F*> vVsTimeMonthsTH1NQ;
00693   static vector<TH1F*> vVsTimeWeeksTH1NQ;
00694   static vector<TH1F*> vVsTimeDaysTH1NQ;
00695   static vector<TH1F*> vVsTimeHoursTH1NQ;
00696 
00697   static vector<TProfile*> vVsTimeMonthsTProfNQ;
00698   static vector<TProfile*> vVsTimeWeeksTProfNQ;
00699   static vector<TProfile*> vVsTimeDaysTProfNQ;
00700   static vector<TProfile*> vVsTimeHoursTProfNQ;
00701 
00702   //cap the energy variables
00703   Float_t energy30=nu.energy;
00704   if (nu.energy>30) energy30=30;
00705   Float_t energy120=nu.energy;
00706   if (nu.energy>120) energy120=120;
00707   
00708   Float_t trkEnCurv30=nu.trkEnCurv;
00709   if (nu.trkEnCurv>30) trkEnCurv30=30;
00710   Float_t trkEnCurv120=nu.trkEnCurv;
00711   if (nu.trkEnCurv>120) trkEnCurv30=120;
00712 
00713   //create vectors to hold the variables
00714   vector<Double_t> vVariablesTH1;
00715   vector<Double_t> vVariablesTProf;
00716 
00717   //fill the TH1 variables  
00718   vVariablesTH1.push_back(1);//Evts: just a weight of one
00719   vVariablesTH1.push_back(nu.potSinceLastEvt*1e12);
00720   vVariablesTH1.push_back(nu.potSinceLastEvtGood*1e12);
00721   vVariablesTH1.push_back(nu.potSinceLastEvtBad*1e12);
00722 
00723   //fill the TProf variables  
00724   vVariablesTProf.push_back(nu.beamType);
00725   vVariablesTProf.push_back(nu.beamTypeDB);
00726   vVariablesTProf.push_back(nu.hornCur);
00727 
00728   vVariablesTProf.push_back(nu.goodBeam);
00729   vVariablesTProf.push_back(nu.goodBeamSntp);
00730   vVariablesTProf.push_back(nu.coilCurrent);
00731 
00732   vVariablesTProf.push_back(nu.coilIsOk);
00733   vVariablesTProf.push_back(nu.coilIsReverse);
00734   vVariablesTProf.push_back(nu.energy);
00735   vVariablesTProf.push_back(energy30);
00736   
00737   vVariablesTProf.push_back(energy120);
00738   vVariablesTProf.push_back(nu.trkEnCurv);
00739   vVariablesTProf.push_back(trkEnCurv30);
00740   
00741   vVariablesTProf.push_back(trkEnCurv120);
00742   vVariablesTProf.push_back(nu.shwEn);
00743   vVariablesTProf.push_back(nu.qp);
00744   
00745   vVariablesTProf.push_back(nu.trkfitpass);
00746   vVariablesTProf.push_back(nu.xTrkEnd);
00747   vVariablesTProf.push_back(nu.yTrkEnd);
00748 
00749   vVariablesTProf.push_back(nu.zTrkEnd);
00750   vVariablesTProf.push_back(nu.xTrkVtx);
00751   vVariablesTProf.push_back(nu.yTrkVtx);
00752 
00753   vVariablesTProf.push_back(nu.zTrkVtx);
00754   
00755   //create the histograms
00756   if (vVsTimeMonthsTH1PQ.size()==0) {
00757     //add all the TH1 variable names
00758     vNamesTH1.push_back("Evts");
00759     vNamesTH1.push_back("PotTotal");
00760     vNamesTH1.push_back("PotGood");
00761 
00762     vNamesTH1.push_back("PotBad");
00763 
00764     //add all the TProf variable names
00765     vNamesTProf.push_back("BeamType");
00766     vNamesTProf.push_back("BeamTypeDB");
00767     vNamesTProf.push_back("HornCur");
00768 
00769     vNamesTProf.push_back("GoodBeamDB");
00770     vNamesTProf.push_back("GoodBeamSntp");
00771     vNamesTProf.push_back("CoilCur");
00772 
00773     vNamesTProf.push_back("CoilIsOk");
00774     vNamesTProf.push_back("CoilIsReverse");
00775     vNamesTProf.push_back("RecoEn");
00776     vNamesTProf.push_back("RecoEn30");
00777 
00778     vNamesTProf.push_back("RecoEn120");
00779     vNamesTProf.push_back("TrkEnCurv");
00780     vNamesTProf.push_back("TrkEnCurv30");
00781     
00782     vNamesTProf.push_back("TrkEnCurv120");
00783     vNamesTProf.push_back("ShwEn");
00784     vNamesTProf.push_back("qp");
00785 
00786     vNamesTProf.push_back("trkfitpass");
00787     vNamesTProf.push_back("XTrkEnd");
00788     vNamesTProf.push_back("YTrkEnd");
00789 
00790     vNamesTProf.push_back("ZTrkEnd");
00791     vNamesTProf.push_back("XTrkVtx");
00792     vNamesTProf.push_back("YTrkVtx");
00793 
00794     vNamesTProf.push_back("ZTrkVtx");
00795 
00796     Int_t numMonths=static_cast<Int_t>
00797       ((latestTime-earliestTime)/(30*24*60*60))+1;
00798     Int_t numWeeks=static_cast<Int_t>
00799       ((latestTime-earliestTime)/(7*24*60*60))+1;
00800     Int_t numDays=static_cast<Int_t>
00801       ((latestTime-earliestTime)/(24*60*60))+1;
00802     Int_t numHours=static_cast<Int_t>
00803       ((latestTime-earliestTime)/(60*60))+1;
00804     
00805     MSG("NuTime",Msg::kInfo)
00806       <<"Using earliest time and latest time: "
00807       <<earliestTime<<" -> "<<latestTime
00808       <<endl
00809       <<"  #months="<<numMonths
00810       <<", weeks="<<numWeeks
00811       <<", days="<<numDays
00812       <<", hours="<<numHours<<endl;
00813     
00814     lib.general.EpochTo1995(earliestTime);
00815     lib.general.EpochTo1995(latestTime);
00816     
00817     //loop over all the TH1s to be created
00818     for (UInt_t i=0;i<vNamesTH1.size();++i) {
00819       MSG("NuTime",Msg::kInfo)
00820         <<"Creating "<<vNamesTH1[i]<<"VsTime histos..."<<endl;
00821       string s="";
00822 
00823       //AllQ
00824       s="h"+sPrefix+vNamesTH1[i]+"VsTimeMonthsAllQ";
00825       vVsTimeMonthsTH1AllQ.push_back
00826         (new TH1F(s.c_str(),s.c_str(),
00827                   numMonths,earliestTime,latestTime));
00828       lib.general.SetGraphAxis(vVsTimeMonthsTH1AllQ[i]->GetXaxis(),
00829                                earliestTime,latestTime);
00830       vVsTimeMonthsTH1AllQ[i]->GetXaxis()->CenterTitle();
00831       vVsTimeMonthsTH1AllQ[i]->GetYaxis()->SetTitle(vNamesTH1[i].c_str());
00832       vVsTimeMonthsTH1AllQ[i]->GetYaxis()->CenterTitle();
00833       
00834       s="h"+sPrefix+vNamesTH1[i]+"VsTimeWeeksAllQ";
00835       vVsTimeWeeksTH1AllQ.push_back
00836         (new TH1F(s.c_str(),s.c_str(),
00837                   numWeeks,earliestTime,latestTime));
00838       lib.general.SetGraphAxis(vVsTimeWeeksTH1AllQ[i]->GetXaxis(),
00839                                earliestTime,latestTime);
00840       vVsTimeWeeksTH1AllQ[i]->GetXaxis()->CenterTitle();
00841       vVsTimeWeeksTH1AllQ[i]->GetYaxis()->SetTitle(vNamesTH1[i].c_str());
00842       vVsTimeWeeksTH1AllQ[i]->GetYaxis()->CenterTitle();
00843 
00844       s="h"+sPrefix+vNamesTH1[i]+"VsTimeDaysAllQ";
00845       vVsTimeDaysTH1AllQ.push_back
00846         (new TH1F(s.c_str(),s.c_str(),
00847                   numDays,earliestTime,latestTime));
00848       lib.general.SetGraphAxis(vVsTimeDaysTH1AllQ[i]->GetXaxis(),
00849                                earliestTime,latestTime);
00850       vVsTimeDaysTH1AllQ[i]->GetXaxis()->CenterTitle();
00851       vVsTimeDaysTH1AllQ[i]->GetYaxis()->SetTitle(vNamesTH1[i].c_str());
00852       vVsTimeDaysTH1AllQ[i]->GetYaxis()->CenterTitle();
00853     
00854       s="h"+sPrefix+vNamesTH1[i]+"VsTimeHoursAllQ";
00855       vVsTimeHoursTH1AllQ.push_back
00856         (new TH1F(s.c_str(),s.c_str(),
00857                   numHours,earliestTime,latestTime));
00858       lib.general.SetGraphAxis(vVsTimeHoursTH1AllQ[i]->GetXaxis(),
00859                                earliestTime,latestTime);
00860       vVsTimeHoursTH1AllQ[i]->GetXaxis()->CenterTitle();
00861       vVsTimeHoursTH1AllQ[i]->GetYaxis()->SetTitle(vNamesTH1[i].c_str());
00862       vVsTimeHoursTH1AllQ[i]->GetYaxis()->CenterTitle();
00863   
00865       //PQ
00867       s="h"+sPrefix+vNamesTH1[i]+"VsTimeMonthsPQ";
00868       vVsTimeMonthsTH1PQ.push_back
00869         (new TH1F(s.c_str(),s.c_str(),
00870                   numMonths,earliestTime,latestTime));
00871       lib.general.SetGraphAxis(vVsTimeMonthsTH1PQ[i]->GetXaxis(),
00872                                earliestTime,latestTime);
00873       vVsTimeMonthsTH1PQ[i]->GetXaxis()->CenterTitle();
00874       vVsTimeMonthsTH1PQ[i]->GetYaxis()->SetTitle(vNamesTH1[i].c_str());
00875       vVsTimeMonthsTH1PQ[i]->GetYaxis()->CenterTitle();
00876       
00877       s="h"+sPrefix+vNamesTH1[i]+"VsTimeWeeksPQ";
00878       vVsTimeWeeksTH1PQ.push_back
00879         (new TH1F(s.c_str(),s.c_str(),
00880                   numWeeks,earliestTime,latestTime));
00881       lib.general.SetGraphAxis(vVsTimeWeeksTH1PQ[i]->GetXaxis(),
00882                                earliestTime,latestTime);
00883       vVsTimeWeeksTH1PQ[i]->GetXaxis()->CenterTitle();
00884       vVsTimeWeeksTH1PQ[i]->GetYaxis()->SetTitle(vNamesTH1[i].c_str());
00885       vVsTimeWeeksTH1PQ[i]->GetYaxis()->CenterTitle();
00886 
00887       s="h"+sPrefix+vNamesTH1[i]+"VsTimeDaysPQ";
00888       vVsTimeDaysTH1PQ.push_back
00889         (new TH1F(s.c_str(),s.c_str(),
00890                   numDays,earliestTime,latestTime));
00891       lib.general.SetGraphAxis(vVsTimeDaysTH1PQ[i]->GetXaxis(),
00892                                earliestTime,latestTime);
00893       vVsTimeDaysTH1PQ[i]->GetXaxis()->CenterTitle();
00894       vVsTimeDaysTH1PQ[i]->GetYaxis()->SetTitle(vNamesTH1[i].c_str());
00895       vVsTimeDaysTH1PQ[i]->GetYaxis()->CenterTitle();
00896     
00897       s="h"+sPrefix+vNamesTH1[i]+"VsTimeHoursPQ";
00898       vVsTimeHoursTH1PQ.push_back
00899         (new TH1F(s.c_str(),s.c_str(),
00900                   numHours,earliestTime,latestTime));
00901       lib.general.SetGraphAxis(vVsTimeHoursTH1PQ[i]->GetXaxis(),
00902                                earliestTime,latestTime);
00903       vVsTimeHoursTH1PQ[i]->GetXaxis()->CenterTitle();
00904       vVsTimeHoursTH1PQ[i]->GetYaxis()->SetTitle(vNamesTH1[i].c_str());
00905       vVsTimeHoursTH1PQ[i]->GetYaxis()->CenterTitle();
00906   
00908       //NQ
00910       s="h"+sPrefix+vNamesTH1[i]+"VsTimeMonthsNQ";
00911       vVsTimeMonthsTH1NQ.push_back
00912         (new TH1F(s.c_str(),s.c_str(),
00913                   numMonths,earliestTime,latestTime));
00914       lib.general.SetGraphAxis(vVsTimeMonthsTH1NQ[i]->GetXaxis(),
00915                                earliestTime,latestTime);
00916       vVsTimeMonthsTH1NQ[i]->GetXaxis()->CenterTitle();
00917       vVsTimeMonthsTH1NQ[i]->GetYaxis()->SetTitle(vNamesTH1[i].c_str());
00918       vVsTimeMonthsTH1NQ[i]->GetYaxis()->CenterTitle();
00919       
00920       s="h"+sPrefix+vNamesTH1[i]+"VsTimeWeeksNQ";
00921       vVsTimeWeeksTH1NQ.push_back
00922         (new TH1F(s.c_str(),s.c_str(),
00923                   numWeeks,earliestTime,latestTime));
00924       lib.general.SetGraphAxis(vVsTimeWeeksTH1NQ[i]->GetXaxis(),
00925                                earliestTime,latestTime);
00926       vVsTimeWeeksTH1NQ[i]->GetXaxis()->CenterTitle();
00927       vVsTimeWeeksTH1NQ[i]->GetYaxis()->SetTitle(vNamesTH1[i].c_str());
00928       vVsTimeWeeksTH1NQ[i]->GetYaxis()->CenterTitle();
00929 
00930       s="h"+sPrefix+vNamesTH1[i]+"VsTimeDaysNQ";
00931       vVsTimeDaysTH1NQ.push_back
00932         (new TH1F(s.c_str(),s.c_str(),
00933                   numDays,earliestTime,latestTime));
00934       lib.general.SetGraphAxis(vVsTimeDaysTH1NQ[i]->GetXaxis(),
00935                                earliestTime,latestTime);
00936       vVsTimeDaysTH1NQ[i]->GetXaxis()->CenterTitle();
00937       vVsTimeDaysTH1NQ[i]->GetYaxis()->SetTitle(vNamesTH1[i].c_str());
00938       vVsTimeDaysTH1NQ[i]->GetYaxis()->CenterTitle();
00939     
00940       s="h"+sPrefix+vNamesTH1[i]+"VsTimeHoursNQ";
00941       vVsTimeHoursTH1NQ.push_back
00942         (new TH1F(s.c_str(),s.c_str(),
00943                   numHours,earliestTime,latestTime));
00944       lib.general.SetGraphAxis(vVsTimeHoursTH1NQ[i]->GetXaxis(),
00945                                earliestTime,latestTime);
00946       vVsTimeHoursTH1NQ[i]->GetXaxis()->CenterTitle();
00947       vVsTimeHoursTH1NQ[i]->GetYaxis()->SetTitle(vNamesTH1[i].c_str());
00948       vVsTimeHoursTH1NQ[i]->GetYaxis()->CenterTitle();
00949     }  
00950 
00952     //loop over all the TProfiles to be created
00954     for (UInt_t i=0;i<vNamesTProf.size();++i) {
00955       MSG("NuTime",Msg::kInfo)
00956         <<"Creating "<<vNamesTProf[i]<<"VsTime TProfiles..."<<endl;
00957       string s="";
00958 
00959       //AllQ
00960       s="p"+sPrefix+vNamesTProf[i]+"VsTimeMonthsAllQ";
00961       vVsTimeMonthsTProfAllQ.push_back
00962         (new TProfile(s.c_str(),s.c_str(),
00963                   numMonths,earliestTime,latestTime));
00964       lib.general.SetGraphAxis(vVsTimeMonthsTProfAllQ[i]->GetXaxis(),
00965                                earliestTime,latestTime);
00966       vVsTimeMonthsTProfAllQ[i]->GetXaxis()->CenterTitle();
00967       vVsTimeMonthsTProfAllQ[i]->GetYaxis()->
00968         SetTitle(vNamesTProf[i].c_str());
00969       vVsTimeMonthsTProfAllQ[i]->GetYaxis()->CenterTitle();
00970       
00971       s="p"+sPrefix+vNamesTProf[i]+"VsTimeWeeksAllQ";
00972       vVsTimeWeeksTProfAllQ.push_back
00973         (new TProfile(s.c_str(),s.c_str(),
00974                   numWeeks,earliestTime,latestTime));
00975       lib.general.SetGraphAxis(vVsTimeWeeksTProfAllQ[i]->GetXaxis(),
00976                                earliestTime,latestTime);
00977       vVsTimeWeeksTProfAllQ[i]->GetXaxis()->CenterTitle();
00978       vVsTimeWeeksTProfAllQ[i]->GetYaxis()->
00979         SetTitle(vNamesTProf[i].c_str());
00980       vVsTimeWeeksTProfAllQ[i]->GetYaxis()->CenterTitle();
00981 
00982       s="p"+sPrefix+vNamesTProf[i]+"VsTimeDaysAllQ";
00983       vVsTimeDaysTProfAllQ.push_back
00984         (new TProfile(s.c_str(),s.c_str(),
00985                   numDays,earliestTime,latestTime));
00986       lib.general.SetGraphAxis(vVsTimeDaysTProfAllQ[i]->GetXaxis(),
00987                                earliestTime,latestTime);
00988       vVsTimeDaysTProfAllQ[i]->GetXaxis()->CenterTitle();
00989       vVsTimeDaysTProfAllQ[i]->GetYaxis()->
00990         SetTitle(vNamesTProf[i].c_str());
00991       vVsTimeDaysTProfAllQ[i]->GetYaxis()->CenterTitle();
00992     
00993       s="p"+sPrefix+vNamesTProf[i]+"VsTimeHoursAllQ";
00994       vVsTimeHoursTProfAllQ.push_back
00995         (new TProfile(s.c_str(),s.c_str(),
00996                   numHours,earliestTime,latestTime));
00997       lib.general.SetGraphAxis(vVsTimeHoursTProfAllQ[i]->GetXaxis(),
00998                                earliestTime,latestTime);
00999       vVsTimeHoursTProfAllQ[i]->GetXaxis()->CenterTitle();
01000       vVsTimeHoursTProfAllQ[i]->GetYaxis()->
01001         SetTitle(vNamesTProf[i].c_str());
01002       vVsTimeHoursTProfAllQ[i]->GetYaxis()->CenterTitle();
01003 
01004       //PQ
01005       s="p"+sPrefix+vNamesTProf[i]+"VsTimeMonthsPQ";
01006       vVsTimeMonthsTProfPQ.push_back
01007         (new TProfile(s.c_str(),s.c_str(),
01008                   numMonths,earliestTime,latestTime));
01009       lib.general.SetGraphAxis(vVsTimeMonthsTProfPQ[i]->GetXaxis(),
01010                                earliestTime,latestTime);
01011       vVsTimeMonthsTProfPQ[i]->GetXaxis()->CenterTitle();
01012       vVsTimeMonthsTProfPQ[i]->GetYaxis()->
01013         SetTitle(vNamesTProf[i].c_str());
01014       vVsTimeMonthsTProfPQ[i]->GetYaxis()->CenterTitle();
01015       
01016       s="p"+sPrefix+vNamesTProf[i]+"VsTimeWeeksPQ";
01017       vVsTimeWeeksTProfPQ.push_back
01018         (new TProfile(s.c_str(),s.c_str(),
01019                   numWeeks,earliestTime,latestTime));
01020       lib.general.SetGraphAxis(vVsTimeWeeksTProfPQ[i]->GetXaxis(),
01021                                earliestTime,latestTime);
01022       vVsTimeWeeksTProfPQ[i]->GetXaxis()->CenterTitle();
01023       vVsTimeWeeksTProfPQ[i]->GetYaxis()->
01024         SetTitle(vNamesTProf[i].c_str());
01025       vVsTimeWeeksTProfPQ[i]->GetYaxis()->CenterTitle();
01026 
01027       s="p"+sPrefix+vNamesTProf[i]+"VsTimeDaysPQ";
01028       vVsTimeDaysTProfPQ.push_back
01029         (new TProfile(s.c_str(),s.c_str(),
01030                   numDays,earliestTime,latestTime));
01031       lib.general.SetGraphAxis(vVsTimeDaysTProfPQ[i]->GetXaxis(),
01032                                earliestTime,latestTime);
01033       vVsTimeDaysTProfPQ[i]->GetXaxis()->CenterTitle();
01034       vVsTimeDaysTProfPQ[i]->GetYaxis()->
01035         SetTitle(vNamesTProf[i].c_str());
01036       vVsTimeDaysTProfPQ[i]->GetYaxis()->CenterTitle();
01037     
01038       s="p"+sPrefix+vNamesTProf[i]+"VsTimeHoursPQ";
01039       vVsTimeHoursTProfPQ.push_back
01040         (new TProfile(s.c_str(),s.c_str(),
01041                   numHours,earliestTime,latestTime));
01042       lib.general.SetGraphAxis(vVsTimeHoursTProfPQ[i]->GetXaxis(),
01043                                earliestTime,latestTime);
01044       vVsTimeHoursTProfPQ[i]->GetXaxis()->CenterTitle();
01045       vVsTimeHoursTProfPQ[i]->GetYaxis()->
01046         SetTitle(vNamesTProf[i].c_str());
01047       vVsTimeHoursTProfPQ[i]->GetYaxis()->CenterTitle();
01048       
01050       //NQ
01052       s="p"+sPrefix+vNamesTProf[i]+"VsTimeMonthsNQ";
01053       vVsTimeMonthsTProfNQ.push_back
01054         (new TProfile(s.c_str(),s.c_str(),
01055                   numMonths,earliestTime,latestTime));
01056       lib.general.SetGraphAxis(vVsTimeMonthsTProfNQ[i]->GetXaxis(),
01057                                earliestTime,latestTime);
01058       vVsTimeMonthsTProfNQ[i]->GetXaxis()->CenterTitle();
01059       vVsTimeMonthsTProfNQ[i]->GetYaxis()->
01060         SetTitle(vNamesTProf[i].c_str());
01061       vVsTimeMonthsTProfNQ[i]->GetYaxis()->CenterTitle();
01062       
01063       s="p"+sPrefix+vNamesTProf[i]+"VsTimeWeeksNQ";
01064       vVsTimeWeeksTProfNQ.push_back
01065         (new TProfile(s.c_str(),s.c_str(),
01066                   numWeeks,earliestTime,latestTime));
01067       lib.general.SetGraphAxis(vVsTimeWeeksTProfNQ[i]->GetXaxis(),
01068                                earliestTime,latestTime);
01069       vVsTimeWeeksTProfNQ[i]->GetXaxis()->CenterTitle();
01070       vVsTimeWeeksTProfNQ[i]->GetYaxis()->
01071         SetTitle(vNamesTProf[i].c_str());
01072       vVsTimeWeeksTProfNQ[i]->GetYaxis()->CenterTitle();
01073 
01074       s="p"+sPrefix+vNamesTProf[i]+"VsTimeDaysNQ";
01075       vVsTimeDaysTProfNQ.push_back
01076         (new TProfile(s.c_str(),s.c_str(),
01077                   numDays,earliestTime,latestTime));
01078       lib.general.SetGraphAxis(vVsTimeDaysTProfNQ[i]->GetXaxis(),
01079                                earliestTime,latestTime);
01080       vVsTimeDaysTProfNQ[i]->GetXaxis()->CenterTitle();
01081       vVsTimeDaysTProfNQ[i]->GetYaxis()->
01082         SetTitle(vNamesTProf[i].c_str());
01083       vVsTimeDaysTProfNQ[i]->GetYaxis()->CenterTitle();
01084     
01085       s="p"+sPrefix+vNamesTProf[i]+"VsTimeHoursNQ";
01086       vVsTimeHoursTProfNQ.push_back
01087         (new TProfile(s.c_str(),s.c_str(),
01088                       numHours,earliestTime,latestTime));
01089       lib.general.SetGraphAxis(vVsTimeHoursTProfNQ[i]->GetXaxis(),
01090                                earliestTime,latestTime);
01091       vVsTimeHoursTProfNQ[i]->GetXaxis()->CenterTitle();
01092       vVsTimeHoursTProfNQ[i]->GetYaxis()->
01093         SetTitle(vNamesTProf[i].c_str());
01094       vVsTimeHoursTProfNQ[i]->GetYaxis()->CenterTitle();
01095     }  
01096   }
01097   
01098   Int_t time=nu.timeSec;
01099   lib.general.EpochTo1995(time);//convert to 1995
01100   
01101   //loop over all the TH1s
01102   for (UInt_t i=0;i<vVsTimeMonthsTH1PQ.size();++i) {
01103     Double_t var=vVariablesTH1[i];
01104     
01105     vVsTimeMonthsTH1AllQ[i]->Fill(time,var);
01106     vVsTimeWeeksTH1AllQ[i]->Fill(time,var);
01107     vVsTimeDaysTH1AllQ[i]->Fill(time,var);
01108     vVsTimeHoursTH1AllQ[i]->Fill(time,var);
01109     
01110     if (nu.charge==+1) {
01111       vVsTimeMonthsTH1PQ[i]->Fill(time,var);
01112       vVsTimeWeeksTH1PQ[i]->Fill(time,var);
01113       vVsTimeDaysTH1PQ[i]->Fill(time,var);
01114       vVsTimeHoursTH1PQ[i]->Fill(time,var);
01115     }
01116     else if (nu.charge==-1){
01117       vVsTimeMonthsTH1NQ[i]->Fill(time,var);
01118       vVsTimeWeeksTH1NQ[i]->Fill(time,var);
01119       vVsTimeDaysTH1NQ[i]->Fill(time,var);
01120       vVsTimeHoursTH1NQ[i]->Fill(time,var);
01121     }
01122   }
01123   
01124   //loop over all the TProfs
01125   for (UInt_t i=0;i<vVsTimeMonthsTProfPQ.size();++i) {
01126     Double_t var=vVariablesTProf[i];
01127 
01128     vVsTimeMonthsTProfAllQ[i]->Fill(time,var);
01129     vVsTimeWeeksTProfAllQ[i]->Fill(time,var);
01130     vVsTimeDaysTProfAllQ[i]->Fill(time,var);
01131     vVsTimeHoursTProfAllQ[i]->Fill(time,var);
01132 
01133     if (nu.charge==+1) {
01134       vVsTimeMonthsTProfPQ[i]->Fill(time,var);
01135       vVsTimeWeeksTProfPQ[i]->Fill(time,var);
01136       vVsTimeDaysTProfPQ[i]->Fill(time,var);
01137       vVsTimeHoursTProfPQ[i]->Fill(time,var);
01138     }
01139     else if (nu.charge==-1){
01140       vVsTimeMonthsTProfNQ[i]->Fill(time,var);
01141       vVsTimeWeeksTProfNQ[i]->Fill(time,var);
01142       vVsTimeDaysTProfNQ[i]->Fill(time,var);
01143       vVsTimeHoursTProfNQ[i]->Fill(time,var);
01144     }
01145   }
01146 }

void NuTime::SetEntries ( Int_t  entriesIn  ) 

Definition at line 53 of file NuTime.cxx.

References entries, vPot, vPotBad, vTime, vTimeBad, vTimeNuMuBarEvt, and vTimeNuMuEvt.

00054 {
00055   entries=entriesIn;
00056   
00057   vPot.reserve(entries);
00058   vTime.reserve(entries);
00059   vPotBad.reserve(entries/10);
00060   vTimeBad.reserve(entries/10);
00061   
00062   vTimeNuMuEvt.reserve(entries/5);
00063   vTimeNuMuBarEvt.reserve(entries/5);
00064 }


Member Data Documentation

Int_t NuTime::endTimeSecs [private]

Definition at line 46 of file NuTime.h.

Referenced by FillTime(), FillTimeHistos(), and NuTime().

Int_t NuTime::entries [private]

Definition at line 44 of file NuTime.h.

Referenced by NuTime(), and SetEntries().

Int_t NuTime::startTimeSecs [private]

Definition at line 45 of file NuTime.h.

Referenced by FillTime(), FillTimeHistos(), and NuTime().

std::vector<Double_t> NuTime::vPot

Definition at line 34 of file NuTime.h.

Referenced by FillTime(), FillTimeHistos(), and SetEntries().

std::vector<Double_t> NuTime::vPotBad

Definition at line 36 of file NuTime.h.

Referenced by FillTime(), FillTimeHistos(), and SetEntries().

std::vector<Double_t> NuTime::vTime

Definition at line 35 of file NuTime.h.

Referenced by FillTime(), FillTimeHistos(), and SetEntries().

std::vector<Double_t> NuTime::vTimeBad

Definition at line 37 of file NuTime.h.

Referenced by FillTime(), FillTimeHistos(), and SetEntries().

std::vector<Double_t> NuTime::vTimeNuMuBarEvt

Definition at line 40 of file NuTime.h.

Referenced by NuAnalysis::ChargeSeparationOneSnarl(), FillTimeHistos(), and SetEntries().

std::vector<Double_t> NuTime::vTimeNuMuEvt

Definition at line 39 of file NuTime.h.

Referenced by NuAnalysis::ChargeSeparationOneSnarl(), FillTimeHistos(), and SetEntries().


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

Generated on 2 Nov 2017 for loon by  doxygen 1.6.1