BOSS 7.1.2
BESIII Offline Software System
Loading...
Searching...
No Matches
Identifier.cxx
Go to the documentation of this file.
2#include <stdarg.h>
3#include <stdio.h>
4#include <algorithm>
5
6#include <iostream>
7#include <iomanip>
8
9//-----------------------------------------------
10void Identifier::set (const std::string& id)
11{
12 sscanf (id.c_str(), "0x%x", &m_id);
13}
14
15
16//-----------------------------------------------
17std::string Identifier::getString() const
18{
19 std::string result;
20 char temp[20];
21
22 sprintf (temp, "0x%x", (unsigned int)m_id);
23 result += temp;
24 result.insert(2,10-result.length(),'0');
25
26 return (result);
27}
28
29//-----------------------------------------------
30void Identifier::show () const
31{
32 const Identifier& me = *this;
33 std::cout << me.getString();
34}
35
36std::ostream& operator<<(std::ostream & os, const Identifier& Id)
37{
38 return (os<<Id.getString());
39}
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)
std::ostream & operator<<(std::ostream &os, const Identifier &Id)
const double me
Definition PipiJpsi.cxx:48
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