-
- } else { // no new ESD cluster
- delete [] amplList;
- delete [] timeList;
- delete [] digiList;
- }
- } // cycle on clusters
- 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 [] newAbsIdList ;
+ delete [] newFracList ;
+ }
+ } // cycle on clusters
+
+ delete [] matchedTrack;
+
+ //Fill ESDCaloCluster with PID weights
+ AliEMCALPID *pid = new AliEMCALPID;
+ //pid->SetPrintInfo(kTRUE);
+ pid->SetReconstructor(kTRUE);
+ pid->RunPID(esd);
+ delete pid;
+
+ //Store EMCAL misalignment matrixes
+ FillMisalMatrixes(esd) ;
+
+}
+
+//==================================================================================
+void AliEMCALReconstructor::FillMisalMatrixes(AliESDEvent* esd)const{
+ //Store EMCAL matrixes in ESD Header
+
+ //Check, if matrixes was already stored
+ for(Int_t sm = 0 ; sm < fGeom->GetNumberOfSuperModules(); sm++){
+ if(esd->GetEMCALMatrix(sm)!=0)
+ return ;
+ }
+
+ //Create and store matrixes
+ if(!gGeoManager){
+ AliError("Can not store misal. matrixes: no gGeoManager! \n") ;
+ return ;
+ }
+ //Note, that owner of copied marixes will be header
+ const Int_t bufsize = 255;
+ char path[bufsize] ;
+ TGeoHMatrix * m = 0x0;
+ for(Int_t sm = 0; sm < fGeom->GetNumberOfSuperModules(); sm++){
+ snprintf(path,bufsize,"/ALIC_1/XEN1_1/SMOD_%d",sm+1) ; //In Geometry modules numbered 1,2,.,5
+ if(sm >= 10) snprintf(path,bufsize,"/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) ;
+ }
+ }
+}
+
+
+
+//__________________________________________________________________________
+void AliEMCALReconstructor::ReadDigitsArrayFromTree(TTree *digitsTree) const
+{
+ // See AliEMCALClusterizer::SetInput(TTree *digitsTree);
+ if(fgDigitsArr) {
+ // Clear previous digits
+ fgDigitsArr->Clear("C");
+ //delete fgDigitsArr;
+ }
+ // Read the digits from the input tree
+ TBranch *branch = digitsTree->GetBranch("EMCAL");
+ if (!branch) {
+ AliError("can't get the branch with the EMCAL digits !");
+ return;
+ }
+ fgDigitsArr = new TClonesArray("AliEMCALDigit",100);
+ branch->SetAddress(&fgDigitsArr);
+ branch->GetEntry(0);