]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Setting splitlevel to 0 by default in treeH, TreeR and TreeT branches. TreeD is still...
authormartinez <martinez@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 21 Oct 2003 16:01:30 +0000 (16:01 +0000)
committermartinez <martinez@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 21 Oct 2003 16:01:30 +0000 (16:01 +0000)
MUON/AliMUON.cxx
MUON/AliMUON.h
MUON/AliMUONData.cxx
MUON/AliMUONData.h

index addbdb55ee8ed01db6e05029066819454cf81f21..7f8cd05e3bd96d7673eb33103def9da9a6265388 100644 (file)
@@ -100,6 +100,7 @@ AliMUON::AliMUON()
     fMerger          = 0;
     fFileName        = 0;
     fMUONData        = 0;
+    fSplitLevel      = 0;
 }
 //__________________________________________________________________
 AliMUON::AliMUON(const char *name, const char *title)
@@ -111,6 +112,7 @@ AliMUON::AliMUON(const char *name, const char *title)
 */
 //End_Html
   fMUONData  = 0x0;
+  fSplitLevel= 0;
   fIshunt     =  0;
 
   fNCh             = AliMUONConstants::NCh(); 
@@ -203,6 +205,7 @@ void  AliMUON::SetTreeAddress()
 {
   GetMUONData()->SetLoader(fLoader); 
   GetMUONData()->SetTreeAddress("H,D,RC");
+  fHits = GetMUONData()->Hits(); // Added by Ivana to use the methods FisrtHit, NextHit of AliDetector
 }
 
 //____________________________________________________________________
@@ -368,6 +371,7 @@ AliLoader* AliMUON::MakeLoader(const char* topfoldername)
      
  fLoader   = new AliLoader(GetName(),topfoldername);
  fMUONData = new AliMUONData(fLoader,GetName(),GetName()); 
+ fMUONData->SetSplitLevel(fSplitLevel);
  return fLoader;
 }
 
index a127602c15bc7da51473071cc41968b6e4c0e9ac..859fb2407ac6d9a7b1e9756daaa5971839f14d2f 100644 (file)
@@ -51,11 +51,12 @@ class AliMUON : public  AliDetector {
     virtual AliLoader* MakeLoader(const char* topfoldername); //builds standard getter (AliLoader type)
     // Interface with AliMUONData
     virtual void       MakeBranch(Option_t *opt=" ") {GetMUONData()->MakeBranch(opt);}
-    void               SetTreeAddress();
+    virtual void       SetTreeAddress();
     virtual void       ResetHits()                   {GetMUONData()->ResetHits();}
     virtual void       ResetDigits()                 {GetMUONData()->ResetDigits();}
-    virtual void       ResetTrigger()                {GetMUONData()->ResetTrigger();};
-    virtual void       ResetRawClusters()            {GetMUONData()->ResetRawClusters();};
+    virtual void       ResetTrigger()                {GetMUONData()->ResetTrigger();}
+    virtual void       ResetRawClusters()            {GetMUONData()->ResetRawClusters();}
+    virtual void       SetSplitLevel(Int_t SplitLevel)     {fSplitLevel=SplitLevel;}
     // Cluster Finding
     virtual void   Digits2Reco();
     virtual void   FindClusters();
@@ -114,6 +115,7 @@ class AliMUON : public  AliDetector {
     Int_t                 fNCh;                // Number of chambers   
     Int_t                 fNTrackingCh;        // Number of tracking chambers*
     AliMUONData*          fMUONData;           // Data container for MUON subsystem  
+    Int_t                 fSplitLevel;         // Splitlevel when making branches in outfiles.
     TObjArray*            fChambers;           // List of Tracking Chambers
     TObjArray*            fTriggerCircuits;    // List of Trigger Circuits
    
index fa6a74ebd3a2e119b297540d142607cee475edf0..4b855a436dcf51dbd355ab7636a9c0c02a3acd28 100644 (file)
@@ -41,6 +41,7 @@ AliMUONData::AliMUONData():TNamed()
   fGlobalTrigger = 0x0; //! List of Global Trigger 1st event in TreeR/GlobalTriggerBranch
   fLocalTrigger  = 0x0;  //! List of Local Trigger, 1st event in TreeR/LocalTriggerBranch
   fRecTracks     = 0x0;       
+  fSplitLevel    = 0;
 //default constructor
 }
 //_____________________________________________________________________________
@@ -58,7 +59,8 @@ AliMUONData::AliMUONData(AliLoader * loader, const char* name, const char* title
   fNhits         = 0;
   fNglobaltrigger =0;
   fNlocaltrigger = 0;
-  fNrectracks    = 0; 
+  fNrectracks    = 0;  
+  fSplitLevel    = 0;
 //   fHits          = new TClonesArray("AliMUONHit",1000);
 //   fNhits         = 0;
 //   fDigits        = new TObjArray(AliMUONConstants::NCh());
@@ -309,7 +311,7 @@ void AliMUONData::MakeBranch(Option_t* option)
       Info("MakeBranch","Branch %s is already in tree.",GetName());
       return ;
     }
-    branch = TreeH()->Branch(branchname,&fHits,kBufferSize);
+    branch = TreeH()->Branch(branchname,&fHits,kBufferSize,fSplitLevel);
     Info("MakeBranch","Making Branch %s for hits \n",branchname);
   }  
   
@@ -337,7 +339,7 @@ void AliMUONData::MakeBranch(Option_t* option)
        return;
       }
       TClonesArray * digits = Digits(iDetectionPlane); 
-      branch = TreeD()->Branch(branchname, &digits, kBufferSize);
+      branch = TreeD()->Branch(branchname, &digits, kBufferSize,1);
       Info("MakeBranch","Making Branch %s for digits in detection plane %d\n",branchname,iDetectionPlane+1);
       }
   }
@@ -349,7 +351,7 @@ void AliMUONData::MakeBranch(Option_t* option)
     if (fRawClusters == 0x0) {
       fRawClusters = new TObjArray(AliMUONConstants::NTrackingCh());
       for (Int_t i=0; i<AliMUONConstants::NTrackingCh();i++) {
-       fRawClusters->AddAt(new TClonesArray("AliMUONRawCluster",10000),i); 
+       fRawClusters->AddAt(new TClonesArray("AliMUONRawCluster",1000),i); 
       }
     }
 
@@ -368,7 +370,7 @@ void AliMUONData::MakeBranch(Option_t* option)
        Info("MakeBranch","Branch %s is already in tree.",GetName());
        return;
       }
-      branch = TreeR()->Branch(branchname, &((*fRawClusters)[i]),kBufferSize);
+      branch = TreeR()->Branch(branchname, &((*fRawClusters)[i]),kBufferSize,fSplitLevel);
       Info("MakeBranch","Making Branch %s for rawcluster in detection plane %d\n",branchname,i+1);
     }
   }
@@ -381,7 +383,7 @@ void AliMUONData::MakeBranch(Option_t* option)
     branch = 0x0;
     
     if (fGlobalTrigger == 0x0) {
-      fGlobalTrigger = new TClonesArray("AliMUONGlobalTrigger",1); 
+      fGlobalTrigger = new TClonesArray("AliMUONGlobalTrigger",fSplitLevel); 
       fNglobaltrigger = 0;
     }
     branch = TreeR()->GetBranch(branchname);
@@ -389,7 +391,7 @@ void AliMUONData::MakeBranch(Option_t* option)
       Info("MakeBranch","Branch %s is already in tree.",GetName());
       return ;
     }
-    branch = TreeR()->Branch(branchname, &fGlobalTrigger, kBufferSize);
+    branch = TreeR()->Branch(branchname, &fGlobalTrigger, kBufferSize,fSplitLevel);
     Info("MakeBranch", "Making Branch %s for Global Trigger\n",branchname);
     
     //
@@ -407,7 +409,7 @@ void AliMUONData::MakeBranch(Option_t* option)
       Info("MakeBranch","Branch %s is already in tree.",GetName());
       return;
     }
-    branch = TreeR()->Branch(branchname, &fLocalTrigger, kBufferSize);
+    branch = TreeR()->Branch(branchname, &fLocalTrigger, kBufferSize,fSplitLevel);
     Info("MakeBranch", "Making Branch %s for Global Trigger\n",branchname);  
   }
   
@@ -498,7 +500,7 @@ void AliMUONData::SetTreeAddress(Option_t* option)
     sprintf(branchname,"%sHits",GetName());  
     branch = TreeH()->GetBranch(branchname);
     if (branch) {
-      Info("SetTreeAddress","(%s) Setting for Hits",GetName());
+      //      Info("SetTreeAddress","(%s) Setting for Hits",GetName());
       branch->SetAddress(&fHits);
     }
     else { //can be invoked before branch creation
@@ -522,10 +524,12 @@ void AliMUONData::SetTreeAddress(Option_t* option)
   if (TreeD() && fDigits && cD) {
     for (int i=0; i<AliMUONConstants::NCh(); i++) {
       sprintf(branchname,"%sDigits%d",GetName(),i+1);
-      branch = TreeD()->GetBranch(branchname);
-      TClonesArray * digits = Digits(i);
-      if (branch) branch->SetAddress( &digits );
-      else Warning("SetTreeAddress","(%s) Failed for Digits Detection plane %d. Can not find branch in tree.",GetName(),i);
+      if (fDigits) {
+       branch = TreeD()->GetBranch(branchname);
+       TClonesArray * digits = Digits(i);
+       if (branch) branch->SetAddress( &digits );
+       else Warning("SetTreeAddress","(%s) Failed for Digits Detection plane %d. Can not find branch in tree.",GetName(),i);
+      }
     }
   }
   
@@ -553,7 +557,7 @@ void AliMUONData::SetTreeAddress(Option_t* option)
       sprintf(branchname,"%sRawClusters%d",GetName(),i+1);
       if (fRawClusters) {
        branch = TreeR()->GetBranch(branchname);
-       if (branch) branch->SetAddress(&((*fRawClusters)[i]));
+       if (branch) branch->SetAddress( &((*fRawClusters)[i]) );
        else Warning("SetTreeAddress","(%s) Failed for RawClusters Detection plane %d. Can not find branch in tree.",GetName(),i);
       }
     }
index abbb0a94fc7f38d73d7be728f69537ca70aac9ae..e3d9c00729461feb2a327adc1168522d6ca6f8e3 100644 (file)
@@ -68,6 +68,7 @@ class AliMUONData : public TNamed {
     void           GetCathode(Int_t ic) {fLoader->TreeD()->GetEvent(ic);}
     void           GetRawClusters() {fLoader->TreeR()->GetEvent(0);}
     void           GetTrigger() {fLoader->TreeR()->GetEvent(0);}
+    Int_t          GetSplitLevel() {return fSplitLevel;}
 
     Bool_t        IsRawClusterBranchesInTree();
     Bool_t        IsTriggerBranchesInTree();
@@ -79,6 +80,9 @@ class AliMUONData : public TNamed {
     virtual void   MakeBranch(Option_t *opt=" ");
     virtual void   SetTreeAddress(Option_t *opt=" ");
     
+    void           SetSplitLevel(Int_t SplitLevel) {fSplitLevel=SplitLevel;}
+    
+
     virtual void   ResetHits();
     virtual void   ResetDigits();
     virtual void   ResetTrigger();
@@ -118,6 +122,7 @@ class AliMUONData : public TNamed {
     Int_t           fNglobaltrigger;//!
     Int_t           fNlocaltrigger;//!
     Int_t           fNrectracks; //!
+    Int_t           fSplitLevel; // Splitting of branches 0 no spitting (root files are smaller) 1 splitting (larger output files)
 
     ClassDef(AliMUONData,1)
  };