Skip to content
Snippets Groups Projects
Commit 95ba429f authored by Yohei Yamaguchi's avatar Yohei Yamaguchi
Browse files

Merge remote-tracking branch 'upstream/master' into FTFInsideOut_master

parents 6d859be1 9852215a
6 merge requests!58791DataQualityConfigurations: Modify L1Calo config for web display,!46784MuonCondInterface: Enable thread-safety checking.,!46776Updated LArMonitoring config file for WD to match new files produced using MT,!45405updated ART test cron job,!42417Draft: DIRE and VINCIA Base Fragments for Pythia 8.3,!36867L2 inside-out
Showing
with 350 additions and 299 deletions
......@@ -15,7 +15,7 @@
#include "CaloConditions/ToolConstants.h"
#include "GaudiKernel/IAlgTool.h"
#include "GaudiKernel/IInterface.h"
#include "GaudiKernel/StatusCode.h"
#include "GaudiKernel/EventContext.h"
#include <string>
......@@ -27,7 +27,7 @@
* Defines operations needed by CaloClusterCorrDBWriter.
*/
class IToolWithConstants
: virtual public IAlgTool
: virtual public IInterface
{
public:
DeclareInterfaceID (IToolWithConstants, 1, 0);
......
......@@ -20,6 +20,7 @@
#include "CaloUtils/exceptions.h"
#include "CaloInterface/IToolWithConstants.h"
#include "CaloConditions/ToolConstants.h"
#include "AthenaBaseComps/AthCheckMacros.h"
#include "StoreGate/ReadCondHandleKey.h"
......@@ -434,7 +435,7 @@ private:
template <class BASE>
ATH_REQUIRES( requires (BASE& b, Gaudi::Property<int>& p) { { b.declareProperty(p) }; } )
class ToolWithConstants
: public BASE
: public extends<BASE, IToolWithConstants>
{
public:
/// Shorthand for derived classes.
......@@ -442,7 +443,7 @@ public:
/// Inherit constructor.
using BASE::BASE;
using extends<BASE, IToolWithConstants>::extends;
/// Convenient alias for the Context type.
......@@ -485,7 +486,7 @@ public:
* @param ctx Event context.
*/
virtual StatusCode mergeConstants (CaloRec::ToolConstants& out,
const EventContext& ctx) const;
const EventContext& ctx) const override;
/**
......
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/
#ifndef _GeoCaloCalibHit_h_
#define _GeoCaloCalibHit_h_
#ifndef GEOADAPTORS_GEOCALOCALIBHIT_H
#define GEOADAPTORS_GEOCALOCALIBHIT_H
//----------------------------------------------------------//
// //
// Adaptor for CaloCalibHits. //
......@@ -68,13 +68,13 @@ class GeoCaloCalibHit
const CaloDetDescrElement* getDetDescrElement() const;
private:
static const CaloDetDescrManager* initDDMgr();
const CaloDetDescrManager* ddmgr() const;
void init(const std::string & collectionName);
const CaloCalibrationHit *m_hit;
static const CaloIdManager *s_man;
static const CaloDM_ID *s_dmid;
static const CaloDetDescrManager *s_caloMan;
int m_subdet;
int m_type; // i.e. in the barrel or in the endcap.
int m_sampling;
......
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/
//----------------------------------------------------------//
......@@ -11,8 +11,6 @@
// //
// //
//----------------------------------------------------------//
#include "StoreGate/StoreGateSvc.h"
#include "StoreGate/StoreGate.h"
#include "CaloIdentifier/CaloIdManager.h"
#include "CaloDetDescr/CaloDetDescrElement.h"
......@@ -21,9 +19,6 @@
#include "CaloDetDescr/CaloDetDescrManager.h"
#include "CLHEP/Units/SystemOfUnits.h"
const CaloIdManager* GeoCaloCalibHit::s_man = 0;
const CaloDM_ID* GeoCaloCalibHit::s_dmid = 0;
const CaloDetDescrManager * GeoCaloCalibHit::s_caloMan = 0;
#undef DEBUG_GEOHIT
......@@ -71,7 +66,8 @@ inline double GeoCaloCalibHit::phiMin() const {
double dphi = m_ddElement->dphi();
return phi-dphi/2.0;
}
int phiIndex=s_dmid->phi(m_hit->cellID()); // Dead material hits
const CaloDM_ID* dmid = ddmgr()->getCalo_Mgr()->getDM_ID();
int phiIndex=dmid->phi(m_hit->cellID()); // Dead material hits
int n_phi=32;
if(abs(m_subdet) == 4 && m_type==2 && (m_region == 2 || m_region == 3) ) {
n_phi=16;
......@@ -86,7 +82,8 @@ inline double GeoCaloCalibHit::phiMax() const {
double dphi = m_ddElement->dphi();
return phi+dphi/2.0;
}
int phiIndex=s_dmid->phi(m_hit->cellID()); // Dead material hits
const CaloDM_ID* dmid = ddmgr()->getCalo_Mgr()->getDM_ID();
int phiIndex=dmid->phi(m_hit->cellID()); // Dead material hits
int n_phi=32;
if(abs(m_subdet) == 4 && m_type==2 && (m_region == 2 || m_region == 3) ) {
n_phi=16;
......@@ -100,7 +97,8 @@ inline double GeoCaloCalibHit::phi() const {
double phi = m_ddElement->phi();
return phi;
}
int phiIndex=s_dmid->phi(m_hit->cellID()); // Dead material hits
const CaloDM_ID* dmid = ddmgr()->getCalo_Mgr()->getDM_ID();
int phiIndex=dmid->phi(m_hit->cellID()); // Dead material hits
int n_phi=32;
if(abs(m_subdet) == 4 && m_type==2 && (m_region == 2 || m_region == 3) ) {
n_phi=16;
......@@ -143,7 +141,8 @@ inline double GeoCaloCalibHit::eta() const {
double eta = m_ddElement->eta();
return eta;
}
int etaIndex=s_dmid->eta(m_hit->cellID()); // Dead material hits
const CaloDM_ID* dmid = ddmgr()->getCalo_Mgr()->getDM_ID();
int etaIndex=dmid->eta(m_hit->cellID()); // Dead material hits
double dEta = 0.1;
if ((m_type==1 && m_sampling==3 && m_region==1) ||
(m_type==2 && m_region==3)) {
......@@ -151,7 +150,7 @@ inline double GeoCaloCalibHit::eta() const {
}
double etaCenter = m_etaOffset + (etaIndex+0.5)*dEta;
bool isNegative =s_dmid->pos_neg_z(m_hit->cellID())<0;
bool isNegative = dmid->pos_neg_z(m_hit->cellID())<0;
if (isNegative) {
etaCenter = -etaCenter;
}
......@@ -204,24 +203,6 @@ inline void GeoCaloCalibHit::init(const std::string & collectionName) {
return;
}
StoreGateSvc *detStore = StoreGate::pointer("DetectorStore");
// Dead hits
if(detStore->retrieve(s_man).isFailure()) {
m_failed=true;
return;
}
if (s_man) s_dmid = s_man->getDM_ID();
if (!s_dmid) {
m_failed=true;
return;
}
// Active and Inactive hits
if(detStore->retrieve(s_caloMan).isFailure()) {
m_failed=true;
return;
}
m_ddElement = getDetDescrElement();
//bool inactive = collectionName=="LArCalibrationHitInactive";
......@@ -235,21 +216,23 @@ inline void GeoCaloCalibHit::init(const std::string & collectionName) {
if (m_hitType==DEAD || m_hitType==TILEDM || m_hitType==TILEDEAD) { // Dead hits: LAr: m_subdet= +-4, Tile: m_subdet= +-5)
// from Calorimeter/ CaloIdentifier/ CaloIdentifier/ CaloDM_ID.h
m_subdet = s_dmid->pos_neg_z(m_hit->cellID());
m_type = s_dmid->dmat(m_hit->cellID());
m_sampling = s_dmid->sampling(m_hit->cellID());
m_region = s_dmid->region(m_hit->cellID());
m_etaBin = s_dmid->eta(m_hit->cellID());
m_phiBin = s_dmid->phi(m_hit->cellID());
const CaloDM_ID* dmid = ddmgr()->getCalo_Mgr()->getDM_ID();
m_subdet = dmid->pos_neg_z(m_hit->cellID());
m_type = dmid->dmat(m_hit->cellID());
m_sampling = dmid->sampling(m_hit->cellID());
m_region = dmid->region(m_hit->cellID());
m_etaBin = dmid->eta(m_hit->cellID());
m_phiBin = dmid->phi(m_hit->cellID());
} else { // Active and Inactive hit ID from Calorimeter/ CaloIdentifier/ CaloIdentifier/ CaloCell_ID.h
m_subdet = 1 + s_caloMan->getCaloCell_ID()->sub_calo(m_hit->cellID());
m_type = s_caloMan->getCaloCell_ID()->pos_neg(m_hit->cellID());
m_sampling = s_caloMan->getCaloCell_ID()->calo_sample(m_hit->cellID());
m_region = s_caloMan->getCaloCell_ID()->region(m_hit->cellID());
m_etaBin = s_caloMan->getCaloCell_ID()->eta(m_hit->cellID());
m_phiBin = s_caloMan->getCaloCell_ID()->phi(m_hit->cellID());
const CaloDetDescrManager* caloMan = ddmgr();
m_subdet = 1 + caloMan->getCaloCell_ID()->sub_calo(m_hit->cellID());
m_type = caloMan->getCaloCell_ID()->pos_neg(m_hit->cellID());
m_sampling = caloMan->getCaloCell_ID()->calo_sample(m_hit->cellID());
m_region = caloMan->getCaloCell_ID()->region(m_hit->cellID());
m_etaBin = caloMan->getCaloCell_ID()->eta(m_hit->cellID());
m_phiBin = caloMan->getCaloCell_ID()->phi(m_hit->cellID());
}
/*
......@@ -768,6 +751,6 @@ inline int GeoCaloCalibHit::region() const {
inline const CaloDetDescrElement* GeoCaloCalibHit::getDetDescrElement() const
{
if (m_hitType!=DEAD && m_hitType!=TILEDM && m_hitType!=TILEDEAD) return s_caloMan->get_element(m_hit->cellID());
if (m_hitType!=DEAD && m_hitType!=TILEDM && m_hitType!=TILEDEAD) return ddmgr()->get_element(m_hit->cellID());
return NULL;
}
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/
#ifndef GEOADAPTORS_GEOLARHIT_H
......@@ -33,17 +33,16 @@ class GeoLArHit
int SamplingLayer() const;
// Underlying hit.
const LArHit &data() const { return *m_hit;}
const LArHit &data() const { return m_hit;}
// Is this hit OK?
operator bool () const { return s_man; }
operator bool () const { return true; }
private:
static void init();
static const CaloDetDescrManager* init();
const CaloDetDescrManager* mgr() const;
const LArHit* m_hit;
static const CaloDetDescrManager *s_man;
const LArHit& m_hit;
};
#include "GeoAdaptors/GeoLArHit.icc"
......
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/
#include "StoreGate/StoreGateSvc.h"
#include "StoreGate/StoreGate.h"
#include "CaloDetDescr/CaloDetDescrManager.h"
#include "CaloDetDescr/CaloDetDescrElement.h"
#include "LArSimEvent/LArHitContainer.h"
#include "CaloIdentifier/CaloCell_ID.h"
inline void GeoLArHit::init()
{
StoreGateSvc *detStore = StoreGate::pointer("DetectorStore");
if(detStore->retrieve(s_man).isFailure())
std::cout << "GeoLArHit::init() WARNING Unable to retrieve CaloDetDescrManager!" << std::endl;
}
inline GeoLArHit::GeoLArHit(const LArHit & h)
: m_hit (h)
{
m_hit = &h;
if(!s_man) init();
}
inline const CaloDetDescrElement* GeoLArHit::getDetDescrElement() const
{
return s_man->get_element(m_hit->cellID());
return mgr()->get_element(m_hit.cellID());
}
inline double GeoLArHit::Energy() const
{
return m_hit->energy();
return m_hit.energy();
}
inline double GeoLArHit::Time() const
{
return m_hit->time();
return m_hit.time();
}
inline int GeoLArHit::SamplingLayer() const {
const CaloCell_ID *caloID = s_man->getCaloCell_ID();
int layer = caloID->sampling(m_hit->cellID());
const CaloCell_ID *caloID = mgr()->getCaloCell_ID();
int layer = caloID->sampling(m_hit.cellID());
return layer;
}
/*
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 GEOADAPTORS_GEOMUONHITS_H
......@@ -49,8 +49,19 @@ namespace MuonGM{
}
class Identifier;
class GeoMDTHit {
class GeoMuonHitBase
{
protected:
const MuonGM::MuonDetectorManager* mgr() const;
private:
static const MuonGM::MuonDetectorManager* init();
};
class GeoMDTHit : public GeoMuonHitBase
{
public:
// Constructor:
......@@ -63,19 +74,15 @@ class GeoMDTHit {
const MDTSimHit &data() const { return *m_hit;}
// Is this hit OK?
operator bool () const { return s_man; }
operator bool () const { return true; }
private:
static void init();
const MDTSimHit* m_hit;
static const MuonGM::MuonDetectorManager* s_man;
static const MdtIdHelper* s_mdtID;
};
class GeoRPCHit {
class GeoRPCHit : public GeoMuonHitBase
{
public:
// Constructor:
......@@ -88,19 +95,15 @@ class GeoRPCHit {
const RPCSimHit &data() const { return *m_hit;}
// Is this hit OK?
operator bool () const { return s_man; }
operator bool () const { return true; }
private:
static void init();
const RPCSimHit* m_hit;
static const MuonGM::MuonDetectorManager* s_man;
static const RpcIdHelper* s_rpcID;
};
class GeoTGCHit {
class GeoTGCHit : public GeoMuonHitBase
{
public:
// Constructor:
......@@ -113,22 +116,17 @@ class GeoTGCHit {
const TGCSimHit &data() const { return *m_hit;}
// Is this hit OK?
operator bool () const { return s_man; }
operator bool () const { return true; }
private:
static void init();
const TGCSimHit *m_hit;
static const MuonGM::MuonDetectorManager* s_man;
static const TgcIdHelper* s_tgcID;
};
class GeoCSCHit {
class GeoCSCHit : public GeoMuonHitBase
{
public:
// Constructor:
......@@ -141,19 +139,15 @@ class GeoCSCHit {
const CSCSimHit &data() const { return *m_hit;}
// Is this hit OK?
operator bool () const { return s_man; }
operator bool () const { return true; }
private:
static void init();
const CSCSimHit *m_hit;
static const MuonGM::MuonDetectorManager* s_man;
static const CscIdHelper* s_cscID;
};
class GeoMMHit {
class GeoMMHit : public GeoMuonHitBase
{
public:
// Constructor:
......@@ -172,21 +166,17 @@ class GeoMMHit {
const MMSimHit &data() const { return *m_hit;}
// Is this hit OK?
operator bool () const { return s_man; }
operator bool () const { return true; }
private:
static void init();
const MMSimHit *m_hit;
static const MuonGM::MuonDetectorManager* s_man;
static const MmIdHelper* s_mmID;
};
class GeosTGCHit {
class GeosTGCHit : public GeoMuonHitBase
{
public:
// Constructor:
......@@ -199,17 +189,11 @@ class GeosTGCHit {
const sTGCSimHit &data() const { return *m_hit;}
// Is this hit OK?
operator bool () const { return s_man; }
operator bool () const { return true; }
private:
static void init();
const sTGCSimHit *m_hit;
static const MuonGM::MuonDetectorManager* s_man;
static const sTgcIdHelper* s_stgcID;
};
#include "GeoAdaptors/GeoMuonHits.icc"
......
......@@ -2,9 +2,6 @@
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/
#include "StoreGate/StoreGateSvc.h"
#include "StoreGate/StoreGate.h"
#include "MuonReadoutGeometry/MuonDetectorManager.h"
#include "MuonIdHelpers/MdtIdHelper.h"
#include "MuonIdHelpers/RpcIdHelper.h"
......@@ -50,17 +47,8 @@
#include "MuonReadoutGeometry/MMReadoutElement.h"
inline void GeoMDTHit::init()
{
StoreGateSvc *detStore = StoreGate::pointer("DetectorStore");
if(detStore->retrieve(s_man,"Muon").isSuccess())
s_mdtID = s_man->mdtIdHelper();
}
inline GeoMDTHit::GeoMDTHit (const MDTSimHit & h) {
m_hit = &h;
if(!s_mdtID) init();
}
......@@ -78,19 +66,21 @@ inline Amg::Vector3D GeoMDTHit::getGlobalPosition() const {
int tl = mdthhelper->GetLayer(hitid);
int tube = mdthhelper->GetTube(hitid);
Identifier offid = s_mdtID->channelID(stname,
steta,
stphi,ml,tl,tube);
const MdtIdHelper* mdtID = mgr()->mdtIdHelper();
Identifier offid = mdtID->channelID(stname,
steta,
stphi,ml,tl,tube);
if (offid == 0)
std::cerr<<" Cannot build a valid Identifier; skip "<<std::endl;
const MuonGM::MdtReadoutElement* mdtdet = s_man->getMdtReadoutElement(offid);
const MuonGM::MdtReadoutElement* mdtdet = mgr()->getMdtReadoutElement(offid);
if (mdtdet == NULL)
{
const MdtIdHelper* mdtID = mgr()->mdtIdHelper();
std::cerr<<"MDT readout element not found for Id = "
<<s_mdtID->show_to_string(offid)<<std::endl;
<<mdtID->show_to_string(offid)<<std::endl;
return Amg::Vector3D(0,0,0);
}
......@@ -103,22 +93,15 @@ inline Amg::Vector3D GeoMDTHit::getGlobalPosition() const {
return simHitPos;
}
inline void GeoRPCHit::init()
{
StoreGateSvc *detStore = StoreGate::pointer("DetectorStore");
if(detStore->retrieve(s_man,"Muon").isSuccess())
s_rpcID = s_man->rpcIdHelper();
}
inline GeoRPCHit::GeoRPCHit (const RPCSimHit & h) {
m_hit = &h;
if(!s_rpcID) init();
}
inline Amg::Vector3D GeoRPCHit::getGlobalPosition() const {
HitID hitid = m_hit->RPCid();
RpcHitIdHelper* rpchhelper = RpcHitIdHelper::GetHelper(s_rpcID->gasGapMax());
const RpcIdHelper* rpcID = mgr()->rpcIdHelper();
RpcHitIdHelper* rpchhelper = RpcHitIdHelper::GetHelper(rpcID->gasGapMax());
std::string stname = rpchhelper->GetStationName(hitid);
int steta = rpchhelper->GetZSector(hitid);
int stphi = rpchhelper->GetPhiSector(hitid);
......@@ -128,14 +111,14 @@ inline Amg::Vector3D GeoRPCHit::getGlobalPosition() const {
int gg = rpchhelper->GetGasGapLayer(hitid);
int mfi = rpchhelper->GetMeasuresPhi(hitid);
int strip = 1;
Identifier offid = s_rpcID->channelID(stname,
steta,
stphi,
dbr, dbz, dbp, gg, mfi, strip);
Identifier offid = rpcID->channelID(stname,
steta,
stphi,
dbr, dbz, dbp, gg, mfi, strip);
if ( offid == 0)
std::cerr<<" Cannot build a valid Identifier; skip "<<std::endl;
const MuonGM::RpcReadoutElement* rpcdet = s_man->getRpcReadoutElement(offid);
const MuonGM::RpcReadoutElement* rpcdet = mgr()->getRpcReadoutElement(offid);
if (rpcdet != NULL)
{
Amg::Vector3D xU;
......@@ -146,23 +129,16 @@ inline Amg::Vector3D GeoRPCHit::getGlobalPosition() const {
}
else
{
const RpcIdHelper* rpcID = mgr()->rpcIdHelper();
std::cerr<<"RPC readout element not found for Id = "
<<s_rpcID->show_to_string(offid)<<std::endl;
<<rpcID->show_to_string(offid)<<std::endl;
return Amg::Vector3D(0,0,0);
}
}
inline void GeoTGCHit::init()
{
StoreGateSvc *detStore = StoreGate::pointer("DetectorStore");
if(detStore->retrieve(s_man,"Muon").isSuccess())
s_tgcID = s_man->tgcIdHelper();
}
inline GeoTGCHit::GeoTGCHit (const TGCSimHit & h) {
m_hit = &h;
if(!s_tgcID) init();
}
inline Amg::Vector3D GeoTGCHit::getGlobalPosition() const {
......@@ -175,14 +151,15 @@ inline Amg::Vector3D GeoTGCHit::getGlobalPosition() const {
int gg = tgchhelper->GetGasGap(hitid);
int isstrip= 0;
int channel= 1;
Identifier offid = s_tgcID->channelID(stname,
steta,
stphi,
gg, isstrip, channel);
const TgcIdHelper* tgcID = mgr()->tgcIdHelper();
Identifier offid = tgcID->channelID(stname,
steta,
stphi,
gg, isstrip, channel);
if ( offid == 0)
std::cerr<<" Cannot build a valid Identifier; skip "<<std::endl;
const MuonGM::TgcReadoutElement* tgcdet = s_man->getTgcReadoutElement(offid);
const MuonGM::TgcReadoutElement* tgcdet = mgr()->getTgcReadoutElement(offid);
if (tgcdet != NULL)
{
Amg::Vector3D xU;
......@@ -193,21 +170,15 @@ inline Amg::Vector3D GeoTGCHit::getGlobalPosition() const {
}
else
{
const TgcIdHelper* tgcID = mgr()->tgcIdHelper();
std::cerr<<"TGC readout element not found for Id = "
<<s_tgcID->show_to_string(offid)<<std::endl;
<<tgcID->show_to_string(offid)<<std::endl;
return Amg::Vector3D(0,0,0);
}
}
inline void GeoCSCHit::init()
{
StoreGateSvc *detStore = StoreGate::pointer("DetectorStore");
if(detStore->retrieve(s_man,"Muon").isSuccess())
s_cscID = s_man->cscIdHelper();
}
inline GeoCSCHit::GeoCSCHit (const CSCSimHit & h) {
m_hit = &h;
if (!s_cscID) init();
}
inline Amg::Vector3D GeoCSCHit::getGlobalPosition() const {
......@@ -223,19 +194,21 @@ inline Amg::Vector3D GeoCSCHit::getGlobalPosition() const {
int measphi = 0;
int channel = 1;
Identifier offid = s_cscID->channelID(stname,
steta,
stphi,ml,wl,measphi,channel);
const CscIdHelper* cscID = mgr()->cscIdHelper();
Identifier offid = cscID->channelID(stname,
steta,
stphi,ml,wl,measphi,channel);
if (offid == 0)
std::cerr<<" Cannot build a valid Identifier; skip "<<std::endl;
const MuonGM::CscReadoutElement* cscdet = s_man->getCscReadoutElement(offid);
const MuonGM::CscReadoutElement* cscdet = mgr()->getCscReadoutElement(offid);
if (cscdet == NULL)
{
const CscIdHelper* cscID = mgr()->cscIdHelper();
std::cerr<<"CSC readout element not found for Id = "
<<s_cscID->show_to_string(offid)<<std::endl;
<<cscID->show_to_string(offid)<<std::endl;
return Amg::Vector3D(0,0,0);
}
......@@ -247,33 +220,27 @@ inline Amg::Vector3D GeoCSCHit::getGlobalPosition() const {
}
inline void GeoMMHit::init()
{
StoreGateSvc *detStore = StoreGate::pointer("DetectorStore");
if(detStore->retrieve(s_man,"Muon").isSuccess())
s_mmID = s_man->mmIdHelper();
}
inline GeoMMHit::GeoMMHit (const MMSimHit & h) {
m_hit = &h;
if (!s_mmID) init();
}
inline Amg::Vector3D GeoMMHit::getGlobalPosition() const {
HitID hitid = m_hit->MMId();
MM_SimIdToOfflineId simToOffline(s_mmID);
const MmIdHelper* mmID = mgr()->mmIdHelper();
MM_SimIdToOfflineId simToOffline(mmID);
Identifier offid = simToOffline.convert(hitid);
if (offid == 0)
std::cerr<<" Cannot build a valid Identifier; skip "<<std::endl;
const MuonGM::MMReadoutElement* mmdet = s_man->getMMReadoutElement(offid);
const MuonGM::MMReadoutElement* mmdet = mgr()->getMMReadoutElement(offid);
if (mmdet == NULL)
{
const MmIdHelper* mmID = mgr()->mmIdHelper();
std::cerr<<"MM readout element not found for Id = "
<<s_mmID->show_to_string(offid)<<std::endl;
<<mmID->show_to_string(offid)<<std::endl;
return Amg::Vector3D(0,0,0);
}
......@@ -285,18 +252,20 @@ inline Amg::Vector3D GeoMMHit::getGlobalPosition() const {
inline Amg::Vector3D GeoMMHit::getTrkGlobalPosition() const {
HitID hitid = m_hit->MMId();
MM_SimIdToOfflineId simToOffline(s_mmID);
const MmIdHelper* mmID = mgr()->mmIdHelper();
MM_SimIdToOfflineId simToOffline(mmID);
Identifier offid = simToOffline.convert(hitid);
if (offid == 0)
std::cerr<<" Cannot build a valid Identifier; skip "<<std::endl;
const MuonGM::MMReadoutElement* mmdet = s_man->getMMReadoutElement(offid);
const MuonGM::MMReadoutElement* mmdet = mgr()->getMMReadoutElement(offid);
if (mmdet == NULL)
{
const MmIdHelper* mmID = mgr()->mmIdHelper();
std::cerr<<"MM readout element not found for Id = "
<<s_mmID->show_to_string(offid)<<std::endl;
<<mmID->show_to_string(offid)<<std::endl;
return Amg::Vector3D(0,0,0);
}
Amg::Vector3D trkLocP = getTrkLocalPosition();
......@@ -309,18 +278,20 @@ inline Amg::Vector3D GeoMMHit::getTrkLocalPosition() const {
HitID hitid = m_hit->MMId();
MM_SimIdToOfflineId simToOffline(s_mmID);
const MmIdHelper* mmID = mgr()->mmIdHelper();
MM_SimIdToOfflineId simToOffline(mmID);
Identifier offid = simToOffline.convert(hitid);
if (offid == 0)
std::cerr<<" Cannot build a valid Identifier; skip "<<std::endl;
const MuonGM::MMReadoutElement* mmdet = s_man->getMMReadoutElement(offid);
const MuonGM::MMReadoutElement* mmdet = mgr()->getMMReadoutElement(offid);
if (mmdet == NULL)
{
const MmIdHelper* mmID = mgr()->mmIdHelper();
std::cerr<<"MM readout element not found for Id = "
<<s_mmID->show_to_string(offid)<<std::endl;
<<mmID->show_to_string(offid)<<std::endl;
}
Amg::Transform3D gToL = mmdet->absTransform().inverse();
......@@ -332,32 +303,27 @@ inline Amg::Vector3D GeoMMHit::getTrkLocalPosition() const {
return trkLocHit;
}
inline void GeosTGCHit::init()
{
StoreGateSvc *detStore = StoreGate::pointer("DetectorStore");
if(detStore->retrieve(s_man,"Muon").isSuccess())
s_stgcID = s_man->stgcIdHelper();
}
inline GeosTGCHit::GeosTGCHit (const sTGCSimHit & h) {
m_hit = &h;
if (!s_stgcID) init();
}
inline Amg::Vector3D GeosTGCHit::getGlobalPosition() const {
HitID hitid = m_hit->sTGCId();
sTgcSimIdToOfflineId simToOffline(s_stgcID);
const sTgcIdHelper* stgcID = mgr()->stgcIdHelper();
sTgcSimIdToOfflineId simToOffline(stgcID);
Identifier offid = simToOffline.convert(hitid);
if (offid == 0)
std::cerr<<" Cannot build a valid Identifier; skip "<<std::endl;
const MuonGM::sTgcReadoutElement* stgcdet = s_man->getsTgcReadoutElement(offid);
const MuonGM::sTgcReadoutElement* stgcdet = mgr()->getsTgcReadoutElement(offid);
if (stgcdet == NULL)
{
const sTgcIdHelper* stgcID = mgr()->stgcIdHelper();
std::cerr<<"sTGC readout element not found for Id = "
<<s_stgcID->show_to_string(offid)<<std::endl;
<<stgcID->show_to_string(offid)<<std::endl;
return Amg::Vector3D(0,0,0);
}
......
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/
#ifndef GEOADAPTORS_GEOSIHIT_h
......@@ -39,17 +39,20 @@ class GeoSiHit {
// Is this hit ok?
operator bool () const { return s_sct || s_pix; }
operator bool () const { return true; }
private:
static void init();
static const InDetDD::PixelDetectorManager* initPixMgr();
static const InDetDD::SCT_DetectorManager* initSctMgr();
static const PixelID* initPixID();
static const SCT_ID* initSctID();
const InDetDD::PixelDetectorManager* pixMgr() const;
const InDetDD::SCT_DetectorManager* sctMgr() const;
const PixelID* pixID() const;
const SCT_ID* sctID() const;
const SiHit *m_hit;
static const InDetDD::SCT_DetectorManager *s_sct;
static const InDetDD::PixelDetectorManager *s_pix;
static const PixelID *s_pID;
static const SCT_ID *s_sID;
};
#include "GeoAdaptors/GeoSiHit.icc"
......
......@@ -6,34 +6,13 @@
#include "InDetReadoutGeometry/SiDetectorElement.h"
#include "SCT_ReadoutGeometry/SCT_DetectorManager.h"
#include "PixelReadoutGeometry/PixelDetectorManager.h"
#include "StoreGate/StoreGateSvc.h"
#include "StoreGate/StoreGate.h"
#include "InDetIdentifier/PixelID.h"
#include "InDetIdentifier/SCT_ID.h"
#include "GeoPrimitives/CLHEPtoEigenConverter.h"
inline void GeoSiHit::init() {
StoreGateSvc *detStore = StoreGate::pointer("DetectorStore");
if(detStore->retrieve(s_sct,"SCT").isFailure()){
//if SCT retrieval fails, try ITkStrip
if(detStore->retrieve(s_sct,"ITkStrip").isFailure()) s_sct=0;
}
if(detStore->retrieve(s_pix,"Pixel").isFailure()){
//if Pixel retrieval fails, try ITkPixel
if(detStore->retrieve(s_pix,"ITkPixel").isFailure()) s_pix = 0;
}
if(detStore->retrieve(s_sID,"SCT_ID").isFailure())
s_sID = 0;
if(detStore->retrieve(s_pID,"PixelID").isFailure())
s_pID = 0;
}
inline GeoSiHit::GeoSiHit (const SiHit & h) {
m_hit = &h;
//If neither manager exists, may need to re-initialize...
if (!s_sct && !s_pix) init();
}
inline HepGeom::Point3D<double> GeoSiHit::getGlobalPosition() const {
......@@ -44,19 +23,19 @@ inline HepGeom::Point3D<double> GeoSiHit::getGlobalPosition() const {
const InDetDD::SiDetectorElement *geoelement=NULL;
if (m_hit->isPixel()) {
id = s_pID->wafer_id(Barrel,
id = pixID()->wafer_id(Barrel,
m_hit->getLayerDisk(),
m_hit->getPhiModule(),
m_hit->getEtaModule());
geoelement = s_pix->getDetectorElement(id);
geoelement = pixMgr()->getDetectorElement(id);
}
else {
id = s_sID->wafer_id(Barrel,
id = sctID()->wafer_id(Barrel,
m_hit->getLayerDisk(),
m_hit->getPhiModule(),
m_hit->getEtaModule(),
m_hit->getSide() );
geoelement = s_sct->getDetectorElement(id);
geoelement = sctMgr()->getDetectorElement(id);
}
......
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/
#ifndef GEOADAPTORS_GEOTRTUNCOMPRESSEDHIT_H
......@@ -33,15 +33,13 @@ class GeoTRTUncompressedHit {
HepGeom::Point3D<double> getGlobalPosition() const;
// Is this hit OK?
operator bool () const { return s_mgr; }
operator bool () const { return true; }
private:
static void init();
static const InDetDD::TRT_DetectorManager* init();
const InDetDD::TRT_DetectorManager* mgr() const;
const TRTUncompressedHit *m_hit;
static const InDetDD::TRT_DetectorManager *s_mgr;
};
#include "GeoAdaptors/GeoTRTUncompressedHit.icc"
......
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/
#include "InDetSimEvent/TRTUncompressedHit.h"
#include "TRT_ReadoutGeometry/TRT_DetectorManager.h"
#include "TRT_ReadoutGeometry/TRT_BarrelElement.h"
#include "TRT_ReadoutGeometry/TRT_EndcapElement.h"
#include "StoreGate/StoreGateSvc.h"
#include "StoreGate/StoreGate.h"
#include <bitset>
inline void GeoTRTUncompressedHit::init() {
StoreGateSvc *detStore = StoreGate::pointer("DetectorStore");
if(detStore->retrieve(s_mgr,"TRT").isFailure())
std::cout << "GeoTRTUncompressedHit::init() WARNING Unable to retrieve InDetDD::TRT_DetectorManager" << std::endl;
}
inline GeoTRTUncompressedHit::GeoTRTUncompressedHit (const TRTUncompressedHit & h) {
m_hit = &h;
if (!s_mgr) init();
}
inline HepGeom::Point3D<double> GeoTRTUncompressedHit::getGlobalPosition() const {
......@@ -38,7 +29,7 @@ inline HepGeom::Point3D<double> GeoTRTUncompressedHit::getGlobalPosition() const
hitID >>= shift;
ringID = hitID & mask;
trtID = hitID >> shift;
const InDetDD::TRT_BarrelElement *element = s_mgr->getBarrelElement(trtID,ringID,moduleID,layerID);
const InDetDD::TRT_BarrelElement *element = mgr()->getBarrelElement(trtID,ringID,moduleID,layerID);
if (element) {
HepGeom::Point3D<double> v(m_hit->GetPreStepX(), m_hit->GetPreStepY(), m_hit->GetPreStepZ());
return element->getAbsoluteTransform(strawID)*v;
......@@ -54,7 +45,7 @@ inline HepGeom::Point3D<double> GeoTRTUncompressedHit::getGlobalPosition() const
wheelID = hitID & mask;
trtID = hitID >> shift;
bool isPositive = trtID==2 ? 1:0;
const InDetDD::TRT_EndcapElement *element = s_mgr->getEndcapElement(isPositive,wheelID,planeID,sectorID);
const InDetDD::TRT_EndcapElement *element = mgr()->getEndcapElement(isPositive,wheelID,planeID,sectorID);
if (element) {
HepGeom::Point3D<double> v(m_hit->GetPreStepX(), m_hit->GetPreStepY(), m_hit->GetPreStepZ());
return element->getAbsoluteTransform(strawID)*v;
......
/*
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/
#include "GeoAdaptors/GeoCaloCalibHit.h"
#include "StoreGate/StoreGateSvc.h"
#include "GaudiKernel/ServiceHandle.h"
const CaloDetDescrManager* GeoCaloCalibHit::initDDMgr()
{
ServiceHandle<StoreGateSvc> detStore ("DetectorStore", "GeoLArHit");
const CaloDetDescrManager* mgr = nullptr;
if (detStore->retrieve(mgr).isFailure()) {
std::abort();
}
return mgr;
}
const CaloDetDescrManager* GeoCaloCalibHit::ddmgr() const
{
const CaloDetDescrManager* const ddmgr = initDDMgr();
return ddmgr;
}
/*
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/
#include "GeoAdaptors/GeoLArHit.h"
#include "StoreGate/StoreGateSvc.h"
#include "GaudiKernel/ServiceHandle.h"
const CaloDetDescrManager* GeoLArHit::init()
{
ServiceHandle<StoreGateSvc> detStore ("DetectorStore", "GeoLArHit");
const CaloDetDescrManager* mgr = nullptr;
if (detStore->retrieve(mgr).isFailure()) {
std::abort();
}
return mgr;
}
const CaloDetDescrManager* GeoLArHit::mgr() const
{
static const CaloDetDescrManager* const mgr = init();
return mgr;
}
/*
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/
#include "GeoAdaptors/GeoMuonHits.h"
#include "StoreGate/StoreGateSvc.h"
#include "GaudiKernel/ServiceHandle.h"
const MuonGM::MuonDetectorManager* GeoMuonHitBase::init()
{
ServiceHandle<StoreGateSvc> detStore ("DetectorStore", "GeoSiHit");
const MuonGM::MuonDetectorManager* mgr = nullptr;
if(detStore->retrieve(mgr,"Muon").isFailure()) {
std::abort();
}
return mgr;
}
const MuonGM::MuonDetectorManager* GeoMuonHitBase::mgr() const
{
const MuonGM::MuonDetectorManager* const mgr = init();
return mgr;
}
/*
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/
#include "GeoAdaptors/GeoSiHit.h"
#include "StoreGate/StoreGateSvc.h"
#include "GaudiKernel/ServiceHandle.h"
const InDetDD::PixelDetectorManager* GeoSiHit::initPixMgr()
{
ServiceHandle<StoreGateSvc> detStore ("DetectorStore", "GeoSiHit");
const InDetDD::PixelDetectorManager* pix = nullptr;
if(detStore->retrieve(pix,"Pixel").isFailure()){
//if Pixel retrieval fails, try ITkPixel
if(detStore->retrieve(pix,"ITkPixel").isFailure())
{
std::abort();
}
}
return pix;
}
const InDetDD::SCT_DetectorManager* GeoSiHit::initSctMgr()
{
ServiceHandle<StoreGateSvc> detStore ("DetectorStore", "GeoSiHit");
const InDetDD::SCT_DetectorManager* sct = nullptr;
if(detStore->retrieve(sct,"SCT").isFailure()){
if(detStore->retrieve(sct,"ITkStrip").isFailure()) {
std::abort();
}
}
return sct;
}
const PixelID* GeoSiHit::initPixID()
{
ServiceHandle<StoreGateSvc> detStore ("DetectorStore", "GeoSiHit");
const PixelID* pix = nullptr;
if(detStore->retrieve(pix,"PixelID").isFailure()) {
std::abort();
}
return pix;
}
const SCT_ID* GeoSiHit::initSctID()
{
ServiceHandle<StoreGateSvc> detStore ("DetectorStore", "GeoSiHit");
const SCT_ID* sct = nullptr;
if(detStore->retrieve(sct,"SCT_ID").isFailure()) {
std::abort();
}
return sct;
}
const InDetDD::PixelDetectorManager* GeoSiHit::pixMgr() const
{
const InDetDD::PixelDetectorManager* const mgr = initPixMgr();
return mgr;
}
const InDetDD::SCT_DetectorManager* GeoSiHit::sctMgr() const
{
const InDetDD::SCT_DetectorManager* const mgr = initSctMgr();
return mgr;
}
const PixelID* GeoSiHit::pixID() const
{
const PixelID* const id = initPixID();
return id;
}
const SCT_ID* GeoSiHit::sctID() const
{
const SCT_ID* const id = initSctID();
return id;
}
/*
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/
#include "GeoAdaptors/GeoTRTUncompressedHit.h"
#include "StoreGate/StoreGateSvc.h"
#include "GaudiKernel/ServiceHandle.h"
const InDetDD::TRT_DetectorManager* GeoTRTUncompressedHit::init()
{
ServiceHandle<StoreGateSvc> detStore ("DetectorStore", "GeoSiHit");
const InDetDD::TRT_DetectorManager* mgr = nullptr;
if(detStore->retrieve(mgr,"TRT").isFailure()) {
std::abort();
}
return mgr;
}
const InDetDD::TRT_DetectorManager* GeoTRTUncompressedHit::mgr() const
{
const InDetDD::TRT_DetectorManager* const mgr = init();
return mgr;
}
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#include "GeoAdaptors/GeoLArHit.h"
#include "GeoAdaptors/GeoSiHit.h"
#include "GeoAdaptors/GeoMuonHits.h"
#include "GeoAdaptors/GeoTRTUncompressedHit.h"
const InDetDD::SCT_DetectorManager *GeoSiHit::s_sct = 0;
const InDetDD::PixelDetectorManager *GeoSiHit::s_pix = 0;
const PixelID *GeoSiHit::s_pID = 0;
const SCT_ID *GeoSiHit::s_sID = 0;
const MuonGM::MuonDetectorManager* GeoMDTHit::s_man = 0;
const MdtIdHelper* GeoMDTHit::s_mdtID = 0;
const MuonGM::MuonDetectorManager* GeoTGCHit::s_man = 0;
const TgcIdHelper* GeoTGCHit::s_tgcID = 0;
const MuonGM::MuonDetectorManager* GeoRPCHit::s_man = 0;
const RpcIdHelper* GeoRPCHit::s_rpcID = 0;
const MuonGM::MuonDetectorManager* GeoCSCHit::s_man = 0;
const CscIdHelper* GeoCSCHit::s_cscID = 0;
const MuonGM::MuonDetectorManager* GeosTGCHit::s_man = 0;
const sTgcIdHelper* GeosTGCHit::s_stgcID = 0;
const MuonGM::MuonDetectorManager* GeoMMHit::s_man = 0;
const MmIdHelper* GeoMMHit::s_mmID = 0;
const CaloDetDescrManager* GeoLArHit::s_man = 0;
const InDetDD::TRT_DetectorManager *GeoTRTUncompressedHit::s_mgr = 0;
ForwardDetectors/ZDC/ZdcCnv/ZdcByteStream
/*
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 ZDCBYTESTREAMCNV_H
......@@ -38,6 +38,7 @@ class ISvcLocator;
class StatusCode;
class ZdcByteStreamTool;
class ZdcByteStreamReadV1V2Tool;
class StoreGateSvc;
// Abstract factory to create the converter
template <typename > class CnvFactory;
......@@ -77,8 +78,9 @@ private:
/// Service for WRITING bytestream
ServiceHandle<IByteStreamEventAccess> m_ByteStreamEventAccess;
/// Message log
mutable MsgStream m_log;
ServiceHandle<StoreGateSvc> m_evtStore;
/// Message log
bool m_debug;
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment