]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - EMCAL/AliEMCALReconstructor.cxx
This is a backward incompatible change in AliRoot. The following methods have been...
[u/mrichter/AliRoot.git] / EMCAL / AliEMCALReconstructor.cxx
index e4c41b88a46e6e47557cc79d724c3855433d4788..0f0493465a36f85bea9076bd4ef5d6844df7e6a4 100644 (file)
@@ -199,6 +199,11 @@ void AliEMCALReconstructor::Reconstruct(TTree* digitsTree, TTree* clustersTree)
 
   }
 
+  if (vzeroLoader) 
+  {
+         vzeroLoader->UnloadDigits();
+  }
+
   clustersTree->Fill();        
 
   delete trgData;
@@ -231,7 +236,8 @@ void AliEMCALReconstructor::ConvertDigits(AliRawReader* rawReader, TTree* digits
   fgRawUtils->SetNPedSamples(GetRecParam()->GetNPedSamples());
   fgRawUtils->SetRemoveBadChannels(GetRecParam()->GetRemoveBadChannels());
   fgRawUtils->SetFittingAlgorithm(GetRecParam()->GetFittingAlgorithm());
-
+  fgRawUtils->SetFALTROUsage(GetRecParam()->UseFALTRO());
+       
   fgRawUtils->Raw2Digits(rawReader,digitsArr,fPedestalData,digitsTrg);
 
   digitsTree->Fill();
@@ -256,7 +262,7 @@ void AliEMCALReconstructor::FillESD(TTree* digitsTree, TTree* clustersTree,
   //######################################################
   //#########Calculate trigger and set trigger info###########
   //######################################################
+  // Obsolete, to be changed with new trigger emulator when consensus is achieved about what is stored in ESDs.
   AliEMCALTrigger tr;
   //   tr.SetPatchSize(1);  // create 4x4 patches
   tr.SetSimulation(kFALSE); // Reconstruction mode
@@ -378,8 +384,6 @@ void AliEMCALReconstructor::FillESD(TTree* digitsTree, TTree* clustersTree,
 
   Int_t nClusters = clusters->GetEntries(),  nClustersNew=0;
   AliDebug(1,Form("%d clusters",nClusters));
-  esd->SetFirstEMCALCluster(esd->GetNumberOfCaloClusters()); // Put after Phos clusters 
-
 
   //######################################################
   //#######################TRACK MATCHING###############
@@ -403,7 +407,6 @@ void AliEMCALReconstructor::FillESD(TTree* digitsTree, TTree* clustersTree,
   //########################################
   //##############Fill CaloClusters#############
   //########################################
-  esd->SetNumberOfEMCALClusters(nClusters);
   for (Int_t iClust = 0 ; iClust < nClusters ; iClust++) {
     const AliEMCALRecPoint * clust = (const AliEMCALRecPoint*)clusters->At(iClust);
     //if(clust->GetClusterType()== AliESDCaloCluster::kEMCALClusterv1) nRP++; else nPC++;
@@ -487,24 +490,18 @@ void AliEMCALReconstructor::FillESD(TTree* digitsTree, TTree* clustersTree,
 
  delete [] matchedTrack;
 
- esd->SetNumberOfEMCALClusters(nClustersNew);
- //if(nClustersNew != nClusters)
- //printf(" ##### nClusters %i -> new %i ##### \n", nClusters, nClustersNew );
-
  //Fill ESDCaloCluster with PID weights
 AliEMCALPID *pid = new AliEMCALPID;
 //pid->SetPrintInfo(kTRUE);
 pid->SetReconstructor(kTRUE);
 pid->RunPID(esd);
 delete pid;
+ AliEMCALPID *pid = new AliEMCALPID;
+ //pid->SetPrintInfo(kTRUE);
+ pid->SetReconstructor(kTRUE);
+ pid->RunPID(esd);
+ delete pid;
   
 delete digits;
 delete clusters;
+ delete digits;
+ delete clusters;
   
-  // printf(" ## AliEMCALReconstructor::FillESD() is ended : ncl %i -> %i ### \n ",nClusters, nClustersNew); 
-
-  //Store EMCAL misalignment matrixes
-  FillMisalMatrixes(esd) ;
+ //Store EMCAL misalignment matrixes
+ FillMisalMatrixes(esd) ;
 
 }
 
@@ -513,7 +510,7 @@ void AliEMCALReconstructor::FillMisalMatrixes(AliESDEvent* esd)const{
        //Store EMCAL matrixes in ESD Header
        
        //Check, if matrixes was already stored
-       for(Int_t sm = 0 ; sm < 12; sm++){
+       for(Int_t sm = 0 ; sm < fGeom->GetNumberOfSuperModules(); sm++){
                if(esd->GetEMCALMatrix(sm)!=0)
                        return ;
        }
@@ -526,13 +523,18 @@ void AliEMCALReconstructor::FillMisalMatrixes(AliESDEvent* esd)const{
        //Note, that owner of copied marixes will be header
        char path[255] ;
        TGeoHMatrix * m = 0x0;
-       for(Int_t sm = 0; sm < 12; sm++){
+       for(Int_t sm = 0; sm < fGeom->GetNumberOfSuperModules(); sm++){
                sprintf(path,"/ALIC_1/XEN1_1/SMOD_%d",sm+1) ; //In Geometry modules numbered 1,2,.,5
                if(sm >= 10) sprintf(path,"/ALIC_1/XEN1_1/SM10_%d",sm-10+1) ;
                
                if (gGeoManager->CheckPath(path)){
+                       gGeoManager->cd(path);
                        m = gGeoManager->GetCurrentMatrix() ;
+//                     printf("================================================= \n");
+//                     printf("AliEMCALReconstructor::FixMisalMatrixes(), sm %d, \n",sm);
+//                     m->Print("");
                        esd->SetEMCALMatrix(new TGeoHMatrix(*m),sm) ;
+//                     printf("================================================= \n");
                }
                else{
                        esd->SetEMCALMatrix(NULL,sm) ;