3 Important macro to get certain Aliroot parameters. They are stored
4 in a file "Init.cxx". Compare the contents of the class AliL3Transform
5 with the result of this macro to check that there are no differences.
8 void Make_Init(char *file, char *tofile="Init.cxx"){
10 TFile * rootf = new TFile(file,"READ");
13 cerr<<"no file: "<<file<<endl;
17 AliTPCParam* par = (AliTPCParam*)rootf->Get("75x40_100x60");
20 cerr<<"no AliTPCParam 75x40_100x60 in file: "<<file<<endl;
24 AliTPCParamSR *param=(AliTPCParamSR*)par;
25 AliTPCPRF2D * prfinner = new AliTPCPRF2D;
26 AliTPCPRF2D * prfouter = new AliTPCPRF2D;
27 AliTPCRF1D * rf = new AliTPCRF1D(kTRUE);
28 rf->SetGauss(param->GetZSigma(),param->GetZWidth(),1.);
29 rf->SetOffset(3*param->GetZSigma());
32 TDirectory *savedir=gDirectory;
33 TFile *if=TFile::Open("$ALICE_ROOT/TPC/AliTPCprf2d.root");
35 cerr<<"Can't open $ALICE_ROOT/TPC/AliTPCprf2d.root !\n" ;
38 prfinner->Read("prf_07504_Gati_056068_d02");
39 prfouter->Read("prf_10006_Gati_047051_d03");
43 param->SetInnerPRF(prfinner);
44 param->SetOuterPRF(prfouter);
47 int fNTimeBins = par->GetMaxTBin()+1;
48 int fNRowLow = par->GetNRowLow();
49 int fNRowUp = par->GetNRowUp();
50 int fNRow= fNRowLow + fNRowUp;
51 int fNSectorLow = par->GetNInnerSector();
52 int fNSectorUp = par->GetNOuterSector();
53 int fNSector = fNSectorLow + fNSectorUp;
54 int fNSlice = fNSectorLow;
56 FILE *f = fopen(tofile,"w");
57 fprintf(f,"void AliL3Transform::Init(){\n");
59 fprintf(f," //sector:\n");
60 fprintf(f," fNTimeBins = %d ;\n",fNTimeBins);
61 fprintf(f," fNRowLow = %d ;\n",fNRowLow);
62 fprintf(f," fNRowUp = %d ;\n",fNRowUp);
63 fprintf(f," fNSectorLow = %d ;\n",fNSectorLow);
64 fprintf(f," fNSectorUp = %d ;\n",fNSectorUp);
65 fprintf(f," fNSector = %d ;\n",fNSector);
66 fprintf(f," fPadPitchWidthLow = %f ;\n",par->GetPadPitchWidth(0));
67 fprintf(f," fPadPitchWidthUp = %f ;\n",par->GetPadPitchWidth(fNSectorLow));
68 fprintf(f," fZWidth = %.20f ;\n",par->GetZWidth());
69 fprintf(f," fZSigma = %.20f ;\n",par->GetZSigma());
70 fprintf(f," fZOffset = %.20f\n",par->GetZOffset());
71 fprintf(f," fDiffT = %.20f ;\n",par->GetDiffT());
72 fprintf(f," fDiffL = %.20f ;\n",par->GetDiffL());
73 fprintf(f," fInnerPadLength = %f\n",par->GetInnerPadLength());
74 fprintf(f," fOuterPadLength = %f\n",par->GetOuterPadLength());
75 fprintf(f," fInnerPRFSigma = %.20f\n",param->GetInnerPRF()->GetSigmaX());
76 fprintf(f," fOuterPRFSigma = %.20f\n",param->GetOuterPRF()->GetSigmaX());
77 fprintf(f," fTimeSigma = %.20f\n",param->GetTimeRF()->GetSigma());
78 fprintf(f," fZLength = %f\n",par->GetZLength());
80 fprintf(f,"\n //slices:\n");
81 fprintf(f," fNSlice = %d ;\n",fNSectorLow);
82 fprintf(f," fNRow = %d ;\n",fNRow);
84 //rotation shift put in by hand -> Constantin
85 fprintf(f," fNRotShift = 0.5 ;\n");
87 fprintf(f," fPi = %.15f ;\n",TMath::Pi());
88 fprintf(f," for(Int_t i=0;i<36;i++){\n");
89 fprintf(f," fCos[i] = cos(2*fPi/9*(i+0.5));\n");
90 fprintf(f," fSin[i] = sin(2*fPi/9*(i+0.5));\n");
93 for(Int_t i=0;i<fNRow;i++){
95 if( i < fNRowLow){sec =0;row =i;}
96 else{sec = fNSectorLow;row =i-fNRowLow;}
97 fprintf(f," fX[%d] = %3.15f ;\n",i,par->GetPadRowRadii(sec,row));
99 for(Int_t i=0;i<fNRow;i++){
101 if( i < fNRowLow){sec =0;row =i;}
102 else{sec = fNSectorLow;row =i-fNRowLow;}
103 fprintf(f," fNPads[%d] = %d ;\n",i,par->GetNPads(sec,row));
110 void Make_Default(char *file,char *tofile)
113 Macro to write out default values, which should be used to initialize
114 the static data members of the AliL3Transform class. Macro does more
115 or less the same as the above, only the output syntax is changed in order
116 to use it for static data member initialization.
119 TFile * rootf = new TFile(file,"READ");
121 if(!rootf->IsOpen()){
122 cerr<<"no file: "<<file<<endl;
126 AliTPCParam* par = (AliTPCParam*)rootf->Get("75x40_100x60");
129 cerr<<"no AliTPCParam 75x40_100x60 in file: "<<file<<endl;
133 int fNTimeBins = par->GetMaxTBin()+1;
134 int fNRowLow = par->GetNRowLow();
135 int fNRowUp = par->GetNRowUp();
136 int fNRow= fNRowLow + fNRowUp;
137 int fNSectorLow = par->GetNInnerSector();
138 int fNSectorUp = par->GetNOuterSector();
139 int fNSector = fNSectorLow + fNSectorUp;
140 int fNSlice = fNSectorLow;
142 FILE *f = fopen(tofile,"w");
143 fprintf(f,"Int_t AliL3Transform::fNTimeBins = %d ;\n",fNTimeBins);
144 fprintf(f,"Int_t AliL3Transform::fNRowLow = %d ;\n",fNRowLow);
145 fprintf(f,"Int_t AliL3Transform::fNRowUp = %d ;\n",fNRowUp);
146 fprintf(f,"Int_t AliL3Transform::fNSectorLow = %d ;\n",fNSectorLow);
147 fprintf(f,"Int_t AliL3Transform::fNSectorUp = %d ;\n",fNSectorUp);
148 fprintf(f,"Int_t AliL3Transform::fNSector = %d ;\n",fNSector);
149 fprintf(f,"Double_t AliL3Transform::fPadPitchWidthLow = %f ;\n",par->GetPadPitchWidth(0));
150 fprintf(f,"Double_t AliL3Transform::fPadPitchWidthUp = %f ;\n",par->GetPadPitchWidth(fNSectorLow));
151 fprintf(f,"Double_t AliL3Transform::fZWidth = %.20f ;\n",par->GetZWidth());
152 fprintf(f,"Double_t AliL3Transform::fZSigma = %.20f ;\n",par->GetZSigma());
153 fprintf(f,"Int_t AliL3Transform::fNSlice = %d ;\n",fNSectorLow);
154 fprintf(f,"Int_t AliL3Transform::fNRow = %d ;\n",fNRow);
155 fprintf(f,"Double_t AliL3Transform::fNRotShift = 0.5 ;\n");
156 fprintf(f,"Double_t AliL3Transform::fPi = %.15f ;\n",TMath::Pi());
157 fprintf(f,"Double_t AliL3Transform::fX[176] = {\n");
158 for(Int_t i=0;i<fNRow;i++){
160 if( i < fNRowLow){sec =0;row =i;}
161 else{sec = fNSectorLow;row =i-fNRowLow;}
163 fprintf(f," %3.15f,\n",par->GetPadRowRadii(sec,row));
167 fprintf(f,"Int_t AliL3Transform::fNPads[176] = {\n");
168 for(Int_t i=0;i<fNRow;i++){
170 if( i < fNRowLow){sec =0;row =i;}
171 else{sec = fNSectorLow;row =i-fNRowLow;}
172 fprintf(f," %d,\n",par->GetNPads(sec,row));