BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
Identifier.cxx
Go to the documentation of this file.
1#include "Identifier/Identifier.h"
2#include <algorithm>
3#include <stdarg.h>
4#include <stdio.h>
5
6#include <iomanip>
7#include <iostream>
8
9//-----------------------------------------------
10void Identifier::set( const std::string& id ) { sscanf( id.c_str(), "0x%x", &m_id ); }
11
12//-----------------------------------------------
13std::string Identifier::getString() const {
14 std::string result;
15 char temp[20];
16
17 sprintf( temp, "0x%x", (unsigned int)m_id );
18 result += temp;
19 result.insert( 2, 10 - result.length(), '0' );
20
21 return ( result );
22}
23
24//-----------------------------------------------
25void Identifier::show() const {
26 const Identifier& me = *this;
27 std::cout << me.getString();
28}
29
30std::ostream& operator<<( std::ostream& os, const Identifier& Id ) {
31 return ( os << Id.getString() );
32}
sprintf(cut, "kal_costheta0_em>-0.93&&kal_costheta0_em<0.93&&kal_pxy0_em>=0.05+%d*0.1&&kal_" "pxy0_em<0.15+%d*0.1&&NGch>=2", j, j)
double me
std::ostream & operator<<(std::ostream &os, const Identifier &Id)
std::string getString() const
Provide a string form of the identifier - hexadecimal.
void show() const
Print out in hex form.
void set(const std::string &id)
build from a string form - hexadecimal