fCleanOutputStdAOD(kFALSE), fDeltaAODFileName("deltaAODPartCorr.root"),fFiredTriggerClassName(""),
fEMCALGeoName("EMCAL_COMPLETE"),fPHOSGeoName("PHOSgeo"),
fEMCALGeo(0x0), fPHOSGeo(0x0), fEMCALGeoMatrixSet(kFALSE), fPHOSGeoMatrixSet(kFALSE), fAnaLED(kFALSE),
- fRemoveBadChannels(kFALSE),fEMCALBadChannelMap(0),fPHOSBadChannelMap(0)
+ fRemoveBadChannels(kFALSE),fEMCALBadChannelMap(new TObjArray()),
+ fPHOSBadChannelMap(new TObjArray()), fTaskName("")
{
//Ctor
fEMCALGeo(new AliEMCALGeoUtils(*g.fEMCALGeo)), fPHOSGeo(new AliPHOSGeoUtils(*g.fPHOSGeo)),
fEMCALGeoMatrixSet(g.fEMCALGeoMatrixSet), fPHOSGeoMatrixSet(g.fPHOSGeoMatrixSet),
fAnaLED(g.fAnaLED), fRemoveBadChannels(g.fRemoveBadChannels),
- fEMCALBadChannelMap(),fPHOSBadChannelMap()
+ fEMCALBadChannelMap(new TObjArray(*g.fEMCALBadChannelMap)),
+ fPHOSBadChannelMap(new TObjArray(*g.fPHOSBadChannelMap)),
+ fTaskName(g.fTaskName)
{
// cpy ctor
}
if(fPHOSGeo) delete fPHOSGeo ;
if(fEMCALGeo) delete fEMCALGeo ;
- fEMCALBadChannelMap.Delete();
- fPHOSBadChannelMap. Delete();
+ if(fEMCALBadChannelMap) {
+ fEMCALBadChannelMap->Clear();
+ delete fEMCALBadChannelMap;
+ }
+ if(fPHOSBadChannelMap) {
+ fPHOSBadChannelMap->Clear();
+ delete fPHOSBadChannelMap;
+ }
+
+ //fEMCALBadChannelMap. Delete();
+ //fPHOSBadChannelMap. Delete();
}
if (!fRemoveBadChannels) return kFALSE;
+ if(calorimeter == "EMCAL" && !fEMCALBadChannelMap->GetEntries()) return kFALSE;
+ if(calorimeter == "PHOS" && !fPHOSBadChannelMap ->GetEntries()) return kFALSE;
+ printf("hello\n");
Int_t icol = -1;
Int_t irow = -1;
Int_t imod = -1;
if(calorimeter == "EMCAL"){
Int_t iTower = -1, iIphi = -1, iIeta = -1;
fEMCALGeo->GetCellIndex(cellList[iCell],imod,iTower,iIphi,iIeta);
+ if(fEMCALBadChannelMap->GetEntries() <= imod) continue;
fEMCALGeo->GetCellPhiEtaIndexInSModule(imod,iTower,iIphi, iIeta,irow,icol);
if(GetEMCALChannelStatus(imod, icol, irow))return kTRUE;
}
irow = relId[2];
icol = relId[3];
imod = relId[0]-1;
+ if(fPHOSBadChannelMap->GetEntries() <= imod)continue;
if(GetPHOSChannelStatus(imod, icol, irow)) return kTRUE;
}
else return kFALSE;
}// cell cluster loop
-
+ printf("hello 2\n");
return kFALSE;
}
}
else printf("AliCaloTrackReader::Init() - Second input not added, reader is not AOD\n");
}
+
+ //printf("TaskName in reader: %s\n",fTaskName.Data());
+ fEMCALBadChannelMap->SetName(Form("EMCALBadMap_%s",fTaskName.Data()));
+ fPHOSBadChannelMap->SetName(Form("PHOSBadMap_%s",fTaskName.Data()));
}
//_______________________________________________________________
void AliCaloTrackReader::InitParameters()
{
-
//Initialize the parameters of the analysis.
fDataType = kESD ;
fCTSPtMin = 0.2 ;
fAnaLED = kFALSE;
fRemoveBadChannels = kFALSE;
-
+}
+
+//________________________________________________________________
+void AliCaloTrackReader::InitEMCALBadChannelStatusMap(){
+ //Init EMCAL bad channels map
+ if(fDebug > 0 )printf("AliCaloTrackReader::InitEMCALBadChannelStatusMap()\n");
//In order to avoid rewriting the same histograms
Bool_t oldStatus = TH1::AddDirectoryStatus();
TH1::AddDirectory(kFALSE);
-
- for (int i = 0; i < 12; i++)
- fEMCALBadChannelMap.Add(new TH2I(Form("EMCALBadChannelMap_SM%d",i),Form("EMCALBadChannelMap_SM%d",i),
- 48, 0, 48, 24, 0, 24));
-
- for (int i = 0; i < 5; i++)
- fPHOSBadChannelMap.Add(new TH2I(Form("PHOSBadChannelMap_Mod%d",i),Form("PHOSBadChannelMap_Mod%d",i),
- 56, 0, 56, 64, 0, 64));
-
- fEMCALBadChannelMap.SetOwner(kTRUE);
- fPHOSBadChannelMap. SetOwner(kTRUE);
- fEMCALBadChannelMap.Compress();
- fPHOSBadChannelMap. Compress();
-
+
+ for (int i = 0; i < 12; i++) fEMCALBadChannelMap->Add(new TH2I(Form("EMCALBadChannelMap_SM%d_%s",i,fTaskName.Data()),Form("EMCALBadChannelMap_SM%d",i), 48, 0, 48, 24, 0, 24));
+
+ fEMCALBadChannelMap->SetOwner(kTRUE);
+ fEMCALBadChannelMap->Compress();
+
//In order to avoid rewriting the same histograms
- TH1::AddDirectory(oldStatus);
-
+ TH1::AddDirectory(oldStatus);
+}
+
+//________________________________________________________________
+void AliCaloTrackReader::InitPHOSBadChannelStatusMap(){
+ //Init PHOS bad channels map
+ if(fDebug > 0 )printf("AliCaloTrackReader::InitPHOSBadChannelStatusMap()\n");
+ //In order to avoid rewriting the same histograms
+ Bool_t oldStatus = TH1::AddDirectoryStatus();
+ TH1::AddDirectory(kFALSE);
+ for (int i = 0; i < 5; i++)fPHOSBadChannelMap->Add(new TH2I(Form("PHOSBadChannelMap_Mod%d_%s",i,fTaskName.Data()),Form("PHOSBadChannelMap_Mod%d",i), 56, 0, 56, 64, 0, 64));
+
+ fPHOSBadChannelMap->SetOwner(kTRUE);
+ fPHOSBadChannelMap->Compress();
+
+ //In order to avoid rewriting the same histograms
+ TH1::AddDirectory(oldStatus);
}
//________________________________________________________________
return;
printf("***** Print: %s %s ******\n", GetName(), GetTitle() ) ;
+ printf("Task name : %s\n", fTaskName.Data()) ;
printf("Data type : %d\n", fDataType) ;
printf("CTS Min pT : %2.1f GeV/c\n", fCTSPtMin) ;
printf("EMCAL Min pT : %2.1f GeV/c\n", fEMCALPtMin) ;
printf("Read Kine from, stack? %d, AOD ? %d \n", fReadStack, fReadAODMCParticles) ;
printf("Clean std AOD = %d\n", fCleanOutputStdAOD) ;
printf("Delta AOD File Name = %s\n", fDeltaAODFileName.Data()) ;
- printf("Rremove Clusters with bad channels? %d\n",fRemoveBadChannels);
+ printf("Remove Clusters with bad channels? %d\n",fRemoveBadChannels);
printf(" \n") ;
}
void SwitchOnBadChannelsRemoval() {fRemoveBadChannels = kTRUE ; }
void SwitchOffBadChannelsRemoval() {fRemoveBadChannels = kFALSE ; }
- Int_t GetEMCALChannelStatus(Int_t iSM , Int_t iCol, Int_t iRow) const { return (Int_t) ((TH2I*)fEMCALBadChannelMap[iSM])->GetBinContent(iCol,iRow);}
- Int_t GetPHOSChannelStatus (Int_t imod, Int_t iCol, Int_t iRow) const { return (Int_t) ((TH2I*)fPHOSBadChannelMap[imod])->GetBinContent(iCol,iRow);}
-
- void SetEMCALChannelStatus(Int_t iSM , Int_t iCol, Int_t iRow, Double_t c = 1) { ((TH2I*)fEMCALBadChannelMap[iSM])->SetBinContent(iCol,iRow,c);}
- void SetPHOSChannelStatus (Int_t imod, Int_t iCol, Int_t iRow, Double_t c = 1) { ((TH2I*)fPHOSBadChannelMap[imod])->SetBinContent(iCol,iRow,c);}
-
- TH2I * GetEMCALChannelStatusMap(Int_t iSM) const {return (TH2I*)fEMCALBadChannelMap[iSM];}
- TH2I * GetPHOSChannelStatusMap(Int_t imod) const {return (TH2I*)fPHOSBadChannelMap[imod];}
+ void InitEMCALBadChannelStatusMap() ;
+ void InitPHOSBadChannelStatusMap () ;
+
+ Int_t GetEMCALChannelStatus(Int_t iSM , Int_t iCol, Int_t iRow) const {
+ if(fEMCALBadChannelMap->GetEntries()>0) return (Int_t) ((TH2I*)fEMCALBadChannelMap->At(iSM))->GetBinContent(iCol,iRow);
+ else return -1;}
- void SetEMCALChannelStatusMap(TObjArray map) {fEMCALBadChannelMap = map;}
- void SetPHOSChannelStatusMap (TObjArray map) {fPHOSBadChannelMap = map;}
+ Int_t GetPHOSChannelStatus (Int_t imod, Int_t iCol, Int_t iRow) const {
+ if(fPHOSBadChannelMap->GetEntries()>0)return (Int_t) ((TH2I*)fPHOSBadChannelMap->At(imod))->GetBinContent(iCol,iRow);
+ else return -1;}
+
+ void SetEMCALChannelStatus(Int_t iSM , Int_t iCol, Int_t iRow, Double_t c = 1) {
+ if(!fEMCALBadChannelMap->GetEntries())InitEMCALBadChannelStatusMap() ;
+ ((TH2I*)fEMCALBadChannelMap->At(iSM))->SetBinContent(iCol,iRow,c);}
+
+ void SetPHOSChannelStatus (Int_t imod, Int_t iCol, Int_t iRow, Double_t c = 1) {
+ if(!fPHOSBadChannelMap->GetEntries()) InitPHOSBadChannelStatusMap() ;
+ ((TH2I*)fPHOSBadChannelMap->At(imod))->SetBinContent(iCol,iRow,c);}
+
+ TH2I * GetEMCALChannelStatusMap(Int_t iSM) const {return (TH2I*)fEMCALBadChannelMap->At(iSM);}
+ TH2I * GetPHOSChannelStatusMap(Int_t imod) const {return (TH2I*)fPHOSBadChannelMap->At(imod);}
+
+ void SetEMCALChannelStatusMap(TObjArray *map) {fEMCALBadChannelMap = map;}
+ void SetPHOSChannelStatusMap (TObjArray *map) {fPHOSBadChannelMap = map;}
Bool_t ClusterContainsBadChannel(TString calorimeter,UShort_t* cellList, Int_t nCells);
+ TString GetTaskName() const {return fTaskName;}
+ void SetTaskName(TString name) {fTaskName = name;}
+
protected:
Int_t fEventNumber; // Event number
TString fCurrentFileName; // Current file name under analysis
Bool_t fPHOSGeoMatrixSet ; // Check if the transformation matrix is set for PHOS
Bool_t fAnaLED; // Analyze LED data only.
Bool_t fRemoveBadChannels; // Check the channel status provided and remove clusters with bad channels
- TObjArray fEMCALBadChannelMap; //! Array of histograms with map of bad channels, EMCAL
- TObjArray fPHOSBadChannelMap; //! Array of histograms with map of bad channels, PHOS
+ TObjArray *fEMCALBadChannelMap; //! Array of histograms with map of bad channels, EMCAL
+ TObjArray *fPHOSBadChannelMap; //! Array of histograms with map of bad channels, PHOS
+ TString fTaskName; // Name of task that executes the analysis
- ClassDef(AliCaloTrackReader,12)
+ ClassDef(AliCaloTrackReader,13)
} ;