TreeC created once per event (M.Masera)
authorhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 13 May 2002 14:27:57 +0000 (14:27 +0000)
committerhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 13 May 2002 14:27:57 +0000 (14:27 +0000)
ITS/AliITS.cxx
ITS/AliITSreconstruction.cxx

index e357a1c26d80dd3e3e10b5fb7f133389398caa7f..5af7556a849e64a4bbeadb71389c5fa2fdb9b645 100644 (file)
 
 /*
 $Log$
+Revision 1.70  2002/05/10 22:28:30  nilsen
+Changes by Massimo Masera to allow the TTree of clusters to be written to a
+file otherthan the one with digits in it.
+
 Revision 1.69  2002/05/05 21:06:55  nilsen
 Added GetSimulationMoel, and fixed up SetDefaultSimulation to do the
 proper initilization when a simulation has already been defined.
@@ -1519,7 +1523,18 @@ void AliITS::MakeTreeC(Option_t *option){
   TFile *fileRecPoints = gAlice->GetTreeRFile();
   if(fileRecPoints)fileRecPoints->cd();
     const char *optC = strstr(option,"C");
-    if (optC && !fTreeC) fTreeC = new TTree("TC","Clusters in ITS");
+    char hname[30];
+    Int_t cureve = gAlice->GetEvNumber();
+    sprintf(hname,"TreeC%d",cureve);
+    if(fTreeC){
+      const char *curname = fTreeC->GetName();
+      char *exists = strstr(hname,curname);
+      if(!exists){
+        delete fTreeC; 
+        fTreeC=0;
+      }
+    }
+    if (optC && !fTreeC) fTreeC = new TTree(hname,"Clusters in ITS");
     else return;
 
     Int_t buffersize = 4000;
@@ -1529,12 +1544,14 @@ void AliITS::MakeTreeC(Option_t *option){
     char clclass[40];
 
     // one branch for Clusters per type of detector
-    Int_t i;
+    Int_t i;   
     for (i=0; i<kNTYPES ;i++) {
         AliITSDetType *iDetType=DetType(i); 
         iDetType->GetClassNames(digclass,clclass);
        // clusters
-        fCtype->AddAt(new TClonesArray(clclass,1000),i);
+        if(!ClustersAddress(i)){
+          fCtype->AddAt(new TClonesArray(clclass,1000),i);
+        }
         if (kNTYPES==3) sprintf(branchname,"%sClusters%s",GetName(),det[i]);
        else  sprintf(branchname,"%sClusters%d",GetName(),i+1);
        if (fCtype   && fTreeC) {
index deb9c75a3e467060cdb888c343a2e8608a6869db..88167646502e5047bd4081f696433ceada1de712 100644 (file)
  
 /*
 $Log$
+Revision 1.4  2002/05/10 22:31:30  nilsen
+Changes by Massimo Masera to allow Recpoints and Clusters to be written
+to separate files.
+
 Revision 1.3  2002/02/06 13:52:27  barbera
 gAlice deletion corrected (from M. Masera)
 
@@ -229,19 +233,19 @@ void AliITSreconstruction::Exec(const Option_t *opt){
     TDirectory *curr = gDirectory;
     if(fFile2)fFile2->cd();
     for(evnt=0;evnt<fEnt;evnt++){
-       nparticles = gAlice->GetEvent(evnt);
-       gAlice->SetEvent(evnt);
-       if(!gAlice->TreeR()){
-      if(fFile2){
-        gAlice->MakeTree("R",fFile2);
-      }
-      else {
-        gAlice->MakeTree("R");
+      nparticles = gAlice->GetEvent(evnt);
+      gAlice->SetEvent(evnt);
+      if(!gAlice->TreeR()){
+        if(fFile2){
+          gAlice->MakeTree("R",fFile2);
+        }
+        else {
+          gAlice->MakeTree("R");
+        }
       }
-    }
-       fITS->MakeBranch("R");
-       fITS->DigitsToRecPoints(evnt,0,lopt);
-    cout << "end of recpoints finding *********************\n";
+      fITS->MakeBranch("R");
+      fITS->MakeTreeC();
+      fITS->DigitsToRecPoints(evnt,0,lopt);
     } // end for evnt
     curr->cd();
 }