diff --git a/Trigger/TrigAnalysis/TrigInDetAnalysisUser/Analysis/src/ConfVtxAnalysis.cxx b/Trigger/TrigAnalysis/TrigInDetAnalysisUser/Analysis/src/ConfVtxAnalysis.cxx index 91c092b1f4678cc36c3dd8a856a16d7f6515815c..76a31e9aa5d02e2c6cf46a375a0214d7ba77b3fa 100644 --- a/Trigger/TrigAnalysis/TrigInDetAnalysisUser/Analysis/src/ConfVtxAnalysis.cxx +++ b/Trigger/TrigAnalysis/TrigInDetAnalysisUser/Analysis/src/ConfVtxAnalysis.cxx @@ -80,23 +80,23 @@ void ConfVtxAnalysis::initialise() { hnvtx = new TH1F( "nvtx", ";number of vertices", 100, -0.5, 100.5 ); - hzed = new TH1F( "zed", ";vtx z [mm]", 200, -300, 300 ); + hzed = new TH1F( "zed", ";vtx z [mm]", 200, -300, 300 ); // hntrax = new TH1F( "ntrax", ";number of tracks", 201, -0.5, 200.5 ); hntrax = new TH1F( "ntrax", ";number of tracks", 80, vnbins ); - hmu = new TH1F( "mu", ";<mu>", 81, -0.5, 80.5 ); + hmu = new TH1F( "mu", ";<mu>", 81, -0.5, 80.5 ); hlb = new TH1F( "lb", ";lumi block", 301, -0.5, 3009.5 ); - hnvtx_rec = new TH1F( "nvtx_rec", ";number of vertices", 100, -0.5, 100.5 ); - hzed_rec = new TH1F( "zed_rec", ";vtx z [mm]", 200, -300, 300 ); - hntrax_rec = new TH1F( "ntrax_rec", ";number of tracks", 80, vnbins ); + hnvtx_rec = new TH1F( "nvtx_rec", ";number of vertices", 100, -0.5, 100.5 ); + hzed_rec = new TH1F( "zed_rec", ";vtx z [mm]", 200, -300, 300 ); + hntrax_rec = new TH1F( "ntrax_rec", ";number of tracks", 80, vnbins ); hzed_res = new TH1F( "zed_res", "Delta z [mm]", 400, -10, 10 ); - rdz_vs_zed = new Resplot( "rdz_vs_zed", 100, -300, 300, 400, -20, 20 ); - rdz_vs_ntrax = new Resplot( "rdz_vs_ntrax", 201, -0.5, 200.5, 400, -20, 20 ); - rdz_vs_nvtx = new Resplot( "rdz_vs_nvtx", 81, -0.5, 80.5, 400, -20, 20 ); - rdz_vs_mu = new Resplot( "rdz_vs_mu", 30, 0, 30, 400, -20, 20 ); + rdz_vs_zed = new Resplot( "rdz_vs_zed", 100, -300, 300, 1600, -20, 20 ); + rdz_vs_ntrax = new Resplot( "rdz_vs_ntrax", 201, -0.5, 200.5, 1600, -20, 20 ); + rdz_vs_nvtx = new Resplot( "rdz_vs_nvtx", 81, -0.5, 80.5, 1600, -20, 20 ); + rdz_vs_mu = new Resplot( "rdz_vs_mu", 30, 0, 30, 1600, -20, 20 ); eff_zed = new Efficiency( hzed, "zed_eff" ); eff_ntrax = new Efficiency( hntrax, "ntrax_eff" ); @@ -106,7 +106,7 @@ void ConfVtxAnalysis::initialise() { // double ntrax[10] = { 0, 2, 5, 10, 15, 20, 30, 15, 100 }; - rdz_vs_lb = new Resplot( "rdz_vs_lb", 301, -0.5, 3009.5, 400, -20, 20 ); + rdz_vs_lb = new Resplot( "rdz_vs_lb", 301, -0.5, 3009.5, 800, -20, 20 ); rdx_vs_lb = new Resplot( "rdx_vs_lb", 301, -0.5, 3009.5, 300, -3, 3 ); rdy_vs_lb = new Resplot( "rdy_vs_lb", 301, -0.5, 3009.5, 300, -3, 3 ); diff --git a/Trigger/TrigAnalysis/TrigInDetAnalysisUser/Analysis/src/Makefile b/Trigger/TrigAnalysis/TrigInDetAnalysisUser/Analysis/src/Makefile index ba181d580c0aec429d266ea0cdedb368d99a58ba..5a8bceb92afe95c677fc3c106665e3751f16a0c1 100644 --- a/Trigger/TrigAnalysis/TrigInDetAnalysisUser/Analysis/src/Makefile +++ b/Trigger/TrigAnalysis/TrigInDetAnalysisUser/Analysis/src/Makefile @@ -32,8 +32,9 @@ endif ifeq ($(TestArea),) ATLASBASE = $(HOME)/atlas/TIDA else - ATLASBASE = $(TestArea)/Trigger/TrigAnalysis +# ATLASBASE = $(TestArea)/Trigger/TrigAnalysis # ATLASBASE = /cvmfs/atlas-nightlies.cern.ch/repo/sw/21.1-dev/2018-04-09T2234/AthenaP1/21.1.24/InstallArea/x86_64-slc6-gcc62-opt/src/Trigger/TrigAnalysis + ATLASBASE = /cvmfs/atlas-nightlies.cern.ch/repo/sw/21.1-dev/2018-05-15T2242/AthenaP1/21.1.27/InstallArea/x86_64-slc6-gcc62-opt/src/Trigger/TrigAnalysis endif CMTCONFIG= @@ -43,7 +44,6 @@ CMTCONFIG= ifeq ($(CMTCONFIG),) - # ATLAS_ARCH = $(shell ./setarch.sh) # ATLAS_ARCH = x86 @@ -67,11 +67,13 @@ ifeq ($(CMTCONFIG),) # TIDUB = $(ATLASBASE)/TrigInDetAnalysisUser/TrigInDetAnalysisUser-00-01-11 # TIDUB = ../.. # else + TID = $(ATLASBASE)/TrigInDetAnalysis - TIDU = $(ATLASBASE)/TrigInDetAnalysisUtils +# TIDU = $(ATLASBASE)/TrigInDetAnalysisUtils + TIDU = $(TestArea)/Trigger/TrigAnalysis/TrigInDetAnalysisUtils TIDE = $(ATLASBASE)/TrigInDetAnalysisExample - TIDUB = $(ATLASBASE)/TrigInDetAnalysisUser -# TIDUB = $(TestArea)/Trigger/TrigAnalysis/TrigInDetAnalysisUser +# TIDUB = $(ATLASBASE)/TrigInDetAnalysisUser + TIDUB = $(TestArea)/Trigger/TrigAnalysis/TrigInDetAnalysisUser # endif CXXFLAGS += -I$(TID) -I$(TIDU) -I$(TIDE) -fPIC diff --git a/Trigger/TrigAnalysis/TrigInDetAnalysisUser/Analysis/src/comparitor.cxx b/Trigger/TrigAnalysis/TrigInDetAnalysisUser/Analysis/src/comparitor.cxx index acdc1267cfe616fb3c1ecd0956f8576284a8c25a..a4d2e83d79b7b9095913364b0aa908f209aacfcf 100644 --- a/Trigger/TrigAnalysis/TrigInDetAnalysisUser/Analysis/src/comparitor.cxx +++ b/Trigger/TrigAnalysis/TrigInDetAnalysisUser/Analysis/src/comparitor.cxx @@ -57,7 +57,14 @@ bool fulldbg = false; /// if histogram is not found, then check for dir/name template<typename T=TH1F> -T* Get( TFile& f, const std::string& name, const std::string& dir="", std::vector<std::string>* saved=0 ) { +T* Get( TFile& f, const std::string& n, const std::string& dir="", std::vector<std::string>* saved=0 ) { + + + std::string name; + + size_t pos = n.find("+"); + if ( pos!=std::string::npos ) name = n.substr( 0, pos ); + else name = n; T* h = (T*)f.Get( name.c_str() ); if ( h || dir=="" || name.find(dir)!=std::string::npos ) { @@ -1268,7 +1275,8 @@ int main(int argc, char** argv) { if ( fulldbg ) std::cout << __LINE__ << std::endl; - if ( histo.name().find("1d")!=std::string::npos ) { + if ( histo.name().find("rdz_vs_zed")==std::string::npos && histo.name().find("1d")!=std::string::npos ) { + std::cout << "Rebinning histogram: " << histo.name() << std::endl; if ( htest->GetNbinsX()>500 ) htest->Rebin(10); if ( href && href->GetNbinsX()>500 ) href->Rebin(10); } @@ -1485,28 +1493,43 @@ int main(int argc, char** argv) { if ( contains(histo.name(),"_res") || contains(histo.name(),"residual_") || contains(histo.name(),"1d") ) residual = true; + + std::string collection = basename( chains[j] ); std::string actual_chain = basename( dirname( chains[j] ) ); - std::cout << "track collection: " << collection << std::endl; - std::cout << "actual chain: " << actual_chain << std::endl; + if ( collection.find("_InDet")!=std::string::npos ) collection.erase( 0, collection.find("_InDet")+1 ); + if ( actual_chain.find("_InDet")!=std::string::npos ) actual_chain.erase( actual_chain.find("_InDet") ); + + + std::cout << "raw: " << chains[j] << std::endl; + + std::cout << "track collection: " << collection << std::endl; + std::cout << "actual chain: " << actual_chain << std::endl; + + if ( actual_chain.find("_idperf")!=std::string::npos ) actual_chain.erase( actual_chain.find("_idperf"), 7 ); if ( actual_chain.find("_bperf")!=std::string::npos ) actual_chain.erase( actual_chain.find("_bperf"), 6 ); + if ( actual_chain.find("_boffperf")!=std::string::npos ) actual_chain.erase( actual_chain.find("_boffperf"), 9 ); if ( collection.find("_IDTrkNoCut")!=std::string::npos ) collection.erase( collection.find("_IDTrkNoCut"), 11 ); if ( collection.find("xAODCnv")!=std::string::npos ) collection.erase( collection.find("xAODCnv"), 7 ); if ( collection.find("Tracking")!=std::string::npos ) collection.replace( collection.find("Tracking"), 8, "Trk" ); - if ( collection.find("InDetTrigTrk_")!=std::string::npos ) collection.replace( collection.find("InDetTrigTrk_"), 13, "" ); - + if ( collection.find("InDetTrigTrk_")!=std::string::npos ) collection.erase( collection.find("InDetTrigTrk_"), 13 ); if ( collection.find("FTK_Track")==std::string::npos ) replace( collection, "_Tr", " : " ); std::string c = actual_chain + " : " + collection; + std::cout << "track collection: " << collection << " <-" << std::endl; + std::cout << "actual chain: " << actual_chain << " <-" << std::endl; + replace( c, "_In", " : " ); c = " " + c; + std::cout << "use label: " << c << std::endl; + /// calculate and set axis limits // std::cout << "adding plot " << histos[i] << " " << htest->GetName() << std::endl; @@ -1919,6 +1942,8 @@ int main(int argc, char** argv) { useplotname = plotname; } + useplotname.erase( std::remove( useplotname.begin(), useplotname.end(), '+' ), useplotname.end() ); + // std::string printbase = dir+"HLT_"+ppanelname+tag; std::string printbase = dir + useplotname + tag; diff --git a/Trigger/TrigAnalysis/TrigInDetAnalysisUser/Analysis/src/rmain.cxx b/Trigger/TrigAnalysis/TrigInDetAnalysisUser/Analysis/src/rmain.cxx index 8428aab681634e4c003429c44c2244e082c41377..225badee73a50e36526ec75b3f792def0011baf8 100644 --- a/Trigger/TrigAnalysis/TrigInDetAnalysisUser/Analysis/src/rmain.cxx +++ b/Trigger/TrigAnalysis/TrigInDetAnalysisUser/Analysis/src/rmain.cxx @@ -1887,14 +1887,18 @@ int main(int argc, char** argv) double dzsintheta = std::fabs( (vx.z()-tr->z0()) * std::sin(theta_) ); if( dzsintheta < 1.5 ) trackcount++; } - - vertices_roi.push_back( TIDA::Vertex( vx.x(), vx.y(), vx.z(), - vx.dx(), vx.dy(), vx.dz(), - trackcount, - vx.chi2(), vx.ndof() ) ); // ndof not valid for only Roi tracks - - // std::cout << "\t \t" << vertices_roi.back() << std::endl; - + + /// don't add vertices with no matching tracks - remember the + /// tracks are filtered by Roi already so some vertices may have + /// no tracks in the Roi - ntracks set to 0 by default + if ( trackcount>=ntracks ) { + vertices_roi.push_back( TIDA::Vertex( vx.x(), vx.y(), vx.z(), + vx.dx(), vx.dy(), vx.dz(), + trackcount, + vx.chi2(), vx.ndof() ) ); // ndof not valid for only Roi tracks + + // std::cout << "\t \t" << vertices_roi.back() << std::endl; + } } } @@ -1945,7 +1949,7 @@ int main(int argc, char** argv) // std::cout << "vertex size :" << vtxp_test.size() << "\tvertex key " << vtxanal->name() << std::endl; - vtxanal->execute( vtxp, vtxp_test, track_ev ); + if ( vtxp.size()>0 ) vtxanal->execute( vtxp, vtxp_test, track_ev ); }