Changed from hardcoded param to a version which gets the param string from AliL3Trans...
authorloizides <loizides@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 3 Sep 2002 14:20:03 +0000 (14:20 +0000)
committerloizides <loizides@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 3 Sep 2002 14:20:03 +0000 (14:20 +0000)
HLT/src/AliL3Display.cxx
HLT/src/AliL3Evaluate.cxx
HLT/src/AliL3FileHandler.cxx
HLT/src/AliL3Transform.cxx
HLT/src/AliL3Transform.h

index b071dd2..295021b 100644 (file)
 #include <TShape.h>
 #include <TParticle.h>
 #include <TFile.h>
+#ifdef use_aliroot
+#include <TClonesArray.h>
+#include <AliRun.h>
+#include <AliSimDigits.h>
+#include <AliTPCParam.h>
+#endif
 
 #include "AliL3Logging.h"
 #include "AliL3Display.h"
-#ifdef use_aliroot
-#include "AliRun.h"
-#include "AliSimDigits.h"
-#include "AliTPCParam.h"
-#endif
 #include "AliL3Transform.h"
 #include "AliL3Track.h"
 #include "AliL3TrackArray.h"
@@ -365,8 +366,11 @@ void AliL3Display::DisplayClusterRow(Int_t slice,Int_t padrow,Char_t *digitsFile
   
 #ifdef use_aliroot
   TFile *file = new TFile(digitsFile);
-  AliTPCParam *param = (AliTPCParam*)file->Get("75x40_100x60");
-  TTree *TD=(TTree*)file->Get("TreeD_75x40_100x60_0");
+  AliTPCParam *param = (AliTPCParam*)file->Get(AliL3Transform::GetParamName());
+
+  Char_t dname[100];
+  sprintf(dname,"TreeD_%s_0",AliL3Transform::GetParamName());
+  TTree *TD=(TTree*)file->Get(dname);
   AliSimDigits da, *digits=&da;
   TD->GetBranch("Segment")->SetAddress(&digits); //Return pointer to branch segment.
   
index 21f7a23..2707a6a 100644 (file)
@@ -66,7 +66,7 @@ AliL3Evaluate::AliL3Evaluate(Char_t *mcfile,Int_t *slice)
 
   fEventFile = new TFile(mcfile,"READ");
     
-  fParam = (AliTPCParam*)fEventFile->Get("75x40_100x60");
+  fParam = (AliTPCParam*)fEventFile->Get(AliL3Transform::GetParamName());
   
   fMinSlice = slice[0];
   fMaxSlice = slice[1];
@@ -191,8 +191,10 @@ Bool_t AliL3Evaluate::InitMC()
 {
   if(fIsSlow)
     {
+      Char_t dname[100];
+      sprintf(dname,"TreeD_%s_0",AliL3Transform::GetParamName());
       fDigitsFile->cd();
-      fDigitsTree = (TTree*)fDigitsFile->Get("TreeD_75x40_100x60_0");
+      fDigitsTree = (TTree*)fDigitsFile->Get(dname);
       if(!fDigitsTree) 
        {
          LOG(AliL3Log::kError,"AliL3Evaluate::InitMC","Digits Tree")
@@ -954,7 +956,7 @@ TNtuple *AliL3Evaluate::EvaluatePoints(Char_t *rootfile)
       return 0;
     }
 
-  AliTPCParam *param = (AliTPCParam*)exfile->Get("75x40_100x60");
+  AliTPCParam *param = (AliTPCParam*)exfile->Get(AliL3Transform::GetParamName());
   
   //Get the exact clusters from file:
   AliTPCClustersArray *arr = new AliTPCClustersArray;
index 1899a5a..8f2b7a6 100644 (file)
@@ -4,16 +4,18 @@
 //*-- Copyright &copy Uli 
 
 #include "AliL3StandardIncludes.h"
+#include <TClonesArray.h>
+
 #include <AliTPCDigitsArray.h>
 #include <AliTPCClustersArray.h>
 #include <AliTPCcluster.h>
 #include <AliTPCClustersRow.h>
+#include <AliSimDigits.h>
 
 #include "AliL3Logging.h"
 #include "AliL3Transform.h"
 #include "AliL3MemHandler.h"
 #include "AliL3FileHandler.h"
-
 #include "AliL3DigitData.h"
 #include "AliL3TrackSegmentData.h"
 #include "AliL3SpacePointData.h"
@@ -126,10 +128,10 @@ Bool_t AliL3FileHandler::SetAliInput()
       <<"Ali File "<<fInAli->GetName()<<" does not exist"<<ENDLOG;
     return kFALSE;
   }
-  fParam = (AliTPCParam*)fInAli->Get("75x40_100x60_150x60");
+  fParam = (AliTPCParam*)fInAli->Get(AliL3Transform::GetParamName());
   if(!fParam){ 
     LOG(AliL3Log::kError,"AliL3FileHandler::SetAliInput","File Open")
-      <<"No AliTPCParam 75x40_100x60 in File "<<fInAli->GetName()<<ENDLOG;
+      <<"No AliTPCParam "<<AliL3Transform::GetParamName()<<"in File "<<fInAli->GetName()<<ENDLOG;
     return kFALSE;
   }
   return kTRUE;
@@ -185,7 +187,7 @@ Bool_t AliL3FileHandler::IsDigit(Int_t event)
     return kTRUE;  //may you are use binary input which is Digits!!
   }
   Char_t name[1024];
-  sprintf(name,"TreeD_75x40_100x60_150x60_%d",event);
+  sprintf(name,"TreeD_%s_%d",AliL3Transform::GetParamName(),event);
   TTree *t=(TTree*)fInAli->Get(name);
   if(t){
     LOG(AliL3Log::kInformational,"AliL3FileHandler::IsDigit","File Type")
@@ -355,7 +357,7 @@ Bool_t AliL3FileHandler::GetDigitsTree(Int_t event)
   
   fInAli->cd();
   Char_t dname[100];
-  sprintf(dname,"TreeD_75x40_100x60_150x60_%d",event);
+  sprintf(dname,"TreeD_%s_%d",AliL3Transform::GetParamName(),event);
   fDigitsTree = (TTree*)fInAli->Get(dname);
   if(!fDigitsTree) 
     {
@@ -393,7 +395,11 @@ void AliL3FileHandler::AliDigits2RootFile(AliL3DigitRowData *rowPt,Char_t *new_d
   AliTPCDigitsArray *old_array = new AliTPCDigitsArray();
   old_array->Setup(fParam);
   old_array->SetClass("AliSimDigits");
-  Bool_t ok = old_array->ConnectTree("TreeD_75x40_100x60_0");
+
+  Char_t dname[100];
+  sprintf(dname,"TreeD_%s_0",AliL3Transform::GetParamName());
+
+  Bool_t ok = old_array->ConnectTree(dname);
   if(!ok)
     {
       printf("AliL3FileHandler::AliDigits2RootFile : No digits tree object\n");
@@ -433,7 +439,7 @@ void AliL3FileHandler::AliDigits2RootFile(AliL3DigitRowData *rowPt,Char_t *new_d
     arr->MakeTree();
   else
     {
-      Bool_t ok = arr->ConnectTree("TreeD_75x40_100x60_0");
+      Bool_t ok = arr->ConnectTree(dname);
       if(!ok)
        {
          printf("AliL3FileHandler::AliDigits2RootFile : No digits tree object in existing file\n");
index 2b893b8..c35c155 100644 (file)
@@ -6,17 +6,18 @@
 
 #include "AliL3StandardIncludes.h"
 
-#include "AliL3Logging.h"
-#include "AliL3Transform.h"
 #ifdef use_aliroot
-#include "AliRun.h"
-#include "AliMagF.h"
-#include "AliTPCParamSR.h"
-#include "AliTPCPRF2D.h"
-#include "AliTPCRF1D.h"
-#include "TFile.h"
+#include <AliRun.h>
+#include <AliMagF.h>
+#include <AliTPCParamSR.h>
+#include <AliTPCPRF2D.h>
+#include <AliTPCRF1D.h>
+#include <TFile.h>
 #endif
 
+#include "AliL3Logging.h"
+#include "AliL3Transform.h"
+
 /** \class AliL3Transform 
 //<pre>
 //_____________________________________________________________
 
 ClassImp(AliL3Transform)
 
+// Defined by HLT group
+Int_t AliL3Transform::fRows[6][2] = {{0,31},{32,62},{63,86},{87,110},{111,134},{135,158}}; //Defined by us
+Int_t AliL3Transform::fNRows[6] = {32,31,24,24,24,24}; //Defined by us
+Double_t AliL3Transform::fAnodeWireSpacing = 0.25; //Taken from the TDR
+
+// The following definition is generated by Make_Init macro in exa
 const Double_t AliL3Transform::fBFACT = 0.0029980;
 Double_t AliL3Transform::fBField = 0.2;
 Int_t AliL3Transform::fVersion = 0;
@@ -69,7 +76,6 @@ Int_t AliL3Transform::fNRowUp2 = 32 ;
 Int_t AliL3Transform::fNSectorLow = 36 ;
 Int_t AliL3Transform::fNSectorUp = 36 ;
 Int_t AliL3Transform::fNSector = 72 ;
-Double_t AliL3Transform::fAnodeWireSpacing = 0.25; //Taken from the TDR
 Double_t AliL3Transform::fPadPitchWidthLow = 0.400000 ;
 Double_t AliL3Transform::fPadPitchWidthUp = 0.600000 ;
 Double_t AliL3Transform::fZWidth = 0.56599998474121093750 ;
@@ -89,8 +95,6 @@ Int_t AliL3Transform::fNSlice = 36 ;
 Int_t AliL3Transform::fNRow = 159 ;
 Double_t AliL3Transform::fNRotShift = 0.5 ;
 Double_t AliL3Transform::fPi = 3.141592653589793 ;
-Int_t AliL3Transform::fRows[6][2] = {{0,31},{32,62},{63,86},{87,110},{111,134},{135,158}}; //Defined by us
-Int_t AliL3Transform::fNRows[6] = {32,31,24,24,24,24}; //Defined by us
 Double_t AliL3Transform::fX[159] = {85.194999694824219,
                                     85.944999694824219,
                                     86.694999694824219,
@@ -413,8 +417,6 @@ Int_t AliL3Transform::fNPads[159] = {67,
                                      139
 };
 
-
-
 void AliL3Transform::Init(Char_t* path,Bool_t UseAliTPCParam)
 {
   //Overwrite the parameters with values stored in file "l3transform.config" in path.
@@ -512,14 +514,12 @@ void AliL3Transform::ReadInit(Char_t *path)
   return;
 #else
   Char_t filename[1024];
-  sprintf(filename,"%s/digitfile.root",path);
+  sprintf(filename,"%s/alirunfile.root",path);
   MakeInitFile(filename,"/tmp/");
   Init("/tmp/");
 #endif  
 }
 
-
-
 void AliL3Transform::MakeInitFile(Char_t *filename,Char_t *path)
 {
   //Get the parameters from rootfile, and store it on the file "l3transform.config"
@@ -538,7 +538,7 @@ void AliL3Transform::MakeInitFile(Char_t *filename,Char_t *path)
        <<"No gAlice in file: "<<filename<<ENDLOG;
       return;
     }  
-  AliTPCParamSR *param=(AliTPCParamSR*)rootfile->Get("75x40_100x60_150x60");
+  AliTPCParamSR *param=(AliTPCParamSR*)rootfile->Get(GetParamName());
   if(!param)
     {
       LOG(AliL3Log::kError,"AliL3Transform::MakeInitFile","File")
@@ -642,7 +642,7 @@ void AliL3Transform::MakeInitFile(Char_t *filename,Char_t *path)
 #endif
 }
 
-inline Double_t AliL3Transform::GetPadLength(Int_t padrow)
+Double_t AliL3Transform::GetPadLength(Int_t padrow)
 {
   if(padrow >= fNRow)
     return 0;
@@ -652,9 +652,11 @@ inline Double_t AliL3Transform::GetPadLength(Int_t padrow)
     return fOuter1PadLength;
   if(padrow >= fNRowLow + fNRowUp1 - 1)
     return fOuter2PadLength;
+
+  return -1.0; //should never happen
 }
 
-inline Double_t AliL3Transform::GetPRFSigma(Int_t padrow)
+Double_t AliL3Transform::GetPRFSigma(Int_t padrow)
 {
   if(padrow >= fNRow)
     return 0;
@@ -664,6 +666,8 @@ inline Double_t AliL3Transform::GetPRFSigma(Int_t padrow)
     return fOuter1PRFSigma;
   if(padrow >= fNRowLow + fNRowUp1 - 1)
     return fOuter2PRFSigma;
+
+  return -1.; //should never happen
 }
 
 Double_t AliL3Transform::GetEta(Float_t *xyz)
index e3301c7..c76599a 100644 (file)
@@ -52,6 +52,8 @@ class AliL3Transform {
   static void ReadInit(Char_t *path);
   static void SetBField(Double_t f) {fBField = f;}
 
+  static const Char_t* GetParamName() {return "75x40_100x60_150x60";}
+
   static Int_t GetFirstRow(Int_t patch) {return fRows[patch][0];}
   static Int_t GetLastRow(Int_t patch) {return fRows[patch][1];}
   static Int_t GetNRows(Int_t patch) {return fNRows[patch];}