Move the initialization of the containers for raw clusters in MakeTreeC()
authormariana <mariana@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sat, 10 Feb 2001 22:26:39 +0000 (22:26 +0000)
committermariana <mariana@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sat, 10 Feb 2001 22:26:39 +0000 (22:26 +0000)
ITS/AliITS.cxx

index 435dc363e3c528422a9e8c448adb0a19ac94b205..5e2087b5ac5fba2844960eefacb3a339486618bc 100644 (file)
 
 /*
 $Log$
 
 /*
 $Log$
+Revision 1.32  2001/02/08 23:55:31  nilsen
+Removed fMajor/MinorVersion variables in favor of variables in derived classes.
+Set arrays char *det[3] = {"SPD","SDD","SSD"} as const.
+
 Revision 1.31  2001/02/02 23:57:28  nilsen
 Added include file that are no londer included in AliITSgeom.h
 
 Revision 1.31  2001/02/02 23:57:28  nilsen
 Added include file that are no londer included in AliITSgeom.h
 
@@ -142,7 +146,7 @@ the AliITS class.
 #include <TRandom.h>
 #include <TBranch.h>
 #include <TVector.h>
 #include <TRandom.h>
 #include <TBranch.h>
 #include <TVector.h>
-#include <TObjArray.h>
+#include <TClonesArray.h>
 #include <TROOT.h>
 #include <TObjectTable.h>
 #include <TFile.h>
 #include <TROOT.h>
 #include <TObjectTable.h>
 #include <TFile.h>
@@ -156,7 +160,10 @@ the AliITS class.
 #include "AliITSMap.h"
 #include "AliITSDetType.h"
 #include "AliITSClusterFinder.h"
 #include "AliITSMap.h"
 #include "AliITSDetType.h"
 #include "AliITSClusterFinder.h"
-#include "AliITSsimulation.h"
+//#include "AliITSsimulation.h"
+#include "AliITSsimulationSPD.h"
+#include "AliITSsimulationSDD.h"
+#include "AliITSsimulationSSD.h"
 #include "AliITSresponse.h"
 #include "AliITSsegmentationSPD.h"
 #include "AliITSresponseSPD.h"
 #include "AliITSresponse.h"
 #include "AliITSsegmentationSPD.h"
 #include "AliITSresponseSPD.h"
@@ -681,9 +688,17 @@ void AliITS::MakeTreeC(Option_t *option)
 
      const char *det[3] = {"SPD","SDD","SSD"};
 
 
      const char *det[3] = {"SPD","SDD","SSD"};
 
+     char digclass[40];
+     char clclass[40];
+
      // one branch for Clusters per type of detector
      Int_t i;
      for (i=0; i<kNTYPES ;i++) {
      // one branch for Clusters per type of detector
      Int_t i;
      for (i=0; i<kNTYPES ;i++) {
+       AliITSDetType *iDetType=DetType(i); 
+       iDetType->GetClassNames(digclass,clclass);
+       //printf("i, digclass, recclass %d %s %s\n",i,digclass,clclass); 
+       // clusters
+       (*fCtype)[i] = new TClonesArray(clclass,10000); 
         if (kNTYPES==3) sprintf(branchname,"%sClusters%s",GetName(),det[i]);
        else  sprintf(branchname,"%sClusters%d",GetName(),i+1);
        if (fCtype   && fTreeC) {
         if (kNTYPES==3) sprintf(branchname,"%sClusters%s",GetName(),det[i]);
        else  sprintf(branchname,"%sClusters%d",GetName(),i+1);
        if (fCtype   && fTreeC) {
@@ -715,7 +730,6 @@ void AliITS::GetTreeC(Int_t event)
     sprintf(treeName,"TreeC%d",event);
     fTreeC = (TTree*)gDirectory->Get(treeName);
 
     sprintf(treeName,"TreeC%d",event);
     fTreeC = (TTree*)gDirectory->Get(treeName);
 
-
     TBranch *branch;
     if (fTreeC) {
         Int_t i;
     TBranch *branch;
     if (fTreeC) {
         Int_t i;
@@ -766,7 +780,7 @@ void AliITS::MakeBranch(Option_t* option, char *file)
        // digits
        (*fDtype)[i] = new TClonesArray(digclass,10000); 
        // clusters
        // digits
        (*fDtype)[i] = new TClonesArray(digclass,10000); 
        // clusters
-       (*fCtype)[i] = new TClonesArray(clclass,10000); 
+       //(*fCtype)[i] = new TClonesArray(clclass,10000); 
    }
 
    for (i=0; i<kNTYPES ;i++) {
    }
 
    for (i=0; i<kNTYPES ;i++) {
@@ -1157,12 +1171,13 @@ void AliITS::DigitsToRecPoints(Int_t evNumber,Int_t lastentry,Option_t *opt)
    char *det[3] = {strstr(opt,"SPD"),strstr(opt,"SDD"),strstr(opt,"SSD")};
 
    static Bool_t first=kTRUE;
    char *det[3] = {strstr(opt,"SPD"),strstr(opt,"SDD"),strstr(opt,"SSD")};
 
    static Bool_t first=kTRUE;
-   if (first) {
+   if (!TreeC() && first) {
        MakeTreeC("C");
        first=kFALSE;
    }
        MakeTreeC("C");
        first=kFALSE;
    }
+
+   TTree *treeC=TreeC();
  
  
-   TTree *iTC=TreeC();
 
    //TBranch *branch;
    AliITSClusterFinder* rec;
 
    //TBranch *branch;
    AliITSClusterFinder* rec;
@@ -1197,7 +1212,7 @@ void AliITS::DigitsToRecPoints(Int_t evNumber,Int_t lastentry,Option_t *opt)
              if (ndigits) rec->FindRawClusters();
              gAlice->TreeR()->Fill(); 
              ResetRecPoints();
              if (ndigits) rec->FindRawClusters();
              gAlice->TreeR()->Fill(); 
              ResetRecPoints();
-             iTC->Fill();
+             treeC->Fill();
               ResetClusters();
              // try and fill only the branch 
              //branch->Fill();
               ResetClusters();
              // try and fill only the branch 
              //branch->Fill();
@@ -1207,7 +1222,7 @@ void AliITS::DigitsToRecPoints(Int_t evNumber,Int_t lastentry,Option_t *opt)
 
 
    Int_t nentries=(Int_t)gAlice->TreeR()->GetEntries();
 
 
    Int_t nentries=(Int_t)gAlice->TreeR()->GetEntries();
-   Int_t ncentries=(Int_t)iTC->GetEntries();
+   Int_t ncentries=(Int_t)treeC->GetEntries();
    cout << " nentries ncentries " << nentries << ncentries <<  endl;
 
    char hname[30];
    cout << " nentries ncentries " << nentries << ncentries <<  endl;
 
    char hname[30];
@@ -1217,8 +1232,8 @@ void AliITS::DigitsToRecPoints(Int_t evNumber,Int_t lastentry,Option_t *opt)
    gAlice->TreeR()->Reset();
 
    sprintf(hname,"TreeC%d",evNumber);
    gAlice->TreeR()->Reset();
 
    sprintf(hname,"TreeC%d",evNumber);
-   iTC->Write(hname);
-   iTC->Reset();
+   treeC->Write(hname,TObject::kOverwrite);
+   treeC->Reset();
 }
 
 
 }