Commit 23c9353a authored by Edward Moyse's avatar Edward Moyse
Browse files

Merge branch 'MR_MuonDetMgr' into 'master'

Migrate clients to retrieve MuonDetectorManager from the conditions store

See merge request atlas/athena!28912
parents 1fbbf570 155785bc
......@@ -39,8 +39,6 @@ namespace MuonCalib {
CscCalcPed::CscCalcPed(const string& name, ISvcLocator* pSvcLocator) :
AthAlgorithm(name,pSvcLocator),
m_cscId(NULL),
m_muon_mgr(NULL),
m_chronoSvc(0),
m_cscCoolStrSvc("MuonCalib::CscCoolStrSvc",name),
m_cscRdoDecoderTool ("Muon::CscRDO_Decoder"),
......@@ -114,18 +112,8 @@ namespace MuonCalib {
//*******Register services and tools *********/
/// Store Gate active store
StatusCode sc = detStore()->retrieve(m_cscId,"CSCIDHELPER");
if( sc.isFailure())
{
mLog << MSG::ERROR << " Cannot retrieve CscIdHelper " << endmsg;
return sc;
}
else
{
mLog << MSG::ERROR << "couldn't retrieve CscIdHelper" << endmsg;
return StatusCode::FAILURE;
}
ATH_CHECK(m_idHelperSvc.retrieve());
if(m_cscCoolStrSvc.retrieve().isFailure())
{
......@@ -133,7 +121,7 @@ namespace MuonCalib {
return StatusCode::FAILURE;
}
sc = service("ChronoStatSvc",m_chronoSvc);
StatusCode sc = service("ChronoStatSvc",m_chronoSvc);
if(sc.isFailure())
{
mLog << MSG::FATAL << "Cannot retrieve ChronoStatSvc!" << endmsg;
......@@ -167,7 +155,7 @@ namespace MuonCalib {
//Loop through ids to find out what hash range we're working on (in case we're using some
//unusual geometry)
vector<Identifier> ids = m_cscId->idVector();
vector<Identifier> ids = m_idHelperSvc->cscIdHelper().idVector();
vector<Identifier>::const_iterator chamItr = ids.begin();
vector<Identifier>::const_iterator chamEnd = ids.end();
m_maxStripHash = 0;
......@@ -175,14 +163,14 @@ namespace MuonCalib {
for(; chamItr != chamEnd; chamItr++)
{
vector<Identifier> stripVect;
m_cscId->idChannels(*chamItr,stripVect);
m_idHelperSvc->cscIdHelper().idChannels(*chamItr,stripVect);
vector<Identifier>::const_iterator stripItr = stripVect.begin();
vector<Identifier>::const_iterator stripEnd = stripVect.end();
for(;stripItr != stripEnd; stripItr++)
{
IdentifierHash stripHash;
m_cscId->get_channel_hash(*stripItr,stripHash);
m_idHelperSvc->cscIdHelper().get_channel_hash(*stripItr,stripHash);
if((unsigned int)stripHash > m_maxStripHash)
m_maxStripHash = (int)stripHash;
}//End strip loop
......@@ -199,23 +187,23 @@ namespace MuonCalib {
IdentifierHash stripHash =stripItr;
Identifier stripId;
IdContext channelContext = m_cscId->channel_context();
m_cscId->get_id(stripHash, stripId, &channelContext);
IdContext channelContext = m_idHelperSvc->cscIdHelper().channel_context();
m_idHelperSvc->cscIdHelper().get_id(stripHash, stripId, &channelContext);
int chamLayer = m_cscId->chamberLayer(stripId);
int chamLayer = m_idHelperSvc->cscIdHelper().chamberLayer(stripId);
if(chamLayer == m_expectedChamberLayer) //Only second chamber layer exists
{
int stationEta = m_cscId->stationEta(stripId);
int stationPhi = m_cscId->stationPhi(stripId);
int stripNumber = m_cscId->strip(stripId);
int wireLayer = m_cscId->wireLayer(stripId);
char orientation = m_cscId->measuresPhi(stripId) ? 'Y':'X';
int stationEta = m_idHelperSvc->cscIdHelper().stationEta(stripId);
int stationPhi = m_idHelperSvc->cscIdHelper().stationPhi(stripId);
int stripNumber = m_idHelperSvc->cscIdHelper().strip(stripId);
int wireLayer = m_idHelperSvc->cscIdHelper().wireLayer(stripId);
char orientation = m_idHelperSvc->cscIdHelper().measuresPhi(stripId) ? 'Y':'X';
char name[30],titleSeed[600];
TH1I* hist = NULL;
int stationName = m_cscId->stationName(stripId);
int stationName = m_idHelperSvc->cscIdHelper().stationName(stripId);
//Amplitude histogram
sprintf(name, "ampHist%u",stripItr);
sprintf(titleSeed, "Amplitude Histogram for eta %d, sector %d, layer %d%c, strip %d",
......@@ -452,7 +440,7 @@ namespace MuonCalib {
if(m_verbose) mLog << MSG::VERBOSE <<"There are " << rawDataContainter->size() << " rods in the RDO" << endmsg;
IdContext channelContext = m_cscId->channel_context();
IdContext channelContext = m_idHelperSvc->cscIdHelper().channel_context();
//Loop over RODs (data from 2 chambers), each of which is in
//a single CscRawaData collection
......@@ -489,58 +477,58 @@ namespace MuonCalib {
// WP Added
Identifier channelId =m_cscRdoDecoderTool->channelIdentifier(cluster, stripItr);
IdentifierHash cscChannelHashId;
m_cscId->get_channel_hash(channelId, cscChannelHashId);
m_idHelperSvc->cscIdHelper().get_channel_hash(channelId, cscChannelHashId);
///////////
int stripHash = cscChannelHashId;
Identifier stripId;
m_cscId->get_id(stripHash, stripId, &channelContext);
m_idHelperSvc->cscIdHelper().get_id(stripHash, stripId, &channelContext);
Chrono chronoAfterId(m_chronoSvc,"afterID1");
if( m_cscId->chamberLayer(channelId) != m_expectedChamberLayer)
if( m_idHelperSvc->cscIdHelper().chamberLayer(channelId) != m_expectedChamberLayer)
{
// cout << "Wrong chamber layer" << endl;
mLog << MSG::WARNING << "Wrong chamber layer a hash ("
<< stripHash << ") from the wrong multilayer has appeared in the data. Its string id is " << m_cscId->show_to_string(stripId)
<< " " << m_cscId->show_to_string(channelId)
<< stripHash << ") from the wrong multilayer has appeared in the data. Its string id is " << m_idHelperSvc->cscIdHelper().show_to_string(stripId)
<< " " << m_idHelperSvc->cscIdHelper().show_to_string(channelId)
<< endmsg;
mLog << MSG::INFO << "WP added (1) "
<< m_cscId->stationEta(stripId) << " " << m_cscId->measuresPhi(stripId) << " "
<< m_idHelperSvc->cscIdHelper().stationEta(stripId) << " " << m_idHelperSvc->cscIdHelper().measuresPhi(stripId) << " "
<< stripHash << " " << cscChannelHashId
<< endmsg;
mLog << MSG::INFO << "WP added (2) "
<< m_cscId->stationEta(stripId) << " " << m_cscId->measuresPhi(stripId) << " "
<< m_idHelperSvc->cscIdHelper().stationEta(stripId) << " " << m_idHelperSvc->cscIdHelper().measuresPhi(stripId) << " "
<< stripId << " " << channelId
<< endmsg;
// if(m_cscId->measuresPhi(stripId))
// if(m_idHelperSvc->cscIdHelper().measuresPhi(stripId))
// mLog << MSG::DEBUG <<" bad id Measures Phi" << endmsg;
// else
// mLog << MSG::DEBUG <<" bad id is eta" << endmsg;
//continue;
stripId = m_cscId->channelID(
m_cscId->stationName(stripId),
m_cscId->stationEta(stripId),
m_cscId->stationPhi(stripId),
stripId = m_idHelperSvc->cscIdHelper().channelID(
m_idHelperSvc->cscIdHelper().stationName(stripId),
m_idHelperSvc->cscIdHelper().stationEta(stripId),
m_idHelperSvc->cscIdHelper().stationPhi(stripId),
2,
m_cscId->wireLayer(stripId),
m_cscId->measuresPhi(stripId),
m_cscId->strip(stripId)
m_idHelperSvc->cscIdHelper().wireLayer(stripId),
m_idHelperSvc->cscIdHelper().measuresPhi(stripId),
m_idHelperSvc->cscIdHelper().strip(stripId)
);
IdentifierHash newHash;
m_cscId->get_channel_hash(stripId, newHash );
m_idHelperSvc->cscIdHelper().get_channel_hash(stripId, newHash );
stripHash = newHash;
if(m_debug) mLog << MSG::DEBUG << "New hash " << stripHash << endmsg;
}
else{
if(m_cscId->measuresPhi(stripId))
if(m_idHelperSvc->cscIdHelper().measuresPhi(stripId))
mLog << MSG::VERBOSE <<" good id Measures Phi" << endmsg;
else
mLog << MSG::VERBOSE <<" good id is eta" << endmsg;
......@@ -556,7 +544,7 @@ namespace MuonCalib {
//Test for threshold breach...
//int minMax = GetMinMax(samples);
//if(minMax < (m_cscId->measuresPhi(stripId) ? 50 :30)) {
//if(minMax < (m_idHelperSvc->cscIdHelper().measuresPhi(stripId) ? 50 :30)) {
size_t sampCnt = 0;
std::vector<uint16_t>::const_iterator sampItr = samples.begin();
std::vector<uint16_t>::const_iterator sampEnd = samples.end();
......@@ -761,25 +749,25 @@ namespace MuonCalib {
if(m_debug) mLog << MSG::DEBUG << "we're on hash " << hashId << " with pedestal " << ped
<< "and noise " << noise << endmsg;//<< " and threshold " << thold << endmsg;
Identifier id;
IdContext channelContext = m_cscId->channel_context();
m_cscId->get_id(hashId,id, &channelContext);
IdContext channelContext = m_idHelperSvc->cscIdHelper().channel_context();
m_idHelperSvc->cscIdHelper().get_id(hashId,id, &channelContext);
Identifier chamberId = m_cscId->elementID(id);
if(!m_cscId->valid(chamberId))
Identifier chamberId = m_idHelperSvc->cscIdHelper().elementID(id);
if(!m_idHelperSvc->cscIdHelper().valid(chamberId))
{
mLog << MSG::WARNING << chamberId.getString() << " is not a valid id!" << endmsg;
mLog << MSG::WARNING << "identifier is: " << m_cscId->show_to_string(chamberId) << endmsg;
mLog << MSG::WARNING << "identifier is: " << m_idHelperSvc->cscIdHelper().show_to_string(chamberId) << endmsg;
//id.show();
//in.ignore(10000,'\n');
}
IdentifierHash chamberHash;
m_cscId->get_module_hash(id,chamberHash);
m_idHelperSvc->cscIdHelper().get_module_hash(id,chamberHash);
//print out values.
out << hashId;
out <<" " << chamberHash;
out << " " << m_cscId->show_to_string(id) << " ";
out << " " << m_idHelperSvc->cscIdHelper().show_to_string(id) << " ";
out << " " << ped;
out << " " << noise;
out << " " << rms;
......@@ -835,31 +823,31 @@ namespace MuonCalib {
if(m_debug) mLog << MSG::DEBUG << "we're on hash " << hashId << " with pedestal " << ped
<< "and noise " << noise << endmsg;//<< " and threshold " << thold << endmsg;
Identifier id;
IdContext channelContext = m_cscId->channel_context();
m_cscId->get_id(hashId,id, &channelContext);
IdContext channelContext = m_idHelperSvc->cscIdHelper().channel_context();
m_idHelperSvc->cscIdHelper().get_id(hashId,id, &channelContext);
Identifier chamberId = m_cscId->elementID(id);
if(!m_cscId->valid(chamberId))
Identifier chamberId = m_idHelperSvc->cscIdHelper().elementID(id);
if(!m_idHelperSvc->cscIdHelper().valid(chamberId))
{
mLog << MSG::WARNING << chamberId.getString() << " is not a valid id!" << endmsg;
mLog << MSG::WARNING << "identifier is: " << m_cscId->show_to_string(chamberId) << endmsg;
mLog << MSG::WARNING << "identifier is: " << m_idHelperSvc->cscIdHelper().show_to_string(chamberId) << endmsg;
//id.show();
//in.ignore(10000,'\n');
}
char orientationChar = (m_cscId->measuresPhi(id) ? 'Y':'X');
char orientationChar = (m_idHelperSvc->cscIdHelper().measuresPhi(id) ? 'Y':'X');
IdentifierHash chamberHash;
m_cscId->get_module_hash(id,chamberHash);
m_idHelperSvc->cscIdHelper().get_module_hash(id,chamberHash);
//print out values.
out.setf(ios::right);//right aligned columns
out << setfill('0') << setw(8) << onlineHexId;
out <<" "
<< setw(2) << chamberHash << orientationChar << (m_cscId->wireLayer(id)-1)
<< setw(2) << chamberHash << orientationChar << (m_idHelperSvc->cscIdHelper().wireLayer(id)-1)
<<" "
<< setw(3) << m_cscId->strip(id) -1 << " " ;
<< setw(3) << m_idHelperSvc->cscIdHelper().strip(id) -1 << " " ;
out.setf(ios::fixed);
......@@ -1001,18 +989,18 @@ namespace MuonCalib {
for(unsigned int hashItr =0; hashItr <= m_maxStripHash; hashItr++) {
IdentifierHash stripHash =hashItr;
Identifier stripId;
IdContext channelContext = m_cscId->channel_context();
m_cscId->get_id(stripHash, stripId, &channelContext);
IdContext channelContext = m_idHelperSvc->cscIdHelper().channel_context();
m_idHelperSvc->cscIdHelper().get_id(stripHash, stripId, &channelContext);
int chamLayer = m_cscId->chamberLayer(stripId);
int chamLayer = m_idHelperSvc->cscIdHelper().chamberLayer(stripId);
if(chamLayer == m_expectedChamberLayer) //Only second chamber layer exists
{
int stationName = m_cscId->stationName(stripId);
//int stationEta = m_cscId->stationEta(stripId);
int stationPhi = m_cscId->stationPhi(stripId);
int stripNumber = m_cscId->strip(stripId);
int wireLayer = m_cscId->wireLayer(stripId);
char orientation = m_cscId->measuresPhi(stripId) ? 'Y':'X';
int stationName = m_idHelperSvc->cscIdHelper().stationName(stripId);
//int stationEta = m_idHelperSvc->cscIdHelper().stationEta(stripId);
int stationPhi = m_idHelperSvc->cscIdHelper().stationPhi(stripId);
int stripNumber = m_idHelperSvc->cscIdHelper().strip(stripId);
int wireLayer = m_idHelperSvc->cscIdHelper().wireLayer(stripId);
char orientation = m_idHelperSvc->cscIdHelper().measuresPhi(stripId) ? 'Y':'X';
int sector = 2*stationPhi + 50 - stationName;
......@@ -1099,10 +1087,10 @@ namespace MuonCalib {
strip = ((onlineId)&0xff) +1;
}
Identifier chanId = m_cscId->channelID(stationName,eta,phi,chamLay,wireLay,measuresPhi,strip);
Identifier chanId = m_idHelperSvc->cscIdHelper().channelID(stationName,eta,phi,chamLay,wireLay,measuresPhi,strip);
IdentifierHash chanHash;
m_cscId->get_channel_hash(chanId, chanHash);
m_idHelperSvc->cscIdHelper().get_channel_hash(chanId, chanHash);
hashId = (unsigned int)chanHash;
......
......@@ -13,8 +13,8 @@ an RDO
#include "StoreGate/DataHandle.h"
#include "GaudiKernel/ToolHandle.h"
#include "GaudiKernel/ServiceHandle.h"
#include "MuonReadoutGeometry/MuonDetectorManager.h"
#include "AthContainers/DataVector.h"
#include <vector>
......@@ -25,6 +25,7 @@ an RDO
#include "TH2.h"
#include "TH2F.h"
#include "MuonCondInterface/CscICoolStrSvc.h"
#include "MuonIdHelpers/IMuonIdHelperSvc.h"
class cscIdHelper;
class TFile;
......@@ -102,8 +103,7 @@ namespace MuonCalib{
/**Services and tools*/
// ITHistSvc * m_thistSvc;
// ICscCalibTool * m_cscCalibTool;
const CscIdHelper *m_cscId;
const MuonGM::MuonDetectorManager * m_muon_mgr;
ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};
IChronoStatSvc* m_chronoSvc;
ServiceHandle<CscICoolStrSvc> m_cscCoolStrSvc;
ToolHandle<Muon::ICSC_RDO_Decoder> m_cscRdoDecoderTool;
......
/*
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 "GaudiKernel/MsgStream.h"
......@@ -50,7 +50,6 @@ namespace MuonCalib {
m_cscCalibTool(NULL),
m_cscCoolStrSvc("MuonCalib::CscCoolStrSvc",name),
m_cscRdoDecoderTool ("Muon::CscRDO_Decoder"),
m_cscId(NULL),
m_chronoSvc(NULL),
m_outputFileName("output.cal"),
m_dumpAllHists(false),
......@@ -179,13 +178,9 @@ cerr << "detstore" << endl;
}
cerr << "idhelper" << endl;
sc = detStore->retrieve(m_cscId,"CSCIDHELPER");
if( sc.isFailure())
{
mLog << MSG::ERROR << " Cannot retrieve CscIdHelper " << endmsg;
return sc;
}
ATH_CHECK(m_idHelperSvc.retrieve());
cerr << "chorno" << endl;
sc = service("ChronoStatSvc",m_chronoSvc);
if(sc.isFailure())
......@@ -240,19 +235,19 @@ cerr << "done init services" << endl;
for(unsigned int pulserLevel=0; pulserLevel < 64; pulserLevel++)
m_dbLevels[pulserLevel] = pulserLevel*.5;
IdContext channelContext = m_cscId->channel_context();
IdContext channelContext = m_idHelperSvc->cscIdHelper().channel_context();
if(m_doBitHists) m_bitHists = new DataVector<TH1I>(SG::VIEW_ELEMENTS);
//Loop through ids to find out what hash range we're working on, and to
//initialize histograms.
vector<Identifier> ids = m_cscId->idVector();
vector<Identifier> ids = m_idHelperSvc->cscIdHelper().idVector();
vector<Identifier>::const_iterator chamItr = ids.begin();
vector<Identifier>::const_iterator chamEnd = ids.end();
m_maxStripHash = 0;
for(; chamItr != chamEnd; chamItr++)
{
std::vector<Identifier> stripVect;
m_cscId->idChannels(*chamItr,stripVect);
m_idHelperSvc->cscIdHelper().idChannels(*chamItr,stripVect);
/*
vector<vector<float> > chamberDbs;
......@@ -272,7 +267,7 @@ cerr << "done init services" << endl;
for(;stripItr != stripEnd; stripItr++)
{
IdentifierHash stripHash;
m_cscId->get_channel_hash(*stripItr,stripHash);
m_idHelperSvc->cscIdHelper().get_channel_hash(*stripItr,stripHash);
if(m_maxStripHash < (unsigned int)stripHash)
m_maxStripHash = (unsigned int)stripHash;
......@@ -280,15 +275,15 @@ cerr << "done init services" << endl;
if(m_bitHists)
{
Identifier id;
m_cscId->get_id((IdentifierHash)stripHash,id,&channelContext);
int wireLayer = m_cscId->wireLayer(id);
char orientation = (m_cscId->measuresPhi(id) ? 'Y':'X');
m_idHelperSvc->cscIdHelper().get_id((IdentifierHash)stripHash,id,&channelContext);
int wireLayer = m_idHelperSvc->cscIdHelper().wireLayer(id);
char orientation = (m_idHelperSvc->cscIdHelper().measuresPhi(id) ? 'Y':'X');
int stationName = m_cscId->stationName(id);
int stationPhi = m_cscId->stationPhi(id);
int stationEta = m_cscId->stationEta(id);
int stationName = m_idHelperSvc->cscIdHelper().stationName(id);
int stationPhi = m_idHelperSvc->cscIdHelper().stationPhi(id);
int stationEta = m_idHelperSvc->cscIdHelper().stationEta(id);
int stripNumber = m_cscId->strip(id);
int stripNumber = m_idHelperSvc->cscIdHelper().strip(id);
char bitName[200], titleSeed[500];
//Bit histogram (for looking for stuck-bits)
......@@ -314,9 +309,9 @@ cerr << "done init services" << endl;
m_calGraphs->push_back(NULL);
/*IdentifierHash stripHash =chanItr;
Identifier stripId;
IdContext channelContext = m_cscId->channel_context();
m_cscId->get_id(stripHash, stripId, &channelContext);
m_allowedStrips[chanItr] = (m_cscId->chamberLayer(stripId) == m_expectedChamberLayer);*/
IdContext channelContext = m_idHelperSvc->cscIdHelper().channel_context();
m_idHelperSvc->cscIdHelper().get_id(stripHash, stripId, &channelContext);
m_allowedStrips[chanItr] = (m_idHelperSvc->cscIdHelper().chamberLayer(stripId) == m_expectedChamberLayer);*/
}
......@@ -527,13 +522,13 @@ cerr << "done init services" << endl;
int numStrips = cluster->width();
int samplesPerStrip = (cluster->samples()).size()/numStrips;
IdContext channelContext = m_cscId->channel_context();
IdContext channelContext = m_idHelperSvc->cscIdHelper().channel_context();
/*
Identifier startId;
m_cscId->get_id(hashStart, startId, &channelContex);
m_idHelperSvc->cscIdHelper().get_id(hashStart, startId, &channelContex);
//check the chamber layer.
int chamberLayer = m_cscId->chamberLayer(startId) << endmsg;
int chamberLayer = m_idHelperSvc->cscIdHelper().chamberLayer(startId) << endmsg;
if(chamberLayer != m_expectedChamberLayer)
{
m_log << MSG::ERROR << "A chamber with a chamber layer of " << chamberLayer << " was found. "
......@@ -545,11 +540,11 @@ cerr << "done init services" << endl;
{
Identifier stripId =m_cscRdoDecoderTool->channelIdentifier(cluster, stripItr);
IdentifierHash cscChannelHashId;
m_cscId->get_channel_hash(stripId, cscChannelHashId);
m_idHelperSvc->cscIdHelper().get_channel_hash(stripId, cscChannelHashId);
int stripHash = cscChannelHashId;
mLog << MSG::VERBOSE << "The eta of this strip is: " << m_cscId->stationEta(stripId) << endmsg;
mLog << MSG::VERBOSE << "The eta of this strip is: " << m_idHelperSvc->cscIdHelper().stationEta(stripId) << endmsg;
int chamberLayer = m_cscId->chamberLayer(stripId);
int chamberLayer = m_idHelperSvc->cscIdHelper().chamberLayer(stripId);
if(chamberLayer != m_expectedChamberLayer)
{
mLog << MSG::FATAL << "Cluster includes strip in chamber layer "
......@@ -559,18 +554,18 @@ cerr << "done init services" << endl;
return StatusCode::FAILURE;
}
int currentWireLayer = m_cscId->wireLayer(stripId) - 1;
int currentWireLayer = m_idHelperSvc->cscIdHelper().wireLayer(stripId) - 1;
if( currentWireLayer < 0 || currentWireLayer > 3)
{
mLog << MSG::FATAL << "Problem in getting wire layer! - Current value is "
<< m_cscId->wireLayer(stripId) << " while only values between 1-4 are allowed." << endmsg;
<< m_idHelperSvc->cscIdHelper().wireLayer(stripId) << " while only values between 1-4 are allowed." << endmsg;
return StatusCode::FAILURE;
}
bool isThisLayerPulsed = (pulsedWireLayer >> currentWireLayer)&0x1;
if(isThisLayerPulsed)
{
/*Usefull for debug, but slows things down a surprising amount
if(!m_cscId->valid(stripId))
if(!m_idHelperSvc->cscIdHelper().valid(stripId))
{
mLog << MSG::ERROR << stripId.getString() << " is not a valid id!" << endmsg;
}*/
......@@ -661,7 +656,7 @@ cerr << "done init services" << endl;
mLog << MSG::WARNING << "stripHash " << stripHash << endmsg;
mLog << MSG::WARNING << "strip in chamber " << stripItr << endmsg;
mLog << MSG::WARNING
<< " and detailed id " << m_cscId->show_to_string(stripId,&channelContext)
<< " and detailed id " << m_idHelperSvc->cscIdHelper().show_to_string(stripId,&channelContext)
<< endmsg;
mLog << "Pulsed layer " << pulsedWireLayer <<endmsg;
mLog << ", Samples: " << samples[0] <<", " << samples[1] << ", "
......@@ -702,7 +697,7 @@ cerr << "done init services" << endl;
unsigned int numCalibPoints = m_ampProfs->size();
mLog << MSG::INFO << "There are " << numCalibPoints << " pulser levels to evaluate." << endmsg;
IdContext channelContext = m_cscId->channel_context();
IdContext channelContext = m_idHelperSvc->cscIdHelper().channel_context();
float chargeMax = 530.88; //in fC
......@@ -721,17 +716,17 @@ cerr << "done init services" << endl;
Identifier id;
m_cscId->get_id((IdentifierHash)stripHash,id,&channelContext);
int chamberLayer = m_cscId->chamberLayer(id);
char orientation = (m_cscId->measuresPhi(id) ? 'Y':'X');
m_idHelperSvc->cscIdHelper().get_id((IdentifierHash)stripHash,id,&channelContext);
int chamberLayer = m_idHelperSvc->cscIdHelper().chamberLayer(id);
char orientation = (m_idHelperSvc->cscIdHelper().measuresPhi(id) ? 'Y':'X');
int wireLayer = m_cscId->wireLayer(id);
int wireLayer = m_idHelperSvc->cscIdHelper().wireLayer(id);
int stationName = m_cscId->stationName(id);
int stationPhi = m_cscId->stationPhi(id);
int stationEta = m_cscId->stationEta(id);
int stripNumber = m_cscId->strip(id);
int stationName = m_idHelperSvc->cscIdHelper().stationName(id);
int stationPhi = m_idHelperSvc->cscIdHelper().stationPhi(id);
int stationEta = m_idHelperSvc->cscIdHelper().stationEta(id);
int stripNumber = m_idHelperSvc->cscIdHelper().strip(id);
//Decide if we're fitting to an edge strip or not, which
......@@ -746,7 +741,7 @@ cerr << "done init services" << endl;
IdentifierHash chamHash;
m_cscId->get_module_hash(id,chamHash);
m_idHelperSvc->cscIdHelper().get_module_hash(id,chamHash);
if(chamberLayer != m_expectedChamberLayer)
continue;
......@@ -1018,24 +1013,24 @@ cerr << "done init services" << endl;
//get id for next few outputs
Identifier id;
IdContext channelContext = m_cscId->channel_context();
m_cscId->get_id((*slopeItr)->hashId(),id, &channelContext);
IdContext channelContext = m_idHelperSvc->cscIdHelper().channel_context();
m_idHelperSvc->cscIdHelper().get_id((*slopeItr)->hashId(),id, &channelContext);
//output chamber #
IdentifierHash chamberHash;
Identifier chamberId = m_cscId->elementID(id);
if(!m_cscId->valid(chamberId))
Identifier chamberId = m_idHelperSvc->cscIdHelper().elementID(id);
if(!m_idHelperSvc->cscIdHelper().valid(chamberId))
{
mLog << MSG::FATAL << chamberId.getString() << " is not a valid id!" << endmsg;
mLog << MSG::FATAL << "identifier is: " << m_cscId->show_to_string(chamberId) << endmsg;
mLog << MSG::FATAL << "identifier is: " << m_idHelperSvc->cscIdHelper().show_to_string(chamberId) << endmsg;
return StatusCode::FAILURE;
}
m_cscId->get_module_hash(id,chamberHash);
m_idHelperSvc->cscIdHelper().get_module_hash(id,chamberHash);
out <<" " << chamberHash;
//output strip details
out << " " << m_cscId->show_to_string(id) << " ";
out << " " << m_idHelperSvc->cscIdHelper().show_to_string(id) << " ";
//output parameter values