+ // variables for filling the TTree
+ Int_t iSM = 0; // SuperModule index
+ Int_t iCol = 0;
+ Int_t iRow = 0;
+ Int_t nCorr = 0;
+ Float_t correction[fgkMaxTimeBins] = {0};
+ // make sure it's really initialized correctly
+ memset(correction, 0, sizeof(correction)); // better safe than sorry
+
+ // declare the branches
+ treeCorr->Branch("iSM", &iSM, "iSM/I");
+ treeCorr->Branch("iCol", &iCol, "iCol/I");
+ treeCorr->Branch("iRow", &iRow, "iRow/I");
+ treeCorr->Branch("nCorr", &nCorr, "nCorr/I");
+ treeCorr->Branch("correction", &correction, "correction[nCorr]/F");
+
+ Int_t nAPDPerSM = AliEMCALGeoParams::fgkEMCALCols * AliEMCALGeoParams::fgkEMCALRows;
+
+ for (iSM = 0; iSM < fNSuperModule; iSM++) {
+ AliEMCALSuperModuleCalibTimeDepCorrection * t = (AliEMCALSuperModuleCalibTimeDepCorrection*) fSuperModuleData[iSM];
+
+ for (Int_t j=0; j<nAPDPerSM; j++) {
+ iCol = j / AliEMCALGeoParams::fgkEMCALRows;
+ iRow = j % AliEMCALGeoParams::fgkEMCALRows;
+
+ nCorr = t->GetCorrection(iCol,iRow)->GetSize();
+ if (nCorr > fgkMaxTimeBins) {
+ printf("AliEMCALCalibTimeDepCorrection::WriteRootInfo - too many correction/timebins %d kept\n", nCorr);
+ return;
+ }
+
+ if (swapSides) {
+ // C side, oriented differently than A side: swap is requested
+ iCol = AliEMCALGeoParams::fgkEMCALCols-1 - iCol;
+ iRow = AliEMCALGeoParams::fgkEMCALRows-1 - iRow;
+ }
+
+ for (Int_t k=0; k<nCorr; k++) {
+ correction[k] = t->GetCorrection(iCol,iRow)->At(k);
+ }
+
+ treeCorr->Fill();
+ }
+
+ } // i, SuperModule
+
+ treeGlob->Write();
+ treeCorr->Write();
+ destFile.Close();
+
+ return;
+}
+
+//____________________________________________________________________________
+AliEMCALCalibTimeDepCorrection::~AliEMCALCalibTimeDepCorrection()
+{
+ fSuperModuleData.Delete();
+}
+
+//____________________________________________________________________________
+AliEMCALSuperModuleCalibTimeDepCorrection * AliEMCALCalibTimeDepCorrection::GetSuperModuleCalibTimeDepCorrectionNum(Int_t supModIndex)const
+{