Skip to content
Commits on Source (66)
......@@ -526,7 +526,7 @@ namespace asg
ANA_MSG_ERROR ("trying to initialize ToolHandleArray property " << val_name << " with empty handle");
return StatusCode::FAILURE;
}
//strip the parent name
std::string tool_name = toolHandle.name();
tools.push_back (toolHandle.type() + "/" + tool_name);
......@@ -1130,6 +1130,9 @@ namespace asg
return detail::AnaToolHandleMode::USER;
#endif
if (m_config.empty() && !m_handleUser->typeAndName().empty() && (m_handleUser->type() != this->type() || m_handleUser->name() != this->name()))
return detail::AnaToolHandleMode::USER;
if (m_config.empty() && m_name.empty())
return detail::AnaToolHandleMode::EMPTY;
......
......@@ -56,9 +56,10 @@ StatusCode HepMCTruthReader::execute() {
if (cntr==0) {
HepMC::GenVertex* signalProcessVtx = genEvt->signal_process_vertex();
ATH_MSG_INFO("Signal process vertex position: (" << signalProcessVtx->position().x()
<< ", " << signalProcessVtx->position().y() << ", " << signalProcessVtx->position().z() << "). Pointer: "
<< signalProcessVtx);
ATH_MSG_INFO("Signal process vertex position: (" << (signalProcessVtx?signalProcessVtx->position().x():0)
<< ", " << (signalProcessVtx?signalProcessVtx->position().y():0)
<< ", " << (signalProcessVtx?signalProcessVtx->position().z():0)
<< "). Pointer: " << signalProcessVtx);
}
printEvent(genEvt);
......
......@@ -97,8 +97,8 @@ namespace InDet
std::string m_outGlobalFolderFile; //!< filename for the textfile with final GlobalFolder constants
bool m_writeTextFile; //!< flag whether to write out the final constants into text file
bool m_writeOldConstants; //!< flag whether to write out the initial constants into text file
std::string m_oldIBLDistFile; //!< filename for the textfile with initial IBLDist params
std::string m_oldAlignFile; //!< filename for the textfile with initial alignment constants
std::string m_oldIBLDistFile; //!< filename for the textfile with initial IBLDist params
std::string m_oldGlobalFolderFile; //!< filename for the textfile with initial GlobalFolder constants
bool m_updateConstants; //!< flag whether to update the constants
......
......@@ -81,6 +81,7 @@ namespace InDet
bool m_writeOldConstants;
bool m_updateConstants;
ServiceHandle<ITRT_AlignDbSvc> m_trtAlignDbSvc;
ToolHandle<Trk::IAlignModuleTool> m_alignModuleTool;
ToolHandle<Trk::IGeometryManagerTool> m_trtGeoManager;
......@@ -89,6 +90,8 @@ namespace InDet
int m_trtAlignLevelBarrel;
int m_trtAlignLevelEndcaps;
bool m_WriteTRTAsL2;
TFile * m_ntuple;
}; // end class
......
......@@ -44,6 +44,7 @@ TRTTrkAlignDBTool::TRTTrkAlignDBTool(const std::string & type, const std::string
, m_trtAlignLevel(-1)
, m_trtAlignLevelBarrel(-1)
, m_trtAlignLevelEndcaps(-1)
, m_WriteTRTAsL2(false)
{
declareInterface<ITrkAlignDBTool>(this);
......@@ -57,6 +58,7 @@ TRTTrkAlignDBTool::TRTTrkAlignDBTool(const std::string & type, const std::string
declareProperty("AlignModuleTool", m_alignModuleTool, "Tool for handling of align module collections");
declareProperty("TRTGeometryManager", m_trtGeoManager, "Tool for handling the TRT alignment geometry");
declareProperty("UpdateConstants", m_updateConstants, "Whether or no to update the alignment constants");
declareProperty("WriteTRTAsL2", m_WriteTRTAsL2, "Option to update L1 corrections as L2 ones");
m_logStream = 0;
}
......@@ -128,6 +130,9 @@ StatusCode TRTTrkAlignDBTool::initialize()
}
}
if (m_WriteTRTAsL2)
ATH_MSG_INFO(" TRT constants are going to be updated at L2 because WriteTRTAsL2 is set to True");
if(m_trtAlignLevel == 0)
ATH_MSG_INFO(" Requested update of Level "<<m_trtAlignLevel<<" alignment constants for TRT");
else {
......@@ -376,6 +381,14 @@ void TRTTrkAlignDBTool::updateDB()
ATH_MSG_DEBUG("DB transform for " << module->name() << " at alignment level " << level);
printTransform(dbtransform);
if(m_WriteTRTAsL2){
if(m_trtAlignDbSvc->tweakAlignTransform(modID,dbtransform,2).isSuccess())
ATH_MSG_INFO("WriteTRTAsL2: Module \'"<<module->name()<<"\': Level "<<level<<" constants updated.");
else // failure
msg(MSG::ERROR)<<"WriteTRTAsL2: Error setting constants for module \'"<<module->name()<<"\'"<<endmsg;
continue;
}
// tweak applies the transform onto already existing transform in the DB
// or sets it if it doesn't exist yet
if(m_trtAlignDbSvc->tweakAlignTransform(modID,dbtransform,level).isSuccess())
......
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
// /*
// Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
// */
/** @file TRT_AlignDbSvc.cxx
* @brief Service to manage TRT alignment conditions
* @author AUTHOR John Alison <johnda@hep.upenn.edu>, Peter Hansen <phansen@nbi.dk>, Wouter Hulsbergen
**/
// /** @file TRT_AlignDbSvc.cxx
// * @brief Service to manage TRT alignment conditions
// * @author AUTHOR John Alison <johnda@hep.upenn.edu>, Peter Hansen <phansen@nbi.dk>, Wouter Hulsbergen **/
#include "TRT_AlignDbSvc.h"
......@@ -269,13 +268,14 @@ StatusCode TRT_AlignDbSvc::writeAlignTextFile(std::string file) const
{
msg(MSG::DEBUG) << " in writeAlignTextFile " << endmsg;
std::ofstream* outfile=0;
msg(MSG::INFO) << " Write AlignableTransforms to text file: "<< file << endmsg;
msg(MSG::INFO) << "Writing AlignableTransforms to text file: "<< file << endmsg;
outfile=new std::ofstream(file.c_str());
int ntrans=0;
int nobj=0;
/** Loop over created AlignableTransforms */
msg(MSG::DEBUG) << " Starting the loop on AlignableTransforms " << endmsg;
std::vector<std::string>::const_iterator iobj=m_alignobjs.begin();
std::vector<std::string>::const_iterator iobjE=m_alignobjs.end();
for (;iobj!=iobjE; ++iobj) {
......@@ -283,8 +283,10 @@ StatusCode TRT_AlignDbSvc::writeAlignTextFile(std::string file) const
std::string key=*iobj;
/** Only write out new keys unless explicitly ask for old keys */
if(isOldKey(key) && m_alignString != "ALold")
if(isOldKey(key) && m_alignString != "ALold") {
msg(MSG::INFO) << " -- key: " << key.c_str() << " isOldKey !!! --> continue " << endmsg;
continue;
}
/** The object must exist in detector store */
if (!pat){
......@@ -295,7 +297,7 @@ StatusCode TRT_AlignDbSvc::writeAlignTextFile(std::string file) const
}
// first record is the name
msg(MSG::INFO) << " Write folder: " << key << endmsg;
msg(MSG::INFO) << " Writing folder name to outfile: " << key << endmsg;
*outfile << key << std::endl;
++nobj;
......@@ -796,14 +798,14 @@ StatusCode TRT_AlignDbSvc::setAlignTransformL1(Identifier ident, Amg::Transform3
*/
if(msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "In setAlignTransformL1" << endmsg;
if(msgLvl(MSG::DEBUG)){
printTransform("Transform in setAlignTransformL1",trans);
printTransform(" == TRT Transform in setAlignTransformL1 == ",trans);
}
// New additions for new global folder structure
// No ATs exist for levels 1 & 2 --> need alternative
if (m_dynamicDB){
if(!tweakGlobalFolder(ident, trans)) {
ATH_MSG_ERROR( "Attempt tweak GlobalDB folder failed" );
ATH_MSG_ERROR( "Attempt tweak GlobalDB folder failed -- setAlignTransformL1 -- identifier " << ident);
return StatusCode::FAILURE;
}
}
......@@ -1018,18 +1020,30 @@ StatusCode TRT_AlignDbSvc::tweakAlignTransform(Identifier ident, Amg::Transform3
return StatusCode::SUCCESS;
}
////////////////////////////////////////////////////////////////////////////////////////////
/** tweak Level 1 AlignableTransform for an identifier */
StatusCode TRT_AlignDbSvc::tweakAlignTransformL1(Identifier ident, Amg::Transform3D trans) {
/** multiply level 1 AlignableTransform for the module containing ident
by an additional transform.
*/
if(msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "In tweakAlignTransformL1" << endmsg;
ATH_MSG_INFO( " -- tweakAlignTransformL1 -- START -- identifier " << ident << " using dynamic DB " << m_dynamicDB);
// make sure identifier is TRT
if( !(m_trtid->is_trt(ident)) ){
msg(MSG::WARNING) << "-- tweakAlignTransformL1 -- The identifier " << ident << " is not from the TRT --> FAILURE " << endmsg;
return StatusCode::FAILURE;
}
// New additions for new global folder structure
// No ATs exist for levels 1 & 2 --> need alternative
if (m_dynamicDB){
if(!tweakGlobalFolder(ident, trans)) {
ATH_MSG_ERROR( "Attempt tweak GlobalDB folder failed" );
if(tweakGlobalFolder(ident, trans)) {
ATH_MSG_ERROR( "-- tweakAlignTransformL1 -- return SUCCESS from tweakGlobalDBfolder(ident,trans) for identifier " << ident << " --> SUCCESS " );
return StatusCode::SUCCESS;
}
else {
ATH_MSG_ERROR( "-- tweakAlignTransformL1 -- return FAILURE from tweakGlobalDBfolder(ident,trans) for identifier " << ident << " --> FAILURE ");
return StatusCode::FAILURE;
}
}
......@@ -1063,13 +1077,15 @@ StatusCode TRT_AlignDbSvc::tweakAlignTransformL1(Identifier ident, Amg::Transfor
}
}
if(msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Leaving tweakAlignTransformL1" << endmsg;
ATH_MSG_INFO( " -- tweakAlignTransformL1 -- Completed -- identifier " << ident << " using dynamic DB " << m_dynamicDB << " --> SUCCESS ");
return StatusCode::SUCCESS;
}
////////////////////////////////////////////////////////////////////////////////////////////
/** tweak Level 2 AlignableTransform for an identifier */
StatusCode TRT_AlignDbSvc::tweakAlignTransformL2(Identifier ident, Amg::Transform3D trans) {
if(msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "In tweakAlignTransformL2" << endmsg;
ATH_MSG_INFO( " -- tweakAlignTransformL2 -- START for identifier " << ident);
// multiply level 2 AlignableTransform for the module containing ident
// by an additional transform.
......@@ -1102,10 +1118,11 @@ StatusCode TRT_AlignDbSvc::tweakAlignTransformL2(Identifier ident, Amg::Transfor
return StatusCode::FAILURE;
}
if(msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Leaving tweakAlignTransformL2" << endmsg;
ATH_MSG_INFO( " -- tweakAlignTransformL2 -- completed for identifier " << ident);
return StatusCode::SUCCESS;
}
////////////////////////////////////////////////////////////////////////////////////////////
/** tweak Level 3 AlignableTransform for an identifier */
StatusCode TRT_AlignDbSvc::tweakAlignTransformL3 (Identifier ident, Amg::Transform3D trans) {
if(msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "In tweakAlignTransformL3" << endmsg;
......@@ -1617,7 +1634,7 @@ StatusCode TRT_AlignDbSvc::writeGlobalFolderFile( const std::string file)
/////////////////////////////////////////////////////////////////////////////////////////
StatusCode TRT_AlignDbSvc::tweakGlobalFolder(Identifier ident, Amg::Transform3D trans ) {
// find transform key, then set appropriate transform
......@@ -1625,21 +1642,37 @@ StatusCode TRT_AlignDbSvc::tweakGlobalFolder(Identifier ident, Amg::Transform3D
CondAttrListCollection* atrlistcol2=0;
bool result = false;
std::string key="/TRT/AlignL1/TRT";
msg(MSG::DEBUG) << " Identifier is valid: "<< ident.is_valid() << endmsg;
int bec=m_trtid->barrel_ec(ident);
const unsigned int DBident=bec*1000;
// so far not a very fancy DB identifier, but seems elaborate enough for this simple structure
const unsigned int DBident=1000+bec*100;
// Salva. Restore previous code by Matthias. -> so far not a very fancy DB identifier, but seems elaborate enough for this simple structure
ATH_MSG_INFO( " -- tweakGlobalFolder -- START ==> identifier " << ident
<< "\n >> key: " << key
<< "\n >> bec: " << bec
<< "\n >> Target DBident= "<< DBident << "\n");
if (StatusCode::SUCCESS==m_detStore->retrieve(atrlistcol1,key)) {
// loop over objects in collection
atrlistcol2 = const_cast<CondAttrListCollection*>(atrlistcol1);
if (atrlistcol1!=0){
ATH_MSG_INFO( "tweakGlobalFolder ==> atrlistcol1->size()= " << atrlistcol1->size());
for (CondAttrListCollection::const_iterator citr=atrlistcol2->begin(); citr!=atrlistcol2->end();++citr) {
const coral::AttributeList& atrlist=citr->second;
coral::AttributeList& atrlist2 = const_cast<coral::AttributeList&>(atrlist);
if(citr->first!=DBident) continue;
if (citr->first != DBident) {
ATH_MSG_INFO( " citr->first (" << citr->first << ") != DBident (" << DBident << ") --> lets continue");
continue;
}
else {
ATH_MSG_DEBUG( " -- TRT structure identifiers "
<< "\n citr->first= " << citr->first
<< "\n DBident = " << DBident
<< "\n bec = " << bec
<< "\n ident = " << ident
<< "\n");
msg(MSG::DEBUG) << "Tweak Old global DB -- channel: " << citr->first
<< " ,bec: " << atrlist2["bec"].data<int>()
<< " ,layer: " << atrlist2["layer"].data<int>()
......@@ -1659,22 +1692,26 @@ StatusCode TRT_AlignDbSvc::tweakGlobalFolder(Identifier ident, Amg::Transform3D
HepGeom::Transform3D oldtransform(oldrotation, oldtranslation);
// get the new transform
//HepGeom::Transform3D newtrans = Amg::EigenTransformToCLHEP(trans)*oldtrans;
Amg::Transform3D newtrans = trans*Amg::CLHEPTransformToEigen(oldtransform);
HepGeom::Transform3D newtrans = Amg::EigenTransformToCLHEP(trans)*oldtransform;
Amg::Transform3D newtransAMG = trans*Amg::CLHEPTransformToEigen(oldtransform);
// Extract the values we need to write to DB
Amg::Vector3D shift=newtrans.translation();
Amg::Vector3D eulerangles = newtrans.rotation().eulerAngles(2,0,2) ;
//CLHEP::HepRotation rot=newtrans.getRotation();
Amg::Vector3D shift=newtransAMG.translation();
CLHEP::HepRotation rot=newtrans.getRotation();
Amg::Vector3D eulerangles;
eulerangles[0] = rot.getPhi();
eulerangles[1] = rot.getTheta();
eulerangles[2] = rot.getPsi();
atrlist2["Tx"].data<float>() = shift.x();
atrlist2["Ty"].data<float>() = shift.y();
atrlist2["Tz"].data<float>() = shift.z();
atrlist2["phi"].data<float>() = eulerangles[0]/CLHEP::mrad ;
atrlist2["theta"].data<float>() = eulerangles[1]/CLHEP::mrad ;
atrlist2["psi"].data<float>() = eulerangles[2]/CLHEP::mrad ;
atrlist2["phi"].data<float>() = eulerangles[0] ;
atrlist2["theta"].data<float>() = eulerangles[1] ;
atrlist2["psi"].data<float>() = eulerangles[2] ;
result = true;
msg(MSG::DEBUG) << "Tweak New global DB -- channel: " << citr->first
msg(MSG::INFO) << "Tweak New global DB -- channel: " << citr->first
<< " ,bec: " << atrlist2["bec"].data<int>()
<< " ,layer: " << atrlist2["layer"].data<int>()
<< " ,sector: " << atrlist2["sector"].data<int>()
......@@ -1701,3 +1738,4 @@ StatusCode TRT_AlignDbSvc::tweakGlobalFolder(Identifier ident, Amg::Transform3D
if (result) return StatusCode::SUCCESS;
else return StatusCode::FAILURE;
}
# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
......@@ -1164,7 +1164,7 @@ class doTrackSegmentsPixelFourLayer(InDetFlagsJobProperty):
StoredValue = False
class doTrackSegmentsPixelThreeLayer(InDetFlagsJobProperty):
"""Turn running of pixel stablet creation in pixel after NewTracking, using all available hits, on and off"""
"""Turn running of pixel stablet creation in pixel after NewTracking, using unassociated hits, on and off"""
statusOn = True
allowedTypes = ['bool']
StoredValue = False
......
# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
##
## @file InDetRecExample/python/InDetKeys.py
......@@ -559,19 +559,19 @@ class PixelFourLayerDetailedTracksTruth(JobProperty):
StoredValue = 'PixelFourLayerTracksDetailedTruth'
class SiSpSeededPixelThreeLayerTracks(JobProperty):
"""StoreGate key for pixel stublets with 3 SPs run after new tracking on all PRDs"""
"""StoreGate key for pixel stublets with 3 SPs run after new tracking on unassociated PRDs"""
statusOn = True
allowedTypes = ['str']
StoredValue = 'SiSPSeededPixelThreeLayerTracks'
class PixelThreeLayerTracksTruth(JobProperty):
"""StoreGate key for pixel stublets with 3 SPs truth run after New Tracking on all PRDs"""
"""StoreGate key for pixel stublets with 3 SPs truth run after New Tracking on unassociated PRDs"""
statusOn = True
allowedTypes = ['str']
StoredValue = 'PixelThreeLayerTracksTruthCollection'
class PixelThreeLayerDetailedTracksTruth(JobProperty):
"""StoreGate key for detailed pixel stublets with 3 SPs truth run after New Tracking on all PRDs"""
"""StoreGate key for detailed pixel stublets with 3 SPs truth run after New Tracking on unassociated PRDs"""
statusOn = True
allowedTypes = ['str']
StoredValue = 'PixelThreeLayerTracksDetailedTruth'
......@@ -650,7 +650,7 @@ class ExtendedTracksMapPixelFourLayer(JobProperty):
StoredValue = 'ExtendedTracksMapPixelFourLayer'
class ResolvedPixelThreeLayerTracks(JobProperty):
"""StoreGate key for resolved pixel tracks run after New Tracking on all PRDs"""
"""StoreGate key for resolved pixel tracks run after New Tracking on unassociated PRDs"""
statusOn = True
allowedTypes = ['str']
StoredValue = 'ResolvedPixelThreeLayerTracks'
......@@ -662,7 +662,7 @@ class ExtendedTracksPixelThreeLayer(JobProperty):
StoredValue = 'ExtendedTracksPixelThreeLayer'
class PixelThreeLayerTracks(JobProperty):
"""StoreGate key for rfinal pixel tracks run after New Tracking on all PRDs"""
"""StoreGate key for final pixel tracks run after New Tracking on unassociated PRDs"""
statusOn = True
allowedTypes = ['str']
StoredValue = 'PixelThreeLayerTracks'
......@@ -1192,13 +1192,13 @@ class xAODPixelFourLayerExtendedTrackParticleContainer(JobProperty):
StoredValue = "InDetPixelFourLayerExtendedTrackParticles"
class xAODPixelThreeLayerTrackParticleContainer(JobProperty):
"""xAOD PixelTrackParticle on all hits using three layers"""
"""xAOD PixelTrackParticle on unassociated hits using three layers"""
statusOn = True
allowedTypes = ['str']
StoredValue = "InDetPixelThreeLayerTrackParticles"
class xAODPixelThreeLayerExtendedTrackParticleContainer(JobProperty):
"""xAOD Extended PixelTrackParticle on all hits using four layers"""
"""xAOD Extended PixelTrackParticle on unassociated hits using three layers"""
statusOn = True
allowedTypes = ['str']
StoredValue = "InDetPixelThreeLayerExtendedTrackParticles"
......
# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
# +++++++++++++++++++ beginning of InDetRec_jobOptions.py
# jobOptions Fragment for ID software
......@@ -734,7 +736,7 @@ else:
# ------------------------------------------------------------
#
# --- Pixel Stublets (3 layer tracks) on all PRDs
# --- Pixel Stublets (3 layer tracks) on unassociated PRDs
#
# ------------------------------------------------------------
......
......@@ -5036,25 +5036,25 @@ void IDAlignMonResiduals::MakeTRTEndcapHistograms(MonGroup& al_mon){
/** Pull noTube vs mu */
m_trt_ec_hist->pullR_notube_mu[endcap] = MakeHist("trt_ec_pullRnotube_mu_"+endcapName[endcap],"UnBiased Pull vs mu for the TRT Barrel (no tube hits)"+endcapName[endcap],m_nBinsPtRange,-m_PtRange,m_PtRange,100,-m_RangeOfPullHistos,m_RangeOfPullHistos, "#mu","Pull");
m_trt_ec_hist->pullR_notube_mu[endcap] = MakeHist("trt_ec_pullRnotube_mu_"+endcapName[endcap],"UnBiased Pull vs mu for the TRT (no tube hits)"+endcapName[endcap],m_nBinsPtRange,-m_PtRange,m_PtRange,100,-m_RangeOfPullHistos,m_RangeOfPullHistos, "#mu","Pull");
RegisterHisto(al_mon,m_trt_ec_hist->pullR_notube_mu[endcap]);
/** Residuals and pulls vs pT*/
m_trt_ec_hist->residualR_pt[endcap] = MakeHist("trt_ec_residualR_pt_"+endcapName[endcap],"UnBiased Residual vs pT for the TRT Barrel "+endcapName[endcap],m_nBinsPtRange,-m_PtRange,m_PtRange,200,-1.0,1.0, "Track p_{T} [GeV]","Residual [mm]");
m_trt_ec_hist->residualR_pt[endcap] = MakeHist("trt_ec_residualR_pt_"+endcapName[endcap],"UnBiased Residual vs pT for the TRT "+endcapName[endcap],m_nBinsPtRange,-m_PtRange,m_PtRange,200,-1.0,1.0, "Track p_{T} [GeV]","Residual [mm]");
RegisterHisto(al_mon,m_trt_ec_hist->residualR_pt[endcap]);
m_trt_ec_hist->pullR_pt[endcap] = MakeHist("trt_ec_pullR_pt_"+endcapName[endcap],"UnBiased Pull vs pT for the TRT Barrel "+endcapName[endcap],m_nBinsPtRange,-m_PtRange,m_PtRange,100,-m_RangeOfPullHistos,m_RangeOfPullHistos, "Track p_{T} [GeV]","Pull");
m_trt_ec_hist->pullR_pt[endcap] = MakeHist("trt_ec_pullR_pt_"+endcapName[endcap],"UnBiased Pull vs pT for the TRT "+endcapName[endcap],m_nBinsPtRange,-m_PtRange,m_PtRange,100,-m_RangeOfPullHistos,m_RangeOfPullHistos, "Track p_{T} [GeV]","Pull");
RegisterHisto(al_mon,m_trt_ec_hist->pullR_pt[endcap]);
m_trt_ec_hist->pullR_notube_pt[endcap] = MakeHist("trt_ec_pullRnotube_pt_"+endcapName[endcap],"UnBiased Pull vs pT for the TRT Barrel (no tube hits)"+endcapName[endcap],m_nBinsPtRange,-m_PtRange,m_PtRange,100,-m_RangeOfPullHistos,m_RangeOfPullHistos, "Track p_{T} [GeV]","Pull");
m_trt_ec_hist->pullR_notube_pt[endcap] = MakeHist("trt_ec_pullRnotube_pt_"+endcapName[endcap],"UnBiased Pull vs pT for the TRT (no tube hits)"+endcapName[endcap],m_nBinsPtRange,-m_PtRange,m_PtRange,100,-m_RangeOfPullHistos,m_RangeOfPullHistos, "Track p_{T} [GeV]","Pull");
RegisterHisto(al_mon,m_trt_ec_hist->pullR_notube_pt[endcap]);
/** Residuals and pulls vs mu*/
m_trt_ec_hist->residualR_mu[endcap] = MakeHist("trt_ec_residualR_mu_"+endcapName[endcap],"UnBiased Residual vs mu for the TRT Barrel "+endcapName[endcap],m_nBinsPtRange,-m_PtRange,m_PtRange,200,-1.0,1.0, "#mu ","Residual [mm]");
m_trt_ec_hist->residualR_mu[endcap] = MakeHist("trt_ec_residualR_mu_"+endcapName[endcap],"UnBiased Residual vs mu for the TRT "+endcapName[endcap],m_nBinsPtRange,-m_PtRange,m_PtRange,200,-1.0,1.0, "#mu ","Residual [mm]");
RegisterHisto(al_mon,m_trt_ec_hist->residualR_mu[endcap]);
m_trt_ec_hist->pullR_mu[endcap] = MakeHist("trt_ec_pullR_mu_"+endcapName[endcap],"UnBiased Pull vs mu for the TRT Barrel "+endcapName[endcap],m_nBinsPtRange,-m_PtRange,m_PtRange,100,-m_RangeOfPullHistos,m_RangeOfPullHistos, "#mu","Pull");
m_trt_ec_hist->pullR_mu[endcap] = MakeHist("trt_ec_pullR_mu_"+endcapName[endcap],"UnBiased Pull vs mu for the TRT "+endcapName[endcap],m_nBinsPtRange,-m_PtRange,m_PtRange,100,-m_RangeOfPullHistos,m_RangeOfPullHistos, "#mu","Pull");
RegisterHisto(al_mon,m_trt_ec_hist->pullR_mu[endcap]);
}
......
......@@ -107,6 +107,7 @@ namespace InDet {
constexpr static Int_t LOCAL_MAX_INT = std::numeric_limits<Int_t>::max();
Double_t m_minPt = -1.; //!< Minimum p_T of tracks
Double_t m_maxPt = -1.; //!< Maximum p_T of tracks (negative -> no cut)
Double_t m_maxAbsEta = LOCAL_MAX_DOUBLE; //!< Maximum magnitude of pseudorapidity
Double_t m_maxZ0SinTheta = LOCAL_MAX_DOUBLE; //!< Maximum |z0*sin(theta)| of tracks
Double_t m_maxZ0 = LOCAL_MAX_DOUBLE; //!< Maximum |z0| of tracks
......
......@@ -51,6 +51,7 @@ InDet::InDetTrackSelectionTool::InDetTrackSelectionTool(const std::string& name,
declareProperty("CutLevel", m_cutLevel);
declareProperty("minPt", m_minPt, "Minimum transverse momentum");
declareProperty("maxPt", m_maxPt, "Maximum transverse momentum");
declareProperty("minP", m_minP, "Minimum momentum");
declareProperty("maxAbsEta", m_maxAbsEta, "Maximum magnitude of pseudorapidity");
declareProperty("maxD0", m_maxD0, "Maximum transverse separation");
......@@ -227,6 +228,10 @@ StatusCode InDet::InDetTrackSelectionTool::initialize() {
ATH_MSG_INFO( " Minimum Pt: " << m_minPt << " MeV" );
m_trackCuts["Pt"].push_back(make_unique<MinCut<double, &xAOD::TrackParticle::pt> >(this, m_minPt, "pt"));
}
if (m_maxPt > 0.) {
ATH_MSG_INFO( " Maximum Pt: " << m_maxPt << " MeV" );
m_trackCuts["PtMax"].push_back(make_unique<MaxAbsCut<double, &xAOD::TrackParticle::pt> >(this, m_maxPt, "pt max [MeV]"));
}
if (maxDoubleIsSet(m_maxAbsEta)) {
ATH_MSG_INFO( " Maximum |Eta|: " << m_maxAbsEta );
m_trackCuts["Eta"].push_back(make_unique< MaxAbsCut<double, &xAOD::TrackParticle::eta> >(this, m_maxAbsEta, "eta"));
......
......@@ -47,7 +47,8 @@ if( NOT XAOD_STANDALONE )
MuonIdHelpers/selection.xml
LINK_LIBRARIES MuonIdHelpersLib )
atlas_add_executable( test_muon_id
test/test_muon_id.cxx
LINK_LIBRARIES Identifier IdDictParser GaudiKernel MuonIdHelpersLib )
atlas_add_test( muon_id_test
SOURCES
test/muon_id_test.cxx
LINK_LIBRARIES Identifier IdDictParser GaudiKernel MuonIdHelpersLib )
endif()
......@@ -75,7 +75,9 @@ class CscIdHelper : public MuonIdHelper
IdentifierHash& hash_id ) const;
virtual int get_detectorElement_hash (const Identifier& id,
IdentifierHash& hash_id ) const;
virtual int get_channel_hash(const Identifier&, IdentifierHash&) const;
virtual int get_channel_hash(const Identifier&, IdentifierHash&) const; // this method returns the geometrical channel hash for CSCs
int get_pos_channel_hash(const Identifier&, IdentifierHash&) const; // this method returns the positional channel hash for CSCs (needed for CscRawData_p4 conversion)
int get_id_fromPosHash(const IdentifierHash& hash_id, Identifier& id) const; // this methods returns a CSC channel identifiers by reference when specifying a positional hash
///////////// compact identifier stuff ends //////////////////////////////////////
......@@ -215,7 +217,7 @@ class CscIdHelper : public MuonIdHelper
mutable unsigned int m_etaStripMax;
mutable unsigned int m_phiStripMax;
inline virtual void create_mlog() const;
id_vec m_sorted_channel_vec; // sorted vector of CSC identifiers (to be used to find positional hashes)
};
// For backwards compatibility
......
This diff is collapsed.
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
*/
/**
......@@ -30,7 +30,7 @@ inline void CscIdHelper::create_mlog() const
/// Constructor/Destructor
CscIdHelper::CscIdHelper() : MuonIdHelper(), m_CHAMBERLAYER_INDEX(0),
m_WIRELAYER_INDEX(0), m_MEASURESPHI_INDEX(0), m_etaStripMax(0), m_phiStripMax(0) {}
m_WIRELAYER_INDEX(0), m_MEASURESPHI_INDEX(0), m_etaStripMax(0), m_phiStripMax(0), m_sorted_channel_vec() {}
/// Destructor
......@@ -340,6 +340,10 @@ int CscIdHelper::initialize_from_dictionary(const IdDictMgr& dict_mgr)
<< "Initializing CSC hash indices for finding neighbors ... " << endmsg;
status = init_neighbors();
// now copy all CSC channel identifiers into m_sorted_channel_vec to sort it (for the positional hash retrieval)
// Using assignment operator to copy one vector to other
m_sorted_channel_vec = m_channel_vec;
std::sort(m_sorted_channel_vec.begin(), m_sorted_channel_vec.end());
return (status);
}
......@@ -396,6 +400,38 @@ int CscIdHelper::get_channel_hash(const Identifier& id, IdentifierHash& hash_id)
return get_hash_calc(id,hash_id,&context);
}
int CscIdHelper::get_pos_channel_hash(const Identifier& id, IdentifierHash& hash_id) const {
hash_id = UINT_MAX;
const IdContext context=this->channel_context();
if (0 == context.begin_index()) { // No hashes yet for ids with prefixes
if (m_CHANNEL_INDEX == context.end_index()) {
id_vec_it it = std::lower_bound(m_sorted_channel_vec.begin(), m_sorted_channel_vec.end(), id);
if ((it != m_sorted_channel_vec.end())&&(*it==id)) {
hash_id = it - m_sorted_channel_vec.begin();
return 0;
}
}
}
create_mlog();
(*m_Log) << MSG::WARNING << "CscIdHelper::get_pos_channel_hash(): Could not determine hash for identifier " << id.get_compact() << endmsg;
return 1;
}
int CscIdHelper::get_id_fromPosHash(const IdentifierHash& hash_id, Identifier& id) const {
int result = 1;
id.clear();
const IdContext context=this->channel_context();
if (0 == context.begin_index()) { // No hashes yet for ids with prefixes
if (m_CHANNEL_INDEX == context.end_index()) {
if (hash_id < (unsigned int)(m_sorted_channel_vec.end() - m_sorted_channel_vec.begin())) {
id = m_sorted_channel_vec[hash_id];
result = 0;
}
}
}
return result;
}
void CscIdHelper::idChannels (const Identifier& id, std::vector<Identifier>& vect) const {
vect.clear();
......
/*
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
*/
#ifdef ROOTCORE
int main() { return 0; }
#else
#include "IdDictParser/IdDictParser.h"
#include "MuonIdHelpers/MuonIdHelperTool.h"
#include "GaudiKernel/System.h"
#include <iostream>
// for the CSCs, test the geometrical hash to real hash conversion
int check_CSC_hash_conversion(CscIdHelper *idhelp) {
IdentifierHash hash;
IdentifierHash geo_hash;
Identifier id;
Identifier id2;
// check channel Identifiers
std::cout << "checking channel hashes..." << std::endl;
IdContext context = idhelp->channel_context();
for (unsigned int i=0; i<idhelp->channel_hash_max(); ++i) {
// get Identifier from positional hash
if (idhelp->get_id_fromPosHash(i, id)) {
std::cout << "ERROR: Failed to retrieve identifier from hash=" << i << std::endl;
return 1;
}
// get geometrical hash from Identifier
if (idhelp->get_channel_hash(id, geo_hash)) {
std::cout << "ERROR: Failed to retrieve geometrical identifier hash from identifier=" << id.get_compact() << std::endl;
return 1;
}
// get Identifier from geometrical hash
if (idhelp->get_id(geo_hash, id2, &context)) {
std::cout << "ERROR: Failed to retrieve real identifier hash from geometrical identifier hash=" << geo_hash << std::endl;
return 1;
}
if (id.get_compact()!=id2.get_compact()) {
std::cout << "ERROR: Original Identifier=" << id.get_compact() << " differs from retrieved Identifier=" << id2.get_compact() << std::endl;
return 1;
}
}
return 0;
}
int check_muon_decoding(IdDictMgr& idd, bool hasCSC, bool hasSTgc, bool hasMM)
{
MdtIdHelper mdt_id;
if(mdt_id.initialize_from_dictionary (idd)) {
std::cout << "check_muon_decoding - cannot init from mdt dict" << std::endl;
return 1;
}
RpcIdHelper rpc_id;
if(rpc_id.initialize_from_dictionary (idd)) {
std::cout << "check_muon_decoding - cannot init from rpc dict" << std::endl;
return 1;
}
TgcIdHelper tgc_id;
if(tgc_id.initialize_from_dictionary (idd)) {
std::cout << "check_muon_decoding - cannot init from tgc dict" << std::endl;
return 1;
}
if (hasCSC) {
CscIdHelper csc_id;
if(csc_id.initialize_from_dictionary (idd)) {
std::cout << "check_muon_decoding - cannot init from csc dict" << std::endl;
return 1;
}
if (check_CSC_hash_conversion(&csc_id)) return 1;
}
if (hasSTgc) {
TgcIdHelper sTgc_id;
if(sTgc_id.initialize_from_dictionary (idd)) {
std::cout << "check_muon_decoding - cannot init from sTgc dict" << std::endl;
return 1;
}
}
if (hasMM) {
MmIdHelper mm_id;
if(mm_id.initialize_from_dictionary (idd)) {
std::cout << "check_muon_decoding - cannot init from mm dict" << std::endl;
return 1;
}
}
return 0;
}
int checkDictFile(std::string filename, bool hasCSC=true, bool hasSTgc=true, bool hasMM=true) {
std::cout << "=========> checking dictionnary file=" << filename << std::endl;
IdDictParser parser;
parser.register_external_entity("MuonSpectrometer", filename);
IdDictMgr& idd = parser.parse ("IdDictParser/ATLAS_IDS.xml");
return check_muon_decoding(idd, hasCSC, hasSTgc, hasMM);
}
/**
* @brief Tests the MuonSpectrometer IdDict files
*
* @return Returns 0 if the MuonIdHelpers classes were initialized successfully and retrieval of channel identifiers and hashes work, otherwise 1.
*/
int main ()
{
// check Run 2 layout (no STgc/MM)
if (checkDictFile("IdDictMuonSpectrometer_R.03.xml", true, false, false)) return 1;
return 0;
}
#endif // ROOTCORE
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
// $Id: test_muon_id.cxx 594238 2014-04-25 09:00:53Z krasznaa $
#ifdef ROOTCORE
int main() { return 0; }
#else
#include "IdDictParser/IdDictParser.h"
#include "Identifier/Range.h"
#include "Identifier/IdentifierHash.h"
#include "MuonIdHelpers/CscIdHelper.h"
#include "MuonIdHelpers/MdtIdHelper.h"
#include "MuonIdHelpers/MmIdHelper.h"
#include "MuonIdHelpers/RpcIdHelper.h"
#include "MuonIdHelpers/TgcIdHelper.h"
#include "MuonIdHelpers/sTgcIdHelper.h"
#include "GaudiKernel/System.h"
#include <iostream>
typedef Identifier::size_type size_type ;
static void
check_muon_decoding(IdDictMgr& idd)
{
std::cout << "=========> check_muon_decoding" << std::endl;
MdtIdHelper mdt_id;
if(mdt_id.initialize_from_dictionary (idd)) {
std::cout << "check_muon_decoding - cannot init from mdt dict" << std::endl;
}
CscIdHelper csc_id;
if(csc_id.initialize_from_dictionary (idd)) {
std::cout << "check_muon_decoding - cannot init from csc dict" << std::endl;
}
MmIdHelper mm_id;
if(mm_id.initialize_from_dictionary (idd)) {
std::cout << "check_muon_decoding - cannot init from mm dict" << std::endl;
}
RpcIdHelper rpc_id;
if(rpc_id.initialize_from_dictionary (idd)) {
std::cout << "check_muon_decoding - cannot init from rpc dict" << std::endl;
}
TgcIdHelper tgc_id;
if(tgc_id.initialize_from_dictionary (idd)) {
std::cout << "check_muon_decoding - cannot init from tgc dict" << std::endl;
}
sTgcIdHelper sTgc_id;
if(sTgc_id.initialize_from_dictionary (idd)) {
std::cout << "check_muon_decoding - cannot init from sTgc dict" << std::endl;
}
// pixel_id.test_wafer_packing ();
}
/**
* @brief Tests the ATLAS Id xml files, i.e. updates of the MuonSpectrometer IdDict files
*
* @param[in] argc Length of argv
* @param[in] argv Here, the second argument after the name of the executable has to be the ’top-level’ xml file: IdDictParser/ATLAS_IDS.xml
*
* @return Returns 0 if the MuonIdHelpers classes were initialized successfully, otherwise 1.
*/
int main (int argc, char* argv[])
{
if (argc < 2) return (1);
longlong startOfUserTime = System::userTime( System::microSec );
longlong startOfKernelTime = System::kernelTime ( System::microSec );
longlong startOfElapsedTime = System::ellapsedTime ( System::microSec );
IdDictParser parser;
parser.register_external_entity("MuonSpectrometer", "IdDictMuonSpectrometer_R.01.xml");
// parser.register_external_entity("InnerDetector", "InDetIdDictFiles/IdDictInnerDetector_IBL-01.xml");
// parser.register_external_entity("LArCalorimeter", "IdDictLArCalorimeter_H8_2004.xml");
// parser.register_external_entity("InnerDetector", "IdDictInnerDetector_slhc.xml");
// parser.register_external_entity("InnerDetector", "IdDictInnerDetector_Cosmic.xml");
// parser.register_external_entity("InnerDetector", "IdDictInnerDetector_CTB2004.xml");
IdDictMgr& idd = parser.parse (argv[1]);
// IdDictMgr& idd = parser.parse (argv[1], "initial_layout");
std::cout << "Timing for parsing dictionaries " << std::endl;
/// following lines could be platform dependent!
longlong deltaUser = System::userTime ( System::microSec ) - startOfUserTime ;
///
longlong deltaKernel = System::kernelTime ( System::microSec ) - startOfKernelTime ;
///
longlong deltaElapsed = System::ellapsedTime( System::microSec ) - startOfElapsedTime ;
std::cout << "tries, user, kernel, elapsed "
<< deltaUser << " "
<< deltaKernel << " "
<< deltaElapsed << " "
<< std::endl;
std::cout << "got dict mgr " << std::endl;
// std::cout << "regenerate for tag = initial_layout " << std::endl;
// idd.generate_implementation ("initial_layout");
check_muon_decoding(idd);
return 0;
}
#endif // ROOTCORE
#!/bin/sh
#
# art-description: Check SQL files of muon spectrometer description, just AGDD part from amdc_simrec (for NSW, using NSW layout)
#
# art-type: grid
# art-include: master/Athena
# art-include: 21.3/Athena
#
# art-output: *.txt
art.py createpoolfile
set -x
wget http://atlas.web.cern.ch/Atlas/GROUPS/MUON/AMDB/amdb_simrec.r.08.01
athena.py AmdcAth/AmdcAth_GeometryTasks.py -c "input_amdb_simrec='amdb_simrec.r.08.01';database_layout='MuonSpectrometer-R.08.01-NSW';CheckAGDDBlob=True;"
echo "art-result: $?"
#!/bin/sh
#
# art-description: Check SQL files of muon spectrometer description, just AMDB part from amdc_simrec (using NSW layout)
#
# art-type: grid
# art-include: master/Athena
# art-include: 21.3/Athena
#
# art-output: *.txt
art.py createpoolfile
set -x
echo $AtlasVersion
if [ ${AtlasVersion:0:4} == "21.3" ]; then
DATABASE_LAYOUT="database_layout='MuonSpectrometer-R.08.01-NSW'"
else
DATABASE_LAYOUT="database_layout=''"
fi
wget http://atlas.web.cern.ch/Atlas/GROUPS/MUON/AMDB/amdb_simrec.r.08.01
athena.py AmdcAth/AmdcAth_GeometryTasks.py -c "input_amdb_simrec='amdb_simrec.r.08.01';CheckAMDBTables=True;"$DATABASE_LAYOUT;
echo "art-result: $?"
\ No newline at end of file