Skip to content
Commits on Source (37)
......@@ -47,6 +47,7 @@ class TrackRecordGenerator : public GenModule {
std::string m_recordName; //!< TrackRecord collection name
bool m_stopParticles; //!< Stop particles before simulation
float m_stopped_tminus, m_stopped_tplus; //!< Bounds for random time
bool m_add_cL; //!< For stopped particles, add c*L to the time
};
#endif
......@@ -33,8 +33,9 @@ TrackRecordGenerator::TrackRecordGenerator(const std::string& name, ISvcLocator*
declareProperty("TRSmearing", m_smearTR=-1, "Smear the initial position of the track by up to this amount");
declareProperty("TRPSmearing", m_smearTRp=-1, "Smear the momentum of the track by up to this amount");
declareProperty("StopParticles", m_stopParticles=false, "Stop the particles and make them decay within 25 ns");
declareProperty("stopped_tminus", m_stopped_tminus =-25. );
declareProperty("stopped_tplus", m_stopped_tplus =25. );
declareProperty("stopped_tminus", m_stopped_tminus =-25. );
declareProperty("stopped_tplus", m_stopped_tplus =25. );
declareProperty("Add_cL", m_add_cL=true, "For stopped particles, shift the time by c times the decay rho");
}
//--------------------------------------------------------------------------
......@@ -149,6 +150,9 @@ StatusCode TrackRecordGenerator::callGenerator() {
double settime=CLHEP::RandFlat::shoot(&randomEngine(),m_stopped_tminus, m_stopped_tplus);
ATH_MSG_DEBUG( "Setting particle time to something uniform between "<<m_stopped_tminus<<" and "<<m_stopped_tplus<<" ns : " << settime );
if (m_add_cL){
settime += particle4Position.rho()/CLHEP::c_light;
}
particle4Position.setT(settime*CLHEP::c_light); // ct in mm
}
......
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
*/
......@@ -105,7 +105,7 @@ StatusCode SiTrkAlignDBTool::initialize() {
// Si alignment database tool
if ( m_IDAlignDBTool.retrieve().isFailure() ) {
msg(MSG::FATAL) << "Can not retrieve IDAlignDBTool of type " << m_IDAlignDBTool.typeAndName() << endreq;
ATH_MSG_FATAL("SiTrkAlignDBTool::initialize() -> Can not retrieve IDAlignDBTool of type " << m_IDAlignDBTool.typeAndName());
return StatusCode::FAILURE;
}
else
......@@ -113,7 +113,7 @@ StatusCode SiTrkAlignDBTool::initialize() {
// get AlignModuleTool
if( m_alignModuleTool.retrieve().isFailure() ) {
msg(MSG::FATAL) << " Could not retrieve " << m_alignModuleTool << endreq;
ATH_MSG_FATAL("SiTrkAlignDBTool::initialize() -> Could not retrieve " << m_alignModuleTool);
return StatusCode::FAILURE;
}
else
......@@ -121,7 +121,7 @@ StatusCode SiTrkAlignDBTool::initialize() {
// retrieve Pixel helper
if ( detStore()->retrieve(m_pixHelper).isFailure() ) {
msg(MSG::FATAL) << " Cannot retrieve Pixel Helper " << endreq;
ATH_MSG_FATAL("SiTrkAlignDBTool::initialize() -> Cannot retrieve Pixel Helper ");
return StatusCode::FAILURE;
}
else
......@@ -129,14 +129,14 @@ StatusCode SiTrkAlignDBTool::initialize() {
// retrieve SCT helper
if ( detStore()->retrieve(m_sctHelper).isFailure() ) {
msg(MSG::FATAL) << " Cannot retrieve SCT Helper " << endreq;
ATH_MSG_FATAL("SiTrkAlignDBTool::initialize() -> Cannot retrieve SCT Helper ");
return StatusCode::FAILURE;
}
else
ATH_MSG_INFO("retrieved Silicon SCT Helper");
if (detStore()->retrieve(m_idHelper, "AtlasID").isFailure()) {
msg(MSG::FATAL) << "Could not get AtlasDetectorID helper" << endreq;
ATH_MSG_FATAL("SiTrkAlignDBTool::initialize() -> Could not get AtlasDetectorID helper");
return StatusCode::FAILURE;
}
......@@ -145,7 +145,7 @@ StatusCode SiTrkAlignDBTool::initialize() {
// get SiGeometryManagerTool
if( !m_siGeoManager.empty() ) {
if( m_siGeoManager.retrieve().isFailure() ) {
msg(MSG::FATAL) << " Could not retrieve " << m_siGeoManager << endreq;
ATH_MSG_FATAL("SiTrkAlignDBTool::initialize() -> Could not retrieve " << m_siGeoManager);
return StatusCode::FAILURE;
}
......@@ -156,7 +156,7 @@ StatusCode SiTrkAlignDBTool::initialize() {
// check alignment level but don't stop on error
// if unknown level given, set to -1
if(!checkSiLevel()) {
msg(MSG::WARNING)<<" Storing of alignment constants for level "<<m_siAlignLevel<<" for Silicon is not implemented."<<endreq;
ATH_MSG_FATAL("SiTrkAlignDBTool::initialize() -> Storing of alignment constants for level "<<m_siAlignLevel<<" for Silicon is not implemented.");
m_siAlignLevel=-1;
}
}
......@@ -167,7 +167,7 @@ StatusCode SiTrkAlignDBTool::initialize() {
// get PixelGeometryManagerTool
if( !m_pixelGeoManager.empty() ) {
if( m_pixelGeoManager.retrieve().isFailure() ) {
msg(MSG::FATAL) << " Could not retrieve " << m_pixelGeoManager << endreq;
ATH_MSG_FATAL("SiTrkAlignDBTool::initialize() -> Could not retrieve " << m_pixelGeoManager);
return StatusCode::FAILURE;
}
......@@ -175,7 +175,7 @@ StatusCode SiTrkAlignDBTool::initialize() {
m_pixelAlignLevel = m_pixelGeoManager->alignLevel();
m_pixelAlignLevelBarrel = m_pixelGeoManager->alignLevelBarrel();
m_pixelAlignLevelEndcaps = m_pixelGeoManager->alignLevelEndcaps();
// m_pixelaAlignDBM = m_pixelGeoManager->alignDBM();
ATH_MSG_DEBUG("Retrieved Pixel Global alignment level: "<<m_pixelAlignLevel);
ATH_MSG_DEBUG("Retrieved Pixel Barrel alignment level: "<<m_pixelAlignLevelBarrel);
ATH_MSG_DEBUG("Retrieved Pixel Endcap alignment level: "<<m_pixelAlignLevelEndcaps);
......@@ -190,15 +190,14 @@ StatusCode SiTrkAlignDBTool::initialize() {
// check alignment level but don't stop on error
if(!checkPixelLevel()) {
msg(MSG::FATAL)<<" Pixel alignment level not given."<<endreq;
// return StatusCode::FAILURE;
ATH_MSG_FATAL("SiTrkAlignDBTool::initialize() -> Pixel alignment level not given.");
}
}
// get SCTGeometryManagerTool
if( !m_sctGeoManager.empty() ) {
if( m_sctGeoManager.retrieve().isFailure() ) {
msg(MSG::FATAL) << " Could not retrieve " << m_sctGeoManager << endreq;
ATH_MSG_FATAL("SiTrkAlignDBTool::initialize() -> Could not retrieve " << m_sctGeoManager);
return StatusCode::FAILURE;
}
......@@ -210,7 +209,7 @@ StatusCode SiTrkAlignDBTool::initialize() {
ATH_MSG_DEBUG("Retrieved SCT Barrel alignment level: "<<m_sctAlignLevelBarrel);
ATH_MSG_DEBUG("Retrieved SCT Endcap alignment level: "<<m_sctAlignLevelEndcaps);
if(m_sctAlignLevel == 0)
if(m_sctAlignLevel == 0)
ATH_MSG_INFO(" Requested update of Level "<<m_sctAlignLevel<<" alignment constants for SCT");
else {
ATH_MSG_INFO(" Requested update of Level "<<m_sctAlignLevelBarrel<<" alignment constants for SCT Barrel");
......@@ -219,15 +218,14 @@ StatusCode SiTrkAlignDBTool::initialize() {
// check alignment level but don't stop on error
if(!checkSCTLevel()) {
msg(MSG::FATAL)<<" SCT alignment level not given."<<endreq;
// return StatusCode::FAILURE;
ATH_MSG_FATAL("SiTrkAlignDBTool::initialize() -> SCT alignment level not given.");
}
}
// if we're here it means that we need at least one the two managers
if(m_pixelAlignLevel<0 && m_pixelAlignLevelBarrel<0 && m_pixelAlignLevelEndcaps<0
&& m_sctAlignLevel<0 && m_sctAlignLevelBarrel<0 && m_sctAlignLevelEndcaps<0) {
msg(MSG::FATAL) << " No geometry manager available or alignment level not given. " << endreq;
ATH_MSG_FATAL("SiTrkAlignDBTool::initialize() -> No geometry manager available or alignment level not given. ");
// we don't want to stop if there's errors
// so we comment out the return statement
// return StatusCode::FAILURE;
......@@ -245,11 +243,10 @@ StatusCode SiTrkAlignDBTool::initialize() {
ATH_MSG_INFO(" Storing IBLDist as level 16 constants in separate DB");
if(!m_doPixel && !m_doSCT && !m_doSi) {
msg(MSG::FATAL)<<" No geometry manager available or alignment level not given."<<endreq;
msg(MSG::FATAL)<<" DB not updated."<<endreq;
// return;
ATH_MSG_FATAL(" No geometry manager available or alignment level not given.");
ATH_MSG_FATAL(" WARNING -> DB not updated.");
}
ATH_MSG_DEBUG("Made it till here..... "<<m_doSi<<" "<<m_doPixel<<" "<<m_doSCT);
ATH_MSG_DEBUG("SiTrkAlignDBTool::initialize() -> Made it till here..... "<<m_doSi<<" "<<m_doPixel<<" "<<m_doSCT);
ATH_MSG_DEBUG("update constants..... "<<m_updateConstants);
return StatusCode::SUCCESS;
}
......@@ -298,9 +295,10 @@ bool SiTrkAlignDBTool::checkPixelLevel()
switch(m_pixelAlignLevelBarrel) {
case 11: case 12: case 15: case 16: case 2: case 22: case 26: case 27: case 3:
ok = true;
ATH_MSG_INFO("Storing alignment constants for m_pixelAlignLevelBarrel as level "<< m_pixelAlignLevelBarrel);
break;
default:
msg(MSG::ERROR)<<" Storing of alignment constants for level "<<m_pixelAlignLevelBarrel<<" for Pixel Barrel is not implemented."<<endreq;
ATH_MSG_ERROR(" Storing of alignment constants for level "<<m_pixelAlignLevelBarrel<<" for Pixel Barrel is not implemented.");
m_pixelAlignLevelBarrel = -1;
ok = false;
break;
......@@ -311,7 +309,7 @@ bool SiTrkAlignDBTool::checkPixelLevel()
ok = ok && true;
break;
default:
msg(MSG::ERROR)<<" Storing of alignment constants for level "<<m_pixelAlignLevelEndcaps<<" for Pixel Endcaps is not implemented."<<endreq;
ATH_MSG_ERROR(" Storing of alignment constants for level "<<m_pixelAlignLevelEndcaps<<" for Pixel Endcaps is not implemented.");
m_pixelAlignLevelEndcaps = -1;
ok = false;
break;
......@@ -334,25 +332,25 @@ bool SiTrkAlignDBTool::checkSCTLevel()
bool ok = false;
switch(m_sctAlignLevelBarrel) {
case 1: case 2: case 27: case 3:
ok = true;
break;
default:
msg(MSG::ERROR)<<" Storing of alignment constants for level "<<m_sctAlignLevelBarrel<<" for SCT Barrel is not implemented."<<endreq;
m_sctAlignLevelBarrel = -1;
ok = false;
break;
case 1: case 2: case 25: case 27: case 3:
ok = true;
break;
default:
ATH_MSG_ERROR("SiTrkAlignDBTool -> Storing of alignment constants for level "<<m_sctAlignLevelBarrel<<" for SCT Barrel is not implemented.");
m_sctAlignLevelBarrel = -1;
ok = false;
break;
}
switch(m_sctAlignLevelEndcaps) {
case 1: case 2: case 25: case 3:
ok = ok && true;
break;
default:
msg(MSG::ERROR)<<" Storing of alignment constants for level "<<m_sctAlignLevelEndcaps<<" for SCT Endcaps is not implemented."<<endreq;
m_sctAlignLevelEndcaps = -1;
ok = false;
break;
case 1: case 2: case 25: case 3:
ok = ok && true;
break;
default:
ATH_MSG_ERROR("SiTrkAlignDBTool -> Storing of alignment constants for level "<<m_sctAlignLevelEndcaps<<" for SCT Endcaps is not implemented.");
m_sctAlignLevelEndcaps = -1;
ok = false;
break;
}
return ok;
......@@ -607,7 +605,7 @@ void SiTrkAlignDBTool::updateDB()
if( m_IDAlignDBTool->setTrans(modID, level, dbtransform) )
ATH_MSG_INFO("Module \'"<<module->name()<<"\': Level "<<level<<" constants updated.");
else
msg(MSG::ERROR)<<"Error setting level "<<level<<" constants for module "<<module->name()<<endreq;
ATH_MSG_ERROR("Error setting level "<<level<<" constants for module "<<module->name());
}
}
......@@ -622,7 +620,7 @@ void SiTrkAlignDBTool::updateSiL0asL1(Identifier idL0, const Amg::Transform3D &
// the id has to be equal to L1 Pixel ID for Silicon level 0 update
// or to SCT barrel L1 ID for SCT level 0 update
if( idL0 != m_pixHelper->wafer_id(0,0,0,0) && idL0 != m_sctHelper->wafer_id(0,0,0,0,0) ) {
msg(MSG::ERROR)<<"wrong identifier for L0 Silicon in updateSiL0asL1()"<<endreq;
ATH_MSG_ERROR("wrong identifier for L0 Silicon in updateSiL0asL1()");
return;
}
......@@ -642,7 +640,7 @@ void SiTrkAlignDBTool::updateSiL0asL1(Identifier idL0, const Amg::Transform3D &
// set replaces the transform in the DB
ATH_MSG_INFO("Call to tweak failed. Constants probably don't exist yet. Use set instead.");
if( !m_IDAlignDBTool->setTrans(idPixel, 1, transform) )
msg(MSG::ERROR)<<"Error setting constants."<<endreq;
ATH_MSG_ERROR("Error setting constants.");
}
}
else
......@@ -663,7 +661,7 @@ void SiTrkAlignDBTool::updateSiL0asL1(Identifier idL0, const Amg::Transform3D &
// set replaces the transform in the DB
ATH_MSG_INFO("Module "<<i<<". - id "<<ids[i]<<": Call to tweak failed. Constants probably don't exist yet. Use set instead.");
if( !m_IDAlignDBTool->setTrans(ids[i], 1, transform) )
msg(MSG::ERROR)<<"Error setting constants."<<endreq;
ATH_MSG_ERROR("Error setting constants.");
}
}
}
......@@ -740,17 +738,16 @@ void SiTrkAlignDBTool::updateAsL3(const Trk::AlignModule * module, const Amg::Tr
// This should work as Bowing is in DB frame, i.e. local module frame
// This implementation is need in the CL as of Oct2015;
// For now, just comment for offline
/**
if (apBowX!=0){
double z = sielem->center()[2];
const double y0y0 = 366.5*366.5;
//ATH_MSG_DEBUG("Z position : "<< z);
double bowx = apBowX * ( z*z - y0y0 ) / y0y0;
ATH_MSG_DEBUG("Z position: "<< z << " apBowX:" << apBowX << " bowx: " << bowx);
// This is in the module frame, as bowing corrections are directly L3
Amg::Translation3D translation_bow(bowx , 0, 0 );
dbtransform *= translation_bow;
}
**/
// Amg::Translation3D translation_bow(bowx , 0, 0 );
// dbtransform *= translation_bow;
}
ATH_MSG_DEBUG("DB transform");
printTransform(dbtransform);
......@@ -758,7 +755,7 @@ void SiTrkAlignDBTool::updateAsL3(const Trk::AlignModule * module, const Amg::Tr
if( !(m_IDAlignDBTool->tweakTrans(elemID, level, dbtransform)) ) {
// set replaces the transform in the DB
if( !(m_IDAlignDBTool->setTrans(elemID, level, dbtransform)) )
msg(MSG::ERROR)<<"Error setting level "<<level<<" constants for element "<<elemID<<" in module "<<module->name()<<endreq;
ATH_MSG_ERROR("Error setting level "<<level<<" constants for element "<<elemID<<" in module "<<module->name());
}
} // end loop over detElements
ATH_MSG_DEBUG("-----------------------------------------------------");
......@@ -826,7 +823,7 @@ void SiTrkAlignDBTool::updateAsL2(const Trk::AlignModule * module, const Amg::Tr
if( !(m_IDAlignDBTool->tweakTrans(level_mod, level, dbtransform)) ) {
// set replaces the transform in the DB
if( !(m_IDAlignDBTool->setTrans(level_mod, level, dbtransform)) )
msg(MSG::ERROR)<<"Error setting level "<<level<<" constants for element "<<level_mod<<" in module "<<module->name()<<endreq;
ATH_MSG_INFO("Error setting level "<<level<<" constants for element "<<level_mod<<" in module "<<module->name() );
}
}
else {
......@@ -872,7 +869,7 @@ void SiTrkAlignDBTool::updateAsL16(const Trk::AlignModule * module, double bowx)
// tweak applies the transform onto already existing transform in the DB
if( !(m_IDAlignDBTool->tweakIBLDist(this_stave_phi,bowx)) ) {
msg(MSG::ERROR)<<"Error tweaking IBLDist DB for stave "<<this_stave_phi<<endreq;
ATH_MSG_INFO("Error tweaking IBLDist DB for stave "<<this_stave_phi);
}
}
else {
......
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
*/
#ifndef INDETALIGNGEOMTOOLS_SCTGEOMETRYMANAGERTOOL_H
......@@ -92,6 +92,9 @@ namespace InDet
/** creates L2 AlignModules for SCT barrel */
void buildL2Barrel();
/** creates L25 AlignModules for SCT barrel */
void buildL25Barrel();
/** creates L27 AlignModules for SCT barrel */
void buildL27Barrel();
......
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
*/
#include "AthContainers/DataVector.h"
......@@ -213,8 +213,8 @@ namespace InDet {
// check whether geometry level is allowed
switch(m_alignLevelBarrel) {
case 1: case 2: case 27: case 3:
ATH_MSG_INFO("Alignment level for SCT Barrel is "<<m_alignLevelBarrel);
case 1: case 2: case 25: case 27: case 3:
ATH_MSG_INFO("Alignment level for SCT Barrel is "<<m_alignLevelBarrel);
return true;
default:
msg(MSG::FATAL)<<"Alignment level "<<m_alignLevelBarrel<<" does not exist for SCT Barrel"<<endmsg;
......@@ -301,6 +301,9 @@ namespace InDet {
case 2:
buildL2Barrel();
break;
case 25:
buildL25Barrel();
break;
case 27:
buildL27Barrel();
break;
......@@ -374,7 +377,7 @@ namespace InDet {
// get the element via hash
SiDetectorElement * element2 = m_detManager->getDetectorElement(id);
if (element2) {
const Trk::TrkDetElementBase * element = (const Trk::TrkDetElementBase*) element2;
const Trk::TrkDetElementBase * element = dynamic_cast<const Trk::TrkDetElementBase *> (element2);
// add element to respective AlignModule
......@@ -454,7 +457,7 @@ namespace InDet {
for (int is = 0; is < 2; is++) { // module side
const SiDetectorElement * element2 = m_detManager->getDetectorElement(0, iLayer, iPhi, iEta, is);
const Trk::TrkDetElementBase * element = (const Trk::TrkDetElementBase*) element2;
const Trk::TrkDetElementBase * element = dynamic_cast<const Trk::TrkDetElementBase *> (element2);
if (element) {
// get element location for debugging
......@@ -528,7 +531,7 @@ namespace InDet {
for(int is=0; is<2; is++) { // module side
const SiDetectorElement * element2 = m_detManager->getDetectorElement(iSide, iWheel, iPhi, iEta, is);
const Trk::TrkDetElementBase * element = (const Trk::TrkDetElementBase*) element2;
const Trk::TrkDetElementBase * element = dynamic_cast<const Trk::TrkDetElementBase *> (element2);
if (element) {
// get element location for debugging
// HepGeom::Point3D<double> center = element->transform() * HepGeom::Point3D<double>();
......@@ -609,7 +612,7 @@ namespace InDet {
for (int is = 0; is < 2; is++) { // module side
const SiDetectorElement * element2 = m_detManager->getDetectorElement(0, iLayer, iPhi, iEta, is);
const Trk::TrkDetElementBase * element = (const Trk::TrkDetElementBase*) element2;
const Trk::TrkDetElementBase * element = dynamic_cast<const Trk::TrkDetElementBase *> (element2);
if (element) {
// get element location for debugging
......@@ -630,6 +633,102 @@ namespace InDet {
}
}
//_______________________________________________________________________
void SCTGeometryManagerTool::buildL25Barrel()
{
// ========================================
// BARREL
ATH_MSG_INFO("Preparing the SCT Barrel geometry for L25: 48 rings (12 eta rings x 4 layers)");
if(!m_alignBarrel) {
ATH_MSG_INFO("Warning SCT barrel not being aligned");
return;
}
// ========================================
// get all modules for Level 25 alignment of the Barrel
// 48 staves (ladders)
const Amg::Transform3D transform = Amg::Transform3D::Identity();
unsigned int maxHash = m_idHelper->wafer_hash_max();
ATH_MSG_DEBUG("maxHash for the SCT "<<maxHash);
if(!m_idHashToAlignModuleMapsPtr->at(Trk::AlignModule::SCT))
m_idHashToAlignModuleMapsPtr->at(Trk::AlignModule::SCT) = new Trk::AlignModuleList(static_cast<size_t>(maxHash),0);
Trk::AlignModuleList * sctIdHashMap = m_idHashToAlignModuleMapsPtr->at(Trk::AlignModule::SCT);
for (int iLayer = 0; iLayer < m_detManager->numerology().numLayers(); iLayer++) {
if (!m_detManager->numerology().useLayer(iLayer))
ATH_MSG_INFO(" Layer "<<iLayer<<" not present");
for (int iEta = m_detManager->numerology().beginEtaModuleForLayer(iLayer); iEta < m_detManager->numerology().endEtaModuleForLayer(iLayer); iEta++) {
if (!iEta && m_detManager->numerology().skipEtaZeroForLayer(iLayer))
continue;
ATH_MSG_DEBUG("iEta "<<iEta);
// create the AlignModule
Trk::AlignModule * mod = new Trk::AlignModule(this);
mod->setIdHash(getNextIDHash());
// even though there is no iEta=0 module for SCT barrel, the
// Identifier is still valid so we use it for the stave
mod->setIdentifier(m_idHelper->wafer_id(0, iLayer, 0, iEta, 0));
std::stringstream name;
name <<"SCT/Barrel/Layer_"<<iLayer<<"/EtaRing_"<<iEta;
mod->setName(name.str());
if(!moduleSelected(mod)) {
ATH_MSG_DEBUG("Module "<<mod->name()<<" NOT selected");
delete mod;
continue;
}
ATH_MSG_DEBUG("Building module "<<mod->name());
// rotation of the stave alignment frame
Amg::RotationMatrix3D rotation; rotation.setIdentity();
for (int iPhi = 0; iPhi < m_detManager->numerology().numPhiModulesForLayer(iLayer); iPhi++) {
ATH_MSG_DEBUG("iPhi "<<iPhi);
for (int is = 0; is < 2; is++) { // module side
const SiDetectorElement * element2 = m_detManager->getDetectorElement(0, iLayer, iPhi, iEta, is);
const Trk::TrkDetElementBase * element = dynamic_cast<const Trk::TrkDetElementBase *> (element2);
if (element) {
// add element to the AlignModule
mod->addDetElement(Trk::AlignModule::SCT,element,transform);
// and fill the corresponding map
(*sctIdHashMap)[element->identifyHash()] = mod;
}
// for the eta-ring alignment frame rotation we use the one of the iPhi=0 (stave 0)
// non-stereo side (which is the module local frame)
if(iEta==0 && !element2->isStereo())
rotation = element2->moduleTransform().rotation();
}
}
// we set the alignment frame to be the CoG of the stave
// with rotation being the one of the iEta=1 module set above
Amg::Translation3D translation(mod->centerOfGravity());
Amg::Transform3D localToGlobal = translation * rotation;
ATH_MSG_DEBUG("Prepared local to global transform :");
ATH_MSG_DEBUG(" - translation: "<<localToGlobal.translation().x()<<" "<<localToGlobal.translation().y()<<" "<<localToGlobal.translation().z());
ATH_MSG_DEBUG(" - rotation:");
ATH_MSG_DEBUG(" "<<localToGlobal.rotation()(0,0)<<" "<<localToGlobal.rotation()(0,1)<<" "<<localToGlobal.rotation()(0,2));
ATH_MSG_DEBUG(" "<<localToGlobal.rotation()(1,0)<<" "<<localToGlobal.rotation()(1,1)<<" "<<localToGlobal.rotation()(1,2));
ATH_MSG_DEBUG(" "<<localToGlobal.rotation()(2,0)<<" "<<localToGlobal.rotation()(2,1)<<" "<<localToGlobal.rotation()(2,2));
mod->setGlobalFrameToAlignFrameTransform(localToGlobal.inverse());
m_alignModuleListPtr->push_back(mod);
}
}
}
//_______________________________________________________________________
void SCTGeometryManagerTool::buildL27Barrel()
{
......@@ -692,7 +791,7 @@ namespace InDet {
for (int is = 0; is < 2; is++) { // module side
const SiDetectorElement * element2 = m_detManager->getDetectorElement(0, iLayer, iPhi, iEta, is);
const Trk::TrkDetElementBase * element = (const Trk::TrkDetElementBase*) element2;
const Trk::TrkDetElementBase * element = dynamic_cast<const Trk::TrkDetElementBase *> (element2);
if (element) {
// get element location for debugging
......@@ -785,7 +884,7 @@ namespace InDet {
for(int is=0; is<2; is++) { // module side
const SiDetectorElement * element2 = m_detManager->getDetectorElement(iSide, iWheel, iPhi, iEta, is);
const Trk::TrkDetElementBase * element = (const Trk::TrkDetElementBase*) element2;
const Trk::TrkDetElementBase * element = dynamic_cast<const Trk::TrkDetElementBase *> (element2);
if (element) {
// get element location for debugging
// HepGeom::Point3D<double> center = element->transform() * HepGeom::Point3D<double>();
......@@ -869,7 +968,7 @@ namespace InDet {
for(int is=0; is<2; is++) { // module side
const SiDetectorElement * element2 = m_detManager->getDetectorElement(iSide, iWheel, iPhi, iEta, is);
const Trk::TrkDetElementBase * element = (const Trk::TrkDetElementBase*) element2;
const Trk::TrkDetElementBase * element = dynamic_cast<const Trk::TrkDetElementBase *> (element2);
if (element) {
// get element location for debugging
// HepGeom::Point3D<double> center = element->transform() * HepGeom::Point3D<double>();
......@@ -942,7 +1041,7 @@ namespace InDet {
ATH_MSG_DEBUG("iPhi "<<iPhi);
for(int is=0; is<2; is++) { // module side
const SiDetectorElement * element2 = m_detManager->getDetectorElement(iSide, iWheel, iPhi, iEta, is);
const Trk::TrkDetElementBase * element = (const Trk::TrkDetElementBase*) element2;
const Trk::TrkDetElementBase * element = dynamic_cast<const Trk::TrkDetElementBase *> (element2);
if (element) {
// get element location for debugging
// HepGeom::Point3D<double> center = element->transform() * HepGeom::Point3D<double>();
......@@ -999,7 +1098,7 @@ namespace InDet {
for (int is = 0; is < 2; is++) { // module side
const SiDetectorElement * element2 = m_detManager->getDetectorElement(0, iLayer, iPhi, iEta, is);
const Trk::TrkDetElementBase * element = (const Trk::TrkDetElementBase*) element2;
const Trk::TrkDetElementBase * element = dynamic_cast<const Trk::TrkDetElementBase *> (element2);
if (element) {
// get element location for debugging
......@@ -1048,7 +1147,7 @@ namespace InDet {
ATH_MSG_DEBUG("iPhi "<<iPhi);
for(int is=0; is<2; is++) { // module side
const SiDetectorElement * element2 = m_detManager->getDetectorElement(iSide, iWheel, iPhi, iEta, is);
const Trk::TrkDetElementBase * element = (const Trk::TrkDetElementBase*) element2;
const Trk::TrkDetElementBase * element = dynamic_cast<const Trk::TrkDetElementBase *> (element2);
if (element) {
// get element location for debugging
// HepGeom::Point3D<double> center = element->transform() * HepGeom::Point3D<double>();
......@@ -1125,7 +1224,7 @@ namespace InDet {
for(int is=0;is<2;is++) { // module side
const SiDetectorElement * element2 = m_detManager->getDetectorElement(0, iLayer, iPhi, iEta, is);
const Trk::TrkDetElementBase * element = (const Trk::TrkDetElementBase*) element2;
const Trk::TrkDetElementBase * element = dynamic_cast<const Trk::TrkDetElementBase *> (element2);
if (element) {
// get element location for debugging
......@@ -1212,7 +1311,7 @@ namespace InDet {
for(int is=0; is<2; is++) { // module side
const SiDetectorElement * element2 = m_detManager->getDetectorElement(iSide, iWheel, iPhi, iEta, is);
const Trk::TrkDetElementBase * element = (const Trk::TrkDetElementBase*) element2;
const Trk::TrkDetElementBase * element = dynamic_cast<const Trk::TrkDetElementBase *> (element2);
if (element) {
// get element location for debugging
// HepGeom::Point3D<double> center = element->transform() * HepGeom::Point3D<double>();
......
......@@ -485,6 +485,10 @@ void TRTProcessingOfStraw::ProcessStraw ( hitCollConstIter i,
{
particleCharge = (particleEncoding>0 ? 1. : -1.) *(((abs(particleEncoding) / 100000.0) - 100.0) * 1000.0);
}
else if ((static_cast<int>(abs(particleEncoding)/10000000) == 2) && (static_cast<int>(abs(particleEncoding)/100000)==200))
{
particleCharge = (particleEncoding>0 ? 1. : -1.) *((double)((abs(particleEncoding) / 1000) % 100) / (double)((abs(particleEncoding) / 10) % 100));
}
}
else
{
......
......@@ -50,6 +50,22 @@ ToolSvc += InDetxAODParticleCreatorTool
if InDetFlags.doPrintConfigurables():
print InDetxAODParticleCreatorTool
def createTrackParticlesFromTracks(track_collection, track_particle_collection) :
creator_alg = xAODMaker__TrackParticleCnvAlg(track_particle_collection+"Creator",
xAODContainerName = track_particle_collection,
xAODTrackParticlesFromTracksContainerName = track_particle_collection,
TrackContainerName = track_collection,
TrackParticleCreator = InDetxAODParticleCreatorTool,
AODContainerName = "",
AODTruthContainerName = "",
ConvertTrackParticles = doConversion,
ConvertTracks = doCreation,
AddTruthLink = False,
TrackTruthContainerName = "",
PrintIDSummaryInfo = True)
return creator_alg
if (doCreation or doConversion):# or InDetFlags.useExistingTracksAsInput()) : <---- [XXX JDC Should we included this?
# problems appear when nothing should
# be done but
......@@ -74,6 +90,13 @@ if (doCreation or doConversion):# or InDetFlags.useExistingTracksAsInput()) : <-
xAODTrackParticleCnvAlg.TrackTruthContainerName = InputTrackCollectionTruth
xAODTrackParticleCnvAlg.PrintIDSummaryInfo = True
topSequence += xAODTrackParticleCnvAlg
from InDetPhysValMonitoring.InDetPhysValJobProperties import InDetPhysValFlags
from InDetPhysValMonitoring.ConfigUtils import extractCollectionPrefix
for col in InDetPhysValFlags.validateExtraTrackCollections() :
prefix=extractCollectionPrefix(col)
topSequence += createTrackParticlesFromTracks(prefix+"Tracks",prefix+"TrackParticles")
if InDetFlags.doDBMstandalone() or InDetFlags.doDBM():
xAODDBMTrackParticleCnvAlg = xAODMaker__TrackParticleCnvAlg(InDetKeys.xAODDBMTrackParticleContainer())
xAODDBMTrackParticleCnvAlg.xAODContainerName = InDetKeys.xAODDBMTrackParticleContainer()
......@@ -107,6 +130,7 @@ if not InDetFlags.doVertexFinding():
xAODVertexCnvAlgDBM.TPContainerName = InDetKeys.xAODDBMTrackParticleContainer()
topSequence += xAODVertexCnvAlgDBM
#For forward tracks, no separate collection for ITK, since they are already merged
if (InDetFlags.doForwardTracks() and InDetFlags.doParticleCreation() and not InDetFlags.doSLHC()) or doConversion:
xAODForwardTrackParticleCnvAlg = xAODMaker__TrackParticleCnvAlg(InDetKeys.xAODForwardTrackParticleContainer())
......
......@@ -17,6 +17,12 @@ if InDetFlags.doxAOD():
excludedAuxData = "-caloExtension.-cellAssociation.-clusterAssociation"
InDetAODList+=['xAOD::TrackParticleContainer#'+InDetKeys.xAODTrackParticleContainer()]
InDetAODList+=['xAOD::TrackParticleAuxContainer#'+InDetKeys.xAODTrackParticleContainer()+'Aux.' + excludedAuxData]
from InDetPhysValMonitoring.InDetPhysValJobProperties import InDetPhysValFlags
from InDetPhysValMonitoring.ConfigUtils import extractCollectionPrefix
for col in InDetPhysValFlags.validateExtraTrackCollections() :
prefix=extractCollectionPrefix(col)
InDetAODList+=['xAOD::TrackParticleContainer#'+prefix+'TrackParticles']
InDetAODList+=['xAOD::TrackParticleAuxContainer#'+prefix+'TrackParticlesAux.' + excludedAuxData]
if not InDetFlags.doSLHC():
InDetAODList+=['xAOD::TrackParticleContainer#'+InDetKeys.xAODForwardTrackParticleContainer()]
InDetAODList+=['xAOD::TrackParticleAuxContainer#'+InDetKeys.xAODForwardTrackParticleContainer()+'Aux.' + excludedAuxData]
......
......@@ -159,6 +159,13 @@ if InDetFlags.doxAOD():
InDetESDList+=['xAOD::TrackParticleContainer#'+InDetKeys.xAODTrackParticleContainer()]
InDetESDList+=['xAOD::TrackParticleAuxContainer#'+InDetKeys.xAODTrackParticleContainer()+'Aux.' + excludedAuxData]
from InDetPhysValMonitoring.InDetPhysValJobProperties import InDetPhysValFlags
from InDetPhysValMonitoring.ConfigUtils import extractCollectionPrefix
for col in InDetPhysValFlags.validateExtraTrackCollections() :
prefix=extractCollectionPrefix(col)
InDetESDList+=['xAOD::TrackParticleContainer#'+prefix+'TrackParticles']
InDetESDList+=['xAOD::TrackParticleAuxContainer#'+prefix+'TrackParticlesAux.' + excludedAuxData]
if InDetFlags.doStoreTrackSeeds():
InDetESDList+=['xAOD::TrackParticleContainer#'+InDetKeys.SiSPSeedSegments()+"TrackParticle"]
InDetESDList+=['xAOD::TrackParticleAuxContainer#'+InDetKeys.SiSPSeedSegments()+"TrackParticle"+'Aux.' + excludedAuxData]
......
# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
def dumpConfigurables(obj) :
print '==== %s ====' % obj.name()
......@@ -12,61 +12,12 @@ def dumpConfigurables(obj) :
except :
print ' %s not an attribute' % (cfg)
def injectNameArgument(inFunction):
configurable_base_classes = ['ConfigurableAlgTool','ConfigurableAlgorithm']
'''
Auxiliary method to inject a name argument in the keyword argument dictionary
'''
def setConfigurables(_cls) :
class_stack = [_cls]
the_base_class = None
while len(class_stack) > 0 :
the_class = class_stack.pop()
for base in the_class.__bases__ :
if base.__name__ in configurable_base_classes :
_cls.configurables = the_class.configurables
break
class_stack.append(base)
return
def outFunction(*args,**kwargs):
_cls = args[0]
# set the name argument to be equal to the class name
import copy
kw_cp=copy.copy(kwargs)
kw_cp['name']=_cls.__name__
if len(_cls.configurables)==0 :
setConfigurables(_cls)
return inFunction(*args,**kw_cp)
return outFunction
def checkKWArgs(inFunction):
'''
Auxiliary method to check that only a name kw arg is given.
'''
def outFunction(*args,**kwargs):
if len(kwargs)>1 or kwargs.keys()[0] != 'name' :
raise(' No keyword arguments shall be given')
return inFunction(*args,**kwargs)
return outFunction
def _args( kwargs, **extra_kwargs) :
import copy
_kwargs = copy.copy(kwargs)
for kw in extra_kwargs :
_kwargs[kw] = extra_kwargs[kw]
return _kwargs;
def extractCollectionPrefix(track_collection_name) :
return track_collection_name[:-6] if track_collection_name[-6:] == 'Tracks' else track_collection_name
def setDefaults( kwargs, **extra_kwargs) :
extra_kwargs.update(kwargs)
return extra_kwargs
def toolFactory( tool_class ):
from AthenaCommon.AppMgr import ToolSvc
......
# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
from ConfigUtils import injectNameArgument,checkKWArgs,_args
from ConfigUtils import setDefaults
#,dumpConfigurables
import InDetPhysValMonitoring.InDetPhysValMonitoringConf
class HistogramDefinitionSvc(object) :
def getHistogramDefinitionSvc(**kwargs) :
'''
Namespace for Histogram definition services
Default HistogramDefinitionSvc
'''
def __init__(self) :
raise('must not be instantiated. Only child classes should be instantiated.')
class HistogramDefinitionSvc(InDetPhysValMonitoring.InDetPhysValMonitoringConf.HistogramDefinitionSvc) :
'''
Default HistogramDefinitionSvc
'''
@injectNameArgument
def __new__(cls, *args, **kwargs) :
return InDetPhysValMonitoring.InDetPhysValMonitoringConf.HistogramDefinitionSvc.__new__(cls,*args,**kwargs)
@checkKWArgs
def __init__(self, **kwargs) :
super(HistogramDefinitionSvc.HistogramDefinitionSvc,self)\
.__init__(**_args( kwargs,
name = self.__class__.__name__))
# special parameters of the default HistogramDefinitionSvc
self.DefinitionSource="InDetPVMPlotDefRun2.xml"
self.DefinitionFormat="text/xml"
kwargs = setDefaults(kwargs,
DefinitionSource="InDetPVMPlotDefRun2.xml",
DefinitionFormat="text/xml")
return InDetPhysValMonitoring.InDetPhysValMonitoringConf.HistogramDefinitionSvc(**kwargs)
# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
# block('InDetPhysValMonitoring/InDetPhysValDecoration.py')
import ConfigUtils
......@@ -96,106 +96,43 @@ def setMetaData() :
# print 'DEBUG add meta data %s.' % svcMgr.TagInfoMgr.ExtraTagValuePairs
from ConfigUtils import _args
from ConfigUtils import injectNameArgument
from ConfigUtils import setDefaults
from ConfigUtils import dumpConfigurables
from ConfigUtils import checkKWArgs
from ConfigUtils import toolFactory
from InDetTrackHoleSearch.InDetTrackHoleSearchConf import InDet__InDetTrackHoleSearchTool
class InDetHoleSearchTool(object) :
'''
Namespace for inner detector hole search tools
'''
def __init__(self) :
raise('must not be instantiated. Only child classes should be instantiated.')
class PhysValMonInDetHoleSearchTool(InDet__InDetTrackHoleSearchTool) :
'''
default inner detector hole search tool
'''
@injectNameArgument
def __new__(cls, *args, **kwargs) :
# if cls.__name__ in cls.configurables :
# print 'WARNING configurable %s exists already ' % cls.__name__
return InDet__InDetTrackHoleSearchTool.__new__(cls,*args,**kwargs)
@checkKWArgs
def __init__(self, **kwargs) :
from AthenaCommon.AppMgr import ToolSvc, ServiceMgr
# If InDetSCT_ConditionsSummarySvc instance configured by InDetRecConditionsAccess.py is available, use it.
# Otherwise, the default SCT_ConditionsSummarySvc instance is used.
# @TODO find a better to solution to get the correct service for the current job.
SctSummarySvc = "InDetSCT_ConditionsSummarySvc"
if not hasattr(ServiceMgr, SctSummarySvc):
SctSummarySvc = "SCT_ConditionsSummarySvc"
from InDetRecExample.InDetJobProperties import InDetFlags
super(InDetHoleSearchTool.PhysValMonInDetHoleSearchTool,self).__init__(**_args( kwargs,
name = self.__class__.__name__,
Extrapolator = ToolSvc.InDetExtrapolator,
SctSummarySvc = SctSummarySvc,
usePixel = True,
useSCT = True,
checkBadSCTChip = InDetFlags.checkDeadElementsOnTrack(),
# OutputLevel = 1,
CountDeadModulesAfterLastHit = True) )
import InDetPhysValMonitoring.InDetPhysValMonitoringConf
class InDetPhysHitDecoratorTool(object) :
'''
Namespace for hit decoration tool
'''
def __init__(self) :
raise('must not be instantiated. Only child classes should be instantiated.')
class InDetPhysHitDecoratorTool(InDetPhysValMonitoring.InDetPhysValMonitoringConf.InDetPhysHitDecoratorTool) :
@injectNameArgument
def __new__(cls, *args, **kwargs) :
return InDetPhysValMonitoring.InDetPhysValMonitoringConf.InDetPhysHitDecoratorTool.__new__(cls,*args,**kwargs)
@checkKWArgs
def __init__(self, **kwargs) :
super(InDetPhysHitDecoratorTool.InDetPhysHitDecoratorTool,self)\
.__init__(**_args( kwargs,
name = self.__class__.__name__))
# custom configuration here:
self.InDetTrackHoleSearchTool = toolFactory(InDetHoleSearchTool.PhysValMonInDetHoleSearchTool)
# Configuration of InDetPhysValDecoratorAlg algorithms
#
import InDetPhysValMonitoring.InDetPhysValMonitoringConf
class InDetPhysValDecoratorAlg(object) :
'''
Namespace for track aprticle decoration algorithms
'''
def __init__(self) :
raise('must not be instantiated. Only child classes should be instantiated.')
class InDetPhysValDecoratorAlg(InDetPhysValMonitoring.InDetPhysValMonitoringConf.InDetPhysValDecoratorAlg) :
'''
Default track particle decoration algorithm.
This algorithm will decorate the InDetTrackParticles.
'''
@injectNameArgument
def __new__(cls, *args, **kwargs) :
return InDetPhysValMonitoring.InDetPhysValMonitoringConf.InDetPhysValDecoratorAlg.__new__(cls,*args,**kwargs)
@checkKWArgs
def __init__(self, **kwargs) :
super(InDetPhysValDecoratorAlg.InDetPhysValDecoratorAlg,self)\
.__init__(**_args( kwargs,
name = self.__class__.__name__))
# custom configurations below:
self.InDetPhysHitDecoratorTool = toolFactory(InDetPhysHitDecoratorTool.InDetPhysHitDecoratorTool)
# self.InDetPhysHitDecoratorTool.OutputLevel=1
from InDetPhysValMonitoring.InDetPhysValJobProperties import isMC
if not isMC() :
# disable truth monitoring for data
self.TruthParticleContainerName = ''
def getPhysValMonInDetHoleSearchTool(**kwargs) :
'''
default inner detector hole search tool
'''
from AthenaCommon.AppMgr import ToolSvc, ServiceMgr
# If InDetSCT_ConditionsSummarySvc instance configured by InDetRecConditionsAccess.py is available, use it.
# Otherwise, the default SCT_ConditionsSummarySvc instance is used.
# @TODO find a better to solution to get the correct service for the current job.
SctSummarySvc = "InDetSCT_ConditionsSummarySvc"
if not hasattr(ServiceMgr, SctSummarySvc):
SctSummarySvc = "SCT_ConditionsSummarySvc"
from InDetRecExample.InDetJobProperties import InDetFlags
kwargs=setDefaults( kwargs,
name = 'PhysValMonInDetHoleSearchTool',
Extrapolator = ToolSvc.InDetExtrapolator,
SctSummarySvc = SctSummarySvc,
usePixel = True,
useSCT = True,
checkBadSCTChip = InDetFlags.checkDeadElementsOnTrack(),
# OutputLevel = 1,
CountDeadModulesAfterLastHit = True)
return InDet__InDetTrackHoleSearchTool(**kwargs)
def getInDetPhysHitDecoratorTool(**kwargs) :
kwargs=setDefaults(kwargs,name='InDetPhysHitDecoratorTool')
if 'InDetTrackHoleSearchTool' not in kwargs :
kwargs=setDefaults(kwargs,InDetTrackHoleSearchTool = toolFactory(getPhysValMonInDetHoleSearchTool))
import InDetPhysValMonitoring.InDetPhysValMonitoringConf
return InDetPhysValMonitoring.InDetPhysValMonitoringConf.InDetPhysHitDecoratorTool(**kwargs)
class InDetPhysValKeys :
......@@ -212,32 +149,43 @@ class InDetPhysValKeys :
# @todo should be used also in InDetPhysValMonitoring.py
GSFTrackParticles = 'GSFTrackParticles'
class InDetPhysValDecoratorAlg(InDetPhysValDecoratorAlg) :
class InDetPhysValDecoratorAlgGSF(InDetPhysValDecoratorAlg.InDetPhysValDecoratorAlg) :
'''
Algorithm to decorate GSF track particles.
'''
def __init__(self, **kwargs) :
super(InDetPhysValDecoratorAlg.InDetPhysValDecoratorAlgGSF,self)\
.__init__(**_args( kwargs,
name = self.__class__.__name__))
# custom configuration below:
self.TrackParticleContainerName=InDetPhysValKeys.GSFTrackParticles
class InDetPhysValDecoratorAlgDBM(InDetPhysValDecoratorAlg.InDetPhysValDecoratorAlg) :
'''
Algorithm to decorate DBM Track particles.
'''
def __init__(self, **kwargs) :
super(InDetPhysValDecoratorAlg.InDetPhysValDecoratorAlgDBM,self)\
.__init__(**_args( kwargs,
name = self.__class__.__name__))
# custom configuration below:
from InDetRecExample.InDetKeys import InDetKeys
self.TrackParticleContainerName=InDetKeys.DBMTrackParticles()
def getInDetPhysValDecoratorAlg(**kwargs) :
'''
Default track particle decoration algorithm.
This algorithm will decorate the InDetTrackParticles.
'''
kwargs=setDefaults(kwargs,
name = 'InDetPhysValDecoratorAlg')
if 'InDetPhysHitDecoratorTool' not in kwargs :
kwargs=setDefaults(kwargs,
InDetPhysHitDecoratorTool = toolFactory(getInDetPhysHitDecoratorTool))
# self.InDetPhysHitDecoratorTool.OutputLevel=1
from InDetPhysValMonitoring.InDetPhysValJobProperties import isMC
if not isMC() :
# disable truth monitoring for data
kwargs=setDefaults(kwargs, TruthParticleContainerName = '')
import InDetPhysValMonitoring.InDetPhysValMonitoringConf
return InDetPhysValMonitoring.InDetPhysValMonitoringConf.InDetPhysValDecoratorAlg(**kwargs)
def getInDetPhysValDecoratorAlgGSF(**kwargs) :
'''
Algorithm to decorate GSF track particles.
'''
return getInDetPhysValDecoratorAlg( **setDefaults(kwargs,
name = 'InDetPhysValDecoratorAlgGSF',
TrackParticleContainerName =InDetPhysValKeys.GSFTrackParticles))
def getInDetPhysValDecoratorAlgDBM(**kwargs) :
'''
Algorithm to decorate DBM track particles.
'''
from InDetRecExample.InDetKeys import InDetKeys
return getInDetPhysValDecoratorAlg( **setDefaults(kwargs,
name = 'InDetPhysValDecoratorAlgDBM',
TrackParticleContainerName =InDetKeys.DBMTrackParticles() ))
# Debugging
# import trace
......@@ -294,12 +242,11 @@ def addGSFTrackDecoratorAlg() :
Search egamma algorithm and add the GSF TrackParticle decorator after the it.
'''
from InDetPhysValMonitoring.InDetPhysValDecoration import _addDecorators
from InDetPhysValMonitoring.InDetPhysValDecoration import InDetPhysValDecoratorAlg
from InDetPhysValMonitoring.InDetPhysValJobProperties import InDetPhysValFlags
if InDetPhysValFlags.doValidateGSFTracks() :
# print 'DEBUG add addGSFTrackDecoratorAlg'
decorators=[InDetPhysValDecoratorAlg.InDetPhysValDecoratorAlgGSF() ]
decorators=[getInDetPhysValDecoratorAlgGSF()]
# add the InDetPhysValDecoratorAlgGSF after the egamma algorithms ran
# they build the GSF track particles.
_addDecorators( decorators, ['egamma','egammaTruthAssociationAlg'] )
......@@ -344,7 +291,7 @@ def addDecorator() :
decorators=[]
decorators.append( InDetPhysValDecoratorAlg.InDetPhysValDecoratorAlg() )
decorators.append( getInDetPhysValDecoratorAlg() )
from InDetPhysValMonitoring.InDetPhysValJobProperties import InDetPhysValFlags
InDetPhysValFlags.init()
......@@ -361,10 +308,17 @@ def addDecorator() :
# for backward compatibility check whether DBM has been added already
if InDetPhysValFlags.doValidateDBMTracks() and hasattr(InDetKeys,'DBMTrackParticles') :
# and InDetFlags.doDBM()
decorators.append( InDetPhysValDecoratorAlg.InDetPhysValDecoratorAlgDBM() )
decorators.append( getInDetPhysValDecoratorAlgDBM() )
from InDetPhysValMonitoring.InDetPhysValJobProperties import InDetPhysValFlags
from InDetPhysValMonitoring.ConfigUtils import extractCollectionPrefix
for col in InDetPhysValFlags.validateExtraTrackCollections() :
prefix=extractCollectionPrefix(col)
decorators += [ getInDetPhysValDecoratorAlg(name = 'InDetPhysValDecoratorAlg'+prefix,
TrackParticleContainerName = prefix+"TrackParticles") ]
_addDecorators( decorators )
def addExtraMonitoring() :
'''
IF monitoring is wished for GSF or DBM TrackParticles find the monitoring manager and
......
# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
#
## purpose Python module to hold common flags to configure the InDetPhysValMonitoring
......@@ -67,6 +67,12 @@ class doValidateTracksInJets(InDetPhysValFlagsJobProperty):
allowedTypes = ['bool']
StoredValue = False
class validateExtraTrackCollections(InDetPhysValFlagsJobProperty) :
"""List of extra track collection names to be validated in addition to Tracks."""
statusOn = True
allowedTypes = ['list']
StoredValue = []
from InDetRecExample.InDetJobProperties import Enabled
##-----------------------------------------------------------------------------
......@@ -122,10 +128,11 @@ jobproperties.add_Container(InDetPhysValJobProperties)
_list_InDetPhysValJobProperties = [
Enabled,
doValidateDBMTracks,
doValidateGSFTracks,
doValidateGSFTracks,
doValidateLooseTracks,
doValidateTightPrimaryTracks,
doValidateTracksInJets
doValidateTracksInJets,
validateExtraTrackCollections
]
for j in _list_InDetPhysValJobProperties:
......
# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
from ConfigUtils import injectNameArgument,checkKWArgs,_args,serviceFactory,toolFactory
from ConfigUtils import setDefaults,serviceFactory,toolFactory
import InDetPhysValMonitoring.InDetPhysValMonitoringConf
......@@ -27,142 +27,101 @@ def removePhysValExample() :
for child in topSequence.getChildren() :
print 'DEBUG top sequence has %s' % (child.getName())
class InDetPhysValMonitoringTool(object) :
'''
Namespace for inner detector hole search tools
'''
def __init__(self) :
raise('must not be instantiated. Only child classes should be instantiated.')
class InDetPhysValMonitoringTool(InDetPhysValMonitoring.InDetPhysValMonitoringConf.InDetPhysValMonitoringTool) :
'''
Default InDetPhysValMonitoringTool for InDetTrackParticles
'''
@injectNameArgument
def __new__(cls, *args, **kwargs) :
print "DEBUG InDetPhysValMonitoringTool.py InDetPhysValMonitoringTool.InDetPhysValMonitoringTool %s" %kwargs['name']
return InDetPhysValMonitoring.InDetPhysValMonitoringConf.InDetPhysValMonitoringTool.__new__(cls,*args,**kwargs)
@checkKWArgs
def __init__(self, **kwargs) :
super(InDetPhysValMonitoringTool.InDetPhysValMonitoringTool,self)\
.__init__(**_args( kwargs,
name = self.__class__.__name__))
# special parameters of the default InDetPhysValMonitoringTool
self.useTrackSelection = False
self.EnableLumi = False
# create the HistogramDefinitionSvc
# at the moment there can only be one HistogramDefinitionSvc
from InDetPhysValMonitoring.HistogramDefinitionSvc import HistogramDefinitionSvc
#self.HistogramDefinitionSvc =
serviceFactory(HistogramDefinitionSvc.HistogramDefinitionSvc)
from InDetPhysValMonitoring.InDetPhysValJobProperties import isMC,InDetPhysValFlags
if isMC() :
self.TruthParticleContainerName = "TruthParticles"
if InDetPhysValFlags.doValidateTracksInJets() :
self.jetContainerName ='AntiKt4TruthJets'
self.FillTrackInJetPlots = True
from InDetPhysValMonitoring.addTruthJets import addTruthJetsIfNotExising
addTruthJetsIfNotExising(self.jetContainerName)
else :
self.jetContainerName =''
self.FillTrackInJetPlots = False
else :
# disable truth monitoring for data
self.TruthParticleContainerName = ''
# the jet container is actually meant to be a truth jet container
self.jetContainerName =''
# hack to remove example phyval monitor
from RecExConfig.AutoConfiguration import IsInInputFile
if not IsInInputFile('xAOD::JetContainer','AntiKt4EMTopoJets') :
from RecExConfig.RecFlags import rec
rec.UserExecs += ['from InDetPhysValMonitoring.InDetPhysValMonitoringTool import removePhysValExample;removePhysValExample();']
class InDetPhysValMonitoringToolLoose(InDetPhysValMonitoringTool) :
'''
InDetPhysValMonitoringTool for track particles which pass the loose selection
'''
#@injectNameArgument
#def __new__(cls, *args, **kwargs) :
# return InDetPhysValMonitoringTool.InDetPhysValMonitoringTool.__new__(cls,*args,**kwargs)
@checkKWArgs
def __init__(self, **kwargs) :
super(InDetPhysValMonitoringTool.InDetPhysValMonitoringToolLoose,self)\
.__init__(**_args( kwargs,
name = self.__class__.__name__))
# special parameters of the InDetPhysValMonitoringTool for monitoring loose tracks
self.SubFolder='Loose/'
self.useTrackSelection = True
from InDetPhysValMonitoring.TrackSelectionTool import InDetTrackSelectionTool
self.TrackSelectionTool = toolFactory(InDetTrackSelectionTool.InDetTrackSelectionToolLoose)
class InDetPhysValMonitoringToolTightPrimary(InDetPhysValMonitoringTool) :
'''
InDetPhysValMonitoringTool for track particles which pass the tight primary selection
'''
#@injectNameArgument
#def __new__(cls, *args, **kwargs) :
# return InDetPhysValMonitoringTool.InDetPhysValMonitoringTool.__new__(cls,*args,**kwargs)
@checkKWArgs
def __init__(self, **kwargs) :
super(InDetPhysValMonitoringTool.InDetPhysValMonitoringToolTightPrimary,self)\
.__init__(**_args( kwargs,
name = self.__class__.__name__))
# special parameters of the InDetPhysValMonitoringTool for monitoring tight primary tracks
self.SubFolder='TightPrimary/'
self.useTrackSelection = True
from InDetPhysValMonitoring.TrackSelectionTool import InDetTrackSelectionTool
self.TrackSelectionTool = toolFactory(InDetTrackSelectionTool.InDetTrackSelectionToolTightPrimary)
class InDetPhysValMonitoringToolGSF(InDetPhysValMonitoringTool) :
'''
InDetPhysValMonitoringTool for GSF track particles
'''
#@injectNameArgument
#def __new__(cls, *args, **kwargs) :
# return InDetPhysValMonitoringTool.InDetPhysValMonitoringTool.__new__(cls,*args,**kwargs)
@checkKWArgs
def __init__(self, **kwargs) :
super(InDetPhysValMonitoringTool.InDetPhysValMonitoringToolGSF,self)\
.__init__(**_args( kwargs,
name = self.__class__.__name__))
# special parameters of the GSF InDetPhysValMonitoringTool
self.TrackParticleContainerName = 'GSFTrackParticles'
self.SubFolder='GSF/'
class InDetPhysValMonitoringToolDBM(InDetPhysValMonitoringTool) :
'''
InDetPhysValMonitoringTool for DBM track particles
'''
#@injectNameArgument
#def __new__(cls, *args, **kwargs) :
# return InDetPhysValMonitoringTool.InDetPhysValMonitoringTool.__new__(cls,*args,**kwargs)
@checkKWArgs
def __init__(self, **kwargs) :
super(InDetPhysValMonitoringTool.InDetPhysValMonitoringToolDBM,self)\
.__init__(**_args( kwargs,
name = self.__class__.__name__))
# special parameters of the GSF InDetPhysValMonitoringTool
from InDetRecExample.InDetKeys import InDetKeys
self.TrackParticleContainerName=InDetKeys.DBMTracks()
self.SubFolder='DBM/'
def getInDetPhysValMonitoringTool(**kwargs) :
kwargs=setDefaults(kwargs,
useTrackSelection = False,
EnableLumi = False)
# create the HistogramDefinitionSvc
# at the moment there can only be one HistogramDefinitionSvc
from InDetPhysValMonitoring.HistogramDefinitionSvc import getHistogramDefinitionSvc
#self.HistogramDefinitionSvc =
serviceFactory(getHistogramDefinitionSvc)
from InDetPhysValMonitoring.InDetPhysValJobProperties import isMC,InDetPhysValFlags
if isMC() :
from InDetPhysValMonitoring.InDetPhysValDecoration import getInDetRttTruthSelectionTool
kwargs=setDefaults(kwargs, TruthParticleContainerName = "TruthParticles")
if 'TruthSelectionTool' not in kwargs :
kwargs=setDefaults(kwargs, TruthSelectionTool = getInDetRttTruthSelectionTool() )
if InDetPhysValFlags.doValidateTracksInJets() :
jets_name='AntiKt4TruthJets'
kwargs=setDefaults(kwargs,
jetContainerName = jets_name,
FillTrackInJetPlots = True)
from InDetPhysValMonitoring.addTruthJets import addTruthJetsIfNotExising
addTruthJetsIfNotExising(jets_name)
else :
kwargs=setDefaults(kwargs,
jetContainerName ='' ,
FillTrackInJetPlots = False)
else :
# disable truth monitoring for data
kwargs=setDefaults(kwargs,
TruthParticleContainerName = '',
# TruthVertexContainerName = '',
# TruthEventKey = '',
# TruthPileupEventKey = '',
# TruthSelectionTool = '',
# the jet container is actually meant to be a truth jet container
jetContainerName ='',
FillTrackInJetPlots = False)
# hack to remove example phyval monitor
from RecExConfig.AutoConfiguration import IsInInputFile
if not IsInInputFile('xAOD::JetContainer','AntiKt4EMTopoJets') :
add_remover=True;
from RecExConfig.RecFlags import rec
for elm in rec.UserExecs :
if elm.find('removePhysValExample')>0 :
add_remover=False
break
if add_remover :
rec.UserExecs += ['from InDetPhysValMonitoring.InDetPhysValMonitoringTool import removePhysValExample;removePhysValExample();']
return InDetPhysValMonitoring.InDetPhysValMonitoringConf.InDetPhysValMonitoringTool(**kwargs)
def getInDetPhysValMonitoringToolLoose(**kwargs) :
if 'TrackSelectionTool' not in kwargs :
from InDetPhysValMonitoring.TrackSelectionTool import InDetTrackSelectionTool
kwargs=setDefaults(kwargs, TrackSelectionTool = toolFactory(InDetTrackSelectionTool.getInDetTrackSelectionToolLoose))
kwargs=setDefaults(kwargs,
name = 'InDetPhysValMonitoringToolLoose',
SubFolder = 'Loose/',
useTrackSelection = True)
return getInDetPhysValMonitoringTool(**kwargs)
def getInDetPhysValMonitoringToolTightPrimary(**kwargs) :
if 'TrackSelectionTool' not in kwargs :
from InDetPhysValMonitoring.TrackSelectionTool import InDetTrackSelectionTool
kwargs=setDefaults(kwargs, TrackSelectionTool = toolFactory(InDetTrackSelectionTool.getInDetTrackSelectionToolTightPrimary))
kwargs=setDefaults(kwargs,
name = 'InDetPhysValMonitoringToolTightPrimary',
SubFolder = 'TightPrimary/',
useTrackSelection = True)
return getInDetPhysValMonitoringTool(**kwargs)
def getInDetPhysValMonitoringToolGSF(**kwargs) :
kwargs=setDefaults(kwargs,
name = 'InDetPhysValMonitoringToolGSF',
SubFolder = 'GSF/',
TrackParticleContainerName = 'GSFTrackParticles',
useTrackSelection = True)
return getInDetPhysValMonitoringTool(**kwargs)
def getInDetPhysValMonitoringToolDBM(**kwargs) :
from InDetRecExample.InDetKeys import InDetKeys
kwargs=setDefaults(kwargs,
name = 'InDetPhysValMonitoringToolDBM',
SubFolder = 'DBM/',
TrackParticleContainerName = InDetKeys.DBMTracks(),
useTrackSelection = True)
return getInDetPhysValMonitoringTool(**kwargs)
# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
from ConfigUtils import injectNameArgument,checkKWArgs,_args,serviceFactory
from ConfigUtils import setDefaults
from InDetTrackSelectionTool.InDetTrackSelectionToolConf import InDet__InDetTrackSelectionTool
class InDetTrackSelectionTool(object) :
def getInDetTrackSelectionToolLoose(**kwargs) :
'''
Namespace for inner detector hole search tools
Default InDetTrackSelectionTool for InDetTrackParticles
'''
def __init__(self) :
raise('must not be instantiated. Only child classes should be instantiated.')
class InDetTrackSelectionToolLoose(InDet__InDetTrackSelectionTool) :
'''
Default InDetTrackSelectionTool for InDetTrackParticles
'''
@injectNameArgument
def __new__(cls, *args, **kwargs) :
return InDet__InDetTrackSelectionTool.__new__(cls,*args,**kwargs)
kwargs = setDefaults(kwargs,CutLevel = "Loose" )
return InDet__InDetTrackSelectionTool(**kwargs)
@checkKWArgs
def __init__(self, **kwargs) :
super(InDetTrackSelectionTool.InDetTrackSelectionToolLoose,self)\
.__init__(**_args( kwargs,
name = self.__class__.__name__))
# special parameters of the InDetTrackSelectionToolLoose
self.CutLevel = "Loose"
class InDetTrackSelectionToolTightPrimary(InDet__InDetTrackSelectionTool) :
'''
Default InDetTrackSelectionTool for InDetTrackParticles
'''
@injectNameArgument
def __new__(cls, *args, **kwargs) :
return InDet__InDetTrackSelectionTool.__new__(cls,*args,**kwargs)
@checkKWArgs
def __init__(self, **kwargs) :
super(InDetTrackSelectionTool.InDetTrackSelectionToolTightPrimary,self)\
.__init__(**_args( kwargs,
name = self.__class__.__name__))
# special parameters of the InDetTrackSelectionToolTightPrimary
self.CutLevel = "TightPrimary"
def getInDetTrackSelectionToolTightPrimary(**kwargs) :
'''
Default InDetTrackSelectionTool for InDetTrackParticles
'''
kwargs = setDefaults(kwargs, CutLevel = "TightPrimary" )
return InDet__InDetTrackSelectionTool(**kwargs)
......@@ -3,29 +3,28 @@ decoration = InDetPhysValMonitoring.InDetPhysValDecoration.addDecoratorIfNeeded(
# add ID physics validation monitoring tool
from InDetPhysValMonitoring.InDetPhysValMonitoringTool import InDetPhysValMonitoringTool
from InDetPhysValMonitoring.InDetPhysValJobProperties import InDetPhysValFlags
import InDetPhysValMonitoring.InDetPhysValMonitoringTool as InDetPhysValMonitoringTool
indet_mon_tool = InDetPhysValMonitoringTool.InDetPhysValMonitoringTool()
ToolSvc += [indet_mon_tool]
monMan.AthenaMonTools += [indet_mon_tool]
mons=[ (True , InDetPhysValMonitoringTool.getInDetPhysValMonitoringTool),
(InDetPhysValFlags.doValidateLooseTracks() , InDetPhysValMonitoringTool.getInDetPhysValMonitoringToolLoose),
(InDetPhysValFlags.doValidateTightPrimaryTracks() , InDetPhysValMonitoringTool.getInDetPhysValMonitoringToolTightPrimary),
(InDetPhysValFlags.doValidateDBMTracks() , InDetPhysValMonitoringTool.getInDetPhysValMonitoringToolDBM),
(InDetPhysValFlags.doValidateGSFTracks() , InDetPhysValMonitoringTool.getInDetPhysValMonitoringToolGSF)
]
if InDetPhysValFlags.doValidateDBMTracks():
indet_mon_tool_DBM = InDetPhysValMonitoringTool.InDetPhysValMonitoringToolDBM()
ToolSvc += [ indet_mon_tool_DBM ]
monMan.AthenaMonTools += [ indet_mon_tool_DBM ]
for enabled, creator in mons :
if enabled :
tool = creator()
ToolSvc += [ tool ]
monMan.AthenaMonTools += [ tool ]
if InDetPhysValFlags.doValidateGSFTracks():
indet_mon_tool_GSF = InDetPhysValMonitoringTool.InDetPhysValMonitoringToolGSF()
ToolSvc += [ indet_mon_tool_GSF ]
monMan.AthenaMonTools += [ indet_mon_tool_GSF ]
if InDetPhysValFlags.doValidateLooseTracks():
indet_mon_tool_Loose = InDetPhysValMonitoringTool.InDetPhysValMonitoringToolLoose()
ToolSvc += [ indet_mon_tool_Loose ]
monMan.AthenaMonTools += [ indet_mon_tool_Loose ]
if InDetPhysValFlags.doValidateTightPrimaryTracks():
indet_mon_tool_TightPrimary = InDetPhysValMonitoringTool.InDetPhysValMonitoringToolTightPrimary()
ToolSvc += [ indet_mon_tool_TightPrimary ]
monMan.AthenaMonTools += [ indet_mon_tool_TightPrimary ]
from InDetPhysValMonitoring.InDetPhysValJobProperties import InDetPhysValFlags
from InDetPhysValMonitoring.ConfigUtils import extractCollectionPrefix
for col in InDetPhysValFlags.validateExtraTrackCollections() :
prefix=extractCollectionPrefix(col)
tool = InDetPhysValMonitoringTool.getInDetPhysValMonitoringTool(name = 'InDetPhysValMonitoringTool'+prefix,
SubFolder = prefix+'Tracks/',
TrackParticleContainerName = prefix+'TrackParticles')
ToolSvc += [ tool ]
monMan.AthenaMonTools += [ tool ]
21.0.104.1
\ No newline at end of file
21.0.105.1
\ No newline at end of file
21.0.105
\ No newline at end of file
21.0.106
\ No newline at end of file
/*
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/
#ifndef G4UserActions_RadiationMapsMaker_H
......@@ -29,7 +29,9 @@ namespace G4UA
/// They can be configured to other values/ranges for other purposes.
std::string material = std::string("");
bool posYOnly = false; // set to true for upper hemisphere only
int nBinsr = 120;
int nBinsz = 240;
......