19#include "CoralBase/Blob.h"
21#include "Identifier/Identifier.h"
34 return StatusCode::SUCCESS;
42 std::chrono::duration<double> retrieving{};
45 if (!
retrieve(ctx, retrieving).isSuccess())
return StatusCode::FAILURE;
48 ATH_MSG_INFO(
"Retrieving time = " << (std::chrono::duration_cast<std::chrono::microseconds>(retrieving).
count() * 1.0) <<
"s ");
51 return StatusCode::SUCCESS;
57 auto start1 = std::chrono::high_resolution_clock::now();
67 return StatusCode::FAILURE;
71 if (!readHandle.
range(range)) {
73 return StatusCode::FAILURE;
77 rangeW = EventIDRange::intersect(range, rangeW);
80 std::vector<Identifier> channelIds = readCdo->
getChannelIds();
81 ATH_MSG_INFO(
"Found data for " << channelIds.size() <<
" channels!");
82 ATH_MSG_INFO(
"Going to display passivation params for all channels (left, right, top, bottom)");
85 fout.open(
"passivationDump.txt");
86 fout <<
"athenaId,PCB,stationName,stationEta,stationPhi,multiLayer,gasGap,left,right,top,bottom\n";
89 for(
unsigned int i=0; i<channelIds.size(); ++i){
94 int pcb = (chnl-1)/1024+1;
95 if(std::abs(
eta)>1) pcb+=5;
97 fout << channel.get_compact()<<
","<<pcb<<
","<<
m_idHelperSvc->toString(channel)<<
","<<passiv.
left<<
","<<passiv.
right<<
","<<passiv.
top<<
","<<passiv.
bottom<<std::endl;
102 auto end1 = std::chrono::high_resolution_clock::now();
103 timer += end1 - start1;
105 return StatusCode::SUCCESS;
109 auto now = std::chrono::system_clock::now();
110 std::time_t time_now = std::chrono::system_clock::to_time_t(now);
112 localtime_r(&time_now, &local_tm);
113 auto duration_since_epoch = now.time_since_epoch();
114 auto milliseconds = std::chrono::duration_cast<std::chrono::milliseconds>(duration_since_epoch) % 1000;
115 std::ostringstream oss;
116 oss << std::put_time(&local_tm,
"%H:%M:%S") <<
'.' << std::setw(3) << std::setfill(
'0') << milliseconds.count();
Scalar eta() const
pseudorapidity method
#define ATH_CHECK
Evaluate an expression and check for errors.
An algorithm that can be simultaneously executed in multiple threads.
static EventIDRange infiniteMixed()
Produces an mixed EventIDRange that is infinite in Time and RunLumi.
std::vector< Identifier > getChannelIds() const
const PCBPassivation & getPassivation(const Identifier &id) const
virtual StatusCode execute(const EventContext &) const override
virtual ~NswPassivationTestAlg() override
NswPassivationTestAlg(const std::string &name, ISvcLocator *pSvcLocator)
StatusCode retrieve(const EventContext &, std::chrono::duration< double > &) const
SG::ReadCondHandleKey< NswPassivationDbData > m_readKey
std::string timestamp() const
virtual StatusCode initialize() override
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
bool range(EventIDRange &r)
const std::string & key() const
int count(std::string s, const std::string ®x)
count how many occurances of a regx are in a string
Helper struct to save the four passivation values of each PCB.