updated from TPC-dev1
authorkowal2 <kowal2@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 17 Apr 2000 11:29:58 +0000 (11:29 +0000)
committerkowal2 <kowal2@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 17 Apr 2000 11:29:58 +0000 (11:29 +0000)
TPC/AliTPCHits2Digits.C
TPC/SetTPCParam.C [new file with mode: 0644]

index 54c2d02..e4a424f 100644 (file)
@@ -1,91 +1,55 @@
-void AliTPCHits2Digits(const  char * name= "pokusD_")
+void TPCHits2Digits()
 {
   // Dynamically link some shared libs
-        if (gClassTable->GetID("AliRun") < 0) {
-        gROOT->LoadMacro("loadlibs.C");
-      loadlibs();
-     }
-  
-   //names of trees
-
-   const char * inFile = "galice.root";
-   //   const * char ident= "TreeD1par_";
-
-// Connect the Root Galice file containing Geometry, Kine and Hits
-   TFile *file = (TFile*)gROOT->GetListOfFiles()->FindObject(inFile);
-   if (file) file->Close();
-   file = new TFile(inFile,"UPDATE");
-// Get AliRun object from file or create it if not on file
-
-   if(gAlice){
-     delete gAlice;
-     gAlice=0;
-   }
-      if (!gAlice) {
-      gAlice = (AliRun*)file->Get("gAlice");
-      if (gAlice) printf("AliRun object found on file\n");
-      if (!gAlice) gAlice = new AliRun("gAlice","Alice test program");
-        }
-   gAlice->GetEvent(0);
-   AliTPC *TPC = (AliTPC*)gAlice->GetModule("TPC");      
-   TPC->Dump();
-   //adjust parameters
-  
-  AliTPCD *paramd = TPC->GetDigParam();
-  paramd->Dump();
-  paramd->SetName("Param1");  
-  paramd->MakeTree();
-  //set pointers to parameters
-  paramd->Dump();
-  AliTPCParam &param = paramd->GetParam();
-  AliTPCPRF2D &prf = paramd->GetPRF2D();
-  AliTPCRF1D  & rf  = paramd->GetRF();
-  
-  param.SetPadLength(2.05);
-  param.SetPadWidth(0.35);
-  param.SetPadPitchLength(2.05);
-  param.SetPadPitchWidth(0.35);
-  param.SetNWires(5);
-  param.SetZeroSup(5);
-  param.SetDiffT(0.022);
-  param.SetDiffL(0.022);
-  param.SetNoise(500);
-  param.SetGasGain(1.e4);
-  param.SetChipGain(24); 
-  param.SetSectorAngles(40.,0.,20.,10.);
-  param.SetInnerRadiusLow(83.7);
-  param.SetInnerRadiusUp(132.9);
-  param.SetOuterRadiusLow(146.9);
-  param.SetOuterRadiusUp(249.4);     
-  param.Update();
-
-    //Set z (time) response function
-
-  rf.SetOffset(3.*param.GetZSigma());
-  rf.SetGauss(param.GetZSigma(),param.GetZWidth(),0.4);
-  rf.Update();
-  //Set two dimensional pad response function
-  TFile f("TPC/AliTPCprf2d.root");
-  //  prf.Read("prf_205035_Gati_062074_d03");
-  prf.Read("prf_205035_Gati_062074_d03");
-  f.Close();
-  
-  printf("**********Digit object dump start********************\n");
-  paramd->Dump();
-  printf("**********AliTPCParam**************************\n");
-  param.Dump();
-  printf("**********Time response function***************\n");
-  rf.Dump();
-  printf("**********Pad response function params*********\n");
-  prf.Dump();
-  printf("**********Digit object dump end********************\n");
-
-   TPC->Hits2DigitsSector(0);     
-         
-   file->cd();
-   TPC->GetDigParam()->Write();
+  if (gClassTable->GetID("AliRun") < 0) {
+    gROOT->LoadMacro("loadlibs.C");
+    loadlibs();
+  }  
+  gROOT->LoadMacro("SetTPCParam.C");
+  AliTPCParam *par=SetTPCParam();
+
+
+  // Connect the Root Galice file containing Geometry, Kine and Hits
+  const char * inFile = "galice.root";  
+  TFile *file = (TFile*)gROOT->GetListOfFiles()->FindObject(inFile);
+  if (file) file->Close();
+  file = new TFile(inFile,"UPDATE");
+  // Get AliRun object from file or create it if not on file
+
+  gAlice = (AliRun*)file->Get("gAlice");
+  if (gAlice) printf("AliRun object found on file\n");
+  if (!gAlice) gAlice = new AliRun("gAlice","Alice test program");
+
+  gAlice->GetEvent(0);
+  AliTPC *TPC = (AliTPC*)gAlice->GetDetector("TPC");      
+    
+  cerr<<"Hits2Digits\n";
+  //setup TPCDigitsArray 
+  AliTPCDigitsArray *arr = new AliTPCDigitsArray; 
+  arr->SetClass("AliSimDigits");
+  arr->Setup(par);
+  TPC->SetParam(par);
+  arr->MakeTree();
+
+  TPC->SetDigitsArray(arr);
+  TPC->Hits2DigitsSector(1);             
+  TPC->Hits2DigitsSector(2);             
+  TPC->Hits2DigitsSector(3);             
+  TPC->Hits2DigitsSector(1+18);             
+  TPC->Hits2DigitsSector(2+18);             
+  TPC->Hits2DigitsSector(3+18);             
+
+  TPC->Hits2DigitsSector(36+1);             
+  TPC->Hits2DigitsSector(36+2);             
+  TPC->Hits2DigitsSector(36+3);             
+  TPC->Hits2DigitsSector(36+1+18);             
+  TPC->Hits2DigitsSector(36+2+18);             
+  TPC->Hits2DigitsSector(36+3+18);             
+  //write results
+  char treeName[100];
+  sprintf(treeName,"TreeD_%s",par->GetTitle());
+  TPC->GetDigitsArray()->GetTree()->Write(treeName);
+  par->Write(par->GetTitle());
+  file->Close();
 };
 
-
diff --git a/TPC/SetTPCParam.C b/TPC/SetTPCParam.C
new file mode 100644 (file)
index 0000000..296363c
--- /dev/null
@@ -0,0 +1,53 @@
+AliTPCParam * SetTPCParam()
+{
+  AliTPCParamSR  * param = new AliTPCParamSR;
+  AliTPCPRF2D    * prfinner   = new AliTPCPRF2D;
+  AliTPCPRF2D    * prfouter   = new AliTPCPRF2D;
+  AliTPCRF1D     * rf    = new AliTPCRF1D(kTRUE);
+  param->SetTitle("75x40_100x60");
+
+
+  param->SetSectorAngles(20.,0.,20.,0.);
+  param->SetInnerRadiusLow(87.35);
+  param->SetInnerRadiusUp(130.6);
+  param->SetOuterRadiusLow(131.2);
+  param->SetOuterRadiusUp(252.2);
+  param->SetInnerPadPitchLength(0.75);
+  param->SetInnerPadPitchWidth(0.40);
+  param->SetOuterPadPitchLength(1.00);
+  param->SetOuterPadPitchWidth(0.60);
+  param->SetInnerNWires(3);
+  param->SetOuterNWires(4);
+
+  param->SetZeroSup(2); //3 is included !
+  param->SetDriftV(2.83e6);
+  param->SetDiffT(0.022);
+  param->SetDiffL(0.022);
+  param->SetNoise(1000);
+  param->SetGasGain(2.e4);
+  param->SetTFWHM(1.9e-7);
+    param->SetTSample(2.0e-7);
+    param->SetMaxTBin(445);
+  param->SetChipGain(12);      
+  param->SetChipNorm(0.4);
+  param->SetNCrossRows(1);
+  param->SetFacSigmaPadRow(3.);
+  param->SetFacSigmaPad(3.);
+  param->SetFacSigmaTime(3.);
+  param->Update();
+  //Set z (time) response function
+  rf->SetGauss(param.GetZSigma(),param.GetZWidth(),1.);
+  rf->SetOffset(3*param.GetZSigma());
+  rf->Update();
+  //Set two dimensional pad response function
+  TFile f("AliTPCprf2d.root");
+  prfinner->Read("prf_07504_Gati_056068_d02");
+  prfouter->Read("prf_10006_Gati_047051_d03");
+  param->SetInnerPRF(prfinner); //param object is responsible for destroying objects
+  param->SetOuterPRF(prfouter); 
+  param->SetTimeRF(rf);
+  f.Close();
+  
+  //gTPCParam =param;
+  return param;
+};