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
//-----------------------------------------------
10
void
Identifier::set
(
const
std::string&
id
) { sscanf(
id
.c_str(),
"0x%x"
, &m_id ); }
11
12
//-----------------------------------------------
13
std::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
//-----------------------------------------------
25
void
Identifier::show
()
const
{
26
const
Identifier
&
me
= *
this
;
27
std::cout <<
me
.getString();
28
}
29
30
std::ostream&
operator<<
( std::ostream& os,
const
Identifier
& Id ) {
31
return
( os << Id.
getString
() );
32
}
sprintf
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)
me
double me
Definition
EvtPhokharaDef.hh:17
operator<<
std::ostream & operator<<(std::ostream &os, const Identifier &Id)
Definition
Identifier.cxx:30
Identifier
Definition
DetectorDescription/Identifier/include/Identifier/Identifier.h:20
Identifier::getString
std::string getString() const
Provide a string form of the identifier - hexadecimal.
Definition
Identifier.cxx:13
Identifier::show
void show() const
Print out in hex form.
Definition
Identifier.cxx:25
Identifier::Identifier
Identifier()
Default constructor.
Definition
DetectorDescription/Identifier/include/Identifier/Identifier.h:105
Identifier::set
void set(const std::string &id)
build from a string form - hexadecimal
Definition
Identifier.cxx:10
8.0.0
BOSS_Source
DetectorDescription
Identifier
src
Identifier.cxx
Generated by
1.16.1