]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Mostly minor style modifications to be ready for cloning with EMCAL
authorschutz <schutz@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 23 Aug 2002 15:43:06 +0000 (15:43 +0000)
committerschutz <schutz@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 23 Aug 2002 15:43:06 +0000 (15:43 +0000)
PHOS/AliPHOS.cxx
PHOS/AliPHOSClusterizer.cxx
PHOS/AliPHOSClusterizer.h
PHOS/AliPHOSClusterizerv1.cxx
PHOS/AliPHOSClusterizerv1.h
PHOS/AliPHOSDigitizer.cxx
PHOS/AliPHOSDigitizer.h
PHOS/AliPHOSGetter.cxx
PHOS/AliPHOSGetter.h
PHOS/AliPHOSSDigitizer.cxx
PHOS/AliPHOSSDigitizer.h

index d8f9a1a34a9f8bba9e20f60e9473c84fb032b2cb..2b1230cb2f755081f9fe5aef9d92a19b31c0b266 100644 (file)
@@ -32,10 +32,9 @@ class TFile;
 #include "TFolder.h" 
 
 // --- Standard library ---
-
 #include <strstream.h>
-// --- AliRoot header files ---
 
+// --- AliRoot header files ---
 #include "AliPHOS.h"
 #include "AliMC.h"
 #include "AliRun.h"
@@ -62,7 +61,6 @@ AliPHOS::AliPHOS(const char* name, const char* title): AliDetector(name, title)
   fTreeQA = 0;
 }
 
-
 //____________________________________________________________________________
 AliPHOS::~AliPHOS() 
 {  
@@ -373,10 +371,6 @@ AliPHOSGeometry * AliPHOS::GetGeometry() const
 void AliPHOS::SetTreeAddress()
 { 
 
-
-  // TBranch *branch;
-  //  AliDetector::SetTreeAddress();
-
   TBranch *branch;
   char branchname[20];
   sprintf(branchname,"%s",GetName());
index 458abc09c8639972ae0c86cf1d9c346eb542652d..214f6a787a9ef58acaa0cc6738e1af060fd6076f 100644 (file)
@@ -27,7 +27,6 @@
 #include "TFile.h"
 #include "TTree.h"
 
-
 // --- Standard library ---
 #include <iostream.h>
 #include <stdlib.h>   
@@ -48,9 +47,6 @@ ClassImp(AliPHOSClusterizer)
   // ctor
   fSplitFile= 0 ; 
   fToSplit  = kFALSE ;
-//   fHitsFileName = "" ; 
-//   fSDigitsFileName = "" ; 
-//   fDigitsFileName = "" ; 
 
 }
 
@@ -61,13 +57,7 @@ TTask(name, headerFile)
   // ctor
   fToSplit  = toSplit ;
   fSplitFile= 0 ; 
-  //  fDigitsFileName = headerFile ; 
-  //  AliPHOSGetter * gime = AliPHOSGetter::GetInstance(headerFile, name,toSplit) ; 
-//   gime->Event(0,"D") ; 
-//   fSDigitsFileName = gime->Digitizer()->GetTitle() ; 
-//   gime = AliPHOSGetter::GetInstance(fSDigitsFileName, name) ; 
-//   gime->Event(0,"S") ; 
-//   fHitsFileName = gime->SDigitizer()->GetTitle() ; 
+
 }
 
 //____________________________________________________________________________
@@ -78,39 +68,4 @@ AliPHOSClusterizer::~AliPHOSClusterizer()
   fSplitFile = 0 ; 
 }
 
-// //____________________________________________________________________________
-// void AliPHOSClusterizer::SetSplitFile(const TString splitFileName) 
-// {
-//   // Diverts the RecPoints in a file separate from the Digits file
-  
-
-//   TDirectory * cwd = gDirectory ;
-//   fSplitFile = gAlice->InitTreeFile("R",splitFileName.Data());
-//   fSplitFile->cd() ; 
-//   gAlice->Write(0, TObject::kOverwrite);
 
-//   TTree *treeE  = gAlice->TreeE();
-//   if (!treeE) {
-//     cerr << "ERROR: AliPHOSClusterizer::SetSplitFile -> No TreeE found "<<endl;
-//     abort() ;
-//   }      
-  
-//   // copy TreeE
-//   AliHeader *header = new AliHeader();
-//   treeE->SetBranchAddress("Header", &header);
-//   treeE->SetBranchStatus("*",1);
-//   TTree *treeENew =  treeE->CloneTree();
-//   treeENew->Write(0, TObject::kOverwrite);
-    
-//   // copy AliceGeom
-//   TGeometry *AliceGeom = static_cast<TGeometry*>(cwd->Get("AliceGeom"));
-//   if (!AliceGeom) {
-//     cerr << "ERROR: AliPHOSClusterizer::SetSplitFile -> AliceGeom was not found in the input file "<<endl;
-//     abort() ;
-//   }
-//   AliceGeom->Write(0, TObject::kOverwrite);
-  
-//   gAlice->MakeTree("R", fSplitFile);
-//   cwd->cd() ; 
-//   cout << "INFO: AliPHOSClusterizer::SetSPlitMode -> RecPoints will be stored in " << splitFileName.Data() << endl ;   
-// }
index 596140113458e8a571bb68ddb4a81244c4666d30..5cd8953610dc3f2cb3dabe17b85b58132cf09885 100644 (file)
@@ -27,10 +27,6 @@ public:
   AliPHOSClusterizer(const char * headerFile, const char * name, const Bool_t toSplit) ;
   virtual ~AliPHOSClusterizer() ; // dtor
 
-  //  const TString GetHitsFileName() const { return fHitsFileName ; }
-  //  const TString GetSDigitsFileName() const { return fSDigitsFileName ; }
-  //  const TString GetDigitsFileName() const { return fDigitsFileName ; }
-
   virtual Float_t GetEmcClusteringThreshold()const {cout << "Not Defined" << endl ; return 0. ; }  
   virtual Float_t GetEmcLocalMaxCut()const {cout << "Not Defined" << endl ; return 0. ; } 
   virtual Float_t GetEmcLogWeight()const {cout << "Not Defined" << endl ; return 0. ; } 
@@ -54,15 +50,11 @@ public:
   virtual void SetCpvLogWeight(Float_t w) {cout << "Not Defined" << endl ;  } 
   virtual void SetDigitsBranch(const char * title) {cout << "Not Defined" << endl ; }  
   virtual void SetRecPointsBranch(const char *title) {cout << "Not Defined" << endl ; } 
-  //  //  virtual void SetSplitFile(const TString splitFileName = "PHOS.RecData.root") ; 
   virtual void SetUnfolding(Bool_t toUnfold ){cout << "Not Defined" << endl ;}  
   virtual const char * Version() const {cout << "Not Defined" << endl ; return 0 ; }  
 
 protected:
 
-  //  TString fHitsFileName ;          // file name that contains the original hits
-  // TString fSDigitsFileName ;       // file name that contains the original SDigits
-  //  TString fDigitsFileName ;        // file name that contains the original Digits
   TFile * fSplitFile ;             //! file in which RecPoints will eventually be stored
   Bool_t  fToSplit ;               //! Should we write to splitted file
 
index 058321d548211f3c2b5ffa8c2edd61be44305213..e7dc51b0fc3a63e4887f35f9e98ea2a2f03bb93a 100644 (file)
@@ -100,7 +100,6 @@ AliPHOSClusterizerv1::AliPHOSClusterizerv1(const char* headerFile,const char* na
   // ctor with the indication of the file where header Tree and digits Tree are stored
   
   InitParameters() ;
-  
   Init() ;
   fDefaultInit = kFALSE ; 
 
@@ -110,26 +109,8 @@ AliPHOSClusterizerv1::AliPHOSClusterizerv1(const char* headerFile,const char* na
   AliPHOSClusterizerv1::~AliPHOSClusterizerv1()
 {
   // dtor
+  fSplitFile = 0 ; 
 
-//   if (!fDefaultInit) {
-//     AliPHOSGetter * gime = AliPHOSGetter::GetInstance() ; 
-    
-//   // remove the task from the folder list
-//     gime->RemoveTask("C",GetName()) ;
-    
-//     // remove the data from the folder list
-//     TString name(GetName()) ; 
-//     name.Remove(name.Index(":")) ; 
-//     gime->RemoveObjects("D", name) ;  //  Digits
-//     gime->RemoveObjects("RE", name) ; // EMCARecPoints
-//     gime->RemoveObjects("RC", name) ; // CPVRecPoints
-    
-//     // Delete gAlice
-//     gime->CloseFile() ; 
-    
-    fSplitFile = 0 ; 
-//  }
 }
 
 //____________________________________________________________________________
@@ -143,11 +124,14 @@ const TString AliPHOSClusterizerv1::BranchName() const
 //____________________________________________________________________________
 Float_t  AliPHOSClusterizerv1::Calibrate(Int_t amp, Int_t absId) const
 { //To be replased later by the method, reading individual parameters from the database
+
   if(absId <= fEmcCrystals) //calibrate as EMC 
-    return fADCpedestalEmc + amp*fADCchanelEmc ;       
+    return fADCpedestalEmc + amp*fADCchanelEmc ;    
+   
   else //Digitize as CPV
     return fADCpedestalCpv+ amp*fADCchanelCpv ;       
 }
+
 //____________________________________________________________________________
 void AliPHOSClusterizerv1::Exec(Option_t * option)
 {
@@ -162,36 +146,6 @@ void AliPHOSClusterizerv1::Exec(Option_t * option)
   if(strstr(option,"print"))
     Print("") ; 
 
-//    gAlice->GetEvent(0) ;
-  
-//  //check, if the branch with name of this" already exits?
-//   if(gAlice->TreeR()) { 
-//     TObjArray * lob = (TObjArray*)gAlice->TreeR()->GetListOfBranches() ;
-//     TIter next(lob) ; 
-//     TBranch * branch = 0 ;  
-//     Bool_t phosemcfound = kFALSE, phoscpvfound = kFALSE, clusterizerfound = kFALSE ; 
-    
-//     TString branchname = GetName() ;
-//     branchname.Remove(branchname.Index(Version())-1) ;
-    
-//     while ( (branch = (TBranch*)next()) && (!phosemcfound || !phoscpvfound || !clusterizerfound) ) {
-//       if ( (strcmp(branch->GetName(), "PHOSEmcRP")==0) && (strcmp(branch->GetTitle(), branchname.Data())==0) ) 
-//     phosemcfound = kTRUE ;
-      
-//       else if ( (strcmp(branch->GetName(), "PHOSCpvRP")==0) && (strcmp(branch->GetTitle(), branchname.Data())==0) ) 
-//     phoscpvfound = kTRUE ;
-      
-//       else if ((strcmp(branch->GetName(), "AliPHOSClusterizer")==0) && (strcmp(branch->GetTitle(), GetName())==0) ) 
-//     clusterizerfound = kTRUE ; 
-//     }
-    
-//     if ( phoscpvfound || phosemcfound || clusterizerfound ) {
-//       cerr << "WARNING: AliPHOSClusterizer::Exec -> Emc(Cpv)RecPoints and/or Clusterizer branch with name " 
-//        << branchname.Data() << " already exits" << endl ;
-//       return ; 
-//     }       
-//   }
-  
   AliPHOSGetter * gime = AliPHOSGetter::GetInstance() ;
   if(gime->BranchExists("RecPoints"))
     return ;
@@ -205,12 +159,8 @@ void AliPHOSClusterizerv1::Exec(Option_t * option)
     if(ievent == 0)
       GetCalibrationParameters() ;
     
-    fNumberOfEmcClusters  = 0 ;
-    fNumberOfCpvClusters  = 0 ;
-    
-    
-    //    if(!ReadDigits(ievent))   continue;  //reads digits for event ievent
-    
+    fNumberOfEmcClusters  = fNumberOfCpvClusters  = 0 ;
+            
     MakeClusters() ;
     
     if(fToUnfold)             
@@ -342,6 +292,7 @@ void AliPHOSClusterizerv1::GetCalibrationParameters()
   fADCpedestalCpv = dig->GetCPVpedestal() ; 
   
 }
+
 //____________________________________________________________________________
 void AliPHOSClusterizerv1::Init()
 {
@@ -393,9 +344,6 @@ void AliPHOSClusterizerv1::Init()
 
   gime->PostClusterizer(this) ;
   gime->PostRecPoints(branchname) ;
-
-  //  gime->PostDigits() ;
-  //  gime->PostDigitizer() ;
   
 }
 
@@ -418,10 +366,7 @@ void AliPHOSClusterizerv1::InitParameters()
   fEmcTimeGate             = 1.e-8 ; 
   
   fToUnfold                = kTRUE ;
-  
-  //  fHeaderFileName          = GetTitle() ; 
-  //  fDigitsBranchTitle       = GetName() ;
-   
+    
   TString clusterizerName( GetName()) ;
   if (clusterizerName.IsNull() ) 
     clusterizerName = "Default" ; 
@@ -581,7 +526,7 @@ void AliPHOSClusterizerv1::WriteRecPoints(Int_t event)
   cpvBranch        ->Fill() ;
   clusterizerBranch->Fill() ;
 
-  treeR->AutoSave() ; //Write(0,kOverwrite) ;  
+  treeR->AutoSave() ; 
   if(gAlice->TreeR()!=treeR)
     treeR->Delete();
 }
index c1269299e25d461b20462705f082cb1dcfd16faf..489c40d44dd5607d96e21c706cb26fb09ae53444 100644 (file)
@@ -52,7 +52,6 @@ public:
   virtual Float_t GetCpvLogWeight()const          { return fW0CPV;}  
   virtual const char *  GetRecPointsBranch() const{ return GetName() ;}
   virtual const Int_t GetRecPointsInRun() const   {return fRecPointsInRun ;} 
-  //  virtual const char *  GetDigitsBranch() const         { return (char*) fDigitsBranchTitle.Data() ;}
 
   void    Exec(Option_t *option);                // Does the job
 
@@ -65,9 +64,7 @@ public:
   virtual void SetCpvClusteringThreshold(Float_t cluth)  { fCpvClusteringThreshold = cluth ; }
   virtual void SetCpvLocalMaxCut(Float_t cut)            { fCpvLocMaxCut = cut ; }
   virtual void SetCpvLogWeight(Float_t w)                { fW0CPV = w ; }
-  //  virtual void SetDigitsBranch(const char * title) { fDigitsBranchTitle = title  ;}
-  //  virtual void SetRecPointsBranch(const char *title){fRecPointsBranchTitle = title; }
-  virtual void SetUnfolding(Bool_t toUnfold = kTRUE )    { fToUnfold = toUnfold ;}  
+   virtual void SetUnfolding(Bool_t toUnfold = kTRUE )    { fToUnfold = toUnfold ;}  
   static Double_t ShowerShape(Double_t r) ; // Shape of EM shower used in unfolding; 
                                             //class member function (not object member function)
   static void UnfoldingChiSquare(Int_t & nPar, Double_t * Grad, Double_t & fret, Double_t * x, Int_t iflag)  ;
@@ -100,10 +97,6 @@ private:
 private:
 
   Bool_t  fDefaultInit;              //! Says if the task was created by defaut ctor (only parameters are initialized)
-  //  TString fFrom ;                    // name of Digits 
-  //  TString fHeaderFileName ;          // name of the file which contains gAlice, Tree headers etc.
-  //  TString fDigitsBranchTitle ;       // name of the file, where digits branch is stored
-  //  TString fRecPointsBranchTitle ;    // name of the file, where RecPoints branchs are stored
 
   Int_t   fEmcCrystals ;             // number of EMC cristalls in PHOS
 
index bbb894ac1220b6886d001891030e67243af0a290..c65aa7674aa2f4213c5e69c7ab9a67121de3c013 100644 (file)
@@ -68,7 +68,6 @@
 #include <iomanip.h>
 
 // --- AliRoot header files ---
-
 #include "AliRun.h"
 #include "AliHeader.h"
 #include "AliStream.h"
@@ -91,9 +90,7 @@ ClassImp(AliPHOSDigitizer)
   InitParameters() ; 
   fDefaultInit = kTRUE ;
   fManager = 0 ;                     // We work in the standalong mode
-  // fHitsFileName    = "" ;
-  // fSDigitsFileName = "" ; 
+
  }
 
 //____________________________________________________________________________ 
@@ -109,10 +106,6 @@ AliPHOSDigitizer::AliPHOSDigitizer(const char *headerFile, const char * name, co
   fToSplit = toSplit ;
   Init() ;
   fDefaultInit = kFALSE ; 
-  //  fSDigitsFileName = headerFile ; 
-  //  AliPHOSGetter * gime = AliPHOSGetter::GetInstance() ; 
-  //  gime->Event(0, "S") ; 
-  //  fHitsFileName = gime->SDigitizer()->GetTitle() ; 
 }
 
 //____________________________________________________________________________ 
@@ -131,38 +124,14 @@ AliPHOSDigitizer::AliPHOSDigitizer(AliRunDigitizer * ard):AliDigitizer(ard)
     SetName("Default") ;
     fToSplit = kFALSE ;
   }
-
-//   fSDigitsFileName = fManager->GetInputFileName(0, 0) ;
-//   AliPHOSGetter * gime = AliPHOSGetter::GetInstance(fSDigitsFileName, GetName()) ; 
-//   gime->Event(0,"S") ; 
-//  fHitsFileName = gime->SDigitizer()->GetTitle() ; 
-  
 }
 
 //____________________________________________________________________________ 
   AliPHOSDigitizer::~AliPHOSDigitizer()
 {
   // dtor
-  // fDefaultInit = kTRUE if Digitizer created by default ctor (to get just the parameters)
-  
-//   if (!fDefaultInit) {
-//     AliPHOSGetter * gime = AliPHOSGetter::GetInstance() ; 
-//    // remove the task from the folder list
-//    gime->RemoveTask("S",GetName()) ;
-//    gime->RemoveTask("D",GetName()) ;
-   
-//    // remove the Digits from the folder list
-//    gime->RemoveObjects("D", GetName()) ;
-   
-//    // remove the SDigits from the folder list
-//    gime->RemoveSDigits() ;
-   
-//    // Delete gAlice
-//    gime->CloseFile() ; 
-   
+     
    fSplitFile = 0 ; 
-   // }
 }
 
 //____________________________________________________________________________
@@ -362,7 +331,7 @@ void AliPHOSDigitizer::Digitize(const Int_t event)
   
   //remove digits below thresholds
   for(i = 0; i < nEMC ; i++){
-    digit = (AliPHOSDigit*) digits->At(i) ;
+    digit = dynamic_cast<AliPHOSDigit*>( digits->At(i) ) ;
     if(sDigitizer->Calibrate( digit->GetAmp() ) < fEMCDigitThreshold)
       digits->RemoveAt(i) ;
     else
@@ -381,13 +350,14 @@ void AliPHOSDigitizer::Digitize(const Int_t event)
 
   //Set indexes in list of digits and make true digitization of the energy
   for (i = 0 ; i < ndigits ; i++) { 
-    AliPHOSDigit * digit = (AliPHOSDigit *) digits->At(i) ; 
+    digit = dynamic_cast<AliPHOSDigit*>( digits->At(i) ) ; 
     digit->SetIndexInList(i) ;     
     Float_t energy = sDigitizer->Calibrate(digit->GetAmp()) ;
     digit->SetAmp(DigitizeEnergy(energy,digit->GetId()) ) ;
   }
 
 }
+
 //____________________________________________________________________________
 Int_t AliPHOSDigitizer::DigitizeEnergy(Float_t energy, Int_t absId)
 {
@@ -402,6 +372,7 @@ Int_t AliPHOSDigitizer::DigitizeEnergy(Float_t energy, Int_t absId)
   }
   return chanel ;
 }
+
 //____________________________________________________________________________
 void AliPHOSDigitizer::Exec(Option_t *option) 
 { 
@@ -626,7 +597,10 @@ void AliPHOSDigitizer::MixWith(const char* headerFile)
   // check if the specified SDigits do not already exist on the White Board:
   // //Folders/RunMC/Event/Data/PHOS/SDigits/headerFile/sdigitsname
 
-  TString path = "Folders/RunMC/Event/Data/PHOS/SDigits" ; 
+  AliPHOSGetter * gime = AliPHOSGetter::GetInstance() ; 
+  TString path = gime->SDigitsFolder()->GetName() ; 
+
+  // before it was ???? "Folders/RunMC/Event/Data/PHOS/SDigits" ; 
   path += headerFile ; 
   path += "/" ; 
   path += GetName() ;
@@ -635,7 +609,6 @@ void AliPHOSDigitizer::MixWith(const char* headerFile)
     return;
   }
 
-  AliPHOSGetter * gime = AliPHOSGetter::GetInstance() ;
   gime->PostSDigits(GetName(),headerFile) ;
   
   // check if the requested file is already open or exist and if SDigits Branch exist
@@ -650,59 +623,6 @@ void AliPHOSDigitizer::MixWith(const char* headerFile)
   
 }
 
-// //__________________________________________________________________
-// void AliPHOSDigitizer::SetSplitFile(const TString splitFileName)
-// {
-//   // Diverts the Digits in a file separate from the hits file
-  
-//   // I guess it is not going to work if we do merging
-// //   if (fManager) {
-// //     cerr << "ERROR: AliPHOSDigitizer::SetSplitFile -> Not yet available in case of merging activated " << endl ;  
-// //     return ; 
-// //   }
-
-//   cout << "AliPHOSDigitizer::SetSplitFile " << gDirectory->GetName() << endl ;  
-//   cout << "AliPHOSDigitizer::SetSplitFile " << gAlice->GetTreeDFileName() << endl ;  
-//   cout << "AliPHOSDigitizer::SetSplitFile " <<  splitFileName.Data() << endl ;
-  
-//   SetTitle(splitFileName) ; 
-
-//   TDirectory * cwd = gDirectory ;
-//   if ( !(gAlice->GetTreeDFileName() == splitFileName) ) {
-//     if (gAlice->GetTreeDFile() )  
-//       gAlice->GetTreeDFile()->Close() ; 
-//   }
-
-//   fSplitFile = gAlice->InitTreeFile("D",splitFileName.Data());
-//   fSplitFile->cd() ; 
-//   gAlice->Write(0, TObject::kOverwrite);
-
-//   TTree *treeE  = gAlice->TreeE();
-//   if (!treeE) {
-//     cerr << "ERROR: AliPHOSDigitizer::SetSplitFile -> No TreeE found "<<endl;
-//     abort() ;
-//   }      
-  
-//   // copy TreeE
-//   AliHeader *header = new AliHeader();
-//   treeE->SetBranchAddress("Header", &header);
-//   treeE->SetBranchStatus("*",1);
-//   TTree *treeENew =  treeE->CloneTree();
-//   treeENew->Write(0, TObject::kOverwrite);
-  
-//   // copy AliceGeom
-//   TGeometry *AliceGeom = static_cast<TGeometry*>(cwd->Get("AliceGeom"));
-//   if (!AliceGeom) {
-//     cerr << "ERROR: AliPHOSDigitizer::SetSplitFile -> AliceGeom was not found in the input file "<<endl;
-//     abort() ;
-//     }
-//   AliceGeom->Write(0, TObject::kOverwrite);
-  
-//   gAlice->MakeTree("D",fSplitFile);
-//   cwd->cd() ; 
-//   cout << "INFO: AliPHOSDigitizer::SetSPlitMode -> Digits will be stored in " << splitFileName.Data() << endl ; 
-// }
-
 //__________________________________________________________________
 void AliPHOSDigitizer::Print(Option_t* option)const {
   // Print Digitizer's parameters
@@ -806,16 +726,6 @@ void AliPHOSDigitizer::PrintDigits(Option_t * option){
 
 }
 
-// //__________________________________________________________________
-// void AliPHOSDigitizer::SetSDigitsBranch(const char* title)
-// {
-//   // we set title (comment) of the SDigits branch in the first! header file
-//   if( strcmp(GetName(), "") == 0 )
-//     Init() ;
-
-//   AliPHOSGetter::GetInstance()->SDigits()->SetName(title) ; 
-// }
 //__________________________________________________________________
 Float_t AliPHOSDigitizer::TimeOfNoise(void)
 {  // Calculates the time signal generated by noise
@@ -823,19 +733,6 @@ Float_t AliPHOSDigitizer::TimeOfNoise(void)
   return 1. ;
 
 }
-// //____________________________________________________________________________
-// void AliPHOSDigitizer::Reset() 
-// { 
-//   // sets current event number to the first simulated event
-
-//   if( strcmp(GetName(), "") == 0 )
-//     Init() ;
-
-//  //  Int_t inputs ;
-// //   for(inputs = 0; inputs < fNinputs ;inputs++)
-// //       fIevent->AddAt(-1, inputs ) ;
-  
-// }
 
 //____________________________________________________________________________
 void AliPHOSDigitizer::WriteDigits(Int_t event)
index 4842551d912fde103e22fd49cf60591373a156ab..25b807af8344476cef47c9063111a33bc4b4b0b0 100644 (file)
@@ -68,15 +68,9 @@ public:
 
   //General
   const Int_t   GetDigitsInRun()  const { return fDigitsInRun ;}  
-  //  const TString GetHitsFileName() const { return fHitsFileName ; }
-  //  const TString GetSDigitsFileName() const { return fSDigitsFileName ; }
-
   void    MixWith(const char* HeaderFile) ; // Add another one file to mix
   void    Print(Option_t* option)const ;
-  // void    Reset() ;   //restarts starts event processing from 0 event(s)
-  //  void    SetSplitFile(const TString splitFileName = "PHOS.Digits.root") ;
-  // void    SetSDigitsBranch(const char* file) ;
-
   AliPHOSDigitizer & operator = (const AliPHOSDigitizer & rvalue)  {
     // assignement operator requested by coding convention but not needed
     abort() ;
@@ -97,9 +91,9 @@ private:
 
 private:
 
-  //  TString fHitsFileName ;           // file name that contains the original hits
-  //  TString fSDigitsFileName ;        // file name that contains the original SDigits
   Bool_t  fDefaultInit;             //! Says if the task was created by defaut ctor (only parameters are initialized)
+  Int_t fDigitsInRun ;              //! Total number of digits in one run
+
   Int_t   fEmcCrystals ;            // Number of EMC crystalls in the given geometry
 
   Float_t fPinNoise ;               // Electronics noise in EMC
@@ -108,7 +102,6 @@ private:
   Float_t fCPVNoise ;               // Noise in CPV
   Float_t fCPVDigitThreshold  ;     // Threshold for storing digits in CPV
 
-  Int_t fDigitsInRun ;              //! Total number of digits in one run
 
   Float_t fTimeResolution ;         // Time resolution of FEE electronics
   Float_t fTimeThreshold ;          // Threshold to start timing for given crystall
index 373c22d76971adb07f3706b5587898227d376aa5..bb457101ec7eb3840789c97ff7508380fd7b39ad 100644 (file)
@@ -48,7 +48,6 @@
 //*--         systematic usage of TFolders without changing the interface        
 //////////////////////////////////////////////////////////////////////////////
 
-
 // --- ROOT system ---
 #include "TFile.h"
 #include "TTree.h"
@@ -61,7 +60,6 @@
 #include <iostream.h>
 
 // --- AliRoot header files ---
-
 #include "AliRun.h"
 #include "AliConfig.h"
 #include "AliPHOSGetter.h"
@@ -204,8 +202,6 @@ AliPHOSGetter * AliPHOSGetter::GetInstance()
   // Returns the pointer of the unique instance already defined
   
   if ( fgObjGetter ) {
-//     if (fFile)   // not the case if fManager
-//       fFile->cd() ; 
     return fgObjGetter ;
   }
   else {
@@ -221,6 +217,7 @@ AliPHOSGetter * AliPHOSGetter::GetInstance(const char* headerFile,
 {
   // Creates and returns the pointer of the unique instance
   // Must be called only when the environment has changed
+
   if(!fgObjGetter){
     fgObjGetter = new AliPHOSGetter(headerFile,branchTitle,toSplit) ;
     if(fgObjGetter->fFailed)
@@ -716,6 +713,7 @@ const Bool_t AliPHOSGetter::PostSDigitizer(const char * name, const char * file)
   return kTRUE; 
   
 }
+
 //____________________________________________________________________________ 
 const Bool_t AliPHOSGetter::PostDigits(const char * name) const 
 {  //---------- Digits -------------------------
@@ -1170,7 +1168,6 @@ const Bool_t AliPHOSGetter::PostTrackSegmentMaker(const char * name) const
   
   // the hierarchy is //Folders/Tasks/Reconstructioner/PHOS/sdigitsname
   
-  
   TTask * tasks  = dynamic_cast<TTask*>(fTasksFolder->FindObject("Reconstructioner")) ; 
   
   if ( !tasks ) {
@@ -1283,7 +1280,7 @@ const Bool_t AliPHOSGetter::PostRecParticles(const char * name) const
 
 //____________________________________________________________________________ 
 TObject** AliPHOSGetter::RecParticlesRef(const char * name) const 
-{ // ---------------TrackSegments -----------------------------------
+{ // ---------------RecParticles -----------------------------------
   
   // the hierarchy is //Folders/Run/Event/RecData/PHOS/TrackSegments/name
 
@@ -1571,27 +1568,9 @@ const TParticle * AliPHOSGetter::Primary(Int_t index) const
     p = fAlice->Particle(index) ; 
   else 
     p = gAlice->Particle(index) ; 
-  //   if (p->GetFirstMother() != -1 ) {
-  //     cout << "AliPHOSGetter::Primary : Not a primary " << endl ; 
-  //   }
   
   return p ; 
     
-  
-  
-  //   Int_t primaryIndex = index % 10000000 ; 
-//   Int_t primaryList = (Int_t ) ((index-primaryIndex)/10000000.)  ;
-  
-//   if ( primaryList > 0  ) {
-//     if (fDebug) {
-//       cout << " Getter does not support currently Mixing of primary " << endl ;
-//       cout << "   can not return primary: " << index<< " (list "<< primaryList<< " primary # " << primaryIndex << " )"<<endl ;
-//     }
-//     return 0;
-//   }
-  
-//   return gAlice->Particle(primaryIndex) ;
-  
 }
 
 //____________________________________________________________________________ 
@@ -1635,30 +1614,6 @@ Int_t AliPHOSGetter::ReadTreeD(const Int_t event)
   else
     treeD = gAlice->TreeD() ;
   
-//   if(!treeD) { // TreeD not found in header file
-    
-//     if (fDebug) 
-//       cout <<   "WARNING: AliPHOSGetter::ReadTreeD -> Cannot find TreeD in " << fHeaderFile << endl ;
-    
-//     TString searchFileName("") ; 
-    
-//     if (Digitizer())  // Digitizer found in header file
-//       searchFileName = Digitizer()->GetTitle() ; 
-    
-//     else if (Clusterizer())  // Clusterizer found in header file
-//       searchFileName = Clusterizer()->GetDigitsFileName() ; 
-    
-//     if ( (treeD = TreeD(searchFileName)) ) { //found TreeD in the file which contains the hits
-//       if (fDebug) 
-//     cout << "INFO: AliPHOSGetter::ReadTreeD -> TreeD found in " << searchFileName.Data() << endl ; 
-      
-//     } else {
-//       cerr << "ERROR: AliPHOSGetter::ReadTreeD -> TreeD not found " << endl ; 
-//       return 1;
-//     }   
-//   }
-
-  
   TObjArray * lob = static_cast<TObjArray*>(treeD->GetListOfBranches()) ;
   TIter next(lob) ; 
   TBranch * branch = 0 ; 
@@ -1791,8 +1746,8 @@ void AliPHOSGetter::Track(Int_t itrack)
   hitsbranch->SetAddress(HitsRef()) ;
   hitsbranch->GetEntry(itrack) ;
 
-
 }
+
 //____________________________________________________________________________ 
 void AliPHOSGetter::ReadTreeQA()
 {
@@ -1979,9 +1934,8 @@ Int_t AliPHOSGetter::ReadTreeR(const Int_t event)
     pidbranch->GetEntry(0) ;
   }
 
-  if(gAlice->TreeR()!=treeR){
+  if(gAlice->TreeR()!=treeR)
     treeR->Delete();
-  }
   return 0 ; 
 }
 
@@ -2063,23 +2017,12 @@ Int_t AliPHOSGetter::ReadTreeS(const Int_t event)
       PostSDigitizer(fSDigitsTitle,folder->GetName()) ;
     sdigitizerBranch->SetAddress(SDigitizerRef(sdname)) ;
     sdigitizerBranch->GetEntry(0) ; 
-    //    lob  ->Delete();
     if(gAlice->TreeS()!=treeS)
       treeS->Delete();
   }    
-  
-  // After SDigits have been read from all files, return to the first one
-  
-//   next.Reset();
-//   folder = static_cast<TFolder*>(next());
-//   if(folder){
-//     TString fileName(folder->GetName()) ; 
-//     fileName.ReplaceAll("_","/") ; 
-//     file   = static_cast<TFile*>(gROOT->GetFile(fileName)); 
-//     file   ->cd() ;
-//   }
   return 0 ; 
 }
+
 //____________________________________________________________________________ 
 void AliPHOSGetter::ReadTreeS(TTree * treeS, Int_t input)
 
@@ -2133,7 +2076,6 @@ void AliPHOSGetter::ReadTreeS(TTree * treeS, Int_t input)
     PostSDigitizer(sdigitsBranch->GetTitle(),filename) ;
   sdigitizerBranch->SetAddress(SDigitizerRef(sdname)) ;
   sdigitizerBranch->GetEntry(0) ;
-  //  lob  ->Delete();
   if(gAlice->TreeS()!=treeS)
     treeS->Delete();
 }    
@@ -2173,6 +2115,7 @@ void AliPHOSGetter::ReadPrimaries()
 void AliPHOSGetter::Event(const Int_t event, const char* opt)  
 {
   // Reads the content of all Tree's S, D and R
+
   if (event >= gAlice->TreeE()->GetEntries() ) {
     cerr << "ERROR: AliPHOSGetter::Event -> " << event << " not found in TreeE!" << endl ; 
     return ; 
@@ -2216,7 +2159,6 @@ TObject * AliPHOSGetter::ReturnO(TString what, TString name, TString file) const
   TFolder * folder = 0 ;
   TObject * phosO  = 0 ; 
 
-  //  if ( name.IsNull() ) {
   if ( what.CompareTo("Primaries") == 0 ) {
     folder = dynamic_cast<TFolder *>(fPrimariesFolder->FindObject("Primaries")) ; 
     if (folder) 
@@ -2591,7 +2533,7 @@ void AliPHOSGetter::CleanWhiteBoard(void){
   }
 
 
-  //---- Now Tascks ----------- 
+  //---- Now Tasks ----------- 
 
   TObject * obj ;
   TString sdname(fSDigitsTitle);
index 386f5f983aa5a8294114a4d937ab10586a0e04af..66259f54101293662314d33c95c2fb9df2220aa2 100644 (file)
@@ -66,13 +66,13 @@ class AliPHOSGetter : public TObject {
     return *this ; 
   }
   virtual ~AliPHOSGetter() ; 
-
+  
   //=========== Instantiators ================
   static AliPHOSGetter * GetInstance(const char* headerFile,
                                     const char* branchTitle = "Default",
                                      const Bool_t toSplit = kFALSE ) ; 
   static AliPHOSGetter * GetInstance() ; 
-
+  
   //=========== General information about run ==============
   const Int_t  MaxEvent() const    { return static_cast<Int_t>(gAlice->TreeE()->GetEntries()) ; }
   const Int_t  EventNumber() const { return static_cast<Int_t>(gAlice->GetEvNumber()) ; }
@@ -81,7 +81,7 @@ class AliPHOSGetter : public TObject {
   //========== PHOSGeometry and PHOS ============= 
   const AliPHOS *         PHOS() ;  
   const AliPHOSGeometry * PHOSGeometry() ; 
-
+  
   //========== Methods to read something from file ==========
   void   Event(const Int_t event, const char * opt = "HSDRP") ;    
   void   Track(const Int_t itrack) ;
@@ -92,16 +92,16 @@ class AliPHOSGetter : public TObject {
   TFolder * Alarms() const { return dynamic_cast<TFolder*>(ReturnO("Alarms", 0)) ; }
   const TObjArray *  Alarms(const char * name ) const { return dynamic_cast<const TObjArray*>(ReturnO("Alarms", name)) ; }
   const TTask * QATasks(const char * name = 0) const { return ReturnT("QATasks", name) ; }
-
+  
   //-----------------now getter's data--------------------------------------
-
+  
   //=========== Primaries ============
   TTree *           TreeK(TString filename="") ; 
   TClonesArray *    Primaries(void) const { return dynamic_cast<TClonesArray*>(ReturnO("Primaries")) ; }
   const TParticle * Primary(Int_t index) const ;
   const Int_t       NPrimaries()const { return fNPrimaries; }
   const TParticle * Secondary(TParticle * p, Int_t index=1) const ;  
+  
   //=========== Hits =================
   TTree *               TreeH(TString filename="") ; 
   const TClonesArray *  Hits(void) { return dynamic_cast<const TClonesArray*>(ReturnO("Hits")) ; }
@@ -115,26 +115,24 @@ class AliPHOSGetter : public TObject {
   const AliPHOSSDigitizer *  SDigitizer(const char * name =0) const { 
     return (const AliPHOSSDigitizer *) ReturnT("SDigitizer", name) ;   // here static or dynamic cast does not work ! why ?
   }
-
+  
   //========== Digits ================
   TTree *                   TreeD(TString filename="") ; 
   TClonesArray *            Digits(const char * name = 0)const  { 
     return dynamic_cast<TClonesArray*>(ReturnO("Digits", name)) ;   }
-//const AliPHOSDigit *  Digit(Int_t index) { return static_cast<const AliPHOSDigit *>(Digits()->At(index)) ;} !!! why no such method ?
+  //const AliPHOSDigit *  Digit(Int_t index) { return static_cast<const AliPHOSDigit *>(Digits()->At(index)) ;} !!! why no such method ?
   const AliPHOSDigitizer *  Digitizer(const char * name = 0) const { 
     return (const AliPHOSDigitizer*)(ReturnT("Digitizer", name)) ;   }
   
   //========== RecPoints =============
-  //TTree *                    TreeR(TString filename="") ; !!! why no such method ? 
   TObjArray *                EmcRecPoints(const char * name = 0) {
     return dynamic_cast<TObjArray*>(ReturnO("EmcRecPoints", name)) ;   }
-//const AliPHOSEmcRecPoint *  EmcRecPoint(Int_t index) { return static_cast<const AliPHOSEmcRecPoint *>(EmcRecPoints()->At(index)) ;} !!! why no such method ?
+  //const AliPHOSEmcRecPoint *  EmcRecPoint(Int_t index) { return static_cast<const AliPHOSEmcRecPoint *>(EmcRecPoints()->At(index)) ;} !!! why no such method ?
   TObjArray *                CpvRecPoints(const char * name = 0) { 
     return dynamic_cast<TObjArray*>(ReturnO("CpvRecPoints", name)) ;   }    
-//const AliPHOSCpvRecPoint *  CpvRecPoint(Int_t index) { return static_cast<const AliPHOSCpvRecPoint *>(EmcCpvPoints()->At(index)) ;} !!! why no such method ?
   const AliPHOSClusterizer * Clusterizer (const char * name =0) const { 
     return (const AliPHOSClusterizer*)(ReturnT("Clusterizer", name)) ;   // here static or dynamic cast does not work ! why ?
-}
+  }
   
   //========== TrackSegments ==========
   TClonesArray * TrackSegments(const char * name = 0) { 
@@ -146,9 +144,8 @@ class AliPHOSGetter : public TObject {
   TClonesArray * RecParticles(const char * name = 0) { 
     return static_cast<TClonesArray*>(ReturnO("RecParticles", name)) ;   }
   const AliPHOSPID * PID(const char * name =0) const { 
-    return (const AliPHOSPID*)(ReturnT("PID", name)) ;  // here static or dynamic cast does not work ! why ?
- }
-
+    return (const AliPHOSPID*)(ReturnT("PID", name)) ; } // here static or dynamic cast does not work ! why ? 
+    
   //-----------------Auxiliary methods: cleaners-----------------
   void  RemoveTask(TString opt, TString name) const ;
   void  RemoveObjects(TString opt, TString name) const ;
@@ -254,5 +251,3 @@ private:
 };
 
 #endif // AliPHOSGETTER_H
-
-
index 18d3e71d93fec3336b1102ce426fc9cf4b48ea70..704809538b63338202ace406c418d51e4ef18f91 100644 (file)
@@ -76,7 +76,8 @@ ClassImp(AliPHOSSDigitizer)
 
            
 //____________________________________________________________________________ 
-  AliPHOSSDigitizer::AliPHOSSDigitizer():TTask("","") {
+  AliPHOSSDigitizer::AliPHOSSDigitizer():TTask("","") 
+{
   // ctor
   InitParameters() ;
   fDefaultInit = kTRUE ; 
@@ -168,6 +169,7 @@ void AliPHOSSDigitizer::InitParameters()
 void AliPHOSSDigitizer::Exec(Option_t *option) 
 { 
   // Collects all hits in the same active volume into digit
+
   if( strcmp(GetName(), "") == 0 )
     Init() ;
   
@@ -299,49 +301,6 @@ void AliPHOSSDigitizer::SetSDigitsBranch(const char * title )
   gime->PostSDigits( title, GetTitle()) ; 
 }
 
-// //__________________________________________________________________
-// void AliPHOSSDigitizer::SetSplitFile(const TString splitFileName) 
-// {
-//   // Diverts the SDigits in a file separate from the hits file
-  
-//   TDirectory * cwd = gDirectory ;
-  
-//   if ( !(gAlice->GetTreeSFileName() == splitFileName) ) {
-//     if (gAlice->GetTreeSFile() ) 
-//       gAlice->GetTreeSFile()->Close() ; 
-//   }
-  
-//   fSplitFile = gAlice->InitTreeFile("S",splitFileName.Data());
-//   fSplitFile->cd() ; 
-//   gAlice->Write(0, TObject::kOverwrite);
-  
-//   TTree *treeE  = gAlice->TreeE();
-//   if (!treeE) {
-//     cerr << "ERROR: AliPHOSSDigitizer::SetSPlitFile -> No TreeE found "<<endl;
-//     abort() ;
-//   }      
-  
-//   // copy TreeE
-//     AliHeader *header = new AliHeader();
-//     treeE->SetBranchAddress("Header", &header);
-//     treeE->SetBranchStatus("*",1);
-//     TTree *treeENew =  treeE->CloneTree();
-//     treeENew->Write(0, TObject::kOverwrite);
-  
-
-//   // copy AliceGeom
-//     TGeometry *AliceGeom = static_cast<TGeometry*>(cwd->Get("AliceGeom"));
-//     if (!AliceGeom) {
-//       cerr << "ERROR: AliPHOSSDigitizer::SetSPlitFile -> AliceGeom was not found in the input file "<<endl;
-//       abort() ;
-//     }
-//     AliceGeom->Write(0, TObject::kOverwrite);
-
-//   gAlice->MakeTree("S",fSplitFile);
-//   cwd->cd() ; 
-//   cout << "INFO: AliPHOSSDigitizer::SetSPlitMode -> SDigits will be stored in " << splitFileName.Data() << endl ; 
-
-// }
 
 //__________________________________________________________________
 void AliPHOSSDigitizer::Print(Option_t* option)const
@@ -355,6 +314,7 @@ void AliPHOSSDigitizer::Print(Option_t* option)const
   cout << "---------------------------------------------------"<<endl ;
   
 }
+
 //__________________________________________________________________
 Bool_t AliPHOSSDigitizer::operator==( AliPHOSSDigitizer const &sd )const
 {
@@ -366,7 +326,7 @@ Bool_t AliPHOSSDigitizer::operator==( AliPHOSSDigitizer const &sd )const
   else
     return kFALSE ;
 }
-//__________________________________________________________________
+
 //__________________________________________________________________
 void AliPHOSSDigitizer::PrintSDigits(Option_t * option)
 {
index 7b7343b319988a956ffbadb4e109e785b5c3c6a0..149369c0d775bb1b53055d78935fe92a5764e236 100644 (file)
@@ -16,8 +16,6 @@
 // --- ROOT system ---
 #include "TTask.h"
 #include "TString.h"
-class TFile ; 
-
 // --- Standard library ---
 
 // --- AliRoot header files ---
@@ -36,7 +34,6 @@ public:
   const Int_t    GetSDigitsInRun() const {return fSDigitsInRun ;}  
   virtual void Print(Option_t* option) const ;
   void SetSDigitsBranch(const char * title ) ;
-  //  void SetSplitFile(const TString splitFileName = "PHOS.SDigits.root") ;
   void UseHitsFrom(const char * filename) ;      
   Bool_t operator == (const AliPHOSSDigitizer & sd) const ;