]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TPC/AliTPC.cxx
adding default configuration objects for PrimaryVertexer and V0Finder components
[u/mrichter/AliRoot.git] / TPC / AliTPC.cxx
index 04ce0a97156836d75d5b3da22f7cdf70ed70ff4c..ed24ff8d0935567f977056cc66a619153a3e13c9 100644 (file)
@@ -108,6 +108,7 @@ ClassImp(AliTPC)
   // Default constructor
   //
   fIshunt   = 0;
+  for(Int_t i=0;i<4;i++) fCurrentIndex[i]=0;
  
   //  fTrackHitsOld = 0;   
 #if ROOT_VERSION_CODE >= ROOT_VERSION(4,0,1)
@@ -165,7 +166,7 @@ AliTPC::AliTPC(const char *name, const char *title)
   fHitType = 2;
 #endif
 
-
+  for(Int_t i=0;i<4;i++) fCurrentIndex[i]=0;
 
   //
   fIshunt     =  0;
@@ -773,14 +774,16 @@ void    AliTPC::SetActiveSectors(Int_t flag)
     return;
   }
   for (Int_t i=0;i<fTPCParam->GetNSector();i++) fActiveSectors[i]=kFALSE;
-  TBranch * branch=0;
+  //TBranch * branch=0;
   if (fLoader->TreeH() == 0x0)
    {
      AliFatal("Can not find TreeH in folder");
      return;
    }
-  if (fHitType>1) branch = fLoader->TreeH()->GetBranch("TPC2");
-  else branch = fLoader->TreeH()->GetBranch("TPC");
+  //if (fHitType>1) branch = fLoader->TreeH()->GetBranch("TPC2");
+  if (fHitType>1) fLoader->TreeH()->GetBranch("TPC2");
+  //else branch = fLoader->TreeH()->GetBranch("TPC");
+  else fLoader->TreeH()->GetBranch("TPC");
   Stat_t ntracks = fLoader->TreeH()->GetEntries();
   // loop over all hits
   AliDebug(1,Form("Got %d tracks", (Int_t) ntracks));
@@ -1208,25 +1211,20 @@ void AliTPC::SetDefaults(){
   //
   AliRunLoader* rl = (AliRunLoader*)fLoader->GetEventFolder()->FindObject(AliRunLoader::GetRunLoaderName());
   rl->CdGAFile();
-  AliTPCParamSR *param=(AliTPCParamSR*)gDirectory->Get("75x40_100x60");
-  // if(param){
-//     AliInfo("You are using 2 pad-length geom hits with 3 pad-lenght geom digits...");
-//     delete param;
-//     param = new AliTPCParamSR();
-//   }
-//   else {
-//     param=(AliTPCParamSR*)gDirectory->Get("75x40_100x60_150x60");
-//   }
-  param = (AliTPCParamSR*)AliTPCcalibDB::Instance()->GetParameters();
+  //AliTPCParamSR *param=(AliTPCParamSR*)gDirectory->Get("75x40_100x60");
+  //gDirectory->Get("75x40_100x60");
+  AliTPCParamSR *param = (AliTPCParamSR*)AliTPCcalibDB::Instance()->GetParameters();
+  if(!param){
+    AliFatal("No TPC parameters found");
+    return;
+  }
   if (!param->IsGeoRead()){
       //
       // read transformation matrices for gGeoManager
       //
       param->ReadGeoMatrices();
     }
-  if(!param){
-    AliFatal("No TPC parameters found");
-  }
+
 
 
   AliTPCPRF2D    * prfinner   = new AliTPCPRF2D;
@@ -1242,8 +1240,9 @@ void AliTPC::SetDefaults(){
   // Use gamma 4
   //
   char  strgamma4[1000];
-  sprintf(strgamma4,"AliTPCRF1D::Gamma4((x-0.135+%f)*%f,55,160)",3*param->GetZSigma(), 1000000000*param->GetTSample()/param->GetZWidth());
+  //sprintf(strgamma4,"AliTPCRF1D::Gamma4((x-0.135+%f)*%f,55,160)",3*param->GetZSigma(), 1000000000*param->GetTSample()/param->GetZWidth());
   
+  snprintf(strgamma4,1000,"AliTPCRF1D::Gamma4((x-0.135+%f)*%f,55,160)",3*param->GetZSigma(), 1000000000*param->GetTSample()/param->GetZWidth());
   TF1 * fgamma4 = new TF1("fgamma4",strgamma4, -1,1);
   AliTPCRF1D     * rf    = new AliTPCRF1D(kTRUE,1000);
   rf->SetParam(fgamma4,param->GetZWidth(), 1,0.2);
@@ -1536,13 +1535,10 @@ void AliTPC::Hits2DigitsSector(Int_t isec)
 
   Stat_t ntracks = tH->GetEntries();
 
-
-
-    TObjArray **row;
-    
     Int_t nrows =fTPCParam->GetNRow(isec);
 
-    row= new TObjArray* [nrows+2]; // 2 extra rows for cross talk
+    TObjArray **row=new TObjArray* [nrows+2]; // 2 extra rows for cross talk
+    for(Int_t j=0;j<nrows+2;j++) row[j]=0;
     
     MakeSector(isec,nrows,tH,ntracks,row);
 
@@ -2322,7 +2318,8 @@ void AliTPC::MakeBranch(Option_t *option)
   AliDebug(1,"");
   if (fHitType<2) return;
   char branchname[10];
-  sprintf(branchname,"%s2",GetName());  
+  //sprintf(branchname,"%s2",GetName()); 
+  snprintf(branchname,10,"%s2",GetName()); 
   //
   // Get the pointer to the header
   const char *cH = strstr(option,"H");
@@ -2359,7 +2356,8 @@ void AliTPC::SetTreeAddress2()
   
   TBranch *branch;
   char branchname[20];
-  sprintf(branchname,"%s2",GetName());
+  //sprintf(branchname,"%s2",GetName());
+  snprintf(branchname,20,"%s2",GetName());
   //
   // Branch address for hit tree
   TTree *treeH = fLoader->TreeH();
@@ -2571,7 +2569,8 @@ AliTPCParam* AliTPC::LoadTPCParam(TFile *file) {
 // and one has to decide where to store the TPC parameters
 // M.Kowalski
   char paramName[50];
-  sprintf(paramName,"75x40_100x60_150x60");
+  //sprintf(paramName,"75x40_100x60_150x60");
+  snprintf(paramName,50,"75x40_100x60_150x60");
   AliTPCParam *paramTPC=(AliTPCParam*)file->Get(paramName);
   if (paramTPC) {
     AliDebugClass(1,Form("TPC parameters %s found.",paramName));