37 m_event = hit->
event();
39 m_qleft = hit->
adc1();
40 m_qright = hit->
adc2();
41 m_tleft = hit->
tdc1();
42 m_tright = hit->
tdc2();
43 m_zrhit = hit->
zHit();
44 m_texp = hit->
tpred();
49 m_hitcase = hit->
qual();
59 m_event = hit->
event();
63 m_zrhit = hit->
rHit();
64 m_texp = hit->
tpred();
69 m_hitcase = hit->
qual();
83 if(
one.hitcase >= 0 &&
one.hitcase <=2 ) {
84 m_qright =
one.qright;
85 m_tright =
one.tright;
93 m_hitcase =
one.hitcase;
100 if(
t &&
t->GetEntries()>0 ) {
102 t->SetBranchAddress(
"run", &item.
run );
103 t->SetBranchAddress(
"event", &item.
event );
104 t->SetBranchAddress(
"tofid", &item.
tofid );
105 t->SetBranchAddress(
"qleft", &item.
qleft );
106 t->SetBranchAddress(
"qright", &item.
qright );
107 t->SetBranchAddress(
"tleft", &item.
tleft );
108 t->SetBranchAddress(
"tright", &item.
tright );
109 t->SetBranchAddress(
"zrhit", &item.
zrhit );
110 t->SetBranchAddress(
"texp", &item.
texp );
111 t->SetBranchAddress(
"path", &item.
path );
112 t->SetBranchAddress(
"phi", &item.
phi );
113 t->SetBranchAddress(
"theta", &item.
theta );
114 t->SetBranchAddress(
"p", &item.
p );
115 t->SetBranchAddress(
"hitcase", &item.
hitcase );
117 for(
unsigned int i=0; i<
t->GetEntries(); i++ ) {
122 unsigned int tofID = item.
tofid;
123 barrelData[tofID]->push_back(r);
132 unsigned int tofID = item.
tofid;
133 endcapData[tofID]->push_back(r);
142 std::cerr <<
"Error: a invalid tree or a blank tree, When converting a tree to TofDataSet,exit" << std::endl;
150 for(
unsigned int i=0; i<
NBarrel; i++ ) {
153 for(
unsigned int i=0; i<
NEndcap; i++ ) {
161 for(
unsigned int i=0; i<
NBarrel; i++ ) {
162 barrelData[i]->clear();
163 delete barrelData[i];
165 for(
unsigned int i=0; i<
NEndcap; i++ ) {
166 endcapData[i]->clear();
167 delete endcapData[i];
174 TChain* data_barrel =
new TChain(
"btrk");
176 std::cerr <<
" tofcalgsec Error Msg: creating a tree[barrel] fails in TofDataSet()"<<std::endl;
177 throw "Error Msg: creating a tree fails in TofDataSet() ";
179 std::cout<<
"begin reading barrel data file ... "<<std::endl;
181 for( std::vector<std::string>::iterator it=barrelFiles.begin(); it!=barrelFiles.end(); it++ ) {
182 std::cout <<
" Add file : " << (*it) << std::endl;
183 data_barrel->Add( (*it).c_str() );
187 std::cerr <<
"tofcalgsec Error Msg : in TofDataSet::setDataFiles(std::vector<std::string>&) " << std::endl;
197 TChain* data_endcap =
new TChain(
"etrk");
199 std::cerr <<
" tofcalgsec Error Msg: creating a tree[endcap] fails in TofDataSet()"<<std::endl;
200 throw "Error Msg: creating a tree fails in TofDataSet() ";
202 std::cout<<
"begin reading endcap data file ... "<<std::endl;
204 for( std::vector<std::string>::iterator it=endcapFiles.begin(); it!=endcapFiles.end(); it++ ) {
205 std::cout <<
" Add file : " << (*it) << std::endl;
206 data_endcap->Add( (*it).c_str() );
210 std::cerr <<
"tofcalgsec Error Msg : in TofDataSet::setDataFiles(std::vector<std::string>&) " << std::endl;
220 RecBTofCalHitCol::iterator
iter = bhitcol.begin();
221 for( ;
iter!=bhitcol.end();
iter++ ) {
222 int tofid = (*iter)->mod();
223 if( tofid<0 || tofid>175 )
continue;
227 barrelData[tofid]->push_back(r);
238 RecETofCalHitCol::iterator
iter = ehitcol.begin();
239 for( ;
iter!=ehitcol.end();
iter++ ) {
240 int tofid = (*iter)->mod();
241 if( tofid<0 || tofid>95 )
continue;
245 endcapData[tofid]->push_back(r);
ObjectVector< RecBTofCalHit > RecBTofCalHitCol
ObjectVector< RecETofCalHit > RecETofCalHitCol
std::vector< Record * > RecordSet
const unsigned int NBarrel
const unsigned int NEndcap
void setEndcapDataFiles(std::vector< std::string > &)
void setBarrelData(RecBTofCalHitCol &)
void setData(TTree *, bool)
void setBarrelDataFiles(std::vector< std::string > &)
void setEndcapData(RecETofCalHitCol &)