1 #if !defined(__CINT__) || defined(__MAKECINT__)
7 #include "../STEER/AliRun.h"
8 #include "../STEER/AliRunDigitizer.h"
9 #include "ITS/AliITSDigitizer.h"
10 #include "ITS/AliITS.h"
11 #include "ITS/AliITSDetType.h"
12 #include "ITS/AliITSresponseSDD.h"
13 #include "TStopwatch.h"
16 TFile* AccessFile(TString inFile="galice.root", TString acctype="R");
17 void writeAR(TFile * fin, TFile *fou);
18 Int_t ChangeITSDefaults(TFile *hitfile,AliITS *ITS,TString opt="");
25 Int_t AliITSd2r(TString df="galice.root",TString rf="",TString opt=""){
26 // Produce ITS RecPoints from Digits.
28 // Dynamically link some shared libs
29 if (gClassTable->GetID("AliRun") < 0) {
30 gROOT->LoadMacro("loadlibs.C");
33 gROOT->LoadMacro("$(ALICE_ROOT)/ITS/AliITSstandard.C");
35 TFile *dfp = 0, *rfp = 0;
37 // gAlice not define. Must open a file and read it in.
38 if(rf.CompareTo(df) == 0 || rf.CompareTo("") == 0) {
39 // Input file = output file
40 dfp = AccessFile(df,"U"); // input file open for update.
41 }else{ // Input file different from output file.
42 dfp = AccessFile(df,"R"); // input file open as read only
43 // open output file and create TreeR on it
44 rfp = new TFile(rp,"NEW");
46 } // end if !GALICEITSOK()
47 AliITS *ITS = (AliITS*)gAlice->GetDetector("ITS");
49 ChangeITSDefaults(dfp,ITS,opt);
50 // write the AliRun object to the output file if different from input file.
53 rfp->Close(); // Manager will open in update mode.
59 cout << "Creating reconstructed points from digits for the ITS..." << endl;
62 AliITSreconstruction *itsr = new AliITSreconstruction(df.Data());
64 AliITSreconstruction *itsr = new AliITSreconstruction(0);
65 if(df.CompareTo(rf)!=0 && rf.CompareTo("")!=0) {
66 itsr->SetOutputFile(rf.Data());
76 cout <<"After Reconstruction "<<rf<<" size ="<< rfp->GetSize()<< endl;
78 cout <<"After Reconstruction "<<df<<" size ="<< dfp->GetSize()<< endl;