Commit 4ed8566a authored by Atlas-Software Librarian's avatar Atlas-Software Librarian Committed by Graeme Stewart
Browse files

'CMakeLists.txt' (CscCalibEvent-01-01-00)

	* removing class CscCalibDataIdHash from package (this class cannot work that way)
	* addressing coverity defects 12721, 13086
	* tagging CscCalibEvent-01-01-00

2015-04-14 Jochen Meyer
	* addressing coverity defects 29280, 12459, 12430
	* tagging CscCalibEvent-01-00-05
parent d7c66706
################################################################################
# Package: CscCalibEvent
################################################################################
# Declare the package name:
atlas_subdir( CscCalibEvent )
# Declare the package's dependencies:
atlas_depends_on_subdirs( PUBLIC
Control/CLIDSvc
Control/DataModel
Control/SGTools
DetectorDescription/Identifier
Event/EventContainers
MuonSpectrometer/MuonIdHelpers )
# External dependencies:
find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread )
# Component(s) in the package:
atlas_add_library( CscCalibEvent
src/*.cxx
PUBLIC_HEADERS CscCalibEvent
PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
LINK_LIBRARIES DataModel SGTools Identifier MuonIdHelpersLib
PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} )
atlas_add_dictionary( CscCalibEventDict
CscCalibEvent/CscCalibEventDict.h
CscCalibEvent/selection.xml
INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
LINK_LIBRARIES ${ROOT_LIBRARIES} DataModel SGTools Identifier MuonIdHelpersLib CscCalibEvent )
......@@ -29,7 +29,7 @@ private:
public:
/* default constructor */
CscCalibData() {}
CscCalibData() : m_idHash(0) {}
/* full constructor */
CscCalibData(int hashId, std::vector<float> calibConst) :
......
......@@ -16,7 +16,6 @@
#include <string>
#include "CscCalibEvent/CscCalibDataCollection.h"
#include "CscCalibEvent/CscCalibDataIdHash.h"
#include "MuonIdHelpers/CscIdHelper.h"
#include "CLIDSvc/CLASS_DEF.h"
......
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#ifndef CSCCALIBEVENT_CSCCALIBDATAIDHASH_H
#define CSCCALIBEVENT_CSCCALIBDATAIDHASH_H
/****************************************************************
Hash function for CSC calibration data of a chamber
- to be used in CscCalibDataContainer (IdentifiableContainer)
@author Ketevi A. Assamagan, BNL October 2005
Name: CscCalibDataIdHash.h
Package: MuonSpectrometer/MuonCalib/CscCalib/CscCalibEvent
*****************************************************************/
#include "MuonIdHelpers/CscIdHelper.h"
class CscCalibDataIdHash {
public:
typedef Identifier ID;
/** constructor */
CscCalibDataIdHash ();
/** destructor */
virtual ~CscCalibDataIdHash();
/** Convert ID to int */
int operator() (const ID& id) const ;
/** return maximum number of IDs */
int max() const { return m_max; }
/** Initialize the Csc Id Helper */
void setHelper (const CscIdHelper* helper) { m_cscHelper = helper; }
/** get the CSC Id Helper */
const CscIdHelper * cscIdHelper () { return m_cscHelper; }
private:
/** Identifier context */
IdContext* m_context;
/** total number of IDs */
int m_max;
/** CSC Id Helper */
const CscIdHelper * m_cscHelper;
};
#endif
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#include "CscCalibEvent/CscCalibDataIdHash.h"
/***************************************************
CscCalibData Hash Id implementation
This class converts a Csc Identifier into a integer,
according to its fields
Author: Ketevi A. Assamagan
***************************************************/
#include <cassert>
#include <iostream>
/** default contructor */
CscCalibDataIdHash::CscCalibDataIdHash( ) {
IdContext cntx = m_cscHelper->module_context();
m_context = new IdContext(cntx.prefix_id(), cntx.begin_index(), cntx.end_index());
m_max = m_cscHelper->module_hash_max();
}
/** get the hash id given the identifier */
int CscCalibDataIdHash::operator() (const ID& id) const {
IdentifierHash result;
m_cscHelper->get_hash(id, result, m_context);
return (result);
}
/** default destructor */
CscCalibDataIdHash::~CscCalibDataIdHash( ) {
delete m_context;
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment