diff --git a/macros/CCEScan/deplTool.h b/macros/CCEScan/deplTool.h index 2051235..9f4528c 100755 --- a/macros/CCEScan/deplTool.h +++ b/macros/CCEScan/deplTool.h @@ -15,16 +15,50 @@ #include "TROOT.h" #include "TSpline.h" +#include "../../include/incBasicROOT.h" + namespace STTool { + // Cut on tracks - TCut cu_track_TT("(TrChi2/TrNDoF<3.0) &&" - "(GhostP<0.01+0.1/1.6*TrChi2/TrNDoF) &&" - "(GhostP<0.01-0.1/3.4*(TrChi2/TrNDoF-5.0))"); - TCut cu_track_IT("(GhostP<0.1*TrChi2/TrNDoF) &&" - "(GhostP<0.2-0.1*(TrChi2/TrNDoF-5.0))"); + static TCut get_track_selection(TString det, int fill){ + // Selection from Christian, based on S/N + TCut cu_track_TT_run1("(TrChi2/TrNDoF<3.0) &&" + "(GhostP<0.01+0.1/1.6*TrChi2/TrNDoF) &&" + "(GhostP<0.01-0.1/3.4*(TrChi2/TrNDoF-5.0))"); + TCut cu_track_IT_run1("(GhostP<0.1*TrChi2/TrNDoF) &&" + "(GhostP<0.2-0.1*(TrChi2/TrNDoF-5.0))"); + // Selection from Elena, based on S/sqrt(N) and S/sqrt(S+N) + TCut sel_TT_from3479("((((TrChi2/TrNDoF)*TMath::Cos(0.0261799387799) " + "-GhostP*TMath::Sin(0.0261799387799)-1.35)^2/1.1^2 " + "+ (GhostP*TMath::Cos(0.0261799387799) " + "-(TrChi2/TrNDoF)*TMath::Sin(0.0261799387799)-0.04)^2/0.08^2) < 1.)"); + //TCut sel_TT_from2252("((((TrChi2/TrNDoF)*TMath::Cos(0.0471238898038) " + // "-GhostP*TMath::Sin(0.0471238898038)-1.26)^2/1.0^2 " + // "+ (GhostP*TMath::Cos(0.0471238898038) " + // "-(TrChi2/TrNDoF)*TMath::Sin(0.0471238898038)-0.04)^2/0.07^2) < 1.)"); + //TCut sel_TT_from2084("((((TrChi2/TrNDoF)*TMath::Cos(0.0872664625997) " + // "-GhostP*TMath::Sin(0.0872664625997)-1.15)^2/1.0^2 " + // "+ (GhostP*TMath::Cos(0.0872664625997) " + // "-(TrChi2/TrNDoF)*TMath::Sin(0.0872664625997)-0.05)^2/0.1^2) < 1.)"); + //TCut sel_TT_from0001("((((TrChi2/TrNDoF)*TMath::Cos(0.0715584993318) " + // "-GhostP*TMath::Sin(0.0715584993318)-1.3)^2/1.4^2 " + // "+ (GhostP*TMath::Cos(0.0715584993318) " + // "-(TrChi2/TrNDoF)*TMath::Sin(0.0715584993318)-0.05)^2/0.11^2) < 1.)") + if (det.EqualTo("TT")) { + if (fill <= 3478) { + return cu_track_TT_run1; + } + else { + return sel_TT_from3479; + } + } + else { + return cu_track_IT_run1; + } + } // Define first run of fill static std::map zeroRunOfFill(){ diff --git a/macros/CCEScan/landauFit.C b/macros/CCEScan/landauFit.C index a6b322c..e6268e0 100755 --- a/macros/CCEScan/landauFit.C +++ b/macros/CCEScan/landauFit.C @@ -261,10 +261,11 @@ } // Select tracks based on their chi^2 and ghost prob - TCut cu_sel = STTool::cu_track_TT; - if (strcmp(det.Data(),"TT")==0) { - cu_sel = STTool::cu_track_IT; - } + //TCut cu_sel = STTool::cu_track_TT; + //if (strcmp(det.Data(),"TT")==0) { + // cu_sel = STTool::cu_track_IT; + //} + TCut cu_sel = STTool::get_track_selection(det, fill); // Get full selection for signal tracks/hits including radius TCut cu_sig = cu_bkg && cu_sel && TCut(Form("(TMath::Sqrt(xHit*xHit+yHit*yHit)<%f)",radius));