#include <TofDataSet.h>
Public Member Functions | |
RecordSet * | getBarrelData (unsigned int i) const |
RecordSet * | getBarrelData (unsigned int i) const |
RecordSet * | getEndcapData (unsigned int i) const |
RecordSet * | getEndcapData (unsigned int i) const |
void | setBarrelData (RecBTofCalHitCol &) |
void | setBarrelData (RecBTofCalHitCol &) |
void | setBarrelDataFiles (std::vector< std::string > &) |
void | setBarrelDataFiles (std::vector< std::string > &) |
void | setData (TTree *, bool) |
void | setData (TTree *, bool) |
void | setEndcapData (RecETofCalHitCol &) |
void | setEndcapData (RecETofCalHitCol &) |
void | setEndcapDataFiles (std::vector< std::string > &) |
void | setEndcapDataFiles (std::vector< std::string > &) |
TofDataSet () | |
TofDataSet () | |
~TofDataSet () | |
~TofDataSet () | |
Private Attributes | |
RecordSet * | barrelData [NBarrel] |
RecordSet * | barrelData [NBarrel] |
RecordSet * | endcapData [NEndcap] |
RecordSet * | endcapData [NEndcap] |
|
00149 { 00150 for( unsigned int i=0; i<NBarrel; i++ ) { 00151 barrelData[i] = new RecordSet; 00152 } 00153 for( unsigned int i=0; i<NEndcap; i++ ) { 00154 endcapData[i] = new RecordSet; 00155 } 00156 return; 00157 }
|
|
00160 { 00161 for( unsigned int i=0; i<NBarrel; i++ ) { 00162 barrelData[i]->clear(); 00163 delete barrelData[i]; 00164 } 00165 for( unsigned int i=0; i<NEndcap; i++ ) { 00166 endcapData[i]->clear(); 00167 delete endcapData[i]; 00168 } 00169 return; 00170 }
|
|
|
|
|
|
00098 { return barrelData[i]; }
|
|
00098 { return barrelData[i]; }
|
|
00099 { return endcapData[i]; }
|
|
00099 { return endcapData[i]; }
|
|
|
|
00219 { 00220 RecBTofCalHitCol::iterator iter = bhitcol.begin(); 00221 for( ; iter!=bhitcol.end(); iter++ ) { 00222 int tofid = (*iter)->mod(); 00223 if( tofid<0 || tofid>175 ) continue; 00224 00225 Record *r = new Record( (*iter) ); 00226 if( r->cutBarrel() ) { 00227 barrelData[tofid]->push_back(r); 00228 } 00229 else { 00230 delete r; 00231 } 00232 } 00233 return; 00234 }
|
|
|
|
00173 { 00174 TChain* data_barrel = new TChain("btrk"); 00175 if( !data_barrel ) { 00176 std::cerr << " tofcalgsec Error Msg: creating a tree[barrel] fails in TofDataSet()"<<std::endl; 00177 throw "Error Msg: creating a tree fails in TofDataSet() "; 00178 } 00179 std::cout<<"begin reading barrel data file ... "<<std::endl; 00180 try{ 00181 for( std::vector<std::string>::iterator it=barrelFiles.begin(); it!=barrelFiles.end(); it++ ) { 00182 std::cout << " Add file : " << (*it) << std::endl; 00183 data_barrel->Add( (*it).c_str() ); 00184 } 00185 } 00186 catch(...){ 00187 std::cerr << "tofcalgsec Error Msg : in TofDataSet::setDataFiles(std::vector<std::string>&) " << std::endl; 00188 return; 00189 } 00190 setData( data_barrel, true ); 00191 delete data_barrel; 00192 return; 00193 }
|
|
|
|
00099 { 00100 if( t && t->GetEntries()>0 ) { 00101 rootRecord item; 00102 t->SetBranchAddress( "run", &item.run ); 00103 t->SetBranchAddress( "event", &item.event ); 00104 t->SetBranchAddress( "tofid", &item.tofid ); 00105 t->SetBranchAddress( "qleft", &item.qleft ); 00106 t->SetBranchAddress( "qright", &item.qright ); 00107 t->SetBranchAddress( "tleft", &item.tleft ); 00108 t->SetBranchAddress( "tright", &item.tright ); 00109 t->SetBranchAddress( "zrhit", &item.zrhit ); 00110 t->SetBranchAddress( "texp", &item.texp ); 00111 t->SetBranchAddress( "path", &item.path ); 00112 t->SetBranchAddress( "phi", &item.phi ); 00113 t->SetBranchAddress( "theta", &item.theta ); 00114 t->SetBranchAddress( "p", &item.p ); 00115 t->SetBranchAddress( "hitcase", &item.hitcase ); 00116 00117 for( unsigned int i=0; i<t->GetEntries(); i++ ) { 00118 t->GetEntry(i); 00119 if( isBarrel && item.hitcase>=0 && item.hitcase<=2 ) { 00120 Record *r = new Record( item ); 00121 if( r->cutBarrel() ) { 00122 unsigned int tofID = item.tofid; 00123 barrelData[tofID]->push_back(r); 00124 } 00125 else { 00126 delete r; 00127 } 00128 } 00129 else if( !isBarrel && ( item.hitcase==3 || item.hitcase==4 ) ) { 00130 Record *r = new Record( item ); 00131 if( r->cutEndcap() ) { 00132 unsigned int tofID = item.tofid; 00133 endcapData[tofID]->push_back(r); 00134 } 00135 else { 00136 delete r; 00137 } 00138 } 00139 } 00140 } 00141 else { 00142 std::cerr << "Error: a invalid tree or a blank tree, When converting a tree to TofDataSet,exit" << std::endl; 00143 } 00144 00145 return; 00146 }
|
|
|
|
00237 { 00238 RecETofCalHitCol::iterator iter = ehitcol.begin(); 00239 for( ; iter!=ehitcol.end(); iter++ ) { 00240 int tofid = (*iter)->mod(); 00241 if( tofid<0 || tofid>95 ) continue; 00242 00243 Record *r = new Record( (*iter) ); 00244 if( r->cutEndcap() ) { 00245 endcapData[tofid]->push_back(r); 00246 } 00247 else { 00248 delete r; 00249 } 00250 } 00251 return; 00252 }
|
|
|
|
00196 { 00197 TChain* data_endcap = new TChain("etrk"); 00198 if( !data_endcap ) { 00199 std::cerr << " tofcalgsec Error Msg: creating a tree[endcap] fails in TofDataSet()"<<std::endl; 00200 throw "Error Msg: creating a tree fails in TofDataSet() "; 00201 } 00202 std::cout<<"begin reading endcap data file ... "<<std::endl; 00203 try{ 00204 for( std::vector<std::string>::iterator it=endcapFiles.begin(); it!=endcapFiles.end(); it++ ) { 00205 std::cout << " Add file : " << (*it) << std::endl; 00206 data_endcap->Add( (*it).c_str() ); 00207 } 00208 } 00209 catch(...){ 00210 std::cerr << "tofcalgsec Error Msg : in TofDataSet::setDataFiles(std::vector<std::string>&) " << std::endl; 00211 return; 00212 } 00213 setData( data_endcap, false ); 00214 delete data_endcap; 00215 return; 00216 }
|
|
|
|
|
|
|
|
|