Added new fields for new Transformer Object config
authorloizides <loizides@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 18 Apr 2002 18:33:00 +0000 (18:33 +0000)
committerloizides <loizides@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 18 Apr 2002 18:33:00 +0000 (18:33 +0000)
HLT/exa/Make_Init.C

index 6664d5c..73c8ae8 100644 (file)
@@ -1,4 +1,11 @@
-void Make_Init(char *file){
+/** $Id$ 
+
+Important macro to get certain Aliroot parameters. They are stored
+in a file "Init.cxx". Compare the contents of the class AliL3Transform
+with the result of this macro to check that there are no differences.
+*/
+
+void Make_Init(char *file, char *tofile="Init.cxx"){
 
   TFile * rootf = new TFile(file,"READ");
 
@@ -14,50 +21,57 @@ void Make_Init(char *file){
     return;
   }
 
-  int fNTimeBins = par->GetMaxTBin();
+  int fNTimeBins = par->GetMaxTBin()+1;
   int fNRowLow = par->GetNRowLow();
   int fNRowUp  = par->GetNRowUp();
-  int fNRow= fNRowLow+ fNRowUp;
+  int fNRow= fNRowLow + fNRowUp;
   int fNSectorLow = par->GetNInnerSector();
   int fNSectorUp = par->GetNOuterSector();
   int fNSector = fNSectorLow + fNSectorUp;
   int fNSlice = fNSectorLow;
 
-  FILE *f = fopen("Init.cxx","w");
+  FILE *f = fopen(tofile,"w");
   fprintf(f,"void AliL3Transform::Init(){\n");
+
   fprintf(f,"  //sector:\n");
-  fprintf(f,"  fNTimeBins = %d;\n",fNTimeBins);
-  fprintf(f,"  fNRowLow = %d;\n",fNRowLow);
-  fprintf(f,"  fNRowUp = %d;\n",fNRowUp);
-  fprintf(f,"  fNSectorLow = %d;\n",fNSectorLow);
-  fprintf(f,"  fNSectorUp = %d;\n",fNSectorUp);
-  fprintf(f,"  fNSector = %d;\n",fNSector);
-  fprintf(f,"  fPadPitchWidthLow = %f;\n",par->GetPadPitchWidth(0));
-  fprintf(f,"  fPadPitchWidthUp = %f;\n",par->GetPadPitchWidth(fNSectorLow));
-  fprintf(f,"  fZWidth = %.20f;\n",par->GetZWidth());
-  fprintf(f,"  fZSigma = %.20f;\n",par->GetZSigma());
+  fprintf(f,"  fNTimeBins = %d ;\n",fNTimeBins);
+  fprintf(f,"  fNRowLow = %d ;\n",fNRowLow);
+  fprintf(f,"  fNRowUp = %d ;\n",fNRowUp);
+  fprintf(f,"  fNSectorLow = %d ;\n",fNSectorLow);
+  fprintf(f,"  fNSectorUp = %d ;\n",fNSectorUp);
+  fprintf(f,"  fNSector = %d ;\n",fNSector);
+  fprintf(f,"  fPadPitchWidthLow = %f ;\n",par->GetPadPitchWidth(0));
+  fprintf(f,"  fPadPitchWidthUp = %f ;\n",par->GetPadPitchWidth(fNSectorLow));
+  fprintf(f,"  fZWidth = %.20f ;\n",par->GetZWidth());
+  fprintf(f,"  fZSigma = %.20f ;\n",par->GetZSigma());
+
   fprintf(f,"\n  //slices:\n");
-  fprintf(f,"  fNSlice = %d;\n",fNSectorLow);
-  fprintf(f,"  fNRow = %d;\n",fNRow);
-//  fprintf(f,"  fPi = 3.14159265358979323846;\n");
-  fprintf(f,"  fPi = %.15f;\n",TMath::Pi());
+  fprintf(f,"  fNSlice = %d ;\n",fNSectorLow);
+  fprintf(f,"  fNRow = %d ;\n",fNRow);
+
+  //rotation shift put in by hand -> Constantin 
+  fprintf(f,"  fNRotShift = 0.5 ;\n");
+
+  fprintf(f,"  fPi = %.15f ;\n",TMath::Pi());
   fprintf(f,"  for(Int_t i=0;i<36;i++){\n");
-  fprintf(f,"    fCos[i] = cos(fPi/9*i);\n");
-  fprintf(f,"    fSin[i] = sin(fPi/9*i);\n");
+  fprintf(f,"    fCos[i] = cos(2*fPi/9*(i+0.5));\n");
+  fprintf(f,"    fSin[i] = sin(2*fPi/9*(i+0.5));\n");
   fprintf(f,"  }\n\n");
+
   for(Int_t i=0;i<fNRow;i++){
     int sec,row;
     if( i < fNRowLow){sec =0;row =i;}
     else{sec = fNSectorLow;row =i-fNRowLow;}
-    fprintf(f,"  fX[%d] = %3.15f;\n",i,par->GetPadRowRadii(sec,row));
+    fprintf(f,"  fX[%d] = %3.15f ;\n",i,par->GetPadRowRadii(sec,row));
   }
   for(Int_t i=0;i<fNRow;i++){
     int sec,row;
     if( i < fNRowLow){sec =0;row =i;}
     else{sec = fNSectorLow;row =i-fNRowLow;}
-    fprintf(f,"  fNPads[%d] = %d;\n",i,par->GetNPads(sec,row));
+    fprintf(f,"  fNPads[%d] = %d ;\n",i,par->GetNPads(sec,row));
   }
 
   fprintf(f,"}\n");
   fclose(f);
 }
+