]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
This patch solves the problem encountered when posting tasks to the folder. What...
authorschutz <schutz@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 4 Jul 2002 08:06:36 +0000 (08:06 +0000)
committerschutz <schutz@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 4 Jul 2002 08:06:36 +0000 (08:06 +0000)
So everything is now back to normal

16 files changed:
EMCAL/AliEMCALDigitizer.cxx
EMCAL/AliEMCALDigitizer.h
EMCAL/AliEMCALGetter.cxx
EMCAL/AliEMCALSDigitizer.cxx
EMCAL/AliEMCALSDigitizer.h
PHOS/AliPHOSClusterizerv1.cxx
PHOS/AliPHOSClusterizerv1.h
PHOS/AliPHOSDigitizer.cxx
PHOS/AliPHOSDigitizer.h
PHOS/AliPHOSGetter.cxx
PHOS/AliPHOSPIDv1.cxx
PHOS/AliPHOSPIDv1.h
PHOS/AliPHOSSDigitizer.cxx
PHOS/AliPHOSSDigitizer.h
PHOS/AliPHOSTrackSegmentMakerv1.cxx
PHOS/AliPHOSTrackSegmentMakerv1.h

index 87e77fe7ab51430b573e9165b6a052d26b410162..9e3cf46d34aee556bf9566a0461a0d0d01745437 100644 (file)
@@ -88,6 +88,7 @@ ClassImp(AliEMCALDigitizer)
   // ctor
 
   InitParameters() ; 
+  fDefaultInit = kTRUE ; 
 
 }
 
@@ -100,6 +101,7 @@ AliEMCALDigitizer::AliEMCALDigitizer(const char *headerFile,const char *name)
   fSplitFile= 0 ; 
   InitParameters() ; 
   Init() ;
+  fDefaultInit = kFALSE ; 
 
 }
 
@@ -115,11 +117,11 @@ AliEMCALDigitizer::AliEMCALDigitizer(AliRunDigitizer * ard):AliDigitizer(ard)
   AliEMCALDigitizer::~AliEMCALDigitizer()
 {
   // dtor
-  // gime=0 if Digitizer created by default ctor (to get just the parameters)
-  AliEMCALGetter * gime = AliEMCALGetter::GetInstance() ; 
-
-  if (gime) {
+  // fDefaultInit = kTRUE if Digitizer created by default ctor (to get just the parameters)
+  
+  if (!fDefaultInit) {
+    AliEMCALGetter * gime = AliEMCALGetter::GetInstance() ; 
+    
     // remove the task from the folder list
     gime->RemoveTask("S",GetName()) ;
     gime->RemoveTask("D",GetName()) ;
index 100c3626cb7a4f9d92efde42d983bf937dac1e3c..f4e19c574ac0008e6f63ae32ee5d3c04fa416905 100644 (file)
@@ -80,6 +80,8 @@ private:
 
 private:
   
+  Bool_t fDefaultInit;      //! Says if the task was created by defaut ctor (only parameters are initialized)
+  // !!! the following is not necessary, it is in the folder !!!!!!!
   AliEMCALSDigitizer * fSDigitizer ; // ! SDigitizer to extract some sdigitizing parameters
   Int_t   fNinputs ;                // Number of input files
   Bool_t  fInitialized ;            // 
index 0b0ea662c735ce331ef8523aeecf16c9016ab5ad..0ba1fe70298c444f249ea51095a008b095675206 100644 (file)
@@ -570,13 +570,13 @@ TObject ** AliEMCALGetter::DigitizerRef(const char * name) const
 {  
   TTask * sd  = dynamic_cast<TTask*>(fTasksFolder->FindObject("Digitizer")) ; 
   if ( !sd ) {
-    cerr << "ERROR: AliEMCALGetter::Post DerRef -> Task //" << fTasksFolder << "/Digitizer not found!" << endl;
+    cerr << "ERROR: AliEMCALGetter::Post DerRef -> Task //" << fTasksFolder->GetName() << "/Digitizer not found!" << endl;
     abort();
   }        
 
   TTask * emcal = dynamic_cast<TTask*>(sd->GetListOfTasks()->FindObject("EMCAL")) ; 
   if ( !emcal )  {
-    cerr <<"ERROR: AliEMCALGetter::Post DerRef ->  //" << fTasksFolder << "/Digitizer/EMCAL" << endl;
+    cerr <<"ERROR: AliEMCALGetter::Post DerRef ->  //" << fTasksFolder->GetName() << "/Digitizer/EMCAL" << endl;
     abort();
   }        
 
@@ -733,13 +733,13 @@ TObject ** AliEMCALGetter::ClusterizerRef(const char * name) const
   TTask * tasks  = dynamic_cast<TTask*>(fTasksFolder->FindObject("Reconstructioner")) ; 
 
   if ( !tasks ) {
-    cerr << "ERROR: AliEMCALGetter::Post RerRef -> Task //" << fTasksFolder << "/Reconstructioner not found!" << endl;
+    cerr << "ERROR: AliEMCALGetter::Post RerRef -> Task //" << fTasksFolder->GetName() << "/Reconstructioner not found!" << endl;
     abort() ;
   }        
         
   TTask * emcal = dynamic_cast<TTask*>(tasks->GetListOfTasks()->FindObject("EMCAL")) ; 
   if ( !emcal )  {
-    cerr <<"WARNING: AliEMCALGetter::Post RerRef -> //" << fTasksFolder << "/Reconstructioner/EMCAL" << endl; 
+    cerr <<"WARNING: AliEMCALGetter::Post RerRef -> //" << fTasksFolder->GetName() << "/Reconstructioner/EMCAL" << endl; 
     abort() ; 
   }   
 
@@ -774,7 +774,7 @@ Bool_t AliEMCALGetter::PostClusterizer(const char * name) const
   TTask * tasks  = dynamic_cast<TTask*>(fTasksFolder->FindObject("Reconstructioner")) ; 
 
   if ( !tasks ) {
-    cerr << "ERROR: AliEMCALGetter::Post Rer -> Task//" << fTasksFolder << "/Reconstructioner not found!" << endl; 
+    cerr << "ERROR: AliEMCALGetter::Post Rer -> Task//" << fTasksFolder->GetName() << "/Reconstructioner not found!" << endl; 
     return kFALSE ;
   }        
   
@@ -915,7 +915,7 @@ Bool_t AliEMCALGetter::PostTrackSegmentMaker(const char * name) const
   if ( !emcal )  {
     if (fDebug) {
       cout <<"WARNING: AliEMCALGetter::Post Rer -> //" << fTasksFolder << "/Reconstructioner/EMCAL not found!" << endl; 
-      cout <<"INFO: AliEMCALGetter::Post Rer -> Adding //" << fTasksFolder << "/Reconstructioner/EMCAL" << endl;
+      cout <<"INFO: AliEMCALGetter::Post Rer -> Adding //" << fTasksFolder->GetName() << "/Reconstructioner/EMCAL" << endl;
     }
     emcal = new TTask("EMCAL", "") ; 
     tasks->Add(emcal) ; 
@@ -941,13 +941,13 @@ TObject ** AliEMCALGetter::TSMakerRef(const char * name) const
   TTask * tasks  = dynamic_cast<TTask*>(fTasksFolder->FindObject("Reconstructioner")) ; 
 
   if ( !tasks ) {
-    cerr << "ERROR: AliEMCALGetter::TSLakerRef TerRef -> Task //" << fTasksFolder << "/Reconstructioner not found!" << endl;
+    cerr << "ERROR: AliEMCALGetter::TSLakerRef TerRef -> Task //" << fTasksFolder->GetName() << "/Reconstructioner not found!" << endl;
     abort() ;
   }        
         
   TTask * emcal = dynamic_cast<TTask*>(tasks->GetListOfTasks()->FindObject("EMCAL")) ; 
   if ( !emcal )  {
-    cerr <<"WARNING: AliEMCALGetter::TSMakerRef TerRef -> //" << fTasksFolder << "/Reconstructioner/EMCAL not found!" << endl; 
+    cerr <<"WARNING: AliEMCALGetter::TSMakerRef TerRef -> //" << fTasksFolder->GetName() << "/Reconstructioner/EMCAL not found!" << endl; 
     abort() ; 
   }   
 
@@ -1039,15 +1039,15 @@ Bool_t AliEMCALGetter::PostPID(AliEMCALPID * pid) const
   TTask * tasks  = dynamic_cast<TTask*>(fTasksFolder->FindObject("Reconstructioner")) ; 
 
   if ( !tasks ) {
-    cerr << "ERROR: AliEMCALGetter::Post Per -> Task //" << fTasksFolder << "/Reconstructioner not found!" << endl;
+    cerr << "ERROR: AliEMCALGetter::Post Per -> Task //" << fTasksFolder->GetName() << "/Reconstructioner not found!" << endl;
     return kFALSE ;
   }        
   
   TTask * emcal = dynamic_cast<TTask*>(tasks->GetListOfTasks()->FindObject("EMCAL")) ; 
   if ( !emcal )  {
     if (fDebug) {
-      cout <<"WARNING: AliEMCALGetter::Post Per -> //" << fTasksFolder << "/Reconstructioner/EMCAL not found!" << endl; 
-      cout <<"INFO: AliEMCALGetter::Post Per -> Adding //" << fTasksFolder << "/Reconstructioner/EMCAL" << endl;
+      cout <<"WARNING: AliEMCALGetter::Post Per -> //" << fTasksFolder->GetName() << "/Reconstructioner/EMCAL not found!" << endl; 
+      cout <<"INFO: AliEMCALGetter::Post Per -> Adding //" << fTasksFolder->GetName() << "/Reconstructioner/EMCAL" << endl;
     }
     emcal = new TTask("EMCAL", "") ; 
     tasks->Add(emcal) ; 
@@ -1073,15 +1073,15 @@ Bool_t AliEMCALGetter::PostPID(const char * name) const
   TTask * tasks  = dynamic_cast<TTask*>(fTasksFolder->FindObject("Reconstructioner")) ; 
 
   if ( !tasks ) {
-    cerr << "ERROR: AliEMCALGetter::Post Per -> Task //" << fTasksFolder << "/Reconstructioner not found!" << endl;
+    cerr << "ERROR: AliEMCALGetter::Post Per -> Task //" << fTasksFolder->GetName() << "/Reconstructioner not found!" << endl;
     return kFALSE ;
   }        
   
   TTask * emcal = dynamic_cast<TTask*>(tasks->GetListOfTasks()->FindObject("EMCAL")) ; 
   if ( !emcal )  {
     if (fDebug) {
-      cout <<"WARNING: AliEMCALGetter::Post Per -> //" << fTasksFolder << "/Reconstructioner/EMCAL not found!" << endl; 
-      cout <<"INFO: AliEMCALGetter::Post Per -> Adding //" << fTasksFolder << "/Reconstructioner/EMCAL" << endl;
+      cout <<"WARNING: AliEMCALGetter::Post Per -> //" << fTasksFolder->GetName() << "/Reconstructioner/EMCAL not found!" << endl; 
+      cout <<"INFO: AliEMCALGetter::Post Per -> Adding //" << fTasksFolder->GetName() << "/Reconstructioner/EMCAL" << endl;
     }
     emcal = new TTask("EMCAL", "") ; 
     tasks->Add(emcal) ; 
@@ -1113,13 +1113,13 @@ TObject ** AliEMCALGetter::PIDRef(const char * name) const
   TTask * tasks  = dynamic_cast<TTask*>(fTasksFolder->FindObject("Reconstructioner")) ; 
 
   if ( !tasks ) {
-    cerr << "ERROR: AliEMCALGetter::PIDRef PerRef -> Task //" << fTasksFolder << "/Reconstructioner not found!" << endl;
+    cerr << "ERROR: AliEMCALGetter::PIDRef PerRef -> Task //" << fTasksFolder->GetName() << "/Reconstructioner not found!" << endl;
     abort() ;
   }        
         
   TTask * emcal = dynamic_cast<TTask*>(tasks->GetListOfTasks()->FindObject("EMCAL")) ; 
   if ( !emcal )  {
-    cerr <<"WARNING: AliEMCALGetter::PIDRef PerRef -> //" << fTasksFolder << "/ReconstructionerEMCAL not found!" << endl; 
+    cerr <<"WARNING: AliEMCALGetter::PIDRef PerRef -> //" << fTasksFolder->GetName() << "/ReconstructionerEMCAL not found!" << endl; 
     abort() ; 
   }   
   
@@ -1251,9 +1251,8 @@ void AliEMCALGetter::ReadTreeD()
   if(!Digitizer(fDigitsTitle))
     PostDigitizer(fDigitsTitle) ;
 
-  //!!!!!!!!!!!!!!!!!!!!!!!!!! Weird problem, the following line causes a seg fault
-  // digitizerbranch->SetAddress(DigitizerRef(fDigitsTitle)) ;
-  // digitizerbranch->GetEntry(0) ;
+  digitizerbranch->SetAddress(DigitizerRef(fDigitsTitle)) ;
+  digitizerbranch->GetEntry(0) ;
  
   
 }
@@ -1421,9 +1420,9 @@ void AliEMCALGetter::ReadTreeR()
   
   if(!Clusterizer(fRecPointsTitle) )
     PostClusterizer(fRecPointsTitle) ;
-  //!!!!!!!!!!!!!!!!!!!!!!!!!! Weird problem, the following line causes a seg fault
-  //clusterizerbranch->SetAddress(ClusterizerRef(fRecPointsTitle)) ;
-  //clusterizerbranch->GetEntry(0) ;
+  
+  clusterizerbranch->SetAddress(ClusterizerRef(fRecPointsTitle)) ;
+  clusterizerbranch->GetEntry(0) ;
  
   
   //------------------- TrackSegments ---------------------
@@ -1460,9 +1459,8 @@ void AliEMCALGetter::ReadTreeR()
 //   // Read and Post the TrackSegment Maker
 //   if(!TrackSegmentMaker(fTrackSegmentsTitle))
 //     PostTrackSegmentMaker(fTrackSegmentsTitle) ;
-     //!!!!!!!!!!!!!!!!!!!!!!!!!! Weird problem, the following line causes a seg fault
-//   //tsmakerbranch->SetAddress(TSMakerRef(fTrackSegmentsTitle)) ;
-//   //tsmakerbranch->GetEntry(0) ;
+//   tsmakerbranch->SetAddress(TSMakerRef(fTrackSegmentsTitle)) ;
+//   tsmakerbranch->GetEntry(0) ;
   
   
 //   //------------ RecParticles ----------------------------
@@ -1499,9 +1497,8 @@ void AliEMCALGetter::ReadTreeR()
 //   // Read and Post the PID
 //   if(!PID(fRecParticlesTitle))
 //     PostPID(fRecParticlesTitle) ;
-      //!!!!!!!!!!!!!!!!!!!!!!!!!! Weird problem, the following line causes a seg fault
-//   //pidbranch->SetAddress(PIDRef(fRecParticlesTitle)) ;
-//   //pidbranch->GetEntry(0) ;
+//   pidbranch->SetAddress(PIDRef(fRecParticlesTitle)) ;
+//   pidbranch->GetEntry(0) ;
   
   
 }
@@ -1586,9 +1583,8 @@ void AliEMCALGetter::ReadTreeS(Int_t event)
     if(!SDigitizer(sdname) ) 
       PostSDigitizer(fSDigitsTitle,folder->GetName()) ;
 
-    //!!!!!!!!!!!!!!!!!!!!!!!!!! Weird problem, the following line causes a seg fault
-    // sdigitizerBranch->SetAddress(SDigitizerRef(sdname)) ;
-    // sdigitizerBranch->GetEntry(0) ;
+    sdigitizerBranch->SetAddress(SDigitizerRef(sdname)) ;
+    sdigitizerBranch->GetEntry(0) ;
     
   }    
   
index 25d63b502c8df91968834696c6ff2b3879d2b2e0..d56cc71770bd96def6035de48574b6e286b74011 100644 (file)
@@ -76,6 +76,7 @@ ClassImp(AliEMCALSDigitizer)
 {
   // ctor
   InitParameters() ; 
+  fDefaultInit = kTRUE ; 
 }
 
 //____________________________________________________________________________ 
@@ -84,17 +85,18 @@ AliEMCALSDigitizer::AliEMCALSDigitizer(const char* headerFile, const char *sDigi
   // ctor
   InitParameters() ; 
   Init();
+  fDefaultInit = kFALSE ; 
 }
 
 //____________________________________________________________________________ 
 AliEMCALSDigitizer::~AliEMCALSDigitizer()
 {
   // dtor
-  // gime=0 if Digitizer created by default ctor (to get just the parameters)
-  AliEMCALGetter * gime = AliEMCALGetter::GetInstance() ; 
-
-  if (gime) {
+  // fDefaultInit = kTRUE if SDigitizer created by default ctor (to get just the parameters)
+  
+  if (!fDefaultInit) {
+    AliEMCALGetter * gime = AliEMCALGetter::GetInstance() ; 
+    
     // remove the task from the folder list
     gime->RemoveTask("S",GetName()) ;
     
index d703dfd8eb706b136c401d406e78f8e7446ff263..32faa5d469e3d2ed797b950e2b8fa59df2e52bdc 100644 (file)
@@ -61,6 +61,7 @@ private:
   // should be calculated independently for each layer as : 
   // LightYield*LightCollectionEfficiency*LightAttenuation*APDPhotoElectronEfficiency*APDGain
 
+  Bool_t fDefaultInit;      //! Says if the task was created by defaut ctor (only parameters are initialized)
   Int_t   fNevents ;        // Number of events to digitize
   Float_t fTowerPrimThreshold ;  // To store primary in Tower if Elos > threshold
   Float_t fPreShowerPrimThreshold ;  // To store primary if Pre Shower Elos > threshold
index 56252f2ebd0e9e12c6a15f7633f99fca5f0f8f62..8d20768ccfb2492baa7883700fa66d9e6676e1de 100644 (file)
@@ -90,6 +90,7 @@ ClassImp(AliPHOSClusterizerv1)
   // default ctor (to be used mainly by Streamer)
   
   InitParameters() ; 
+  fDefaultInit = kTRUE ; 
 }
 
 //____________________________________________________________________________
@@ -105,6 +106,7 @@ AliPHOSClusterizerv1::AliPHOSClusterizerv1(const char* headerFile,const char* na
   else
     fFrom = from ; 
   Init() ;
+  fDefaultInit = kFALSE ; 
 
 }
 
@@ -112,13 +114,13 @@ AliPHOSClusterizerv1::AliPHOSClusterizerv1(const char* headerFile,const char* na
   AliPHOSClusterizerv1::~AliPHOSClusterizerv1()
 {
   // dtor
-  // gime=0 if Clusterizer created by default ctor (to get just the parameters)
+  // fDefaultInit = kTRUE if Clusterizer created by default ctor (to get just the parameters)
 
  
-  AliPHOSGetter * gime = AliPHOSGetter::GetInstance() ; 
-  
-  if (gime) {
-    // remove the task from the folder list
+  if (!fDefaultInit) {
+    AliPHOSGetter * gime = AliPHOSGetter::GetInstance() ; 
+    
+  // remove the task from the folder list
     gime->RemoveTask("C",GetName()) ;
     
     // remove the data from the folder list
index ea131853e0dcf05cbf9d19bca627ce7b40e6779b..ca9a4712fec1186356602d6e0f2944138e2acb45 100644 (file)
@@ -99,6 +99,7 @@ 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
index 43350461f74eb3ef1f5284974ec8eb4a654d2922..2c5071af6e66bf739ab9c53f70e11a196e3d9a0e 100644 (file)
@@ -89,6 +89,7 @@ ClassImp(AliPHOSDigitizer)
   // ctor
 
   InitParameters() ; 
+  fDefaultInit = kTRUE ; 
 }
 
 //____________________________________________________________________________ 
@@ -101,6 +102,7 @@ AliPHOSDigitizer::AliPHOSDigitizer(const char *headerFile,const char * name)
   fSplitFile= 0 ; 
   InitParameters() ; 
   Init() ;
+  fDefaultInit = kFALSE ; 
   
 }
 
@@ -111,18 +113,18 @@ AliPHOSDigitizer::AliPHOSDigitizer(AliRunDigitizer * ard):AliDigitizer(ard)
   SetTitle("aliroot") ;
   SetName("Default") ;
   InitParameters() ; 
-  
+  fDefaultInit = kTRUE ; 
 }
 
 //____________________________________________________________________________ 
   AliPHOSDigitizer::~AliPHOSDigitizer()
 {
   // dtor
-  // gime=0 if Digitizer created by default ctor (to get just the parameters)
+  // fDefaultInit = kTRUE if Digitizer created by default ctor (to get just the parameters)
   
- AliPHOSGetter * gime = AliPHOSGetter::GetInstance() ; 
- if (gime) {
+  if (!fDefaultInit) {
+    AliPHOSGetter * gime = AliPHOSGetter::GetInstance() ; 
+    
    // remove the task from the folder list
    gime->RemoveTask("S",GetName()) ;
    gime->RemoveTask("D",GetName()) ;
@@ -170,7 +172,7 @@ void AliPHOSDigitizer::Digitize(const Int_t event)
   digits->Expand(nCPV) ;
 
   // get first the sdigitizer from the tasks list (must have same name as the digitizer)
-  const AliPHOSSDigitizer * sDigitizer = new AliPHOSSDigitizer() ; //gime->SDigitizer(GetName()); 
+  const AliPHOSSDigitizer * sDigitizer = gime->SDigitizer(GetName()); 
   if ( !sDigitizer) {
     cerr << "ERROR: AliPHOSDigitizer::Digitize -> SDigitizer with name " << GetName() << " not found " << endl ; 
     abort() ; 
@@ -654,7 +656,7 @@ void AliPHOSDigitizer::Print(Option_t* option)const {
     cout << "------------------- "<< GetName() << " -------------" << endl ;
     cout << "Digitizing sDigits from file(s): " <<endl ;
     
-     TCollection * folderslist = ((TFolder*)gROOT->FindObjectAny("Folders/RunMC/Event/Data/PHOS/SDigits"))->GetListOfFolders() ; 
+    TCollection * folderslist = ((TFolder*)gROOT->FindObjectAny("Folders/RunMC/Event/Data/SDigits/PHOS"))->GetListOfFolders() ; 
     TIter next(folderslist) ; 
     TFolder * folder = 0 ; 
     
index e96a222dfd0bf68ed086ea821e3cdcaf7725afdd..3d82c3d810e5de54f12eeb11295fa1b375dfb693 100644 (file)
@@ -94,6 +94,7 @@ private:
 
 private:
 
+  Bool_t  fDefaultInit;             //! Says if the task was created by defaut ctor (only parameters are initialized)
   Int_t   fEmcCrystals ;            // Number of EMC crystalls in the given geometry
 
   Float_t fPinNoise ;               // Electronics noise in EMC
index bb00188540723910eb7b90702ffc0eb1277bf6a2..d0d23b0018539b66cde32e1cf5a5885752b8ea87 100644 (file)
@@ -326,8 +326,8 @@ Bool_t AliPHOSGetter::PostPrimaries(void) const
   TFolder * primariesFolder = dynamic_cast<TFolder*>(fPrimariesFolder->FindObject("Primaries")) ; 
   if ( !primariesFolder ) {
     if (fDebug) {
-      cout << "WARNING: AliPHOSGetter::Post Primaries -> Folder //" << fPrimariesFolder << "/Primaries/ not found!" << endl;
-      cout << "INFO:    AliPHOSGetter::Post Primaries -> Adding Folder //" << fPrimariesFolder << "/Primaries/"  << endl;
+      cout << "WARNING: AliPHOSGetter::Post Primaries -> Folder //" << fPrimariesFolder->GetName() << "/Primaries/ not found!" << endl;
+      cout << "INFO:    AliPHOSGetter::Post Primaries -> Adding Folder //" << fPrimariesFolder->GetName() << "/Primaries/"  << endl;
     }
     primariesFolder = fPrimariesFolder->AddFolder("Primaries", "Primaries particles from TreeK") ; 
   }    
@@ -707,12 +707,6 @@ TObject** AliPHOSGetter::DigitizerRef(const char * name) const
 
   TTask * task = dynamic_cast<TTask*>(phos->GetListOfTasks()->FindObject(name)) ; 
 
-  cout << "AliPHOSGetter::DigitizerRef " << task->GetName() << endl ; 
-  cout << "AliPHOSGetter::DigitizerRef " << phos->GetName() << endl ; 
-  cout << "AliPHOSGetter::DigitizerRef " << task->GetListOfTasks() << endl ; 
-  cout << "AliPHOSGetter::DigitizerRef " << task->GetListOfTasks()->GetObjectRef(task) << endl ; 
-
-
   return phos->GetListOfTasks()->GetObjectRef(task) ;
 
 }
@@ -946,7 +940,7 @@ Bool_t AliPHOSGetter::PostTrackSegments(const char * name) const
   
   if ( !phosFolder ) {
     if (fDebug) {
-      cout << "WARNING: AliPHOSGetter::Post TS -> Folder //" << fRecoFolder << "/PHOS/ not found!" << endl;
+      cout << "WARNING: AliPHOSGetter::Post TS -> Folder //" << fRecoFolder->GetName() << "/PHOS/ not found!" << endl;
       cout << "INFO:    AliPHOSGetter::Post TS -> Adding Folder //" << fRecoFolder->GetName() << "/PHOS" << endl;
     }
     phosFolder = fRecoFolder->AddFolder("PHOS", "Reconstructed data from PHOS") ;  
@@ -955,7 +949,7 @@ Bool_t AliPHOSGetter::PostTrackSegments(const char * name) const
   TFolder * phosTSFolder  = dynamic_cast<TFolder*>(phosFolder->FindObject("TrackSegments")) ;
   if ( !phosTSFolder ) {
     if (fDebug) {
-      cout << "WARNING: AliPHOSGetter::Post TS -> Folder//" << fRecoFolder->GetName() << "/PHOS/TrackSegments/ not found!" << endl; 
+      cout << "WARNING: AliPHOSGetter::Post TS -> Folder //" << fRecoFolder->GetName() << "/PHOS/TrackSegments/ not found!" << endl; 
       cout << "INFO:    AliPHOSGetter::Post TS -> Adding Folder //" << fRecoFolder->GetName() << "/PHOS/TrackSegments/" << endl; 
     }
     phosTSFolder = phosFolder->AddFolder("TrackSegments", "TrackSegments from PHOS") ;  
@@ -1038,15 +1032,15 @@ Bool_t AliPHOSGetter::PostTrackSegmentMaker(const char * name) const
   TTask * tasks  = dynamic_cast<TTask*>(fTasksFolder->FindObject("Reconstructioner")) ; 
   
   if ( !tasks ) {
-    cerr << "ERROR: AliPHOSGetter::Post Ter -> Task //" << fTasksFolder << "/Reconstructioner not found!" << endl;
+    cerr << "ERROR: AliPHOSGetter::Post Ter -> Task //" << fTasksFolder->GetName() << "/Reconstructioner not found!" << endl;
     return kFALSE ;
   }        
   
   TTask * phos = dynamic_cast<TTask*>(tasks->GetListOfTasks()->FindObject("PHOS")) ; 
   if ( !phos )  {
     if (fDebug) {
-      cout <<"WARNING: AliPHOSGetter::Post Rer -> //" << fTasksFolder << "/Reconstructioner/PHOS not found!" << endl; 
-      cout <<"INFO: AliPHOSGetter::Post Rer -> Adding //" << fTasksFolder << "/Reconstructioner/PHOS" << endl;
+      cout <<"WARNING: AliPHOSGetter::Post Ter -> //" << fTasksFolder->GetName() << "/Reconstructioner/PHOS not found!" << endl; 
+      cout <<"INFO: AliPHOSGetter::Post Ter -> Adding //" << fTasksFolder->GetName() << "/Reconstructioner/PHOS" << endl;
     }
     phos = new TTask("PHOS", "") ; 
     tasks->Add(phos) ; 
@@ -1055,6 +1049,7 @@ Bool_t AliPHOSGetter::PostTrackSegmentMaker(const char * name) const
   TList * l = phos->GetListOfTasks() ;   
   TIter it(l) ;
   TString tsn(name);
+  tsn+=":tsm" ; 
   TTask * task ;
   while((task = static_cast<TTask *>(it.Next()) )){
     TString taskname(task->GetName()) ;
@@ -1077,13 +1072,13 @@ TObject** AliPHOSGetter::TSMakerRef(const char * name) const
   TTask * tasks  = dynamic_cast<TTask*>(fTasksFolder->FindObject("Reconstructioner")) ; 
 
   if ( !tasks ) {
-    cerr << "ERROR: AliPHOSGetter::TSMakerRef -> Task //" << fTasksFolder << "/Reconstructioner not found!" << endl;
+    cerr << "ERROR: AliPHOSGetter::TSMakerRef -> Task //" << fTasksFolder->GetName() << "/Reconstructioner not found!" << endl;
     abort() ;
   }        
         
   TTask * phos = dynamic_cast<TTask*>(tasks->GetListOfTasks()->FindObject("PHOS")) ; 
   if ( !phos )  {
-    cerr <<"WARNING: AliPHOSGetter::TSMakerRef -> //" << fTasksFolder << "/Reconstructioner/PHOS not found!" << endl; 
+    cerr <<"WARNING: AliPHOSGetter::TSMakerRef -> //" << fTasksFolder->GetName() << "/Reconstructioner/PHOS not found!" << endl; 
     abort()  ; 
   }   
 
@@ -1104,8 +1099,8 @@ TObject** AliPHOSGetter::TSMakerRef(const char * name) const
   if(tsm) 
     return l->GetObjectRef(tsm) ;
   else {
-    cerr << "ERROR: AliPHOSGetter::TSMakerRef -> Task //" << fTasksFolder << "/Reconstructioner/TrackSegmentMarker name not found!" << endl;
-    abort() ;
+    cerr << "ERROR: AliPHOSGetter::TSMakerRef -> Task //" << fTasksFolder->GetName() << "/Reconstructioner/PHOS/TrackSegmentMarker/" << name << " not found!" << endl;
+    //abort() ;
   } 
 } 
 
@@ -1209,15 +1204,15 @@ Bool_t AliPHOSGetter::PostPID(const char * name) const
   TTask * tasks  = dynamic_cast<TTask*>(fTasksFolder->FindObject("Reconstructioner")) ; 
 
   if ( !tasks ) {
-    cerr << "ERROR: AliPHOSGetter::Post Per -> Task //" << fTasksFolder << "/Reconstructioner not found!" << endl;
+    cerr << "ERROR: AliPHOSGetter::Post Per -> Task //" << fTasksFolder->GetName() << "/Reconstructioner not found!" << endl;
     return kFALSE ;
   }        
   
   TTask * phos = dynamic_cast<TTask*>(tasks->GetListOfTasks()->FindObject("PHOS")) ; 
   if ( !phos )  {
     if (fDebug) {
-      cout <<"WARNING: AliPHOSGetter::Post Per -> //" << fTasksFolder << "/Reconstructioner/PHOS not found!" << endl; 
-      cout <<"INFO: AliPHOSGetter::Post Per -> Adding //" << fTasksFolder << "/Reconstructioner/PHOS" << endl;
+      cout <<"WARNING: AliPHOSGetter::Post Per -> //" << fTasksFolder->GetName() << "/Reconstructioner/PHOS not found!" << endl; 
+      cout <<"INFO: AliPHOSGetter::Post Per -> Adding //" << fTasksFolder->GetName() << "/Reconstructioner/PHOS" << endl;
     }
     phos = new TTask("PHOS", "") ; 
     tasks->Add(phos) ; 
@@ -1226,6 +1221,7 @@ Bool_t AliPHOSGetter::PostPID(const char * name) const
   TList * l = phos->GetListOfTasks() ;   
   TIter it(l) ;
   TString pidname(name) ;
+  pidname+=":pid" ;
   TTask * task ;
   while((task = static_cast<TTask *>(it.Next()) )){
     TString taskname(task->GetName()) ;
@@ -1247,13 +1243,13 @@ TObject** AliPHOSGetter::PIDRef(const char * name) const
   TTask * tasks  = dynamic_cast<TTask*>(fTasksFolder->FindObject("Reconstructioner")) ; 
 
   if ( !tasks ) {
-    cerr << "ERROR: AliPHOSGetter::PIDRef -> Task //" << fTasksFolder << "/Reconstructioner not found!" << endl;
+    cerr << "ERROR: AliPHOSGetter::PIDRef -> Task //" << fTasksFolder->GetName() << "/Reconstructioner not found!" << endl;
     abort() ;
   }        
         
   TTask * phos = dynamic_cast<TTask*>(tasks->GetListOfTasks()->FindObject("PHOS")) ; 
   if ( !phos )  {
-    cerr << "ERROR: AliPHOSGetter::PIDRef -> //" << fTasksFolder << "/Reconstructioner/PHOS not found!" << endl; 
+    cerr << "ERROR: AliPHOSGetter::PIDRef -> //" << fTasksFolder->GetName() << "/Reconstructioner/PHOS not found!" << endl; 
     abort()  ; 
   }   
   
@@ -1274,8 +1270,8 @@ TObject** AliPHOSGetter::PIDRef(const char * name) const
   if(pid) 
     return l->GetObjectRef(pid) ;
   else {
-    cerr << "ERROR: AliPHOSGetter::PIDRef -> Task //" << fTasksFolder << "/Reconstructioner/PID name not found!" << endl;
-    abort() ;
+    cerr << "ERROR: AliPHOSGetter::PIDRef -> Task //" << fTasksFolder->GetName() << "/Reconstructioner/PHOS/PID/" <<  name << " not found!" << endl;
+    //abort() ;
   }
   
 } 
@@ -1409,9 +1405,8 @@ Int_t AliPHOSGetter::ReadTreeD()
   // read  the Digitizer
   if(!Digitizer(fDigitsTitle))
     PostDigitizer(fDigitsTitle) ;
-    //!!!!!!!!!!!!!!!!!!!!!!!!!! Weird problem, the following line causes a seg fault
-  // digitizerbranch->SetAddress(DigitizerRef(fDigitsTitle)) ;
-  // digitizerbranch->GetEntry(0) ;
+  digitizerbranch->SetAddress(DigitizerRef(fDigitsTitle)) ;
+  digitizerbranch->GetEntry(0) ;
  
   return 0 ; 
 }
@@ -1569,17 +1564,18 @@ Int_t AliPHOSGetter::ReadTreeR(Bool_t any)
   } else { 
     if(!EmcRecPoints(fRecPointsTitle) ) 
       PostRecPoints(fRecPointsTitle) ;
+    
     emcbranch->SetAddress(EmcRecPointsRef(fRecPointsTitle)) ;
     emcbranch->GetEntry(0) ;
 
     cpvbranch->SetAddress(CpvRecPointsRef(fRecPointsTitle)) ; 
     cpvbranch->GetEntry(0) ;  
     
-    if(!Clusterizer(fRecPointsTitle) )
+    if(!Clusterizer(fRecPointsTitle) ) 
       PostClusterizer(fRecPointsTitle) ;
-    //!!!!!!!!!!!!!!!!!!!!!!!!!! Weird problem, the following line causes a seg fault
-    //clusterizerbranch->SetAddress(ClusterizerRef(fRecPointsTitle)) ;
-    //clusterizerbranch->GetEntry(0) ;
+    
+    clusterizerbranch->SetAddress(ClusterizerRef(fRecPointsTitle)) ;
+    clusterizerbranch->GetEntry(0) ;
   }
   
   //------------------- TrackSegments ---------------------
@@ -1613,9 +1609,8 @@ Int_t AliPHOSGetter::ReadTreeR(Bool_t any)
     // Read and Post the TrackSegment Maker
     if(!TrackSegmentMaker(fTrackSegmentsTitle))
       PostTrackSegmentMaker(fTrackSegmentsTitle) ;
-    //!!!!!!!!!!!!!!!!!!!!!!!!!! Weird problem, the following line causes a seg fault
-    //tsmakerbranch->SetAddress(TSMakerRef(fTrackSegmentsTitle)) ;
-    //tsmakerbranch->GetEntry(0) ;
+    tsmakerbranch->SetAddress(TSMakerRef(fTrackSegmentsTitle)) ;
+    tsmakerbranch->GetEntry(0) ;
  }
   
   
@@ -1650,9 +1645,8 @@ Int_t AliPHOSGetter::ReadTreeR(Bool_t any)
     // Read and Post the PID
     if(!PID(fRecParticlesTitle))
       PostPID(fRecParticlesTitle) ;
-    //!!!!!!!!!!!!!!!!!!!!!!!!!! Weird problem, the following line causes a seg fault
-    //pidbranch->SetAddress(PIDRef(fRecParticlesTitle)) ;
-    //pidbranch->GetEntry(0) ;
+    pidbranch->SetAddress(PIDRef(fRecParticlesTitle)) ;
+    pidbranch->GetEntry(0) ;
   }
   return 0 ; 
 }
@@ -1737,13 +1731,12 @@ Int_t AliPHOSGetter::ReadTreeS(Int_t event)
     sdname+=folder->GetName() ;
     if(!SDigitizer(sdname) ) 
       PostSDigitizer(fSDigitsTitle,folder->GetName()) ;
-    //!!!!!!!!!!!!!!!!!!!!!!!!!! Weird problem, the following line causes a seg fault
-    //  sdigitizerBranch->SetAddress(SDigitizerRef(sdname)) ;
-    // sdigitizerBranch->GetEntry(0) ;  
+    sdigitizerBranch->SetAddress(SDigitizerRef(sdname)) ;
+    sdigitizerBranch->GetEntry(0) ; 
   }    
   
-  // After SDigits have been read from all files, return to the first one
-  
+// After SDigits have been read from all files, return to the first one
+
   next.Reset();
   folder = static_cast<TFolder*>(next());
   if(folder){
@@ -1804,9 +1797,8 @@ void AliPHOSGetter::ReadTreeS(TTree * treeS, Int_t input)
   
   if(!SDigitizer(sdigitsBranch->GetTitle()) )
     PostSDigitizer(sdigitsBranch->GetTitle(),filename) ;
-  //!!!!!!!!!!!!!!!!!!!!!!!!!! Weird problem, the following line causes a seg fault
-  //   sdigitizerBranch->SetAddress(SDigitizerRef(sdname)) ;
-  //   sdigitizerBranch->GetEntry(0) ;
+  sdigitizerBranch->SetAddress(SDigitizerRef(sdname)) ;
+  sdigitizerBranch->GetEntry(0) ;
 }    
 
 
@@ -2003,12 +1995,12 @@ const TTask * AliPHOSGetter::ReturnT(TString what, TString name) const
   } else  if (what.CompareTo("Clusterizer") == 0){ 
     if ( name.IsNull() )
       name =  fRecPointsTitle ;
-    name.Append(":clusterizer") ;
+    name.Append(":clu") ;
   }
   else  if (what.CompareTo("TrackSegmentMaker") == 0){ 
     if ( name.IsNull() )
       name =  fTrackSegmentsTitle ;
-    name.Append(":tracksegmentmaker") ;
+    name.Append(":tsm") ;
   }
   else  if (what.CompareTo("PID") == 0){ 
     if ( name.IsNull() )
@@ -2029,7 +2021,7 @@ const TTask * AliPHOSGetter::ReturnT(TString what, TString name) const
   }
   
   if(fDebug)
-    cout << "WARNING: AliPHOSGetter::ReturnT -> Task " << search << "/" << name << " not found!" << endl ; 
+    cout << "WARNING: AliPHOSGetter::ReturnT -> Task " << search << "/PHOS" << name << " not found!" << endl ; 
   return 0 ;
 }
 
index 169170e0d4b24fb16be97746bd02d7f11973403f..09f2d3fa888536fbbfe292fe53ece75c4bbab53c 100644 (file)
@@ -105,6 +105,8 @@ AliPHOSPIDv1::AliPHOSPIDv1():AliPHOSPID()
   // default ctor
  
   InitParameters() ; 
+  fDefaultInit = kTRUE ; 
+
 }
 
 //____________________________________________________________________________
@@ -122,6 +124,7 @@ AliPHOSPIDv1::AliPHOSPIDv1(const char * headerFile,const char * name, const char
     fFrom = from ; 
 
   Init() ;
+  fDefaultInit = kFALSE ; 
 
 }
 
@@ -129,8 +132,7 @@ AliPHOSPIDv1::AliPHOSPIDv1(const char * headerFile,const char * name, const char
 AliPHOSPIDv1::~AliPHOSPIDv1()
 { 
   // dtor
-  // gime=0 if PID created by default ctor (to get just the parameters)
-  
+  // fDefaultInit = kTRUE if PID created by default ctor (to get just the parameters)
 
   delete [] fX ; // Principal input 
   delete [] fP ; // Principal components
@@ -139,26 +141,26 @@ AliPHOSPIDv1::~AliPHOSPIDv1()
   delete fParameters100 ; // Matrix of Parameters 
  
 
-  AliPHOSGetter * gime = AliPHOSGetter::GetInstance() ; 
-
-  if(gime){  
-  // remove the task from the folder list
-  gime->RemoveTask("P",GetName()) ;
-  TString name(GetName()) ; 
-  name.ReplaceAll("pid", "clu") ; 
-  gime->RemoveTask("C",name) ;
-  
-  // remove the data from the folder list
-  name = GetName() ; 
-  name.Remove(name.Index(":")) ; 
-  gime->RemoveObjects("RE", name) ; // EMCARecPoints
-  gime->RemoveObjects("RC", name) ; // CPVRecPoints
-  gime->RemoveObjects("T", name) ;  // TrackSegments
-  gime->RemoveObjects("P", name) ;  // RecParticles
-  
-  // Delete gAlice
-  gime->CloseFile() ; 
-  fSplitFile = 0 ; 
+  if (!fDefaultInit) {  
+    AliPHOSGetter * gime = AliPHOSGetter::GetInstance() ; 
+    // remove the task from the folder list
+    gime->RemoveTask("P",GetName()) ;
+    TString name(GetName()) ; 
+    name.ReplaceAll("pid", "clu") ; 
+    gime->RemoveTask("C",name) ;
+    
+    // remove the data from the folder list
+    name = GetName() ; 
+    name.Remove(name.Index(":")) ; 
+    gime->RemoveObjects("RE", name) ; // EMCARecPoints
+    gime->RemoveObjects("RC", name) ; // CPVRecPoints
+    gime->RemoveObjects("T", name) ;  // TrackSegments
+    gime->RemoveObjects("P", name) ;  // RecParticles
+    
+    // Delete gAlice
+    gime->CloseFile() ; 
+    
+    fSplitFile = 0 ; 
   }
 }
 
@@ -441,7 +443,7 @@ void  AliPHOSPIDv1::SetCpvtoEmcDistanceCut(Float_t Cluster_En, TString Eff_Pur,
   // "MEDIUM EFFICIENCY" "LOW EFFICIENCY" and 3 more options changing 
   // EFFICIENCY by PURITY)
 
-  
+
   Int_t eff_pur = GetEffPurOption(Eff_Pur);
   GetAnalysisParameters(Cluster_En) ;
   if((fClusterrcpv!= -1)&&(eff_pur != -1))
index dfd18a129a528e9de5ba2f07b6e9b34e7d28f0d7..55bde15bc7c5298b0b91b7d9e30a53cc3d32ec36 100644 (file)
@@ -102,6 +102,7 @@ public:
 
  private:
 
+  Bool_t                 fDefaultInit;        //! Says if the task was created by defaut ctor (only parameters are initialized)
   TString    fFileName5 ;     // File that contains the Principal file for analysis from 0.5 to 5 GeV
   TString    fFileName100 ;   // File that contains the Principal file for analysis from 0.5 to 100 GeV
   TString    fFileNamePar5 ;  // File that contains the parameters for analysis from 0.5 to 5 GeV
index a9b2f7675b052bb0cf564d52dece4ffcce2b0b33..4f4c8c828a7a4d3eef0d4706d8ca2ff826be40e7 100644 (file)
@@ -79,7 +79,8 @@ ClassImp(AliPHOSSDigitizer)
 //____________________________________________________________________________ 
   AliPHOSSDigitizer::AliPHOSSDigitizer():TTask("","") {
   // ctor
-  InitParameters() ; 
+  InitParameters() ;
+  fDefaultInit = kTRUE ; 
 }
 
 //____________________________________________________________________________ 
@@ -88,17 +89,19 @@ AliPHOSSDigitizer::AliPHOSSDigitizer(const char * headerFile, const char * sDigi
   // ctor
   InitParameters() ; 
   Init();
+  fDefaultInit = kFALSE ; 
 }
 
 //____________________________________________________________________________ 
 AliPHOSSDigitizer::~AliPHOSSDigitizer()
 {
   // dtor
-  // gime=0 if Digitizer created by default ctor (to get just the parameters)
+  // fDefaultInit = kTRUE if SDigitizer created by default ctor (to get just the parameters)
 
-  AliPHOSGetter * gime = AliPHOSGetter::GetInstance() ; 
   
-  if (gime) {
+  if (!fDefaultInit) {
+    AliPHOSGetter * gime = AliPHOSGetter::GetInstance() ; 
+    
     // remove the task from the folder list
     gime->RemoveTask("S",GetName()) ;
     
index 4cf48e218aaac680172c783b6f528547f1978cda..e1787ee36762f83ed8e68e0695ed47a9c04ae203 100644 (file)
@@ -49,6 +49,7 @@ private:
 
   Float_t fA ;              // Pedestal parameter
   Float_t fB ;              // Slope Digitizition parameters
+  Bool_t fDefaultInit;      //! Says if the task was created by defaut ctor (only parameters are initialized)
   Float_t fPrimThreshold ;  // To store primari if Elos > threshold
   Int_t fSDigitsInRun ;     //! Total number of sdigits in one run
   TFile * fSplitFile ;      //! file in which SDigits will eventually be stored
index 5079ea241a6cbf8e25d2be4338cc68924de1a030..907881e130a4bb4695987be03f6f479529d6f6aa 100644 (file)
@@ -82,6 +82,8 @@ ClassImp( AliPHOSTrackSegmentMakerv1)
   fFrom                     = "" ; 
 
   fTrackSegmentsInRun       = 0 ; 
+
+  fDefaultInit = kTRUE ; 
 }
 
 //____________________________________________________________________________
@@ -100,20 +102,22 @@ ClassImp( AliPHOSTrackSegmentMakerv1)
   else
     fFrom = from ; 
   Init() ;
-  
+
+  fDefaultInit = kFALSE ; 
+
 }
 
 //____________________________________________________________________________
  AliPHOSTrackSegmentMakerv1::~AliPHOSTrackSegmentMakerv1()
 { 
   // dtor
-  // gime=0 if TrackSegmentMaker created by default ctor (to get just the parameters)
-
-  delete fLinkUpArray  ;
+  // fDefaultInit = kTRUE if TrackSegmentMaker created by default ctor (to get just the parameters)
   
-  AliPHOSGetter * gime = AliPHOSGetter::GetInstance() ; 
-
-  if (gime) {
+  if (!fDefaultInit) {
+    delete fLinkUpArray  ;
+    
+    AliPHOSGetter * gime = AliPHOSGetter::GetInstance() ; 
+    
     // remove the task from the folder list
     gime->RemoveTask("T",GetName()) ;
     TString name(GetName()) ; 
index 796607e406afd840a72008e93534cbd01e7dd35a..ecfc23fff3d819960051cccceddde8e666de972f 100644 (file)
@@ -70,6 +70,7 @@ private:
 
 private:  
 
+  Bool_t  fDefaultInit;               //! Says if the task was created by defaut ctor (only parameters are initialized)
   TString fFrom ;                     // name of Recpoints 
   TString fHeaderFileName ;           // name of the file which contains gAlice, Tree headers etc.
   TString fRecPointsBranchTitle ;     // name of the file, where RecPoints branchs are stored