Skip to content
Snippets Groups Projects
Commit b6253973 authored by Atlas-Software Librarian's avatar Atlas-Software Librarian Committed by Graeme Stewart
Browse files

'CMakeLists.txt' (PixelCalibAlgs-00-07-10)

parent d110d19a
No related branches found
No related tags found
No related merge requests found
################################################################################
# Package: PixelCalibAlgs
################################################################################
# Declare the package name:
atlas_subdir( PixelCalibAlgs )
# Declare the package's dependencies:
atlas_depends_on_subdirs( PUBLIC
Control/AthenaBaseComps
GaudiKernel
InnerDetector/InDetRecEvent/InDetPrepRawData
PRIVATE
Database/AthenaPOOL/AthenaPoolUtilities
Database/CoralDB
DetectorDescription/DetDescrCond/DetDescrConditions
DetectorDescription/Identifier
Event/EventInfo
InnerDetector/InDetConditions/InDetConditionsSummaryService
InnerDetector/InDetConditions/PixelConditionsData
InnerDetector/InDetConditions/PixelConditionsServices
InnerDetector/InDetDetDescr/InDetIdentifier
InnerDetector/InDetDetDescr/InDetReadoutGeometry
InnerDetector/InDetDetDescr/PixelGeoModel
InnerDetector/InDetRawEvent/InDetRawData
Tools/PathResolver )
# External dependencies:
find_package( CLHEP )
find_package( CORAL COMPONENTS CoralBase CoralKernel RelationalAccess )
find_package( ROOT COMPONENTS Matrix Gpad Graf Core Tree MathCore Hist RIO pthread GenVector MathMore Minuit Minuit2 Physics HistPainter Rint Graf3d Html Postscript Gui GX11TTF GX11 )
# tag ROOTCintexLibs was not recognized in automatic conversion in cmt2cmake
# tag ROOTSTLDictLibs was not recognized in automatic conversion in cmt2cmake
# tag ROOTBasicLibs was not recognized in automatic conversion in cmt2cmake
# Component(s) in the package:
atlas_add_library( PixelOfflineCalib
src/*.cxx
PUBLIC_HEADERS PixelCalibAlgs
INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
PRIVATE_INCLUDE_DIRS ${CORAL_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS}
PRIVATE_DEFINITIONS ${CLHEP_DEFINITIONS}
LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaBaseComps GaudiKernel InDetPrepRawData
PRIVATE_LINK_LIBRARIES ${CORAL_LIBRARIES} ${CLHEP_LIBRARIES} AthenaPoolUtilities CoralDB DetDescrConditions Identifier EventInfo PixelConditionsData InDetIdentifier InDetReadoutGeometry InDetRawData PathResolver )
atlas_add_component( PixelCalibAlgs
src/*.cxx
src/components/*.cxx
INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS}
LINK_LIBRARIES ${ROOT_LIBRARIES} ${CORAL_LIBRARIES} ${CLHEP_LIBRARIES} AthenaBaseComps GaudiKernel InDetPrepRawData AthenaPoolUtilities CoralDB DetDescrConditions Identifier EventInfo PixelConditionsData InDetIdentifier InDetReadoutGeometry InDetRawData PathResolver PixelOfflineCalib )
atlas_add_executable( doPixelOfflineCalib
Application/doPixelOfflineCalib.cxx
INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS}
LINK_LIBRARIES ${ROOT_LIBRARIES} ${CORAL_LIBRARIES} ${CLHEP_LIBRARIES} AthenaBaseComps GaudiKernel InDetPrepRawData AthenaPoolUtilities CoralDB DetDescrConditions Identifier EventInfo PixelConditionsData InDetIdentifier InDetReadoutGeometry InDetRawData PathResolver PixelOfflineCalib )
atlas_add_executable( doPixelOfflineCalibG4
Application/doPixelOfflineCalibG4.cxx
INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS}
LINK_LIBRARIES ${ROOT_LIBRARIES} ${CORAL_LIBRARIES} ${CLHEP_LIBRARIES} AthenaBaseComps GaudiKernel InDetPrepRawData AthenaPoolUtilities CoralDB DetDescrConditions Identifier EventInfo PixelConditionsData InDetIdentifier InDetReadoutGeometry InDetRawData PathResolver PixelOfflineCalib )
atlas_add_executable( PlotChargeSharingConstants
Application/PlotChargeSharingConstants.cxx
INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS}
LINK_LIBRARIES ${ROOT_LIBRARIES} ${CORAL_LIBRARIES} ${CLHEP_LIBRARIES} AthenaBaseComps GaudiKernel InDetPrepRawData AthenaPoolUtilities CoralDB DetDescrConditions Identifier EventInfo PixelConditionsData InDetIdentifier InDetReadoutGeometry InDetRawData PathResolver PixelOfflineCalib )
atlas_add_executable( PlotPixelClusterOnTrackErrors
Application/PlotPixelClusterOnTrackErrors.cxx
INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS}
LINK_LIBRARIES ${ROOT_LIBRARIES} ${CORAL_LIBRARIES} ${CLHEP_LIBRARIES} AthenaBaseComps GaudiKernel InDetPrepRawData AthenaPoolUtilities CoralDB DetDescrConditions Identifier EventInfo PixelConditionsData InDetIdentifier InDetReadoutGeometry InDetRawData PathResolver PixelOfflineCalib )
atlas_add_executable( updateNoiseMaps
Application/updateNoiseMaps.C
INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS}
LINK_LIBRARIES ${ROOT_LIBRARIES} ${CORAL_LIBRARIES} ${CLHEP_LIBRARIES} AthenaBaseComps GaudiKernel InDetPrepRawData AthenaPoolUtilities CoralDB DetDescrConditions Identifier EventInfo PixelConditionsData InDetIdentifier InDetReadoutGeometry InDetRawData PathResolver PixelOfflineCalib )
atlas_add_executable( updateDeadMaps
Application/updateDeadMaps.C
INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS}
LINK_LIBRARIES ${ROOT_LIBRARIES} ${CORAL_LIBRARIES} ${CLHEP_LIBRARIES} AthenaBaseComps GaudiKernel InDetPrepRawData AthenaPoolUtilities CoralDB DetDescrConditions Identifier EventInfo PixelConditionsData InDetIdentifier InDetReadoutGeometry InDetRawData PathResolver PixelOfflineCalib )
# Install files from the package:
atlas_install_joboptions( share/*.py )
atlas_install_runtime( share/*.txt share/*.sh )
...@@ -53,13 +53,10 @@ class NoiseMapBuilder: public AthAlgorithm{ ...@@ -53,13 +53,10 @@ class NoiseMapBuilder: public AthAlgorithm{
double m_nEvents; double m_nEvents;
TH1D* m_nEventsHist;
std::vector<TH2D*> m_hitMaps; std::vector<TH2D*> m_hitMaps;
std::vector<TH2C*> m_noiseMaps; std::vector<TH2C*> m_noiseMaps;
std::vector<TH1D*> m_LBdependence; std::vector<TH1D*> m_LBdependence;
TH1D* m_disabledModules;
const PixelID* m_pixelID; const PixelID* m_pixelID;
double m_disk1ACut; double m_disk1ACut;
...@@ -85,6 +82,8 @@ class NoiseMapBuilder: public AthAlgorithm{ ...@@ -85,6 +82,8 @@ class NoiseMapBuilder: public AthAlgorithm{
int m_lbMax; int m_lbMax;
bool m_calculateNoiseMaps; bool m_calculateNoiseMaps;
TH1D* m_nEventsHist;
TH1D* m_disabledModules;
}; };
#endif #endif
...@@ -16,6 +16,8 @@ ...@@ -16,6 +16,8 @@
#include<vector> #include<vector>
class IPixelCalibSvc; class IPixelCalibSvc;
class IPixelOfflineCalibSvc;
class IBLParameterSvc;
class PixelChargeToTConversion: public AthAlgorithm{ class PixelChargeToTConversion: public AthAlgorithm{
...@@ -29,6 +31,9 @@ class PixelChargeToTConversion: public AthAlgorithm{ ...@@ -29,6 +31,9 @@ class PixelChargeToTConversion: public AthAlgorithm{
private: private:
ServiceHandle<IPixelCalibSvc> m_calibsvc; ServiceHandle<IPixelCalibSvc> m_calibsvc;
ServiceHandle<IBLParameterSvc> m_IBLParameterSvc;
int m_overflowIBLToT;
ServiceHandle<IPixelOfflineCalibSvc> m_offlineCalibSvc;
//std::vector<unsigned int> m_modules; //std::vector<unsigned int> m_modules;
std::string m_PixelsClustersName; std::string m_PixelsClustersName;
......
...@@ -28,6 +28,7 @@ use InDetRawData InDetRawData-* InnerDetector/InDetRawEv ...@@ -28,6 +28,7 @@ use InDetRawData InDetRawData-* InnerDetector/InDetRawEv
use EventInfo EventInfo-* Event use EventInfo EventInfo-* Event
use InDetConditionsSummaryService InDetConditionsSummaryService-* InnerDetector/InDetConditions use InDetConditionsSummaryService InDetConditionsSummaryService-* InnerDetector/InDetConditions
use AtlasCLHEP AtlasCLHEP-* External use AtlasCLHEP AtlasCLHEP-* External
use PixelGeoModel PixelGeoModel-* InnerDetector/InDetDetDescr
public public
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include "PixelConditionsData/SpecialPixelMap.h" #include "PixelConditionsData/SpecialPixelMap.h"
#include "PixelConditionsServices/ISpecialPixelMapSvc.h" #include "PixelConditionsServices/ISpecialPixelMapSvc.h"
#include "AthenaPoolUtilities/CondAttrListCollection.h" #include "AthenaPoolUtilities/CondAttrListCollection.h"
#include "PixelConditionsServices/ISpecialPixelMapSvc.h"
// geometry // geometry
#include "InDetIdentifier/PixelID.h" #include "InDetIdentifier/PixelID.h"
...@@ -213,38 +214,35 @@ StatusCode PixMapOverlayWriter::execute(){ ...@@ -213,38 +214,35 @@ StatusCode PixMapOverlayWriter::execute(){
for(std::map<std::string, std::vector<int> >::const_iterator module = m_frontends.begin(); for(std::map<std::string, std::vector<int> >::const_iterator module = m_frontends.begin();
module != m_frontends.end(); ++module){ module != m_frontends.end(); ++module){
unsigned int modid_parsed= std::atoi((module->first).c_str());
IdentifierHash moduleHash = m_pixelID->wafer_hash(Identifier(modid_parsed));
try{ try{
if(db->objectType(module->first) == "MODULE"){
IdentifierHash moduleHash = if( moduleHash < m_pixelID->wafer_hash_max() ){
m_pixelID->wafer_hash(Identifier(std::atoi(db->findAlias(module->first, "HASHID").c_str())));
if( moduleHash < m_pixelID->wafer_hash_max() ){
for( std::vector<int>::const_iterator frontend = module->second.begin(); for( std::vector<int>::const_iterator frontend = module->second.begin();
frontend != module->second.end(); ++frontend ){ frontend != module->second.end(); ++frontend ){
if( (*frontend) >= 0 && (*frontend) < 16 ){ if( (*frontend) >= 0 && (*frontend) < 16 ){
(*spm)[moduleHash]->setchipsPerModule( m_specialPixelMapSvc->getChips(moduleHash) );
(*spm)[moduleHash]->setChipStatus( (*frontend), m_moduleStatus); (*spm)[moduleHash]->setChipStatus( (*frontend), m_moduleStatus);
} }
else{ else{
ATH_MSG_ERROR( "Frontend index out of range: " << module->second ATH_MSG_ERROR( "Frontend index out of range: " << module->second
<< ", ignoring this frontend index" ); << ", ignoring this frontend index" );
} }
} } //for
} } //if 2
else{ else{
ATH_MSG_ERROR( "Module hash out of range: " << moduleHash ATH_MSG_ERROR( "Module hash out of range: " << moduleHash
<< ", ignoring this module hash" ); << ", ignoring this module hash" );
} }
} }//try
else{
ATH_MSG_ERROR( module->first << " is of type " << db->objectType(module->first)
<< " (expected MODULE), ignoring this object ID" );
}
}
catch(...){ catch(...){
ATH_MSG_ERROR( "Unable to look up type of object " << module->first ATH_MSG_ERROR( "Unable to look up type of object " << module->first
<< ", ignoring this object ID" ); << ", ignoring this object ID" );
......
...@@ -7,11 +7,20 @@ ...@@ -7,11 +7,20 @@
#include "PixelConditionsServices/IPixelCalibSvc.h" #include "PixelConditionsServices/IPixelCalibSvc.h"
#include "AthenaPoolUtilities/CondAttrListCollection.h" #include "AthenaPoolUtilities/CondAttrListCollection.h"
#define private public #define private public
#include "PixelGeoModel/IBLParameterSvc.h"
#include "InDetIdentifier/PixelID.h"
#include "InDetPrepRawData/PixelCluster.h" #include "InDetPrepRawData/PixelCluster.h"
#include "InDetReadoutGeometry/SiDetectorElement.h"
#include "PixelConditionsServices/IPixelOfflineCalibSvc.h"
PixelChargeToTConversion::PixelChargeToTConversion(const std::string& name, ISvcLocator* pSvcLocator) : PixelChargeToTConversion::PixelChargeToTConversion(const std::string& name, ISvcLocator* pSvcLocator) :
AthAlgorithm(name, pSvcLocator), AthAlgorithm(name, pSvcLocator),
m_calibsvc("PixelCalibSvc", name) m_calibsvc("PixelCalibSvc", name),
m_IBLParameterSvc("IBLParameterSvc",name),
m_overflowIBLToT(0),
m_offlineCalibSvc("PixelOfflineCalibSvc", name)
{ {
declareProperty("PixelCalibSvc", m_calibsvc); declareProperty("PixelCalibSvc", m_calibsvc);
} }
...@@ -32,6 +41,25 @@ StatusCode PixelChargeToTConversion::initialize(){ ...@@ -32,6 +41,25 @@ StatusCode PixelChargeToTConversion::initialize(){
} }
msg(MSG::INFO) << " PixelCalibSvc found " << endreq; msg(MSG::INFO) << " PixelCalibSvc found " << endreq;
if ( !m_offlineCalibSvc.empty() ) {
StatusCode sc = m_offlineCalibSvc.retrieve();
if (sc.isFailure() || !m_offlineCalibSvc ) {
ATH_MSG_ERROR( m_offlineCalibSvc.type() << " not found! ");
return StatusCode::RECOVERABLE;
}
else{
ATH_MSG_INFO ( "Retrieved tool " << m_offlineCalibSvc.type() );
}
}
if (m_IBLParameterSvc.retrieve().isFailure()) {
ATH_MSG_FATAL("Could not retrieve IBLParameterSvc");
return StatusCode::FAILURE;
} else
ATH_MSG_INFO("Retrieved service " << m_IBLParameterSvc);
m_overflowIBLToT = m_offlineCalibSvc->getIBLToToverflow();
return StatusCode::SUCCESS; return StatusCode::SUCCESS;
} }
...@@ -61,6 +89,20 @@ StatusCode PixelChargeToTConversion::execute(){ ...@@ -61,6 +89,20 @@ StatusCode PixelChargeToTConversion::execute(){
auto theNonConstCluster = const_cast<InDet::PixelCluster*> (theCluster); auto theNonConstCluster = const_cast<InDet::PixelCluster*> (theCluster);
ATH_MSG_DEBUG( "cluster RDOs , size, ToTs, size, Charges, size "<< RDOs <<" "<<RDOs.size()<<" "<< ToTs<<" " <<ToTs.size()<<" "<<Charges<<" "<<Charges.size()); ATH_MSG_DEBUG( "cluster RDOs , size, ToTs, size, Charges, size "<< RDOs <<" "<<RDOs.size()<<" "<< ToTs<<" " <<ToTs.size()<<" "<<Charges<<" "<<Charges.size());
const InDetDD::SiDetectorElement* element=theCluster->detectorElement();
if (element==0) {
ATH_MSG_ERROR("Could not get detector element");
}
const AtlasDetectorID* aid = element->getIdHelper();
if (aid==0){
ATH_MSG_ERROR("Could not get ATLASDetectorID");
}
const PixelID* pixelIDp=dynamic_cast<const PixelID*>(aid);
if (!pixelIDp){
ATH_MSG_ERROR("Could not get PixelID pointer");
}
const PixelID& pixelID = *pixelIDp;
int nRDO=RDOs.size(); int nRDO=RDOs.size();
// convert from Charge -> ToT // convert from Charge -> ToT
if(ToTs.size()==0 && Charges.size()!=0){ if(ToTs.size()==0 && Charges.size()!=0){
...@@ -81,10 +123,20 @@ StatusCode PixelChargeToTConversion::execute(){ ...@@ -81,10 +123,20 @@ StatusCode PixelChargeToTConversion::execute(){
if ( A>0. && (Charge+C)!=0 ) { if ( A>0. && (Charge+C)!=0 ) {
tot = A*(Charge+E)/(Charge+C); tot = A*(Charge+E)/(Charge+C);
} else tot=0.; } else tot=0.;
ATH_MSG_DEBUG( "A E C tot " << A <<" "<<E <<" "<<C<<" "<<tot); ATH_MSG_DEBUG( "A E C tot " << A <<" "<<E <<" "<<C<<" "<<tot);
totList.push_back( (int) (tot + 0.1)) ; // Fudge to make sure we round to the correct number
ATH_MSG_DEBUG( "from Charge --> ToT " << Charge <<" "<<(int) (tot + 0.1) ); int totInt = (int) (tot + 0.1);
sumToT += (int) (tot + 0.1);
if( m_IBLParameterSvc->containsIBL() && pixelID.barrel_ec(pixid) == 0 && pixelID.layer_disk(pixid) == 0 ) {
int tot0 = totInt;
if ( totInt >= m_overflowIBLToT ) totInt = m_overflowIBLToT;
msg(MSG::DEBUG) << "barrel_ec = " << pixelID.barrel_ec(pixid) << " layer_disque = " << pixelID.layer_disk(pixid) << " ToT = " << tot0 << " Real ToT = " << totInt << endreq;
}
totList.push_back( totInt ) ; // Fudge to make sure we round to the correct number
ATH_MSG_DEBUG( "from Charge --> ToT " << Charge <<" "<< totInt);
sumToT += totInt;
} }
ATH_MSG_DEBUG( "sumToT " << sumToT); ATH_MSG_DEBUG( "sumToT " << sumToT);
theNonConstCluster->m_totList = totList; theNonConstCluster->m_totList = totList;
...@@ -95,8 +147,7 @@ StatusCode PixelChargeToTConversion::execute(){ ...@@ -95,8 +147,7 @@ StatusCode PixelChargeToTConversion::execute(){
}//loop over collections }//loop over collections
return StatusCode::SUCCESS; return StatusCode::SUCCESS;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment