#include "AliAnalysisManager.h"
#include "AliInputEventHandler.h"
#include "AliESDtrackCuts.h"
+#include "TGeoManager.h"
ClassImp(AliAnalysisTaskCaloFilter)
AliAnalysisTaskCaloFilter::AliAnalysisTaskCaloFilter():
AliAnalysisTaskSE(), //fCuts(0x0),
fCaloFilter(0), fCorrect(kFALSE),
- fEMCALGeo(0x0),fEMCALGeoName("EMCAL_FIRSTYEAR"),
+ fEMCALGeo(0x0),fEMCALGeoName("EMCAL_FIRSTYEARV1"),
fEMCALRecoUtils(new AliEMCALRecoUtils),
- fESDtrackCuts(0), fTrackMultEtaCut(0.9)
+ fESDtrackCuts(0), fTrackMultEtaCut(0.8),
+ fLoadEMCALMatrices(kFALSE), //fLoadPHOSMatrices(kFALSE),
+ fGeoMatrixSet(kFALSE)
{
// Default constructor
fESDtrackCuts = AliESDtrackCuts::GetStandardITSTPCTrackCuts2010();
+ for(Int_t i = 0; i < 10; i++) fEMCALMatrix[i] = 0 ;
+ //for(Int_t i = 0; i < 5 ; i++) fPHOSMatrix[i] = 0 ;
}
AliAnalysisTaskCaloFilter::AliAnalysisTaskCaloFilter(const char* name):
AliAnalysisTaskSE(name), //fCuts(0x0),
fCaloFilter(0), fCorrect(kFALSE),
- fEMCALGeo(0x0),fEMCALGeoName("EMCAL_FIRSTYEAR"),
+ fEMCALGeo(0x0),fEMCALGeoName("EMCAL_FIRSTYEARV1"),
fEMCALRecoUtils(new AliEMCALRecoUtils),
- fESDtrackCuts(0), fTrackMultEtaCut(0.9)
+ fESDtrackCuts(0), fTrackMultEtaCut(0.8),
+ fLoadEMCALMatrices(kFALSE), //fLoadPHOSMatrices(kFALSE),
+ fGeoMatrixSet(kFALSE)
{
// Constructor
fESDtrackCuts = AliESDtrackCuts::GetStandardITSTPCTrackCuts2010();
+ for(Int_t i = 0; i < 10; i++) fEMCALMatrix[i] = 0 ;
+ //for(Int_t i = 0; i < 5 ; i++) fPHOSMatrix[i] = 0 ;
}
if(fEMCALGeo) delete fEMCALGeo;
if(fEMCALRecoUtils) delete fEMCALRecoUtils;
if(fESDtrackCuts) delete fESDtrackCuts;
+
}
//__________________________________________________
for (Int_t itrack = 0; itrack < nTracks; itrack++) {////////////// track loop
AliVTrack * track = (AliVTrack*)InputEvent()->GetTrack(itrack) ; // retrieve track from esd
if(!fESDtrackCuts->AcceptTrack((AliESDtrack*)track)) continue;
- //Count the tracks in eta < 0.9
+ //Count the tracks in eta < 0.8
if(TMath::Abs(track->Eta())< fTrackMultEtaCut) trackMult++;
}
}
//If EMCAL, and requested, correct energy, position ...
//Need to do this in a separate loop before filling the ESDs because of the track matching recalculations
if(fCorrect && (fCaloFilter==kEMCAL || fCaloFilter==kBoth) ) {
+
+ if(!fGeoMatrixSet){
+ if(fLoadEMCALMatrices){
+ printf("AliAnalysisTaskCaloFilter::UserExec() - Load user defined geometry matrices\n");
+ for(Int_t mod=0; mod < (fEMCALGeo->GetEMCGeometry())->GetNumberOfSuperModules(); mod++){
+ if(fEMCALMatrix[mod]){
+ if(DebugLevel() > 1)
+ fEMCALMatrix[mod]->Print();
+ fEMCALGeo->SetMisalMatrix(fEMCALMatrix[mod],mod) ;
+ }
+ fGeoMatrixSet=kTRUE;
+ }//SM loop
+ }//Load matrices
+ else if(!gGeoManager){
+ printf("AliAnalysisTaskCaloFilter::UserExec() - Get geo matrices from data\n");
+ //Still not implemented in AOD, just a workaround to be able to work at least with ESDs
+ if(!strcmp(event->GetName(),"AliAODEvent")) {
+ if(DebugLevel() > 1)
+ printf("AliAnalysisTaskCaloFilter Use ideal geometry, values geometry matrix not kept in AODs.\n");
+ }//AOD
+ else {
+ if(DebugLevel() > 1) printf("AliAnalysisTaskCaloFilter Load Misaligned matrices. \n");
+ AliESDEvent* esd = dynamic_cast<AliESDEvent*>(event) ;
+ if(!esd) {
+ printf("AliAnalysisTaskCaloFilter::UserExec() - This event does not contain ESDs?");
+ return;
+ }
+ for(Int_t mod=0; mod < (fEMCALGeo->GetEMCGeometry())->GetNumberOfSuperModules(); mod++){
+ //if(DebugLevel() > 1)
+ esd->GetEMCALMatrix(mod)->Print();
+ if(esd->GetEMCALMatrix(mod)) fEMCALGeo->SetMisalMatrix(esd->GetEMCALMatrix(mod),mod) ;
+ }
+ fGeoMatrixSet=kTRUE;
+ }//ESD
+ }//Load matrices from Data
+ }//first event
+
+
//Cluster Loop
for (Int_t iClust=0; iClust<nCaloClus; ++iClust) {
// }
if(DebugLevel() > 2)
{
- printf("Filter, before : i %d, E %f, dispersion %f, m02 %f, m20 %f\n",iClust,cluster->E(),
- cluster->GetDispersion(),cluster->GetM02(),cluster->GetM20());
+ printf("Filter, before : i %d, E %f, dispersion %f, m02 %f, m20 %f, distToBad %f\n",iClust,cluster->E(),
+ cluster->GetDispersion(),cluster->GetM02(),cluster->GetM20(), cluster->GetDistanceToBadChannel());
cluster->GetPosition(position);
printf("Filter, before : i %d, x %f, y %f, z %f\n",cluster->GetID(), position[0], position[1], position[2]);
}
+ //Recalculate distance to bad channels, if new list of bad channels provided
+ fEMCALRecoUtils->RecalculateClusterDistanceToBadChannel(fEMCALGeo, event->GetEMCALCells(), cluster);
+
if(fEMCALRecoUtils->IsRecalibrationOn()) {
fEMCALRecoUtils->RecalibrateClusterEnergy(fEMCALGeo, cluster, event->GetEMCALCells());
fEMCALRecoUtils->RecalculateClusterShowerShapeParameters(fEMCALGeo, event->GetEMCALCells(),cluster);
fEMCALRecoUtils->RecalculateClusterPID(cluster);
}
+
cluster->SetE(fEMCALRecoUtils->CorrectClusterEnergyLinearity(cluster));
fEMCALRecoUtils->RecalculateClusterPosition(fEMCALGeo, event->GetEMCALCells(),cluster);
if(DebugLevel() > 2)
{
- printf("Filter, after : i %d, E %f, dispersion %f, m02 %f, m20 %f\n",cluster->GetID(),cluster->E(),
- cluster->GetDispersion(),cluster->GetM02(),cluster->GetM20());
+ printf("Filter, after : i %d, E %f, dispersion %f, m02 %f, m20 %f, distToBad %f\n",cluster->GetID(),cluster->E(),
+ cluster->GetDispersion(),cluster->GetM02(),cluster->GetM20(), cluster->GetDistanceToBadChannel());
cluster->GetPosition(position);
printf("Filter, after : i %d, x %f, y %f, z %f\n",cluster->GetID(), position[0], position[1], position[2]);
}
printf("TASK: AnalysisCaloFilter \n");
printf("\t Not only filter, correct Clusters? %d\n",fCorrect);
printf("\t Calorimeter Filtering Option ? %d\n",fCaloFilter);
+ //printf("\t Use handmade geo matrices? EMCAL %d, PHOS %d\n",fLoadEMCALMatrices, fLoadPHOSMatrices);
+ printf("\t Use handmade geo matrices? EMCAL %d, PHOS 0\n",fLoadEMCALMatrices);
}
void SetCaloFilter(Int_t calo) {fCaloFilter = calo;}
TString GetCaloFilter() const {return fCaloFilter;}
- void SetGeometryName(TString name) { fEMCALGeoName = name ; }
- TString GeometryName() const { return fEMCALGeoName ; }
+ void SetEMCALGeometryName(TString name) { fEMCALGeoName = name ; }
+ TString EMCALGeometryName() const { return fEMCALGeoName ; }
+
+ void SwitchOnLoadOwnEMCALGeometryMatrices() { fLoadEMCALMatrices = kTRUE ; }
+ void SwitchOffLoadOwnEMCALGeometryMatrices() { fLoadEMCALMatrices = kFALSE ; }
+ void SetEMCALGeometryMatrixInSM(TGeoHMatrix* m, Int_t i) { fEMCALMatrix[i] = m ; }
+
+ //void SwitchOnLoadOwnPHOSGeometryMatrices() { fLoadPHOSMatrices = kTRUE ; }
+ //void SwitchOffLoadOwnPHOSGeometryMatrices() { fLoadPHOSMatrices = kFALSE ; }
+ //void SetPHOSGeometryMatrixInSM(TGeoHMatrix* m, Int_t i) { fPHOSMatrix[i] = m ; }
void SetEMCALRecoUtils(AliEMCALRecoUtils * ru) {fEMCALRecoUtils = ru;}
AliEMCALRecoUtils* GetEMCALRecoUtils() const {return fEMCALRecoUtils;}
Float_t GetTrackMultiplicityEtaCut() const { return fTrackMultEtaCut ; }
void SetTrackMultiplicityEtaCut(Float_t eta) { fTrackMultEtaCut = eta ; }
-
void PrintInfo();
private:
AliESDtrackCuts *fESDtrackCuts ; // Track cut
Float_t fTrackMultEtaCut ; // Track multiplicity eta cut
+ Bool_t fLoadEMCALMatrices; // Matrices set from configuration, not get from geometry.root or from ESDs/AODs
+ TGeoHMatrix * fEMCALMatrix[10]; // Geometry matrices with alignments
+ //Bool_t fLoadPHOSMatrices; // Matrices set from configuration, not get from geometry.root or from ESDs/AODs
+ //TGeoHMatrix * fPHOSMatrix[5]; // Geometry matrices with alignments
+ Bool_t fGeoMatrixSet; // Set geometry matrices only once, for the first event.
- ClassDef(AliAnalysisTaskCaloFilter, 3); // Analysis task for standard ESD filtering
+ ClassDef(AliAnalysisTaskCaloFilter, 4); // Analysis task for standard ESD filtering
};
#endif
AliAnalysisTaskSE(name),fEMCALGeo(0x0),//fCalibData(0x0),
fEmin(0.5), fEmax(15.), fAsyCut(1.),fMinNCells(2), fGroupNCells(0),
fLogWeight(4.5), fSameSM(kFALSE), fOldAOD(kFALSE), fFilteredInput(kFALSE),
- fCorrectClusters(kFALSE), fEMCALGeoName("EMCAL_FIRSTYEAR"),
+ fCorrectClusters(kFALSE), fEMCALGeoName("EMCAL_FIRSTYEARV1"),
fRecoUtils(new AliEMCALRecoUtils),
fNbins(300), fMinBin(0.), fMaxBin(300.),fOutputContainer(0x0),
fHmgg(0x0), fHmggDifferentSM(0x0),
fHOpeningAngle(0x0), fHOpeningAngleDifferentSM(0x0),
fHIncidentAngle(0x0), fHIncidentAngleDifferentSM(0x0),
fHAsymmetry(0x0), fHAsymmetryDifferentSM(0x0),
- fhNEvents(0x0),fCuts(0x0)
+ fhNEvents(0x0),fCuts(0x0),fLoadMatrices(0)
{
//Named constructor which should be used.
fhTowerDecayPhotonHit[iSM] =0;
fhTowerDecayPhotonEnergy[iSM]=0;
fhTowerDecayPhotonAsymmetry[iSM]=0;
+ fMatrix[iSM] = 0x0;
}
DefineOutput(1, TList::Class());
}
//if(fCalibData) delete fCalibData;
- if(fEMCALGeo) delete fEMCALGeo;
-
- if(fRecoUtils) delete fRecoUtils ;
+ if(fEMCALGeo) delete fEMCALGeo ;
+ if(fRecoUtils) delete fRecoUtils ;
}
snprintf(onePar,buffersize, "Switchs: Remove Bad Channels? %d; Use filtered input? %d; Correct Clusters? %d, Analyze Old AODs? %d, Mass per channel same SM clusters? %d ",
fRecoUtils->IsBadChannelsRemovalSwitchedOn(),fFilteredInput,fCorrectClusters, fOldAOD, fSameSM) ;
fCuts->Add(new TObjString(onePar));
- snprintf(onePar,buffersize, "EMCAL Geometry name: < %s >",fEMCALGeoName.Data()) ;
+ snprintf(onePar,buffersize, "EMCAL Geometry name: < %s >, Load Matrices? %d",fEMCALGeoName.Data(),fLoadMatrices) ;
fCuts->Add(new TObjString(onePar));
// Post Data
//if(DebugLevel() > 1) printf("Run number: %d\n",runNum);
//Get the matrix with geometry information
- //Still not implemented in AOD, just a workaround to be able to work at least with ESDs
- if(!gGeoManager && fhNEvents->GetEntries()==1){
- printf("AliAnalysisTaskEMCALPi0CalibSelection::UserExec() - Get geo matrices from data\n");
- if(!strcmp(event->GetName(),"AliAODEvent")) {
+ if(fhNEvents->GetEntries()==1){
+ if(fLoadMatrices){
+ printf("AliAnalysisTaskEMCALPi0CalibSelection::UserExec() - Load user defined geometry matrices\n");
+ for(Int_t mod=0; mod < (fEMCALGeo->GetEMCGeometry())->GetNumberOfSuperModules(); mod++){
+ if(fMatrix[mod]){
+ if(DebugLevel() > 1)
+ fMatrix[mod]->Print();
+ fEMCALGeo->SetMisalMatrix(fMatrix[mod],mod) ;
+ }
+ }//SM loop
+ }//Load matrices
+ else if(!gGeoManager){
+ printf("AliAnalysisTaskEMCALPi0CalibSelection::UserExec() - Get geo matrices from data\n");
+ //Still not implemented in AOD, just a workaround to be able to work at least with ESDs
+ if(!strcmp(event->GetName(),"AliAODEvent")) {
if(DebugLevel() > 1)
printf("AliAnalysisTaskEMCALPi0CalibSelection Use ideal geometry, values geometry matrix not kept in AODs.\n");
- }//AOD
- else {
- if(DebugLevel() > 1) printf("AliAnalysisTaskEMCALPi0CalibSelection Load Misaligned matrices. \n");
+ }//AOD
+ else {
+ if(DebugLevel() > 1) printf("AliAnalysisTaskEMCALPi0CalibSelection Load Misaligned matrices. \n");
AliESDEvent* esd = dynamic_cast<AliESDEvent*>(event) ;
if(!esd) {
printf("AliAnalysisTaskEMCALPi0CalibSelection::UserExec() - This event does not contain ESDs?");
- return;
+ return;
}
for(Int_t mod=0; mod < (fEMCALGeo->GetEMCGeometry())->GetNumberOfSuperModules(); mod++){
- if(DebugLevel() > 1) esd->GetEMCALMatrix(mod)->Print();
+ //if(DebugLevel() > 1)
+ esd->GetEMCALMatrix(mod)->Print();
if(esd->GetEMCALMatrix(mod)) fEMCALGeo->SetMisalMatrix(esd->GetEMCALMatrix(mod),mod) ;
}
- }//ESD
+ }//ESD
+ }//Load matrices from Data
}//first event
if(DebugLevel() > 1) printf("AliAnalysisTaskEMCALPi0CalibSelection Will use fLogWeight %.3f .\n",fLogWeight);
Int_t iSupMod2 = -1;
Int_t iphi2 = -1;
Int_t ieta2 = -1;
-
+ Bool_t shared = kFALSE;
+
TLorentzVector p1;
TLorentzVector p2;
TLorentzVector p12;
//clu1.EvalEnergy();
//clu1.EvalAll(fLogWeight, fEMCALGeoName);
- fRecoUtils->GetMaxEnergyCell(fEMCALGeo, emCells,c1,absId1,iSupMod1,ieta1,iphi1);
+ fRecoUtils->GetMaxEnergyCell(fEMCALGeo, emCells,c1,absId1,iSupMod1,ieta1,iphi1,shared);
c1->GetMomentum(p1,v);
//newc1.GetMomentum(p1,v);
//clu2.EvalEnergy();
//clu2.EvalAll(fLogWeight,fEMCALGeoName);
- fRecoUtils->GetMaxEnergyCell(fEMCALGeo, emCells,c2,absId2,iSupMod2,ieta2,iphi2);
+ fRecoUtils->GetMaxEnergyCell(fEMCALGeo, emCells,c2,absId2,iSupMod2,ieta2,iphi2,shared);
c2->GetMomentum(p2,v);
//newc2.GetMomentum(p2,v);
p12 = p1+p2;
printf("Histograms: bins %d; energy range: %2.2f < E < %2.2f GeV\n",fNbins,fMinBin,fMaxBin) ;
printf("Switchs:\n \t Remove Bad Channels? %d; Use filtered input? %d; Correct Clusters? %d, \n \t Analyze Old AODs? %d, Mass per channel same SM clusters? %d\n",
fRecoUtils->IsBadChannelsRemovalSwitchedOn(),fFilteredInput,fCorrectClusters, fOldAOD, fSameSM) ;
- printf("EMCAL Geometry name: < %s >\n",fEMCALGeoName.Data()) ;
+ printf("EMCAL Geometry name: < %s >, Load Matrices %d\n",fEMCALGeoName.Data(), fLoadMatrices) ;
+ if(fLoadMatrices) {for(Int_t ism = 0; ism < 4; ism++) fMatrix[ism]->Print();}
}
void SwitchOnOldAODs() {fOldAOD = kTRUE ; }
void SwitchOffOldAODs() {fOldAOD = kFALSE ; }
- void SetGeometryName(TString name) { fEMCALGeoName = name ; }
- TString GeometryName() const { return fEMCALGeoName ; }
-
+ void SetGeometryName(TString name) { fEMCALGeoName = name ; }
+ TString GeometryName() const { return fEMCALGeoName ; }
+ void SwitchOnLoadOwnGeometryMatrices() { fLoadMatrices = kTRUE ; }
+ void SwitchOffLoadOwnGeometryMatrices() { fLoadMatrices = kFALSE ; }
+ void SetGeometryMatrixInSM(TGeoHMatrix* m, Int_t i) { fMatrix[i] = m ; }
+
void SetEMCALRecoUtils(AliEMCALRecoUtils * ru) {fRecoUtils = ru;}
AliEMCALRecoUtils* GetEMCALRecoUtils() const {return fRecoUtils;}
void UseFilteredEventAsInput() {fFilteredInput = kTRUE;}
void UseNormalEventAsInput() {fFilteredInput = kFALSE;}
+
void PrintInfo();
private:
TH2F* fhTowerDecayPhotonEnergy[4] ; //! Cells ordered in column/row for different module, accumulated energy in the tower by decay photons.
TH2F* fhTowerDecayPhotonAsymmetry[4] ; //! Cells ordered in column/row for different module, accumulated asymmetry in the tower by decay photons.
- TH1I* fhNEvents; //! Number of events counter histogram
- TList * fCuts ; //! List with analysis cuts
-
- ClassDef(AliAnalysisTaskEMCALPi0CalibSelection,10);
+ TH1I* fhNEvents; //! Number of events counter histogram
+ TList * fCuts ; //! List with analysis cuts
+ Bool_t fLoadMatrices; // Matrices set from configuration, not get from geometry.root or from ESDs/AODs
+ TGeoHMatrix * fMatrix[4]; // Geometry matrices with alignments
+
+ ClassDef(AliAnalysisTaskEMCALPi0CalibSelection,11);
};
if(fDataType==kESD && !fESDtrackCuts->AcceptTrack((AliESDtrack*)track)) continue;
+ // Track filter selection
+ //if (fTrackFilter) {
+ // selectInfo = fTrackFilter->IsSelected(esdTrack);
+ // if (!selectInfo && !(esd->GetPrimaryVertex())->UsesTrack(esdTrack->GetID())) continue;
+ // }
+
//Count the tracks in eta < 0.9
//printf("Eta %f cut %f\n",TMath::Abs(track->Eta()),fTrackMultEtaCut);
if(TMath::Abs(track->Eta())< fTrackMultEtaCut) fTrackMult++;
GetCaloUtils()->RecalculateClusterPID(clus);
}
+
+ //Recalculate distance to bad channels, if new list of bad channels provided
+ GetCaloUtils()->RecalculateClusterDistanceToBadChannel(GetEMCALCells(),clus);
//Correct non linearity
if(GetCaloUtils()->IsCorrectionOfClusterEnergyOn()){
//____________________________________________________________________________
AliCalorimeterUtils::AliCalorimeterUtils() :
TObject(), fDebug(0),
- fEMCALGeoName("EMCAL_FIRSTYEAR"),fPHOSGeoName("PHOSgeo"),
+ fEMCALGeoName("EMCAL_FIRSTYEARV1"),fPHOSGeoName("PHOSgeo"),
fEMCALGeo(0x0), fPHOSGeo(0x0),
fEMCALGeoMatrixSet(kFALSE), fPHOSGeoMatrixSet(kFALSE),
+ fLoadEMCALMatrices(kFALSE), fLoadPHOSMatrices(kFALSE),
fRemoveBadChannels(kFALSE),fPHOSBadChannelMap(0x0),
fNCellsFromPHOSBorder(0), fRecalibration(kFALSE),
fPHOSRecalibrationFactors(),
//Initialize parameters
InitParameters();
+ for(Int_t i = 0; i < 10; i++) fEMCALMatrix[i] = 0 ;
+ for(Int_t i = 0; i < 5 ; i++) fPHOSMatrix[i] = 0 ;
+
}
//_________________________________
void AliCalorimeterUtils::InitParameters()
{
//Initialize the parameters of the analysis.
- fEMCALGeoName = "EMCAL_FIRSTYEAR";
+ fEMCALGeoName = "EMCAL_FIRSTYEARV1";
fPHOSGeoName = "PHOSgeo";
if(gGeoManager) {// geoManager was set
//Set the calorimeters transformation matrices
//Get the EMCAL transformation geometry matrices from ESD
- if (!gGeoManager && fEMCALGeo && !fEMCALGeoMatrixSet) {
- if(fDebug > 1)
- printf(" AliCalorimeterUtils::SetGeometryTransformationMatrices() - Load EMCAL misalignment matrices. \n");
- if(!strcmp(inputEvent->GetName(),"AliESDEvent")) {
- for(Int_t mod=0; mod < (fEMCALGeo->GetEMCGeometry())->GetNumberOfSuperModules(); mod++){
- if(inputEvent->GetEMCALMatrix(mod)) {
- //printf("EMCAL: mod %d, matrix %p\n",mod, ((AliESDEvent*)inputEvent)->GetEMCALMatrix(mod));
- fEMCALGeo->SetMisalMatrix(inputEvent->GetEMCALMatrix(mod),mod) ;
- fEMCALGeoMatrixSet = kTRUE;//At least one, so good
- }
- }// loop over super modules
- }//ESD as input
- else {
- if(fDebug > 1)
- printf("AliCalorimeterUtils::SetGeometryTransformationMatrices() - Setting of EMCAL transformation matrixes for AODs not implemented yet. \n Import geometry.root file\n");
- }//AOD as input
+ if(!fEMCALGeoMatrixSet && fEMCALGeo){
+ if(fLoadEMCALMatrices){
+ printf("AliCalorimeterUtils::SetGeometryTransformationMatrices() - Load user defined geometry matrices\n");
+ for(Int_t mod=0; mod < (fEMCALGeo->GetEMCGeometry())->GetNumberOfSuperModules(); mod++){
+ if(fEMCALMatrix[mod]){
+ if(fDebug > 1)
+ fEMCALMatrix[mod]->Print();
+ fEMCALGeo->SetMisalMatrix(fEMCALMatrix[mod],mod) ;
+ }
+ }//SM loop
+ fEMCALGeoMatrixSet = kTRUE;//At least one, so good
+
+ }//Load matrices
+ else if (!gGeoManager) {
+ if(fDebug > 1)
+ printf(" AliCalorimeterUtils::SetGeometryTransformationMatrices() - Load EMCAL misalignment matrices. \n");
+ if(!strcmp(inputEvent->GetName(),"AliESDEvent")) {
+ for(Int_t mod=0; mod < (fEMCALGeo->GetEMCGeometry())->GetNumberOfSuperModules(); mod++){
+ if(inputEvent->GetEMCALMatrix(mod)) {
+ //printf("EMCAL: mod %d, matrix %p\n",mod, ((AliESDEvent*)inputEvent)->GetEMCALMatrix(mod));
+ fEMCALGeo->SetMisalMatrix(inputEvent->GetEMCALMatrix(mod),mod) ;
+ }
+ }// loop over super modules
+ fEMCALGeoMatrixSet = kTRUE;//At least one, so good
+
+ }//ESD as input
+ else {
+ if(fDebug > 1)
+ printf("AliCalorimeterUtils::SetGeometryTransformationMatrices() - Setting of EMCAL transformation matrixes for AODs not implemented yet. \n Import geometry.root file\n");
+ }//AOD as input
+ }//Get matrix from data
}//EMCAL geo && no geoManager
//Get the PHOS transformation geometry matrices from ESD
- if (!gGeoManager && fPHOSGeo && !fPHOSGeoMatrixSet) {
- if(fDebug > 1)
- printf(" AliCalorimeterUtils::SetGeometryTransformationMatrices() - Load PHOS misalignment matrices. \n");
+ if(!fPHOSGeoMatrixSet && fPHOSGeo){
+ if(fLoadPHOSMatrices){
+ printf("AliCalorimeterUtils::SetGeometryTransformationMatrices() - Load user defined geometry matrices\n");
+ for(Int_t mod=0; mod < 5; mod++){
+ if(fPHOSMatrix[mod]){
+ if(fDebug > 1)
+ fPHOSMatrix[mod]->Print();
+ fPHOSGeo->SetMisalMatrix(fPHOSMatrix[mod],mod) ;
+ }
+ }//SM loop
+ fPHOSGeoMatrixSet = kTRUE;//At least one, so good
+ }//Load matrices
+ else if (!gGeoManager) {
+ if(fDebug > 1)
+ printf(" AliCalorimeterUtils::SetGeometryTransformationMatrices() - Load PHOS misalignment matrices. \n");
if(!strcmp(inputEvent->GetName(),"AliESDEvent")) {
for(Int_t mod=0; mod < 5; mod++){
if(inputEvent->GetPHOSMatrix(mod)) {
//printf("PHOS: mod %d, matrix %p\n",mod, ((AliESDEvent*)inputEvent)->GetPHOSMatrix(mod));
fPHOSGeo->SetMisalMatrix(inputEvent->GetPHOSMatrix(mod),mod) ;
- fPHOSGeoMatrixSet = kTRUE; //At least one so good
}
- }// loop over modules
+ }// loop over modules
+ fPHOSGeoMatrixSet = kTRUE; //At least one so good
}//ESD as input
else {
if(fDebug > 1)
printf("AliCalorimeterUtils::SetGeometryTransformationMatrices() - Setting of EMCAL transformation matrixes for AODs not implemented yet. \n Import geometry.root file\n");
- }//AOD as input
+ }//AOD as input
+ }// get matrix from data
}//PHOS geo and geoManager was not set
-
+
}
//________________________________________________________________
void SetGeometryTransformationMatrices(AliVEvent* inputEvent) ;
+ void SwitchOnLoadOwnEMCALGeometryMatrices() { fLoadEMCALMatrices = kTRUE ; }
+ void SwitchOffLoadOwnEMCALGeometryMatrices() { fLoadEMCALMatrices = kFALSE ; }
+ void SetEMCALGeometryMatrixInSM(TGeoHMatrix* m, Int_t i) { fEMCALMatrix[i] = m ; }
+
+ void SwitchOnLoadOwnPHOSGeometryMatrices() { fLoadPHOSMatrices = kTRUE ; }
+ void SwitchOffLoadOwnPHOSGeometryMatrices() { fLoadPHOSMatrices = kFALSE ; }
+ void SetPHOSGeometryMatrixInSM(TGeoHMatrix* m, Int_t i) { fPHOSMatrix[i] = m ; }
+
// Bad channels
Bool_t IsBadChannelsRemovalSwitchedOn() const { return fRemoveBadChannels ; }
void SwitchOnBadChannelsRemoval () {fRemoveBadChannels = kTRUE ; fEMCALRecoUtils->SwitchOnBadChannelsRemoval(); InitPHOSBadChannelStatusMap();}
void RecalculateClusterShowerShapeParameters(AliVCaloCells* cells, AliVCluster* clu){
fEMCALRecoUtils->RecalculateClusterShowerShapeParameters((AliEMCALGeometry*)fEMCALGeo, cells, clu);
}
+
+ void RecalculateClusterDistanceToBadChannel(AliVCaloCells* cells, AliVCluster* clu){
+ fEMCALRecoUtils->RecalculateClusterDistanceToBadChannel((AliEMCALGeometry*)fEMCALGeo, cells, clu);
+ }
+
void RecalculateClusterPID(AliVCluster* clu) {fEMCALRecoUtils->RecalculateClusterPID(clu);}
//Track matching recalculation
AliPHOSGeoUtils * fPHOSGeo ; //! PHOS geometry pointer
Bool_t fEMCALGeoMatrixSet; // Check if the transformation matrix is set for EMCAL
Bool_t fPHOSGeoMatrixSet ; // Check if the transformation matrix is set for PHOS
+ Bool_t fLoadEMCALMatrices; // Matrices set from configuration, not get from geometry.root or from ESDs/AODs
+ TGeoHMatrix * fEMCALMatrix[10]; // Geometry matrices with alignments
+ Bool_t fLoadPHOSMatrices; // Matrices set from configuration, not get from geometry.root or from ESDs/AODs
+ TGeoHMatrix * fPHOSMatrix[5]; // Geometry matrices with alignments
Bool_t fRemoveBadChannels; // Check the channel status provided and remove clusters with bad channels
TObjArray * fPHOSBadChannelMap; // Array of histograms with map of bad channels, PHOS
Int_t fNCellsFromPHOSBorder; // Number of cells from PHOS border the cell with maximum amplitude has to be.
Bool_t fRecalibration; // Switch on or off the recalibration
TObjArray * fPHOSRecalibrationFactors; // Array of histograms with map of recalibration factors, PHOS
AliEMCALRecoUtils* fEMCALRecoUtils; // EMCAL utils for cluster rereconstruction
- Bool_t fRecalculatePosition; // Recalculate cluster position
- Bool_t fCorrectELinearity ; // Correct cluster energy linearity
- Bool_t fRecalculateMatching; // Recalculate cluster position
- Float_t fCutR; // dR cut on matching
- Float_t fCutZ; // dZ cut on matching
+ Bool_t fRecalculatePosition; // Recalculate cluster position
+ Bool_t fCorrectELinearity ; // Correct cluster energy linearity
+ Bool_t fRecalculateMatching; // Recalculate cluster position
+ Float_t fCutR; // dR cut on matching
+ Float_t fCutZ; // dZ cut on matching
- ClassDef(AliCalorimeterUtils,4)
+
+ ClassDef(AliCalorimeterUtils,5)
} ;