/[PAMELA software]/DarthVader/TrackerLevel2/src/TrkCore.cpp
ViewVC logotype

Annotation of /DarthVader/TrackerLevel2/src/TrkCore.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.7 - (hide annotations) (download)
Wed Sep 6 10:34:19 2006 UTC (18 years, 5 months ago) by pam-fi
Branch: MAIN
Changes since 1.6: +122 -112 lines
adapted to the new YodaProfiler

1 mocchiut 1.1 /**
2     * \file TrkCore.cpp
3     * \author Elena Vannuccini
4     */
5     // .........................................................
6     // ROOT header files
7     // .........................................................
8     #include <TTree.h>
9     #include <TClassEdit.h>
10     #include <TObject.h>
11     #include <TList.h>
12     #include <TSystem.h>
13     #include <TSystemDirectory.h>
14     #include <TString.h>
15     #include <TFile.h>
16     #include <TClass.h>
17     #include <TCanvas.h>
18     #include <TH1.h>
19     #include <TH1F.h>
20     #include <TH2D.h>
21     #include <TLatex.h>
22     #include <TPad.h>
23     #include <TSQLServer.h>
24     #include <TSQLRow.h>
25     #include <TSQLResult.h>
26     // .........................................................
27     // other general header files
28     // .........................................................
29     #include <fstream>
30     #include <iostream>
31     // .........................................................
32     // files in the inc directory
33     // .........................................................
34     #include <RunInfo.h>
35     #include <GLTables.h>
36     #include <TrkVerl2.h>
37     #include <TrkProcess.h>
38 pam-fi 1.2 //#include <TrkStruct.h>
39 mocchiut 1.1 #include <TrkLevel2.h>
40 pam-fi 1.6 #include <TrkLevel1.h>
41 mocchiut 1.1 #include <TrkLevel0.h>
42     // .........................................................
43     // YODA header files
44     // .........................................................
45     #include <PamelaRun.h>
46 pam-fi 1.7 //#include <RegistryEvent.h>
47 mocchiut 1.1 #include <physics/tracker/TrackerEvent.h>
48     #include <CalibTrk1Event.h>
49     #include <CalibTrk2Event.h>
50 pam-fi 1.2
51 mocchiut 1.1 // .........................................................
52     // namespaces
53     // .........................................................
54     using namespace std;
55     using namespace pamela;
56     // ================================================================================
57     //
58     //
59     // ================================================================================
60     /**
61     * \brief Tracker data reduction routine.
62     *
63     * It performs data reduction LEVEL0->LEVEL1->LEVEL2, producing LEVEL1 and or LEVEL2 output, in ROOT or HBOOK format.
64     * Input parameters:
65     * @param run id of the run to be processed (if run=0 a whole file is reprocessed)
66     * @param dbc pointer to BD server
67     * @param file1 output LEVEL1 file name (null if no LEVEL1 output is required)
68     * @param file2 output LEVEL2 file name (null if no LEVEL2 output is required)
69     * @param standalone (flag to run the program in standalone mode, that is without reading RunInfo)
70     */
71     //short int TrkCore(Int_t run, TSQLServer *dbc, TString file1, TString file2, Bool_t standalone)
72 pam-fi 1.7 int TrkCore(UInt_t run, TFile *f2, TSQLServer *dbc, int ncustom, char*vcustom[])
73 mocchiut 1.1 {
74     // ---------------------------
75     // Define some basic variables
76     // ---------------------------
77    
78     TString filename = 0;
79     TString trkcalibfile = 0;
80     Int_t last_trk_calib_used = 0;
81 pam-fi 1.7 Long64_t nentries = 0LL;
82 pam-fi 1.2
83 mocchiut 1.1 // LEVEL0 input
84     TFile *f0 = 0;
85 pam-fi 1.2 TFile *f0_c = 0;
86 mocchiut 1.1 TTree *physicsTree = 0;
87 pam-fi 1.7 // TBranch *b_registry = 0;
88 mocchiut 1.1 TBranch *b_trk = 0;
89     TBranch *b_header = 0;
90 pam-fi 1.7 // RegistryEvent *reg = 0;
91 mocchiut 1.1 EventHeader *header = 0;
92     PscuHeader *pscu = 0;
93     TrkLevel0 *l0_event = 0;
94     // RunInfo
95     ItoRunInfo *runinfo = 0;
96 pam-fi 1.7 TArrayI *runlist = 0;
97     UInt_t from_run;
98     UInt_t to_run;
99 mocchiut 1.1 Bool_t reprocessing = false;
100     //LEVEL1 output - ROOT
101 pam-fi 1.7 // TFile *f1;
102     // TTree *t_level1 = 0;
103 pam-fi 1.6 TrkLevel1 *l1_event = new TrkLevel1();
104     // TrkLevel2Ref *l2_ref = new TrkLevel2Ref();
105 mocchiut 1.1 //LEVEL2 output - ROOT
106     TTree *t_level2 = 0;
107     TTree *t_clone = 0;
108     TrkLevel2 *l2_event = new TrkLevel2();
109     TrkLevel2 *l2_clone = new TrkLevel2();
110     // -----------------------
111     // -----------------------
112     // Handle input parameters
113     // (data)
114     //
115     // - open/create output files, determining the environment root/hbook from the estension
116     // - create the level1/level2 tree+branch/nt-uple
117     // -----------------------
118     // -----------------------
119     TrkProcess *p = new TrkProcess(run,f2);
120     p->HandleCustomPar(ncustom,vcustom);
121 pam-fi 1.2 if( p->DebugMode() )p->Dump();
122 mocchiut 1.1
123     // ===================================
124     // Open/Create level1 output file
125     // (NB output files other than LEVEL2 are
126     // created in a separate folder)
127     // ===================================
128 pam-fi 1.7 /* if(p->get1){
129 pam-fi 1.6 if(p->ifroot1){
130     cout << endl << "Requested LEVEL1 output" << endl;
131 pam-fi 1.7 // Create NEW Tracker tree
132 pam-fi 1.6 t_level1 = new TTree("Clusters","PAMELA tracker level1 data ");
133     t_level1->Branch("TrkLevel1","TrkLevel1",&l1_event);
134     t_level1->SetDirectory(0);
135     }else{
136     throw -299;
137     };
138 pam-fi 1.7 };*/
139 mocchiut 1.1 // ===================================
140     // Open/Create level2 output file
141     // ===================================
142     if(p->get2){
143     // if(p->ifroot2){ // root
144 pam-fi 1.6 //-------------------------------------------
145     // read RunInfo
146     //-------------------------------------------
147     if(!(p->standalone)){
148     // Open "RunInfo" tree and get list of run
149     runinfo = new ItoRunInfo(f2);
150     char *trkversion = TrkInfo(false);
151     int runinfo_error = runinfo->Update(run,"TRK",trkversion);
152     if( runinfo_error ) throw runinfo_error;
153     runlist = runinfo->GetRunList();
154 pam-fi 1.7 reprocessing = runinfo->IsReprocessing();//????
155 pam-fi 1.6 if(p->VerboseMode()){
156     cout << "#events "<< runinfo->GetFileEntries() << endl;// #events in the file
157     cout << "#runs "<< runinfo->GetRunEntries() << endl;// #runs in the file
158     cout << "1-st run "<< runlist->At(0) << endl;
159     cout << "last run "<< runlist->At(runinfo->GetRunEntries()-1) << endl;
160     cout << "1-st event "<< runinfo->GetFirstEntry() << endl;// first event of our run
161     cout << "last event+1 "<< runinfo->GetLastEntry() << endl;// first event AFTER the last event of our run
162     cout << "reprocessing "<< runinfo->IsReprocessing() << endl << endl;
163     };
164     };
165     //-------------------------------------------
166     //
167     //-------------------------------------------
168     // Take (if present) the old Tracker tree
169     t_clone = (TTree*)f2->Get("Tracker");
170     if( t_clone != NULL ) t_clone->SetBranchAddress("TrkLevel2",&l2_clone);
171     // Create NEW Tracker tree
172     t_level2 = new TTree("Tracker","PAMELA tracker level2 data ");
173     t_level2->Branch("TrkLevel2","TrkLevel2",&l2_event);
174     /* if(p->get1){
175 pam-fi 1.7 if(p->VerboseMode())cout << endl << "Requested LEVEL1 output" << endl;
176 pam-fi 1.6 t_level2->Branch("TrkLevel1","TrkLevel1",&l1_event);
177     t_level2->BranchRef();
178 pam-fi 1.7 }else{
179     throw -299;
180 pam-fi 1.6 };*/
181 pam-fi 1.7 };
182 mocchiut 1.1 // }else{ // hbook
183     // throw -299;
184     // }
185    
186    
187     // -------------------------------------------
188     // define runs to be processed/reprocessed
189     // -------------------------------------------
190     if(run == 0){
191 pam-fi 1.7 // reprocessing ALL runs
192     if(p->standalone)throw -298; // reprocessing not implemented
193     from_run = runlist->At(0);
194     to_run = runlist->At(runinfo->GetRunEntries()-1);
195 mocchiut 1.1 }else{
196     // processing/reprocessing ONE single run
197 pam-fi 1.7 from_run = run;
198     to_run = run;
199 mocchiut 1.1 };
200    
201     //
202     // init "expiration date" of calibrations and parameters
203     //
204 pam-fi 1.7 UInt_t pedsig_time =0;
205     UInt_t B_time =0;
206     UInt_t mip_time =0;
207     UInt_t charge_time =0;
208     UInt_t eta_time =0;
209     UInt_t align_time =0;
210     UInt_t mask_time =0;
211 mocchiut 1.1 //
212     // init event counter
213     //
214     Int_t ev_count =0;
215     //
216     // create query-results objects
217     //
218 pam-fi 1.7 GL_RUN q1 = GL_RUN();
219 mocchiut 1.1 GL_TRK_CALIB q2 = GL_TRK_CALIB();
220     GL_ROOT q3 = GL_ROOT();
221     GL_PARAM q4 = GL_PARAM();
222    
223     // ------------------------------------------------------------
224     // if reprocessing one run, copy all the events BEFORE the run
225     // ------------------------------------------------------------
226     if( !(p->standalone) ){
227 pam-fi 1.6 for(UInt_t i=0; i<runinfo->GetFirstEntry(); i++){
228     t_clone->GetEntry(i);
229     *l2_event = *l2_clone;
230     t_level2->Fill();
231     l2_event->Clear();
232     // COPY COPY COPY
233     };
234 mocchiut 1.1 };
235     // ------------------------------------------------------------
236     // ------------------------------------------------------------
237     // START LOOP OVER RUNS TO PROCESSED/REPROCESSED
238     // ------------------------------------------------------------
239     // ------------------------------------------------------------
240 pam-fi 1.7 for(UInt_t idRun = from_run; idRun <= to_run; idRun++){
241 mocchiut 1.1
242 pam-fi 1.2 if(p->VerboseMode()) cout << endl<<" ========================= Run: "<< idRun << endl;
243 pam-fi 1.7 UInt_t runheadtime = 0;
244     UInt_t runtrailtime = 0;
245 mocchiut 1.1 UInt_t evfrom = 0;
246     UInt_t evto = 0;
247 pam-fi 1.7 UInt_t nevents = 0;
248     Int_t id_root_l0 =-1;
249 mocchiut 1.1 Int_t trk_calib_used = 0;
250 pam-fi 1.7
251 mocchiut 1.1 if(p->standalone){
252     // ==============================
253     // first query: retrieve run info
254     // ==============================
255 pam-fi 1.7 if (q1.Query_GL_RUN(idRun,dbc) )throw -50;
256     id_root_l0 = q1.ID_ROOT_L0;
257 mocchiut 1.1 runheadtime = q1.RUNHEADER_TIME;
258     runtrailtime = q1.RUNTRAILER_TIME;
259 pam-fi 1.7 evfrom = q1.EV_FROM;
260     evto = q1.EV_TO;
261     nevents = q1.NEVENTS;
262     trk_calib_used = q1.TRK_CALIB_USED;
263 mocchiut 1.1 }else{
264     // ==============================
265     // get run info from RunInfo tree
266     // ==============================
267 pam-fi 1.3 int runinfo_error = runinfo->GetRunInfo(idRun);
268 pam-fi 1.7 if( runinfo_error ) throw runinfo_error;
269     id_root_l0 = runinfo->ID_ROOT_L0;
270 mocchiut 1.1 runheadtime = runinfo->RUNHEADER_TIME;
271     runtrailtime = runinfo->RUNTRAILER_TIME;
272 pam-fi 1.7 evfrom = runinfo->EV_FROM;
273     evto = runinfo->EV_TO;
274     nevents = runinfo->NEVENTS;
275     trk_calib_used = runinfo->TRK_CALIB_USED;
276 mocchiut 1.1 };
277     //
278 pam-fi 1.2 if(p->VerboseMode()){
279 pam-fi 1.7 cout << "ROOT file ID "<< id_root_l0 << endl;
280 mocchiut 1.1 cout << "RunHeader time "<< runheadtime << endl;
281     cout << "RunTrailer time "<< runtrailtime << endl;
282 pam-fi 1.7 cout << " from event "<< evfrom << endl;
283     cout << " to event "<< evto << endl;
284     cout << " num. events "<< nevents << endl;
285     cout << "trk-calibration used "<< trk_calib_used << endl;
286 mocchiut 1.1 };
287     // ========================================================
288     // second query: search the LEVEL0 file that contains idRun
289     // ========================================================
290     TString lastfilename = filename;
291 pam-fi 1.7 if( q3.Query_GL_ROOT(id_root_l0,dbc) )throw -51;
292 mocchiut 1.1 filename = q3.PATH + q3.NAME;
293     // ========================================================
294     // Open the input LEVEL0 data file
295     // ========================================================
296     if(filename.CompareTo(lastfilename)){
297     if(!lastfilename.IsNull())f0->Close();
298     //if( debug ) cout << "Opening LEVEL0 file: "<< filename << endl;
299 pam-fi 1.2 if(p->VerboseMode()) cout << "Opening LEVEL0 file: "<< filename << endl;
300     FileStat_t t;
301     if( gSystem->GetPathInfo(filename.Data(),t) )throw -6;
302 mocchiut 1.1 f0 = new TFile(filename);
303     if ( !f0 ) throw -6;
304     physicsTree = (TTree*)f0->Get("Physics"); if(!physicsTree) throw -7;
305     b_header = physicsTree ->GetBranch("Header"); if(!b_header ) throw -8;
306 pam-fi 1.7 // b_registry = physicsTree ->GetBranch("Registry"); if(!b_registry ) throw -9;
307 mocchiut 1.1 b_trk = physicsTree ->GetBranch("Tracker"); if(!b_trk ) throw -203;
308     physicsTree->SetBranchAddress("Tracker" ,&l0_event);
309 pam-fi 1.7 // physicsTree->SetBranchAddress("Registry",&reg);
310 mocchiut 1.1 physicsTree->SetBranchAddress("Header",&header);
311    
312 pam-fi 1.7 nentries = physicsTree->GetEntries();
313     if ( nentries < 1 ) throw -11;
314     if ( nentries < (evto+1)) throw -12;
315    
316 mocchiut 1.1 };
317    
318 pam-fi 1.7 GL_TIMESYNC *dbtime = new GL_TIMESYNC(id_root_l0,"ID",dbc);
319    
320 mocchiut 1.1 // =============================================================
321 pam-fi 1.2 // retrieve calibration file needed to reduce data
322 mocchiut 1.1 // =============================================================
323 pam-fi 1.2 // if run OBT is > last calibration "expiration date"
324     // - search for new calibration packet
325     // - load calibration parameters (full + truncated)
326 pam-fi 1.5 if(p->VerboseMode() )cout << "Full pedestals for cluster finding:";
327 pam-fi 1.2 if(runheadtime > pedsig_time){
328     if( q2.Query_GL_TRK_CALIB(runheadtime,dbc) )throw -53;
329     pedsig_time = q2.TO_TIME;
330 pam-fi 1.7 if(q2.EV_ROOT_CALIBTRK1 != q2.EV_ROOT_CALIBTRK2)
331     printf("WARNING!! ---> EV_ROOT_CALIBTRK1=%d it's different from EV_ROOT_CALIBTRK2=%d \n\n",q2.EV_ROOT_CALIBTRK1,q2.EV_ROOT_CALIBTRK2);
332     if( q3.Query_GL_ROOT(q2.ID_ROOT_L0,dbc) )throw -51;
333 pam-fi 1.5 trkcalibfile = q3.PATH + q3.NAME;
334     if(p->VerboseMode()) cout << " >> Loading from LEVEL0 file: "<< trkcalibfile << endl;
335 pam-fi 1.2 if(trkcalibfile.CompareTo(filename)){
336 pam-fi 1.5 FileStat_t t;
337     if( gSystem->GetPathInfo(trkcalibfile.Data(),t) )throw -6;
338     f0_c=new TFile(trkcalibfile);
339     if ( !f0_c ) throw -6;
340 pam-fi 1.2 }else{
341 pam-fi 1.5 f0_c = f0;
342 pam-fi 1.2 };
343     if(p->VerboseMode()) {
344 pam-fi 1.7 cout << " calibration entries "<< q2.EV_ROOT_CALIBTRK1 << " " << q2.EV_ROOT_CALIBTRK2;
345     cout << " (from time "<< q2.FROM_TIME <<" to time "<< q2.TO_TIME <<")"<<endl;
346 pam-fi 1.2 };
347 pam-fi 1.7 pedsigbad_.FillACalibFrom(f0_c,q2.EV_ROOT_CALIBTRK1,q2.EV_ROOT_CALIBTRK2);
348 pam-fi 1.5 }else{
349     if(p->VerboseMode() )cout<< " already loaded. "<< endl;
350 pam-fi 1.2 };
351     if( p->DebugMode() ) for(int i=0; i<12; i++) cout << " DSP "<< i << " "<< pedsigbad_.pedestal[64][12][i] << endl;
352     // =============================================================
353     // retrieve calibration file needed to uncompress data
354     // =============================================================
355     // if the run was compressed using default calib
356     // load truncated pedestals from default
357     // otherwise reload them from on-line calibration
358     if(p->VerboseMode() )cout << "Truncated pedestals for uncompression:";
359 mocchiut 1.1 if(trk_calib_used==104 && last_trk_calib_used!=104){
360    
361 pam-fi 1.5 if(p->VerboseMode() )cout << " >> Loading default calibration " << endl;
362 pam-fi 1.7 if (q4.Query_GL_PARAM(runheadtime,7,dbc) )throw -52;
363 pam-fi 1.2 pedsigbad_.FillTCalibFrom(q4.PATH+q4.NAME);
364    
365     }else if( (trk_calib_used==1 | trk_calib_used==2) && last_trk_calib_used==104 ){
366    
367     if(p->VerboseMode()) cout << ">> Re-loading on-line calibration " << endl;
368 pam-fi 1.7 pedsigbad_.FillTCalibFrom(f0_c,q2.EV_ROOT_CALIBTRK1,q2.EV_ROOT_CALIBTRK2);
369 pam-fi 1.2 }else{
370     if(p->VerboseMode()) cout << ">> Using on-line calibration " << endl;
371     };
372     if( p->DebugMode() ) for(int i=0; i<12; i++) cout << " DSP "<< i << " "<< pedsigbad_.pedestal_t[64][12][i] << endl;
373     last_trk_calib_used = trk_calib_used;
374    
375 mocchiut 1.1 // =============================================================
376     // retrieve information about parameters to process LEVEL2
377     // =============================================================
378     //
379     // magnetic field
380     //
381 pam-fi 1.2 if(p->VerboseMode()) cout << "Loading parameter files : "<< endl;
382    
383 mocchiut 1.1 if(runheadtime > B_time){
384 pam-fi 1.7 if( q4.Query_GL_PARAM(runheadtime,1,dbc) )throw -52;
385 mocchiut 1.1 B_time = q4.TO_TIME;
386     l2_event->LoadField(q4.PATH+q4.NAME);
387 pam-fi 1.2 // l2_event->LoadField(q4.PATH+q4.NAME);
388 mocchiut 1.1 if(path_.error) throw -215;
389     };
390     //
391     // mip conversion parameters
392     //
393     if(runheadtime > mip_time){
394 pam-fi 1.7 if( q4.Query_GL_PARAM(runheadtime,2,dbc) )throw -52;
395 mocchiut 1.1 mip_time = q4.TO_TIME;
396     path_.FillWith(q4.PATH+q4.NAME);
397     readmipparam_();
398     if(path_.error) throw -212;
399     };
400     //
401     // charge correlation parameters
402     //
403     if(runheadtime > charge_time){
404 pam-fi 1.7 if( q4.Query_GL_PARAM(runheadtime,3,dbc) )throw -52;
405 mocchiut 1.1 charge_time = q4.TO_TIME;
406     path_.FillWith(q4.PATH+q4.NAME);
407     readchargeparam_();
408     if(path_.error) throw -213;
409     };
410     //
411     // eta p.f.a. parameters
412     //
413     if(runheadtime > eta_time){
414 pam-fi 1.7 if( q4.Query_GL_PARAM(runheadtime,4,dbc) )throw -52;
415 mocchiut 1.1 eta_time = q4.TO_TIME;
416     path_.FillWith(q4.PATH+q4.NAME);
417     readetaparam_();
418     if(path_.error) throw -214;
419     };
420     //
421     // alignment parameters
422     //
423     if(runheadtime > align_time){
424 pam-fi 1.7 if( q4.Query_GL_PARAM(runheadtime,5,dbc) )throw -52;
425 mocchiut 1.1 align_time = q4.TO_TIME;
426     path_.FillWith(q4.PATH+q4.NAME);
427     readalignparam_();
428     if(path_.error) throw -211;
429     };
430     //
431     // viking mask
432     //
433     if(runheadtime > mask_time){
434 pam-fi 1.7 if( q4.Query_GL_PARAM(runheadtime,6,dbc) )throw -52;
435 mocchiut 1.1 mask_time = q4.TO_TIME;
436     path_.FillWith(q4.PATH+q4.NAME);
437     readvkmask_();
438     if(path_.error) throw -210;
439     };
440    
441     //
442     // ====================================================
443     // start looping on events cointained in the data file
444     // ====================================================
445 pam-fi 1.7 for (UInt_t re = evfrom; re < evfrom+nevents; re++){
446 mocchiut 1.1
447     ev_count++;
448    
449 pam-fi 1.7 if ( p->DebugMode() && re%100 == 0 && re > 0 ) cout << ".";
450 mocchiut 1.1
451 pam-fi 1.7 b_trk->GetEntry(re);
452     b_header->GetEntry(re);
453     pscu = header->GetPscuHeader();
454    
455     if ( dbtime->DBabsTime(pscu->GetOrbitalTime()) > runtrailtime || dbtime->DBabsTime(pscu->GetOrbitalTime()) < runheadtime) {
456    
457     if (p->VerboseMode()) printf(" TrkCore - WARNING: event outside the run time window, skipping it\n");
458    
459     }else{
460    
461     p->ProcessEvent(l0_event);
462    
463     // ----------------
464     // LEVEL1 output
465     // ----------------
466     if(p->get1){
467     if(p->ifroot1){ // root
468     l1_event->Clear();
469     l1_event->SetFromLevel1Struct(&level1event_);
470     // t_level1->Fill();
471     }else{ // hbook
472     throw -299;
473     };
474     };
475     // ----------------
476     // LEVEL2 output
477     // ----------------
478     if(p->get2){
479     l2_event->Clear();
480     if(p->get1) l2_event->SetFromLevel2Struct(&level2event_,l1_event);//set references to level1
481     else l2_event->SetFromLevel2Struct(&level2event_);
482     t_level2->Fill();
483 pam-fi 1.6 };
484 mocchiut 1.1 };
485     }; // end loop on events
486 pam-fi 1.2 if(p->VerboseMode())cout << " >>> processed "<< ev_count <<" events"<< endl;
487 pam-fi 1.7
488     delete dbtime;
489    
490     }; // end loop on runs
491    
492 mocchiut 1.1 // ------------------------------------------------------------
493     // if reprocessing one run, copy all the events AFTER the run
494     // ------------------------------------------------------------
495     if( !(p->standalone) ){
496     for(UInt_t i=runinfo->GetLastEntry()+1; i<runinfo->GetFileEntries(); i++){
497     t_clone->GetEntry(i);
498     *l2_event = *l2_clone;
499     t_level2->Fill();
500     l2_event->Clear();
501     // COPY COPY COPY
502     };
503     };
504     // ---------------
505     // close the files
506     // ---------------
507 pam-fi 1.6 if(p->get1){
508     if(p->ifroot1){ // root
509 pam-fi 1.7 // cout << "Creating file: "<<p->file1<< endl;
510     // f1 = new TFile(p->file1,"RECREATE");
511     // t_level1->Write();
512     // if( f1->IsOpen() ) f1->Close();
513     // if( t_level1 )t_level1->Delete(); //delete new tree from memory
514 pam-fi 1.6
515     }else{ // hbook
516     }
517     cout << "Done."<<endl;
518 mocchiut 1.1 };
519     if(p->get2){
520     // if(p->ifroot2){ // root
521 pam-fi 1.6 if( t_clone )t_clone->Delete("all");//delete old tree from file
522     if( !(p->standalone) )runinfo->Close();
523     // gDirectory->pwd();
524     // gDirectory->ls();
525     f2->Write("Tracker");
526     if( t_level2 )t_level2->Delete(); //delete new tree from memory
527 mocchiut 1.1
528     // }else{ // hbook
529     // }
530 pam-fi 1.6 };
531    
532     if( f0->IsOpen() ) f0->Close();
533 pam-fi 1.2 if( f0_c->IsOpen() )f0_c->Close();
534 pam-fi 1.6
535 pam-fi 1.2
536     return(p->ostatus);
537 mocchiut 1.1 }
538    

  ViewVC Help
Powered by ViewVC 1.1.23