Commit 3585d12f authored by Ligang Xia's avatar Ligang Xia
Browse files

update ps_rerun_list

parents fabe909a fb71feb5
Pipeline #690739 passed with stage
in 0 seconds
......@@ -98,15 +98,15 @@ def handiWithComparisons( name, resultsFile, htmlDir, runlistLoc, compare, brows
if (browserMenu):
makeAllDirsXml( htmlDir, name, s, number, resultsFile)
list, namelist = makeAllDirsBrowserFile( htmlDir, name, s, number, resultsFile,allDirsScriptDir)
dirlist, namelist = makeAllDirsBrowserFile( htmlDir, name, s, number, resultsFile,allDirsScriptDir )
else:
list, namelist = makeAllDirsFile( htmlDir, name, s, number, resultsFile)
dirlist, namelist = makeAllDirsFile( htmlDir, name, s, number, resultsFile )
for x in range(0,len(list)):
makeSubDirFile( htmlDir, name, s, number, namelist[x], list[x], runlistLoc, compare, allDirsScriptDir,jsRoot)
makeColorFile( htmlDir, name, s, number, namelist[x], list[x], 'Red', runlistLoc, compare, allDirsScriptDir,jsRoot)
makeColorFile( htmlDir, name, s, number, namelist[x], list[x], 'Yellow', runlistLoc, compare, allDirsScriptDir,jsRoot)
makeColorFile( htmlDir, name, s, number, namelist[x], list[x], 'Green', runlistLoc, compare, allDirsScriptDir,jsRoot)
for x in range(0,len(dirlist)):
makeSubDirFile( htmlDir, name, s, number, namelist[x], dirlist[x], runlistLoc, compare, allDirsScriptDir, jsRoot )
makeColorFile( htmlDir, name, s, number, namelist[x], dirlist[x], 'Red', runlistLoc, compare, allDirsScriptDir, jsRoot )
makeColorFile( htmlDir, name, s, number, namelist[x], dirlist[x], 'Yellow', runlistLoc, compare, allDirsScriptDir, jsRoot )
makeColorFile( htmlDir, name, s, number, namelist[x], dirlist[x], 'Green', runlistLoc, compare, allDirsScriptDir, jsRoot )
makeCSSFile( htmlDir,"", namelist[x] )
makeCSSFile( htmlDir,"", "." )
......@@ -186,8 +186,8 @@ def makeAllDirsFile( htmlDir, name, s, number, resultsFile):
# initial number of white spaces, will change to positive value once we go over the lines
spaces=-1
# list = list with directories (the line number) that contain histos
list=[]
# dirlist = list with directories (the line number) that contain histos
dirlist=[]
# namelist = list with corresponding direcotory names
namelist=[]
......@@ -230,7 +230,7 @@ def makeAllDirsFile( htmlDir, name, s, number, resultsFile):
else:
g.write('<a href="'+namedir +'/index.html" >'+shortNameDir+ ':</a>')
g.write('&nbsp;&nbsp;&nbsp;<font class="'+ sp[1]+'">'+ sp[1] + '</font>\n')
list.append(x)
dirlist.append(x)
namelist.append(namedir)
else:
g.write(shortNameDir+ ':')
......@@ -246,7 +246,7 @@ def makeAllDirsFile( htmlDir, name, s, number, resultsFile):
g.write('</font></td>\n</tr>\n</table>')
g.write('</body>\n</html>\n')
g.close()
return list, namelist
return dirlist, namelist
def makeAllDirsBrowserFile( htmlDir, name, s, number, resultsFile,AllDirsScriptDir):
......@@ -274,8 +274,8 @@ def makeAllDirsBrowserFile( htmlDir, name, s, number, resultsFile,AllDirsScriptD
g.write('</body>\n</html>\n')
g.close()
# list = list with directories (the line number) that contain histos
list=[]
# dirlist = list with directories (the line number) that contain histos
dirlist=[]
# namelist = list with corresponding direcotory names
namelist=[]
......@@ -288,10 +288,10 @@ def makeAllDirsBrowserFile( htmlDir, name, s, number, resultsFile,AllDirsScriptD
if ( (x<number-1) and (s[x+1].rsplit())[3]=='ass' ): # check that dir contains histos
if namedir=='<top_level>':
namedir = '.'
list.append(x)
dirlist.append(x)
namelist.append(namedir)
g.close()
return list, namelist
return dirlist, namelist
def makeSubDirFile( htmlDir, name, s, number, subname, assessIndex, runlistLoc,compare, AllDirsScriptDir,jsRoot):
......
......@@ -1442,7 +1442,9 @@ std::pair<std::string,std::string> HanOutputFile:: getHistogram( std::string nam
displayExtra(myC,display);
myC->RedrawAxis();
ratioplot(myC ,h,hRef,display); //RatioPad
if (hRef) {
ratioplot(myC ,h,hRef,display); //RatioPad
}
myC->cd();//might be unnecessary
polynomial(myC,display,h); //draw polynome for TH1
......@@ -2244,13 +2246,16 @@ void HanOutputFile::ratioplot (TCanvas* myC_upperpad ,TH1* h,TH1* hRef,std::stri
TProfile* ph = dynamic_cast<TProfile*>( h );
TH1F *clonehist ;
TH1F *clonehistref;
if( ph != 0 ) {//profile
std::cout<<"it is a TProfile\n";
//transform if profiles
if( ph != 0 ) {
clonehist=(TH1F*)ph->ProjectionX();
clonehistref=(TH1F*)phRef->ProjectionX();
}else{
} else {
clonehist=(TH1F*)h->Clone();
clonehist->Sumw2();
}
if ( phRef != 0 ) {
clonehistref=(TH1F*)phRef->ProjectionX();
}else{
clonehistref=(TH1F*)hRef->Clone();
clonehistref->Sumw2();
}
......
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
*/
// JetVertexTaggerTool.h
......@@ -55,7 +55,6 @@
#include "xAODTracking/TrackParticle.h"
#include "xAODTracking/TrackParticleContainer.h"
#include "JetInterface/IJetTrackSelector.h"
#include "JetRec/JetModifierBase.h"
#include "JetEDM/TrackVertexAssociation.h"
#include "JetInterface/IJetModifier.h"
......@@ -106,15 +105,11 @@ private: // data
// Configurable parameters
std::string m_verticesName;
std::string m_assocTracksName;
std::string m_tvaName;
std::string m_tracksName;
std::string m_jvfCorrName;
std::string m_sumPtTrkName;
std::string m_jvtlikelihoodHistName;
std::string m_jvtfileName;
std::string m_jvtName;
ToolHandle<IJetTrackSelector> m_htsel;
TString m_fn;
TFile * m_jvtfile;
TH2F * m_jvthisto;
......
///////////////////////// -*- C++ -*- ////////////////////////////
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
*/
// JetVertexTaggerTool.cxx
......@@ -21,7 +21,6 @@ JetVertexTaggerTool::JetVertexTaggerTool(const std::string& name)
: asg::AsgTool(name)
, m_jvtlikelihoodHistName("")
, m_jvtfileName("")
, m_htsel("")
{
declareProperty("JVFCorrName", m_jvfCorrName="JVFCorr");
declareProperty("SumPtTrkName", m_sumPtTrkName="SumPtTrkPt500");
......@@ -29,7 +28,6 @@ JetVertexTaggerTool::JetVertexTaggerTool(const std::string& name)
declareProperty("JVTFileName",m_jvtfileName = "JVTlikelihood_20140805.root");
declareProperty("JVTLikelihoodHistName",m_jvtlikelihoodHistName = "JVTRootCore_kNN100trim_pt20to50_Likelihood");
declareProperty("TrackSelector", m_htsel);
declareProperty("JVTName", m_jvtName ="Jvt");
}
......@@ -38,12 +36,6 @@ JetVertexTaggerTool::JetVertexTaggerTool(const std::string& name)
StatusCode JetVertexTaggerTool::initialize() {
ATH_MSG_INFO("Initializing JetVertexTaggerTool " << name());
if ( m_htsel.empty() ) {
ATH_MSG_INFO(" No track selector.");
} else {
ATH_MSG_INFO(" Track selector: " << m_htsel->name());
}
// Use the Path Resolver to find the jvt file and retrieve the likelihood histogram
m_fn = PathResolverFindCalibFile(m_jvtfileName);
ATH_MSG_INFO(" Reading JVT file from:\n " << m_jvtfileName << "\n");
......@@ -90,7 +82,7 @@ int JetVertexTaggerTool::modify(xAOD::JetContainer& jetCont) const {
// Default JVFcorr to -1 when no tracks are associated.
float jvfcorr = jet->getAttribute<float>(m_jvfCorrName);
std::vector<float> sumpttrkpt500 = jet->getAttribute<std::vector<float> >(m_sumPtTrkName);
const float rpt = sumpttrkpt500[HSvertex->index()]/jet->pt();
const float rpt = sumpttrkpt500[HSvertex->index() - (*vertices)[0]->index()]/jet->pt();
float jvt = evaluateJvt(rpt, jvfcorr);
jet->setAttribute(m_jvtName+"Rpt",rpt);
......
#!/usr/bin/env python
# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
## RunTier0Tests.py - Brief description of the purpose of this script (Has to be in PROC tools)
# $Id$
......@@ -315,7 +315,7 @@ def RunFrozenTier0PolicyTest(q,inputFormat,maxEvents,CleanRunHeadDir,UniqID,RunP
logging.info("Reading the reference file from location "+clean_dir)
comparison_command = "acmd.py diff-root "+clean_dir+"/my"+inputFormat+".pool.root run_"+q+"/my"+inputFormat+".pool.root --error-mode resilient --ignore-leaves RecoTimingObj_p1_EVNTtoHITS_timings RecoTimingObj_p1_HITStoRDO_timings RecoTimingObj_p1_RAWtoESD_mems RecoTimingObj_p1_RAWtoESD_timings RAWtoESD_mems RAWtoESD_timings ESDtoAOD_mems ESDtoAOD_timings HITStoRDO_mems HITStoRDO_timings --entries "+str(maxEvents)+" > run_"+q+"/diff-root-"+q+"."+inputFormat+".log 2>&1"
comparison_command = "acmd.py diff-root "+clean_dir+"/my"+inputFormat+".pool.root run_"+q+"/my"+inputFormat+".pool.root --error-mode resilient --ignore-leaves RecoTimingObj_p1_EVNTtoHITS_timings RecoTimingObj_p1_HITStoRDO_timings RecoTimingObj_p1_RAWtoESD_mems RecoTimingObj_p1_RAWtoESD_timings RecoTimingObj_p1_RAWtoALL_mems RecoTimingObj_p1_RAWtoALL_timings RAWtoALL_mems RAWtoALL_timings RAWtoESD_mems RAWtoESD_timings ESDtoAOD_mems ESDtoAOD_timings HITStoRDO_mems HITStoRDO_timings --entries "+str(maxEvents)+" > run_"+q+"/diff-root-"+q+"."+inputFormat+".log 2>&1"
output,error = subprocess.Popen(['/bin/bash', '-c', comparison_command], stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()
# We want to catch/print both container additions/subtractions as well as
......@@ -723,7 +723,7 @@ def main():
elif RunOverlay:
RunCleanOTest(q,overlay_hit_f,overlay_bkg_f,mypwd,cleanSetup,extraArg,CleanRunHeadDir,UniqName)
else:
RunCleanQTest(q,mypwd,cleanSetup,extraArg,CleanRunHeadDir,UniqName, doR2A=r2aMode, trigConfig=trigRun2Config)
RunCleanQTest(q,mypwd,cleanSetup,extraArg,CleanRunHeadDir,UniqName,doR2A=r2aMode,trigConfig=trigRun2Config)
pass
def mypatchedqtest(q=q):
......@@ -775,7 +775,7 @@ def main():
elif RunOverlay:
RunCleanOTest(q,overlay_hit_f,overlay_bkg_f,mypwd,cleanSetup,extraArg,CleanRunHeadDir,UniqName)
else:
RunCleanQTest(q,mypwd,cleanSetup,extraArg,CleanRunHeadDir,UniqName,trigConfig=trigRun2Config)
RunCleanQTest(q,mypwd,cleanSetup,extraArg,CleanRunHeadDir,UniqName,doR2A=r2aMode,trigConfig=trigRun2Config)
pass
def mypatchedqtest(q=q):
......@@ -784,7 +784,7 @@ def main():
elif RunOverlay:
RunPatchedOTest(q,overlay_hit_f,overlay_bkg_f,mypwd,cleanSetup,extraArg)
else:
RunPatchedQTest(q,mypwd,mysetup,extraArg,trigConfig=trigRun2Config)
RunPatchedQTest(q,mypwd,mysetup,extraArg,doR2A=r2aMode,trigConfig=trigRun2Config)
pass
mythreads[q+"_clean"] = threading.Thread(target=mycleanqtest)
......
......@@ -15,7 +15,7 @@ ciRefFileMap = {
# qTestsTier0_required-test
'q221-21.0' : 'v1',
'q431-21.0' : 'v1',
'q221-21.3' : 'v1',
'q221-21.3' : 'v2',
'q431-21.3' : 'v1',
# SimulationTier0Test_required-test
's3126-21.0' : 'v1',
......
......@@ -1257,7 +1257,7 @@ Trk::TimedExtrapolator::overlapSearch(const IPropagator &prop,
if (detParameters) {
// retrive compatible subsurfaces
std::vector<Trk::SurfaceIntersection> cSurfaces;
size_t ncSurfaces = lay.compatibleSurfaces(cSurfaces, *detParameters, Trk::anyDirection, bcheck);
size_t ncSurfaces = lay.compatibleSurfaces(cSurfaces, *detParameters, Trk::anyDirection, bcheck, false);
// import from StaticEngine.icc
if (ncSurfaces) {
......@@ -1284,7 +1284,7 @@ Trk::TimedExtrapolator::overlapSearch(const IPropagator &prop,
((overlapParameters->position() - parsOnLayer.position()).dot(dir *
parsOnLayer.momentum().normalized())
< 0) : surfaceHit;
if (surfaceHit) {
if (surfaceHit && csf.object!=detSurface) { //skipping the initial surface on which a hit has already been created
ATH_MSG_VERBOSE(" [H] Hit with detector surface recorded !");
// count the overlap Surfaces hit
++m_overlapSurfaceHit;
......
......@@ -199,6 +199,25 @@ def addJVFTool(toolname,
'Added jvf tool "%s" to jtm' % toolname
def addJVTTool(toolname,
vcSGkey, ):
global jtm
try:
jvfTool = getattr(jtm, toolname)
except AttributeError:
from JetMomentTools.JetMomentToolsConf import JetVertexTaggerTool
# Build the tool :
jvtTool = JetVertexTaggerTool(toolname,
VertexContainer = vcSGkey)
jtm += jvtTool
print 'TrigHLTJetRecConfig.addJVFTool '\
'Added jvt tool "%s" to jtm' % toolname
# *** FTK track moment tool helpers set up ***
def configTVassocTool(name,
tvSGkey,
......@@ -317,6 +336,11 @@ def _getJetBuildTool(merge_param,
jvf_ghosttrack.AssociatedTracks = secondary_label
jvf_ghosttrack.lock()
mymods.append(jvf_ghosttrack)
if not hasattr(jtm, 'jvt_'+trkopt):
print "In TrigHLTJetRecConfig._getJetBuildTool: Something went wrong. GhostTrack label set but no JVT tool configured. Continuing without jvt calculations."
else:
jvt_ghosttrack = getattr(jtm, 'jvt_'+trkopt)
mymods.append(jvt_ghosttrack)
if not do_minimalist_setup:
# add in extra modofiers. This allows monitoring the ability
......@@ -1197,6 +1221,12 @@ class TrigHLTTrackMomentHelpers(TrigHLTJetRecConf.TrigHLTTrackMomentHelpers):
)
addJVFTool(jvftoolname, **jvfoptions)
# add a specially configured jvt tool to jtm
jvttoolname = 'jvt_'+trkopt
jvtoptions = dict(vcSGkey=primVtxSGkey)
addJVTTool(jvttoolname, **jvtoptions)
# Data scouting algorithm
class TrigHLTJetDSSelector(TrigHLTJetRecConf.TrigHLTJetDSSelector):
def __init__(self, name,
......
......@@ -40,12 +40,20 @@ public:
TrigObjectMatcher( TrackSelector* selector,
const std::vector<TrackTrigObject>& objects,
bool (*select_function)(const TrackTrigObject& t)=0 )
bool (*select_function)(const TrackTrigObject& )=0 )
: m_status(1) {
const std::vector<TIDA::Track*> tracks = selector->tracks();
for ( size_t i=tracks.size() ; i-- ; ) if ( match( tracks[i]->id(), objects, select_function )==false ) selector->delete_track( tracks[i] );
}
TrigObjectMatcher( TrackSelector* selector,
const std::vector<TrackTrigObject>& objects,
bool (*select_function)(const TrackTrigObject& , TIDA::Track* )=0 )
: m_status(1) {
const std::vector<TIDA::Track*> tracks = selector->tracks();
for ( size_t i=tracks.size() ; i-- ; ) if ( match( tracks[i], objects, select_function )==false ) selector->delete_track( tracks[i] );
}
virtual ~TrigObjectMatcher() { }
......@@ -88,6 +96,22 @@ private:
}
bool match( TIDA::Track* track, const std::vector<TrackTrigObject>& objects, bool (*select_function)(const TrackTrigObject& , TIDA::Track* )=0 ) {
for ( size_t j=objects.size() ; j-- ; ) {
for ( size_t k=objects[j].children().size() ; k-- ; ) {
if ( track->id() == objects[j].children()[k] ) {
if ( select_function==0 || select_function(objects[j], track) ) {
m_objectmap.insert( map_type::value_type( track->id(), &objects[j] ) );
return true;
}
else return false;
}
}
}
return false;
}
private:
int m_status;
......
......@@ -349,6 +349,17 @@ double ETmin = 0;
bool SelectObjectET(const TrackTrigObject& t) { return std::fabs(t.pt())>ETmin; }
double ETovPTmin = 0;
bool SelectObjectETovPT(const TrackTrigObject& tobj, TIDA::Track* t=0) {
bool ETselection = std::fabs(tobj.pt())>=ETmin;
bool ETovPTselection = true;
if ( t ) ETovPTselection = std::fabs(tobj.pt()/t->pT())>=ETovPTmin;
return ETselection&ETovPTselection;
}
int main(int argc, char** argv)
{
......@@ -535,6 +546,7 @@ int main(int argc, char** argv)
if ( inputdata.isTagDefined("pT") ) pT = inputdata.GetValue("pT");
if ( inputdata.isTagDefined("ET") ) ETmin = inputdata.GetValue("ET");
if ( inputdata.isTagDefined("ETovPT") ) ETovPTmin = inputdata.GetValue("ETovPT");
/// here we set a pTMax value less than pT, then only set the max pT in the
/// filter if we read a pTMax value *greater* than pT
......@@ -1620,8 +1632,12 @@ int main(int argc, char** argv)
/// get objects if requested
// tom = true;
ETovPTmin = ETmin;
if ( chains[ic].rois()[0].objects().size()>0 ) {
tom = TrigObjectMatcher( &refTracks, chains[ic].rois()[0].objects(), SelectObjectET );
tom = TrigObjectMatcher( &refTracks, chains[ic].rois()[0].objects(), SelectObjectETovPT );
}
break;
......
/*
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
*/
#ifndef TRIGHLTJETHYPO_FALSECONDITION_H
#define TRIGHLTJETHYPO_FALSECONDITION_H
/********************************************************************
*
* NAME: FalseCondition.h
* PACKAGE: Trigger/TrigHypothesis/TrigHLTJetHypo
*
* AUTHOR: A. Steinhebel
* CREATED: May 2018
*
*********************************************************************/
#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/IJet.h"
#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/ICondition.h"
class FalseCondition: public ICondition{
public:
FalseCondition(double limitMin,
double limitMax);
~FalseCondition() override {}
bool isSatisfied(const HypoJetVector&) const override;
double orderingParameter() const noexcept override;
std::string toString() const noexcept override;
private:
double m_limitMin;
double m_limitMax;
};
#endif
/*
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
*/
#ifndef TRIGHLTJETHYPO_IJETATTRSVALUEINTERPRETER_H
#define TRIGHLTJETHYPO_IJETATTRSVALUEINTERPRETER_H
class IJetAttrsValueInterpreter
{
public:
virtual ~IJetAttrsValueInterpreter(){};
virtual std::pair<double,double> operator() (const std::string& ,
const std::string& ) const = 0;
};
#endif
/*
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
*/
#ifndef TRIGHLTJETHYPO_JETATTRSCONDITION_H
#define TRIGHLTJETHYPO_JETATTRSCONDITION_H
/********************************************************************
*
* NAME: JetAttrsCondition.h
* PACKAGE: Trigger/TrigHypothesis/TrigHLTJetHypo
*
* AUTHOR: A. Steinhebel
* CREATED: November 2018
*
*********************************************************************/
#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/IJet.h"
#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/ICondition.h"
class JetAttrsCondition: public ICondition{
public:
JetAttrsCondition(
std::vector<std::string> jetVar,
std::vector<double> limitMin,
std::vector<double> limitMax
);
~JetAttrsCondition() override {}
bool isSatisfied(const HypoJetVector&) const override;
double orderingParameter() const noexcept override;
std::string toString() const noexcept override;
private:
typedef struct {bool validCondition; double value;} Jet;
bool passWidthCut(pHypoJet, int) const;
bool passKtDRCut(pHypoJet, int) const;
std::vector<std::string> m_jetVar;
std::vector<double> m_limitMin;
std::vector<double> m_limitMax;
};
#endif
/*
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
*/
#ifndef TRIGJETHLTHYPO_JETATTRSFACTORY_H
#define TRIGJETHLTHYPO_JETATTRSFACTORY_H
// ********************************************************************
//
// NAME: JetAttrsFactory.h
// PACKAGE: Trigger/TrigHypothesis/TrigHLTJetHypo
//
// AUTHOR: A. Steinhebel
//
// ********************************************************************
//
#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/ConditionsDefs.h"
Conditions JetAttrsSort(std::string var, double limitMin, double limitMax);
#endif
/*
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
*/
#ifndef TRIGHLTJETHYPO_JETATTRSKTDRCONDITION_H
#define TRIGHLTJETHYPO_JETATTRSKTDRCONDITION_H
/********************************************************************
*
* NAME: JetAttrsKtDRCondition.h
* PACKAGE: Trigger/TrigHypothesis/TrigHLTJetHypo
*
* AUTHOR: A. Steinhebel
* CREATED: April 2018
*
*********************************************************************/
#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/IJet.h"
#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/ICondition.h"
class JetAttrsKtDRCondition: public ICondition{
public:
JetAttrsKtDRCondition(
double limitMin,
double limitMax
);
~JetAttrsKtDRCondition() override {}
bool isSatisfied(const HypoJetVector&) const override;
double orderingParameter() const noexcept override;
std::string toString() const noexcept override;
private:
typedef struct {bool validCondition; double ktdrVal;} Jet;
bool passKtDRCut(const Jet&) const;
double m_limitMin;