48 {
49
50 MsgStream log(
msgSvc(),
"TreeMucCalibDataCnv");
51 log<<MSG::DEBUG<<"SetProperty"<<endreq;
55
56 TBufferFile *buf1 = new TBufferFile(TBuffer::kRead);
57 TBufferFile *buf2 = new TBufferFile(TBuffer::kRead);
58 TBufferFile *buf3 = new TBufferFile(TBuffer::kRead);
59 buf1->SetBuffer((*records)["LayTree"],512000,kFALSE);
60 buf2->SetBuffer((*records)["BoxTree"],512000,kFALSE);
61 buf3->SetBuffer((*records)["StrTree"],512000,kFALSE);
62 std::cout<<" SftVer is "<<(*records)["SftVer"];
63 std::cout<<" CalVerSft is "<<(*records)["CalParVer"];
64 std::cout<<" File name is "<<(*records)["FileName"]<<std::endl;
65
66
67 TTree* laytree = new TTree();
68 laytree->Streamer(*buf1);
69 log<<MSG::DEBUG<< "laytree name:\t" << laytree->GetName() << endreq;
70 TTree* boxtree = new TTree();
71 boxtree->Streamer(*buf2);
72 log<<MSG::DEBUG<< "boxtree name:\t" << boxtree->GetName() << endreq;
73 TTree* strtree= new TTree();
74 strtree->Streamer(*buf3);
75 log<<MSG::DEBUG<< "strtree name:\t" << strtree->GetName() << endreq;
76
77
78
79 Double_t lay_eff,box_eff,str_eff;
80 Double_t lay_cnt, box_cnt, str_cnt;
81 Double_t lay_nos, box_nos, str_nos;
82 Double_t lay_nos_ratio, box_nos_ratio, str_nos_ratio;
83 lay_eff = box_eff = str_eff = 0.0;
84 lay_cnt = box_cnt = str_cnt = 0.0;
85 lay_nos = box_nos = str_nos = 0.0;
86 lay_nos_ratio = box_nos_ratio = str_nos_ratio = 0.0;
87
88 char name[60];
89 laytree->SetBranchAddress("layer_eff", &lay_eff);
90 laytree->SetBranchAddress("layer_cnt", &lay_cnt);
91 laytree->SetBranchAddress("layer_noise", &lay_nos);
92 laytree->SetBranchAddress("layer_nosratio",&lay_nos_ratio);
93
94 boxtree->SetBranchAddress("box_eff", &box_eff);
95 boxtree->SetBranchAddress("box_cnt", &box_cnt);
96 boxtree->SetBranchAddress("box_noise", &box_nos);
97 boxtree->SetBranchAddress("box_nosratio", &box_nos_ratio);
98
99 strtree->SetBranchAddress("strip_eff", &str_eff);
100 strtree->SetBranchAddress("strip_cnt", &str_cnt);
101 strtree->SetBranchAddress("strip_noise", &str_nos);
102 strtree->SetBranchAddress("strip_nosratio", &str_nos_ratio);
103
104 int part, segment, layer, strip;
105 part = segment = layer = strip = 0;
106 for(int i=0; i<LAYER_MAX; i++)
107 {
108 laytree->GetEntry(i);
114 for(int j=0; j<CLST_MAX; j++) {
115
116
118 }
119 log<<MSG::DEBUG<<"layer: " << i << "\t" << lay_eff <<endreq;
120 }
121
122 for(int i=0; i<BOX_MAX; i++)
123 {
124 m_ptrIdTr->
SetBoxPos( i, &part, &segment, &layer );
125 boxtree->GetEntry(i);
126 tmpObject->
setBoxEff(box_eff, part, segment, layer);
127 tmpObject->
setBoxCnt(box_cnt, part, segment, layer);
128 tmpObject->
setBoxNos(box_nos, part, segment, layer);
130
131 sprintf(name,
"BoxClstPro_B%d",i);
132 for(int j=0; j<CLST_MAX; j++) {
133
134
135 tmpObject->
setBoxClstPro(DEFAULT_CLST_PRO[j],part,segment,layer,j);
136 }
137 log<<MSG::DEBUG<<"box: " << i << "\t" << box_eff <<endreq;
138 }
139
140 log<<MSG::DEBUG<<"strtree entries:\t" << strtree->GetEntries() << endreq;
142 {
143 m_ptrIdTr->
SetStripPos( i, &part, &segment, &layer, &strip );
144 strtree->GetEntry(i);
145 tmpObject->
setStripEff(str_eff, part, segment, layer, strip);
146 tmpObject->
setStripCnt(str_cnt, part, segment, layer, strip);
147 tmpObject->
setStripNos(str_nos, part, segment, layer, strip);
149 log<<MSG::DEBUG<<"strip: " << i << "\t" << str_eff <<endreq;
150
151 }
152
153 refpObject=tmpObject;
154 delete laytree;
155 delete boxtree;
156 delete strtree;
157 return StatusCode::SUCCESS;
158
159
160}
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)
void setLayerClstPro(const double layerpro, int i, int j)
void setLayerNos(const double layernos, int i)
void setLayerCnt(const double layercnt, int i)
void setBoxCnt(const double boxcnt, int i, int j, int k)
void setStripNos(const double stripnos, int i, int j, int k, int l)
void setBoxNosRatio(const double boxratio, int i, int j, int k)
void setStripEff(const double stripeff, int i, int j, int k, int l)
void setStripNosRatio(const double stripnosratio, int i, int j, int k, int l)
void setStripCnt(const double stripcnt, int i, int j, int k, int l)
void setBoxEff(const double boxeff, int i, int j, int k)
void setBoxNos(const double boxnos, int i, int j, int k)
void setLayerEff(const double layereff, int i)
void setLayerNosRatio(const double layernosratio, int i)
void setBoxClstPro(const double boxpro, int i, int j, int k, int l)
virtual DatabaseRecord * pp()