2222// pLow and pHigh and save the canvases
2323//
2424// .L CalibPlotProperties.C+g
25- // CalibSplit c1(fname, dirname, outFileName, pmin, pmax, debug);
25+ // CalibSplit c1(fname, dirname, outFileName, pmin, pmax, runMin, runMax, debug);
2626// c1.Loop(nentries);
2727//
2828// This will split the tree and keep for tacks with momenta between
138138// outFileName (std::string)= name of the file containing saved tree
139139// pmin (double) = minimum track momentum (40.0)
140140// pmax (double) = maximum track momentum (60.0)
141+ // runMin (int) = minimum run number (-1) | if -1, no check on
142+ // runMax (int) = maximum run number (-1) | run number not done
141143// debug (bool) = debug flag (false)
142144//////////////////////////////////////////////////////////////////////////////
143145#include <TROOT.h>
@@ -1812,6 +1814,8 @@ public:
18121814 const std ::string & outFileName ,
18131815 double pmin = 40.0 ,
18141816 double pmax = 60.0 ,
1817+ int runMin = -1 ,
1818+ int runMax = -1 ,
18151819 bool debug = false);
18161820 virtual ~CalibSplit ();
18171821 virtual Int_t Cut (Long64_t entry );
@@ -1827,23 +1831,34 @@ public:
18271831private :
18281832 const std ::string fname_ , dirnm_ , outFileName_ ;
18291833 const double pmin_ , pmax_ ;
1834+ const int runMin_ , runMax_ ;
18301835 const bool debug_ ;
1836+ bool checkRun_ ;
18311837 TFile * outputFile_ ;
18321838 TDirectoryFile * outputDir_ ;
18331839 TTree * outputTree_ ;
18341840};
18351841
1836- CalibSplit ::CalibSplit (
1837- const char * fname , const std ::string & dirnm , const std ::string & outFileName , double pmin , double pmax , bool debug )
1842+ CalibSplit ::CalibSplit (const char * fname ,
1843+ const std ::string & dirnm ,
1844+ const std ::string & outFileName ,
1845+ double pmin ,
1846+ double pmax ,
1847+ int runMin ,
1848+ int runMax ,
1849+ bool debug )
18381850 : fname_ (fname ),
18391851 dirnm_ (dirnm ),
18401852 outFileName_ (outFileName ),
18411853 pmin_ (pmin ),
18421854 pmax_ (pmax ),
1855+ runMin_ (runMin ),
1856+ runMax_ (runMax ),
18431857 debug_ (debug ),
18441858 outputFile_ (nullptr ),
18451859 outputDir_ (nullptr ),
18461860 outputTree_ (nullptr ) {
1861+ checkRun_ = ((runMin_ < 0 ) || (runMax_ < 0 )) ? false : true;
18471862 char treeName [400 ];
18481863 sprintf (treeName , "%s/CalibTree" , dirnm .c_str ());
18491864 TChain * chain = new TChain (treeName );
@@ -2075,6 +2090,10 @@ void CalibSplit::Loop(Long64_t nentries) {
20752090 std ::cout << "Entry " << jentry << " Run " << t_Run << " Event " << t_Event << std ::endl ;
20762091 ++ kount ;
20772092 bool select = ((t_p >= pmin_ ) && (t_p < pmax_ ));
2093+ if (select && checkRun_ ) {
2094+ if ((t_Run < runMin_ ) || (t_Run > runMax_ ))
2095+ select = false;
2096+ }
20782097 if (!select ) {
20792098 ++ reject ;
20802099 if (debug_ )
0 commit comments